// made for 3kh0.github.io
//
// Any attempt on stealing this code can lead to
// legal trouble! Just play the game!
//
// - Echo
function x() {
function h(t, e) {
(this.x = t || 0), (this.y = e || 0);
}
function t(t, e) {
(this.pos = t || new h()), (this.r = e || 0);
}
function n(t, e) {
(this.pos = t || new h()), (this.angle = 0), (this.offset = new h()), this.u(e || []);
}
function l(t, e, i) {
(this.pos = t || new h()), (this.w = e || 0), (this.h = i || 0);
}
function e() {
(this.b = this.a = null), (this.overlapN = new h()), (this.overlapV = new h()), this.clear();
}
function u(t, e, i) {
for (var n = Number.MAX_VALUE, s = -Number.MAX_VALUE, r = t.length, o = 0; o < r; o++) {
var a = t[o].f(e);
a < n && (n = a), s < a && (s = a);
}
(i[0] = n), (i[1] = s);
}
function c(t, e, i, n, s, r) {
var o = d.pop(),
a = d.pop();
return (
(e = (t = y.pop().c(e).sub(t)).f(s)),
u(i, s, o),
u(n, s, a),
(a[0] += e),
(a[1] += e),
o[0] > a[1] || a[0] > o[1]
? (y.push(t), d.push(o), d.push(a), !0)
: (r &&
(o[0] < a[0]
? ((r.aInB = !1), o[1] < a[1] ? ((i = o[1] - a[0]), (r.bInA = !1)) : (i = (i = o[1] - a[0]) < (n = a[1] - o[0]) ? i : -n))
: ((r.bInA = !1), o[1] > a[1] ? ((i = o[0] - a[1]), (r.aInB = !1)) : (i = (i = o[1] - a[0]) < (n = a[1] - o[0]) ? i : -n)),
(n = Math.abs(i)) < r.overlap && ((r.overlap = n), r.overlapN.c(s), i < 0 && r.overlapN.reverse())),
y.push(t),
d.push(o),
d.push(a),
!1)
);
}
function v(t, e) {
var i = t.g(),
n = e.f(t);
return n < 0 ? -1 : i < n ? 1 : 0;
}
function s(t, e, i) {
for (var n = y.pop().c(e.pos).sub(t.pos), s = e.r, r = s * s, o = t.calcPoints, a = o.length, h = y.pop(), l = y.pop(), u = 0; u < a; u++) {
var c = u === a - 1 ? 0 : u + 1,
d = 0 === u ? a - 1 : u - 1,
f = 0,
p = null;
h.c(t.edges[u]), l.c(n).sub(o[u]), i && l.g() > r && (i.aInB = !1);
var g = v(h, l);
if (-1 === g) {
if ((h.c(t.edges[d]), 1 === (g = v(h, (c = y.pop().c(n).sub(o[d])))))) {
if (s < (g = l.j())) return y.push(n), y.push(h), y.push(l), y.push(c), !1;
i && ((i.bInA = !1), (p = l.normalize()), (f = s - g));
}
y.push(c);
} else if (1 === g) {
if ((h.c(t.edges[c]), l.c(n).sub(o[c]), -1 === (g = v(h, l)))) {
if (s < (g = l.j())) return y.push(n), y.push(h), y.push(l), !1;
i && ((i.bInA = !1), (p = l.normalize()), (f = s - g));
}
} else {
if (((c = h.m().normalize()), (g = l.f(c)), (d = Math.abs(g)), 0 < g && s < d)) return y.push(n), y.push(c), y.push(l), !1;
i && ((p = c), (f = s - g), 0 <= g || f < 2 * s) && (i.bInA = !1);
}
p && i && Math.abs(f) < Math.abs(i.overlap) && ((i.overlap = f), i.overlapN.c(p));
}
return i && ((i.a = t), (i.b = e), i.overlapV.c(i.overlapN).scale(i.overlap)), y.push(n), y.push(h), y.push(l), !0;
}
function r(t, e, i) {
for (var n = t.calcPoints, s = n.length, r = e.calcPoints, o = r.length, a = 0; a < s; a++) if (c(t.pos, e.pos, n, r, t.normals[a], i)) return !1;
for (a = 0; a < o; a++) if (c(t.pos, e.pos, n, r, e.normals[a], i)) return !1;
return i && ((i.a = t), (i.b = e), i.overlapV.c(i.overlapN).scale(i.overlap)), !0;
}
var i = {};
(i.Vector = h),
((i.V = h).prototype.copy = h.prototype.c = function (t) {
return (this.x = t.x), (this.y = t.y), this;
}),
(h.prototype.clone = h.prototype.clone = function () {
return new h(this.x, this.y);
}),
(h.prototype.perp = h.prototype.m = function () {
var t = this.x;
return (this.x = this.y), (this.y = -t), this;
}),
(h.prototype.rotate = h.prototype.rotate = function (t) {
var e = this.x,
i = this.y;
return (this.x = e * Math.cos(t) - i * Math.sin(t)), (this.y = e * Math.sin(t) + i * Math.cos(t)), this;
}),
(h.prototype.reverse = h.prototype.reverse = function () {
return (this.x = -this.x), (this.y = -this.y), this;
}),
(h.prototype.normalize = h.prototype.normalize = function () {
var t = this.j();
return 0 < t && ((this.x /= t), (this.y /= t)), this;
}),
(h.prototype.add = h.prototype.add = function (t) {
return (this.x += t.x), (this.y += t.y), this;
}),
(h.prototype.sub = h.prototype.sub = function (t) {
return (this.x -= t.x), (this.y -= t.y), this;
}),
(h.prototype.scale = h.prototype.scale = function (t, e) {
return (this.x *= t), (this.y *= e || t), this;
}),
(h.prototype.project = h.prototype.o = function (t) {
var e = this.f(t) / t.g();
return (this.x = e * t.x), (this.y = e * t.y), this;
}),
(h.prototype.projectN = h.prototype.s = function (t) {
var e = this.f(t);
return (this.x = e * t.x), (this.y = e * t.y), this;
}),
(h.prototype.reflect = function (t) {
var e = this.x,
i = this.y;
return this.o(t).scale(2), (this.x -= e), (this.y -= i), this;
}),
(h.prototype.reflectN = function (t) {
var e = this.x,
i = this.y;
return this.s(t).scale(2), (this.x -= e), (this.y -= i), this;
}),
(h.prototype.dot = h.prototype.f = function (t) {
return this.x * t.x + this.y * t.y;
}),
(h.prototype.len2 = h.prototype.g = function () {
return this.f(this);
}),
(h.prototype.len = h.prototype.j = function () {
return Math.sqrt(this.g());
}),
((i.Circle = t).prototype.getAABB = function () {
var t = this.r;
return new l(this.pos.clone().sub(new h(t, t)), 2 * t, 2 * t).l();
}),
((i.Polygon = n).prototype.setPoints = n.prototype.u = function (t) {
if (!this.points || this.points.length !== t.length) {
var e,
i = (this.calcPoints = []),
n = (this.edges = []),
s = (this.normals = []);
for (e = 0; e < t.length; e++) i.push(new h()), n.push(new h()), s.push(new h());
}
return (this.points = t), this.i(), this;
}),
(n.prototype.setAngle = function (t) {
return (this.angle = t), this.i(), this;
}),
(n.prototype.setOffset = function (t) {
return (this.offset = t), this.i(), this;
}),
(n.prototype.rotate = n.prototype.rotate = function (t) {
for (var e = this.points, i = e.length, n = 0; n < i; n++) e[n].rotate(t);
return this.i(), this;
}),
(n.prototype.translate = n.prototype.translate = function (t, e) {
for (var i = this.points, n = i.length, s = 0; s < n; s++) (i[s].x += t), (i[s].y += e);
return this.i(), this;
}),
(n.prototype.i = function () {
var t,
e = this.calcPoints,
i = this.edges,
n = this.normals,
s = this.points,
r = this.offset,
o = this.angle,
a = s.length;
for (t = 0; t < a; t++) {
var h = e[t].c(s[t]);
(h.x += r.x), (h.y += r.y), 0 !== o && h.rotate(o);
}
for (t = 0; t < a; t++) (s = e[t]), (s = i[t].c(t < a - 1 ? e[t + 1] : e[0]).sub(s)), n[t].c(s).m().normalize();
}),
(n.prototype.getAABB = function () {
for (var t = this.calcPoints, e = t.length, i = t[0].x, n = t[0].y, s = t[0].x, r = t[0].y, o = 1; o < e; o++) {
var a = t[o];
a.x < i ? (i = a.x) : a.x > s && (s = a.x), a.y < n ? (n = a.y) : a.y > r && (r = a.y);
}
return new l(this.pos.clone().add(new h(i, n)), s - i, r - n).l();
}),
((i.Box = l).prototype.toPolygon = l.prototype.l = function () {
var t = this.pos,
e = this.w,
i = this.h;
return new n(new h(t.x, t.y), [new h(), new h(e, 0), new h(e, i), new h(0, i)]);
}),
((i.Response = e).prototype.clear = e.prototype.clear = function () {
return (this.bInA = this.aInB = !0), (this.overlap = Number.MAX_VALUE), this;
});
for (var y = [], o = 0; o < 10; o++) y.push(new h());
var d = [];
for (o = 0; o < 5; o++) d.push([]);
var a = new e(),
f = new l(new h(), 1e-6, 1e-6).l();
return (
(i.isSeparatingAxis = c),
(i.pointInCircle = function (t, e) {
var i = y.pop().c(t).sub(e.pos),
n = e.r * e.r,
s = i.g();
return y.push(i), s <= n;
}),
(i.pointInPolygon = function (t, e) {
f.pos.c(t), a.clear();
var i = r(f, e, a);
return i && (i = a.aInB), i;
}),
(i.testCircleCircle = function (t, e, i) {
var n = y.pop().c(e.pos).sub(t.pos),
s = t.r + e.r,
r = n.g();
return s * s < r
? (y.push(n), !1)
: (i && ((r = Math.sqrt(r)), (i.a = t), (i.b = e), (i.overlap = s - r), i.overlapN.c(n.normalize()), i.overlapV.c(n).scale(i.overlap), (i.aInB = t.r <= e.r && r <= e.r - t.r), (i.bInA = e.r <= t.r && r <= t.r - e.r)),
y.push(n),
!0);
}),
(i.testPolygonCircle = s),
(i.testCirclePolygon = function (t, e, i) {
if ((t = s(e, t, i)) && i) {
e = i.a;
var n = i.aInB;
i.overlapN.reverse(), i.overlapV.reverse(), (i.a = i.b), (i.b = e), (i.aInB = i.bInA), (i.bInA = n);
}
return t;
}),
(i.testPolygonPolygon = r),
i
);
}
!(function (t, e) {
"object" == typeof exports && "undefined" != typeof module ? e(exports) : "function" == typeof define && define.amd ? define(["exports"], e) : e((t.h5SansAnalytics = t.h5SansAnalytics || {}));
})(this, function (t) {
"use strict";
var n = function (t, e) {
return (n =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);
})(t, e);
};
var e = (function (t) {
function e() {
return t.call(this) || this;
}
return (
(function (t, e) {
function i() {
this.constructor = t;
}
n(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
})(e, t),
e
);
})(
(function () {
function t() {
this.providers = [];
}
return (
(t.prototype.loadScript = function (e) {
this.providers.forEach(function (t) {
return t.loadScript(e);
});
}),
(t.prototype.create = function (e) {
this.providers.forEach(function (t) {
return t.create(e);
});
}),
(t.prototype.sendScreenView = function (e) {
this.providers.forEach(function (t) {
return t.sendScreenView(e);
});
}),
(t.prototype.sendEvent = function (e, i) {
this.providers.forEach(function (t) {
return t.sendEvent(e, i);
});
}),
(t.prototype.sendCustomEvent = function (e, i) {
this.providers.forEach(function (t) {
return t.sendCustomEvent(e, i);
});
}),
(t.prototype.sendGenericEvent = function (e, i, n) {
this.providers.forEach(function (t) {
return t.sendGenericEvent(e, i, n);
});
}),
(t.prototype.addProgressionEvent = function (e, i, n, s, r) {
this.providers.forEach(function (t) {
return t.addProgressionEvent(e, i, n, s, r);
});
}),
(t.prototype.addDesignEvent = function (e, i) {
this.providers.forEach(function (t) {
return t.addDesignEvent(e, i);
});
}),
t
);
})()
);
(t.DummyAnalyticsProvider = e), Object.defineProperty(t, "__esModule", { value: !0 });
}),
(function (t, e) {
"object" == typeof exports && "object" == typeof module ? (module.exports = e()) : "function" == typeof define && define.amd ? define("Phaser", [], e) : "object" == typeof exports ? (exports.Phaser = e()) : (t.Phaser = e());
})(this, function () {
return (
(n = {}),
(s.m = i = [
function (t, e) {
function r(t, e, i, n) {
for (var s in e)
if (e.hasOwnProperty(s)) {
var r =
((l = e),
(u = s),
(f = d = void 0),
(f = (c = i) ? l[u] : Object.getOwnPropertyDescriptor(l, u)),
!c && f.value && "object" == typeof f.value && (f = f.value),
!(!f || !(((d = f).get && "function" == typeof d.get) || (d.set && "function" == typeof d.set))) &&
(void 0 === f.enumerable && (f.enumerable = !0), void 0 === f.configurable && (f.configurable = !0), f));
if (!1 !== r) {
if (((o = (n || t).prototype), (a = s), (h = void 0), (h = Object.getOwnPropertyDescriptor(o, a)) && (h.value && "object" == typeof h.value && (h = h.value), !1 === h.configurable))) {
if (p.ignoreFinals) continue;
throw new Error("cannot override final property '" + s + "', set Class.ignoreFinals = true to skip");
}
Object.defineProperty(t.prototype, s, r);
} else t.prototype[s] = e[s];
}
var o, a, h, l, u, c, d, f;
}
function o(t, e) {
if (e) {
Array.isArray(e) || (e = [e]);
for (var i = 0; i < e.length; i++) r(t, e[i].prototype || e[i]);
}
}
function p(t) {
var e, i, n;
if ((t = t || {}).initialize) {
if ("function" != typeof t.initialize) throw new Error("initialize must be a function");
(n = t.initialize), delete t.initialize;
} else
n = t.Extends
? ((i = t.Extends),
function () {
i.apply(this, arguments);
})
: function () {};
t.Extends ? ((n.prototype = Object.create(t.Extends.prototype)), (n.prototype.constructor = n), (e = t.Extends), delete t.Extends) : (n.prototype.constructor = n);
var s = null;
return t.Mixins && ((s = t.Mixins), delete t.Mixins), o(n, s), r(n, t, !0, e), n;
}
(p.extend = r), (p.mixin = o), (p.ignoreFinals = !1), (t.exports = p);
},
function (t, e) {
t.exports = function () {};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = typeof t;
return t && "number" != n && "string" != n && t.hasOwnProperty(e) && void 0 !== t[e] ? t[e] : i;
};
},
function (t, e, i) {
var n = i(0),
s = i(124),
r = new n({
initialize: function (t, e) {
(this.x = 0), (this.y = 0), "object" == typeof t ? ((this.x = t.x || 0), (this.y = t.y || 0)) : (void 0 === e && (e = t), (this.x = t || 0), (this.y = e || 0));
},
clone: function () {
return new r(this.x, this.y);
},
copy: function (t) {
return (this.x = t.x || 0), (this.y = t.y || 0), this;
},
setFromObject: function (t) {
return (this.x = t.x || 0), (this.y = t.y || 0), this;
},
set: function (t, e) {
return void 0 === e && (e = t), (this.x = t), (this.y = e), this;
},
setTo: function (t, e) {
return this.set(t, e);
},
setToPolar: function (t, e) {
return null == e && (e = 1), (this.x = Math.cos(t) * e), (this.y = Math.sin(t) * e), this;
},
equals: function (t) {
return this.x === t.x && this.y === t.y;
},
fuzzyEquals: function (t, e) {
return s(this.x, t.x, e) && s(this.y, t.y, e);
},
angle: function () {
var t = Math.atan2(this.y, this.x);
return t < 0 && (t += 2 * Math.PI), t;
},
setAngle: function (t) {
return this.setToPolar(t, this.length());
},
add: function (t) {
return (this.x += t.x), (this.y += t.y), this;
},
subtract: function (t) {
return (this.x -= t.x), (this.y -= t.y), this;
},
multiply: function (t) {
return (this.x *= t.x), (this.y *= t.y), this;
},
scale: function (t) {
return isFinite(t) ? ((this.x *= t), (this.y *= t)) : ((this.x = 0), (this.y = 0)), this;
},
divide: function (t) {
return (this.x /= t.x), (this.y /= t.y), this;
},
negate: function () {
return (this.x = -this.x), (this.y = -this.y), this;
},
distance: function (t) {
var e = t.x - this.x,
i = t.y - this.y;
return Math.sqrt(e * e + i * i);
},
distanceSq: function (t) {
var e = t.x - this.x,
i = t.y - this.y;
return e * e + i * i;
},
length: function () {
var t = this.x,
e = this.y;
return Math.sqrt(t * t + e * e);
},
setLength: function (t) {
return this.normalize().scale(t);
},
lengthSq: function () {
var t = this.x,
e = this.y;
return t * t + e * e;
},
normalize: function () {
var t = this.x,
e = this.y,
i = t * t + e * e;
return 0 < i && ((i = 1 / Math.sqrt(i)), (this.x = t * i), (this.y = e * i)), this;
},
normalizeRightHand: function () {
var t = this.x;
return (this.x = -1 * this.y), (this.y = t), this;
},
normalizeLeftHand: function () {
var t = this.x;
return (this.x = this.y), (this.y = -1 * t), this;
},
dot: function (t) {
return this.x * t.x + this.y * t.y;
},
cross: function (t) {
return this.x * t.y - this.y * t.x;
},
lerp: function (t, e) {
void 0 === e && (e = 0);
var i = this.x,
n = this.y;
return (this.x = i + e * (t.x - i)), (this.y = n + e * (t.y - n)), this;
},
transformMat3: function (t) {
var e = this.x,
i = this.y,
n = t.val;
return (this.x = n[0] * e + n[3] * i + n[6]), (this.y = n[1] * e + n[4] * i + n[7]), this;
},
transformMat4: function (t) {
var e = this.x,
i = this.y,
n = t.val;
return (this.x = n[0] * e + n[4] * i + n[12]), (this.y = n[1] * e + n[5] * i + n[13]), this;
},
reset: function () {
return (this.x = 0), (this.y = 0), this;
},
limit: function (t) {
var e = this.length();
return e && t < e && this.scale(t / e), this;
},
reflect: function (t) {
return (t = t.clone().normalize()), this.subtract(t.scale(2 * this.dot(t)));
},
mirror: function (t) {
return this.reflect(t).negate();
},
rotate: function (t) {
var e = Math.cos(t),
i = Math.sin(t);
return this.set(e * this.x - i * this.y, i * this.x + e * this.y);
},
});
(r.ZERO = new r()), (r.RIGHT = new r(1, 0)), (r.LEFT = new r(-1, 0)), (r.UP = new r(0, -1)), (r.DOWN = new r(0, 1)), (r.ONE = new r(1, 1)), (t.exports = r);
},
function (t, e, i) {
var n = i(0),
s = i(56),
r = new n({
initialize: function (t, e) {
void 0 === t && (t = 0), void 0 === e && (e = t), (this.type = s.POINT), (this.x = t), (this.y = e);
},
setTo: function (t, e) {
return void 0 === t && (t = 0), void 0 === e && (e = t), (this.x = t), (this.y = e), this;
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(0),
s = i(24),
r = i(20),
o = new n({
initialize: function (t) {
(this.scene = t), (this.systems = t.sys), (this.events = t.sys.events), this.displayList, this.updateList, this.events.once(r.BOOT, this.boot, this), this.events.on(r.START, this.start, this);
},
boot: function () {
(this.displayList = this.systems.displayList), (this.updateList = this.systems.updateList), this.events.once(r.DESTROY, this.destroy, this);
},
start: function () {
this.events.once(r.SHUTDOWN, this.shutdown, this);
},
existing: function (t) {
return (t.renderCanvas || t.renderWebGL) && this.displayList.add(t), t.preUpdate && this.updateList.add(t), t;
},
shutdown: function () {
this.events.off(r.SHUTDOWN, this.shutdown, this);
},
destroy: function () {
this.shutdown(), this.events.off(r.START, this.start, this), (this.scene = null), (this.systems = null), (this.events = null), (this.displayList = null), (this.updateList = null);
},
});
(o.register = function (t, e) {
o.prototype.hasOwnProperty(t) || (o.prototype[t] = e);
}),
(o.remove = function (t) {
o.prototype.hasOwnProperty(t) && delete o.prototype[t];
}),
s.register("GameObjectFactory", o, "add"),
(t.exports = o);
},
function (t, e) {
t.exports = function (t, e, i) {
if (t && "number" != typeof t) {
if (t.hasOwnProperty(e)) return t[e];
if (-1 === e.indexOf(".")) return i;
for (var n = e.split("."), s = t, r = i, o = 0; o < n.length; o++) {
if (!s.hasOwnProperty(n[o])) {
r = i;
break;
}
(r = s[n[o]]), (s = s[n[o]]);
}
return r;
}
return i;
};
},
function (t, e) {
t.exports = function (t) {
if ("object" != typeof t || t.nodeType || t === t.window) return !1;
try {
if (t.constructor && !{}.hasOwnProperty.call(t.constructor.prototype, "isPrototypeOf")) return !1;
} catch (t) {
return !1;
}
return !0;
};
},
function (t, e) {
var i = {},
n = {
install: function (t) {
for (var e in i) t[e] = i[e];
},
register: function (t, e) {
i[t] = e;
},
destroy: function () {
i = {};
},
};
t.exports = n;
},
function (t, e, i) {
"use strict";
var n = Object.prototype.hasOwnProperty,
f = "~";
function s() {}
function a(t, e, i) {
(this.fn = t), (this.context = e), (this.once = i || !1);
}
function r(t, e, i, n, s) {
if ("function" != typeof i) throw new TypeError("The listener must be a function");
var r = new a(i, n || t, s),
o = f ? f + e : e;
return t._events[o] ? (t._events[o].fn ? (t._events[o] = [t._events[o], r]) : t._events[o].push(r)) : ((t._events[o] = r), t._eventsCount++), t;
}
function l(t, e) {
0 == --t._eventsCount ? (t._events = new s()) : delete t._events[e];
}
function o() {
(this._events = new s()), (this._eventsCount = 0);
}
Object.create && ((s.prototype = Object.create(null)), new s().__proto__ || (f = !1)),
(o.prototype.eventNames = function () {
var t,
e,
i = [];
if (0 === this._eventsCount) return i;
for (e in (t = this._events)) n.call(t, e) && i.push(f ? e.slice(1) : e);
return Object.getOwnPropertySymbols ? i.concat(Object.getOwnPropertySymbols(t)) : i;
}),
(o.prototype.listeners = function (t) {
var e = f ? f + t : t,
i = this._events[e];
if (!i) return [];
if (i.fn) return [i.fn];
for (var n = 0, s = i.length, r = new Array(s); n < s; n++) r[n] = i[n].fn;
return r;
}),
(o.prototype.listenerCount = function (t) {
var e = f ? f + t : t,
i = this._events[e];
return i ? (i.fn ? 1 : i.length) : 0;
}),
(o.prototype.emit = function (t, e, i, n, s, r) {
var o = f ? f + t : t;
if (!this._events[o]) return !1;
var a,
h = this._events[o],
l = arguments.length;
if (h.fn) {
switch ((h.once && this.removeListener(t, h.fn, void 0, !0), l)) {
case 1:
return h.fn.call(h.context), !0;
case 2:
return h.fn.call(h.context, e), !0;
case 3:
return h.fn.call(h.context, e, i), !0;
case 4:
return h.fn.call(h.context, e, i, n), !0;
case 5:
return h.fn.call(h.context, e, i, n, s), !0;
case 6:
return h.fn.call(h.context, e, i, n, s, r), !0;
}
for (d = 1, a = new Array(l - 1); d < l; d++) a[d - 1] = arguments[d];
h.fn.apply(h.context, a);
} else
for (var u, c = h.length, d = 0; d < c; d++)
switch ((h[d].once && this.removeListener(t, h[d].fn, void 0, !0), l)) {
case 1:
h[d].fn.call(h[d].context);
break;
case 2:
h[d].fn.call(h[d].context, e);
break;
case 3:
h[d].fn.call(h[d].context, e, i);
break;
case 4:
h[d].fn.call(h[d].context, e, i, n);
break;
default:
if (!a) for (u = 1, a = new Array(l - 1); u < l; u++) a[u - 1] = arguments[u];
h[d].fn.apply(h[d].context, a);
}
return !0;
}),
(o.prototype.on = function (t, e, i) {
return r(this, t, e, i, !1);
}),
(o.prototype.once = function (t, e, i) {
return r(this, t, e, i, !0);
}),
(o.prototype.removeListener = function (t, e, i, n) {
var s = f ? f + t : t;
if (!this._events[s]) return this;
if (!e) return l(this, s), this;
var r = this._events[s];
if (r.fn) r.fn !== e || (n && !r.once) || (i && r.context !== i) || l(this, s);
else {
for (var o = 0, a = [], h = r.length; o < h; o++) (r[o].fn !== e || (n && !r[o].once) || (i && r[o].context !== i)) && a.push(r[o]);
a.length ? (this._events[s] = 1 === a.length ? a[0] : a) : l(this, s);
}
return this;
}),
(o.prototype.removeAllListeners = function (t) {
var e;
return t ? ((e = f ? f + t : t), this._events[e] && l(this, e)) : ((this._events = new s()), (this._eventsCount = 0)), this;
}),
(o.prototype.off = o.prototype.removeListener),
(o.prototype.addListener = o.prototype.on),
(o.prefixed = f),
(o.EventEmitter = o),
(t.exports = o);
},
function (t, e, i) {
var n = i(0),
s = i(57),
r = i(171),
o = i(306),
a = i(56),
h = i(47),
l = i(174),
u = new n({
initialize: function (t, e, i, n) {
void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === n && (n = 0), (this.type = a.RECTANGLE), (this.x = t), (this.y = e), (this.width = i), (this.height = n);
},
contains: function (t, e) {
return s(this, t, e);
},
getPoint: function (t, e) {
return r(this, t, e);
},
getPoints: function (t, e, i) {
return o(this, t, e, i);
},
getRandomPoint: function (t) {
return l(this, t);
},
setTo: function (t, e, i, n) {
return (this.x = t), (this.y = e), (this.width = i), (this.height = n), this;
},
setEmpty: function () {
return this.setTo(0, 0, 0, 0);
},
setPosition: function (t, e) {
return void 0 === e && (e = t), (this.x = t), (this.y = e), this;
},
setSize: function (t, e) {
return void 0 === e && (e = t), (this.width = t), (this.height = e), this;
},
isEmpty: function () {
return this.width <= 0 || this.height <= 0;
},
getLineA: function (t) {
return void 0 === t && (t = new h()), t.setTo(this.x, this.y, this.right, this.y), t;
},
getLineB: function (t) {
return void 0 === t && (t = new h()), t.setTo(this.right, this.y, this.right, this.bottom), t;
},
getLineC: function (t) {
return void 0 === t && (t = new h()), t.setTo(this.right, this.bottom, this.x, this.bottom), t;
},
getLineD: function (t) {
return void 0 === t && (t = new h()), t.setTo(this.x, this.bottom, this.x, this.y), t;
},
left: {
get: function () {
return this.x;
},
set: function (t) {
t >= this.right ? (this.width = 0) : (this.width = this.right - t), (this.x = t);
},
},
right: {
get: function () {
return this.x + this.width;
},
set: function (t) {
t <= this.x ? (this.width = 0) : (this.width = t - this.x);
},
},
top: {
get: function () {
return this.y;
},
set: function (t) {
t >= this.bottom ? (this.height = 0) : (this.height = this.bottom - t), (this.y = t);
},
},
bottom: {
get: function () {
return this.y + this.height;
},
set: function (t) {
t <= this.y ? (this.height = 0) : (this.height = t - this.y);
},
},
centerX: {
get: function () {
return this.x + this.width / 2;
},
set: function (t) {
this.x = t - this.width / 2;
},
},
centerY: {
get: function () {
return this.y + this.height / 2;
},
set: function (t) {
this.y = t - this.height / 2;
},
},
});
t.exports = u;
},
function (t, e, i) {
t.exports = {
Alpha: i(607),
AlphaSingle: i(303),
BlendMode: i(304),
ComputedSize: i(608),
Crop: i(609),
Depth: i(305),
Flip: i(610),
GetBounds: i(611),
Mask: i(309),
Origin: i(632),
PathFollower: i(633),
Pipeline: i(167),
ScrollFactor: i(312),
Size: i(634),
Texture: i(635),
TextureCrop: i(636),
Tint: i(637),
ToJSON: i(176),
Transform: i(313),
TransformMatrix: i(25),
Visible: i(314),
};
},
function (t, e) {
t.exports = {
getTintFromFloats: function (t, e, i, n) {
return (((255 & ((255 * n) | 0)) << 24) | ((255 & ((255 * t) | 0)) << 16) | ((255 & ((255 * e) | 0)) << 8) | (255 & ((255 * i) | 0))) >>> 0;
},
getTintAppendFloatAlpha: function (t, e) {
return (((255 & ((255 * e) | 0)) << 24) | t) >>> 0;
},
getTintAppendFloatAlphaAndSwap: function (t, e) {
return (((255 & ((255 * e) | 0)) << 24) | ((255 & (0 | t)) << 16) | ((255 & ((t >> 8) | 0)) << 8) | (255 & ((t >> 16) | 0))) >>> 0;
},
getFloatsFromUintRGB: function (t) {
return [(255 & ((t >> 16) | 0)) / 255, (255 & ((t >> 8) | 0)) / 255, (255 & (0 | t)) / 255];
},
checkShaderMax: function (t, e) {
(e && -1 !== e) || (e = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS));
for (var i = t.createShader(t.FRAGMENT_SHADER), n = ["precision mediump float;", "void main(void){", "float test = 0.1;", "%forloop%", "gl_FragColor = vec4(0.0);", "}"].join("\n"); ; ) {
var s = n.replace(
/%forloop%/gi,
(function (t) {
for (var e = "", i = 0; i < t; ++i) 0 < i && (e += "\nelse "), i < t - 1 && (e += "if(test == " + i + ".0){}");
return e;
})(e)
);
if ((t.shaderSource(i, s), t.compileShader(i), t.getShaderParameter(i, t.COMPILE_STATUS))) break;
e = (e / 2) | 0;
}
return e;
},
parseFragmentShaderMaxTextures: function (t, e) {
if (!t) return "";
for (var i = "", n = 0; n < e; n++)
0 < n && (i += "\n\telse "), n < e - 1 && (i += "if (outTexId < " + n + ".5)"), (i += "\n\t{"), (i += "\n\t\ttexture = texture2D(uMainSampler[" + n + "], outTexCoord);"), (i += "\n\t}");
return (t = t.replace(/%count%/gi, e.toString())).replace(/%forloop%/gi, i);
},
};
},
function (t, e, i) {
var s = i(193),
r = i(6);
t.exports = function (t, e, i) {
var n = r(t, e, null);
if (null === n) return i;
if (Array.isArray(n)) return s.RND.pick(n);
if ("object" == typeof n) {
if (n.hasOwnProperty("randInt")) return s.RND.integerInRange(n.randInt[0], n.randInt[1]);
if (n.hasOwnProperty("randFloat")) return s.RND.realInRange(n.randFloat[0], n.randFloat[1]);
} else if ("function" == typeof n) return n(e);
return n;
};
},
function (t, e) {
var i = {
PI2: 2 * Math.PI,
TAU: 0.5 * Math.PI,
EPSILON: 1e-6,
DEG_TO_RAD: Math.PI / 180,
RAD_TO_DEG: 180 / Math.PI,
RND: null,
MIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER || -9007199254740991,
MAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER || 9007199254740991,
};
t.exports = i;
},
function (t, e, i) {
var n = i(0),
s = i(176),
r = i(101),
o = i(9),
a = i(75),
h = i(20),
l = new n({
Extends: o,
initialize: function (t, e) {
o.call(this),
(this.scene = t),
(this.displayList = null),
(this.type = e),
(this.state = 0),
(this.parentContainer = null),
(this.name = ""),
(this.active = !0),
(this.tabIndex = -1),
(this.data = null),
(this.renderFlags = 15),
(this.cameraFilter = 0),
(this.input = null),
(this.body = null),
(this.ignoreDestroy = !1),
this.on(a.ADDED_TO_SCENE, this.addedToScene, this),
this.on(a.REMOVED_FROM_SCENE, this.removedFromScene, this),
t.sys.queueDepthSort();
},
setActive: function (t) {
return (this.active = t), this;
},
setName: function (t) {
return (this.name = t), this;
},
setState: function (t) {
return (this.state = t), this;
},
setDataEnabled: function () {
return this.data || (this.data = new r(this)), this;
},
setData: function (t, e) {
return this.data || (this.data = new r(this)), this.data.set(t, e), this;
},
incData: function (t, e) {
return this.data || (this.data = new r(this)), this.data.inc(t, e), this;
},
toggleData: function (t) {
return this.data || (this.data = new r(this)), this.data.toggle(t), this;
},
getData: function (t) {
return this.data || (this.data = new r(this)), this.data.get(t);
},
setInteractive: function (t, e, i) {
return this.scene.sys.input.enable(this, t, e, i), this;
},
disableInteractive: function () {
return this.input && (this.input.enabled = !1), this;
},
removeInteractive: function () {
return this.scene.sys.input.clear(this), (this.input = void 0), this;
},
addedToScene: function () {},
removedFromScene: function () {},
update: function () {},
toJSON: function () {
return s(this);
},
willRender: function (t) {
return !(l.RENDER_MASK !== this.renderFlags || (0 !== this.cameraFilter && this.cameraFilter & t.id));
},
getIndexList: function () {
for (var t = this, e = this.parentContainer, i = []; e && (i.unshift(e.getIndex(t)), (t = e).parentContainer); ) e = e.parentContainer;
return this.displayList ? i.unshift(this.displayList.getIndex(t)) : i.unshift(this.scene.sys.displayList.getIndex(t)), i;
},
addToDisplayList: function (t) {
return (
void 0 === t && (t = this.scene.sys.displayList),
this.displayList && this.displayList !== t && this.removeFromDisplayList(),
t.exists(this) || ((this.displayList = t).add(this, !0), t.queueDepthSort(), this.emit(a.ADDED_TO_SCENE, this, this.scene), t.events.emit(h.ADDED_TO_SCENE, this, this.scene)),
this
);
},
addToUpdateList: function () {
return this.scene && this.preUpdate && this.scene.sys.updateList.add(this), this;
},
removeFromDisplayList: function () {
var t = this.displayList || this.scene.sys.displayList;
return t.exists(this) && (t.remove(this, !0), t.queueDepthSort(), (this.displayList = null), this.emit(a.REMOVED_FROM_SCENE, this, this.scene), t.events.emit(h.REMOVED_FROM_SCENE, this, this.scene)), this;
},
removeFromUpdateList: function () {
return this.scene && this.preUpdate && this.scene.sys.updateList.remove(this), this;
},
destroy: function (t) {
this.scene &&
!this.ignoreDestroy &&
(void 0 === t && (t = !1),
this.preDestroy && this.preDestroy.call(this),
this.emit(a.DESTROY, this, t),
this.removeAllListeners(),
this.postPipelines && this.resetPostPipeline(!0),
this.removeFromDisplayList(),
this.removeFromUpdateList(),
this.input && (this.scene.sys.input.clear(this), (this.input = void 0)),
this.data && (this.data.destroy(), (this.data = void 0)),
this.body && (this.body.destroy(), (this.body = void 0)),
(this.active = !1),
(this.visible = !1),
(this.scene = void 0),
(this.parentContainer = void 0));
},
});
(l.RENDER_MASK = 15), (t.exports = l);
},
function (t, e, i) {
var n = i(0),
s = i(24),
r = i(20),
o = new n({
initialize: function (t) {
(this.scene = t), (this.systems = t.sys), (this.events = t.sys.events), this.displayList, this.updateList, this.events.once(r.BOOT, this.boot, this), this.events.on(r.START, this.start, this);
},
boot: function () {
(this.displayList = this.systems.displayList), (this.updateList = this.systems.updateList), this.events.once(r.DESTROY, this.destroy, this);
},
start: function () {
this.events.once(r.SHUTDOWN, this.shutdown, this);
},
shutdown: function () {
this.events.off(r.SHUTDOWN, this.shutdown, this);
},
destroy: function () {
this.shutdown(), this.events.off(r.START, this.start, this), (this.scene = null), (this.systems = null), (this.events = null), (this.displayList = null), (this.updateList = null);
},
});
(o.register = function (t, e) {
o.prototype.hasOwnProperty(t) || (o.prototype[t] = e);
}),
(o.remove = function (t) {
o.prototype.hasOwnProperty(t) && delete o.prototype[t];
}),
s.register("GameObjectCreator", o, "make"),
(t.exports = o);
},
function (t, e, i) {
var u = i(7),
c = function () {
var t,
e,
i,
n,
s,
r,
o = arguments[0] || {},
a = 1,
h = arguments.length,
l = !1;
for ("boolean" == typeof o && ((l = o), (o = arguments[1] || {}), (a = 2)), h === a && ((o = this), --a); a < h; a++)
if (null != (t = arguments[a]))
for (e in t)
(i = o[e]),
o !== (n = t[e]) && (l && n && (u(n) || (s = Array.isArray(n))) ? ((r = s ? ((s = !1), i && Array.isArray(i) ? i : []) : i && u(i) ? i : {}), (o[e] = c(l, r, n))) : void 0 !== n && (o[e] = n));
return o;
};
t.exports = c;
},
function (t, e) {
t.exports = function (t, e, i) {
return Math.max(e, Math.min(i, t));
};
},
function (t, e, i) {
var n = i(25),
o = new n(),
a = new n(),
h = new n(),
l = { camera: o, sprite: a, calc: h };
t.exports = function (t, e, i) {
var n = o,
s = a,
r = h;
return (
s.applyITRS(t.x, t.y, t.rotation, t.scaleX, t.scaleY),
n.copyFrom(e.matrix),
i ? (n.multiplyWithOffset(i, -e.scrollX * t.scrollFactorX, -e.scrollY * t.scrollFactorY), (s.e = t.x), (s.f = t.y)) : ((s.e -= e.scrollX * t.scrollFactorX), (s.f -= e.scrollY * t.scrollFactorY)),
n.multiply(s, r),
l
);
};
},
function (t, e, i) {
t.exports = {
ADDED_TO_SCENE: i(656),
BOOT: i(657),
CREATE: i(658),
DESTROY: i(659),
PAUSE: i(660),
POST_UPDATE: i(661),
PRE_RENDER: i(662),
PRE_UPDATE: i(663),
READY: i(664),
REMOVED_FROM_SCENE: i(665),
RENDER: i(666),
RESUME: i(667),
SHUTDOWN: i(668),
SLEEP: i(669),
START: i(670),
TRANSITION_COMPLETE: i(671),
TRANSITION_INIT: i(672),
TRANSITION_OUT: i(673),
TRANSITION_START: i(674),
TRANSITION_WAKE: i(675),
UPDATE: i(676),
WAKE: i(677),
};
},
function (t, e) {
t.exports = {
LOADER_IDLE: 0,
LOADER_LOADING: 1,
LOADER_PROCESSING: 2,
LOADER_COMPLETE: 3,
LOADER_SHUTDOWN: 4,
LOADER_DESTROYED: 5,
FILE_PENDING: 10,
FILE_LOADING: 11,
FILE_LOADED: 12,
FILE_FAILED: 13,
FILE_PROCESSING: 14,
FILE_ERRORED: 16,
FILE_COMPLETE: 17,
FILE_DESTROYED: 18,
FILE_POPULATED: 19,
};
},
function (t, e, i) {
t.exports = {
BLUR: i(612),
BOOT: i(613),
CONTEXT_LOST: i(614),
CONTEXT_RESTORED: i(615),
DESTROY: i(616),
FOCUS: i(617),
HIDDEN: i(618),
PAUSE: i(619),
POST_RENDER: i(620),
POST_STEP: i(621),
PRE_RENDER: i(622),
PRE_STEP: i(623),
READY: i(624),
RESUME: i(625),
STEP: i(626),
VISIBLE: i(627),
};
},
function (t, e, i) {
var n = i(0),
s = i(21),
r = i(95),
o = i(2),
a = i(155),
h = i(240),
l = i(517),
u = i(156),
c = new n({
initialize: function (t, e) {
(this.loader = t), (this.cache = o(e, "cache", !1)), (this.type = o(e, "type", !1)), (this.key = o(e, "key", !1));
var i = this.key;
if ((t.prefix && "" !== t.prefix && (this.key = t.prefix + i), !this.type || !this.key)) throw new Error("Invalid Loader." + this.type + " key");
var n = o(e, "url");
void 0 === n ? (n = t.path + i + "." + o(e, "extension", "")) : "string" != typeof n || n.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/) || (n = t.path + n),
(this.url = n),
(this.src = ""),
(this.xhrSettings = u(o(e, "responseType", void 0))),
o(e, "xhrSettings", !1) && (this.xhrSettings = h(this.xhrSettings, o(e, "xhrSettings", {}))),
(this.xhrLoader = null),
(this.state = "function" == typeof this.url ? s.FILE_POPULATED : s.FILE_PENDING),
(this.bytesTotal = 0),
(this.bytesLoaded = -1),
(this.percentComplete = -1),
(this.crossOrigin = void 0),
(this.data = void 0),
(this.config = o(e, "config", {})),
this.multiFile,
this.linkFile;
},
setLink: function (t) {
(this.linkFile = t).linkFile = this;
},
resetXHR: function () {
this.xhrLoader && ((this.xhrLoader.onload = void 0), (this.xhrLoader.onerror = void 0), (this.xhrLoader.onprogress = void 0));
},
load: function () {
this.state === s.FILE_POPULATED
? this.loader.nextFile(this, !0)
: ((this.state = s.FILE_LOADING), (this.src = a(this, this.loader.baseURL)), 0 === this.src.indexOf("data:") || (this.xhrLoader = l(this, this.loader.xhr)));
},
onLoad: function (t, e) {
var i = t.responseURL && (0 === t.responseURL.indexOf("file://") || 0 === t.responseURL.indexOf("capacitor://")) && 0 === e.target.status,
n = !(e.target && 200 !== e.target.status) || i;
4 === t.readyState && 400 <= t.status && t.status <= 599 && (n = !1), (this.state = s.FILE_LOADED), this.resetXHR(), this.loader.nextFile(this, n);
},
onError: function () {
this.resetXHR(), this.loader.nextFile(this, !1);
},
onProgress: function (t) {
t.lengthComputable &&
((this.bytesLoaded = t.loaded), (this.bytesTotal = t.total), (this.percentComplete = Math.min(this.bytesLoaded / this.bytesTotal, 1)), this.loader.emit(r.FILE_PROGRESS, this, this.percentComplete));
},
onProcess: function () {
(this.state = s.FILE_PROCESSING), this.onProcessComplete();
},
onProcessComplete: function () {
(this.state = s.FILE_COMPLETE), this.multiFile && this.multiFile.onFileComplete(this), this.loader.fileProcessComplete(this);
},
onProcessError: function () {
(this.state = s.FILE_ERRORED), this.multiFile && this.multiFile.onFileFailed(this), this.loader.fileProcessComplete(this);
},
hasCacheConflict: function () {
return this.cache && this.cache.exists(this.key);
},
addToCache: function () {
this.cache && this.cache.add(this.key, this.data), this.pendingDestroy();
},
pendingDestroy: function (t) {
void 0 === t && (t = this.data);
var e = this.key,
i = this.type;
this.loader.emit(r.FILE_COMPLETE, e, i, t), this.loader.emit(r.FILE_KEY_COMPLETE + i + "-" + e, e, i, t), this.loader.flagForRemoval(this);
},
destroy: function () {
(this.loader = null), (this.cache = null), (this.xhrSettings = null), (this.multiFile = null), (this.linkFile = null), (this.data = null);
},
});
(c.createObjectURL = function (t, e, i) {
var n;
"function" == typeof URL
? (t.src = URL.createObjectURL(e))
: (((n = new FileReader()).onload = function () {
t.removeAttribute("crossOrigin"), (t.src = "data:" + (e.type || i) + ";base64," + n.result.split(",")[1]);
}),
(n.onerror = t.onerror),
n.readAsDataURL(e));
}),
(c.revokeObjectURL = function (t) {
"function" == typeof URL && URL.revokeObjectURL(t.src);
}),
(t.exports = c);
},
function (t, e) {
var s = {},
r = {},
i = {
register: function (t, e, i, n) {
void 0 === n && (n = !1), (s[t] = { plugin: e, mapping: i, custom: n });
},
registerCustom: function (t, e, i, n) {
r[t] = { plugin: e, mapping: i, data: n };
},
hasCore: function (t) {
return s.hasOwnProperty(t);
},
hasCustom: function (t) {
return r.hasOwnProperty(t);
},
getCore: function (t) {
return s[t];
},
getCustom: function (t) {
return r[t];
},
getCustomClass: function (t) {
return r.hasOwnProperty(t) ? r[t].plugin : null;
},
remove: function (t) {
s.hasOwnProperty(t) && delete s[t];
},
removeCustom: function (t) {
r.hasOwnProperty(t) && delete r[t];
},
destroyCorePlugins: function () {
for (var t in s) s.hasOwnProperty(t) && delete s[t];
},
destroyCustomPlugins: function () {
for (var t in r) r.hasOwnProperty(t) && delete r[t];
},
};
t.exports = i;
},
function (t, e, i) {
var n = i(0),
r = i(14),
c = i(3),
s = new n({
initialize: function (t, e, i, n, s, r) {
void 0 === t && (t = 1),
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 1),
void 0 === s && (s = 0),
void 0 === r && (r = 0),
(this.matrix = new Float32Array([t, e, i, n, s, r, 0, 0, 1])),
(this.decomposedMatrix = { translateX: 0, translateY: 0, scaleX: 1, scaleY: 1, rotation: 0 });
},
a: {
get: function () {
return this.matrix[0];
},
set: function (t) {
this.matrix[0] = t;
},
},
b: {
get: function () {
return this.matrix[1];
},
set: function (t) {
this.matrix[1] = t;
},
},
c: {
get: function () {
return this.matrix[2];
},
set: function (t) {
this.matrix[2] = t;
},
},
d: {
get: function () {
return this.matrix[3];
},
set: function (t) {
this.matrix[3] = t;
},
},
e: {
get: function () {
return this.matrix[4];
},
set: function (t) {
this.matrix[4] = t;
},
},
f: {
get: function () {
return this.matrix[5];
},
set: function (t) {
this.matrix[5] = t;
},
},
tx: {
get: function () {
return this.matrix[4];
},
set: function (t) {
this.matrix[4] = t;
},
},
ty: {
get: function () {
return this.matrix[5];
},
set: function (t) {
this.matrix[5] = t;
},
},
rotation: {
get: function () {
return Math.acos(this.a / this.scaleX) * (Math.atan(-this.c / this.a) < 0 ? -1 : 1);
},
},
rotationNormalized: {
get: function () {
var t = this.matrix,
e = t[0],
i = t[1],
n = t[2],
s = t[3];
return e || i ? (0 < i ? Math.acos(e / this.scaleX) : -Math.acos(e / this.scaleX)) : n || s ? r.TAU - (0 < s ? Math.acos(-n / this.scaleY) : -Math.acos(n / this.scaleY)) : 0;
},
},
scaleX: {
get: function () {
return Math.sqrt(this.a * this.a + this.b * this.b);
},
},
scaleY: {
get: function () {
return Math.sqrt(this.c * this.c + this.d * this.d);
},
},
loadIdentity: function () {
var t = this.matrix;
return (t[0] = 1), (t[1] = 0), (t[2] = 0), (t[3] = 1), (t[4] = 0), (t[5] = 0), this;
},
translate: function (t, e) {
var i = this.matrix;
return (i[4] = i[0] * t + i[2] * e + i[4]), (i[5] = i[1] * t + i[3] * e + i[5]), this;
},
scale: function (t, e) {
var i = this.matrix;
return (i[0] *= t), (i[1] *= t), (i[2] *= e), (i[3] *= e), this;
},
rotate: function (t) {
var e = Math.sin(t),
i = Math.cos(t),
n = this.matrix,
s = n[0],
r = n[1],
o = n[2],
a = n[3];
return (n[0] = s * i + o * e), (n[1] = r * i + a * e), (n[2] = s * -e + o * i), (n[3] = r * -e + a * i), this;
},
multiply: function (t, e) {
var i = this.matrix,
n = t.matrix,
s = i[0],
r = i[1],
o = i[2],
a = i[3],
h = i[4],
l = i[5],
u = n[0],
c = n[1],
d = n[2],
f = n[3],
p = n[4],
g = n[5],
v = void 0 === e ? this : e;
return (v.a = u * s + c * o), (v.b = u * r + c * a), (v.c = d * s + f * o), (v.d = d * r + f * a), (v.e = p * s + g * o + h), (v.f = p * r + g * a + l), v;
},
multiplyWithOffset: function (t, e, i) {
var n = this.matrix,
s = t.matrix,
r = n[0],
o = n[1],
a = n[2],
h = n[3],
l = e * r + i * a + n[4],
u = e * o + i * h + n[5],
c = s[0],
d = s[1],
f = s[2],
p = s[3],
g = s[4],
v = s[5];
return (n[0] = c * r + d * a), (n[1] = c * o + d * h), (n[2] = f * r + p * a), (n[3] = f * o + p * h), (n[4] = g * r + v * a + l), (n[5] = g * o + v * h + u), this;
},
transform: function (t, e, i, n, s, r) {
var o = this.matrix,
a = o[0],
h = o[1],
l = o[2],
u = o[3],
c = o[4],
d = o[5];
return (o[0] = t * a + e * l), (o[1] = t * h + e * u), (o[2] = i * a + n * l), (o[3] = i * h + n * u), (o[4] = s * a + r * l + c), (o[5] = s * h + r * u + d), this;
},
transformPoint: function (t, e, i) {
void 0 === i && (i = { x: 0, y: 0 });
var n = this.matrix,
s = n[0],
r = n[1],
o = n[2],
a = n[3],
h = n[4],
l = n[5];
return (i.x = t * s + e * o + h), (i.y = t * r + e * a + l), i;
},
invert: function () {
var t = this.matrix,
e = t[0],
i = t[1],
n = t[2],
s = t[3],
r = t[4],
o = t[5],
a = e * s - i * n;
return (t[0] = s / a), (t[1] = -i / a), (t[2] = -n / a), (t[3] = e / a), (t[4] = (n * o - s * r) / a), (t[5] = -(e * o - i * r) / a), this;
},
copyFrom: function (t) {
var e = this.matrix;
return (e[0] = t.a), (e[1] = t.b), (e[2] = t.c), (e[3] = t.d), (e[4] = t.e), (e[5] = t.f), this;
},
copyFromArray: function (t) {
var e = this.matrix;
return (e[0] = t[0]), (e[1] = t[1]), (e[2] = t[2]), (e[3] = t[3]), (e[4] = t[4]), (e[5] = t[5]), this;
},
copyToContext: function (t) {
var e = this.matrix;
return t.transform(e[0], e[1], e[2], e[3], e[4], e[5]), t;
},
setToContext: function (t) {
var e = this.matrix;
return t.setTransform(e[0], e[1], e[2], e[3], e[4], e[5]), t;
},
copyToArray: function (t) {
var e = this.matrix;
return void 0 === t ? (t = [e[0], e[1], e[2], e[3], e[4], e[5]]) : ((t[0] = e[0]), (t[1] = e[1]), (t[2] = e[2]), (t[3] = e[3]), (t[4] = e[4]), (t[5] = e[5])), t;
},
setTransform: function (t, e, i, n, s, r) {
var o = this.matrix;
return (o[0] = t), (o[1] = e), (o[2] = i), (o[3] = n), (o[4] = s), (o[5] = r), this;
},
decomposeMatrix: function () {
var t,
e,
i = this.decomposedMatrix,
n = this.matrix,
s = n[0],
r = n[1],
o = n[2],
a = n[3],
h = s * a - r * o;
return (
(i.translateX = n[4]),
(i.translateY = n[5]),
s || r
? ((t = Math.sqrt(s * s + r * r)), (i.rotation = 0 < r ? Math.acos(s / t) : -Math.acos(s / t)), (i.scaleX = t), (i.scaleY = h / t))
: o || a
? ((e = Math.sqrt(o * o + a * a)), (i.rotation = 0.5 * Math.PI - (0 < a ? Math.acos(-o / e) : -Math.acos(o / e))), (i.scaleX = h / e), (i.scaleY = e))
: ((i.rotation = 0), (i.scaleX = 0), (i.scaleY = 0)),
i
);
},
applyITRS: function (t, e, i, n, s) {
var r = this.matrix,
o = Math.sin(i),
a = Math.cos(i);
return (r[4] = t), (r[5] = e), (r[0] = a * n), (r[1] = o * n), (r[2] = -o * s), (r[3] = a * s), this;
},
applyInverse: function (t, e, i) {
void 0 === i && (i = new c());
var n = this.matrix,
s = n[0],
r = n[1],
o = n[2],
a = n[3],
h = n[4],
l = n[5],
u = 1 / (s * a + o * -r);
return (i.x = a * u * t + -o * u * e + (l * o - h * a) * u), (i.y = s * u * e + -r * u * t + (-l * s + h * r) * u), i;
},
getX: function (t, e) {
return t * this.a + e * this.c + this.e;
},
getY: function (t, e) {
return t * this.b + e * this.d + this.f;
},
getXRound: function (t, e, i) {
var n = this.getX(t, e);
return i && (n = Math.round(n)), n;
},
getYRound: function (t, e, i) {
var n = this.getY(t, e);
return i && (n = Math.round(n)), n;
},
getCSSMatrix: function () {
var t = this.matrix;
return "matrix(" + t[0] + "," + t[1] + "," + t[2] + "," + t[3] + "," + t[4] + "," + t[5] + ")";
},
destroy: function () {
(this.matrix = null), (this.decomposedMatrix = null);
},
});
t.exports = s;
},
function (t, e, i) {
var f = i(2);
t.exports = function (t, e, i, n, s, r) {
void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = r.width), void 0 === n && (n = r.height);
var o = f((s = s || {}), "isNotEmpty", !1),
a = f(s, "isColliding", !1),
h = f(s, "hasInterestingFace", !1);
t < 0 && ((i += t), (t = 0)), e < 0 && ((n += e), (e = 0)), t + i > r.width && (i = Math.max(r.width - t, 0)), e + n > r.height && (n = Math.max(r.height - e, 0));
for (var l = [], u = e; u < e + n; u++)
for (var c = t; c < t + i; c++) {
var d = r.data[u][c];
if (null !== d) {
if (o && -1 === d.index) continue;
if (a && !d.collides) continue;
if (h && !d.hasInterestingFace) continue;
l.push(d);
}
}
return l;
};
},
function (t, e) {
t.exports = function (t, e, i, n, s, r) {
var o;
void 0 === n && (n = 0), void 0 === s && (s = 0), void 0 === r && (r = 1);
var a = 0,
h = t.length;
if (1 === r) for (o = s; o < h; o++) (t[o][e] = i + a * n), a++;
else for (o = s; 0 <= o; o--) (t[o][e] = i + a * n), a++;
return t;
};
},
function (t, e, i) {
var l = i(35),
u = i(13);
t.exports = function (t, e, i) {
(e.x = u(i, "x", 0)), (e.y = u(i, "y", 0)), (e.depth = u(i, "depth", 0)), (e.flipX = u(i, "flipX", !1)), (e.flipY = u(i, "flipY", !1));
var n = u(i, "scale", null);
"number" == typeof n ? e.setScale(n) : null !== n && ((e.scaleX = u(n, "x", 1)), (e.scaleY = u(n, "y", 1)));
var s = u(i, "scrollFactor", null);
"number" == typeof s ? e.setScrollFactor(s) : null !== s && ((e.scrollFactorX = u(s, "x", 1)), (e.scrollFactorY = u(s, "y", 1))), (e.rotation = u(i, "rotation", 0));
var r = u(i, "angle", null);
null !== r && (e.angle = r), (e.alpha = u(i, "alpha", 1));
var o,
a,
h = u(i, "origin", null);
return (
"number" == typeof h ? e.setOrigin(h) : null !== h && ((o = u(h, "x", 0.5)), (a = u(h, "y", 0.5)), e.setOrigin(o, a)),
(e.blendMode = u(i, "blendMode", l.NORMAL)),
(e.visible = u(i, "visible", !0)),
u(i, "add", !0) && t.sys.displayList.add(e),
e.preUpdate && t.sys.updateList.add(e),
e
);
};
},
function (t, e) {
t.exports = { ORTHOGONAL: 0, ISOMETRIC: 1, STAGGERED: 2, HEXAGONAL: 3 };
},
function (t, e, i) {
var a = i(19);
t.exports = function (t, e, i, n, s) {
var r = n.alpha * i.alpha;
if (r <= 0) return !1;
var o = a(i, n, s).calc;
return (e.globalCompositeOperation = t.blendModes[i.blendMode]), (e.globalAlpha = r), e.save(), o.setToContext(e), (e.imageSmoothingEnabled = !(!t.antialias || (i.frame && i.frame.source.scaleMode))), !0;
};
},
function (t, e, i) {
var a,
h = i(33),
l = i(192),
u = [],
c = !1;
function n(t, e, i, n, s) {
void 0 === e && (e = 1), void 0 === i && (i = 1), void 0 === n && (n = h.CANVAS), void 0 === s && (s = !1);
var r = a(n),
o = (null === r ? ((r = { parent: t, canvas: document.createElement("canvas"), type: n }), n === h.CANVAS && u.push(r)) : (r.parent = t), r.canvas);
return s && (r.parent = o), (o.width = e), (o.height = i), c && n === h.CANVAS && l.disable(o.getContext("2d")), o;
}
function s() {
var e = 0;
return (
u.forEach(function (t) {
t.parent && e++;
}),
e
);
}
t.exports = {
create2D: function (t, e, i) {
return n(t, e, i, h.CANVAS);
},
create: n,
createWebGL: function (t, e, i) {
return n(t, e, i, h.WEBGL);
},
disableSmoothing: function () {
c = !0;
},
enableSmoothing: function () {
c = !1;
},
first: (a = function (t) {
if ((void 0 === t && (t = h.CANVAS), t === h.WEBGL)) return null;
for (var e = 0; e < u.length; e++) {
var i = u[e];
if (!i.parent && i.type === t) return i;
}
return null;
}),
free: function () {
return u.length - s();
},
pool: u,
remove: function (e) {
var i = e instanceof HTMLCanvasElement;
u.forEach(function (t) {
((i && t.canvas === e) || (!i && t.parent === e)) && ((t.parent = null), (t.canvas.width = 1), (t.canvas.height = 1));
});
},
total: s,
};
},
function (t, e) {
var h = {};
(t.exports = h),
(function () {
(h._nextId = 0),
(h._seed = 0),
(h._nowStartTime = +new Date()),
(h.extend = function (t, e) {
for (var i, n = "boolean" == typeof e ? ((i = 2), e) : ((i = 1), !0), s = i; s < arguments.length; s++) {
var r = arguments[s];
if (r) for (var o in r) !n || !r[o] || r[o].constructor !== Object || (t[o] && t[o].constructor !== Object) ? (t[o] = r[o]) : ((t[o] = t[o] || {}), h.extend(t[o], n, r[o]));
}
return t;
}),
(h.clone = function (t, e) {
return h.extend({}, e, t);
}),
(h.keys = function (t) {
if (Object.keys) return Object.keys(t);
var e = [];
for (var i in t) e.push(i);
return e;
}),
(h.values = function (t) {
var e = [];
if (Object.keys) {
for (var i = Object.keys(t), n = 0; n < i.length; n++) e.push(t[i[n]]);
return e;
}
for (var s in t) e.push(t[s]);
return e;
}),
(h.get = function (t, e, i, n) {
e = e.split(".").slice(i, n);
for (var s = 0; s < e.length; s += 1) t = t[e[s]];
return t;
}),
(h.set = function (t, e, i, n, s) {
var r = e.split(".").slice(n, s);
return (h.get(t, e, 0, -1)[r[r.length - 1]] = i);
}),
(h.shuffle = function (t) {
for (var e = t.length - 1; 0 < e; e--) {
var i = Math.floor(h.random() * (e + 1)),
n = t[e];
(t[e] = t[i]), (t[i] = n);
}
return t;
}),
(h.choose = function (t) {
return t[Math.floor(h.random() * t.length)];
}),
(h.isElement = function (t) {
return "undefined" != typeof HTMLElement ? t instanceof HTMLElement : !!(t && t.nodeType && t.nodeName);
}),
(h.isArray = function (t) {
return "[object Array]" === Object.prototype.toString.call(t);
}),
(h.isFunction = function (t) {
return "function" == typeof t;
}),
(h.isPlainObject = function (t) {
return "object" == typeof t && t.constructor === Object;
}),
(h.isString = function (t) {
return "[object String]" === Object.prototype.toString.call(t);
}),
(h.clamp = function (t, e, i) {
return t < e ? e : i < t ? i : t;
}),
(h.sign = function (t) {
return t < 0 ? -1 : 1;
}),
(h.now = function () {
if ("undefined" != typeof window && window.performance) {
if (window.performance.now) return window.performance.now();
if (window.performance.webkitNow) return window.performance.webkitNow();
}
return new Date() - h._nowStartTime;
}),
(h.random = function (t, e) {
return (e = void 0 !== e ? e : 1), (t = void 0 !== t ? t : 0) + i() * (e - t);
});
var i = function () {
return (h._seed = (9301 * h._seed + 49297) % 233280), h._seed / 233280;
};
(h.colorToNumber = function (t) {
return 3 == (t = t.replace("#", "")).length && (t = t.charAt(0) + t.charAt(0) + t.charAt(1) + t.charAt(1) + t.charAt(2) + t.charAt(2)), parseInt(t, 16);
}),
(h.logLevel = 1),
(h.log = function () {
console && 0 < h.logLevel && h.logLevel;
}),
(h.info = function () {
console && 0 < h.logLevel && h.logLevel;
}),
(h.warn = function () {
console && 0 < h.logLevel && h.logLevel;
}),
(h.nextId = function () {
return h._nextId++;
}),
(h.indexOf = function (t, e) {
if (t.indexOf) return t.indexOf(e);
for (var i = 0; i < t.length; i++) if (t[i] === e) return i;
return -1;
}),
(h.map = function (t, e) {
if (t.map) return t.map(e);
for (var i = [], n = 0; n < t.length; n += 1) i.push(e(t[n]));
return i;
}),
(h.topologicalSort = function (t) {
var e = [],
i = [],
n = [];
for (var s in t) i[s] || n[s] || h._topologicalSort(s, i, n, t, e);
return e;
}),
(h._topologicalSort = function (t, e, i, n, s) {
var r = n[t] || [];
i[t] = !0;
for (var o = 0; o < r.length; o += 1) {
var a = r[o];
i[a] || e[a] || h._topologicalSort(a, e, i, n, s);
}
(i[t] = !1), (e[t] = !0), s.push(t);
}),
(h.chain = function () {
for (var r = [], t = 0; t < arguments.length; t += 1) {
var e = arguments[t];
e._chained ? r.push.apply(r, e._chained) : r.push(e);
}
function i() {
for (var t, e = new Array(arguments.length), i = 0, n = arguments.length; i < n; i++) e[i] = arguments[i];
for (i = 0; i < r.length; i += 1) {
var s = r[i].apply(t, e);
void 0 !== s && (t = s);
}
return t;
}
return (i._chained = r), i;
}),
(h.chainPathBefore = function (t, e, i) {
return h.set(t, e, h.chain(i, h.get(t, e)));
}),
(h.chainPathAfter = function (t, e, i) {
return h.set(t, e, h.chain(h.get(t, e), i));
});
})();
},
function (t, e, i) {
var n = { VERSION: "3.55.2", BlendModes: i(35), ScaleModes: i(168), AUTO: 0, CANVAS: 1, WEBGL: 2, HEADLESS: 3, FOREVER: -1, NONE: 4, UP: 5, DOWN: 6, LEFT: 7, RIGHT: 8 };
t.exports = n;
},
function (t, e, i) {
var n = i(0),
s = i(11),
r = i(15),
o = i(47),
a = new n({
Extends: r,
Mixins: [s.AlphaSingle, s.BlendMode, s.Depth, s.GetBounds, s.Mask, s.Origin, s.Pipeline, s.ScrollFactor, s.Transform, s.Visible],
initialize: function (t, e, i) {
void 0 === e && (e = "Shape"),
r.call(this, t, e),
(this.geom = i),
(this.pathData = []),
(this.pathIndexes = []),
(this.fillColor = 16777215),
(this.fillAlpha = 1),
(this.strokeColor = 16777215),
(this.strokeAlpha = 1),
(this.lineWidth = 1),
(this.isFilled = !1),
(this.isStroked = !1),
(this.closePath = !0),
(this._tempLine = new o()),
(this.width = 0),
(this.height = 0),
this.initPipeline();
},
setFillStyle: function (t, e) {
return void 0 === e && (e = 1), void 0 === t ? (this.isFilled = !1) : ((this.fillColor = t), (this.fillAlpha = e), (this.isFilled = !0)), this;
},
setStrokeStyle: function (t, e, i) {
return void 0 === i && (i = 1), void 0 === t ? (this.isStroked = !1) : ((this.lineWidth = t), (this.strokeColor = e), (this.strokeAlpha = i), (this.isStroked = !0)), this;
},
setClosePath: function (t) {
return (this.closePath = t), this;
},
setSize: function (t, e) {
return (this.width = t), (this.height = e), this;
},
setDisplaySize: function (t, e) {
return (this.displayWidth = t), (this.displayHeight = e), this;
},
preDestroy: function () {
(this.geom = null), (this._tempLine = null), (this.pathData = []), (this.pathIndexes = []);
},
displayWidth: {
get: function () {
return this.scaleX * this.width;
},
set: function (t) {
this.scaleX = t / this.width;
},
},
displayHeight: {
get: function () {
return this.scaleY * this.height;
},
set: function (t) {
this.scaleY = t / this.height;
},
},
});
t.exports = a;
},
function (t, e) {
t.exports = {
SKIP_CHECK: -1,
NORMAL: 0,
ADD: 1,
MULTIPLY: 2,
SCREEN: 3,
OVERLAY: 4,
DARKEN: 5,
LIGHTEN: 6,
COLOR_DODGE: 7,
COLOR_BURN: 8,
HARD_LIGHT: 9,
SOFT_LIGHT: 10,
DIFFERENCE: 11,
EXCLUSION: 12,
HUE: 13,
SATURATION: 14,
COLOR: 15,
LUMINOSITY: 16,
ERASE: 17,
SOURCE_IN: 18,
SOURCE_OUT: 19,
SOURCE_ATOP: 20,
DESTINATION_OVER: 21,
DESTINATION_IN: 22,
DESTINATION_OUT: 23,
DESTINATION_ATOP: 24,
LIGHTER: 25,
COPY: 26,
XOR: 27,
};
},
function (t, e, i) {
var n = i(14);
t.exports = function (t) {
return t * n.DEG_TO_RAD;
};
},
function (t, e, i) {
t.exports = {
DESTROY: i(743),
FADE_IN_COMPLETE: i(744),
FADE_IN_START: i(745),
FADE_OUT_COMPLETE: i(746),
FADE_OUT_START: i(747),
FLASH_COMPLETE: i(748),
FLASH_START: i(749),
FOLLOW_UPDATE: i(750),
PAN_COMPLETE: i(751),
PAN_START: i(752),
POST_RENDER: i(753),
PRE_RENDER: i(754),
ROTATE_COMPLETE: i(755),
ROTATE_START: i(756),
SHAKE_COMPLETE: i(757),
SHAKE_START: i(758),
ZOOM_COMPLETE: i(759),
ZOOM_START: i(760),
};
},
function (t, e, i) {
var n = i(0),
r = i(103),
o = i(328),
s = i(188),
a = i(329),
h = new n({
initialize: function (t, e, i, n) {
void 0 === t && (t = 0),
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 255),
(this.r = 0),
(this.g = 0),
(this.b = 0),
(this.a = 255),
(this._h = 0),
(this._s = 0),
(this._v = 0),
(this._locked = !1),
(this.gl = [0, 0, 0, 1]),
(this._color = 0),
(this._color32 = 0),
(this._rgba = ""),
this.setTo(t, e, i, n);
},
transparent: function () {
return (this._locked = !0), (this.red = 0), (this.green = 0), (this.blue = 0), (this.alpha = 0), (this._locked = !1), this.update(!0);
},
setTo: function (t, e, i, n, s) {
return void 0 === n && (n = 255), void 0 === s && (s = !0), (this._locked = !0), (this.red = t), (this.green = e), (this.blue = i), (this.alpha = n), (this._locked = !1), this.update(s);
},
setGLTo: function (t, e, i, n) {
return void 0 === n && (n = 1), (this._locked = !0), (this.redGL = t), (this.greenGL = e), (this.blueGL = i), (this.alphaGL = n), (this._locked = !1), this.update(!0);
},
setFromRGB: function (t) {
return (this._locked = !0), (this.red = t.r), (this.green = t.g), (this.blue = t.b), t.hasOwnProperty("a") && (this.alpha = t.a), (this._locked = !1), this.update(!0);
},
setFromHSV: function (t, e, i) {
return s(t, e, i, this);
},
update: function (t) {
if ((void 0 === t && (t = !1), this._locked)) return this;
var e = this.r,
i = this.g,
n = this.b,
s = this.a;
return (this._color = r(e, i, n)), (this._color32 = o(e, i, n, s)), (this._rgba = "rgba(" + e + "," + i + "," + n + "," + s / 255 + ")"), t && a(e, i, n, this), this;
},
updateHSV: function () {
var t = this.r,
e = this.g,
i = this.b;
return a(t, e, i, this), this;
},
clone: function () {
return new h(this.r, this.g, this.b, this.a);
},
gray: function (t) {
return this.setTo(t, t, t);
},
random: function (t, e) {
void 0 === t && (t = 0), void 0 === e && (e = 255);
var i = Math.floor(t + Math.random() * (e - t)),
n = Math.floor(t + Math.random() * (e - t)),
s = Math.floor(t + Math.random() * (e - t));
return this.setTo(i, n, s);
},
randomGray: function (t, e) {
void 0 === t && (t = 0), void 0 === e && (e = 255);
var i = Math.floor(t + Math.random() * (e - t));
return this.setTo(i, i, i);
},
saturate: function (t) {
return (this.s += t / 100), this;
},
desaturate: function (t) {
return (this.s -= t / 100), this;
},
lighten: function (t) {
return (this.v += t / 100), this;
},
darken: function (t) {
return (this.v -= t / 100), this;
},
brighten: function (t) {
var e = this.r,
i = this.g,
n = this.b;
(e = Math.max(0, Math.min(255, e - Math.round((-t / 100) * 255)))), (i = Math.max(0, Math.min(255, i - Math.round((-t / 100) * 255)))), (n = Math.max(0, Math.min(255, n - Math.round((-t / 100) * 255))));
return this.setTo(e, i, n);
},
color: {
get: function () {
return this._color;
},
},
color32: {
get: function () {
return this._color32;
},
},
rgba: {
get: function () {
return this._rgba;
},
},
redGL: {
get: function () {
return this.gl[0];
},
set: function (t) {
(this.gl[0] = Math.min(Math.abs(t), 1)), (this.r = Math.floor(255 * this.gl[0])), this.update(!0);
},
},
greenGL: {
get: function () {
return this.gl[1];
},
set: function (t) {
(this.gl[1] = Math.min(Math.abs(t), 1)), (this.g = Math.floor(255 * this.gl[1])), this.update(!0);
},
},
blueGL: {
get: function () {
return this.gl[2];
},
set: function (t) {
(this.gl[2] = Math.min(Math.abs(t), 1)), (this.b = Math.floor(255 * this.gl[2])), this.update(!0);
},
},
alphaGL: {
get: function () {
return this.gl[3];
},
set: function (t) {
(this.gl[3] = Math.min(Math.abs(t), 1)), (this.a = Math.floor(255 * this.gl[3])), this.update();
},
},
red: {
get: function () {
return this.r;
},
set: function (t) {
(t = Math.floor(Math.abs(t))), (this.r = Math.min(t, 255)), (this.gl[0] = t / 255), this.update(!0);
},
},
green: {
get: function () {
return this.g;
},
set: function (t) {
(t = Math.floor(Math.abs(t))), (this.g = Math.min(t, 255)), (this.gl[1] = t / 255), this.update(!0);
},
},
blue: {
get: function () {
return this.b;
},
set: function (t) {
(t = Math.floor(Math.abs(t))), (this.b = Math.min(t, 255)), (this.gl[2] = t / 255), this.update(!0);
},
},
alpha: {
get: function () {
return this.a;
},
set: function (t) {
(t = Math.floor(Math.abs(t))), (this.a = Math.min(t, 255)), (this.gl[3] = t / 255), this.update();
},
},
h: {
get: function () {
return this._h;
},
set: function (t) {
(this._h = t), s(t, this._s, this._v, this);
},
},
s: {
get: function () {
return this._s;
},
set: function (t) {
(this._s = t), s(this._h, t, this._v, this);
},
},
v: {
get: function () {
return this._v;
},
set: function (t) {
(this._v = t), s(this._h, this._s, t, this);
},
},
});
t.exports = h;
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e, i) {
(this.x = 0), (this.y = 0), (this.z = 0), "object" == typeof t ? ((this.x = t.x || 0), (this.y = t.y || 0), (this.z = t.z || 0)) : ((this.x = t || 0), (this.y = e || 0), (this.z = i || 0));
},
up: function () {
return (this.x = 0), (this.y = 1), (this.z = 0), this;
},
min: function (t) {
return (this.x = Math.min(this.x, t.x)), (this.y = Math.min(this.y, t.y)), (this.z = Math.min(this.z, t.z)), this;
},
max: function (t) {
return (this.x = Math.max(this.x, t.x)), (this.y = Math.max(this.y, t.y)), (this.z = Math.max(this.z, t.z)), this;
},
clone: function () {
return new n(this.x, this.y, this.z);
},
addVectors: function (t, e) {
return (this.x = t.x + e.x), (this.y = t.y + e.y), (this.z = t.z + e.z), this;
},
crossVectors: function (t, e) {
var i = t.x,
n = t.y,
s = t.z,
r = e.x,
o = e.y,
a = e.z;
return (this.x = n * a - s * o), (this.y = s * r - i * a), (this.z = i * o - n * r), this;
},
equals: function (t) {
return this.x === t.x && this.y === t.y && this.z === t.z;
},
copy: function (t) {
return (this.x = t.x), (this.y = t.y), (this.z = t.z || 0), this;
},
set: function (t, e, i) {
return "object" == typeof t ? ((this.x = t.x || 0), (this.y = t.y || 0), (this.z = t.z || 0)) : ((this.x = t || 0), (this.y = e || 0), (this.z = i || 0)), this;
},
setFromMatrixPosition: function (t) {
return this.fromArray(t.val, 12);
},
setFromMatrixColumn: function (t, e) {
return this.fromArray(t.val, 4 * e);
},
fromArray: function (t, e) {
return void 0 === e && (e = 0), (this.x = t[e]), (this.y = t[e + 1]), (this.z = t[e + 2]), this;
},
add: function (t) {
return (this.x += t.x), (this.y += t.y), (this.z += t.z || 0), this;
},
addScalar: function (t) {
return (this.x += t), (this.y += t), (this.z += t), this;
},
addScale: function (t, e) {
return (this.x += t.x * e), (this.y += t.y * e), (this.z += t.z * e || 0), this;
},
subtract: function (t) {
return (this.x -= t.x), (this.y -= t.y), (this.z -= t.z || 0), this;
},
multiply: function (t) {
return (this.x *= t.x), (this.y *= t.y), (this.z *= t.z || 1), this;
},
scale: function (t) {
return isFinite(t) ? ((this.x *= t), (this.y *= t), (this.z *= t)) : ((this.x = 0), (this.y = 0), (this.z = 0)), this;
},
divide: function (t) {
return (this.x /= t.x), (this.y /= t.y), (this.z /= t.z || 1), this;
},
negate: function () {
return (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), this;
},
distance: function (t) {
var e = t.x - this.x,
i = t.y - this.y,
n = t.z - this.z || 0;
return Math.sqrt(e * e + i * i + n * n);
},
distanceSq: function (t) {
var e = t.x - this.x,
i = t.y - this.y,
n = t.z - this.z || 0;
return e * e + i * i + n * n;
},
length: function () {
var t = this.x,
e = this.y,
i = this.z;
return Math.sqrt(t * t + e * e + i * i);
},
lengthSq: function () {
var t = this.x,
e = this.y,
i = this.z;
return t * t + e * e + i * i;
},
normalize: function () {
var t = this.x,
e = this.y,
i = this.z,
n = t * t + e * e + i * i;
return 0 < n && ((n = 1 / Math.sqrt(n)), (this.x = t * n), (this.y = e * n), (this.z = i * n)), this;
},
dot: function (t) {
return this.x * t.x + this.y * t.y + this.z * t.z;
},
cross: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.x,
r = t.y,
o = t.z;
return (this.x = i * o - n * r), (this.y = n * s - e * o), (this.z = e * r - i * s), this;
},
lerp: function (t, e) {
void 0 === e && (e = 0);
var i = this.x,
n = this.y,
s = this.z;
return (this.x = i + e * (t.x - i)), (this.y = n + e * (t.y - n)), (this.z = s + e * (t.z - s)), this;
},
applyMatrix3: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.val;
return (this.x = s[0] * e + s[3] * i + s[6] * n), (this.y = s[1] * e + s[4] * i + s[7] * n), (this.z = s[2] * e + s[5] * i + s[8] * n), this;
},
applyMatrix4: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.val,
r = 1 / (s[3] * e + s[7] * i + s[11] * n + s[15]);
return (this.x = (s[0] * e + s[4] * i + s[8] * n + s[12]) * r), (this.y = (s[1] * e + s[5] * i + s[9] * n + s[13]) * r), (this.z = (s[2] * e + s[6] * i + s[10] * n + s[14]) * r), this;
},
transformMat3: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.val;
return (this.x = e * s[0] + i * s[3] + n * s[6]), (this.y = e * s[1] + i * s[4] + n * s[7]), (this.z = e * s[2] + i * s[5] + n * s[8]), this;
},
transformMat4: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.val;
return (this.x = s[0] * e + s[4] * i + s[8] * n + s[12]), (this.y = s[1] * e + s[5] * i + s[9] * n + s[13]), (this.z = s[2] * e + s[6] * i + s[10] * n + s[14]), this;
},
transformCoordinates: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.val,
r = e * s[0] + i * s[4] + n * s[8] + s[12],
o = e * s[1] + i * s[5] + n * s[9] + s[13],
a = e * s[2] + i * s[6] + n * s[10] + s[14],
h = e * s[3] + i * s[7] + n * s[11] + s[15];
return (this.x = r / h), (this.y = o / h), (this.z = a / h), this;
},
transformQuat: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.x,
r = t.y,
o = t.z,
a = t.w,
h = a * e + r * n - o * i,
l = a * i + o * e - s * n,
u = a * n + s * i - r * e,
c = -s * e - r * i - o * n;
return (this.x = h * a + c * -s + l * -o - u * -r), (this.y = l * a + c * -r + u * -s - h * -o), (this.z = u * a + c * -o + h * -r - l * -s), this;
},
project: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.val,
r = s[0],
o = s[1],
a = s[2],
h = s[3],
l = s[4],
u = s[5],
c = s[6],
d = s[7],
f = s[8],
p = s[9],
g = s[10],
v = s[11],
y = s[12],
m = s[13],
x = s[14],
b = 1 / (e * h + i * d + n * v + s[15]);
return (this.x = (e * r + i * l + n * f + y) * b), (this.y = (e * o + i * u + n * p + m) * b), (this.z = (e * a + i * c + n * g + x) * b), this;
},
projectViewMatrix: function (t, e) {
return this.applyMatrix4(t).applyMatrix4(e);
},
unprojectViewMatrix: function (t, e) {
return this.applyMatrix4(t).applyMatrix4(e);
},
unproject: function (t, e) {
var i = t.x,
n = t.y,
s = t.z,
r = t.w,
o = this.x - i,
a = r - this.y - 1 - n,
h = this.z;
return (this.x = (2 * o) / s - 1), (this.y = (2 * a) / r - 1), (this.z = 2 * h - 1), this.project(e);
},
reset: function () {
return (this.x = 0), (this.y = 0), (this.z = 0), this;
},
});
(n.ZERO = new n()),
(n.RIGHT = new n(1, 0, 0)),
(n.LEFT = new n(-1, 0, 0)),
(n.UP = new n(0, -1, 0)),
(n.DOWN = new n(0, 1, 0)),
(n.FORWARD = new n(0, 0, 1)),
(n.BACK = new n(0, 0, -1)),
(n.ONE = new n(1, 1, 1)),
(t.exports = n);
},
function (t, e) {
t.exports = { CSV: 0, TILED_JSON: 1, ARRAY_2D: 2, WELTMEISTER: 3 };
},
function (t, e, i) {
var p = {};
t.exports = p;
var g = i(64),
u = i(83),
s = i(165),
r = i(32),
v = i(84),
c = i(271);
!(function () {
(p._inertiaScale = 4),
(p._nextCollidingGroupId = 1),
(p._nextNonCollidingGroupId = -1),
(p._nextCategory = 1),
(p.create = function (t) {
var e = {
id: r.nextId(),
type: "body",
label: "Body",
parts: [],
plugin: {},
angle: 0,
vertices: null,
position: { x: 0, y: 0 },
force: { x: 0, y: 0 },
torque: 0,
positionImpulse: { x: 0, y: 0 },
previousPositionImpulse: { x: 0, y: 0 },
constraintImpulse: { x: 0, y: 0, angle: 0 },
totalContacts: 0,
speed: 0,
angularSpeed: 0,
velocity: { x: 0, y: 0 },
angularVelocity: 0,
isSensor: !1,
isStatic: !1,
isSleeping: !1,
motion: 0,
sleepThreshold: 60,
density: 0.001,
restitution: 0,
friction: 0.1,
frictionStatic: 0.5,
frictionAir: 0.01,
collisionFilter: { category: 1, mask: 4294967295, group: 0 },
slop: 0.05,
timeScale: 1,
events: null,
bounds: null,
chamfer: null,
circleRadius: 0,
positionPrev: null,
anglePrev: 0,
parent: null,
axes: null,
area: 0,
mass: 0,
inverseMass: 0,
inertia: 0,
inverseInertia: 0,
_original: null,
render: { visible: !0, opacity: 1, sprite: { xOffset: 0, yOffset: 0 }, fillColor: null, fillOpacity: null, lineColor: null, lineOpacity: null, lineThickness: null },
gameObject: null,
scale: { x: 1, y: 1 },
centerOfMass: { x: 0, y: 0 },
centerOffset: { x: 0, y: 0 },
gravityScale: { x: 1, y: 1 },
ignoreGravity: !1,
ignorePointer: !1,
onCollideCallback: null,
onCollideEndCallback: null,
onCollideActiveCallback: null,
onCollideWith: {},
};
!t.hasOwnProperty("position") && t.hasOwnProperty("vertices") ? (t.position = g.centre(t.vertices)) : t.hasOwnProperty("vertices") || (e.vertices = g.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"));
var i = r.extend(e, t);
return (
n(i, t),
(i.setOnCollideWith = function (t, e) {
return e ? (this.onCollideWith[t.id] = e) : delete this.onCollideWith[t.id], this;
}),
i
);
}),
(p.nextGroup = function (t) {
return t ? p._nextNonCollidingGroupId-- : p._nextCollidingGroupId++;
}),
(p.nextCategory = function () {
return (p._nextCategory = p._nextCategory << 1), p._nextCategory;
});
var n = function (t, e) {
(e = e || {}),
p.set(t, {
bounds: t.bounds || v.create(t.vertices),
positionPrev: t.positionPrev || u.clone(t.position),
anglePrev: t.anglePrev || t.angle,
vertices: t.vertices,
parts: t.parts || [t],
isStatic: t.isStatic,
isSleeping: t.isSleeping,
parent: t.parent || t,
});
var i,
n,
s,
r,
o = t.bounds;
g.rotate(t.vertices, t.angle, t.position),
c.rotate(t.axes, t.angle),
v.update(o, t.vertices, t.velocity),
p.set(t, { axes: e.axes || t.axes, area: e.area || t.area, mass: e.mass || t.mass, inertia: e.inertia || t.inertia }),
1 === t.parts.length &&
((i = t.centerOfMass),
(n = t.centerOffset),
(s = o.max.x - o.min.x),
(r = o.max.y - o.min.y),
(i.x = -(o.min.x - t.position.x) / s),
(i.y = -(o.min.y - t.position.y) / r),
(n.x = s * i.x),
(n.y = r * i.y));
};
(p.set = function (t, e, i) {
var n;
for (n in ("string" == typeof e && ((n = e), ((e = {})[n] = i)), e))
if (Object.prototype.hasOwnProperty.call(e, n))
switch (((i = e[n]), n)) {
case "isStatic":
p.setStatic(t, i);
break;
case "isSleeping":
s.set(t, i);
break;
case "mass":
p.setMass(t, i);
break;
case "density":
p.setDensity(t, i);
break;
case "inertia":
p.setInertia(t, i);
break;
case "vertices":
p.setVertices(t, i);
break;
case "position":
p.setPosition(t, i);
break;
case "angle":
p.setAngle(t, i);
break;
case "velocity":
p.setVelocity(t, i);
break;
case "angularVelocity":
p.setAngularVelocity(t, i);
break;
case "parts":
p.setParts(t, i);
break;
case "centre":
p.setCentre(t, i);
break;
default:
t[n] = i;
}
}),
(p.setStatic = function (t, e) {
for (var i = 0; i < t.parts.length; i++) {
var n = t.parts[i];
(n.isStatic = e)
? ((n._original = { restitution: n.restitution, friction: n.friction, mass: n.mass, inertia: n.inertia, density: n.density, inverseMass: n.inverseMass, inverseInertia: n.inverseInertia }),
(n.restitution = 0),
(n.friction = 1),
(n.mass = n.inertia = n.density = 1 / 0),
(n.inverseMass = n.inverseInertia = 0),
(n.positionPrev.x = n.position.x),
(n.positionPrev.y = n.position.y),
(n.anglePrev = n.angle),
(n.angularVelocity = 0),
(n.speed = 0),
(n.angularSpeed = 0),
(n.motion = 0))
: n._original &&
((n.restitution = n._original.restitution),
(n.friction = n._original.friction),
(n.mass = n._original.mass),
(n.inertia = n._original.inertia),
(n.density = n._original.density),
(n.inverseMass = n._original.inverseMass),
(n.inverseInertia = n._original.inverseInertia),
(n._original = null));
}
}),
(p.setMass = function (t, e) {
var i = t.inertia / (t.mass / 6);
(t.inertia = (e / 6) * i), (t.inverseInertia = 1 / t.inertia), (t.mass = e), (t.inverseMass = 1 / t.mass), (t.density = t.mass / t.area);
}),
(p.setDensity = function (t, e) {
p.setMass(t, e * t.area), (t.density = e);
}),
(p.setInertia = function (t, e) {
(t.inertia = e), (t.inverseInertia = 1 / t.inertia);
}),
(p.setVertices = function (t, e) {
e[0].body === t ? (t.vertices = e) : (t.vertices = g.create(e, t)), (t.axes = c.fromVertices(t.vertices)), (t.area = g.area(t.vertices)), p.setMass(t, t.density * t.area);
var i = g.centre(t.vertices);
g.translate(t.vertices, i, -1), p.setInertia(t, p._inertiaScale * g.inertia(t.vertices, t.mass)), g.translate(t.vertices, t.position), v.update(t.bounds, t.vertices, t.velocity);
}),
(p.setParts = function (t, e, i) {
for (e = e.slice(0), t.parts.length = 0, t.parts.push(t), t.parent = t, r = 0; r < e.length; r++) {
var n = e[r];
n !== t && (n.parent = t).parts.push(n);
}
if (1 !== t.parts.length) {
if ((i = void 0 === i || i)) {
for (var s = [], r = 0; r < e.length; r++) s = s.concat(e[r].vertices);
g.clockwiseSort(s);
var o = g.hull(s),
a = g.centre(o);
p.setVertices(t, o), g.translate(t.vertices, a);
}
var h = p._totalProperties(t),
l = h.centre.x,
u = h.centre.y,
c = t.bounds,
d = t.centerOfMass,
f = t.centerOffset;
v.update(c, t.vertices, t.velocity),
(d.x = -(c.min.x - l) / (c.max.x - c.min.x)),
(d.y = -(c.min.y - u) / (c.max.y - c.min.y)),
(f.x = l),
(f.y = u),
(t.area = h.area),
((t.parent = t).position.x = l),
(t.position.y = u),
(t.positionPrev.x = l),
(t.positionPrev.y = u),
p.setMass(t, h.mass),
p.setInertia(t, h.inertia),
p.setPosition(t, h.centre);
}
}),
(p.setCentre = function (t, e, i) {
i
? ((t.positionPrev.x += e.x), (t.positionPrev.y += e.y), (t.position.x += e.x), (t.position.y += e.y))
: ((t.positionPrev.x = e.x - (t.position.x - t.positionPrev.x)), (t.positionPrev.y = e.y - (t.position.y - t.positionPrev.y)), (t.position.x = e.x), (t.position.y = e.y));
}),
(p.setPosition = function (t, e) {
var i = u.sub(e, t.position);
(t.positionPrev.x += i.x), (t.positionPrev.y += i.y);
for (var n = 0; n < t.parts.length; n++) {
var s = t.parts[n];
(s.position.x += i.x), (s.position.y += i.y), g.translate(s.vertices, i), v.update(s.bounds, s.vertices, t.velocity);
}
}),
(p.setAngle = function (t, e) {
var i = e - t.angle;
t.anglePrev += i;
for (var n = 0; n < t.parts.length; n++) {
var s = t.parts[n];
(s.angle += i), g.rotate(s.vertices, i, t.position), c.rotate(s.axes, i), v.update(s.bounds, s.vertices, t.velocity), 0 < n && u.rotateAbout(s.position, i, t.position, s.position);
}
}),
(p.setVelocity = function (t, e) {
(t.positionPrev.x = t.position.x - e.x), (t.positionPrev.y = t.position.y - e.y), (t.velocity.x = e.x), (t.velocity.y = e.y), (t.speed = u.magnitude(t.velocity));
}),
(p.setAngularVelocity = function (t, e) {
(t.anglePrev = t.angle - e), (t.angularVelocity = e), (t.angularSpeed = Math.abs(t.angularVelocity));
}),
(p.translate = function (t, e) {
p.setPosition(t, u.add(t.position, e));
}),
(p.rotate = function (t, e, i) {
var n, s, r, o;
i && ((n = Math.cos(e)), (s = Math.sin(e)), (r = t.position.x - i.x), (o = t.position.y - i.y), p.setPosition(t, { x: i.x + (r * n - o * s), y: i.y + (r * s + o * n) })), p.setAngle(t, t.angle + e);
}),
(p.scale = function (t, e, i, n) {
var s = 0,
r = 0;
n = n || t.position;
for (var o = 0; o < t.parts.length; o++) {
var a = t.parts[o];
(a.scale.x = e),
(a.scale.y = i),
g.scale(a.vertices, e, i, n),
(a.axes = c.fromVertices(a.vertices)),
(a.area = g.area(a.vertices)),
p.setMass(a, t.density * a.area),
g.translate(a.vertices, { x: -a.position.x, y: -a.position.y }),
p.setInertia(a, p._inertiaScale * g.inertia(a.vertices, a.mass)),
g.translate(a.vertices, { x: a.position.x, y: a.position.y }),
0 < o && ((s += a.area), (r += a.inertia)),
(a.position.x = n.x + (a.position.x - n.x) * e),
(a.position.y = n.y + (a.position.y - n.y) * i),
v.update(a.bounds, a.vertices, t.velocity);
}
1 < t.parts.length && ((t.area = s), t.isStatic || (p.setMass(t, t.density * s), p.setInertia(t, r))), t.circleRadius && (e === i ? (t.circleRadius *= e) : (t.circleRadius = null));
}),
(p.update = function (t, e, i, n) {
var s = Math.pow(e * i * t.timeScale, 2),
r = 1 - t.frictionAir * i * t.timeScale,
o = t.position.x - t.positionPrev.x,
a = t.position.y - t.positionPrev.y;
(t.velocity.x = o * r * n + (t.force.x / t.mass) * s),
(t.velocity.y = a * r * n + (t.force.y / t.mass) * s),
(t.positionPrev.x = t.position.x),
(t.positionPrev.y = t.position.y),
(t.position.x += t.velocity.x),
(t.position.y += t.velocity.y),
(t.angularVelocity = (t.angle - t.anglePrev) * r * n + (t.torque / t.inertia) * s),
(t.anglePrev = t.angle),
(t.angle += t.angularVelocity),
(t.speed = u.magnitude(t.velocity)),
(t.angularSpeed = Math.abs(t.angularVelocity));
for (var h = 0; h < t.parts.length; h++) {
var l = t.parts[h];
g.translate(l.vertices, t.velocity),
0 < h && ((l.position.x += t.velocity.x), (l.position.y += t.velocity.y)),
0 !== t.angularVelocity && (g.rotate(l.vertices, t.angularVelocity, t.position), c.rotate(l.axes, t.angularVelocity), 0 < h && u.rotateAbout(l.position, t.angularVelocity, t.position, l.position)),
v.update(l.bounds, l.vertices, t.velocity);
}
}),
(p.applyForce = function (t, e, i) {
(t.force.x += i.x), (t.force.y += i.y);
var n = e.x - t.position.x,
s = e.y - t.position.y;
t.torque += n * i.y - s * i.x;
}),
(p._totalProperties = function (t) {
for (var e = { mass: 0, area: 0, inertia: 0, centre: { x: 0, y: 0 } }, i = 1 === t.parts.length ? 0 : 1; i < t.parts.length; i++) {
var n = t.parts[i],
s = n.mass !== 1 / 0 ? n.mass : 1;
(e.mass += s), (e.area += n.area), (e.inertia += n.inertia), (e.centre = u.add(e.centre, u.mult(n.position, s)));
}
return (e.centre = u.div(e.centre, e.mass)), e;
});
})();
},
function (t, e) {
t.exports = function (t) {
return t.y + t.height - t.height * t.originY;
};
},
function (t, e) {
t.exports = function (t) {
return t.x - t.width * t.originX;
};
},
function (t, e) {
t.exports = function (t) {
return t.x + t.width - t.width * t.originX;
};
},
function (t, e) {
t.exports = function (t) {
return t.y - t.height * t.originY;
};
},
function (t, e) {
t.exports = function (t, e, i, n, s, r) {
var o;
void 0 === n && (n = 0), void 0 === s && (s = 0), void 0 === r && (r = 1);
var a = 0,
h = t.length;
if (1 === r) for (o = s; o < h; o++) (t[o][e] += i + a * n), a++;
else for (o = s; 0 <= o; o--) (t[o][e] += i + a * n), a++;
return t;
};
},
function (t, e, i) {
var n = i(0),
s = i(307),
r = i(172),
o = i(56),
a = i(173),
h = i(3),
l = new n({
initialize: function (t, e, i, n) {
void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === n && (n = 0), (this.type = o.LINE), (this.x1 = t), (this.y1 = e), (this.x2 = i), (this.y2 = n);
},
getPoint: function (t, e) {
return s(this, t, e);
},
getPoints: function (t, e, i) {
return r(this, t, e, i);
},
getRandomPoint: function (t) {
return a(this, t);
},
setTo: function (t, e, i, n) {
return void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === n && (n = 0), (this.x1 = t), (this.y1 = e), (this.x2 = i), (this.y2 = n), this;
},
getPointA: function (t) {
return void 0 === t && (t = new h()), t.set(this.x1, this.y1), t;
},
getPointB: function (t) {
return void 0 === t && (t = new h()), t.set(this.x2, this.y2), t;
},
left: {
get: function () {
return Math.min(this.x1, this.x2);
},
set: function (t) {
this.x1 <= this.x2 ? (this.x1 = t) : (this.x2 = t);
},
},
right: {
get: function () {
return Math.max(this.x1, this.x2);
},
set: function (t) {
this.x1 > this.x2 ? (this.x1 = t) : (this.x2 = t);
},
},
top: {
get: function () {
return Math.min(this.y1, this.y2);
},
set: function (t) {
this.y1 <= this.y2 ? (this.y1 = t) : (this.y2 = t);
},
},
bottom: {
get: function () {
return Math.max(this.y1, this.y2);
},
set: function (t) {
this.y1 > this.y2 ? (this.y1 = t) : (this.y2 = t);
},
},
});
t.exports = l;
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = i || e.fillColor,
r = n || e.fillAlpha,
o = (16711680 & s) >>> 16,
a = (65280 & s) >>> 8,
h = 255 & s;
t.fillStyle = "rgba(" + o + "," + a + "," + h + "," + r + ")";
};
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e, i, n) {
var s = [];
n.forEach(function (t) {
t && s.push(t);
}),
(this.loader = t),
(this.type = e),
(this.key = i),
(this.multiKeyIndex = t.multiKeyIndex++),
(this.files = s),
(this.complete = !1),
(this.pending = s.length),
(this.failed = 0),
(this.config = {}),
(this.baseURL = t.baseURL),
(this.path = t.path),
(this.prefix = t.prefix);
for (var r = 0; r < s.length; r++) s[r].multiFile = this;
},
isReadyToProcess: function () {
return 0 === this.pending && 0 === this.failed && !this.complete;
},
addToMultiFile: function (t) {
return this.files.push(t), (t.multiFile = this).pending++, (this.complete = !1), this;
},
onFileComplete: function (t) {
-1 !== this.files.indexOf(t) && this.pending--;
},
onFileFailed: function (t) {
-1 !== this.files.indexOf(t) && this.failed++;
},
});
t.exports = n;
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = t - i,
r = e - n;
return Math.sqrt(s * s + r * r);
};
},
function (t, e, i) {
t.exports = {
BOOT: i(922),
DESTROY: i(923),
DRAG_END: i(924),
DRAG_ENTER: i(925),
DRAG: i(926),
DRAG_LEAVE: i(927),
DRAG_OVER: i(928),
DRAG_START: i(929),
DROP: i(930),
GAME_OUT: i(931),
GAME_OVER: i(932),
GAMEOBJECT_DOWN: i(933),
GAMEOBJECT_DRAG_END: i(934),
GAMEOBJECT_DRAG_ENTER: i(935),
GAMEOBJECT_DRAG: i(936),
GAMEOBJECT_DRAG_LEAVE: i(937),
GAMEOBJECT_DRAG_OVER: i(938),
GAMEOBJECT_DRAG_START: i(939),
GAMEOBJECT_DROP: i(940),
GAMEOBJECT_MOVE: i(941),
GAMEOBJECT_OUT: i(942),
GAMEOBJECT_OVER: i(943),
GAMEOBJECT_POINTER_DOWN: i(944),
GAMEOBJECT_POINTER_MOVE: i(945),
GAMEOBJECT_POINTER_OUT: i(946),
GAMEOBJECT_POINTER_OVER: i(947),
GAMEOBJECT_POINTER_UP: i(948),
GAMEOBJECT_POINTER_WHEEL: i(949),
GAMEOBJECT_UP: i(950),
GAMEOBJECT_WHEEL: i(951),
MANAGER_BOOT: i(952),
MANAGER_PROCESS: i(953),
MANAGER_UPDATE: i(954),
POINTER_DOWN: i(955),
POINTER_DOWN_OUTSIDE: i(956),
POINTER_MOVE: i(957),
POINTER_OUT: i(958),
POINTER_OVER: i(959),
POINTER_UP: i(960),
POINTER_UP_OUTSIDE: i(961),
POINTER_WHEEL: i(962),
POINTERLOCK_CHANGE: i(963),
PRE_UPDATE: i(964),
SHUTDOWN: i(965),
START: i(966),
UPDATE: i(967),
};
},
function (t, e) {
t.exports = function (t, e) {
return (t.y = e + t.height * t.originY), t;
};
},
function (t, e) {
t.exports = function (t, e) {
return (t.x = e + t.width * t.originX), t;
};
},
function (t, e) {
t.exports = function (t, e) {
return (t.x = e - t.width + t.width * t.originX), t;
};
},
function (t, e) {
t.exports = function (t, e) {
return (t.y = e - t.height + t.height * t.originY), t;
};
},
function (t, e) {
t.exports = { CIRCLE: 0, ELLIPSE: 1, LINE: 2, POINT: 3, POLYGON: 4, RECTANGLE: 5, TRIANGLE: 6 };
},
function (t, e) {
t.exports = function (t, e, i) {
return !(t.width <= 0 || t.height <= 0) && t.x <= e && t.x + t.width >= e && t.y <= i && t.y + t.height >= i;
};
},
function (t, e, i) {
var n = i(0),
m = i(175),
s = i(9),
v = i(374),
x = i(2),
y = i(69),
b = i(91),
w = i(141),
T = i(12),
S = i(375),
r = new n({
Extends: s,
initialize: function (t) {
s.call(this);
var e = t.game,
i = e.renderer,
n = i.gl;
(this.name = x(t, "name", "WebGLPipeline")),
(this.game = e),
(this.renderer = i),
this.manager,
(this.gl = n),
(this.view = e.canvas),
(this.width = 0),
(this.height = 0),
(this.vertexCount = 0),
(this.vertexCapacity = 0),
this.vertexData,
this.vertexBuffer,
(this.topology = x(t, "topology", n.TRIANGLES)),
this.bytes,
this.vertexViewF32,
this.vertexViewU32,
(this.active = !0),
(this.currentUnit = 0),
(this.forceZero = x(t, "forceZero", !1)),
(this.hasBooted = !1),
(this.isPostFX = !1),
(this.renderTargets = []),
this.currentRenderTarget,
(this.shaders = []),
this.currentShader,
this.projectionMatrix,
(this.projectionWidth = 0),
(this.projectionHeight = 0),
(this.config = t),
(this.glReset = !1);
},
boot: function () {
var t = this.gl,
e = this.config,
i = this.renderer;
this.isPostFX || (this.projectionMatrix = new y().identity());
var n = this.renderTargets,
s = x(e, "renderTarget", !1);
"boolean" == typeof s && s && (s = 1);
var r = i.width,
o = i.height;
if ("number" == typeof s) for (d = 0; d < s; d++) n.push(new w(i, r, o, 1, 0, !0));
else if (Array.isArray(s))
for (d = 0; d < s.length; d++) {
var a = x(s[d], "scale", 1),
h = x(s[d], "minFilter", 0),
l = x(s[d], "autoClear", 1);
n.push(new w(i, r, o, a, h, l));
}
n.length && (this.currentRenderTarget = n[0]), this.setShadersFromConfig(e);
for (var u = this.shaders, c = 0, d = 0; d < u.length; d++) u[d].vertexSize > c && (c = u[d].vertexSize);
var f = x(e, "batchSize", i.config.batchSize);
this.vertexCapacity = 6 * f;
var p = new ArrayBuffer(this.vertexCapacity * c);
(this.vertexData = p), (this.bytes = new Uint8Array(p)), (this.vertexViewF32 = new Float32Array(p)), (this.vertexViewU32 = new Uint32Array(p));
var g = x(e, "vertices", null);
for (
g ? (this.vertexViewF32.set(g), (this.vertexBuffer = i.createVertexBuffer(p, t.STATIC_DRAW))) : (this.vertexBuffer = i.createVertexBuffer(p.byteLength, t.DYNAMIC_DRAW)),
this.setVertexBuffer(),
d = u.length - 1;
0 <= d;
d--
)
u[d].rebind();
(this.hasBooted = !0),
i.on(b.RESIZE, this.resize, this),
i.on(b.PRE_RENDER, this.onPreRender, this),
i.on(b.RENDER, this.onRender, this),
i.on(b.POST_RENDER, this.onPostRender, this),
this.emit(v.BOOT, this),
this.onBoot();
},
onBoot: function () {},
onResize: function () {},
setShader: function (t, e) {
var i = this.renderer;
return (
(t === this.currentShader && i.currentProgram === this.currentShader.program) || (this.flush(), i.resetTextures(), this.setVertexBuffer() && !e && (e = !0), t.bind(e, !1), (this.currentShader = t)), this
);
},
getShaderByName: function (t) {
for (var e = this.shaders, i = 0; i < e.length; i++) if (e[i].name === t) return e[i];
},
setShadersFromConfig: function (t) {
var e = this.shaders,
i = this.renderer;
for (d = 0; d < e.length; d++) e[d].destroy();
var n = "vertShader",
s = "fragShader",
r = "attributes",
o = x(t, n, null),
a = T.parseFragmentShaderMaxTextures(x(t, s, null), i.maxTextures),
h = x(t, r, null),
l = x(t, "shaders", []),
u = l.length;
if (0 === u) o && a && (this.shaders = [new S(this, "default", o, a, m(h))]);
else {
for (var c = [], d = 0; d < u; d++) {
var f = l[d],
p = x(f, "name", "default"),
g = x(f, n, o),
v = T.parseFragmentShaderMaxTextures(x(f, s, a), i.maxTextures),
y = x(f, r, h);
g && v && c.push(new S(this, p, g, v, m(y)));
}
this.shaders = c;
}
return 0 === this.shaders.length || (this.currentShader = this.shaders[0]), this;
},
setGameObject: function (t, e) {
return void 0 === e && (e = t.frame), (this.currentUnit = this.renderer.setTextureSource(e.source)), this.currentUnit;
},
shouldFlush: function (t) {
return void 0 === t && (t = 0), this.vertexCount + t > this.vertexCapacity;
},
resize: function (t, e) {
(t === this.width && e === this.height) || this.flush(), (this.width = t), (this.height = e);
for (var i = this.renderTargets, n = 0; n < i.length; n++) i[n].resize(t, e);
return this.setProjectionMatrix(t, e), this.emit(v.RESIZE, t, e, this), this.onResize(t, e), this;
},
setProjectionMatrix: function (t, e) {
var i = this.projectionMatrix;
if (!i) return this;
(this.projectionWidth = t), (this.projectionHeight = e), i.ortho(0, t, e, 0, -1e3, 1e3);
for (var n = this.shaders, s = "uProjectionMatrix", r = 0; r < n.length; r++) {
var o = n[r];
o.hasUniform(s) && (o.resetUniform(s), o.setMatrix4fv(s, !1, i.val, o));
}
return this;
},
updateProjectionMatrix: function () {
var t, e;
this.projectionMatrix && ((t = this.renderer.projectionWidth), (e = this.renderer.projectionHeight), (this.projectionWidth === t && this.projectionHeight === e) || this.setProjectionMatrix(t, e));
},
bind: function (t) {
if ((void 0 === t && (t = this.currentShader), this.glReset)) return this.rebind(t);
var e = this.setVertexBuffer();
return t.bind(e), (this.currentShader = t), this.emit(v.BIND, this, t), this.onActive(t), this;
},
rebind: function (t) {
this.setVertexBuffer();
for (var e = this.shaders, i = e.length - 1; 0 <= i; i--) {
var n = e[i].rebind();
(t && n !== t) || (this.currentShader = n);
}
return this.emit(v.REBIND, this.currentShader), this.onActive(this.currentShader), this.onRebind(), (this.glReset = !1), this;
},
setVertexBuffer: function () {
var t = this.gl,
e = this.vertexBuffer;
return t.getParameter(t.ARRAY_BUFFER_BINDING) !== e && (t.bindBuffer(t.ARRAY_BUFFER, e), !0);
},
preBatch: function (t) {
return this.currentRenderTarget && this.currentRenderTarget.bind(), this.onPreBatch(t), this;
},
postBatch: function (t) {
return this.onDraw(this.currentRenderTarget), this.onPostBatch(t), this;
},
onDraw: function () {},
unbind: function () {
this.currentRenderTarget && this.currentRenderTarget.unbind();
},
flush: function (t) {
var e, i, n;
return (
void 0 === t && (t = !1),
0 < this.vertexCount &&
(this.emit(v.BEFORE_FLUSH, this, t),
this.onBeforeFlush(t),
(e = this.gl),
(i = this.vertexCount),
(n = this.currentShader.vertexSize),
this.active &&
(this.setVertexBuffer(),
i === this.vertexCapacity ? e.bufferData(e.ARRAY_BUFFER, this.vertexData, e.DYNAMIC_DRAW) : e.bufferSubData(e.ARRAY_BUFFER, 0, this.bytes.subarray(0, i * n)),
e.drawArrays(this.topology, 0, i)),
(this.vertexCount = 0),
this.emit(v.AFTER_FLUSH, this, t),
this.onAfterFlush(t)),
this
);
},
onActive: function () {},
onBind: function () {},
onRebind: function () {},
onBatch: function () {},
onPreBatch: function () {},
onPostBatch: function () {},
onPreRender: function () {},
onRender: function () {},
onPostRender: function () {},
onBeforeFlush: function () {},
onAfterFlush: function () {},
batchVert: function (t, e, i, n, s, r, o) {
var a = this.vertexViewF32,
h = this.vertexViewU32,
l = this.vertexCount * this.currentShader.vertexComponentCount - 1;
(a[++l] = t), (a[++l] = e), (a[++l] = i), (a[++l] = n), (a[++l] = s), (a[++l] = r), (h[++l] = o), this.vertexCount++;
},
batchQuad: function (t, e, i, n, s, r, o, a, h, l, u, c, d, f, p, g, v, y, m, x) {
void 0 === x && (x = this.currentUnit);
var b = !1;
return (
this.shouldFlush(6) && (this.flush(), (b = !0), (x = this.setTexture2D(m))),
this.batchVert(e, i, l, u, x, y, f),
this.batchVert(n, s, l, d, x, y, g),
this.batchVert(r, o, c, d, x, y, v),
this.batchVert(e, i, l, u, x, y, f),
this.batchVert(r, o, c, d, x, y, v),
this.batchVert(a, h, c, u, x, y, p),
this.onBatch(t),
b
);
},
batchTri: function (t, e, i, n, s, r, o, a, h, l, u, c, d, f, p, g, v) {
void 0 === v && (v = this.currentUnit);
var y = !1;
return (
this.shouldFlush(3) && (this.flush(), (y = !0), (v = this.setTexture2D(g))),
this.batchVert(e, i, a, h, v, p, c),
this.batchVert(n, s, a, u, v, p, d),
this.batchVert(r, o, l, u, v, p, f),
this.onBatch(t),
y
);
},
drawFillRect: function (t, e, i, n, s, r, o, a) {
void 0 === o && (o = this.renderer.whiteTexture.glTexture), void 0 === a && (a = !0), (t = Math.floor(t)), (e = Math.floor(e));
var h = Math.floor(t + i),
l = Math.floor(e + n),
u = this.setTexture2D(o),
c = T.getTintAppendFloatAlphaAndSwap(s, r),
d = 0,
f = 1;
a && ((d = 1), (f = 0)), this.batchQuad(null, t, e, t, l, h, l, h, e, 0, d, 1, f, c, c, c, c, 0, o, u);
},
setTexture2D: function (t) {
return void 0 === t && (t = this.renderer.whiteTexture.glTexture), (this.currentUnit = this.renderer.setTexture2D(t)), this.currentUnit;
},
bindTexture: function (t, e) {
void 0 === e && (e = 0);
var i = this.gl;
return i.activeTexture(i.TEXTURE0 + e), i.bindTexture(i.TEXTURE_2D, t), this;
},
bindRenderTarget: function (t, e) {
return this.bindTexture(t.texture, e);
},
setTime: function (t) {
return this.set1f(t, this.game.loop.getDuration()), this;
},
set1f: function (t, e, i) {
return void 0 === i && (i = this.currentShader), i.set1f(t, e), this;
},
set2f: function (t, e, i, n) {
return void 0 === n && (n = this.currentShader), n.set2f(t, e, i), this;
},
set3f: function (t, e, i, n, s) {
return void 0 === s && (s = this.currentShader), s.set3f(t, e, i, n), this;
},
set4f: function (t, e, i, n, s, r) {
return void 0 === r && (r = this.currentShader), r.set4f(t, e, i, n, s), this;
},
set1fv: function (t, e, i) {
return void 0 === i && (i = this.currentShader), i.set1fv(t, e), this;
},
set2fv: function (t, e, i) {
return void 0 === i && (i = this.currentShader), i.set2fv(t, e), this;
},
set3fv: function (t, e, i) {
return void 0 === i && (i = this.currentShader), i.set3fv(t, e), this;
},
set4fv: function (t, e, i) {
return void 0 === i && (i = this.currentShader), i.set4fv(t, e), this;
},
set1iv: function (t, e, i) {
return void 0 === i && (i = this.currentShader), i.set1iv(t, e), this;
},
set2iv: function (t, e, i) {
return void 0 === i && (i = this.currentShader), i.set2iv(t, e), this;
},
set3iv: function (t, e, i) {
return void 0 === i && (i = this.currentShader), i.set3iv(t, e), this;
},
set4iv: function (t, e, i) {
return void 0 === i && (i = this.currentShader), i.set4iv(t, e), this;
},
set1i: function (t, e, i) {
return void 0 === i && (i = this.currentShader), i.set1i(t, e), this;
},
set2i: function (t, e, i, n) {
return void 0 === n && (n = this.currentShader), n.set2i(t, e, i), this;
},
set3i: function (t, e, i, n, s) {
return void 0 === s && (s = this.currentShader), s.set3i(t, e, i, n), this;
},
set4i: function (t, e, i, n, s, r) {
return void 0 === r && (r = this.currentShader), r.set4i(t, e, i, n, s), this;
},
setMatrix2fv: function (t, e, i, n) {
return void 0 === n && (n = this.currentShader), n.setMatrix2fv(t, e, i), this;
},
setMatrix3fv: function (t, e, i, n) {
return void 0 === n && (n = this.currentShader), n.setMatrix3fv(t, e, i), this;
},
setMatrix4fv: function (t, e, i, n) {
return void 0 === n && (n = this.currentShader), n.setMatrix4fv(t, e, i), this;
},
destroy: function () {
this.emit(v.DESTROY, this);
for (var t = this.shaders, e = 0; e < t.length; e++) t[e].destroy();
var i = this.renderTargets;
for (e = 0; e < i.length; e++) i[e].destroy();
this.gl.deleteBuffer(this.vertexBuffer);
var n = this.renderer;
return (
n.off(b.RESIZE, this.resize, this),
n.off(b.PRE_RENDER, this.onPreRender, this),
n.off(b.RENDER, this.onRender, this),
n.off(b.POST_RENDER, this.onPostRender, this),
this.removeAllListeners(),
(this.game = null),
(this.renderer = null),
(this.manager = null),
(this.gl = null),
(this.view = null),
(this.shaders = null),
(this.renderTargets = null),
(this.bytes = null),
(this.vertexViewF32 = null),
(this.vertexViewU32 = null),
(this.vertexData = null),
(this.vertexBuffer = null),
(this.currentShader = null),
(this.currentRenderTarget = null),
this
);
},
});
t.exports = r;
},
function (t, e, i) {
"use strict";
function n(t, e, i) {
i = i || 2;
var n,
s,
r,
o,
a,
h,
l,
u = e && e.length,
c = u ? e[0] * i : t.length,
d = g(t, 0, c, i, !0),
f = [];
if (!d || d.next === d.prev) return f;
if (
(u &&
(d = (function (t, e, i, n) {
var s,
r,
o,
a,
h,
l,
u = [];
for (s = 0, r = e.length; s < r; s++)
(o = g(t, e[s] * n, s < r - 1 ? e[s + 1] * n : t.length, n, !1)) === o.next && (o.steiner = !0),
u.push(
(function (t) {
for (var e = t, i = t; (e.x < i.x || (e.x === i.x && e.y < i.y)) && (i = e), (e = e.next) !== t; );
return i;
})(o)
);
for (u.sort(y), s = 0; s < u.length; s++)
(a = u[s]),
(l = void 0),
(h = (function (t, e) {
var i,
n = e,
s = t.x,
r = t.y,
o = -1 / 0;
do {
if (r <= n.y && r >= n.next.y && n.next.y !== n.y) {
var a = n.x + ((r - n.y) * (n.next.x - n.x)) / (n.next.y - n.y);
if (a <= s && o < a) {
if ((o = a) === s) {
if (r === n.y) return n;
if (r === n.next.y) return n.next;
}
i = n.x < n.next.x ? n : n.next;
}
}
n = n.next;
} while (n !== e);
if (!i) return null;
if (s === o) return i;
var h,
l,
u,
c = i,
d = i.x,
f = i.y,
p = 1 / 0;
for (
n = i;
s >= n.x &&
n.x >= d &&
s !== n.x &&
x(r < f ? s : o, r, d, f, r < f ? o : s, r, n.x, n.y) &&
((h = Math.abs(r - n.y) / (s - n.x)),
S(n, t) && (h < p || (h === p && (n.x > i.x || (n.x === i.x && ((u = n), b((l = i).prev, l, u.prev) < 0 && b(u.next, l, l.next) < 0))))) && ((i = n), (p = h))),
(n = n.next) !== c;
);
return i;
})(a, (h = i))) && ((l = _(h, a)), v(h, h.next), v(l, l.next)),
(i = v(i, i.next));
return i;
})(t, e, d, i)),
t.length > 80 * i)
) {
(n = r = t[0]), (s = o = t[1]);
for (var p = i; p < c; p += i) (a = t[p]) < n && (n = a), (h = t[p + 1]) < s && (s = h), r < a && (r = a), o < h && (o = h);
l = 0 !== (l = Math.max(r - n, o - s)) ? 1 / l : 0;
}
return (
(function c(t, e, i, n, s, r, o) {
if (t) {
!o &&
r &&
(function (t, e, i, n) {
for (var s = t; null === s.z && (s.z = m(s.x, s.y, e, i, n)), (s.prevZ = s.prev), (s.nextZ = s.next), (s = s.next) !== t; );
(s.prevZ.nextZ = null),
(s.prevZ = null),
(function (t) {
var e,
i,
n,
s,
r,
o,
a,
h,
l = 1;
do {
for (i = t, r = t = null, o = 0; i; ) {
for (o++, n = i, e = a = 0; e < l && (a++, (n = n.nextZ)); e++);
for (h = l; 0 < a || (0 < h && n); )
0 !== a && (0 === h || !n || i.z <= n.z) ? ((i = (s = i).nextZ), a--) : ((n = (s = n).nextZ), h--), r ? (r.nextZ = s) : (t = s), (s.prevZ = r), (r = s);
i = n;
}
(r.nextZ = null), (l *= 2);
} while (1 < o);
})(s);
})(t, n, s, r);
for (var a, h, l = t; t.prev !== t.next; )
if (
((a = t.prev),
(h = t.next),
r
? (function (t, e, i, n) {
var s = t.prev,
r = t,
o = t.next;
if (0 <= b(s, r, o)) return !1;
for (
var a = s.x < r.x ? (s.x < o.x ? s.x : o.x) : r.x < o.x ? r.x : o.x,
h = s.y < r.y ? (s.y < o.y ? s.y : o.y) : r.y < o.y ? r.y : o.y,
l = s.x > r.x ? (s.x > o.x ? s.x : o.x) : r.x > o.x ? r.x : o.x,
u = s.y > r.y ? (s.y > o.y ? s.y : o.y) : r.y > o.y ? r.y : o.y,
c = m(a, h, e, i, n),
d = m(l, u, e, i, n),
f = t.prevZ,
p = t.nextZ;
f && f.z >= c && p && p.z <= d;
) {
if (f !== t.prev && f !== t.next && x(s.x, s.y, r.x, r.y, o.x, o.y, f.x, f.y) && 0 <= b(f.prev, f, f.next)) return !1;
if (((f = f.prevZ), p !== t.prev && p !== t.next && x(s.x, s.y, r.x, r.y, o.x, o.y, p.x, p.y) && 0 <= b(p.prev, p, p.next))) return !1;
p = p.nextZ;
}
for (; f && f.z >= c; ) {
if (f !== t.prev && f !== t.next && x(s.x, s.y, r.x, r.y, o.x, o.y, f.x, f.y) && 0 <= b(f.prev, f, f.next)) return !1;
f = f.prevZ;
}
for (; p && p.z <= d; ) {
if (p !== t.prev && p !== t.next && x(s.x, s.y, r.x, r.y, o.x, o.y, p.x, p.y) && 0 <= b(p.prev, p, p.next)) return !1;
p = p.nextZ;
}
return !0;
})(t, n, s, r)
: (function (t) {
var e = t.prev,
i = t,
n = t.next;
if (0 <= b(e, i, n)) return !1;
for (var s = t.next.next; s !== t.prev; ) {
if (x(e.x, e.y, i.x, i.y, n.x, n.y, s.x, s.y) && 0 <= b(s.prev, s, s.next)) return !1;
s = s.next;
}
return !0;
})(t))
)
e.push(a.i / i), e.push(t.i / i), e.push(h.i / i), E(t), (t = h.next), (l = h.next);
else if ((t = h) === l) {
o
? 1 === o
? c(
(t = (function (t, e, i) {
var n = t;
do {
var s = n.prev,
r = n.next.next;
!w(s, r) && T(s, n, n.next, r) && S(s, r) && S(r, s) && (e.push(s.i / i), e.push(n.i / i), e.push(r.i / i), E(n), E(n.next), (n = t = r)), (n = n.next);
} while (n !== t);
return v(n);
})(v(t), e, i)),
e,
i,
n,
s,
r,
2
)
: 2 === o &&
(function (t, e, i, n, s, r) {
var o,
a,
h = t;
do {
for (var l = h.next.next; l !== h.prev; ) {
if (
h.i !== l.i &&
((a = l),
(o = h).next.i !== a.i &&
o.prev.i !== a.i &&
!(function (t, e) {
var i = t;
do {
if (i.i !== t.i && i.next.i !== t.i && i.i !== e.i && i.next.i !== e.i && T(i, i.next, t, e)) return !0;
i = i.next;
} while (i !== t);
return !1;
})(o, a) &&
((S(o, a) &&
S(a, o) &&
(function (t, e) {
for (
var i = t, n = !1, s = (t.x + e.x) / 2, r = (t.y + e.y) / 2;
i.y > r != i.next.y > r && i.next.y !== i.y && s < ((i.next.x - i.x) * (r - i.y)) / (i.next.y - i.y) + i.x && (n = !n), (i = i.next) !== t;
);
return n;
})(o, a) &&
(b(o.prev, o, a.prev) || b(o, a.prev, a))) ||
(w(o, a) && 0 < b(o.prev, o, o.next) && 0 < b(a.prev, a, a.next))))
) {
var u = _(h, l);
return (h = v(h, h.next)), (u = v(u, u.next)), c(h, e, i, n, s, r), c(u, e, i, n, s, r);
}
l = l.next;
}
h = h.next;
} while (h !== t);
})(t, e, i, n, s, r)
: c(v(t), e, i, n, s, r, 1);
break;
}
}
})(d, f, i, n, s, l),
f
);
}
function g(t, e, i, n, s) {
var r, o;
if (s === 0 < P(t, e, i, n)) for (r = e; r < i; r += n) o = a(r, t[r], t[r + 1], o);
else for (r = i - n; e <= r; r -= n) o = a(r, t[r], t[r + 1], o);
return o && w(o, o.next) && (E(o), (o = o.next)), o;
}
function v(t, e) {
if (!t) return t;
e = e || t;
var i,
n = t;
do {
if (((i = !1), n.steiner || (!w(n, n.next) && 0 !== b(n.prev, n, n.next)))) n = n.next;
else {
if ((E(n), (n = e = n.prev) === n.next)) break;
i = !0;
}
} while (i || n !== e);
return e;
}
function y(t, e) {
return t.x - e.x;
}
function m(t, e, i, n, s) {
return (
(t = 1431655765 & ((t = 858993459 & ((t = 252645135 & ((t = 16711935 & ((t = 32767 * (t - i) * s) | (t << 8))) | (t << 4))) | (t << 2))) | (t << 1))) |
((e = 1431655765 & ((e = 858993459 & ((e = 252645135 & ((e = 16711935 & ((e = 32767 * (e - n) * s) | (e << 8))) | (e << 4))) | (e << 2))) | (e << 1))) << 1)
);
}
function x(t, e, i, n, s, r, o, a) {
return 0 <= (s - o) * (e - a) - (t - o) * (r - a) && 0 <= (t - o) * (n - a) - (i - o) * (e - a) && 0 <= (i - o) * (r - a) - (s - o) * (n - a);
}
function b(t, e, i) {
return (e.y - t.y) * (i.x - e.x) - (e.x - t.x) * (i.y - e.y);
}
function w(t, e) {
return t.x === e.x && t.y === e.y;
}
function T(t, e, i, n) {
var s = l(b(t, e, i)),
r = l(b(t, e, n)),
o = l(b(i, n, t)),
a = l(b(i, n, e));
return (s !== r && o !== a) || (0 === s && h(t, i, e)) || (0 === r && h(t, n, e)) || (0 === o && h(i, t, n)) || !(0 !== a || !h(i, e, n));
}
function h(t, e, i) {
return e.x <= Math.max(t.x, i.x) && e.x >= Math.min(t.x, i.x) && e.y <= Math.max(t.y, i.y) && e.y >= Math.min(t.y, i.y);
}
function l(t) {
return 0 < t ? 1 : t < 0 ? -1 : 0;
}
function S(t, e) {
return b(t.prev, t, t.next) < 0 ? 0 <= b(t, e, t.next) && 0 <= b(t, t.prev, e) : b(t, e, t.prev) < 0 || b(t, t.next, e) < 0;
}
function _(t, e) {
var i = new o(t.i, t.x, t.y),
n = new o(e.i, e.x, e.y),
s = t.next,
r = e.prev;
return ((t.next = e).prev = t), ((i.next = s).prev = i), ((n.next = i).prev = n), ((r.next = n).prev = r), n;
}
function a(t, e, i, n) {
var s = new o(t, e, i);
return n ? ((s.next = n.next), ((s.prev = n).next.prev = s), (n.next = s)) : ((s.prev = s).next = s), s;
}
function E(t) {
(t.next.prev = t.prev), (t.prev.next = t.next), t.prevZ && (t.prevZ.nextZ = t.nextZ), t.nextZ && (t.nextZ.prevZ = t.prevZ);
}
function o(t, e, i) {
(this.i = t), (this.x = e), (this.y = i), (this.prev = null), (this.next = null), (this.z = null), (this.prevZ = null), (this.nextZ = null), (this.steiner = !1);
}
function P(t, e, i, n) {
for (var s = 0, r = e, o = i - n; r < i; r += n) (s += (t[o] - t[r]) * (t[r + 1] + t[o + 1])), (o = r);
return s;
}
(n.deviation = function (t, e, i, n) {
var s = e && e.length,
r = s ? e[0] * i : t.length,
o = Math.abs(P(t, 0, r, i));
if (s)
for (var a = 0, h = e.length; a < h; a++) {
var l = e[a] * i,
u = a < h - 1 ? e[a + 1] * i : t.length;
o -= Math.abs(P(t, l, u, i));
}
var c = 0;
for (a = 0; a < n.length; a += 3) {
var d = n[a] * i,
f = n[a + 1] * i,
p = n[a + 2] * i;
c += Math.abs((t[d] - t[p]) * (t[1 + f] - t[1 + d]) - (t[d] - t[f]) * (t[1 + p] - t[1 + d]));
}
return 0 === o && 0 === c ? 0 : Math.abs((c - o) / o);
}),
(n.flatten = function (t) {
for (var e = t[0][0].length, i = { vertices: [], holes: [], dimensions: e }, n = 0, s = 0; s < t.length; s++) {
for (var r = 0; r < t[s].length; r++) for (var o = 0; o < e; o++) i.vertices.push(t[s][r][o]);
0 < s && ((n += t[s - 1].length), i.holes.push(n));
}
return i;
}),
(t.exports = n);
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = i || e.strokeColor,
r = n || e.strokeAlpha,
o = (16711680 & s) >>> 16,
a = (65280 & s) >>> 8,
h = 255 & s;
(t.strokeStyle = "rgba(" + o + "," + a + "," + h + "," + r + ")"), (t.lineWidth = e.lineWidth);
};
},
function (t, e, i) {
var n = i(0),
h = i(21),
l = i(23),
s = i(8),
u = i(2),
c = i(6),
d = i(7),
r = new n({
Extends: l,
initialize: function (t, e, i, n, s) {
var r,
o = "json";
d(e) && ((e = u((r = e), "key")), (i = u(r, "url")), (n = u(r, "xhrSettings")), (o = u(r, "extension", o)), (s = u(r, "dataKey", s)));
var a = { type: "json", cache: t.cacheManager.json, extension: o, responseType: "text", key: e, url: i, xhrSettings: n, config: s };
l.call(this, t, a), d(i) && ((this.data = s ? c(i, s) : i), (this.state = h.FILE_POPULATED));
},
onProcess: function () {
if (this.state !== h.FILE_POPULATED) {
this.state = h.FILE_PROCESSING;
try {
var t = JSON.parse(this.xhrLoader.responseText);
} catch (t) {
throw (this.onProcessError(), t);
}
var e = this.config;
this.data = "string" == typeof e ? c(t, e, t) : t;
}
this.onProcessComplete();
},
});
s.register("json", function (t, e, i, n) {
if (Array.isArray(t)) for (var s = 0; s < t.length; s++) this.addFile(new r(this, t[s]));
else this.addFile(new r(this, t, e, n, i));
return this;
}),
(t.exports = r);
},
function (t, e) {
t.exports = { DYNAMIC_BODY: 0, STATIC_BODY: 1, GROUP: 2, TILEMAPLAYER: 3, FACING_NONE: 10, FACING_UP: 11, FACING_DOWN: 12, FACING_LEFT: 13, FACING_RIGHT: 14 };
},
function (t, e, i) {
var d = i(158),
f = i(26);
t.exports = function (t, e, i, n, s) {
for (var r, o, a, h, l = f(t, e, i, n, null, s), u = 0; u < l.length; u++) {
var c = l[u];
c &&
(c.collides
? ((r = d(c.x, c.y - 1, !0, s)),
(o = d(c.x, c.y + 1, !0, s)),
(a = d(c.x - 1, c.y, !0, s)),
(h = d(c.x + 1, c.y, !0, s)),
(c.faceTop = !r || !r.collides),
(c.faceBottom = !o || !o.collides),
(c.faceLeft = !a || !a.collides),
(c.faceRight = !h || !h.collides))
: c.resetFaces());
}
};
},
function (t, e, i) {
var a = {};
t.exports = a;
var b = i(83),
w = i(32);
(a.create = function (t, e) {
for (var i = [], n = 0; n < t.length; n++) {
var s = t[n],
r = { x: s.x, y: s.y, index: n, body: e, isInternal: !1, contact: null, offset: null };
(r.contact = { vertex: r, normalImpulse: 0, tangentImpulse: 0 }), i.push(r);
}
return i;
}),
(a.fromPath = function (t, e) {
var n = [];
return (
t.replace(/L?\s*([-\d.e]+)[\s,]*([-\d.e]+)*/gi, function (t, e, i) {
n.push({ x: parseFloat(e), y: parseFloat(i) });
}),
a.create(n, e)
);
}),
(a.centre = function (t) {
for (var e, i, n, s = a.area(t, !0), r = { x: 0, y: 0 }, o = 0; o < t.length; o++) (n = (o + 1) % t.length), (e = b.cross(t[o], t[n])), (i = b.mult(b.add(t[o], t[n]), e)), (r = b.add(r, i));
return b.div(r, 6 * s);
}),
(a.mean = function (t) {
for (var e = { x: 0, y: 0 }, i = 0; i < t.length; i++) (e.x += t[i].x), (e.y += t[i].y);
return b.div(e, t.length);
}),
(a.area = function (t, e) {
for (var i = 0, n = t.length - 1, s = 0; s < t.length; s++) (i += (t[n].x - t[s].x) * (t[n].y + t[s].y)), (n = s);
return e ? i / 2 : Math.abs(i) / 2;
}),
(a.inertia = function (t, e) {
for (var i, n, s = 0, r = 0, o = t, a = 0; a < o.length; a++) (n = (a + 1) % o.length), (s += (i = Math.abs(b.cross(o[n], o[a]))) * (b.dot(o[n], o[n]) + b.dot(o[n], o[a]) + b.dot(o[a], o[a]))), (r += i);
return (e / 6) * (s / r);
}),
(a.translate = function (t, e, i) {
var n;
if (i) for (n = 0; n < t.length; n++) (t[n].x += e.x * i), (t[n].y += e.y * i);
else for (n = 0; n < t.length; n++) (t[n].x += e.x), (t[n].y += e.y);
return t;
}),
(a.rotate = function (t, e, i) {
if (0 !== e) {
for (var n = Math.cos(e), s = Math.sin(e), r = 0; r < t.length; r++) {
var o = t[r],
a = o.x - i.x,
h = o.y - i.y;
(o.x = i.x + (a * n - h * s)), (o.y = i.y + (a * s + h * n));
}
return t;
}
}),
(a.contains = function (t, e) {
for (var i = 0; i < t.length; i++) {
var n = t[i],
s = t[(i + 1) % t.length];
if (0 < (e.x - n.x) * (s.y - n.y) + (e.y - n.y) * (n.x - s.x)) return !1;
}
return !0;
}),
(a.scale = function (t, e, i, n) {
if (1 === e && 1 === i) return t;
var s, r;
n = n || a.centre(t);
for (var o = 0; o < t.length; o++) (s = t[o]), (r = b.sub(s, n)), (t[o].x = n.x + r.x * e), (t[o].y = n.y + r.y * i);
return t;
}),
(a.chamfer = function (t, e, i, n, s) {
(e = "number" == typeof e ? [e] : e || [8]), (i = void 0 !== i ? i : -1), (n = n || 2), (s = s || 14);
for (var r = [], o = 0; o < t.length; o++) {
var a = t[0 <= o - 1 ? o - 1 : t.length - 1],
h = t[o],
l = t[(o + 1) % t.length],
u = e[o < e.length ? o : e.length - 1];
if (0 !== u) {
var c = b.normalise({ x: h.y - a.y, y: a.x - h.x }),
d = b.normalise({ x: l.y - h.y, y: h.x - l.x }),
f = Math.sqrt(2 * Math.pow(u, 2)),
p = b.mult(w.clone(c), u),
g = b.normalise(b.mult(b.add(c, d), 0.5)),
v = b.sub(h, b.mult(g, f)),
y = i;
-1 === i && (y = 1.75 * Math.pow(u, 0.32)), (y = w.clamp(y, n, s)) % 2 == 1 && (y += 1);
for (var m = Math.acos(b.dot(c, d)) / y, x = 0; x < y; x++) r.push(b.add(b.rotate(p, m * x), v));
} else r.push(h);
}
return r;
}),
(a.clockwiseSort = function (t) {
var i = a.mean(t);
return (
t.sort(function (t, e) {
return b.angle(i, t) - b.angle(i, e);
}),
t
);
}),
(a.isConvex = function (t) {
var e,
i,
n,
s,
r = 0,
o = t.length;
if (o < 3) return null;
for (e = 0; e < o; e++) if (((n = (e + 2) % o), (s = (t[(i = (e + 1) % o)].x - t[e].x) * (t[n].y - t[i].y)), (s -= (t[i].y - t[e].y) * (t[n].x - t[i].x)) < 0 ? (r |= 1) : 0 < s && (r |= 2), 3 === r)) return !1;
return 0 !== r || null;
}),
(a.hull = function (t) {
var e,
i,
n = [],
s = [];
for (
(t = t.slice(0)).sort(function (t, e) {
var i = t.x - e.x;
return 0 != i ? i : t.y - e.y;
}),
i = 0;
i < t.length;
i += 1
) {
for (e = t[i]; 2 <= s.length && b.cross3(s[s.length - 2], s[s.length - 1], e) <= 0; ) s.pop();
s.push(e);
}
for (i = t.length - 1; 0 <= i; --i) {
for (e = t[i]; 2 <= n.length && b.cross3(n[n.length - 2], n[n.length - 1], e) <= 0; ) n.pop();
n.push(e);
}
return n.pop(), s.pop(), n.concat(s);
});
},
function (t, e, i) {
var n = i(0),
s = i(66),
r = i(300),
o = i(301),
a = i(56),
h = i(170),
l = new n({
initialize: function (t, e, i) {
void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 0), (this.type = a.CIRCLE), (this.x = t), (this.y = e), (this._radius = i), (this._diameter = 2 * i);
},
contains: function (t, e) {
return s(this, t, e);
},
getPoint: function (t, e) {
return r(this, t, e);
},
getPoints: function (t, e, i) {
return o(this, t, e, i);
},
getRandomPoint: function (t) {
return h(this, t);
},
setTo: function (t, e, i) {
return (this.x = t), (this.y = e), (this._radius = i), (this._diameter = 2 * i), this;
},
setEmpty: function () {
return (this._radius = 0), (this._diameter = 0), this;
},
setPosition: function (t, e) {
return void 0 === e && (e = t), (this.x = t), (this.y = e), this;
},
isEmpty: function () {
return this._radius <= 0;
},
radius: {
get: function () {
return this._radius;
},
set: function (t) {
(this._radius = t), (this._diameter = 2 * t);
},
},
diameter: {
get: function () {
return this._diameter;
},
set: function (t) {
(this._diameter = t), (this._radius = 0.5 * t);
},
},
left: {
get: function () {
return this.x - this._radius;
},
set: function (t) {
this.x = t + this._radius;
},
},
right: {
get: function () {
return this.x + this._radius;
},
set: function (t) {
this.x = t - this._radius;
},
},
top: {
get: function () {
return this.y - this._radius;
},
set: function (t) {
this.y = t + this._radius;
},
},
bottom: {
get: function () {
return this.y + this._radius;
},
set: function (t) {
this.y = t - this._radius;
},
},
});
t.exports = l;
},
function (t, e) {
t.exports = function (t, e, i) {
return 0 < t.radius && e >= t.left && e <= t.right && i >= t.top && i <= t.bottom && (t.x - e) * (t.x - e) + (t.y - i) * (t.y - i) <= t.radius * t.radius;
};
},
function (t, e) {
t.exports = function (t) {
return Math.sqrt((t.x2 - t.x1) * (t.x2 - t.x1) + (t.y2 - t.y1) * (t.y2 - t.y1));
};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = i - e;
return e + ((((t - e) % n) + n) % n);
};
},
function (t, e, i) {
var n = i(0),
s = i(39),
r = new n({
initialize: function (t) {
(this.val = new Float32Array(16)), t ? this.copy(t) : this.identity();
},
clone: function () {
return new r(this);
},
set: function (t) {
return this.copy(t);
},
setValues: function (t, e, i, n, s, r, o, a, h, l, u, c, d, f, p, g) {
var v = this.val;
return (
(v[0] = t), (v[1] = e), (v[2] = i), (v[3] = n), (v[4] = s), (v[5] = r), (v[6] = o), (v[7] = a), (v[8] = h), (v[9] = l), (v[10] = u), (v[11] = c), (v[12] = d), (v[13] = f), (v[14] = p), (v[15] = g), this
);
},
copy: function (t) {
var e = t.val;
return this.setValues(e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8], e[9], e[10], e[11], e[12], e[13], e[14], e[15]);
},
fromArray: function (t) {
return this.setValues(t[0], t[1], t[2], t[3], t[4], t[5], t[6], t[7], t[8], t[9], t[10], t[11], t[12], t[13], t[14], t[15]);
},
zero: function () {
return this.setValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
},
transform: function (t, e, i) {
var n = h.fromQuat(i).val,
s = e.x,
r = e.y,
o = e.z;
return this.setValues(n[0] * s, n[1] * s, n[2] * s, 0, n[4] * r, n[5] * r, n[6] * r, 0, n[8] * o, n[9] * o, n[10] * o, 0, t.x, t.y, t.z, 1);
},
xyz: function (t, e, i) {
this.identity();
var n = this.val;
return (n[12] = t), (n[13] = e), (n[14] = i), this;
},
scaling: function (t, e, i) {
this.zero();
var n = this.val;
return (n[0] = t), (n[5] = e), (n[10] = i), (n[15] = 1), this;
},
identity: function () {
return this.setValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
},
transpose: function () {
var t = this.val,
e = t[1],
i = t[2],
n = t[3],
s = t[6],
r = t[7],
o = t[11];
return (t[1] = t[4]), (t[2] = t[8]), (t[3] = t[12]), (t[4] = e), (t[6] = t[9]), (t[7] = t[13]), (t[8] = i), (t[9] = s), (t[11] = t[14]), (t[12] = n), (t[13] = r), (t[14] = o), this;
},
getInverse: function (t) {
return this.copy(t), this.invert();
},
invert: function () {
var t = this.val,
e = t[0],
i = t[1],
n = t[2],
s = t[3],
r = t[4],
o = t[5],
a = t[6],
h = t[7],
l = t[8],
u = t[9],
c = t[10],
d = t[11],
f = t[12],
p = t[13],
g = t[14],
v = t[15],
y = e * o - i * r,
m = e * a - n * r,
x = e * h - s * r,
b = i * a - n * o,
w = i * h - s * o,
T = n * h - s * a,
S = l * p - u * f,
_ = l * g - c * f,
E = l * v - d * f,
P = u * g - c * p,
A = u * v - d * p,
M = c * v - d * g,
C = y * M - m * A + x * P + b * E - w * _ + T * S;
return C
? ((C = 1 / C),
this.setValues(
(o * M - a * A + h * P) * C,
(n * A - i * M - s * P) * C,
(p * T - g * w + v * b) * C,
(c * w - u * T - d * b) * C,
(a * E - r * M - h * _) * C,
(e * M - n * E + s * _) * C,
(g * x - f * T - v * m) * C,
(l * T - c * x + d * m) * C,
(r * A - o * E + h * S) * C,
(i * E - e * A - s * S) * C,
(f * w - p * x + v * y) * C,
(u * x - l * w - d * y) * C,
(o * _ - r * P - a * S) * C,
(e * P - i * _ + n * S) * C,
(p * m - f * b - g * y) * C,
(l * b - u * m + c * y) * C
))
: this;
},
adjoint: function () {
var t = this.val,
e = t[0],
i = t[1],
n = t[2],
s = t[3],
r = t[4],
o = t[5],
a = t[6],
h = t[7],
l = t[8],
u = t[9],
c = t[10],
d = t[11],
f = t[12],
p = t[13],
g = t[14],
v = t[15];
return this.setValues(
o * (c * v - d * g) - u * (a * v - h * g) + p * (a * d - h * c),
-(i * (c * v - d * g) - u * (n * v - s * g) + p * (n * d - s * c)),
i * (a * v - h * g) - o * (n * v - s * g) + p * (n * h - s * a),
-(i * (a * d - h * c) - o * (n * d - s * c) + u * (n * h - s * a)),
-(r * (c * v - d * g) - l * (a * v - h * g) + f * (a * d - h * c)),
e * (c * v - d * g) - l * (n * v - s * g) + f * (n * d - s * c),
-(e * (a * v - h * g) - r * (n * v - s * g) + f * (n * h - s * a)),
e * (a * d - h * c) - r * (n * d - s * c) + l * (n * h - s * a),
r * (u * v - d * p) - l * (o * v - h * p) + f * (o * d - h * u),
-(e * (u * v - d * p) - l * (i * v - s * p) + f * (i * d - s * u)),
e * (o * v - h * p) - r * (i * v - s * p) + f * (i * h - s * o),
-(e * (o * d - h * u) - r * (i * d - s * u) + l * (i * h - s * o)),
-(r * (u * g - c * p) - l * (o * g - a * p) + f * (o * c - a * u)),
e * (u * g - c * p) - l * (i * g - n * p) + f * (i * c - n * u),
-(e * (o * g - a * p) - r * (i * g - n * p) + f * (i * a - n * o)),
e * (o * c - a * u) - r * (i * c - n * u) + l * (i * a - n * o)
);
},
determinant: function () {
var t = this.val,
e = t[0],
i = t[1],
n = t[2],
s = t[3],
r = t[4],
o = t[5],
a = t[6],
h = t[7],
l = t[8],
u = t[9],
c = t[10],
d = t[11],
f = t[12],
p = t[13],
g = t[14],
v = t[15];
return (
(e * o - i * r) * (c * v - d * g) -
(e * a - n * r) * (u * v - d * p) +
(e * h - s * r) * (u * g - c * p) +
(i * a - n * o) * (l * v - d * f) -
(i * h - s * o) * (l * g - c * f) +
(n * h - s * a) * (l * p - u * f)
);
},
multiply: function (t) {
var e = this.val,
i = e[0],
n = e[1],
s = e[2],
r = e[3],
o = e[4],
a = e[5],
h = e[6],
l = e[7],
u = e[8],
c = e[9],
d = e[10],
f = e[11],
p = e[12],
g = e[13],
v = e[14],
y = e[15],
m = t.val,
x = m[0],
b = m[1],
w = m[2],
T = m[3];
return (
(e[0] = x * i + b * o + w * u + T * p),
(e[1] = x * n + b * a + w * c + T * g),
(e[2] = x * s + b * h + w * d + T * v),
(e[3] = x * r + b * l + w * f + T * y),
(x = m[4]),
(b = m[5]),
(w = m[6]),
(T = m[7]),
(e[4] = x * i + b * o + w * u + T * p),
(e[5] = x * n + b * a + w * c + T * g),
(e[6] = x * s + b * h + w * d + T * v),
(e[7] = x * r + b * l + w * f + T * y),
(x = m[8]),
(b = m[9]),
(w = m[10]),
(T = m[11]),
(e[8] = x * i + b * o + w * u + T * p),
(e[9] = x * n + b * a + w * c + T * g),
(e[10] = x * s + b * h + w * d + T * v),
(e[11] = x * r + b * l + w * f + T * y),
(x = m[12]),
(b = m[13]),
(w = m[14]),
(T = m[15]),
(e[12] = x * i + b * o + w * u + T * p),
(e[13] = x * n + b * a + w * c + T * g),
(e[14] = x * s + b * h + w * d + T * v),
(e[15] = x * r + b * l + w * f + T * y),
this
);
},
multiplyLocal: function (t) {
var e = this.val,
i = t.val;
return this.setValues(
e[0] * i[0] + e[1] * i[4] + e[2] * i[8] + e[3] * i[12],
e[0] * i[1] + e[1] * i[5] + e[2] * i[9] + e[3] * i[13],
e[0] * i[2] + e[1] * i[6] + e[2] * i[10] + e[3] * i[14],
e[0] * i[3] + e[1] * i[7] + e[2] * i[11] + e[3] * i[15],
e[4] * i[0] + e[5] * i[4] + e[6] * i[8] + e[7] * i[12],
e[4] * i[1] + e[5] * i[5] + e[6] * i[9] + e[7] * i[13],
e[4] * i[2] + e[5] * i[6] + e[6] * i[10] + e[7] * i[14],
e[4] * i[3] + e[5] * i[7] + e[6] * i[11] + e[7] * i[15],
e[8] * i[0] + e[9] * i[4] + e[10] * i[8] + e[11] * i[12],
e[8] * i[1] + e[9] * i[5] + e[10] * i[9] + e[11] * i[13],
e[8] * i[2] + e[9] * i[6] + e[10] * i[10] + e[11] * i[14],
e[8] * i[3] + e[9] * i[7] + e[10] * i[11] + e[11] * i[15],
e[12] * i[0] + e[13] * i[4] + e[14] * i[8] + e[15] * i[12],
e[12] * i[1] + e[13] * i[5] + e[14] * i[9] + e[15] * i[13],
e[12] * i[2] + e[13] * i[6] + e[14] * i[10] + e[15] * i[14],
e[12] * i[3] + e[13] * i[7] + e[14] * i[11] + e[15] * i[15]
);
},
premultiply: function (t) {
return this.multiplyMatrices(t, this);
},
multiplyMatrices: function (t, e) {
var i = t.val,
n = e.val,
s = i[0],
r = i[4],
o = i[8],
a = i[12],
h = i[1],
l = i[5],
u = i[9],
c = i[13],
d = i[2],
f = i[6],
p = i[10],
g = i[14],
v = i[3],
y = i[7],
m = i[11],
x = i[15],
b = n[0],
w = n[4],
T = n[8],
S = n[12],
_ = n[1],
E = n[5],
P = n[9],
A = n[13],
M = n[2],
C = n[6],
O = n[10],
k = n[14],
R = n[3],
L = n[7],
I = n[11],
D = n[15];
return this.setValues(
s * b + r * _ + o * M + a * R,
h * b + l * _ + u * M + c * R,
d * b + f * _ + p * M + g * R,
v * b + y * _ + m * M + x * R,
s * w + r * E + o * C + a * L,
h * w + l * E + u * C + c * L,
d * w + f * E + p * C + g * L,
v * w + y * E + m * C + x * L,
s * T + r * P + o * O + a * I,
h * T + l * P + u * O + c * I,
d * T + f * P + p * O + g * I,
v * T + y * P + m * O + x * I,
s * S + r * A + o * k + a * D,
h * S + l * A + u * k + c * D,
d * S + f * A + p * k + g * D,
v * S + y * A + m * k + x * D
);
},
translate: function (t) {
return this.translateXYZ(t.x, t.y, t.z);
},
translateXYZ: function (t, e, i) {
var n = this.val;
return (
(n[12] = n[0] * t + n[4] * e + n[8] * i + n[12]),
(n[13] = n[1] * t + n[5] * e + n[9] * i + n[13]),
(n[14] = n[2] * t + n[6] * e + n[10] * i + n[14]),
(n[15] = n[3] * t + n[7] * e + n[11] * i + n[15]),
this
);
},
scale: function (t) {
return this.scaleXYZ(t.x, t.y, t.z);
},
scaleXYZ: function (t, e, i) {
var n = this.val;
return (
(n[0] = n[0] * t),
(n[1] = n[1] * t),
(n[2] = n[2] * t),
(n[3] = n[3] * t),
(n[4] = n[4] * e),
(n[5] = n[5] * e),
(n[6] = n[6] * e),
(n[7] = n[7] * e),
(n[8] = n[8] * i),
(n[9] = n[9] * i),
(n[10] = n[10] * i),
(n[11] = n[11] * i),
this
);
},
makeRotationAxis: function (t, e) {
var i = Math.cos(e),
n = Math.sin(e),
s = 1 - i,
r = t.x,
o = t.y,
a = t.z,
h = s * r,
l = s * o;
return this.setValues(h * r + i, h * o - n * a, h * a + n * o, 0, h * o + n * a, l * o + i, l * a - n * r, 0, h * a - n * o, l * a + n * r, s * a * a + i, 0, 0, 0, 0, 1);
},
rotate: function (t, e) {
var i = this.val,
n = e.x,
s = e.y,
r = e.z,
o = Math.sqrt(n * n + s * s + r * r);
if (Math.abs(o) < 1e-6) return this;
(n *= o = 1 / o), (s *= o), (r *= o);
var a = Math.sin(t),
h = Math.cos(t),
l = 1 - h,
u = i[0],
c = i[1],
d = i[2],
f = i[3],
p = i[4],
g = i[5],
v = i[6],
y = i[7],
m = i[8],
x = i[9],
b = i[10],
w = i[11],
T = i[12],
S = i[13],
_ = i[14],
E = i[15],
P = n * n * l + h,
A = s * n * l + r * a,
M = r * n * l - s * a,
C = n * s * l - r * a,
O = s * s * l + h,
k = r * s * l + n * a,
R = n * r * l + s * a,
L = s * r * l - n * a,
I = r * r * l + h;
return this.setValues(
u * P + p * A + m * M,
c * P + g * A + x * M,
d * P + v * A + b * M,
f * P + y * A + w * M,
u * C + p * O + m * k,
c * C + g * O + x * k,
d * C + v * O + b * k,
f * C + y * O + w * k,
u * R + p * L + m * I,
c * R + g * L + x * I,
d * R + v * L + b * I,
f * R + y * L + w * I,
T,
S,
_,
E
);
},
rotateX: function (t) {
var e = this.val,
i = Math.sin(t),
n = Math.cos(t),
s = e[4],
r = e[5],
o = e[6],
a = e[7],
h = e[8],
l = e[9],
u = e[10],
c = e[11];
return (e[4] = s * n + h * i), (e[5] = r * n + l * i), (e[6] = o * n + u * i), (e[7] = a * n + c * i), (e[8] = h * n - s * i), (e[9] = l * n - r * i), (e[10] = u * n - o * i), (e[11] = c * n - a * i), this;
},
rotateY: function (t) {
var e = this.val,
i = Math.sin(t),
n = Math.cos(t),
s = e[0],
r = e[1],
o = e[2],
a = e[3],
h = e[8],
l = e[9],
u = e[10],
c = e[11];
return (e[0] = s * n - h * i), (e[1] = r * n - l * i), (e[2] = o * n - u * i), (e[3] = a * n - c * i), (e[8] = s * i + h * n), (e[9] = r * i + l * n), (e[10] = o * i + u * n), (e[11] = a * i + c * n), this;
},
rotateZ: function (t) {
var e = this.val,
i = Math.sin(t),
n = Math.cos(t),
s = e[0],
r = e[1],
o = e[2],
a = e[3],
h = e[4],
l = e[5],
u = e[6],
c = e[7];
return (e[0] = s * n + h * i), (e[1] = r * n + l * i), (e[2] = o * n + u * i), (e[3] = a * n + c * i), (e[4] = h * n - s * i), (e[5] = l * n - r * i), (e[6] = u * n - o * i), (e[7] = c * n - a * i), this;
},
fromRotationTranslation: function (t, e) {
var i = t.x,
n = t.y,
s = t.z,
r = t.w,
o = i + i,
a = n + n,
h = s + s,
l = i * o,
u = i * a,
c = i * h,
d = n * a,
f = n * h,
p = s * h,
g = r * o,
v = r * a,
y = r * h;
return this.setValues(1 - (d + p), u + y, c - v, 0, u - y, 1 - (l + p), f + g, 0, c + v, f - g, 1 - (l + d), 0, e.x, e.y, e.z, 1);
},
fromQuat: function (t) {
var e = t.x,
i = t.y,
n = t.z,
s = t.w,
r = e + e,
o = i + i,
a = n + n,
h = e * r,
l = e * o,
u = e * a,
c = i * o,
d = i * a,
f = n * a,
p = s * r,
g = s * o,
v = s * a;
return this.setValues(1 - (c + f), l + v, u - g, 0, l - v, 1 - (h + f), d + p, 0, u + g, d - p, 1 - (h + c), 0, 0, 0, 0, 1);
},
frustum: function (t, e, i, n, s, r) {
var o = 1 / (e - t),
a = 1 / (n - i),
h = 1 / (s - r);
return this.setValues(2 * s * o, 0, 0, 0, 0, 2 * s * a, 0, 0, (e + t) * o, (n + i) * a, (r + s) * h, -1, 0, 0, r * s * 2 * h, 0);
},
perspective: function (t, e, i, n) {
var s = 1 / Math.tan(t / 2),
r = 1 / (i - n);
return this.setValues(s / e, 0, 0, 0, 0, s, 0, 0, 0, 0, (n + i) * r, -1, 0, 0, 2 * n * i * r, 0);
},
perspectiveLH: function (t, e, i, n) {
return this.setValues((2 * i) / t, 0, 0, 0, 0, (2 * i) / e, 0, 0, 0, 0, -n / (i - n), 1, 0, 0, (i * n) / (i - n), 0);
},
ortho: function (t, e, i, n, s, r) {
var o = 0 == (o = t - e) ? o : 1 / o,
a = 0 == (a = i - n) ? a : 1 / a,
h = 0 == (h = s - r) ? h : 1 / h;
return this.setValues(-2 * o, 0, 0, 0, 0, -2 * a, 0, 0, 0, 0, 2 * h, 0, (t + e) * o, (n + i) * a, (r + s) * h, 1);
},
lookAtRH: function (t, e, i) {
var n = this.val;
return (
u.subVectors(t, e),
0 === u.getLengthSquared() && (u.z = 1),
u.normalize(),
o.crossVectors(i, u),
0 === o.getLengthSquared() && (1 === Math.abs(i.z) ? (u.x += 1e-4) : (u.z += 1e-4), u.normalize(), o.crossVectors(i, u)),
o.normalize(),
a.crossVectors(u, o),
(n[0] = o.x),
(n[1] = o.y),
(n[2] = o.z),
(n[4] = a.x),
(n[5] = a.y),
(n[6] = a.z),
(n[8] = u.x),
(n[9] = u.y),
(n[10] = u.z),
this
);
},
lookAt: function (t, e, i) {
var n = t.x,
s = t.y,
r = t.z,
o = i.x,
a = i.y,
h = i.z,
l = e.x,
u = e.y,
c = e.z;
if (Math.abs(n - l) < 1e-6 && Math.abs(s - u) < 1e-6 && Math.abs(r - c) < 1e-6) return this.identity();
var d = n - l,
f = s - u,
p = r - c,
g = 1 / Math.sqrt(d * d + f * f + p * p),
v = a * (p *= g) - h * (f *= g),
y = h * (d *= g) - o * p,
m = o * f - a * d;
(g = Math.sqrt(v * v + y * y + m * m)) ? ((v *= g = 1 / g), (y *= g), (m *= g)) : (m = y = v = 0);
var x = f * m - p * y,
b = p * v - d * m,
w = d * y - f * v;
return (
(g = Math.sqrt(x * x + b * b + w * w)) ? ((x *= g = 1 / g), (b *= g), (w *= g)) : (w = b = x = 0),
this.setValues(v, x, d, 0, y, b, f, 0, m, w, p, 0, -(v * n + y * s + m * r), -(x * n + b * s + w * r), -(d * n + f * s + p * r), 1)
);
},
yawPitchRoll: function (t, e, i) {
this.zero(), h.zero(), l.zero();
var n = this.val,
s = h.val,
r = l.val,
o = Math.sin(i),
a = Math.cos(i);
return (
(n[10] = 1),
(n[15] = 1),
(n[0] = a),
(n[1] = o),
(n[4] = -o),
(n[5] = a),
(o = Math.sin(e)),
(a = Math.cos(e)),
(s[0] = 1),
(s[15] = 1),
(s[5] = a),
(s[10] = a),
(s[9] = -o),
(s[6] = o),
(o = Math.sin(t)),
(a = Math.cos(t)),
(r[5] = 1),
(r[15] = 1),
(r[0] = a),
(r[2] = -o),
(r[8] = o),
(r[10] = a),
this.multiplyLocal(h),
this.multiplyLocal(l),
this
);
},
setWorldMatrix: function (t, e, i, n, s) {
return this.yawPitchRoll(t.y, t.x, t.z), h.scaling(i.x, i.y, i.z), l.xyz(e.x, e.y, e.z), this.multiplyLocal(h), this.multiplyLocal(l), n && this.multiplyLocal(n), s && this.multiplyLocal(s), this;
},
multiplyToMat4: function (t, e) {
var i = this.val,
n = t.val,
s = i[0],
r = i[1],
o = i[2],
a = i[3],
h = i[4],
l = i[5],
u = i[6],
c = i[7],
d = i[8],
f = i[9],
p = i[10],
g = i[11],
v = i[12],
y = i[13],
m = i[14],
x = i[15],
b = n[0],
w = n[1],
T = n[2],
S = n[3],
_ = n[4],
E = n[5],
P = n[6],
A = n[7],
M = n[8],
C = n[9],
O = n[10],
k = n[11],
R = n[12],
L = n[13],
I = n[14],
D = n[15];
return e.setValues(
b * s + w * h + T * d + S * v,
w * r + w * l + T * f + S * y,
T * o + w * u + T * p + S * m,
S * a + w * c + T * g + S * x,
_ * s + E * h + P * d + A * v,
_ * r + E * l + P * f + A * y,
_ * o + E * u + P * p + A * m,
_ * a + E * c + P * g + A * x,
M * s + C * h + O * d + k * v,
M * r + C * l + O * f + k * y,
M * o + C * u + O * p + k * m,
M * a + C * c + O * g + k * x,
R * s + L * h + I * d + D * v,
R * r + L * l + I * f + D * y,
R * o + L * u + I * p + D * m,
R * a + L * c + I * g + D * x
);
},
fromRotationXYTranslation: function (t, e, i) {
var n = e.x,
s = e.y,
r = e.z,
o = Math.sin(t.x),
a = Math.cos(t.x),
h = Math.sin(t.y),
l = Math.cos(t.y),
u = n,
c = s,
d = r,
f = -o,
p = 0 - f * h,
g = 0 - a * h,
v = f * l,
y = a * l;
return i || ((u = l * n + h * r), (c = p * n + a * s + v * r), (d = g * n + o * s + y * r)), this.setValues(l, p, g, 0, 0, a, o, 0, h, v, y, 0, u, c, d, 1);
},
getMaxScaleOnAxis: function () {
var t = this.val,
e = t[0] * t[0] + t[1] * t[1] + t[2] * t[2],
i = t[4] * t[4] + t[5] * t[5] + t[6] * t[6],
n = t[8] * t[8] + t[9] * t[9] + t[10] * t[10];
return Math.sqrt(Math.max(e, i, n));
},
}),
h = new r(),
l = new r(),
o = new s(),
a = new s(),
u = new s();
t.exports = r;
},
function (t, e, i) {
t.exports = {
COMPLETE: i(987),
DECODED: i(988),
DECODED_ALL: i(989),
DESTROY: i(990),
DETUNE: i(991),
GLOBAL_DETUNE: i(992),
GLOBAL_MUTE: i(993),
GLOBAL_RATE: i(994),
GLOBAL_VOLUME: i(995),
LOOP: i(996),
LOOPED: i(997),
MUTE: i(998),
PAN: i(999),
PAUSE_ALL: i(1e3),
PAUSE: i(1001),
PLAY: i(1002),
RATE: i(1003),
RESUME_ALL: i(1004),
RESUME: i(1005),
SEEK: i(1006),
STOP_ALL: i(1007),
STOP: i(1008),
UNLOCKED: i(1009),
VOLUME: i(1010),
};
},
function (t, e, i) {
var n = i(0),
s = i(21),
c = i(23),
r = i(8),
d = i(2),
f = i(7),
o = new n({
Extends: c,
initialize: function t(e, i, n, s, r) {
var o,
a,
h = "png";
f(i) && ((i = d((a = i), "key")), (n = d(a, "url")), (o = d(a, "normalMap")), (s = d(a, "xhrSettings")), (h = d(a, "extension", h)), (r = d(a, "frameConfig"))), Array.isArray(n) && ((o = n[1]), (n = n[0]));
var l,
u = { type: "image", cache: e.textureManager, extension: h, responseType: "blob", key: i, url: n, xhrSettings: s, config: r };
c.call(this, e, u), o && (((l = new t(e, this.key, o, s, r)).type = "normalMap"), this.setLink(l), e.addFile(l));
},
onProcess: function () {
(this.state = s.FILE_PROCESSING), (this.data = new Image()), (this.data.crossOrigin = this.crossOrigin);
var t = this;
(this.data.onload = function () {
c.revokeObjectURL(t.data), t.onProcessComplete();
}),
(this.data.onerror = function () {
c.revokeObjectURL(t.data), t.onProcessError();
}),
c.createObjectURL(this.data, this.xhrLoader.response, "image/png");
},
addToCache: function () {
var t,
e = this.linkFile;
e && e.state === s.FILE_COMPLETE
? ((t = "image" === this.type ? this.cache.addImage(this.key, this.data, e.data) : this.cache.addImage(e.key, e.data, this.data)), this.pendingDestroy(t), e.pendingDestroy(t))
: e || ((t = this.cache.addImage(this.key, this.data)), this.pendingDestroy(t));
},
});
r.register("image", function (t, e, i) {
if (Array.isArray(t)) for (var n = 0; n < t.length; n++) this.addFile(new o(this, t[n]));
else this.addFile(new o(this, t, e, i));
return this;
}),
(t.exports = o);
},
function (t, e) {
t.exports = function (t, e) {
e ? t.setCollision(!0, !0, !0, !0, !1) : t.resetCollision(!1);
};
},
function (t, e, i) {
var r = i(164),
n = i(0),
s = i(11),
o = i(15),
a = i(1065),
h = new n({
Extends: o,
Mixins: [s.Alpha, s.BlendMode, s.Depth, s.Flip, s.GetBounds, s.Mask, s.Origin, s.Pipeline, s.ScrollFactor, s.Size, s.TextureCrop, s.Tint, s.Transform, s.Visible, a],
initialize: function (t, e, i, n, s) {
o.call(this, t, "Sprite"),
(this._crop = this.resetCropObject()),
(this.anims = new r(this)),
this.setTexture(n, s),
this.setPosition(e, i),
this.setSizeToFrame(),
this.setOriginFromFrame(),
this.initPipeline();
},
addedToScene: function () {
this.scene.sys.updateList.add(this);
},
removedFromScene: function () {
this.scene.sys.updateList.remove(this);
},
preUpdate: function (t, e) {
this.anims.update(t, e);
},
play: function (t, e) {
return this.anims.play(t, e);
},
playReverse: function (t, e) {
return this.anims.playReverse(t, e);
},
playAfterDelay: function (t, e) {
return this.anims.playAfterDelay(t, e);
},
playAfterRepeat: function (t, e) {
return this.anims.playAfterRepeat(t, e);
},
chain: function (t) {
return this.anims.chain(t);
},
stop: function () {
return this.anims.stop();
},
stopAfterDelay: function (t) {
return this.anims.stopAfterDelay(t);
},
stopAfterRepeat: function (t) {
return this.anims.stopAfterRepeat(t);
},
stopOnFrame: function (t) {
return this.anims.stopOnFrame(t);
},
toJSON: function () {
return s.ToJSON(this);
},
preDestroy: function () {
this.anims.destroy(), (this.anims = void 0);
},
});
t.exports = h;
},
function (t, e) {
t.exports = function (t, e) {
if (!(e >= t.length)) {
for (var i = t.length - 1, n = t[e], s = e; s < i; s++) t[s] = t[s + 1];
return (t.length = i), n;
}
};
},
function (t, e, i) {
t.exports = {
ADDED_TO_SCENE: i(643),
DESTROY: i(644),
REMOVED_FROM_SCENE: i(645),
VIDEO_COMPLETE: i(646),
VIDEO_CREATED: i(647),
VIDEO_ERROR: i(648),
VIDEO_LOOP: i(649),
VIDEO_PLAY: i(650),
VIDEO_SEEKED: i(651),
VIDEO_SEEKING: i(652),
VIDEO_STOP: i(653),
VIDEO_TIMEOUT: i(654),
VIDEO_UNLOCKED: i(655),
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), 0 === e ? t : ((t -= i), (t = e * Math.floor(t / e)), n ? (i + t) / e : i + t);
};
},
function (t, e) {
t.exports = function (t) {
var e = {};
for (var i in t) Array.isArray(t[i]) ? (e[i] = t[i].slice(0)) : (e[i] = t[i]);
return e;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = t.length;
if (e < 0 || s < e || i <= e || s < i || s < e + i) {
if (n) throw new Error("Range Error: Values outside acceptable range");
return !1;
}
return !0;
};
},
function (t, e) {
function n(t, e) {
return String(t).localeCompare(e);
}
function o(t, e, i, n) {
for (var s, r, o, a, h = t.length, l = 0, u = 2 * i, c = 0; c < h; c += u)
for (r = (s = c + i) + i, h < s && (s = h), h < r && (r = h), o = c, a = s; ; )
if (o < s && a < r) e(t[o], t[a]) <= 0 ? (n[l++] = t[o++]) : (n[l++] = t[a++]);
else if (o < s) n[l++] = t[o++];
else {
if (!(a < r)) break;
n[l++] = t[a++];
}
}
t.exports = function (t, e) {
void 0 === e && (e = n);
var i = (function (t, e) {
var i = t.length;
if (i <= 1) return t;
for (var n = new Array(i), s = 1; s < i; s *= 2) {
o(t, e, s, n);
var r = t;
(t = n), (n = r);
}
return t;
})(t, e);
return i !== t && o(i, null, t.length, t), t;
};
},
function (t, e, i) {
var r = i(134),
o = i(205);
t.exports = function (t, e) {
var i,
n = r.Power0;
if (
("string" == typeof t
? r.hasOwnProperty(t)
? (n = r[t])
: ((i = ""),
t.indexOf(".") && ("in" === (i = t.substr(t.indexOf(".") + 1)).toLowerCase() ? (i = "easeIn") : "out" === i.toLowerCase() ? (i = "easeOut") : "inout" === i.toLowerCase() && (i = "easeInOut")),
(t = o(t.substr(0, t.indexOf(".") + 1) + i)),
r.hasOwnProperty(t) && (n = r[t]))
: "function" == typeof t
? (n = t)
: Array.isArray(t) && t.length,
!e)
)
return n;
var s = e.slice(0);
return (
s.unshift(0),
function (t) {
return (s[0] = t), n.apply(this, s);
}
);
};
},
function (t, e, i) {
var v = i(12);
t.exports = function (t, e, i, n, s) {
var r = t.strokeTint,
o = v.getTintAppendFloatAlpha(e.strokeColor, e.strokeAlpha * i);
(r.TL = o), (r.TR = o), (r.BL = o), (r.BR = o);
var a = e.pathData,
h = a.length - 1,
l = e.lineWidth,
u = l / 2,
c = a[0] - n,
d = a[1] - s;
e.closePath || (h -= 2);
for (var f = 2; f < h; f += 2) {
var p = a[f] - n,
g = a[f + 1] - s;
t.batchLine(c, d, p, g, u, u, l, f - 2, !!e.closePath && f === h - 1), (c = p), (d = g);
}
};
},
function (t, e, i) {
var n = i(0),
s = i(115),
r = i(476),
o = i(477),
a = i(56),
h = i(47),
l = i(181),
u = new n({
initialize: function (t, e, i, n, s, r) {
void 0 === t && (t = 0),
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 0),
void 0 === s && (s = 0),
void 0 === r && (r = 0),
(this.type = a.TRIANGLE),
(this.x1 = t),
(this.y1 = e),
(this.x2 = i),
(this.y2 = n),
(this.x3 = s),
(this.y3 = r);
},
contains: function (t, e) {
return s(this, t, e);
},
getPoint: function (t, e) {
return r(this, t, e);
},
getPoints: function (t, e, i) {
return o(this, t, e, i);
},
getRandomPoint: function (t) {
return l(this, t);
},
setTo: function (t, e, i, n, s, r) {
return (
void 0 === t && (t = 0),
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 0),
void 0 === s && (s = 0),
void 0 === r && (r = 0),
(this.x1 = t),
(this.y1 = e),
(this.x2 = i),
(this.y2 = n),
(this.x3 = s),
(this.y3 = r),
this
);
},
getLineA: function (t) {
return void 0 === t && (t = new h()), t.setTo(this.x1, this.y1, this.x2, this.y2), t;
},
getLineB: function (t) {
return void 0 === t && (t = new h()), t.setTo(this.x2, this.y2, this.x3, this.y3), t;
},
getLineC: function (t) {
return void 0 === t && (t = new h()), t.setTo(this.x3, this.y3, this.x1, this.y1), t;
},
left: {
get: function () {
return Math.min(this.x1, this.x2, this.x3);
},
set: function (t) {
var e = this.x1 <= this.x2 && this.x1 <= this.x3 ? this.x1 - t : this.x2 <= this.x1 && this.x2 <= this.x3 ? this.x2 - t : this.x3 - t;
(this.x1 -= e), (this.x2 -= e), (this.x3 -= e);
},
},
right: {
get: function () {
return Math.max(this.x1, this.x2, this.x3);
},
set: function (t) {
var e = this.x1 >= this.x2 && this.x1 >= this.x3 ? this.x1 - t : this.x2 >= this.x1 && this.x2 >= this.x3 ? this.x2 - t : this.x3 - t;
(this.x1 -= e), (this.x2 -= e), (this.x3 -= e);
},
},
top: {
get: function () {
return Math.min(this.y1, this.y2, this.y3);
},
set: function (t) {
var e = this.y1 <= this.y2 && this.y1 <= this.y3 ? this.y1 - t : this.y2 <= this.y1 && this.y2 <= this.y3 ? this.y2 - t : this.y3 - t;
(this.y1 -= e), (this.y2 -= e), (this.y3 -= e);
},
},
bottom: {
get: function () {
return Math.max(this.y1, this.y2, this.y3);
},
set: function (t) {
var e = this.y1 >= this.y2 && this.y1 >= this.y3 ? this.y1 - t : this.y2 >= this.y1 && this.y2 >= this.y3 ? this.y2 - t : this.y3 - t;
(this.y1 -= e), (this.y2 -= e), (this.y3 -= e);
},
},
});
t.exports = u;
},
function (t, e) {
var i = {};
((t.exports = i).create = function (t, e) {
return { x: t || 0, y: e || 0 };
}),
(i.clone = function (t) {
return { x: t.x, y: t.y };
}),
(i.magnitude = function (t) {
return Math.sqrt(t.x * t.x + t.y * t.y);
}),
(i.magnitudeSquared = function (t) {
return t.x * t.x + t.y * t.y;
}),
(i.rotate = function (t, e, i) {
var n = Math.cos(e),
s = Math.sin(e);
i = i || {};
var r = t.x * n - t.y * s;
return (i.y = t.x * s + t.y * n), (i.x = r), i;
}),
(i.rotateAbout = function (t, e, i, n) {
var s = Math.cos(e),
r = Math.sin(e);
n = n || {};
var o = i.x + ((t.x - i.x) * s - (t.y - i.y) * r);
return (n.y = i.y + ((t.x - i.x) * r + (t.y - i.y) * s)), (n.x = o), n;
}),
(i.normalise = function (t) {
var e = i.magnitude(t);
return 0 === e ? { x: 0, y: 0 } : { x: t.x / e, y: t.y / e };
}),
(i.dot = function (t, e) {
return t.x * e.x + t.y * e.y;
}),
(i.cross = function (t, e) {
return t.x * e.y - t.y * e.x;
}),
(i.cross3 = function (t, e, i) {
return (e.x - t.x) * (i.y - t.y) - (e.y - t.y) * (i.x - t.x);
}),
(i.add = function (t, e, i) {
return ((i = i || {}).x = t.x + e.x), (i.y = t.y + e.y), i;
}),
(i.sub = function (t, e, i) {
return ((i = i || {}).x = t.x - e.x), (i.y = t.y - e.y), i;
}),
(i.mult = function (t, e) {
return { x: t.x * e, y: t.y * e };
}),
(i.div = function (t, e) {
return { x: t.x / e, y: t.y / e };
}),
(i.perp = function (t, e) {
return { x: (e = !0 === e ? -1 : 1) * -t.y, y: e * t.x };
}),
(i.neg = function (t) {
return { x: -t.x, y: -t.y };
}),
(i.angle = function (t, e) {
return Math.atan2(e.y - t.y, e.x - t.x);
}),
(i._temp = [i.create(), i.create(), i.create(), i.create(), i.create(), i.create()]);
},
function (t, e) {
var i = {};
((t.exports = i).create = function (t) {
var e = { min: { x: 0, y: 0 }, max: { x: 0, y: 0 } };
return t && i.update(e, t), e;
}),
(i.update = function (t, e, i) {
(t.min.x = 1 / 0), (t.max.x = -1 / 0), (t.min.y = 1 / 0), (t.max.y = -1 / 0);
for (var n = 0; n < e.length; n++) {
var s = e[n];
s.x > t.max.x && (t.max.x = s.x), s.x < t.min.x && (t.min.x = s.x), s.y > t.max.y && (t.max.y = s.y), s.y < t.min.y && (t.min.y = s.y);
}
i && (0 < i.x ? (t.max.x += i.x) : (t.min.x += i.x), 0 < i.y ? (t.max.y += i.y) : (t.min.y += i.y));
}),
(i.contains = function (t, e) {
return e.x >= t.min.x && e.x <= t.max.x && e.y >= t.min.y && e.y <= t.max.y;
}),
(i.overlaps = function (t, e) {
return t.min.x <= e.max.x && t.max.x >= e.min.x && t.max.y >= e.min.y && t.min.y <= e.max.y;
}),
(i.translate = function (t, e) {
(t.min.x += e.x), (t.max.x += e.x), (t.min.y += e.y), (t.max.y += e.y);
}),
(i.shift = function (t, e) {
var i = t.max.x - t.min.x,
n = t.max.y - t.min.y;
(t.min.x = e.x), (t.max.x = e.x + i), (t.min.y = e.y), (t.max.y = e.y + n);
});
},
function (t, e, i) {
var n = i(29),
s = i(0),
r = i(11),
o = i(502),
a = new s({
Mixins: [r.Alpha, r.Flip, r.Visible],
initialize: function (t, e, i, n, s, r, o, a) {
(this.layer = t),
(this.index = e),
(this.x = i),
(this.y = n),
(this.width = s),
(this.height = r),
this.right,
this.bottom,
(this.baseWidth = void 0 !== o ? o : s),
(this.baseHeight = void 0 !== a ? a : r),
(this.pixelX = 0),
(this.pixelY = 0),
this.updatePixelXY(),
(this.properties = {}),
(this.rotation = 0),
(this.collideLeft = !1),
(this.collideRight = !1),
(this.collideUp = !1),
(this.collideDown = !1),
(this.faceLeft = !1),
(this.faceRight = !1),
(this.faceTop = !1),
(this.faceBottom = !1),
(this.collisionCallback = void 0),
((this.collisionCallbackContext = this).tint = 16777215),
(this.physics = {});
},
containsPoint: function (t, e) {
return !(t < this.pixelX || e < this.pixelY || t > this.right || e > this.bottom);
},
copy: function (t) {
return (
(this.index = t.index),
(this.alpha = t.alpha),
(this.properties = t.properties),
(this.visible = t.visible),
this.setFlip(t.flipX, t.flipY),
(this.tint = t.tint),
(this.rotation = t.rotation),
(this.collideUp = t.collideUp),
(this.collideDown = t.collideDown),
(this.collideLeft = t.collideLeft),
(this.collideRight = t.collideRight),
(this.collisionCallback = t.collisionCallback),
(this.collisionCallbackContext = t.collisionCallbackContext),
this
);
},
getCollisionGroup: function () {
return this.tileset ? this.tileset.getTileCollisionGroup(this.index) : null;
},
getTileData: function () {
return this.tileset ? this.tileset.getTileData(this.index) : null;
},
getLeft: function (t) {
var e = this.tilemapLayer;
return e ? e.tileToWorldX(this.x, t) : this.x * this.baseWidth;
},
getRight: function (t) {
var e = this.tilemapLayer;
return e ? this.getLeft(t) + this.width * e.scaleX : this.getLeft(t) + this.width;
},
getTop: function (t) {
var e = this.tilemapLayer;
return e ? e.tileToWorldY(this.y, t) - (this.height - this.baseHeight) * e.scaleY : this.y * this.baseHeight - (this.height - this.baseHeight);
},
getBottom: function (t) {
var e = this.tilemapLayer;
return e ? this.getTop(t) + this.height * e.scaleY : this.getTop(t) + this.height;
},
getBounds: function (t, e) {
return void 0 === e && (e = new o()), (e.x = this.getLeft()), (e.y = this.getTop()), (e.width = this.getRight() - e.x), (e.height = this.getBottom() - e.y), e;
},
getCenterX: function (t) {
return (this.getLeft(t) + this.getRight(t)) / 2;
},
getCenterY: function (t) {
return (this.getTop(t) + this.getBottom(t)) / 2;
},
intersects: function (t, e, i, n) {
return !(i <= this.pixelX || n <= this.pixelY || t >= this.right || e >= this.bottom);
},
isInteresting: function (t, e) {
return t && e ? this.canCollide || this.hasInterestingFace : t ? this.collides : !!e && this.hasInterestingFace;
},
resetCollision: function (t) {
return (
void 0 === t && (t = !0),
(this.collideLeft = !1),
(this.collideRight = !1),
(this.collideUp = !1),
(this.collideDown = !1),
(this.faceTop = !1),
(this.faceBottom = !1),
(this.faceLeft = !1),
(this.faceRight = !1),
t && this.tilemapLayer && this.tilemapLayer.calculateFacesAt(this.x, this.y),
this
);
},
resetFaces: function () {
return (this.faceTop = !1), (this.faceBottom = !1), (this.faceLeft = !1), (this.faceRight = !1), this;
},
setCollision: function (t, e, i, n, s) {
return (
void 0 === e && (e = t),
void 0 === i && (i = t),
void 0 === n && (n = t),
void 0 === s && (s = !0),
(this.collideLeft = t),
(this.collideRight = e),
(this.collideUp = i),
(this.collideDown = n),
(this.faceLeft = t),
(this.faceRight = e),
(this.faceTop = i),
(this.faceBottom = n),
s && this.tilemapLayer && this.tilemapLayer.calculateFacesAt(this.x, this.y),
this
);
},
setCollisionCallback: function (t, e) {
return null === t ? ((this.collisionCallback = void 0), (this.collisionCallbackContext = void 0)) : ((this.collisionCallback = t), (this.collisionCallbackContext = e)), this;
},
setSize: function (t, e, i, n) {
return void 0 !== t && (this.width = t), void 0 !== e && (this.height = e), void 0 !== i && (this.baseWidth = i), void 0 !== n && (this.baseHeight = n), this.updatePixelXY(), this;
},
updatePixelXY: function () {
var t,
e,
i = this.layer.orientation;
return (
i === n.ORTHOGONAL
? ((this.pixelX = this.x * this.baseWidth), (this.pixelY = this.y * this.baseHeight))
: i === n.ISOMETRIC
? ((this.pixelX = (this.x - this.y) * this.baseWidth * 0.5), (this.pixelY = (this.x + this.y) * this.baseHeight * 0.5))
: i === n.STAGGERED
? ((this.pixelX = this.x * this.baseWidth + (this.y % 2) * (this.baseWidth / 2)), (this.pixelY = this.y * (this.baseHeight / 2)))
: i === n.HEXAGONAL && ((t = this.layer.hexSideLength), (e = (this.baseHeight - t) / 2 + t), (this.pixelX = this.x * this.baseWidth + (this.y % 2) * (this.baseWidth / 2)), (this.pixelY = this.y * e)),
(this.right = this.pixelX + this.baseWidth),
(this.bottom = this.pixelY + this.baseHeight),
this
);
},
destroy: function () {
(this.collisionCallback = void 0), (this.collisionCallbackContext = void 0), (this.properties = void 0);
},
canCollide: {
get: function () {
return this.collideLeft || this.collideRight || this.collideUp || this.collideDown || void 0 !== this.collisionCallback;
},
},
collides: {
get: function () {
return this.collideLeft || this.collideRight || this.collideUp || this.collideDown;
},
},
hasInterestingFace: {
get: function () {
return this.faceTop || this.faceBottom || this.faceLeft || this.faceRight;
},
},
tileset: {
get: function () {
var t = this.layer.tilemapLayer;
if (t) {
var e = t.gidMap[this.index];
if (e) return e;
}
return null;
},
},
tilemapLayer: {
get: function () {
return this.layer.tilemapLayer;
},
},
tilemap: {
get: function () {
var t = this.tilemapLayer;
return t ? t.tilemap : null;
},
},
});
t.exports = a;
},
function (t, e, i) {
var v = {};
t.exports = v;
var y = i(64),
m = i(32),
x = i(41),
d = i(84),
f = i(83),
b = i(1393);
(v.rectangle = function (t, e, i, n, s) {
s = s || {};
var r,
o = { label: "Rectangle Body", position: { x: t, y: e }, vertices: y.fromPath("L 0 0 L " + i + " 0 L " + i + " " + n + " L 0 " + n) };
return s.chamfer && ((r = s.chamfer), (o.vertices = y.chamfer(o.vertices, r.radius, r.quality, r.qualityMin, r.qualityMax)), delete s.chamfer), x.create(m.extend({}, o, s));
}),
(v.trapezoid = function (t, e, i, n, s, r) {
r = r || {};
var o,
a = i * (s *= 0.5),
h = a + (1 - 2 * s) * i,
l = h + a,
u = s < 0.5 ? "L 0 0 L " + a + " " + -n + " L " + h + " " + -n + " L " + l + " 0" : "L 0 0 L " + h + " " + -n + " L " + l + " 0",
c = { label: "Trapezoid Body", position: { x: t, y: e }, vertices: y.fromPath(u) };
return r.chamfer && ((o = r.chamfer), (c.vertices = y.chamfer(c.vertices, o.radius, o.quality, o.qualityMin, o.qualityMax)), delete r.chamfer), x.create(m.extend({}, c, r));
}),
(v.circle = function (t, e, i, n, s) {
n = n || {};
var r = { label: "Circle Body", circleRadius: i };
s = s || 25;
var o = Math.ceil(Math.max(10, Math.min(s, i)));
return o % 2 == 1 && (o += 1), v.polygon(t, e, o, i, m.extend({}, r, n));
}),
(v.polygon = function (t, e, i, n, s) {
if (((s = s || {}), i < 3)) return v.circle(t, e, n, s);
for (var r = (2 * Math.PI) / i, o = "", a = 0.5 * r, h = 0; h < i; h += 1) {
var l = a + h * r,
u = Math.cos(l) * n,
c = Math.sin(l) * n;
o += "L " + u.toFixed(3) + " " + c.toFixed(3) + " ";
}
var d,
f = { label: "Polygon Body", position: { x: t, y: e }, vertices: y.fromPath(o) };
return s.chamfer && ((d = s.chamfer), (f.vertices = y.chamfer(f.vertices, d.radius, d.quality, d.qualityMin, d.qualityMax)), delete s.chamfer), x.create(m.extend({}, f, s));
}),
(v.fromVertices = function (t, e, i, n, s, r, o) {
var a, h, l, u, c;
for (
n = n || {},
h = [],
s = void 0 !== s && s,
r = void 0 !== r ? r : 0.01,
o = void 0 !== o ? o : 10,
b || m.warn("Bodies.fromVertices: poly-decomp.js required. Could not decompose vertices. Fallback to convex hull."),
m.isArray(i[0]) || (i = [i]),
c = 0;
c < i.length;
c += 1
)
if (((u = i[c]), (l = y.isConvex(u)) || !b)) (u = l ? y.clockwiseSort(u) : y.hull(u)), h.push({ position: { x: t, y: e }, vertices: u });
else {
var d = u.map(function (t) {
return [t.x, t.y];
});
b.makeCCW(d), !1 !== r && b.removeCollinearPoints(d, r);
for (var f = b.quickDecomp(d), p = 0; p < f.length; p++) {
var g = f[p].map(function (t) {
return { x: t[0], y: t[1] };
});
(0 < o && y.area(g) < o) || h.push({ position: y.centre(g), vertices: g });
}
}
for (p = 0; p < h.length; p++) h[p] = x.create(m.extend(h[p], n));
return s && v.flagCoincidentParts(h, 5), 1 < h.length ? ((a = x.create(m.extend({ parts: h.slice(0) }, n))), x.setPosition(a, { x: t, y: e }), a) : h[0];
}),
(v.flagCoincidentParts = function (t, e) {
void 0 === e && (e = 5);
for (var i = 0; i < t.length; i++)
for (var n = t[i], s = i + 1; s < t.length; s++) {
var r = t[s];
if (d.overlaps(n.bounds, r.bounds))
for (var o = n.vertices, a = r.vertices, h = 0; h < n.vertices.length; h++)
for (var l = 0; l < r.vertices.length; l++) {
var u = f.magnitudeSquared(f.sub(o[(h + 1) % o.length], a[l])),
c = f.magnitudeSquared(f.sub(o[h], a[(l + 1) % a.length]));
u < e && c < e && ((o[h].isInternal = !0), (a[l].isInternal = !0));
}
}
return t;
});
},
function (t, e) {
t.exports = function (t) {
return t.x - t.width * t.originX + 0.5 * t.width;
};
},
function (t, e) {
t.exports = function (t, e) {
var i = t.width * t.originX;
return (t.x = e + i - 0.5 * t.width), t;
};
},
function (t, e) {
t.exports = function (t) {
return t.y - t.height * t.originY + 0.5 * t.height;
};
},
function (t, e) {
t.exports = function (t, e) {
var i = t.height * t.originY;
return (t.y = e + i - 0.5 * t.height), t;
};
},
function (t, e, i) {
t.exports = { POST_RENDER: i(628), PRE_RENDER: i(629), RENDER: i(630), RESIZE: i(631) };
},
function (t, e) {
t.exports = {
BITMAPMASK_PIPELINE: "BitmapMaskPipeline",
LIGHT_PIPELINE: "Light2D",
POINTLIGHT_PIPELINE: "PointLightPipeline",
SINGLE_PIPELINE: "SinglePipeline",
MULTI_PIPELINE: "MultiPipeline",
ROPE_PIPELINE: "RopePipeline",
GRAPHICS_PIPELINE: "GraphicsPipeline",
POSTFX_PIPELINE: "PostFXPipeline",
UTILITY_PIPELINE: "UtilityPipeline",
};
},
function (t, e, i) {
var h = i(74);
t.exports = function (t, e, i, n) {
if ((void 0 === n && (n = t), !Array.isArray(e))) return -1 !== (o = t.indexOf(e)) ? (h(t, o), i && i.call(n, e), e) : null;
for (var s = e.length - 1, r = []; 0 <= s; ) {
var o,
a = e[s];
-1 !== (o = t.indexOf(a)) && (h(t, o), r.push(a), i && i.call(n, a)), s--;
}
return r;
};
},
function (t, e, i) {
var n = i(0),
s = i(199),
r = i(10),
o = i(3),
a = new n({
initialize: function (t) {
(this.type = t), (this.defaultDivisions = 5), (this.arcLengthDivisions = 100), (this.cacheArcLengths = []), (this.needsUpdate = !0), (this.active = !0), (this._tmpVec2A = new o()), (this._tmpVec2B = new o());
},
draw: function (t, e) {
return void 0 === e && (e = 32), t.strokePoints(this.getPoints(e));
},
getBounds: function (t, e) {
(t = t || new r()), void 0 === e && (e = 16);
var i = this.getLength();
i < e && (e = i / 2);
var n = Math.max(1, Math.round(i / e));
return s(this.getSpacedPoints(n), t);
},
getDistancePoints: function (t) {
var e = this.getLength(),
i = Math.max(1, e / t);
return this.getSpacedPoints(i);
},
getEndPoint: function (t) {
return void 0 === t && (t = new o()), this.getPointAt(1, t);
},
getLength: function () {
var t = this.getLengths();
return t[t.length - 1];
},
getLengths: function (t) {
if ((void 0 === t && (t = this.arcLengthDivisions), this.cacheArcLengths.length === t + 1 && !this.needsUpdate)) return this.cacheArcLengths;
this.needsUpdate = !1;
var e,
i = [],
n = this.getPoint(0, this._tmpVec2A),
s = 0;
i.push(0);
for (var r = 1; r <= t; r++) (s += (e = this.getPoint(r / t, this._tmpVec2B)).distance(n)), i.push(s), n.copy(e);
return (this.cacheArcLengths = i);
},
getPointAt: function (t, e) {
var i = this.getUtoTmapping(t);
return this.getPoint(i, e);
},
getPoints: function (t, e, i) {
void 0 === i && (i = []), (t = t || (e ? this.getLength() / e : this.defaultDivisions));
for (var n = 0; n <= t; n++) i.push(this.getPoint(n / t));
return i;
},
getRandomPoint: function (t) {
return void 0 === t && (t = new o()), this.getPoint(Math.random(), t);
},
getSpacedPoints: function (t, e, i) {
void 0 === i && (i = []), (t = t || (e ? this.getLength() / e : this.defaultDivisions));
for (var n = 0; n <= t; n++) {
var s = this.getUtoTmapping(n / t, null, t);
i.push(this.getPoint(s));
}
return i;
},
getStartPoint: function (t) {
return void 0 === t && (t = new o()), this.getPointAt(0, t);
},
getTangent: function (t, e) {
void 0 === e && (e = new o());
var i = t - 1e-4,
n = t + 1e-4;
return i < 0 && (i = 0), 1 < n && (n = 1), this.getPoint(i, this._tmpVec2A), this.getPoint(n, e), e.subtract(this._tmpVec2A).normalize();
},
getTangentAt: function (t, e) {
var i = this.getUtoTmapping(t);
return this.getTangent(i, e);
},
getTFromDistance: function (t, e) {
return t <= 0 ? 0 : this.getUtoTmapping(0, t, e);
},
getUtoTmapping: function (t, e, i) {
for (var n, s = this.getLengths(i), r = 0, o = s.length, a = e ? Math.min(e, s[o - 1]) : t * s[o - 1], h = 0, l = o - 1; h <= l; )
if ((n = s[(r = Math.floor(h + (l - h) / 2))] - a) < 0) h = r + 1;
else {
if (!(0 < n)) {
l = r;
break;
}
l = r - 1;
}
if (s[(r = l)] === a) return r / (o - 1);
var u = s[r];
return (r + (a - u) / (s[r + 1] - u)) / (o - 1);
},
updateArcLengths: function () {
(this.needsUpdate = !0), this.getLengths();
},
});
t.exports = a;
},
function (t, e, i) {
t.exports = { ADD: i(968), COMPLETE: i(969), FILE_COMPLETE: i(970), FILE_KEY_COMPLETE: i(971), FILE_LOAD_ERROR: i(972), FILE_LOAD: i(973), FILE_PROGRESS: i(974), POST_PROCESS: i(975), PROGRESS: i(976), START: i(977) };
},
function (t, e, i) {
var p = i(4);
t.exports = function (t, e, i) {
void 0 === i && (i = new p());
var n = t.x1,
s = t.y1,
r = t.x2,
o = t.y2,
a = e.x1,
h = e.y1,
l = e.x2,
u = e.y2,
c = (u - h) * (r - n) - (l - a) * (o - s);
if (0 == c) return !1;
var d = ((l - a) * (s - h) - (u - h) * (n - a)) / c,
f = ((r - n) * (s - h) - (o - s) * (n - a)) / c;
return 0 <= d && d <= 1 && 0 <= f && f <= 1 && ((i.x = n + d * (r - n)), (i.y = s + d * (o - s)), !0);
};
},
function (t, e) {
t.exports = function (t) {
return Math.atan2(t.y2 - t.y1, t.x2 - t.x1);
};
},
function (t, e, i) {
var n = i(18);
t.exports = function (t, e, i) {
return (i - e) * (t = n(t, 0, 1)) + e;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return t && t.hasOwnProperty(e) ? t[e] : i;
};
},
function (t, e) {
t.exports = {
CREATED: 0,
INIT: 1,
DELAY: 2,
OFFSET_DELAY: 3,
PENDING_RENDER: 4,
PLAYING_FORWARD: 5,
PLAYING_BACKWARD: 6,
HOLD_DELAY: 7,
REPEAT_DELAY: 8,
COMPLETE: 9,
PENDING_ADD: 20,
PAUSED: 21,
LOOP_DELAY: 22,
ACTIVE: 23,
COMPLETE_DELAY: 24,
PENDING_REMOVE: 25,
REMOVED: 26,
};
},
function (t, e, i) {
var n = i(0),
a = i(315),
s = new n({
initialize: function (t, e) {
(this.parent = t),
(this.events = e) || (this.events = t.events ? t.events : t),
(this.list = {}),
(this.values = {}),
(this._frozen = !1),
!t.hasOwnProperty("sys") && this.events && this.events.once(a.DESTROY, this.destroy, this);
},
get: function (t) {
var e = this.list;
if (Array.isArray(t)) {
for (var i = [], n = 0; n < t.length; n++) i.push(e[t[n]]);
return i;
}
return e[t];
},
getAll: function () {
var t = {};
for (var e in this.list) this.list.hasOwnProperty(e) && (t[e] = this.list[e]);
return t;
},
query: function (t) {
var e = {};
for (var i in this.list) this.list.hasOwnProperty(i) && i.match(t) && (e[i] = this.list[i]);
return e;
},
set: function (t, e) {
if (this._frozen) return this;
if ("string" == typeof t) return this.setValue(t, e);
for (var i in t) this.setValue(i, t[i]);
return this;
},
inc: function (t, e) {
if (this._frozen) return this;
void 0 === e && (e = 1);
var i = this.get(t);
return void 0 === i && (i = 0), this.set(t, i + e), this;
},
toggle: function (t) {
return this._frozen || this.set(t, !this.get(t)), this;
},
setValue: function (i, t) {
return (
this._frozen ||
(this.has(i)
? (this.values[i] = t)
: ((s = (n = this).list),
(r = this.events),
(o = this.parent),
Object.defineProperty(this.values, i, {
enumerable: !0,
configurable: !0,
get: function () {
return s[i];
},
set: function (t) {
var e;
n._frozen || ((e = s[i]), (s[i] = t), r.emit(a.CHANGE_DATA, o, i, t, e), r.emit(a.CHANGE_DATA_KEY + i, o, t, e));
},
}),
(s[i] = t),
r.emit(a.SET_DATA, o, i, t))),
this
);
var n, s, r, o;
},
each: function (t, e) {
for (var i = [this.parent, null, void 0], n = 1; n < arguments.length; n++) i.push(arguments[n]);
for (var s in this.list) (i[1] = s), (i[2] = this.list[s]), t.apply(e, i);
return this;
},
merge: function (t, e) {
for (var i in (void 0 === e && (e = !0), t)) t.hasOwnProperty(i) && (e || (!e && !this.has(i))) && this.setValue(i, t[i]);
return this;
},
remove: function (t) {
if (this._frozen) return this;
if (!Array.isArray(t)) return this.removeValue(t);
for (var e = 0; e < t.length; e++) this.removeValue(t[e]);
return this;
},
removeValue: function (t) {
var e;
return this.has(t) && ((e = this.list[t]), delete this.list[t], delete this.values[t], this.events.emit(a.REMOVE_DATA, this.parent, t, e)), this;
},
pop: function (t) {
var e = void 0;
return !this._frozen && this.has(t) && ((e = this.list[t]), delete this.list[t], delete this.values[t], this.events.emit(a.REMOVE_DATA, this.parent, t, e)), e;
},
has: function (t) {
return this.list.hasOwnProperty(t);
},
setFreeze: function (t) {
return (this._frozen = t), this;
},
reset: function () {
for (var t in this.list) delete this.list[t], delete this.values[t];
return (this._frozen = !1), this;
},
destroy: function () {
this.reset(), this.events.off(a.CHANGE_DATA), this.events.off(a.SET_DATA), this.events.off(a.REMOVE_DATA), (this.parent = null);
},
freeze: {
get: function () {
return this._frozen;
},
set: function (t) {
this._frozen = !!t;
},
},
count: {
get: function () {
var t = 0;
for (var e in this.list) void 0 !== this.list[e] && t++;
return t;
},
},
});
t.exports = s;
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t) {
if (((this.entries = {}), (this.size = 0), Array.isArray(t))) for (var e = 0; e < t.length; e++) this.set(t[e][0], t[e][1]);
},
set: function (t, e) {
return this.has(t) || this.size++, (this.entries[t] = e), this;
},
get: function (t) {
if (this.has(t)) return this.entries[t];
},
getArray: function () {
var t = [],
e = this.entries;
for (var i in e) t.push(e[i]);
return t;
},
has: function (t) {
return this.entries.hasOwnProperty(t);
},
delete: function (t) {
return this.has(t) && (delete this.entries[t], this.size--), this;
},
clear: function () {
return (
Object.keys(this.entries).forEach(function (t) {
delete this.entries[t];
}, this),
(this.size = 0),
this
);
},
keys: function () {
return Object.keys(this.entries);
},
values: function () {
var t = [],
e = this.entries;
for (var i in e) t.push(e[i]);
return t;
},
dump: function () {
var t = this.entries;
for (var e in t);
},
each: function (t) {
var e = this.entries;
for (var i in e) if (!1 === t(i, e[i])) break;
return this;
},
contains: function (t) {
var e = this.entries;
for (var i in e) if (e[i] === t) return !0;
return !1;
},
merge: function (t, e) {
void 0 === e && (e = !1);
var i = this.entries,
n = t.entries;
for (var s in n) i.hasOwnProperty(s) && e ? (i[s] = n[s]) : this.set(s, n[s]);
return this;
},
});
t.exports = n;
},
function (t, e) {
t.exports = function (t, e, i) {
return (t << 16) | (e << 8) | i;
};
},
function (t, e, i) {
t.exports = { ENTER_FULLSCREEN: i(800), FULLSCREEN_FAILED: i(801), FULLSCREEN_UNSUPPORTED: i(802), LEAVE_FULLSCREEN: i(803), ORIENTATION_CHANGE: i(804), RESIZE: i(805) };
},
function (t, e, i) {
(function (i) {
var n = {
android: !1,
chromeOS: !1,
cordova: !1,
crosswalk: !1,
desktop: !1,
ejecta: !1,
electron: !1,
iOS: !1,
iOSVersion: 0,
iPad: !1,
iPhone: !1,
kindle: !1,
linux: !1,
macOS: !1,
node: !1,
nodeWebkit: !1,
pixelRatio: 1,
webApp: !1,
windows: !1,
windowsPhone: !1,
};
t.exports = (function () {
if ("function" == typeof importScripts) return n;
var t = navigator.userAgent;
/Windows/.test(t)
? (n.windows = !0)
: /Mac OS/.test(t) && !/like Mac OS/.test(t)
? navigator.maxTouchPoints && 2 < navigator.maxTouchPoints
? ((n.iOS = !0), (n.iPad = !0), navigator.appVersion.match(/Version\/(\d+)/), (n.iOSVersion = parseInt(RegExp.$1, 10)))
: (n.macOS = !0)
: /Android/.test(t)
? (n.android = !0)
: /Linux/.test(t)
? (n.linux = !0)
: /iP[ao]d|iPhone/i.test(t)
? ((n.iOS = !0), navigator.appVersion.match(/OS (\d+)/), (n.iOSVersion = parseInt(RegExp.$1, 10)), (n.iPhone = -1 !== t.toLowerCase().indexOf("iphone")), (n.iPad = -1 !== t.toLowerCase().indexOf("ipad")))
: /Kindle/.test(t) || /\bKF[A-Z][A-Z]+/.test(t) || /Silk.*Mobile Safari/.test(t)
? (n.kindle = !0)
: /CrOS/.test(t) && (n.chromeOS = !0),
(/Windows Phone/i.test(t) || /IEMobile/i.test(t)) && ((n.android = !1), (n.iOS = !1), (n.macOS = !1), (n.windows = !0), (n.windowsPhone = !0));
var e = /Silk/.test(t);
return (
(n.windows || n.macOS || (n.linux && !e) || n.chromeOS) && (n.desktop = !0),
(n.windowsPhone || (/Windows NT/i.test(t) && /Touch/i.test(t))) && (n.desktop = !1),
navigator.standalone && (n.webApp = !0),
"function" != typeof importScripts && (void 0 !== window.cordova && (n.cordova = !0), void 0 !== window.ejecta && (n.ejecta = !0)),
void 0 !== i && i.versions && i.versions.node && (n.node = !0),
n.node && "object" == typeof i.versions && ((n.nodeWebkit = !!i.versions["node-webkit"]), (n.electron = !!i.versions.electron)),
/Crosswalk/.test(t) && (n.crosswalk = !0),
(n.pixelRatio = window.devicePixelRatio || 1),
n
);
})();
}.call(this, i(807)));
},
function (t, e, i) {
t.exports = { ADD: i(861), ERROR: i(862), LOAD: i(863), READY: i(864), REMOVE: i(865) };
},
function (t, e) {
t.exports = {
BYTE: { enum: 5120, size: 1 },
UNSIGNED_BYTE: { enum: 5121, size: 1 },
SHORT: { enum: 5122, size: 2 },
UNSIGNED_SHORT: { enum: 5123, size: 2 },
INT: { enum: 5124, size: 4 },
UNSIGNED_INT: { enum: 5125, size: 4 },
FLOAT: { enum: 5126, size: 4 },
};
},
function (t, e, i) {
var n = i(0),
M = i(59),
s = i(2),
r = i(878),
o = i(879),
a = i(25),
X = i(12),
h = i(107),
l = i(58),
u = new n({
Extends: l,
initialize: function (t) {
var e = t.game.renderer,
i = s(t, "fragShader", r);
(t.fragShader = X.parseFragmentShaderMaxTextures(i, e.maxTextures)),
(t.vertShader = s(t, "vertShader", o)),
(t.attributes = s(t, "attributes", [
{ name: "inPosition", size: 2 },
{ name: "inTexCoord", size: 2 },
{ name: "inTexId" },
{ name: "inTintEffect" },
{ name: "inTint", size: 4, type: h.UNSIGNED_BYTE, normalized: !0 },
])),
l.call(this, t),
(this._tempMatrix1 = new a()),
(this._tempMatrix2 = new a()),
(this._tempMatrix3 = new a()),
(this.calcMatrix = new a()),
(this.tempTriangle = [
{ x: 0, y: 0, width: 0 },
{ x: 0, y: 0, width: 0 },
{ x: 0, y: 0, width: 0 },
{ x: 0, y: 0, width: 0 },
]),
(this.strokeTint = { TL: 0, TR: 0, BL: 0, BR: 0 }),
(this.fillTint = { TL: 0, TR: 0, BL: 0, BR: 0 }),
(this.currentFrame = { u0: 0, v0: 0, u1: 1, v1: 1 }),
(this.firstQuad = [0, 0, 0, 0, 0]),
(this.prevQuad = [0, 0, 0, 0, 0]),
(this.polygonCache = []);
},
boot: function () {
l.prototype.boot.call(this), this.currentShader.set1iv("uMainSampler", this.renderer.textureIndexes);
},
batchSprite: function (t, e, i) {
this.manager.set(this, t);
var n,
s = this._tempMatrix1,
r = this._tempMatrix2,
o = this._tempMatrix3,
a = t.frame,
h = a.glTexture,
l = a.u0,
u = a.v0,
c = a.u1,
d = a.v1,
f = a.x,
p = a.y,
g = a.cutWidth,
v = a.cutHeight,
y = a.customPivot,
m = t.displayOriginX,
x = t.displayOriginY,
b = -m + f,
w = -x + p;
t.isCropped &&
(((n = t._crop).flipX === t.flipX && n.flipY === t.flipY) || a.updateCropUVs(n, t.flipX, t.flipY),
(l = n.u0),
(u = n.v0),
(c = n.u1),
(d = n.v1),
(g = n.width),
(v = n.height),
(b = -m + n.x),
(w = -x + n.y));
var T = 1,
S = 1;
t.flipX && (y || (b += -a.realWidth + 2 * m), (T = -1)),
(t.flipY || (a.source.isGLTexture && !h.flipY)) && (y || (w += -a.realHeight + 2 * x), (S = -1)),
r.applyITRS(t.x, t.y, t.rotation, t.scaleX * T, t.scaleY * S),
s.copyFrom(e.matrix),
i ? (s.multiplyWithOffset(i, -e.scrollX * t.scrollFactorX, -e.scrollY * t.scrollFactorY), (r.e = t.x), (r.f = t.y)) : ((r.e -= e.scrollX * t.scrollFactorX), (r.f -= e.scrollY * t.scrollFactorY)),
s.multiply(r, o);
var _ = b + g,
E = w + v,
P = e.roundPixels,
A = o.getXRound(b, w, P),
M = o.getYRound(b, w, P),
C = o.getXRound(b, E, P),
O = o.getYRound(b, E, P),
k = o.getXRound(_, E, P),
R = o.getYRound(_, E, P),
L = o.getXRound(_, w, P),
I = o.getYRound(_, w, P),
D = X.getTintAppendFloatAlpha,
F = e.alpha,
B = D(t.tintTopLeft, F * t._alphaTL),
N = D(t.tintTopRight, F * t._alphaTR),
U = D(t.tintBottomLeft, F * t._alphaBL),
Y = D(t.tintBottomRight, F * t._alphaBR);
this.shouldFlush(6) && this.flush();
var z = this.setGameObject(t, a);
this.manager.preBatch(t), this.batchQuad(t, A, M, C, O, k, R, L, I, l, u, c, d, B, N, U, Y, t.tintFill, h, z), this.manager.postBatch(t);
},
batchTexture: function (t, e, i, n, s, r, o, a, h, l, u, c, d, f, p, g, v, y, m, x, b, w, T, S, _, E, P, A, M, C, O, k) {
this.manager.set(this, t);
var R,
L,
I,
D,
F,
B = this._tempMatrix1,
N = this._tempMatrix2,
U = this._tempMatrix3,
Y = y / i + P,
z = m / n + A,
X = (y + x) / i + P,
V = (m + b) / n + A,
G = o,
j = a,
H = -g,
W = -v;
t.isCropped &&
((o = G = L = (R = t._crop).width),
(a = j = I = R.height),
(D = y = R.x),
(F = m = R.y),
c && (D = x - R.x - L),
d && (F = b - R.y - I),
(Y = D / i + P),
(z = F / n + A),
(X = (D + L) / i + P),
(V = (F + I) / n + A),
(H = -g + y),
(W = -v + m)),
c && ((G *= -1), (H += o)),
(d ^= !O && e.isRenderTexture ? 1 : 0) && ((j *= -1), (W += a));
var K = H + G,
q = W + j;
N.applyITRS(s, r, u, h, l), B.copyFrom(M.matrix), C ? (B.multiplyWithOffset(C, -M.scrollX * f, -M.scrollY * p), (N.e = s), (N.f = r)) : ((N.e -= M.scrollX * f), (N.f -= M.scrollY * p)), B.multiply(N, U);
var Z = M.roundPixels,
J = U.getXRound(H, W, Z),
Q = U.getYRound(H, W, Z),
$ = U.getXRound(H, q, Z),
tt = U.getYRound(H, q, Z),
et = U.getXRound(K, q, Z),
it = U.getYRound(K, q, Z),
nt = U.getXRound(K, W, Z),
st = U.getYRound(K, W, Z);
void 0 === k && (k = this.renderer.setTexture2D(e)), t && this.manager.preBatch(t), this.batchQuad(t, J, Q, $, tt, et, it, nt, st, Y, z, X, V, w, T, S, _, E, e, k), t && this.manager.postBatch(t);
},
batchTextureFrame: function (t, e, i, n, s, r, o) {
this.manager.set(this);
var a = this._tempMatrix1.copyFrom(r),
h = this._tempMatrix2,
l = e + t.width,
u = i + t.height;
o ? a.multiply(o, h) : (h = a);
var c = h.getX(e, i),
d = h.getY(e, i),
f = h.getX(e, u),
p = h.getY(e, u),
g = h.getX(l, u),
v = h.getY(l, u),
y = h.getX(l, i),
m = h.getY(l, i),
x = this.renderer.setTextureSource(t.source);
(n = X.getTintAppendFloatAlpha(n, s)), this.batchQuad(null, c, d, f, p, g, v, y, m, t.u0, t.v0, t.u1, t.v1, n, n, n, n, 0, t.glTexture, x);
},
batchFillRect: function (t, e, i, n, s, r) {
this.renderer.pipelines.set(this);
var o = this.calcMatrix;
r && r.multiply(s, o);
var a = t + i,
h = e + n,
l = o.getX(t, e),
u = o.getY(t, e),
c = o.getX(t, h),
d = o.getY(t, h),
f = o.getX(a, h),
p = o.getY(a, h),
g = o.getX(a, e),
v = o.getY(a, e),
y = this.fillTint;
this.batchQuad(null, l, u, c, d, f, p, g, v, 0, 0, 1, 1, y.TL, y.TR, y.BL, y.BR, 2);
},
batchFillTriangle: function (t, e, i, n, s, r, o, a) {
this.renderer.pipelines.set(this);
var h = this.calcMatrix;
a && a.multiply(o, h);
var l = h.getX(t, e),
u = h.getY(t, e),
c = h.getX(i, n),
d = h.getY(i, n),
f = h.getX(s, r),
p = h.getY(s, r),
g = this.fillTint;
this.batchTri(null, l, u, c, d, f, p, 0, 0, 1, 1, g.TL, g.TR, g.BL, 2);
},
batchStrokeTriangle: function (t, e, i, n, s, r, o, a, h) {
var l = this.tempTriangle;
(l[0].x = t),
(l[0].y = e),
(l[0].width = o),
(l[1].x = i),
(l[1].y = n),
(l[1].width = o),
(l[2].x = s),
(l[2].y = r),
(l[2].width = o),
(l[3].x = t),
(l[3].y = e),
(l[3].width = o),
this.batchStrokePath(l, o, !1, a, h);
},
batchFillPath: function (t, e, i) {
this.renderer.pipelines.set(this);
var n = this.calcMatrix;
i && i.multiply(e, n);
for (var s, r, o = t.length, a = this.polygonCache, h = this.fillTint.TL, l = this.fillTint.TR, u = this.fillTint.BL, c = 0; c < o; ++c) (r = t[c]), a.push(r.x, r.y);
o = (s = M(a)).length;
for (var d = 0; d < o; d += 3) {
var f = 2 * s[d + 0],
p = 2 * s[d + 1],
g = 2 * s[d + 2],
v = a[0 + f],
y = a[1 + f],
m = a[0 + p],
x = a[1 + p],
b = a[0 + g],
w = a[1 + g],
T = n.getX(v, y),
S = n.getY(v, y),
_ = n.getX(m, x),
E = n.getY(m, x),
P = n.getX(b, w),
A = n.getY(b, w);
this.batchTri(null, T, S, _, E, P, A, 0, 0, 1, 1, h, l, u, 2);
}
a.length = 0;
},
batchStrokePath: function (t, e, i, n, s) {
this.renderer.pipelines.set(this), (this.prevQuad[4] = 0), (this.firstQuad[4] = 0);
for (var r = t.length - 1, o = 0; o < r; o++) {
var a = t[o],
h = t[o + 1];
this.batchLine(a.x, a.y, h.x, h.y, a.width / 2, h.width / 2, e, o, !i && o === r - 1, n, s);
}
},
batchLine: function (t, e, i, n, s, r, o, a, h, l, u) {
this.renderer.pipelines.set(this);
var c = this.calcMatrix;
u && u.multiply(l, c);
var d,
f,
p = i - t,
g = n - e,
v = Math.sqrt(p * p + g * g),
y = (s * (n - e)) / v,
m = (s * (t - i)) / v,
x = (r * (n - e)) / v,
b = (r * (t - i)) / v,
w = i - x,
T = n - b,
S = t - y,
_ = e - m,
E = i + x,
P = n + b,
A = t + y,
M = e + m,
C = c.getX(w, T),
O = c.getY(w, T),
k = c.getX(S, _),
R = c.getY(S, _),
L = c.getX(E, P),
I = c.getY(E, P),
D = c.getX(A, M),
F = c.getY(A, M),
B = this.strokeTint,
N = B.TL,
U = B.TR,
Y = B.BL,
z = B.BR;
this.batchQuad(null, D, F, k, R, C, O, L, I, 0, 0, 1, 1, N, U, Y, z, 2),
o <= 2 ||
((d = this.prevQuad),
(f = this.firstQuad),
0 < a && d[4] ? this.batchQuad(null, D, F, k, R, d[0], d[1], d[2], d[3], 0, 0, 1, 1, N, U, Y, z, 2) : ((f[0] = D), (f[1] = F), (f[2] = k), (f[3] = R), (f[4] = 1)),
h && f[4] ? this.batchQuad(null, C, O, L, I, f[0], f[1], f[2], f[3], 0, 0, 1, 1, N, U, Y, z, 2) : ((d[0] = C), (d[1] = O), (d[2] = L), (d[3] = I), (d[4] = 1)));
},
});
t.exports = u;
},
function (t, e, i) {
var n = i(0),
A = i(18),
s = i(17),
r = new n({
initialize: function (t, e, i, n, s, r, o) {
(this.texture = t),
(this.name = e),
(this.source = t.source[i]),
(this.sourceIndex = i),
(this.glTexture = this.source.glTexture),
this.cutX,
this.cutY,
this.cutWidth,
this.cutHeight,
(this.x = 0),
(this.y = 0),
this.width,
this.height,
this.halfWidth,
this.halfHeight,
this.centerX,
this.centerY,
(this.pivotX = 0),
(this.pivotY = 0),
(this.customPivot = !1),
(this.rotated = !1),
(this.autoRound = -1),
(this.customData = {}),
(this.u0 = 0),
(this.v0 = 0),
(this.u1 = 0),
(this.v1 = 0),
(this.data = {
cut: { x: 0, y: 0, w: 0, h: 0, r: 0, b: 0 },
trim: !1,
sourceSize: { w: 0, h: 0 },
spriteSourceSize: { x: 0, y: 0, w: 0, h: 0, r: 0, b: 0 },
radius: 0,
drawImage: { x: 0, y: 0, width: 0, height: 0 },
}),
this.setSize(r, o, n, s);
},
setSize: function (t, e, i, n) {
void 0 === i && (i = 0),
void 0 === n && (n = 0),
(this.cutX = i),
(this.cutY = n),
(this.cutWidth = t),
(this.cutHeight = e),
(this.width = t),
(this.height = e),
(this.halfWidth = Math.floor(0.5 * t)),
(this.halfHeight = Math.floor(0.5 * e)),
(this.centerX = Math.floor(t / 2)),
(this.centerY = Math.floor(e / 2));
var s = this.data,
r = s.cut;
(r.x = i),
(r.y = n),
(r.w = t),
(r.h = e),
(r.r = i + t),
(r.b = n + e),
(s.sourceSize.w = t),
(s.sourceSize.h = e),
(s.spriteSourceSize.w = t),
(s.spriteSourceSize.h = e),
(s.radius = 0.5 * Math.sqrt(t * t + e * e));
var o = s.drawImage;
return (o.x = i), (o.y = n), (o.width = t), (o.height = e), this.updateUVs();
},
setTrim: function (t, e, i, n, s, r) {
var o = this.data,
a = o.spriteSourceSize;
return (
(o.trim = !0),
(o.sourceSize.w = t),
(o.sourceSize.h = e),
(a.x = i),
(a.y = n),
(a.w = s),
(a.h = r),
(a.r = i + s),
(a.b = n + r),
(this.x = i),
(this.y = n),
(this.width = s),
(this.height = r),
(this.halfWidth = 0.5 * s),
(this.halfHeight = 0.5 * r),
(this.centerX = Math.floor(s / 2)),
(this.centerY = Math.floor(r / 2)),
this.updateUVs()
);
},
setCropUVs: function (t, e, i, n, s, r, o) {
var a,
h,
l,
u,
c,
d,
f,
p = this.cutX,
g = this.cutY,
v = this.cutWidth,
y = this.cutHeight,
m = this.realWidth,
x = this.realHeight,
b = p + (e = A(e, 0, m)),
w = g + (i = A(i, 0, x)),
T = (n = A(n, 0, m - e)),
S = (s = A(s, 0, x - i)),
_ = this.data;
_.trim
? ((a = _.spriteSourceSize),
(h = e + (n = A(n, 0, v - e))),
(l = i + (s = A(s, 0, y - i))),
a.r < e || a.b < i || a.x > h || a.y > l
? (S = T = w = b = 0)
: ((u = Math.max(a.x, e)),
(c = Math.max(a.y, i)),
(T = d = Math.min(a.r, h) - u),
(S = f = Math.min(a.b, l) - c),
(b = r ? p + (v - (u - a.x) - d) : p + (u - a.x)),
(w = o ? g + (y - (c - a.y) - f) : g + (c - a.y)),
(e = u),
(i = c),
(n = d),
(s = f)))
: (r && (b = p + (v - e - n)), o && (w = g + (y - i - s)));
var E = this.source.width,
P = this.source.height;
return (
(t.u0 = Math.max(0, b / E)),
(t.v0 = Math.max(0, w / P)),
(t.u1 = Math.min(1, (b + T) / E)),
(t.v1 = Math.min(1, (w + S) / P)),
(t.x = e),
(t.y = i),
(t.cx = b),
(t.cy = w),
(t.cw = T),
(t.ch = S),
(t.width = n),
(t.height = s),
(t.flipX = r),
(t.flipY = o),
t
);
},
updateCropUVs: function (t, e, i) {
return this.setCropUVs(t, t.x, t.y, t.width, t.height, e, i);
},
setUVs: function (t, e, i, n, s, r) {
var o = this.data.drawImage;
return (o.width = t), (o.height = e), (this.u0 = i), (this.v0 = n), (this.u1 = s), (this.v1 = r), this;
},
updateUVs: function () {
var t = this.cutX,
e = this.cutY,
i = this.cutWidth,
n = this.cutHeight,
s = this.data.drawImage;
(s.width = i), (s.height = n);
var r = this.source.width,
o = this.source.height;
return (this.u0 = t / r), (this.v0 = e / o), (this.u1 = (t + i) / r), (this.v1 = (e + n) / o), this;
},
updateUVsInverted: function () {
var t = this.source.width,
e = this.source.height;
return (this.u0 = (this.cutX + this.cutHeight) / t), (this.v0 = this.cutY / e), (this.u1 = this.cutX / t), (this.v1 = (this.cutY + this.cutWidth) / e), this;
},
clone: function () {
var t = new r(this.texture, this.name, this.sourceIndex);
return (
(t.cutX = this.cutX),
(t.cutY = this.cutY),
(t.cutWidth = this.cutWidth),
(t.cutHeight = this.cutHeight),
(t.x = this.x),
(t.y = this.y),
(t.width = this.width),
(t.height = this.height),
(t.halfWidth = this.halfWidth),
(t.halfHeight = this.halfHeight),
(t.centerX = this.centerX),
(t.centerY = this.centerY),
(t.rotated = this.rotated),
(t.data = s(!0, t.data, this.data)),
t.updateUVs(),
t
);
},
destroy: function () {
(this.source = null), (this.texture = null), (this.glTexture = null), (this.customData = null), (this.data = null);
},
realWidth: {
get: function () {
return this.data.sourceSize.w;
},
},
realHeight: {
get: function () {
return this.data.sourceSize.h;
},
},
radius: {
get: function () {
return this.data.radius;
},
},
trimmed: {
get: function () {
return this.data.trim;
},
},
canvasData: {
get: function () {
return this.data.drawImage;
},
},
});
t.exports = r;
},
function (t, e, i) {
var s = i(208),
n = i(0),
r = i(1),
o = i(79),
a = new n({
initialize: function (t) {
(this.parent = t), (this.list = []), (this.position = 0), (this.addCallback = r), (this.removeCallback = r), (this._sortKey = "");
},
add: function (t, e) {
return e ? s.Add(this.list, t) : s.Add(this.list, t, 0, this.addCallback, this);
},
addAt: function (t, e, i) {
return i ? s.AddAt(this.list, t, e) : s.AddAt(this.list, t, e, 0, this.addCallback, this);
},
getAt: function (t) {
return this.list[t];
},
getIndex: function (t) {
return this.list.indexOf(t);
},
sort: function (i, t) {
return (
i &&
(void 0 === t &&
(t = function (t, e) {
return t[i] - e[i];
}),
o(this.list, t)),
this
);
},
getByName: function (t) {
return s.GetFirst(this.list, "name", t);
},
getRandom: function (t, e) {
return s.GetRandom(this.list, t, e);
},
getFirst: function (t, e, i, n) {
return s.GetFirst(this.list, t, e, i, n);
},
getAll: function (t, e, i, n) {
return s.GetAll(this.list, t, e, i, n);
},
count: function (t, e) {
return s.CountAllMatching(this.list, t, e);
},
swap: function (t, e) {
s.Swap(this.list, t, e);
},
moveTo: function (t, e) {
return s.MoveTo(this.list, t, e);
},
moveAbove: function (t, e) {
return s.MoveAbove(this.list, t, e);
},
moveBelow: function (t, e) {
return s.MoveBelow(this.list, t, e);
},
remove: function (t, e) {
return e ? s.Remove(this.list, t) : s.Remove(this.list, t, this.removeCallback, this);
},
removeAt: function (t, e) {
return e ? s.RemoveAt(this.list, t) : s.RemoveAt(this.list, t, this.removeCallback, this);
},
removeBetween: function (t, e, i) {
return i ? s.RemoveBetween(this.list, t, e) : s.RemoveBetween(this.list, t, e, this.removeCallback, this);
},
removeAll: function (t) {
for (var e = this.list.length; e--; ) this.remove(this.list[e], t);
return this;
},
bringToTop: function (t) {
return s.BringToTop(this.list, t);
},
sendToBack: function (t) {
return s.SendToBack(this.list, t);
},
moveUp: function (t) {
return s.MoveUp(this.list, t), t;
},
moveDown: function (t) {
return s.MoveDown(this.list, t), t;
},
reverse: function () {
return this.list.reverse(), this;
},
shuffle: function () {
return s.Shuffle(this.list), this;
},
replace: function (t, e) {
return s.Replace(this.list, t, e);
},
exists: function (t) {
return -1 < this.list.indexOf(t);
},
setAll: function (t, e, i, n) {
return s.SetAll(this.list, t, e, i, n), this;
},
each: function (t, e) {
for (var i = [null], n = 2; n < arguments.length; n++) i.push(arguments[n]);
for (n = 0; n < this.list.length; n++) (i[0] = this.list[n]), t.apply(e, i);
},
shutdown: function () {
this.removeAll(), (this.list = []);
},
destroy: function () {
this.removeAll(), (this.parent = null), (this.addCallback = null), (this.removeCallback = null);
},
length: {
get: function () {
return this.list.length;
},
},
first: {
get: function () {
return (this.position = 0) < this.list.length ? this.list[0] : null;
},
},
last: {
get: function () {
return 0 < this.list.length ? ((this.position = this.list.length - 1), this.list[this.position]) : null;
},
},
next: {
get: function () {
return this.position < this.list.length ? (this.position++, this.list[this.position]) : null;
},
},
previous: {
get: function () {
return 0 < this.position ? (this.position--, this.list[this.position]) : null;
},
},
});
t.exports = a;
},
function (t, e, i) {
var n = i(0),
s = i(112),
r = i(445),
o = i(446),
a = i(56),
h = i(180),
l = new n({
initialize: function (t, e, i, n) {
void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === n && (n = 0), (this.type = a.ELLIPSE), (this.x = t), (this.y = e), (this.width = i), (this.height = n);
},
contains: function (t, e) {
return s(this, t, e);
},
getPoint: function (t, e) {
return r(this, t, e);
},
getPoints: function (t, e, i) {
return o(this, t, e, i);
},
getRandomPoint: function (t) {
return h(this, t);
},
setTo: function (t, e, i, n) {
return (this.x = t), (this.y = e), (this.width = i), (this.height = n), this;
},
setEmpty: function () {
return (this.width = 0), (this.height = 0), this;
},
setPosition: function (t, e) {
return void 0 === e && (e = t), (this.x = t), (this.y = e), this;
},
setSize: function (t, e) {
return void 0 === e && (e = t), (this.width = t), (this.height = e), this;
},
isEmpty: function () {
return this.width <= 0 || this.height <= 0;
},
getMinorRadius: function () {
return Math.min(this.width, this.height) / 2;
},
getMajorRadius: function () {
return Math.max(this.width, this.height) / 2;
},
left: {
get: function () {
return this.x - this.width / 2;
},
set: function (t) {
this.x = t + this.width / 2;
},
},
right: {
get: function () {
return this.x + this.width / 2;
},
set: function (t) {
this.x = t - this.width / 2;
},
},
top: {
get: function () {
return this.y - this.height / 2;
},
set: function (t) {
this.y = t + this.height / 2;
},
},
bottom: {
get: function () {
return this.y + this.height / 2;
},
set: function (t) {
this.y = t - this.height / 2;
},
},
});
t.exports = l;
},
function (t, e) {
t.exports = function (t, e, i) {
if (t.width <= 0 || t.height <= 0) return !1;
var n = (e - t.x) / t.width,
s = (i - t.y) / t.height;
return (n *= n) + (s *= s) < 0.25;
};
},
function (t, e, i) {
var z = i(275),
n = i(0),
r = i(75),
s = i(9),
o = i(207),
X = i(2),
V = i(6),
a = i(7),
G = i(437),
h = i(149),
l = i(73),
u = new n({
Extends: s,
initialize: function (t, e, i) {
s.call(this),
i ? e && !Array.isArray(e) && (e = [e]) : Array.isArray(e) ? a(e[0]) && ((i = e), (e = null)) : a(e) && ((i = e), (e = null)),
(this.scene = t),
(this.children = new h()),
(this.isParent = !0),
(this.type = "Group"),
(this.classType = X(i, "classType", l)),
(this.name = X(i, "name", "")),
(this.active = X(i, "active", !0)),
(this.maxSize = X(i, "maxSize", -1)),
(this.defaultKey = X(i, "defaultKey", null)),
(this.defaultFrame = X(i, "defaultFrame", null)),
(this.runChildUpdate = X(i, "runChildUpdate", !1)),
(this.createCallback = X(i, "createCallback", null)),
(this.removeCallback = X(i, "removeCallback", null)),
(this.createMultipleCallback = X(i, "createMultipleCallback", null)),
(this.internalCreateCallback = X(i, "internalCreateCallback", null)),
(this.internalRemoveCallback = X(i, "internalRemoveCallback", null)),
e && this.addMultiple(e),
i && this.createMultiple(i),
this.on(r.ADDED_TO_SCENE, this.addedToScene, this),
this.on(r.REMOVED_FROM_SCENE, this.removedFromScene, this);
},
addedToScene: function () {
this.scene.sys.updateList.add(this);
},
removedFromScene: function () {
this.scene.sys.updateList.remove(this);
},
create: function (t, e, i, n, s, r) {
if ((void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = this.defaultKey), void 0 === n && (n = this.defaultFrame), void 0 === s && (s = !0), void 0 === r && (r = !0), this.isFull()))
return null;
var o = new this.classType(this.scene, t, e, i, n);
return o.addToDisplayList(this.scene.sys.displayList), o.addToUpdateList(), (o.visible = s), o.setActive(r), this.add(o), o;
},
createMultiple: function (t) {
if (this.isFull()) return [];
Array.isArray(t) || (t = [t]);
var e = [];
if (t[0].key)
for (var i = 0; i < t.length; i++) {
var n = this.createFromConfig(t[i]);
e = e.concat(n);
}
return e;
},
createFromConfig: function (t) {
if (this.isFull()) return [];
this.classType = X(t, "classType", this.classType);
var e = X(t, "key", void 0),
i = X(t, "frame", null),
n = X(t, "visible", !0),
s = X(t, "active", !0),
r = [];
if (void 0 === e) return r;
Array.isArray(e) || (e = [e]), Array.isArray(i) || (i = [i]);
var o = X(t, "repeat", 0),
a = X(t, "randomKey", !1),
h = X(t, "randomFrame", !1),
l = X(t, "yoyo", !1),
u = X(t, "quantity", !1),
c = X(t, "frameQuantity", 1),
d = X(t, "max", 0),
f = G(e, i, { max: d, qty: u || c, random: a, randomB: h, repeat: o, yoyo: l });
t.createCallback && (this.createCallback = t.createCallback), t.removeCallback && (this.removeCallback = t.removeCallback);
for (var p = 0; p < f.length; p++) {
var g = this.create(0, 0, f[p].a, f[p].b, n, s);
if (!g) break;
r.push(g);
}
var v = V(t, "setXY.x", 0),
y = V(t, "setXY.y", 0),
m = V(t, "setXY.stepX", 0),
x = V(t, "setXY.stepY", 0);
z.SetXY(r, v, y, m, x);
var b = V(t, "setRotation.value", 0),
w = V(t, "setRotation.step", 0);
z.SetRotation(r, b, w);
var T = V(t, "setScale.x", 1),
S = V(t, "setScale.y", T),
_ = V(t, "setScale.stepX", 0),
E = V(t, "setScale.stepY", 0);
z.SetScale(r, T, S, _, E);
var P = V(t, "setOrigin.x", 0.5),
A = V(t, "setOrigin.y", P),
M = V(t, "setOrigin.stepX", 0),
C = V(t, "setOrigin.stepY", 0);
z.SetOrigin(r, P, A, M, C);
var O = V(t, "setAlpha.value", 1),
k = V(t, "setAlpha.step", 0);
z.SetAlpha(r, O, k);
var R = V(t, "setDepth.value", 0),
L = V(t, "setDepth.step", 0);
z.SetDepth(r, R, L);
var I = V(t, "setScrollFactor.x", 1),
D = V(t, "setScrollFactor.y", I),
F = V(t, "setScrollFactor.stepX", 0),
B = V(t, "setScrollFactor.stepY", 0);
z.SetScrollFactor(r, I, D, F, B);
var N = X(t, "hitArea", null),
U = X(t, "hitAreaCallback", null);
N && z.SetHitArea(r, N, U);
var Y = X(t, "gridAlign", !1);
return Y && z.GridAlign(r, Y), this.createMultipleCallback && this.createMultipleCallback.call(this, r), r;
},
preUpdate: function (t, e) {
if (this.runChildUpdate && 0 !== this.children.size)
for (var i = this.children.entries.slice(), n = 0; n < i.length; n++) {
var s = i[n];
s.active && s.update(t, e);
}
},
add: function (t, e) {
return (
void 0 === e && (e = !1),
this.isFull() ||
(this.children.set(t),
this.internalCreateCallback && this.internalCreateCallback.call(this, t),
this.createCallback && this.createCallback.call(this, t),
e && (t.addToDisplayList(this.scene.sys.displayList), t.addToUpdateList()),
t.on(r.DESTROY, this.remove, this)),
this
);
},
addMultiple: function (t, e) {
if ((void 0 === e && (e = !1), Array.isArray(t))) for (var i = 0; i < t.length; i++) this.add(t[i], e);
return this;
},
remove: function (t, e, i) {
return (
void 0 === e && (e = !1),
void 0 === i && (i = !1),
this.children.contains(t) &&
(this.children.delete(t),
this.internalRemoveCallback && this.internalRemoveCallback.call(this, t),
this.removeCallback && this.removeCallback.call(this, t),
t.off(r.DESTROY, this.remove, this),
i ? t.destroy() : e && (t.removeFromDisplayList(), t.removeFromUpdateList())),
this
);
},
clear: function (t, e) {
void 0 === t && (t = !1), void 0 === e && (e = !1);
for (var i = this.children, n = 0; n < i.size; n++) {
var s = i.entries[n];
s.off(r.DESTROY, this.remove, this), e ? s.destroy() : t && (s.removeFromDisplayList(), s.removeFromUpdateList());
}
return this.children.clear(), this;
},
contains: function (t) {
return this.children.contains(t);
},
getChildren: function () {
return this.children.entries;
},
getLength: function () {
return this.children.size;
},
getMatching: function (t, e, i, n) {
return o(this.children.entries, t, e, i, n);
},
getFirst: function (t, e, i, n, s, r, o) {
return this.getHandler(!0, 1, t, e, i, n, s, r, o);
},
getFirstNth: function (t, e, i, n, s, r, o, a) {
return this.getHandler(!0, t, e, i, n, s, r, o, a);
},
getLast: function (t, e, i, n, s, r, o) {
return this.getHandler(!1, 1, t, e, i, n, s, r, o);
},
getLastNth: function (t, e, i, n, s, r, o, a) {
return this.getHandler(!1, t, e, i, n, s, r, o, a);
},
getHandler: function (t, e, i, n, s, r, o, a, h) {
var l, u;
void 0 === i && (i = !1), void 0 === n && (n = !1);
var c = 0,
d = this.children.entries;
if (t)
for (u = 0; u < d.length; u++)
if ((l = d[u]).active === i) {
if (++c === e) break;
} else l = null;
else
for (u = d.length - 1; 0 <= u; u--)
if ((l = d[u]).active === i) {
if (++c === e) break;
} else l = null;
return l ? ("number" == typeof s && (l.x = s), "number" == typeof r && (l.y = r), l) : n ? this.create(s, r, o, a, h) : null;
},
get: function (t, e, i, n, s) {
return this.getFirst(!1, !0, t, e, i, n, s);
},
getFirstAlive: function (t, e, i, n, s, r) {
return this.getFirst(!0, t, e, i, n, s, r);
},
getFirstDead: function (t, e, i, n, s, r) {
return this.getFirst(!1, t, e, i, n, s, r);
},
playAnimation: function (t, e) {
return z.PlayAnimation(this.children.entries, t, e), this;
},
isFull: function () {
return -1 !== this.maxSize && this.children.size >= this.maxSize;
},
countActive: function (t) {
void 0 === t && (t = !0);
for (var e = 0, i = 0; i < this.children.size; i++) this.children.entries[i].active === t && e++;
return e;
},
getTotalUsed: function () {
return this.countActive();
},
getTotalFree: function () {
var t = this.getTotalUsed();
return (-1 === this.maxSize ? 999999999999 : this.maxSize) - t;
},
setActive: function (t) {
return (this.active = t), this;
},
setName: function (t) {
return (this.name = t), this;
},
propertyValueSet: function (t, e, i, n, s) {
return z.PropertyValueSet(this.children.entries, t, e, i, n, s), this;
},
propertyValueInc: function (t, e, i, n, s) {
return z.PropertyValueInc(this.children.entries, t, e, i, n, s), this;
},
setX: function (t, e) {
return z.SetX(this.children.entries, t, e), this;
},
setY: function (t, e) {
return z.SetY(this.children.entries, t, e), this;
},
setXY: function (t, e, i, n) {
return z.SetXY(this.children.entries, t, e, i, n), this;
},
incX: function (t, e) {
return z.IncX(this.children.entries, t, e), this;
},
incY: function (t, e) {
return z.IncY(this.children.entries, t, e), this;
},
incXY: function (t, e, i, n) {
return z.IncXY(this.children.entries, t, e, i, n), this;
},
shiftPosition: function (t, e, i) {
return z.ShiftPosition(this.children.entries, t, e, i), this;
},
angle: function (t, e) {
return z.Angle(this.children.entries, t, e), this;
},
rotate: function (t, e) {
return z.Rotate(this.children.entries, t, e), this;
},
rotateAround: function (t, e) {
return z.RotateAround(this.children.entries, t, e), this;
},
rotateAroundDistance: function (t, e, i) {
return z.RotateAroundDistance(this.children.entries, t, e, i), this;
},
setAlpha: function (t, e) {
return z.SetAlpha(this.children.entries, t, e), this;
},
setTint: function (t, e, i, n) {
return z.SetTint(this.children.entries, t, e, i, n), this;
},
setOrigin: function (t, e, i, n) {
return z.SetOrigin(this.children.entries, t, e, i, n), this;
},
scaleX: function (t, e) {
return z.ScaleX(this.children.entries, t, e), this;
},
scaleY: function (t, e) {
return z.ScaleY(this.children.entries, t, e), this;
},
scaleXY: function (t, e, i, n) {
return z.ScaleXY(this.children.entries, t, e, i, n), this;
},
setDepth: function (t, e) {
return z.SetDepth(this.children.entries, t, e), this;
},
setBlendMode: function (t) {
return z.SetBlendMode(this.children.entries, t), this;
},
setHitArea: function (t, e) {
return z.SetHitArea(this.children.entries, t, e), this;
},
shuffle: function () {
return z.Shuffle(this.children.entries), this;
},
kill: function (t) {
this.children.contains(t) && t.setActive(!1);
},
killAndHide: function (t) {
this.children.contains(t) && (t.setActive(!1), t.setVisible(!1));
},
setVisible: function (t, e, i) {
return z.SetVisible(this.children.entries, t, e, i), this;
},
toggleVisible: function () {
return z.ToggleVisible(this.children.entries), this;
},
destroy: function (t, e) {
void 0 === t && (t = !1),
void 0 === e && (e = !1),
this.scene && !this.ignoreDestroy && (this.emit(r.DESTROY, this), this.removeAllListeners(), this.scene.sys.updateList.remove(this), this.clear(e, t), (this.scene = void 0), (this.children = void 0));
},
});
t.exports = u;
},
function (t, e, i) {
var E = i(12);
t.exports = function (t, e, i, n, s, r) {
for (var o = E.getTintAppendFloatAlpha(i.fillColor, i.fillAlpha * n), a = i.pathData, h = i.pathIndexes, l = 0; l < h.length; l += 3) {
var u = 2 * h[l],
c = 2 * h[l + 1],
d = 2 * h[l + 2],
f = a[0 + u] - s,
p = a[1 + u] - r,
g = a[0 + c] - s,
v = a[1 + c] - r,
y = a[0 + d] - s,
m = a[1 + d] - r,
x = e.getX(f, p),
b = e.getY(f, p),
w = e.getX(g, v),
T = e.getY(g, v),
S = e.getX(y, m),
_ = e.getY(y, m);
t.batchTri(i, x, b, w, T, S, _, 0, 0, 1, 1, o, o, o, 2);
}
};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = t.x3 - t.x1,
s = t.y3 - t.y1,
r = t.x2 - t.x1,
o = t.y2 - t.y1,
a = e - t.x1,
h = i - t.y1,
l = n * n + s * s,
u = n * r + s * o,
c = n * a + s * h,
d = r * r + o * o,
f = r * a + o * h,
p = l * d - u * u,
g = 0 == p ? 0 : 1 / p,
v = (d * c - u * f) * g,
y = (l * f - u * c) * g;
return 0 <= v && 0 <= y && v + y < 1;
};
},
function (t, e, i) {
var n = i(0),
s = i(10),
r = i(3);
function p(t, e, i, n) {
var s = t - i,
r = e - n,
o = s * s + r * r;
return Math.sqrt(o);
}
var o = new n({
initialize: function (t, e, i) {
(this.vertex1 = t), (this.vertex2 = e), (this.vertex3 = i), (this.bounds = new s()), (this._inCenter = new r());
},
getInCenter: function (t) {
void 0 === t && (t = !0);
var e,
i,
n,
s,
r,
o = this.vertex1,
a = this.vertex2,
h = this.vertex3,
l = t ? ((e = o.x), (i = o.y), (n = a.x), (s = a.y), (r = h.x), h.y) : ((e = o.vx), (i = o.vy), (n = a.vx), (s = a.vy), (r = h.vx), h.vy),
u = p(r, l, n, s),
c = p(e, i, r, l),
d = p(n, s, e, i),
f = u + c + d;
return this._inCenter.set((e * u + n * c + r * d) / f, (i * u + s * c + l * d) / f);
},
contains: function (t, e, i) {
var n,
s,
r,
o,
a,
h,
l = this.vertex1,
u = this.vertex2,
c = this.vertex3,
d = l.vx,
f = l.vy,
p = u.vx,
g = u.vy,
v = c.vx,
y = c.vy;
i &&
((n = i.a),
(s = i.b),
(r = i.c),
(o = i.d),
(a = i.e),
(h = i.f),
(d = l.vx * n + l.vy * r + a),
(f = l.vx * s + l.vy * o + h),
(p = u.vx * n + u.vy * r + a),
(g = u.vx * s + u.vy * o + h),
(v = c.vx * n + c.vy * r + a),
(y = c.vx * s + c.vy * o + h));
var m = v - d,
x = y - f,
b = p - d,
w = g - f,
T = t - d,
S = e - f,
_ = m * m + x * x,
E = m * b + x * w,
P = m * T + x * S,
A = b * b + w * w,
M = b * T + w * S,
C = _ * A - E * E,
O = 0 == C ? 0 : 1 / C,
k = (A * P - E * M) * O,
R = (_ * M - E * P) * O;
return 0 <= k && 0 <= R && k + R < 1;
},
isCounterClockwise: function (t) {
var e = this.vertex1,
i = this.vertex2,
n = this.vertex3,
s = (i.vx - e.vx) * (n.vy - e.vy) - (i.vy - e.vy) * (n.vx - e.vx);
return t <= 0 ? 0 <= s : s < 0;
},
load: function (t, e, i, n, s) {
return (i = this.vertex1.load(t, e, i, n, s)), (i = this.vertex2.load(t, e, i, n, s)), this.vertex3.load(t, e, i, n, s);
},
transformCoordinatesLocal: function (t, e, i, n) {
return this.vertex1.transformCoordinatesLocal(t, e, i, n), this.vertex2.transformCoordinatesLocal(t, e, i, n), this.vertex3.transformCoordinatesLocal(t, e, i, n), this;
},
updateBounds: function () {
var t = this.vertex1,
e = this.vertex2,
i = this.vertex3,
n = this.bounds;
return (n.x = Math.min(t.vx, e.vx, i.vx)), (n.y = Math.min(t.vy, e.vy, i.vy)), (n.width = Math.max(t.vx, e.vx, i.vx) - n.x), (n.height = Math.max(t.vy, e.vy, i.vy) - n.y), this;
},
isInView: function (t, e, i, n, s, r, o, a, h, l, u) {
var c = this.vertex1.update(s, r, o, a, h, l, u, n),
d = this.vertex2.update(s, r, o, a, h, l, u, n),
f = this.vertex3.update(s, r, o, a, h, l, u, n);
if (c.ta <= 0 && d.ta <= 0 && f.ta <= 0) return !1;
if (e && !this.isCounterClockwise(i)) return !1;
var p = this.bounds;
(p.x = Math.min(c.tx, d.tx, f.tx)), (p.y = Math.min(c.ty, d.ty, f.ty)), (p.width = Math.max(c.tx, d.tx, f.tx) - p.x), (p.height = Math.max(c.ty, d.ty, f.ty) - p.y);
var g = t.x + t.width,
v = t.y + t.height;
return !(p.width <= 0 || p.height <= 0 || t.width <= 0 || t.height <= 0 || p.right < t.x || p.bottom < t.y || p.x > g || p.y > v);
},
translate: function (t, e) {
void 0 === e && (e = 0);
var i = this.vertex1,
n = this.vertex2,
s = this.vertex3;
return (i.x += t), (i.y += e), (n.x += t), (n.y += e), (s.x += t), (s.y += e), this;
},
x: {
get: function () {
return this.getInCenter().x;
},
set: function (t) {
var e = this.getInCenter();
this.translate(t - e.x, 0);
},
},
y: {
get: function () {
return this.getInCenter().y;
},
set: function (t) {
var e = this.getInCenter();
this.translate(0, t - e.y);
},
},
alpha: {
get: function () {
var t = this.vertex1,
e = this.vertex2,
i = this.vertex3;
return (t.alpha + e.alpha + i.alpha) / 3;
},
set: function (t) {
(this.vertex1.alpha = t), (this.vertex2.alpha = t), (this.vertex3.alpha = t);
},
},
depth: {
get: function () {
var t = this.vertex1,
e = this.vertex2,
i = this.vertex3;
return (t.vz + e.vz + i.vz) / 3;
},
},
destroy: function () {
(this.vertex1 = null), (this.vertex2 = null), (this.vertex3 = null);
},
});
t.exports = o;
},
function (t, e, i) {
var n = i(0),
r = i(12),
u = i(39),
s = new n({
Extends: u,
initialize: function (t, e, i, n, s, r, o, a, h, l) {
void 0 === r && (r = 16777215),
void 0 === o && (o = 1),
void 0 === a && (a = 0),
void 0 === h && (h = 0),
void 0 === l && (l = 0),
u.call(this, t, e, i),
(this.vx = 0),
(this.vy = 0),
(this.vz = 0),
(this.nx = a),
(this.ny = h),
(this.nz = l),
(this.u = n),
(this.v = s),
(this.color = r),
(this.alpha = o),
(this.tx = 0),
(this.ty = 0),
(this.ta = 0);
},
setUVs: function (t, e) {
return (this.u = t), (this.v = e), this;
},
transformCoordinatesLocal: function (t, e, i, n) {
var s = this.x,
r = this.y,
o = this.z,
a = t.val,
h = s * a[0] + r * a[4] + o * a[8] + a[12],
l = s * a[1] + r * a[5] + o * a[9] + a[13],
u = s * a[2] + r * a[6] + o * a[10] + a[14],
c = s * a[3] + r * a[7] + o * a[11] + a[15];
(this.vx = (h / c) * e), (this.vy = (-l / c) * i), (this.vz = n <= 0 ? u / c : -u / c);
},
update: function (t, e, i, n, s, r, o, a) {
var h = this.vx * t + this.vy * i + s,
l = this.vx * e + this.vy * n + r;
return o && ((h = Math.round(h)), (l = Math.round(l))), (this.tx = h), (this.ty = l), (this.ta = this.alpha * a), this;
},
load: function (t, e, i, n, s) {
return (t[++i] = this.tx), (t[++i] = this.ty), (t[++i] = this.u), (t[++i] = this.v), (t[++i] = n), (t[++i] = s), (e[++i] = r.getTintAppendFloatAlpha(this.color, this.ta)), i;
},
});
t.exports = s;
},
function (t, e, i) {
var c = {};
t.exports = c;
var o = i(166),
r = i(32),
a = i(84),
d = i(41);
(c.create = function (t) {
return r.extend({ id: r.nextId(), type: "composite", parent: null, isModified: !1, bodies: [], constraints: [], composites: [], label: "Composite", plugin: {} }, t);
}),
(c.setModified = function (t, e, i, n) {
if ((o.trigger(t, "compositeModified", t), (t.isModified = e), i && t.parent && c.setModified(t.parent, e, i, n), n))
for (var s = 0; s < t.composites.length; s++) {
var r = t.composites[s];
c.setModified(r, e, i, n);
}
}),
(c.add = function (t, e) {
var i = [].concat(e);
o.trigger(t, "beforeAdd", { object: e });
for (var n = 0; n < i.length; n++) {
var s = i[n];
switch (s.type) {
case "body":
if (s.parent !== s) {
r.warn("Composite.add: skipped adding a compound body part (you must add its parent instead)");
break;
}
c.addBody(t, s);
break;
case "constraint":
c.addConstraint(t, s);
break;
case "composite":
c.addComposite(t, s);
break;
case "mouseConstraint":
c.addConstraint(t, s.constraint);
}
}
return o.trigger(t, "afterAdd", { object: e }), t;
}),
(c.remove = function (t, e, i) {
var n = [].concat(e);
o.trigger(t, "beforeRemove", { object: e });
for (var s = 0; s < n.length; s++) {
var r = n[s];
switch (r.type) {
case "body":
c.removeBody(t, r, i);
break;
case "constraint":
c.removeConstraint(t, r, i);
break;
case "composite":
c.removeComposite(t, r, i);
break;
case "mouseConstraint":
c.removeConstraint(t, r.constraint);
}
}
return o.trigger(t, "afterRemove", { object: e }), t;
}),
(c.addComposite = function (t, e) {
return t.composites.push(e), (e.parent = t), c.setModified(t, !0, !0, !1), t;
}),
(c.removeComposite = function (t, e, i) {
var n = t.composites.indexOf(e);
if ((-1 !== n && (c.removeCompositeAt(t, n), c.setModified(t, !0, !0, !1)), i)) for (var s = 0; s < t.composites.length; s++) c.removeComposite(t.composites[s], e, !0);
return t;
}),
(c.removeCompositeAt = function (t, e) {
return t.composites.splice(e, 1), c.setModified(t, !0, !0, !1), t;
}),
(c.addBody = function (t, e) {
return t.bodies.push(e), c.setModified(t, !0, !0, !1), t;
}),
(c.removeBody = function (t, e, i) {
var n = t.bodies.indexOf(e);
if ((-1 !== n && (c.removeBodyAt(t, n), c.setModified(t, !0, !0, !1)), i)) for (var s = 0; s < t.composites.length; s++) c.removeBody(t.composites[s], e, !0);
return t;
}),
(c.removeBodyAt = function (t, e) {
return t.bodies.splice(e, 1), c.setModified(t, !0, !0, !1), t;
}),
(c.addConstraint = function (t, e) {
return t.constraints.push(e), c.setModified(t, !0, !0, !1), t;
}),
(c.removeConstraint = function (t, e, i) {
var n = t.constraints.indexOf(e);
if ((-1 !== n && c.removeConstraintAt(t, n), i)) for (var s = 0; s < t.composites.length; s++) c.removeConstraint(t.composites[s], e, !0);
return t;
}),
(c.removeConstraintAt = function (t, e) {
return t.constraints.splice(e, 1), c.setModified(t, !0, !0, !1), t;
}),
(c.clear = function (t, e, i) {
if (i) for (var n = 0; n < t.composites.length; n++) c.clear(t.composites[n], e, !0);
return (
e
? (t.bodies = t.bodies.filter(function (t) {
return t.isStatic;
}))
: (t.bodies.length = 0),
(t.constraints.length = 0),
(t.composites.length = 0),
c.setModified(t, !0, !0, !1),
t
);
}),
(c.allBodies = function (t) {
for (var e = [].concat(t.bodies), i = 0; i < t.composites.length; i++) e = e.concat(c.allBodies(t.composites[i]));
return e;
}),
(c.allConstraints = function (t) {
for (var e = [].concat(t.constraints), i = 0; i < t.composites.length; i++) e = e.concat(c.allConstraints(t.composites[i]));
return e;
}),
(c.allComposites = function (t) {
for (var e = [].concat(t.composites), i = 0; i < t.composites.length; i++) e = e.concat(c.allComposites(t.composites[i]));
return e;
}),
(c.get = function (t, e, i) {
var n, s;
switch (i) {
case "body":
n = c.allBodies(t);
break;
case "constraint":
n = c.allConstraints(t);
break;
case "composite":
n = c.allComposites(t).concat(t);
}
return n &&
0 !==
(s = n.filter(function (t) {
return t.id.toString() === e.toString();
})).length
? s[0]
: null;
}),
(c.move = function (t, e, i) {
return c.remove(t, e), c.add(i, e), t;
}),
(c.rebase = function (t) {
for (var e = c.allBodies(t).concat(c.allConstraints(t)).concat(c.allComposites(t)), i = 0; i < e.length; i++) e[i].id = r.nextId();
return c.setModified(t, !0, !0, !1), t;
}),
(c.translate = function (t, e, i) {
for (var n = i ? c.allBodies(t) : t.bodies, s = 0; s < n.length; s++) d.translate(n[s], e);
return c.setModified(t, !0, !0, !1), t;
}),
(c.rotate = function (t, e, i, n) {
for (var s = Math.cos(e), r = Math.sin(e), o = n ? c.allBodies(t) : t.bodies, a = 0; a < o.length; a++) {
var h = o[a],
l = h.position.x - i.x,
u = h.position.y - i.y;
d.setPosition(h, { x: i.x + (l * s - u * r), y: i.y + (l * r + u * s) }), d.rotate(h, e);
}
return c.setModified(t, !0, !0, !1), t;
}),
(c.scale = function (t, e, i, n, s) {
for (var r = s ? c.allBodies(t) : t.bodies, o = 0; o < r.length; o++) {
var a = r[o],
h = a.position.x - n.x,
l = a.position.y - n.y;
d.setPosition(a, { x: n.x + h * e, y: n.y + l * i }), d.scale(a, e, i);
}
return c.setModified(t, !0, !0, !1), t;
}),
(c.bounds = function (t) {
for (var e = c.allBodies(t), i = [], n = 0; n < e.length; n += 1) {
var s = e[n];
i.push(s.bounds.min, s.bounds.max);
}
return a.create(i);
});
},
function (t, e) {
t.exports = function (t, e, i) {
return 0 <= t && t < i.width && 0 <= e && e < i.height;
};
},
function (t, e, i) {
var n = i(0),
s = i(29),
r = i(2),
o = new n({
initialize: function (t) {
void 0 === t && (t = {}),
(this.name = r(t, "name", "layer")),
(this.x = r(t, "x", 0)),
(this.y = r(t, "y", 0)),
(this.width = r(t, "width", 0)),
(this.height = r(t, "height", 0)),
(this.tileWidth = r(t, "tileWidth", 0)),
(this.tileHeight = r(t, "tileHeight", 0)),
(this.baseTileWidth = r(t, "baseTileWidth", this.tileWidth)),
(this.baseTileHeight = r(t, "baseTileHeight", this.tileHeight)),
(this.orientation = r(t, "orientation", s.ORTHOGONAL)),
(this.widthInPixels = r(t, "widthInPixels", this.width * this.baseTileWidth)),
(this.heightInPixels = r(t, "heightInPixels", this.height * this.baseTileHeight)),
(this.alpha = r(t, "alpha", 1)),
(this.visible = r(t, "visible", !0)),
(this.properties = r(t, "properties", [])),
(this.indexes = r(t, "indexes", [])),
(this.collideIndexes = r(t, "collideIndexes", [])),
(this.callbacks = r(t, "callbacks", [])),
(this.bodies = r(t, "bodies", [])),
(this.data = r(t, "data", [])),
(this.tilemapLayer = r(t, "tilemapLayer", null)),
(this.hexSideLength = r(t, "hexSideLength", 0));
},
});
t.exports = o;
},
function (t, e, i) {
var n = i(0),
s = i(29),
r = i(2),
o = new n({
initialize: function (t) {
void 0 === t && (t = {}),
(this.name = r(t, "name", "map")),
(this.width = r(t, "width", 0)),
(this.height = r(t, "height", 0)),
(this.infinite = r(t, "infinite", !1)),
(this.tileWidth = r(t, "tileWidth", 0)),
(this.tileHeight = r(t, "tileHeight", 0)),
(this.widthInPixels = r(t, "widthInPixels", this.width * this.tileWidth)),
(this.heightInPixels = r(t, "heightInPixels", this.height * this.tileHeight)),
(this.format = r(t, "format", null)),
(this.orientation = r(t, "orientation", s.ORTHOGONAL)),
(this.renderOrder = r(t, "renderOrder", "right-down")),
(this.version = r(t, "version", "1")),
(this.properties = r(t, "properties", {})),
(this.layers = r(t, "layers", [])),
(this.images = r(t, "images", [])),
(this.objects = r(t, "objects", {})),
(this.collision = r(t, "collision", {})),
(this.tilesets = r(t, "tilesets", [])),
(this.imageCollections = r(t, "imageCollections", [])),
(this.tiles = r(t, "tiles", [])),
(this.hexSideLength = r(t, "hexSideLength", 0));
},
});
t.exports = o;
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e, i, n, s, r, o, a) {
(void 0 === i || i <= 0) && (i = 32),
(void 0 === n || n <= 0) && (n = 32),
void 0 === s && (s = 0),
void 0 === r && (r = 0),
void 0 === o && (o = {}),
void 0 === a && (a = {}),
(this.name = t),
(this.firstgid = e),
(this.tileWidth = i),
(this.tileHeight = n),
(this.tileMargin = s),
(this.tileSpacing = r),
(this.tileProperties = o),
(this.tileData = a),
(this.image = null),
(this.glTexture = null),
(this.rows = 0),
(this.columns = 0),
(this.total = 0),
(this.texCoordinates = []);
},
getTileProperties: function (t) {
return this.containsTileIndex(t) ? this.tileProperties[t - this.firstgid] : null;
},
getTileData: function (t) {
return this.containsTileIndex(t) ? this.tileData[t - this.firstgid] : null;
},
getTileCollisionGroup: function (t) {
var e = this.getTileData(t);
return e && e.objectgroup ? e.objectgroup : null;
},
containsTileIndex: function (t) {
return t >= this.firstgid && t < this.firstgid + this.total;
},
getTileTextureCoordinates: function (t) {
return this.containsTileIndex(t) ? this.texCoordinates[t - this.firstgid] : null;
},
setImage: function (t) {
return (this.image = t), (this.glTexture = t.get().source.glTexture), this.updateTileData(this.image.source[0].width, this.image.source[0].height), this;
},
setTileSize: function (t, e) {
return void 0 !== t && (this.tileWidth = t), void 0 !== e && (this.tileHeight = e), this.image && this.updateTileData(this.image.source[0].width, this.image.source[0].height), this;
},
setSpacing: function (t, e) {
return void 0 !== t && (this.tileMargin = t), void 0 !== e && (this.tileSpacing = e), this.image && this.updateTileData(this.image.source[0].width, this.image.source[0].height), this;
},
updateTileData: function (t, e) {
var i = (e - 2 * this.tileMargin + this.tileSpacing) / (this.tileHeight + this.tileSpacing),
n = (t - 2 * this.tileMargin + this.tileSpacing) / (this.tileWidth + this.tileSpacing);
(i = Math.floor(i)), (n = Math.floor(n)), (this.rows = i), (this.columns = n), (this.total = i * n), (this.texCoordinates.length = 0);
for (var s = this.tileMargin, r = this.tileMargin, o = 0; o < this.rows; o++) {
for (var a = 0; a < this.columns; a++) this.texCoordinates.push({ x: s, y: r }), (s += this.tileWidth + this.tileSpacing);
(s = this.tileMargin), (r += this.tileHeight + this.tileSpacing);
}
return this;
},
});
t.exports = n;
},
function (t, e) {
t.exports = { TOP_LEFT: 0, TOP_CENTER: 1, TOP_RIGHT: 2, LEFT_TOP: 3, LEFT_CENTER: 4, LEFT_BOTTOM: 5, CENTER: 6, RIGHT_TOP: 7, RIGHT_CENTER: 8, RIGHT_BOTTOM: 9, BOTTOM_LEFT: 10, BOTTOM_CENTER: 11, BOTTOM_RIGHT: 12 };
},
function (t, e) {
t.exports = function (t, e, i) {
return void 0 === i && (i = 1e-4), Math.abs(t - e) < i;
};
},
function (t, e, i) {
var n = i(0),
s = i(11),
r = i(15),
o = i(1068),
a = new n({
Extends: r,
Mixins: [s.Alpha, s.BlendMode, s.Depth, s.Flip, s.GetBounds, s.Mask, s.Origin, s.Pipeline, s.ScrollFactor, s.Size, s.TextureCrop, s.Tint, s.Transform, s.Visible, o],
initialize: function (t, e, i, n, s) {
r.call(this, t, "Image"), (this._crop = this.resetCropObject()), this.setTexture(n, s), this.setPosition(e, i), this.setSizeToFrame(), this.setOriginFromFrame(), this.initPipeline();
},
});
t.exports = a;
},
function (t, e) {
t.exports = function (t, e) {
return t.hasOwnProperty(e);
};
},
function (t, e, i) {
var s = i(77);
t.exports = function (t, e) {
var i = s(t);
for (var n in e) i.hasOwnProperty(n) || (i[n] = e[n]);
return i;
};
},
function (t, e, i) {
var w = {};
t.exports = w;
var o = i(64),
T = i(83),
a = i(165),
h = i(84),
l = i(271),
u = i(32);
(w._warming = 0.4),
(w._torqueDampen = 1),
(w._minLength = 1e-6),
(w.create = function (t) {
var e = t;
e.bodyA && !e.pointA && (e.pointA = { x: 0, y: 0 }), e.bodyB && !e.pointB && (e.pointB = { x: 0, y: 0 });
var i = e.bodyA ? T.add(e.bodyA.position, e.pointA) : e.pointA,
n = e.bodyB ? T.add(e.bodyB.position, e.pointB) : e.pointB,
s = T.magnitude(T.sub(i, n));
(e.length = void 0 !== e.length ? e.length : s),
(e.id = e.id || u.nextId()),
(e.label = e.label || "Constraint"),
(e.type = "constraint"),
(e.stiffness = e.stiffness || (0 < e.length ? 1 : 0.7)),
(e.damping = e.damping || 0),
(e.angularStiffness = e.angularStiffness || 0),
(e.angleA = e.bodyA ? e.bodyA.angle : e.angleA),
(e.angleB = e.bodyB ? e.bodyB.angle : e.angleB),
(e.plugin = {});
var r = { visible: !0, type: "line", anchors: !0, lineColor: null, lineOpacity: null, lineThickness: null, pinSize: null, anchorColor: null, anchorSize: null };
return 0 === e.length && 0.1 < e.stiffness ? ((r.type = "pin"), (r.anchors = !1)) : e.stiffness < 0.9 && (r.type = "spring"), (e.render = u.extend(r, e.render)), e;
}),
(w.preSolveAll = function (t) {
for (var e = 0; e < t.length; e += 1) {
var i = t[e],
n = i.constraintImpulse;
i.isStatic || (0 === n.x && 0 === n.y && 0 === n.angle) || ((i.position.x += n.x), (i.position.y += n.y), (i.angle += n.angle));
}
}),
(w.solveAll = function (t, e) {
for (var i = 0; i < t.length; i += 1) {
var n = t[i],
s = !n.bodyA || (n.bodyA && n.bodyA.isStatic),
r = !n.bodyB || (n.bodyB && n.bodyB.isStatic);
(s || r) && w.solve(t[i], e);
}
for (i = 0; i < t.length; i += 1) (s = !(n = t[i]).bodyA || (n.bodyA && n.bodyA.isStatic)), (r = !n.bodyB || (n.bodyB && n.bodyB.isStatic)), s || r || w.solve(t[i], e);
}),
(w.solve = function (t, e) {
var i,
n,
s,
r,
o,
a,
h,
l,
u,
c,
d,
f,
p,
g,
v,
y = t.bodyA,
m = t.bodyB,
x = t.pointA,
b = t.pointB;
(y || m) &&
(y && !y.isStatic && (T.rotate(x, y.angle - t.angleA, x), (t.angleA = y.angle)),
m && !m.isStatic && (T.rotate(b, m.angle - t.angleB, b), (t.angleB = m.angle)),
(i = x),
(n = b),
y && (i = T.add(y.position, x)),
m && (n = T.add(m.position, b)),
i &&
n &&
((s = T.sub(i, n)),
(r = T.magnitude(s)) < w._minLength && (r = w._minLength),
(o = (r - t.length) / r),
(a = t.stiffness < 1 ? t.stiffness * e : t.stiffness),
(h = T.mult(s, o * a)),
(u = (l = (y ? y.inverseMass : 0) + (m ? m.inverseMass : 0)) + ((y ? y.inverseInertia : 0) + (m ? m.inverseInertia : 0))),
t.damping && ((f = T.create()), (p = T.div(s, r)), (g = T.sub((m && T.sub(m.position, m.positionPrev)) || f, (y && T.sub(y.position, y.positionPrev)) || f)), (v = T.dot(p, g))),
y &&
!y.isStatic &&
((d = y.inverseMass / l),
(y.constraintImpulse.x -= h.x * d),
(y.constraintImpulse.y -= h.y * d),
(y.position.x -= h.x * d),
(y.position.y -= h.y * d),
t.damping && ((y.positionPrev.x -= t.damping * p.x * v * d), (y.positionPrev.y -= t.damping * p.y * v * d)),
(c = (T.cross(x, h) / u) * w._torqueDampen * y.inverseInertia * (1 - t.angularStiffness)),
(y.constraintImpulse.angle -= c),
(y.angle -= c)),
m &&
!m.isStatic &&
((d = m.inverseMass / l),
(m.constraintImpulse.x += h.x * d),
(m.constraintImpulse.y += h.y * d),
(m.position.x += h.x * d),
(m.position.y += h.y * d),
t.damping && ((m.positionPrev.x += t.damping * p.x * v * d), (m.positionPrev.y += t.damping * p.y * v * d)),
(c = (T.cross(b, h) / u) * w._torqueDampen * m.inverseInertia * (1 - t.angularStiffness)),
(m.constraintImpulse.angle += c),
(m.angle += c))));
}),
(w.postSolveAll = function (t) {
for (var e = 0; e < t.length; e++) {
var i = t[e],
n = i.constraintImpulse;
if (!(i.isStatic || (0 === n.x && 0 === n.y && 0 === n.angle))) {
a.set(i, !1);
for (var s = 0; s < i.parts.length; s++) {
var r = i.parts[s];
o.translate(r.vertices, n),
0 < s && ((r.position.x += n.x), (r.position.y += n.y)),
0 !== n.angle && (o.rotate(r.vertices, n.angle, i.position), l.rotate(r.axes, n.angle), 0 < s && T.rotateAbout(r.position, n.angle, i.position, r.position)),
h.update(r.bounds, r.vertices, i.velocity);
}
(n.angle *= w._warming), (n.x *= w._warming), (n.y *= w._warming);
}
}
}),
(w.pointAWorld = function (t) {
return { x: (t.bodyA ? t.bodyA.position.x : 0) + t.pointA.x, y: (t.bodyA ? t.bodyA.position.y : 0) + t.pointA.y };
}),
(w.pointBWorld = function (t) {
return { x: (t.bodyB ? t.bodyB.position.x : 0) + t.pointB.x, y: (t.bodyB ? t.bodyB.position.y : 0) + t.pointB.y };
});
},
function (t, e, i) {
var r = i(35),
n = i(65),
s = i(66),
o = i(0),
a = i(11),
h = i(15),
l = i(10),
u = i(57),
c = new o({
Extends: h,
Mixins: [a.Depth, a.GetBounds, a.Origin, a.Transform, a.ScrollFactor, a.Visible],
initialize: function (t, e, i, n, s) {
void 0 === n && (n = 1), void 0 === s && (s = n), h.call(this, t, "Zone"), this.setPosition(e, i), (this.width = n), (this.height = s), (this.blendMode = r.NORMAL), this.updateDisplayOrigin();
},
displayWidth: {
get: function () {
return this.scaleX * this.width;
},
set: function (t) {
this.scaleX = t / this.width;
},
},
displayHeight: {
get: function () {
return this.scaleY * this.height;
},
set: function (t) {
this.scaleY = t / this.height;
},
},
setSize: function (t, e, i) {
void 0 === i && (i = !0), (this.width = t), (this.height = e), this.updateDisplayOrigin();
var n = this.input;
return i && n && !n.customHitArea && ((n.hitArea.width = t), (n.hitArea.height = e)), this;
},
setDisplaySize: function (t, e) {
return (this.displayWidth = t), (this.displayHeight = e), this;
},
setCircleDropZone: function (t) {
return this.setDropZone(new n(0, 0, t), s);
},
setRectangleDropZone: function (t, e) {
return this.setDropZone(new l(0, 0, t, e), u);
},
setDropZone: function (t, e) {
return void 0 === t ? this.setRectangleDropZone(this.width, this.height) : this.input || this.setInteractive(t, e, !0), this;
},
setAlpha: function () {},
setBlendMode: function () {},
renderCanvas: function (t, e, i) {
i.addToRenderList(e);
},
renderWebGL: function (t, e, i) {
i.addToRenderList(e);
},
});
t.exports = c;
},
function (t, e) {
t.exports = function (t) {
return 2 * (t.width + t.height);
};
},
function (t, e) {
t.exports = function (t) {
for (var e = t.length - 1; 0 < e; e--) {
var i = Math.floor(Math.random() * (e + 1)),
n = t[e];
(t[e] = t[i]), (t[i] = n);
}
return t;
};
},
function (t, e, i) {
t.exports = {
ADD_ANIMATION: i(724),
ANIMATION_COMPLETE: i(725),
ANIMATION_COMPLETE_KEY: i(726),
ANIMATION_REPEAT: i(727),
ANIMATION_RESTART: i(728),
ANIMATION_START: i(729),
ANIMATION_STOP: i(730),
ANIMATION_UPDATE: i(731),
PAUSE_ALL: i(732),
REMOVE_ANIMATION: i(733),
RESUME_ALL: i(734),
};
},
function (t, e, i) {
var n = i(0),
s = i(11),
r = i(36),
o = i(9),
a = i(37),
h = i(10),
l = i(25),
u = i(187),
E = i(3),
c = new n({
Extends: o,
Mixins: [s.Alpha, s.Visible],
initialize: function (t, e, i, n) {
void 0 === t && (t = 0),
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 0),
o.call(this),
this.scene,
this.sceneManager,
this.scaleManager,
this.cameraManager,
(this.id = 0),
(this.name = ""),
(this.roundPixels = !1),
(this.useBounds = !1),
(this.worldView = new h()),
(this.dirty = !0),
(this._x = t),
(this._y = e),
(this._width = i),
(this._height = n),
(this._bounds = new h()),
(this._scrollX = 0),
(this._scrollY = 0),
(this._zoomX = 1),
(this._zoomY = 1),
(this._rotation = 0),
(this.matrix = new l()),
(this.transparent = !0),
(this.backgroundColor = u("rgba(0,0,0,0)")),
(this.disableCull = !1),
(this.culledObjects = []),
(this.midPoint = new E(i / 2, n / 2)),
(this.originX = 0.5),
(this.originY = 0.5),
(this._customViewport = !1),
(this.mask = null),
(this._maskCamera = null),
(this.renderList = []);
},
addToRenderList: function (t) {
this.renderList.push(t);
},
setOrigin: function (t, e) {
return void 0 === t && (t = 0.5), void 0 === e && (e = t), (this.originX = t), (this.originY = e), this;
},
getScroll: function (t, e, i) {
void 0 === i && (i = new E());
var n = 0.5 * this.width,
s = 0.5 * this.height;
return (i.x = t - n), (i.y = e - s), this.useBounds && ((i.x = this.clampX(i.x)), (i.y = this.clampY(i.y))), i;
},
centerOnX: function (t) {
var e = 0.5 * this.width;
return (this.midPoint.x = t), (this.scrollX = t - e), this.useBounds && (this.scrollX = this.clampX(this.scrollX)), this;
},
centerOnY: function (t) {
var e = 0.5 * this.height;
return (this.midPoint.y = t), (this.scrollY = t - e), this.useBounds && (this.scrollY = this.clampY(this.scrollY)), this;
},
centerOn: function (t, e) {
return this.centerOnX(t), this.centerOnY(e), this;
},
centerToBounds: function () {
var t, e, i;
return this.useBounds && ((t = this._bounds), (e = 0.5 * this.width), (i = 0.5 * this.height), this.midPoint.set(t.centerX, t.centerY), (this.scrollX = t.centerX - e), (this.scrollY = t.centerY - i)), this;
},
centerToSize: function () {
return (this.scrollX = 0.5 * this.width), (this.scrollY = 0.5 * this.height), this;
},
cull: function (t) {
if (this.disableCull) return t;
var e = this.matrix.matrix,
i = e[0],
n = e[1],
s = e[2],
r = e[3];
if (!(i * r - n * s)) return t;
for (
var o = e[4], a = e[5], h = this.scrollX, l = this.scrollY, u = this.width, c = this.height, d = this.y, f = d + c, p = this.x, g = p + u, v = this.culledObjects, y = t.length, m = (v.length = 0);
m < y;
++m
) {
var x,
b,
w,
T,
S = t[m];
S.hasOwnProperty("width") && !S.parentContainer
? ((x = S.width),
(b = S.height),
p < ((w = S.x - h * S.scrollFactorX - x * S.originX) + x) * i + ((T = S.y - l * S.scrollFactorY - b * S.originY) + b) * s + o &&
w * i + T * s + o < g &&
d < (w + x) * n + (T + b) * r + a &&
w * n + T * r + a < f &&
v.push(S))
: v.push(S);
}
return v;
},
getWorldPoint: function (t, e, i) {
void 0 === i && (i = new E());
var n = this.matrix.matrix,
s = n[0],
r = n[1],
o = n[2],
a = n[3],
h = n[4],
l = n[5],
u = s * a - r * o;
if (!u) return (i.x = t), (i.y = e), i;
var c = a * (u = 1 / u),
d = -r * u,
f = -o * u,
p = s * u,
g = (o * l - a * h) * u,
v = (r * h - s * l) * u,
y = Math.cos(this.rotation),
m = Math.sin(this.rotation),
x = this.zoomX,
b = this.zoomY,
w = this.scrollX,
T = this.scrollY,
S = t + (w * y - T * m) * x,
_ = e + (w * m + T * y) * b;
return (i.x = S * c + _ * f + g), (i.y = S * d + _ * p + v), i;
},
ignore: function (t) {
var e = this.id;
Array.isArray(t) || (t = [t]);
for (var i = 0; i < t.length; i++) {
var n = t[i];
Array.isArray(n) ? this.ignore(n) : n.isParent ? this.ignore(n.getChildren()) : (n.cameraFilter |= e);
}
return this;
},
preRender: function () {
this.renderList.length = 0;
var t = this.width,
e = this.height,
i = 0.5 * t,
n = 0.5 * e,
s = this.zoomX,
r = this.zoomY,
o = this.matrix,
a = t * this.originX,
h = e * this.originY,
l = this.scrollX,
u = this.scrollY;
this.useBounds && ((l = this.clampX(l)), (u = this.clampY(u))), this.roundPixels && ((a = Math.round(a)), (h = Math.round(h)));
var c = (this.scrollX = l) + i,
d = (this.scrollY = u) + n;
this.midPoint.set(c, d);
var f = t / s,
p = e / r;
this.worldView.setTo(c - f / 2, d - p / 2, f, p), o.applyITRS(this.x + a, this.y + h, this.rotation, s, r), o.translate(-a, -h);
},
clampX: function (t) {
var e = this._bounds,
i = this.displayWidth,
n = e.x + (i - this.width) / 2,
s = Math.max(n, n + e.width - i);
return t < n ? (t = n) : s < t && (t = s), t;
},
clampY: function (t) {
var e = this._bounds,
i = this.displayHeight,
n = e.y + (i - this.height) / 2,
s = Math.max(n, n + e.height - i);
return t < n ? (t = n) : s < t && (t = s), t;
},
removeBounds: function () {
return (this.useBounds = !1), (this.dirty = !0), this._bounds.setEmpty(), this;
},
setAngle: function (t) {
return void 0 === t && (t = 0), (this.rotation = r(t)), this;
},
setBackgroundColor: function (t) {
return void 0 === t && (t = "rgba(0,0,0,0)"), (this.backgroundColor = u(t)), (this.transparent = 0 === this.backgroundColor.alpha), this;
},
setBounds: function (t, e, i, n, s) {
return (
void 0 === s && (s = !1),
this._bounds.setTo(t, e, i, n),
(this.dirty = !0),
(this.useBounds = !0),
s ? this.centerToBounds() : ((this.scrollX = this.clampX(this.scrollX)), (this.scrollY = this.clampY(this.scrollY))),
this
);
},
getBounds: function (t) {
void 0 === t && (t = new h());
var e = this._bounds;
return t.setTo(e.x, e.y, e.width, e.height), t;
},
setName: function (t) {
return void 0 === t && (t = ""), (this.name = t), this;
},
setPosition: function (t, e) {
return void 0 === e && (e = t), (this.x = t), (this.y = e), this;
},
setRotation: function (t) {
return void 0 === t && (t = 0), (this.rotation = t), this;
},
setRoundPixels: function (t) {
return (this.roundPixels = t), this;
},
setScene: function (t) {
this.scene && this._customViewport && this.sceneManager.customViewports--;
var e = (this.scene = t).sys;
return (this.sceneManager = e.game.scene), (this.scaleManager = e.scale), (this.cameraManager = e.cameras), this.updateSystem(), this;
},
setScroll: function (t, e) {
return void 0 === e && (e = t), (this.scrollX = t), (this.scrollY = e), this;
},
setSize: function (t, e) {
return void 0 === e && (e = t), (this.width = t), (this.height = e), this;
},
setViewport: function (t, e, i, n) {
return (this.x = t), (this.y = e), (this.width = i), (this.height = n), this;
},
setZoom: function (t, e) {
return void 0 === t && (t = 1), void 0 === e && (e = t), 0 === t && (t = 0.001), 0 === e && (e = 0.001), (this.zoomX = t), (this.zoomY = e), this;
},
setMask: function (t, e) {
return void 0 === e && (e = !0), (this.mask = t), (this._maskCamera = e ? this.cameraManager.default : this), this;
},
clearMask: function (t) {
return void 0 === t && (t = !1), t && this.mask && this.mask.destroy(), (this.mask = null), this;
},
toJSON: function () {
var t = {
name: this.name,
x: this.x,
y: this.y,
width: this.width,
height: this.height,
zoom: this.zoom,
rotation: this.rotation,
roundPixels: this.roundPixels,
scrollX: this.scrollX,
scrollY: this.scrollY,
backgroundColor: this.backgroundColor.rgba,
};
return this.useBounds && (t.bounds = { x: this._bounds.x, y: this._bounds.y, width: this._bounds.width, height: this._bounds.height }), t;
},
update: function () {},
updateSystem: function () {
var t, e;
this.scaleManager &&
((t = 0 !== this._x || 0 !== this._y || this.scaleManager.width !== this._width || this.scaleManager.height !== this._height),
(e = this.sceneManager),
t && !this._customViewport ? e.customViewports++ : !t && this._customViewport && e.customViewports--,
(this.dirty = !0),
(this._customViewport = t));
},
destroy: function () {
this.emit(a.DESTROY, this),
this.removeAllListeners(),
this.matrix.destroy(),
(this.culledObjects = []),
this._customViewport && this.sceneManager.customViewports--,
(this.renderList = []),
(this._bounds = null),
(this.scene = null),
(this.scaleManager = null),
(this.sceneManager = null),
(this.cameraManager = null);
},
x: {
get: function () {
return this._x;
},
set: function (t) {
(this._x = t), this.updateSystem();
},
},
y: {
get: function () {
return this._y;
},
set: function (t) {
(this._y = t), this.updateSystem();
},
},
width: {
get: function () {
return this._width;
},
set: function (t) {
(this._width = t), this.updateSystem();
},
},
height: {
get: function () {
return this._height;
},
set: function (t) {
(this._height = t), this.updateSystem();
},
},
scrollX: {
get: function () {
return this._scrollX;
},
set: function (t) {
(this._scrollX = t), (this.dirty = !0);
},
},
scrollY: {
get: function () {
return this._scrollY;
},
set: function (t) {
(this._scrollY = t), (this.dirty = !0);
},
},
zoom: {
get: function () {
return (this._zoomX + this._zoomY) / 2;
},
set: function (t) {
(this._zoomX = t), (this._zoomY = t), (this.dirty = !0);
},
},
zoomX: {
get: function () {
return this._zoomX;
},
set: function (t) {
(this._zoomX = t), (this.dirty = !0);
},
},
zoomY: {
get: function () {
return this._zoomY;
},
set: function (t) {
(this._zoomY = t), (this.dirty = !0);
},
},
rotation: {
get: function () {
return this._rotation;
},
set: function (t) {
(this._rotation = t), (this.dirty = !0);
},
},
centerX: {
get: function () {
return this.x + 0.5 * this.width;
},
},
centerY: {
get: function () {
return this.y + 0.5 * this.height;
},
},
displayWidth: {
get: function () {
return this.width / this.zoomX;
},
},
displayHeight: {
get: function () {
return this.height / this.zoomY;
},
},
});
t.exports = c;
},
function (t, e, i) {
var n = i(334),
s = i(335),
r = i(336),
o = i(337),
a = i(338),
h = i(339),
l = i(340),
u = i(341),
c = i(342),
d = i(343),
f = i(344),
p = i(345);
t.exports = {
Power0: l,
Power1: u.Out,
Power2: o.Out,
Power3: c.Out,
Power4: d.Out,
Linear: l,
Quad: u.Out,
Cubic: o.Out,
Quart: c.Out,
Quint: d.Out,
Sine: f.Out,
Expo: h.Out,
Circ: r.Out,
Elastic: a.Out,
Back: n.Out,
Bounce: s.Out,
Stepped: p,
"Quad.easeIn": u.In,
"Cubic.easeIn": o.In,
"Quart.easeIn": c.In,
"Quint.easeIn": d.In,
"Sine.easeIn": f.In,
"Expo.easeIn": h.In,
"Circ.easeIn": r.In,
"Elastic.easeIn": a.In,
"Back.easeIn": n.In,
"Bounce.easeIn": s.In,
"Quad.easeOut": u.Out,
"Cubic.easeOut": o.Out,
"Quart.easeOut": c.Out,
"Quint.easeOut": d.Out,
"Sine.easeOut": f.Out,
"Expo.easeOut": h.Out,
"Circ.easeOut": r.Out,
"Elastic.easeOut": a.Out,
"Back.easeOut": n.Out,
"Bounce.easeOut": s.Out,
"Quad.easeInOut": u.InOut,
"Cubic.easeInOut": o.InOut,
"Quart.easeInOut": c.InOut,
"Quint.easeInOut": d.InOut,
"Sine.easeInOut": f.InOut,
"Expo.easeInOut": h.InOut,
"Circ.easeInOut": r.InOut,
"Elastic.easeInOut": a.InOut,
"Back.easeInOut": n.InOut,
"Bounce.easeInOut": s.InOut,
};
},
function (t, e) {
t.exports = function (t, e, i) {
return (e - t) * i + t;
};
},
function (t, e, i) {
var n,
s = i(105),
r = { chrome: !1, chromeVersion: 0, edge: !1, firefox: !1, firefoxVersion: 0, ie: !1, ieVersion: 0, mobileSafari: !1, opera: !1, safari: !1, safariVersion: 0, silk: !1, trident: !1, tridentVersion: 0 };
t.exports =
((n = navigator.userAgent),
/Edge\/\d+/.test(n)
? (r.edge = !0)
: /Chrome\/(\d+)/.test(n) && !s.windowsPhone
? ((r.chrome = !0), (r.chromeVersion = parseInt(RegExp.$1, 10)))
: /Firefox\D+(\d+)/.test(n)
? ((r.firefox = !0), (r.firefoxVersion = parseInt(RegExp.$1, 10)))
: /AppleWebKit/.test(n) && s.iOS
? (r.mobileSafari = !0)
: /MSIE (\d+\.\d+);/.test(n)
? ((r.ie = !0), (r.ieVersion = parseInt(RegExp.$1, 10)))
: /Opera/.test(n)
? (r.opera = !0)
: /Safari/.test(n) && !s.windowsPhone
? (r.safari = !0)
: /Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(n) && ((r.ie = !0), (r.trident = !0), (r.tridentVersion = parseInt(RegExp.$1, 10)), (r.ieVersion = parseInt(RegExp.$3, 10))),
/Silk/.test(n) && (r.silk = !0),
r);
},
function (t, e) {
t.exports = function (t, e) {
return Math.random() * (e - t) + t;
};
},
function (t, e) {
t.exports = function (t, e) {
return 0 < t && 0 == (t & (t - 1)) && 0 < e && 0 == (e & (e - 1));
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), 0 === e ? t : ((t -= i), (t = e * Math.ceil(t / e)), n ? (i + t) / e : i + t);
};
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e, i, n) {
(this.x = 0),
(this.y = 0),
(this.z = 0),
(this.w = 0),
"object" == typeof t ? ((this.x = t.x || 0), (this.y = t.y || 0), (this.z = t.z || 0), (this.w = t.w || 0)) : ((this.x = t || 0), (this.y = e || 0), (this.z = i || 0), (this.w = n || 0));
},
clone: function () {
return new n(this.x, this.y, this.z, this.w);
},
copy: function (t) {
return (this.x = t.x), (this.y = t.y), (this.z = t.z || 0), (this.w = t.w || 0), this;
},
equals: function (t) {
return this.x === t.x && this.y === t.y && this.z === t.z && this.w === t.w;
},
set: function (t, e, i, n) {
return "object" == typeof t ? ((this.x = t.x || 0), (this.y = t.y || 0), (this.z = t.z || 0), (this.w = t.w || 0)) : ((this.x = t || 0), (this.y = e || 0), (this.z = i || 0), (this.w = n || 0)), this;
},
add: function (t) {
return (this.x += t.x), (this.y += t.y), (this.z += t.z || 0), (this.w += t.w || 0), this;
},
subtract: function (t) {
return (this.x -= t.x), (this.y -= t.y), (this.z -= t.z || 0), (this.w -= t.w || 0), this;
},
scale: function (t) {
return (this.x *= t), (this.y *= t), (this.z *= t), (this.w *= t), this;
},
length: function () {
var t = this.x,
e = this.y,
i = this.z,
n = this.w;
return Math.sqrt(t * t + e * e + i * i + n * n);
},
lengthSq: function () {
var t = this.x,
e = this.y,
i = this.z,
n = this.w;
return t * t + e * e + i * i + n * n;
},
normalize: function () {
var t = this.x,
e = this.y,
i = this.z,
n = this.w,
s = t * t + e * e + i * i + n * n;
return 0 < s && ((s = 1 / Math.sqrt(s)), (this.x = t * s), (this.y = e * s), (this.z = i * s), (this.w = n * s)), this;
},
dot: function (t) {
return this.x * t.x + this.y * t.y + this.z * t.z + this.w * t.w;
},
lerp: function (t, e) {
void 0 === e && (e = 0);
var i = this.x,
n = this.y,
s = this.z,
r = this.w;
return (this.x = i + e * (t.x - i)), (this.y = n + e * (t.y - n)), (this.z = s + e * (t.z - s)), (this.w = r + e * (t.w - r)), this;
},
multiply: function (t) {
return (this.x *= t.x), (this.y *= t.y), (this.z *= t.z || 1), (this.w *= t.w || 1), this;
},
divide: function (t) {
return (this.x /= t.x), (this.y /= t.y), (this.z /= t.z || 1), (this.w /= t.w || 1), this;
},
distance: function (t) {
var e = t.x - this.x,
i = t.y - this.y,
n = t.z - this.z || 0,
s = t.w - this.w || 0;
return Math.sqrt(e * e + i * i + n * n + s * s);
},
distanceSq: function (t) {
var e = t.x - this.x,
i = t.y - this.y,
n = t.z - this.z || 0,
s = t.w - this.w || 0;
return e * e + i * i + n * n + s * s;
},
negate: function () {
return (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), (this.w = -this.w), this;
},
transformMat4: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = this.w,
r = t.val;
return (
(this.x = r[0] * e + r[4] * i + r[8] * n + r[12] * s),
(this.y = r[1] * e + r[5] * i + r[9] * n + r[13] * s),
(this.z = r[2] * e + r[6] * i + r[10] * n + r[14] * s),
(this.w = r[3] * e + r[7] * i + r[11] * n + r[15] * s),
this
);
},
transformQuat: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.x,
r = t.y,
o = t.z,
a = t.w,
h = a * e + r * n - o * i,
l = a * i + o * e - s * n,
u = a * n + s * i - r * e,
c = -s * e - r * i - o * n;
return (this.x = h * a + c * -s + l * -o - u * -r), (this.y = l * a + c * -r + u * -s - h * -o), (this.z = u * a + c * -o + h * -r - l * -s), this;
},
reset: function () {
return (this.x = 0), (this.y = 0), (this.z = 0), (this.w = 0), this;
},
});
(n.prototype.sub = n.prototype.subtract),
(n.prototype.mul = n.prototype.multiply),
(n.prototype.div = n.prototype.divide),
(n.prototype.dist = n.prototype.distance),
(n.prototype.distSq = n.prototype.distanceSq),
(n.prototype.len = n.prototype.length),
(n.prototype.lenSq = n.prototype.lengthSq),
(t.exports = n);
},
function (t, e, i) {
var n = i(0),
s = i(91),
r = new n({
initialize: function (t, e, i, n, s, r, o) {
void 0 === n && (n = 1),
void 0 === s && (s = 0),
void 0 === r && (r = !0),
void 0 === o && (o = !1),
(this.renderer = t),
(this.framebuffer = null),
(this.texture = null),
(this.width = 0),
(this.height = 0),
(this.scale = n),
(this.minFilter = s),
(this.autoClear = r),
(this.autoResize = !1),
this.resize(e, i),
o && this.setAutoResize(!0);
},
setAutoResize: function (t) {
return (
t && !this.autoResize ? (this.renderer.on(s.RESIZE, this.resize, this), (this.autoResize = !0)) : !t && this.autoResize && (this.renderer.off(s.RESIZE, this.resize, this), (this.autoResize = !1)), this
);
},
resize: function (t, e) {
var i,
n = t * this.scale,
s = e * this.scale;
return (
(n === this.width && s === this.height) ||
((i = this.renderer).deleteFramebuffer(this.framebuffer),
i.deleteTexture(this.texture),
(t *= this.scale),
(e *= this.scale),
(t = Math.round(t)) <= 0 && (t = 1),
(e = Math.round(e)) <= 0 && (e = 1),
(this.texture = i.createTextureFromSource(null, t, e, this.minFilter)),
(this.framebuffer = i.createFramebuffer(t, e, this.texture, !1)),
(this.width = t),
(this.height = e)),
this
);
},
bind: function (t, e, i) {
var n;
void 0 === t && (t = !1),
t && this.renderer.flush(),
e && i && this.resize(e, i),
this.renderer.pushFramebuffer(this.framebuffer, !1, !1, !1),
t && this.adjustViewport(),
this.autoClear && ((n = this.renderer.gl).clearColor(0, 0, 0, 0), n.clear(n.COLOR_BUFFER_BIT));
},
adjustViewport: function () {
var t = this.renderer.gl;
t.viewport(0, 0, this.width, this.height), t.disable(t.SCISSOR_TEST);
},
clear: function () {
var t = this.renderer,
e = t.gl;
t.pushFramebuffer(this.framebuffer), e.disable(e.SCISSOR_TEST), e.clearColor(0, 0, 0, 0), e.clear(e.COLOR_BUFFER_BIT), t.popFramebuffer(), t.resetScissor();
},
unbind: function (t) {
void 0 === t && (t = !1);
var e = this.renderer;
return t && e.flush(), e.popFramebuffer();
},
destroy: function () {
var t = this.renderer;
t.deleteFramebuffer(this.framebuffer), t.deleteTexture(this.texture), t.off(s.RESIZE, this.resize, this), (this.renderer = null), (this.framebuffer = null), (this.texture = null);
},
});
t.exports = r;
},
function (t, e) {
t.exports = function (t, e) {
var i;
if (e) "string" == typeof e ? (i = document.getElementById(e)) : "object" == typeof e && 1 === e.nodeType && (i = e);
else if (t.parentElement || null === e) return t;
return (i = i || document.body).appendChild(t), t;
};
},
function (t, e) {
t.exports = {
BACKSPACE: 8,
TAB: 9,
ENTER: 13,
SHIFT: 16,
CTRL: 17,
ALT: 18,
PAUSE: 19,
CAPS_LOCK: 20,
ESC: 27,
SPACE: 32,
PAGE_UP: 33,
PAGE_DOWN: 34,
END: 35,
HOME: 36,
LEFT: 37,
UP: 38,
RIGHT: 39,
DOWN: 40,
PRINT_SCREEN: 42,
INSERT: 45,
DELETE: 46,
ZERO: 48,
ONE: 49,
TWO: 50,
THREE: 51,
FOUR: 52,
FIVE: 53,
SIX: 54,
SEVEN: 55,
EIGHT: 56,
NINE: 57,
NUMPAD_ZERO: 96,
NUMPAD_ONE: 97,
NUMPAD_TWO: 98,
NUMPAD_THREE: 99,
NUMPAD_FOUR: 100,
NUMPAD_FIVE: 101,
NUMPAD_SIX: 102,
NUMPAD_SEVEN: 103,
NUMPAD_EIGHT: 104,
NUMPAD_NINE: 105,
NUMPAD_ADD: 107,
NUMPAD_SUBTRACT: 109,
A: 65,
B: 66,
C: 67,
D: 68,
E: 69,
F: 70,
G: 71,
H: 72,
I: 73,
J: 74,
K: 75,
L: 76,
M: 77,
N: 78,
O: 79,
P: 80,
Q: 81,
R: 82,
S: 83,
T: 84,
U: 85,
V: 86,
W: 87,
X: 88,
Y: 89,
Z: 90,
F1: 112,
F2: 113,
F3: 114,
F4: 115,
F5: 116,
F6: 117,
F7: 118,
F8: 119,
F9: 120,
F10: 121,
F11: 122,
F12: 123,
SEMICOLON: 186,
PLUS: 187,
COMMA: 188,
MINUS: 189,
PERIOD: 190,
FORWARD_SLASH: 191,
BACK_SLASH: 220,
QUOTES: 222,
BACKTICK: 192,
OPEN_BRACKET: 219,
CLOSED_BRACKET: 221,
SEMICOLON_FIREFOX: 59,
COLON: 58,
COMMA_FIREFOX_WINDOWS: 60,
COMMA_FIREFOX: 62,
BRACKET_RIGHT_FIREFOX: 174,
BRACKET_LEFT_FIREFOX: 175,
};
},
function (t, e) {
t.exports = { PENDING: 0, INIT: 1, START: 2, LOADING: 3, CREATING: 4, RUNNING: 5, PAUSED: 6, SLEEPING: 7, SHUTDOWN: 8, DESTROYED: 9 };
},
function (t, e, i) {
var n = i(0),
o = i(77),
s = i(9),
r = i(70),
a = i(22),
h = i(1),
l = i(207),
u = i(428),
c = new n({
Extends: s,
initialize: function (t) {
s.call(this),
(this.game = t),
(this.jsonCache = t.cache.json),
(this.sounds = []),
(this.mute = !1),
(this.volume = 1),
(this.pauseOnBlur = !0),
(this._rate = 1),
(this._detune = 0),
(this.locked = this.locked || !1),
(this.unlocked = !1),
t.events.on(a.BLUR, this.onGameBlur, this),
t.events.on(a.FOCUS, this.onGameFocus, this),
t.events.on(a.PRE_STEP, this.update, this),
t.events.once(a.DESTROY, this.destroy, this);
},
add: h,
addAudioSprite: function (t, e) {
void 0 === e && (e = {});
var i,
n,
s = this.add(t, e);
for (var r in ((s.spritemap = this.jsonCache.get(t).spritemap), s.spritemap))
s.spritemap.hasOwnProperty(r) && ((i = o(e)), (n = s.spritemap[r]), (i.loop = !!n.hasOwnProperty("loop") && n.loop), s.addMarker({ name: r, start: n.start, duration: n.end - n.start, config: i }));
return s;
},
get: function (t) {
return u(this.sounds, "key", t);
},
getAll: function (t) {
return l(this.sounds, "key", t);
},
play: function (t, e) {
var i = this.add(t);
return i.once(r.COMPLETE, i.destroy, i), e ? (e.name ? (i.addMarker(e), i.play(e.name)) : i.play(e)) : i.play();
},
playAudioSprite: function (t, e, i) {
var n = this.addAudioSprite(t);
return n.once(r.COMPLETE, n.destroy, n), n.play(e, i);
},
remove: function (t) {
var e = this.sounds.indexOf(t);
return -1 !== e && (t.destroy(), this.sounds.splice(e, 1), !0);
},
removeAll: function () {
this.sounds.forEach(function (t) {
t.destroy();
}),
(this.sounds.length = 0);
},
removeByKey: function (t) {
for (var e = 0, i = this.sounds.length - 1; 0 <= i; i--) {
var n = this.sounds[i];
n.key === t && (n.destroy(), this.sounds.splice(i, 1), e++);
}
return e;
},
pauseAll: function () {
this.forEachActiveSound(function (t) {
t.pause();
}),
this.emit(r.PAUSE_ALL, this);
},
resumeAll: function () {
this.forEachActiveSound(function (t) {
t.resume();
}),
this.emit(r.RESUME_ALL, this);
},
stopAll: function () {
this.forEachActiveSound(function (t) {
t.stop();
}),
this.emit(r.STOP_ALL, this);
},
stopByKey: function (t) {
var e = 0;
return (
this.getAll(t).forEach(function (t) {
t.stop() && e++;
}),
e
);
},
unlock: h,
onBlur: h,
onFocus: h,
onGameBlur: function () {
this.pauseOnBlur && this.onBlur();
},
onGameFocus: function () {
this.pauseOnBlur && this.onFocus();
},
update: function (e, i) {
this.unlocked && ((this.unlocked = !1), (this.locked = !1), this.emit(r.UNLOCKED, this));
for (var t = this.sounds.length - 1; 0 <= t; t--) this.sounds[t].pendingRemove && this.sounds.splice(t, 1);
this.sounds.forEach(function (t) {
t.update(e, i);
});
},
destroy: function () {
this.game.events.off(a.BLUR, this.onGameBlur, this),
this.game.events.off(a.FOCUS, this.onGameFocus, this),
this.game.events.off(a.PRE_STEP, this.update, this),
this.removeAllListeners(),
this.removeAll(),
(this.sounds.length = 0),
(this.sounds = null),
(this.game = null);
},
forEachActiveSound: function (i, n) {
var s = this;
this.sounds.forEach(function (t, e) {
t && !t.pendingRemove && i.call(n || s, t, e, s.sounds);
});
},
setRate: function (t) {
return (this.rate = t), this;
},
rate: {
get: function () {
return this._rate;
},
set: function (t) {
(this._rate = t),
this.forEachActiveSound(function (t) {
t.calculateRate();
}),
this.emit(r.GLOBAL_RATE, this, t);
},
},
setDetune: function (t) {
return (this.detune = t), this;
},
detune: {
get: function () {
return this._detune;
},
set: function (t) {
(this._detune = t),
this.forEachActiveSound(function (t) {
t.calculateRate();
}),
this.emit(r.GLOBAL_DETUNE, this, t);
},
},
});
t.exports = c;
},
function (t, e, i) {
var n = i(0),
s = i(9),
r = i(70),
o = i(17),
a = i(1),
h = new n({
Extends: s,
initialize: function (t, e, i) {
s.call(this),
(this.manager = t),
(this.key = e),
(this.isPlaying = !1),
(this.isPaused = !1),
(this.totalRate = 1),
(this.duration = this.duration || 0),
(this.totalDuration = this.totalDuration || 0),
(this.config = { mute: !1, volume: 1, rate: 1, detune: 0, seek: 0, loop: !1, delay: 0, pan: 0 }),
(this.currentConfig = this.config),
(this.config = o(this.config, i)),
(this.markers = {}),
(this.currentMarker = null),
(this.pendingRemove = !1);
},
addMarker: function (t) {
return !(
!t ||
!t.name ||
"string" != typeof t.name ||
this.markers[t.name] ||
((t = o(!0, { name: "", start: 0, duration: this.totalDuration - (t.start || 0), config: { mute: !1, volume: 1, rate: 1, detune: 0, seek: 0, loop: !1, delay: 0, pan: 0 } }, t)),
(this.markers[t.name] = t),
0)
);
},
updateMarker: function (t) {
return !(!t || !t.name || "string" != typeof t.name || !this.markers[t.name] || ((this.markers[t.name] = o(!0, this.markers[t.name], t)), 0));
},
removeMarker: function (t) {
var e = this.markers[t];
return e ? ((this.markers[t] = null), e) : null;
},
play: function (t, e) {
if ((void 0 === t && (t = ""), "object" == typeof t && ((e = t), (t = "")), "string" != typeof t)) return !1;
if (t) {
if (!this.markers[t]) return !1;
(this.currentMarker = this.markers[t]), (this.currentConfig = this.currentMarker.config), (this.duration = this.currentMarker.duration);
} else (this.currentMarker = null), (this.currentConfig = this.config), (this.duration = this.totalDuration);
return this.resetConfig(), (this.currentConfig = o(this.currentConfig, e)), (this.isPlaying = !0), !(this.isPaused = !1);
},
pause: function () {
return !(this.isPaused || !this.isPlaying) && ((this.isPlaying = !1), (this.isPaused = !0));
},
resume: function () {
return !(!this.isPaused || this.isPlaying || ((this.isPlaying = !0), (this.isPaused = !1)));
},
stop: function () {
return !((!this.isPaused && !this.isPlaying) || ((this.isPlaying = !1), (this.isPaused = !1), this.resetConfig(), 0));
},
applyConfig: function () {
(this.mute = this.currentConfig.mute),
(this.volume = this.currentConfig.volume),
(this.rate = this.currentConfig.rate),
(this.detune = this.currentConfig.detune),
(this.loop = this.currentConfig.loop),
(this.pan = this.currentConfig.pan);
},
resetConfig: function () {
(this.currentConfig.seek = 0), (this.currentConfig.delay = 0);
},
update: a,
calculateRate: function () {
var t = this.currentConfig.detune + this.manager.detune,
e = Math.pow(1.0005777895065548, t);
this.totalRate = this.currentConfig.rate * this.manager.rate * e;
},
destroy: function () {
this.pendingRemove ||
(this.emit(r.DESTROY, this),
(this.pendingRemove = !0),
(this.manager = null),
(this.key = ""),
this.removeAllListeners(),
(this.isPlaying = !1),
(this.isPaused = !1),
(this.config = null),
(this.currentConfig = null),
(this.markers = null),
(this.currentMarker = null));
},
});
t.exports = h;
},
function (t, e, i) {
var n = i(209),
s = i(435);
t.exports = function (t, e) {
if ((void 0 === e && (e = 90), !n(t))) return null;
if (("string" != typeof e && (e = ((e % 360) + 360) % 360), 90 === e || -270 === e || "rotateLeft" === e)) (t = s(t)).reverse();
else if (-90 === e || 270 === e || "rotateRight" === e) t.reverse(), (t = s(t));
else if (180 === Math.abs(e) || "rotate180" === e) {
for (var i = 0; i < t.length; i++) t[i].reverse();
t.reverse();
}
return t;
};
},
function (t, e, i) {
var n = i(0),
f = i(18),
s = i(11),
h = i(15),
l = i(1043),
r = i(1044),
o = i(212),
u = i(10),
a = i(1045),
c = new n({
Extends: h,
Mixins: [s.Alpha, s.BlendMode, s.Depth, s.Mask, s.Origin, s.Pipeline, s.ScrollFactor, s.Texture, s.Tint, s.Transform, s.Visible, a],
initialize: function (t, e, i, n, s, r, o) {
void 0 === s && (s = ""), void 0 === o && (o = 0), h.call(this, t, "BitmapText"), (this.font = n);
var a = this.scene.sys.cache.bitmapFont.get(n);
(this.fontData = a.data),
(this._text = ""),
(this._fontSize = r || this.fontData.size),
(this._letterSpacing = 0),
(this._align = o),
(this._bounds = l()),
(this._dirty = !0),
(this._maxWidth = 0),
(this.wordWrapCharCode = 32),
(this.charColors = []),
(this.dropShadowX = 0),
(this.dropShadowY = 0),
(this.dropShadowColor = 0),
(this.dropShadowAlpha = 0.5),
(this.fromAtlas = a.fromAtlas),
this.setTexture(a.texture, a.frame),
this.setPosition(e, i),
this.setOrigin(0, 0),
this.initPipeline(),
this.setText(s);
},
setLeftAlign: function () {
return (this._align = c.ALIGN_LEFT), (this._dirty = !0), this;
},
setCenterAlign: function () {
return (this._align = c.ALIGN_CENTER), (this._dirty = !0), this;
},
setRightAlign: function () {
return (this._align = c.ALIGN_RIGHT), (this._dirty = !0), this;
},
setFontSize: function (t) {
return (this._fontSize = t), (this._dirty = !0), this;
},
setLetterSpacing: function (t) {
return void 0 === t && (t = 0), (this._letterSpacing = t), (this._dirty = !0), this;
},
setText: function (t) {
return t || 0 === t || (t = ""), Array.isArray(t) && (t = t.join("\n")), t !== this.text && ((this._text = t.toString()), (this._dirty = !0), this.updateDisplayOrigin()), this;
},
setDropShadow: function (t, e, i, n) {
return (
void 0 === t && (t = 0),
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 0.5),
(this.dropShadowX = t),
(this.dropShadowY = e),
(this.dropShadowColor = i),
(this.dropShadowAlpha = n),
this
);
},
setCharacterTint: function (t, e, i, n, s, r, o) {
void 0 === t && (t = 0), void 0 === e && (e = 1), void 0 === i && (i = !1), void 0 === n && (n = -1), void 0 === s && (o = r = s = n);
var a = this.text.length;
-1 === e && (e = a), t < 0 && (t = a + t), (t = f(t, 0, a - 1));
for (var h = f(t + e, t, a), l = this.charColors, u = t; u < h; u++) {
var c,
d = l[u];
-1 === n
? (l[u] = null)
: ((c = i ? 1 : 0), d ? ((d.tintEffect = c), (d.tintTL = n), (d.tintTR = s), (d.tintBL = r), (d.tintBR = o)) : (l[u] = { tintEffect: c, tintTL: n, tintTR: s, tintBL: r, tintBR: o }));
}
return this;
},
setWordTint: function (t, e, i, n, s, r, o) {
void 0 === e && (e = 1);
for (var a = this.getTextBounds().words, h = "number" == typeof t, l = 0, u = 0; u < a.length; u++) {
var c = a[u];
if (((h && u === t) || (!h && c.word === t)) && (this.setCharacterTint(c.i, c.word.length, i, n, s, r, o), ++l === e)) return this;
}
return this;
},
getTextBounds: function (t) {
var e = this._bounds;
return (this._dirty || t || this.scaleX !== e.scaleX || this.scaleY !== e.scaleY) && (l(this, t, !0, e), (this._dirty = !1)), e;
},
getCharacterAt: function (t, e, i) {
for (var n = this.getLocalPoint(t, e, null, i), s = this.getTextBounds().characters, r = new u(), o = 0; o < s.length; o++) {
var a = s[o];
if ((r.setTo(a.x, a.t, a.r - a.x, a.b), r.contains(n.x, n.y))) return a;
}
return null;
},
updateDisplayOrigin: function () {
return (this._dirty = !0), this.getTextBounds(!1), this;
},
setFont: function (t, e, i) {
var n;
return (
void 0 === e && (e = this._fontSize),
void 0 === i && (i = this._align),
t === this.font ||
((n = this.scene.sys.cache.bitmapFont.get(t)) &&
((this.font = t), (this.fontData = n.data), (this._fontSize = e), (this._align = i), (this.fromAtlas = !0 === n.fromAtlas), this.setTexture(n.texture, n.frame), l(this, !1, !0, this._bounds))),
this
);
},
setMaxWidth: function (t, e) {
return (this._maxWidth = t), (this._dirty = !0), void 0 !== e && (this.wordWrapCharCode = e), this;
},
align: {
set: function (t) {
(this._align = t), (this._dirty = !0);
},
get: function () {
return this._align;
},
},
text: {
set: function (t) {
this.setText(t);
},
get: function () {
return this._text;
},
},
fontSize: {
set: function (t) {
(this._fontSize = t), (this._dirty = !0);
},
get: function () {
return this._fontSize;
},
},
letterSpacing: {
set: function (t) {
(this._letterSpacing = t), (this._dirty = !0);
},
get: function () {
return this._letterSpacing;
},
},
maxWidth: {
set: function (t) {
(this._maxWidth = t), (this._dirty = !0);
},
get: function () {
return this._maxWidth;
},
},
width: {
get: function () {
return this.getTextBounds(!1), this._bounds.global.width;
},
},
height: {
get: function () {
return this.getTextBounds(!1), this._bounds.global.height;
},
},
toJSON: function () {
var t = s.ToJSON(this),
e = { font: this.font, text: this.text, fontSize: this.fontSize, letterSpacing: this.letterSpacing, align: this.align };
return (t.data = e), t;
},
preDestroy: function () {
(this.charColors.length = 0), (this._bounds = null), (this.fontData = null);
},
});
(c.ALIGN_LEFT = 0), (c.ALIGN_CENTER = 1), (c.ALIGN_RIGHT = 2), (c.ParseFromAtlas = r), (c.ParseXMLBitmapFont = o), (t.exports = c);
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t) {
if (((this.entries = []), Array.isArray(t))) for (var e = 0; e < t.length; e++) this.set(t[e]);
},
set: function (t) {
return -1 === this.entries.indexOf(t) && this.entries.push(t), this;
},
get: function (t, e) {
for (var i = 0; i < this.entries.length; i++) {
var n = this.entries[i];
if (n[t] === e) return n;
}
},
getArray: function () {
return this.entries.slice(0);
},
delete: function (t) {
var e = this.entries.indexOf(t);
return -1 < e && this.entries.splice(e, 1), this;
},
dump: function () {
for (var t = 0; t < this.entries.length; t++) this.entries[t];
},
each: function (t, e) {
var i,
n = this.entries.slice(),
s = n.length;
if (e) for (i = 0; i < s && !1 !== t.call(e, n[i], i); i++);
else for (i = 0; i < s && !1 !== t(n[i], i); i++);
return this;
},
iterate: function (t, e) {
var i,
n = this.entries.length;
if (e) for (i = 0; i < n && !1 !== t.call(e, this.entries[i], i); i++);
else for (i = 0; i < n && !1 !== t(this.entries[i], i); i++);
return this;
},
iterateLocal: function (t) {
for (var e = [], i = 1; i < arguments.length; i++) e.push(arguments[i]);
var n = this.entries.length;
for (i = 0; i < n; i++) {
var s = this.entries[i];
s[t].apply(s, e);
}
return this;
},
clear: function () {
return (this.entries.length = 0), this;
},
contains: function (t) {
return -1 < this.entries.indexOf(t);
},
union: function (t) {
var e = new n();
return (
t.entries.forEach(function (t) {
e.set(t);
}),
this.entries.forEach(function (t) {
e.set(t);
}),
e
);
},
intersect: function (e) {
var i = new n();
return (
this.entries.forEach(function (t) {
e.contains(t) && i.set(t);
}),
i
);
},
difference: function (e) {
var i = new n();
return (
this.entries.forEach(function (t) {
e.contains(t) || i.set(t);
}),
i
);
},
size: {
get: function () {
return this.entries.length;
},
set: function (t) {
return t < this.entries.length ? (this.entries.length = t) : this.entries.length;
},
},
});
t.exports = n;
},
function (t, e, i) {
var n = i(0),
s = i(11),
a = i(15),
h = i(189),
l = i(92),
r = i(1182),
o = new n({
Extends: a,
Mixins: [s.AlphaSingle, s.BlendMode, s.Depth, s.GetBounds, s.Mask, s.Pipeline, s.ScrollFactor, s.Transform, s.Visible, r],
initialize: function (t, e, i, n, s, r, o) {
void 0 === n && (n = 16777215),
void 0 === s && (s = 128),
void 0 === r && (r = 1),
void 0 === o && (o = 0.1),
a.call(this, t, "PointLight"),
this.initPipeline(l.POINTLIGHT_PIPELINE),
this.setPosition(e, i),
(this.color = h(n)),
(this.intensity = r),
(this.attenuation = o),
(this.width = 2 * s),
(this.height = 2 * s),
(this._radius = s);
},
radius: {
get: function () {
return this._radius;
},
set: function (t) {
(this._radius = t), (this.width = 2 * t), (this.height = 2 * t);
},
},
originX: {
get: function () {
return 0.5;
},
},
originY: {
get: function () {
return 0.5;
},
},
displayOriginX: {
get: function () {
return this._radius;
},
},
displayOriginY: {
get: function () {
return this._radius;
},
},
});
t.exports = o;
},
function (t, e) {
t.exports = function (t, e) {
var i = e.width / 2,
n = e.height / 2,
s = Math.abs(t.x - e.x - i),
r = Math.abs(t.y - e.y - n),
o = i + t.radius,
a = n + t.radius;
if (o < s || a < r) return !1;
if (s <= i || r <= n) return !0;
var h = s - i,
l = r - n;
return h * h + l * l <= t.radius * t.radius;
};
},
function (t, e) {
t.exports = function (t, e) {
return !(t.width <= 0 || t.height <= 0 || e.width <= 0 || e.height <= 0 || t.right < e.x || t.bottom < e.y || t.x > e.right || t.y > e.bottom);
};
},
function (t, e, i) {
var l = i(6),
u = {},
n = {
register: function (t, e, i, n, s) {
u[t] = { plugin: e, mapping: i, settingsKey: n, configKey: s };
},
getPlugin: function (t) {
return u[t];
},
install: function (t) {
var e = t.scene.sys,
i = e.settings.input,
n = e.game.config;
for (var s in u) {
var r = u[s].plugin,
o = u[s].mapping,
a = u[s].settingsKey,
h = u[s].configKey;
l(i, a, n[h]) && (t[o] = new r(t));
}
},
remove: function (t) {
u.hasOwnProperty(t) && delete u[t];
},
};
t.exports = n;
},
function (t, e, i) {
t.exports = { ANY_KEY_DOWN: i(1323), ANY_KEY_UP: i(1324), COMBO_MATCH: i(1325), DOWN: i(1326), KEY_DOWN: i(1327), KEY_UP: i(1328), UP: i(1329) };
},
function (t, e) {
t.exports = function (t, e) {
return !!t.url && (t.url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/) ? t.url : e + t.url);
};
},
function (t, e) {
t.exports = function (t, e, i, n, s, r) {
return (
void 0 === t && (t = ""),
void 0 === e && (e = !0),
void 0 === i && (i = ""),
void 0 === n && (n = ""),
void 0 === s && (s = 0),
void 0 === r && (r = !1),
{ responseType: t, async: e, user: i, password: n, timeout: s, headers: void 0, header: void 0, headerValue: void 0, requestedWith: !1, overrideMimeType: void 0, withCredentials: r }
);
};
},
function (t, e, i) {
var n = i(0),
s = i(243),
r = i(73),
o = new n({
Extends: r,
Mixins: [s.Acceleration, s.Angular, s.Bounce, s.Debug, s.Drag, s.Enable, s.Friction, s.Gravity, s.Immovable, s.Mass, s.Pushable, s.Size, s.Velocity],
initialize: function (t, e, i, n, s) {
r.call(this, t, e, i, n, s), (this.body = null);
},
});
t.exports = o;
},
function (t, e, i) {
var r = i(119);
t.exports = function (t, e, i, n) {
if ((void 0 === i && (i = !1), r(t, e, n))) {
var s = n.data[e][t] || null;
return s && (-1 !== s.index || i) ? s : null;
}
return null;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s,
r,
o,
a = t.data,
h = t.width,
l = t.height,
u = t.tilemapLayer,
c = Math.max(0, e.left),
d = Math.min(h, e.right),
f = Math.max(0, e.top),
p = Math.min(l, e.bottom);
if (0 === i) for (r = f; r < p; r++) for (s = c; a[r] && s < d; s++) (o = a[r][s]) && -1 !== o.index && o.visible && 0 !== o.alpha && n.push(o);
else if (1 === i) for (r = f; r < p; r++) for (s = d; a[r] && c <= s; s--) (o = a[r][s]) && -1 !== o.index && o.visible && 0 !== o.alpha && n.push(o);
else if (2 === i) for (r = p; f <= r; r--) for (s = c; a[r] && s < d; s++) (o = a[r][s]) && -1 !== o.index && o.visible && 0 !== o.alpha && n.push(o);
else if (3 === i) for (r = p; f <= r; r--) for (s = d; a[r] && c <= s; s--) (o = a[r][s]) && -1 !== o.index && o.visible && 0 !== o.alpha && n.push(o);
return (u.tilesDrawn = n.length), (u.tilesTotal = h * l), n;
};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = i.collideIndexes.indexOf(t);
e && -1 === n ? i.collideIndexes.push(t) : e || -1 === n || i.collideIndexes.splice(n, 1);
};
},
function (t, e, i) {
var r = i(2);
t.exports = function (t, e, i) {
if (!e) return { i: 0, layers: t.layers, name: "", opacity: 1, visible: !0, x: 0, y: 0 };
var n = e.x + r(e, "startx", 0) * t.tilewidth + r(e, "offsetx", 0),
s = e.y + r(e, "starty", 0) * t.tileheight + r(e, "offsety", 0);
return { i: 0, layers: e.layers, name: i.name + e.name + "/", opacity: i.opacity * e.opacity, visible: i.visible && e.visible, x: i.x + n, y: i.y + s };
};
},
function (t, e) {
t.exports = function (o, a, t) {
return o.hasOwnProperty(a)
? "function" == typeof o[a]
? function (t, e, i, n, s, r) {
return o[a](t, e, i, n, s, r);
}
: function () {
return o[a];
}
: "function" == typeof t
? t
: function () {
return t;
};
};
},
function (t, e, i) {
var k = i(265),
R = i(13),
L = i(99),
I = i(80),
D = i(162),
F = i(583),
B = i(263),
N = i(6),
U = i(264),
Y = i(266),
z = i(268);
t.exports = function (t, e, i) {
void 0 === i && (i = k);
for (
var n = i.targets ? i.targets : B(e),
s = F(e),
r = D(e, "delay", i.delay),
o = D(e, "duration", i.duration),
a = N(e, "easeParams", i.easeParams),
h = I(N(e, "ease", i.ease), a),
l = D(e, "hold", i.hold),
u = D(e, "repeat", i.repeat),
c = D(e, "repeatDelay", i.repeatDelay),
d = L(e, "yoyo", i.yoyo),
f = L(e, "flipX", i.flipX),
p = L(e, "flipY", i.flipY),
g = [],
v = 0;
v < s.length;
v++
)
for (var y = s[v].key, m = s[v].value, x = 0; x < n.length; x++) {
var b = U(y, m),
w = z(
n[x],
x,
y,
b.getEnd,
b.getStart,
b.getActive,
I(N(m, "ease", h), N(m, "easeParams", a)),
D(m, "delay", r),
D(m, "duration", o),
L(m, "yoyo", d),
D(m, "hold", l),
D(m, "repeat", u),
D(m, "repeatDelay", c),
L(m, "flipX", f),
L(m, "flipY", p)
);
g.push(w);
}
var T = new Y(t, g, n);
(T.offset = R(e, "offset", null)),
(T.completeDelay = R(e, "completeDelay", 0)),
(T.loop = Math.round(R(e, "loop", 0))),
(T.loopDelay = Math.round(R(e, "loopDelay", 0))),
(T.paused = L(e, "paused", !1)),
(T.useFrames = L(e, "useFrames", !1));
for (var S = N(e, "callbackScope", T), _ = [T, null], E = Y.TYPES, P = 0; P < E.length; P++) {
var A,
M,
C = E[P],
O = N(e, C, !1);
O && ((A = N(e, C + "Scope", S)), (M = N(e, C + "Params", [])), T.setCallback(C, O, _.concat(M), A));
}
return T;
};
},
function (t, e, i) {
var n = i(0),
s = i(102),
l = i(2),
r = i(132),
o = i(185),
a = new n({
initialize: function (t) {
(this.parent = t),
(this.animationManager = t.scene.sys.anims),
this.animationManager.on(r.REMOVE_ANIMATION, this.globalRemove, this),
(this.textureManager = this.animationManager.textureManager),
(this.anims = null),
(this.isPlaying = !1),
(this.hasStarted = !1),
(this.currentAnim = null),
(this.currentFrame = null),
(this.nextAnim = null),
(this.nextAnimsQueue = []),
(this.timeScale = 1),
(this.frameRate = 0),
(this.duration = 0),
(this.msPerFrame = 0),
(this.skipMissedFrames = !0),
(this.delay = 0),
(this.repeat = 0),
(this.repeatDelay = 0),
(this.yoyo = !1),
(this.showOnStart = !1),
(this.hideOnComplete = !1),
(this.forward = !0),
(this.inReverse = !1),
(this.accumulator = 0),
(this.nextTick = 0),
(this.delayCounter = 0),
(this.repeatCounter = 0),
(this.pendingRepeat = !1),
(this._paused = !1),
(this._wasPlaying = !1),
(this._pendingStop = 0),
this._pendingStopValue;
},
chain: function (t) {
var e = this.parent;
if (void 0 === t) return (this.nextAnimsQueue.length = 0), (this.nextAnim = null), e;
Array.isArray(t) || (t = [t]);
for (var i = 0; i < t.length; i++) {
var n = t[i];
null === this.nextAnim ? (this.nextAnim = n) : this.nextAnimsQueue.push(n);
}
return this.parent;
},
getName: function () {
return this.currentAnim ? this.currentAnim.key : "";
},
getFrameName: function () {
return this.currentFrame ? this.currentFrame.textureFrame : "";
},
load: function (t) {
this.isPlaying && this.stop();
var e,
i,
n,
s,
r,
o = this.animationManager,
a = "string" == typeof t ? t : l(t, "key", null),
h = this.exists(a) ? this.get(a) : o.get(a);
return (
h &&
((e = (this.currentAnim = h).getTotalFrames()),
(i = l(t, "frameRate", h.frameRate)),
(n = l(t, "duration", h.duration)),
h.calculateDuration(this, e, n, i),
(this.delay = l(t, "delay", h.delay)),
(this.repeat = l(t, "repeat", h.repeat)),
(this.repeatDelay = l(t, "repeatDelay", h.repeatDelay)),
(this.yoyo = l(t, "yoyo", h.yoyo)),
(this.showOnStart = l(t, "showOnStart", h.showOnStart)),
(this.hideOnComplete = l(t, "hideOnComplete", h.hideOnComplete)),
(this.skipMissedFrames = l(t, "skipMissedFrames", h.skipMissedFrames)),
(this.timeScale = l(t, "timeScale", this.timeScale)),
(s = l(t, "startFrame", 0)) > h.getTotalFrames() && (s = 0),
(r = h.frames[s]),
0 !== s || this.forward || (r = h.getLastFrame()),
(this.currentFrame = r)),
this.parent
);
},
pause: function (t) {
return this._paused || ((this._paused = !0), (this._wasPlaying = this.isPlaying), (this.isPlaying = !1)), void 0 !== t && this.setCurrentFrame(t), this.parent;
},
resume: function (t) {
return this._paused && ((this._paused = !1), (this.isPlaying = this._wasPlaying)), void 0 !== t && this.setCurrentFrame(t), this.parent;
},
playAfterDelay: function (t, e) {
var i, n;
return (
this.isPlaying
? ((i = this.nextAnim), (n = this.nextAnimsQueue), i && n.unshift(i), (this.nextAnim = t), (this._pendingStop = 1), (this._pendingStopValue = e))
: ((this.delayCounter = e), this.play(t, !0)),
this.parent
);
},
playAfterRepeat: function (t, e) {
var i, n;
return (
void 0 === e && (e = 1),
this.isPlaying
? ((i = this.nextAnim),
(n = this.nextAnimsQueue),
i && n.unshift(i),
-1 !== this.repeatCounter && e > this.repeatCounter && (e = this.repeatCounter),
(this.nextAnim = t),
(this._pendingStop = 2),
(this._pendingStopValue = e))
: this.play(t),
this.parent
);
},
play: function (t, e) {
void 0 === e && (e = !1);
var i = this.currentAnim,
n = this.parent,
s = "string" == typeof t ? t : t.key;
if (e && this.isPlaying && i.key === s) return n;
if (i && this.isPlaying) {
var r = this.animationManager.getMix(i.key, t);
if (0 < r) return this.playAfterDelay(t, r);
}
return (this.forward = !0), (this.inReverse = !1), (this._paused = !1), (this._wasPlaying = !0), this.startAnimation(t);
},
playReverse: function (t, e) {
void 0 === e && (e = !1);
var i = "string" == typeof t ? t : t.key;
return e && this.isPlaying && this.currentAnim.key === i ? this.parent : ((this.forward = !1), (this.inReverse = !0), (this._paused = !1), (this._wasPlaying = !0), this.startAnimation(t));
},
startAnimation: function (t) {
this.load(t);
var e = this.currentAnim,
i = this.parent;
return (
e &&
((this.repeatCounter = -1 === this.repeat ? Number.MAX_VALUE : this.repeat),
e.getFirstTick(this),
(this.isPlaying = !0),
(this.pendingRepeat = !1),
(this.hasStarted = !1),
(this._pendingStop = 0),
(this._pendingStopValue = 0),
(this._paused = !1),
(this.delayCounter += this.delay),
0 === this.delayCounter && this.handleStart()),
i
);
},
handleStart: function () {
this.showOnStart && this.parent.setVisible(!0), this.setCurrentFrame(this.currentFrame), (this.hasStarted = !0), this.emitEvents(r.ANIMATION_START);
},
handleRepeat: function () {
(this.pendingRepeat = !1), this.emitEvents(r.ANIMATION_REPEAT);
},
handleStop: function () {
(this._pendingStop = 0), (this.isPlaying = !1), this.emitEvents(r.ANIMATION_STOP);
},
handleComplete: function () {
(this._pendingStop = 0), (this.isPlaying = !1), this.hideOnComplete && this.parent.setVisible(!1), this.emitEvents(r.ANIMATION_COMPLETE, r.ANIMATION_COMPLETE_KEY);
},
emitEvents: function (t, e) {
var i = this.currentAnim,
n = this.currentFrame,
s = this.parent,
r = n.textureFrame;
s.emit(t, i, n, s, r), e && s.emit(e + i.key, i, n, s, r);
},
reverse: function () {
return this.isPlaying && ((this.inReverse = !this.inReverse), (this.forward = !this.forward)), this.parent;
},
getProgress: function () {
var t = this.currentFrame;
if (!t) return 0;
var e = t.progress;
return this.inReverse && (e *= -1), e;
},
setProgress: function (t) {
return this.forward || (t = 1 - t), this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)), this.parent;
},
setRepeat: function (t) {
return (this.repeatCounter = -1 === t ? Number.MAX_VALUE : t), this.parent;
},
globalRemove: function (t, e) {
void 0 === e && (e = this.currentAnim), this.isPlaying && e.key === this.currentAnim.key && (this.stop(), this.setCurrentFrame(this.currentAnim.frames[0]));
},
restart: function (t, e) {
void 0 === t && (t = !1), void 0 === e && (e = !1);
var i = this.currentAnim,
n = this.parent;
return i
? (e && (this.repeatCounter = -1 === this.repeat ? Number.MAX_VALUE : this.repeat),
i.getFirstTick(this),
this.emitEvents(r.ANIMATION_RESTART),
(this.isPlaying = !0),
(this.pendingRepeat = !1),
(this.hasStarted = !t),
(this._pendingStop = 0),
(this._pendingStopValue = 0),
(this._paused = !1),
this.setCurrentFrame(i.frames[0]),
this.parent)
: n;
},
complete: function () {
var t;
return (
(this._pendingStop = 0),
(this.isPlaying = !1),
this.currentAnim && this.handleComplete(),
this.nextAnim && ((t = this.nextAnim), (this.nextAnim = 0 < this.nextAnimsQueue.length ? this.nextAnimsQueue.shift() : null), this.play(t)),
this.parent
);
},
stop: function () {
var t;
return (this._pendingStop = 0), (this.isPlaying = !1), this.currentAnim && this.handleStop(), this.nextAnim && ((t = this.nextAnim), (this.nextAnim = this.nextAnimsQueue.shift()), this.play(t)), this.parent;
},
stopAfterDelay: function (t) {
return (this._pendingStop = 1), (this._pendingStopValue = t), this.parent;
},
stopAfterRepeat: function (t) {
return void 0 === t && (t = 1), -1 !== this.repeatCounter && t > this.repeatCounter && (t = this.repeatCounter), (this._pendingStop = 2), (this._pendingStopValue = t), this.parent;
},
stopOnFrame: function (t) {
return (this._pendingStop = 3), (this._pendingStopValue = t), this.parent;
},
getTotalFrames: function () {
return this.currentAnim ? this.currentAnim.getTotalFrames() : 0;
},
update: function (t, e) {
var i = this.currentAnim;
if (this.isPlaying && i && !i.paused) {
if (((this.accumulator += e * this.timeScale), 1 === this._pendingStop && ((this._pendingStopValue -= e), this._pendingStopValue <= 0))) return this.stop();
if (this.hasStarted) {
if (
this.accumulator >= this.nextTick &&
(this.forward ? i.nextFrame(this) : i.previousFrame(this), this.isPlaying && 0 === this._pendingStop && this.skipMissedFrames && this.accumulator > this.nextTick)
)
for (var n = 0; this.forward ? i.nextFrame(this) : i.previousFrame(this), n++, this.isPlaying && this.accumulator > this.nextTick && n < 60; );
} else this.accumulator >= this.delayCounter && ((this.accumulator -= this.delayCounter), this.handleStart());
}
},
setCurrentFrame: function (t) {
var e = this.parent;
return (
(this.currentFrame = t),
(e.texture = t.frame.texture),
(e.frame = t.frame),
e.isCropped && e.frame.updateCropUVs(e._crop, e.flipX, e.flipY),
t.setAlpha && (e.alpha = t.alpha),
e.setSizeToFrame(),
e._originComponent && (t.frame.customPivot ? e.setOrigin(t.frame.pivotX, t.frame.pivotY) : e.updateDisplayOrigin()),
this.isPlaying && this.hasStarted && (this.emitEvents(r.ANIMATION_UPDATE), 3 === this._pendingStop && this._pendingStopValue === t && this.stop()),
e
);
},
nextFrame: function () {
return this.currentAnim && this.currentAnim.nextFrame(this), this.parent;
},
previousFrame: function () {
return this.currentAnim && this.currentAnim.previousFrame(this), this.parent;
},
get: function (t) {
return this.anims ? this.anims.get(t) : null;
},
exists: function (t) {
return !!this.anims && this.anims.has(t);
},
create: function (t) {
var e = t.key,
i = !1;
return e && ((i = this.get(e)) || ((i = new o(this, e, t)), this.anims || (this.anims = new s()), this.anims.set(e, i))), i;
},
generateFrameNames: function (t, e) {
return this.animationManager.generateFrameNames(t, e);
},
generateFrameNumbers: function (t, e) {
return this.animationManager.generateFrameNumbers(t, e);
},
remove: function (t) {
var e = this.get(t);
return e && (this.currentAnim === e && this.stop(), this.anims.delete(t)), e;
},
destroy: function () {
this.animationManager.off(r.REMOVE_ANIMATION, this.globalRemove, this),
this.anims && this.anims.clear(),
(this.animationManager = null),
(this.parent = null),
(this.nextAnim = null),
(this.nextAnimsQueue.length = 0),
(this.currentAnim = null),
(this.currentFrame = null);
},
isPaused: {
get: function () {
return this._paused;
},
},
});
t.exports = a;
},
function (t, e, i) {
var u = {};
t.exports = u;
var n = i(166);
(u._motionWakeThreshold = 0.18),
(u._motionSleepThreshold = 0.08),
(u._minBias = 0.9),
(u.update = function (t, e) {
for (var i = e * e * e, n = 0; n < t.length; n++) {
var s,
r,
o = t[n],
a = o.speed * o.speed + o.angularSpeed * o.angularSpeed;
0 === o.force.x && 0 === o.force.y
? ((s = Math.min(o.motion, a)),
(r = Math.max(o.motion, a)),
(o.motion = u._minBias * s + (1 - u._minBias) * r),
0 < o.sleepThreshold && o.motion < u._motionSleepThreshold * i ? ((o.sleepCounter += 1), o.sleepCounter >= o.sleepThreshold && u.set(o, !0)) : 0 < o.sleepCounter && --o.sleepCounter)
: u.set(o, !1);
}
}),
(u.afterCollisions = function (t, e) {
for (var i = e * e * e, n = 0; n < t.length; n++) {
var s,
r,
o,
a,
h,
l = t[n];
l.isActive &&
((r = (s = l.collision).bodyA.parent),
(o = s.bodyB.parent),
(r.isSleeping && o.isSleeping) ||
r.isStatic ||
o.isStatic ||
((r.isSleeping || o.isSleeping) && ((h = (a = r.isSleeping && !r.isStatic ? r : o) === r ? o : r), !a.isStatic && h.motion > u._motionWakeThreshold * i && u.set(a, !1))));
}
}),
(u.set = function (t, e) {
var i = t.isSleeping;
e
? ((t.isSleeping = !0),
(t.sleepCounter = t.sleepThreshold),
(t.positionImpulse.x = 0),
(t.positionImpulse.y = 0),
(t.positionPrev.x = t.position.x),
(t.positionPrev.y = t.position.y),
(t.anglePrev = t.angle),
(t.speed = 0),
(t.angularSpeed = 0),
(t.motion = 0),
i || n.trigger(t, "sleepStart"))
: ((t.isSleeping = !1), (t.sleepCounter = 0), i && n.trigger(t, "sleepEnd"));
});
},
function (t, e, i) {
var n = {};
t.exports = n;
var u = i(32);
(n.on = function (t, e, i) {
for (var n, s = e.split(" "), r = 0; r < s.length; r++) (n = s[r]), (t.events = t.events || {}), (t.events[n] = t.events[n] || []), t.events[n].push(i);
return i;
}),
(n.off = function (t, e, i) {
if (e) {
"function" == typeof e && ((i = e), (e = u.keys(t.events).join(" ")));
for (var n = e.split(" "), s = 0; s < n.length; s++) {
var r = t.events[n[s]],
o = [];
if (i && r) for (var a = 0; a < r.length; a++) r[a] !== i && o.push(r[a]);
t.events[n[s]] = o;
}
} else t.events = {};
}),
(n.trigger = function (t, e, i) {
var n,
s,
r,
o,
a = t.events;
if (a && 0 < u.keys(a).length) {
(i = i || {}), (n = e.split(" "));
for (var h = 0; h < n.length; h++)
if ((r = a[(s = n[h])])) {
((o = u.clone(i, !1)).name = s), (o.source = t);
for (var l = 0; l < r.length; l++) r[l].apply(t, [o]);
}
}
});
},
function (t, e, i) {
var a = i(175),
s = i(92),
r = i(74),
n = {
defaultPipeline: null,
pipeline: null,
hasPostPipeline: !1,
postPipelines: null,
pipelineData: null,
initPipeline: function (t) {
void 0 === t && (t = s.MULTI_PIPELINE);
var e = this.scene.sys.renderer;
if (!e) return !1;
var i = e.pipelines;
if (((this.postPipelines = []), (this.pipelineData = {}), i)) {
var n = i.get(t);
if (n) return (this.defaultPipeline = n), (this.pipeline = n), !0;
}
return !1;
},
setPipeline: function (t, e, i) {
var n = this.scene.sys.renderer;
if (!n) return this;
var s,
r = n.pipelines;
return r && ((s = r.get(t)) && (this.pipeline = s), e && (this.pipelineData = i ? a(e) : e)), this;
},
setPostPipeline: function (t, e, i) {
var n = this.scene.sys.renderer;
if (!n) return this;
var s = n.pipelines;
if (s) {
Array.isArray(t) || (t = [t]);
for (var r = 0; r < t.length; r++) {
var o = s.getPostPipeline(t[r], this);
o && this.postPipelines.push(o);
}
e && (this.pipelineData = i ? a(e) : e);
}
return (this.hasPostPipeline = 0 < this.postPipelines.length), this;
},
setPipelineData: function (t, e) {
var i = this.pipelineData;
return void 0 === e ? delete i[t] : (i[t] = e), this;
},
getPostPipeline: function (t) {
for (var e = this.postPipelines, i = [], n = 0; n < e.length; n++) {
var s = e[n];
(("string" == typeof t && s.name === t) || s instanceof t) && i.push(s);
}
return 1 === i.length ? i[0] : i;
},
resetPipeline: function (t, e) {
return (
void 0 === t && (t = !1),
void 0 === e && (e = !1),
(this.pipeline = this.defaultPipeline),
t && ((this.postPipelines = []), (this.hasPostPipeline = !1)),
e && (this.pipelineData = {}),
null !== this.pipeline
);
},
resetPostPipeline: function (t) {
void 0 === t && (t = !1);
for (var e = this.postPipelines, i = 0; i < e.length; i++) e[i].destroy();
(this.postPipelines = []), (this.hasPostPipeline = !1), t && (this.pipelineData = {});
},
removePostPipeline: function (t) {
for (var e = this.postPipelines, i = e.length - 1; 0 <= i; i--) {
var n = e[i];
(("string" == typeof t && n.name === t) || ("string" != typeof t && n instanceof t)) && (n.destroy(), r(e, i));
}
return (this.hasPostPipeline = 0 < this.postPipelines.length), this;
},
getPipelineName: function () {
return this.pipeline.name;
},
};
t.exports = n;
},
function (t, e) {
t.exports = { DEFAULT: 0, LINEAR: 0, NEAREST: 1 };
},
function (t, e, i) {
var n = i(4);
t.exports = function (t, e, i) {
return void 0 === i && (i = new n()), (i.x = t.x + t.radius * Math.cos(e)), (i.y = t.y + t.radius * Math.sin(e)), i;
};
},
function (t, e, i) {
var a = i(4);
t.exports = function (t, e) {
void 0 === e && (e = new a());
var i = 2 * Math.PI * Math.random(),
n = Math.random() + Math.random(),
s = 1 < n ? 2 - n : n,
r = s * Math.cos(i),
o = s * Math.sin(i);
return (e.x = t.x + r * t.radius), (e.y = t.y + o * t.radius), e;
};
},
function (t, e, i) {
var s = i(130),
r = i(4);
t.exports = function (t, e, i) {
if ((void 0 === i && (i = new r()), e <= 0 || 1 <= e)) return (i.x = t.x), (i.y = t.y), i;
var n = s(t) * e;
return (
0.5 < e
? (n -= t.width + t.height) <= t.width
? ((i.x = t.right - n), (i.y = t.bottom))
: ((i.x = t.x), (i.y = t.bottom - (n - t.width)))
: n <= t.width
? ((i.x = t.x + n), (i.y = t.y))
: ((i.x = t.right), (i.y = t.y + (n - t.width))),
i
);
};
},
function (t, e, i) {
var d = i(67),
f = i(4);
t.exports = function (t, e, i, n) {
void 0 === n && (n = []), !e && 0 < i && (e = d(t) / i);
for (var s = t.x1, r = t.y1, o = t.x2, a = t.y2, h = 0; h < e; h++) {
var l = h / e,
u = s + (o - s) * l,
c = r + (a - r) * l;
n.push(new f(u, c));
}
return n;
};
},
function (t, e, i) {
var n = i(4);
t.exports = function (t, e) {
void 0 === e && (e = new n());
var i = Math.random();
return (e.x = t.x1 + i * (t.x2 - t.x1)), (e.y = t.y1 + i * (t.y2 - t.y1)), e;
};
},
function (t, e, i) {
var n = i(4);
t.exports = function (t, e) {
return void 0 === e && (e = new n()), (e.x = t.x + Math.random() * t.width), (e.y = t.y + Math.random() * t.height), e;
};
},
function (t, e) {
var s = function (t) {
var e, i, n;
if ("object" != typeof t || null === t) return t;
for (n in ((e = Array.isArray(t) ? [] : {}), t)) (i = t[n]), (e[n] = s(i));
return e;
};
t.exports = s;
},
function (t, e) {
t.exports = function (t) {
var e = {
name: t.name,
type: t.type,
x: t.x,
y: t.y,
depth: t.depth,
scale: { x: t.scaleX, y: t.scaleY },
origin: { x: t.originX, y: t.originY },
flipX: t.flipX,
flipY: t.flipY,
rotation: t.rotation,
alpha: t.alpha,
visible: t.visible,
blendMode: t.blendMode,
textureKey: "",
frameKey: "",
data: {},
};
return t.texture && ((e.textureKey = t.texture.key), (e.frameKey = t.frame.name)), e;
};
},
function (t, e, i) {
var g = i(3);
t.exports = function (t, e, i, n, s, r, o, a) {
void 0 === a && (a = new g());
var h = Math.sin(s),
l = Math.cos(s),
u = l * r,
c = h * r,
d = -h * o,
f = l * o,
p = 1 / (u * f + d * -c);
return (a.x = f * p * t + -d * p * e + (n * d - i * f) * p), (a.y = u * p * e + -c * p * t + (-n * u + i * c) * p), a;
};
},
function (t, e) {
t.exports = function (t, e) {
void 0 === e && (e = 1);
for (var i = null, n = 0; n < e; n++) (i = t.shift()), t.push(i);
return i;
};
},
function (t, e) {
t.exports = function (t, e) {
void 0 === e && (e = 1);
for (var i = null, n = 0; n < e; n++) (i = t.pop()), t.unshift(i);
return i;
};
},
function (t, e, i) {
var s = i(4);
t.exports = function (t, e) {
void 0 === e && (e = new s());
var i = Math.random() * Math.PI * 2,
n = Math.sqrt(Math.random());
return (e.x = t.x + (n * Math.cos(i) * t.width) / 2), (e.y = t.y + (n * Math.sin(i) * t.height) / 2), e;
};
},
function (t, e, i) {
var h = i(4);
t.exports = function (t, e) {
void 0 === e && (e = new h());
var i = t.x2 - t.x1,
n = t.y2 - t.y1,
s = t.x3 - t.x1,
r = t.y3 - t.y1,
o = Math.random(),
a = Math.random();
return 1 <= o + a && ((o = 1 - o), (a = 1 - a)), (e.x = t.x1 + (i * o + s * a)), (e.y = t.y1 + (n * o + r * a)), e;
};
},
function (t, e) {
t.exports = function (t, e, i, n, s) {
var r = n + Math.atan2(t.y - i, t.x - e);
return (t.x = e + s * Math.cos(r)), (t.y = i + s * Math.sin(r)), t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return (t = Math.max(0, Math.min(1, (t - e) / (i - e)))) * t * t * (t * (6 * t - 15) + 10);
};
},
function (t, e) {
t.exports = function (t, e, i) {
return t <= e ? 0 : i <= t ? 1 : (t = (t - e) / (i - e)) * t * (3 - 2 * t);
};
},
function (t, e, i) {
var n = i(18),
s = i(0),
r = i(132),
o = i(318),
v = i(319),
y = i(6),
m = i(320),
a = new s({
initialize: function (t, e, i) {
(this.manager = t),
(this.key = e),
(this.type = "frame"),
(this.frames = this.getFrames(t.textureManager, y(i, "frames", []), y(i, "defaultTextureKey", null), y(i, "sortFrames", !0))),
(this.frameRate = y(i, "frameRate", null)),
(this.duration = y(i, "duration", null)),
this.msPerFrame,
(this.skipMissedFrames = y(i, "skipMissedFrames", !0)),
(this.delay = y(i, "delay", 0)),
(this.repeat = y(i, "repeat", 0)),
(this.repeatDelay = y(i, "repeatDelay", 0)),
(this.yoyo = y(i, "yoyo", !1)),
(this.showOnStart = y(i, "showOnStart", !1)),
(this.hideOnComplete = y(i, "hideOnComplete", !1)),
(this.paused = !1),
this.calculateDuration(this, this.getTotalFrames(), this.duration, this.frameRate),
this.manager.on && (this.manager.on(r.PAUSE_ALL, this.pause, this), this.manager.on(r.RESUME_ALL, this.resume, this));
},
getTotalFrames: function () {
return this.frames.length;
},
calculateDuration: function (t, e, i, n) {
null === i && null === n ? ((t.frameRate = 24), (t.duration = (24 / e) * 1e3)) : i && null === n ? ((t.duration = i), (t.frameRate = e / (i / 1e3))) : ((t.frameRate = n), (t.duration = (e / n) * 1e3)),
(t.msPerFrame = 1e3 / t.frameRate);
},
addFrame: function (t) {
return this.addFrameAt(this.frames.length, t);
},
addFrameAt: function (t, e) {
var i,
n,
s = this.getFrames(this.manager.textureManager, e);
return (
0 < s.length &&
(0 === t
? (this.frames = s.concat(this.frames))
: t === this.frames.length
? (this.frames = this.frames.concat(s))
: ((i = this.frames.slice(0, t)), (n = this.frames.slice(t)), (this.frames = i.concat(s, n))),
this.updateFrameSequence()),
this
);
},
checkFrame: function (t) {
return 0 <= t && t < this.frames.length;
},
getFirstTick: function (t) {
(t.accumulator = 0), (t.nextTick = t.msPerFrame + t.currentFrame.duration);
},
getFrameAt: function (t) {
return this.frames[t];
},
getFrames: function (t, e, i, n) {
void 0 === n && (n = !0);
var s,
r,
o,
a = [],
h = 1;
if (
("string" == typeof e &&
((r = e),
(o = t.get(r).getFrameNames()),
n && m(o),
(e = []),
o.forEach(function (t) {
e.push({ key: r, frame: t });
})),
!Array.isArray(e) || 0 === e.length)
)
return a;
for (g = 0; g < e.length; g++) {
var l,
u,
c,
d = e[g],
f = y(d, "key", i);
f && ((l = y(d, "frame", 0)), (u = t.getFrame(f, l)), ((c = new v(f, l, h, u)).duration = y(d, "duration", 0)), (c.isFirst = !s), s && ((s.nextFrame = c).prevFrame = s), a.push(c), (s = c), h++);
}
if (0 < a.length) {
(c.isLast = !0), (c.nextFrame = a[0]), (a[0].prevFrame = c);
for (var p = 1 / (a.length - 1), g = 0; g < a.length; g++) a[g].progress = g * p;
}
return a;
},
getNextTick: function (t) {
(t.accumulator -= t.nextTick), (t.nextTick = t.msPerFrame + t.currentFrame.duration);
},
getFrameByProgress: function (t) {
return (t = n(t, 0, 1)), o(t, this.frames, "progress");
},
nextFrame: function (t) {
var e = t.currentFrame;
e.isLast ? (t.yoyo ? this.handleYoyoFrame(t, !1) : 0 < t.repeatCounter ? (t.inReverse && t.forward ? (t.forward = !1) : this.repeatAnimation(t)) : t.complete()) : this.updateAndGetNextTick(t, e.nextFrame);
},
handleYoyoFrame: function (t, e) {
if (((e = e || !1), t.inReverse === !e && 0 < t.repeatCounter)) return (0 !== t.repeatDelay && !t.pendingRepeat) || (t.forward = e), void this.repeatAnimation(t);
var i;
t.inReverse === e || 0 !== t.repeatCounter ? ((i = (t.forward = e) ? t.currentFrame.nextFrame : t.currentFrame.prevFrame), this.updateAndGetNextTick(t, i)) : t.complete();
},
getLastFrame: function () {
return this.frames[this.frames.length - 1];
},
previousFrame: function (t) {
var e = t.currentFrame;
e.isFirst
? t.yoyo
? this.handleYoyoFrame(t, !0)
: 0 < t.repeatCounter
? ((t.inReverse && !t.forward) || (t.forward = !0), this.repeatAnimation(t))
: t.complete()
: this.updateAndGetNextTick(t, e.prevFrame);
},
updateAndGetNextTick: function (t, e) {
t.setCurrentFrame(e), this.getNextTick(t);
},
removeFrame: function (t) {
var e = this.frames.indexOf(t);
return -1 !== e && this.removeFrameAt(e), this;
},
removeFrameAt: function (t) {
return this.frames.splice(t, 1), this.updateFrameSequence(), this;
},
repeatAnimation: function (t) {
if (2 === t._pendingStop) {
if (0 === t._pendingStopValue) return t.stop();
t._pendingStopValue--;
}
0 < t.repeatDelay && !t.pendingRepeat
? ((t.pendingRepeat = !0), (t.accumulator -= t.nextTick), (t.nextTick += t.repeatDelay))
: (t.repeatCounter--, t.forward ? t.setCurrentFrame(t.currentFrame.nextFrame) : t.setCurrentFrame(t.currentFrame.prevFrame), t.isPlaying && (this.getNextTick(t), t.handleRepeat()));
},
toJSON: function () {
var e = {
key: this.key,
type: this.type,
frames: [],
frameRate: this.frameRate,
duration: this.duration,
skipMissedFrames: this.skipMissedFrames,
delay: this.delay,
repeat: this.repeat,
repeatDelay: this.repeatDelay,
yoyo: this.yoyo,
showOnStart: this.showOnStart,
hideOnComplete: this.hideOnComplete,
};
return (
this.frames.forEach(function (t) {
e.frames.push(t.toJSON());
}),
e
);
},
updateFrameSequence: function () {
for (var t, e = this.frames.length, i = 1 / (e - 1), n = 0; n < e; n++)
((t = this.frames[n]).index = n + 1),
(t.isFirst = !1),
(t.isLast = !1),
(t.progress = n * i),
0 === n
? ((t.isFirst = !0), 1 === e ? ((t.isLast = !0), ((t.nextFrame = t).prevFrame = t)) : ((t.isLast = !1), (t.prevFrame = this.frames[e - 1]), (t.nextFrame = this.frames[n + 1])))
: n === e - 1 && 1 < e
? ((t.isLast = !0), (t.prevFrame = this.frames[e - 2]), (t.nextFrame = this.frames[0]))
: 1 < e && ((t.prevFrame = this.frames[n - 1]), (t.nextFrame = this.frames[n + 1]));
return this;
},
pause: function () {
return (this.paused = !0), this;
},
resume: function () {
return (this.paused = !1), this;
},
destroy: function () {
this.manager.off && (this.manager.off(r.PAUSE_ALL, this.pause, this), this.manager.off(r.RESUME_ALL, this.resume, this)), this.manager.remove(this.key);
for (var t = 0; t < this.frames.length; t++) this.frames[t].destroy();
(this.frames = []), (this.manager = null);
},
});
t.exports = a;
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s;
if ((void 0 === e && (e = 0), void 0 === i && (i = " "), void 0 === n && (n = 3), e + 1 >= (t = t.toString()).length))
switch (n) {
case 1:
t = new Array(e + 1 - t.length).join(i) + t;
break;
case 3:
var r = Math.ceil((s = e - t.length) / 2);
t = new Array(s - r + 1).join(i) + t + new Array(r + 1).join(i);
break;
default:
t += new Array(e + 1 - t.length).join(i);
}
return t;
};
},
function (t, e, i) {
var n = i(327),
s = i(189),
r = i(331),
o = i(332);
t.exports = function (t) {
switch (typeof t) {
case "string":
return ("rgb" === t.substr(0, 3).toLowerCase() ? o : n)(t);
case "number":
return s(t);
case "object":
return r(t);
}
};
},
function (t, e, i) {
var a = i(103);
function h(t, e, i, n) {
var s = (t + 6 * e) % 6,
r = Math.min(s, 4 - s, 1);
return Math.round(255 * (n - n * i * Math.max(0, r)));
}
t.exports = function (t, e, i, n) {
void 0 === e && (e = 1), void 0 === i && (i = 1);
var s = h(5, t, e, i),
r = h(3, t, e, i),
o = h(1, t, e, i);
return n ? (n.setTo ? n.setTo(s, r, o, n.alpha, !1) : ((n.r = s), (n.g = r), (n.b = o), (n.color = a(s, r, o)), n)) : { r: s, g: r, b: o, color: a(s, r, o) };
};
},
function (t, e, i) {
var n = i(38),
s = i(330);
t.exports = function (t) {
var e = s(t);
return new n(e.r, e.g, e.b, e.a);
};
},
function (t, e) {
t.exports = function (t, e, i) {
return (t.x = e - t.width / 2), (t.y = i - t.height / 2), t;
};
},
function (t, e, i) {
var n = i(105),
r = i(136),
o = i(31),
a = { canvas: !1, canvasBitBltShift: null, file: !1, fileSystem: !1, getUserMedia: !0, littleEndian: !1, localStorage: !1, pointerLock: !1, support32bit: !1, vibration: !1, webGL: !1, worker: !1 };
t.exports = (function () {
if ("function" == typeof importScripts) return a;
a.canvas = !!window.CanvasRenderingContext2D;
try {
a.localStorage = !!localStorage.getItem;
} catch (t) {
a.localStorage = !1;
}
(a.file = !!(window.File && window.FileReader && window.FileList && window.Blob)), (a.fileSystem = !!window.requestFileSystem);
var t,
e,
i,
s = !1;
return (
(a.webGL = (function () {
if (window.WebGLRenderingContext)
try {
var t = o.createWebGL(this),
e = t.getContext("webgl") || t.getContext("experimental-webgl"),
i = o.create2D(this),
n = i.getContext("2d").createImageData(1, 1);
return (s = n.data instanceof Uint8ClampedArray), o.remove(t), o.remove(i), !!e;
} catch (t) {
return !1;
}
return !1;
})()),
(a.worker = !!window.Worker),
(a.pointerLock = "pointerLockElement" in document || "mozPointerLockElement" in document || "webkitPointerLockElement" in document),
(navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia),
(window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL),
(a.getUserMedia = a.getUserMedia && !!navigator.getUserMedia && !!window.URL),
r.firefox && r.firefoxVersion < 21 && (a.getUserMedia = !1),
!n.iOS && (r.ie || r.firefox || r.chrome) && (a.canvasBitBltShift = !0),
(r.safari || r.mobileSafari) && (a.canvasBitBltShift = !1),
(navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate),
navigator.vibrate && (a.vibration = !0),
"undefined" != typeof ArrayBuffer &&
"undefined" != typeof Uint8Array &&
"undefined" != typeof Uint32Array &&
(a.littleEndian = ((t = new ArrayBuffer(4)), (e = new Uint8Array(t)), (i = new Uint32Array(t)), (e[0] = 161), (e[1] = 178), (e[2] = 195), (e[3] = 212), 3569595041 === i[0] || (2712847316 !== i[0] && null))),
(a.support32bit = "undefined" != typeof ArrayBuffer && "undefined" != typeof Uint8ClampedArray && "undefined" != typeof Int32Array && null !== a.littleEndian && s),
a
);
})();
},
function (t, e) {
var i = "";
function n(t) {
for (var e = ["i", "webkitI", "msI", "mozI", "oI"], i = 0; i < e.length; i++) {
var n = e[i] + "mageSmoothingEnabled";
if (n in t) return n;
}
return null;
}
t.exports = {
disable: function (t) {
return "" === i && (i = n(t)), i && (t[i] = !1), t;
},
enable: function (t) {
return "" === i && (i = n(t)), i && (t[i] = !0), t;
},
getPrefix: n,
isEnabled: function (t) {
return null !== i ? t[i] : null;
},
};
},
function (t, e, i) {
var n = i(14),
s = i(17)(
!1,
(s = {
Angle: i(812),
Distance: i(821),
Easing: i(826),
Fuzzy: i(827),
Interpolation: i(830),
Pow2: i(835),
Snap: i(837),
RandomDataGenerator: i(839),
Average: i(840),
Bernstein: i(356),
Between: i(195),
CatmullRom: i(194),
CeilTo: i(841),
Clamp: i(18),
DegToRad: i(36),
Difference: i(842),
Euler: i(843),
Factorial: i(357),
FloatBetween: i(137),
FloorTo: i(844),
FromPercent: i(98),
GetSpeed: i(845),
IsEven: i(846),
IsEvenStrict: i(847),
Linear: i(135),
MaxAdd: i(848),
Median: i(849),
MinSub: i(850),
Percent: i(851),
RadToDeg: i(196),
RandomXY: i(852),
RandomXYZ: i(853),
RandomXYZW: i(854),
Rotate: i(362),
RotateAround: i(308),
RotateAroundDistance: i(182),
RotateTo: i(855),
RoundAwayFromZero: i(363),
RoundTo: i(856),
SinCosTableGenerator: i(857),
SmootherStep: i(183),
SmoothStep: i(184),
ToXY: i(858),
TransformXY: i(177),
Within: i(859),
Wrap: i(68),
Vector2: i(3),
Vector3: i(39),
Vector4: i(140),
Matrix3: i(364),
Matrix4: i(69),
Quaternion: i(365),
RotateVec3: i(860),
}),
n
);
t.exports = s;
},
function (t, e) {
t.exports = function (t, e, i, n, s) {
var r = 0.5 * (n - e),
o = 0.5 * (s - i),
a = t * t;
return (2 * i - 2 * n + r + o) * (t * a) + (-3 * i + 3 * n - 2 * r - o) * a + r * t + i;
};
},
function (t, e) {
t.exports = function (t, e) {
return Math.floor(Math.random() * (e - t + 1) + t);
};
},
function (t, e, i) {
var n = i(14);
t.exports = function (t) {
return t * n.RAD_TO_DEG;
};
},
function (t, e, i) {
t.exports = {
Global: ["game", "anims", "cache", "plugins", "registry", "scale", "sound", "textures", "renderer"],
CoreScene: ["EventEmitter", "CameraManager", "GameObjectCreator", "GameObjectFactory", "ScenePlugin", "DisplayList", "UpdateList"],
DefaultScene: ["Clock", "DataManagerPlugin", "InputPlugin", "Loader", "TweenManager", "LightsPlugin"],
};
},
function (t, e, i) {
var n = new (i(0))({
initialize: function () {
(this._matrix = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]), (this.alpha = 1), (this._dirty = !0), this._data;
},
set: function (t) {
return (this._matrix = t), (this._dirty = !0), this;
},
reset: function () {
var t = this._matrix;
return (
(t[0] = 1),
(t[1] = 0),
(t[2] = 0),
(t[3] = 0),
(t[4] = 0),
(t[5] = 0),
(t[6] = 1),
(t[7] = 0),
(t[8] = 0),
(t[9] = 0),
(t[10] = 0),
(t[11] = 0),
(t[12] = 1),
(t[13] = 0),
(t[14] = 0),
(t[15] = 0),
(t[16] = 0),
(t[17] = 0),
(t[18] = 1),
(t[19] = 0),
(this._dirty = !0),
this
);
},
getData: function () {
var t;
return this._dirty && (((t = new Float32Array(this._matrix))[4] /= 255), (t[9] /= 255), (t[14] /= 255), (t[19] /= 255), (this._data = t), (this._dirty = !1)), this._data;
},
brightness: function (t, e) {
return void 0 === t && (t = 0), void 0 === e && (e = !1), this.multiply([t, 0, 0, 0, 0, 0, t, 0, 0, 0, 0, 0, t, 0, 0, 0, 0, 0, 1, 0], e);
},
saturate: function (t, e) {
void 0 === t && (t = 0), void 0 === e && (e = !1);
var i = (2 * t) / 3 + 1,
n = -0.5 * (i - 1);
return this.multiply([i, n, n, 0, 0, n, i, n, 0, 0, n, n, i, 0, 0, 0, 0, 0, 1, 0], e);
},
desaturate: function (t) {
return void 0 === t && (t = !1), this.saturate(-1, t);
},
hue: function (t, e) {
void 0 === t && (t = 0), void 0 === e && (e = !1), (t = (t / 180) * Math.PI);
var i = Math.cos(t),
n = Math.sin(t);
return this.multiply(
[
0.213 + 0.787 * i + -0.213 * n,
0.715 + -0.715 * i + -0.715 * n,
0.072 + -0.072 * i + 0.928 * n,
0,
0,
0.213 + -0.213 * i + 0.143 * n,
0.715 + i * (1 - 0.715) + 0.14 * n,
0.072 + -0.072 * i + -0.283 * n,
0,
0,
0.213 + -0.213 * i + -0.787 * n,
0.715 + -0.715 * i + 0.715 * n,
0.072 + 0.928 * i + 0.072 * n,
0,
0,
0,
0,
0,
1,
0,
],
e
);
},
grayscale: function (t, e) {
return void 0 === t && (t = 1), void 0 === e && (e = !1), this.saturate(-t, e);
},
blackWhite: function (t) {
return void 0 === t && (t = !1), this.multiply([0.3, 0.6, 0.1, 0, 0, 0.3, 0.6, 0.1, 0, 0, 0.3, 0.6, 0.1, 0, 0, 0, 0, 0, 1, 0], t);
},
contrast: function (t, e) {
void 0 === t && (t = 0), void 0 === e && (e = !1);
var i = t + 1,
n = -0.5 * (i - 1);
return this.multiply([i, 0, 0, 0, n, 0, i, 0, 0, n, 0, 0, i, 0, n, 0, 0, 0, 1, 0], e);
},
negative: function (t) {
return void 0 === t && (t = !1), this.multiply([-1, 0, 0, 1, 0, 0, -1, 0, 1, 0, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0], t);
},
desaturateLuminance: function (t) {
return void 0 === t && (t = !1), this.multiply([0.2764723, 0.929708, 0.0938197, 0, -37.1, 0.2764723, 0.929708, 0.0938197, 0, -37.1, 0.2764723, 0.929708, 0.0938197, 0, -37.1, 0, 0, 0, 1, 0], t);
},
sepia: function (t) {
return void 0 === t && (t = !1), this.multiply([0.393, 0.7689999, 0.18899999, 0, 0, 0.349, 0.6859999, 0.16799999, 0, 0, 0.272, 0.5339999, 0.13099999, 0, 0, 0, 0, 0, 1, 0], t);
},
night: function (t, e) {
return void 0 === t && (t = 0.1), void 0 === e && (e = !1), this.multiply([-2 * t, -t, 0, 0, 0, -t, 0, t, 0, 0, 0, t, 2 * t, 0, 0, 0, 0, 0, 1, 0], e);
},
lsd: function (t) {
return void 0 === t && (t = !1), this.multiply([2, -0.4, 0.5, 0, 0, -0.5, 2, -0.4, 0, 0, -0.4, -0.5, 3, 0, 0, 0, 0, 0, 1, 0], t);
},
brown: function (t) {
return (
void 0 === t && (t = !1),
this.multiply(
[
0.5997023498159715,
0.34553243048391263,
-0.2708298674538042,
0,
47.43192855600873,
-0.037703249837783157,
0.8609577587992641,
0.15059552388459913,
0,
-36.96841498319127,
0.24113635128153335,
-0.07441037908422492,
0.44972182064877153,
0,
-7.562075277591283,
0,
0,
0,
1,
0,
],
t
)
);
},
vintagePinhole: function (t) {
return (
void 0 === t && (t = !1),
this.multiply(
[
0.6279345635605994,
0.3202183420819367,
-0.03965408211312453,
0,
9.651285835294123,
0.02578397704808868,
0.6441188644374771,
0.03259127616149294,
0,
7.462829176470591,
0.0466055556782719,
-0.0851232987247891,
0.5241648018700465,
0,
5.159190588235296,
0,
0,
0,
1,
0,
],
t
)
);
},
kodachrome: function (t) {
return (
void 0 === t && (t = !1),
this.multiply(
[
1.1285582396593525,
-0.3967382283601348,
-0.03992559172921793,
0,
63.72958762196502,
-0.16404339962244616,
1.0835251566291304,
-0.05498805115633132,
0,
24.732407896706203,
-0.16786010706155763,
-0.5603416277695248,
1.6014850761964943,
0,
35.62982807460946,
0,
0,
0,
1,
0,
],
t
)
);
},
technicolor: function (t) {
return (
void 0 === t && (t = !1),
this.multiply(
[
1.9125277891456083,
-0.8545344976951645,
-0.09155508482755585,
0,
11.793603434377337,
-0.3087833385928097,
1.7658908555458428,
-0.10601743074722245,
0,
-70.35205161461398,
-0.231103377548616,
-0.7501899197440212,
1.847597816108189,
0,
30.950940869491138,
0,
0,
0,
1,
0,
],
t
)
);
},
polaroid: function (t) {
return void 0 === t && (t = !1), this.multiply([1.438, -0.062, -0.062, 0, 0, -0.122, 1.378, -0.122, 0, 0, -0.016, -0.016, 1.483, 0, 0, 0, 0, 0, 1, 0], t);
},
shiftToBGR: function (t) {
return void 0 === t && (t = !1), this.multiply([0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0], t);
},
multiply: function (t, e) {
e || this.reset();
for (var i = this._matrix, n = [], s = 0; s < 20; s++) n[s] = i[s];
return (
(i[0] = n[0] * t[0] + n[1] * t[5] + n[2] * t[10] + n[3] * t[15]),
(i[1] = n[0] * t[1] + n[1] * t[6] + n[2] * t[11] + n[3] * t[16]),
(i[2] = n[0] * t[2] + n[1] * t[7] + n[2] * t[12] + n[3] * t[17]),
(i[3] = n[0] * t[3] + n[1] * t[8] + n[2] * t[13] + n[3] * t[18]),
(i[4] = n[0] * t[4] + n[1] * t[9] + n[2] * t[14] + n[3] * t[19] + n[4]),
(i[5] = n[5] * t[0] + n[6] * t[5] + n[7] * t[10] + n[8] * t[15]),
(i[6] = n[5] * t[1] + n[6] * t[6] + n[7] * t[11] + n[8] * t[16]),
(i[7] = n[5] * t[2] + n[6] * t[7] + n[7] * t[12] + n[8] * t[17]),
(i[8] = n[5] * t[3] + n[6] * t[8] + n[7] * t[13] + n[8] * t[18]),
(i[9] = n[5] * t[4] + n[6] * t[9] + n[7] * t[14] + n[8] * t[19] + n[9]),
(i[10] = n[10] * t[0] + n[11] * t[5] + n[12] * t[10] + n[13] * t[15]),
(i[11] = n[10] * t[1] + n[11] * t[6] + n[12] * t[11] + n[13] * t[16]),
(i[12] = n[10] * t[2] + n[11] * t[7] + n[12] * t[12] + n[13] * t[17]),
(i[13] = n[10] * t[3] + n[11] * t[8] + n[12] * t[13] + n[13] * t[18]),
(i[14] = n[10] * t[4] + n[11] * t[9] + n[12] * t[14] + n[13] * t[19] + n[14]),
(i[15] = n[15] * t[0] + n[16] * t[5] + n[17] * t[10] + n[18] * t[15]),
(i[16] = n[15] * t[1] + n[16] * t[6] + n[17] * t[11] + n[18] * t[16]),
(i[17] = n[15] * t[2] + n[16] * t[7] + n[17] * t[12] + n[18] * t[17]),
(i[18] = n[15] * t[3] + n[16] * t[8] + n[17] * t[13] + n[18] * t[18]),
(i[19] = n[15] * t[4] + n[16] * t[9] + n[17] * t[14] + n[18] * t[19] + n[19]),
(this._dirty = !0),
this
);
},
});
t.exports = n;
},
function (t, e, i) {
var u = i(10),
c = i(14);
t.exports = function (t, e) {
if ((void 0 === e && (e = new u()), 0 === t.length)) return e;
for (var i, n, s, r = Number.MAX_VALUE, o = Number.MAX_VALUE, a = c.MIN_SAFE_INTEGER, h = c.MIN_SAFE_INTEGER, l = 0; l < t.length; l++)
(i = t[l]), (s = Array.isArray(i) ? ((n = i[0]), i[1]) : ((n = i.x), i.y)), (r = Math.min(r, n)), (o = Math.min(o, s)), (a = Math.max(a, n)), (h = Math.max(h, s));
return (e.x = r), (e.y = o), (e.width = a - r), (e.height = h - o), e;
};
},
function (t, e, i) {
var n = i(0),
s = i(1),
r = new n({
initialize: function (t, e, i) {
(this._rgb = [0, 0, 0]), (this.onChangeCallback = s), (this.dirty = !1), this.set(t, e, i);
},
set: function (t, e, i) {
return void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 0), (this._rgb = [t, e, i]), this.onChange(), this;
},
equals: function (t, e, i) {
var n = this._rgb;
return n.r === t && n.g === e && n.b === i;
},
onChange: function () {
this.dirty = !0;
var t = this._rgb;
this.onChangeCallback.call(this, t[0], t[1], t[2]);
},
r: {
get: function () {
return this._rgb[0];
},
set: function (t) {
(this._rgb[0] = t), this.onChange();
},
},
g: {
get: function () {
return this._rgb[1];
},
set: function (t) {
(this._rgb[1] = t), this.onChange();
},
},
b: {
get: function () {
return this._rgb[2];
},
set: function (t) {
(this._rgb[2] = t), this.onChange();
},
},
destroy: function () {
this.onChangeCallback = null;
},
});
t.exports = r;
},
function (t, e, i) {
var n = { CENTER: i(403), ORIENTATION: i(404), SCALE_MODE: i(405), ZOOM: i(406) };
t.exports = n;
},
function (t, e) {
t.exports = function (t) {
t.parentNode && t.parentNode.removeChild(t);
};
},
function (t, e) {
t.exports = { MOUSE_DOWN: 0, MOUSE_MOVE: 1, MOUSE_UP: 2, TOUCH_START: 3, TOUCH_MOVE: 4, TOUCH_END: 5, POINTER_LOCK_CHANGE: 6, TOUCH_CANCEL: 7, MOUSE_WHEEL: 8 };
},
function (t, e, i) {
var n = i(0),
s = i(144),
r = i(197),
o = i(20),
a = i(419),
h = i(420),
l = i(33),
u = i(1),
c = i(421),
d = new n({
initialize: function (t, e) {
(this.scene = t),
this.game,
this.renderer,
(this.config = e),
(this.settings = c.create(e)),
this.canvas,
this.context,
this.anims,
this.cache,
this.plugins,
this.registry,
this.scale,
this.sound,
this.textures,
this.add,
this.cameras,
this.displayList,
this.events,
this.make,
this.scenePlugin,
this.updateList,
(this.sceneUpdate = u);
},
init: function (t) {
(this.settings.status = s.INIT), (this.sceneUpdate = u), (this.game = t), (this.renderer = t.renderer), (this.canvas = t.canvas), (this.context = t.context);
var e = t.plugins;
(this.plugins = e).addToScene(this, r.Global, [r.CoreScene, h(this), a(this)]), this.events.emit(o.BOOT, this), (this.settings.isBooted = !0);
},
step: function (t, e) {
var i = this.events;
i.emit(o.PRE_UPDATE, t, e), i.emit(o.UPDATE, t, e), this.sceneUpdate.call(this.scene, t, e), i.emit(o.POST_UPDATE, t, e);
},
render: function (t) {
var e = this.displayList;
e.depthSort(), this.events.emit(o.PRE_RENDER, t), this.cameras.render(t, e), this.events.emit(o.RENDER, t);
},
queueDepthSort: function () {
this.displayList.queueDepthSort();
},
depthSort: function () {
this.displayList.depthSort();
},
pause: function (t) {
var e = this.events,
i = this.settings;
return this.settings.active && ((i.status = s.PAUSED), (i.active = !1), e.emit(o.PAUSE, this, t)), this;
},
resume: function (t) {
var e = this.events,
i = this.settings;
return this.settings.active || ((i.status = s.RUNNING), (i.active = !0), e.emit(o.RESUME, this, t)), this;
},
sleep: function (t) {
var e = this.events,
i = this.settings;
return (i.status = s.SLEEPING), (i.active = !1), (i.visible = !1), e.emit(o.SLEEP, this, t), this;
},
wake: function (t) {
var e = this.events,
i = this.settings;
return (i.status = s.RUNNING), (i.active = !0), (i.visible = !0), e.emit(o.WAKE, this, t), i.isTransition && e.emit(o.TRANSITION_WAKE, i.transitionFrom, i.transitionDuration), this;
},
getData: function () {
return this.settings.data;
},
isSleeping: function () {
return this.settings.status === s.SLEEPING;
},
isActive: function () {
return this.settings.status === s.RUNNING;
},
isPaused: function () {
return this.settings.status === s.PAUSED;
},
isTransitioning: function () {
return this.settings.isTransition || null !== this.scenePlugin._target;
},
isTransitionOut: function () {
return null !== this.scenePlugin._target && 0 < this.scenePlugin._duration;
},
isTransitionIn: function () {
return this.settings.isTransition;
},
isVisible: function () {
return this.settings.visible;
},
setVisible: function (t) {
return (this.settings.visible = t), this;
},
setActive: function (t, e) {
return t ? this.resume(e) : this.pause(e);
},
start: function (t) {
var e = this.events,
i = this.settings;
t && (i.data = t), (i.status = s.START), (i.active = !0), (i.visible = !0), e.emit(o.START, this), e.emit(o.READY, this, t);
},
shutdown: function (t) {
var e = this.events,
i = this.settings;
e.off(o.TRANSITION_INIT),
e.off(o.TRANSITION_START),
e.off(o.TRANSITION_COMPLETE),
e.off(o.TRANSITION_OUT),
(i.status = s.SHUTDOWN),
(i.active = !1),
(i.visible = !1),
this.renderer === l.WEBGL && this.renderer.resetTextures(!0),
e.emit(o.SHUTDOWN, this, t);
},
destroy: function () {
var t = this.events,
e = this.settings;
(e.status = s.DESTROYED), (e.active = !1), (e.visible = !1), t.emit(o.DESTROY, this), t.removeAllListeners();
for (var i = ["scene", "game", "anims", "cache", "plugins", "registry", "sound", "textures", "add", "camera", "displayList", "events", "make", "scenePlugin", "updateList"], n = 0; n < i.length; n++)
this[i[n]] = null;
},
});
t.exports = d;
},
function (t, e) {
t.exports = function (t) {
return t && t[0].toUpperCase() + t.slice(1);
};
},
function (t, e, i) {
var n = i(33),
s = i(0),
a = i(109),
o = i(424),
r = new s({
initialize: function (t, e, i, n, s) {
Array.isArray(i) || (i = [i]), (this.manager = t), (this.key = e), (this.source = []), (this.dataSource = []), (this.frames = {}), (this.customData = {}), (this.firstFrame = "__BASE");
for (var r = (this.frameTotal = 0); r < i.length; r++) this.source.push(new o(this, i[r], n, s));
},
add: function (t, e, i, n, s, r) {
if (this.has(t)) return null;
var o = new a(this, t, e, i, n, s, r);
return (this.frames[t] = o), "__BASE" === this.firstFrame && (this.firstFrame = t), this.frameTotal++, o;
},
remove: function (t) {
return !!this.has(t) && (this.get(t).destroy(), delete this.frames[t], !0);
},
has: function (t) {
return this.frames[t];
},
get: function (t) {
t = t || this.firstFrame;
var e = this.frames[t];
return e || (e = this.frames[this.firstFrame]), e;
},
getTextureSourceIndex: function (t) {
for (var e = 0; e < this.source.length; e++) if (this.source[e] === t) return e;
return -1;
},
getFramesFromTextureSource: function (t, e) {
void 0 === e && (e = !1);
var i,
n = [];
for (var s in this.frames) ("__BASE" === s && !e) || ((i = this.frames[s]).sourceIndex === t && n.push(i));
return n;
},
getFrameNames: function (t) {
void 0 === t && (t = !1);
var e,
i = Object.keys(this.frames);
return t || (-1 !== (e = i.indexOf("__BASE")) && i.splice(e, 1)), i;
},
getSourceImage: function (t) {
(null != t && 1 !== this.frameTotal) || (t = "__BASE");
var e = this.frames[t];
return e ? e.source.image : this.frames.__BASE.source.image;
},
getDataSourceImage: function (t) {
(null != t && 1 !== this.frameTotal) || (t = "__BASE");
var e = this.frames[t],
i = e ? e.sourceIndex : this.frames.__BASE.sourceIndex;
return this.dataSource[i].image;
},
setDataSource: function (t) {
Array.isArray(t) || (t = [t]);
for (var e = 0; e < t.length; e++) {
var i = this.source[e];
this.dataSource.push(new o(this, t[e], i.width, i.height));
}
},
setFilter: function (t) {
for (var e = 0; e < this.source.length; e++) this.source[e].setFilter(t);
for (e = 0; e < this.dataSource.length; e++) this.dataSource[e].setFilter(t);
},
destroy: function () {
for (var t = 0; t < this.source.length; t++) this.source[t].destroy();
for (t = 0; t < this.dataSource.length; t++) this.dataSource[t].destroy();
for (var e in this.frames) this.frames[e].destroy();
(this.source = []), (this.dataSource = []), (this.frames = {}), this.manager.removeKey(this.key);
var i = this.manager.game.renderer;
i && i.type === n.WEBGL && i.resetTextures(!0), (this.manager = null);
},
});
t.exports = r;
},
function (t, e, i) {
var h = i(78);
t.exports = function (t, e, i, n, s) {
void 0 === n && (n = 0), void 0 === s && (s = t.length);
var r = [];
if (h(t, n, s))
for (var o = n; o < s; o++) {
var a = t[o];
(!e || (e && void 0 === i && a.hasOwnProperty(e)) || (e && void 0 !== i && a[e] === i)) && r.push(a);
}
return r;
};
},
function (t, e, i) {
t.exports = {
Matrix: i(1013),
Add: i(1021),
AddAt: i(1022),
BringToTop: i(1023),
CountAllMatching: i(1024),
Each: i(1025),
EachInRange: i(1026),
FindClosestInSorted: i(318),
GetAll: i(207),
GetFirst: i(428),
GetRandom: i(210),
MoveDown: i(1027),
MoveTo: i(1028),
MoveUp: i(1029),
MoveAbove: i(1030),
MoveBelow: i(1031),
NumberArray: i(322),
NumberArrayStep: i(1032),
QuickSelect: i(436),
Range: i(437),
Remove: i(93),
RemoveAt: i(1033),
RemoveBetween: i(1034),
RemoveRandomElement: i(1035),
Replace: i(1036),
RotateLeft: i(178),
RotateRight: i(179),
SafeRange: i(78),
SendToBack: i(1037),
SetAll: i(1038),
Shuffle: i(131),
SortByDigits: i(320),
SpliceOne: i(74),
StableSort: i(79),
Swap: i(1039),
};
},
function (t, e) {
t.exports = function (t) {
if (!Array.isArray(t) || t.length < 2 || !Array.isArray(t[0])) return !1;
for (var e = t[0].length, i = 1; i < t.length; i++) if (t[i].length !== e) return !1;
return !0;
};
},
function (t, e) {
t.exports = function (t, e, i) {
void 0 === e && (e = 0), void 0 === i && (i = t.length);
var n = e + Math.floor(Math.random() * i);
return void 0 === t[n] ? null : t[n];
};
},
function (t, e, i) {
var n = i(0),
s = i(9),
r = i(438),
o = new n({
Extends: s,
initialize: function () {
s.call(this), (this._pending = []), (this._active = []), (this._destroy = []), (this._toProcess = 0), (this.checkQueue = !1);
},
add: function (t) {
return this._pending.push(t), this._toProcess++, t;
},
remove: function (t) {
return this._destroy.push(t), this._toProcess++, t;
},
removeAll: function () {
for (var t = this._active, e = this._destroy, i = t.length; i--; ) e.push(t[i]), this._toProcess++;
return this;
},
update: function () {
if (0 === this._toProcess) return this._active;
for (var t, e = this._destroy, i = this._active, n = 0; n < e.length; n++) {
t = e[n];
var s = i.indexOf(t);
-1 !== s && (i.splice(s, 1), this.emit(r.PROCESS_QUEUE_REMOVE, t));
}
for (e.length = 0, e = this._pending, n = 0; n < e.length; n++) (t = e[n]), (!this.checkQueue || (this.checkQueue && -1 === i.indexOf(t))) && (i.push(t), this.emit(r.PROCESS_QUEUE_ADD, t));
return (e.length = 0), (this._toProcess = 0), i;
},
getActive: function () {
return this._active;
},
length: {
get: function () {
return this._active.length;
},
},
destroy: function () {
(this._toProcess = 0), (this._pending = []), (this._active = []), (this._destroy = []);
},
});
t.exports = o;
},
function (t, e) {
function D(t, e) {
return parseInt(t.getAttribute(e), 10);
}
t.exports = function (t, e, i, n, s) {
void 0 === i && (i = 0), void 0 === n && (n = 0);
var r = e.cutX,
o = e.cutY,
a = e.source.width,
h = e.source.height,
l = e.sourceIndex,
u = {},
c = t.getElementsByTagName("info")[0],
d = t.getElementsByTagName("common")[0];
(u.font = c.getAttribute("face")), (u.size = D(c, "size")), (u.lineHeight = D(d, "lineHeight") + n), (u.chars = {});
var f,
p,
g = t.getElementsByTagName("char"),
v = void 0 !== e && e.trimmed;
v && ((f = e.height), (p = e.width));
for (var y = 0; y < g.length; y++) {
var m = g[y],
x = D(m, "id"),
b = String.fromCharCode(x),
w = D(m, "x"),
T = D(m, "y"),
S = D(m, "width"),
_ = D(m, "height");
v && (w < p && (p = w), T < f && (f = T)), v && 0 !== f && 0 !== p && ((w -= e.x), (T -= e.y));
var E,
P = (r + w) / a,
A = (o + T) / h,
M = (r + w + S) / a,
C = (o + T + _) / h;
(u.chars[x] = {
x: w,
y: T,
width: S,
height: _,
centerX: Math.floor(S / 2),
centerY: Math.floor(_ / 2),
xOffset: D(m, "xoffset"),
yOffset: D(m, "yoffset"),
xAdvance: D(m, "xadvance") + i,
data: {},
kerning: {},
u0: P,
v0: A,
u1: M,
v1: C,
}),
!s || 0 === S || 0 === _ || ((E = s.add(b, l, w, T, S, _)) && E.setUVs(S, _, P, A, M, C));
}
var O = t.getElementsByTagName("kerning");
for (y = 0; y < O.length; y++) {
var k = O[y],
R = D(k, "first"),
L = D(k, "second"),
I = D(k, "amount");
u.chars[L].kerning[R] = I;
}
return u;
};
},
function (t, e, i) {
var n = i(1049),
o = i(440),
s = i(0),
r = i(11),
a = i(109),
h = i(15),
l = i(110),
u = new s({
Extends: h,
Mixins: [r.Alpha, r.BlendMode, r.Depth, r.Mask, r.Pipeline, r.ScrollFactor, r.Size, r.Texture, r.Transform, r.Visible, n],
initialize: function (t, e, i, n, s) {
h.call(this, t, "Blitter"), this.setTexture(n, s), this.setPosition(e, i), this.initPipeline(), (this.children = new l()), (this.renderList = []), (this.dirty = !1);
},
create: function (t, e, i, n, s) {
void 0 === n && (n = !0), void 0 === s && (s = this.children.length), void 0 === i ? (i = this.frame) : i instanceof a || (i = this.texture.get(i));
var r = new o(this, t, e, i, n);
return this.children.addAt(r, s, !1), (this.dirty = !0), r;
},
createFromCallback: function (t, e, i, n) {
for (var s = this.createMultiple(e, i, n), r = 0; r < s.length; r++) {
var o = s[r];
t.call(this, o, r);
}
return s;
},
createMultiple: function (i, t, n) {
void 0 === t && (t = this.frame.name), void 0 === n && (n = !0), Array.isArray(t) || (t = [t]);
var s = [],
r = this;
return (
t.forEach(function (t) {
for (var e = 0; e < i; e++) s.push(r.create(0, 0, t, n));
}),
s
);
},
childCanRender: function (t) {
return t.visible && 0 < t.alpha;
},
getRenderList: function () {
return this.dirty && ((this.renderList = this.children.list.filter(this.childCanRender, this)), (this.dirty = !1)), this.renderList;
},
clear: function () {
this.children.removeAll(), (this.dirty = !0);
},
preDestroy: function () {
this.children.destroy(), (this.renderList = []);
},
});
t.exports = u;
},
function (t, e, i) {
var r = i(208),
s = i(35),
n = i(0),
o = i(11),
a = i(75),
h = i(15),
l = i(10),
u = i(1052),
c = i(441),
d = i(3),
f = new n({
Extends: h,
Mixins: [o.AlphaSingle, o.BlendMode, o.ComputedSize, o.Depth, o.Mask, o.Pipeline, o.Transform, o.Visible, u],
initialize: function (t, e, i, n) {
h.call(this, t, "Container"),
(this.list = []),
(this.exclusive = !0),
(this.maxSize = -1),
(this.position = 0),
(this.localTransform = new o.TransformMatrix()),
(this.tempTransformMatrix = new o.TransformMatrix()),
(this._sortKey = ""),
(this._sysEvents = t.sys.events),
(this.scrollFactorX = 1),
(this.scrollFactorY = 1),
this.initPipeline(),
this.setPosition(e, i),
this.clearAlpha(),
this.setBlendMode(s.SKIP_CHECK),
n && this.add(n);
},
originX: {
get: function () {
return 0.5;
},
},
originY: {
get: function () {
return 0.5;
},
},
displayOriginX: {
get: function () {
return 0.5 * this.width;
},
},
displayOriginY: {
get: function () {
return 0.5 * this.height;
},
},
setExclusive: function (t) {
return void 0 === t && (t = !0), (this.exclusive = t), this;
},
getBounds: function (t) {
var e;
if (
(void 0 === t && (t = new l()),
t.setTo(this.x, this.y, 0, 0),
this.parentContainer && ((e = this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x, this.y)), t.setTo(e.x, e.y, 0, 0)),
0 < this.list.length)
) {
var i = this.list,
n = new l(),
s = !1;
t.setEmpty();
for (var r = 0; r < i.length; r++) {
var o = i[r];
o.getBounds && (o.getBounds(n), s ? c(n, t, t) : (t.setTo(n.x, n.y, n.width, n.height), (s = !0)));
}
}
return t;
},
addHandler: function (t) {
t.once(a.DESTROY, this.remove, this), this.exclusive && (t.parentContainer && t.parentContainer.remove(t), t.removeFromDisplayList(), (t.parentContainer = this));
},
removeHandler: function (t) {
t.off(a.DESTROY, this.remove), this.exclusive && ((t.parentContainer = null), t.addToDisplayList());
},
pointToContainer: function (t, e) {
void 0 === e && (e = new d()), this.parentContainer ? this.parentContainer.pointToContainer(t, e) : (e = new d(t.x, t.y));
var i = this.tempTransformMatrix;
return i.applyITRS(this.x, this.y, this.rotation, this.scaleX, this.scaleY), i.invert(), i.transformPoint(t.x, t.y, e), e;
},
getBoundsTransformMatrix: function () {
return this.getWorldTransformMatrix(this.tempTransformMatrix, this.localTransform);
},
add: function (t) {
return r.Add(this.list, t, this.maxSize, this.addHandler, this), this;
},
addAt: function (t, e) {
return r.AddAt(this.list, t, e, this.maxSize, this.addHandler, this), this;
},
getAt: function (t) {
return this.list[t];
},
getIndex: function (t) {
return this.list.indexOf(t);
},
sort: function (i, t) {
return (
i &&
(void 0 === t &&
(t = function (t, e) {
return t[i] - e[i];
}),
r.StableSort(this.list, t)),
this
);
},
getByName: function (t) {
return r.GetFirst(this.list, "name", t);
},
getRandom: function (t, e) {
return r.GetRandom(this.list, t, e);
},
getFirst: function (t, e, i, n) {
return r.GetFirst(this.list, t, e, i, n);
},
getAll: function (t, e, i, n) {
return r.GetAll(this.list, t, e, i, n);
},
count: function (t, e, i, n) {
return r.CountAllMatching(this.list, t, e, i, n);
},
swap: function (t, e) {
return r.Swap(this.list, t, e), this;
},
moveTo: function (t, e) {
return r.MoveTo(this.list, t, e), this;
},
moveAbove: function (t, e) {
return r.MoveAbove(this.list, t, e), this;
},
moveBelow: function (t, e) {
return r.MoveBelow(this.list, t, e), this;
},
remove: function (t, e) {
var i = r.Remove(this.list, t, this.removeHandler, this);
if (e && i) {
Array.isArray(i) || (i = [i]);
for (var n = 0; n < i.length; n++) i[n].destroy();
}
return this;
},
removeAt: function (t, e) {
var i = r.RemoveAt(this.list, t, this.removeHandler, this);
return e && i && i.destroy(), this;
},
removeBetween: function (t, e, i) {
var n = r.RemoveBetween(this.list, t, e, this.removeHandler, this);
if (i) for (var s = 0; s < n.length; s++) n[s].destroy();
return this;
},
removeAll: function (t) {
var e = r.RemoveBetween(this.list, 0, this.list.length, this.removeHandler, this);
if (t) for (var i = 0; i < e.length; i++) e[i].destroy();
return this;
},
bringToTop: function (t) {
return r.BringToTop(this.list, t), this;
},
sendToBack: function (t) {
return r.SendToBack(this.list, t), this;
},
moveUp: function (t) {
return r.MoveUp(this.list, t), this;
},
moveDown: function (t) {
return r.MoveDown(this.list, t), this;
},
reverse: function () {
return this.list.reverse(), this;
},
shuffle: function () {
return r.Shuffle(this.list), this;
},
replace: function (t, e, i) {
return r.Replace(this.list, t, e) && (this.addHandler(e), this.removeHandler(t), i && t.destroy()), this;
},
exists: function (t) {
return -1 < this.list.indexOf(t);
},
setAll: function (t, e, i, n) {
return r.SetAll(this.list, t, e, i, n), this;
},
each: function (t, e) {
for (var i = [null], n = this.list.slice(), s = n.length, r = 2; r < arguments.length; r++) i.push(arguments[r]);
for (r = 0; r < s; r++) (i[0] = n[r]), t.apply(e, i);
return this;
},
iterate: function (t, e) {
for (var i = [null], n = 2; n < arguments.length; n++) i.push(arguments[n]);
for (n = 0; n < this.list.length; n++) (i[0] = this.list[n]), t.apply(e, i);
return this;
},
setScrollFactor: function (t, e, i) {
return void 0 === e && (e = t), void 0 === i && (i = !1), (this.scrollFactorX = t), (this.scrollFactorY = e), i && (r.SetAll(this.list, "scrollFactorX", t), r.SetAll(this.list, "scrollFactorY", e)), this;
},
length: {
get: function () {
return this.list.length;
},
},
first: {
get: function () {
return (this.position = 0) < this.list.length ? this.list[0] : null;
},
},
last: {
get: function () {
return 0 < this.list.length ? ((this.position = this.list.length - 1), this.list[this.position]) : null;
},
},
next: {
get: function () {
return this.position < this.list.length ? (this.position++, this.list[this.position]) : null;
},
},
previous: {
get: function () {
return 0 < this.position ? (this.position--, this.list[this.position]) : null;
},
},
preDestroy: function () {
this.removeAll(!!this.exclusive), this.localTransform.destroy(), this.tempTransformMatrix.destroy(), (this.list = []);
},
});
t.exports = f;
},
function (t, e, i) {
var a = i(148),
n = i(0),
s = i(1057),
r = new n({
Extends: a,
Mixins: [s],
initialize: function (t, e, i, n, s, r, o) {
a.call(this, t, e, i, n, s, r, o),
(this.type = "DynamicBitmapText"),
(this.scrollX = 0),
(this.scrollY = 0),
(this.cropWidth = 0),
(this.cropHeight = 0),
this.displayCallback,
(this.callbackData = { parent: this, color: 0, tint: { topLeft: 0, topRight: 0, bottomLeft: 0, bottomRight: 0 }, index: 0, charCode: 0, x: 0, y: 0, scale: 0, rotation: 0, data: 0 });
},
setSize: function (t, e) {
return (this.cropWidth = t), (this.cropHeight = e), this;
},
setDisplayCallback: function (t) {
return (this.displayCallback = t), this;
},
setScrollX: function (t) {
return (this.scrollX = t), this;
},
setScrollY: function (t) {
return (this.scrollY = t), this;
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(133),
s = i(0),
h = i(217),
r = i(303),
o = i(304),
a = i(305),
l = i(309),
u = i(167),
c = i(312),
d = i(313),
f = i(314),
p = i(111),
g = i(15),
v = i(2),
y = i(6),
m = i(14),
x = i(1063),
b = new s({
Extends: g,
Mixins: [r, o, a, l, u, d, f, c, x],
initialize: function (t, e) {
var i = y(e, "x", 0),
n = y(e, "y", 0);
g.call(this, t, "Graphics"),
this.setPosition(i, n),
this.initPipeline(),
(this.displayOriginX = 0),
(this.displayOriginY = 0),
(this.commandBuffer = []),
(this.defaultFillColor = -1),
(this.defaultFillAlpha = 1),
(this.defaultStrokeWidth = 1),
(this.defaultStrokeColor = -1),
(this.defaultStrokeAlpha = 1),
(this._lineWidth = 1),
this.setDefaultStyles(e);
},
setDefaultStyles: function (t) {
return (
y(t, "lineStyle", null) &&
((this.defaultStrokeWidth = y(t, "lineStyle.width", 1)),
(this.defaultStrokeColor = y(t, "lineStyle.color", 16777215)),
(this.defaultStrokeAlpha = y(t, "lineStyle.alpha", 1)),
this.lineStyle(this.defaultStrokeWidth, this.defaultStrokeColor, this.defaultStrokeAlpha)),
y(t, "fillStyle", null) &&
((this.defaultFillColor = y(t, "fillStyle.color", 16777215)), (this.defaultFillAlpha = y(t, "fillStyle.alpha", 1)), this.fillStyle(this.defaultFillColor, this.defaultFillAlpha)),
this
);
},
lineStyle: function (t, e, i) {
return void 0 === i && (i = 1), this.commandBuffer.push(h.LINE_STYLE, t, e, i), (this._lineWidth = t), this;
},
fillStyle: function (t, e) {
return void 0 === e && (e = 1), this.commandBuffer.push(h.FILL_STYLE, t, e), this;
},
fillGradientStyle: function (t, e, i, n, s, r, o, a) {
return void 0 === s && (s = 1), void 0 === r && (r = s), void 0 === o && (o = s), void 0 === a && (a = s), this.commandBuffer.push(h.GRADIENT_FILL_STYLE, s, r, o, a, t, e, i, n), this;
},
lineGradientStyle: function (t, e, i, n, s, r) {
return void 0 === r && (r = 1), this.commandBuffer.push(h.GRADIENT_LINE_STYLE, t, r, e, i, n, s), this;
},
beginPath: function () {
return this.commandBuffer.push(h.BEGIN_PATH), this;
},
closePath: function () {
return this.commandBuffer.push(h.CLOSE_PATH), this;
},
fillPath: function () {
return this.commandBuffer.push(h.FILL_PATH), this;
},
fill: function () {
return this.commandBuffer.push(h.FILL_PATH), this;
},
strokePath: function () {
return this.commandBuffer.push(h.STROKE_PATH), this;
},
stroke: function () {
return this.commandBuffer.push(h.STROKE_PATH), this;
},
fillCircleShape: function (t) {
return this.fillCircle(t.x, t.y, t.radius);
},
strokeCircleShape: function (t) {
return this.strokeCircle(t.x, t.y, t.radius);
},
fillCircle: function (t, e, i) {
return this.beginPath(), this.arc(t, e, i, 0, m.PI2), this.fillPath(), this;
},
strokeCircle: function (t, e, i) {
return this.beginPath(), this.arc(t, e, i, 0, m.PI2), this.strokePath(), this;
},
fillRectShape: function (t) {
return this.fillRect(t.x, t.y, t.width, t.height);
},
strokeRectShape: function (t) {
return this.strokeRect(t.x, t.y, t.width, t.height);
},
fillRect: function (t, e, i, n) {
return this.commandBuffer.push(h.FILL_RECT, t, e, i, n), this;
},
strokeRect: function (t, e, i, n) {
var s = this._lineWidth / 2,
r = t - s,
o = t + s;
return (
this.beginPath(),
this.moveTo(t, e),
this.lineTo(t, e + n),
this.strokePath(),
this.beginPath(),
this.moveTo(t + i, e),
this.lineTo(t + i, e + n),
this.strokePath(),
this.beginPath(),
this.moveTo(r, e),
this.lineTo(o + i, e),
this.strokePath(),
this.beginPath(),
this.moveTo(r, e + n),
this.lineTo(o + i, e + n),
this.strokePath(),
this
);
},
fillRoundedRect: function (t, e, i, n, s) {
void 0 === s && (s = 20);
var r = s,
o = s,
a = s,
h = s;
return (
"number" != typeof s && ((r = v(s, "tl", 20)), (o = v(s, "tr", 20)), (a = v(s, "bl", 20)), (h = v(s, "br", 20))),
this.beginPath(),
this.moveTo(t + r, e),
this.lineTo(t + i - o, e),
this.arc(t + i - o, e + o, o, -m.TAU, 0),
this.lineTo(t + i, e + n - h),
this.arc(t + i - h, e + n - h, h, 0, m.TAU),
this.lineTo(t + a, e + n),
this.arc(t + a, e + n - a, a, m.TAU, Math.PI),
this.lineTo(t, e + r),
this.arc(t + r, e + r, r, -Math.PI, -m.TAU),
this.fillPath(),
this
);
},
strokeRoundedRect: function (t, e, i, n, s) {
void 0 === s && (s = 20);
var r = s,
o = s,
a = s,
h = s;
return (
"number" != typeof s && ((r = v(s, "tl", 20)), (o = v(s, "tr", 20)), (a = v(s, "bl", 20)), (h = v(s, "br", 20))),
this.beginPath(),
this.moveTo(t + r, e),
this.lineTo(t + i - o, e),
this.moveTo(t + i - o, e),
this.arc(t + i - o, e + o, o, -m.TAU, 0),
this.lineTo(t + i, e + n - h),
this.moveTo(t + i, e + n - h),
this.arc(t + i - h, e + n - h, h, 0, m.TAU),
this.lineTo(t + a, e + n),
this.moveTo(t + a, e + n),
this.arc(t + a, e + n - a, a, m.TAU, Math.PI),
this.lineTo(t, e + r),
this.moveTo(t, e + r),
this.arc(t + r, e + r, r, -Math.PI, -m.TAU),
this.strokePath(),
this
);
},
fillPointShape: function (t, e) {
return this.fillPoint(t.x, t.y, e);
},
fillPoint: function (t, e, i) {
return !i || i < 1 ? (i = 1) : ((t -= i / 2), (e -= i / 2)), this.commandBuffer.push(h.FILL_RECT, t, e, i, i), this;
},
fillTriangleShape: function (t) {
return this.fillTriangle(t.x1, t.y1, t.x2, t.y2, t.x3, t.y3);
},
strokeTriangleShape: function (t) {
return this.strokeTriangle(t.x1, t.y1, t.x2, t.y2, t.x3, t.y3);
},
fillTriangle: function (t, e, i, n, s, r) {
return this.commandBuffer.push(h.FILL_TRIANGLE, t, e, i, n, s, r), this;
},
strokeTriangle: function (t, e, i, n, s, r) {
return this.commandBuffer.push(h.STROKE_TRIANGLE, t, e, i, n, s, r), this;
},
strokeLineShape: function (t) {
return this.lineBetween(t.x1, t.y1, t.x2, t.y2);
},
lineBetween: function (t, e, i, n) {
return this.beginPath(), this.moveTo(t, e), this.lineTo(i, n), this.strokePath(), this;
},
lineTo: function (t, e) {
return this.commandBuffer.push(h.LINE_TO, t, e), this;
},
moveTo: function (t, e) {
return this.commandBuffer.push(h.MOVE_TO, t, e), this;
},
strokePoints: function (t, e, i, n) {
void 0 === e && (e = !1), void 0 === i && (i = !1), void 0 === n && (n = t.length), this.beginPath(), this.moveTo(t[0].x, t[0].y);
for (var s = 1; s < n; s++) this.lineTo(t[s].x, t[s].y);
return e && this.lineTo(t[0].x, t[0].y), i && this.closePath(), this.strokePath(), this;
},
fillPoints: function (t, e, i, n) {
void 0 === e && (e = !1), void 0 === i && (i = !1), void 0 === n && (n = t.length), this.beginPath(), this.moveTo(t[0].x, t[0].y);
for (var s = 1; s < n; s++) this.lineTo(t[s].x, t[s].y);
return e && this.lineTo(t[0].x, t[0].y), i && this.closePath(), this.fillPath(), this;
},
strokeEllipseShape: function (t, e) {
void 0 === e && (e = 32);
var i = t.getPoints(e);
return this.strokePoints(i, !0);
},
strokeEllipse: function (t, e, i, n, s) {
void 0 === s && (s = 32);
var r = new p(t, e, i, n).getPoints(s);
return this.strokePoints(r, !0);
},
fillEllipseShape: function (t, e) {
void 0 === e && (e = 32);
var i = t.getPoints(e);
return this.fillPoints(i, !0);
},
fillEllipse: function (t, e, i, n, s) {
void 0 === s && (s = 32);
var r = new p(t, e, i, n).getPoints(s);
return this.fillPoints(r, !0);
},
arc: function (t, e, i, n, s, r, o) {
return void 0 === r && (r = !1), void 0 === o && (o = 0), this.commandBuffer.push(h.ARC, t, e, i, n, s, r, o), this;
},
slice: function (t, e, i, n, s, r, o) {
return (
void 0 === r && (r = !1),
void 0 === o && (o = 0),
this.commandBuffer.push(h.BEGIN_PATH),
this.commandBuffer.push(h.MOVE_TO, t, e),
this.commandBuffer.push(h.ARC, t, e, i, n, s, r, o),
this.commandBuffer.push(h.CLOSE_PATH),
this
);
},
save: function () {
return this.commandBuffer.push(h.SAVE), this;
},
restore: function () {
return this.commandBuffer.push(h.RESTORE), this;
},
translateCanvas: function (t, e) {
return this.commandBuffer.push(h.TRANSLATE, t, e), this;
},
scaleCanvas: function (t, e) {
return this.commandBuffer.push(h.SCALE, t, e), this;
},
rotateCanvas: function (t) {
return this.commandBuffer.push(h.ROTATE, t), this;
},
clear: function () {
return (
(this.commandBuffer.length = 0),
-1 < this.defaultFillColor && this.fillStyle(this.defaultFillColor, this.defaultFillAlpha),
-1 < this.defaultStrokeColor && this.lineStyle(this.defaultStrokeWidth, this.defaultStrokeColor, this.defaultStrokeAlpha),
this
);
},
generateTexture: function (t, e, i) {
var n,
s,
r,
o = this.scene.sys,
a = o.game.renderer;
return (
void 0 === e && (e = o.scale.width),
void 0 === i && (i = o.scale.height),
b.TargetCamera.setScene(this.scene),
b.TargetCamera.setViewport(0, 0, e, i),
(b.TargetCamera.scrollX = this.x),
(b.TargetCamera.scrollY = this.y),
"string" == typeof t
? o.textures.exists(t)
? (r = (n = o.textures.get(t)).getSourceImage()) instanceof HTMLCanvasElement && (s = r.getContext("2d"))
: (s = (n = o.textures.createCanvas(t, e, i)).getSourceImage().getContext("2d"))
: t instanceof HTMLCanvasElement && (s = t.getContext("2d")),
s && (this.renderCanvas(a, this, b.TargetCamera, null, s, !1), n && n.refresh()),
this
);
},
preDestroy: function () {
this.commandBuffer = [];
},
});
(b.TargetCamera = new n()), (t.exports = b);
},
function (t, e) {
t.exports = {
ARC: 0,
BEGIN_PATH: 1,
CLOSE_PATH: 2,
FILL_RECT: 3,
LINE_TO: 4,
MOVE_TO: 5,
LINE_STYLE: 6,
FILL_STYLE: 7,
FILL_PATH: 8,
STROKE_PATH: 9,
FILL_TRIANGLE: 10,
STROKE_TRIANGLE: 11,
SAVE: 14,
RESTORE: 15,
TRANSLATE: 16,
SCALE: 17,
ROTATE: 18,
GRADIENT_FILL_STYLE: 21,
GRADIENT_LINE_STYLE: 22,
};
},
function (t, e, i) {
var r = i(4);
t.exports = function (t, e, i) {
void 0 === i && (i = new r());
var n = t.width / 2,
s = t.height / 2;
return (i.x = t.x + n * Math.cos(e)), (i.y = t.y + s * Math.sin(e)), i;
};
},
function (t, e, i) {
var n = i(35),
s = i(0),
r = i(11),
o = i(176),
a = i(101),
h = i(9),
l = i(75),
u = i(110),
c = i(1071),
d = i(20),
f = i(79),
p = new s({
Extends: u,
Mixins: [r.AlphaSingle, r.BlendMode, r.Depth, r.Mask, r.Pipeline, r.Visible, h, c],
initialize: function (t, e) {
u.call(this, t),
h.call(this),
(this.scene = t),
(this.displayList = null),
(this.type = "Layer"),
(this.state = 0),
(this.parentContainer = null),
(this.name = ""),
(this.active = !0),
(this.tabIndex = -1),
(this.data = null),
(this.renderFlags = 15),
(this.cameraFilter = 0),
(this.input = null),
(this.body = null),
(this.ignoreDestroy = !1),
(this.systems = t.sys),
(this.events = t.sys.events),
(this.sortChildrenFlag = !1),
(this.addCallback = this.addChildCallback),
(this.removeCallback = this.removeChildCallback),
this.initPipeline(),
this.clearAlpha(),
this.setBlendMode(n.SKIP_CHECK),
e && this.add(e),
t.sys.queueDepthSort();
},
setActive: function (t) {
return (this.active = t), this;
},
setName: function (t) {
return (this.name = t), this;
},
setState: function (t) {
return (this.state = t), this;
},
setDataEnabled: function () {
return this.data || (this.data = new a(this)), this;
},
setData: function (t, e) {
return this.data || (this.data = new a(this)), this.data.set(t, e), this;
},
incData: function (t, e) {
return this.data || (this.data = new a(this)), this.data.inc(t, e), this;
},
toggleData: function (t) {
return this.data || (this.data = new a(this)), this.data.toggle(t), this;
},
getData: function (t) {
return this.data || (this.data = new a(this)), this.data.get(t);
},
setInteractive: function () {
return this;
},
disableInteractive: function () {
return this;
},
removeInteractive: function () {
return this;
},
addedToScene: function () {},
removedFromScene: function () {},
update: function () {},
toJSON: function () {
return o(this);
},
willRender: function (t) {
return !(15 !== this.renderFlags || 0 === this.list.length || (0 !== this.cameraFilter && this.cameraFilter & t.id));
},
getIndexList: function () {
for (var t = this, e = this.parentContainer, i = []; e && (i.unshift(e.getIndex(t)), (t = e).parentContainer); ) e = e.parentContainer;
return i.unshift(this.displayList.getIndex(t)), i;
},
addChildCallback: function (t) {
t.displayList && t.displayList !== this && t.removeFromDisplayList(),
t.displayList || (this.queueDepthSort(), (t.displayList = this), t.emit(l.ADDED_TO_SCENE, t, this.scene), this.events.emit(d.ADDED_TO_SCENE, t, this.scene));
},
removeChildCallback: function (t) {
this.queueDepthSort(), (t.displayList = null), t.emit(l.REMOVED_FROM_SCENE, t, this.scene), this.events.emit(d.REMOVED_FROM_SCENE, t, this.scene);
},
queueDepthSort: function () {
this.sortChildrenFlag = !0;
},
depthSort: function () {
this.sortChildrenFlag && (f(this.list, this.sortByDepth), (this.sortChildrenFlag = !1));
},
sortByDepth: function (t, e) {
return t._depth - e._depth;
},
getChildren: function () {
return this.list;
},
destroy: function () {
if (this.scene && !this.ignoreDestroy) {
this.emit(l.DESTROY, this);
for (var t = this.list.length; t--; ) this.list[t].destroy();
this.removeAllListeners(),
this.resetPostPipeline(!0),
this.displayList && (this.displayList.remove(this, !0), this.displayList.queueDepthSort()),
this.data && (this.data.destroy(), (this.data = void 0)),
(this.active = !1),
(this.visible = !1),
(this.list = void 0),
(this.scene = void 0),
(this.displayList = void 0),
(this.systems = void 0),
(this.events = void 0);
}
},
});
t.exports = p;
},
function (t, e, i) {
var n = i(0),
s = i(11),
r = i(15),
o = i(450),
a = i(110),
h = i(452),
l = i(1075),
u = new n({
Extends: r,
Mixins: [s.Depth, s.Mask, s.Pipeline, s.Transform, s.Visible, l],
initialize: function (t, e, i, n) {
if (
(r.call(this, t, "ParticleEmitterManager"),
(this.blendMode = -1),
(this.timeScale = 1),
(this.texture = null),
(this.frame = null),
(this.frameNames = []),
null === i || ("object" != typeof i && !Array.isArray(i)) || ((n = i), (i = null)),
this.setTexture(e, i),
this.initPipeline(),
(this.emitters = new a(this)),
(this.wells = new a(this)),
n)
) {
Array.isArray(n) || (n = [n]);
for (var s = 0; s < n.length; s++) this.createEmitter(n[s]);
}
},
addedToScene: function () {
this.scene.sys.updateList.add(this);
},
removedFromScene: function () {
this.scene.sys.updateList.remove(this);
},
setTexture: function (t, e) {
return (this.texture = this.scene.sys.textures.get(t)), this.setFrame(e);
},
setFrame: function (t) {
this.frame = this.texture.get(t);
var e = this.texture.getFramesFromTextureSource(this.frame.sourceIndex),
i = [];
return (
e.forEach(function (t) {
i.push(t.name);
}),
(this.frameNames = i),
(this.defaultFrame = this.frame),
this
);
},
setEmitterFrames: function (t, e) {
Array.isArray(t) || (t = [t]);
for (var i = e.frames, n = (i.length = 0); n < t.length; n++) {
var s = t[n];
-1 !== this.frameNames.indexOf(s) && i.push(this.texture.get(s));
}
return 0 < i.length ? (e.defaultFrame = i[0]) : (e.defaultFrame = this.defaultFrame), this;
},
addEmitter: function (t) {
return this.emitters.add(t);
},
createEmitter: function (t) {
return this.addEmitter(new h(this, t));
},
removeEmitter: function (t) {
return this.emitters.remove(t, !0);
},
addGravityWell: function (t) {
return this.wells.add(t);
},
createGravityWell: function (t) {
return this.addGravityWell(new o(t));
},
emitParticle: function (t, e, i) {
for (var n = this.emitters.list, s = 0; s < n.length; s++) {
var r = n[s];
r.active && r.emitParticle(t, e, i);
}
return this;
},
emitParticleAt: function (t, e, i) {
return this.emitParticle(i, t, e);
},
pause: function () {
return (this.active = !1), this;
},
resume: function () {
return (this.active = !0), this;
},
getProcessors: function () {
return this.wells.getAll("active", !0);
},
preUpdate: function (t, e) {
e *= this.timeScale;
for (var i = this.emitters.list, n = 0; n < i.length; n++) {
var s = i[n];
s.active && s.preUpdate(t, e);
}
},
setAlpha: function () {},
setScrollFactor: function () {},
setBlendMode: function () {},
});
t.exports = u;
},
function (t, e, i) {
var o = i(35),
h = i(133),
l = i(31),
n = i(0),
s = i(11),
u = i(33),
a = i(109),
c = i(15),
d = i(1),
f = i(92),
r = i(1079),
p = i(141),
x = i(12),
g = i(222),
v = new n({
Extends: c,
Mixins: [s.Alpha, s.BlendMode, s.ComputedSize, s.Crop, s.Depth, s.Flip, s.GetBounds, s.Mask, s.Origin, s.Pipeline, s.ScrollFactor, s.Tint, s.Transform, s.Visible, r],
initialize: function (t, e, i, n, s, r, o) {
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 32),
void 0 === s && (s = 32),
c.call(this, t, "RenderTexture"),
(this.renderer = t.sys.renderer),
(this.textureManager = t.sys.textures),
(this.globalTint = 16777215),
(this.globalAlpha = 1),
(this.canvas = null),
(this.dirty = !1),
(this._crop = this.resetCropObject()),
(this.texture = null),
(this.frame = null),
(this._saved = !1),
void 0 === r
? ((this.canvas = l.create2D(this, n, s)), (this.texture = t.sys.textures.addCanvas(g(), this.canvas)), (this.frame = this.texture.get()))
: ((this.texture = t.sys.textures.get(r)),
(this.frame = this.texture.get(o)),
(this.canvas = this.frame.source.image),
(this._saved = !0),
(this.dirty = !0),
(this.width = this.frame.cutWidth),
(this.height = this.frame.cutHeight)),
(this.context = this.canvas.getContext("2d")),
(this._eraseMode = !1),
(this.camera = new h(0, 0, n, s)),
(this.renderTarget = null);
var a = this.renderer;
a
? a.type === u.WEBGL
? ((this.drawGameObject = this.batchGameObjectWebGL), (this.renderTarget = new p(a, n, s, 1, 0, !1)))
: a.type === u.CANVAS && (this.drawGameObject = this.batchGameObjectCanvas)
: (this.drawGameObject = d),
this.camera.setScene(t),
this.setPosition(e, i),
void 0 === r && this.setSize(n, s),
this.setOrigin(0, 0),
this.initPipeline(f.SINGLE_PIPELINE);
},
setSize: function (t, e) {
return this.resize(t, e);
},
resize: function (t, e) {
void 0 === e && (e = t);
var i,
n,
s = this.frame;
t !== this.width || e !== this.height
? "__BASE" === s.name &&
((this.canvas.width = t),
(this.canvas.height = e),
(this.texture.width = t),
(this.texture.height = e),
(i = this.renderTarget) && (i.resize(t, e), (s.glTexture = i.texture), (s.source.isRenderTexture = !0), (s.source.isGLTexture = !0), (s.source.glTexture = i.texture)),
this.camera.setSize(t, e),
(s.source.width = t),
(s.source.height = e),
s.setSize(t, e),
(this.width = t),
(this.height = e))
: ((n = this.texture.getSourceImage()), s.cutX + t > n.width && (t = n.width - s.cutX), s.cutY + e > n.height && (e = n.height - s.cutY), s.setSize(t, e, s.cutX, s.cutY)),
this.updateDisplayOrigin();
var r = this.input;
return r && !r.customHitArea && ((r.hitArea.width = t), (r.hitArea.height = e)), this;
},
setGlobalTint: function (t) {
return (this.globalTint = t), this;
},
setGlobalAlpha: function (t) {
return (this.globalAlpha = t), this;
},
saveTexture: function (t) {
return this.textureManager.renameTexture(this.texture.key, t), (this._saved = !0), this.texture;
},
fill: function (t, e, i, n, s, r) {
var o = this.frame,
a = this.camera,
h = this.renderer;
void 0 === e && (e = 1), void 0 === i && (i = 0), void 0 === n && (n = 0), void 0 === s && (s = o.cutWidth), void 0 === r && (r = o.cutHeight);
var l,
u,
c,
d,
f,
p,
g = ((t >> 16) & 255) / 255,
v = ((t >> 8) & 255) / 255,
y = (255 & t) / 255,
m = this.renderTarget;
return (
a.preRender(),
m
? (m.bind(!0),
(l = this.pipeline).manager.set(l),
(u = m.width),
(c = m.height),
(d = h.width / u),
(f = h.height / c),
l.drawFillRect(i * d, n * f, s * d, r * f, x.getTintFromFloats(y, v, g, 1), e),
m.unbind(!0))
: ((p = this.context), h.setContext(p), (p.fillStyle = "rgba(" + g + "," + v + "," + y + "," + e + ")"), p.fillRect(i + o.cutX, n + o.cutY, s, r), h.setContext()),
(this.dirty = !0),
this
);
},
clear: function () {
var t, e;
return (
this.dirty &&
((t = this.renderTarget)
? t.clear()
: ((e = this.context).save(), e.setTransform(1, 0, 0, 1, 0, 0), e.clearRect(this.frame.cutX, this.frame.cutY, this.frame.cutWidth, this.frame.cutHeight), e.restore()),
(this.dirty = !1)),
this
);
},
erase: function (t, e, i) {
return (this._eraseMode = !0), this.draw(t, e, i, 1, 16777215), (this._eraseMode = !1), this;
},
draw: function (t, e, i, n, s) {
return this.beginDraw(), this.batchDraw(t, e, i, n, s), this.endDraw(), this;
},
drawFrame: function (t, e, i, n, s, r) {
return this.beginDraw(), this.batchDrawFrame(t, e, i, n, s, r), this.endDraw(), this;
},
beginDraw: function () {
var t = this.camera,
e = this.renderer,
i = this.renderTarget;
return t.preRender(), i ? e.beginCapture(i.width, i.height) : e.setContext(this.context), this;
},
batchDraw: function (t, e, i, n, s) {
return (
void 0 === n && (n = this.globalAlpha),
(s = void 0 === s ? (this.globalTint >> 16) + (65280 & this.globalTint) + ((255 & this.globalTint) << 16) : (s >> 16) + (65280 & s) + ((255 & s) << 16)),
Array.isArray(t) || (t = [t]),
this.batchList(t, e, i, n, s),
this
);
},
batchDrawFrame: function (t, e, i, n, s, r) {
void 0 === i && (i = 0),
void 0 === n && (n = 0),
void 0 === s && (s = this.globalAlpha),
(r = void 0 === r ? (this.globalTint >> 16) + (65280 & this.globalTint) + ((255 & this.globalTint) << 16) : (r >> 16) + (65280 & r) + ((255 & r) << 16));
var o = this.textureManager.getFrame(t, e);
return o && (this.renderTarget ? this.pipeline.batchTextureFrame(o, i, n, r, s, this.camera.matrix, null) : this.batchTextureFrame(o, i + this.frame.cutX, n + this.frame.cutY, s, r)), this;
},
endDraw: function (t) {
void 0 === t && (t = this._eraseMode);
var e,
i = this.renderer,
n = this.renderTarget;
return n ? ((e = i.endCapture()), i.pipelines.setUtility().blitFrame(e, n, 1, !1, !1, t), i.resetScissor(), i.resetViewport()) : i.setContext(), (this.dirty = !0), this;
},
batchList: function (t, e, i, n, s) {
for (var r = 0; r < t.length; r++) {
var o = t[r];
o &&
o !== this &&
(o.renderWebGL || o.renderCanvas
? this.drawGameObject(o, e, i)
: o.isParent || o.list
? this.batchGroup(o.getChildren(), e, i)
: "string" == typeof o
? this.batchTextureFrameKey(o, null, e, i, n, s)
: o instanceof a
? this.batchTextureFrame(o, e, i, n, s)
: Array.isArray(o) && this.batchList(o, e, i, n, s));
}
},
batchGroup: function (t, e, i) {
void 0 === e && (e = 0), void 0 === i && (i = 0), (e += this.frame.cutX), (i += this.frame.cutY);
for (var n = 0; n < t.length; n++) {
var s,
r,
o = t[n];
o.willRender(this.camera) && ((s = o.x + e), (r = o.y + i), this.drawGameObject(o, s, r));
}
},
batchGameObjectWebGL: function (t, e, i) {
void 0 === e && (e = t.x), void 0 === i && (i = t.y);
var n = t.x,
s = t.y;
t.setPosition(e + this.frame.cutX, i + this.frame.cutY), t.renderDirect ? t.renderDirect(this.renderer, t, this.camera) : t.renderWebGL(this.renderer, t, this.camera), t.setPosition(n, s);
},
batchGameObjectCanvas: function (t, e, i) {
void 0 === e && (e = t.x), void 0 === i && (i = t.y);
var n,
s = t.x,
r = t.y;
this._eraseMode && ((n = t.blendMode), (t.blendMode = o.ERASE)),
t.setPosition(e + this.frame.cutX, i + this.frame.cutY),
t.renderCanvas(this.renderer, t, this.camera, null),
t.setPosition(s, r),
this._eraseMode && (t.blendMode = n);
},
batchTextureFrameKey: function (t, e, i, n, s, r) {
var o = this.textureManager.getFrame(t, e);
o && this.batchTextureFrame(o, i, n, s, r);
},
batchTextureFrame: function (t, e, i, n, s) {
var r, o, a, h;
void 0 === e && (e = 0),
void 0 === i && (i = 0),
(e += this.frame.cutX),
(i += this.frame.cutY),
this.renderTarget
? this.pipeline.batchTextureFrame(t, e, i, s, n, this.camera.matrix, null)
: ((r = this.context),
(o = t.canvasData),
(a = t.source.image),
(h = this.camera.matrix),
r.save(),
(r.globalCompositeOperation = this._eraseMode ? "destination-out" : "source-over"),
(r.globalAlpha = n),
h.setToContext(r),
r.drawImage(a, o.x, o.y, o.width, o.height, e, i, o.width, o.height),
r.restore());
},
snapshotArea: function (t, e, i, n, s, r, o) {
return (
this.renderTarget ? this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer, this.width, this.height, s, !1, t, e, i, n, r, o) : this.renderer.snapshotCanvas(this.canvas, s, !1, t, e, i, n, r, o),
this
);
},
snapshot: function (t, e, i) {
return (
this.renderTarget
? this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer, this.width, this.height, t, !1, 0, 0, this.width, this.height, e, i)
: this.renderer.snapshotCanvas(this.canvas, t, !1, 0, 0, this.width, this.height, e, i),
this
);
},
snapshotPixel: function (t, e, i) {
return this.renderTarget ? this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer, this.width, this.height, i, !0, t, e) : this.renderer.snapshotCanvas(this.canvas, i, !0, t, e), this;
},
preDestroy: function () {
this._saved || (l.remove(this.canvas), this.renderTarget && this.renderTarget.destroy(), this.texture.destroy(), this.camera.destroy(), (this.canvas = null), (this.context = null), (this.texture = null));
},
});
t.exports = v;
},
function (t, e) {
t.exports = function () {
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (t) {
var e = (16 * Math.random()) | 0;
return ("x" === t ? e : (3 & e) | 8).toString(16);
});
};
},
function (t, e, i) {
var l = i(164),
n = i(0),
s = i(11),
u = i(15),
c = i(92),
r = i(1085),
d = i(3),
o = new n({
Extends: u,
Mixins: [s.AlphaSingle, s.BlendMode, s.Depth, s.Flip, s.Mask, s.Pipeline, s.Size, s.Texture, s.Transform, s.Visible, s.ScrollFactor, r],
initialize: function (t, e, i, n, s, r, o, a, h) {
void 0 === n && (n = "__DEFAULT"),
void 0 === r && (r = 2),
void 0 === o && (o = !0),
u.call(this, t, "Rope"),
(this.anims = new l(this)),
(this.points = r),
this.vertices,
this.uv,
this.colors,
this.alphas,
(this.tintFill = "__DEFAULT" === n),
(this.dirty = !1),
(this.horizontal = o),
(this._flipX = !1),
(this._flipY = !1),
(this._perp = new d()),
(this.debugCallback = null),
(this.debugGraphic = null),
this.setTexture(n, s),
this.setPosition(e, i),
this.setSizeToFrame(),
this.initPipeline(c.ROPE_PIPELINE),
Array.isArray(r) && this.resizeArrays(r.length),
this.setPoints(r, a, h),
this.updateVertices();
},
addedToScene: function () {
this.scene.sys.updateList.add(this);
},
removedFromScene: function () {
this.scene.sys.updateList.remove(this);
},
preUpdate: function (t, e) {
var i = this.anims.currentFrame;
this.anims.update(t, e), this.anims.currentFrame !== i && (this.updateUVs(), this.updateVertices());
},
play: function (t, e, i) {
return this.anims.play(t, e, i), this;
},
setDirty: function () {
return (this.dirty = !0), this;
},
setHorizontal: function (t, e, i) {
return void 0 === t && (t = this.points.length), this.horizontal ? this : ((this.horizontal = !0), this.setPoints(t, e, i));
},
setVertical: function (t, e, i) {
return void 0 === t && (t = this.points.length), this.horizontal ? ((this.horizontal = !1), this.setPoints(t, e, i)) : this;
},
setTintFill: function (t) {
return void 0 === t && (t = !1), (this.tintFill = t), this;
},
setAlphas: function (t, e) {
var i = this.points.length;
if (i < 1) return this;
var n = this.alphas;
void 0 === t ? (t = [1]) : Array.isArray(t) || void 0 !== e || (t = [t]);
var s = 0;
if (void 0 !== e) for (o = 0; o < i; o++) (n[(s = 2 * o)] = t), (n[s + 1] = e);
else if (t.length === i) for (o = 0; o < i; o++) (n[(s = 2 * o)] = t[o]), (n[s + 1] = t[o]);
else for (var r = t[0], o = 0; o < i; o++) (s = 2 * o), t.length > s && (r = t[s]), (n[s] = r), t.length > s + 1 && (r = t[s + 1]), (n[s + 1] = r);
return this;
},
setColors: function (t) {
var e = this.points.length;
if (e < 1) return this;
var i = this.colors;
void 0 === t ? (t = [16777215]) : Array.isArray(t) || (t = [t]);
var n = 0;
if (t.length === e) for (r = 0; r < e; r++) (i[(n = 2 * r)] = t[r]), (i[n + 1] = t[r]);
else for (var s = t[0], r = 0; r < e; r++) (n = 2 * r), t.length > n && (s = t[n]), (i[n] = s), t.length > n + 1 && (s = t[n + 1]), (i[n + 1] = s);
return this;
},
setPoints: function (t, e, i) {
if ((void 0 === t && (t = 2), "number" == typeof t)) {
var n,
s,
r,
o = t;
if ((o < 2 && (o = 2), (t = []), this.horizontal)) for (r = -this.frame.halfWidth, s = this.frame.width / (o - 1), n = 0; n < o; n++) t.push({ x: r + n * s, y: 0 });
else for (r = -this.frame.halfHeight, s = this.frame.height / (o - 1), n = 0; n < o; n++) t.push({ x: 0, y: r + n * s });
}
var a = t.length,
h = this.points.length;
return a < 1 || (1 === a && (t.unshift({ x: 0, y: 0 }), a++), h !== a && this.resizeArrays(a), (this.points = t), this.updateUVs(), null != e && this.setColors(e), null != i && this.setAlphas(i)), this;
},
updateUVs: function () {
for (var t = this.uv, e = this.points.length, i = this.frame.u0, n = this.frame.v0, s = this.frame.u1, r = this.frame.v1, o = (s - i) / (e - 1), a = (r - n) / (e - 1), h = 0; h < e; h++) {
var l,
u,
c,
d = 4 * h,
f = this.horizontal
? ((c = l = this._flipX ? s - h * o : i + h * o), this._flipY ? ((u = r), n) : ((u = n), r))
: ((c = this._flipX ? ((l = i), s) : ((l = s), i)), (u = this._flipY ? r - h * a : n + h * a));
(t[0 + d] = l), (t[1 + d] = u), (t[2 + d] = c), (t[3 + d] = f);
}
return this;
},
resizeArrays: function (t) {
var e = this.colors,
i = this.alphas;
(this.vertices = new Float32Array(4 * t)), (this.uv = new Float32Array(4 * t)), (e = new Uint32Array(2 * t)), (i = new Float32Array(2 * t));
for (var n = 0; n < 2 * t; n++) (e[n] = 16777215), (i[n] = 1);
return (this.colors = e), (this.alphas = i), (this.dirty = !0), this;
},
updateVertices: function () {
var t = this._perp,
e = this.points,
i = this.vertices,
n = e.length;
if (((this.dirty = !1), !(n < 1))) {
for (var s = e[0], r = this.horizontal ? this.frame.halfHeight : this.frame.halfWidth, o = 0; o < n; o++) {
var a = e[o],
h = 4 * o,
l = o < n - 1 ? e[o + 1] : a;
(t.x = l.y - s.y), (t.y = -(l.x - s.x));
var u = t.length();
(t.x /= u), (t.y /= u), (t.x *= r), (t.y *= r), (i[h] = a.x + t.x), (i[1 + h] = a.y + t.y), (i[2 + h] = a.x - t.x), (i[3 + h] = a.y - t.y), (s = a);
}
return this;
}
},
setDebug: function (t, e) {
return (this.debugGraphic = t), (this.debugCallback = t || e ? e || this.renderDebugVerts : null), this;
},
renderDebugVerts: function (t, e, i) {
var n = t.debugGraphic,
s = i[0],
r = i[1],
o = i[2],
a = i[3];
n.lineBetween(s, r, o, a);
for (var h = 4; h < e; h += 4) {
var l = i[h + 0],
u = i[h + 1],
c = i[h + 2],
d = i[h + 3];
n.lineBetween(s, r, l, u), n.lineBetween(o, a, c, d), n.lineBetween(o, a, l, u), n.lineBetween(l, u, c, d), (s = l), (r = u), (o = c), (a = d);
}
},
preDestroy: function () {
this.anims.destroy(),
(this.anims = void 0),
(this.points = null),
(this.vertices = null),
(this.uv = null),
(this.colors = null),
(this.alphas = null),
(this.debugCallback = null),
(this.debugGraphic = null);
},
flipX: {
get: function () {
return this._flipX;
},
set: function (t) {
return (this._flipX = t), this.updateUVs();
},
},
flipY: {
get: function () {
return this._flipY;
},
set: function (t) {
return (this._flipY = t), this.updateUVs();
},
},
});
t.exports = o;
},
function (t, e, i) {
var n = i(142),
r = i(31),
s = i(0),
o = i(11),
a = i(22),
h = i(15),
T = i(458),
l = i(6),
u = i(202),
c = i(1088),
d = i(459),
f = new s({
Extends: h,
Mixins: [o.Alpha, o.BlendMode, o.ComputedSize, o.Crop, o.Depth, o.Flip, o.GetBounds, o.Mask, o.Origin, o.Pipeline, o.ScrollFactor, o.Tint, o.Transform, o.Visible, c],
initialize: function (t, e, i, n, s) {
void 0 === e && (e = 0),
void 0 === i && (i = 0),
h.call(this, t, "Text"),
(this.renderer = t.sys.renderer),
this.setPosition(e, i),
this.setOrigin(0, 0),
this.initPipeline(),
(this.canvas = r.create(this)),
(this.context = this.canvas.getContext("2d")),
(this.style = new d(this, s)),
(this.autoRound = !0),
(this.splitRegExp = /(?:\r\n|\r|\n)/),
(this._text = void 0),
(this.padding = { left: 0, right: 0, top: 0, bottom: 0 }),
(this.width = 1),
(this.height = 1),
(this.lineSpacing = 0),
(this.dirty = !1),
0 === this.style.resolution && (this.style.resolution = 1),
(this._crop = this.resetCropObject()),
(this.texture = t.sys.textures.addCanvas(null, this.canvas, !0)),
(this.frame = this.texture.get()),
(this.frame.source.resolution = this.style.resolution),
this.renderer && this.renderer.gl && (this.renderer.deleteTexture(this.frame.source.glTexture), (this.frame.source.glTexture = null)),
this.initRTL(),
this.setText(n),
s && s.padding && this.setPadding(s.padding),
s && s.lineSpacing && this.setLineSpacing(s.lineSpacing),
t.sys.game.events.on(
a.CONTEXT_RESTORED,
function () {
this.dirty = !0;
},
this
);
},
initRTL: function () {
this.style.rtl && ((this.canvas.dir = "rtl"), (this.context.direction = "rtl"), (this.canvas.style.display = "none"), n(this.canvas, this.scene.sys.canvas), (this.originX = 1));
},
runWordWrap: function (t) {
var e = this.style;
if (e.wordWrapCallback) {
var i = e.wordWrapCallback.call(e.wordWrapCallbackScope, t, this);
return Array.isArray(i) && (i = i.join("\n")), i;
}
return e.wordWrapWidth ? (e.wordWrapUseAdvanced ? this.advancedWordWrap(t, this.context, this.style.wordWrapWidth) : this.basicWordWrap(t, this.context, this.style.wordWrapWidth)) : t;
},
advancedWordWrap: function (t, e, i) {
for (var n = "", s = t.replace(/ +/gi, " ").split(this.splitRegExp), r = s.length, o = 0; o < r; o++) {
var a = "",
h = (h = s[o]).replace(/^ *|\s*$/gi, "");
if (e.measureText(h).width < i) n += h + "\n";
else {
for (var l = i, u = h.split(" "), c = 0; c < u.length; c++) {
var d = u[c],
f = d + " ",
p = e.measureText(f).width;
if (l < p) {
if (0 === c) {
for (var g = f; g.length && ((g = g.slice(0, -1)), !((p = e.measureText(g).width) <= l)); );
if (!g.length) throw new Error("This text's wordWrapWidth setting is less than a single character!");
var v = d.substr(g.length);
(u[c] = v), (a += g);
}
var y = u[c].length ? c : c + 1,
m = u
.slice(y)
.join(" ")
.replace(/[ \n]*$/gi, "");
(s[o + 1] = m + " " + (s[o + 1] || "")), (r = s.length);
break;
}
(a += f), (l -= p);
}
n += a.replace(/[ \n]*$/gi, "") + "\n";
}
}
return n.replace(/[\s|\n]*$/gi, "");
},
basicWordWrap: function (t, e, i) {
for (var n = "", s = t.split(this.splitRegExp), r = s.length - 1, o = e.measureText(" ").width, a = 0; a <= r; a++) {
for (var h = i, l = s[a].split(" "), u = l.length - 1, c = 0; c <= u; c++) {
var d = l[c],
f = e.measureText(d).width,
p = f;
c < u && (p += o), h < p && 0 < c && ((n += "\n"), (h = i)), (n += d), c < u ? ((n += " "), (h -= p)) : (h -= f);
}
a < r && (n += "\n");
}
return n;
},
getWrappedText: function (t) {
return void 0 === t && (t = this._text), this.style.syncFont(this.canvas, this.context), this.runWordWrap(t).split(this.splitRegExp);
},
setText: function (t) {
return t || 0 === t || (t = ""), Array.isArray(t) && (t = t.join("\n")), t !== this._text && ((this._text = t.toString()), this.updateText()), this;
},
setStyle: function (t) {
return this.style.setStyle(t);
},
setFont: function (t) {
return this.style.setFont(t);
},
setFontFamily: function (t) {
return this.style.setFontFamily(t);
},
setFontSize: function (t) {
return this.style.setFontSize(t);
},
setFontStyle: function (t) {
return this.style.setFontStyle(t);
},
setFixedSize: function (t, e) {
return this.style.setFixedSize(t, e);
},
setBackgroundColor: function (t) {
return this.style.setBackgroundColor(t);
},
setFill: function (t) {
return this.style.setFill(t);
},
setColor: function (t) {
return this.style.setColor(t);
},
setStroke: function (t, e) {
return this.style.setStroke(t, e);
},
setShadow: function (t, e, i, n, s, r) {
return this.style.setShadow(t, e, i, n, s, r);
},
setShadowOffset: function (t, e) {
return this.style.setShadowOffset(t, e);
},
setShadowColor: function (t) {
return this.style.setShadowColor(t);
},
setShadowBlur: function (t) {
return this.style.setShadowBlur(t);
},
setShadowStroke: function (t) {
return this.style.setShadowStroke(t);
},
setShadowFill: function (t) {
return this.style.setShadowFill(t);
},
setWordWrapWidth: function (t, e) {
return this.style.setWordWrapWidth(t, e);
},
setWordWrapCallback: function (t, e) {
return this.style.setWordWrapCallback(t, e);
},
setAlign: function (t) {
return this.style.setAlign(t);
},
setResolution: function (t) {
return this.style.setResolution(t);
},
setLineSpacing: function (t) {
return (this.lineSpacing = t), this.updateText();
},
setPadding: function (t, e, i, n) {
var s, r, o;
return (
"object" == typeof t
? ((i = null !== (r = l((s = t), "x", null)) ? (t = r) : ((t = l(s, "left", 0)), l(s, "right", t))), (n = null !== (o = l(s, "y", null)) ? (e = o) : ((e = l(s, "top", 0)), l(s, "bottom", e))))
: (void 0 === t && (t = 0), void 0 === e && (e = t), void 0 === i && (i = t), void 0 === n && (n = e)),
(this.padding.left = t),
(this.padding.top = e),
(this.padding.right = i),
(this.padding.bottom = n),
this.updateText()
);
},
setMaxLines: function (t) {
return this.style.setMaxLines(t);
},
updateText: function () {
var t = this.canvas,
e = this.context,
i = this.style,
n = i.resolution,
s = i.metrics;
i.syncFont(t, e);
var r = this._text;
(i.wordWrapWidth || i.wordWrapCallback) && (r = this.runWordWrap(this._text));
var o,
a = r.split(this.splitRegExp),
h = T(this, s, a),
l = this.padding;
0 === i.fixedWidth ? ((this.width = h.width + l.left + l.right), (o = h.width)) : ((this.width = i.fixedWidth), (o = this.width - l.left - l.right) < h.width && (o = h.width)),
0 === i.fixedHeight ? (this.height = h.height + l.top + l.bottom) : (this.height = i.fixedHeight);
var u,
c,
d = this.width,
f = this.height;
this.updateDisplayOrigin(),
(d *= n),
(f *= n),
(d = Math.max(d, 1)),
(f = Math.max(f, 1)),
t.width !== d || t.height !== f ? ((t.width = d), (t.height = f), this.frame.setSize(d, f), i.syncFont(t, e)) : e.clearRect(0, 0, d, f),
e.save(),
e.scale(n, n),
i.backgroundColor && ((e.fillStyle = i.backgroundColor), e.fillRect(0, 0, d, f)),
i.syncStyle(t, e),
(e.textBaseline = "alphabetic"),
e.translate(l.left, l.top);
for (var p = 0; p < h.lines; p++) {
if (((u = i.strokeThickness / 2), (c = i.strokeThickness / 2 + p * h.lineHeight + s.ascent), 0 < p && (c += h.lineSpacing * p), i.rtl)) u = d - u;
else if ("right" === i.align) u += o - h.lineWidths[p];
else if ("center" === i.align) u += (o - h.lineWidths[p]) / 2;
else if ("justify" === i.align && 0.85 <= h.lineWidths[p] / h.width) {
var g = h.width - h.lineWidths[p],
v = e.measureText(" ").width,
y = a[p].trim(),
m = y.split(" ");
g += (a[p].length - y.length) * v;
for (var x = Math.floor(g / v), b = 0; 0 < x; ) (m[b] += " "), (b = (b + 1) % (m.length - 1 || 1)), --x;
a[p] = m.join(" ");
}
this.autoRound && ((u = Math.round(u)), (c = Math.round(c))),
i.strokeThickness && (this.style.syncShadow(e, i.shadowStroke), e.strokeText(a[p], u, c)),
i.color && (this.style.syncShadow(e, i.shadowFill), e.fillText(a[p], u, c));
}
e.restore(),
this.renderer && this.renderer.gl && ((this.frame.source.glTexture = this.renderer.canvasToTexture(t, this.frame.source.glTexture, !0)), (this.frame.glTexture = this.frame.source.glTexture)),
(this.dirty = !0);
var w = this.input;
return w && !w.customHitArea && ((w.hitArea.width = this.width), (w.hitArea.height = this.height)), this;
},
getTextMetrics: function () {
return this.style.getTextMetrics();
},
text: {
get: function () {
return this._text;
},
set: function (t) {
this.setText(t);
},
},
toJSON: function () {
var t = o.ToJSON(this),
e = { autoRound: this.autoRound, text: this._text, style: this.style.toJSON(), padding: { left: this.padding.left, right: this.padding.right, top: this.padding.top, bottom: this.padding.bottom } };
return (t.data = e), t;
},
preDestroy: function () {
this.style.rtl && u(this.canvas), r.remove(this.canvas), this.texture.destroy();
},
});
t.exports = f;
},
function (t, e, i) {
var u = i(31),
n = i(0),
s = i(11),
c = i(22),
d = i(15),
f = i(361),
o = i(192),
r = i(1091),
p = i(3),
a = new n({
Extends: d,
Mixins: [s.Alpha, s.BlendMode, s.ComputedSize, s.Crop, s.Depth, s.Flip, s.GetBounds, s.Mask, s.Origin, s.Pipeline, s.ScrollFactor, s.Tint, s.Transform, s.Visible, r],
initialize: function (t, e, i, n, s, r, o) {
var a = t.sys.renderer;
d.call(this, t, "TileSprite");
var h = t.sys.textures.get(r),
l = h.get(o);
(s = n && s ? ((n = Math.floor(n)), Math.floor(s)) : ((n = l.width), l.height)),
(this._tilePosition = new p()),
(this._tileScale = new p(1, 1)),
(this.dirty = !1),
(this.renderer = a),
(this.canvas = u.create(this, n, s)),
(this.context = this.canvas.getContext("2d")),
(this.displayTexture = h),
(this.displayFrame = l),
(this._crop = this.resetCropObject()),
(this.texture = t.sys.textures.addCanvas(null, this.canvas, !0)),
(this.frame = this.texture.get()),
(this.potWidth = f(l.width)),
(this.potHeight = f(l.height)),
(this.fillCanvas = u.create2D(this, this.potWidth, this.potHeight)),
(this.fillContext = this.fillCanvas.getContext("2d")),
(this.fillPattern = null),
this.setPosition(e, i),
this.setSize(n, s),
this.setFrame(o),
this.setOriginFromFrame(),
this.initPipeline(),
t.sys.game.events.on(
c.CONTEXT_RESTORED,
function (t) {
var e;
t &&
((e = t.gl),
(this.dirty = !0),
(this.fillPattern = null),
(this.fillPattern = t.createTexture2D(0, e.LINEAR, e.LINEAR, e.REPEAT, e.REPEAT, e.RGBA, this.fillCanvas, this.potWidth, this.potHeight)));
},
this
);
},
setTexture: function (t, e) {
return (this.displayTexture = this.scene.sys.textures.get(t)), this.setFrame(e);
},
setFrame: function (t) {
var e = this.displayTexture.get(t);
return (
(this.potWidth = f(e.width)),
(this.potHeight = f(e.height)),
(this.canvas.width = 0),
e.cutWidth && e.cutHeight ? (this.renderFlags |= 8) : (this.renderFlags &= -9),
(this.displayFrame = e),
(this.dirty = !0),
this.updateTileTexture(),
this
);
},
setTilePosition: function (t, e) {
return void 0 !== t && (this.tilePositionX = t), void 0 !== e && (this.tilePositionY = e), this;
},
setTileScale: function (t, e) {
return void 0 === t && (t = this.tileScaleX), void 0 === e && (e = t), (this.tileScaleX = t), (this.tileScaleY = e), this;
},
updateTileTexture: function () {
if (this.dirty && this.renderer) {
var t = this.displayFrame;
if (t.source.isRenderTexture || t.source.isGLTexture) return void (this.dirty = !1);
var e = this.fillContext,
i = this.fillCanvas,
n = this.potWidth,
s = this.potHeight;
(this.renderer && this.renderer.gl) || ((n = t.cutWidth), (s = t.cutHeight)),
e.clearRect(0, 0, n, s),
(i.width = n),
(i.height = s),
e.drawImage(t.source.image, t.cutX, t.cutY, t.cutWidth, t.cutHeight, 0, 0, n, s),
this.renderer && this.renderer.gl ? (this.fillPattern = this.renderer.canvasToTexture(i, this.fillPattern)) : (this.fillPattern = e.createPattern(i, "repeat")),
this.updateCanvas(),
(this.dirty = !1);
}
},
updateCanvas: function () {
var t,
e,
i,
n,
s,
r = this.canvas;
(r.width === this.width && r.height === this.height) || ((r.width = this.width), (r.height = this.height), this.frame.setSize(this.width, this.height), this.updateDisplayOrigin(), (this.dirty = !0)),
!this.dirty ||
(this.renderer && this.renderer.gl) ||
((t = this.context),
this.scene.sys.game.config.antialias || o.disable(t),
(e = this._tileScale.x),
(i = this._tileScale.y),
(n = this._tilePosition.x),
(s = this._tilePosition.y),
t.clearRect(0, 0, this.width, this.height),
t.save(),
t.scale(e, i),
t.translate(-n, -s),
(t.fillStyle = this.fillPattern),
t.fillRect(n, s, this.width / e, this.height / i),
t.restore()),
(this.dirty = !1);
},
preDestroy: function () {
this.renderer && this.renderer.gl && this.renderer.deleteTexture(this.fillPattern),
u.remove(this.canvas),
u.remove(this.fillCanvas),
(this.fillPattern = null),
(this.fillContext = null),
(this.fillCanvas = null),
(this.displayTexture = null),
(this.displayFrame = null),
this.texture.destroy(),
(this.renderer = null);
},
tilePositionX: {
get: function () {
return this._tilePosition.x;
},
set: function (t) {
(this._tilePosition.x = t), (this.dirty = !0);
},
},
tilePositionY: {
get: function () {
return this._tilePosition.y;
},
set: function (t) {
(this._tilePosition.y = t), (this.dirty = !0);
},
},
tileScaleX: {
get: function () {
return this._tileScale.x;
},
set: function (t) {
(this._tileScale.x = t), (this.dirty = !0);
},
},
tileScaleY: {
get: function () {
return this._tileScale.y;
},
set: function (t) {
(this._tileScale.y = t), (this.dirty = !0);
},
},
});
t.exports = a;
},
function (t, e, i) {
var n = i(0),
s = i(18),
r = i(11),
o = i(75),
a = i(22),
h = i(51),
l = i(15),
u = i(70),
c = i(222),
d = i(1094),
f = i(14),
p = new n({
Extends: l,
Mixins: [r.Alpha, r.BlendMode, r.Depth, r.Flip, r.GetBounds, r.Mask, r.Origin, r.Pipeline, r.ScrollFactor, r.Size, r.TextureCrop, r.Tint, r.Transform, r.Visible, d],
initialize: function (t, e, i, n) {
l.call(this, t, "Video"),
(this.video = null),
(this.videoTexture = null),
(this.videoTextureSource = null),
(this.snapshotTexture = null),
(this.flipY = !1),
(this._key = c()),
(this.touchLocked = !0),
(this.playWhenUnlocked = !1),
(this.retryLimit = 20),
(this.retry = 0),
(this.retryInterval = 500),
(this._retryID = null),
(this._systemMuted = !1),
(this._codeMuted = !1),
(this._systemPaused = !1),
(this._codePaused = !1),
(this._callbacks = {
play: this.playHandler.bind(this),
error: this.loadErrorHandler.bind(this),
end: this.completeHandler.bind(this),
time: this.timeUpdateHandler.bind(this),
seeking: this.seekingHandler.bind(this),
seeked: this.seekedHandler.bind(this),
}),
(this._crop = this.resetCropObject()),
(this.markers = {}),
(this._markerIn = -1),
(this._markerOut = f.MAX_SAFE_INTEGER),
(this._lastUpdate = 0),
(this._cacheKey = ""),
(this._isSeeking = !1),
(this.removeVideoElementOnDestroy = !1),
this.setPosition(e, i),
this.initPipeline(),
n && this.changeSource(n, !1);
var s = t.sys.game.events;
s.on(a.PAUSE, this.globalPause, this), s.on(a.RESUME, this.globalResume, this);
var r = t.sys.sound;
r && r.on(u.GLOBAL_MUTE, this.globalMute, this);
},
addedToScene: function () {
this.scene.sys.updateList.add(this);
},
removedFromScene: function () {
this.scene.sys.updateList.remove(this);
},
play: function (t, e, i) {
if ((this.touchLocked && this.playWhenUnlocked) || this.isPlaying()) return this;
var n = this.video;
if (!n) return this;
void 0 === t && (t = n.loop);
var s = this.scene.sys.sound;
s && s.mute && this.setMute(!0), isNaN(e) || (this._markerIn = e), !isNaN(i) && e < i && (this._markerOut = i), (n.loop = t);
var r = this._callbacks,
o = n.play();
return (
void 0 !== o
? o.then(this.playPromiseSuccessHandler.bind(this)).catch(this.playPromiseErrorHandler.bind(this))
: (n.addEventListener("playing", r.play, !0), n.readyState < 2 && ((this.retry = this.retryLimit), (this._retryID = window.setTimeout(this.checkVideoProgress.bind(this), this.retryInterval)))),
n.addEventListener("ended", r.end, !0),
n.addEventListener("timeupdate", r.time, !0),
n.addEventListener("seeking", r.seeking, !0),
n.addEventListener("seeked", r.seeked, !0),
this
);
},
changeSource: function (t, e, i, n, s) {
void 0 === e && (e = !0), this.video && this.stop();
var r = this.scene.sys.cache.video.get(t);
return (
r
? ((this.video = r),
(this._cacheKey = t),
(this._codePaused = r.paused),
(this._codeMuted = r.muted),
this.videoTexture
? (this.scene.sys.textures.remove(this._key),
(this.videoTexture = this.scene.sys.textures.create(this._key, r, r.videoWidth, r.videoHeight)),
(this.videoTextureSource = this.videoTexture.source[0]),
this.videoTexture.add("__BASE", 0, 0, 0, r.videoWidth, r.videoHeight),
this.setTexture(this.videoTexture),
this.setSizeToFrame(),
this.updateDisplayOrigin(),
this.emit(o.VIDEO_CREATED, this, r.videoWidth, r.videoHeight))
: this.updateTexture(),
(r.currentTime = 0),
(this._lastUpdate = 0),
e && this.play(i, n, s))
: (this.video = null),
this
);
},
addMarker: function (t, e, i) {
return !isNaN(e) && 0 <= e && !isNaN(i) && (this.markers[t] = [e, i]), this;
},
playMarker: function (t, e) {
var i = this.markers[t];
return i && this.play(e, i[0], i[1]), this;
},
removeMarker: function (t) {
return delete this.markers[t], this;
},
snapshot: function (t, e) {
return void 0 === t && (t = this.width), void 0 === e && (e = this.height), this.snapshotArea(0, 0, this.width, this.height, t, e);
},
snapshotArea: function (t, e, i, n, s, r) {
void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = this.width), void 0 === n && (n = this.height), void 0 === s && (s = i), void 0 === r && (r = n);
var o = this.video,
a = this.snapshotTexture;
return a ? a.setSize(s, r) : ((a = this.scene.sys.textures.createCanvas(c(), s, r)), (this.snapshotTexture = a)), o && a.context.drawImage(o, t, e, i, n, 0, 0, s, r), a.update();
},
saveSnapshotTexture: function (t) {
return (
this.snapshotTexture ? this.scene.sys.textures.renameTexture(this.snapshotTexture.key, t) : (this.snapshotTexture = this.scene.sys.textures.createCanvas(t, this.width, this.height)), this.snapshotTexture
);
},
loadURL: function (t, e, i) {
void 0 === e && (e = "loadeddata"), void 0 === i && (i = !1), this.video && this.stop(), this.videoTexture && this.scene.sys.textures.remove(this._key);
var n = document.createElement("video");
return (
(n.controls = !1),
i && ((n.muted = !0), (n.defaultMuted = !0), n.setAttribute("autoplay", "autoplay")),
n.setAttribute("playsinline", "playsinline"),
n.setAttribute("preload", "auto"),
n.addEventListener("error", this._callbacks.error, !0),
(n.src = t),
n.load(),
(this.video = n),
this
);
},
loadMediaStream: function (t, e, i) {
void 0 === e && (e = "loadeddata"), void 0 === i && (i = !1), this.video && this.stop(), this.videoTexture && this.scene.sys.textures.remove(this._key);
var n = document.createElement("video");
(n.controls = !1),
i && ((n.muted = !0), (n.defaultMuted = !0), n.setAttribute("autoplay", "autoplay")),
n.setAttribute("playsinline", "playsinline"),
n.setAttribute("preload", "auto"),
n.addEventListener("error", this._callbacks.error, !0);
try {
n.srcObject = t;
} catch (e) {
n.src = window.URL.createObjectURL(t);
}
return n.load(), (this.video = n), this;
},
playPromiseSuccessHandler: function () {
(this._codePaused = !1), (this.touchLocked = !1), this.emit(o.VIDEO_PLAY, this), -1 < this._markerIn && (this.video.currentTime = this._markerIn);
},
playPromiseErrorHandler: function (t) {
this.scene.sys.input.once(h.POINTER_DOWN, this.unlockHandler, this), (this.touchLocked = !0), (this.playWhenUnlocked = !0), this.emit(o.VIDEO_ERROR, this, t);
},
playHandler: function () {
(this._codePaused = !1), (this.touchLocked = !1), this.emit(o.VIDEO_PLAY, this), this.video.removeEventListener("playing", this._callbacks.play, !0);
},
loadErrorHandler: function (t) {
this.stop(), this.emit(o.VIDEO_ERROR, this, t);
},
unlockHandler: function () {
(this.touchLocked = !1), (this.playWhenUnlocked = !1), this.emit(o.VIDEO_UNLOCKED, this), -1 < this._markerIn && (this.video.currentTime = this._markerIn), this.video.play(), this.emit(o.VIDEO_PLAY, this);
},
completeHandler: function () {
this.emit(o.VIDEO_COMPLETE, this);
},
timeUpdateHandler: function () {
this.video && this.video.currentTime < this._lastUpdate && (this.emit(o.VIDEO_LOOP, this), (this._lastUpdate = 0));
},
preUpdate: function () {
var t,
e = this.video;
!e ||
((t = e.currentTime) !== this._lastUpdate &&
((this._lastUpdate = t),
this.updateTexture(),
t >= this._markerOut && (e.loop ? ((e.currentTime = this._markerIn), this.updateTexture(), (this._lastUpdate = t), this.emit(o.VIDEO_LOOP, this)) : (this.emit(o.VIDEO_COMPLETE, this), this.stop()))));
},
checkVideoProgress: function () {
2 <= this.video.readyState
? this.updateTexture()
: (this.retry--, 0 < this.retry ? (this._retryID = window.setTimeout(this.checkVideoProgress.bind(this), this.retryInterval)) : this.emit(o.VIDEO_TIMEOUT, this));
},
updateTexture: function () {
var t,
e = this.video,
i = e.videoWidth,
n = e.videoHeight;
this.videoTexture
? ((t = this.videoTextureSource).source !== e && ((t.source = e), (t.width = i), (t.height = n)), t.update())
: ((this.videoTexture = this.scene.sys.textures.create(this._key, e, i, n)),
(this.videoTextureSource = this.videoTexture.source[0]),
this.videoTexture.add("__BASE", 0, 0, 0, i, n),
this.setTexture(this.videoTexture),
this.setSizeToFrame(),
this.updateDisplayOrigin(),
this.emit(o.VIDEO_CREATED, this, i, n));
},
getVideoKey: function () {
return this._cacheKey;
},
seekTo: function (t) {
var e,
i,
n = this.video;
return n && ((e = n.duration) === 1 / 0 || isNaN(e) || ((i = e * t), this.setCurrentTime(i))), this;
},
getCurrentTime: function () {
return this.video ? this.video.currentTime : 0;
},
setCurrentTime: function (t) {
var e,
i,
n = this.video;
return (
n && ("string" == typeof t && ((e = t[0]), (i = parseFloat(t.substr(1))), "+" === e ? (t = n.currentTime + i) : "-" === e && (t = n.currentTime - i)), (n.currentTime = t), (this._lastUpdate = t)), this
);
},
isSeeking: function () {
return this._isSeeking;
},
seekingHandler: function () {
(this._isSeeking = !0), this.emit(o.VIDEO_SEEKING, this);
},
seekedHandler: function () {
(this._isSeeking = !1), this.emit(o.VIDEO_SEEKED, this), this.video && this.updateTexture();
},
getProgress: function () {
var t = this.video;
if (t) {
var e = t.currentTime,
i = t.duration;
if (i !== 1 / 0 && !isNaN(i)) return e / i;
}
return 0;
},
getDuration: function () {
return this.video ? this.video.duration : 0;
},
setMute: function (t) {
void 0 === t && (t = !0), (this._codeMuted = t);
var e = this.video;
return e && (e.muted = !!this._systemMuted || t), this;
},
isMuted: function () {
return this._codeMuted;
},
globalMute: function (t, e) {
this._systemMuted = e;
var i = this.video;
i && (i.muted = !!this._codeMuted || e);
},
globalPause: function () {
(this._systemPaused = !0), this.video && this.video.pause();
},
globalResume: function () {
(this._systemPaused = !1), this.video && !this._codePaused && this.video.play();
},
setPaused: function (t) {
void 0 === t && (t = !0);
var e = this.video;
return (this._codePaused = t), e && (t ? e.paused || e.pause() : t || (e.paused && !this._systemPaused && e.play())), this;
},
getVolume: function () {
return this.video ? this.video.volume : 1;
},
setVolume: function (t) {
return void 0 === t && (t = 1), this.video && (this.video.volume = s(t, 0, 1)), this;
},
getPlaybackRate: function () {
return this.video ? this.video.playbackRate : 1;
},
setPlaybackRate: function (t) {
return this.video && (this.video.playbackRate = t), this;
},
getLoop: function () {
return !!this.video && this.video.loop;
},
setLoop: function (t) {
return void 0 === t && (t = !0), this.video && (this.video.loop = t), this;
},
isPlaying: function () {
return !!this.video && !(this.video.paused || this.video.ended);
},
isPaused: function () {
return (this.video && this.video.paused) || this._codePaused || this._systemPaused;
},
saveTexture: function (t, e) {
return (
void 0 === e && (e = !1),
this.videoTexture && this.scene.sys.textures.renameTexture(this._key, t),
(this._key = t),
(this.flipY = e),
this.videoTextureSource && this.videoTextureSource.setFlipY(e),
this.videoTexture
);
},
stop: function () {
var t = this.video;
if (t) {
var e = this._callbacks;
for (var i in e) t.removeEventListener(i, e[i], !0);
t.pause();
}
return this._retryID && window.clearTimeout(this._retryID), this.emit(o.VIDEO_STOP, this), this;
},
removeVideoElement: function () {
var t = this.video;
if (t) {
for (t.parentNode && t.parentNode.removeChild(t); t.hasChildNodes(); ) t.removeChild(t.firstChild);
t.removeAttribute("autoplay"), t.removeAttribute("src"), (this.video = null);
}
},
preDestroy: function () {
this.stop(), this.removeVideoElementOnDestroy && this.removeVideoElement();
var t = this.scene.sys.game.events;
t.off(a.PAUSE, this.globalPause, this), t.off(a.RESUME, this.globalResume, this);
var e = this.scene.sys.sound;
e && e.off(u.GLOBAL_MUTE, this.globalMute, this), this._retryID && window.clearTimeout(this._retryID);
},
});
t.exports = p;
},
function (t, e, i) {
var n = i(0),
s = i(228),
r = i(470),
o = i(56),
a = new n({
initialize: function (t) {
(this.type = o.POLYGON), (this.area = 0), (this.points = []), t && this.setTo(t);
},
contains: function (t, e) {
return s(this, t, e);
},
setTo: function (t) {
if (((this.area = 0), (this.points = []), "string" == typeof t && (t = t.split(" ")), !Array.isArray(t))) return this;
for (var e, i = Number.MAX_VALUE, n = 0; n < t.length; n++)
(e = { x: 0, y: 0 }),
"number" == typeof t[n] || "string" == typeof t[n]
? ((e.x = parseFloat(t[n])), (e.y = parseFloat(t[n + 1])), n++)
: Array.isArray(t[n])
? ((e.x = t[n][0]), (e.y = t[n][1]))
: ((e.x = t[n].x), (e.y = t[n].y)),
this.points.push(e),
e.y < i && (i = e.y);
return this.calculateArea(i), this;
},
calculateArea: function () {
if (this.points.length < 3) return (this.area = 0), this.area;
for (var t, e, i = 0, n = 0; n < this.points.length - 1; n++) (t = this.points[n]), (i += ((e = this.points[n + 1]).x - t.x) * (t.y + e.y));
return (t = this.points[0]), (e = this.points[this.points.length - 1]), (i += (t.x - e.x) * (e.y + t.y)), (this.area = 0.5 * -i), this.area;
},
getPoints: function (t, e, i) {
return r(this, t, e, i);
},
});
t.exports = a;
},
function (t, e) {
t.exports = function (t, e, i) {
for (var n = !1, s = -1, r = t.points.length - 1; ++s < t.points.length; r = s) {
var o = t.points[s].x,
a = t.points[s].y,
h = t.points[r].x,
l = t.points[r].y;
((a <= i && i < l) || (l <= i && i < a)) && e < ((h - o) * (i - a)) / (l - a) + o && (n = !n);
}
return n;
};
},
function (t, e, i) {
var n = i(0),
s = i(11),
l = i(15),
c = i(2),
u = i(17),
r = i(478),
o = i(1176),
d = i(25),
a = new n({
Extends: l,
Mixins: [s.ComputedSize, s.Depth, s.GetBounds, s.Mask, s.Origin, s.ScrollFactor, s.Transform, s.Visible, o],
initialize: function (t, e, i, n, s, r, o, a) {
void 0 === i && (i = 0), void 0 === n && (n = 0), void 0 === s && (s = 128), void 0 === r && (r = 128), l.call(this, t, "Shader"), (this.blendMode = -1), this.shader;
var h = t.sys.renderer;
(this.renderer = h),
(this.gl = h.gl),
(this.vertexData = new ArrayBuffer(2 * Float32Array.BYTES_PER_ELEMENT * 6)),
(this.vertexBuffer = h.createVertexBuffer(this.vertexData.byteLength, this.gl.STREAM_DRAW)),
(this.program = null),
(this.bytes = new Uint8Array(this.vertexData)),
(this.vertexViewF32 = new Float32Array(this.vertexData)),
(this._tempMatrix1 = new d()),
(this._tempMatrix2 = new d()),
(this._tempMatrix3 = new d()),
(this.viewMatrix = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])),
(this.projectionMatrix = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])),
(this.uniforms = {}),
(this.pointer = null),
(this._rendererWidth = h.width),
(this._rendererHeight = h.height),
(this._textureCount = 0),
(this.framebuffer = null),
(this.glTexture = null),
(this.renderToTexture = !1),
(this.texture = null),
this.setPosition(i, n),
this.setSize(s, r),
this.setOrigin(0.5, 0.5),
this.setShader(e, o, a);
},
willRender: function (t) {
return !!this.renderToTexture || !(l.RENDER_MASK !== this.renderFlags || (0 !== this.cameraFilter && this.cameraFilter & t.id));
},
setRenderToTexture: function (t, e) {
var i, n, s;
return (
void 0 === e && (e = !1),
this.renderToTexture ||
((i = this.width),
(n = this.height),
(s = this.renderer),
(this.glTexture = s.createTextureFromSource(null, i, n, 0)),
(this.glTexture.flipY = e),
(this.framebuffer = s.createFramebuffer(i, n, this.glTexture, !1)),
(this._rendererWidth = i),
(this._rendererHeight = n),
(this.renderToTexture = !0),
this.projOrtho(0, this.width, this.height, 0),
t && (this.texture = this.scene.sys.textures.addGLTexture(t, this.glTexture, i, n))),
this.shader && (s.pipelines.clear(), this.load(), this.flush(), s.pipelines.rebind()),
this
);
},
setShader: function (t, e, i) {
if ((void 0 === e && (e = []), "string" == typeof t)) {
var n = this.scene.sys.cache.shader;
if (!n.has(t)) return this;
this.shader = n.get(t);
} else this.shader = t;
var s = this.gl,
r = this.renderer;
this.program && s.deleteProgram(this.program);
var o = r.createProgram(this.shader.vertexSrc, this.shader.fragmentSrc);
s.uniformMatrix4fv(s.getUniformLocation(o, "uViewMatrix"), !1, this.viewMatrix),
s.uniformMatrix4fv(s.getUniformLocation(o, "uProjectionMatrix"), !1, this.projectionMatrix),
s.uniform2f(s.getUniformLocation(o, "uResolution"), this.width, this.height),
(this.program = o);
var a = new Date(),
h = {
resolution: { type: "2f", value: { x: this.width, y: this.height } },
time: { type: "1f", value: 0 },
mouse: { type: "2f", value: { x: this.width / 2, y: this.height / 2 } },
date: { type: "4fv", value: [a.getFullYear(), a.getMonth(), a.getDate(), 60 * a.getHours() * 60 + 60 * a.getMinutes() + a.getSeconds()] },
sampleRate: { type: "1f", value: 44100 },
iChannel0: { type: "sampler2D", value: null, textureData: { repeat: !0 } },
iChannel1: { type: "sampler2D", value: null, textureData: { repeat: !0 } },
iChannel2: { type: "sampler2D", value: null, textureData: { repeat: !0 } },
iChannel3: { type: "sampler2D", value: null, textureData: { repeat: !0 } },
};
this.shader.uniforms ? (this.uniforms = u(!0, {}, this.shader.uniforms, h)) : (this.uniforms = h);
for (var l = 0; l < 4; l++) e[l] && this.setSampler2D("iChannel" + l, e[l], l, i);
return this.initUniforms(), this.projOrtho(0, this._rendererWidth, this._rendererHeight, 0), this;
},
setPointer: function (t) {
return (this.pointer = t), this;
},
projOrtho: function (t, e, i, n) {
var s = 1 / (t - e),
r = 1 / (i - n),
o = this.projectionMatrix;
(o[0] = -2 * s), (o[5] = -2 * r), (o[10] = -0.001), (o[12] = (t + e) * s), (o[13] = (n + i) * r), (o[14] = -0);
var a = this.program,
h = this.gl;
this.renderer.setProgram(a), h.uniformMatrix4fv(h.getUniformLocation(a, "uProjectionMatrix"), !1, this.projectionMatrix), (this._rendererWidth = e), (this._rendererHeight = i);
},
initUniforms: function () {
var t = this.gl,
e = this.renderer.glFuncMap,
i = this.program;
for (var n in ((this._textureCount = 0), this.uniforms)) {
var s = this.uniforms[n],
r = s.type,
o = e[r];
(s.uniformLocation = t.getUniformLocation(i, n)), "sampler2D" !== r && ((s.glMatrix = o.matrix), (s.glValueLength = o.length), (s.glFunc = o.func));
}
},
setSampler2DBuffer: function (t, e, i, n, s, r) {
void 0 === s && (s = 0), void 0 === r && (r = {});
var o = this.uniforms[t];
return (o.value = e), (r.width = i), (r.height = n), (o.textureData = r), (this._textureCount = s), this.initSampler2D(o), this;
},
setSampler2D: function (t, e, i, n) {
void 0 === i && (i = 0);
var s = this.scene.sys.textures;
if (s.exists(e)) {
var r = s.getFrame(e);
if (r.glTexture && r.glTexture.isRenderTexture) return this.setSampler2DBuffer(t, r.glTexture, r.width, r.height, i, n);
var o = this.uniforms[t],
a = r.source;
(o.textureKey = e),
(o.source = a.image),
(o.value = r.glTexture),
a.isGLTexture && (((n = n || {}).width = a.width), (n.height = a.height)),
n && (o.textureData = n),
(this._textureCount = i),
this.initSampler2D(o);
}
return this;
},
setUniform: function (t, e) {
return r(this.uniforms, t, e), this;
},
getUniform: function (t) {
return c(this.uniforms, t, null);
},
setChannel0: function (t, e) {
return this.setSampler2D("iChannel0", t, 0, e);
},
setChannel1: function (t, e) {
return this.setSampler2D("iChannel1", t, 1, e);
},
setChannel2: function (t, e) {
return this.setSampler2D("iChannel2", t, 2, e);
},
setChannel3: function (t, e) {
return this.setSampler2D("iChannel3", t, 3, e);
},
initSampler2D: function (t) {
var e, i, n, s, r, o, a, h, l, u;
t.value &&
((e = this.gl).activeTexture(e.TEXTURE0 + this._textureCount),
e.bindTexture(e.TEXTURE_2D, t.value),
(i = t.textureData) &&
!t.value.isRenderTexture &&
((n = e[c(i, "magFilter", "linear").toUpperCase()]),
(s = e[c(i, "minFilter", "linear").toUpperCase()]),
(r = e[c(i, "wrapS", "repeat").toUpperCase()]),
(o = e[c(i, "wrapT", "repeat").toUpperCase()]),
(a = e[c(i, "format", "rgba").toUpperCase()]),
i.repeat && ((r = e.REPEAT), (o = e.REPEAT)),
e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, !!i.flipY),
i.width
? ((h = c(i, "width", 512)), (l = c(i, "height", 2)), (u = c(i, "border", 0)), e.texImage2D(e.TEXTURE_2D, 0, a, h, l, u, a, e.UNSIGNED_BYTE, null))
: e.texImage2D(e.TEXTURE_2D, 0, a, e.RGBA, e.UNSIGNED_BYTE, t.source),
e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, n),
e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, s),
e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, r),
e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, o)),
this.renderer.setProgram(this.program),
e.uniform1i(t.uniformLocation, this._textureCount),
this._textureCount++);
},
syncUniforms: function () {
var t,
e,
i,
n,
s,
r = this.gl,
o = this.uniforms,
a = 0;
for (var h in o)
(i = (t = o[h]).glFunc),
(e = t.glValueLength),
(n = t.uniformLocation),
null !== (s = t.value) &&
(1 === e
? t.glMatrix
? i.call(r, n, t.transpose, s)
: i.call(r, n, s)
: 2 === e
? i.call(r, n, s.x, s.y)
: 3 === e
? i.call(r, n, s.x, s.y, s.z)
: 4 === e
? i.call(r, n, s.x, s.y, s.z, s.w)
: "sampler2D" === t.type && (r.activeTexture(r.TEXTURE0 + a), r.bindTexture(r.TEXTURE_2D, s), r.uniform1i(n, a), a++));
},
load: function (t) {
var e,
i,
n = this.gl,
s = this.width,
r = this.height,
o = this.renderer,
a = this.program,
h = this.viewMatrix;
this.renderToTexture ||
((e = -this._displayOriginX),
(i = -this._displayOriginY),
(h[0] = t[0]),
(h[1] = t[1]),
(h[4] = t[2]),
(h[5] = t[3]),
(h[8] = t[4]),
(h[9] = t[5]),
(h[12] = h[0] * e + h[4] * i),
(h[13] = h[1] * e + h[5] * i)),
n.useProgram(a),
n.uniformMatrix4fv(n.getUniformLocation(a, "uViewMatrix"), !1, h),
n.uniform2f(n.getUniformLocation(a, "uResolution"), this.width, this.height);
var l = this.uniforms,
u = l.resolution;
(u.value.x = s), (u.value.y = r), (l.time.value = o.game.loop.getDuration());
var c,
d,
f,
p = this.pointer;
p && ((c = l.mouse), (d = p.x / s), (f = 1 - p.y / r), (c.value.x = d.toFixed(2)), (c.value.y = f.toFixed(2))), this.syncUniforms();
},
flush: function () {
var t = this.width,
e = this.height,
i = this.program,
n = this.gl,
s = this.vertexBuffer,
r = this.renderer,
o = 2 * Float32Array.BYTES_PER_ELEMENT;
this.renderToTexture && (r.setFramebuffer(this.framebuffer), n.clearColor(0, 0, 0, 0), n.clear(n.COLOR_BUFFER_BIT)), n.bindBuffer(n.ARRAY_BUFFER, s);
var a = n.getAttribLocation(i, "inPosition");
-1 !== a && (n.enableVertexAttribArray(a), n.vertexAttribPointer(a, 2, n.FLOAT, !1, o, 0));
var h = this.vertexViewF32;
(h[3] = e),
(h[4] = t),
(h[5] = e),
(h[8] = t),
(h[9] = e),
(h[10] = t),
n.bufferSubData(n.ARRAY_BUFFER, 0, this.bytes.subarray(0, 6 * o)),
n.drawArrays(n.TRIANGLES, 0, 6),
this.renderToTexture && r.setFramebuffer(null, !1);
},
setAlpha: function () {},
setBlendMode: function () {},
preDestroy: function () {
var t = this.gl;
t.deleteProgram(this.program),
t.deleteBuffer(this.vertexBuffer),
this.renderToTexture && (this.renderer.deleteFramebuffer(this.framebuffer), this.texture.destroy(), (this.framebuffer = null), (this.glTexture = null), (this.texture = null));
},
});
t.exports = a;
},
function (t, e, i) {
var n = i(0),
s = i(11),
r = i(36),
o = i(116),
f = i(15),
h = i(479),
u = i(480),
l = i(19),
p = i(69),
a = i(1179),
c = i(79),
g = i(39),
d = i(117),
v = new n({
Extends: f,
Mixins: [s.AlphaSingle, s.BlendMode, s.Depth, s.Mask, s.Pipeline, s.Size, s.Texture, s.Transform, s.Visible, s.ScrollFactor, a],
initialize: function (t, e, i, n, s, r, o, a, h, l, u, c) {
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = "__WHITE"),
f.call(this, t, "Mesh"),
(this.faces = []),
(this.vertices = []),
(this.tintFill = !1),
(this.debugCallback = null),
(this.debugGraphic = null),
(this.hideCCW = !0),
(this.modelPosition = new g()),
(this.modelScale = new g(1, 1, 1)),
(this.modelRotation = new g()),
(this.dirtyCache = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]),
(this.transformMatrix = new p()),
(this.viewPosition = new g()),
(this.viewMatrix = new p()),
(this.projectionMatrix = new p()),
(this.totalRendered = 0),
(this.totalFrame = 0),
(this.ignoreDirtyCache = !1);
var d = t.sys.renderer;
this.setPosition(e, i), this.setTexture(n, s), this.setSize(d.width, d.height), this.initPipeline(), this.setPerspective(d.width, d.height), r && this.addVertices(r, o, a, h, l, u, c);
},
addedToScene: function () {
this.scene.sys.updateList.add(this);
},
removedFromScene: function () {
this.scene.sys.updateList.remove(this);
},
panX: function (t) {
return this.viewPosition.addScale(g.LEFT, t), (this.dirtyCache[10] = 1), this;
},
panY: function (t) {
return (this.viewPosition.y += g.DOWN.y * t), (this.dirtyCache[10] = 1), this;
},
panZ: function (t) {
return (this.viewPosition.z += t), (this.dirtyCache[10] = 1), this;
},
setPerspective: function (t, e, i, n, s) {
return void 0 === i && (i = 45), void 0 === n && (n = 0.01), void 0 === s && (s = 1e3), this.projectionMatrix.perspective(r(i), t / e, n, s), (this.dirtyCache[10] = 1), (this.dirtyCache[11] = 0), this;
},
setOrtho: function (t, e, i, n) {
return (
void 0 === t && (t = this.scene.sys.renderer.getAspectRatio()),
void 0 === e && (e = 1),
void 0 === i && (i = -1e3),
void 0 === n && (n = 1e3),
this.projectionMatrix.ortho(-t, t, -e, e, i, n),
(this.dirtyCache[10] = 1),
(this.dirtyCache[11] = 1),
this
);
},
clear: function () {
return (
this.faces.forEach(function (t) {
t.destroy();
}),
(this.faces = []),
(this.vertices = []),
this
);
},
addVerticesFromObj: function (t, e, i, n, s, r, o, a, h) {
var l = this.scene.sys.cache.obj.get(t);
return l && u(l, this, e, i, n, s, r, o, a, h), this;
},
sortByDepth: function (t, e) {
return t.depth - e.depth;
},
depthSort: function () {
return c(this.faces, this.sortByDepth), this;
},
addVertex: function (t, e, i, n, s, r, o) {
var a = new d(t, e, i, n, s, r, o);
return this.vertices.push(a), a;
},
addFace: function (t, e, i) {
var n = new o(t, e, i);
return this.faces.push(n), (this.dirtyCache[9] = -1), n;
},
addVertices: function (t, e, i, n, s, r, o) {
var a = h(t, e, i, n, s, r, o);
return a && ((this.faces = this.faces.concat(a.faces)), (this.vertices = this.vertices.concat(a.vertices))), (this.dirtyCache[9] = -1), this;
},
getFaceCount: function () {
return this.faces.length;
},
getVertexCount: function () {
return this.vertices.length;
},
getFace: function (t) {
return this.faces[t];
},
getFaceAt: function (t, e, i) {
void 0 === i && (i = this.scene.sys.cameras.main);
for (var n = l(this, i).calc, s = this.faces, r = [], o = 0; o < s.length; o++) {
var a = s[o];
a.contains(t, e, n) && r.push(a);
}
return c(r, this.sortByDepth);
},
setDebug: function (t, e) {
return (this.debugGraphic = t), (this.debugCallback = t || e ? e || this.renderDebug : null), this;
},
isDirty: function () {
var t = this.modelPosition,
e = this.modelRotation,
i = this.modelScale,
n = this.dirtyCache,
s = t.x,
r = t.y,
o = t.z,
a = e.x,
h = e.y,
l = e.z,
u = i.x,
c = i.y,
d = i.z,
f = this.getFaceCount(),
p = n[0],
g = n[1],
v = n[2],
y = n[3],
m = n[4],
x = n[5],
b = n[6],
w = n[7],
T = n[8],
S = n[9];
return (
(n[0] = s),
(n[1] = r),
(n[2] = o),
(n[3] = a),
(n[4] = h),
(n[5] = l),
(n[6] = u),
(n[7] = c),
(n[8] = d),
(n[9] = f),
p !== s || g !== r || v !== o || y !== a || m !== h || x !== l || b !== u || w !== c || T !== d || S !== f
);
},
preUpdate: function () {
(this.totalRendered = this.totalFrame), (this.totalFrame = 0);
var t = this.dirtyCache;
if (this.ignoreDirtyCache || t[10] || this.isDirty()) {
var e = this.width,
i = this.height,
n = this.viewMatrix,
s = this.viewPosition;
t[10] && (n.identity(), n.translate(s), n.invert(), (t[10] = 0));
var r = this.transformMatrix;
r.setWorldMatrix(this.modelRotation, this.modelPosition, this.modelScale, this.viewMatrix, this.projectionMatrix);
for (var o = s.z, a = this.faces, h = 0; h < a.length; h++) a[h].transformCoordinatesLocal(r, e, i, o);
this.depthSort();
}
},
renderDebug: function (t, e) {
for (var i = t.debugGraphic, n = 0; n < e.length; n++) {
var s = e[n],
r = s.vertex1.tx,
o = s.vertex1.ty,
a = s.vertex2.tx,
h = s.vertex2.ty,
l = s.vertex3.tx,
u = s.vertex3.ty;
i.strokeTriangle(r, o, a, h, l, u);
}
},
preDestroy: function () {
this.clear(), (this.debugCallback = null), (this.debugGraphic = null);
},
});
t.exports = v;
},
function (t, e, i) {
var n = i(50);
t.exports = function (t, e) {
return n(t.x, t.y, e.x, e.y) <= t.radius + e.radius;
};
},
function (t, e, i) {
var b = i(4),
w = i(233);
t.exports = function (t, e, i) {
var n, s, r, o, a, h, l, u, c, d, f, p, g, v, y, m, x;
return (
void 0 === i && (i = []),
w(t, e) &&
((n = t.x1),
(s = t.y1),
(r = t.x2),
(o = t.y2),
0 == (p = (f = 2 * ((h = r - n) * (u = n - e.x) + (l = o - s) * (c = s - e.y))) * f - 4 * (d = h * h + l * l) * (u * u + c * c - (a = e.radius) * a))
? ((v = n + (g = -f / (2 * d)) * h), (y = s + g * l), 0 <= g && g <= 1 && i.push(new b(v, y)))
: 0 < p &&
((v = n + (m = (-f - Math.sqrt(p)) / (2 * d)) * h),
(y = s + m * l),
0 <= m && m <= 1 && i.push(new b(v, y)),
(v = n + (x = (-f + Math.sqrt(p)) / (2 * d)) * h),
(y = s + x * l),
0 <= x && x <= 1 && i.push(new b(v, y)))),
i
);
};
},
function (t, e, i) {
var c = i(66),
d = new (i(4))();
t.exports = function (t, e, i) {
if ((void 0 === i && (i = d), c(e, t.x1, t.y1))) return (i.x = t.x1), (i.y = t.y1), !0;
if (c(e, t.x2, t.y2)) return (i.x = t.x2), (i.y = t.y2), !0;
var n,
s = t.x2 - t.x1,
r = t.y2 - t.y1,
o = e.x - t.x1,
a = e.y - t.y1,
h = s * s + r * r,
l = s,
u = r;
return 0 < h && ((l *= n = (o * s + a * r) / h), (u *= n)), (i.x = t.x1 + l), (i.y = t.y1 + u), l * l + u * u <= h && 0 <= l * s + u * r && c(e, i.x, i.y);
};
},
function (t, e, i) {
var u = i(4),
c = i(96),
d = i(488);
t.exports = function (t, e, i) {
if ((void 0 === i && (i = []), d(t, e)))
for (var n = e.getLineA(), s = e.getLineB(), r = e.getLineC(), o = e.getLineD(), a = [new u(), new u(), new u(), new u()], h = [c(n, t, a[0]), c(s, t, a[1]), c(r, t, a[2]), c(o, t, a[3])], l = 0; l < 4; l++)
h[l] && i.push(a[l]);
return i;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
void 0 === i && (i = !1), void 0 === n && (n = []);
for (
var s,
r,
o,
a,
h,
l,
u = t.x3 - t.x1,
c = t.y3 - t.y1,
d = t.x2 - t.x1,
f = t.y2 - t.y1,
p = u * u + c * c,
g = u * d + c * f,
v = d * d + f * f,
y = p * v - g * g,
m = 0 == y ? 0 : 1 / y,
x = t.x1,
b = t.y1,
w = 0;
w < e.length && ((r = (p * (l = d * (o = e[w].x - x) + f * (a = e[w].y - b)) - g * (h = u * o + c * a)) * m), !(0 <= (s = (v * h - g * l) * m) && 0 <= r && s + r < 1 && (n.push({ x: e[w].x, y: e[w].y }), i)));
w++
);
return n;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = Math.cos(n),
r = Math.sin(n),
o = t.x1 - e,
a = t.y1 - i;
return (t.x1 = o * s - a * r + e), (t.y1 = o * r + a * s + i), (o = t.x2 - e), (a = t.y2 - i), (t.x2 = o * s - a * r + e), (t.y2 = o * r + a * s + i), t;
};
},
function (t, e) {
t.exports = function (t) {
return 0 === t.height ? NaN : t.width / t.height;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = Math.cos(n),
r = Math.sin(n),
o = t.x1 - e,
a = t.y1 - i;
return (
(t.x1 = o * s - a * r + e),
(t.y1 = o * r + a * s + i),
(o = t.x2 - e),
(a = t.y2 - i),
(t.x2 = o * s - a * r + e),
(t.y2 = o * r + a * s + i),
(o = t.x3 - e),
(a = t.y3 - i),
(t.x3 = o * s - a * r + e),
(t.y3 = o * r + a * s + i),
t
);
};
},
function (t, e, i) {
t.exports = { BUTTON_DOWN: i(1310), BUTTON_UP: i(1311), CONNECTED: i(1312), DISCONNECTED: i(1313), GAMEPAD_BUTTON_DOWN: i(1314), GAMEPAD_BUTTON_UP: i(1315) };
},
function (t, e, i) {
var s = i(17),
r = i(156);
t.exports = function (t, e) {
var i = void 0 === t ? r() : s({}, t);
if (e) for (var n in e) void 0 !== e[n] && (i[n] = e[n]);
return i;
};
},
function (t, e, i) {
var n = i(0),
s = i(21),
a = i(23),
r = i(8),
h = i(2),
l = i(7),
o = i(408),
u = new n({
Extends: a,
initialize: function (t, e, i, n) {
var s,
r = "xml";
l(e) && ((e = h((s = e), "key")), (i = h(s, "url")), (n = h(s, "xhrSettings")), (r = h(s, "extension", r)));
var o = { type: "xml", cache: t.cacheManager.xml, extension: r, responseType: "text", key: e, url: i, xhrSettings: n };
a.call(this, t, o);
},
onProcess: function () {
(this.state = s.FILE_PROCESSING), (this.data = o(this.xhrLoader.responseText)), this.data ? this.onProcessComplete() : this.onProcessError();
},
});
r.register("xml", function (t, e, i) {
if (Array.isArray(t)) for (var n = 0; n < t.length; n++) this.addFile(new u(this, t[n]));
else this.addFile(new u(this, t, e, i));
return this;
}),
(t.exports = u);
},
function (t, e, i) {
var n = i(0),
s = i(21),
l = i(23),
r = i(8),
u = i(2),
c = i(7),
o = new n({
Extends: l,
initialize: function (t, e, i, n) {
var s,
r = "text",
o = "txt",
a = t.cacheManager.text;
c(e) && ((e = u((s = e), "key")), (i = u(s, "url")), (n = u(s, "xhrSettings")), (o = u(s, "extension", o)), (r = u(s, "type", r)), (a = u(s, "cache", a)));
var h = { type: r, cache: a, extension: o, responseType: "text", key: e, url: i, xhrSettings: n };
l.call(this, t, h);
},
onProcess: function () {
(this.state = s.FILE_PROCESSING), (this.data = this.xhrLoader.responseText), this.onProcessComplete();
},
});
r.register("text", function (t, e, i) {
if (Array.isArray(t)) for (var n = 0; n < t.length; n++) this.addFile(new o(this, t[n]));
else this.addFile(new o(this, t, e, i));
return this;
}),
(t.exports = o);
},
function (t, e, i) {
t.exports = {
Acceleration: i(1368),
Angular: i(1369),
Bounce: i(1370),
Debug: i(1371),
Drag: i(1372),
Enable: i(1373),
Friction: i(1374),
Gravity: i(1375),
Immovable: i(1376),
Mass: i(1377),
OverlapCirc: i(523),
OverlapRect: i(244),
Pushable: i(1378),
Size: i(1379),
Velocity: i(1380),
};
},
function (t, e) {
t.exports = function (t, e, i, n, s, r, o) {
void 0 === r && (r = !0), void 0 === o && (o = !1);
var a,
h,
l,
u = [],
c = [],
d = t.treeMinMax;
return (
(d.minX = e),
(d.minY = i),
(d.maxX = e + n),
(d.maxY = i + s),
o && (c = t.staticTree.search(d)),
r && t.useTree
? (u = t.tree.search(d))
: r &&
((a = t.bodies),
(h = { position: { x: e, y: i }, left: e, top: i, right: e + n, bottom: i + s, isCircle: !1 }),
(l = t.intersects),
a.iterate(function (t) {
l(t, h) && u.push(t);
})),
c.concat(u)
);
};
},
function (t, e, i) {
t.exports = { COLLIDE: i(1381), OVERLAP: i(1382), PAUSE: i(1383), RESUME: i(1384), TILE_COLLIDE: i(1385), TILE_OVERLAP: i(1386), WORLD_BOUNDS: i(1387), WORLD_STEP: i(1388) };
},
function (t, e, i) {
var o = i(62);
t.exports = function (t, e, i, n) {
var s = 0,
r = t.deltaAbsX() + e.deltaAbsX() + n;
return (
0 === t._dx && 0 === e._dx
? ((t.embedded = !0), (e.embedded = !0))
: t._dx > e._dx
? (r < (s = t.right - e.x) && !i) || !1 === t.checkCollision.right || !1 === e.checkCollision.left
? (s = 0)
: ((t.touching.none = !1),
(t.touching.right = !0),
(e.touching.none = !1),
(e.touching.left = !0),
e.physicsType !== o.STATIC_BODY || i || ((t.blocked.none = !1), (t.blocked.right = !0)),
t.physicsType !== o.STATIC_BODY || i || ((e.blocked.none = !1), (e.blocked.left = !0)))
: t._dx < e._dx &&
((r < -(s = t.x - e.width - e.x) && !i) || !1 === t.checkCollision.left || !1 === e.checkCollision.right
? (s = 0)
: ((t.touching.none = !1),
(t.touching.left = !0),
(e.touching.none = !1),
(e.touching.right = !0),
e.physicsType !== o.STATIC_BODY || i || ((t.blocked.none = !1), (t.blocked.left = !0)),
t.physicsType !== o.STATIC_BODY || i || ((e.blocked.none = !1), (e.blocked.right = !0)))),
(t.overlapX = s),
(e.overlapX = s)
);
};
},
function (t, e, i) {
var o = i(62);
t.exports = function (t, e, i, n) {
var s = 0,
r = t.deltaAbsY() + e.deltaAbsY() + n;
return (
0 === t._dy && 0 === e._dy
? ((t.embedded = !0), (e.embedded = !0))
: t._dy > e._dy
? (r < (s = t.bottom - e.y) && !i) || !1 === t.checkCollision.down || !1 === e.checkCollision.up
? (s = 0)
: ((t.touching.none = !1),
(t.touching.down = !0),
(e.touching.none = !1),
(e.touching.up = !0),
e.physicsType !== o.STATIC_BODY || i || ((t.blocked.none = !1), (t.blocked.down = !0)),
t.physicsType !== o.STATIC_BODY || i || ((e.blocked.none = !1), (e.blocked.up = !0)))
: t._dy < e._dy &&
((r < -(s = t.y - e.bottom) && !i) || !1 === t.checkCollision.up || !1 === e.checkCollision.down
? (s = 0)
: ((t.touching.none = !1),
(t.touching.up = !0),
(e.touching.none = !1),
(e.touching.down = !0),
e.physicsType !== o.STATIC_BODY || i || ((t.blocked.none = !1), (t.blocked.up = !0)),
t.physicsType !== o.STATIC_BODY || i || ((e.blocked.none = !1), (e.blocked.down = !0)))),
(t.overlapY = s),
(e.overlapY = s)
);
};
},
function (t, e) {
t.exports = function (t, e) {
return !(e.right <= t.left || e.bottom <= t.top || e.position.x >= t.right || e.position.y >= t.bottom);
};
},
function (t, e, i) {
t.exports = {
Bounce: i(1495),
Collision: i(1496),
Force: i(1497),
Friction: i(1498),
Gravity: i(1499),
Mass: i(1500),
Sensor: i(1501),
SetBody: i(1502),
Sleep: i(1503),
Static: i(1520),
Transform: i(1521),
Velocity: i(1522),
};
},
function (t, e) {
var l = {};
((t.exports = l).create = function (t, e) {
var i = t.bodyA,
n = t.bodyB,
s = {
id: l.id(i, n),
bodyA: i,
bodyB: n,
activeContacts: [],
separation: 0,
isActive: !0,
confirmedActive: !0,
isSensor: i.isSensor || n.isSensor,
timeCreated: e,
timeUpdated: e,
collision: null,
inverseMass: 0,
friction: 0,
frictionStatic: 0,
restitution: 0,
slop: 0,
};
return l.update(s, t, e), s;
}),
(l.update = function (t, e, i) {
if ((t.collision = e).collided) {
var n = e.supports,
s = t.activeContacts,
r = e.parentA,
o = e.parentB;
(t.inverseMass = r.inverseMass + o.inverseMass),
(t.friction = Math.min(r.friction, o.friction)),
(t.frictionStatic = Math.max(r.frictionStatic, o.frictionStatic)),
(t.restitution = Math.max(r.restitution, o.restitution)),
(t.slop = Math.max(r.slop, o.slop));
for (var a = 0; a < n.length; a++) s[a] = n[a].contact;
var h = n.length;
h < s.length && (s.length = h), (t.separation = e.depth), l.setActive(t, !0, i);
} else !0 === t.isActive && l.setActive(t, !1, i);
}),
(l.setActive = function (t, e, i) {
e ? ((t.isActive = !0), (t.timeUpdated = i)) : ((t.isActive = !1), (t.activeContacts.length = 0));
}),
(l.id = function (t, e) {
return t.id < e.id ? "A" + t.id + "B" + e.id : "A" + e.id + "B" + t.id;
});
},
function (t, e, i) {
t.exports = {
CalculateFacesAt: i(252),
CalculateFacesWithin: i(63),
CheckIsoBounds: i(541),
Copy: i(1420),
CreateFromTiles: i(1421),
CullBounds: i(543),
CullTiles: i(544),
Fill: i(1422),
FilterTiles: i(1423),
FindByIndex: i(1424),
FindTile: i(1425),
ForEachTile: i(1426),
GetCullTilesFunction: i(1427),
GetTileAt: i(158),
GetTileAtWorldXY: i(1428),
GetTilesWithin: i(26),
GetTilesWithinShape: i(1429),
GetTilesWithinWorldXY: i(529),
GetTileToWorldXFunction: i(1430),
GetTileToWorldXYFunction: i(1431),
GetTileToWorldYFunction: i(1432),
GetWorldToTileXFunction: i(1433),
GetWorldToTileXYFunction: i(1434),
GetWorldToTileYFunction: i(1435),
HasTileAt: i(562),
HasTileAtWorldXY: i(1436),
HexagonalCullBounds: i(546),
HexagonalCullTiles: i(545),
HexagonalTileToWorldXY: i(550),
HexagonalTileToWorldY: i(554),
HexagonalWorldToTileXY: i(556),
HexagonalWorldToTileY: i(560),
IsInLayerBounds: i(119),
IsometricCullTiles: i(547),
IsometricTileToWorldXY: i(551),
IsometricWorldToTileXY: i(557),
PutTileAt: i(257),
PutTileAtWorldXY: i(1437),
PutTilesAt: i(1438),
Randomize: i(1439),
RemoveTileAt: i(563),
RemoveTileAtWorldXY: i(1440),
RenderDebug: i(1441),
ReplaceByIndex: i(542),
RunCull: i(159),
SetCollision: i(1442),
SetCollisionBetween: i(1443),
SetCollisionByExclusion: i(1444),
SetCollisionByProperty: i(1445),
SetCollisionFromCollisionGroup: i(1446),
SetLayerCollisionIndex: i(160),
SetTileCollision: i(72),
SetTileIndexCallback: i(1447),
SetTileLocationCallback: i(1448),
Shuffle: i(1449),
StaggeredCullBounds: i(549),
StaggeredCullTiles: i(548),
StaggeredTileToWorldXY: i(552),
StaggeredTileToWorldY: i(555),
StaggeredWorldToTileXY: i(558),
StaggeredWorldToTileY: i(561),
SwapByIndex: i(1450),
TileToWorldX: i(253),
TileToWorldXY: i(553),
TileToWorldY: i(254),
WeightedRandomize: i(1451),
WorldToTileX: i(255),
WorldToTileXY: i(559),
WorldToTileY: i(256),
};
},
function (t, e, i) {
var l = i(158);
t.exports = function (t, e, i) {
var n = l(t, e, !0, i),
s = l(t, e - 1, !0, i),
r = l(t, e + 1, !0, i),
o = l(t - 1, e, !0, i),
a = l(t + 1, e, !0, i),
h = n && n.collides;
return (
h && ((n.faceTop = !0), (n.faceBottom = !0), (n.faceLeft = !0), (n.faceRight = !0)),
s && s.collides && (h && (n.faceTop = !1), (s.faceBottom = !h)),
r && r.collides && (h && (n.faceBottom = !1), (r.faceTop = !h)),
o && o.collides && (h && (n.faceLeft = !1), (o.faceRight = !h)),
a && a.collides && (h && (n.faceRight = !1), (a.faceLeft = !h)),
n && !n.collides && n.resetFaces(),
n
);
};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = i.baseTileWidth,
s = i.tilemapLayer,
r = 0;
return s && ((e = e || s.scene.cameras.main), (r = s.x + e.scrollX * (1 - s.scrollFactorX)), (n *= s.scaleX)), r + t * n;
};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = i.baseTileHeight,
s = i.tilemapLayer,
r = 0;
return s && ((e = e || s.scene.cameras.main), (r = s.y + e.scrollY * (1 - s.scrollFactorY)), (n *= s.scaleY)), r + t * n;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
void 0 === e && (e = !0);
var s = n.baseTileWidth,
r = n.tilemapLayer;
return r && ((i = i || r.scene.cameras.main), (t -= r.x + i.scrollX * (1 - r.scrollFactorX)), (s *= r.scaleX)), e ? Math.floor(t / s) : t / s;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
void 0 === e && (e = !0);
var s = n.baseTileHeight,
r = n.tilemapLayer;
return r && ((i = i || r.scene.cameras.main), (t -= r.y + i.scrollY * (1 - r.scrollFactorY)), (s *= r.scaleY)), e ? Math.floor(t / s) : t / s;
};
},
function (t, e, i) {
var u = i(85),
c = i(119),
d = i(252),
f = i(72);
t.exports = function (t, e, i, n, s) {
if ((void 0 === n && (n = !0), !c(e, i, s))) return null;
var r,
o = s.data[i][e],
a = o && o.collides;
t instanceof u
? (null === s.data[i][e] && (s.data[i][e] = new u(s, t.index, e, i, s.tileWidth, s.tileHeight)), s.data[i][e].copy(t))
: ((r = t), null === s.data[i][e] ? (s.data[i][e] = new u(s, r, e, i, s.tileWidth, s.tileHeight)) : (s.data[i][e].index = r));
var h = s.data[i][e],
l = -1 !== s.collideIndexes.indexOf(h.index);
return f(h, l), n && a !== h.collides && d(e, i, s), h;
};
},
function (t, e, i) {
var n = i(29);
t.exports = function (t) {
return "isometric" === (t = t.toLowerCase()) ? n.ISOMETRIC : "staggered" === t ? n.STAGGERED : "hexagonal" === t ? n.HEXAGONAL : n.ORTHOGONAL;
};
},
function (t, e, i) {
var p = i(40),
g = i(120),
v = i(121),
y = i(85);
t.exports = function (t, e, i, n, s) {
for (var r = new g({ tileWidth: i, tileHeight: n }), o = new v({ name: t, tileWidth: i, tileHeight: n, format: p.ARRAY_2D, layers: [r] }), a = [], h = e.length, l = 0, u = 0; u < e.length; u++) {
a[u] = [];
for (var c = e[u], d = 0; d < c.length; d++) {
var f = parseInt(c[d], 10);
isNaN(f) || -1 === f ? (a[u][d] = s ? null : new y(r, -1, d, u, i, n)) : (a[u][d] = new y(r, f, d, u, i, n));
}
0 === l && (l = c.length);
}
return (o.width = r.width = l), (o.height = r.height = h), (o.widthInPixels = r.widthInPixels = l * i), (o.heightInPixels = r.heightInPixels = h * n), (r.data = a), o;
};
},
function (t, e, i) {
function r(t) {
return { x: t.x, y: t.y };
}
var o = i(571),
a = i(261),
h = ["id", "name", "type", "rotation", "properties", "visible", "x", "y", "width", "height"];
t.exports = function (t, e, i) {
void 0 === e && (e = 0), void 0 === i && (i = 0);
var n,
s = o(t, h);
return (
(s.x += e),
(s.y += i),
t.gid
? ((n = a(t.gid)), (s.gid = n.gid), (s.flippedHorizontal = n.flippedHorizontal), (s.flippedVertical = n.flippedVertical), (s.flippedAntiDiagonal = n.flippedAntiDiagonal))
: t.polyline
? (s.polyline = t.polyline.map(r))
: t.polygon
? (s.polygon = t.polygon.map(r))
: t.ellipse
? (s.ellipse = t.ellipse)
: t.text
? (s.text = t.text)
: t.point
? (s.point = !0)
: (s.rectangle = !0),
s
);
};
},
function (t, e) {
t.exports = function (t) {
var e = Boolean(2147483648 & t),
i = Boolean(1073741824 & t),
n = Boolean(536870912 & t);
t &= 536870911;
var s = 0,
r = !1;
return (
e && i && n
? ((s = Math.PI / 2), (r = !0))
: e && i && !n
? ((s = Math.PI), (r = !1))
: e && !i && n
? ((s = Math.PI / 2), (r = !1))
: !e || i || n
? !e && i && n
? ((s = (3 * Math.PI) / 2), (r = !1))
: e || !i || n
? e || i || !n
? e || i || n || ((s = 0), (r = !1))
: ((s = (3 * Math.PI) / 2), (r = !0))
: ((s = Math.PI), (r = !0))
: (r = !(s = 0)),
{ gid: t, flippedHorizontal: e, flippedVertical: i, flippedAntiDiagonal: n, rotation: s, flipped: r }
);
};
},
function (t, e, i) {
var u = i(40),
c = i(121),
d = i(564),
f = i(580);
t.exports = function (t, e, i, n, s, r, o, a) {
void 0 === i && (i = 32), void 0 === n && (n = 32), void 0 === s && (s = 10), void 0 === r && (r = 10), void 0 === a && (a = !1);
var h,
l = null;
return (
Array.isArray(o) ? (l = d(void 0 !== e ? e : "map", u.ARRAY_2D, o, i, n, a)) : void 0 !== e && (h = t.cache.tilemap.get(e)) && (l = d(e, h.format, h.data, i, n, a)),
null === l && (l = new c({ tileWidth: i, tileHeight: n, width: s, height: r })),
new f(t, l)
);
};
},
function (t, e, i) {
var n = i(6);
t.exports = function (t) {
var e = n(t, "targets", null);
return null === e || ("function" == typeof e && (e = e.call()), Array.isArray(e) || (e = [e])), e;
};
},
function (t, e) {
function g(t) {
return !!t.getActive && "function" == typeof t.getActive;
}
function v(t) {
return !!t.getStart && "function" == typeof t.getStart;
}
function y(t) {
return !!t.getEnd && "function" == typeof t.getEnd;
}
var m = function (t, e) {
var i,
n,
s,
r,
o,
a,
h,
l = function (t, e, i) {
return i;
},
u = function (t, e, i) {
return i;
},
c = null,
d = typeof e;
if ("number" == d)
l = function () {
return e;
};
else if ("string" == d) {
var f = e[0],
p = parseFloat(e.substr(2));
switch (f) {
case "+":
l = function (t, e, i) {
return i + p;
};
break;
case "-":
l = function (t, e, i) {
return i - p;
};
break;
case "*":
l = function (t, e, i) {
return i * p;
};
break;
case "/":
l = function (t, e, i) {
return i / p;
};
break;
default:
l = function () {
return parseFloat(e);
};
}
} else
"function" == d
? (l = e)
: "object" == d &&
(v((h = e)) || y(h) || g(h)
? (g(e) && (c = e.getActive), y(e) && (l = e.getEnd), v(e) && (u = e.getStart))
: e.hasOwnProperty("value")
? (a = m(t, e.value))
: ((i = e.hasOwnProperty("to")),
(n = e.hasOwnProperty("from")),
(s = e.hasOwnProperty("start")),
i && (n || s) && ((a = m(t, e.to)), s && ((r = m(t, e.start)), (a.getActive = r.getEnd)), n && ((o = m(t, e.from)), (a.getStart = o.getEnd)))));
return a || { getActive: c, getEnd: l, getStart: u };
};
t.exports = m;
},
function (t, e) {
t.exports = { targets: null, delay: 0, duration: 1e3, ease: "Power0", easeParams: null, hold: 0, repeat: 0, repeatDelay: 0, yoyo: !1, flipX: !1, flipY: !1 };
},
function (t, e, i) {
var n = i(0),
s = i(9),
u = i(267),
r = i(16),
o = i(5),
c = i(100),
a = i(14),
h = new n({
Extends: s,
initialize: function (t, e, i) {
s.call(this),
(this.parent = t),
(this.parentIsTimeline = t.hasOwnProperty("isTimeline")),
(this.data = e),
(this.totalData = e.length),
(this.targets = i),
(this.totalTargets = i.length),
(this.useFrames = !1),
(this.timeScale = 1),
(this.loop = 0),
(this.loopDelay = 0),
(this.loopCounter = 0),
(this.startDelay = 0),
(this.hasStarted = !1),
(this.isSeeking = !1),
(this.completeDelay = 0),
(this.countdown = 0),
(this.offset = 0),
(this.calculatedOffset = 0),
(this.state = c.PENDING_ADD),
(this._pausedState = c.INIT),
(this.paused = !1),
(this.elapsed = 0),
(this.totalElapsed = 0),
(this.duration = 0),
(this.progress = 0),
(this.totalDuration = 0),
(this.totalProgress = 0),
(this.callbacks = { onActive: null, onComplete: null, onLoop: null, onRepeat: null, onStart: null, onStop: null, onUpdate: null, onYoyo: null }),
this.callbackScope;
},
getValue: function (t) {
return void 0 === t && (t = 0), this.data[t].current;
},
setTimeScale: function (t) {
return (this.timeScale = t), this;
},
getTimeScale: function () {
return this.timeScale;
},
isPlaying: function () {
return this.state === c.ACTIVE;
},
isPaused: function () {
return this.state === c.PAUSED;
},
hasTarget: function (t) {
return -1 !== this.targets.indexOf(t);
},
updateTo: function (t, e, i) {
void 0 === i && (i = !1);
for (var n = 0; n < this.totalData; n++) {
var s = this.data[n];
s.key === t && ((s.end = e), i && (s.start = s.current));
}
return this;
},
restart: function () {
return (
(this.elapsed = 0),
(this.progress = 0),
(this.totalElapsed = 0),
(this.totalProgress = 0),
this.state === c.ACTIVE ? this.seek(0) : this.state === c.REMOVED ? (this.seek(0), this.parent.makeActive(this), this) : this.state === c.PENDING_ADD ? this : this.play()
);
},
calcDuration: function () {
for (var t = 0, e = a.MAX_SAFE_INTEGER, i = this.data, n = 0; n < this.totalData; n++) {
var s = i[n];
(s.t1 = s.duration + s.hold),
s.yoyo && (s.t1 += s.duration),
(s.t2 = s.t1 + s.repeatDelay),
(s.totalDuration = s.delay + s.t1),
-1 === s.repeat ? (s.totalDuration += 999999999999 * s.t2) : 0 < s.repeat && (s.totalDuration += s.t2 * s.repeat),
s.totalDuration > t && (t = s.totalDuration),
s.delay < e && (e = s.delay);
}
(this.duration = Math.max(t, 0.001)),
(this.loopCounter = -1 === this.loop ? 999999999999 : this.loop),
0 < this.loopCounter ? (this.totalDuration = this.duration + this.completeDelay + (this.duration + this.loopDelay) * this.loopCounter) : (this.totalDuration = this.duration + this.completeDelay),
(this.startDelay = e);
},
init: function () {
if (this.paused && !this.parentIsTimeline) return (this.state = c.PENDING_ADD), (this._pausedState = c.INIT), !1;
for (var t = this.data, e = this.totalTargets, i = 0; i < this.totalData; i++) {
var n = t[i],
s = n.target,
r = n.gen,
o = n.key,
a = n.index;
(n.delay = r.delay(s, o, 0, a, e, this)),
(n.duration = Math.max(r.duration(s, o, 0, a, e, this), 0.001)),
(n.hold = r.hold(s, o, 0, a, e, this)),
(n.repeat = r.repeat(s, o, 0, a, e, this)),
(n.repeatDelay = r.repeatDelay(s, o, 0, a, e, this));
}
return this.calcDuration(), (this.progress = 0), (this.totalProgress = 0), (this.elapsed = 0), (this.totalElapsed = 0), (this.state = c.INIT), !0;
},
makeActive: function () {
this.parent.makeActive(this), this.dispatchTweenEvent(u.TWEEN_ACTIVE, this.callbacks.onActive);
},
nextState: function () {
0 < this.loopCounter
? ((this.elapsed = 0),
(this.progress = 0),
this.loopCounter--,
this.resetTweenData(!0),
0 < this.loopDelay ? ((this.countdown = this.loopDelay), (this.state = c.LOOP_DELAY)) : ((this.state = c.ACTIVE), this.dispatchTweenEvent(u.TWEEN_LOOP, this.callbacks.onLoop)))
: 0 < this.completeDelay
? ((this.state = c.COMPLETE_DELAY), (this.countdown = this.completeDelay))
: ((this.state = c.PENDING_REMOVE), this.dispatchTweenEvent(u.TWEEN_COMPLETE, this.callbacks.onComplete));
},
pause: function () {
return this.state === c.PAUSED || ((this.paused = !0), (this._pausedState = this.state), (this.state = c.PAUSED)), this;
},
play: function (t) {
void 0 === t && (t = !1);
var e = this.state;
return (
e !== c.INIT || this.parentIsTimeline
? e === c.ACTIVE ||
(e === c.PENDING_ADD && this._pausedState === c.PENDING_ADD) ||
(this.parentIsTimeline || (e !== c.PENDING_REMOVE && e !== c.REMOVED)
? this.parentIsTimeline
? (this.resetTweenData(t), 0 === this.calculatedOffset ? (this.state = c.ACTIVE) : ((this.countdown = this.calculatedOffset), (this.state = c.OFFSET_DELAY)))
: (this.paused ? (this.paused = !1) : (this.resetTweenData(t), (this.state = c.ACTIVE)), this.makeActive())
: (this.seek(0), this.parent.makeActive(this)))
: (this.resetTweenData(!1), (this.state = c.ACTIVE)),
this
);
},
resetTweenData: function (t) {
for (var e = this.data, i = this.totalData, n = this.totalTargets, s = 0; s < i; s++) {
var r = e[s],
o = r.target,
a = r.key,
h = r.index;
(r.progress = 0),
(r.elapsed = 0),
(r.repeatCounter = -1 === r.repeat ? 999999999999 : r.repeat),
t ? ((r.start = r.getStartValue(o, a, r.start, h, n, this)), (r.end = r.getEndValue(o, a, r.end, h, n, this)), (r.current = r.start), (r.state = c.PLAYING_FORWARD)) : (r.state = c.PENDING_RENDER),
0 < r.delay && ((r.elapsed = r.delay), (r.state = c.DELAY)),
r.getActiveValue && (o[a] = r.getActiveValue(r.target, r.key, r.start));
}
},
resume: function () {
return this.state === c.PAUSED ? ((this.paused = !1), (this.state = this._pausedState)) : this.play(), this;
},
seek: function (t, e) {
void 0 === e && (e = 16.6), this.state === c.REMOVED && this.makeActive(), (this.elapsed = 0), (this.progress = 0), (this.totalElapsed = 0), (this.totalProgress = 0);
for (var i = this.data, n = this.totalTargets, s = 0; s < this.totalData; s++) {
var r = i[s],
o = r.target,
a = r.gen,
h = r.key,
l = r.index;
(r.progress = 0),
(r.elapsed = 0),
(r.repeatCounter = -1 === r.repeat ? 999999999999 : r.repeat),
(r.delay = a.delay(o, h, 0, l, n, this)),
(r.duration = Math.max(a.duration(o, h, 0, l, n, this), 0.001)),
(r.hold = a.hold(o, h, 0, l, n, this)),
(r.repeat = a.repeat(o, h, 0, l, n, this)),
(r.repeatDelay = a.repeatDelay(o, h, 0, l, n, this)),
(r.current = r.start),
(r.state = c.PLAYING_FORWARD),
this.updateTweenData(this, r, 0, l, n),
0 < r.delay && ((r.elapsed = r.delay), (r.state = c.DELAY));
}
this.calcDuration();
var u = !1;
for (this.state === c.PAUSED && ((u = !0), (this.state = c.ACTIVE)), this.isSeeking = !0; this.update(0, e), this.totalProgress < t; );
return (this.isSeeking = !1), u && (this.state = c.PAUSED), this;
},
setCallback: function (t, e, i, n) {
return (this.callbacks[t] = { func: e, scope: n, params: i }), this;
},
complete: function (t) {
return void 0 === t && (t = 0), t ? ((this.state = c.COMPLETE_DELAY), (this.countdown = t)) : ((this.state = c.PENDING_REMOVE), this.dispatchTweenEvent(u.TWEEN_COMPLETE, this.callbacks.onComplete)), this;
},
remove: function () {
return this.parent.remove(this), this;
},
stop: function (t) {
return (
this.state === c.ACTIVE && void 0 !== t && this.seek(t),
this.state !== c.REMOVED &&
((this.state !== c.PAUSED && this.state !== c.PENDING_ADD) ||
(this.parentIsTimeline ? (this.parent.manager._destroy.push(this), this.parent.manager._toProcess++) : (this.parent._destroy.push(this), this.parent._toProcess++)),
this.dispatchTweenEvent(u.TWEEN_STOP, this.callbacks.onStop),
this.removeAllListeners(),
(this.state = c.PENDING_REMOVE)),
this
);
},
update: function (t, e) {
if (this.state === c.PAUSED) return !1;
switch (
(this.useFrames && (e = +this.parent.timeScale),
(e *= this.timeScale),
(this.elapsed += e),
(this.progress = Math.min(this.elapsed / this.duration, 1)),
(this.totalElapsed += e),
(this.totalProgress = Math.min(this.totalElapsed / this.totalDuration, 1)),
this.state)
) {
case c.ACTIVE:
this.hasStarted || this.isSeeking || ((this.startDelay -= e), this.startDelay <= 0 && ((this.hasStarted = !0), this.dispatchTweenEvent(u.TWEEN_START, this.callbacks.onStart)));
for (var i = !1, n = 0; n < this.totalData; n++) {
var s = this.data[n];
this.updateTweenData(this, s, e) && (i = !0);
}
i || this.nextState();
break;
case c.LOOP_DELAY:
(this.countdown -= e), this.countdown <= 0 && ((this.state = c.ACTIVE), this.dispatchTweenEvent(u.TWEEN_LOOP, this.callbacks.onLoop));
break;
case c.OFFSET_DELAY:
(this.countdown -= e), this.countdown <= 0 && (this.state = c.ACTIVE);
break;
case c.COMPLETE_DELAY:
(this.countdown -= e), this.countdown <= 0 && ((this.state = c.PENDING_REMOVE), this.dispatchTweenEvent(u.TWEEN_COMPLETE, this.callbacks.onComplete));
}
return this.state === c.PENDING_REMOVE;
},
dispatchTweenDataEvent: function (t, e, i) {
this.isSeeking || (this.emit(t, this, i.key, i.target, i.current, i.previous), e && ((e.params[1] = i.target), e.func.apply(e.scope, e.params)));
},
dispatchTweenEvent: function (t, e) {
this.isSeeking || (this.emit(t, this, this.targets), e && ((e.params[1] = this.targets), e.func.apply(e.scope, e.params)));
},
setStateFromEnd: function (t, e, i) {
return e.yoyo
? ((e.elapsed = i),
(e.progress = i / e.duration),
e.flipX && e.target.toggleFlipX(),
e.flipY && e.target.toggleFlipY(),
this.dispatchTweenDataEvent(u.TWEEN_YOYO, t.callbacks.onYoyo, e),
(e.start = e.getStartValue(e.target, e.key, e.start, e.index, t.totalTargets, t)),
c.PLAYING_BACKWARD)
: 0 < e.repeatCounter
? (e.repeatCounter--,
(e.elapsed = i),
(e.progress = i / e.duration),
e.flipX && e.target.toggleFlipX(),
e.flipY && e.target.toggleFlipY(),
(e.start = e.getStartValue(e.target, e.key, e.start, e.index, t.totalTargets, t)),
(e.end = e.getEndValue(e.target, e.key, e.start, e.index, t.totalTargets, t)),
0 < e.repeatDelay
? ((e.elapsed = e.repeatDelay - i), (e.current = e.start), (e.target[e.key] = e.current), c.REPEAT_DELAY)
: (this.dispatchTweenDataEvent(u.TWEEN_REPEAT, t.callbacks.onRepeat, e), c.PLAYING_FORWARD))
: c.COMPLETE;
},
setStateFromStart: function (t, e, i) {
return 0 < e.repeatCounter
? (e.repeatCounter--,
(e.elapsed = i),
(e.progress = i / e.duration),
e.flipX && e.target.toggleFlipX(),
e.flipY && e.target.toggleFlipY(),
(e.end = e.getEndValue(e.target, e.key, e.start, e.index, t.totalTargets, t)),
0 < e.repeatDelay
? ((e.elapsed = e.repeatDelay - i), (e.current = e.start), (e.target[e.key] = e.current), c.REPEAT_DELAY)
: (this.dispatchTweenDataEvent(u.TWEEN_REPEAT, t.callbacks.onRepeat, e), c.PLAYING_FORWARD))
: c.COMPLETE;
},
updateTweenData: function (t, e, i) {
var n = e.target;
switch (e.state) {
case c.PLAYING_FORWARD:
case c.PLAYING_BACKWARD:
if (!n) {
e.state = c.COMPLETE;
break;
}
var s = e.elapsed,
r = e.duration,
o = 0;
r < (s += i) && ((o = s - r), (s = r));
var a,
h = e.state === c.PLAYING_FORWARD,
l = s / r;
(e.elapsed = s),
(e.progress = l),
(e.previous = e.current),
1 == l
? h
? ((e.current = e.end), (n[e.key] = e.end), 0 < e.hold ? ((e.elapsed = e.hold - o), (e.state = c.HOLD_DELAY)) : (e.state = this.setStateFromEnd(t, e, o)))
: ((e.current = e.start), (n[e.key] = e.start), (e.state = this.setStateFromStart(t, e, o)))
: ((a = h ? e.ease(l) : e.ease(1 - l)), (e.current = e.start + (e.end - e.start) * a), (n[e.key] = e.current)),
this.dispatchTweenDataEvent(u.TWEEN_UPDATE, t.callbacks.onUpdate, e);
break;
case c.DELAY:
(e.elapsed -= i), e.elapsed <= 0 && ((e.elapsed = Math.abs(e.elapsed)), (e.state = c.PENDING_RENDER));
break;
case c.REPEAT_DELAY:
(e.elapsed -= i), e.elapsed <= 0 && ((e.elapsed = Math.abs(e.elapsed)), (e.state = c.PLAYING_FORWARD), this.dispatchTweenDataEvent(u.TWEEN_REPEAT, t.callbacks.onRepeat, e));
break;
case c.HOLD_DELAY:
(e.elapsed -= i), e.elapsed <= 0 && (e.state = this.setStateFromEnd(t, e, Math.abs(e.elapsed)));
break;
case c.PENDING_RENDER:
n
? ((e.start = e.getStartValue(n, e.key, n[e.key], e.index, t.totalTargets, t)),
(e.end = e.getEndValue(n, e.key, e.start, e.index, t.totalTargets, t)),
(e.current = e.start),
(n[e.key] = e.start),
(e.state = c.PLAYING_FORWARD))
: (e.state = c.COMPLETE);
}
return e.state !== c.COMPLETE;
},
});
(h.TYPES = ["onActive", "onComplete", "onLoop", "onRepeat", "onStart", "onStop", "onUpdate", "onYoyo"]),
o.register("tween", function (t) {
return this.scene.sys.tweens.add(t);
}),
r.register("tween", function (t) {
return this.scene.sys.tweens.create(t);
}),
(t.exports = h);
},
function (t, e, i) {
t.exports = {
TIMELINE_COMPLETE: i(1466),
TIMELINE_LOOP: i(1467),
TIMELINE_PAUSE: i(1468),
TIMELINE_RESUME: i(1469),
TIMELINE_START: i(1470),
TIMELINE_UPDATE: i(1471),
TWEEN_ACTIVE: i(1472),
TWEEN_COMPLETE: i(1473),
TWEEN_LOOP: i(1474),
TWEEN_REPEAT: i(1475),
TWEEN_START: i(1476),
TWEEN_STOP: i(1477),
TWEEN_UPDATE: i(1478),
TWEEN_YOYO: i(1479),
};
},
function (t, e) {
t.exports = function (t, e, i, n, s, r, o, a, h, l, u, c, d, f, p) {
return {
target: t,
index: e,
key: i,
getActiveValue: r,
getEndValue: n,
getStartValue: s,
ease: o,
duration: 0,
totalDuration: 0,
delay: 0,
yoyo: l,
hold: 0,
repeat: 0,
repeatDelay: 0,
flipX: f,
flipY: p,
progress: 0,
elapsed: 0,
repeatCounter: 0,
start: 0,
previous: 0,
current: 0,
end: 0,
t1: 0,
t2: 0,
gen: { delay: a, duration: h, hold: u, repeat: c, repeatDelay: d },
state: 0,
};
};
},
function (t, e, i) {
var n = i(68);
t.exports = function (t) {
return n(t, -Math.PI, Math.PI);
};
},
function (t, e, i) {
var n = i(68);
t.exports = function (t) {
return n(t, -180, 180);
};
},
function (t, e, i) {
var n = {};
t.exports = n;
var r = i(83),
o = i(32);
(n.fromVertices = function (t) {
for (var e = {}, i = 0; i < t.length; i++) {
var n = (i + 1) % t.length,
s = r.normalise({ x: t[n].y - t[i].y, y: t[i].x - t[n].x });
e[(0 === s.y ? 1 / 0 : s.x / s.y).toFixed(3).toString()] = s;
}
return o.values(e);
}),
(n.rotate = function (t, e) {
if (0 !== e)
for (var i = Math.cos(e), n = Math.sin(e), s = 0; s < t.length; s++) {
var r = t[s],
o = r.x * i - r.y * n;
(r.y = r.x * n + r.y * i), (r.x = o);
}
});
},
function (t, e, i) {
t.exports = {
AFTER_ADD: i(1504),
AFTER_REMOVE: i(1505),
AFTER_UPDATE: i(1506),
BEFORE_ADD: i(1507),
BEFORE_REMOVE: i(1508),
BEFORE_UPDATE: i(1509),
COLLISION_ACTIVE: i(1510),
COLLISION_END: i(1511),
COLLISION_START: i(1512),
DRAG_END: i(1513),
DRAG: i(1514),
DRAG_START: i(1515),
PAUSE: i(1516),
RESUME: i(1517),
SLEEP_END: i(1518),
SLEEP_START: i(1519),
};
},
function (t, e, i) {
var g = {};
t.exports = g;
var v = i(274),
y = i(250),
m = i(84);
(g.collisions = function (t, e) {
for (var i = [], n = e.pairs.table, s = e.metrics, r = 0; r < t.length; r++) {
var o = t[r][0],
a = t[r][1];
if (((!o.isStatic && !o.isSleeping) || (!a.isStatic && !a.isSleeping)) && g.canCollide(o.collisionFilter, a.collisionFilter) && ((s.midphaseTests += 1), m.overlaps(o.bounds, a.bounds)))
for (var h = 1 < o.parts.length ? 1 : 0; h < o.parts.length; h++)
for (var l = o.parts[h], u = 1 < a.parts.length ? 1 : 0; u < a.parts.length; u++) {
var c,
d,
f,
p = a.parts[u];
((l === o && p === a) || m.overlaps(l.bounds, p.bounds)) &&
((d = (c = n[y.id(l, p)]) && c.isActive ? c.collision : null),
(f = v.collides(l, p, d)),
(s.narrowphaseTests += 1),
f.reused && (s.narrowReuseCount += 1),
f.collided && (i.push(f), (s.narrowDetections += 1)));
}
}
return i;
}),
(g.canCollide = function (t, e) {
return t.group === e.group && 0 !== t.group ? 0 < t.group : 0 != (t.mask & e.category) && 0 != (e.mask & t.category);
});
},
function (t, e, i) {
var y = {};
t.exports = y;
var m = i(64),
x = i(83);
(y.collides = function (t, e, i) {
var n,
s,
r,
o,
a,
h,
l = !1;
if (
((h = i
? ((r = t.parent), (o = e.parent), (a = r.speed * r.speed + r.angularSpeed * r.angularSpeed + o.speed * o.speed + o.angularSpeed * o.angularSpeed), (l = i && i.collided && a < 0.2), i)
: { collided: !1, bodyA: t, bodyB: e }),
i && l)
) {
var u = h.axisBody,
c = u === t ? e : t,
d = [u.axes[i.axisNumber]],
f = y._overlapAxes(u.vertices, c.vertices, d);
if (((h.reused = !0), f.overlap <= 0)) return (h.collided = !1), h;
} else {
if ((n = y._overlapAxes(t.vertices, e.vertices, t.axes)).overlap <= 0) return (h.collided = !1), h;
if ((s = y._overlapAxes(e.vertices, t.vertices, e.axes)).overlap <= 0) return (h.collided = !1), h;
n.overlap < s.overlap ? ((f = n), (h.axisBody = t)) : ((f = s), (h.axisBody = e)), (h.axisNumber = f.axisNumber);
}
(h.bodyA = t.id < e.id ? t : e),
(h.bodyB = t.id < e.id ? e : t),
(h.collided = !0),
(h.depth = f.overlap),
(h.parentA = h.bodyA.parent),
(h.parentB = h.bodyB.parent),
(t = h.bodyA),
(e = h.bodyB),
x.dot(f.axis, x.sub(e.position, t.position)) < 0 ? (h.normal = { x: f.axis.x, y: f.axis.y }) : (h.normal = { x: -f.axis.x, y: -f.axis.y }),
(h.tangent = x.perp(h.normal)),
(h.penetration = h.penetration || {}),
(h.penetration.x = h.normal.x * h.depth),
(h.penetration.y = h.normal.y * h.depth);
var p,
g = y._findSupports(t, e, h.normal),
v = [];
return (
m.contains(t.vertices, g[0]) && v.push(g[0]),
m.contains(t.vertices, g[1]) && v.push(g[1]),
v.length < 2 && ((p = y._findSupports(e, t, x.neg(h.normal))), m.contains(e.vertices, p[0]) && v.push(p[0]), v.length < 2 && m.contains(e.vertices, p[1]) && v.push(p[1])),
v.length < 1 && (v = [g[0]]),
(h.supports = v),
h
);
}),
(y._overlapAxes = function (t, e, i) {
for (var n, s, r = x._temp[0], o = x._temp[1], a = { overlap: Number.MAX_VALUE }, h = 0; h < i.length; h++) {
if (((s = i[h]), y._projectToAxis(r, t, s), y._projectToAxis(o, e, s), (n = Math.min(r.max - o.min, o.max - r.min)) <= 0)) return (a.overlap = n), a;
n < a.overlap && ((a.overlap = n), (a.axis = s), (a.axisNumber = h));
}
return a;
}),
(y._projectToAxis = function (t, e, i) {
for (var n = x.dot(e[0], i), s = n, r = 1; r < e.length; r += 1) {
var o = x.dot(e[r], i);
s < o ? (s = o) : o < n && (n = o);
}
(t.min = n), (t.max = s);
}),
(y._findSupports = function (t, e, i) {
for (var n, s, r, o = Number.MAX_VALUE, a = x._temp[0], h = e.vertices, l = t.position, u = 0; u < h.length; u++) (c = h[u]), (a.x = c.x - l.x), (a.y = c.y - l.y), (n = -x.dot(i, a)) < o && ((o = n), (s = c));
var c = h[0 <= s.index - 1 ? s.index - 1 : h.length - 1];
return (a.x = c.x - l.x), (a.y = c.y - l.y), (o = -x.dot(i, a)), (r = c), (c = h[(s.index + 1) % h.length]), (a.x = c.x - l.x), (a.y = c.y - l.y), (n = -x.dot(i, a)) < o && (r = c), [s, r];
});
},
function (t, e, i) {
t.exports = {
AlignTo: i(601),
Angle: i(602),
Call: i(603),
GetFirst: i(604),
GetLast: i(605),
GridAlign: i(606),
IncAlpha: i(678),
IncX: i(679),
IncXY: i(680),
IncY: i(681),
PlaceOnCircle: i(682),
PlaceOnEllipse: i(683),
PlaceOnLine: i(684),
PlaceOnRectangle: i(685),
PlaceOnTriangle: i(686),
PlayAnimation: i(687),
PropertyValueInc: i(46),
PropertyValueSet: i(27),
RandomCircle: i(688),
RandomEllipse: i(689),
RandomLine: i(690),
RandomRectangle: i(691),
RandomTriangle: i(692),
Rotate: i(693),
RotateAround: i(694),
RotateAroundDistance: i(695),
ScaleX: i(696),
ScaleXY: i(697),
ScaleY: i(698),
SetAlpha: i(699),
SetBlendMode: i(700),
SetDepth: i(701),
SetHitArea: i(702),
SetOrigin: i(703),
SetRotation: i(704),
SetScale: i(705),
SetScaleX: i(706),
SetScaleY: i(707),
SetScrollFactor: i(708),
SetScrollFactorX: i(709),
SetScrollFactorY: i(710),
SetTint: i(711),
SetVisible: i(712),
SetX: i(713),
SetXY: i(714),
SetY: i(715),
ShiftPosition: i(716),
Shuffle: i(717),
SmootherStep: i(718),
SmoothStep: i(719),
Spread: i(720),
ToggleVisible: i(721),
WrapInRectangle: i(722),
};
},
function (t, e, i) {
var n = i(123),
r = [];
(r[n.BOTTOM_CENTER] = i(277)),
(r[n.BOTTOM_LEFT] = i(278)),
(r[n.BOTTOM_RIGHT] = i(279)),
(r[n.LEFT_BOTTOM] = i(280)),
(r[n.LEFT_CENTER] = i(281)),
(r[n.LEFT_TOP] = i(282)),
(r[n.RIGHT_BOTTOM] = i(283)),
(r[n.RIGHT_CENTER] = i(284)),
(r[n.RIGHT_TOP] = i(285)),
(r[n.TOP_CENTER] = i(286)),
(r[n.TOP_LEFT] = i(287)),
(r[n.TOP_RIGHT] = i(288)),
(t.exports = function (t, e, i, n, s) {
return r[i](t, e, n, s);
});
},
function (t, e, i) {
var s = i(42),
r = i(87),
o = i(88),
a = i(52);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), o(t, r(e) + i), a(t, s(e) + n), t;
};
},
function (t, e, i) {
var s = i(42),
r = i(43),
o = i(53),
a = i(52);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), o(t, r(e) - i), a(t, s(e) + n), t;
};
},
function (t, e, i) {
var s = i(42),
r = i(44),
o = i(54),
a = i(52);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), o(t, r(e) + i), a(t, s(e) + n), t;
};
},
function (t, e, i) {
var s = i(42),
r = i(43),
o = i(55),
a = i(54);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), a(t, r(e) - i), o(t, s(e) + n), t;
};
},
function (t, e, i) {
var s = i(89),
r = i(43),
o = i(90),
a = i(54);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), a(t, r(e) - i), o(t, s(e) + n), t;
};
},
function (t, e, i) {
var s = i(43),
r = i(45),
o = i(54),
a = i(52);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), o(t, s(e) - i), a(t, r(e) - n), t;
};
},
function (t, e, i) {
var s = i(42),
r = i(44),
o = i(55),
a = i(53);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), a(t, r(e) + i), o(t, s(e) + n), t;
};
},
function (t, e, i) {
var s = i(89),
r = i(44),
o = i(90),
a = i(53);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), a(t, r(e) + i), o(t, s(e) + n), t;
};
},
function (t, e, i) {
var s = i(44),
r = i(45),
o = i(53),
a = i(52);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), o(t, s(e) + i), a(t, r(e) - n), t;
};
},
function (t, e, i) {
var s = i(87),
r = i(45),
o = i(55),
a = i(88);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), a(t, s(e) + i), o(t, r(e) - n), t;
};
},
function (t, e, i) {
var s = i(43),
r = i(45),
o = i(55),
a = i(53);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), a(t, s(e) - i), o(t, r(e) - n), t;
};
},
function (t, e, i) {
var s = i(44),
r = i(45),
o = i(55),
a = i(54);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), a(t, s(e) + i), o(t, r(e) - n), t;
};
},
function (t, e, i) {
var n = i(123),
r = [];
(r[n.BOTTOM_CENTER] = i(290)),
(r[n.BOTTOM_LEFT] = i(291)),
(r[n.BOTTOM_RIGHT] = i(292)),
(r[n.CENTER] = i(293)),
(r[n.LEFT_CENTER] = i(295)),
(r[n.RIGHT_CENTER] = i(296)),
(r[n.TOP_CENTER] = i(297)),
(r[n.TOP_LEFT] = i(298)),
(r[n.TOP_RIGHT] = i(299)),
(r[n.LEFT_BOTTOM] = r[n.BOTTOM_LEFT]),
(r[n.LEFT_TOP] = r[n.TOP_LEFT]),
(r[n.RIGHT_BOTTOM] = r[n.BOTTOM_RIGHT]),
(r[n.RIGHT_TOP] = r[n.TOP_RIGHT]),
(t.exports = function (t, e, i, n, s) {
return r[i](t, e, n, s);
});
},
function (t, e, i) {
var s = i(42),
r = i(87),
o = i(55),
a = i(88);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), a(t, r(e) + i), o(t, s(e) + n), t;
};
},
function (t, e, i) {
var s = i(42),
r = i(43),
o = i(55),
a = i(53);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), a(t, r(e) - i), o(t, s(e) + n), t;
};
},
function (t, e, i) {
var s = i(42),
r = i(44),
o = i(55),
a = i(54);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), a(t, r(e) + i), o(t, s(e) + n), t;
};
},
function (t, e, i) {
var s = i(294),
r = i(87),
o = i(89);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), s(t, r(e) + i, o(e) + n), t;
};
},
function (t, e, i) {
var n = i(88),
s = i(90);
t.exports = function (t, e, i) {
return n(t, e), s(t, i);
};
},
function (t, e, i) {
var s = i(89),
r = i(43),
o = i(90),
a = i(53);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), a(t, r(e) - i), o(t, s(e) + n), t;
};
},
function (t, e, i) {
var s = i(89),
r = i(44),
o = i(90),
a = i(54);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), a(t, r(e) + i), o(t, s(e) + n), t;
};
},
function (t, e, i) {
var s = i(87),
r = i(45),
o = i(88),
a = i(52);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), o(t, s(e) + i), a(t, r(e) - n), t;
};
},
function (t, e, i) {
var s = i(43),
r = i(45),
o = i(53),
a = i(52);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), o(t, s(e) - i), a(t, r(e) - n), t;
};
},
function (t, e, i) {
var s = i(44),
r = i(45),
o = i(54),
a = i(52);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), o(t, s(e) + i), a(t, r(e) - n), t;
};
},
function (t, e, i) {
var s = i(169),
r = i(98),
o = i(14),
a = i(4);
t.exports = function (t, e, i) {
void 0 === i && (i = new a());
var n = r(e, 0, o.PI2);
return s(t, n, i);
};
},
function (t, e, i) {
var o = i(302),
a = i(169),
h = i(98),
l = i(14);
t.exports = function (t, e, i, n) {
void 0 === n && (n = []), !e && 0 < i && (e = o(t) / i);
for (var s = 0; s < e; s++) {
var r = h(s / e, 0, l.PI2);
n.push(a(t, r));
}
return n;
};
},
function (t, e) {
t.exports = function (t) {
return Math.PI * t.radius * 2;
};
},
function (t, e, i) {
var n = i(18),
s = {
_alpha: 1,
clearAlpha: function () {
return this.setAlpha(1);
},
setAlpha: function (t) {
return void 0 === t && (t = 1), (this.alpha = t), this;
},
alpha: {
get: function () {
return this._alpha;
},
set: function (t) {
var e = n(t, 0, 1);
0 === (this._alpha = e) ? (this.renderFlags &= -3) : (this.renderFlags |= 2);
},
},
};
t.exports = s;
},
function (t, e, i) {
var n = i(35),
s = {
_blendMode: n.NORMAL,
blendMode: {
get: function () {
return this._blendMode;
},
set: function (t) {
"string" == typeof t && (t = n[t]), -1 <= (t |= 0) && (this._blendMode = t);
},
},
setBlendMode: function (t) {
return (this.blendMode = t), this;
},
};
t.exports = s;
},
function (t, e) {
t.exports = {
_depth: 0,
depth: {
get: function () {
return this._depth;
},
set: function (t) {
this.displayList && this.displayList.queueDepthSort(), (this._depth = t);
},
},
setDepth: function (t) {
return void 0 === t && (t = 0), (this.depth = t), this;
},
};
},
function (t, e, i) {
var o = i(171),
a = i(130);
t.exports = function (t, e, i, n) {
void 0 === n && (n = []), !e && 0 < i && (e = a(t) / i);
for (var s = 0; s < e; s++) {
var r = s / e;
n.push(o(t, r));
}
return n;
};
},
function (t, e, i) {
var n = i(4);
t.exports = function (t, e, i) {
return void 0 === i && (i = new n()), (i.x = t.x1 + (t.x2 - t.x1) * e), (i.y = t.y1 + (t.y2 - t.y1) * e), i;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = Math.cos(n),
r = Math.sin(n),
o = t.x - e,
a = t.y - i;
return (t.x = o * s - a * r + e), (t.y = o * r + a * s + i), t;
};
},
function (t, e, i) {
var n = i(310),
s = i(311),
r = {
mask: null,
setMask: function (t) {
return (this.mask = t), this;
},
clearMask: function (t) {
return void 0 === t && (t = !1), t && this.mask && this.mask.destroy(), (this.mask = null), this;
},
createBitmapMask: function (t) {
return void 0 === t && (this.texture || this.shader) && (t = this), new n(this.scene, t);
},
createGeometryMask: function (t) {
return void 0 === t && "Graphics" === this.type && (t = this), new s(this.scene, t);
},
};
t.exports = r;
},
function (t, e, i) {
var n = i(0),
s = i(22),
r = i(91),
o = new n({
initialize: function (t, e) {
var i = t.sys.renderer;
(this.renderer = i),
(this.bitmapMask = e),
(this.maskTexture = null),
(this.mainTexture = null),
(this.dirty = !0),
(this.mainFramebuffer = null),
(this.maskFramebuffer = null),
(this.invertAlpha = !1),
(this.isStencil = !1),
this.createMask(),
t.sys.game.events.on(s.CONTEXT_RESTORED, this.createMask, this),
i && i.on(r.RESIZE, this.createMask, this);
},
createMask: function () {
var t,
e,
i,
n,
s,
r,
o = this.renderer;
o &&
o.gl &&
(this.mainTexture && this.clearMask(),
(t = o.width),
(e = o.height),
(i = 0 == (t & (t - 1)) && 0 == (e & (e - 1))),
(n = o.gl),
(s = i ? n.REPEAT : n.CLAMP_TO_EDGE),
(r = n.LINEAR),
(this.mainTexture = o.createTexture2D(0, r, r, s, s, n.RGBA, null, t, e)),
(this.maskTexture = o.createTexture2D(0, r, r, s, s, n.RGBA, null, t, e)),
(this.mainFramebuffer = o.createFramebuffer(t, e, this.mainTexture, !0)),
(this.maskFramebuffer = o.createFramebuffer(t, e, this.maskTexture, !0)));
},
clearMask: function () {
var t = this.renderer;
t &&
t.gl &&
this.mainTexture &&
(t.deleteTexture(this.mainTexture),
t.deleteTexture(this.maskTexture),
t.deleteFramebuffer(this.mainFramebuffer),
t.deleteFramebuffer(this.maskFramebuffer),
(this.mainTexture = null),
(this.maskTexture = null),
(this.mainFramebuffer = null),
(this.maskFramebuffer = null));
},
setBitmap: function (t) {
this.bitmapMask = t;
},
preRenderWebGL: function (t, e, i) {
t.pipelines.BITMAPMASK_PIPELINE.beginMask(this, e, i);
},
postRenderWebGL: function (t, e) {
t.pipelines.BITMAPMASK_PIPELINE.endMask(this, e);
},
preRenderCanvas: function () {},
postRenderCanvas: function () {},
destroy: function () {
this.clearMask(), this.renderer && this.renderer.off(r.RESIZE, this.createMask, this), (this.bitmapMask = null), (this.prevFramebuffer = null), (this.renderer = null);
},
});
t.exports = o;
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e) {
(this.geometryMask = e), (this.invertAlpha = !1), (this.isStencil = !0), (this.level = 0);
},
setShape: function (t) {
return (this.geometryMask = t), this;
},
setInvertAlpha: function (t) {
return void 0 === t && (t = !0), (this.invertAlpha = t), this;
},
preRenderWebGL: function (t, e, i) {
var n = t.gl;
t.flush(),
0 === t.maskStack.length && (n.enable(n.STENCIL_TEST), n.clear(n.STENCIL_BUFFER_BIT), (t.maskCount = 0)),
t.currentCameraMask.mask !== this && (t.currentMask.mask = this),
t.maskStack.push({ mask: this, camera: i }),
this.applyStencil(t, i, !0),
t.maskCount++;
},
applyStencil: function (t, e, i) {
var n = t.gl,
s = this.geometryMask,
r = t.maskCount;
n.colorMask(!1, !1, !1, !1),
i ? (n.stencilFunc(n.EQUAL, r, 255), n.stencilOp(n.KEEP, n.KEEP, n.INCR)) : (n.stencilFunc(n.EQUAL, r + 1, 255), n.stencilOp(n.KEEP, n.KEEP, n.DECR)),
s.renderWebGL(t, s, e),
t.flush(),
n.colorMask(!0, !0, !0, !0),
n.stencilOp(n.KEEP, n.KEEP, n.KEEP),
i ? (this.invertAlpha ? n.stencilFunc(n.NOTEQUAL, r + 1, 255) : n.stencilFunc(n.EQUAL, r + 1, 255)) : this.invertAlpha ? n.stencilFunc(n.NOTEQUAL, r, 255) : n.stencilFunc(n.EQUAL, r, 255);
},
postRenderWebGL: function (t) {
var e = t.gl;
t.maskStack.pop(), t.maskCount--, t.flush();
var i,
n = t.currentMask;
0 === t.maskStack.length
? ((n.mask = null), e.disable(e.STENCIL_TEST))
: ((i = t.maskStack[t.maskStack.length - 1]).mask.applyStencil(t, i.camera, !1), t.currentCameraMask.mask !== i.mask ? ((n.mask = i.mask), (n.camera = i.camera)) : (n.mask = null));
},
preRenderCanvas: function (t, e, i) {
var n = this.geometryMask;
t.currentContext.save(), n.renderCanvas(t, n, i, null, null, !0), t.currentContext.clip();
},
postRenderCanvas: function (t) {
t.currentContext.restore();
},
destroy: function () {
this.geometryMask = null;
},
});
t.exports = n;
},
function (t, e) {
t.exports = {
scrollFactorX: 1,
scrollFactorY: 1,
setScrollFactor: function (t, e) {
return void 0 === e && (e = t), (this.scrollFactorX = t), (this.scrollFactorY = e), this;
},
};
},
function (t, e, i) {
var n = i(14),
s = i(25),
h = i(177),
r = i(269),
o = i(270),
l = i(3),
a = {
_scaleX: 1,
_scaleY: 1,
_rotation: 0,
x: 0,
y: 0,
z: 0,
w: 0,
scale: {
get: function () {
return (this._scaleX + this._scaleY) / 2;
},
set: function (t) {
(this._scaleX = t), 0 === (this._scaleY = t) ? (this.renderFlags &= -5) : (this.renderFlags |= 4);
},
},
scaleX: {
get: function () {
return this._scaleX;
},
set: function (t) {
0 === (this._scaleX = t) ? (this.renderFlags &= -5) : (this.renderFlags |= 4);
},
},
scaleY: {
get: function () {
return this._scaleY;
},
set: function (t) {
0 === (this._scaleY = t) ? (this.renderFlags &= -5) : (this.renderFlags |= 4);
},
},
angle: {
get: function () {
return o(this._rotation * n.RAD_TO_DEG);
},
set: function (t) {
this.rotation = o(t) * n.DEG_TO_RAD;
},
},
rotation: {
get: function () {
return this._rotation;
},
set: function (t) {
this._rotation = r(t);
},
},
setPosition: function (t, e, i, n) {
return void 0 === t && (t = 0), void 0 === e && (e = t), void 0 === i && (i = 0), void 0 === n && (n = 0), (this.x = t), (this.y = e), (this.z = i), (this.w = n), this;
},
copyPosition: function (t) {
return void 0 !== t.x && (this.x = t.x), void 0 !== t.y && (this.y = t.y), void 0 !== t.z && (this.z = t.z), void 0 !== t.w && (this.w = t.w), this;
},
setRandomPosition: function (t, e, i, n) {
return (
void 0 === t && (t = 0),
void 0 === e && (e = 0),
void 0 === i && (i = this.scene.sys.scale.width),
void 0 === n && (n = this.scene.sys.scale.height),
(this.x = t + Math.random() * i),
(this.y = e + Math.random() * n),
this
);
},
setRotation: function (t) {
return void 0 === t && (t = 0), (this.rotation = t), this;
},
setAngle: function (t) {
return void 0 === t && (t = 0), (this.angle = t), this;
},
setScale: function (t, e) {
return void 0 === t && (t = 1), void 0 === e && (e = t), (this.scaleX = t), (this.scaleY = e), this;
},
setX: function (t) {
return void 0 === t && (t = 0), (this.x = t), this;
},
setY: function (t) {
return void 0 === t && (t = 0), (this.y = t), this;
},
setZ: function (t) {
return void 0 === t && (t = 0), (this.z = t), this;
},
setW: function (t) {
return void 0 === t && (t = 0), (this.w = t), this;
},
getLocalTransformMatrix: function (t) {
return void 0 === t && (t = new s()), t.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY);
},
getWorldTransformMatrix: function (t, e) {
void 0 === t && (t = new s()), void 0 === e && (e = new s());
var i = this.parentContainer;
if (!i) return this.getLocalTransformMatrix(t);
for (t.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY); i; ) e.applyITRS(i.x, i.y, i._rotation, i._scaleX, i._scaleY), e.multiply(t, t), (i = i.parentContainer);
return t;
},
getLocalPoint: function (t, e, i, n) {
i = i || new l();
var s = (n = n || this.scene.sys.cameras.main).scrollX,
r = n.scrollY,
o = t + s * this.scrollFactorX - s,
a = e + r * this.scrollFactorY - r;
return (
this.parentContainer ? this.getWorldTransformMatrix().applyInverse(o, a, i) : h(o, a, this.x, this.y, this.rotation, this.scaleX, this.scaleY, i),
this._originComponent && ((i.x += this._displayOriginX), (i.y += this._displayOriginY)),
i
);
},
getParentRotation: function () {
for (var t = 0, e = this.parentContainer; e; ) (t += e.rotation), (e = e.parentContainer);
return t;
},
};
t.exports = a;
},
function (t, e) {
t.exports = {
_visible: !0,
visible: {
get: function () {
return this._visible;
},
set: function (t) {
t ? ((this._visible = !0), (this.renderFlags |= 1)) : ((this._visible = !1), (this.renderFlags &= -2));
},
},
setVisible: function (t) {
return (this.visible = t), this;
},
};
},
function (t, e, i) {
t.exports = { CHANGE_DATA: i(638), CHANGE_DATA_KEY: i(639), DESTROY: i(640), REMOVE_DATA: i(641), SET_DATA: i(642) };
},
function (t, e, i) {
var h = i(130),
l = i(4);
t.exports = function (t, e, i, n) {
if ((void 0 === n && (n = []), !e && !i)) return n;
e ? (i = Math.round(h(t) / e)) : (e = h(t) / i);
for (var s = t.x, r = t.y, o = 0, a = 0; a < i; a++)
switch ((n.push(new l(s, r)), o)) {
case 0:
(s += e) >= t.right && ((o = 1), (r += s - t.right), (s = t.right));
break;
case 1:
(r += e) >= t.bottom && ((o = 2), (s -= r - t.bottom), (r = t.bottom));
break;
case 2:
(s -= e) <= t.left && ((o = 3), (r -= t.left - s), (s = t.left));
break;
case 3:
(r -= e) <= t.top && ((o = 0), (r = t.top));
}
return n;
};
},
function (t, e) {
t.exports = function (t, e, i) {
void 0 === e && (e = 1), void 0 === i && (i = []);
var n = Math.round(t.x1),
s = Math.round(t.y1),
r = Math.round(t.x2),
o = Math.round(t.y2),
a = Math.abs(r - n),
h = Math.abs(o - s),
l = n < r ? 1 : -1,
u = s < o ? 1 : -1,
c = a - h;
i.push({ x: n, y: s });
for (var d = 1; n !== r || s !== o; ) {
var f = c << 1;
-h < f && ((c -= h), (n += l)), f < a && ((c += a), (s += u)), d % e == 0 && i.push({ x: n, y: s }), d++;
}
return i;
};
},
function (t, e) {
t.exports = function (t, e, i) {
if (!e.length) return NaN;
if (1 === e.length) return e[0];
var n,
s,
r = 1;
if (i) {
if (t < e[0][i]) return e[0];
for (; e[r][i] < t; ) r++;
} else for (; e[r] < t; ) r++;
return r > e.length && (r = e.length), i ? ((n = e[r - 1][i]), (s = e[r][i]) - t <= t - n ? e[r] : e[r - 1]) : ((n = e[r - 1]), (s = e[r]) - t <= t - n ? s : n);
};
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e, i, n, s) {
void 0 === s && (s = !1),
(this.textureKey = t),
(this.textureFrame = e),
(this.index = i),
(this.frame = n),
(this.isFirst = !1),
(this.isLast = !1),
(this.prevFrame = null),
(this.nextFrame = null),
(this.duration = 0),
(this.progress = 0),
(this.isKeyFrame = s);
},
toJSON: function () {
return { key: this.textureKey, frame: this.textureFrame, duration: this.duration, keyframe: this.isKeyFrame };
},
destroy: function () {
this.frame = void 0;
},
});
t.exports = n;
},
function (t, e) {
t.exports = function (t) {
var i = /\D/g;
return (
t.sort(function (t, e) {
return parseInt(t.replace(i, ""), 10) - parseInt(e.replace(i, ""), 10);
}),
t
);
};
},
function (t, e, i) {
var n = i(185),
s = i(0),
r = i(102),
o = i(9),
a = i(132),
h = i(22),
b = i(2),
d = i(6),
f = i(186),
p = i(322),
l = new s({
Extends: o,
initialize: function (t) {
o.call(this),
(this.game = t),
(this.textureManager = null),
(this.globalTimeScale = 1),
(this.anims = new r()),
(this.mixes = new r()),
(this.paused = !1),
(this.name = "AnimationManager"),
t.events.once(h.BOOT, this.boot, this);
},
boot: function () {
(this.textureManager = this.game.textures), this.game.events.once(h.DESTROY, this.destroy, this);
},
addMix: function (t, e, i) {
var n,
s = this.anims,
r = this.mixes,
o = "string" == typeof t ? t : t.key,
a = "string" == typeof e ? e : e.key;
return s.has(o) && s.has(a) && (((n = (n = r.get(o)) || {})[a] = i), r.set(o, n)), this;
},
removeMix: function (t, e) {
var i,
n = this.mixes,
s = "string" == typeof t ? t : t.key,
r = n.get(s);
return r && (e ? ((i = "string" == typeof e ? e : e.key), r.hasOwnProperty(i) && delete r[i]) : e || n.delete(s)), this;
},
getMix: function (t, e) {
var i = this.mixes,
n = "string" == typeof t ? t : t.key,
s = "string" == typeof e ? e : e.key,
r = i.get(n);
return r && r.hasOwnProperty(s) ? r[s] : 0;
},
add: function (t, e) {
return this.anims.has(t) || ((e.key = t), this.anims.set(t, e), this.emit(a.ADD_ANIMATION, t, e)), this;
},
exists: function (t) {
return this.anims.has(t);
},
createFromAseprite: function (g, v) {
var y = [],
t = this.game.cache.json.get(g);
if (!t) return y;
var m = this,
e = d(t, "meta", null),
x = d(t, "frames", null);
return (
e &&
x &&
d(e, "frameTags", []).forEach(function (t) {
var e = [],
i = b(t, "name", null),
n = b(t, "from", 0),
s = b(t, "to", 0),
r = b(t, "direction", "forward");
if (i && (!v || (v && -1 < v.indexOf(i)))) {
for (var o = [], a = Number.MAX_SAFE_INTEGER, h = n; h <= s; h++) {
var l,
u = h.toString(),
c = x[u];
c && ((l = b(c, "duration", Number.MAX_SAFE_INTEGER)) < a && (a = l), o.push({ frame: u, duration: l }));
}
o.forEach(function (t) {
e.push({ key: g, frame: t.frame, duration: a - t.duration });
});
var d = a * e.length;
"reverse" === r && (e = e.reverse());
var f = { key: i, frames: e, duration: d, yoyo: "pingpong" === r },
p = m.create(f);
p && y.push(p);
}
}),
y
);
},
create: function (t) {
var e = t.key,
i = !1;
return e && ((i = this.get(e)) || ((i = new n(this, e, t)), this.anims.set(e, i), this.emit(a.ADD_ANIMATION, e, i))), i;
},
fromJSON: function (t, e) {
void 0 === e && (e = !1), e && this.anims.clear(), "string" == typeof t && (t = JSON.parse(t));
var i = [];
if (t.hasOwnProperty("anims") && Array.isArray(t.anims)) {
for (var n = 0; n < t.anims.length; n++) i.push(this.create(t.anims[n]));
t.hasOwnProperty("globalTimeScale") && (this.globalTimeScale = t.globalTimeScale);
} else t.hasOwnProperty("key") && "frame" === t.type && i.push(this.create(t));
return i;
},
generateFrameNames: function (t, e) {
var i,
n = d(e, "prefix", ""),
s = d(e, "start", 0),
r = d(e, "end", 0),
o = d(e, "suffix", ""),
a = d(e, "zeroPad", 0),
h = d(e, "outputArray", []),
l = d(e, "frames", !1),
u = this.textureManager.get(t);
if (!u) return h;
if (e)
for (l = l || p(s, r), i = 0; i < l.length; i++) {
var c = n + f(l[i], a, "0", 1) + o;
u.has(c) && h.push({ key: t, frame: c });
}
else for (l = u.getFrameNames(), i = 0; i < l.length; i++) h.push({ key: t, frame: l[i] });
return h;
},
generateFrameNumbers: function (t, e) {
var i = d(e, "start", 0),
n = d(e, "end", -1),
s = d(e, "first", !1),
r = d(e, "outputArray", []),
o = d(e, "frames", !1),
a = this.textureManager.get(t);
if (!a) return r;
s && a.has(s) && r.push({ key: t, frame: s }), o || (-1 === n && (n = a.frameTotal - 2), (o = p(i, n)));
for (var h = 0; h < o.length; h++) a.has(o[h]) && r.push({ key: t, frame: o[h] });
return r;
},
get: function (t) {
return this.anims.get(t);
},
pauseAll: function () {
return this.paused || ((this.paused = !0), this.emit(a.PAUSE_ALL)), this;
},
play: function (t, e) {
Array.isArray(e) || (e = [e]);
for (var i = 0; i < e.length; i++) e[i].anims.play(t);
return this;
},
staggerPlay: function (t, e, i, n) {
void 0 === i && (i = 0), void 0 === n && (n = !0), Array.isArray(e) || (e = [e]);
var s = e.length;
n || s--;
for (var r = 0; r < e.length; r++) {
var o = i < 0 ? Math.abs(i) * (s - r) : i * r;
e[r].anims.playAfterDelay(t, o);
}
return this;
},
remove: function (t) {
var e = this.get(t);
return e && (this.emit(a.REMOVE_ANIMATION, t, e), this.anims.delete(t), this.removeMix(t)), e;
},
resumeAll: function () {
return this.paused && ((this.paused = !1), this.emit(a.RESUME_ALL)), this;
},
toJSON: function (t) {
var i = { anims: [], globalTimeScale: this.globalTimeScale };
return (
void 0 !== t && "" !== t
? i.anims.push(this.anims.get(t).toJSON())
: this.anims.each(function (t, e) {
i.anims.push(e.toJSON());
}),
i
);
},
destroy: function () {
this.anims.clear(), this.mixes.clear(), (this.textureManager = null), (this.game = null);
},
});
t.exports = l;
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s,
r = [],
o = !1;
if (((i || n) && ((o = !0), (i = i || ""), (n = n || "")), e < t)) for (s = t; e <= s; s--) o ? r.push(i + s.toString() + n) : r.push(s);
else for (s = t; s <= e; s++) o ? r.push(i + s.toString() + n) : r.push(s);
return r;
};
},
function (t, e, i) {
var n = i(0),
s = i(102),
r = i(9),
o = i(324),
a = new n({
initialize: function () {
(this.entries = new s()), (this.events = new r());
},
add: function (t, e) {
return this.entries.set(t, e), this.events.emit(o.ADD, this, t, e), this;
},
has: function (t) {
return this.entries.has(t);
},
exists: function (t) {
return this.entries.has(t);
},
get: function (t) {
return this.entries.get(t);
},
remove: function (t) {
var e = this.get(t);
return e && (this.entries.delete(t), this.events.emit(o.REMOVE, this, t, e.data)), this;
},
getKeys: function () {
return this.entries.keys();
},
destroy: function () {
this.entries.clear(), this.events.removeAllListeners(), (this.entries = null), (this.events = null);
},
});
t.exports = a;
},
function (t, e, i) {
t.exports = { ADD: i(736), REMOVE: i(737) };
},
function (t, e, i) {
var n = i(323),
s = i(0),
r = i(22),
o = new s({
initialize: function (t) {
(this.game = t),
(this.binary = new n()),
(this.bitmapFont = new n()),
(this.json = new n()),
(this.physics = new n()),
(this.shader = new n()),
(this.audio = new n()),
(this.video = new n()),
(this.text = new n()),
(this.html = new n()),
(this.obj = new n()),
(this.tilemap = new n()),
(this.xml = new n()),
(this.custom = {}),
this.game.events.once(r.DESTROY, this.destroy, this);
},
addCustom: function (t) {
return this.custom.hasOwnProperty(t) || (this.custom[t] = new n()), this.custom[t];
},
destroy: function () {
for (var t = ["binary", "bitmapFont", "json", "physics", "shader", "audio", "video", "text", "html", "obj", "tilemap", "xml"], e = 0; e < t.length; e++) this[t[e]].destroy(), (this[t[e]] = null);
for (var i in this.custom) this.custom[i].destroy();
(this.custom = null), (this.game = null);
},
});
t.exports = o;
},
function (t, e, i) {
var s = i(133),
w = i(190),
u = i(18),
n = i(0),
r = i(11),
o = i(333),
T = i(37),
S = i(135),
a = i(10),
h = i(3),
l = new n({
Extends: s,
Mixins: [r.Flip, r.Tint, r.Pipeline],
initialize: function (t, e, i, n) {
s.call(this, t, e, i, n),
(this.postPipelines = []),
(this.pipelineData = {}),
(this.inputEnabled = !0),
(this.fadeEffect = new o.Fade(this)),
(this.flashEffect = new o.Flash(this)),
(this.shakeEffect = new o.Shake(this)),
(this.panEffect = new o.Pan(this)),
(this.rotateToEffect = new o.RotateTo(this)),
(this.zoomEffect = new o.Zoom(this)),
(this.lerp = new h(1, 1)),
(this.followOffset = new h()),
(this.deadzone = null),
(this._follow = null);
},
setDeadzone: function (t, e) {
var i, n, s, r;
return (
void 0 === t
? (this.deadzone = null)
: (this.deadzone ? ((this.deadzone.width = t), (this.deadzone.height = e)) : (this.deadzone = new a(0, 0, t, e)),
this._follow &&
((i = this.width / 2),
(n = this.height / 2),
(s = this._follow.x - this.followOffset.x),
(r = this._follow.y - this.followOffset.y),
this.midPoint.set(s, r),
(this.scrollX = s - i),
(this.scrollY = r - n)),
w(this.deadzone, this.midPoint.x, this.midPoint.y)),
this
);
},
fadeIn: function (t, e, i, n, s, r) {
return this.fadeEffect.start(!1, t, e, i, n, !0, s, r);
},
fadeOut: function (t, e, i, n, s, r) {
return this.fadeEffect.start(!0, t, e, i, n, !0, s, r);
},
fadeFrom: function (t, e, i, n, s, r, o) {
return this.fadeEffect.start(!1, t, e, i, n, s, r, o);
},
fade: function (t, e, i, n, s, r, o) {
return this.fadeEffect.start(!0, t, e, i, n, s, r, o);
},
flash: function (t, e, i, n, s, r, o) {
return this.flashEffect.start(t, e, i, n, s, r, o);
},
shake: function (t, e, i, n, s) {
return this.shakeEffect.start(t, e, i, n, s);
},
pan: function (t, e, i, n, s, r, o) {
return this.panEffect.start(t, e, i, n, s, r, o);
},
rotateTo: function (t, e, i, n, s, r, o) {
return this.rotateToEffect.start(t, e, i, n, s, r, o);
},
zoomTo: function (t, e, i, n, s, r) {
return this.zoomEffect.start(t, e, i, n, s, r);
},
preRender: function () {
this.renderList.length = 0;
var t = this.width,
e = this.height,
i = 0.5 * t,
n = 0.5 * e,
s = this.zoom,
r = this.matrix,
o = t * this.originX,
a = e * this.originY,
h = this._follow,
l = this.deadzone,
u = this.scrollX,
c = this.scrollY;
l && w(l, this.midPoint.x, this.midPoint.y);
var d,
f,
p = !1;
h &&
!this.panEffect.isRunning &&
((d = h.x - this.followOffset.x),
(f = h.y - this.followOffset.y),
l
? (d < l.x ? (u = S(u, u - (l.x - d), this.lerp.x)) : d > l.right && (u = S(u, u + (d - l.right), this.lerp.x)),
f < l.y ? (c = S(c, c - (l.y - f), this.lerp.y)) : f > l.bottom && (c = S(c, c + (f - l.bottom), this.lerp.y)))
: ((u = S(u, d - o, this.lerp.x)), (c = S(c, f - a, this.lerp.y))),
(p = !0)),
this.useBounds && ((u = this.clampX(u)), (c = this.clampY(c))),
this.roundPixels && ((o = Math.round(o)), (a = Math.round(a)), (u = Math.round(u)), (c = Math.round(c)));
var g = (this.scrollX = u) + i,
v = (this.scrollY = c) + n;
this.midPoint.set(g, v);
var y = t / s,
m = e / s,
x = g - y / 2,
b = v - m / 2;
this.roundPixels && ((x = Math.round(x)), (b = Math.round(b))),
this.worldView.setTo(x, b, y, m),
r.applyITRS(this.x + o, this.y + a, this.rotation, s, s),
r.translate(-o, -a),
this.shakeEffect.preRender(),
p && this.emit(T.FOLLOW_UPDATE, this, h);
},
setLerp: function (t, e) {
return void 0 === t && (t = 1), void 0 === e && (e = t), this.lerp.set(t, e), this;
},
setFollowOffset: function (t, e) {
return void 0 === t && (t = 0), void 0 === e && (e = 0), this.followOffset.set(t, e), this;
},
startFollow: function (t, e, i, n, s, r) {
void 0 === e && (e = !1),
void 0 === i && (i = 1),
void 0 === n && (n = i),
void 0 === s && (s = 0),
void 0 === r && (r = s),
(this._follow = t),
(this.roundPixels = e),
(i = u(i, 0, 1)),
(n = u(n, 0, 1)),
this.lerp.set(i, n),
this.followOffset.set(s, r);
var o = this.width / 2,
a = this.height / 2,
h = t.x - s,
l = t.y - r;
return this.midPoint.set(h, l), (this.scrollX = h - o), (this.scrollY = l - a), this.useBounds && ((this.scrollX = this.clampX(this.scrollX)), (this.scrollY = this.clampY(this.scrollY))), this;
},
stopFollow: function () {
return (this._follow = null), this;
},
resetFX: function () {
return this.rotateToEffect.reset(), this.panEffect.reset(), this.shakeEffect.reset(), this.flashEffect.reset(), this.fadeEffect.reset(), this;
},
update: function (t, e) {
this.visible && (this.rotateToEffect.update(t, e), this.panEffect.update(t, e), this.zoomEffect.update(t, e), this.shakeEffect.update(t, e), this.flashEffect.update(t, e), this.fadeEffect.update(t, e));
},
destroy: function () {
this.resetFX(), s.prototype.destroy.call(this), (this._follow = null), (this.deadzone = null);
},
});
t.exports = l;
},
function (t, e, i) {
var o = i(38);
t.exports = function (t) {
var e = new o();
t = t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i, function (t, e, i, n) {
return e + e + i + i + n + n;
});
var i,
n,
s,
r = /^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
return r && ((i = parseInt(r[1], 16)), (n = parseInt(r[2], 16)), (s = parseInt(r[3], 16)), e.setTo(i, n, s)), e;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
return (n << 24) | (t << 16) | (e << 8) | i;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
void 0 === n && (n = { h: 0, s: 0, v: 0 }), (t /= 255), (e /= 255), (i /= 255);
var s = Math.min(t, e, i),
r = Math.max(t, e, i),
o = r - s,
a = 0,
h = 0 === r ? 0 : o / r,
l = r;
return (
r !== s && (r === t ? (a = (e - i) / o + (e < i ? 6 : 0)) : r === e ? (a = (i - t) / o + 2) : r === i && (a = (t - e) / o + 4), (a /= 6)),
n.hasOwnProperty("_h") ? ((n._h = a), (n._s = h), (n._v = l)) : ((n.h = a), (n.s = h), (n.v = l)),
n
);
};
},
function (t, e) {
t.exports = function (t) {
return 16777215 < t ? { a: t >>> 24, r: (t >> 16) & 255, g: (t >> 8) & 255, b: 255 & t } : { a: 255, r: (t >> 16) & 255, g: (t >> 8) & 255, b: 255 & t };
};
},
function (t, e, i) {
var n = i(38);
t.exports = function (t) {
return new n(t.r, t.g, t.b, t.a);
};
},
function (t, e, i) {
var a = i(38);
t.exports = function (t) {
var e,
i,
n,
s,
r = new a(),
o = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());
return o && ((e = parseInt(o[1], 10)), (i = parseInt(o[2], 10)), (n = parseInt(o[3], 10)), (s = void 0 !== o[4] ? parseFloat(o[4]) : 1), r.setTo(e, i, n, 255 * s)), r;
};
},
function (t, e, i) {
t.exports = { Fade: i(761), Flash: i(762), Pan: i(763), Shake: i(796), RotateTo: i(797), Zoom: i(798) };
},
function (t, e, i) {
t.exports = { In: i(764), Out: i(765), InOut: i(766) };
},
function (t, e, i) {
t.exports = { In: i(767), Out: i(768), InOut: i(769) };
},
function (t, e, i) {
t.exports = { In: i(770), Out: i(771), InOut: i(772) };
},
function (t, e, i) {
t.exports = { In: i(773), Out: i(774), InOut: i(775) };
},
function (t, e, i) {
t.exports = { In: i(776), Out: i(777), InOut: i(778) };
},
function (t, e, i) {
t.exports = { In: i(779), Out: i(780), InOut: i(781) };
},
function (t, e, i) {
t.exports = i(782);
},
function (t, e, i) {
t.exports = { In: i(783), Out: i(784), InOut: i(785) };
},
function (t, e, i) {
t.exports = { In: i(786), Out: i(787), InOut: i(788) };
},
function (t, e, i) {
t.exports = { In: i(789), Out: i(790), InOut: i(791) };
},
function (t, e, i) {
t.exports = { In: i(792), Out: i(793), InOut: i(794) };
},
function (t, e, i) {
t.exports = i(795);
},
function (t, e, i) {
var n = i(0),
h = i(33),
l = i(347),
u = i(2),
c = i(6),
d = i(7),
f = i(193),
p = i(1),
g = i(197),
v = i(187),
s = new n({
initialize: function (t) {
void 0 === t && (t = {}),
(this.width = c(t, "width", 1024)),
(this.height = c(t, "height", 768)),
(this.zoom = c(t, "zoom", 1)),
(this.parent = c(t, "parent", void 0)),
(this.scaleMode = c(t, "scaleMode", 0)),
(this.expandParent = c(t, "expandParent", !0)),
(this.autoRound = c(t, "autoRound", !1)),
(this.autoCenter = c(t, "autoCenter", 0)),
(this.resizeInterval = c(t, "resizeInterval", 500)),
(this.fullscreenTarget = c(t, "fullscreenTarget", null)),
(this.minWidth = c(t, "minWidth", 0)),
(this.maxWidth = c(t, "maxWidth", 0)),
(this.minHeight = c(t, "minHeight", 0)),
(this.maxHeight = c(t, "maxHeight", 0));
var e = c(t, "scale", null);
e &&
((this.width = c(e, "width", this.width)),
(this.height = c(e, "height", this.height)),
(this.zoom = c(e, "zoom", this.zoom)),
(this.parent = c(e, "parent", this.parent)),
(this.scaleMode = c(e, "mode", this.scaleMode)),
(this.expandParent = c(e, "expandParent", this.expandParent)),
(this.autoRound = c(e, "autoRound", this.autoRound)),
(this.autoCenter = c(e, "autoCenter", this.autoCenter)),
(this.resizeInterval = c(e, "resizeInterval", this.resizeInterval)),
(this.fullscreenTarget = c(e, "fullscreenTarget", this.fullscreenTarget)),
(this.minWidth = c(e, "min.width", this.minWidth)),
(this.maxWidth = c(e, "max.width", this.maxWidth)),
(this.minHeight = c(e, "min.height", this.minHeight)),
(this.maxHeight = c(e, "max.height", this.maxHeight))),
(this.renderType = c(t, "type", h.AUTO)),
(this.canvas = c(t, "canvas", null)),
(this.context = c(t, "context", null)),
(this.canvasStyle = c(t, "canvasStyle", null)),
(this.customEnvironment = c(t, "customEnvironment", !1)),
(this.sceneConfig = c(t, "scene", null)),
(this.seed = c(t, "seed", [(Date.now() * Math.random()).toString()])),
(f.RND = new f.RandomDataGenerator(this.seed)),
(this.gameTitle = c(t, "title", "")),
(this.gameURL = c(t, "url", "https://phaser.io")),
(this.gameVersion = c(t, "version", "")),
(this.autoFocus = c(t, "autoFocus", !0)),
(this.domCreateContainer = c(t, "dom.createContainer", !1)),
(this.domBehindCanvas = c(t, "dom.behindCanvas", !1)),
(this.domPointerEvents = c(t, "dom.pointerEvents", "none")),
(this.inputKeyboard = c(t, "input.keyboard", !0)),
(this.inputKeyboardEventTarget = c(t, "input.keyboard.target", window)),
(this.inputKeyboardCapture = c(t, "input.keyboard.capture", [])),
(this.inputMouse = c(t, "input.mouse", !0)),
(this.inputMouseEventTarget = c(t, "input.mouse.target", null)),
(this.inputMousePreventDefaultDown = c(t, "input.mouse.preventDefaultDown", !0)),
(this.inputMousePreventDefaultUp = c(t, "input.mouse.preventDefaultUp", !0)),
(this.inputMousePreventDefaultMove = c(t, "input.mouse.preventDefaultMove", !0)),
(this.inputMousePreventDefaultWheel = c(t, "input.mouse.preventDefaultWheel", !0)),
(this.inputTouch = c(t, "input.touch", l.input.touch)),
(this.inputTouchEventTarget = c(t, "input.touch.target", null)),
(this.inputTouchCapture = c(t, "input.touch.capture", !0)),
(this.inputActivePointers = c(t, "input.activePointers", 1)),
(this.inputSmoothFactor = c(t, "input.smoothFactor", 0)),
(this.inputWindowEvents = c(t, "input.windowEvents", !0)),
(this.inputGamepad = c(t, "input.gamepad", !1)),
(this.inputGamepadEventTarget = c(t, "input.gamepad.target", window)),
(this.disableContextMenu = c(t, "disableContextMenu", !1)),
(this.audio = c(t, "audio", {})),
(this.hideBanner = !1 === c(t, "banner", null)),
(this.hidePhaser = c(t, "banner.hidePhaser", !1)),
(this.bannerTextColor = c(t, "banner.text", "#ffffff")),
(this.bannerBackgroundColor = c(t, "banner.background", ["#ff0000", "#ffff00", "#00ff00", "#00ffff", "#000000"])),
"" === this.gameTitle && this.hidePhaser && (this.hideBanner = !0),
(this.fps = c(t, "fps", null));
var i = c(t, "render", t);
(this.pipeline = c(i, "pipeline", null)),
(this.antialias = c(i, "antialias", !0)),
(this.antialiasGL = c(i, "antialiasGL", !0)),
(this.mipmapFilter = c(i, "mipmapFilter", "LINEAR")),
(this.desynchronized = c(i, "desynchronized", !1)),
(this.roundPixels = c(i, "roundPixels", !1)),
(this.pixelArt = c(i, "pixelArt", 1 !== this.zoom)),
this.pixelArt && ((this.antialias = !1), (this.antialiasGL = !1), (this.roundPixels = !0)),
(this.transparent = c(i, "transparent", !1)),
(this.clearBeforeRender = c(i, "clearBeforeRender", !0)),
(this.preserveDrawingBuffer = c(i, "preserveDrawingBuffer", !1)),
(this.premultipliedAlpha = c(i, "premultipliedAlpha", !0)),
(this.failIfMajorPerformanceCaveat = c(i, "failIfMajorPerformanceCaveat", !1)),
(this.powerPreference = c(i, "powerPreference", "default")),
(this.batchSize = c(i, "batchSize", 4096)),
(this.maxTextures = c(i, "maxTextures", -1)),
(this.maxLights = c(i, "maxLights", 10));
var n = c(t, "backgroundColor", 0);
(this.backgroundColor = v(n)),
this.transparent && ((this.backgroundColor = v(0)), (this.backgroundColor.alpha = 0)),
(this.preBoot = c(t, "callbacks.preBoot", p)),
(this.postBoot = c(t, "callbacks.postBoot", p)),
(this.physics = c(t, "physics", {})),
(this.defaultPhysicsSystem = c(this.physics, "default", !1)),
(this.loaderBaseURL = c(t, "loader.baseURL", "")),
(this.loaderPath = c(t, "loader.path", ""));
var s = l.os.android ? 6 : 32;
(this.loaderMaxParallelDownloads = c(t, "loader.maxParallelDownloads", s)),
(this.loaderCrossOrigin = c(t, "loader.crossOrigin", void 0)),
(this.loaderResponseType = c(t, "loader.responseType", "")),
(this.loaderAsync = c(t, "loader.async", !0)),
(this.loaderUser = c(t, "loader.user", "")),
(this.loaderPassword = c(t, "loader.password", "")),
(this.loaderTimeout = c(t, "loader.timeout", 0)),
(this.loaderWithCredentials = c(t, "loader.withCredentials", !1)),
(this.installGlobalPlugins = []),
(this.installScenePlugins = []);
var r = c(t, "plugins", null),
o = g.DefaultScene;
r &&
(Array.isArray(r)
? (this.defaultPlugins = r)
: d(r) &&
((this.installGlobalPlugins = u(r, "global", [])),
(this.installScenePlugins = u(r, "scene", [])),
Array.isArray(r.default) ? (o = r.default) : Array.isArray(r.defaultMerge) && (o = o.concat(r.defaultMerge)))),
(this.defaultPlugins = o);
var a = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";
(this.defaultImage = c(t, "images.default", a + "AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg==")),
(this.missingImage = c(
t,
"images.missing",
a +
"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="
)),
(this.whiteImage = c(
t,
"images.white",
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"
)),
window && (window.FORCE_WEBGL ? (this.renderType = h.WEBGL) : window.FORCE_CANVAS && (this.renderType = h.CANVAS));
},
});
t.exports = s;
},
function (t, e, i) {
t.exports = { os: i(105), browser: i(136), features: i(191), input: i(808), audio: i(809), video: i(810), fullscreen: i(811), canvasFeatures: i(348) };
},
function (t, e, i) {
var n,
s,
r,
o = i(31),
a = { supportInverseAlpha: !1, supportNewBlendModes: !1 };
t.exports =
("function" != typeof importScripts &&
void 0 !== document &&
((a.supportNewBlendModes =
((n = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/"),
(s = "AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg=="),
((r = new Image()).onload = function () {
var i = new Image();
(i.onload = function () {
var t = o.create(i, 6, 1).getContext("2d");
if (((t.globalCompositeOperation = "multiply"), t.drawImage(r, 0, 0), t.drawImage(i, 2, 0), !t.getImageData(2, 0, 1, 1))) return !1;
var e = t.getImageData(2, 0, 1, 1).data;
o.remove(i), (a.supportNewBlendModes = 255 === e[0] && 0 === e[1] && 0 === e[2]);
}),
(i.src = n + "/wCKxvRF" + s);
}),
(r.src = n + "AP804Oa6" + s),
!1)),
(a.supportInverseAlpha = (function () {
var t = o.create(this, 2, 1).getContext("2d");
(t.fillStyle = "rgba(10, 20, 30, 0.5)"), t.fillRect(0, 0, 1, 1);
var e = t.getImageData(0, 0, 1, 1);
if (null === e) return !1;
t.putImageData(e, 1, 0);
var i = t.getImageData(1, 0, 1, 1);
return i.data[0] === e.data[0] && i.data[1] === e.data[1] && i.data[2] === e.data[2] && i.data[3] === e.data[3];
})())),
a);
},
function (t, e) {
t.exports = function (t, e, i, n) {
return Math.atan2(n - e, i - t);
};
},
function (t, e) {
t.exports = function (t, e) {
return Math.atan2(e.y - t.y, e.x - t.x);
};
},
function (t, e) {
t.exports = function (t) {
return 0 <= (t %= 2 * Math.PI) ? t : t + 2 * Math.PI;
};
},
function (t, e) {
t.exports = function (t, e) {
var i = t.x - e.x,
n = t.y - e.y;
return Math.sqrt(i * i + n * n);
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = t - i,
r = e - n;
return s * s + r * r;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return void 0 === i && (i = 1e-4), e - i < t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return void 0 === i && (i = 1e-4), t < e + i;
};
},
function (t, e, i) {
var n = i(357);
t.exports = function (t, e) {
return n(t) / n(e) / n(t - e);
};
},
function (t, e) {
t.exports = function (t) {
if (0 === t) return 1;
for (var e = t; --t; ) e *= t;
return e;
};
},
function (t, e) {
t.exports = function (t, e, i, n, s) {
return (l = 1 - t) * l * l * e + 3 * (h = 1 - (a = t)) * h * a * i + 3 * (1 - (o = t)) * o * o * n + (r = t) * r * r * s;
var r, o, a, h, l;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
return (o = 1 - t) * o * e + 2 * (1 - (r = t)) * r * i + (s = t) * s * n;
var s, r, o;
};
},
function (t, e, i) {
var n = i(184);
t.exports = function (t, e, i) {
return e + (i - e) * n(t, 0, 1);
};
},
function (t, e) {
t.exports = function (t) {
var e = Math.log(t) / 0.6931471805599453;
return 1 << Math.ceil(e);
};
},
function (t, e) {
t.exports = function (t, e) {
var i = t.x,
n = t.y;
return (t.x = i * Math.cos(e) - n * Math.sin(e)), (t.y = i * Math.sin(e) + n * Math.cos(e)), t;
};
},
function (t, e) {
t.exports = function (t) {
return 0 < t ? Math.ceil(t) : Math.floor(t);
};
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t) {
(this.val = new Float32Array(9)), t ? this.copy(t) : this.identity();
},
clone: function () {
return new n(this);
},
set: function (t) {
return this.copy(t);
},
copy: function (t) {
var e = this.val,
i = t.val;
return (e[0] = i[0]), (e[1] = i[1]), (e[2] = i[2]), (e[3] = i[3]), (e[4] = i[4]), (e[5] = i[5]), (e[6] = i[6]), (e[7] = i[7]), (e[8] = i[8]), this;
},
fromMat4: function (t) {
var e = t.val,
i = this.val;
return (i[0] = e[0]), (i[1] = e[1]), (i[2] = e[2]), (i[3] = e[4]), (i[4] = e[5]), (i[5] = e[6]), (i[6] = e[8]), (i[7] = e[9]), (i[8] = e[10]), this;
},
fromArray: function (t) {
var e = this.val;
return (e[0] = t[0]), (e[1] = t[1]), (e[2] = t[2]), (e[3] = t[3]), (e[4] = t[4]), (e[5] = t[5]), (e[6] = t[6]), (e[7] = t[7]), (e[8] = t[8]), this;
},
identity: function () {
var t = this.val;
return (t[0] = 1), (t[1] = 0), (t[2] = 0), (t[3] = 0), (t[4] = 1), (t[5] = 0), (t[6] = 0), (t[7] = 0), (t[8] = 1), this;
},
transpose: function () {
var t = this.val,
e = t[1],
i = t[2],
n = t[5];
return (t[1] = t[3]), (t[2] = t[6]), (t[3] = e), (t[5] = t[7]), (t[6] = i), (t[7] = n), this;
},
invert: function () {
var t = this.val,
e = t[0],
i = t[1],
n = t[2],
s = t[3],
r = t[4],
o = t[5],
a = t[6],
h = t[7],
l = t[8],
u = l * r - o * h,
c = -l * s + o * a,
d = h * s - r * a,
f = e * u + i * c + n * d;
return f
? ((f = 1 / f),
(t[0] = u * f),
(t[1] = (-l * i + n * h) * f),
(t[2] = (o * i - n * r) * f),
(t[3] = c * f),
(t[4] = (l * e - n * a) * f),
(t[5] = (-o * e + n * s) * f),
(t[6] = d * f),
(t[7] = (-h * e + i * a) * f),
(t[8] = (r * e - i * s) * f),
this)
: null;
},
adjoint: function () {
var t = this.val,
e = t[0],
i = t[1],
n = t[2],
s = t[3],
r = t[4],
o = t[5],
a = t[6],
h = t[7],
l = t[8];
return (
(t[0] = r * l - o * h),
(t[1] = n * h - i * l),
(t[2] = i * o - n * r),
(t[3] = o * a - s * l),
(t[4] = e * l - n * a),
(t[5] = n * s - e * o),
(t[6] = s * h - r * a),
(t[7] = i * a - e * h),
(t[8] = e * r - i * s),
this
);
},
determinant: function () {
var t = this.val,
e = t[0],
i = t[1],
n = t[2],
s = t[3],
r = t[4],
o = t[5],
a = t[6],
h = t[7],
l = t[8];
return e * (l * r - o * h) + i * (-l * s + o * a) + n * (h * s - r * a);
},
multiply: function (t) {
var e = this.val,
i = e[0],
n = e[1],
s = e[2],
r = e[3],
o = e[4],
a = e[5],
h = e[6],
l = e[7],
u = e[8],
c = t.val,
d = c[0],
f = c[1],
p = c[2],
g = c[3],
v = c[4],
y = c[5],
m = c[6],
x = c[7],
b = c[8];
return (
(e[0] = d * i + f * r + p * h),
(e[1] = d * n + f * o + p * l),
(e[2] = d * s + f * a + p * u),
(e[3] = g * i + v * r + y * h),
(e[4] = g * n + v * o + y * l),
(e[5] = g * s + v * a + y * u),
(e[6] = m * i + x * r + b * h),
(e[7] = m * n + x * o + b * l),
(e[8] = m * s + x * a + b * u),
this
);
},
translate: function (t) {
var e = this.val,
i = t.x,
n = t.y;
return (e[6] = i * e[0] + n * e[3] + e[6]), (e[7] = i * e[1] + n * e[4] + e[7]), (e[8] = i * e[2] + n * e[5] + e[8]), this;
},
rotate: function (t) {
var e = this.val,
i = e[0],
n = e[1],
s = e[2],
r = e[3],
o = e[4],
a = e[5],
h = Math.sin(t),
l = Math.cos(t);
return (e[0] = l * i + h * r), (e[1] = l * n + h * o), (e[2] = l * s + h * a), (e[3] = l * r - h * i), (e[4] = l * o - h * n), (e[5] = l * a - h * s), this;
},
scale: function (t) {
var e = this.val,
i = t.x,
n = t.y;
return (e[0] = i * e[0]), (e[1] = i * e[1]), (e[2] = i * e[2]), (e[3] = n * e[3]), (e[4] = n * e[4]), (e[5] = n * e[5]), this;
},
fromQuat: function (t) {
var e = t.x,
i = t.y,
n = t.z,
s = t.w,
r = e + e,
o = i + i,
a = n + n,
h = e * r,
l = e * o,
u = e * a,
c = i * o,
d = i * a,
f = n * a,
p = s * r,
g = s * o,
v = s * a,
y = this.val;
return (y[0] = 1 - (c + f)), (y[3] = l + v), (y[6] = u - g), (y[1] = l - v), (y[4] = 1 - (h + f)), (y[7] = d + p), (y[2] = u + g), (y[5] = d - p), (y[8] = 1 - (h + c)), this;
},
normalFromMat4: function (t) {
var e = t.val,
i = this.val,
n = e[0],
s = e[1],
r = e[2],
o = e[3],
a = e[4],
h = e[5],
l = e[6],
u = e[7],
c = e[8],
d = e[9],
f = e[10],
p = e[11],
g = e[12],
v = e[13],
y = e[14],
m = e[15],
x = n * h - s * a,
b = n * l - r * a,
w = n * u - o * a,
T = s * l - r * h,
S = s * u - o * h,
_ = r * u - o * l,
E = c * v - d * g,
P = c * y - f * g,
A = c * m - p * g,
M = d * y - f * v,
C = d * m - p * v,
O = f * m - p * y,
k = x * O - b * C + w * M + T * A - S * P + _ * E;
return k
? ((k = 1 / k),
(i[0] = (h * O - l * C + u * M) * k),
(i[1] = (l * A - a * O - u * P) * k),
(i[2] = (a * C - h * A + u * E) * k),
(i[3] = (r * C - s * O - o * M) * k),
(i[4] = (n * O - r * A + o * P) * k),
(i[5] = (s * A - n * C - o * E) * k),
(i[6] = (v * _ - y * S + m * T) * k),
(i[7] = (y * w - g * _ - m * b) * k),
(i[8] = (g * S - v * w + m * x) * k),
this)
: null;
},
});
t.exports = n;
},
function (t, e, i) {
var n = i(0),
s = i(364),
r = i(1),
o = i(39),
a = new Int8Array([1, 2, 0]),
h = new Float32Array([0, 0, 0]),
l = new o(1, 0, 0),
u = new o(0, 1, 0),
c = new o(),
d = new s(),
f = new n({
initialize: function (t, e, i, n) {
(this.onChangeCallback = r), this.set(t, e, i, n);
},
x: {
get: function () {
return this._x;
},
set: function (t) {
(this._x = t), this.onChangeCallback(this);
},
},
y: {
get: function () {
return this._y;
},
set: function (t) {
(this._y = t), this.onChangeCallback(this);
},
},
z: {
get: function () {
return this._z;
},
set: function (t) {
(this._z = t), this.onChangeCallback(this);
},
},
w: {
get: function () {
return this._w;
},
set: function (t) {
(this._w = t), this.onChangeCallback(this);
},
},
copy: function (t) {
return this.set(t);
},
set: function (t, e, i, n, s) {
return (
void 0 === s && (s = !0),
"object" == typeof t ? ((this._x = t.x || 0), (this._y = t.y || 0), (this._z = t.z || 0), (this._w = t.w || 0)) : ((this._x = t || 0), (this._y = e || 0), (this._z = i || 0), (this._w = n || 0)),
s && this.onChangeCallback(this),
this
);
},
add: function (t) {
return (this._x += t.x), (this._y += t.y), (this._z += t.z), (this._w += t.w), this.onChangeCallback(this), this;
},
subtract: function (t) {
return (this._x -= t.x), (this._y -= t.y), (this._z -= t.z), (this._w -= t.w), this.onChangeCallback(this), this;
},
scale: function (t) {
return (this._x *= t), (this._y *= t), (this._z *= t), (this._w *= t), this.onChangeCallback(this), this;
},
length: function () {
var t = this.x,
e = this.y,
i = this.z,
n = this.w;
return Math.sqrt(t * t + e * e + i * i + n * n);
},
lengthSq: function () {
var t = this.x,
e = this.y,
i = this.z,
n = this.w;
return t * t + e * e + i * i + n * n;
},
normalize: function () {
var t = this.x,
e = this.y,
i = this.z,
n = this.w,
s = t * t + e * e + i * i + n * n;
return 0 < s && ((s = 1 / Math.sqrt(s)), (this._x = t * s), (this._y = e * s), (this._z = i * s), (this._w = n * s)), this.onChangeCallback(this), this;
},
dot: function (t) {
return this.x * t.x + this.y * t.y + this.z * t.z + this.w * t.w;
},
lerp: function (t, e) {
void 0 === e && (e = 0);
var i = this.x,
n = this.y,
s = this.z,
r = this.w;
return this.set(i + e * (t.x - i), n + e * (t.y - n), s + e * (t.z - s), r + e * (t.w - r));
},
rotationTo: function (t, e) {
var i = t.x * e.x + t.y * e.y + t.z * e.z;
return i < -0.999999
? (c.copy(l).cross(t).length() < 1e-6 && c.copy(u).cross(t), c.normalize(), this.setAxisAngle(c, Math.PI))
: 0.999999 < i
? this.set(0, 0, 0, 1)
: (c.copy(t).cross(e), (this._x = c.x), (this._y = c.y), (this._z = c.z), (this._w = 1 + i), this.normalize());
},
setAxes: function (t, e, i) {
var n = d.val;
return (n[0] = e.x), (n[3] = e.y), (n[6] = e.z), (n[1] = i.x), (n[4] = i.y), (n[7] = i.z), (n[2] = -t.x), (n[5] = -t.y), (n[8] = -t.z), this.fromMat3(d).normalize();
},
identity: function () {
return this.set(0, 0, 0, 1);
},
setAxisAngle: function (t, e) {
e *= 0.5;
var i = Math.sin(e);
return this.set(i * t.x, i * t.y, i * t.z, Math.cos(e));
},
multiply: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = this.w,
r = t.x,
o = t.y,
a = t.z,
h = t.w;
return this.set(e * h + s * r + i * a - n * o, i * h + s * o + n * r - e * a, n * h + s * a + e * o - i * r, s * h - e * r - i * o - n * a);
},
slerp: function (t, e) {
var i = this.x,
n = this.y,
s = this.z,
r = this.w,
o = t.x,
a = t.y,
h = t.z,
l = t.w,
u = i * o + n * a + s * h + r * l;
u < 0 && ((u = -u), (o = -o), (a = -a), (h = -h), (l = -l));
var c,
d,
f = 1 - e,
p = e;
return 1e-6 < 1 - u && ((c = Math.acos(u)), (d = Math.sin(c)), (f = Math.sin((1 - e) * c) / d), (p = Math.sin(e * c) / d)), this.set(f * i + p * o, f * n + p * a, f * s + p * h, f * r + p * l);
},
invert: function () {
var t = this.x,
e = this.y,
i = this.z,
n = this.w,
s = t * t + e * e + i * i + n * n,
r = s ? 1 / s : 0;
return this.set(-t * r, -e * r, -i * r, n * r);
},
conjugate: function () {
return (this._x = -this.x), (this._y = -this.y), (this._z = -this.z), this.onChangeCallback(this), this;
},
rotateX: function (t) {
t *= 0.5;
var e = this.x,
i = this.y,
n = this.z,
s = this.w,
r = Math.sin(t),
o = Math.cos(t);
return this.set(e * o + s * r, i * o + n * r, n * o - i * r, s * o - e * r);
},
rotateY: function (t) {
t *= 0.5;
var e = this.x,
i = this.y,
n = this.z,
s = this.w,
r = Math.sin(t),
o = Math.cos(t);
return this.set(e * o - n * r, i * o + s * r, n * o + e * r, s * o - i * r);
},
rotateZ: function (t) {
t *= 0.5;
var e = this.x,
i = this.y,
n = this.z,
s = this.w,
r = Math.sin(t),
o = Math.cos(t);
return this.set(e * o + i * r, i * o - e * r, n * o + s * r, s * o - n * r);
},
calculateW: function () {
var t = this.x,
e = this.y,
i = this.z;
return (this.w = -Math.sqrt(1 - t * t - e * e - i * i)), this;
},
setFromEuler: function (t, e) {
var i = t.x / 2,
n = t.y / 2,
s = t.z / 2,
r = Math.cos(i),
o = Math.cos(n),
a = Math.cos(s),
h = Math.sin(i),
l = Math.sin(n),
u = Math.sin(s);
switch (t.order) {
case "XYZ":
this.set(h * o * a + r * l * u, r * l * a - h * o * u, r * o * u + h * l * a, r * o * a - h * l * u, e);
break;
case "YXZ":
this.set(h * o * a + r * l * u, r * l * a - h * o * u, r * o * u - h * l * a, r * o * a + h * l * u, e);
break;
case "ZXY":
this.set(h * o * a - r * l * u, r * l * a + h * o * u, r * o * u + h * l * a, r * o * a - h * l * u, e);
break;
case "ZYX":
this.set(h * o * a - r * l * u, r * l * a + h * o * u, r * o * u - h * l * a, r * o * a + h * l * u, e);
break;
case "YZX":
this.set(h * o * a + r * l * u, r * l * a + h * o * u, r * o * u - h * l * a, r * o * a - h * l * u, e);
break;
case "XZY":
this.set(h * o * a - r * l * u, r * l * a - h * o * u, r * o * u + h * l * a, r * o * a + h * l * u, e);
}
return this;
},
setFromRotationMatrix: function (t) {
var e,
i = t.val,
n = i[0],
s = i[4],
r = i[8],
o = i[1],
a = i[5],
h = i[9],
l = i[2],
u = i[6],
c = i[10],
d = n + a + c;
return (
0 < d
? ((e = 0.5 / Math.sqrt(d + 1)), this.set((u - h) * e, (r - l) * e, (o - s) * e, 0.25 / e))
: a < n && c < n
? ((e = 2 * Math.sqrt(1 + n - a - c)), this.set(0.25 * e, (s + o) / e, (r + l) / e, (u - h) / e))
: c < a
? ((e = 2 * Math.sqrt(1 + a - n - c)), this.set((s + o) / e, 0.25 * e, (h + u) / e, (r - l) / e))
: ((e = 2 * Math.sqrt(1 + c - n - a)), this.set((r + l) / e, (h + u) / e, 0.25 * e, (o - s) / e)),
this
);
},
fromMat3: function (t) {
var e,
i,
n,
s,
r = t.val,
o = r[0] + r[4] + r[8];
return (
0 < o
? ((s = Math.sqrt(o + 1)), (this.w = 0.5 * s), (s = 0.5 / s), (this._x = (r[7] - r[5]) * s), (this._y = (r[2] - r[6]) * s), (this._z = (r[3] - r[1]) * s))
: ((e = 0),
r[4] > r[0] && (e = 1),
r[8] > r[3 * e + e] && (e = 2),
(i = a[e]),
(n = a[i]),
(s = Math.sqrt(r[3 * e + e] - r[3 * i + i] - r[3 * n + n] + 1)),
(h[e] = 0.5 * s),
(s = 0.5 / s),
(h[i] = (r[3 * i + e] + r[3 * e + i]) * s),
(h[n] = (r[3 * n + e] + r[3 * e + n]) * s),
(this._x = h[0]),
(this._y = h[1]),
(this._z = h[2]),
(this._w = (r[3 * n + i] - r[3 * i + n]) * s)),
this.onChangeCallback(this),
this
);
},
});
t.exports = f;
},
function (t, e, a) {
var h = a(367),
l = a(31),
u = a(33),
c = a(191);
t.exports = function (t) {
var e = t.config;
if ((e.customEnvironment || e.canvas) && e.renderType === u.AUTO) throw new Error("Must set explicit renderType in custom environment");
if (!e.customEnvironment && !e.canvas && e.renderType !== u.HEADLESS)
if (e.renderType === u.CANVAS || (e.renderType !== u.CANVAS && !c.webGL)) {
if (!c.canvas) throw new Error("Cannot create Canvas or WebGL context, aborting.");
e.renderType = u.CANVAS;
} else e.renderType = u.WEBGL;
e.antialias || l.disableSmoothing();
var i,
n,
s = t.scale.baseSize,
r = s.width,
o = s.height;
e.canvas ? ((t.canvas = e.canvas), (t.canvas.width = r), (t.canvas.height = o)) : (t.canvas = l.create(t, r, o, e.renderType)),
e.canvasStyle && (t.canvas.style = e.canvasStyle),
e.antialias || h.setCrisp(t.canvas),
e.renderType !== u.HEADLESS && ((i = a(368)), (n = a(371)), e.renderType === u.WEBGL ? (t.renderer = new n(t)) : ((t.renderer = new i(t)), (t.context = t.renderer.gameContext)));
};
},
function (t, e) {
t.exports = {
setCrisp: function (e) {
return (
["optimizeSpeed", "-moz-crisp-edges", "-o-crisp-edges", "-webkit-optimize-contrast", "optimize-contrast", "crisp-edges", "pixelated"].forEach(function (t) {
e.style["image-rendering"] = t;
}),
(e.style.msInterpolationMode = "nearest-neighbor"),
e
);
},
setBicubic: function (t) {
return (t.style["image-rendering"] = "auto"), (t.style.msInterpolationMode = "bicubic"), t;
},
};
},
function (t, e, i) {
var d = i(37),
u = i(369),
n = i(0),
s = i(33),
r = i(9),
f = i(91),
o = i(370),
a = i(104),
h = i(106),
l = i(25),
c = new n({
Extends: r,
initialize: function (t) {
r.call(this);
var e = t.config;
(this.config = { clearBeforeRender: e.clearBeforeRender, backgroundColor: e.backgroundColor, antialias: e.antialias, roundPixels: e.roundPixels }),
(this.game = t),
(this.type = s.CANVAS),
(this.drawCount = 0),
(this.width = 0),
(this.height = 0),
(this.gameCanvas = t.canvas);
var i = { alpha: t.config.transparent, desynchronized: t.config.desynchronized };
(this.gameContext = e.context ? e.context : this.gameCanvas.getContext("2d", i)),
(this.currentContext = this.gameContext),
(this.antialias = t.config.antialias),
(this.blendModes = o()),
(this.snapshotState = { x: 0, y: 0, width: 1, height: 1, getPixel: !1, callback: null, type: "image/png", encoder: 0.92 }),
(this._tempMatrix1 = new l()),
(this._tempMatrix2 = new l()),
(this._tempMatrix3 = new l()),
(this.isBooted = !1),
this.init();
},
init: function () {
this.game.textures.once(h.READY, this.boot, this);
},
boot: function () {
var t = this.game,
e = t.scale.baseSize;
(this.width = e.width), (this.height = e.height), (this.isBooted = !0), t.scale.on(a.RESIZE, this.onResize, this), this.resize(e.width, e.height);
},
onResize: function (t, e) {
(e.width === this.width && e.height === this.height) || this.resize(e.width, e.height);
},
resize: function (t, e) {
(this.width = t), (this.height = e), this.emit(f.RESIZE, t, e);
},
resetTransform: function () {
this.currentContext.setTransform(1, 0, 0, 1, 0, 0);
},
setBlendMode: function (t) {
return (this.currentContext.globalCompositeOperation = t), this;
},
setContext: function (t) {
return (this.currentContext = t || this.gameContext), this;
},
setAlpha: function (t) {
return (this.currentContext.globalAlpha = t), this;
},
preRender: function () {
var t = this.gameContext,
e = this.config,
i = this.width,
n = this.height;
(t.globalAlpha = 1),
(t.globalCompositeOperation = "source-over"),
t.setTransform(1, 0, 0, 1, 0, 0),
e.clearBeforeRender && (t.clearRect(0, 0, i, n), e.transparent || ((t.fillStyle = e.backgroundColor.rgba), t.fillRect(0, 0, i, n))),
t.save(),
(this.drawCount = 0),
this.emit(f.PRE_RENDER);
},
render: function (t, e, i) {
var n = e.length;
this.emit(f.RENDER, t, i);
var s = i.x,
r = i.y,
o = i.width,
a = i.height,
h = i.renderToTexture ? i.context : t.sys.context;
h.save(), this.game.scene.customViewports && (h.beginPath(), h.rect(s, r, o, a), h.clip()), (this.currentContext = h);
var l = i.mask;
l && l.preRenderCanvas(this, null, i._maskCamera),
i.transparent || ((h.fillStyle = i.backgroundColor.rgba), h.fillRect(s, r, o, a)),
(h.globalAlpha = i.alpha),
(h.globalCompositeOperation = "source-over"),
(this.drawCount += n),
i.renderToTexture && i.emit(d.PRE_RENDER, i),
i.matrix.copyToContext(h);
for (var u = 0; u < n; u++) {
var c = e[u];
c.mask && c.mask.preRenderCanvas(this, c, i), c.renderCanvas(this, c, i), c.mask && c.mask.postRenderCanvas(this, c, i);
}
h.setTransform(1, 0, 0, 1, 0, 0),
(h.globalCompositeOperation = "source-over"),
(h.globalAlpha = 1),
i.flashEffect.postRenderCanvas(h),
i.fadeEffect.postRenderCanvas(h),
(i.dirty = !1),
l && l.postRenderCanvas(this),
h.restore(),
i.renderToTexture && (i.emit(d.POST_RENDER, i), i.renderToGame && t.sys.context.drawImage(i.canvas, s, r));
},
postRender: function () {
this.gameContext.restore(), this.emit(f.POST_RENDER);
var t = this.snapshotState;
t.callback && (u(this.gameCanvas, t), (t.callback = null));
},
snapshotCanvas: function (t, e, i, n, s, r, o, a, h) {
void 0 === i && (i = !1), this.snapshotArea(n, s, r, o, e, a, h);
var l = this.snapshotState;
return (l.getPixel = i), u(this.canvas, l), (l.callback = null), this;
},
snapshot: function (t, e, i) {
return this.snapshotArea(0, 0, this.gameCanvas.width, this.gameCanvas.height, t, e, i);
},
snapshotArea: function (t, e, i, n, s, r, o) {
var a = this.snapshotState;
return (a.callback = s), (a.type = r), (a.encoder = o), (a.getPixel = !1), (a.x = t), (a.y = e), (a.width = Math.min(i, this.gameCanvas.width)), (a.height = Math.min(n, this.gameCanvas.height)), this;
},
snapshotPixel: function (t, e, i) {
return this.snapshotArea(t, e, 1, 1, i), (this.snapshotState.getPixel = !0), this;
},
batchSprite: function (t, e, i, n) {
var s,
r,
o,
a,
h,
l,
u,
c,
d,
f,
p,
g,
v,
y,
m,
x,
b,
w = i.alpha * t.alpha;
0 != w &&
((s = this.currentContext),
(r = this._tempMatrix1),
(o = this._tempMatrix2),
(h = (a = e.canvasData).x),
(l = a.y),
(u = e.cutWidth),
(c = e.cutHeight),
(d = e.customPivot),
(f = e.source.resolution),
(p = t.displayOriginX),
(g = t.displayOriginY),
(v = -p + e.x),
(y = -g + e.y),
t.isCropped &&
(((m = t._crop).flipX === t.flipX && m.flipY === t.flipY) || e.updateCropUVs(m, t.flipX, t.flipY),
(u = m.cw),
(c = m.ch),
(h = m.cx),
(l = m.cy),
(v = -p + m.x),
(y = -g + m.y),
t.flipX && (0 <= v ? (v = -(v + u)) : v < 0 && (v = Math.abs(v) - u)),
t.flipY && (0 <= y ? (y = -(y + c)) : y < 0 && (y = Math.abs(y) - c))),
(b = x = 1),
t.flipX && (d || (v += -e.realWidth + 2 * p), (x = -1)),
t.flipY && (d || (y += -e.realHeight + 2 * g), (b = -1)),
o.applyITRS(t.x, t.y, t.rotation, t.scaleX * x, t.scaleY * b),
r.copyFrom(i.matrix),
n ? (r.multiplyWithOffset(n, -i.scrollX * t.scrollFactorX, -i.scrollY * t.scrollFactorY), (o.e = t.x), (o.f = t.y)) : ((o.e -= i.scrollX * t.scrollFactorX), (o.f -= i.scrollY * t.scrollFactorY)),
r.multiply(o),
s.save(),
r.setToContext(s),
(s.globalCompositeOperation = this.blendModes[t.blendMode]),
(s.globalAlpha = w),
(s.imageSmoothingEnabled = !(!this.antialias || e.source.scaleMode)),
t.mask && t.mask.preRenderCanvas(this, t, i),
s.drawImage(e.source.image, h, l, u, c, v, y, u / f, c / f),
t.mask && t.mask.postRenderCanvas(this, t, i),
s.restore());
},
destroy: function () {
this.removeAllListeners(), (this.game = null), (this.gameCanvas = null), (this.gameContext = null);
},
});
t.exports = c;
},
function (t, e, i) {
var f = i(31),
p = i(38),
g = i(2);
t.exports = function (t, e) {
var i,
n,
s,
r,
o = g(e, "callback"),
a = g(e, "type", "image/png"),
h = g(e, "encoder", 0.92),
l = Math.abs(Math.round(g(e, "x", 0))),
u = Math.abs(Math.round(g(e, "y", 0))),
c = g(e, "width", t.width),
d = g(e, "height", t.height);
g(e, "getPixel", !1)
? ((i = t.getContext("2d").getImageData(l, u, 1, 1).data), o.call(null, new p(i[0], i[1], i[2], i[3] / 255)))
: 0 !== l || 0 !== u || c !== t.width || d !== t.height
? ((n = f.createWebGL(this, c, d)).getContext("2d").drawImage(t, l, u, c, d, 0, 0, c, d),
((s = new Image()).onerror = function () {
o.call(null), f.remove(n);
}),
(s.onload = function () {
o.call(null, s), f.remove(n);
}),
(s.src = n.toDataURL(a, h)))
: (((r = new Image()).onerror = function () {
o.call(null);
}),
(r.onload = function () {
o.call(null, r);
}),
(r.src = t.toDataURL(a, h)));
};
},
function (t, e, i) {
var n = i(35),
s = i(348);
t.exports = function () {
var t = [],
e = s.supportNewBlendModes,
i = "source-over";
return (
(t[n.NORMAL] = i),
(t[n.ADD] = "lighter"),
(t[n.MULTIPLY] = e ? "multiply" : i),
(t[n.SCREEN] = e ? "screen" : i),
(t[n.OVERLAY] = e ? "overlay" : i),
(t[n.DARKEN] = e ? "darken" : i),
(t[n.LIGHTEN] = e ? "lighten" : i),
(t[n.COLOR_DODGE] = e ? "color-dodge" : i),
(t[n.COLOR_BURN] = e ? "color-burn" : i),
(t[n.HARD_LIGHT] = e ? "hard-light" : i),
(t[n.SOFT_LIGHT] = e ? "soft-light" : i),
(t[n.DIFFERENCE] = e ? "difference" : i),
(t[n.EXCLUSION] = e ? "exclusion" : i),
(t[n.HUE] = e ? "hue" : i),
(t[n.SATURATION] = e ? "saturation" : i),
(t[n.COLOR] = e ? "color" : i),
(t[n.LUMINOSITY] = e ? "luminosity" : i),
(t[n.ERASE] = "destination-out"),
(t[n.SOURCE_IN] = "source-in"),
(t[n.SOURCE_OUT] = "source-out"),
(t[n.SOURCE_ATOP] = "source-atop"),
(t[n.DESTINATION_OVER] = "destination-over"),
(t[n.DESTINATION_IN] = "destination-in"),
(t[n.DESTINATION_OUT] = "destination-out"),
(t[n.DESTINATION_ATOP] = "destination-atop"),
(t[n.LIGHTER] = "lighter"),
(t[n.COPY] = "copy"),
(t[n.XOR] = "xor"),
t
);
};
},
function (t, e, i) {
var n = i(93),
o = i(37),
s = i(0),
v = i(33),
r = i(9),
l = i(91),
y = i(22),
g = i(138),
m = i(69),
a = i(1),
x = i(372),
h = i(141),
u = i(104),
b = i(106),
w = i(12),
f = i(383),
c = new s({
Extends: r,
initialize: function (t) {
r.call(this);
var e = t.config,
i = {
alpha: e.transparent,
desynchronized: e.desynchronized,
depth: !1,
antialias: e.antialiasGL,
premultipliedAlpha: e.premultipliedAlpha,
stencil: !0,
failIfMajorPerformanceCaveat: e.failIfMajorPerformanceCaveat,
powerPreference: e.powerPreference,
preserveDrawingBuffer: e.preserveDrawingBuffer,
};
(this.config = {
clearBeforeRender: e.clearBeforeRender,
antialias: e.antialias,
backgroundColor: e.backgroundColor,
contextCreation: i,
roundPixels: e.roundPixels,
maxTextures: e.maxTextures,
maxTextureSize: e.maxTextureSize,
batchSize: e.batchSize,
maxLights: e.maxLights,
mipmapFilter: e.mipmapFilter,
}),
(this.game = t),
(this.type = v.WEBGL),
(this.pipelines = null),
(this.width = 0),
(this.height = 0),
(this.canvas = t.canvas),
(this.blendModes = []),
(this.contextLost = !1),
(this.snapshotState = { x: 0, y: 0, width: 1, height: 1, getPixel: !1, callback: null, type: "image/png", encoder: 0.92, isFramebuffer: !1, bufferWidth: 0, bufferHeight: 0 }),
(this.currentActiveTexture = 0),
(this.startActiveTexture = 0),
(this.maxTextures = 0),
this.textureIndexes,
this.tempTextures,
this.textureZero,
this.normalTexture,
(this.currentFramebuffer = null),
(this.fboStack = []),
(this.currentProgram = null),
(this.currentBlendMode = 1 / 0),
(this.currentScissorEnabled = !1),
(this.currentScissor = null),
(this.scissorStack = []),
(this.contextLostHandler = a),
(this.contextRestoredHandler = a),
(this.gl = null),
(this.supportedExtensions = null),
(this.instancedArraysExtension = null),
(this.vaoExtension = null),
(this.extensions = {}),
(this.glFormats = []),
(this.compression = { ETC1: !1, PVRTC: !1, S3TC: !1 }),
(this.drawingBufferHeight = 0),
(this.blankTexture = null),
(this.whiteTexture = null),
(this.maskCount = 0),
(this.maskStack = []),
(this.currentMask = { mask: null, camera: null }),
(this.currentCameraMask = { mask: null, camera: null }),
(this.glFuncMap = null),
(this.currentType = ""),
(this.newType = !1),
(this.nextTypeMatch = !1),
(this.finalType = !1),
(this.mipmapFilter = null),
(this.textureFlush = 0),
(this.isTextureClean = !1),
(this.defaultScissor = [0, 0, 0, 0]),
(this.isBooted = !1),
(this.renderTarget = null),
this.projectionMatrix,
(this.projectionWidth = 0),
(this.projectionHeight = 0),
this.init(this.config);
},
init: function (t) {
var e = this.game,
i = this.canvas,
n = t.backgroundColor,
s = e.config.context ? e.config.context : i.getContext("webgl", t.contextCreation) || i.getContext("experimental-webgl", t.contextCreation);
if (!s || s.isContextLost()) throw ((this.contextLost = !0), new Error("WebGL unsupported"));
this.gl = s;
var r = this;
(this.contextLostHandler = function (t) {
(r.contextLost = !0), r.game.events.emit(y.CONTEXT_LOST, r), t.preventDefault();
}),
(this.contextRestoredHandler = function () {
(r.contextLost = !1), r.init(r.config), r.game.events.emit(y.CONTEXT_RESTORED, r);
}),
i.addEventListener("webglcontextlost", this.contextLostHandler, !1),
i.addEventListener("webglcontextrestored", this.contextRestoredHandler, !1),
(e.context = s);
for (var o = 0; o <= 27; o++) this.blendModes.push({ func: [s.ONE, s.ONE_MINUS_SRC_ALPHA], equation: s.FUNC_ADD });
(this.blendModes[1].func = [s.ONE, s.DST_ALPHA]),
(this.blendModes[2].func = [s.DST_COLOR, s.ONE_MINUS_SRC_ALPHA]),
(this.blendModes[3].func = [s.ONE, s.ONE_MINUS_SRC_COLOR]),
(this.blendModes[17] = { func: [s.ZERO, s.ONE_MINUS_SRC_ALPHA], equation: s.FUNC_REVERSE_SUBTRACT }),
(this.glFormats[0] = s.BYTE),
(this.glFormats[1] = s.SHORT),
(this.glFormats[2] = s.UNSIGNED_BYTE),
(this.glFormats[3] = s.UNSIGNED_SHORT),
(this.glFormats[4] = s.FLOAT),
(this.glFuncMap = {
mat2: { func: s.uniformMatrix2fv, length: 1, matrix: !0 },
mat3: { func: s.uniformMatrix3fv, length: 1, matrix: !0 },
mat4: { func: s.uniformMatrix4fv, length: 1, matrix: !0 },
"1f": { func: s.uniform1f, length: 1 },
"1fv": { func: s.uniform1fv, length: 1 },
"1i": { func: s.uniform1i, length: 1 },
"1iv": { func: s.uniform1iv, length: 1 },
"2f": { func: s.uniform2f, length: 2 },
"2fv": { func: s.uniform2fv, length: 1 },
"2i": { func: s.uniform2i, length: 2 },
"2iv": { func: s.uniform2iv, length: 1 },
"3f": { func: s.uniform3f, length: 3 },
"3fv": { func: s.uniform3fv, length: 1 },
"3i": { func: s.uniform3i, length: 3 },
"3iv": { func: s.uniform3iv, length: 1 },
"4f": { func: s.uniform4f, length: 4 },
"4fv": { func: s.uniform4fv, length: 1 },
"4i": { func: s.uniform4i, length: 4 },
"4iv": { func: s.uniform4iv, length: 1 },
});
var a = s.getSupportedExtensions();
(t.maxTextures && -1 !== t.maxTextures) || (t.maxTextures = s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS)), t.maxTextureSize || (t.maxTextureSize = s.getParameter(s.MAX_TEXTURE_SIZE));
var h = "WEBGL_compressed_texture_",
l = "WEBKIT_" + h;
(this.compression.ETC1 = s.getExtension(h + "etc1") || s.getExtension(l + "etc1")),
(this.compression.PVRTC = s.getExtension(h + "pvrtc") || s.getExtension(l + "pvrtc")),
(this.compression.S3TC = s.getExtension(h + "s3tc") || s.getExtension(l + "s3tc")),
(this.supportedExtensions = a);
var u = "ANGLE_instanced_arrays";
this.instancedArraysExtension = -1 < a.indexOf(u) ? s.getExtension(u) : null;
var c = "OES_vertex_array_object";
(this.vaoExtension = -1 < a.indexOf(c) ? s.getExtension(c) : null),
s.disable(s.DEPTH_TEST),
s.disable(s.CULL_FACE),
s.enable(s.BLEND),
s.clearColor(n.redGL, n.greenGL, n.blueGL, n.alphaGL),
(this.mipmapFilter = s[t.mipmapFilter]),
(this.maxTextures = w.checkShaderMax(s, t.maxTextures)),
(this.textureIndexes = []);
var d = this.tempTextures;
if (Array.isArray(d)) for (var f = 0; o < this.maxTextures; f++) s.deleteTexture(d[f]);
else d = new Array(this.maxTextures);
for (var p = 0; p < this.maxTextures; p++) {
var g = s.createTexture();
s.activeTexture(s.TEXTURE0 + p),
s.bindTexture(s.TEXTURE_2D, g),
s.texImage2D(s.TEXTURE_2D, 0, s.RGBA, 1, 1, 0, s.RGBA, s.UNSIGNED_BYTE, new Uint8Array([0, 0, 255, 255])),
(d[p] = g),
this.textureIndexes.push(p);
}
return (
(this.tempTextures = d),
(this.currentActiveTexture = 1),
this.startActiveTexture++,
s.activeTexture(s.TEXTURE1),
(this.pipelines = new x(this)),
this.setBlendMode(v.BlendModes.NORMAL),
(this.projectionMatrix = new m().identity()),
e.textures.once(b.READY, this.boot, this),
this
);
},
boot: function () {
var t = this.game,
e = this.pipelines,
i = t.scale.baseSize;
(this.width = i.width),
(this.height = i.height),
(this.isBooted = !0),
(this.renderTarget = new h(this, this.width, this.height, 1, 0, !0, !0)),
e.boot(t.config.pipeline),
(this.blankTexture = t.textures.getFrame("__DEFAULT")),
(this.whiteTexture = t.textures.getFrame("__WHITE"));
var n = this.gl;
n.bindFramebuffer(n.FRAMEBUFFER, null), n.enable(n.SCISSOR_TEST), t.scale.on(u.RESIZE, this.onResize, this), this.resize(i.width, i.height);
},
onResize: function (t, e) {
(e.width === this.width && e.height === this.height) || this.resize(e.width, e.height);
},
beginCapture: function (t, e) {
void 0 === t && (t = this.width), void 0 === e && (e = this.height), this.renderTarget.bind(!0, t, e), this.setProjectionMatrix(t, e), this.resetTextures();
},
endCapture: function () {
return this.renderTarget.unbind(!0), this.resetProjectionMatrix(), this.renderTarget;
},
resize: function (t, e) {
var i = this.gl;
return (
(this.width = t),
(this.height = e),
this.setProjectionMatrix(t, e),
i.viewport(0, 0, t, e),
(this.drawingBufferHeight = i.drawingBufferHeight),
i.scissor(0, i.drawingBufferHeight - e, t, e),
(this.defaultScissor[2] = t),
(this.defaultScissor[3] = e),
this.emit(l.RESIZE, t, e),
this
);
},
getAspectRatio: function () {
return this.width / this.height;
},
setProjectionMatrix: function (t, e) {
return (t === this.projectionWidth && e === this.projectionHeight) || ((this.projectionWidth = t), (this.projectionHeight = e), this.projectionMatrix.ortho(0, t, e, 0, -1e3, 1e3)), this;
},
resetProjectionMatrix: function () {
(this.projectionWidth = this.width), (this.projectionHeight = this.height), this.projectionMatrix.ortho(0, this.width, this.height, 0, -1e3, 1e3);
},
hasExtension: function (t) {
return !!this.supportedExtensions && this.supportedExtensions.indexOf(t);
},
getExtension: function (t) {
return this.hasExtension(t) ? (t in this.extensions || (this.extensions[t] = this.gl.getExtension(t)), this.extensions[t]) : null;
},
flush: function () {
this.pipelines.flush();
},
pushScissor: function (t, e, i, n, s) {
void 0 === s && (s = this.drawingBufferHeight);
var r = [t, e, i, n];
return this.scissorStack.push(r), this.setScissor(t, e, i, n, s), (this.currentScissor = r);
},
setScissor: function (t, e, i, n, s) {
void 0 === s && (s = this.drawingBufferHeight);
var r,
o,
a,
h,
l = this.gl,
u = this.currentScissor,
c = 0 < i && 0 < n;
u && c && ((r = u[0]), (o = u[1]), (a = u[2]), (h = u[3]), (c = r !== t || o !== e || a !== i || h !== n)), c && (this.flush(), l.scissor(t, s - e - n, i, n));
},
resetScissor: function () {
var t = this.gl;
t.enable(t.SCISSOR_TEST);
var e,
i,
n,
s,
r = this.currentScissor;
r && ((e = r[0]), (i = r[1]), (n = r[2]), (s = r[3]), 0 < n && 0 < s && t.scissor(e, this.drawingBufferHeight - i - s, n, s));
},
popScissor: function () {
var t = this.scissorStack;
t.pop();
var e = t[t.length - 1];
e && this.setScissor(e[0], e[1], e[2], e[3]), (this.currentScissor = e);
},
hasActiveStencilMask: function () {
var t = this.currentMask.mask,
e = this.currentCameraMask.mask;
return (t && t.isStencil) || (e && e.isStencil);
},
resetViewport: function () {
var t = this.gl;
t.viewport(0, 0, this.width, this.height), (this.drawingBufferHeight = t.drawingBufferHeight);
},
setBlendMode: function (t, e) {
void 0 === e && (e = !1);
var i = this.gl,
n = this.blendModes[t];
return (
!!(e || (t !== v.BlendModes.SKIP_CHECK && this.currentBlendMode !== t)) &&
(this.flush(),
i.enable(i.BLEND),
i.blendEquation(n.equation),
2 < n.func.length ? i.blendFuncSeparate(n.func[0], n.func[1], n.func[2], n.func[3]) : i.blendFunc(n.func[0], n.func[1]),
(this.currentBlendMode = t),
!0)
);
},
addBlendMode: function (t, e) {
return this.blendModes.push({ func: t, equation: e }) - 1;
},
updateBlendMode: function (t, e, i) {
return this.blendModes[t] && ((this.blendModes[t].func = e), i && (this.blendModes[t].equation = i)), this;
},
removeBlendMode: function (t) {
return 17 < t && this.blendModes[t] && this.blendModes.splice(t, 1), this;
},
setBlankTexture: function () {
this.setTexture2D(this.blankTexture.glTexture);
},
setTextureSource: function (t) {
if (this.pipelines.forceZero()) return this.setTextureZero(t.glTexture, !0), 0;
var e = this.gl,
i = this.currentActiveTexture;
return (
t.glIndexCounter < this.startActiveTexture &&
((t.glIndexCounter = this.startActiveTexture),
i < this.maxTextures
? ((t.glIndex = i), e.activeTexture(e.TEXTURE0 + i), e.bindTexture(e.TEXTURE_2D, t.glTexture), this.currentActiveTexture++)
: (this.flush(),
this.startActiveTexture++,
this.textureFlush++,
(t.glIndexCounter = this.startActiveTexture),
(t.glIndex = 1),
e.activeTexture(e.TEXTURE1),
e.bindTexture(e.TEXTURE_2D, t.glTexture),
(this.currentActiveTexture = 2))),
(this.isTextureClean = !1),
t.glIndex
);
},
isNewNormalMap: function (t, e) {
return this.textureZero !== t || this.normalTexture !== e;
},
setTextureZero: function (t, e) {
var i;
this.textureZero !== t && (e && this.flush(), (i = this.gl).activeTexture(i.TEXTURE0), i.bindTexture(i.TEXTURE_2D, t), (this.textureZero = t));
},
clearTextureZero: function () {
this.textureZero = null;
},
setNormalMap: function (t) {
var e;
this.normalTexture !== t && ((e = this.gl).activeTexture(e.TEXTURE1), e.bindTexture(e.TEXTURE_2D, t), (this.normalTexture = t), 1 === this.currentActiveTexture && (this.currentActiveTexture = 2));
},
clearNormalMap: function () {
(this.normalTexture = null), this.startActiveTexture++, (this.currentActiveTexture = 1), this.textureFlush++;
},
unbindTextures: function () {
for (var t = this.gl, e = this.tempTextures, i = 0; i < e.length; i++) t.activeTexture(t.TEXTURE0 + i), t.bindTexture(t.TEXTURE_2D, null);
(this.normalTexture = null), (this.textureZero = null), (this.currentActiveTexture = 1), this.startActiveTexture++, this.textureFlush++;
},
resetTextures: function (t) {
if ((void 0 === t && (t = !1), !this.isTextureClean)) {
this.flush();
var e = this.gl,
i = this.tempTextures;
if (t) {
for (var n = 0; n < i.length; n++) e.activeTexture(e.TEXTURE0 + n), e.bindTexture(e.TEXTURE_2D, i[n]);
e.activeTexture(e.TEXTURE1), e.bindTexture(e.TEXTURE_2D, i[1]), (this.isTextureClean = !0);
} else e.activeTexture(e.TEXTURE0), e.bindTexture(e.TEXTURE_2D, i[0]), e.activeTexture(e.TEXTURE1), e.bindTexture(e.TEXTURE_2D, i[1]);
(this.normalTexture = null), (this.textureZero = null), (this.currentActiveTexture = 1), this.startActiveTexture++, this.textureFlush++;
}
},
setTexture2D: function (t) {
if (this.pipelines.forceZero()) return this.setTextureZero(t, !0), 0;
var e = this.gl,
i = this.currentActiveTexture;
return (
t.glIndexCounter < this.startActiveTexture &&
((t.glIndexCounter = this.startActiveTexture),
i < this.maxTextures
? ((t.glIndex = i), e.activeTexture(e.TEXTURE0 + i), e.bindTexture(e.TEXTURE_2D, t), this.currentActiveTexture++)
: (this.flush(),
this.startActiveTexture++,
this.textureFlush++,
(t.glIndexCounter = this.startActiveTexture),
(t.glIndex = 1),
e.activeTexture(e.TEXTURE1),
e.bindTexture(e.TEXTURE_2D, t),
(this.currentActiveTexture = 2))),
(this.isTextureClean = !1),
t.glIndex
);
},
pushFramebuffer: function (t, e, i, n) {
return t === this.currentFramebuffer ? this : (this.fboStack.push(t), this.setFramebuffer(t, e, i, n));
},
setFramebuffer: function (t, e, i, n) {
if ((void 0 === e && (e = !1), void 0 === i && (i = !1), void 0 === n && (n = !0), t === this.currentFramebuffer)) return this;
var s = this.gl,
r = this.width,
o = this.height;
return (
t && t.renderTexture && n ? ((r = t.renderTexture.width), (o = t.renderTexture.height)) : this.flush(),
s.bindFramebuffer(s.FRAMEBUFFER, t),
n && s.viewport(0, 0, r, o),
e && (t ? ((this.drawingBufferHeight = o), this.pushScissor(0, 0, r, o)) : ((this.drawingBufferHeight = this.height), this.popScissor())),
(this.currentFramebuffer = t),
i && this.resetTextures(),
this
);
},
popFramebuffer: function (t, e, i) {
void 0 === t && (t = !1), void 0 === e && (e = !1), void 0 === i && (i = !0);
var n = this.fboStack;
n.pop();
var s = (s = n[n.length - 1]) || null;
return this.setFramebuffer(s, t, e, i), s;
},
setProgram: function (t) {
return t !== this.currentProgram && (this.flush(), this.gl.useProgram(t), (this.currentProgram = t), !0);
},
resetProgram: function () {
return this.gl.useProgram(this.currentProgram), this;
},
createTextureFromSource: function (t, e, i, n) {
var s = this.gl,
r = s.NEAREST,
o = s.NEAREST,
a = s.CLAMP_TO_EDGE;
(e = t ? t.width : e), (i = t ? t.height : i);
var h = g(e, i);
return (
h && (a = s.REPEAT),
n === v.ScaleModes.LINEAR && this.config.antialias && ((r = h ? this.mipmapFilter : s.LINEAR), (o = s.LINEAR)),
t || "number" != typeof e || "number" != typeof i ? this.createTexture2D(0, r, o, a, a, s.RGBA, t) : this.createTexture2D(0, r, o, a, a, s.RGBA, null, e, i)
);
},
createTexture2D: function (t, e, i, n, s, r, o, a, h, l, u, c) {
(l = null == l || l), void 0 === u && (u = !1), void 0 === c && (c = !1);
var d = this.gl,
f = d.createTexture();
d.activeTexture(d.TEXTURE0);
var p = d.getParameter(d.TEXTURE_BINDING_2D);
return (
d.bindTexture(d.TEXTURE_2D, f),
d.texParameteri(d.TEXTURE_2D, d.TEXTURE_MIN_FILTER, e),
d.texParameteri(d.TEXTURE_2D, d.TEXTURE_MAG_FILTER, i),
d.texParameteri(d.TEXTURE_2D, d.TEXTURE_WRAP_S, s),
d.texParameteri(d.TEXTURE_2D, d.TEXTURE_WRAP_T, n),
d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL, l),
d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL, c),
null == o ? d.texImage2D(d.TEXTURE_2D, t, r, a, h, 0, r, d.UNSIGNED_BYTE, null) : (u || ((a = o.width), (h = o.height)), d.texImage2D(d.TEXTURE_2D, t, r, r, d.UNSIGNED_BYTE, o)),
g(a, h) && d.generateMipmap(d.TEXTURE_2D),
p && d.bindTexture(d.TEXTURE_2D, p),
(f.isAlphaPremultiplied = l),
(f.isRenderTexture = !1),
(f.width = a),
(f.height = h),
(f.glIndex = 0),
(f.glIndexCounter = -1),
f
);
},
createFramebuffer: function (t, e, i, n) {
var s,
r,
o = this.gl,
a = o.createFramebuffer();
if (
(this.setFramebuffer(a),
n &&
((r = o.createRenderbuffer()),
o.bindRenderbuffer(o.RENDERBUFFER, r),
o.renderbufferStorage(o.RENDERBUFFER, o.DEPTH_STENCIL, t, e),
o.framebufferRenderbuffer(o.FRAMEBUFFER, o.DEPTH_STENCIL_ATTACHMENT, o.RENDERBUFFER, r)),
(i.isRenderTexture = !0),
(i.isAlphaPremultiplied = !1),
o.framebufferTexture2D(o.FRAMEBUFFER, o.COLOR_ATTACHMENT0, o.TEXTURE_2D, i, 0),
(s = o.checkFramebufferStatus(o.FRAMEBUFFER)) === o.FRAMEBUFFER_COMPLETE)
)
return (a.renderTexture = i), this.setFramebuffer(null), this.resetTextures(), a;
throw new Error("Framebuffer status: " + { 36054: "Incomplete Attachment", 36055: "Missing Attachment", 36057: "Incomplete Dimensions", 36061: "Framebuffer Unsupported" }[s]);
},
createProgram: function (t, e) {
var i = this.gl,
n = i.createProgram(),
s = i.createShader(i.VERTEX_SHADER),
r = i.createShader(i.FRAGMENT_SHADER);
if ((i.shaderSource(s, t), i.shaderSource(r, e), i.compileShader(s), i.compileShader(r), !i.getShaderParameter(s, i.COMPILE_STATUS))) throw new Error("Vertex Shader failed:\n" + i.getShaderInfoLog(s));
if (!i.getShaderParameter(r, i.COMPILE_STATUS)) throw new Error("Fragment Shader failed:\n" + i.getShaderInfoLog(r));
if ((i.attachShader(n, s), i.attachShader(n, r), i.linkProgram(n), !i.getProgramParameter(n, i.LINK_STATUS))) throw new Error("Link Program failed:\n" + i.getProgramInfoLog(n));
return i.useProgram(n), n;
},
createVertexBuffer: function (t, e) {
var i = this.gl,
n = i.createBuffer();
return i.bindBuffer(i.ARRAY_BUFFER, n), i.bufferData(i.ARRAY_BUFFER, t, e), i.bindBuffer(i.ARRAY_BUFFER, null), n;
},
createIndexBuffer: function (t, e) {
var i = this.gl,
n = i.createBuffer();
return i.bindBuffer(i.ELEMENT_ARRAY_BUFFER, n), i.bufferData(i.ELEMENT_ARRAY_BUFFER, t, e), i.bindBuffer(i.ELEMENT_ARRAY_BUFFER, null), n;
},
deleteTexture: function (t, e) {
return e && this.resetTextures(!0), t && this.gl.deleteTexture(t), this;
},
deleteFramebuffer: function (t) {
return t && (this.gl.deleteFramebuffer(t), n(this.fboStack, t), this.currentFramebuffer === t && (this.currentFramebuffer = null)), this;
},
deleteProgram: function (t) {
return t && this.gl.deleteProgram(t), this;
},
deleteBuffer: function (t) {
return this.gl.deleteBuffer(t), this;
},
preRenderCamera: function (t) {
var e = t.x,
i = t.y,
n = t.width,
s = t.height,
r = t.backgroundColor;
t.emit(o.PRE_RENDER, t),
this.pipelines.preBatchCamera(t),
this.pushScissor(e, i, n, s),
t.mask && ((this.currentCameraMask.mask = t.mask), (this.currentCameraMask.camera = t._maskCamera), t.mask.preRenderWebGL(this, t, t._maskCamera)),
0 < r.alphaGL && this.pipelines.setMulti().drawFillRect(e, i, n, s, w.getTintFromFloats(r.blueGL, r.greenGL, r.redGL, 1), r.alphaGL);
},
getCurrentStencilMask: function () {
var t = null,
e = this.maskStack,
i = this.currentCameraMask;
return 0 < e.length ? (t = e[e.length - 1]) : i.mask && i.mask.isStencil && (t = i), t;
},
postRenderCamera: function (t) {
var e,
i = t.flashEffect,
n = t.fadeEffect;
(i.isRunning || n.isRunning || n.isComplete) && ((e = this.pipelines.setMulti()), i.postRenderWebGL(e, w.getTintFromFloats), n.postRenderWebGL(e, w.getTintFromFloats)),
(t.dirty = !1),
this.popScissor(),
t.mask && ((this.currentCameraMask.mask = null), t.mask.postRenderWebGL(this, t._maskCamera)),
this.pipelines.postBatchCamera(t),
t.emit(o.POST_RENDER, t);
},
preRender: function () {
var t, e;
this.contextLost ||
((t = this.gl).bindFramebuffer(t.FRAMEBUFFER, null),
this.config.clearBeforeRender && ((e = this.config.backgroundColor), t.clearColor(e.redGL, e.greenGL, e.blueGL, e.alphaGL), t.clear(t.COLOR_BUFFER_BIT | t.DEPTH_BUFFER_BIT | t.STENCIL_BUFFER_BIT)),
t.enable(t.SCISSOR_TEST),
(this.currentScissor = this.defaultScissor),
(this.scissorStack.length = 0),
this.scissorStack.push(this.currentScissor),
this.game.scene.customViewports && t.scissor(0, this.drawingBufferHeight - this.height, this.width, this.height),
(this.currentMask.mask = null),
(this.currentCameraMask.mask = null),
(this.maskStack.length = 0),
(this.textureFlush = 0),
this.emit(l.PRE_RENDER));
},
render: function (t, e, i) {
if (!this.contextLost) {
var n = e.length;
if ((this.emit(l.RENDER, t, i), this.preRenderCamera(i), 0 === n)) return this.setBlendMode(v.BlendModes.NORMAL), void this.postRenderCamera(i);
this.currentType = "";
for (var s = this.currentMask, r = 0; r < n; r++) {
this.finalType = r === n - 1;
var o = e[r],
a = o.mask;
(s = this.currentMask).mask && s.mask !== a && s.mask.postRenderWebGL(this, s.camera),
a && s.mask !== a && a.preRenderWebGL(this, o, i),
o.blendMode !== this.currentBlendMode && this.setBlendMode(o.blendMode);
var h = o.type;
h !== this.currentType && ((this.newType = !0), (this.currentType = h)),
this.finalType ? (this.nextTypeMatch = !1) : (this.nextTypeMatch = e[r + 1].type === this.currentType),
o.renderWebGL(this, o, i),
(this.newType = !1);
}
(s = this.currentMask).mask && s.mask.postRenderWebGL(this, s.camera), this.setBlendMode(v.BlendModes.NORMAL), this.postRenderCamera(i);
}
},
postRender: function () {
var t;
this.contextLost ||
(this.flush(),
this.emit(l.POST_RENDER),
(t = this.snapshotState).callback && (f(this.canvas, t), (t.callback = null)),
0 < this.textureFlush && (this.startActiveTexture++, (this.currentActiveTexture = 1)));
},
snapshot: function (t, e, i) {
return this.snapshotArea(0, 0, this.gl.drawingBufferWidth, this.gl.drawingBufferHeight, t, e, i);
},
snapshotArea: function (t, e, i, n, s, r, o) {
var a = this.snapshotState;
return (
(a.callback = s), (a.type = r), (a.encoder = o), (a.getPixel = !1), (a.x = t), (a.y = e), (a.width = Math.min(i, this.gl.drawingBufferWidth)), (a.height = Math.min(n, this.gl.drawingBufferHeight)), this
);
},
snapshotPixel: function (t, e, i) {
return this.snapshotArea(t, e, 1, 1, i), (this.snapshotState.getPixel = !0), this;
},
snapshotFramebuffer: function (t, e, i, n, s, r, o, a, h, l, u) {
void 0 === s && (s = !1), void 0 === r && (r = 0), void 0 === o && (o = 0), void 0 === a && (a = e), void 0 === h && (h = i);
var c = this.currentFramebuffer;
this.snapshotArea(r, o, a, h, n, l, u);
var d = this.snapshotState;
return (
(d.getPixel = s), (d.isFramebuffer = !0), (d.bufferWidth = e), (d.bufferHeight = i), this.setFramebuffer(t), f(this.canvas, d), this.setFramebuffer(c), (d.callback = null), (d.isFramebuffer = !1), this
);
},
canvasToTexture: function (t, e, i, n) {
return void 0 === i && (i = !1), void 0 === n && (n = !1), e ? this.updateCanvasTexture(t, e, n) : this.createCanvasTexture(t, i, n);
},
createCanvasTexture: function (t, e, i) {
void 0 === e && (e = !1), void 0 === i && (i = !1);
var n = this.gl,
s = n.NEAREST,
r = n.NEAREST,
o = t.width,
a = t.height,
h = n.CLAMP_TO_EDGE,
l = g(o, a);
return !e && l && (h = n.REPEAT), this.config.antialias && ((s = l ? this.mipmapFilter : n.LINEAR), (r = n.LINEAR)), this.createTexture2D(0, s, r, h, h, n.RGBA, t, o, a, !0, !1, i);
},
updateCanvasTexture: function (t, e, i) {
void 0 === i && (i = !1);
var n,
s = this.gl,
r = t.width,
o = t.height;
return (
0 < r &&
0 < o &&
(s.activeTexture(s.TEXTURE0),
(n = s.getParameter(s.TEXTURE_BINDING_2D)),
s.bindTexture(s.TEXTURE_2D, e),
s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, i),
s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0),
s.texImage2D(s.TEXTURE_2D, 0, s.RGBA, s.RGBA, s.UNSIGNED_BYTE, t),
(e.width = r),
(e.height = o),
n && s.bindTexture(s.TEXTURE_2D, n)),
e
);
},
createVideoTexture: function (t, e, i) {
void 0 === e && (e = !1), void 0 === i && (i = !1);
var n = this.gl,
s = n.NEAREST,
r = n.NEAREST,
o = t.videoWidth,
a = t.videoHeight,
h = n.CLAMP_TO_EDGE,
l = g(o, a);
return !e && l && (h = n.REPEAT), this.config.antialias && ((s = l ? this.mipmapFilter : n.LINEAR), (r = n.LINEAR)), this.createTexture2D(0, s, r, h, h, n.RGBA, t, o, a, !0, !0, i);
},
updateVideoTexture: function (t, e, i) {
void 0 === i && (i = !1);
var n,
s = this.gl,
r = t.videoWidth,
o = t.videoHeight;
return (
0 < r &&
0 < o &&
(s.activeTexture(s.TEXTURE0),
(n = s.getParameter(s.TEXTURE_BINDING_2D)),
s.bindTexture(s.TEXTURE_2D, e),
s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, i),
s.texImage2D(s.TEXTURE_2D, 0, s.RGBA, s.RGBA, s.UNSIGNED_BYTE, t),
(e.width = r),
(e.height = o),
n && s.bindTexture(s.TEXTURE_2D, n)),
e
);
},
setTextureFilter: function (t, e) {
var i = this.gl,
n = [i.LINEAR, i.NEAREST][e];
i.activeTexture(i.TEXTURE0);
var s = i.getParameter(i.TEXTURE_BINDING_2D);
return i.bindTexture(i.TEXTURE_2D, t), i.texParameteri(i.TEXTURE_2D, i.TEXTURE_MIN_FILTER, n), i.texParameteri(i.TEXTURE_2D, i.TEXTURE_MAG_FILTER, n), s && i.bindTexture(i.TEXTURE_2D, s), this;
},
getMaxTextureSize: function () {
return this.config.maxTextureSize;
},
destroy: function () {
this.canvas.removeEventListener("webglcontextlost", this.contextLostHandler, !1), this.canvas.removeEventListener("webglcontextrestored", this.contextRestoredHandler, !1);
for (var t = this.gl, e = this.tempTextures, i = 0; i < e.length; i++) t.deleteTexture(e[i]);
this.pipelines.destroy(),
this.removeAllListeners(),
(this.fboStack = []),
(this.maskStack = []),
(this.extensions = {}),
(this.textureIndexes = []),
(this.gl = null),
(this.game = null),
(this.canvas = null),
(this.contextLost = !0),
(this.currentMask = null),
(this.currentCameraMask = null);
},
});
t.exports = c;
},
function (t, e, i) {
var n = i(0),
o = i(92),
s = i(102),
r = i(373),
a = i(376),
h = i(377),
l = i(108),
u = i(378),
c = i(379),
d = i(380),
f = i(381),
p = new n({
initialize: function (t) {
(this.game = t.game),
(this.renderer = t),
(this.classes = new s([
[o.UTILITY_PIPELINE, f],
[o.MULTI_PIPELINE, l],
[o.BITMAPMASK_PIPELINE, r],
[o.SINGLE_PIPELINE, d],
[o.ROPE_PIPELINE, c],
[o.LIGHT_PIPELINE, h],
[o.POINTLIGHT_PIPELINE, u],
[o.GRAPHICS_PIPELINE, a],
])),
(this.postPipelineClasses = new s()),
(this.pipelines = new s()),
(this.current = null),
(this.previous = null),
(this.MULTI_PIPELINE = null),
(this.BITMAPMASK_PIPELINE = null),
(this.UTILITY_PIPELINE = null),
this.fullFrame1,
this.fullFrame2,
this.halfFrame1,
this.halfFrame2;
},
boot: function (t) {
var e,
i = this,
n = this.game;
if (
(this.classes.each(function (t, e) {
(s = i.add(t, new e({ game: n }))),
t === o.UTILITY_PIPELINE && ((i.UTILITY_PIPELINE = s), (i.fullFrame1 = s.fullFrame1), (i.fullFrame2 = s.fullFrame2), (i.halfFrame1 = s.halfFrame1), (i.halfFrame2 = s.halfFrame2));
}),
(this.MULTI_PIPELINE = this.get(o.MULTI_PIPELINE)),
(this.BITMAPMASK_PIPELINE = this.get(o.BITMAPMASK_PIPELINE)),
t)
)
for (e in t) {
var s,
r = t[e];
(s = new r(n)).isPostFX ? this.postPipelineClasses.set(e, r) : this.has(e) || (this.classes.set(e, r), this.add(e, s));
}
},
add: function (t, e) {
if (!e.isPostFX) {
var i = this.pipelines,
n = this.renderer;
return i.has(t) || ((e.name = t), (e.manager = this), i.set(t, e)), e.hasBooted || e.boot(), 0 !== n.width && 0 !== n.height && e.resize(n.width, n.height), e;
}
},
addPostPipeline: function (t, e) {
this.postPipelineClasses.has(t) || this.postPipelineClasses.set(t, e);
},
flush: function () {
this.current && this.current.flush();
},
has: function (t) {
var e = this.pipelines;
return "string" == typeof t ? e.has(t) : !!e.contains(t);
},
get: function (t) {
var e = this.pipelines;
return "string" == typeof t ? e.get(t) : e.contains(t) ? t : void 0;
},
getPostPipeline: function (t, e) {
var i,
n = this.postPipelineClasses;
if (("string" == typeof t ? (i = n.get(t)) : "function" == typeof t ? n.contains(t) && (i = t) : "object" == typeof t && (i = n.get(t.name)), i)) {
var s = new i(this.game);
return e && (s.gameObject = e), s;
}
},
remove: function (t, e, i) {
void 0 === e && (e = !0), void 0 === i && (i = !0), this.pipelines.delete(t), e && this.classes.delete(t), i && this.postPipelineClasses.delete(t);
},
set: function (t, e, i) {
if (!t.isPostFX) return this.isCurrent(t, i) || (this.flush(), this.current && this.current.unbind(), (this.current = t).bind(i)), t.updateProjectionMatrix(), t.onBind(e), t;
},
preBatch: function (t) {
if (t.hasPostPipeline) {
this.flush();
for (var e = t.postPipelines, i = e.length - 1; 0 <= i; i--) {
var n = e[i];
n.active && n.preBatch(t);
}
}
},
postBatch: function (t) {
if (t.hasPostPipeline) {
this.flush();
for (var e = t.postPipelines, i = 0; i < e.length; i++) {
var n = e[i];
n.active && n.postBatch(t);
}
}
},
preBatchCamera: function (t) {
if (t.hasPostPipeline) {
this.flush();
for (var e = t.postPipelines, i = e.length - 1; 0 <= i; i--) {
var n = e[i];
n.active && n.preBatch(t);
}
}
},
postBatchCamera: function (t) {
if (t.hasPostPipeline) {
this.flush();
for (var e = t.postPipelines, i = 0; i < e.length; i++) {
var n = e[i];
n.active && n.postBatch(t);
}
}
},
isCurrent: function (t, e) {
var i = this.renderer,
n = this.current;
return n && !e && (e = n.currentShader), !(n !== t || e.program !== i.currentProgram);
},
copyFrame: function (t, e, i, n, s) {
return this.setUtility(this.UTILITY_PIPELINE.copyShader).copyFrame(t, e, i, n, s), this;
},
copyToGame: function (t) {
return this.setUtility(this.UTILITY_PIPELINE.copyShader).copyToGame(t), this;
},
drawFrame: function (t, e, i, n) {
return this.setUtility(this.UTILITY_PIPELINE.colorMatrixShader).drawFrame(t, e, i, n), this;
},
blendFrames: function (t, e, i, n, s) {
return this.setUtility(this.UTILITY_PIPELINE.linearShader).blendFrames(t, e, i, n, s), this;
},
blendFramesAdditive: function (t, e, i, n, s) {
return this.setUtility(this.UTILITY_PIPELINE.addShader).blendFramesAdditive(t, e, i, n, s), this;
},
clearFrame: function (t, e) {
return this.UTILITY_PIPELINE.clearFrame(t, e), this;
},
blitFrame: function (t, e, i, n, s, r) {
return this.setUtility(this.UTILITY_PIPELINE.copyShader).blitFrame(t, e, i, n, s, r), this;
},
copyFrameRect: function (t, e, i, n, s, r, o, a) {
return this.UTILITY_PIPELINE.copyFrameRect(t, e, i, n, s, r, o, a), this;
},
forceZero: function () {
return this.current && this.current.forceZero;
},
setMulti: function () {
return this.set(this.MULTI_PIPELINE);
},
setUtility: function (t) {
return this.UTILITY_PIPELINE.bind(t);
},
rebind: function (t) {
void 0 === t && this.previous && (t = this.previous);
var e = this.renderer,
i = e.gl;
i.disable(i.DEPTH_TEST),
i.disable(i.CULL_FACE),
e.hasActiveStencilMask() ? i.clear(i.DEPTH_BUFFER_BIT) : (i.disable(i.STENCIL_TEST), i.clear(i.DEPTH_BUFFER_BIT | i.STENCIL_BUFFER_BIT)),
i.viewport(0, 0, e.width, e.height),
(e.currentProgram = null),
e.setBlendMode(0, !0);
var n = this.pipelines.entries;
for (var s in n) n[s].glReset = !0;
t && (this.current = t).rebind(), e.resetTextures();
},
clear: function () {
var t = this.renderer;
this.flush(), this.current ? (this.current.unbind(), (this.previous = this.current), (this.current = null)) : (this.previous = null), (t.currentProgram = null), t.setBlendMode(0, !0);
},
destroy: function () {
this.flush(),
this.classes.clear(),
this.postPipelineClasses.clear(),
this.pipelines.clear(),
(this.renderer = null),
(this.game = null),
(this.classes = null),
(this.postPipelineClasses = null),
(this.pipelines = null),
(this.current = null),
(this.previous = null);
},
});
t.exports = p;
},
function (t, e, i) {
var n = i(0),
s = i(2),
r = i(866),
o = i(867),
a = i(107),
h = i(58),
l = new n({
Extends: h,
initialize: function (t) {
(t.fragShader = s(t, "fragShader", r)),
(t.vertShader = s(t, "vertShader", o)),
(t.batchSize = s(t, "batchSize", 1)),
(t.vertices = s(t, "vertices", [-1, 1, -1, -7, 7, 1])),
(t.attributes = s(t, "attributes", [{ name: "inPosition", size: 2, type: a.FLOAT }])),
h.call(this, t);
},
boot: function () {
h.prototype.boot.call(this), this.set1i("uMainSampler", 0), this.set1i("uMaskSampler", 1);
},
resize: function (t, e) {
h.prototype.resize.call(this, t, e), this.set2f("uResolution", t, e);
},
beginMask: function (t, e, i) {
var n,
s = this.gl;
t.bitmapMask &&
s &&
((n = this.renderer).flush(),
n.pushFramebuffer(t.mainFramebuffer),
s.disable(s.STENCIL_TEST),
s.clearColor(0, 0, 0, 0),
s.clear(s.COLOR_BUFFER_BIT),
n.currentCameraMask.mask !== t && ((n.currentMask.mask = t), (n.currentMask.camera = i)));
},
endMask: function (t, e) {
var i,
n = this.gl,
s = this.renderer,
r = t.bitmapMask;
r &&
n &&
(s.flush(),
s.pushFramebuffer(t.maskFramebuffer),
n.clearColor(0, 0, 0, 0),
n.clear(n.COLOR_BUFFER_BIT),
s.setBlendMode(0, !0),
r.renderWebGL(s, r, e),
s.flush(),
s.popFramebuffer(),
s.popFramebuffer(),
(i = s.getCurrentStencilMask()) ? (n.enable(n.STENCIL_TEST), i.mask.applyStencil(s, i.camera, !0)) : (s.currentMask.mask = null),
s.pipelines.set(this),
n.activeTexture(n.TEXTURE1),
n.bindTexture(n.TEXTURE_2D, t.maskTexture),
n.activeTexture(n.TEXTURE0),
n.bindTexture(n.TEXTURE_2D, t.mainTexture),
this.set1i("uInvertMaskAlpha", t.invertAlpha),
n.drawArrays(this.topology, 0, 3),
s.resetTextures());
},
});
t.exports = l;
},
function (t, e, i) {
t.exports = { AFTER_FLUSH: i(868), BEFORE_FLUSH: i(869), BIND: i(870), BOOT: i(871), DESTROY: i(872), REBIND: i(873), RESIZE: i(874) };
},
function (t, e, i) {
var n = i(0),
d = i(2),
f = i(107),
s = new n({
initialize: function (t, e, i, n, s) {
(this.pipeline = t),
(this.name = e),
(this.renderer = t.renderer),
(this.gl = this.renderer.gl),
(this.program = this.renderer.createProgram(i, n)),
this.attributes,
(this.vertexComponentCount = 0),
(this.vertexSize = 0),
(this.uniforms = {}),
this.createAttributes(s),
this.createUniforms();
},
createAttributes: function (t) {
for (var e = 0, i = 0, n = [], s = (this.vertexComponentCount = 0); s < t.length; s++) {
var r = t[s],
o = r.name,
a = d(r, "size", 1),
h = d(r, "type", f.FLOAT),
l = h.enum,
u = h.size,
c = !!r.normalized;
n.push({ name: o, size: a, type: l, normalized: c, offset: i, enabled: !1, location: -1 }), 4 === u ? (e += a) : e++, (i += a * u);
}
(this.vertexSize = i), (this.vertexComponentCount = e), (this.attributes = n);
},
bind: function (t, e) {
return void 0 === t && (t = !1), void 0 === e && (e = !1), e && this.pipeline.flush(), this.renderer.setProgram(this.program), t && this.setAttribPointers(), this;
},
rebind: function () {
return this.renderer.setProgram(this.program), this.setAttribPointers(!0), this;
},
setAttribPointers: function (t) {
void 0 === t && (t = !1);
for (var e = this.gl, i = this.vertexSize, n = this.attributes, s = this.program, r = 0; r < n.length; r++) {
var o,
a = n[r],
h = a.size,
l = a.type,
u = a.offset,
c = a.enabled,
d = a.location,
f = !!a.normalized;
t
? 0 <= (o = e.getAttribLocation(s, a.name))
? (e.enableVertexAttribArray(o), e.vertexAttribPointer(o, h, l, f, i, u), (a.enabled = !0), (a.location = o))
: -1 !== o && e.disableVertexAttribArray(o)
: c
? e.vertexAttribPointer(d, h, l, f, i, u)
: !c && -1 < d && (e.disableVertexAttribArray(d), (a.location = -1));
}
return this;
},
createUniforms: function () {
for (var t, e, i = this.gl, n = this.program, s = this.uniforms, r = i.getProgramParameter(n, i.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
var a,
h = i.getActiveUniform(n, o);
h &&
((t = h.name),
null !== (e = i.getUniformLocation(n, t)) && (s[t] = { name: t, location: e, value1: null, value2: null, value3: null, value4: null }),
0 < (a = t.indexOf("[")) &&
((t = t.substr(0, a)), s.hasOwnProperty(t) || (null !== (e = i.getUniformLocation(n, t)) && (s[t] = { name: t, location: e, value1: null, value2: null, value3: null, value4: null }))));
}
return this;
},
hasUniform: function (t) {
return this.uniforms.hasOwnProperty(t);
},
resetUniform: function (t) {
var e = this.uniforms[t];
return e && ((e.value1 = null), (e.value2 = null), (e.value3 = null), (e.value4 = null)), this;
},
setUniform1: function (t, e, i, n) {
var s = this.uniforms[e];
return s && ((!n && s.value1 === i) || ((s.value1 = i), this.renderer.setProgram(this.program), t.call(this.gl, s.location, i), (this.pipeline.currentShader = this))), this;
},
setUniform2: function (t, e, i, n, s) {
var r = this.uniforms[e];
return (
r && ((!s && r.value1 === i && r.value2 === n) || ((r.value1 = i), (r.value2 = n), this.renderer.setProgram(this.program), t.call(this.gl, r.location, i, n), (this.pipeline.currentShader = this))), this
);
},
setUniform3: function (t, e, i, n, s, r) {
var o = this.uniforms[e];
return (
o &&
((!r && o.value1 === i && o.value2 === n && o.value3 === s) ||
((o.value1 = i), (o.value2 = n), (o.value3 = s), this.renderer.setProgram(this.program), t.call(this.gl, o.location, i, n, s), (this.pipeline.currentShader = this))),
this
);
},
setUniform4: function (t, e, i, n, s, r, o) {
var a = this.uniforms[e];
return (
a &&
((!o && a.value1 === i && a.value2 === n && a.value3 === s && a.value4 === r) ||
((a.value1 = i), (a.value2 = n), (a.value3 = s), (a.value4 = r), this.renderer.setProgram(this.program), t.call(this.gl, a.location, i, n, s, r), (this.pipeline.currentShader = this))),
this
);
},
set1f: function (t, e) {
return this.setUniform1(this.gl.uniform1f, t, e);
},
set2f: function (t, e, i) {
return this.setUniform2(this.gl.uniform2f, t, e, i);
},
set3f: function (t, e, i, n) {
return this.setUniform3(this.gl.uniform3f, t, e, i, n);
},
set4f: function (t, e, i, n, s) {
return this.setUniform4(this.gl.uniform4f, t, e, i, n, s);
},
set1fv: function (t, e) {
return this.setUniform1(this.gl.uniform1fv, t, e, !0);
},
set2fv: function (t, e) {
return this.setUniform1(this.gl.uniform2fv, t, e, !0);
},
set3fv: function (t, e) {
return this.setUniform1(this.gl.uniform3fv, t, e, !0);
},
set4fv: function (t, e) {
return this.setUniform1(this.gl.uniform4fv, t, e, !0);
},
set1iv: function (t, e) {
return this.setUniform1(this.gl.uniform1iv, t, e, !0);
},
set2iv: function (t, e) {
return this.setUniform1(this.gl.uniform2iv, t, e, !0);
},
set3iv: function (t, e) {
return this.setUniform1(this.gl.uniform3iv, t, e, !0);
},
set4iv: function (t, e) {
return this.setUniform1(this.gl.uniform4iv, t, e, !0);
},
set1i: function (t, e) {
return this.setUniform1(this.gl.uniform1i, t, e);
},
set2i: function (t, e, i) {
return this.setUniform2(this.gl.uniform2i, t, e, i);
},
set3i: function (t, e, i, n) {
return this.setUniform3(this.gl.uniform3i, t, e, i, n);
},
set4i: function (t, e, i, n, s) {
return this.setUniform4(this.gl.uniform4i, t, e, i, n, s);
},
setMatrix2fv: function (t, e, i) {
return this.setUniform2(this.gl.uniformMatrix2fv, t, e, i, !0);
},
setMatrix3fv: function (t, e, i) {
return this.setUniform2(this.gl.uniformMatrix3fv, t, e, i, !0);
},
setMatrix4fv: function (t, e, i) {
return this.setUniform2(this.gl.uniformMatrix4fv, t, e, i, !0);
},
destroy: function () {
this.gl.deleteProgram(this.program), (this.pipeline = null), (this.renderer = null), (this.gl = null), (this.program = null), (this.attributes = null), (this.uniforms = null);
},
});
t.exports = s;
},
function (t, e, i) {
var n = i(0),
M = i(59),
s = i(2),
r = i(875),
o = i(876),
a = i(25),
h = i(107),
l = i(58),
u = new n({
Extends: l,
initialize: function (t) {
(t.fragShader = s(t, "fragShader", r)),
(t.vertShader = s(t, "vertShader", o)),
(t.attributes = s(t, "attributes", [
{ name: "inPosition", size: 2 },
{ name: "inColor", size: 4, type: h.UNSIGNED_BYTE, normalized: !0 },
])),
l.call(this, t),
(this.calcMatrix = new a()),
(this.tempTriangle = [
{ x: 0, y: 0, width: 0 },
{ x: 0, y: 0, width: 0 },
{ x: 0, y: 0, width: 0 },
{ x: 0, y: 0, width: 0 },
]),
(this.strokeTint = { TL: 0, TR: 0, BL: 0, BR: 0 }),
(this.fillTint = { TL: 0, TR: 0, BL: 0, BR: 0 }),
(this.currentFrame = { u0: 0, v0: 0, u1: 1, v1: 1 }),
(this.firstQuad = [0, 0, 0, 0, 0]),
(this.prevQuad = [0, 0, 0, 0, 0]),
(this.polygonCache = []);
},
batchFillRect: function (t, e, i, n, s, r) {
this.renderer.pipelines.set(this);
var o = this.calcMatrix;
r && r.multiply(s, o);
var a = t + i,
h = e + n,
l = o.getX(t, e),
u = o.getY(t, e),
c = o.getX(t, h),
d = o.getY(t, h),
f = o.getX(a, h),
p = o.getY(a, h),
g = o.getX(a, e),
v = o.getY(a, e),
y = this.fillTint;
this.batchQuad(l, u, c, d, f, p, g, v, y.TL, y.TR, y.BL, y.BR);
},
batchFillTriangle: function (t, e, i, n, s, r, o, a) {
this.renderer.pipelines.set(this);
var h = this.calcMatrix;
a && a.multiply(o, h);
var l = h.getX(t, e),
u = h.getY(t, e),
c = h.getX(i, n),
d = h.getY(i, n),
f = h.getX(s, r),
p = h.getY(s, r),
g = this.fillTint;
this.batchTri(l, u, c, d, f, p, g.TL, g.TR, g.BL);
},
batchStrokeTriangle: function (t, e, i, n, s, r, o, a, h) {
var l = this.tempTriangle;
(l[0].x = t),
(l[0].y = e),
(l[0].width = o),
(l[1].x = i),
(l[1].y = n),
(l[1].width = o),
(l[2].x = s),
(l[2].y = r),
(l[2].width = o),
(l[3].x = t),
(l[3].y = e),
(l[3].width = o),
this.batchStrokePath(l, o, !1, a, h);
},
batchFillPath: function (t, e, i) {
this.renderer.pipelines.set(this);
var n = this.calcMatrix;
i && i.multiply(e, n);
for (var s, r, o = t.length, a = this.polygonCache, h = this.fillTint.TL, l = this.fillTint.TR, u = this.fillTint.BL, c = 0; c < o; ++c) (r = t[c]), a.push(r.x, r.y);
o = (s = M(a)).length;
for (var d = 0; d < o; d += 3) {
var f = 2 * s[d + 0],
p = 2 * s[d + 1],
g = 2 * s[d + 2],
v = a[0 + f],
y = a[1 + f],
m = a[0 + p],
x = a[1 + p],
b = a[0 + g],
w = a[1 + g],
T = n.getX(v, y),
S = n.getY(v, y),
_ = n.getX(m, x),
E = n.getY(m, x),
P = n.getX(b, w),
A = n.getY(b, w);
this.batchTri(T, S, _, E, P, A, h, l, u);
}
a.length = 0;
},
batchStrokePath: function (t, e, i, n, s) {
this.renderer.pipelines.set(this), (this.prevQuad[4] = 0), (this.firstQuad[4] = 0);
for (var r = t.length - 1, o = 0; o < r; o++) {
var a = t[o],
h = t[o + 1];
this.batchLine(a.x, a.y, h.x, h.y, a.width / 2, h.width / 2, e, o, !i && o === r - 1, n, s);
}
},
batchLine: function (t, e, i, n, s, r, o, a, h, l, u) {
this.renderer.pipelines.set(this);
var c = this.calcMatrix;
u && u.multiply(l, c);
var d,
f,
p = i - t,
g = n - e,
v = Math.sqrt(p * p + g * g),
y = (s * (n - e)) / v,
m = (s * (t - i)) / v,
x = (r * (n - e)) / v,
b = (r * (t - i)) / v,
w = i - x,
T = n - b,
S = t - y,
_ = e - m,
E = i + x,
P = n + b,
A = t + y,
M = e + m,
C = c.getX(w, T),
O = c.getY(w, T),
k = c.getX(S, _),
R = c.getY(S, _),
L = c.getX(E, P),
I = c.getY(E, P),
D = c.getX(A, M),
F = c.getY(A, M),
B = this.strokeTint,
N = B.TL,
U = B.TR,
Y = B.BL,
z = B.BR;
this.batchQuad(D, F, k, R, C, O, L, I, N, U, Y, z),
o <= 2 ||
((d = this.prevQuad),
(f = this.firstQuad),
0 < a && d[4] ? this.batchQuad(D, F, k, R, d[0], d[1], d[2], d[3], N, U, Y, z) : ((f[0] = D), (f[1] = F), (f[2] = k), (f[3] = R), (f[4] = 1)),
h && f[4] ? this.batchQuad(C, O, L, I, f[0], f[1], f[2], f[3], N, U, Y, z) : ((d[0] = C), (d[1] = O), (d[2] = L), (d[3] = I), (d[4] = 1)));
},
batchVert: function (t, e, i) {
var n = this.vertexViewF32,
s = this.vertexViewU32,
r = this.vertexCount * this.currentShader.vertexComponentCount - 1;
(n[++r] = t), (n[++r] = e), (s[++r] = i), this.vertexCount++;
},
batchQuad: function (t, e, i, n, s, r, o, a, h, l, u, c) {
var d = !1;
return this.shouldFlush(6) && (this.flush(), (d = !0)), this.batchVert(t, e, h), this.batchVert(i, n, u), this.batchVert(s, r, c), this.batchVert(t, e, h), this.batchVert(s, r, c), this.batchVert(o, a, l), d;
},
batchTri: function (t, e, i, n, s, r, o, a, h) {
var l = !1;
return this.shouldFlush(3) && (this.flush(), (l = !0)), this.batchVert(t, e, o), this.batchVert(i, n, a), this.batchVert(s, r, h), l;
},
destroy: function () {
return l.prototype.destroy.call(this), (this.polygonCache = null), this;
},
});
t.exports = u;
},
function (t, e, i) {
var n = i(0),
s = i(2),
r = i(877),
R = i(108),
o = i(3),
a = i(58),
h = 10,
c = new o(),
l = new n({
Extends: R,
initialize: function (t) {
h = t.game.renderer.config.maxLights;
for (var e = s(t, "fragShader", r), i = [], n = 1; n <= h; n++) i.push({ name: "lights" + n, fragShader: e.replace("%LIGHT_COUNT%", n.toString()) });
(t.shaders = i), R.call(this, t), (this.inverseRotationMatrix = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1])), this.defaultNormalMap, (this.lightsActive = !0);
},
boot: function () {
a.prototype.boot.call(this);
var t = this.gl,
e = t.createTexture();
t.activeTexture(t.TEXTURE0),
t.bindTexture(t.TEXTURE_2D, e),
t.texImage2D(t.TEXTURE_2D, 0, t.RGBA, 1, 1, 0, t.RGBA, t.UNSIGNED_BYTE, new Uint8Array([127, 127, 255, 255])),
(this.defaultNormalMap = { glTexture: e });
for (var i = 0; i < this.shaders.length; i++) this["lightShader" + (i + 1)] = this.shaders[i];
},
onRender: function (t, e) {
var i = t.sys.lights;
if (((this.lightsActive = !1), i && i.active)) {
var n,
s = i.getLights(e),
r = s.length;
if (0 !== r) {
(this.lightsActive = !0), this.setShader(this["lightShader" + r], !0);
var o = this.renderer.height,
a = e.matrix;
for (
this.set1i("uMainSampler", 0),
this.set1i("uNormSampler", 1),
this.set2f("uResolution", this.width / 2, this.height / 2),
this.set4f("uCamera", e.x, e.y, e.rotation, e.zoom),
this.set3f("uAmbientLightColor", i.ambientColor.r, i.ambientColor.g, i.ambientColor.b),
n = 0;
n < r;
n++
) {
var h = s[n].light,
l = h.color,
u = "uLights[" + n + "].";
a.transformPoint(h.x, h.y, c),
this.set2f(u + "position", c.x - e.scrollX * h.scrollFactorX * e.zoom, o - (c.y - e.scrollY * h.scrollFactorY * e.zoom)),
this.set3f(u + "color", l.r, l.g, l.b),
this.set1f(u + "intensity", h.intensity),
this.set1f(u + "radius", h.radius);
}
this.currentNormalMapRotation = null;
}
}
},
setNormalMapRotation: function (t) {
var e, i, n, s;
(t === this.currentNormalMapRotation && 0 !== this.vertexCount) ||
(0 < this.vertexCount && this.flush(),
(e = this.inverseRotationMatrix),
t ? ((i = -t), (n = Math.cos(i)), (s = Math.sin(i)), (e[1] = s), (e[3] = -s), (e[0] = e[4] = n)) : ((e[0] = e[4] = 1), (e[1] = e[3] = 0)),
this.setMatrix3fv("uInverseRotationMatrix", !1, e),
(this.currentNormalMapRotation = t));
},
setTexture2D: function (t, e) {
var i = this.renderer;
void 0 === t && (t = i.tempTextures[0]);
var n = this.getNormalMap(e);
i.isNewNormalMap(t, n) && (this.flush(), i.setTextureZero(t), i.setNormalMap(n));
var s = e ? e.rotation : 0;
return this.setNormalMapRotation(s), (this.currentUnit = 0);
},
setGameObject: function (t, e) {
void 0 === e && (e = t.frame);
var i = this.renderer,
n = e.glTexture,
s = this.getNormalMap(t);
return i.isNewNormalMap() && (this.flush(), i.setTextureZero(n), i.setNormalMap(s)), this.setNormalMapRotation(t.rotation), (this.currentUnit = 0);
},
getNormalMap: function (t) {
var e;
return (
t
? t.displayTexture
? (e = t.displayTexture.dataSource[t.displayFrame.sourceIndex])
: t.texture
? (e = t.texture.dataSource[t.frame.sourceIndex])
: t.tileset && (e = Array.isArray(t.tileset) ? t.tileset[0].image.dataSource[0] : t.tileset.image.dataSource[0])
: (e = this.defaultNormalMap),
(e = e || this.defaultNormalMap).glTexture
);
},
batchSprite: function (t, e, i) {
this.lightsActive && R.prototype.batchSprite.call(this, t, e, i);
},
batchTexture: function (t, e, i, n, s, r, o, a, h, l, u, c, d, f, p, g, v, y, m, x, b, w, T, S, _, E, P, A, M, C, O, k) {
this.lightsActive && R.prototype.batchTexture.call(this, t, e, i, n, s, r, o, a, h, l, u, c, d, f, p, g, v, y, m, x, b, w, T, S, _, E, P, A, M, C, O, k);
},
batchTextureFrame: function (t, e, i, n, s, r, o) {
this.lightsActive && R.prototype.batchTextureFrame.call(this, t, e, i, n, s, r, o);
},
});
(l.LIGHT_COUNT = h), (t.exports = l);
},
function (t, e, i) {
var n = i(0),
s = i(2),
r = i(880),
o = i(881),
a = i(58),
h = new n({
Extends: a,
initialize: function (t) {
(t.vertShader = s(t, "vertShader", o)),
(t.fragShader = s(t, "fragShader", r)),
(t.attributes = s(t, "attributes", [{ name: "inPosition", size: 2 }, { name: "inLightPosition", size: 2 }, { name: "inLightRadius" }, { name: "inLightAttenuation" }, { name: "inLightColor", size: 4 }])),
a.call(this, t);
},
onRender: function (t, e) {
this.set2f("uResolution", this.width, this.height), this.set1f("uCameraZoom", e.zoom);
},
batchPointLight: function (t, e, i, n, s, r, o, a, h, l, u, c) {
var d = t.color,
f = t.intensity,
p = t.radius,
g = t.attenuation,
v = d.r * f,
y = d.g * f,
m = d.b * f,
x = e.alpha * t.alpha;
this.shouldFlush(6) && this.flush(),
this.batchLightVert(i, n, u, c, p, g, v, y, m, x),
this.batchLightVert(s, r, u, c, p, g, v, y, m, x),
this.batchLightVert(o, a, u, c, p, g, v, y, m, x),
this.batchLightVert(i, n, u, c, p, g, v, y, m, x),
this.batchLightVert(o, a, u, c, p, g, v, y, m, x),
this.batchLightVert(h, l, u, c, p, g, v, y, m, x);
},
batchLightVert: function (t, e, i, n, s, r, o, a, h, l) {
var u = this.vertexViewF32,
c = this.vertexCount * this.currentShader.vertexComponentCount - 1;
(u[++c] = t), (u[++c] = e), (u[++c] = i), (u[++c] = n), (u[++c] = s), (u[++c] = r), (u[++c] = o), (u[++c] = a), (u[++c] = h), (u[++c] = l), this.vertexCount++;
},
});
t.exports = h;
},
function (t, e, i) {
var n = i(0),
s = i(2),
r = i(108),
o = new n({
Extends: r,
initialize: function (t) {
(t.topology = 5), (t.batchSize = s(t, "batchSize", 256)), r.call(this, t);
},
});
t.exports = o;
},
function (t, e, i) {
var n = i(0),
s = i(2),
r = i(108),
o = i(882),
a = i(883),
h = i(58),
l = new n({
Extends: r,
initialize: function (t) {
(t.fragShader = s(t, "fragShader", o)), (t.vertShader = s(t, "vertShader", a)), (t.forceZero = !0), r.call(this, t);
},
boot: function () {
h.prototype.boot.call(this), this.set1i("uMainSampler", 0);
},
});
t.exports = l;
},
function (t, e, i) {
var n = i(884),
l = i(35),
s = i(0),
r = i(198),
o = i(885),
a = i(886),
h = i(2),
u = i(887),
c = i(382),
d = i(58),
f = new s({
Extends: d,
initialize: function (t) {
(t.renderTarget = h(t, "renderTarget", [{ scale: 1 }, { scale: 1 }, { scale: 0.5 }, { scale: 0.5 }])),
(t.vertShader = h(t, "vertShader", c)),
(t.shaders = h(t, "shaders", [
{ name: "Copy", fragShader: a },
{ name: "AddBlend", fragShader: n },
{ name: "LinearBlend", fragShader: u },
{ name: "ColorMatrix", fragShader: o },
])),
(t.attributes = h(t, "attributes", [
{ name: "inPosition", size: 2 },
{ name: "inTexCoord", size: 2 },
])),
(t.vertices = [-1, -1, 0, 0, -1, 1, 0, 1, 1, 1, 1, 1, -1, -1, 0, 0, 1, 1, 1, 1, 1, -1, 1, 0]),
(t.batchSize = 1),
d.call(this, t),
(this.colorMatrix = new r()),
this.copyShader,
this.addShader,
this.linearShader,
this.colorMatrixShader,
this.fullFrame1,
this.fullFrame2,
this.halfFrame1,
this.halfFrame2;
},
boot: function () {
d.prototype.boot.call(this);
var t = this.shaders,
e = this.renderTargets;
(this.copyShader = t[0]),
(this.addShader = t[1]),
(this.linearShader = t[2]),
(this.colorMatrixShader = t[3]),
(this.fullFrame1 = e[0]),
(this.fullFrame2 = e[1]),
(this.halfFrame1 = e[2]),
(this.halfFrame2 = e[3]);
},
copyFrame: function (t, e, i, n, s) {
void 0 === i && (i = 1), void 0 === n && (n = !0), void 0 === s && (s = !0);
var r = this.gl;
this.setShader(this.copyShader),
this.set1i("uMainSampler", 0),
this.set1f("uBrightness", i),
r.activeTexture(r.TEXTURE0),
r.bindTexture(r.TEXTURE_2D, t.texture),
e
? (r.viewport(0, 0, e.width, e.height), r.bindFramebuffer(r.FRAMEBUFFER, e.framebuffer), r.framebufferTexture2D(r.FRAMEBUFFER, r.COLOR_ATTACHMENT0, r.TEXTURE_2D, e.texture, 0))
: r.viewport(0, 0, t.width, t.height),
n && (s ? r.clearColor(0, 0, 0, 0) : r.clearColor(0, 0, 0, 1), r.clear(r.COLOR_BUFFER_BIT)),
r.bufferData(r.ARRAY_BUFFER, this.vertexData, r.STATIC_DRAW),
r.drawArrays(r.TRIANGLES, 0, 6),
r.bindFramebuffer(r.FRAMEBUFFER, null),
r.bindTexture(r.TEXTURE_2D, null);
},
blitFrame: function (t, e, i, n, s, r) {
void 0 === i && (i = 1), void 0 === n && (n = !0), void 0 === s && (s = !0), void 0 === r && (r = !1);
var o,
a,
h = this.gl;
this.setShader(this.copyShader),
this.set1i("uMainSampler", 0),
this.set1f("uBrightness", i),
h.activeTexture(h.TEXTURE0),
h.bindTexture(h.TEXTURE_2D, t.texture),
t.height > e.height ? (h.viewport(0, 0, t.width, t.height), this.setTargetUVs(t, e)) : ((o = e.height - t.height), h.viewport(0, o, t.width, t.height)),
h.bindFramebuffer(h.FRAMEBUFFER, e.framebuffer),
h.framebufferTexture2D(h.FRAMEBUFFER, h.COLOR_ATTACHMENT0, h.TEXTURE_2D, e.texture, 0),
n && (s ? h.clearColor(0, 0, 0, 0) : h.clearColor(0, 0, 0, 1), h.clear(h.COLOR_BUFFER_BIT)),
r && ((a = this.renderer.currentBlendMode), this.renderer.setBlendMode(l.ERASE)),
h.bufferData(h.ARRAY_BUFFER, this.vertexData, h.STATIC_DRAW),
h.drawArrays(h.TRIANGLES, 0, 6),
r && this.renderer.setBlendMode(a),
h.bindFramebuffer(h.FRAMEBUFFER, null),
h.bindTexture(h.TEXTURE_2D, null),
this.resetUVs();
},
copyFrameRect: function (t, e, i, n, s, r, o, a) {
void 0 === o && (o = !0), void 0 === a && (a = !0);
var h = this.gl;
h.bindFramebuffer(h.FRAMEBUFFER, t.framebuffer),
h.framebufferTexture2D(h.FRAMEBUFFER, h.COLOR_ATTACHMENT0, h.TEXTURE_2D, t.texture, 0),
o && (a ? h.clearColor(0, 0, 0, 0) : h.clearColor(0, 0, 0, 1), h.clear(h.COLOR_BUFFER_BIT)),
h.activeTexture(h.TEXTURE0),
h.bindTexture(h.TEXTURE_2D, e.texture),
h.copyTexSubImage2D(h.TEXTURE_2D, 0, 0, 0, i, n, s, r),
h.bindFramebuffer(h.FRAMEBUFFER, null),
h.bindTexture(h.TEXTURE_2D, null);
},
copyToGame: function (t) {
var e = this.gl;
this.setShader(this.copyShader),
this.set1i("uMainSampler", 0),
this.set1f("uBrightness", 1),
this.renderer.popFramebuffer(),
e.activeTexture(e.TEXTURE0),
e.bindTexture(e.TEXTURE_2D, t.texture),
e.bufferData(e.ARRAY_BUFFER, this.vertexData, e.STATIC_DRAW),
e.drawArrays(e.TRIANGLES, 0, 6),
this.renderer.resetTextures();
},
drawFrame: function (t, e, i, n) {
void 0 === i && (i = !0), void 0 === n && (n = this.colorMatrix);
var s = this.gl;
this.setShader(this.colorMatrixShader),
this.set1i("uMainSampler", 0),
this.set1fv("uColorMatrix", n.getData()),
this.set1f("uAlpha", n.alpha),
s.activeTexture(s.TEXTURE0),
s.bindTexture(s.TEXTURE_2D, t.texture),
e
? (s.viewport(0, 0, e.width, e.height), s.bindFramebuffer(s.FRAMEBUFFER, e.framebuffer), s.framebufferTexture2D(s.FRAMEBUFFER, s.COLOR_ATTACHMENT0, s.TEXTURE_2D, e.texture, 0))
: s.viewport(0, 0, t.width, t.height),
i ? s.clearColor(0, 0, 0, 0) : s.clearColor(0, 0, 0, 1),
s.clear(s.COLOR_BUFFER_BIT),
s.bufferData(s.ARRAY_BUFFER, this.vertexData, s.STATIC_DRAW),
s.drawArrays(s.TRIANGLES, 0, 6),
s.bindFramebuffer(s.FRAMEBUFFER, null),
s.bindTexture(s.TEXTURE_2D, null);
},
blendFrames: function (t, e, i, n, s, r) {
void 0 === n && (n = 1), void 0 === s && (s = !0), void 0 === r && (r = this.linearShader);
var o = this.gl;
this.setShader(r),
this.set1i("uMainSampler1", 0),
this.set1i("uMainSampler2", 1),
this.set1f("uStrength", n),
o.activeTexture(o.TEXTURE0),
o.bindTexture(o.TEXTURE_2D, t.texture),
o.activeTexture(o.TEXTURE1),
o.bindTexture(o.TEXTURE_2D, e.texture),
i
? (o.bindFramebuffer(o.FRAMEBUFFER, i.framebuffer), o.framebufferTexture2D(o.FRAMEBUFFER, o.COLOR_ATTACHMENT0, o.TEXTURE_2D, i.texture, 0), o.viewport(0, 0, i.width, i.height))
: o.viewport(0, 0, t.width, t.height),
s ? o.clearColor(0, 0, 0, 0) : o.clearColor(0, 0, 0, 1),
o.clear(o.COLOR_BUFFER_BIT),
o.bufferData(o.ARRAY_BUFFER, this.vertexData, o.STATIC_DRAW),
o.drawArrays(o.TRIANGLES, 0, 6),
o.bindFramebuffer(o.FRAMEBUFFER, null),
o.bindTexture(o.TEXTURE_2D, null);
},
blendFramesAdditive: function (t, e, i, n, s) {
this.blendFrames(t, e, i, n, s, this.addShader);
},
clearFrame: function (t, e) {
void 0 === e && (e = !0);
var i = this.gl;
i.viewport(0, 0, t.width, t.height), i.bindFramebuffer(i.FRAMEBUFFER, t.framebuffer), e ? i.clearColor(0, 0, 0, 0) : i.clearColor(0, 0, 0, 1), i.clear(i.COLOR_BUFFER_BIT);
var n = this.renderer.currentFramebuffer;
i.bindFramebuffer(i.FRAMEBUFFER, n);
},
setUVs: function (t, e, i, n, s, r, o, a) {
var h = this.vertexViewF32;
(h[2] = t), (h[3] = e), (h[6] = i), (h[7] = n), (h[10] = s), (h[11] = r), (h[14] = t), (h[15] = e), (h[18] = s), (h[19] = r), (h[22] = o), (h[23] = a);
},
setTargetUVs: function (t, e) {
var i = 0.5 < (i = e.height / t.height) ? 0.5 - (i - 0.5) : 0.5 - i + 0.5;
this.setUVs(0, i, 0, 1 + i, 1, 1 + i, 1, i);
},
flipX: function () {
this.setUVs(1, 0, 1, 1, 0, 1, 0, 0);
},
flipY: function () {
this.setUVs(0, 1, 0, 0, 1, 0, 1, 1);
},
resetUVs: function () {
this.setUVs(0, 0, 0, 1, 1, 1, 1, 0);
},
});
t.exports = f;
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_QUAD_VS",
"",
"precision mediump float;",
"",
"attribute vec2 inPosition;",
"attribute vec2 inTexCoord;",
"",
"varying vec2 outFragCoord;",
"varying vec2 outTexCoord;",
"",
"void main ()",
"{",
" outFragCoord = inPosition.xy * 0.5 + 0.5;",
" outTexCoord = inTexCoord;",
"",
" gl_Position = vec4(inPosition, 0, 1);",
"}",
"",
].join("\n");
},
function (t, e, i) {
var P = i(31),
A = i(38),
M = i(2);
t.exports = function (t, e) {
var i = t.getContext("experimental-webgl"),
n = M(e, "callback"),
s = M(e, "type", "image/png"),
r = M(e, "encoder", 0.92),
o = M(e, "x", 0),
a = M(e, "y", 0),
h = M(e, "getPixel", !1),
l = M(e, "isFramebuffer", !1),
u = l ? M(e, "bufferWidth", 1) : i.drawingBufferWidth,
c = l ? M(e, "bufferHeight", 1) : i.drawingBufferHeight;
if (h) {
var d = new Uint8Array(4),
f = l ? a : c - a;
i.readPixels(o, f, 1, 1, i.RGBA, i.UNSIGNED_BYTE, d), n.call(null, new A(d[0], d[1], d[2], d[3] / 255));
} else {
var p = M(e, "width", u),
g = M(e, "height", c),
v = new Uint8Array(p * g * 4);
i.readPixels(o, c - a - g, p, g, i.RGBA, i.UNSIGNED_BYTE, v);
for (var y = P.createWebGL(this, p, g), m = y.getContext("2d"), x = m.getImageData(0, 0, p, g), b = x.data, w = 0; w < g; w++)
for (var T = 0; T < p; T++) {
var S = 4 * ((g - w - 1) * p + T),
_ = 4 * (w * p + T);
(b[0 + _] = v[0 + S]), (b[1 + _] = v[1 + S]), (b[2 + _] = v[2 + S]), (b[3 + _] = v[3 + S]);
}
m.putImageData(x, 0, 0);
var E = new Image();
(E.onerror = function () {
n.call(null), P.remove(y);
}),
(E.onload = function () {
n.call(null, E), P.remove(y);
}),
(E.src = y.toDataURL(s, r));
}
};
},
function (t, e, i) {
var l = i(33);
t.exports = function (t) {
var e,
i,
n,
s,
r,
o,
a,
h = t.config;
h.hideBanner ||
((e = "WebGL"),
h.renderType === l.CANVAS ? (e = "Canvas") : h.renderType === l.HEADLESS && (e = "Headless"),
(i = h.audio),
(a = (n = t.device.audio).webAudio && !i.disableWebAudio ? "Web Audio" : i.noAudio || (!n.webAudio && !n.audioData) ? "No Audio" : "HTML5 Audio"),
t.device.browser.ie
? window.console
: ((r = [(s = "")]),
Array.isArray(h.bannerBackgroundColor)
? (h.bannerBackgroundColor.forEach(function (t) {
(s = s.concat("%c ")), r.push("background: " + t), (o = t);
}),
(r[r.length - 1] = "color: " + h.bannerTextColor + "; background: " + o))
: ((s = s.concat("%c ")), r.push("color: " + h.bannerTextColor + "; background: " + h.bannerBackgroundColor)),
r.push("background: transparent"),
h.gameTitle && ((s = s.concat(h.gameTitle)), h.gameVersion && (s = s.concat(" v" + h.gameVersion)), h.hidePhaser || (s = s.concat(" / "))),
h.hidePhaser || (s = s.concat("Phaser v" + l.VERSION + " (" + e + " | " + a + ")")),
(s = s.concat(" %c " + h.gameURL)),
(r[0] = s)));
};
},
function (t, e, i) {
var n = i(0),
s = i(6),
r = i(1),
o = i(386),
a = new n({
initialize: function (t, e) {
(this.game = t),
(this.raf = new o()),
(this.started = !1),
(this.running = !1),
(this.minFps = s(e, "min", 5)),
(this.targetFps = s(e, "target", 60)),
(this._min = 1e3 / this.minFps),
(this._target = 1e3 / this.targetFps),
(this.actualFps = this.targetFps),
(this.nextFpsUpdate = 0),
(this.framesThisSecond = 0),
(this.callback = r),
(this.forceSetTimeOut = s(e, "forceSetTimeOut", !1)),
(this.time = 0),
(this.startTime = 0),
(this.lastTime = 0),
(this.frame = 0),
(this.inFocus = !0),
(this._pauseTime = 0),
(this._coolDown = 0),
(this.delta = 0),
(this.deltaIndex = 0),
(this.deltaHistory = []),
(this.deltaSmoothingMax = s(e, "deltaHistory", 10)),
(this.panicMax = s(e, "panicMax", 120)),
(this.rawDelta = 0),
(this.now = 0),
(this.smoothStep = s(e, "smoothStep", !0));
},
blur: function () {
this.inFocus = !1;
},
focus: function () {
(this.inFocus = !0), this.resetDelta();
},
pause: function () {
this._pauseTime = window.performance.now();
},
resume: function () {
this.resetDelta(), (this.startTime += this.time - this._pauseTime);
},
resetDelta: function () {
var t = window.performance.now();
(this.time = t), (this.lastTime = t), (this.nextFpsUpdate = t + 1e3);
for (var e = (this.framesThisSecond = 0); e < this.deltaSmoothingMax; e++) this.deltaHistory[e] = Math.min(this._target, this.deltaHistory[e]);
(this.delta = 0), (this.deltaIndex = 0), (this._coolDown = this.panicMax);
},
start: function (t) {
if (this.started) return this;
(this.started = !0), (this.running = !0);
for (var e = 0; e < this.deltaSmoothingMax; e++) this.deltaHistory[e] = this._target;
this.resetDelta(), (this.startTime = window.performance.now()), (this.callback = t), this.raf.start(this.step.bind(this), this.forceSetTimeOut, this._target);
},
step: function () {
var t = window.performance.now(),
e = (this.now = t) - this.lastTime;
e < 0 && (e = 0), (this.rawDelta = e);
var i = this.deltaIndex,
n = this.deltaHistory,
s = this.deltaSmoothingMax,
r = e,
o = e;
if (this.smoothStep) {
(0 < this._coolDown || !this.inFocus) && (this._coolDown--, (r = Math.min(r, this._target))),
r > this._min && ((r = n[i]), (r = Math.min(r, this._min))),
(n[i] = r),
this.deltaIndex++,
this.deltaIndex > s && (this.deltaIndex = 0);
for (var a = (o = 0); a < s; a++) o += n[a];
o /= s;
}
(this.delta = o),
(this.time += this.rawDelta),
t > this.nextFpsUpdate && ((this.actualFps = 0.25 * this.framesThisSecond + 0.75 * this.actualFps), (this.nextFpsUpdate = t + 1e3), (this.framesThisSecond = 0)),
this.framesThisSecond++;
var h = o / this._target;
this.callback(t, o, h), (this.lastTime = t), this.frame++;
},
tick: function () {
this.step();
},
sleep: function () {
this.running && (this.raf.stop(), (this.running = !1));
},
wake: function (t) {
this.running || (t && (this.startTime += -this.lastTime + (this.lastTime + window.performance.now())), this.raf.start(this.step.bind(this), this.useRAF), (this.running = !0), this.step());
},
getDuration: function () {
return Math.round(this.lastTime - this.startTime) / 1e3;
},
getDurationMS: function () {
return Math.round(this.lastTime - this.startTime);
},
stop: function () {
return (this.running = !1), (this.started = !1), this.raf.stop(), this;
},
destroy: function () {
this.stop(), (this.callback = r), (this.raf = null), (this.game = null);
},
});
t.exports = a;
},
function (t, e, i) {
var n = i(0),
s = i(1),
r = new n({
initialize: function () {
(this.isRunning = !1), (this.callback = s), (this.tick = 0), (this.isSetTimeOut = !1), (this.timeOutID = null), (this.lastTime = 0), (this.target = 0);
var n = this;
(this.step = function t() {
var e = window.performance.now();
(n.lastTime = n.tick), (n.tick = e), n.callback(e), (n.timeOutID = window.requestAnimationFrame(t));
}),
(this.stepTimeout = function t() {
var e = Date.now(),
i = Math.min(Math.max(2 * n.target + n.tick - e, 0), n.target);
(n.lastTime = n.tick), (n.tick = e), n.callback(e), (n.timeOutID = window.setTimeout(t, i));
});
},
start: function (t, e, i) {
this.isRunning ||
((this.callback = t), (this.isSetTimeOut = e), (this.target = i), (this.isRunning = !0), (this.timeOutID = e ? window.setTimeout(this.stepTimeout, 0) : window.requestAnimationFrame(this.step)));
},
stop: function () {
(this.isRunning = !1), this.isSetTimeOut ? clearTimeout(this.timeOutID) : window.cancelAnimationFrame(this.timeOutID);
},
destroy: function () {
this.stop(), (this.callback = s);
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(22);
t.exports = function (t) {
var e,
i = t.events;
void 0 !== document.hidden
? (e = "visibilitychange")
: ["webkit", "moz", "ms"].forEach(function (t) {
void 0 !== document[t + "Hidden"] &&
((document.hidden = function () {
return document[t + "Hidden"];
}),
(e = t + "visibilitychange"));
}),
e &&
document.addEventListener(
e,
function (t) {
document.hidden || "pause" === t.type ? i.emit(n.HIDDEN) : i.emit(n.VISIBLE);
},
!1
),
(window.onblur = function () {
i.emit(n.BLUR);
}),
(window.onfocus = function () {
i.emit(n.FOCUS);
}),
window.focus && t.config.autoFocus && window.focus();
};
},
function (t, e, i) {
var y = i(389),
m = i(31),
x = i(6);
t.exports = function (t) {
var e = x(t, "data", []),
i = x(t, "canvas", null),
n = x(t, "palette", y),
s = x(t, "pixelWidth", 1),
r = x(t, "pixelHeight", s),
o = x(t, "resizeCanvas", !0),
a = x(t, "clearCanvas", !0),
h = x(t, "preRender", null),
l = x(t, "postRender", null),
u = Math.floor(Math.abs(e[0].length * s)),
c = Math.floor(Math.abs(e.length * r));
i || ((i = m.create2D(this, u, c)), (a = o = !1)), o && ((i.width = u), (i.height = c));
var d = i.getContext("2d");
a && d.clearRect(0, 0, u, c), h && h(i, d);
for (var f = 0; f < e.length; f++)
for (var p = e[f], g = 0; g < p.length; g++) {
var v = p[g];
"." !== v && " " !== v && ((d.fillStyle = n[v]), d.fillRect(g * s, f * r, s, r));
}
return l && l(i, d), i;
};
},
function (t, e) {
t.exports = {
0: "#000",
1: "#9D9D9D",
2: "#FFF",
3: "#BE2633",
4: "#E06F8B",
5: "#493C2B",
6: "#A46422",
7: "#EB8931",
8: "#F7E26B",
9: "#2F484E",
A: "#44891A",
B: "#A3CE27",
C: "#1B2632",
D: "#005784",
E: "#31A2F2",
F: "#B2DCEF",
};
},
function (t, e, i) {
var n = i(0),
o = i(358),
s = i(94),
a = i(3),
h = new n({
Extends: s,
initialize: function (t, e, i, n) {
s.call(this, "CubicBezierCurve"),
Array.isArray(t) && ((n = new a(t[6], t[7])), (i = new a(t[4], t[5])), (e = new a(t[2], t[3])), (t = new a(t[0], t[1]))),
(this.p0 = t),
(this.p1 = e),
(this.p2 = i),
(this.p3 = n);
},
getStartPoint: function (t) {
return void 0 === t && (t = new a()), t.copy(this.p0);
},
getResolution: function (t) {
return t;
},
getPoint: function (t, e) {
void 0 === e && (e = new a());
var i = this.p0,
n = this.p1,
s = this.p2,
r = this.p3;
return e.set(o(t, i.x, n.x, s.x, r.x), o(t, i.y, n.y, s.y, r.y));
},
draw: function (t, e) {
void 0 === e && (e = 32);
var i = this.getPoints(e);
t.beginPath(), t.moveTo(this.p0.x, this.p0.y);
for (var n = 1; n < i.length; n++) t.lineTo(i[n].x, i[n].y);
return t.strokePath(), t;
},
toJSON: function () {
return { type: this.type, points: [this.p0.x, this.p0.y, this.p1.x, this.p1.y, this.p2.x, this.p2.y, this.p3.x, this.p3.y] };
},
});
(h.fromJSON = function (t) {
var e = t.points,
i = new a(e[0], e[1]),
n = new a(e[2], e[3]),
s = new a(e[4], e[5]),
r = new a(e[6], e[7]);
return new h(i, n, s, r);
}),
(t.exports = h);
},
function (t, e, i) {
var n = i(0),
l = i(94),
u = i(36),
c = i(6),
s = i(196),
d = i(3),
r = new n({
Extends: l,
initialize: function (t, e, i, n, s, r, o, a) {
var h;
"object" == typeof t
? ((t = c((h = t), "x", 0)),
(e = c(h, "y", 0)),
(i = c(h, "xRadius", 0)),
(n = c(h, "yRadius", i)),
(s = c(h, "startAngle", 0)),
(r = c(h, "endAngle", 360)),
(o = c(h, "clockwise", !1)),
(a = c(h, "rotation", 0)))
: (void 0 === n && (n = i), void 0 === s && (s = 0), void 0 === r && (r = 360), void 0 === o && (o = !1), void 0 === a && (a = 0)),
l.call(this, "EllipseCurve"),
(this.p0 = new d(t, e)),
(this._xRadius = i),
(this._yRadius = n),
(this._startAngle = u(s)),
(this._endAngle = u(r)),
(this._clockwise = o),
(this._rotation = u(a));
},
getStartPoint: function (t) {
return void 0 === t && (t = new d()), this.getPoint(0, t);
},
getResolution: function (t) {
return 2 * t;
},
getPoint: function (t, e) {
void 0 === e && (e = new d());
for (var i = 2 * Math.PI, n = this._endAngle - this._startAngle, s = Math.abs(n) < Number.EPSILON; n < 0; ) n += i;
for (; i < n; ) n -= i;
n < Number.EPSILON && (n = s ? 0 : i), this._clockwise && !s && (n === i ? (n = -i) : (n -= i));
var r,
o,
a,
h,
l = this._startAngle + t * n,
u = this.p0.x + this._xRadius * Math.cos(l),
c = this.p0.y + this._yRadius * Math.sin(l);
return (
0 !== this._rotation && ((r = Math.cos(this._rotation)), (o = Math.sin(this._rotation)), (u = (a = u - this.p0.x) * r - (h = c - this.p0.y) * o + this.p0.x), (c = a * o + h * r + this.p0.y)), e.set(u, c)
);
},
setXRadius: function (t) {
return (this.xRadius = t), this;
},
setYRadius: function (t) {
return (this.yRadius = t), this;
},
setWidth: function (t) {
return (this.xRadius = t / 2), this;
},
setHeight: function (t) {
return (this.yRadius = t / 2), this;
},
setStartAngle: function (t) {
return (this.startAngle = t), this;
},
setEndAngle: function (t) {
return (this.endAngle = t), this;
},
setClockwise: function (t) {
return (this.clockwise = t), this;
},
setRotation: function (t) {
return (this.rotation = t), this;
},
x: {
get: function () {
return this.p0.x;
},
set: function (t) {
this.p0.x = t;
},
},
y: {
get: function () {
return this.p0.y;
},
set: function (t) {
this.p0.y = t;
},
},
xRadius: {
get: function () {
return this._xRadius;
},
set: function (t) {
this._xRadius = t;
},
},
yRadius: {
get: function () {
return this._yRadius;
},
set: function (t) {
this._yRadius = t;
},
},
startAngle: {
get: function () {
return s(this._startAngle);
},
set: function (t) {
this._startAngle = u(t);
},
},
endAngle: {
get: function () {
return s(this._endAngle);
},
set: function (t) {
this._endAngle = u(t);
},
},
clockwise: {
get: function () {
return this._clockwise;
},
set: function (t) {
this._clockwise = t;
},
},
angle: {
get: function () {
return s(this._rotation);
},
set: function (t) {
this._rotation = u(t);
},
},
rotation: {
get: function () {
return this._rotation;
},
set: function (t) {
this._rotation = t;
},
},
toJSON: function () {
return {
type: this.type,
x: this.p0.x,
y: this.p0.y,
xRadius: this._xRadius,
yRadius: this._yRadius,
startAngle: s(this._startAngle),
endAngle: s(this._endAngle),
clockwise: this._clockwise,
rotation: s(this._rotation),
};
},
});
(r.fromJSON = function (t) {
return new r(t);
}),
(t.exports = r);
},
function (t, e, i) {
var n = i(0),
s = i(94),
r = i(199),
o = i(10),
a = i(3),
h = new n({
Extends: s,
initialize: function (t, e) {
s.call(this, "LineCurve"), Array.isArray(t) && ((e = new a(t[2], t[3])), (t = new a(t[0], t[1]))), (this.p0 = t), (this.p1 = e), (this.arcLengthDivisions = 1);
},
getBounds: function (t) {
return void 0 === t && (t = new o()), r([this.p0, this.p1], t);
},
getStartPoint: function (t) {
return void 0 === t && (t = new a()), t.copy(this.p0);
},
getResolution: function (t) {
return void 0 === t && (t = 1), t;
},
getPoint: function (t, e) {
return void 0 === e && (e = new a()), 1 === t ? e.copy(this.p1) : (e.copy(this.p1).subtract(this.p0).scale(t).add(this.p0), e);
},
getPointAt: function (t, e) {
return this.getPoint(t, e);
},
getTangent: function (t, e) {
return void 0 === e && (e = new a()), e.copy(this.p1).subtract(this.p0).normalize(), e;
},
getUtoTmapping: function (t, e, i) {
var n, s;
return e ? ((s = (n = this.getLengths(i))[n.length - 1]), Math.min(e, s) / s) : t;
},
draw: function (t) {
return t.lineBetween(this.p0.x, this.p0.y, this.p1.x, this.p1.y), t;
},
toJSON: function () {
return { type: this.type, points: [this.p0.x, this.p0.y, this.p1.x, this.p1.y] };
},
});
(h.fromJSON = function (t) {
var e = t.points,
i = new a(e[0], e[1]),
n = new a(e[2], e[3]);
return new h(i, n);
}),
(t.exports = h);
},
function (t, e, i) {
var n = i(0),
s = i(3),
r = new n({
initialize: function (t, e) {
(this.active = !1), (this.p0 = new s(t, e));
},
getPoint: function (t, e) {
return void 0 === e && (e = new s()), e.copy(this.p0);
},
getPointAt: function (t, e) {
return this.getPoint(t, e);
},
getResolution: function () {
return 1;
},
getLength: function () {
return 0;
},
toJSON: function () {
return { type: "MoveTo", points: [this.p0.x, this.p0.y] };
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(0),
s = i(94),
r = i(359),
o = i(3),
a = new n({
Extends: s,
initialize: function (t, e, i) {
s.call(this, "QuadraticBezier"), Array.isArray(t) && ((i = new o(t[4], t[5])), (e = new o(t[2], t[3])), (t = new o(t[0], t[1]))), (this.p0 = t), (this.p1 = e), (this.p2 = i);
},
getStartPoint: function (t) {
return void 0 === t && (t = new o()), t.copy(this.p0);
},
getResolution: function (t) {
return t;
},
getPoint: function (t, e) {
void 0 === e && (e = new o());
var i = this.p0,
n = this.p1,
s = this.p2;
return e.set(r(t, i.x, n.x, s.x), r(t, i.y, n.y, s.y));
},
draw: function (t, e) {
void 0 === e && (e = 32);
var i = this.getPoints(e);
t.beginPath(), t.moveTo(this.p0.x, this.p0.y);
for (var n = 1; n < i.length; n++) t.lineTo(i[n].x, i[n].y);
return t.strokePath(), t;
},
toJSON: function () {
return { type: this.type, points: [this.p0.x, this.p0.y, this.p1.x, this.p1.y, this.p2.x, this.p2.y] };
},
});
(a.fromJSON = function (t) {
var e = t.points,
i = new o(e[0], e[1]),
n = new o(e[2], e[3]),
s = new o(e[4], e[5]);
return new a(i, n, s);
}),
(t.exports = a);
},
function (t, e, i) {
var u = i(194),
n = i(0),
s = i(94),
c = i(3),
r = new n({
Extends: s,
initialize: function (t) {
void 0 === t && (t = []), s.call(this, "SplineCurve"), (this.points = []), this.addPoints(t);
},
addPoints: function (t) {
for (var e = 0; e < t.length; e++) {
var i = new c();
"number" == typeof t[e] ? ((i.x = t[e]), (i.y = t[e + 1]), e++) : Array.isArray(t[e]) ? ((i.x = t[e][0]), (i.y = t[e][1])) : ((i.x = t[e].x), (i.y = t[e].y)), this.points.push(i);
}
return this;
},
addPoint: function (t, e) {
var i = new c(t, e);
return this.points.push(i), i;
},
getStartPoint: function (t) {
return void 0 === t && (t = new c()), t.copy(this.points[0]);
},
getResolution: function (t) {
return t * this.points.length;
},
getPoint: function (t, e) {
void 0 === e && (e = new c());
var i = this.points,
n = (i.length - 1) * t,
s = Math.floor(n),
r = n - s,
o = i[0 === s ? s : s - 1],
a = i[s],
h = i[s > i.length - 2 ? i.length - 1 : s + 1],
l = i[s > i.length - 3 ? i.length - 1 : s + 2];
return e.set(u(r, o.x, a.x, h.x, l.x), u(r, o.y, a.y, h.y, l.y));
},
toJSON: function () {
for (var t = [], e = 0; e < this.points.length; e++) t.push(this.points[e].x), t.push(this.points[e].y);
return { type: this.type, points: t };
},
});
(r.fromJSON = function (t) {
return new r(t.points);
}),
(t.exports = r);
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e, i, n) {
(e && "" !== e) ||
(e = ["precision mediump float;", "uniform vec2 resolution;", "varying vec2 fragCoord;", "void main () {", " vec2 uv = fragCoord / resolution.xy;", " gl_FragColor = vec4(uv.xyx, 1.0);", "}"].join(
"\n"
)),
(i && "" !== i) ||
(i = [
"precision mediump float;",
"uniform mat4 uProjectionMatrix;",
"uniform mat4 uViewMatrix;",
"uniform vec2 uResolution;",
"attribute vec2 inPosition;",
"varying vec2 fragCoord;",
"varying vec2 outTexCoord;",
"void main () {",
" gl_Position = uProjectionMatrix * uViewMatrix * vec4(inPosition, 1.0, 1.0);",
" fragCoord = vec2(inPosition.x, uResolution.y - inPosition.y);",
" outTexCoord = vec2(inPosition.x / uResolution.x, fragCoord.y / uResolution.y);",
"}",
].join("\n")),
void 0 === n && (n = null),
(this.key = t),
(this.fragmentSrc = e),
(this.vertexSrc = i),
(this.uniforms = n);
},
});
t.exports = n;
},
function (t, e, i) {
var n = i(38);
(n.ColorSpectrum = i(909)),
(n.ColorToRGBA = i(910)),
(n.ComponentToHex = i(398)),
(n.GetColor = i(103)),
(n.GetColor32 = i(328)),
(n.HexStringToColor = i(327)),
(n.HSLToColor = i(911)),
(n.HSVColorWheel = i(912)),
(n.HSVToRGB = i(188)),
(n.HueToComponent = i(399)),
(n.IntegerToColor = i(189)),
(n.IntegerToRGB = i(330)),
(n.Interpolate = i(913)),
(n.ObjectToColor = i(331)),
(n.RandomRGB = i(914)),
(n.RGBStringToColor = i(332)),
(n.RGBToHSV = i(329)),
(n.RGBToString = i(915)),
(n.ValueToColor = i(187)),
(t.exports = n);
},
function (t, e) {
t.exports = function (t) {
var e = t.toString(16);
return 1 === e.length ? "0" + e : e;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return i < 0 && (i += 1), 1 < i && --i, i < 1 / 6 ? t + 6 * (e - t) * i : i < 0.5 ? e : i < 2 / 3 ? t + (e - t) * (2 / 3 - i) * 6 : t;
};
},
function (t, e, i) {
var n = i(105);
t.exports = function (t) {
var e;
"complete" !== document.readyState && "interactive" !== document.readyState
? ((e = function () {
document.removeEventListener("deviceready", e, !0), document.removeEventListener("DOMContentLoaded", e, !0), window.removeEventListener("load", e, !0), t();
}),
document.body ? (n.cordova ? document.addEventListener("deviceready", e, !1) : (document.addEventListener("DOMContentLoaded", e, !0), window.addEventListener("load", e, !0))) : window.setTimeout(e, 20))
: t();
};
},
function (t, e) {
t.exports = function (t) {
if (!t) return window.innerHeight;
var e = Math.abs(window.orientation),
i = { w: 0, h: 0 },
n = document.createElement("div");
return (
n.setAttribute("style", "position: fixed; height: 100vh; width: 0; top: 0"),
document.documentElement.appendChild(n),
(i.w = 90 === e ? n.offsetHeight : window.innerWidth),
(i.h = 90 === e ? window.innerWidth : n.offsetHeight),
document.documentElement.removeChild(n),
(n = null),
90 !== Math.abs(window.orientation) ? i.h : i.w
);
};
},
function (t, e, i) {
var s = i(201);
t.exports = function (t, e) {
var i = window.screen,
n = !!i && (i.orientation || i.mozOrientation || i.msOrientation);
return n && "string" == typeof n.type
? n.type
: "string" == typeof n
? n
: "number" == typeof window.orientation
? 0 === window.orientation || 180 === window.orientation
? s.ORIENTATION.PORTRAIT
: s.ORIENTATION.LANDSCAPE
: window.matchMedia
? window.matchMedia("(orientation: portrait)").matches
? s.ORIENTATION.PORTRAIT
: window.matchMedia("(orientation: landscape)").matches
? s.ORIENTATION.LANDSCAPE
: void 0
: t < e
? s.ORIENTATION.PORTRAIT
: s.ORIENTATION.LANDSCAPE;
};
},
function (t, e) {
t.exports = { NO_CENTER: 0, CENTER_BOTH: 1, CENTER_HORIZONTALLY: 2, CENTER_VERTICALLY: 3 };
},
function (t, e) {
t.exports = { LANDSCAPE: "landscape-primary", PORTRAIT: "portrait-primary" };
},
function (t, e) {
t.exports = { NONE: 0, WIDTH_CONTROLS_HEIGHT: 1, HEIGHT_CONTROLS_WIDTH: 2, FIT: 3, ENVELOP: 4, RESIZE: 5 };
},
function (t, e) {
t.exports = { NO_ZOOM: 1, ZOOM_2X: 2, ZOOM_4X: 4, MAX_ZOOM: -1 };
},
function (t, e) {
t.exports = function (t) {
var e;
return "" !== t && ("string" == typeof t ? (e = document.getElementById(t)) : t && 1 === t.nodeType && (e = t)), e || document.body;
};
},
function (t, e) {
t.exports = function (t) {
var e = "";
try {
window.DOMParser ? (e = new DOMParser().parseFromString(t, "text/xml")) : (e = new ActiveXObject("Microsoft.XMLDOM")).loadXML(t);
} catch (t) {
e = null;
}
return e && e.documentElement && !e.getElementsByTagName("parsererror").length ? e : null;
};
},
function (t, e, i) {
var n = i(0),
a = i(203),
s = i(9),
r = i(51),
o = i(22),
h = i(410),
l = i(411),
u = i(412),
c = i(413),
d = i(25),
v = i(177),
f = new n({
initialize: function (t, e) {
(this.game = t),
this.scaleManager,
this.canvas,
(this.config = e),
(this.enabled = !0),
(this.events = new s()),
(this.isOver = !0),
(this.defaultCursor = ""),
(this.keyboard = e.inputKeyboard ? new h(this) : null),
(this.mouse = e.inputMouse ? new l(this) : null),
(this.touch = e.inputTouch ? new c(this) : null),
(this.pointers = []),
(this.pointersTotal = e.inputActivePointers),
e.inputTouch && 1 === this.pointersTotal && (this.pointersTotal = 2);
for (var i = 0; i <= this.pointersTotal; i++) {
var n = new u(this, i);
(n.smoothFactor = e.inputSmoothFactor), this.pointers.push(n);
}
(this.mousePointer = e.inputMouse ? this.pointers[0] : null),
(this.activePointer = this.pointers[0]),
(this.globalTopOnly = !0),
(this.time = 0),
(this._tempPoint = { x: 0, y: 0 }),
(this._tempHitTest = []),
(this._tempMatrix = new d()),
(this._tempMatrix2 = new d()),
(this._tempSkip = !1),
(this.mousePointerContainer = [this.mousePointer]),
t.events.once(o.BOOT, this.boot, this);
},
boot: function () {
(this.canvas = this.game.canvas),
(this.scaleManager = this.game.scale),
this.events.emit(r.MANAGER_BOOT),
this.game.events.on(o.PRE_RENDER, this.preRender, this),
this.game.events.once(o.DESTROY, this.destroy, this);
},
setCanvasOver: function (t) {
(this.isOver = !0), this.events.emit(r.GAME_OVER, t);
},
setCanvasOut: function (t) {
(this.isOver = !1), this.events.emit(r.GAME_OUT, t);
},
preRender: function () {
var t = this.game.loop.now,
e = this.game.loop.delta,
i = this.game.scene.getScenes(!0, !0);
(this.time = t), this.events.emit(r.MANAGER_UPDATE);
for (var n = 0; n < i.length; n++) {
var s = i[n];
if (s.sys.input && s.sys.input.updatePoll(t, e) && this.globalTopOnly) return;
}
},
setDefaultCursor: function (t) {
(this.defaultCursor = t), this.canvas.style.cursor !== t && (this.canvas.style.cursor = t);
},
setCursor: function (t) {
t.cursor && (this.canvas.style.cursor = t.cursor);
},
resetCursor: function (t) {
t.cursor && this.canvas && (this.canvas.style.cursor = this.defaultCursor);
},
addPointer: function (t) {
void 0 === t && (t = 1);
var e = [];
10 < this.pointersTotal + t && (t = 10 - this.pointersTotal);
for (var i = 0; i < t; i++) {
var n = this.pointers.length,
s = new u(this, n);
(s.smoothFactor = this.config.inputSmoothFactor), this.pointers.push(s), this.pointersTotal++, e.push(s);
}
return e;
},
updateInputPlugins: function (t, e) {
var i = this.game.scene.getScenes(!0, !0);
this._tempSkip = !1;
for (var n = 0; n < i.length; n++) {
var s = i[n];
if (s.sys.input && ((s.sys.input.update(t, e) && this.globalTopOnly) || this._tempSkip)) return;
}
},
onTouchStart: function (t) {
for (var e = this.pointers, i = [], n = 0; n < t.changedTouches.length; n++)
for (var s = t.changedTouches[n], r = 1; r < this.pointersTotal; r++) {
var o = e[r];
if (!o.active) {
o.touchstart(s, t), (this.activePointer = o), i.push(o);
break;
}
}
this.updateInputPlugins(a.TOUCH_START, i);
},
onTouchMove: function (t) {
for (var e = this.pointers, i = [], n = 0; n < t.changedTouches.length; n++)
for (var s = t.changedTouches[n], r = 1; r < this.pointersTotal; r++) {
var o = e[r];
if (o.active && o.identifier === s.identifier) {
o.touchmove(s, t), (this.activePointer = o), i.push(o);
break;
}
}
this.updateInputPlugins(a.TOUCH_MOVE, i);
},
onTouchEnd: function (t) {
for (var e = this.pointers, i = [], n = 0; n < t.changedTouches.length; n++)
for (var s = t.changedTouches[n], r = 1; r < this.pointersTotal; r++) {
var o = e[r];
if (o.active && o.identifier === s.identifier) {
o.touchend(s, t), i.push(o);
break;
}
}
this.updateInputPlugins(a.TOUCH_END, i);
},
onTouchCancel: function (t) {
for (var e = this.pointers, i = [], n = 0; n < t.changedTouches.length; n++)
for (var s = t.changedTouches[n], r = 1; r < this.pointersTotal; r++) {
var o = e[r];
if (o.active && o.identifier === s.identifier) {
o.touchcancel(s, t), i.push(o);
break;
}
}
this.updateInputPlugins(a.TOUCH_CANCEL, i);
},
onMouseDown: function (t) {
var e = this.mousePointer;
e.down(t), e.updateMotion(), (this.activePointer = e), this.updateInputPlugins(a.MOUSE_DOWN, this.mousePointerContainer);
},
onMouseMove: function (t) {
var e = this.mousePointer;
e.move(t), e.updateMotion(), (this.activePointer = e), this.updateInputPlugins(a.MOUSE_MOVE, this.mousePointerContainer);
},
onMouseUp: function (t) {
var e = this.mousePointer;
e.up(t), e.updateMotion(), (this.activePointer = e), this.updateInputPlugins(a.MOUSE_UP, this.mousePointerContainer);
},
onMouseWheel: function (t) {
var e = this.mousePointer;
e.wheel(t), (this.activePointer = e), this.updateInputPlugins(a.MOUSE_WHEEL, this.mousePointerContainer);
},
onPointerLockChange: function (t) {
var e = this.mouse.locked;
(this.mousePointer.locked = e), this.events.emit(r.POINTERLOCK_CHANGE, t, e);
},
inputCandidate: function (t, e) {
var i = t.input;
if (!i || !i.enabled || (!i.alwaysEnabled && !t.willRender(e))) return !1;
var n = !0,
s = t.parentContainer;
if (s)
do {
if (!s.willRender(e)) {
n = !1;
break;
}
s = s.parentContainer;
} while (s);
return n;
},
hitTest: function (t, e, i, n) {
void 0 === n && (n = this._tempHitTest);
var s = this._tempPoint,
r = i.scrollX,
o = i.scrollY;
n.length = 0;
var a = t.x,
h = t.y;
i.getWorldPoint(a, h, s), (t.worldX = s.x), (t.worldY = s.y);
for (var l = { x: 0, y: 0 }, u = this._tempMatrix, c = this._tempMatrix2, d = 0; d < e.length; d++) {
var f,
p,
g = e[d];
this.inputCandidate(g, i) &&
((f = s.x + r * g.scrollFactorX - r),
(p = s.y + o * g.scrollFactorY - o),
g.parentContainer ? (g.getWorldTransformMatrix(u, c), u.applyInverse(f, p, l)) : v(f, p, g.x, g.y, g.rotation, g.scaleX, g.scaleY, l),
this.pointWithinHitArea(g, l.x, l.y) && n.push(g));
}
return n;
},
pointWithinHitArea: function (t, e, i) {
(e += t.displayOriginX), (i += t.displayOriginY);
var n = t.input;
return !(!n || !n.hitAreaCallback(n.hitArea, e, i, t) || ((n.localX = e), (n.localY = i), 0));
},
pointWithinInteractiveObject: function (t, e, i) {
return !!t.hitArea && ((e += t.gameObject.displayOriginX), (i += t.gameObject.displayOriginY), (t.localX = e), (t.localY = i), t.hitAreaCallback(t.hitArea, e, i, t));
},
transformPointer: function (t, e, i, n) {
var s = t.position,
r = t.prevPosition;
(r.x = s.x), (r.y = s.y);
var o = this.scaleManager.transformX(e),
a = this.scaleManager.transformY(i),
h = t.smoothFactor;
n && 0 !== h ? ((s.x = o * h + r.x * (1 - h)), (s.y = a * h + r.y * (1 - h))) : ((s.x = o), (s.y = a));
},
destroy: function () {
this.events.removeAllListeners(), this.game.events.off(o.PRE_RENDER), this.keyboard && this.keyboard.destroy(), this.mouse && this.mouse.destroy(), this.touch && this.touch.destroy();
for (var t = 0; t < this.pointers.length; t++) this.pointers[t].destroy();
(this.pointers = []), (this._tempHitTest = []), this._tempMatrix.destroy(), (this.canvas = null), (this.game = null);
},
});
t.exports = f;
},
function (t, e, i) {
var s = i(93),
n = i(0),
r = i(22),
o = i(51),
a = i(143),
h = i(1),
l = new n({
initialize: function (t) {
(this.manager = t),
(this.queue = []),
(this.preventDefault = !0),
(this.captures = []),
(this.enabled = !1),
this.target,
(this.onKeyDown = h),
(this.onKeyUp = h),
t.events.once(o.MANAGER_BOOT, this.boot, this);
},
boot: function () {
var t = this.manager.config;
(this.enabled = t.inputKeyboard),
(this.target = t.inputKeyboardEventTarget),
this.addCapture(t.inputKeyboardCapture),
!this.target && window && (this.target = window),
this.enabled && this.target && this.startListeners(),
this.manager.game.events.on(r.POST_STEP, this.postUpdate, this);
},
startListeners: function () {
var i = this;
(this.onKeyDown = function (t) {
var e;
!t.defaultPrevented &&
i.enabled &&
i.manager &&
(i.queue.push(t), i.manager.events.emit(o.MANAGER_PROCESS), (e = t.altKey || t.ctrlKey || t.shiftKey || t.metaKey), i.preventDefault && !e && -1 < i.captures.indexOf(t.keyCode) && t.preventDefault());
}),
(this.onKeyUp = function (t) {
var e;
!t.defaultPrevented &&
i.enabled &&
i.manager &&
(i.queue.push(t),
i.manager.events.emit(o.MANAGER_PROCESS),
(e = t.altKey || t.ctrlKey || t.shiftKey || t.metaKey),
i.preventDefault && !e && -1 < i.captures.indexOf(t.keyCode) && t.preventDefault());
});
var t = this.target;
t && (t.addEventListener("keydown", this.onKeyDown, !1), t.addEventListener("keyup", this.onKeyUp, !1), (this.enabled = !0));
},
stopListeners: function () {
var t = this.target;
t.removeEventListener("keydown", this.onKeyDown, !1), t.removeEventListener("keyup", this.onKeyUp, !1), (this.enabled = !1);
},
postUpdate: function () {
this.queue = [];
},
addCapture: function (t) {
"string" == typeof t && (t = t.split(",")), Array.isArray(t) || (t = [t]);
for (var e = this.captures, i = 0; i < t.length; i++) {
var n = t[i];
"string" == typeof n && (n = a[n.trim().toUpperCase()]), -1 === e.indexOf(n) && e.push(n);
}
this.preventDefault = 0 < e.length;
},
removeCapture: function (t) {
"string" == typeof t && (t = t.split(",")), Array.isArray(t) || (t = [t]);
for (var e = this.captures, i = 0; i < t.length; i++) {
var n = t[i];
"string" == typeof n && (n = a[n.toUpperCase()]), s(e, n);
}
this.preventDefault = 0 < e.length;
},
clearCaptures: function () {
(this.captures = []), (this.preventDefault = !1);
},
destroy: function () {
this.stopListeners(), this.clearCaptures(), (this.queue = []), this.manager.game.events.off(r.POST_RENDER, this.postUpdate, this), (this.target = null), (this.enabled = !1), (this.manager = null);
},
});
t.exports = l;
},
function (t, e, i) {
var n = i(0),
o = i(191),
s = i(51),
r = i(1),
a = new n({
initialize: function (t) {
(this.manager = t),
(this.preventDefaultDown = !0),
(this.preventDefaultUp = !0),
(this.preventDefaultMove = !0),
(this.preventDefaultWheel = !1),
(this.enabled = !1),
this.target,
(this.locked = !1),
(this.onMouseMove = r),
(this.onMouseDown = r),
(this.onMouseUp = r),
(this.onMouseDownWindow = r),
(this.onMouseUpWindow = r),
(this.onMouseOver = r),
(this.onMouseOut = r),
(this.onMouseWheel = r),
(this.pointerLockChange = r),
(this.isTop = !0),
t.events.once(s.MANAGER_BOOT, this.boot, this);
},
boot: function () {
var t = this.manager.config;
(this.enabled = t.inputMouse),
(this.target = t.inputMouseEventTarget),
(this.passive = t.inputMousePassive),
(this.preventDefaultDown = t.inputMousePreventDefaultDown),
(this.preventDefaultUp = t.inputMousePreventDefaultUp),
(this.preventDefaultMove = t.inputMousePreventDefaultMove),
(this.preventDefaultWheel = t.inputMousePreventDefaultWheel),
this.target ? "string" == typeof this.target && (this.target = document.getElementById(this.target)) : (this.target = this.manager.game.canvas),
t.disableContextMenu && this.disableContextMenu(),
this.enabled && this.target && this.startListeners();
},
disableContextMenu: function () {
return (
document.body.addEventListener("contextmenu", function (t) {
return t.preventDefault(), !1;
}),
this
);
},
requestPointerLock: function () {
var t;
o.pointerLock && (((t = this.target).requestPointerLock = t.requestPointerLock || t.mozRequestPointerLock || t.webkitRequestPointerLock), t.requestPointerLock());
},
releasePointerLock: function () {
o.pointerLock && ((document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock), document.exitPointerLock());
},
startListeners: function () {
var t = this.target;
if (t) {
var i = this,
n = this.manager,
e = n.canvas,
s = window && window.focus && n.game.config.autoFocus;
(this.onMouseMove = function (t) {
!t.defaultPrevented && i.enabled && n && n.enabled && (n.onMouseMove(t), i.preventDefaultMove && t.preventDefault());
}),
(this.onMouseDown = function (t) {
s && window.focus(), !t.defaultPrevented && i.enabled && n && n.enabled && (n.onMouseDown(t), i.preventDefaultDown && t.target === e && t.preventDefault());
}),
(this.onMouseDownWindow = function (t) {
!t.defaultPrevented && i.enabled && n && n.enabled && t.target !== e && n.onMouseDown(t);
}),
(this.onMouseUp = function (t) {
!t.defaultPrevented && i.enabled && n && n.enabled && (n.onMouseUp(t), i.preventDefaultUp && t.target === e && t.preventDefault());
}),
(this.onMouseUpWindow = function (t) {
!t.defaultPrevented && i.enabled && n && n.enabled && t.target !== e && n.onMouseUp(t);
}),
(this.onMouseOver = function (t) {
!t.defaultPrevented && i.enabled && n && n.enabled && n.setCanvasOver(t);
}),
(this.onMouseOut = function (t) {
!t.defaultPrevented && i.enabled && n && n.enabled && n.setCanvasOut(t);
}),
(this.onMouseWheel = function (t) {
!t.defaultPrevented && i.enabled && n && n.enabled && n.onMouseWheel(t), i.preventDefaultWheel && t.target === e && t.preventDefault();
});
var r = { passive: !0 };
if (
(t.addEventListener("mousemove", this.onMouseMove),
t.addEventListener("mousedown", this.onMouseDown),
t.addEventListener("mouseup", this.onMouseUp),
t.addEventListener("mouseover", this.onMouseOver, r),
t.addEventListener("mouseout", this.onMouseOut, r),
this.preventDefaultWheel ? t.addEventListener("wheel", this.onMouseWheel, { passive: !1 }) : t.addEventListener("wheel", this.onMouseWheel, r),
window && n.game.config.inputWindowEvents)
)
try {
window.top.addEventListener("mousedown", this.onMouseDownWindow, r), window.top.addEventListener("mouseup", this.onMouseUpWindow, r);
} catch (t) {
window.addEventListener("mousedown", this.onMouseDownWindow, r), window.addEventListener("mouseup", this.onMouseUpWindow, r), (this.isTop = !1);
}
o.pointerLock &&
((this.pointerLockChange = function (t) {
var e = i.target;
(i.locked = document.pointerLockElement === e || document.mozPointerLockElement === e || document.webkitPointerLockElement === e), n.onPointerLockChange(t);
}),
document.addEventListener("pointerlockchange", this.pointerLockChange, !0),
document.addEventListener("mozpointerlockchange", this.pointerLockChange, !0),
document.addEventListener("webkitpointerlockchange", this.pointerLockChange, !0)),
(this.enabled = !0);
}
},
stopListeners: function () {
var t = this.target;
t.removeEventListener("mousemove", this.onMouseMove),
t.removeEventListener("mousedown", this.onMouseDown),
t.removeEventListener("mouseup", this.onMouseUp),
t.removeEventListener("mouseover", this.onMouseOver),
t.removeEventListener("mouseout", this.onMouseOut),
window && ((t = this.isTop ? window.top : window).removeEventListener("mousedown", this.onMouseDownWindow), t.removeEventListener("mouseup", this.onMouseUpWindow)),
o.pointerLock &&
(document.removeEventListener("pointerlockchange", this.pointerLockChange, !0),
document.removeEventListener("mozpointerlockchange", this.pointerLockChange, !0),
document.removeEventListener("webkitpointerlockchange", this.pointerLockChange, !0));
},
destroy: function () {
this.stopListeners(), (this.target = null), (this.enabled = !1), (this.manager = null);
},
});
t.exports = a;
},
function (t, e, i) {
var h = i(349),
n = i(0),
s = i(50),
l = i(124),
u = i(360),
r = i(3),
o = i(105),
a = new n({
initialize: function (t, e) {
(this.manager = t),
(this.id = e),
this.event,
this.downElement,
this.upElement,
(this.camera = null),
(this.button = 0),
(this.buttons = 0),
(this.position = new r()),
(this.prevPosition = new r()),
(this.midPoint = new r(-1, -1)),
(this.velocity = new r()),
(this.angle = 0),
(this.distance = 0),
(this.smoothFactor = 0),
(this.motionFactor = 0.2),
(this.worldX = 0),
(this.worldY = 0),
(this.moveTime = 0),
(this.downX = 0),
(this.downY = 0),
(this.downTime = 0),
(this.upX = 0),
(this.upY = 0),
(this.upTime = 0),
(this.primaryDown = !1),
(this.isDown = !1),
(this.wasTouch = !1),
(this.wasCanceled = !1),
(this.movementX = 0),
(this.movementY = 0),
(this.identifier = 0),
(this.pointerId = null),
(this.active = 0 === e),
(this.locked = !1),
(this.deltaX = 0),
(this.deltaY = 0),
(this.deltaZ = 0);
},
updateWorldPoint: function (t) {
var e = t.getWorldPoint(this.x, this.y);
return (this.worldX = e.x), (this.worldY = e.y), this;
},
positionToCamera: function (t, e) {
return t.getWorldPoint(this.x, this.y, e);
},
updateMotion: function () {
var t,
e,
i,
n,
s = this.position.x,
r = this.position.y,
o = this.midPoint.x,
a = this.midPoint.y;
(s === o && r === a) ||
((t = u(this.motionFactor, o, s)),
(e = u(this.motionFactor, a, r)),
l(t, s, 0.1) && (t = s),
l(e, r, 0.1) && (e = r),
this.midPoint.set(t, e),
(i = s - t),
(n = r - e),
this.velocity.set(i, n),
(this.angle = h(t, e, s, r)),
(this.distance = Math.sqrt(i * i + n * n)));
},
up: function (t) {
"buttons" in t && (this.buttons = t.buttons),
(this.event = t),
(this.button = t.button),
(this.upElement = t.target),
this.manager.transformPointer(this, t.pageX, t.pageY, !1),
0 === t.button && ((this.primaryDown = !1), (this.upX = this.x), (this.upY = this.y)),
0 === this.buttons && ((this.isDown = !1), (this.upTime = t.timeStamp), (this.wasTouch = !1));
},
down: function (t) {
"buttons" in t && (this.buttons = t.buttons),
(this.event = t),
(this.button = t.button),
(this.downElement = t.target),
this.manager.transformPointer(this, t.pageX, t.pageY, !1),
0 === t.button && ((this.primaryDown = !0), (this.downX = this.x), (this.downY = this.y)),
o.macOS && t.ctrlKey && ((this.buttons = 2), (this.primaryDown = !1)),
this.isDown || ((this.isDown = !0), (this.downTime = t.timeStamp)),
(this.wasTouch = !1);
},
move: function (t) {
"buttons" in t && (this.buttons = t.buttons),
(this.event = t),
this.manager.transformPointer(this, t.pageX, t.pageY, !0),
this.locked && ((this.movementX = t.movementX || t.mozMovementX || t.webkitMovementX || 0), (this.movementY = t.movementY || t.mozMovementY || t.webkitMovementY || 0)),
(this.moveTime = t.timeStamp),
(this.wasTouch = !1);
},
wheel: function (t) {
"buttons" in t && (this.buttons = t.buttons),
(this.event = t),
this.manager.transformPointer(this, t.pageX, t.pageY, !1),
(this.deltaX = t.deltaX),
(this.deltaY = t.deltaY),
(this.deltaZ = t.deltaZ),
(this.wasTouch = !1);
},
touchstart: function (t, e) {
t.pointerId && (this.pointerId = t.pointerId),
(this.identifier = t.identifier),
(this.target = t.target),
(this.active = !0),
(this.buttons = 1),
(this.event = e),
(this.downElement = t.target),
this.manager.transformPointer(this, t.pageX, t.pageY, !1),
(this.primaryDown = !0),
(this.downX = this.x),
(this.downY = this.y),
(this.downTime = e.timeStamp),
(this.isDown = !0),
(this.wasTouch = !0),
(this.wasCanceled = !1),
this.updateMotion();
},
touchmove: function (t, e) {
(this.event = e), this.manager.transformPointer(this, t.pageX, t.pageY, !0), (this.moveTime = e.timeStamp), (this.wasTouch = !0), this.updateMotion();
},
touchend: function (t, e) {
(this.buttons = 0),
(this.event = e),
(this.upElement = t.target),
this.manager.transformPointer(this, t.pageX, t.pageY, !1),
(this.primaryDown = !1),
(this.upX = this.x),
(this.upY = this.y),
(this.upTime = e.timeStamp),
(this.isDown = !1),
(this.wasTouch = !0),
(this.wasCanceled = !1),
(this.active = !1),
this.updateMotion();
},
touchcancel: function (t, e) {
(this.buttons = 0),
(this.event = e),
(this.upElement = t.target),
this.manager.transformPointer(this, t.pageX, t.pageY, !1),
(this.primaryDown = !1),
(this.upX = this.x),
(this.upY = this.y),
(this.upTime = e.timeStamp),
(this.isDown = !1),
(this.wasTouch = !0),
(this.wasCanceled = !0),
(this.active = !1);
},
noButtonDown: function () {
return 0 === this.buttons;
},
leftButtonDown: function () {
return !!(1 & this.buttons);
},
rightButtonDown: function () {
return !!(2 & this.buttons);
},
middleButtonDown: function () {
return !!(4 & this.buttons);
},
backButtonDown: function () {
return !!(8 & this.buttons);
},
forwardButtonDown: function () {
return !!(16 & this.buttons);
},
leftButtonReleased: function () {
return 0 === this.button && !this.isDown;
},
rightButtonReleased: function () {
return 2 === this.button && !this.isDown;
},
middleButtonReleased: function () {
return 1 === this.button && !this.isDown;
},
backButtonReleased: function () {
return 3 === this.button && !this.isDown;
},
forwardButtonReleased: function () {
return 4 === this.button && !this.isDown;
},
getDistance: function () {
return this.isDown ? s(this.downX, this.downY, this.x, this.y) : s(this.downX, this.downY, this.upX, this.upY);
},
getDistanceX: function () {
return this.isDown ? Math.abs(this.downX - this.x) : Math.abs(this.downX - this.upX);
},
getDistanceY: function () {
return this.isDown ? Math.abs(this.downY - this.y) : Math.abs(this.downY - this.upY);
},
getDuration: function () {
return this.isDown ? this.manager.time - this.downTime : this.upTime - this.downTime;
},
getAngle: function () {
return this.isDown ? h(this.downX, this.downY, this.x, this.y) : h(this.downX, this.downY, this.upX, this.upY);
},
getInterpolatedPosition: function (t, e) {
void 0 === t && (t = 10), void 0 === e && (e = []);
for (var i = this.prevPosition.x, n = this.prevPosition.y, s = this.position.x, r = this.position.y, o = 0; o < t; o++) {
var a = (1 / t) * o;
e[o] = { x: u(a, i, s), y: u(a, n, r) };
}
return e;
},
destroy: function () {
(this.camera = null), (this.manager = null), (this.position = null);
},
x: {
get: function () {
return this.position.x;
},
set: function (t) {
this.position.x = t;
},
},
y: {
get: function () {
return this.position.y;
},
set: function (t) {
this.position.y = t;
},
},
time: {
get: function () {
return this.event ? this.event.timeStamp : 0;
},
},
});
t.exports = a;
},
function (t, e, i) {
var n = i(0),
s = i(51),
r = i(1),
o = new n({
initialize: function (t) {
(this.manager = t),
(this.capture = !0),
(this.enabled = !1),
this.target,
(this.onTouchStart = r),
(this.onTouchStartWindow = r),
(this.onTouchMove = r),
(this.onTouchEnd = r),
(this.onTouchEndWindow = r),
(this.onTouchCancel = r),
(this.onTouchCancelWindow = r),
(this.onTouchOver = r),
(this.onTouchOut = r),
t.events.once(s.MANAGER_BOOT, this.boot, this);
},
boot: function () {
var t = this.manager.config;
(this.enabled = t.inputTouch),
(this.target = t.inputTouchEventTarget),
(this.capture = t.inputTouchCapture),
this.target || (this.target = this.manager.game.canvas),
t.disableContextMenu && this.disableContextMenu(),
this.enabled && this.target && this.startListeners();
},
disableContextMenu: function () {
return (
document.body.addEventListener("contextmenu", function (t) {
return t.preventDefault(), !1;
}),
this
);
},
startListeners: function () {
var e = this,
i = this.manager.canvas,
n = window && window.focus && this.manager.game.config.autoFocus;
(this.onTouchStart = function (t) {
n && window.focus(), !t.defaultPrevented && e.enabled && e.manager && e.manager.enabled && (e.manager.onTouchStart(t), e.capture && t.cancelable && t.target === i && t.preventDefault());
}),
(this.onTouchStartWindow = function (t) {
!t.defaultPrevented && e.enabled && e.manager && e.manager.enabled && t.target !== i && e.manager.onTouchStart(t);
}),
(this.onTouchMove = function (t) {
!t.defaultPrevented && e.enabled && e.manager && e.manager.enabled && (e.manager.onTouchMove(t), e.capture && t.cancelable && t.preventDefault());
}),
(this.onTouchEnd = function (t) {
!t.defaultPrevented && e.enabled && e.manager && e.manager.enabled && (e.manager.onTouchEnd(t), e.capture && t.cancelable && t.target === i && t.preventDefault());
}),
(this.onTouchEndWindow = function (t) {
!t.defaultPrevented && e.enabled && e.manager && e.manager.enabled && t.target !== i && e.manager.onTouchEnd(t);
}),
(this.onTouchCancel = function (t) {
!t.defaultPrevented && e.enabled && e.manager && e.manager.enabled && (e.manager.onTouchCancel(t), e.capture && t.preventDefault());
}),
(this.onTouchCancelWindow = function (t) {
!t.defaultPrevented && e.enabled && e.manager && e.manager.enabled && e.manager.onTouchCancel(t);
}),
(this.onTouchOver = function (t) {
!t.defaultPrevented && e.enabled && e.manager && e.manager.enabled && e.manager.setCanvasOver(t);
}),
(this.onTouchOut = function (t) {
!t.defaultPrevented && e.enabled && e.manager && e.manager.enabled && e.manager.setCanvasOut(t);
});
var t,
s,
r = this.target;
r &&
((s = { passive: ((t = { passive: !0 }), !1) }),
r.addEventListener("touchstart", this.onTouchStart, this.capture ? s : t),
r.addEventListener("touchmove", this.onTouchMove, this.capture ? s : t),
r.addEventListener("touchend", this.onTouchEnd, this.capture ? s : t),
r.addEventListener("touchcancel", this.onTouchCancel, this.capture ? s : t),
r.addEventListener("touchover", this.onTouchOver, this.capture ? s : t),
r.addEventListener("touchout", this.onTouchOut, this.capture ? s : t),
window &&
this.manager.game.config.inputWindowEvents &&
(window.addEventListener("touchstart", this.onTouchStartWindow, s), window.addEventListener("touchend", this.onTouchEndWindow, s), window.addEventListener("touchcancel", this.onTouchCancelWindow, s)),
(this.enabled = !0));
},
stopListeners: function () {
var t = this.target;
t.removeEventListener("touchstart", this.onTouchStart),
t.removeEventListener("touchmove", this.onTouchMove),
t.removeEventListener("touchend", this.onTouchEnd),
t.removeEventListener("touchcancel", this.onTouchCancel),
t.removeEventListener("touchover", this.onTouchOver),
t.removeEventListener("touchout", this.onTouchOut),
window && (window.removeEventListener("touchstart", this.onTouchStartWindow), window.removeEventListener("touchend", this.onTouchEndWindow));
},
destroy: function () {
this.stopListeners(), (this.target = null), (this.enabled = !1), (this.manager = null);
},
});
t.exports = o;
},
function (t, e, i) {
var n = i(0),
l = i(22),
s = i(9),
r = i(8),
o = i(16),
a = i(5),
u = i(2),
g = i(24),
h = i(93),
c = new n({
Extends: s,
initialize: function (t) {
s.call(this), (this.game = t), (this.plugins = []), (this.scenePlugins = []), (this._pendingGlobal = []), (this._pendingScene = []), t.isBooted ? this.boot() : t.events.once(l.BOOT, this.boot, this);
},
boot: function () {
for (var t, e, i, n, s, r, o = this.game.config, a = (a = o.installGlobalPlugins).concat(this._pendingGlobal), h = 0; h < a.length; h++)
(t = a[h]), (e = u(t, "key", null)), (i = u(t, "plugin", null)), (n = u(t, "start", !1)), (s = u(t, "mapping", null)), (r = u(t, "data", null)), e && i && this.install(e, i, n, s, r);
for (a = (a = o.installScenePlugins).concat(this._pendingScene), h = 0; h < a.length; h++)
(t = a[h]), (e = u(t, "key", null)), (i = u(t, "plugin", null)), (s = u(t, "mapping", null)), e && i && this.installScenePlugin(e, i, s);
(this._pendingGlobal = []), (this._pendingScene = []), this.game.events.once(l.DESTROY, this.destroy, this);
},
addToScene: function (t, e, i) {
for (var n, s = this.game, r = t.scene, o = t.settings.map, a = t.settings.isBooted, h = 0; h < e.length; h++)
s[(f = e[h])] ? ((t[f] = s[f]), o.hasOwnProperty(f) && (r[o[f]] = t[f])) : "game" === f && o.hasOwnProperty(f) && (r[o[f]] = s);
for (var l = 0; l < i.length; l++)
for (n = i[l], h = 0; h < n.length; h++) {
var u,
c,
d,
f = n[h];
g.hasCore(f) && ((c = (u = g.getCore(f)).mapping), (d = new u.plugin(r, this, c)), (t[c] = d), u.custom ? (r[c] = d) : o.hasOwnProperty(c) && (r[o[c]] = d), a && d.boot());
}
for (n = this.plugins, h = 0; h < n.length; h++) {
var p = n[h];
p.mapping && (r[p.mapping] = p.plugin);
}
},
getDefaultScenePlugins: function () {
return this.game.config.defaultPlugins.concat(this.scenePlugins);
},
installScenePlugin: function (t, e, i, n, s) {
if ((void 0 === s && (s = !1), "function" == typeof e)) {
if (g.hasCore(t)) {
if (!s && g.hasCore(t)) return;
} else g.register(t, e, i, !0), this.scenePlugins.push(t);
var r;
n && ((r = new e(n, this, t)), (n.sys[t] = r), i && "" !== i && (n[i] = r), r.boot());
}
},
install: function (t, e, i, n, s) {
if ((void 0 === i && (i = !1), void 0 === n && (n = null), void 0 === s && (s = null), "function" != typeof e)) return null;
if (g.hasCustom(t)) return null;
if ((null !== n && (i = !0), this.game.isBooted)) {
if ((g.registerCustom(t, e, n, s), i)) return this.start(t);
} else this._pendingGlobal.push({ key: t, plugin: e, start: i, mapping: n, data: s });
return null;
},
getIndex: function (t) {
for (var e = this.plugins, i = 0; i < e.length; i++) if (e[i].key === t) return i;
return -1;
},
getEntry: function (t) {
var e = this.getIndex(t);
if (-1 !== e) return this.plugins[e];
},
isActive: function (t) {
var e = this.getEntry(t);
return e && e.active;
},
start: function (t, e) {
void 0 === e && (e = t);
var i = this.getEntry(e);
return i && !i.active ? ((i.active = !0), i.plugin.start()) : (i = i || this.createEntry(t, e)), i ? i.plugin : null;
},
createEntry: function (t, e) {
var i,
n = g.getCustom(t);
return n && ((n = { key: e, plugin: (i = new n.plugin(this)), active: !0, mapping: n.mapping, data: n.data }), this.plugins.push(n), i.init(n.data), i.start()), n;
},
stop: function (t) {
var e = this.getEntry(t);
return e && e.active && ((e.active = !1), e.plugin.stop()), this;
},
get: function (t, e) {
void 0 === e && (e = !0);
var i = this.getEntry(t);
if (i) return i.plugin;
var n = this.getClass(t);
return n && e ? ((i = this.createEntry(t, t)) ? i.plugin : null) : n || null;
},
getClass: function (t) {
return g.getCustomClass(t);
},
removeGlobalPlugin: function (t) {
var e = this.getEntry(t);
e && h(this.plugins, e), g.removeCustom(t);
},
removeScenePlugin: function (t) {
h(this.scenePlugins, t), g.remove(t);
},
registerGameObject: function (t, e, i) {
return e && a.register(t, e), i && o.register(t, i), this;
},
removeGameObject: function (t, e, i) {
return void 0 === e && (e = !0), void 0 === i && (i = !0), e && a.remove(t), i && o.remove(t), this;
},
registerFileType: function (t, e, i) {
r.register(t, e), i && i.sys.load && (i.sys.load[t] = e);
},
destroy: function () {
for (var t = 0; t < this.plugins.length; t++) this.plugins[t].plugin.destroy();
g.destroyCustomPlugins(), this.game.noReturn && g.destroyCorePlugins(), (this.game = null), (this.plugins = []), (this.scenePlugins = []);
},
});
t.exports = c;
},
function (t, e, i) {
var u = i(201),
n = i(0),
s = i(9),
r = i(104),
o = i(22),
a = i(401),
h = i(407),
c = i(402),
l = i(1),
d = i(10),
f = i(416),
p = i(76),
g = i(3),
v = new n({
Extends: s,
initialize: function (t) {
s.call(this),
(this.game = t),
this.canvas,
(this.canvasBounds = new d()),
(this.parent = null),
(this.parentIsWindow = !1),
(this.parentSize = new f()),
(this.gameSize = new f()),
(this.baseSize = new f()),
(this.displaySize = new f()),
(this.scaleMode = u.SCALE_MODE.NONE),
(this.zoom = 1),
(this._resetZoom = !1),
(this.displayScale = new g(1, 1)),
(this.autoRound = !1),
(this.autoCenter = u.CENTER.NO_CENTER),
(this.orientation = u.ORIENTATION.LANDSCAPE),
this.fullscreen,
(this.fullscreenTarget = null),
(this._createdFullscreenTarget = !1),
(this.dirty = !1),
(this.resizeInterval = 500),
(this._lastCheck = 0),
(this._checkOrientation = !1),
(this.listeners = { orientationChange: l, windowResize: l, fullScreenChange: l, fullScreenError: l });
},
preBoot: function () {
this.parseConfig(this.game.config), this.game.events.once(o.BOOT, this.boot, this);
},
boot: function () {
var t = this.game;
(this.canvas = t.canvas),
(this.fullscreen = t.device.fullscreen),
this.scaleMode !== u.SCALE_MODE.RESIZE && this.displaySize.setAspectMode(this.scaleMode),
this.scaleMode === u.SCALE_MODE.NONE
? this.resize(this.width, this.height)
: (this.getParentBounds(), 0 < this.parentSize.width && 0 < this.parentSize.height && this.displaySize.setParent(this.parentSize), this.refresh()),
t.events.on(o.PRE_STEP, this.step, this),
t.events.once(o.READY, this.refresh, this),
t.events.once(o.DESTROY, this.destroy, this),
this.startListeners();
},
parseConfig: function (t) {
this.getParent(t), this.getParentBounds();
var e,
i,
n,
s,
r = t.width,
o = t.height,
a = t.scaleMode,
h = t.zoom,
l = t.autoRound;
"string" == typeof r && (0 === (e = this.parentSize.width) && (e = window.innerWidth), (i = parseInt(r, 10) / 100), (r = Math.floor(e * i))),
"string" == typeof o && (0 === (n = this.parentSize.height) && (n = window.innerHeight), (s = parseInt(o, 10) / 100), (o = Math.floor(n * s))),
(this.scaleMode = a),
(this.autoRound = l),
(this.autoCenter = t.autoCenter),
(this.resizeInterval = t.resizeInterval),
l && ((r = Math.floor(r)), (o = Math.floor(o))),
this.gameSize.setSize(r, o),
h === u.ZOOM.MAX_ZOOM && (h = this.getMaxZoom()),
1 !== (this.zoom = h) && (this._resetZoom = !0),
this.baseSize.setSize(r, o),
l && ((this.baseSize.width = Math.floor(this.baseSize.width)), (this.baseSize.height = Math.floor(this.baseSize.height))),
0 < t.minWidth && this.displaySize.setMin(t.minWidth * h, t.minHeight * h),
0 < t.maxWidth && this.displaySize.setMax(t.maxWidth * h, t.maxHeight * h),
this.displaySize.setSize(r, o),
(this.orientation = c(r, o));
},
getParent: function (t) {
var e,
i = t.parent;
null !== i &&
((this.parent = h(i)),
(this.parentIsWindow = this.parent === document.body),
t.expandParent &&
t.scaleMode !== u.SCALE_MODE.NONE &&
((e = this.parent.getBoundingClientRect()),
(!this.parentIsWindow && 0 !== e.height) ||
((document.documentElement.style.height = "100%"),
(document.body.style.height = "100%"),
(e = this.parent.getBoundingClientRect()),
this.parentIsWindow || 0 !== e.height || ((this.parent.style.overflow = "hidden"), (this.parent.style.width = "100%"), (this.parent.style.height = "100%")))),
t.fullscreenTarget && !this.fullscreenTarget && (this.fullscreenTarget = h(t.fullscreenTarget)));
},
getParentBounds: function () {
if (!this.parent) return !1;
var t = this.parentSize,
e = this.parent.getBoundingClientRect();
this.parentIsWindow && this.game.device.os.iOS && (e.height = a(!0));
var i = e.width,
n = e.height;
return (t.width !== i || t.height !== n) && (t.setSize(i, n), !0);
},
lockOrientation: function (t) {
var e = screen.lockOrientation || screen.mozLockOrientation || screen.msLockOrientation;
return !!e && e.call(screen, t);
},
setParentSize: function (t, e) {
return this.parentSize.setSize(t, e), this.refresh();
},
setGameSize: function (t, e) {
var i = this.autoRound;
i && ((t = Math.floor(t)), (e = Math.floor(e)));
var n = this.width,
s = this.height;
return (
this.gameSize.resize(t, e),
this.baseSize.resize(t, e),
i && ((this.baseSize.width = Math.floor(this.baseSize.width)), (this.baseSize.height = Math.floor(this.baseSize.height))),
this.displaySize.setAspectRatio(t / e),
(this.canvas.width = this.baseSize.width),
(this.canvas.height = this.baseSize.height),
this.refresh(n, s)
);
},
resize: function (t, e) {
var i = this.zoom,
n = this.autoRound;
n && ((t = Math.floor(t)), (e = Math.floor(e)));
var s = this.width,
r = this.height;
this.gameSize.resize(t, e),
this.baseSize.resize(t, e),
n && ((this.baseSize.width = Math.floor(this.baseSize.width)), (this.baseSize.height = Math.floor(this.baseSize.height))),
this.displaySize.setSize(t * i, e * i),
(this.canvas.width = this.baseSize.width),
(this.canvas.height = this.baseSize.height);
var o = this.canvas.style,
a = t * i,
h = e * i;
return n && ((a = Math.floor(a)), (h = Math.floor(h))), (a === t && h === e) || ((o.width = a + "px"), (o.height = h + "px")), this.refresh(s, r);
},
setZoom: function (t) {
return (this.zoom = t), (this._resetZoom = !0), this.refresh();
},
setMaxZoom: function () {
return (this.zoom = this.getMaxZoom()), (this._resetZoom = !0), this.refresh();
},
refresh: function (t, e) {
void 0 === t && (t = this.width),
void 0 === e && (e = this.height),
this.updateScale(),
this.updateBounds(),
this.updateOrientation(),
this.displayScale.set(this.baseSize.width / this.canvasBounds.width, this.baseSize.height / this.canvasBounds.height);
var i,
n,
s = this.game.domContainer;
return (
s &&
(this.baseSize.setCSS(s),
(i = this.canvas.style),
((n = s.style).transform = "scale(" + this.displaySize.width / this.baseSize.width + "," + this.displaySize.height / this.baseSize.height + ")"),
(n.marginLeft = i.marginLeft),
(n.marginTop = i.marginTop)),
this.emit(r.RESIZE, this.gameSize, this.baseSize, this.displaySize, t, e),
this
);
},
updateOrientation: function () {
var t;
this._checkOrientation && ((this._checkOrientation = !1), (t = c(this.width, this.height)) !== this.orientation && ((this.orientation = t), this.emit(r.ORIENTATION_CHANGE, t)));
},
updateScale: function () {
var t,
e,
i = this.canvas.style,
n = this.gameSize.width,
s = this.gameSize.height,
r = this.zoom,
o = this.autoRound;
this.scaleMode === u.SCALE_MODE.NONE
? (this.displaySize.setSize(n * r, s * r),
(t = this.displaySize.width),
(e = this.displaySize.height),
o && ((t = Math.floor(t)), (e = Math.floor(e))),
this._resetZoom && ((i.width = t + "px"), (i.height = e + "px"), (this._resetZoom = !1)))
: this.scaleMode === u.SCALE_MODE.RESIZE
? (this.displaySize.setSize(this.parentSize.width, this.parentSize.height),
this.gameSize.setSize(this.displaySize.width, this.displaySize.height),
this.baseSize.setSize(this.displaySize.width, this.displaySize.height),
(t = this.displaySize.width),
(e = this.displaySize.height),
o && ((t = Math.floor(t)), (e = Math.floor(e))),
(this.canvas.width = t),
(this.canvas.height = e))
: (this.displaySize.setSize(this.parentSize.width, this.parentSize.height),
(t = this.displaySize.width),
(e = this.displaySize.height),
o && ((t = Math.floor(t)), (e = Math.floor(e))),
(i.width = t + "px"),
(i.height = e + "px")),
this.getParentBounds(),
this.updateCenter();
},
getMaxZoom: function () {
var t = p(this.parentSize.width, this.gameSize.width, 0, !0),
e = p(this.parentSize.height, this.gameSize.height, 0, !0);
return Math.max(Math.min(t, e), 1);
},
updateCenter: function () {
var t,
e,
i,
n,
s,
r,
o,
a = this.autoCenter;
a !== u.CENTER.NO_CENTER &&
((e = (t = this.canvas).style),
(n = (i = t.getBoundingClientRect()).width),
(s = i.height),
(r = Math.floor((this.parentSize.width - n) / 2)),
(o = Math.floor((this.parentSize.height - s) / 2)),
a === u.CENTER.CENTER_HORIZONTALLY ? (o = 0) : a === u.CENTER.CENTER_VERTICALLY && (r = 0),
(e.marginLeft = r + "px"),
(e.marginTop = o + "px"));
},
updateBounds: function () {
var t = this.canvasBounds,
e = this.canvas.getBoundingClientRect();
(t.x = e.left + (window.pageXOffset || 0) - (document.documentElement.clientLeft || 0)),
(t.y = e.top + (window.pageYOffset || 0) - (document.documentElement.clientTop || 0)),
(t.width = e.width),
(t.height = e.height);
},
transformX: function (t) {
return (t - this.canvasBounds.left) * this.displayScale.x;
},
transformY: function (t) {
return (t - this.canvasBounds.top) * this.displayScale.y;
},
startFullscreen: function (t) {
void 0 === t && (t = { navigationUI: "hide" });
var e,
i = this.fullscreen;
i.available ? i.active || ((e = this.getFullscreenTarget()), i.keyboard ? e[i.request](Element.ALLOW_KEYBOARD_INPUT) : e[i.request](t)) : this.emit(r.FULLSCREEN_UNSUPPORTED);
},
fullscreenSuccessHandler: function () {
this.getParentBounds(), this.refresh(), this.emit(r.ENTER_FULLSCREEN);
},
fullscreenErrorHandler: function (t) {
this.removeFullscreenTarget(), this.emit(r.FULLSCREEN_FAILED, t);
},
getFullscreenTarget: function () {
var t;
return (
this.fullscreenTarget ||
(((t = document.createElement("div")).style.margin = "0"),
(t.style.padding = "0"),
(t.style.width = "100%"),
(t.style.height = "100%"),
(this.fullscreenTarget = t),
(this._createdFullscreenTarget = !0)),
this._createdFullscreenTarget && (this.canvas.parentNode.insertBefore(this.fullscreenTarget, this.canvas), this.fullscreenTarget.appendChild(this.canvas)),
this.fullscreenTarget
);
},
removeFullscreenTarget: function () {
var t, e;
!this._createdFullscreenTarget || ((t = this.fullscreenTarget) && t.parentNode && ((e = t.parentNode).insertBefore(this.canvas, t), e.removeChild(t)));
},
stopFullscreen: function () {
var t = this.fullscreen;
if (!t.available) return this.emit(r.FULLSCREEN_UNSUPPORTED), !1;
t.active && document[t.cancel](), this.removeFullscreenTarget(), this.getParentBounds(), this.emit(r.LEAVE_FULLSCREEN), this.refresh();
},
toggleFullscreen: function (t) {
this.fullscreen.active ? this.stopFullscreen() : this.startFullscreen(t);
},
startListeners: function () {
var e = this,
i = this.listeners;
(i.orientationChange = function () {
e.updateBounds(), (e._checkOrientation = !0), (e.dirty = !0);
}),
(i.windowResize = function () {
e.updateBounds(), (e.dirty = !0);
}),
window.addEventListener("orientationchange", i.orientationChange, !1),
window.addEventListener("resize", i.windowResize, !1),
this.fullscreen.available &&
((i.fullScreenChange = function (t) {
return e.onFullScreenChange(t);
}),
(i.fullScreenError = function (t) {
return e.onFullScreenError(t);
}),
["webkit", "moz", ""].forEach(function (t) {
document.addEventListener(t + "fullscreenchange", i.fullScreenChange, !1), document.addEventListener(t + "fullscreenerror", i.fullScreenError, !1);
}),
document.addEventListener("MSFullscreenChange", i.fullScreenChange, !1),
document.addEventListener("MSFullscreenError", i.fullScreenError, !1));
},
onFullScreenChange: function () {
document.fullscreenElement || document.webkitFullscreenElement || document.msFullscreenElement || document.mozFullScreenElement ? this.fullscreenSuccessHandler() : this.stopFullscreen();
},
onFullScreenError: function () {
this.removeFullscreenTarget();
},
step: function (t, e) {
this.parent && ((this._lastCheck += e), (this.dirty || this._lastCheck > this.resizeInterval) && (this.getParentBounds() && this.refresh(), (this.dirty = !1), (this._lastCheck = 0)));
},
stopListeners: function () {
var e = this.listeners;
window.removeEventListener("orientationchange", e.orientationChange, !1),
window.removeEventListener("resize", e.windowResize, !1),
["webkit", "moz", ""].forEach(function (t) {
document.removeEventListener(t + "fullscreenchange", e.fullScreenChange, !1), document.removeEventListener(t + "fullscreenerror", e.fullScreenError, !1);
}),
document.removeEventListener("MSFullscreenChange", e.fullScreenChange, !1),
document.removeEventListener("MSFullscreenError", e.fullScreenError, !1);
},
destroy: function () {
this.removeAllListeners(),
this.stopListeners(),
(this.game = null),
(this.canvas = null),
(this.canvasBounds = null),
(this.parent = null),
(this.fullscreenTarget = null),
this.parentSize.destroy(),
this.gameSize.destroy(),
this.baseSize.destroy(),
this.displaySize.destroy();
},
isFullscreen: {
get: function () {
return this.fullscreen.active;
},
},
width: {
get: function () {
return this.gameSize.width;
},
},
height: {
get: function () {
return this.gameSize.height;
},
},
isPortrait: {
get: function () {
return this.orientation === u.ORIENTATION.PORTRAIT;
},
},
isLandscape: {
get: function () {
return this.orientation === u.ORIENTATION.LANDSCAPE;
},
},
isGamePortrait: {
get: function () {
return this.height > this.width;
},
},
isGameLandscape: {
get: function () {
return this.width > this.height;
},
},
});
t.exports = v;
},
function (t, e, i) {
var n = i(18),
s = i(0),
r = i(76),
o = i(3),
a = new s({
initialize: function (t, e, i, n) {
void 0 === t && (t = 0),
void 0 === e && (e = t),
void 0 === i && (i = 0),
void 0 === n && (n = null),
(this._width = t),
(this._height = e),
(this._parent = n),
(this.aspectMode = i),
(this.aspectRatio = 0 === e ? 1 : t / e),
(this.minWidth = 0),
(this.minHeight = 0),
(this.maxWidth = Number.MAX_VALUE),
(this.maxHeight = Number.MAX_VALUE),
(this.snapTo = new o());
},
setAspectMode: function (t) {
return void 0 === t && (t = 0), (this.aspectMode = t), this.setSize(this._width, this._height);
},
setSnap: function (t, e) {
return void 0 === t && (t = 0), void 0 === e && (e = t), this.snapTo.set(t, e), this.setSize(this._width, this._height);
},
setParent: function (t) {
return (this._parent = t), this.setSize(this._width, this._height);
},
setMin: function (t, e) {
return void 0 === t && (t = 0), void 0 === e && (e = t), (this.minWidth = n(t, 0, this.maxWidth)), (this.minHeight = n(e, 0, this.maxHeight)), this.setSize(this._width, this._height);
},
setMax: function (t, e) {
return (
void 0 === t && (t = Number.MAX_VALUE),
void 0 === e && (e = t),
(this.maxWidth = n(t, this.minWidth, Number.MAX_VALUE)),
(this.maxHeight = n(e, this.minHeight, Number.MAX_VALUE)),
this.setSize(this._width, this._height)
);
},
setSize: function (t, e) {
switch ((void 0 === t && (t = 0), void 0 === e && (e = t), this.aspectMode)) {
case a.NONE:
(this._width = this.getNewWidth(r(t, this.snapTo.x))), (this._height = this.getNewHeight(r(e, this.snapTo.y))), (this.aspectRatio = 0 === this._height ? 1 : this._width / this._height);
break;
case a.WIDTH_CONTROLS_HEIGHT:
(this._width = this.getNewWidth(r(t, this.snapTo.x))), (this._height = this.getNewHeight(this._width * (1 / this.aspectRatio), !1));
break;
case a.HEIGHT_CONTROLS_WIDTH:
(this._height = this.getNewHeight(r(e, this.snapTo.y))), (this._width = this.getNewWidth(this._height * this.aspectRatio, !1));
break;
case a.FIT:
this.constrain(t, e, !0);
break;
case a.ENVELOP:
this.constrain(t, e, !1);
}
return this;
},
setAspectRatio: function (t) {
return (this.aspectRatio = t), this.setSize(this._width, this._height);
},
resize: function (t, e) {
return (this._width = this.getNewWidth(r(t, this.snapTo.x))), (this._height = this.getNewHeight(r(e, this.snapTo.y))), (this.aspectRatio = 0 === this._height ? 1 : this._width / this._height), this;
},
getNewWidth: function (t, e) {
return void 0 === e && (e = !0), (t = n(t, this.minWidth, this.maxWidth)), e && this._parent && t > this._parent.width && (t = Math.max(this.minWidth, this._parent.width)), t;
},
getNewHeight: function (t, e) {
return void 0 === e && (e = !0), (t = n(t, this.minHeight, this.maxHeight)), e && this._parent && t > this._parent.height && (t = Math.max(this.minHeight, this._parent.height)), t;
},
constrain: function (t, e, i) {
void 0 === t && (t = 0), void 0 === e && (e = t), void 0 === i && (i = !0), (t = this.getNewWidth(t)), (e = this.getNewHeight(e));
var n = this.snapTo,
s = 0 === e ? 1 : t / e;
return (
(i && this.aspectRatio > s) || (!i && this.aspectRatio < s)
? ((e = (t = r(t, n.x)) / this.aspectRatio), 0 < n.y && (t = (e = r(e, n.y)) * this.aspectRatio))
: ((i && this.aspectRatio < s) || (!i && this.aspectRatio > s)) && ((t = (e = r(e, n.y)) * this.aspectRatio), 0 < n.x && (e = (t = r(t, n.x)) * (1 / this.aspectRatio))),
(this._width = t),
(this._height = e),
this
);
},
fitTo: function (t, e) {
return this.constrain(t, e, !0);
},
envelop: function (t, e) {
return this.constrain(t, e, !1);
},
setWidth: function (t) {
return this.setSize(t, this._height);
},
setHeight: function (t) {
return this.setSize(this._width, t);
},
toString: function () {
return "[{ Size (width=" + this._width + " height=" + this._height + " aspectRatio=" + this.aspectRatio + " aspectMode=" + this.aspectMode + ") }]";
},
setCSS: function (t) {
t && t.style && ((t.style.width = this._width + "px"), (t.style.height = this._height + "px"));
},
copy: function (t) {
return t.setAspectMode(this.aspectMode), (t.aspectRatio = this.aspectRatio), t.setSize(this.width, this.height);
},
destroy: function () {
(this._parent = null), (this.snapTo = null);
},
width: {
get: function () {
return this._width;
},
set: function (t) {
this.setSize(t, this._height);
},
},
height: {
get: function () {
return this._height;
},
set: function (t) {
this.setSize(this._width, t);
},
},
});
(a.NONE = 0), (a.WIDTH_CONTROLS_HEIGHT = 1), (a.HEIGHT_CONTROLS_WIDTH = 2), (a.FIT = 3), (a.ENVELOP = 4), (t.exports = a);
},
function (t, e, i) {
var n = i(0),
r = i(144),
s = i(20),
o = i(22),
l = i(6),
a = i(95),
h = i(1),
u = i(418),
c = i(204),
d = new n({
initialize: function (t, e) {
if (
((this.game = t),
(this.keys = {}),
(this.scenes = []),
(this._pending = []),
(this._start = []),
(this._queue = []),
(this._data = {}),
(this.isProcessing = !1),
(this.isBooted = !1),
(this.customViewports = 0),
e)
) {
Array.isArray(e) || (e = [e]);
for (var i = 0; i < e.length; i++) this._pending.push({ key: "default", scene: e[i], autoStart: 0 === i, data: {} });
}
t.events.once(o.READY, this.bootQueue, this);
},
bootQueue: function () {
if (!this.isBooted) {
for (var t = 0; t < this._pending.length; t++) {
var e,
i,
n,
s = (i = this._pending[t]).key;
(n = i.scene) instanceof u
? (e = this.createSceneFromInstance(s, n))
: "object" == typeof n
? (e = this.createSceneFromObject(s, n))
: "function" == typeof n && (e = this.createSceneFromFunction(s, n)),
(s = e.sys.settings.key),
(this.keys[s] = e),
this.scenes.push(e),
this._data[s] && ((e.sys.settings.data = this._data[s].data), this._data[s].autoStart && (i.autoStart = !0)),
(i.autoStart || e.sys.settings.active) && this._start.push(s);
}
for (this._pending.length = 0, this._data = {}, this.isBooted = !0, t = 0; t < this._start.length; t++) (i = this._start[t]), this.start(i);
this._start.length = 0;
}
},
processQueue: function () {
var t,
e,
i = this._pending.length,
n = this._queue.length;
if (0 !== i || 0 !== n) {
if (i) {
for (t = 0; t < i; t++) (e = this._pending[t]), this.add(e.key, e.scene, e.autoStart, e.data);
for (t = 0; t < this._start.length; t++) (e = this._start[t]), this.start(e);
return (this._start.length = 0), void (this._pending.length = 0);
}
for (t = 0; t < this._queue.length; t++) this[(e = this._queue[t]).op](e.keyA, e.keyB);
this._queue.length = 0;
}
},
add: function (t, e, i, n) {
return (
void 0 === i && (i = !1),
void 0 === n && (n = {}),
this.isProcessing || !this.isBooted
? (this._pending.push({ key: t, scene: e, autoStart: i, data: n }), this.isBooted || (this._data[t] = { data: n }), null)
: ((t = this.getKey(t, e)),
e instanceof u
? (s = this.createSceneFromInstance(t, e))
: "object" == typeof e
? ((e.key = t), (s = this.createSceneFromObject(t, e)))
: "function" == typeof e && (s = this.createSceneFromFunction(t, e)),
(s.sys.settings.data = n),
(t = s.sys.settings.key),
(this.keys[t] = s),
this.scenes.push(s),
(i || s.sys.settings.active) && (this._pending.length ? this._start.push(t) : this.start(t)),
s)
);
var s;
},
remove: function (t) {
if (this.isProcessing) this._queue.push({ op: "remove", keyA: t, keyB: null });
else {
var e = this.getScene(t);
if (!e || e.sys.isTransitioning()) return this;
var i = this.scenes.indexOf(e),
n = e.sys.settings.key;
-1 < i && (delete this.keys[n], this.scenes.splice(i, 1), -1 < this._start.indexOf(n) && ((i = this._start.indexOf(n)), this._start.splice(i, 1)), e.sys.destroy());
}
return this;
},
bootScene: function (t) {
var e,
i = t.sys,
n = i.settings;
(i.sceneUpdate = h),
t.init && (t.init.call(t, n.data), (n.status = r.INIT), n.isTransition && i.events.emit(s.TRANSITION_INIT, n.transitionFrom, n.transitionDuration)),
i.load && (e = i.load).reset(),
e && t.preload ? (t.preload.call(t), 0 === e.list.size ? this.create(t) : ((n.status = r.LOADING), e.once(a.COMPLETE, this.loadComplete, this), e.start())) : this.create(t);
},
loadComplete: function (t) {
this.create(t.scene);
},
payloadComplete: function (t) {
this.bootScene(t.scene);
},
update: function (t, e) {
this.processQueue(), (this.isProcessing = !0);
for (var i = this.scenes.length - 1; 0 <= i; i--) {
var n = this.scenes[i].sys;
n.settings.status > r.START && n.settings.status <= r.RUNNING && n.step(t, e);
}
},
render: function (t) {
for (var e = 0; e < this.scenes.length; e++) {
var i = this.scenes[e].sys;
i.settings.visible && i.settings.status >= r.LOADING && i.settings.status < r.SLEEPING && i.render(t);
}
this.isProcessing = !1;
},
create: function (t) {
var e = t.sys,
i = e.settings;
(t.create && ((i.status = r.CREATING), t.create.call(t, i.data), i.status === r.DESTROYED)) ||
(i.isTransition && e.events.emit(s.TRANSITION_START, i.transitionFrom, i.transitionDuration), t.update && (e.sceneUpdate = t.update), (i.status = r.RUNNING), e.events.emit(s.CREATE, t));
},
createSceneFromFunction: function (t, e) {
var i = new e();
if (i instanceof u) {
var n = i.sys.settings.key;
if (("" !== n && (t = n), this.keys.hasOwnProperty(t))) throw new Error("Cannot add a Scene with duplicate key: " + t);
return this.createSceneFromInstance(t, i);
}
return (i.sys = new c(i)), (i.sys.settings.key = t), i.sys.init(this.game), i;
},
createSceneFromInstance: function (t, e) {
return "" === e.sys.settings.key && (e.sys.settings.key = t), e.sys.init(this.game), e;
},
createSceneFromObject: function (t, e) {
var i = new u(e),
n = i.sys.settings.key;
"" !== n ? (t = n) : (i.sys.settings.key = t), i.sys.init(this.game);
for (var s, r = ["init", "preload", "create", "update", "render"], o = 0; o < r.length; o++) {
var a = l(e, r[o], null);
a && (i[r[o]] = a);
}
if (e.hasOwnProperty("extend"))
for (var h in e.extend) e.extend.hasOwnProperty(h) && ((s = e.extend[h]), "data" === h && i.hasOwnProperty("data") && "object" == typeof s ? i.data.merge(s) : "sys" !== h && (i[h] = s));
return i;
},
getKey: function (t, e) {
if (((t = t || "default"), "function" == typeof e)) return t;
if ((e instanceof u ? (t = e.sys.settings.key) : "object" == typeof e && e.hasOwnProperty("key") && (t = e.key), this.keys.hasOwnProperty(t))) throw new Error("Cannot add a Scene with duplicate key: " + t);
return t;
},
getScenes: function (t, e) {
void 0 === t && (t = !0), void 0 === e && (e = !1);
for (var i = [], n = this.scenes, s = 0; s < n.length; s++) {
var r = n[s];
r && (!t || (t && r.sys.isActive())) && i.push(r);
}
return e ? i.reverse() : i;
},
getScene: function (t) {
if ("string" == typeof t) {
if (this.keys[t]) return this.keys[t];
} else for (var e = 0; e < this.scenes.length; e++) if (t === this.scenes[e]) return t;
return null;
},
isActive: function (t) {
var e = this.getScene(t);
return e ? e.sys.isActive() : null;
},
isPaused: function (t) {
var e = this.getScene(t);
return e ? e.sys.isPaused() : null;
},
isVisible: function (t) {
var e = this.getScene(t);
return e ? e.sys.isVisible() : null;
},
isSleeping: function (t) {
var e = this.getScene(t);
return e ? e.sys.isSleeping() : null;
},
pause: function (t, e) {
var i = this.getScene(t);
return i && i.sys.pause(e), this;
},
resume: function (t, e) {
var i = this.getScene(t);
return i && i.sys.resume(e), this;
},
sleep: function (t, e) {
var i = this.getScene(t);
return i && !i.sys.isTransitioning() && i.sys.sleep(e), this;
},
wake: function (t, e) {
var i = this.getScene(t);
return i && i.sys.wake(e), this;
},
run: function (t, e) {
var i = this.getScene(t);
if (!i) {
for (var n = 0; n < this._pending.length; n++)
if (this._pending[n].key === t) {
this.queueOp("start", t, e);
break;
}
return this;
}
i.sys.isSleeping() ? i.sys.wake(e) : i.sys.isPaused() ? i.sys.resume(e) : this.start(t, e);
},
start: function (t, e) {
if (!this.isBooted) return (this._data[t] = { autoStart: !0, data: e }), this;
var i = this.getScene(t);
if (i) {
var n,
s = i.sys;
if (s.isActive() || s.isPaused()) s.shutdown(), (s.sceneUpdate = h), s.start(e);
else if (((s.sceneUpdate = h), s.start(e), s.load && (n = s.load), n && s.settings.hasOwnProperty("pack") && (n.reset(), n.addPack({ payload: s.settings.pack }))))
return (s.settings.status = r.LOADING), n.once(a.COMPLETE, this.payloadComplete, this), n.start(), this;
this.bootScene(i);
}
return this;
},
stop: function (t, e) {
var i = this.getScene(t);
return i && !i.sys.isTransitioning() && i.sys.shutdown(e), this;
},
switch: function (t, e) {
var i = this.getScene(t),
n = this.getScene(e);
return i && n && i !== n && (this.sleep(t), this.isSleeping(e) ? this.wake(e) : this.start(e)), this;
},
getAt: function (t) {
return this.scenes[t];
},
getIndex: function (t) {
var e = this.getScene(t);
return this.scenes.indexOf(e);
},
bringToTop: function (t) {
var e, i;
return (
this.isProcessing
? this._queue.push({ op: "bringToTop", keyA: t, keyB: null })
: -1 !== (e = this.getIndex(t)) && e < this.scenes.length && ((i = this.getScene(t)), this.scenes.splice(e, 1), this.scenes.push(i)),
this
);
},
sendToBack: function (t) {
var e, i;
return (
this.isProcessing ? this._queue.push({ op: "sendToBack", keyA: t, keyB: null }) : -1 !== (e = this.getIndex(t)) && 0 < e && ((i = this.getScene(t)), this.scenes.splice(e, 1), this.scenes.unshift(i)), this
);
},
moveDown: function (t) {
var e, i, n, s;
return (
this.isProcessing
? this._queue.push({ op: "moveDown", keyA: t, keyB: null })
: 0 < (e = this.getIndex(t)) && ((i = e - 1), (n = this.getScene(t)), (s = this.getAt(i)), (this.scenes[e] = s), (this.scenes[i] = n)),
this
);
},
moveUp: function (t) {
var e, i, n, s;
return (
this.isProcessing
? this._queue.push({ op: "moveUp", keyA: t, keyB: null })
: (e = this.getIndex(t)) < this.scenes.length - 1 && ((i = e + 1), (n = this.getScene(t)), (s = this.getAt(i)), (this.scenes[e] = s), (this.scenes[i] = n)),
this
);
},
moveAbove: function (t, e) {
return (
t === e ||
(this.isProcessing
? this._queue.push({ op: "moveAbove", keyA: t, keyB: e })
: ((i = this.getIndex(t)), (n = this.getIndex(e)), -1 !== i && -1 !== n && ((s = this.getAt(n)), this.scenes.splice(n, 1), this.scenes.splice(i + 1, 0, s)))),
this
);
var i, n, s;
},
moveBelow: function (t, e) {
return (
t === e ||
(this.isProcessing
? this._queue.push({ op: "moveBelow", keyA: t, keyB: e })
: ((i = this.getIndex(t)), (n = this.getIndex(e)), -1 !== i && -1 !== n && ((s = this.getAt(n)), this.scenes.splice(n, 1), 0 === i ? this.scenes.unshift(s) : this.scenes.splice(i, 0, s)))),
this
);
var i, n, s;
},
queueOp: function (t, e, i) {
return this._queue.push({ op: t, keyA: e, keyB: i }), this;
},
swapPosition: function (t, e) {
return (
t === e ||
(this.isProcessing
? this._queue.push({ op: "swapPosition", keyA: t, keyB: e })
: (i = this.getIndex(t)) !== (n = this.getIndex(e)) && -1 !== i && -1 !== n && ((s = this.getAt(i)), (this.scenes[i] = this.scenes[n]), (this.scenes[n] = s))),
this
);
var i, n, s;
},
dump: function () {
for (var t = [], e = ["pending", "init", "start", "loading", "creating", "running", "paused", "sleeping", "shutdown", "destroyed"], i = 0; i < this.scenes.length; i++) {
var n = this.scenes[i].sys,
s = !n.settings.visible || (n.settings.status !== r.RUNNING && n.settings.status !== r.PAUSED) ? "[-] " : "[*] ";
(s += n.settings.key + " (" + e[n.settings.status] + ")"), t.push(s);
}
},
destroy: function () {
for (var t = 0; t < this.scenes.length; t++) this.scenes[t].sys.destroy();
(this.update = h), (this.scenes = []), (this._pending = []), (this._start = []), (this._queue = []), (this.game = null);
},
});
t.exports = d;
},
function (t, e, i) {
var n = i(0),
s = i(204),
r = new n({
initialize: function (t) {
(this.sys = new s(this, t)),
this.game,
this.anims,
this.cache,
this.registry,
this.sound,
this.textures,
this.events,
this.cameras,
this.add,
this.make,
this.scene,
this.children,
this.lights,
this.data,
this.input,
this.load,
this.time,
this.tweens,
this.physics,
this.matter,
this.scale,
this.plugins,
this.renderer;
},
update: function () {},
});
t.exports = r;
},
function (t, e, i) {
var r = i(2),
o = i(205);
t.exports = function (t) {
var e = t.game.config.defaultPhysicsSystem,
i = r(t.settings, "physics", !1);
if (e || i) {
var n = [];
if ((e && n.push(o(e + "Physics")), i)) for (var s in i) (s = o(s.concat("Physics"))), -1 === n.indexOf(s) && n.push(s);
return n;
}
};
},
function (t, e, i) {
var n = i(2);
t.exports = function (t) {
var e = t.plugins.getDefaultScenePlugins(),
i = n(t.settings, "plugins", !1);
return Array.isArray(i) ? i : e || [];
};
},
function (t, e, i) {
var n = i(144),
s = i(6),
r = i(127),
o = i(978),
a = {
create: function (t) {
return (
"string" == typeof t ? (t = { key: t }) : void 0 === t && (t = {}),
{
status: n.PENDING,
key: s(t, "key", ""),
active: s(t, "active", !1),
visible: s(t, "visible", !0),
isBooted: !1,
isTransition: !1,
transitionFrom: null,
transitionDuration: 0,
transitionAllowInput: !0,
data: {},
pack: s(t, "pack", !1),
cameras: s(t, "cameras", null),
map: s(t, "map", r(o, s(t, "mapAdd", {}))),
physics: s(t, "physics", {}),
loader: s(t, "loader", {}),
plugins: s(t, "plugins", !1),
input: s(t, "input", {}),
}
);
},
};
t.exports = a;
},
function (t, e, i) {
var h = i(31),
s = i(423),
n = i(0),
l = i(38),
r = i(33),
o = i(9),
u = i(106),
a = i(22),
c = i(388),
d = i(6),
f = i(425),
p = i(206),
g = new n({
Extends: o,
initialize: function (t) {
o.call(this),
(this.game = t),
(this.name = "TextureManager"),
(this.list = {}),
(this._tempCanvas = h.create2D(this, 1, 1)),
(this._tempContext = this._tempCanvas.getContext("2d")),
(this._pending = 0),
t.events.once(a.BOOT, this.boot, this);
},
boot: function () {
(this._pending = 3), this.on(u.LOAD, this.updatePending, this), this.on(u.ERROR, this.updatePending, this);
var t = this.game.config;
this.addBase64("__DEFAULT", t.defaultImage), this.addBase64("__MISSING", t.missingImage), this.addBase64("__WHITE", t.whiteImage), this.game.events.once(a.DESTROY, this.destroy, this);
},
updatePending: function () {
this._pending--, 0 === this._pending && (this.off(u.LOAD), this.off(u.ERROR), this.emit(u.READY));
},
checkKey: function (t) {
return !this.exists(t) || !1;
},
remove: function (t) {
if ("string" == typeof t) {
if (!this.exists(t)) return this;
t = this.get(t);
}
return this.list.hasOwnProperty(t.key) && (t.destroy(), this.emit(u.REMOVE, t.key)), this;
},
removeKey: function (t) {
return this.list.hasOwnProperty(t) && delete this.list[t], this;
},
addBase64: function (e, t) {
var i, n;
return (
this.checkKey(e) &&
((i = this),
((n = new Image()).onerror = function () {
i.emit(u.ERROR, e);
}),
(n.onload = function () {
var t = i.create(e, n);
f.Image(t, 0), i.emit(u.ADD, e, t), i.emit(u.LOAD, e, t);
}),
(n.src = t)),
this
);
},
getBase64: function (t, e, i, n) {
void 0 === i && (i = "image/png"), void 0 === n && (n = 0.92);
var s,
r,
o = "",
a = this.getFrame(t, e);
return (
(a && (a.source.isRenderTexture || a.source.isGLTexture)) ||
(a &&
((s = a.canvasData),
(r = h.create2D(this, s.width, s.height)).getContext("2d").drawImage(a.source.image, s.x, s.y, s.width, s.height, 0, 0, s.width, s.height),
(o = r.toDataURL(i, n)),
h.remove(r))),
o
);
},
addImage: function (t, e, i) {
var n = null;
return this.checkKey(t) && ((n = this.create(t, e)), f.Image(n, 0), i && n.setDataSource(i), this.emit(u.ADD, t, n)), n;
},
addGLTexture: function (t, e, i, n) {
var s = null;
return this.checkKey(t) && (void 0 === i && (i = e.width), void 0 === n && (n = e.height), (s = this.create(t, e, i, n)).add("__BASE", 0, 0, 0, i, n), this.emit(u.ADD, t, s)), s;
},
addRenderTexture: function (t, e) {
var i = null;
return this.checkKey(t) && ((i = this.create(t, e)).add("__BASE", 0, 0, 0, e.width, e.height), this.emit(u.ADD, t, i)), i;
},
generate: function (t, e) {
if (this.checkKey(t)) {
var i = h.create(this, 1, 1);
return (e.canvas = i), c(e), this.addCanvas(t, i);
}
return null;
},
createCanvas: function (t, e, i) {
if ((void 0 === e && (e = 256), void 0 === i && (i = 256), this.checkKey(t))) {
var n = h.create(this, e, i, r.CANVAS, !0);
return this.addCanvas(t, n);
}
return null;
},
addCanvas: function (t, e, i) {
void 0 === i && (i = !1);
var n = null;
return i ? (n = new s(this, t, e, e.width, e.height)) : this.checkKey(t) && ((n = new s(this, t, e, e.width, e.height)), (this.list[t] = n), this.emit(u.ADD, t, n)), n;
},
addAtlas: function (t, e, i, n) {
return Array.isArray(i.textures) || Array.isArray(i.frames) ? this.addAtlasJSONArray(t, e, i, n) : this.addAtlasJSONHash(t, e, i, n);
},
addAtlasJSONArray: function (t, e, i, n) {
var s = null;
if (this.checkKey(t)) {
if (((s = this.create(t, e)), Array.isArray(i)))
for (var r = 1 === i.length, o = 0; o < s.source.length; o++) {
var a = r ? i[0] : i[o];
f.JSONArray(s, o, a);
}
else f.JSONArray(s, 0, i);
n && s.setDataSource(n), this.emit(u.ADD, t, s);
}
return s;
},
addAtlasJSONHash: function (t, e, i, n) {
var s = null;
if (this.checkKey(t)) {
if (((s = this.create(t, e)), Array.isArray(i))) for (var r = 0; r < i.length; r++) f.JSONHash(s, r, i[r]);
else f.JSONHash(s, 0, i);
n && s.setDataSource(n), this.emit(u.ADD, t, s);
}
return s;
},
addAtlasXML: function (t, e, i, n) {
var s = null;
return this.checkKey(t) && ((s = this.create(t, e)), f.AtlasXML(s, 0, i), n && s.setDataSource(n), this.emit(u.ADD, t, s)), s;
},
addUnityAtlas: function (t, e, i, n) {
var s = null;
return this.checkKey(t) && ((s = this.create(t, e)), f.UnityYAML(s, 0, i), n && s.setDataSource(n), this.emit(u.ADD, t, s)), s;
},
addSpriteSheet: function (t, e, i) {
var n,
s,
r = null;
return this.checkKey(t) && ((n = (r = this.create(t, e)).source[0].width), (s = r.source[0].height), f.SpriteSheet(r, 0, 0, 0, n, s, i), this.emit(u.ADD, t, r)), r;
},
addSpriteSheetFromAtlas: function (t, e) {
if (!this.checkKey(t)) return null;
var i = d(e, "atlas", null),
n = d(e, "frame", null);
if (i && n) {
var s = this.get(i).get(n);
if (s) {
var r = this.create(t, s.source.image);
return s.trimmed ? f.SpriteSheetFromAtlas(r, s, e) : f.SpriteSheet(r, 0, s.cutX, s.cutY, s.cutWidth, s.cutHeight, e), this.emit(u.ADD, t, r), r;
}
}
},
create: function (t, e, i, n) {
var s = null;
return this.checkKey(t) && ((s = new p(this, t, e, i, n)), (this.list[t] = s)), s;
},
exists: function (t) {
return this.list.hasOwnProperty(t);
},
get: function (t) {
return void 0 === t && (t = "__DEFAULT"), this.list[t] ? this.list[t] : t instanceof p ? t : this.list.__MISSING;
},
cloneFrame: function (t, e) {
if (this.list[t]) return this.list[t].get(e).clone();
},
getFrame: function (t, e) {
if (this.list[t]) return this.list[t].get(e);
},
getTextureKeys: function () {
var t = [];
for (var e in this.list) "__DEFAULT" !== e && "__MISSING" !== e && t.push(e);
return t;
},
getPixel: function (t, e, i, n) {
var s = this.getFrame(i, n);
if (s) {
(t -= s.x), (e -= s.y);
var r = s.data.cut;
if (((t += r.x), (e += r.y), t >= r.x && t < r.r && e >= r.y && e < r.b)) {
var o = this._tempContext;
o.clearRect(0, 0, 1, 1), o.drawImage(s.source.image, t, e, 1, 1, 0, 0, 1, 1);
var a = o.getImageData(0, 0, 1, 1);
return new l(a.data[0], a.data[1], a.data[2], a.data[3]);
}
}
return null;
},
getPixelAlpha: function (t, e, i, n) {
var s = this.getFrame(i, n);
if (s) {
(t -= s.x), (e -= s.y);
var r = s.data.cut;
if (((t += r.x), (e += r.y), t >= r.x && t < r.r && e >= r.y && e < r.b)) {
var o = this._tempContext;
return o.clearRect(0, 0, 1, 1), o.drawImage(s.source.image, t, e, 1, 1, 0, 0, 1, 1), o.getImageData(0, 0, 1, 1).data[3];
}
}
return null;
},
setTexture: function (t, e, i) {
return this.list[e] && ((t.texture = this.list[e]), (t.frame = t.texture.get(i))), t;
},
renameTexture: function (t, e) {
var i = this.get(t);
return !(!i || t === e || ((i.key = e), (this.list[e] = i), delete this.list[t], 0));
},
each: function (t, e) {
for (var i = [null], n = 1; n < arguments.length; n++) i.push(arguments[n]);
for (var s in this.list) (i[0] = this.list[s]), t.apply(e, i);
},
destroy: function () {
for (var t in this.list) this.list[t].destroy();
(this.list = {}), (this.game = null), h.remove(this._tempCanvas);
},
});
t.exports = g;
},
function (t, e, i) {
var n = i(0),
f = i(18),
p = i(38),
s = i(33),
r = i(138),
o = i(206),
a = new n({
Extends: o,
initialize: function (t, e, i, n, s) {
o.call(this, t, e, i, n, s),
this.add("__BASE", 0, 0, 0, n, s),
(this._source = this.frames.__BASE.source),
(this.canvas = this._source.image),
(this.context = this.canvas.getContext("2d")),
(this.width = n),
(this.height = s),
(this.imageData = this.context.getImageData(0, 0, n, s)),
(this.data = null),
this.imageData && (this.data = this.imageData.data),
(this.pixels = null),
this.buffer,
this.data &&
(this.imageData.data.buffer
? ((this.buffer = this.imageData.data.buffer), (this.pixels = new Uint32Array(this.buffer)))
: window.ArrayBuffer
? ((this.buffer = new ArrayBuffer(this.imageData.data.length)), (this.pixels = new Uint32Array(this.buffer)))
: (this.pixels = this.imageData.data));
},
update: function () {
return (
(this.imageData = this.context.getImageData(0, 0, this.width, this.height)),
(this.data = this.imageData.data),
this.imageData.data.buffer
? ((this.buffer = this.imageData.data.buffer), (this.pixels = new Uint32Array(this.buffer)))
: window.ArrayBuffer
? ((this.buffer = new ArrayBuffer(this.imageData.data.length)), (this.pixels = new Uint32Array(this.buffer)))
: (this.pixels = this.imageData.data),
this.manager.game.config.renderType === s.WEBGL && this.refresh(),
this
);
},
draw: function (t, e, i) {
return this.context.drawImage(i, t, e), this.update();
},
drawFrame: function (t, e, i, n) {
void 0 === i && (i = 0), void 0 === n && (n = 0);
var s = this.manager.getFrame(t, e);
if (s) {
var r = s.canvasData,
o = s.cutWidth,
a = s.cutHeight,
h = s.source.resolution;
return this.context.drawImage(s.source.image, r.x, r.y, o, a, i, n, o / h, a / h), this.update();
}
return this;
},
setPixel: function (t, e, i, n, s, r) {
var o;
return (
void 0 === r && (r = 255),
(t = Math.abs(Math.floor(t))),
(e = Math.abs(Math.floor(e))),
-1 < this.getIndex(t, e) && (((o = this.context.getImageData(t, e, 1, 1)).data[0] = i), (o.data[1] = n), (o.data[2] = s), (o.data[3] = r), this.context.putImageData(o, t, e)),
this
);
},
putData: function (t, e, i, n, s, r, o) {
return void 0 === n && (n = 0), void 0 === s && (s = 0), void 0 === r && (r = t.width), void 0 === o && (o = t.height), this.context.putImageData(t, e, i, n, s, r, o), this;
},
getData: function (t, e, i, n) {
return (t = f(Math.floor(t), 0, this.width - 1)), (e = f(Math.floor(e), 0, this.height - 1)), (i = f(i, 1, this.width - t)), (n = f(n, 1, this.height - e)), this.context.getImageData(t, e, i, n);
},
getPixel: function (t, e, i) {
i = i || new p();
var n,
s,
r,
o,
a,
h = this.getIndex(t, e);
return -1 < h && ((s = (n = this.data)[h + 0]), (r = n[h + 1]), (o = n[h + 2]), (a = n[h + 3]), i.setTo(s, r, o, a)), i;
},
getPixels: function (t, e, i, n) {
void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = this.width), void 0 === n && (n = i), (t = Math.abs(Math.round(t))), (e = Math.abs(Math.round(e)));
for (var s = f(t, 0, this.width), r = f(t + i, 0, this.width), o = f(e, 0, this.height), a = f(e + n, 0, this.height), h = new p(), l = [], u = o; u < a; u++) {
for (var c = [], d = s; d < r; d++) (h = this.getPixel(d, u, h)), c.push({ x: d, y: u, color: h.color, alpha: h.alphaGL });
l.push(c);
}
return l;
},
getIndex: function (t, e) {
return (t = Math.abs(Math.round(t))), (e = Math.abs(Math.round(e))), t < this.width && e < this.height ? 4 * (t + e * this.width) : -1;
},
refresh: function () {
return this._source.update(), this;
},
getCanvas: function () {
return this.canvas;
},
getContext: function () {
return this.context;
},
clear: function (t, e, i, n) {
return void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = this.width), void 0 === n && (n = this.height), this.context.clearRect(t, e, i, n), this.update();
},
setSize: function (t, e) {
return (
void 0 === e && (e = t),
(t === this.width && e === this.height) ||
((this.canvas.width = t),
(this.canvas.height = e),
(this._source.width = t),
(this._source.height = e),
(this._source.isPowerOf2 = r(t, e)),
this.frames.__BASE.setSize(t, e, 0, 0),
(this.width = t),
(this.height = e),
this.refresh()),
this
);
},
destroy: function () {
o.prototype.destroy.call(this), (this._source = null), (this.canvas = null), (this.context = null), (this.imageData = null), (this.data = null), (this.pixels = null), (this.buffer = null);
},
});
t.exports = a;
},
function (t, e, i) {
var n = i(31),
s = i(0),
o = i(138),
a = i(168),
r = new s({
initialize: function (t, e, i, n, s) {
void 0 === s && (s = !1);
var r = t.manager.game;
(this.renderer = r.renderer),
(this.texture = t),
(this.source = e),
(this.image = e),
(this.compressionAlgorithm = null),
(this.resolution = 1),
(this.width = i || e.naturalWidth || e.videoWidth || e.width || 0),
(this.height = n || e.naturalHeight || e.videoHeight || e.height || 0),
(this.scaleMode = a.DEFAULT),
(this.isCanvas = e instanceof HTMLCanvasElement),
(this.isVideo = window.hasOwnProperty("HTMLVideoElement") && e instanceof HTMLVideoElement),
(this.isRenderTexture = "RenderTexture" === e.type),
(this.isGLTexture = window.hasOwnProperty("WebGLTexture") && e instanceof WebGLTexture),
(this.isPowerOf2 = o(this.width, this.height)),
(this.glTexture = null),
(this.glIndex = 0),
(this.glIndexCounter = -1),
(this.flipY = s),
this.init(r);
},
init: function (t) {
var e = this.renderer;
e &&
(e.gl
? this.isCanvas
? (this.glTexture = e.createCanvasTexture(this.image, !1, this.flipY))
: this.isVideo
? (this.glTexture = e.createVideoTexture(this.image, !1, this.flipY))
: this.isRenderTexture
? ((this.image = this.source.canvas), (this.glTexture = e.createTextureFromSource(null, this.width, this.height, this.scaleMode)))
: this.isGLTexture
? (this.glTexture = this.source)
: (this.glTexture = e.createTextureFromSource(this.image, this.width, this.height, this.scaleMode))
: this.isRenderTexture && (this.image = this.source.canvas)),
t.config.antialias || this.setFilter(1);
},
setFilter: function (t) {
this.renderer.gl && this.renderer.setTextureFilter(this.glTexture, t), (this.scaleMode = t);
},
setFlipY: function (t) {
return void 0 === t && (t = !0), (this.flipY = t), this;
},
update: function () {
var t = this.renderer.gl;
t && this.isCanvas
? (this.glTexture = this.renderer.updateCanvasTexture(this.image, this.glTexture, this.flipY))
: t && this.isVideo && (this.glTexture = this.renderer.updateVideoTexture(this.image, this.glTexture, this.flipY));
},
destroy: function () {
this.glTexture && this.renderer.deleteTexture(this.glTexture, !0),
this.isCanvas && n.remove(this.image),
(this.renderer = null),
(this.texture = null),
(this.source = null),
(this.image = null),
(this.glTexture = null);
},
});
t.exports = r;
},
function (t, e, i) {
t.exports = { AtlasXML: i(979), Canvas: i(980), Image: i(981), JSONArray: i(982), JSONHash: i(983), SpriteSheet: i(984), SpriteSheetFromAtlas: i(985), UnityYAML: i(986) };
},
function (t, e, i) {
var n = i(427),
s = i(430),
r = i(432),
o = {
create: function (t) {
var e = t.config.audio,
i = t.device.audio;
return new (e.noAudio || (!i.webAudio && !i.audioData) ? s : i.webAudio && !e.disableWebAudio ? r : n)(t);
},
};
t.exports = o;
},
function (t, e, i) {
var n = i(145),
s = i(0),
o = i(70),
r = i(429),
a = new s({
Extends: n,
initialize: function (t) {
(this.override = !0),
(this.audioPlayDelay = 0.1),
(this.loopEndOffset = 0.05),
(this.onBlurPausedSounds = []),
(this.locked = "ontouchstart" in window),
(this.lockedActionsQueue = this.locked ? [] : null),
(this._mute = !1),
(this._volume = 1),
n.call(this, t);
},
add: function (t, e) {
var i = new r(this, t, e);
return this.sounds.push(i), i;
},
unlock: function () {
this.locked = !1;
var e,
i,
n,
r = this;
this.game.cache.audio.entries.each(function (t, e) {
for (var i = 0; i < e.length; i++) if ("true" === e[i].dataset.locked) return !(r.locked = !0);
return !0;
}),
this.locked &&
((e = !1),
(i = function () {
e = !0;
}),
(n = function () {
var s, t;
e
? (e = !1)
: (document.body.removeEventListener("touchmove", i),
document.body.removeEventListener("touchend", n),
(s = []),
r.game.cache.audio.entries.each(function (t, e) {
for (var i = 0; i < e.length; i++) {
var n = e[i];
"true" === n.dataset.locked && s.push(n);
}
return !0;
}),
0 !== s.length &&
(((t = s[s.length - 1]).oncanplaythrough = function () {
(t.oncanplaythrough = null),
s.forEach(function (t) {
t.dataset.locked = "false";
}),
(r.unlocked = !0);
}),
s.forEach(function (t) {
t.load();
})));
}),
this.once(
o.UNLOCKED,
function () {
for (
this.forEachActiveSound(function (t) {
null === t.currentMarker && 0 === t.duration && (t.duration = t.tags[0].duration), (t.totalDuration = t.tags[0].duration);
});
this.lockedActionsQueue.length;
) {
var t = this.lockedActionsQueue.shift();
t.sound[t.prop].apply ? t.sound[t.prop].apply(t.sound, t.value || []) : (t.sound[t.prop] = t.value);
}
},
this
),
document.body.addEventListener("touchmove", i, !1),
document.body.addEventListener("touchend", n, !1));
},
onBlur: function () {
this.forEachActiveSound(function (t) {
t.isPlaying && (this.onBlurPausedSounds.push(t), t.onBlur());
});
},
onFocus: function () {
this.onBlurPausedSounds.forEach(function (t) {
t.onFocus();
}),
(this.onBlurPausedSounds.length = 0);
},
destroy: function () {
n.prototype.destroy.call(this), (this.onBlurPausedSounds.length = 0), (this.onBlurPausedSounds = null);
},
isLocked: function (t, e, i) {
return "true" === t.tags[0].dataset.locked && (this.lockedActionsQueue.push({ sound: t, prop: e, value: i }), !0);
},
setMute: function (t) {
return (this.mute = t), this;
},
mute: {
get: function () {
return this._mute;
},
set: function (t) {
(this._mute = t),
this.forEachActiveSound(function (t) {
t.updateMute();
}),
this.emit(o.GLOBAL_MUTE, this, t);
},
},
setVolume: function (t) {
return (this.volume = t), this;
},
volume: {
get: function () {
return this._volume;
},
set: function (t) {
(this._volume = t),
this.forEachActiveSound(function (t) {
t.updateVolume();
}),
this.emit(o.GLOBAL_VOLUME, this, t);
},
},
});
t.exports = a;
},
function (t, e, i) {
var a = i(78);
t.exports = function (t, e, i, n, s) {
if ((void 0 === n && (n = 0), void 0 === s && (s = t.length), a(t, n, s)))
for (var r = n; r < s; r++) {
var o = t[r];
if (!e || (e && void 0 === i && o.hasOwnProperty(e)) || (e && void 0 !== i && o[e] === i)) return o;
}
return null;
};
},
function (t, e, i) {
var n = i(146),
s = i(0),
r = i(70),
o = i(18),
a = new s({
Extends: n,
initialize: function (t, e, i) {
if ((void 0 === i && (i = {}), (this.tags = t.game.cache.audio.get(e)), !this.tags)) throw new Error('There is no audio asset with key "' + e + '" in the audio cache');
(this.audio = null), (this.startTime = 0), (this.previousTime = 0), (this.duration = this.tags[0].duration), (this.totalDuration = this.tags[0].duration), n.call(this, t, e, i);
},
play: function (t, e) {
return !(this.manager.isLocked(this, "play", [t, e]) || !n.prototype.play.call(this, t, e) || !this.pickAndPlayAudioTag() || (this.emit(r.PLAY, this), 0));
},
pause: function () {
return !(
this.manager.isLocked(this, "pause") ||
0 < this.startTime ||
!n.prototype.pause.call(this) ||
((this.currentConfig.seek = this.audio.currentTime - (this.currentMarker ? this.currentMarker.start : 0)), this.stopAndReleaseAudioTag(), this.emit(r.PAUSE, this), 0)
);
},
resume: function () {
return !(this.manager.isLocked(this, "resume") || 0 < this.startTime || !n.prototype.resume.call(this) || !this.pickAndPlayAudioTag() || (this.emit(r.RESUME, this), 0));
},
stop: function () {
return !this.manager.isLocked(this, "stop") && !!n.prototype.stop.call(this) && (this.stopAndReleaseAudioTag(), this.emit(r.STOP, this), !0);
},
pickAndPlayAudioTag: function () {
if (!this.pickAudioTag()) return this.reset(), !1;
var t = this.currentConfig.seek,
e = this.currentConfig.delay,
i = (this.currentMarker ? this.currentMarker.start : 0) + t;
return (
(this.previousTime = i),
(this.audio.currentTime = i),
this.applyConfig(),
0 === e ? ((this.startTime = 0), this.audio.paused && this.playCatchPromise()) : ((this.startTime = window.performance.now() + 1e3 * e), this.audio.paused || this.audio.pause()),
this.resetConfig(),
!0
);
},
pickAudioTag: function () {
if (this.audio) return !0;
for (var t = 0; t < this.tags.length; t++) {
var e = this.tags[t];
if ("false" === e.dataset.used) return (e.dataset.used = "true"), (this.audio = e), !0;
}
if (!this.manager.override) return !1;
var i = [];
this.manager.forEachActiveSound(function (t) {
t.key === this.key && t.audio && i.push(t);
}, this),
i.sort(function (t, e) {
return t.loop === e.loop ? e.seek / e.duration - t.seek / t.duration : t.loop ? 1 : -1;
});
var n = i[0];
return (this.audio = n.audio), n.reset(), (n.audio = null), (n.startTime = 0), !(n.previousTime = 0);
},
playCatchPromise: function () {
var t = this.audio.play();
t && t.catch(function (t) {});
},
stopAndReleaseAudioTag: function () {
(this.startTime = 0), (this.previousTime = 0), this.audio && (this.audio.pause(), (this.audio.dataset.used = "false"), (this.audio = null));
},
reset: function () {
n.prototype.stop.call(this);
},
onBlur: function () {
(this.isPlaying = !1),
(this.isPaused = !0),
(this.currentConfig.seek = this.audio.currentTime - (this.currentMarker ? this.currentMarker.start : 0)),
(this.currentConfig.delay = Math.max(0, (this.startTime - window.performance.now()) / 1e3)),
this.stopAndReleaseAudioTag();
},
onFocus: function () {
(this.isPlaying = !0), (this.isPaused = !1), this.pickAndPlayAudioTag();
},
update: function (t) {
if (this.isPlaying)
if (0 < this.startTime)
this.startTime < t - this.manager.audioPlayDelay &&
((this.audio.currentTime += Math.max(0, t - this.startTime) / 1e3), (this.startTime = 0), (this.previousTime = this.audio.currentTime), this.playCatchPromise());
else {
var e = this.currentMarker ? this.currentMarker.start : 0,
i = e + this.duration,
n = this.audio.currentTime;
if (this.currentConfig.loop)
n >= i - this.manager.loopEndOffset ? ((this.audio.currentTime = e + Math.max(0, n - i)), (n = this.audio.currentTime)) : n < e && ((this.audio.currentTime += e), (n = this.audio.currentTime)),
n < this.previousTime && this.emit(r.LOOPED, this);
else if (i <= n) return this.reset(), this.stopAndReleaseAudioTag(), void this.emit(r.COMPLETE, this);
this.previousTime = n;
}
},
destroy: function () {
n.prototype.destroy.call(this), (this.tags = null), this.audio && this.stopAndReleaseAudioTag();
},
updateMute: function () {
this.audio && (this.audio.muted = this.currentConfig.mute || this.manager.mute);
},
updateVolume: function () {
this.audio && (this.audio.volume = o(this.currentConfig.volume * this.manager.volume, 0, 1));
},
calculateRate: function () {
n.prototype.calculateRate.call(this), this.audio && (this.audio.playbackRate = this.totalRate);
},
mute: {
get: function () {
return this.currentConfig.mute;
},
set: function (t) {
(this.currentConfig.mute = t), this.manager.isLocked(this, "mute", t) || (this.updateMute(), this.emit(r.MUTE, this, t));
},
},
setMute: function (t) {
return (this.mute = t), this;
},
volume: {
get: function () {
return this.currentConfig.volume;
},
set: function (t) {
(this.currentConfig.volume = t), this.manager.isLocked(this, "volume", t) || (this.updateVolume(), this.emit(r.VOLUME, this, t));
},
},
setVolume: function (t) {
return (this.volume = t), this;
},
rate: {
get: function () {
return this.currentConfig.rate;
},
set: function (t) {
(this.currentConfig.rate = t), this.manager.isLocked(this, r.RATE, t) || (this.calculateRate(), this.emit(r.RATE, this, t));
},
},
setRate: function (t) {
return (this.rate = t), this;
},
detune: {
get: function () {
return this.currentConfig.detune;
},
set: function (t) {
(this.currentConfig.detune = t), this.manager.isLocked(this, r.DETUNE, t) || (this.calculateRate(), this.emit(r.DETUNE, this, t));
},
},
setDetune: function (t) {
return (this.detune = t), this;
},
seek: {
get: function () {
return this.isPlaying ? this.audio.currentTime - (this.currentMarker ? this.currentMarker.start : 0) : this.isPaused ? this.currentConfig.seek : 0;
},
set: function (t) {
this.manager.isLocked(this, "seek", t) ||
0 < this.startTime ||
((this.isPlaying || this.isPaused) &&
((t = Math.min(Math.max(0, t), this.duration)),
this.isPlaying ? ((this.previousTime = t), (this.audio.currentTime = t)) : this.isPaused && (this.currentConfig.seek = t),
this.emit(r.SEEK, this, t)));
},
},
setSeek: function (t) {
return (this.seek = t), this;
},
loop: {
get: function () {
return this.currentConfig.loop;
},
set: function (t) {
(this.currentConfig.loop = t), this.manager.isLocked(this, "loop", t) || (this.audio && (this.audio.loop = t), this.emit(r.LOOP, this, t));
},
},
setLoop: function (t) {
return (this.loop = t), this;
},
pan: {
get: function () {
return this.currentConfig.pan;
},
set: function (t) {
(this.currentConfig.pan = t), this.emit(r.PAN, this, t);
},
},
setPan: function (t) {
return (this.pan = t), this;
},
});
t.exports = a;
},
function (t, e, i) {
var n = i(145),
s = i(0),
r = i(9),
o = i(431),
a = i(1),
h = new s({
Extends: r,
initialize: function (t) {
r.call(this), (this.game = t), (this.sounds = []), (this.mute = !1), (this.volume = 1), (this.rate = 1), (this.detune = 0), (this.pauseOnBlur = !0), (this.locked = !1);
},
add: function (t, e) {
var i = new o(this, t, e);
return this.sounds.push(i), i;
},
addAudioSprite: function (t, e) {
var i = this.add(t, e);
return (i.spritemap = {}), i;
},
play: function (t, e) {
return !1;
},
playAudioSprite: function (t, e, i) {
return !1;
},
remove: function (t) {
return n.prototype.remove.call(this, t);
},
removeByKey: function (t) {
return n.prototype.removeByKey.call(this, t);
},
pauseAll: a,
resumeAll: a,
stopAll: a,
update: a,
setRate: a,
setDetune: a,
setMute: a,
setVolume: a,
forEachActiveSound: function (t, e) {
n.prototype.forEachActiveSound.call(this, t, e);
},
destroy: function () {
n.prototype.destroy.call(this);
},
});
t.exports = h;
},
function (t, e, i) {
function n() {
return !1;
}
function s() {
return this;
}
var r = i(146),
o = i(0),
a = i(9),
h = i(17),
l = new o({
Extends: a,
initialize: function (t, e, i) {
void 0 === i && (i = {}),
a.call(this),
(this.manager = t),
(this.key = e),
(this.isPlaying = !1),
(this.isPaused = !1),
(this.totalRate = 1),
(this.duration = 0),
(this.totalDuration = 0),
(this.config = h({ mute: !1, volume: 1, rate: 1, detune: 0, seek: 0, loop: !1, delay: 0, pan: 0 }, i)),
(this.currentConfig = this.config),
(this.mute = !1),
(this.volume = 1),
(this.rate = 1),
(this.detune = 0),
(this.seek = 0),
(this.loop = !1),
(this.pan = 0),
(this.markers = {}),
(this.currentMarker = null),
(this.pendingRemove = !1);
},
addMarker: n,
updateMarker: n,
removeMarker: function () {
return null;
},
play: n,
pause: n,
resume: n,
stop: n,
destroy: function () {
r.prototype.destroy.call(this);
},
setMute: s,
setVolume: s,
setRate: s,
setDetune: s,
setSeek: s,
setLoop: s,
setPan: s,
});
t.exports = l;
},
function (t, e, i) {
var c = i(433),
n = i(145),
s = i(0),
d = i(70),
r = i(22),
o = i(434),
a = new s({
Extends: n,
initialize: function (t) {
(this.context = this.createAudioContext(t)),
(this.masterMuteNode = this.context.createGain()),
(this.masterVolumeNode = this.context.createGain()),
this.masterMuteNode.connect(this.masterVolumeNode),
this.masterVolumeNode.connect(this.context.destination),
(this.destination = this.masterMuteNode),
(this.locked = "suspended" === this.context.state && ("ontouchstart" in window || "onclick" in window)),
n.call(this, t),
this.locked && t.isBooted ? this.unlock() : t.events.once(r.BOOT, this.unlock, this);
},
createAudioContext: function (t) {
var e = t.config.audio;
return e.context ? (e.context.resume(), e.context) : window.hasOwnProperty("AudioContext") ? new AudioContext() : window.hasOwnProperty("webkitAudioContext") ? new window.webkitAudioContext() : void 0;
},
setAudioContext: function (t) {
return (
this.context && this.context.close(),
this.masterMuteNode && this.masterMuteNode.disconnect(),
this.masterVolumeNode && this.masterVolumeNode.disconnect(),
(this.context = t),
(this.masterMuteNode = t.createGain()),
(this.masterVolumeNode = t.createGain()),
this.masterMuteNode.connect(this.masterVolumeNode),
this.masterVolumeNode.connect(t.destination),
(this.destination = this.masterMuteNode),
this
);
},
add: function (t, e) {
var i = new o(this, t, e);
return this.sounds.push(i), i;
},
decodeAudio: function (t, e) {
for (var i = Array.isArray(t) ? t : [{ key: t, data: e }], n = this.game.cache.audio, s = i.length, r = 0; r < i.length; r++) {
var o = i[r],
a = o.key,
h = o.data;
"string" == typeof h && (h = c(h));
var l = function (t, e) {
n.add(t, e), this.emit(d.DECODED, t), 0 == --s && this.emit(d.DECODED_ALL);
}.bind(this, a),
u = function (t, e) {
0 == --s && this.emit(d.DECODED_ALL);
}.bind(this, a);
this.context.decodeAudioData(h, l, u);
}
},
unlock: function () {
function e() {
var t;
i.context &&
n &&
((t = n.removeEventListener),
i.context.resume().then(
function () {
t("touchstart", e), t("touchend", e), t("click", e), t("keydown", e), (i.unlocked = !0);
},
function () {
t("touchstart", e), t("touchend", e), t("click", e), t("keydown", e);
}
));
}
var i = this,
n = document.body;
n && (n.addEventListener("touchstart", e, !1), n.addEventListener("touchend", e, !1), n.addEventListener("click", e, !1), n.addEventListener("keydown", e, !1));
},
onBlur: function () {
this.locked || this.context.suspend();
},
onFocus: function () {
var t = this.context;
("suspended" !== t.state && "interrupted" !== t.state) || this.locked || t.resume();
},
update: function (t, e) {
n.prototype.update.call(this, t, e);
var i = this.context;
i && "interrupted" === i.state && i.resume();
},
destroy: function () {
var t;
(this.destination = null),
this.masterVolumeNode.disconnect(),
(this.masterVolumeNode = null),
this.masterMuteNode.disconnect(),
(this.masterMuteNode = null),
this.game.config.audio.context
? this.context.suspend()
: (t = this).context.close().then(function () {
t.context = null;
}),
n.prototype.destroy.call(this);
},
setMute: function (t) {
return (this.mute = t), this;
},
mute: {
get: function () {
return 0 === this.masterMuteNode.gain.value;
},
set: function (t) {
this.masterMuteNode.gain.setValueAtTime(t ? 0 : 1, 0), this.emit(d.GLOBAL_MUTE, this, t);
},
},
setVolume: function (t) {
return (this.volume = t), this;
},
volume: {
get: function () {
return this.masterVolumeNode.gain.value;
},
set: function (t) {
this.masterVolumeNode.gain.setValueAtTime(t, 0), this.emit(d.GLOBAL_VOLUME, this, t);
},
},
});
t.exports = a;
},
function (t, e) {
for (var i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", c = new Uint8Array(256), n = 0; n < i.length; n++) c[i.charCodeAt(n)] = n;
t.exports = function (t) {
var e,
i,
n,
s,
r = (t = t.substr(t.indexOf(",") + 1)).length,
o = 0.75 * r,
a = 0;
"=" === t[r - 1] && (o--, "=" === t[r - 2] && o--);
for (var h = new ArrayBuffer(o), l = new Uint8Array(h), u = 0; u < r; u += 4)
(e = c[t.charCodeAt(u)]),
(i = c[t.charCodeAt(u + 1)]),
(n = c[t.charCodeAt(u + 2)]),
(s = c[t.charCodeAt(u + 3)]),
(l[a++] = (e << 2) | (i >> 4)),
(l[a++] = ((15 & i) << 4) | (n >> 2)),
(l[a++] = ((3 & n) << 6) | (63 & s));
return h;
};
},
function (t, e, i) {
var n = i(146),
s = i(0),
r = i(70),
o = new s({
Extends: n,
initialize: function (t, e, i) {
if ((void 0 === i && (i = {}), (this.audioBuffer = t.game.cache.audio.get(e)), !this.audioBuffer)) throw new Error('Audio key "' + e + '" missing from cache');
(this.source = null),
(this.loopSource = null),
(this.muteNode = t.context.createGain()),
(this.volumeNode = t.context.createGain()),
(this.pannerNode = null),
(this.playTime = 0),
(this.startTime = 0),
(this.loopTime = 0),
(this.rateUpdates = []),
(this.hasEnded = !1),
(this.hasLooped = !1),
this.muteNode.connect(this.volumeNode),
t.context.createStereoPanner
? ((this.pannerNode = t.context.createStereoPanner()), this.volumeNode.connect(this.pannerNode), this.pannerNode.connect(t.destination))
: this.volumeNode.connect(t.destination),
(this.duration = this.audioBuffer.duration),
(this.totalDuration = this.audioBuffer.duration),
n.call(this, t, e, i);
},
play: function (t, e) {
return !!n.prototype.play.call(this, t, e) && (this.stopAndRemoveBufferSource(), this.createAndStartBufferSource(), this.emit(r.PLAY, this), !0);
},
pause: function () {
return !(
this.manager.context.currentTime < this.startTime ||
!n.prototype.pause.call(this) ||
((this.currentConfig.seek = this.getCurrentTime()), this.stopAndRemoveBufferSource(), this.emit(r.PAUSE, this), 0)
);
},
resume: function () {
return !(this.manager.context.currentTime < this.startTime || !n.prototype.resume.call(this) || (this.createAndStartBufferSource(), this.emit(r.RESUME, this), 0));
},
stop: function () {
return !!n.prototype.stop.call(this) && (this.stopAndRemoveBufferSource(), this.emit(r.STOP, this), !0);
},
createAndStartBufferSource: function () {
var t = this.currentConfig.seek,
e = this.currentConfig.delay,
i = this.manager.context.currentTime + e,
n = (this.currentMarker ? this.currentMarker.start : 0) + t,
s = this.duration - t;
(this.playTime = i - t), (this.startTime = i), (this.source = this.createBufferSource()), this.applyConfig(), this.source.start(Math.max(0, i), Math.max(0, n), Math.max(0, s)), this.resetConfig();
},
createAndStartLoopBufferSource: function () {
var t = this.getLoopTime(),
e = this.currentMarker ? this.currentMarker.start : 0,
i = this.duration;
(this.loopTime = t), (this.loopSource = this.createBufferSource()), this.loopSource.playbackRate.setValueAtTime(this.totalRate, 0), this.loopSource.start(Math.max(0, t), Math.max(0, e), Math.max(0, i));
},
createBufferSource: function () {
var e = this,
t = this.manager.context.createBufferSource();
return (
(t.buffer = this.audioBuffer),
t.connect(this.muteNode),
(t.onended = function (t) {
t.target === e.source && (e.currentConfig.loop ? (e.hasLooped = !0) : (e.hasEnded = !0));
}),
t
);
},
stopAndRemoveBufferSource: function () {
this.source && (this.source.stop(), this.source.disconnect(), (this.source = null)), (this.playTime = 0), (this.startTime = 0), this.stopAndRemoveLoopBufferSource();
},
stopAndRemoveLoopBufferSource: function () {
this.loopSource && (this.loopSource.stop(), this.loopSource.disconnect(), (this.loopSource = null)), (this.loopTime = 0);
},
applyConfig: function () {
(this.rateUpdates.length = 0), this.rateUpdates.push({ time: 0, rate: 1 }), n.prototype.applyConfig.call(this);
},
update: function () {
this.hasEnded
? ((this.hasEnded = !1), n.prototype.stop.call(this), this.stopAndRemoveBufferSource(), this.emit(r.COMPLETE, this))
: this.hasLooped &&
((this.hasLooped = !1),
(this.source = this.loopSource),
(this.loopSource = null),
(this.playTime = this.startTime = this.loopTime),
(this.rateUpdates.length = 0),
this.rateUpdates.push({ time: 0, rate: this.totalRate }),
this.createAndStartLoopBufferSource(),
this.emit(r.LOOPED, this));
},
destroy: function () {
n.prototype.destroy.call(this),
(this.audioBuffer = null),
this.stopAndRemoveBufferSource(),
this.muteNode.disconnect(),
(this.muteNode = null),
this.volumeNode.disconnect(),
(this.volumeNode = null),
this.pannerNode && (this.pannerNode.disconnect(), (this.pannerNode = null)),
(this.rateUpdates.length = 0),
(this.rateUpdates = null);
},
calculateRate: function () {
n.prototype.calculateRate.call(this);
var t = this.manager.context.currentTime;
this.source && "number" == typeof this.totalRate && this.source.playbackRate.setValueAtTime(this.totalRate, t),
this.isPlaying &&
(this.rateUpdates.push({ time: Math.max(this.startTime, t) - this.playTime, rate: this.totalRate }), this.loopSource && (this.stopAndRemoveLoopBufferSource(), this.createAndStartLoopBufferSource()));
},
getCurrentTime: function () {
for (var t = 0, e = 0; e < this.rateUpdates.length; e++)
t += ((e < this.rateUpdates.length - 1 ? this.rateUpdates[e + 1].time : this.manager.context.currentTime - this.playTime) - this.rateUpdates[e].time) * this.rateUpdates[e].rate;
return t;
},
getLoopTime: function () {
for (var t = 0, e = 0; e < this.rateUpdates.length - 1; e++) t += (this.rateUpdates[e + 1].time - this.rateUpdates[e].time) * this.rateUpdates[e].rate;
var i = this.rateUpdates[this.rateUpdates.length - 1];
return this.playTime + i.time + (this.duration - t) / i.rate;
},
rate: {
get: function () {
return this.currentConfig.rate;
},
set: function (t) {
(this.currentConfig.rate = t), this.calculateRate(), this.emit(r.RATE, this, t);
},
},
setRate: function (t) {
return (this.rate = t), this;
},
detune: {
get: function () {
return this.currentConfig.detune;
},
set: function (t) {
(this.currentConfig.detune = t), this.calculateRate(), this.emit(r.DETUNE, this, t);
},
},
setDetune: function (t) {
return (this.detune = t), this;
},
mute: {
get: function () {
return 0 === this.muteNode.gain.value;
},
set: function (t) {
(this.currentConfig.mute = t), this.muteNode.gain.setValueAtTime(t ? 0 : 1, 0), this.emit(r.MUTE, this, t);
},
},
setMute: function (t) {
return (this.mute = t), this;
},
volume: {
get: function () {
return this.volumeNode.gain.value;
},
set: function (t) {
(this.currentConfig.volume = t), this.volumeNode.gain.setValueAtTime(t, 0), this.emit(r.VOLUME, this, t);
},
},
setVolume: function (t) {
return (this.volume = t), this;
},
seek: {
get: function () {
return this.isPlaying ? (this.manager.context.currentTime < this.startTime ? this.startTime - this.playTime : this.getCurrentTime()) : this.isPaused ? this.currentConfig.seek : 0;
},
set: function (t) {
this.manager.context.currentTime < this.startTime ||
((this.isPlaying || this.isPaused) &&
((t = Math.min(Math.max(0, t), this.duration)),
(this.currentConfig.seek = t),
this.isPlaying && (this.stopAndRemoveBufferSource(), this.createAndStartBufferSource()),
this.emit(r.SEEK, this, t)));
},
},
setSeek: function (t) {
return (this.seek = t), this;
},
loop: {
get: function () {
return this.currentConfig.loop;
},
set: function (t) {
(this.currentConfig.loop = t), this.isPlaying && (this.stopAndRemoveLoopBufferSource(), t && this.createAndStartLoopBufferSource()), this.emit(r.LOOP, this, t);
},
},
setLoop: function (t) {
return (this.loop = t), this;
},
pan: {
get: function () {
return this.pannerNode ? this.pannerNode.pan.value : 0;
},
set: function (t) {
(this.currentConfig.pan = t), this.pannerNode && this.pannerNode.pan.setValueAtTime(t, this.manager.context.currentTime), this.emit(r.PAN, this, t);
},
},
setPan: function (t) {
return (this.pan = t), this;
},
});
t.exports = o;
},
function (t, e) {
t.exports = function (t) {
for (var e = t.length, i = t[0].length, n = new Array(i), s = 0; s < i; s++) {
n[s] = new Array(e);
for (var r = e - 1; -1 < r; r--) n[s][r] = t[r][s];
}
return n;
};
},
function (t, e) {
function g(t, e, i) {
var n = t[e];
(t[e] = t[i]), (t[i] = n);
}
function v(t, e) {
return t < e ? -1 : e < t ? 1 : 0;
}
var y = function (t, e, i, n, s) {
for (void 0 === i && (i = 0), void 0 === n && (n = t.length - 1), void 0 === s && (s = v); i < n; ) {
var r, o, a, h, l, u, c;
600 < n - i &&
((r = n - i + 1),
(o = e - i + 1),
(a = Math.log(r)),
(h = 0.5 * Math.exp((2 * a) / 3)),
(l = 0.5 * Math.sqrt((a * h * (r - h)) / r) * (o - r / 2 < 0 ? -1 : 1)),
(u = Math.max(i, Math.floor(e - (o * h) / r + l))),
(c = Math.min(n, Math.floor(e + ((r - o) * h) / r + l))),
y(t, e, u, c, s));
var d = t[e],
f = i,
p = n;
for (g(t, i, e), 0 < s(t[n], d) && g(t, i, n); f < p; ) {
for (g(t, f, p), f++, p--; s(t[f], d) < 0; ) f++;
for (; 0 < s(t[p], d); ) p--;
}
0 === s(t[i], d) ? g(t, i, p) : g(t, ++p, n), p <= e && (i = p + 1), e <= p && (n = p - 1);
}
};
t.exports = y;
},
function (t, e, i) {
var f = i(6),
p = i(131);
t.exports = function (t, e, i) {
var n,
s = f(i, "max", 0),
r = f(i, "qty", 1),
o = f(i, "random", !1),
a = f(i, "randomB", !1),
h = f(i, "repeat", 0),
l = f(i, "yoyo", !1),
u = [];
a && p(e), -1 === h && (h = 0 === s ? 0 : ((n = t.length * e.length * r), l && (n *= 2), Math.ceil(s / n)));
for (var c = 0; c <= h; c++) {
var d = (function (t, e, i) {
for (var n = [], s = 0; s < t.length; s++) for (var r = 0; r < e.length; r++) for (var o = 0; o < i; o++) n.push({ a: t[s], b: e[r] });
return n;
})(t, e, r);
o && p(d), (u = u.concat(d)), l && (d.reverse(), (u = u.concat(d)));
}
return s && u.splice(s), u;
};
},
function (t, e, i) {
t.exports = { PROCESS_QUEUE_ADD: i(1041), PROCESS_QUEUE_REMOVE: i(1042) };
},
function (t, e, i) {
var f = i(13);
t.exports = function (t, e) {
var i,
n,
s,
r,
o,
a,
h,
l,
u,
c,
d = f(e, "anims", null);
return (
null === d ||
("string" == typeof d
? t.anims.play(d)
: "object" == typeof d &&
((i = t.anims),
(n = f(d, "key", void 0)) &&
((s = f(d, "startFrame", void 0)),
(r = f(d, "delay", 0)),
(o = f(d, "repeat", 0)),
(a = f(d, "repeatDelay", 0)),
(h = f(d, "yoyo", !1)),
(l = f(d, "play", !1)),
(u = f(d, "delayedPlay", 0)),
(c = { key: n, delay: r, repeat: o, repeatDelay: a, yoyo: h, startFrame: s }),
l ? i.play(c) : 0 < u ? i.playAfterDelay(c, u) : i.load(c)))),
t
);
};
},
function (t, e, i) {
var n = i(0),
s = i(109),
r = new n({
initialize: function (t, e, i, n, s) {
(this.parent = t), (this.x = e), (this.y = i), (this.frame = n), (this.data = {}), (this.tint = 16777215), (this._visible = s), (this._alpha = 1), (this.flipX = !1), (this.flipY = !1);
},
setFrame: function (t) {
return void 0 === t ? (this.frame = this.parent.frame) : t instanceof s && t.texture === this.parent.texture ? (this.frame = t) : (this.frame = this.parent.texture.get(t)), this;
},
resetFlip: function () {
return (this.flipX = !1), (this.flipY = !1), this;
},
reset: function (t, e, i) {
return (this.x = t), (this.y = e), (this.flipX = !1), (this.flipY = !1), (this._alpha = 1), (this._visible = !0), (this.parent.dirty = !0), i && this.setFrame(i), this;
},
setPosition: function (t, e) {
return (this.x = t), (this.y = e), this;
},
setFlipX: function (t) {
return (this.flipX = t), this;
},
setFlipY: function (t) {
return (this.flipY = t), this;
},
setFlip: function (t, e) {
return (this.flipX = t), (this.flipY = e), this;
},
setVisible: function (t) {
return (this.visible = t), this;
},
setAlpha: function (t) {
return (this.alpha = t), this;
},
setTint: function (t) {
return (this.tint = t), this;
},
destroy: function () {
(this.parent.dirty = !0), this.parent.children.remove(this), (this.parent = void 0), (this.frame = void 0), (this.data = void 0);
},
visible: {
get: function () {
return this._visible;
},
set: function (t) {
(this.parent.dirty |= this._visible !== t), (this._visible = t);
},
},
alpha: {
get: function () {
return this._alpha;
},
set: function (t) {
(this.parent.dirty |= 0 < this._alpha != 0 < t), (this._alpha = t);
},
},
});
t.exports = r;
},
function (t, e, i) {
var a = i(10);
t.exports = function (t, e, i) {
void 0 === i && (i = new a());
var n = Math.min(t.x, e.x),
s = Math.min(t.y, e.y),
r = Math.max(t.right, e.right) - n,
o = Math.max(t.bottom, e.bottom) - s;
return i.setTo(n, s, r, o);
};
},
function (t, e, i) {
var n = i(0),
s = i(11),
r = i(1055),
o = i(15),
a = i(7),
h = i(202),
l = i(20),
u = i(140),
c = new n({
Extends: o,
Mixins: [s.AlphaSingle, s.BlendMode, s.Depth, s.Origin, s.ScrollFactor, s.Transform, s.Visible, r],
initialize: function (t, e, i, n, s, r) {
o.call(this, t, "DOMElement"),
(this.parent = t.sys.game.domContainer),
(this.cache = t.sys.cache.html),
this.node,
(this.transformOnly = !1),
(this.skewX = 0),
(this.skewY = 0),
(this.rotate3d = new u()),
(this.rotate3dAngle = "deg"),
(this.pointerEvents = "auto"),
(this.width = 0),
(this.height = 0),
(this.displayWidth = 0),
(this.displayHeight = 0),
(this.handler = this.dispatchNativeEvent.bind(this)),
this.setPosition(e, i),
"string" == typeof n ? ("#" === n[0] ? this.setElement(n.substr(1), s, r) : this.createElement(n, s, r)) : n && this.setElement(n, s, r),
t.sys.events.on(l.SLEEP, this.handleSceneEvent, this),
t.sys.events.on(l.WAKE, this.handleSceneEvent, this);
},
addedToScene: function () {
this.scene.sys.updateList.add(this);
},
removedFromScene: function () {
this.scene.sys.updateList.remove(this);
},
handleSceneEvent: function (t) {
var e = this.node,
i = e.style;
e && (i.display = t.settings.visible ? "block" : "none");
},
setSkew: function (t, e) {
return void 0 === t && (t = 0), void 0 === e && (e = t), (this.skewX = t), (this.skewY = e), this;
},
setPerspective: function (t) {
return (this.parent.style.perspective = t + "px"), this;
},
perspective: {
get: function () {
return parseFloat(this.parent.style.perspective);
},
set: function (t) {
this.parent.style.perspective = t + "px";
},
},
addListener: function (t) {
if (this.node) {
t = t.split(" ");
for (var e = 0; e < t.length; e++) this.node.addEventListener(t[e], this.handler, !1);
}
return this;
},
removeListener: function (t) {
if (this.node) {
t = t.split(" ");
for (var e = 0; e < t.length; e++) this.node.removeEventListener(t[e], this.handler);
}
return this;
},
dispatchNativeEvent: function (t) {
this.emit(t.type, t);
},
createElement: function (t, e, i) {
return this.setElement(document.createElement(t), e, i);
},
setElement: function (t, e, i) {
var n;
if ((this.removeElement(), "string" == typeof t ? ("#" === t[0] && (t = t.substr(1)), (n = document.getElementById(t))) : "object" == typeof t && 1 === t.nodeType && (n = t), !n)) return this;
if (((this.node = n), e && a(e))) for (var s in e) n.style[s] = e[s];
else "string" == typeof e && (n.style = e);
return (n.style.zIndex = "0"), (n.style.display = "inline"), (n.style.position = "absolute"), (n.phaser = this).parent && this.parent.appendChild(n), i && (n.innerText = i), this.updateSize();
},
createFromCache: function (t, e) {
var i = this.cache.get(t);
return i && this.createFromHTML(i, e), this;
},
createFromHTML: function (t, e) {
void 0 === e && (e = "div"), this.removeElement();
var i = document.createElement(e);
return ((this.node = i).style.zIndex = "0"), (i.style.display = "inline"), (i.style.position = "absolute"), (i.phaser = this).parent && this.parent.appendChild(i), (i.innerHTML = t), this.updateSize();
},
removeElement: function () {
return this.node && (h(this.node), (this.node = null)), this;
},
updateSize: function () {
var t = this.node,
e = t.getBoundingClientRect();
return (this.width = t.clientWidth), (this.height = t.clientHeight), (this.displayWidth = e.width || 0), (this.displayHeight = e.height || 0), this;
},
getChildByProperty: function (t, e) {
if (this.node) for (var i = this.node.querySelectorAll("*"), n = 0; n < i.length; n++) if (i[n][t] === e) return i[n];
return null;
},
getChildByID: function (t) {
return this.getChildByProperty("id", t);
},
getChildByName: function (t) {
return this.getChildByProperty("name", t);
},
setClassName: function (t) {
return this.node && ((this.node.className = t), this.updateSize()), this;
},
setText: function (t) {
return this.node && ((this.node.innerText = t), this.updateSize()), this;
},
setHTML: function (t) {
return this.node && ((this.node.innerHTML = t), this.updateSize()), this;
},
preUpdate: function () {
var t = this.parentContainer,
e = this.node;
e && t && !t.willRender() && (e.style.display = "none");
},
willRender: function () {
return !0;
},
preDestroy: function () {
this.removeElement(), this.scene.sys.events.off(l.SLEEP, this.handleSceneEvent, this), this.scene.sys.events.off(l.WAKE, this.handleSceneEvent, this);
},
});
t.exports = c;
},
function (t, e, i) {
var g = i(1056),
v = i(15),
n = i(25),
y = new n(),
m = new n(),
x = new n();
t.exports = function (t, e, i, n) {
var s, r, o, a, h, l, u, c, d, f, p;
e.node &&
((s = e.node.style),
(r = e.scene.sys.settings),
!s || !r.visible || v.RENDER_MASK !== e.renderFlags || (0 !== e.cameraFilter && e.cameraFilter & i.id) || (e.parentContainer && !e.parentContainer.willRender())
? (s.display = "none")
: ((o = e.parentContainer),
(a = i.alpha * e.alpha),
o && (a *= o.alpha),
(h = y),
(l = m),
(u = x),
(d = c = 0),
(p = f = "0%"),
n
? ((c = e.width * e.scaleX * e.originX),
(d = e.height * e.scaleY * e.originY),
l.applyITRS(e.x - c, e.y - d, e.rotation, e.scaleX, e.scaleY),
h.copyFrom(i.matrix),
h.multiplyWithOffset(n, -i.scrollX * e.scrollFactorX, -i.scrollY * e.scrollFactorY),
(l.e = e.x - c),
(l.f = e.y - d))
: ((c = e.width * e.originX),
(d = e.height * e.originY),
l.applyITRS(e.x - c, e.y - d, e.rotation, e.scaleX, e.scaleY),
h.copyFrom(i.matrix),
(f = 100 * e.originX + "%"),
(p = 100 * e.originY + "%"),
(l.e -= i.scrollX * e.scrollFactorX),
(l.f -= i.scrollY * e.scrollFactorY)),
h.multiply(l, u),
e.transformOnly || ((s.display = "block"), (s.opacity = a), (s.zIndex = e._depth), (s.pointerEvents = e.pointerEvents), (s.mixBlendMode = g[e._blendMode])),
(s.transform = u.getCSSMatrix() + " skew(" + e.skewX + "rad, " + e.skewY + "rad) rotate3d(" + e.rotate3d.x + "," + e.rotate3d.y + "," + e.rotate3d.z + "," + e.rotate3d.w + e.rotate3dAngle + ")"),
(s.transformOrigin = f + " " + p)));
};
},
function (t, e, i) {
var n = i(0),
s = i(11),
r = i(15),
o = i(1060),
a = new n({
Extends: r,
Mixins: [s.Alpha, s.BlendMode, s.Depth, s.Flip, s.Origin, s.ScrollFactor, s.Size, s.Texture, s.Tint, s.Transform, s.Visible, o],
initialize: function (t) {
r.call(this, t, "Extern");
},
addedToScene: function () {
this.scene.sys.updateList.add(this);
},
removedFromScene: function () {
this.scene.sys.updateList.remove(this);
},
preUpdate: function () {},
render: function () {},
});
t.exports = a;
},
function (t, e, i) {
var s = i(218),
r = i(98),
o = i(14),
a = i(4);
t.exports = function (t, e, i) {
void 0 === i && (i = new a());
var n = r(e, 0, o.PI2);
return s(t, n, i);
};
},
function (t, e, i) {
var o = i(447),
a = i(218),
h = i(98),
l = i(14);
t.exports = function (t, e, i, n) {
void 0 === n && (n = []), !e && 0 < i && (e = o(t) / i);
for (var s = 0; s < e; s++) {
var r = h(s / e, 0, l.PI2);
n.push(a(t, r));
}
return n;
};
},
function (t, e) {
t.exports = function (t) {
var e = t.width / 2,
i = t.height / 2,
n = Math.pow(e - i, 2) / Math.pow(e + i, 2);
return Math.PI * (e + i) * (1 + (3 * n) / (10 + Math.sqrt(4 - 3 * n)));
};
},
function (t, e, i) {
var m = i(217),
x = i(30);
t.exports = function (t, e, i, n, s, r) {
var o = e.commandBuffer,
a = o.length,
h = s || t.currentContext;
if (0 !== a && x(t, h, e, i, n)) {
i.addToRenderList(e);
var l,
u,
c,
d,
f,
p = 0,
g = 0,
v = 0;
h.beginPath();
for (var y = 0; y < a; ++y)
switch (o[y]) {
case m.ARC:
h.arc(o[y + 1], o[y + 2], o[y + 3], o[y + 4], o[y + 5], o[y + 6]), (y += 7);
break;
case m.LINE_STYLE:
(f = o[y + 1]),
(c = o[y + 2]),
(l = o[y + 3]),
(p = (16711680 & c) >>> 16),
(g = (65280 & c) >>> 8),
(v = 255 & c),
(h.strokeStyle = "rgba(" + p + "," + g + "," + v + "," + l + ")"),
(h.lineWidth = f),
(y += 3);
break;
case m.FILL_STYLE:
(d = o[y + 1]), (u = o[y + 2]), (p = (16711680 & d) >>> 16), (g = (65280 & d) >>> 8), (v = 255 & d), (h.fillStyle = "rgba(" + p + "," + g + "," + v + "," + u + ")"), (y += 2);
break;
case m.BEGIN_PATH:
h.beginPath();
break;
case m.CLOSE_PATH:
h.closePath();
break;
case m.FILL_PATH:
r || h.fill();
break;
case m.STROKE_PATH:
r || h.stroke();
break;
case m.FILL_RECT:
r ? h.rect(o[y + 1], o[y + 2], o[y + 3], o[y + 4]) : h.fillRect(o[y + 1], o[y + 2], o[y + 3], o[y + 4]), (y += 4);
break;
case m.FILL_TRIANGLE:
h.beginPath(), h.moveTo(o[y + 1], o[y + 2]), h.lineTo(o[y + 3], o[y + 4]), h.lineTo(o[y + 5], o[y + 6]), h.closePath(), r || h.fill(), (y += 6);
break;
case m.STROKE_TRIANGLE:
h.beginPath(), h.moveTo(o[y + 1], o[y + 2]), h.lineTo(o[y + 3], o[y + 4]), h.lineTo(o[y + 5], o[y + 6]), h.closePath(), r || h.stroke(), (y += 6);
break;
case m.LINE_TO:
h.lineTo(o[y + 1], o[y + 2]), (y += 2);
break;
case m.MOVE_TO:
h.moveTo(o[y + 1], o[y + 2]), (y += 2);
break;
case m.LINE_FX_TO:
h.lineTo(o[y + 1], o[y + 2]), (y += 5);
break;
case m.MOVE_FX_TO:
h.moveTo(o[y + 1], o[y + 2]), (y += 5);
break;
case m.SAVE:
h.save();
break;
case m.RESTORE:
h.restore();
break;
case m.TRANSLATE:
h.translate(o[y + 1], o[y + 2]), (y += 2);
break;
case m.SCALE:
h.scale(o[y + 1], o[y + 2]), (y += 2);
break;
case m.ROTATE:
h.rotate(o[y + 1]), (y += 1);
break;
case m.GRADIENT_FILL_STYLE:
y += 5;
break;
case m.GRADIENT_LINE_STYLE:
y += 6;
}
h.restore();
}
};
},
function (t, e, i) {
var n = i(0),
s = i(137),
r = i(80),
o = i(2),
a = i(68),
h = new n({
initialize: function (t, e, i, n) {
void 0 === n && (n = !1),
(this.propertyKey = e),
(this.propertyValue = i),
(this.defaultValue = i),
(this.steps = 0),
(this.counter = 0),
(this.start = 0),
(this.end = 0),
this.ease,
(this.emitOnly = n),
(this.onEmit = this.defaultEmit),
(this.onUpdate = this.defaultUpdate),
this.loadConfig(t);
},
loadConfig: function (t, e) {
void 0 === t && (t = {}), e && (this.propertyKey = e), (this.propertyValue = o(t, this.propertyKey, this.defaultValue)), this.setMethods(), this.emitOnly && (this.onUpdate = this.defaultUpdate);
},
toJSON: function () {
return this.propertyValue;
},
onChange: function (t) {
return (this.propertyValue = t), this.setMethods();
},
setMethods: function () {
var t,
e,
i,
n = this.propertyValue,
s = typeof n;
return (
(this.onEmit = this.defaultEmit),
(this.onUpdate = this.defaultUpdate),
"number" == s
? ((this.onEmit = this.staticValueEmit), (this.onUpdate = this.staticValueUpdate))
: Array.isArray(n)
? (this.onEmit = this.randomStaticValueEmit)
: "function" == s
? this.emitOnly
? (this.onEmit = n)
: (this.onUpdate = n)
: "object" == s && this.hasBoth(n, "start", "end")
? ((this.start = n.start),
(this.end = n.end),
(t = this.has(n, "random")) && (this.onEmit = this.randomRangedValueEmit),
this.has(n, "steps")
? ((this.steps = n.steps), (this.counter = this.start), (this.onEmit = this.steppedEmit))
: ((e = this.has(n, "ease") ? n.ease : "Linear"), (this.ease = r(e, n.easeParams)), t || (this.onEmit = this.easedValueEmit), (this.onUpdate = this.easeValueUpdate)))
: "object" == s && this.hasBoth(n, "min", "max")
? ((this.start = n.min), (this.end = n.max), (this.onEmit = this.randomRangedValueEmit))
: "object" == s && this.has(n, "random")
? ((i = n.random), Array.isArray(i) && ((this.start = i[0]), (this.end = i[1])), (this.onEmit = this.randomRangedValueEmit))
: "object" == s && this.hasEither(n, "onEmit", "onUpdate") && (this.has(n, "onEmit") && (this.onEmit = n.onEmit), this.has(n, "onUpdate") && (this.onUpdate = n.onUpdate)),
this
);
},
has: function (t, e) {
return t.hasOwnProperty(e);
},
hasBoth: function (t, e, i) {
return t.hasOwnProperty(e) && t.hasOwnProperty(i);
},
hasEither: function (t, e, i) {
return t.hasOwnProperty(e) || t.hasOwnProperty(i);
},
defaultEmit: function (t, e, i) {
return i;
},
defaultUpdate: function (t, e, i, n) {
return n;
},
staticValueEmit: function () {
return this.propertyValue;
},
staticValueUpdate: function () {
return this.propertyValue;
},
randomStaticValueEmit: function () {
var t = Math.floor(Math.random() * this.propertyValue.length);
return this.propertyValue[t];
},
randomRangedValueEmit: function (t, e) {
var i = s(this.start, this.end);
return t && t.data[e] && (t.data[e].min = i), i;
},
steppedEmit: function () {
var t = this.counter,
e = this.counter + (this.end - this.start) / this.steps;
return (this.counter = a(e, this.start, this.end)), t;
},
easedValueEmit: function (t, e) {
var i;
return t && t.data[e] && (((i = t.data[e]).min = this.start), (i.max = this.end)), this.start;
},
easeValueUpdate: function (t, e, i) {
var n = t.data[e];
return (n.max - n.min) * this.ease(i) + n.min;
},
});
t.exports = h;
},
function (t, e, i) {
var n = i(0),
o = i(2),
s = new n({
initialize: function (t, e, i, n, s) {
var r;
"object" == typeof t
? ((t = o((r = t), "x", 0)), (e = o(r, "y", 0)), (i = o(r, "power", 0)), (n = o(r, "epsilon", 100)), (s = o(r, "gravity", 50)))
: (void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === n && (n = 100), void 0 === s && (s = 50)),
(this.x = t),
(this.y = e),
(this.active = !0),
(this._gravity = s),
(this._power = 0),
(this._epsilon = 0),
(this.power = i),
(this.epsilon = n);
},
update: function (t, e) {
var i,
n,
s = this.x - t.x,
r = this.y - t.y,
o = s * s + r * r;
0 !== o && ((i = Math.sqrt(o)), o < this._epsilon && (o = this._epsilon), (n = ((this._power * e) / (o * i)) * 100), (t.velocityX += s * n), (t.velocityY += r * n));
},
epsilon: {
get: function () {
return Math.sqrt(this._epsilon);
},
set: function (t) {
this._epsilon = t * t;
},
},
power: {
get: function () {
return this._power / this._gravity;
},
set: function (t) {
this._power = t * this._gravity;
},
},
gravity: {
get: function () {
return this._gravity;
},
set: function (t) {
var e = this.power;
(this._gravity = t), (this.power = e);
},
},
});
t.exports = s;
},
function (t, e, i) {
var n = i(0),
u = i(36),
c = i(50),
s = new n({
initialize: function (t) {
(this.emitter = t),
(this.frame = null),
(this.x = 0),
(this.y = 0),
(this.velocityX = 0),
(this.velocityY = 0),
(this.accelerationX = 0),
(this.accelerationY = 0),
(this.maxVelocityX = 1e4),
(this.maxVelocityY = 1e4),
(this.bounce = 0),
(this.scaleX = 1),
(this.scaleY = 1),
(this.alpha = 1),
(this.angle = 0),
(this.rotation = 0),
(this.tint = 16777215),
(this.life = 1e3),
(this.lifeCurrent = 1e3),
(this.delayCurrent = 0),
(this.lifeT = 0),
(this.data = { tint: { min: 16777215, max: 16777215, current: 16777215 }, alpha: { min: 1, max: 1 }, rotate: { min: 0, max: 0 }, scaleX: { min: 1, max: 1 }, scaleY: { min: 1, max: 1 } });
},
isAlive: function () {
return 0 < this.lifeCurrent;
},
resetPosition: function () {
(this.x = 0), (this.y = 0);
},
fire: function (t, e) {
var i = this.emitter;
(this.frame = i.getFrame()),
i.emitZone && i.emitZone.getPoint(this),
(this.x += void 0 === t ? i.x.onEmit(this, "x") : t),
(this.y += void 0 === e ? i.y.onEmit(this, "y") : e),
(this.life = i.lifespan.onEmit(this, "lifespan")),
(this.lifeCurrent = this.life),
(this.lifeT = 0);
var n,
s,
r,
o,
a,
h = i.speedX.onEmit(this, "speedX"),
l = i.speedY ? i.speedY.onEmit(this, "speedY") : h;
i.radial
? ((n = u(i.angle.onEmit(this, "angle"))), (this.velocityX = Math.cos(n) * Math.abs(h)), (this.velocityY = Math.sin(n) * Math.abs(l)))
: i.moveTo
? ((s = i.moveToX.onEmit(this, "moveToX")),
(r = i.moveToY ? i.moveToY.onEmit(this, "moveToY") : s),
(o = Math.atan2(r - this.y, s - this.x)),
(a = c(this.x, this.y, s, r) / (this.life / 1e3)),
(this.velocityX = Math.cos(o) * a),
(this.velocityY = Math.sin(o) * a))
: ((this.velocityX = h), (this.velocityY = l)),
i.acceleration && ((this.accelerationX = i.accelerationX.onEmit(this, "accelerationX")), (this.accelerationY = i.accelerationY.onEmit(this, "accelerationY"))),
(this.maxVelocityX = i.maxVelocityX.onEmit(this, "maxVelocityX")),
(this.maxVelocityY = i.maxVelocityY.onEmit(this, "maxVelocityY")),
(this.delayCurrent = i.delay.onEmit(this, "delay")),
(this.scaleX = i.scaleX.onEmit(this, "scaleX")),
(this.scaleY = i.scaleY ? i.scaleY.onEmit(this, "scaleY") : this.scaleX),
(this.angle = i.rotate.onEmit(this, "rotate")),
(this.rotation = u(this.angle)),
(this.bounce = i.bounce.onEmit(this, "bounce")),
(this.alpha = i.alpha.onEmit(this, "alpha")),
(this.tint = i.tint.onEmit(this, "tint"));
},
computeVelocity: function (t, e, i, n) {
var s = this.velocityX,
r = this.velocityY,
o = this.accelerationX,
a = this.accelerationY,
h = this.maxVelocityX,
l = this.maxVelocityY;
(s += t.gravityX * i), (r += t.gravityY * i), o && (s += o * i), a && (r += a * i), h < s ? (s = h) : s < -h && (s = -h), l < r ? (r = l) : r < -l && (r = -l), (this.velocityX = s), (this.velocityY = r);
for (var u = 0; u < n.length; u++) n[u].update(this, e, i);
},
checkBounds: function (t) {
var e = t.bounds,
i = -this.bounce;
this.x < e.x && t.collideLeft ? ((this.x = e.x), (this.velocityX *= i)) : this.x > e.right && t.collideRight && ((this.x = e.right), (this.velocityX *= i)),
this.y < e.y && t.collideTop ? ((this.y = e.y), (this.velocityY *= i)) : this.y > e.bottom && t.collideBottom && ((this.y = e.bottom), (this.velocityY *= i));
},
update: function (t, e, i) {
if (0 < this.delayCurrent) return (this.delayCurrent -= t), !1;
var n = this.emitter,
s = 1 - this.lifeCurrent / this.life;
return (
(this.lifeT = s),
this.computeVelocity(n, t, e, i),
(this.x += this.velocityX * e),
(this.y += this.velocityY * e),
n.bounds && this.checkBounds(n),
n.deathZone && n.deathZone.willKill(this)
? !(this.lifeCurrent = 0)
: ((this.scaleX = n.scaleX.onUpdate(this, "scaleX", s, this.scaleX)),
n.scaleY ? (this.scaleY = n.scaleY.onUpdate(this, "scaleY", s, this.scaleY)) : (this.scaleY = this.scaleX),
(this.angle = n.rotate.onUpdate(this, "rotate", s, this.angle)),
(this.rotation = u(this.angle)),
(this.alpha = n.alpha.onUpdate(this, "alpha", s, this.alpha)),
(this.tint = n.tint.onUpdate(this, "tint", s, this.tint)),
(this.lifeCurrent -= t),
this.lifeCurrent <= 0)
);
},
});
t.exports = s;
},
function (t, e, i) {
var n = i(35),
s = i(0),
r = i(11),
o = i(453),
a = i(454),
h = i(449),
l = i(2),
u = i(210),
c = i(455),
d = i(126),
f = i(451),
p = i(456),
g = i(10),
v = i(79),
y = i(3),
m = i(68),
x = new s({
Mixins: [r.BlendMode, r.Mask, r.ScrollFactor, r.Visible],
initialize: function (t, e) {
(this.manager = t),
(this.texture = t.texture),
(this.frames = [t.defaultFrame]),
(this.defaultFrame = t.defaultFrame),
(this.configFastMap = [
"active",
"blendMode",
"collideBottom",
"collideLeft",
"collideRight",
"collideTop",
"deathCallback",
"deathCallbackScope",
"emitCallback",
"emitCallbackScope",
"follow",
"frequency",
"gravityX",
"gravityY",
"maxParticles",
"name",
"on",
"particleBringToTop",
"particleClass",
"radial",
"timeScale",
"trackVisible",
"visible",
]),
(this.configOpMap = [
"accelerationX",
"accelerationY",
"angle",
"alpha",
"bounce",
"delay",
"lifespan",
"maxVelocityX",
"maxVelocityY",
"moveToX",
"moveToY",
"quantity",
"rotate",
"scaleX",
"scaleY",
"speedX",
"speedY",
"tint",
"x",
"y",
]),
(this.name = ""),
(this.particleClass = f),
(this.x = new h(e, "x", 0, !0)),
(this.y = new h(e, "y", 0, !0)),
(this.radial = !0),
(this.gravityX = 0),
(this.gravityY = 0),
(this.acceleration = !1),
(this.accelerationX = new h(e, "accelerationX", 0, !0)),
(this.accelerationY = new h(e, "accelerationY", 0, !0)),
(this.maxVelocityX = new h(e, "maxVelocityX", 1e4, !0)),
(this.maxVelocityY = new h(e, "maxVelocityY", 1e4, !0)),
(this.speedX = new h(e, "speedX", 0, !0)),
(this.speedY = new h(e, "speedY", 0, !0)),
(this.moveTo = !1),
(this.moveToX = new h(e, "moveToX", 0, !0)),
(this.moveToY = new h(e, "moveToY", 0, !0)),
(this.bounce = new h(e, "bounce", 0, !0)),
(this.scaleX = new h(e, "scaleX", 1)),
(this.scaleY = new h(e, "scaleY", 1)),
(this.tint = new h(e, "tint", 16777215)),
(this.alpha = new h(e, "alpha", 1)),
(this.lifespan = new h(e, "lifespan", 1e3, !0)),
(this.angle = new h(e, "angle", { min: 0, max: 360 }, !0)),
(this.rotate = new h(e, "rotate", 0)),
(this.emitCallback = null),
(this.emitCallbackScope = null),
(this.deathCallback = null),
(this.deathCallbackScope = null),
(this.maxParticles = 0),
(this.quantity = new h(e, "quantity", 1, !0)),
(this.delay = new h(e, "delay", 0, !0)),
(this.frequency = 0),
(this.on = !0),
(this.particleBringToTop = !0),
(this.timeScale = 1),
(this.emitZone = null),
(this.deathZone = null),
(this.bounds = null),
(this.collideLeft = !0),
(this.collideRight = !0),
(this.collideTop = !0),
(this.collideBottom = !0),
(this.active = !0),
(this.visible = !0),
(this.blendMode = n.NORMAL),
(this.follow = null),
(this.followOffset = new y()),
(this.trackVisible = !1),
(this.currentFrame = 0),
(this.randomFrame = !0),
(this.frameQuantity = 1),
(this.dead = []),
(this.alive = []),
(this._counter = 0),
(this._frameCounter = 0),
e && this.fromJSON(e);
},
fromJSON: function (t) {
if (!t) return this;
var e,
i = 0,
n = "";
for (i = 0; i < this.configFastMap.length; i++) (n = this.configFastMap[i]), d(t, n) && (this[n] = l(t, n));
for (i = 0; i < this.configOpMap.length; i++) (n = this.configOpMap[i]), d(t, n) && this[n].loadConfig(t);
return (
(this.acceleration = 0 !== this.accelerationX.propertyValue || 0 !== this.accelerationY.propertyValue),
(this.moveTo = 0 !== this.moveToX.propertyValue || 0 !== this.moveToY.propertyValue),
d(t, "speed") && (this.speedX.loadConfig(t, "speed"), (this.speedY = null)),
(c(t, ["speedX", "speedY"]) || this.moveTo) && (this.radial = !1),
d(t, "scale") && (this.scaleX.loadConfig(t, "scale"), (this.scaleY = null)),
d(t, "callbackScope") && ((e = l(t, "callbackScope", null)), (this.emitCallbackScope = e), (this.deathCallbackScope = e)),
d(t, "emitZone") && this.setEmitZone(t.emitZone),
d(t, "deathZone") && this.setDeathZone(t.deathZone),
d(t, "bounds") && this.setBounds(t.bounds),
d(t, "followOffset") && this.followOffset.setFromObject(l(t, "followOffset", 0)),
d(t, "frame") && this.setFrame(t.frame),
d(t, "reserve") && this.reserve(t.reserve),
this
);
},
toJSON: function (t) {
void 0 === t && (t = {});
var e = 0,
i = "";
for (e = 0; e < this.configFastMap.length; e++) t[(i = this.configFastMap[e])] = this[i];
for (e = 0; e < this.configOpMap.length; e++) this[(i = this.configOpMap[e])] && (t[i] = this[i].toJSON());
return this.speedY || (delete t.speedX, (t.speed = this.speedX.toJSON())), this.scaleY || (delete t.scaleX, (t.scale = this.scaleX.toJSON())), t;
},
startFollow: function (t, e, i, n) {
return void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === n && (n = !1), (this.follow = t), this.followOffset.set(e, i), (this.trackVisible = n), this;
},
stopFollow: function () {
return (this.follow = null), this.followOffset.set(0, 0), (this.trackVisible = !1), this;
},
getFrame: function () {
if (1 === this.frames.length) return this.defaultFrame;
if (this.randomFrame) return u(this.frames);
var t = this.frames[this.currentFrame];
return this._frameCounter++, this._frameCounter === this.frameQuantity && ((this._frameCounter = 0), (this.currentFrame = m(this.currentFrame + 1, 0, this._frameLength))), t;
},
setFrame: function (t, e, i) {
void 0 === e && (e = !0), void 0 === i && (i = 1), (this.randomFrame = e), (this.frameQuantity = i), (this.currentFrame = 0), (this._frameCounter = 0);
var n,
s,
r = typeof t;
return (
Array.isArray(t) || "string" == r || "number" == r
? this.manager.setEmitterFrames(t, this)
: "object" == r && ((t = l((n = t), "frames", null)) && this.manager.setEmitterFrames(t, this), (s = l(n, "cycle", !1)), (this.randomFrame = !s), (this.frameQuantity = l(n, "quantity", i))),
(this._frameLength = this.frames.length),
1 === this._frameLength && ((this.frameQuantity = 1), (this.randomFrame = !1)),
this
);
},
setRadial: function (t) {
return void 0 === t && (t = !0), (this.radial = t), this;
},
setPosition: function (t, e) {
return this.x.onChange(t), this.y.onChange(e), this;
},
setBounds: function (t, e, i, n) {
var s;
return (
"object" == typeof t && ((t = (s = t).x), (e = s.y), (i = d(s, "w") ? s.w : s.width), (n = d(s, "h") ? s.h : s.height)),
this.bounds ? this.bounds.setTo(t, e, i, n) : (this.bounds = new g(t, e, i, n)),
this
);
},
setSpeedX: function (t) {
return this.speedX.onChange(t), (this.radial = !1), this;
},
setSpeedY: function (t) {
return this.speedY && (this.speedY.onChange(t), (this.radial = !1)), this;
},
setSpeed: function (t) {
return this.speedX.onChange(t), (this.speedY = null), (this.radial = !0), this;
},
setScaleX: function (t) {
return this.scaleX.onChange(t), this;
},
setScaleY: function (t) {
return this.scaleY.onChange(t), this;
},
setScale: function (t) {
return this.scaleX.onChange(t), (this.scaleY = null), this;
},
setGravityX: function (t) {
return (this.gravityX = t), this;
},
setGravityY: function (t) {
return (this.gravityY = t), this;
},
setGravity: function (t, e) {
return (this.gravityX = t), (this.gravityY = e), this;
},
setAlpha: function (t) {
return this.alpha.onChange(t), this;
},
setTint: function (t) {
return this.tint.onChange(t), this;
},
setEmitterAngle: function (t) {
return this.angle.onChange(t), this;
},
setAngle: function (t) {
return this.angle.onChange(t), this;
},
setLifespan: function (t) {
return this.lifespan.onChange(t), this;
},
setQuantity: function (t) {
return this.quantity.onChange(t), this;
},
setFrequency: function (t, e) {
return (this.frequency = t), (this._counter = 0), e && this.quantity.onChange(e), this;
},
setEmitZone: function (t) {
if (void 0 === t) this.emitZone = null;
else {
var e = l(t, "type", "random"),
i = l(t, "source", null);
switch (e) {
case "random":
this.emitZone = new p(i);
break;
case "edge":
var n = l(t, "quantity", 1),
s = l(t, "stepRate", 0),
r = l(t, "yoyo", !1),
o = l(t, "seamless", !0);
this.emitZone = new a(i, n, s, r, o);
}
}
return this;
},
setDeathZone: function (t) {
var e, i, n;
return void 0 === t ? (this.deathZone = null) : ((e = l(t, "type", "onEnter")), (i = l(t, "source", null)) && "function" == typeof i.contains && ((n = "onEnter" === e), (this.deathZone = new o(i, n)))), this;
},
reserve: function (t) {
for (var e = this.dead, i = 0; i < t; i++) e.push(new this.particleClass(this));
return this;
},
getAliveParticleCount: function () {
return this.alive.length;
},
getDeadParticleCount: function () {
return this.dead.length;
},
getParticleCount: function () {
return this.getAliveParticleCount() + this.getDeadParticleCount();
},
atLimit: function () {
return 0 < this.maxParticles && this.getParticleCount() === this.maxParticles;
},
onParticleEmit: function (t, e) {
return void 0 === t ? ((this.emitCallback = null), (this.emitCallbackScope = null)) : "function" == typeof t && ((this.emitCallback = t), e && (this.emitCallbackScope = e)), this;
},
onParticleDeath: function (t, e) {
return void 0 === t ? ((this.deathCallback = null), (this.deathCallbackScope = null)) : "function" == typeof t && ((this.deathCallback = t), e && (this.deathCallbackScope = e)), this;
},
killAll: function () {
for (var t = this.dead, e = this.alive; 0 < e.length; ) t.push(e.pop());
return this;
},
forEachAlive: function (t, e) {
for (var i = this.alive, n = i.length, s = 0; s < n; ++s) t.call(e, i[s], this);
return this;
},
forEachDead: function (t, e) {
for (var i = this.dead, n = i.length, s = 0; s < n; ++s) t.call(e, i[s], this);
return this;
},
start: function () {
return (this.on = !0), (this._counter = 0), this;
},
stop: function () {
return (this.on = !1), this;
},
pause: function () {
return (this.active = !1), this;
},
resume: function () {
return (this.active = !0), this;
},
remove: function () {
return this.manager.removeEmitter(this), this;
},
depthSort: function () {
return v(this.alive, this.depthSortCallback), this;
},
flow: function (t, e) {
return void 0 === e && (e = 1), (this.frequency = t), this.quantity.onChange(e), this.start();
},
explode: function (t, e, i) {
return (this.frequency = -1), this.emitParticle(t, e, i);
},
emitParticleAt: function (t, e, i) {
return this.emitParticle(i, t, e);
},
emitParticle: function (t, e, i) {
if (!this.atLimit()) {
void 0 === t && (t = this.quantity.onEmit());
for (var n = this.dead, s = this.follow ? this.follow.x + this.followOffset.x : e, r = this.follow ? this.follow.y + this.followOffset.y : i, o = 0; o < t; o++) {
var a = n.pop();
if (
((a = a || new this.particleClass(this)).fire(s, r),
this.particleBringToTop ? this.alive.push(a) : this.alive.unshift(a),
this.emitCallback && this.emitCallback.call(this.emitCallbackScope, a, this),
this.atLimit())
)
break;
}
return a;
}
},
preUpdate: function (t, e) {
var i = (e *= this.timeScale) / 1e3;
this.trackVisible && (this.visible = this.follow.visible);
var n = this.manager.getProcessors(),
s = this.alive,
r = this.dead,
o = 0,
a = [],
h = s.length;
for (o = 0; o < h; o++) {
var l = s[o];
l.update(e, i, n) && a.push({ index: o, particle: l });
}
if (0 < (h = a.length)) {
var u = this.deathCallback,
c = this.deathCallbackScope;
for (o = h - 1; 0 <= o; o--) {
var d = a[o];
s.splice(d.index, 1), r.push(d.particle), u && u.call(c, d.particle), d.particle.resetPosition();
}
}
this.on && (0 === this.frequency ? this.emitParticle() : 0 < this.frequency && ((this._counter -= e), this._counter <= 0 && (this.emitParticle(), (this._counter = this.frequency - Math.abs(this._counter)))));
},
depthSortCallback: function (t, e) {
return t.y - e.y;
},
});
t.exports = x;
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e) {
(this.source = t), (this.killOnEnter = e);
},
willKill: function (t) {
var e = this.source.contains(t.x, t.y);
return (e && this.killOnEnter) || (!e && !this.killOnEnter);
},
});
t.exports = n;
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e, i, n, s) {
void 0 === n && (n = !1),
void 0 === s && (s = !0),
(this.source = t),
(this.points = []),
(this.quantity = e),
(this.stepRate = i),
(this.yoyo = n),
(this.counter = -1),
(this.seamless = s),
(this._length = 0),
(this._direction = 0),
this.updateSource();
},
updateSource: function () {
var t, e;
(this.points = this.source.getPoints(this.quantity, this.stepRate)), this.seamless && ((t = this.points[0]), (e = this.points[this.points.length - 1]), t.x === e.x && t.y === e.y && this.points.pop());
var i = this._length;
return (this._length = this.points.length), this._length < i && this.counter > this._length && (this.counter = this._length - 1), this;
},
changeSource: function (t) {
return (this.source = t), this.updateSource();
},
getPoint: function (t) {
0 === this._direction
? (this.counter++, this.counter >= this._length && (this.yoyo ? ((this._direction = 1), (this.counter = this._length - 1)) : (this.counter = 0)))
: (this.counter--, -1 === this.counter && (this.yoyo ? ((this._direction = 0), (this.counter = 0)) : (this.counter = this._length - 1)));
var e = this.points[this.counter];
e && ((t.x = e.x), (t.y = e.y));
},
});
t.exports = n;
},
function (t, e) {
t.exports = function (t, e) {
for (var i = 0; i < e.length; i++) if (t.hasOwnProperty(e[i])) return !0;
return !1;
};
},
function (t, e, i) {
var n = i(0),
s = i(3),
r = new n({
initialize: function (t) {
(this.source = t), (this._tempVec = new s());
},
getPoint: function (t) {
var e = this._tempVec;
this.source.getRandomPoint(e), (t.x = e.x), (t.y = e.y);
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(0),
s = i(11),
o = i(73),
r = new n({
Extends: o,
Mixins: [s.PathFollower],
initialize: function (t, e, i, n, s, r) {
o.call(this, t, i, n, s, r), (this.path = e);
},
preUpdate: function (t, e) {
this.anims.update(t, e), this.pathUpdate(t);
},
});
t.exports = r;
},
function (t, e) {
t.exports = function (t, e, i) {
var n = t.canvas,
s = t.context,
r = t.style,
o = [],
a = 0,
h = i.length;
0 < r.maxLines && r.maxLines < i.length && (h = r.maxLines), r.syncFont(n, s);
for (var l = 0; l < h; l++) {
var u = r.strokeThickness;
(u += s.measureText(i[l]).width), r.wordWrap && (u -= s.measureText(" ").width), (o[l] = Math.ceil(u)), (a = Math.max(a, o[l]));
}
var c = e.fontSize + r.strokeThickness,
d = c * h,
f = t.lineSpacing;
return 1 < h && (d += f * (h - 1)), { width: a, height: d, lines: h, lineWidths: o, lineSpacing: f, lineHeight: c };
};
},
function (t, e, i) {
var n = i(0),
a = i(13),
h = i(6),
s = i(460),
l = {
fontFamily: ["fontFamily", "Courier"],
fontSize: ["fontSize", "16px"],
fontStyle: ["fontStyle", ""],
backgroundColor: ["backgroundColor", null],
color: ["color", "#fff"],
stroke: ["stroke", "#fff"],
strokeThickness: ["strokeThickness", 0],
shadowOffsetX: ["shadow.offsetX", 0],
shadowOffsetY: ["shadow.offsetY", 0],
shadowColor: ["shadow.color", "#000"],
shadowBlur: ["shadow.blur", 0],
shadowStroke: ["shadow.stroke", !1],
shadowFill: ["shadow.fill", !1],
align: ["align", "left"],
maxLines: ["maxLines", 0],
fixedWidth: ["fixedWidth", 0],
fixedHeight: ["fixedHeight", 0],
resolution: ["resolution", 0],
rtl: ["rtl", !1],
testString: ["testString", "|MÉqgy"],
baselineX: ["baselineX", 1.2],
baselineY: ["baselineY", 1.4],
wordWrapWidth: ["wordWrap.width", null],
wordWrapCallback: ["wordWrap.callback", null],
wordWrapCallbackScope: ["wordWrap.callbackScope", null],
wordWrapUseAdvanced: ["wordWrap.useAdvancedWrap", !1],
},
r = new n({
initialize: function (t, e) {
(this.parent = t),
this.fontFamily,
this.fontSize,
this.fontStyle,
this.backgroundColor,
this.color,
this.stroke,
this.strokeThickness,
this.shadowOffsetX,
this.shadowOffsetY,
this.shadowColor,
this.shadowBlur,
this.shadowStroke,
this.shadowFill,
this.align,
this.maxLines,
this.fixedWidth,
this.fixedHeight,
this.resolution,
this.rtl,
this.testString,
this.baselineX,
this.baselineY,
this.wordWrapWidth,
this.wordWrapCallback,
this.wordWrapCallbackScope,
this.wordWrapUseAdvanced,
this._font,
this.setStyle(e, !1, !0);
var i = h(e, "metrics", !1);
this.metrics = i ? { ascent: h(i, "ascent", 0), descent: h(i, "descent", 0), fontSize: h(i, "fontSize", 0) } : s(this);
},
setStyle: function (t, e, i) {
for (var n in (void 0 === e && (e = !0), void 0 === i && (i = !1), t && t.hasOwnProperty("fontSize") && "number" == typeof t.fontSize && (t.fontSize = t.fontSize.toString() + "px"), l)) {
var s = i ? l[n][1] : this[n];
this[n] = ("wordWrapCallback" === n || "wordWrapCallbackScope" === n ? h : a)(t, l[n][0], s);
}
var r = h(t, "font", null);
null !== r && this.setFont(r, !1), (this._font = [this.fontStyle, this.fontSize, this.fontFamily].join(" ").trim());
var o = h(t, "fill", null);
return null !== o && (this.color = o), e ? this.update(!0) : this.parent;
},
syncFont: function (t, e) {
e.font = this._font;
},
syncStyle: function (t, e) {
(e.textBaseline = "alphabetic"), (e.fillStyle = this.color), (e.strokeStyle = this.stroke), (e.lineWidth = this.strokeThickness), (e.lineCap = "round"), (e.lineJoin = "round");
},
syncShadow: function (t, e) {
e
? ((t.shadowOffsetX = this.shadowOffsetX), (t.shadowOffsetY = this.shadowOffsetY), (t.shadowColor = this.shadowColor), (t.shadowBlur = this.shadowBlur))
: ((t.shadowOffsetX = 0), (t.shadowOffsetY = 0), (t.shadowColor = 0), (t.shadowBlur = 0));
},
update: function (t) {
return t && ((this._font = [this.fontStyle, this.fontSize, this.fontFamily].join(" ").trim()), (this.metrics = s(this))), this.parent.updateText();
},
setFont: function (t, e) {
void 0 === e && (e = !0);
var i,
n,
s = t,
r = "",
o = "";
return (
"string" != typeof t
? ((s = h(t, "fontFamily", "Courier")), (r = h(t, "fontSize", "16px")), (o = h(t, "fontStyle", "")))
: ((n = 0), (o = 2 < (i = t.split(" ")).length ? i[n++] : ""), (r = i[n++] || "16px"), (s = i[n++] || "Courier")),
(s === this.fontFamily && r === this.fontSize && o === this.fontStyle) || ((this.fontFamily = s), (this.fontSize = r), (this.fontStyle = o), e && this.update(!0)),
this.parent
);
},
setFontFamily: function (t) {
return this.fontFamily !== t && ((this.fontFamily = t), this.update(!0)), this.parent;
},
setFontStyle: function (t) {
return this.fontStyle !== t && ((this.fontStyle = t), this.update(!0)), this.parent;
},
setFontSize: function (t) {
return "number" == typeof t && (t = t.toString() + "px"), this.fontSize !== t && ((this.fontSize = t), this.update(!0)), this.parent;
},
setTestString: function (t) {
return (this.testString = t), this.update(!0);
},
setFixedSize: function (t, e) {
return (this.fixedWidth = t), (this.fixedHeight = e), t && (this.parent.width = t), e && (this.parent.height = e), this.update(!1);
},
setBackgroundColor: function (t) {
return (this.backgroundColor = t), this.update(!1);
},
setFill: function (t) {
return (this.color = t), this.update(!1);
},
setColor: function (t) {
return (this.color = t), this.update(!1);
},
setResolution: function (t) {
return (this.resolution = t), this.update(!1);
},
setStroke: function (t, e) {
return (
void 0 === e && (e = this.strokeThickness),
void 0 === t && 0 !== this.strokeThickness
? ((this.strokeThickness = 0), this.update(!0))
: (this.stroke === t && this.strokeThickness === e) || ((this.stroke = t), (this.strokeThickness = e), this.update(!0)),
this.parent
);
},
setShadow: function (t, e, i, n, s, r) {
return (
void 0 === t && (t = 0),
void 0 === e && (e = 0),
void 0 === i && (i = "#000"),
void 0 === n && (n = 0),
void 0 === s && (s = !1),
void 0 === r && (r = !0),
(this.shadowOffsetX = t),
(this.shadowOffsetY = e),
(this.shadowColor = i),
(this.shadowBlur = n),
(this.shadowStroke = s),
(this.shadowFill = r),
this.update(!1)
);
},
setShadowOffset: function (t, e) {
return void 0 === t && (t = 0), void 0 === e && (e = t), (this.shadowOffsetX = t), (this.shadowOffsetY = e), this.update(!1);
},
setShadowColor: function (t) {
return void 0 === t && (t = "#000"), (this.shadowColor = t), this.update(!1);
},
setShadowBlur: function (t) {
return void 0 === t && (t = 0), (this.shadowBlur = t), this.update(!1);
},
setShadowStroke: function (t) {
return (this.shadowStroke = t), this.update(!1);
},
setShadowFill: function (t) {
return (this.shadowFill = t), this.update(!1);
},
setWordWrapWidth: function (t, e) {
return void 0 === e && (e = !1), (this.wordWrapWidth = t), (this.wordWrapUseAdvanced = e), this.update(!1);
},
setWordWrapCallback: function (t, e) {
return void 0 === e && (e = null), (this.wordWrapCallback = t), (this.wordWrapCallbackScope = e), this.update(!1);
},
setAlign: function (t) {
return void 0 === t && (t = "left"), (this.align = t), this.update(!1);
},
setMaxLines: function (t) {
return void 0 === t && (t = 0), (this.maxLines = t), this.update(!1);
},
getTextMetrics: function () {
var t = this.metrics;
return { ascent: t.ascent, descent: t.descent, fontSize: t.fontSize };
},
toJSON: function () {
var t = {};
for (var e in l) t[e] = this[e];
return (t.metrics = this.getTextMetrics()), t;
},
destroy: function () {
this.parent = void 0;
},
});
t.exports = r;
},
function (t, e, i) {
var m = i(31);
t.exports = function (t) {
var e = m.create(this),
i = e.getContext("2d");
t.syncFont(e, i);
var n = i.measureText(t.testString);
if ("actualBoundingBoxAscent" in n) {
var s = n.actualBoundingBoxAscent,
r = n.actualBoundingBoxDescent;
return m.remove(e), { ascent: s, descent: r, fontSize: s + r };
}
var o = Math.ceil(n.width * t.baselineX),
a = 2 * (h = o),
h = (h * t.baselineY) | 0;
(e.width = o), (e.height = a), (i.fillStyle = "#f00"), i.fillRect(0, 0, o, a), (i.font = t._font), (i.textBaseline = "alphabetic"), (i.fillStyle = "#000"), i.fillText(t.testString, 0, h);
var l = { ascent: 0, descent: 0, fontSize: 0 },
u = i.getImageData(0, 0, o, a);
if (!u) return (l.ascent = h), (l.descent = 6 + h), (l.fontSize = l.ascent + l.descent), m.remove(e), l;
for (var c, d = u.data, f = d.length, p = 4 * o, g = 0, v = !1, y = 0; y < h; y++) {
for (c = 0; c < p; c += 4)
if (255 !== d[g + c]) {
v = !0;
break;
}
if (v) break;
g += p;
}
for (l.ascent = h - y, g = f - p, v = !1, y = a; h < y; y--) {
for (c = 0; c < p; c += 4)
if (255 !== d[g + c]) {
v = !0;
break;
}
if (v) break;
g -= p;
}
return (l.descent = y - h), (l.fontSize = l.ascent + l.descent), m.remove(e), l;
};
},
function (t, e, i) {
var n = i(1097),
s = i(0),
l = i(36),
u = i(59),
c = i(65),
d = i(14),
f = i(34),
r = new s({
Extends: f,
Mixins: [n],
initialize: function (t, e, i, n, s, r, o, a, h) {
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 128),
void 0 === s && (s = 0),
void 0 === r && (r = 360),
void 0 === o && (o = !1),
f.call(this, t, "Arc", new c(0, 0, n)),
(this._startAngle = s),
(this._endAngle = r),
(this._anticlockwise = o),
(this._iterations = 0.01),
this.setPosition(e, i);
var l = 2 * this.geom.radius;
this.setSize(l, l), void 0 !== a && this.setFillStyle(a, h), this.updateDisplayOrigin(), this.updateData();
},
iterations: {
get: function () {
return this._iterations;
},
set: function (t) {
(this._iterations = t), this.updateData();
},
},
radius: {
get: function () {
return this.geom.radius;
},
set: function (t) {
var e = 2 * (this.geom.radius = t);
this.setSize(e, e), this.updateDisplayOrigin(), this.updateData();
},
},
startAngle: {
get: function () {
return this._startAngle;
},
set: function (t) {
(this._startAngle = t), this.updateData();
},
},
endAngle: {
get: function () {
return this._endAngle;
},
set: function (t) {
(this._endAngle = t), this.updateData();
},
},
anticlockwise: {
get: function () {
return this._anticlockwise;
},
set: function (t) {
(this._anticlockwise = t), this.updateData();
},
},
setRadius: function (t) {
return (this.radius = t), this;
},
setIterations: function (t) {
return void 0 === t && (t = 0.01), (this.iterations = t), this;
},
setStartAngle: function (t, e) {
return (this._startAngle = t), void 0 !== e && (this._anticlockwise = e), this.updateData();
},
setEndAngle: function (t, e) {
return (this._endAngle = t), void 0 !== e && (this._anticlockwise = e), this.updateData();
},
updateData: function () {
var t = this._iterations,
e = t,
i = this.geom.radius,
n = l(this._startAngle),
s = l(this._endAngle),
r = i,
o = i;
(s -= n), this._anticlockwise ? (s < -d.PI2 ? (s = -d.PI2) : 0 < s && (s = -d.PI2 + (s % d.PI2))) : s > d.PI2 ? (s = d.PI2) : s < 0 && (s = d.PI2 + (s % d.PI2));
for (var a, h = [r + Math.cos(n) * i, o + Math.sin(n) * i]; e < 1; ) (a = s * e + n), h.push(r + Math.cos(a) * i, o + Math.sin(a) * i), (e += t);
return (a = s + n), h.push(r + Math.cos(a) * i, o + Math.sin(a) * i), h.push(r + Math.cos(n) * i, o + Math.sin(n) * i), (this.pathIndexes = u(h)), (this.pathData = h), this;
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(0),
s = i(1100),
r = i(59),
o = i(10),
a = i(34),
h = new n({
Extends: a,
Mixins: [s],
initialize: function (t, e, i, n, s, r) {
void 0 === e && (e = 0),
void 0 === i && (i = 0),
a.call(this, t, "Curve", n),
(this._smoothness = 32),
(this._curveBounds = new o()),
(this.closePath = !1),
this.setPosition(e, i),
void 0 !== s && this.setFillStyle(s, r),
this.updateData();
},
smoothness: {
get: function () {
return this._smoothness;
},
set: function (t) {
(this._smoothness = t), this.updateData();
},
},
setSmoothness: function (t) {
return (this._smoothness = t), this.updateData();
},
updateData: function () {
var t = this._curveBounds,
e = this._smoothness;
this.geom.getBounds(t, e), this.setSize(t.width, t.height), this.updateDisplayOrigin();
for (var i = [], n = this.geom.getPoints(e), s = 0; s < n.length; s++) i.push(n[s].x, n[s].y);
return i.push(n[0].x, n[0].y), (this.pathIndexes = r(i)), (this.pathData = i), this;
},
});
t.exports = h;
},
function (t, e, i) {
var n = i(0),
s = i(59),
r = i(1103),
a = i(111),
h = i(34),
o = new n({
Extends: h,
Mixins: [r],
initialize: function (t, e, i, n, s, r, o) {
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 128),
void 0 === s && (s = 128),
h.call(this, t, "Ellipse", new a(n / 2, s / 2, n, s)),
(this._smoothness = 64),
this.setPosition(e, i),
(this.width = n),
(this.height = s),
void 0 !== r && this.setFillStyle(r, o),
this.updateDisplayOrigin(),
this.updateData();
},
smoothness: {
get: function () {
return this._smoothness;
},
set: function (t) {
(this._smoothness = t), this.updateData();
},
},
setSize: function (t, e) {
return (this.width = t), (this.height = e), this.geom.setPosition(t / 2, e / 2), this.geom.setSize(t, e), this.updateData();
},
setSmoothness: function (t) {
return (this._smoothness = t), this.updateData();
},
updateData: function () {
for (var t = [], e = this.geom.getPoints(this._smoothness), i = 0; i < e.length; i++) t.push(e[i].x, e[i].y);
return t.push(e[0].x, e[0].y), (this.pathIndexes = s(t)), (this.pathData = t), this;
},
});
t.exports = o;
},
function (t, e, i) {
var n = i(0),
c = i(34),
s = i(1106),
r = new n({
Extends: c,
Mixins: [s],
initialize: function (t, e, i, n, s, r, o, a, h, l, u) {
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 128),
void 0 === s && (s = 128),
void 0 === r && (r = 32),
void 0 === o && (o = 32),
c.call(this, t, "Grid", null),
(this.cellWidth = r),
(this.cellHeight = o),
(this.showCells = !0),
(this.outlineFillColor = 0),
(this.outlineFillAlpha = 0),
(this.showOutline = !0),
(this.showAltCells = !1),
this.altFillColor,
this.altFillAlpha,
this.setPosition(e, i),
this.setSize(n, s),
this.setFillStyle(a, h),
void 0 !== l && this.setOutlineStyle(l, u),
this.updateDisplayOrigin();
},
setFillStyle: function (t, e) {
return void 0 === e && (e = 1), void 0 === t ? (this.showCells = !1) : ((this.fillColor = t), (this.fillAlpha = e), (this.showCells = !0)), this;
},
setAltFillStyle: function (t, e) {
return void 0 === e && (e = 1), void 0 === t ? (this.showAltCells = !1) : ((this.altFillColor = t), (this.altFillAlpha = e), (this.showAltCells = !0)), this;
},
setOutlineStyle: function (t, e) {
return void 0 === e && (e = 1), void 0 === t ? (this.showOutline = !1) : ((this.outlineFillColor = t), (this.outlineFillAlpha = e), (this.showOutline = !0)), this;
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(1109),
s = i(0),
h = i(34),
r = new s({
Extends: h,
Mixins: [n],
initialize: function (t, e, i, n, s, r, o, a) {
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 48),
void 0 === s && (s = 32),
void 0 === r && (r = 15658734),
void 0 === o && (o = 10066329),
void 0 === a && (a = 13421772),
h.call(this, t, "IsoBox", null),
(this.projection = 4),
(this.fillTop = r),
(this.fillLeft = o),
(this.fillRight = a),
(this.showTop = !0),
(this.showLeft = !0),
(this.showRight = !0),
(this.isFilled = !0),
this.setPosition(e, i),
this.setSize(n, s),
this.updateDisplayOrigin();
},
setProjection: function (t) {
return (this.projection = t), this;
},
setFaces: function (t, e, i) {
return void 0 === t && (t = !0), void 0 === e && (e = !0), void 0 === i && (i = !0), (this.showTop = t), (this.showLeft = e), (this.showRight = i), this;
},
setFillStyle: function (t, e, i) {
return (this.fillTop = t), (this.fillLeft = e), (this.fillRight = i), (this.isFilled = !0), this;
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(0),
s = i(1112),
l = i(34),
r = new n({
Extends: l,
Mixins: [s],
initialize: function (t, e, i, n, s, r, o, a, h) {
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 48),
void 0 === s && (s = 32),
void 0 === r && (r = !1),
void 0 === o && (o = 15658734),
void 0 === a && (a = 10066329),
void 0 === h && (h = 13421772),
l.call(this, t, "IsoTriangle", null),
(this.projection = 4),
(this.fillTop = o),
(this.fillLeft = a),
(this.fillRight = h),
(this.showTop = !0),
(this.showLeft = !0),
(this.showRight = !0),
(this.isReversed = r),
(this.isFilled = !0),
this.setPosition(e, i),
this.setSize(n, s),
this.updateDisplayOrigin();
},
setProjection: function (t) {
return (this.projection = t), this;
},
setReversed: function (t) {
return (this.isReversed = t), this;
},
setFaces: function (t, e, i) {
return void 0 === t && (t = !0), void 0 === e && (e = !0), void 0 === i && (i = !0), (this.showTop = t), (this.showLeft = e), (this.showRight = i), this;
},
setFillStyle: function (t, e, i) {
return (this.fillTop = t), (this.fillLeft = e), (this.fillRight = i), (this.isFilled = !0), this;
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(0),
c = i(34),
d = i(47),
s = i(1115),
r = new n({
Extends: c,
Mixins: [s],
initialize: function (t, e, i, n, s, r, o, a, h) {
void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === n && (n = 0), void 0 === s && (s = 0), void 0 === r && (r = 128), void 0 === o && (o = 0), c.call(this, t, "Line", new d(n, s, r, o));
var l = Math.max(1, this.geom.right - this.geom.left),
u = Math.max(1, this.geom.bottom - this.geom.top);
(this.lineWidth = 1), (this._startWidth = 1), (this._endWidth = 1), this.setPosition(e, i), this.setSize(l, u), void 0 !== a && this.setStrokeStyle(1, a, h), this.updateDisplayOrigin();
},
setLineWidth: function (t, e) {
return void 0 === e && (e = t), (this._startWidth = t), (this._endWidth = e), (this.lineWidth = t), this;
},
setTo: function (t, e, i, n) {
return this.geom.setTo(t, e, i, n), this;
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(1118),
s = i(0),
r = i(59),
a = i(469),
h = i(227),
l = i(34),
o = i(472),
u = new s({
Extends: l,
Mixins: [n],
initialize: function (t, e, i, n, s, r) {
void 0 === e && (e = 0), void 0 === i && (i = 0), l.call(this, t, "Polygon", new h(n));
var o = a(this.geom);
this.setPosition(e, i), this.setSize(o.width, o.height), void 0 !== s && this.setFillStyle(s, r), this.updateDisplayOrigin(), this.updateData();
},
smooth: function (t) {
void 0 === t && (t = 1);
for (var e = 0; e < t; e++) o(this.geom);
return this.updateData();
},
updateData: function () {
for (var t = [], e = this.geom.points, i = 0; i < e.length; i++) t.push(e[i].x, e[i].y);
return t.push(e[0].x, e[0].y), (this.pathIndexes = r(t)), (this.pathData = t), this;
},
});
t.exports = u;
},
function (t, e, i) {
var h = i(10);
t.exports = function (t, e) {
void 0 === e && (e = new h());
for (var i, n = 1 / 0, s = 1 / 0, r = -n, o = -s, a = 0; a < t.points.length; a++) (i = t.points[a]), (n = Math.min(n, i.x)), (s = Math.min(s, i.y)), (r = Math.max(r, i.x)), (o = Math.max(o, i.y));
return (e.x = n), (e.y = s), (e.width = r - n), (e.height = o - s), e;
};
},
function (t, e, i) {
var g = i(67),
v = i(47),
y = i(471);
t.exports = function (t, e, i, n) {
void 0 === n && (n = []);
var s = t.points,
r = y(t);
!e && 0 < i && (e = r / i);
for (var o = 0; o < e; o++)
for (var a = r * (o / e), h = 0, l = 0; l < s.length; l++) {
var u = s[l],
c = s[(l + 1) % s.length],
d = new v(u.x, u.y, c.x, c.y),
f = g(d);
if (!(a < h || h + f < a)) {
var p = d.getPoint((a - h) / f);
n.push(p);
break;
}
h += f;
}
return n;
};
},
function (t, e, i) {
var a = i(67),
h = i(47);
t.exports = function (t) {
for (var e = t.points, i = 0, n = 0; n < e.length; n++) {
var s = e[n],
r = e[(n + 1) % e.length],
o = new h(s.x, s.y, r.x, r.y);
i += a(o);
}
return i;
};
},
function (t, e) {
function c(t, e) {
return (t[0] = e[0]), (t[1] = e[1]), t;
}
t.exports = function (t) {
for (var e = [], i = t.points, n = 0; n < i.length; n++) e.push([i[n].x, i[n].y]);
var s = [];
for (0 < e.length && s.push(c([0, 0], e[0])), n = 0; n < e.length - 1; n++) {
var r = e[n],
o = e[n + 1],
a = r[0],
h = r[1],
l = o[0],
u = o[1];
s.push([0.85 * a + 0.15 * l, 0.85 * h + 0.15 * u]), s.push([0.15 * a + 0.85 * l, 0.15 * h + 0.85 * u]);
}
return 1 < e.length && s.push(c([0, 0], e[e.length - 1])), t.setTo(s);
};
},
function (t, e, i) {
var n = i(0),
a = i(10),
h = i(34),
s = i(1121),
r = new n({
Extends: h,
Mixins: [s],
initialize: function (t, e, i, n, s, r, o) {
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 128),
void 0 === s && (s = 128),
h.call(this, t, "Rectangle", new a(0, 0, n, s)),
this.setPosition(e, i),
this.setSize(n, s),
void 0 !== r && this.setFillStyle(r, o),
this.updateDisplayOrigin(),
this.updateData();
},
setSize: function (t, e) {
return (this.width = t), (this.height = e), this.geom.setSize(t, e), this.updateData(), this;
},
updateData: function () {
var t = [],
e = this.geom,
i = this._tempLine;
return e.getLineA(i), t.push(i.x1, i.y1, i.x2, i.y2), e.getLineB(i), t.push(i.x2, i.y2), e.getLineC(i), t.push(i.x2, i.y2), e.getLineD(i), t.push(i.x2, i.y2), (this.pathData = t), this;
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(1124),
s = i(0),
l = i(59),
h = i(34),
r = new s({
Extends: h,
Mixins: [n],
initialize: function (t, e, i, n, s, r, o, a) {
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 5),
void 0 === s && (s = 32),
void 0 === r && (r = 64),
h.call(this, t, "Star", null),
(this._points = n),
(this._innerRadius = s),
(this._outerRadius = r),
this.setPosition(e, i),
this.setSize(2 * r, 2 * r),
void 0 !== o && this.setFillStyle(o, a),
this.updateDisplayOrigin(),
this.updateData();
},
setPoints: function (t) {
return (this._points = t), this.updateData();
},
setInnerRadius: function (t) {
return (this._innerRadius = t), this.updateData();
},
setOuterRadius: function (t) {
return (this._outerRadius = t), this.updateData();
},
points: {
get: function () {
return this._points;
},
set: function (t) {
(this._points = t), this.updateData();
},
},
innerRadius: {
get: function () {
return this._innerRadius;
},
set: function (t) {
(this._innerRadius = t), this.updateData();
},
},
outerRadius: {
get: function () {
return this._outerRadius;
},
set: function (t) {
(this._outerRadius = t), this.updateData();
},
},
updateData: function () {
var t = [],
e = this._points,
i = this._innerRadius,
n = this._outerRadius,
s = (Math.PI / 2) * 3,
r = Math.PI / e,
o = n,
a = n;
t.push(o, a + -n);
for (var h = 0; h < e; h++) t.push(o + Math.cos(s) * n, a + Math.sin(s) * n), (s += r), t.push(o + Math.cos(s) * i, a + Math.sin(s) * i), (s += r);
return t.push(o, a + -n), (this.pathIndexes = l(t)), (this.pathData = t), this;
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(0),
f = i(34),
p = i(82),
s = i(1127),
r = new n({
Extends: f,
Mixins: [s],
initialize: function (t, e, i, n, s, r, o, a, h, l, u) {
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 0),
void 0 === s && (s = 128),
void 0 === r && (r = 64),
void 0 === o && (o = 0),
void 0 === a && (a = 128),
void 0 === h && (h = 128),
f.call(this, t, "Triangle", new p(n, s, r, o, a, h));
var c = this.geom.right - this.geom.left,
d = this.geom.bottom - this.geom.top;
this.setPosition(e, i), this.setSize(c, d), void 0 !== l && this.setFillStyle(l, u), this.updateDisplayOrigin(), this.updateData();
},
setTo: function (t, e, i, n, s, r) {
return this.geom.setTo(t, e, i, n, s, r), this.updateData();
},
updateData: function () {
var t = [],
e = this.geom,
i = this._tempLine;
return e.getLineA(i), t.push(i.x1, i.y1, i.x2, i.y2), e.getLineB(i), t.push(i.x2, i.y2), e.getLineC(i), t.push(i.x2, i.y2), (this.pathData = t), this;
},
});
t.exports = r;
},
function (t, e, i) {
var c = i(4),
d = i(67);
t.exports = function (t, e, i) {
void 0 === i && (i = new c());
var n = t.getLineA(),
s = t.getLineB(),
r = t.getLineC();
if (e <= 0 || 1 <= e) return (i.x = n.x1), (i.y = n.y1), i;
var o = d(n),
a = d(s),
h = d(r),
l = (o + a + h) * e,
u = 0;
return (
l < o
? ((u = l / o), (i.x = n.x1 + (n.x2 - n.x1) * u), (i.y = n.y1 + (n.y2 - n.y1) * u))
: o + a < l
? ((u = (l -= o + a) / h), (i.x = r.x1 + (r.x2 - r.x1) * u), (i.y = r.y1 + (r.y2 - r.y1) * u))
: ((u = (l -= o) / a), (i.x = s.x1 + (s.x2 - s.x1) * u), (i.y = s.y1 + (s.y2 - s.y1) * u)),
i
);
};
},
function (t, e, i) {
var g = i(67),
v = i(4);
t.exports = function (t, e, i, n) {
void 0 === n && (n = []);
var s = t.getLineA(),
r = t.getLineB(),
o = t.getLineC(),
a = g(s),
h = g(r),
l = g(o),
u = a + h + l;
!e && 0 < i && (e = u / i);
for (var c = 0; c < e; c++) {
var d = u * (c / e),
f = 0,
p = new v();
d < a
? ((f = d / a), (p.x = s.x1 + (s.x2 - s.x1) * f), (p.y = s.y1 + (s.y2 - s.y1) * f))
: a + h < d
? ((f = (d -= a + h) / l), (p.x = o.x1 + (o.x2 - o.x1) * f), (p.y = o.y1 + (o.y2 - o.y1) * f))
: ((f = (d -= a) / h), (p.x = r.x1 + (r.x2 - r.x1) * f), (p.y = r.y1 + (r.y2 - r.y1) * f)),
n.push(p);
}
return n;
};
},
function (t, e) {
t.exports = function (t, e, i) {
if (!t || "number" == typeof t) return !1;
if (t.hasOwnProperty(e)) return (t[e] = i), !0;
if (-1 === e.indexOf(".")) return !1;
for (var n = e.split("."), s = t, r = t, o = 0; o < n.length; o++) {
if (!s.hasOwnProperty(n[o])) return !1;
s = (r = s)[n[o]];
}
return (r[n[n.length - 1]] = i), !0;
};
},
function (t, e, i) {
var O = i(116),
k = i(117);
t.exports = function (t, e, i, n, s, r, o) {
if ((void 0 === n && (n = !1), void 0 === r && (r = 16777215), void 0 === o && (o = 1), t.length === e.length)) {
var a = { faces: [], vertices: [] },
h = n ? 3 : 2,
l = Array.isArray(r),
u = Array.isArray(o);
if (Array.isArray(i) && 0 < i.length)
for (P = 0; P < i.length; P++) {
var c = i[P],
d = 2 * i[P],
f = i[P] * h,
p = t[f],
g = t[1 + f],
v = n ? t[2 + f] : 0,
y = e[d],
m = e[1 + d],
x = l ? r[c] : r,
b = u ? o[c] : o,
w = 0,
T = 0,
S = 0;
s && ((w = s[f]), (T = s[1 + f]), (S = n ? s[2 + f] : 0)), a.vertices.push(new k(p, g, v, y, m, x, b, w, T, S));
}
else
for (var _ = 0, E = 0, P = 0; P < t.length; P += h)
(p = t[P]),
(g = t[P + 1]),
(v = n ? t[P + 2] : 0),
(y = e[_]),
(m = e[_ + 1]),
(x = l ? r[E] : r),
(b = u ? o[E] : o),
(S = T = w = 0),
s && ((w = s[P]), (T = s[P + 1]), (S = n ? s[P + 2] : 0)),
a.vertices.push(new k(p, g, v, y, m, x, b, w, T, S)),
(_ += 2),
E++;
for (P = 0; P < a.vertices.length; P += 3) {
var A = a.vertices[P],
M = a.vertices[P + 1],
C = a.vertices[P + 2];
a.faces.push(new O(A, M, C));
}
return a;
}
};
},
function (t, e, i) {
var D = i(116),
n = i(69),
s = i(39),
F = i(117),
B = new s(),
N = new s(),
U = new n();
t.exports = function (t, e, i, n, s, r, o, a, h, l) {
void 0 === i && (i = 1), void 0 === n && (n = 0), void 0 === s && (s = 0), void 0 === r && (r = 0), void 0 === o && (o = 0), void 0 === a && (a = 0), void 0 === h && (h = 0), void 0 === l && (l = !0);
var u = { faces: [], verts: [] },
c = t.materials;
B.set(n, s, r), N.set(o, a, h), U.fromRotationXYTranslation(N, B, l);
for (var d = 0; d < t.models.length; d++)
for (var f = t.models[d], p = f.vertices, g = f.textureCoords, v = f.faces, y = 0; y < v.length; y++) {
var m = v[y],
x = m.vertices[0],
b = m.vertices[1],
w = m.vertices[2],
T = p[x.vertexIndex],
S = p[b.vertexIndex],
_ = p[w.vertexIndex],
E = x.textureCoordsIndex,
P = b.textureCoordsIndex,
A = w.textureCoordsIndex,
M = -1 === E ? { u: 0, v: 1 } : g[E],
C = -1 === P ? { u: 0, v: 0 } : g[P],
O = -1 === A ? { u: 1, v: 1 } : g[A],
k = 16777215;
"" !== m.material && c[m.material] && (k = c[m.material]);
var R = new F(T.x * i, T.y * i, T.z * i, M.u, M.v, k).transformMat4(U),
L = new F(S.x * i, S.y * i, S.z * i, C.u, C.v, k).transformMat4(U),
I = new F(_.x * i, _.y * i, _.z * i, O.u, O.v, k).transformMat4(U);
u.verts.push(R, L, I), u.faces.push(new D(R, L, I));
}
return e && ((e.faces = e.faces.concat(u.faces)), (e.vertices = e.vertices.concat(u.verts))), u;
};
},
function (t, e, i) {
var a = i(65),
n = i(0),
s = i(11),
h = i(200),
r = i(12),
o = new n({
Extends: a,
Mixins: [s.ScrollFactor, s.Visible],
initialize: function (t, e, i, n, s, r, o) {
a.call(this, t, e, i), (this.color = new h(n, s, r)), (this.intensity = o), (this.renderFlags = 15), (this.cameraFilter = 0), this.setScrollFactor(1, 1);
},
willRender: function (t) {
return !(o.RENDER_MASK !== this.renderFlags || (0 !== this.cameraFilter && this.cameraFilter & t.id));
},
setColor: function (t) {
var e = r.getFloatsFromUintRGB(t);
return this.color.set(e[0], e[1], e[2]), this;
},
setIntensity: function (t) {
return (this.intensity = t), this;
},
setRadius: function (t) {
return (this.radius = t), this;
},
});
(o.RENDER_MASK = 15), (t.exports = o);
},
function (t, e, i) {
var o = i(151),
n = i(0),
a = i(50),
h = i(481),
l = i(150),
s = i(200),
r = i(74),
u = i(79),
c = i(12),
d = new n({
initialize: function () {
(this.lights = []), (this.ambientColor = new s(0.1, 0.1, 0.1)), (this.active = !1), (this.maxLights = -1), (this.visibleLights = 0);
},
addPointLight: function (t, e, i, n, s, r) {
return this.systems.displayList.add(new l(this.scene, t, e, i, n, s, r));
},
enable: function () {
return -1 === this.maxLights && (this.maxLights = this.systems.renderer.config.maxLights), (this.active = !0), this;
},
disable: function () {
return (this.active = !1), this;
},
getLights: function (t) {
for (var e = this.lights, i = t.worldView, n = [], s = 0; s < e.length; s++) {
var r = e[s];
r.willRender(t) && o(r, i) && n.push({ light: r, distance: a(r.x, r.y, i.centerX, i.centerY) });
}
return n.length > this.maxLights && (u(n, this.sortByDistance), (n = n.slice(0, this.maxLights))), (this.visibleLights = n.length), n;
},
sortByDistance: function (t, e) {
return t.distance >= e.distance;
},
setAmbientColor: function (t) {
var e = c.getFloatsFromUintRGB(t);
return this.ambientColor.set(e[0], e[1], e[2]), this;
},
getMaxVisibleLights: function () {
return this.maxLights;
},
getLightCount: function () {
return this.lights.length;
},
addLight: function (t, e, i, n, s) {
void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 128), void 0 === n && (n = 16777215), void 0 === s && (s = 1);
var r = c.getFloatsFromUintRGB(n),
o = new h(t, e, i, r[0], r[1], r[2], s);
return this.lights.push(o), o;
},
removeLight: function (t) {
var e = this.lights.indexOf(t);
return 0 <= e && r(this.lights, e), this;
},
shutdown: function () {
this.lights.length = 0;
},
destroy: function () {
this.shutdown();
},
});
t.exports = d;
},
function (t, e, i) {
var n = i(56),
s = i(17)(!1, (s = { Circle: i(1191), Ellipse: i(1201), Intersects: i(484), Line: i(1221), Mesh: i(1243), Point: i(1246), Polygon: i(1260), Rectangle: i(502), Triangle: i(1293) }), n);
t.exports = s;
},
function (t, e, i) {
t.exports = {
CircleToCircle: i(231),
CircleToRectangle: i(151),
GetCircleToCircle: i(1211),
GetCircleToRectangle: i(1212),
GetLineToCircle: i(232),
GetLineToLine: i(485),
GetLineToPoints: i(486),
GetLineToPolygon: i(487),
GetLineToRectangle: i(234),
GetRaysFromPointToPolygon: i(1213),
GetRectangleIntersection: i(1214),
GetRectangleToRectangle: i(1215),
GetRectangleToTriangle: i(1216),
GetTriangleToCircle: i(1217),
GetTriangleToLine: i(492),
GetTriangleToTriangle: i(1218),
LineToCircle: i(233),
LineToLine: i(96),
LineToRectangle: i(488),
PointToLine: i(496),
PointToLineSegment: i(1219),
RectangleToRectangle: i(152),
RectangleToTriangle: i(489),
RectangleToValues: i(1220),
TriangleToCircle: i(491),
TriangleToLine: i(493),
TriangleToTriangle: i(494),
};
},
function (t, e, i) {
var g = i(39);
t.exports = function (t, e, i) {
var n = t.x1,
s = t.y1,
r = t.x2,
o = t.y2,
a = e.x1,
h = e.y1,
l = r - n,
u = o - s,
c = e.x2 - a,
d = e.y2 - h;
if (0 == l || 0 == d * l - c * u) return !1;
var f = (l * (h - s) + u * (n - a)) / (c * u - d * l),
p = (a + c * f - n) / l;
return p < 0 || f < 0 || 1 < f ? null : (void 0 === i && (i = new g()), i.set(n + l * p, s + u * p, p));
};
},
function (t, e, i) {
var a = i(39),
h = i(485),
l = new (i(47))(),
u = new a();
t.exports = function (t, e, i) {
void 0 === i && (i = new a());
var n = !1;
i.set(), u.set();
for (var s = e[0], r = 1; r < e.length; r++) {
var o = e[r];
l.setTo(s.x, s.y, o.x, o.y), (s = o), h(t, l, u) && (!n || u.z < i.z) && (i.copy(u), (n = !0));
}
return n ? i : null;
};
},
function (t, e, i) {
var n = i(39),
r = i(140),
o = i(486),
a = new n();
t.exports = function (t, e, i) {
void 0 === i && (i = new r()), Array.isArray(e) || (e = [e]);
var n = !1;
i.set(), a.set();
for (var s = 0; s < e.length; s++) o(t, e[s].points, a) && (!n || a.z < i.z) && (i.set(a.x, a.y, a.z, s), (n = !0));
return n ? i : null;
};
},
function (t, e) {
t.exports = function (t, e) {
var i = t.x1,
n = t.y1,
s = t.x2,
r = t.y2,
o = e.x,
a = e.y,
h = e.right,
l = e.bottom,
u = 0;
if ((o <= i && i <= h && a <= n && n <= l) || (o <= s && s <= h && a <= r && r <= l)) return !0;
if (i < o && o <= s) {
if (a < (u = n + ((r - n) * (o - i)) / (s - i)) && u <= l) return !0;
} else if (h < i && s <= h && a <= (u = n + ((r - n) * (h - i)) / (s - i)) && u <= l) return !0;
if (n < a && a <= r) {
if (o <= (u = i + ((s - i) * (a - n)) / (r - n)) && u <= h) return !0;
} else if (l < n && r <= l && o <= (u = i + ((s - i) * (l - n)) / (r - n)) && u <= h) return !0;
return !1;
};
},
function (t, e, i) {
var u = i(96),
c = i(57),
d = i(235),
f = i(490);
t.exports = function (t, e) {
if (e.left > t.right || e.right < t.left || e.top > t.bottom || e.bottom < t.top) return !1;
var i = e.getLineA(),
n = e.getLineB(),
s = e.getLineC();
if (c(t, i.x1, i.y1) || c(t, i.x2, i.y2)) return !0;
if (c(t, n.x1, n.y1) || c(t, n.x2, n.y2)) return !0;
if (c(t, s.x1, s.y1) || c(t, s.x2, s.y2)) return !0;
var r = t.getLineA(),
o = t.getLineB(),
a = t.getLineC(),
h = t.getLineD();
if (u(i, r) || u(i, o) || u(i, a) || u(i, h)) return !0;
if (u(n, r) || u(n, o) || u(n, a) || u(n, h)) return !0;
if (u(s, r) || u(s, o) || u(s, a) || u(s, h)) return !0;
var l = f(t);
return 0 < d(e, l, !0).length;
};
},
function (t, e) {
t.exports = function (t, e) {
return void 0 === e && (e = []), e.push({ x: t.x, y: t.y }), e.push({ x: t.right, y: t.y }), e.push({ x: t.right, y: t.bottom }), e.push({ x: t.x, y: t.bottom }), e;
};
},
function (t, e, i) {
var n = i(233),
s = i(115);
t.exports = function (t, e) {
return !(t.left > e.right || t.right < e.left || t.top > e.bottom || t.bottom < e.top || (!s(t, e.x, e.y) && !n(t.getLineA(), e) && !n(t.getLineB(), e) && !n(t.getLineC(), e)));
};
},
function (t, e, i) {
var l = i(4),
u = i(493),
c = i(96);
t.exports = function (t, e, i) {
if ((void 0 === i && (i = []), u(t, e)))
for (var n = t.getLineA(), s = t.getLineB(), r = t.getLineC(), o = [new l(), new l(), new l()], a = [c(n, e, o[0]), c(s, e, o[1]), c(r, e, o[2])], h = 0; h < 3; h++) a[h] && i.push(o[h]);
return i;
};
},
function (t, e, i) {
var n = i(96);
t.exports = function (t, e) {
return !!(t.contains(e.x1, e.y1) || t.contains(e.x2, e.y2) || n(t.getLineA(), e) || n(t.getLineB(), e) || n(t.getLineC(), e));
};
},
function (t, e, i) {
var l = i(235),
u = i(495),
c = i(96);
t.exports = function (t, e) {
if (t.left > e.right || t.right < e.left || t.top > e.bottom || t.bottom < e.top) return !1;
var i = t.getLineA(),
n = t.getLineB(),
s = t.getLineC(),
r = e.getLineA(),
o = e.getLineB(),
a = e.getLineC();
if (c(i, r) || c(i, o) || c(i, a)) return !0;
if (c(n, r) || c(n, o) || c(n, a)) return !0;
if (c(s, r) || c(s, o) || c(s, a)) return !0;
var h = u(t);
return 0 < l(e, h, !0).length || ((h = u(e)), 0 < l(t, h, !0).length);
};
},
function (t, e) {
t.exports = function (t, e) {
return void 0 === e && (e = []), e.push({ x: t.x1, y: t.y1 }), e.push({ x: t.x2, y: t.y2 }), e.push({ x: t.x3, y: t.y3 }), e;
};
},
function (t, e) {
t.exports = function (t, e, i) {
void 0 === i && (i = 1);
var n = e.x1,
s = e.y1,
r = e.x2,
o = e.y2,
a = t.x,
h = t.y,
l = (r - n) * (r - n) + (o - s) * (o - s);
if (0 == l) return !1;
var u = ((a - n) * (r - n) + (h - s) * (o - s)) / l;
if (u < 0) return Math.sqrt((n - a) * (n - a) + (s - h) * (s - h)) <= i;
if (0 <= u && u <= 1) {
var c = ((s - h) * (r - n) - (n - a) * (o - s)) / l;
return Math.abs(c) * Math.sqrt(l) <= i;
}
return Math.sqrt((r - a) * (r - a) + (o - h) * (o - h)) <= i;
};
},
function (t, e, i) {
var n = i(14),
s = i(68),
r = i(97);
t.exports = function (t) {
var e = r(t) - n.TAU;
return s(e, -Math.PI, Math.PI);
};
},
function (t, e) {
var L = !0,
I = "untitled",
D = "",
F = "";
function B(t) {
return 0 === t.models.length && t.models.push({ faces: [], name: I, textureCoords: [], vertexNormals: [], vertices: [] }), (D = ""), t.models[t.models.length - 1];
}
t.exports = function (t, e) {
void 0 === e && (e = !0), (L = e);
var i = { materials: {}, materialLibraries: [], models: [] };
F = D = "";
for (var n, s, r, o, a, h, l, u, c, d, f, p, g, v, y, m, x, b, w, T, S, _, E, P, A, M, C, O = t.split("\n"), k = 0; k < O.length; k++) {
var R = ((M = O[k]), void 0, -1 < (C = M.indexOf("#")) ? M.substring(0, C) : M).replace(/\s\s+/g, " ").trim().split(" ");
switch (R[0].toLowerCase()) {
case "o":
(P = i), void 0, (A = 2 <= (E = R).length ? E[1] : I), P.models.push({ faces: [], name: A, textureCoords: [], vertexNormals: [], vertices: [] }), (D = "");
break;
case "g":
2 === (_ = R).length && (D = _[1]);
break;
case "v":
(x = i), void 0, (w = 2 <= (b = (m = R).length) ? parseFloat(m[1]) : 0), (T = 3 <= b ? parseFloat(m[2]) : 0), (S = 4 <= b ? parseFloat(m[3]) : 0), B(x).vertices.push({ x: w, y: T, z: S });
break;
case "vt":
(f = i),
(y = v = g = void 0),
(g = 2 <= (p = (d = R).length) ? parseFloat(d[1]) : 0),
(v = 3 <= p ? parseFloat(d[2]) : 0),
(y = 4 <= p ? parseFloat(d[3]) : 0),
isNaN(g) && (g = 0),
isNaN(v) && (v = 0),
isNaN(y) && (y = 0),
L && (v = 1 - v),
B(f).textureCoords.push({ u: g, v: v, w: y });
break;
case "vn":
(a = i), void 0, (l = 2 <= (h = (o = R).length) ? parseFloat(o[1]) : 0), (u = 3 <= h ? parseFloat(o[2]) : 0), (c = 4 <= h ? parseFloat(o[3]) : 0), B(a).vertexNormals.push({ x: l, y: u, z: c });
break;
case "f":
!(function (t, e) {
var i = t.length - 1;
if (!(i < 3)) {
for (var n = { group: D, material: F, vertices: [] }, s = 0; s < i; s++) {
var r,
o,
a,
h = t[s + 1].split("/"),
l = h.length;
l < 1 ||
3 < l ||
((o = r = a = 0),
(a = parseInt(h[0], 10)),
1 < l && "" !== h[1] && (r = parseInt(h[1], 10)),
2 < l && (o = parseInt(h[2], 10)),
0 !== a && (a < 0 && (a = B(e).vertices.length + 1 + a), --r, --a, --o, n.vertices.push({ textureCoordsIndex: r, vertexIndex: a, vertexNormalIndex: o })));
}
B(e).faces.push(n);
}
})(R, i);
break;
case "mtllib":
(r = i), 2 <= (s = R).length && r.materialLibraries.push(s[1]);
break;
case "usemtl":
2 <= (n = R).length && (F = n[1]);
}
}
return i;
};
},
function (t, e, i) {
var u = i(103);
t.exports = function (t) {
for (var e = {}, i = t.split("\n"), n = "", s = 0; s < i.length; s++) {
var r = i[s].trim();
if (0 !== r.indexOf("#") && "" !== r) {
var o = r.replace(/\s\s+/g, " ").trim().split(" ");
switch (o[0].toLowerCase()) {
case "newmtl":
n = o[1];
break;
case "kd":
var a = Math.floor(255 * o[1]),
h = 2 <= o.length ? Math.floor(255 * o[2]) : a,
l = 3 <= o.length ? Math.floor(255 * o[3]) : a;
e[n] = u(a, h, l);
}
}
}
return e;
};
},
function (t, e) {
t.exports = function (t) {
return Math.sqrt(t.x * t.x + t.y * t.y);
};
},
function (t, e) {
t.exports = function (t) {
return t.x * t.x + t.y * t.y;
};
},
function (t, e, i) {
var n = i(10);
(n.Area = i(1267)),
(n.Ceil = i(1268)),
(n.CeilAll = i(1269)),
(n.CenterOn = i(190)),
(n.Clone = i(1270)),
(n.Contains = i(57)),
(n.ContainsPoint = i(1271)),
(n.ContainsRect = i(503)),
(n.CopyFrom = i(1272)),
(n.Decompose = i(490)),
(n.Equals = i(1273)),
(n.FitInside = i(1274)),
(n.FitOutside = i(1275)),
(n.Floor = i(1276)),
(n.FloorAll = i(1277)),
(n.FromPoints = i(199)),
(n.FromXY = i(1278)),
(n.GetAspectRatio = i(237)),
(n.GetCenter = i(1279)),
(n.GetPoint = i(171)),
(n.GetPoints = i(306)),
(n.GetSize = i(1280)),
(n.Inflate = i(1281)),
(n.Intersection = i(1282)),
(n.MarchingAnts = i(316)),
(n.MergePoints = i(1283)),
(n.MergeRect = i(1284)),
(n.MergeXY = i(1285)),
(n.Offset = i(1286)),
(n.OffsetPoint = i(1287)),
(n.Overlaps = i(1288)),
(n.Perimeter = i(130)),
(n.PerimeterPoint = i(1289)),
(n.Random = i(174)),
(n.RandomOutside = i(1290)),
(n.SameDimensions = i(1291)),
(n.Scale = i(1292)),
(n.Union = i(441)),
(t.exports = n);
},
function (t, e) {
t.exports = function (t, e) {
return !(e.width * e.height > t.width * t.height) && e.x > t.x && e.x < t.right && e.right > t.x && e.right < t.right && e.y > t.y && e.y < t.bottom && e.bottom > t.y && e.bottom < t.bottom;
};
},
function (t, e, i) {
var n = i(4);
t.exports = function (t, e) {
return void 0 === e && (e = new n()), (e.x = (t.x1 + t.x2 + t.x3) / 3), (e.y = (t.y1 + t.y2 + t.y3) / 3), e;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return (t.x1 += e), (t.y1 += i), (t.x2 += e), (t.y2 += i), (t.x3 += e), (t.y3 += i), t;
};
},
function (t, e, i) {
var d = i(4);
function f(t, e, i, n) {
var s = t - i,
r = e - n,
o = s * s + r * r;
return Math.sqrt(o);
}
t.exports = function (t, e) {
void 0 === e && (e = new d());
var i = t.x1,
n = t.y1,
s = t.x2,
r = t.y2,
o = t.x3,
a = t.y3,
h = f(o, a, s, r),
l = f(i, n, o, a),
u = f(s, r, i, n),
c = h + l + u;
return (e.x = (i * h + s * l + o * u) / c), (e.y = (n * h + r * l + a * u) / c), e;
};
},
function (t, e) {
t.exports = function (r, o) {
return function (t, e, i, n) {
var s = r.getPixelAlpha(e, i, n.texture.key, n.frame.name);
return s && o <= s;
};
};
},
function (t, e) {
t.exports = function (t, e, i) {
return {
gameObject: t,
enabled: !0,
alwaysEnabled: !1,
draggable: !1,
dropZone: !1,
cursor: !1,
target: null,
camera: null,
hitArea: e,
hitAreaCallback: i,
hitAreaDebug: null,
customHitArea: !1,
localX: 0,
localY: 0,
dragState: 0,
dragStartX: 0,
dragStartY: 0,
dragStartXGlobal: 0,
dragStartYGlobal: 0,
dragX: 0,
dragY: 0,
};
};
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e) {
(this.pad = t), (this.events = t.events), (this.index = e), (this.value = 0), (this.threshold = 0.1);
},
update: function (t) {
this.value = t;
},
getValue: function () {
return Math.abs(this.value) < this.threshold ? 0 : this.value;
},
destroy: function () {
(this.pad = null), (this.events = null);
},
});
t.exports = n;
},
function (t, e, i) {
var n = i(0),
s = i(239),
r = new n({
initialize: function (t, e) {
(this.pad = t), (this.events = t.manager), (this.index = e), (this.value = 0), (this.threshold = 1), (this.pressed = !1);
},
update: function (t) {
this.value = t;
var e = this.pad,
i = this.index;
t >= this.threshold
? this.pressed || ((this.pressed = !0), this.events.emit(s.BUTTON_DOWN, e, this, t), this.pad.emit(s.GAMEPAD_BUTTON_DOWN, i, t, this))
: this.pressed && ((this.pressed = !1), this.events.emit(s.BUTTON_UP, e, this, t), this.pad.emit(s.GAMEPAD_BUTTON_UP, i, t, this));
},
destroy: function () {
(this.pad = null), (this.events = null);
},
});
t.exports = r;
},
function (t, e, i) {
var a = i(509),
h = i(510),
n = i(0),
l = i(9),
u = i(3),
s = new n({
Extends: l,
initialize: function (t, e) {
l.call(this), (this.manager = t), (this.pad = e), (this.id = e.id), (this.index = e.index);
for (var i = [], n = 0; n < e.buttons.length; n++) i.push(new h(this, n));
this.buttons = i;
var s = [];
for (n = 0; n < e.axes.length; n++) s.push(new a(this, n));
(this.axes = s), (this.vibration = e.vibrationActuator);
var r = { value: 0, pressed: !1 };
(this._LCLeft = i[14] ? i[14] : r),
(this._LCRight = i[15] ? i[15] : r),
(this._LCTop = i[12] ? i[12] : r),
(this._LCBottom = i[13] ? i[13] : r),
(this._RCLeft = i[2] ? i[2] : r),
(this._RCRight = i[1] ? i[1] : r),
(this._RCTop = i[3] ? i[3] : r),
(this._RCBottom = i[0] ? i[0] : r),
(this._FBLeftTop = i[4] ? i[4] : r),
(this._FBLeftBottom = i[6] ? i[6] : r),
(this._FBRightTop = i[5] ? i[5] : r),
(this._FBRightBottom = i[7] ? i[7] : r);
var o = { value: 0 };
(this._HAxisLeft = s[0] ? s[0] : o),
(this._VAxisLeft = s[1] ? s[1] : o),
(this._HAxisRight = s[2] ? s[2] : o),
(this._VAxisRight = s[3] ? s[3] : o),
(this.leftStick = new u()),
(this.rightStick = new u()),
(this._created = performance.now());
},
getAxisTotal: function () {
return this.axes.length;
},
getAxisValue: function (t) {
return this.axes[t].getValue();
},
setAxisThreshold: function (t) {
for (var e = 0; e < this.axes.length; e++) this.axes[e].threshold = t;
},
getButtonTotal: function () {
return this.buttons.length;
},
getButtonValue: function (t) {
return this.buttons[t].value;
},
isButtonDown: function (t) {
return this.buttons[t].pressed;
},
update: function (t) {
if (!(t.timestamp < this._created)) {
for (var e = this.buttons, i = t.buttons, n = e.length, s = 0; s < n; s++) e[s].update(i[s].value);
var r = this.axes,
o = t.axes;
n = r.length;
for (s = 0; s < n; s++) r[s].update(o[s]);
2 <= n && (this.leftStick.set(r[0].getValue(), r[1].getValue()), 4 <= n && this.rightStick.set(r[2].getValue(), r[3].getValue()));
}
},
destroy: function () {
var t;
for (this.removeAllListeners(), this.manager = null, this.pad = null, t = 0; t < this.buttons.length; t++) this.buttons[t].destroy();
for (t = 0; t < this.axes.length; t++) this.axes[t].destroy();
(this.buttons = []), (this.axes = []);
},
connected: {
get: function () {
return this.pad.connected;
},
},
timestamp: {
get: function () {
return this.pad.timestamp;
},
},
left: {
get: function () {
return this._LCLeft.pressed;
},
},
right: {
get: function () {
return this._LCRight.pressed;
},
},
up: {
get: function () {
return this._LCTop.pressed;
},
},
down: {
get: function () {
return this._LCBottom.pressed;
},
},
A: {
get: function () {
return this._RCBottom.pressed;
},
},
Y: {
get: function () {
return this._RCTop.pressed;
},
},
X: {
get: function () {
return this._RCLeft.pressed;
},
},
B: {
get: function () {
return this._RCRight.pressed;
},
},
L1: {
get: function () {
return this._FBLeftTop.value;
},
},
L2: {
get: function () {
return this._FBLeftBottom.value;
},
},
R1: {
get: function () {
return this._FBRightTop.value;
},
},
R2: {
get: function () {
return this._FBRightBottom.value;
},
},
});
t.exports = s;
},
function (t, e, i) {
var n = i(0),
s = i(9),
r = i(154),
o = new n({
Extends: s,
initialize: function (t, e) {
s.call(this),
(this.plugin = t),
(this.keyCode = e),
(this.originalEvent = void 0),
(this.enabled = !0),
(this.isDown = !1),
(this.isUp = !0),
(this.altKey = !1),
(this.ctrlKey = !1),
(this.shiftKey = !1),
(this.metaKey = !1),
(this.location = 0),
(this.timeDown = 0),
(this.duration = 0),
(this.timeUp = 0),
(this.emitOnRepeat = !1),
(this.repeats = 0),
(this._justDown = !1),
(this._justUp = !1),
(this._tick = -1);
},
setEmitOnRepeat: function (t) {
return (this.emitOnRepeat = t), this;
},
onDown: function (t) {
(this.originalEvent = t),
this.enabled &&
((this.altKey = t.altKey),
(this.ctrlKey = t.ctrlKey),
(this.shiftKey = t.shiftKey),
(this.metaKey = t.metaKey),
(this.location = t.location),
this.repeats++,
this.isDown
? this.emitOnRepeat && this.emit(r.DOWN, this, t)
: ((this.isDown = !0), (this.isUp = !1), (this.timeDown = t.timeStamp), (this.duration = 0), (this._justDown = !0), (this._justUp = !1), this.emit(r.DOWN, this, t)));
},
onUp: function (t) {
(this.originalEvent = t),
this.enabled &&
((this.isDown = !1),
(this.isUp = !0),
(this.timeUp = t.timeStamp),
(this.duration = this.timeUp - this.timeDown),
(this.repeats = 0),
(this._justDown = !1),
(this._justUp = !0),
(this._tick = -1),
this.emit(r.UP, this, t));
},
reset: function () {
return (
(this.preventDefault = !0),
(this.enabled = !0),
(this.isDown = !1),
(this.isUp = !0),
(this.altKey = !1),
(this.ctrlKey = !1),
(this.shiftKey = !1),
(this.metaKey = !1),
(this.timeDown = 0),
(this.duration = 0),
(this.timeUp = 0),
(this.repeats = 0),
(this._justDown = !1),
(this._justUp = !1),
(this._tick = -1),
this
);
},
getDuration: function () {
return this.isDown ? this.plugin.game.loop.time - this.timeDown : 0;
},
destroy: function () {
this.removeAllListeners(), (this.originalEvent = null), (this.plugin = null);
},
});
t.exports = o;
},
function (t, e, i) {
var n = i(0),
o = i(154),
a = i(2),
h = i(514),
l = i(516),
s = new n({
initialize: function (t, e, i) {
if ((void 0 === i && (i = {}), e.length < 2)) return !1;
(this.manager = t), (this.enabled = !0), (this.keyCodes = []);
for (var n = 0; n < e.length; n++) {
var s = e[n];
"string" == typeof s ? this.keyCodes.push(s.toUpperCase().charCodeAt(0)) : "number" == typeof s ? this.keyCodes.push(s) : s.hasOwnProperty("keyCode") && this.keyCodes.push(s.keyCode);
}
(this.current = this.keyCodes[0]),
(this.index = 0),
(this.size = this.keyCodes.length),
(this.timeLastMatched = 0),
(this.matched = !1),
(this.timeMatched = 0),
(this.resetOnWrongKey = a(i, "resetOnWrongKey", !0)),
(this.maxKeyDelay = a(i, "maxKeyDelay", 0)),
(this.resetOnMatch = a(i, "resetOnMatch", !1)),
(this.deleteOnMatch = a(i, "deleteOnMatch", !1));
var r = this;
(this.onKeyDown = function (t) {
!r.matched && r.enabled && h(t, r) && (r.manager.emit(o.COMBO_MATCH, r, t), r.resetOnMatch ? l(r) : r.deleteOnMatch && r.destroy());
}),
this.manager.on(o.ANY_KEY_DOWN, this.onKeyDown);
},
progress: {
get: function () {
return this.index / this.size;
},
},
destroy: function () {
(this.enabled = !1), (this.keyCodes = []), this.manager.off(o.ANY_KEY_DOWN, this.onKeyDown), (this.manager = null);
},
});
t.exports = s;
},
function (t, e, i) {
var r = i(515);
t.exports = function (t, e) {
if (e.matched) return !0;
var i,
n = !1,
s = !1;
return (
t.keyCode === e.current && (0 < e.index && 0 < e.maxKeyDelay ? ((i = e.timeLastMatched + e.maxKeyDelay), t.timeStamp <= i && ((s = !0), (n = r(t, e)))) : ((s = !0), (n = r(t, e)))),
!s && e.resetOnWrongKey && ((e.index = 0), (e.current = e.keyCodes[0])),
n && ((e.timeLastMatched = t.timeStamp), (e.matched = !0), (e.timeMatched = t.timeStamp)),
n
);
};
},
function (t, e) {
t.exports = function (t, e) {
return (e.timeLastMatched = t.timeStamp), e.index++, e.index === e.size || ((e.current = e.keyCodes[e.index]), !1);
};
},
function (t, e) {
t.exports = function (t) {
return (t.current = t.keyCodes[0]), (t.index = 0), (t.timeLastMatched = 0), (t.matched = !1), (t.timeMatched = 0), t;
};
},
function (t, e, i) {
var r = i(240);
t.exports = function (t, e) {
var i = r(e, t.xhrSettings),
n = new XMLHttpRequest();
if ((n.open("GET", t.src, i.async, i.user, i.password), (n.responseType = t.xhrSettings.responseType), (n.timeout = i.timeout), i.headers)) for (var s in i.headers) n.setRequestHeader(s, i.headers[s]);
return (
i.header && i.headerValue && n.setRequestHeader(i.header, i.headerValue),
i.requestedWith && n.setRequestHeader("X-Requested-With", i.requestedWith),
i.overrideMimeType && n.overrideMimeType(i.overrideMimeType),
i.withCredentials && (n.withCredentials = !0),
(n.onload = t.onLoad.bind(t, n)),
(n.onerror = t.onError.bind(t, n)),
(n.onprogress = t.onProgress.bind(t)),
n.send(),
n
);
};
},
function (t, e, i) {
var n = i(0),
s = i(21),
a = i(23),
r = i(8),
l = i(2),
u = i(519),
c = i(7),
d = new n({
Extends: a,
initialize: function (t, e, i, n, s) {
var r;
c(e) && ((e = l((r = e), "key")), (n = l(r, "xhrSettings")), (s = l(r, "context", s)));
var o = { type: "audio", cache: t.cacheManager.audio, extension: i.type, responseType: "arraybuffer", key: e, url: i.url, xhrSettings: n, config: { context: s } };
a.call(this, t, o);
},
onProcess: function () {
this.state = s.FILE_PROCESSING;
var e = this;
this.config.context.decodeAudioData(
this.xhrLoader.response,
function (t) {
(e.data = t), e.onProcessComplete();
},
function (t) {
e.onProcessError();
}
),
(this.config.context = null);
},
});
(d.create = function (t, e, i, n, s) {
var r = t.systems.game,
o = r.config.audio,
a = r.device.audio;
c(e) && ((i = l(e, "url", [])), (n = l(e, "config", {})));
var h = d.getAudioURL(r, i);
return h ? (a.webAudio && !o.disableWebAudio ? new d(t, e, h, s, r.sound.context) : new u(t, e, h, n)) : null;
}),
(d.getAudioURL = function (t, e) {
Array.isArray(e) || (e = [e]);
for (var i = 0; i < e.length; i++) {
var n = l(e[i], "url", e[i]);
if (0 === n.indexOf("blob:") || 0 === n.indexOf("data:")) return { url: n, type: "" };
var s = n.match(/\.([a-zA-Z0-9]+)($|\?)/);
s = l(e[i], "type", s ? s[1] : "").toLowerCase();
if (t.device.audio[s]) return { url: n, type: s };
}
return null;
}),
r.register("audio", function (t, e, i, n) {
var s,
r = this.systems.game,
o = r.config.audio,
a = r.device.audio;
if (o.noAudio || (!a.webAudio && !a.audioData)) return this;
if (Array.isArray(t)) for (var h = 0; h < t.length; h++) (s = d.create(this, t[h])) && this.addFile(s);
else (s = d.create(this, t, e, i, n)) && this.addFile(s);
return this;
}),
(t.exports = d);
},
function (t, e, i) {
var n = i(0),
s = i(95),
o = i(23),
a = i(2),
r = i(155),
h = i(7),
l = new n({
Extends: o,
initialize: function (t, e, i, n) {
var s;
h(e) && ((e = a((s = e), "key")), (n = a(s, "config", n)));
var r = { type: "audio", cache: t.cacheManager.audio, extension: i.type, key: e, url: i.url, config: n };
o.call(this, t, r), (this.locked = "ontouchstart" in window), (this.loaded = !1), (this.filesLoaded = 0), (this.filesTotal = 0);
},
onLoad: function () {
this.loaded || ((this.loaded = !0), this.loader.nextFile(this, !0));
},
onError: function () {
for (var t = 0; t < this.data.length; t++) {
var e = this.data[t];
(e.oncanplaythrough = null), (e.onerror = null);
}
this.loader.nextFile(this, !1);
},
onProgress: function (t) {
var e = t.target;
(e.oncanplaythrough = null),
(e.onerror = null),
this.filesLoaded++,
(this.percentComplete = Math.min(this.filesLoaded / this.filesTotal, 1)),
this.loader.emit(s.FILE_PROGRESS, this, this.percentComplete),
this.filesLoaded === this.filesTotal && this.onLoad();
},
load: function () {
this.data = [];
var t = (this.config && this.config.instances) || 1;
(this.filesTotal = t), (this.filesLoaded = 0);
for (var e = (this.percentComplete = 0); e < t; e++) {
var i = new Audio();
i.dataset || (i.dataset = {}),
(i.dataset.name = this.key + ("0" + e).slice(-2)),
(i.dataset.used = "false"),
this.locked ? (i.dataset.locked = "true") : ((i.dataset.locked = "false"), (i.preload = "auto"), (i.oncanplaythrough = this.onProgress.bind(this)), (i.onerror = this.onError.bind(this))),
this.data.push(i);
}
for (e = 0; e < this.data.length; e++) ((i = this.data[e]).src = r(this, this.loader.baseURL)), this.locked || i.load();
this.locked && setTimeout(this.onLoad.bind(this));
},
});
t.exports = l;
},
function (t, e, i) {
var n = i(0),
s = i(21),
a = i(23),
r = i(8),
h = i(2),
l = i(7),
o = new n({
Extends: a,
initialize: function (t, e, i, n) {
var s,
r = "js";
l(e) && ((e = h((s = e), "key")), (i = h(s, "url")), (n = h(s, "xhrSettings")), (r = h(s, "extension", r)));
var o = { type: "script", cache: !1, extension: r, responseType: "text", key: e, url: i, xhrSettings: n };
a.call(this, t, o);
},
onProcess: function () {
(this.state = s.FILE_PROCESSING),
(this.data = document.createElement("script")),
(this.data.language = "javascript"),
(this.data.type = "text/javascript"),
(this.data.defer = !1),
(this.data.text = this.xhrLoader.responseText),
document.head.appendChild(this.data),
this.onProcessComplete();
},
});
r.register("script", function (t, e, i) {
if (Array.isArray(t)) for (var n = 0; n < t.length; n++) this.addFile(new o(this, t[n]));
else this.addFile(new o(this, t, e, i));
return this;
}),
(t.exports = o);
},
function (t, e, i) {
var r = i(522),
o = i(157),
n = i(0),
a = i(62),
s = i(524),
h = i(525),
l = new n({
initialize: function (t) {
(this.world = t), (this.scene = t.scene), (this.sys = t.scene.sys);
},
collider: function (t, e, i, n, s) {
return this.world.addCollider(t, e, i, n, s);
},
overlap: function (t, e, i, n, s) {
return this.world.addOverlap(t, e, i, n, s);
},
existing: function (t, e) {
var i = e ? a.STATIC_BODY : a.DYNAMIC_BODY;
return this.world.enableBody(t, i), t;
},
staticImage: function (t, e, i, n) {
var s = new r(this.scene, t, e, i, n);
return this.sys.displayList.add(s), this.world.enableBody(s, a.STATIC_BODY), s;
},
image: function (t, e, i, n) {
var s = new r(this.scene, t, e, i, n);
return this.sys.displayList.add(s), this.world.enableBody(s, a.DYNAMIC_BODY), s;
},
staticSprite: function (t, e, i, n) {
var s = new o(this.scene, t, e, i, n);
return this.sys.displayList.add(s), this.sys.updateList.add(s), this.world.enableBody(s, a.STATIC_BODY), s;
},
sprite: function (t, e, i, n) {
var s = new o(this.scene, t, e, i, n);
return this.sys.displayList.add(s), this.sys.updateList.add(s), this.world.enableBody(s, a.DYNAMIC_BODY), s;
},
staticGroup: function (t, e) {
return this.sys.updateList.add(new h(this.world, this.world.scene, t, e));
},
group: function (t, e) {
return this.sys.updateList.add(new s(this.world, this.world.scene, t, e));
},
destroy: function () {
(this.world = null), (this.scene = null), (this.sys = null);
},
});
t.exports = l;
},
function (t, e, i) {
var n = i(0),
s = i(243),
r = i(125),
o = new n({
Extends: r,
Mixins: [s.Acceleration, s.Angular, s.Bounce, s.Debug, s.Drag, s.Enable, s.Friction, s.Gravity, s.Immovable, s.Mass, s.Pushable, s.Size, s.Velocity],
initialize: function (t, e, i, n, s) {
r.call(this, t, e, i, n, s), (this.body = null);
},
});
t.exports = o;
},
function (t, e, i) {
var d = i(244),
f = i(65),
p = i(231),
g = i(151);
t.exports = function (t, e, i, n, s, r) {
var o = d(t, e - n, i - n, 2 * n, 2 * n, s, r);
if (0 === o.length) return o;
for (var a = new f(e, i, n), h = new f(), l = [], u = 0; u < o.length; u++) {
var c = o[u];
c.isCircle ? (h.setTo(c.center.x, c.center.y, c.halfWidth), p(a, h) && l.push(c)) : g(a, c) && l.push(c);
}
return l;
};
},
function (t, e, i) {
var r = i(157),
n = i(0),
o = i(62),
a = i(2),
h = i(113),
l = i(7),
s = new n({
Extends: h,
initialize: function (t, e, i, n) {
var s;
i || n
? l(i)
? ((n = i), (i = null), (n.internalCreateCallback = this.createCallbackHandler), (n.internalRemoveCallback = this.removeCallbackHandler))
: Array.isArray(i) && l(i[0])
? ((n = i[0]),
(s = this),
i.forEach(function (t) {
(t.internalCreateCallback = s.createCallbackHandler), (t.internalRemoveCallback = s.removeCallbackHandler);
}),
(i = null))
: (n = { internalCreateCallback: this.createCallbackHandler, internalRemoveCallback: this.removeCallbackHandler })
: (n = { internalCreateCallback: this.createCallbackHandler, internalRemoveCallback: this.removeCallbackHandler }),
(this.world = t),
(n.classType = a(n, "classType", r)),
(this.physicsType = o.DYNAMIC_BODY),
(this.defaults = {
setCollideWorldBounds: a(n, "collideWorldBounds", !1),
setBoundsRectangle: a(n, "customBoundsRectangle", null),
setAccelerationX: a(n, "accelerationX", 0),
setAccelerationY: a(n, "accelerationY", 0),
setAllowDrag: a(n, "allowDrag", !0),
setAllowGravity: a(n, "allowGravity", !0),
setAllowRotation: a(n, "allowRotation", !0),
setBounceX: a(n, "bounceX", 0),
setBounceY: a(n, "bounceY", 0),
setDragX: a(n, "dragX", 0),
setDragY: a(n, "dragY", 0),
setEnable: a(n, "enable", !0),
setGravityX: a(n, "gravityX", 0),
setGravityY: a(n, "gravityY", 0),
setFrictionX: a(n, "frictionX", 0),
setFrictionY: a(n, "frictionY", 0),
setMaxVelocityX: a(n, "maxVelocityX", 1e4),
setMaxVelocityY: a(n, "maxVelocityY", 1e4),
setVelocityX: a(n, "velocityX", 0),
setVelocityY: a(n, "velocityY", 0),
setAngularVelocity: a(n, "angularVelocity", 0),
setAngularAcceleration: a(n, "angularAcceleration", 0),
setAngularDrag: a(n, "angularDrag", 0),
setMass: a(n, "mass", 1),
setImmovable: a(n, "immovable", !1),
}),
h.call(this, e, i, n),
(this.type = "PhysicsGroup");
},
createCallbackHandler: function (t) {
t.body || this.world.enableBody(t, o.DYNAMIC_BODY);
var e = t.body;
for (var i in this.defaults) e[i](this.defaults[i]);
},
removeCallbackHandler: function (t) {
t.body && this.world.disableBody(t);
},
setVelocity: function (t, e, i) {
void 0 === i && (i = 0);
for (var n = this.getChildren(), s = 0; s < n.length; s++) n[s].body.velocity.set(t + s * i, e + s * i);
return this;
},
setVelocityX: function (t, e) {
void 0 === e && (e = 0);
for (var i = this.getChildren(), n = 0; n < i.length; n++) i[n].body.velocity.x = t + n * e;
return this;
},
setVelocityY: function (t, e) {
void 0 === e && (e = 0);
for (var i = this.getChildren(), n = 0; n < i.length; n++) i[n].body.velocity.y = t + n * e;
return this;
},
});
t.exports = s;
},
function (t, e, i) {
var s = i(157),
n = i(0),
r = i(62),
o = i(2),
a = i(113),
h = i(7),
l = new n({
Extends: a,
initialize: function (t, e, i, n) {
i || n
? h(i)
? ((n = i),
(i = null),
(n.internalCreateCallback = this.createCallbackHandler),
(n.internalRemoveCallback = this.removeCallbackHandler),
(n.createMultipleCallback = this.createMultipleCallbackHandler),
(n.classType = o(n, "classType", s)))
: Array.isArray(i) && h(i[0])
? ((n = i),
(i = null),
n.forEach(function (t) {
(t.internalCreateCallback = this.createCallbackHandler),
(t.internalRemoveCallback = this.removeCallbackHandler),
(t.createMultipleCallback = this.createMultipleCallbackHandler),
(t.classType = o(t, "classType", s));
}))
: (n = { internalCreateCallback: this.createCallbackHandler, internalRemoveCallback: this.removeCallbackHandler })
: (n = { internalCreateCallback: this.createCallbackHandler, internalRemoveCallback: this.removeCallbackHandler, createMultipleCallback: this.createMultipleCallbackHandler, classType: s }),
(this.world = t),
(this.physicsType = r.STATIC_BODY),
a.call(this, e, i, n),
(this.type = "StaticPhysicsGroup");
},
createCallbackHandler: function (t) {
t.body || this.world.enableBody(t, r.STATIC_BODY);
},
removeCallbackHandler: function (t) {
t.body && this.world.disableBody(t);
},
createMultipleCallbackHandler: function () {
this.refresh();
},
refresh: function () {
for (var t = this.children.entries, e = 0; e < t.length; e++) t[e].body.reset();
return this;
},
});
t.exports = l;
},
function (t, e, i) {
var v = i(350),
n = i(527),
p = i(18),
s = i(0),
o = i(528),
g = i(62),
y = i(50),
r = i(9),
m = i(245),
x = i(124),
b = i(354),
w = i(355),
T = i(246),
S = i(247),
_ = i(529),
a = i(6),
E = i(14),
h = i(211),
P = i(530),
l = i(10),
u = i(531),
A = i(532),
M = i(537),
C = i(538),
c = i(149),
d = i(539),
O = i(248),
f = i(25),
k = i(3),
R = i(68),
L = new s({
Extends: r,
initialize: function (t, e) {
r.call(this),
(this.scene = t),
(this.bodies = new c()),
(this.staticBodies = new c()),
(this.pendingDestroy = new c()),
(this.colliders = new h()),
(this.gravity = new k(a(e, "gravity.x", 0), a(e, "gravity.y", 0))),
(this.bounds = new l(a(e, "x", 0), a(e, "y", 0), a(e, "width", t.sys.scale.width), a(e, "height", t.sys.scale.height))),
(this.checkCollision = { up: a(e, "checkCollision.up", !0), down: a(e, "checkCollision.down", !0), left: a(e, "checkCollision.left", !0), right: a(e, "checkCollision.right", !0) }),
(this.fps = a(e, "fps", 60)),
(this.fixedStep = a(e, "fixedStep", !0)),
(this._elapsed = 0),
(this._frameTime = 1 / this.fps),
(this._frameTimeMS = 1e3 * this._frameTime),
(this.stepsLastFrame = 0),
(this.timeScale = a(e, "timeScale", 1)),
(this.OVERLAP_BIAS = a(e, "overlapBias", 4)),
(this.TILE_BIAS = a(e, "tileBias", 16)),
(this.forceX = a(e, "forceX", !1)),
(this.isPaused = a(e, "isPaused", !1)),
(this._total = 0),
(this.drawDebug = a(e, "debug", !1)),
this.debugGraphic,
(this.defaults = {
debugShowBody: a(e, "debugShowBody", !0),
debugShowStaticBody: a(e, "debugShowStaticBody", !0),
debugShowVelocity: a(e, "debugShowVelocity", !0),
bodyDebugColor: a(e, "debugBodyColor", 16711935),
staticBodyDebugColor: a(e, "debugStaticBodyColor", 255),
velocityDebugColor: a(e, "debugVelocityColor", 65280),
}),
(this.maxEntries = a(e, "maxEntries", 16)),
(this.useTree = a(e, "useTree", !0)),
(this.tree = new u(this.maxEntries)),
(this.staticTree = new u(this.maxEntries)),
(this.treeMinMax = { minX: 0, minY: 0, maxX: 0, maxY: 0 }),
(this._tempMatrix = new f()),
(this._tempMatrix2 = new f()),
this.drawDebug && this.createDebugGraphic();
},
enable: function (t, e) {
void 0 === e && (e = g.DYNAMIC_BODY), Array.isArray(t) || (t = [t]);
for (var i = 0; i < t.length; i++) {
var n = t[i];
if (n.isParent)
for (var s = n.getChildren(), r = 0; r < s.length; r++) {
var o = s[r];
o.isParent ? this.enable(o, e) : this.enableBody(o, e);
}
else this.enableBody(n, e);
}
},
enableBody: function (t, e) {
return void 0 === e && (e = g.DYNAMIC_BODY), t.body || (e === g.DYNAMIC_BODY ? (t.body = new n(this, t)) : e === g.STATIC_BODY && (t.body = new d(this, t))), this.add(t.body), t;
},
add: function (t) {
return t.physicsType === g.DYNAMIC_BODY ? this.bodies.set(t) : t.physicsType === g.STATIC_BODY && (this.staticBodies.set(t), this.staticTree.insert(t)), (t.enable = !0), t;
},
disable: function (t) {
Array.isArray(t) || (t = [t]);
for (var e = 0; e < t.length; e++) {
var i = t[e];
if (i.isParent)
for (var n = i.getChildren(), s = 0; s < n.length; s++) {
var r = n[s];
r.isParent ? this.disable(r) : this.disableBody(r.body);
}
else this.disableBody(i.body);
}
},
disableBody: function (t) {
this.remove(t), (t.enable = !1);
},
remove: function (t) {
t.physicsType === g.DYNAMIC_BODY ? (this.tree.remove(t), this.bodies.delete(t)) : t.physicsType === g.STATIC_BODY && (this.staticBodies.delete(t), this.staticTree.remove(t));
},
createDebugGraphic: function () {
var t = this.scene.sys.add.graphics({ x: 0, y: 0 });
return t.setDepth(Number.MAX_VALUE), (this.debugGraphic = t), (this.drawDebug = !0), t;
},
setBounds: function (t, e, i, n, s, r, o, a) {
return this.bounds.setTo(t, e, i, n), void 0 !== s && this.setBoundsCollision(s, r, o, a), this;
},
setBoundsCollision: function (t, e, i, n) {
return (
void 0 === t && (t = !0),
void 0 === e && (e = !0),
void 0 === i && (i = !0),
void 0 === n && (n = !0),
(this.checkCollision.left = t),
(this.checkCollision.right = e),
(this.checkCollision.up = i),
(this.checkCollision.down = n),
this
);
},
pause: function () {
return (this.isPaused = !0), this.emit(m.PAUSE), this;
},
resume: function () {
return (this.isPaused = !1), this.emit(m.RESUME), this;
},
addCollider: function (t, e, i, n, s) {
void 0 === i && (i = null), void 0 === n && (n = null), void 0 === s && (s = i);
var r = new o(this, !1, t, e, i, n, s);
return this.colliders.add(r), r;
},
addOverlap: function (t, e, i, n, s) {
void 0 === i && (i = null), void 0 === n && (n = null), void 0 === s && (s = i);
var r = new o(this, !0, t, e, i, n, s);
return this.colliders.add(r), r;
},
removeCollider: function (t) {
return this.colliders.remove(t), this;
},
setFPS: function (t) {
return (this.fps = t), (this._frameTime = 1 / this.fps), (this._frameTimeMS = 1e3 * this._frameTime), this;
},
update: function (t, e) {
if (!this.isPaused && 0 !== this.bodies.size) {
var i,
n = this._frameTime,
s = this._frameTimeMS * this.timeScale;
this._elapsed += e;
var r = this.bodies.entries,
o = this._elapsed >= s;
for (this.fixedStep || ((n = 0.001 * e), (o = !0), (this._elapsed = 0)), h = 0; h < r.length; h++) (i = r[h]).enable && i.preUpdate(o, n);
if (o) {
(this._elapsed -= s), (this.stepsLastFrame = 1), this.useTree && (this.tree.clear(), this.tree.load(r));
for (var a = this.colliders.update(), h = 0; h < a.length; h++) {
var l = a[h];
l.active && l.update();
}
this.emit(m.WORLD_STEP, n);
}
for (; this._elapsed >= s; ) (this._elapsed -= s), this.step(n);
}
},
step: function (t) {
for (var e, i = this.bodies.entries, n = i.length, s = 0; s < n; s++) (e = i[s]).enable && e.update(t);
this.useTree && (this.tree.clear(), this.tree.load(i));
var r = this.colliders.update();
for (s = 0; s < r.length; s++) {
var o = r[s];
o.active && o.update();
}
this.emit(m.WORLD_STEP, t), this.stepsLastFrame++;
},
postUpdate: function () {
var t,
e = (o = this.bodies.entries).length,
i = this.bodies,
n = this.staticBodies;
if (this.stepsLastFrame) for (l = this.stepsLastFrame = 0; l < e; l++) (t = o[l]).enable && t.postUpdate();
if (this.drawDebug) {
var s = this.debugGraphic;
for (s.clear(), l = 0; l < e; l++) (t = o[l]).willDrawDebug() && t.drawDebug(s);
for (e = (o = n.entries).length, l = 0; l < e; l++) (t = o[l]).willDrawDebug() && t.drawDebug(s);
}
var r = this.pendingDestroy;
if (0 < r.size) {
for (var o, a = this.tree, h = this.staticTree, l = ((e = (o = r.entries).length), 0); l < e; l++)
(t = o[l]).physicsType === g.DYNAMIC_BODY ? (a.remove(t), i.delete(t)) : t.physicsType === g.STATIC_BODY && (h.remove(t), n.delete(t)), (t.world = void 0), (t.gameObject = void 0);
r.clear();
}
},
updateMotion: function (t, e) {
t.allowRotation && this.computeAngularVelocity(t, e), this.computeVelocity(t, e);
},
computeAngularVelocity: function (t, e) {
var i = t.angularVelocity,
n = t.angularAcceleration,
s = t.angularDrag,
r = t.maxAngular;
n ? (i += n * e) : t.allowDrag && s && (b(i - (s *= e), 0, 0.1) ? (i -= s) : w(i + s, 0, 0.1) ? (i += s) : (i = 0));
var o = (i = p(i, -r, r)) - t.angularVelocity;
(t.angularVelocity += o), (t.rotation += t.angularVelocity * e);
},
computeVelocity: function (t, e) {
var i = t.velocity.x,
n = t.acceleration.x,
s = t.drag.x,
r = t.maxVelocity.x,
o = t.velocity.y,
a = t.acceleration.y,
h = t.drag.y,
l = t.maxVelocity.y,
u = t.speed,
c = t.maxSpeed,
d = t.allowDrag,
f = t.useDamping;
t.allowGravity && ((i += (this.gravity.x + t.gravity.x) * e), (o += (this.gravity.y + t.gravity.y) * e)),
n ? (i += n * e) : d && s && (f ? ((i *= s = Math.pow(s, e)), (u = Math.sqrt(i * i + o * o)), x(u, 0, 0.001) && (i = 0)) : b(i - (s *= e), 0, 0.01) ? (i -= s) : w(i + s, 0, 0.01) ? (i += s) : (i = 0)),
a ? (o += a * e) : d && h && (f ? ((o *= h = Math.pow(h, e)), (u = Math.sqrt(i * i + o * o)), x(u, 0, 0.001) && (o = 0)) : b(o - (h *= e), 0, 0.01) ? (o -= h) : w(o + h, 0, 0.01) ? (o += h) : (o = 0)),
(i = p(i, -r, r)),
(o = p(o, -l, l)),
t.velocity.set(i, o),
-1 < c && c < u && (t.velocity.normalize().scale(c), (u = c)),
(t.speed = u);
},
separate: function (t, e, i, n, s, r) {
if ((!r && !t.enable) || !e.enable || t.checkCollision.none || e.checkCollision.none || !this.intersects(t, e)) return !1;
if (i && !1 === i.call(n, t.gameObject, e.gameObject)) return !1;
if (t.isCircle && e.isCircle) return this.separateCircle(t, e, s);
if (t.isCircle !== e.isCircle) {
var o = t.isCircle ? e : t,
a = t.isCircle ? t : e,
h = o.x,
l = o.y,
u = o.right,
c = o.bottom,
d = a.center;
if ((d.y < l || d.y > c) && (d.x < h || d.x > u)) return this.separateCircle(t, e, s);
}
var f = !1,
p = !1;
s
? ((f = M(t, e, s, this.OVERLAP_BIAS)), (p = C(t, e, s, this.OVERLAP_BIAS)))
: this.forceX || Math.abs(this.gravity.y + t.gravity.y) < Math.abs(this.gravity.x + t.gravity.x)
? ((f = M(t, e, s, this.OVERLAP_BIAS)), this.intersects(t, e) && (p = C(t, e, s, this.OVERLAP_BIAS)))
: ((p = C(t, e, s, this.OVERLAP_BIAS)), this.intersects(t, e) && (f = M(t, e, s, this.OVERLAP_BIAS)));
var g = f || p;
return g && (s ? (t.onOverlap || e.onOverlap) && this.emit(m.OVERLAP, t.gameObject, e.gameObject, t, e) : (t.onCollide || e.onCollide) && this.emit(m.COLLIDE, t.gameObject, e.gameObject, t, e)), g;
},
separateCircle: function (t, e, i, n) {
T(t, e, !1, n), S(t, e, !1, n);
var s,
r,
o = 0;
if (
(t.isCircle !== e.isCircle
? ((s = { x: e.isCircle ? t.position.x : e.position.x, y: e.isCircle ? t.position.y : e.position.y, right: e.isCircle ? t.right : e.right, bottom: e.isCircle ? t.bottom : e.bottom }),
(r = { x: t.isCircle ? t.center.x : e.center.x, y: t.isCircle ? t.center.y : e.center.y, radius: t.isCircle ? t.halfWidth : e.halfWidth }).y < s.y
? r.x < s.x
? (o = y(r.x, r.y, s.x, s.y) - r.radius)
: s.right < r.x && (o = y(r.x, r.y, s.right, s.y) - r.radius)
: s.bottom < r.y && (r.x < s.x ? (o = y(r.x, r.y, s.x, s.bottom) - r.radius) : s.right < r.x && (o = y(r.x, r.y, s.right, s.bottom) - r.radius)),
(o *= -1))
: (o = t.halfWidth + e.halfWidth - y(t.center.x, t.center.y, e.center.x, e.center.y)),
(t.overlapR = o),
(e.overlapR = o),
i || 0 === o || (t.immovable && e.immovable) || t.customSeparateX || e.customSeparateX)
)
return 0 !== o && (t.onOverlap || e.onOverlap) && this.emit(m.OVERLAP, t.gameObject, e.gameObject, t, e), 0 !== o;
var a = t.center.x - e.center.x,
h = t.center.y - e.center.y,
l = Math.sqrt(Math.pow(a, 2) + Math.pow(h, 2)),
u = (e.center.x - t.center.x) / l || 0,
c = (e.center.y - t.center.y) / l || 0,
d = (2 * (t.velocity.x * u + t.velocity.y * c - e.velocity.x * u - e.velocity.y * c)) / (t.mass + e.mass);
(t.immovable || e.immovable) && (d *= 2),
t.immovable || ((t.velocity.x = t.velocity.x - (d / t.mass) * u), (t.velocity.y = t.velocity.y - (d / t.mass) * c)),
e.immovable || ((e.velocity.x = e.velocity.x + (d / e.mass) * u), (e.velocity.y = e.velocity.y + (d / e.mass) * c)),
t.immovable || e.immovable || (o /= 2);
var f = v(t.center, e.center),
p = (o + E.EPSILON) * Math.cos(f),
g = (o + E.EPSILON) * Math.sin(f);
return (
t.immovable || ((t.x -= p), (t.y -= g), t.updateCenter()),
e.immovable || ((e.x += p), (e.y += g), e.updateCenter()),
(t.velocity.x *= t.bounce.x),
(t.velocity.y *= t.bounce.y),
(e.velocity.x *= e.bounce.x),
(e.velocity.y *= e.bounce.y),
(t.onCollide || e.onCollide) && this.emit(m.COLLIDE, t.gameObject, e.gameObject, t, e),
!0
);
},
intersects: function (t, e) {
return (
t !== e &&
(t.isCircle || e.isCircle
? t.isCircle
? e.isCircle
? y(t.center.x, t.center.y, e.center.x, e.center.y) <= t.halfWidth + e.halfWidth
: this.circleBodyIntersects(t, e)
: this.circleBodyIntersects(e, t)
: !(t.right <= e.position.x || t.bottom <= e.position.y || t.position.x >= e.right || t.position.y >= e.bottom))
);
},
circleBodyIntersects: function (t, e) {
var i = p(t.center.x, e.left, e.right),
n = p(t.center.y, e.top, e.bottom);
return (t.center.x - i) * (t.center.x - i) + (t.center.y - n) * (t.center.y - n) <= t.halfWidth * t.halfWidth;
},
overlap: function (t, e, i, n, s) {
return void 0 === i && (i = null), void 0 === n && (n = null), void 0 === s && (s = i), this.collideObjects(t, e, i, n, s, !0);
},
collide: function (t, e, i, n, s) {
return void 0 === i && (i = null), void 0 === n && (n = null), void 0 === s && (s = i), this.collideObjects(t, e, i, n, s, !1);
},
collideObjects: function (t, e, i, n, s, r) {
var o;
t.isParent && void 0 === t.physicsType && (t = t.children.entries), e && e.isParent && void 0 === e.physicsType && (e = e.children.entries);
var a = Array.isArray(t),
h = Array.isArray(e);
if (((this._total = 0), a || h))
if (!a && h) for (o = 0; o < e.length; o++) this.collideHandler(t, e[o], i, n, s, r);
else if (a && !h)
if (e) for (o = 0; o < t.length; o++) this.collideHandler(t[o], e, i, n, s, r);
else for (o = 0; o < t.length; o++) for (var l = t[o], u = o + 1; u < t.length; u++) o !== u && this.collideHandler(l, t[u], i, n, s, r);
else for (o = 0; o < t.length; o++) for (u = 0; u < e.length; u++) this.collideHandler(t[o], e[u], i, n, s, r);
else this.collideHandler(t, e, i, n, s, r);
return 0 < this._total;
},
collideHandler: function (t, e, i, n, s, r) {
if (void 0 === e && t.isParent) return this.collideGroupVsGroup(t, t, i, n, s, r);
if (!t || !e) return !1;
if (t.body) {
if (e.body) return this.collideSpriteVsSprite(t, e, i, n, s, r);
if (e.isParent) return this.collideSpriteVsGroup(t, e, i, n, s, r);
if (e.isTilemap) return this.collideSpriteVsTilemapLayer(t, e, i, n, s, r);
} else if (t.isParent) {
if (e.body) return this.collideSpriteVsGroup(e, t, i, n, s, r);
if (e.isParent) return this.collideGroupVsGroup(t, e, i, n, s, r);
if (e.isTilemap) return this.collideGroupVsTilemapLayer(t, e, i, n, s, r);
} else if (t.isTilemap) {
if (e.body) return this.collideSpriteVsTilemapLayer(e, t, i, n, s, r);
if (e.isParent) return this.collideGroupVsTilemapLayer(e, t, i, n, s, r);
}
},
collideSpriteVsSprite: function (t, e, i, n, s, r) {
return !(!t.body || !e.body || (this.separate(t.body, e.body, n, s, r) && (i && i.call(s, t, e), this._total++), 0));
},
collideSpriteVsGroup: function (t, e, i, n, s, r) {
var o,
a = t.body;
if (0 !== e.length && a && a.enable && !a.checkCollision.none)
if (this.useTree || e.physicsType === g.STATIC_BODY) {
var h = this.treeMinMax;
(h.minX = a.left), (h.minY = a.top), (h.maxX = a.right), (h.maxY = a.bottom);
for (var l = e.physicsType === g.DYNAMIC_BODY ? this.tree.search(h) : this.staticTree.search(h), u = l.length, c = 0; c < u; c++)
a !== (o = l[c]) && o.enable && !o.checkCollision.none && e.contains(o.gameObject) && this.separate(a, o, n, s, r, !0) && (i && i.call(s, a.gameObject, o.gameObject), this._total++);
} else {
var d = e.getChildren(),
f = e.children.entries.indexOf(t);
for (u = d.length, c = 0; c < u; c++) (o = d[c].body) && c !== f && o.enable && this.separate(a, o, n, s, r) && (i && i.call(s, a.gameObject, o.gameObject), this._total++);
}
},
collideGroupVsTilemapLayer: function (t, e, i, n, s, r) {
var o = t.getChildren();
if (0 === o.length) return !1;
for (var a = !1, h = 0; h < o.length; h++) o[h].body && this.collideSpriteVsTilemapLayer(o[h], e, i, n, s, r) && (a = !0);
return a;
},
collideTiles: function (t, e, i, n, s) {
return !(!t.body.enable || 0 === e.length) && this.collideSpriteVsTilesHandler(t, e, i, n, s, !1, !1);
},
overlapTiles: function (t, e, i, n, s) {
return !(!t.body.enable || 0 === e.length) && this.collideSpriteVsTilesHandler(t, e, i, n, s, !0, !1);
},
collideSpriteVsTilemapLayer: function (t, e, i, n, s, r) {
var o = t.body;
if (!o.enable || o.checkCollision.none) return !1;
var a,
h = o.position.x,
l = o.position.y,
u = o.width,
c = o.height,
d = e.layer;
d.tileWidth > d.baseTileWidth && ((h -= a = (d.tileWidth - d.baseTileWidth) * e.scaleX), (u += a)), d.tileHeight > d.baseTileHeight && (c += (d.tileHeight - d.baseTileHeight) * e.scaleY);
var f = _(h, l, u, c, null, e.scene.cameras.main, e.layer);
return 0 !== f.length && this.collideSpriteVsTilesHandler(t, f, i, n, s, r, !0);
},
collideSpriteVsTilesHandler: function (t, e, i, n, s, r, o) {
for (var a, h, l = t.body, u = { left: 0, right: 0, top: 0, bottom: 0 }, c = !1, d = 0; d < e.length; d++) {
var f = (h = (a = e[d]).tilemapLayer).tileToWorldXY(a.x, a.y);
(u.left = f.x),
(u.top = f.y),
a.baseHeight !== a.height && (u.top -= (a.height - a.baseHeight) * h.scaleY),
(u.right = u.left + a.width * h.scaleX),
(u.bottom = u.top + a.height * h.scaleY),
O(u, l) &&
(!n || n.call(s, t, a)) &&
P(a, t) &&
(r || A(d, l, a, u, h, this.TILE_BIAS, o)) &&
(this._total++, (c = !0), i && i.call(s, t, a), r && l.onOverlap ? this.emit(m.TILE_OVERLAP, t, a, l) : l.onCollide && this.emit(m.TILE_COLLIDE, t, a, l));
}
return c;
},
collideGroupVsGroup: function (t, e, i, n, s, r) {
if (0 !== t.length && 0 !== e.length) for (var o = t.getChildren(), a = 0; a < o.length; a++) this.collideSpriteVsGroup(o[a], e, i, n, s, r);
},
wrap: function (t, e) {
t.body ? this.wrapObject(t, e) : t.getChildren ? this.wrapArray(t.getChildren(), e) : Array.isArray(t) ? this.wrapArray(t, e) : this.wrapObject(t, e);
},
wrapArray: function (t, e) {
for (var i = 0; i < t.length; i++) this.wrapObject(t[i], e);
},
wrapObject: function (t, e) {
void 0 === e && (e = 0), (t.x = R(t.x, this.bounds.left - e, this.bounds.right + e)), (t.y = R(t.y, this.bounds.top - e, this.bounds.bottom + e));
},
shutdown: function () {
this.tree.clear(), this.staticTree.clear(), this.bodies.clear(), this.staticBodies.clear(), this.colliders.destroy(), this.removeAllListeners();
},
destroy: function () {
this.shutdown(), (this.scene = null);
},
});
t.exports = L;
},
function (t, e, i) {
var n = i(0),
s = i(62),
r = i(245),
a = i(196),
o = i(10),
h = i(57),
l = i(3),
u = new n({
initialize: function (t, e) {
var i = e.displayWidth ? e.displayWidth : 64,
n = e.displayHeight ? e.displayHeight : 64;
(this.world = t),
(this.gameObject = e),
(this.transform = { x: e.x, y: e.y, rotation: e.angle, scaleX: e.scaleX, scaleY: e.scaleY, displayOriginX: e.displayOriginX, displayOriginY: e.displayOriginY }),
(this.debugShowBody = t.defaults.debugShowBody),
(this.debugShowVelocity = t.defaults.debugShowVelocity),
(this.debugBodyColor = t.defaults.bodyDebugColor),
(this.enable = !0),
(this.isCircle = !1),
(this.radius = 0),
(this.offset = new l()),
(this.position = new l(e.x - e.scaleX * e.displayOriginX, e.y - e.scaleY * e.displayOriginY)),
(this.prev = this.position.clone()),
(this.prevFrame = this.position.clone()),
(this.allowRotation = !0),
(this.rotation = e.angle),
(this.preRotation = e.angle),
(this.width = i),
(this.height = n),
(this.sourceWidth = i),
(this.sourceHeight = n),
e.frame && ((this.sourceWidth = e.frame.realWidth), (this.sourceHeight = e.frame.realHeight)),
(this.halfWidth = Math.abs(i / 2)),
(this.halfHeight = Math.abs(n / 2)),
(this.center = new l(this.position.x + this.halfWidth, this.position.y + this.halfHeight)),
(this.velocity = new l()),
(this.newVelocity = new l()),
(this.deltaMax = new l()),
(this.acceleration = new l()),
(this.allowDrag = !0),
(this.drag = new l()),
(this.allowGravity = !0),
(this.gravity = new l()),
(this.bounce = new l()),
(this.worldBounce = null),
(this.customBoundsRectangle = t.bounds),
(this.onWorldBounds = !1),
(this.onCollide = !1),
(this.onOverlap = !1),
(this.maxVelocity = new l(1e4, 1e4)),
(this.maxSpeed = -1),
(this.friction = new l(1, 0)),
(this.useDamping = !1),
(this.angularVelocity = 0),
(this.angularAcceleration = 0),
(this.angularDrag = 0),
(this.maxAngular = 1e3),
(this.mass = 1),
(this.angle = 0),
(this.speed = 0),
(this.facing = s.FACING_NONE),
(this.immovable = !1),
(this.pushable = !0),
(this.moves = !0),
(this.customSeparateX = !1),
(this.customSeparateY = !1),
(this.overlapX = 0),
(this.overlapY = 0),
(this.overlapR = 0),
(this.embedded = !1),
(this.collideWorldBounds = !1),
(this.checkCollision = { none: !1, up: !0, down: !0, left: !0, right: !0 }),
(this.touching = { none: !0, up: !1, down: !1, left: !1, right: !1 }),
(this.wasTouching = { none: !0, up: !1, down: !1, left: !1, right: !1 }),
(this.blocked = { none: !0, up: !1, down: !1, left: !1, right: !1 }),
(this.syncBounds = !1),
(this.physicsType = s.DYNAMIC_BODY),
(this._sx = e.scaleX),
(this._sy = e.scaleY),
(this._dx = 0),
(this._dy = 0),
(this._tx = 0),
(this._ty = 0),
(this._bounds = new o());
},
updateBounds: function () {
var t,
e = this.gameObject,
i = this.transform;
e.parentContainer
? ((t = e.getWorldTransformMatrix(this.world._tempMatrix, this.world._tempMatrix2)), (i.x = t.tx), (i.y = t.ty), (i.rotation = a(t.rotation)), (i.scaleX = t.scaleX), (i.scaleY = t.scaleY))
: ((i.x = e.x), (i.y = e.y), (i.rotation = e.angle), (i.scaleX = e.scaleX), (i.scaleY = e.scaleY)),
(i.displayOriginX = e.displayOriginX),
(i.displayOriginY = e.displayOriginY);
var n,
s,
r,
o = !1;
this.syncBounds
? ((n = e.getBounds(this._bounds)), (this.width = n.width), (this.height = n.height), (o = !0))
: ((s = Math.abs(i.scaleX)),
(r = Math.abs(i.scaleY)),
(this._sx === s && this._sy === r) || ((this.width = this.sourceWidth * s), (this.height = this.sourceHeight * r), (this._sx = s), (this._sy = r), (o = !0))),
o && ((this.halfWidth = Math.floor(this.width / 2)), (this.halfHeight = Math.floor(this.height / 2)), this.updateCenter());
},
updateCenter: function () {
this.center.set(this.position.x + this.halfWidth, this.position.y + this.halfHeight);
},
updateFromGameObject: function () {
this.updateBounds();
var t = this.transform;
(this.position.x = t.x + t.scaleX * (this.offset.x - t.displayOriginX)), (this.position.y = t.y + t.scaleY * (this.offset.y - t.displayOriginY)), this.updateCenter();
},
resetFlags: function (t) {
void 0 === t && (t = !1);
var e = this.wasTouching,
i = this.touching,
n = this.blocked;
t ? ((e.none = !0), (e.up = !1), (e.down = !1), (e.left = !1), (e.right = !1)) : ((e.none = i.none), (e.up = i.up), (e.down = i.down), (e.left = i.left), (e.right = i.right)),
(i.none = !0),
(i.up = !1),
(i.down = !1),
(i.left = !1),
(i.right = !1),
(n.none = !0),
(n.up = !1),
(n.down = !1),
(n.left = !1),
(n.right = !1),
(this.overlapR = 0),
(this.overlapX = 0),
(this.overlapY = 0),
(this.embedded = !1);
},
preUpdate: function (t, e) {
t && this.resetFlags(),
this.updateFromGameObject(),
(this.rotation = this.transform.rotation),
(this.preRotation = this.rotation),
this.moves && ((this.prev.x = this.position.x), (this.prev.y = this.position.y), (this.prevFrame.x = this.position.x), (this.prevFrame.y = this.position.y)),
t && this.update(e);
},
update: function (t) {
var e, i;
(this.prev.x = this.position.x),
(this.prev.y = this.position.y),
this.moves &&
(this.world.updateMotion(this, t),
(e = this.velocity.x),
(i = this.velocity.y),
this.newVelocity.set(e * t, i * t),
this.position.add(this.newVelocity),
this.updateCenter(),
(this.angle = Math.atan2(i, e)),
(this.speed = Math.sqrt(e * e + i * i)),
this.collideWorldBounds && this.checkWorldBounds() && this.onWorldBounds && this.world.emit(r.WORLD_BOUNDS, this, this.blocked.up, this.blocked.down, this.blocked.left, this.blocked.right)),
(this._dx = this.position.x - this.prev.x),
(this._dy = this.position.y - this.prev.y);
},
postUpdate: function () {
var t,
e,
i = this.position.x - this.prevFrame.x,
n = this.position.y - this.prevFrame.y;
this.moves &&
(0 !== (t = this.deltaMax.x) && 0 !== i && (i < 0 && i < -t ? (i = -t) : 0 < i && t < i && (i = t)),
0 !== (e = this.deltaMax.y) && 0 !== n && (n < 0 && n < -e ? (n = -e) : 0 < n && e < n && (n = e)),
(this.gameObject.x += i),
(this.gameObject.y += n)),
i < 0 ? (this.facing = s.FACING_LEFT) : 0 < i && (this.facing = s.FACING_RIGHT),
n < 0 ? (this.facing = s.FACING_UP) : 0 < n && (this.facing = s.FACING_DOWN),
this.allowRotation && (this.gameObject.angle += this.deltaZ()),
(this._tx = i),
(this._ty = n);
},
setBoundsRectangle: function (t) {
return (this.customBoundsRectangle = t || this.world.bounds), this;
},
checkWorldBounds: function () {
var t = this.position,
e = this.customBoundsRectangle,
i = this.world.checkCollision,
n = this.worldBounce ? -this.worldBounce.x : -this.bounce.x,
s = this.worldBounce ? -this.worldBounce.y : -this.bounce.y,
r = !1;
return (
t.x < e.x && i.left
? ((t.x = e.x), (this.velocity.x *= n), (r = this.blocked.left = !0))
: this.right > e.right && i.right && ((t.x = e.right - this.width), (this.velocity.x *= n), (r = this.blocked.right = !0)),
t.y < e.y && i.up
? ((t.y = e.y), (this.velocity.y *= s), (r = this.blocked.up = !0))
: this.bottom > e.bottom && i.down && ((t.y = e.bottom - this.height), (this.velocity.y *= s), (r = this.blocked.down = !0)),
r && ((this.blocked.none = !1), this.updateCenter()),
r
);
},
setOffset: function (t, e) {
return void 0 === e && (e = t), this.offset.set(t, e), this;
},
setSize: function (t, e, i) {
void 0 === i && (i = !0);
var n,
s,
r = this.gameObject;
return (
!t && r.frame && (t = r.frame.realWidth),
!e && r.frame && (e = r.frame.realHeight),
(this.sourceWidth = t),
(this.sourceHeight = e),
(this.width = this.sourceWidth * this._sx),
(this.height = this.sourceHeight * this._sy),
(this.halfWidth = Math.floor(this.width / 2)),
(this.halfHeight = Math.floor(this.height / 2)),
this.updateCenter(),
i && r.getCenter && ((n = (r.width - t) / 2), (s = (r.height - e) / 2), this.offset.set(n, s)),
(this.isCircle = !1),
(this.radius = 0),
this
);
},
setCircle: function (t, e, i) {
return (
void 0 === e && (e = this.offset.x),
void 0 === i && (i = this.offset.y),
0 < t
? ((this.isCircle = !0),
(this.radius = t),
(this.sourceWidth = 2 * t),
(this.sourceHeight = 2 * t),
(this.width = this.sourceWidth * this._sx),
(this.height = this.sourceHeight * this._sy),
(this.halfWidth = Math.floor(this.width / 2)),
(this.halfHeight = Math.floor(this.height / 2)),
this.offset.set(e, i),
this.updateCenter())
: (this.isCircle = !1),
this
);
},
reset: function (t, e) {
this.stop();
var i = this.gameObject;
i.setPosition(t, e),
i.getTopLeft ? i.getTopLeft(this.position) : this.position.set(t, e),
this.prev.copy(this.position),
this.prevFrame.copy(this.position),
(this.rotation = i.angle),
(this.preRotation = i.angle),
this.updateBounds(),
this.updateCenter(),
this.resetFlags(!0);
},
stop: function () {
return this.velocity.set(0), this.acceleration.set(0), (this.speed = 0), (this.angularVelocity = 0), (this.angularAcceleration = 0), this;
},
getBounds: function (t) {
return (t.x = this.x), (t.y = this.y), (t.right = this.right), (t.bottom = this.bottom), t;
},
hitTest: function (t, e) {
return this.isCircle
? 0 < this.radius &&
t >= this.left &&
t <= this.right &&
e >= this.top &&
e <= this.bottom &&
(this.center.x - t) * (this.center.x - t) + (this.center.y - e) * (this.center.y - e) <= this.radius * this.radius
: h(this, t, e);
},
onFloor: function () {
return this.blocked.down;
},
onCeiling: function () {
return this.blocked.up;
},
onWall: function () {
return this.blocked.left || this.blocked.right;
},
deltaAbsX: function () {
return 0 < this._dx ? this._dx : -this._dx;
},
deltaAbsY: function () {
return 0 < this._dy ? this._dy : -this._dy;
},
deltaX: function () {
return this._dx;
},
deltaY: function () {
return this._dy;
},
deltaXFinal: function () {
return this._tx;
},
deltaYFinal: function () {
return this._ty;
},
deltaZ: function () {
return this.rotation - this.preRotation;
},
destroy: function () {
(this.enable = !1), this.world && this.world.pendingDestroy.set(this);
},
drawDebug: function (t) {
var e = this.position,
i = e.x + this.halfWidth,
n = e.y + this.halfHeight;
this.debugShowBody &&
(t.lineStyle(t.defaultStrokeWidth, this.debugBodyColor),
this.isCircle
? t.strokeCircle(i, n, this.width / 2)
: (this.checkCollision.up && t.lineBetween(e.x, e.y, e.x + this.width, e.y),
this.checkCollision.right && t.lineBetween(e.x + this.width, e.y, e.x + this.width, e.y + this.height),
this.checkCollision.down && t.lineBetween(e.x, e.y + this.height, e.x + this.width, e.y + this.height),
this.checkCollision.left && t.lineBetween(e.x, e.y, e.x, e.y + this.height))),
this.debugShowVelocity && (t.lineStyle(t.defaultStrokeWidth, this.world.defaults.velocityDebugColor, 1), t.lineBetween(i, n, i + this.velocity.x / 2, n + this.velocity.y / 2));
},
willDrawDebug: function () {
return this.debugShowBody || this.debugShowVelocity;
},
setCollideWorldBounds: function (t, e, i, n) {
void 0 === t && (t = !0), (this.collideWorldBounds = t);
var s = void 0 !== e,
r = void 0 !== i;
return (s || r) && (this.worldBounce || (this.worldBounce = new l()), s && (this.worldBounce.x = e), r && (this.worldBounce.y = i)), void 0 !== n && (this.onWorldBounds = n), this;
},
setVelocity: function (t, e) {
return this.velocity.set(t, e), (t = this.velocity.x), (e = this.velocity.y), (this.speed = Math.sqrt(t * t + e * e)), this;
},
setVelocityX: function (t) {
this.velocity.x = t;
var e = this.velocity.y;
return (this.speed = Math.sqrt(t * t + e * e)), this;
},
setVelocityY: function (t) {
this.velocity.y = t;
var e = this.velocity.x;
return (this.speed = Math.sqrt(e * e + t * t)), this;
},
setMaxVelocity: function (t, e) {
return this.maxVelocity.set(t, e), this;
},
setMaxVelocityX: function (t) {
return (this.maxVelocity.x = t), this;
},
setMaxVelocityY: function (t) {
return (this.maxVelocity.y = t), this;
},
setMaxSpeed: function (t) {
return (this.maxSpeed = t), this;
},
setBounce: function (t, e) {
return this.bounce.set(t, e), this;
},
setBounceX: function (t) {
return (this.bounce.x = t), this;
},
setBounceY: function (t) {
return (this.bounce.y = t), this;
},
setAcceleration: function (t, e) {
return this.acceleration.set(t, e), this;
},
setAccelerationX: function (t) {
return (this.acceleration.x = t), this;
},
setAccelerationY: function (t) {
return (this.acceleration.y = t), this;
},
setAllowDrag: function (t) {
return void 0 === t && (t = !0), (this.allowDrag = t), this;
},
setAllowGravity: function (t) {
return void 0 === t && (t = !0), (this.allowGravity = t), this;
},
setAllowRotation: function (t) {
return void 0 === t && (t = !0), (this.allowRotation = t), this;
},
setDrag: function (t, e) {
return this.drag.set(t, e), this;
},
setDamping: function (t) {
return (this.useDamping = t), this;
},
setDragX: function (t) {
return (this.drag.x = t), this;
},
setDragY: function (t) {
return (this.drag.y = t), this;
},
setGravity: function (t, e) {
return this.gravity.set(t, e), this;
},
setGravityX: function (t) {
return (this.gravity.x = t), this;
},
setGravityY: function (t) {
return (this.gravity.y = t), this;
},
setFriction: function (t, e) {
return this.friction.set(t, e), this;
},
setFrictionX: function (t) {
return (this.friction.x = t), this;
},
setFrictionY: function (t) {
return (this.friction.y = t), this;
},
setAngularVelocity: function (t) {
return (this.angularVelocity = t), this;
},
setAngularAcceleration: function (t) {
return (this.angularAcceleration = t), this;
},
setAngularDrag: function (t) {
return (this.angularDrag = t), this;
},
setMass: function (t) {
return (this.mass = t), this;
},
setImmovable: function (t) {
return void 0 === t && (t = !0), (this.immovable = t), this;
},
setEnable: function (t) {
return void 0 === t && (t = !0), (this.enable = t), this;
},
processX: function (t, e, i, n) {
(this.x += t), this.updateCenter(), null !== e && (this.velocity.x = e);
var s = this.blocked;
i && (s.left = !0), n && (s.right = !0);
},
processY: function (t, e, i, n) {
(this.y += t), this.updateCenter(), null !== e && (this.velocity.y = e);
var s = this.blocked;
i && (s.up = !0), n && (s.down = !0);
},
x: {
get: function () {
return this.position.x;
},
set: function (t) {
this.position.x = t;
},
},
y: {
get: function () {
return this.position.y;
},
set: function (t) {
this.position.y = t;
},
},
left: {
get: function () {
return this.position.x;
},
},
right: {
get: function () {
return this.position.x + this.width;
},
},
top: {
get: function () {
return this.position.y;
},
},
bottom: {
get: function () {
return this.position.y + this.height;
},
},
});
t.exports = u;
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e, i, n, s, r, o) {
(this.world = t), (this.name = ""), (this.active = !0), (this.overlapOnly = e), (this.object1 = i), (this.object2 = n), (this.collideCallback = s), (this.processCallback = r), (this.callbackContext = o);
},
setName: function (t) {
return (this.name = t), this;
},
update: function () {
this.world.collideObjects(this.object1, this.object2, this.collideCallback, this.processCallback, this.callbackContext, this.overlapOnly);
},
destroy: function () {
this.world.removeCollider(this), (this.active = !1), (this.world = null), (this.object1 = null), (this.object2 = null), (this.collideCallback = null), (this.processCallback = null), (this.callbackContext = null);
},
});
t.exports = n;
},
function (t, e, i) {
var d = i(26),
n = i(3),
f = new n(),
p = new n();
t.exports = function (t, e, i, n, s, r, o) {
var a = o.tilemapLayer.tilemap._convert.WorldToTileXY;
a(t, e, !0, f, r, o);
var h = f.x,
l = f.y;
a(t + i, e + n, !1, p, r, o);
var u = Math.ceil(p.x),
c = Math.ceil(p.y);
return d(h, l, u - h, c - l, s, o);
};
},
function (t, e) {
t.exports = function (t, e) {
return t.collisionCallback ? !t.collisionCallback.call(t.collisionCallbackContext, e, t) : !t.layer.callbacks[t.index] || !t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext, e, t);
};
},
function (t, e, i) {
var a = i(436);
function n(t) {
if (!(this instanceof n)) return new n(t);
(this._maxEntries = Math.max(4, t || 9)), (this._minEntries = Math.max(2, Math.ceil(0.4 * this._maxEntries))), this.clear();
}
function f(t, e) {
y(t, 0, t.children.length, e, t);
}
function y(t, e, i, n, s) {
((s = s || p(null)).minX = 1 / 0), (s.minY = 1 / 0), (s.maxX = -1 / 0), (s.maxY = -1 / 0);
for (var r, o = e; o < i; o++) (r = t.children[o]), u(s, t.leaf ? n(r) : r);
return s;
}
function u(t, e) {
return (t.minX = Math.min(t.minX, e.minX)), (t.minY = Math.min(t.minY, e.minY)), (t.maxX = Math.max(t.maxX, e.maxX)), (t.maxY = Math.max(t.maxY, e.maxY)), t;
}
function r(t, e) {
return t.minX - e.minX;
}
function o(t, e) {
return t.minY - e.minY;
}
function m(t) {
return (t.maxX - t.minX) * (t.maxY - t.minY);
}
function c(t) {
return t.maxX - t.minX + (t.maxY - t.minY);
}
function d(t, e) {
return t.minX <= e.minX && t.minY <= e.minY && e.maxX <= t.maxX && e.maxY <= t.maxY;
}
function l(t, e) {
return e.minX <= t.maxX && e.minY <= t.maxY && e.maxX >= t.minX && e.maxY >= t.minY;
}
function p(t) {
return { children: t, height: 1, leaf: !0, minX: 1 / 0, minY: 1 / 0, maxX: -1 / 0, maxY: -1 / 0 };
}
function g(t, e, i, n, s) {
for (var r, o = [e, i]; o.length; ) (i = o.pop()) - (e = o.pop()) <= n || ((r = e + Math.ceil((i - e) / n / 2) * n), a(t, r, e, i, s), o.push(e, r, r, i));
}
(n.prototype = {
all: function () {
return this._all(this.data, []);
},
search: function (t) {
var e = this.data,
i = [],
n = this.toBBox;
if (!l(t, e)) return i;
for (var s, r, o, a, h = []; e; ) {
for (s = 0, r = e.children.length; s < r; s++) (o = e.children[s]), l(t, (a = e.leaf ? n(o) : o)) && (e.leaf ? i.push(o) : d(t, a) ? this._all(o, i) : h.push(o));
e = h.pop();
}
return i;
},
collides: function (t) {
var e = this.data,
i = this.toBBox;
if (!l(t, e)) return !1;
for (var n, s, r, o, a = []; e; ) {
for (n = 0, s = e.children.length; n < s; n++)
if (((r = e.children[n]), l(t, (o = e.leaf ? i(r) : r)))) {
if (e.leaf || d(t, o)) return !0;
a.push(r);
}
e = a.pop();
}
return !1;
},
load: function (t) {
if (!t || !t.length) return this;
if (t.length < this._minEntries) {
for (var e = 0, i = t.length; e < i; e++) this.insert(t[e]);
return this;
}
var n,
s = this._build(t.slice(), 0, t.length - 1, 0);
return (
this.data.children.length
? this.data.height === s.height
? this._splitRoot(this.data, s)
: (this.data.height < s.height && ((n = this.data), (this.data = s), (s = n)), this._insert(s, this.data.height - s.height - 1, !0))
: (this.data = s),
this
);
},
insert: function (t) {
return t && this._insert(t, this.data.height - 1), this;
},
clear: function () {
return (this.data = p([])), this;
},
remove: function (t, e) {
if (!t) return this;
for (var i, n, s, r, o = this.data, a = this.toBBox(t), h = [], l = []; o || h.length; ) {
if (
(o || ((o = h.pop()), (n = h[h.length - 1]), (i = l.pop()), (r = !0)),
o.leaf &&
-1 !==
(s = (function (t, e, i) {
if (!i) return e.indexOf(t);
for (var n = 0; n < e.length; n++) if (i(t, e[n])) return n;
return -1;
})(t, o.children, e)))
)
return o.children.splice(s, 1), h.push(o), this._condense(h), this;
r || o.leaf || !d(o, a) ? (n ? (i++, (o = n.children[i]), (r = !1)) : (o = null)) : (h.push(o), l.push(i), (i = 0), (o = (n = o).children[0]));
}
return this;
},
toBBox: function (t) {
return { minX: t.left, minY: t.top, maxX: t.right, maxY: t.bottom };
},
compareMinX: function (t, e) {
return t.left - e.left;
},
compareMinY: function (t, e) {
return t.top - e.top;
},
toJSON: function () {
return this.data;
},
fromJSON: function (t) {
return (this.data = t), this;
},
_all: function (t, e) {
for (var i = []; t; ) t.leaf ? e.push.apply(e, t.children) : i.push.apply(i, t.children), (t = i.pop());
return e;
},
_build: function (t, e, i, n) {
var s,
r = i - e + 1,
o = this._maxEntries;
if (r <= o) return f((s = p(t.slice(e, i + 1))), this.toBBox), s;
n || ((n = Math.ceil(Math.log(r) / Math.log(o))), (o = Math.ceil(r / Math.pow(o, n - 1)))), ((s = p([])).leaf = !1), (s.height = n);
var a,
h,
l,
u,
c = Math.ceil(r / o),
d = c * Math.ceil(Math.sqrt(o));
for (g(t, e, i, d, this.compareMinX), a = e; a <= i; a += d)
for (g(t, a, (l = Math.min(a + d - 1, i)), c, this.compareMinY), h = a; h <= l; h += c) (u = Math.min(h + c - 1, l)), s.children.push(this._build(t, h, u, n - 1));
return f(s, this.toBBox), s;
},
_chooseSubtree: function (t, e, i, n) {
for (var s, r, o, a, h, l, u, c, d, f; n.push(e), !e.leaf && n.length - 1 !== i; ) {
for (u = c = 1 / 0, s = 0, r = e.children.length; s < r; s++)
(h = m((o = e.children[s]))),
(d = t),
(f = o),
(l = (Math.max(f.maxX, d.maxX) - Math.min(f.minX, d.minX)) * (Math.max(f.maxY, d.maxY) - Math.min(f.minY, d.minY)) - h) < c
? ((c = l), (u = h < u ? h : u), (a = o))
: l === c && h < u && ((u = h), (a = o));
e = a || e.children[0];
}
return e;
},
_insert: function (t, e, i) {
var n = this.toBBox,
s = i ? t : n(t),
r = [],
o = this._chooseSubtree(s, this.data, e, r);
for (o.children.push(t), u(o, s); 0 <= e && r[e].children.length > this._maxEntries; ) this._split(r, e), e--;
this._adjustParentBBoxes(s, r, e);
},
_split: function (t, e) {
var i = t[e],
n = i.children.length,
s = this._minEntries;
this._chooseSplitAxis(i, s, n);
var r = this._chooseSplitIndex(i, s, n),
o = p(i.children.splice(r, i.children.length - r));
(o.height = i.height), (o.leaf = i.leaf), f(i, this.toBBox), f(o, this.toBBox), e ? t[e - 1].children.push(o) : this._splitRoot(i, o);
},
_splitRoot: function (t, e) {
(this.data = p([t, e])), (this.data.height = t.height + 1), (this.data.leaf = !1), f(this.data, this.toBBox);
},
_chooseSplitIndex: function (t, e, i) {
for (var n, s, r, o, a, h, l, u, c, d, f, p, g = (a = 1 / 0), v = e; v <= i - e; v++)
(l = n = y(t, 0, v, this.toBBox)),
(u = s = y(t, v, i, this.toBBox)),
void 0,
(c = Math.max(l.minX, u.minX)),
(d = Math.max(l.minY, u.minY)),
(f = Math.min(l.maxX, u.maxX)),
(p = Math.min(l.maxY, u.maxY)),
(r = Math.max(0, f - c) * Math.max(0, p - d)),
(o = m(n) + m(s)),
r < g ? ((g = r), (h = v), (a = o < a ? o : a)) : r === g && o < a && ((a = o), (h = v));
return h;
},
_chooseSplitAxis: function (t, e, i) {
var n = t.leaf ? this.compareMinX : r,
s = t.leaf ? this.compareMinY : o;
this._allDistMargin(t, e, i, n) < this._allDistMargin(t, e, i, s) && t.children.sort(n);
},
_allDistMargin: function (t, e, i, n) {
t.children.sort(n);
for (var s, r = this.toBBox, o = y(t, 0, e, r), a = y(t, i - e, i, r), h = c(o) + c(a), l = e; l < i - e; l++) (s = t.children[l]), u(o, t.leaf ? r(s) : s), (h += c(o));
for (l = i - e - 1; e <= l; l--) (s = t.children[l]), u(a, t.leaf ? r(s) : s), (h += c(a));
return h;
},
_adjustParentBBoxes: function (t, e, i) {
for (var n = i; 0 <= n; n--) u(e[n], t);
},
_condense: function (t) {
for (var e, i = t.length - 1; 0 <= i; i--) 0 === t[i].children.length ? (0 < i ? (e = t[i - 1].children).splice(e.indexOf(t[i]), 1) : this.clear()) : f(t[i], this.toBBox);
},
}),
(t.exports = n);
},
function (t, e, i) {
var y = i(533),
m = i(535),
x = i(248);
t.exports = function (t, e, i, n, s, r, o) {
var a = n.left,
h = n.top,
l = n.right,
u = n.bottom,
c = i.faceLeft || i.faceRight,
d = i.faceTop || i.faceBottom;
if ((o || (d = c = !0), !c && !d)) return !1;
var f = 0,
p = 0,
g = 0,
v = 1;
if (
(e.deltaAbsX() > e.deltaAbsY() ? (g = -1) : e.deltaAbsX() < e.deltaAbsY() && (v = -1),
0 !== e.deltaX() && 0 !== e.deltaY() && c && d && ((g = Math.min(Math.abs(e.position.x - l), Math.abs(e.right - a))), (v = Math.min(Math.abs(e.position.y - u), Math.abs(e.bottom - h)))),
g < v)
) {
if (c && 0 !== (f = y(e, i, a, l, r, o)) && !x(n, e)) return !0;
d && (p = m(e, i, h, u, r, o));
} else {
if (d && 0 !== (p = m(e, i, h, u, r, o)) && !x(n, e)) return !0;
c && (f = y(e, i, a, l, r, o));
}
return 0 !== f || 0 !== p;
};
},
function (t, e, i) {
var c = i(534);
t.exports = function (t, e, i, n, s, r) {
var o = 0,
a = e.faceLeft,
h = e.faceRight,
l = e.collideLeft,
u = e.collideRight;
return (
r || (u = l = h = a = !0),
t.deltaX() < 0 && u && t.checkCollision.left ? h && t.x < n && (o = t.x - n) < -s && (o = 0) : 0 < t.deltaX() && l && t.checkCollision.right && a && t.right > i && s < (o = t.right - i) && (o = 0),
0 !== o && (t.customSeparateX ? (t.overlapX = o) : c(t, o)),
o
);
};
},
function (t, e) {
t.exports = function (t, e) {
e < 0 ? ((t.blocked.none = !1), (t.blocked.left = !0)) : 0 < e && ((t.blocked.none = !1), (t.blocked.right = !0)),
(t.position.x -= e),
0 === t.bounce.x ? (t.velocity.x = 0) : (t.velocity.x = -t.velocity.x * t.bounce.x);
};
},
function (t, e, i) {
var c = i(536);
t.exports = function (t, e, i, n, s, r) {
var o = 0,
a = e.faceTop,
h = e.faceBottom,
l = e.collideUp,
u = e.collideDown;
return (
r || (u = l = h = a = !0),
t.deltaY() < 0 && u && t.checkCollision.up ? h && t.y < n && (o = t.y - n) < -s && (o = 0) : 0 < t.deltaY() && l && t.checkCollision.down && a && t.bottom > i && s < (o = t.bottom - i) && (o = 0),
0 !== o && (t.customSeparateY ? (t.overlapY = o) : c(t, o)),
o
);
};
},
function (t, e) {
t.exports = function (t, e) {
e < 0 ? ((t.blocked.none = !1), (t.blocked.up = !0)) : 0 < e && ((t.blocked.none = !1), (t.blocked.down = !0)),
(t.position.y -= e),
0 === t.bounce.y ? (t.velocity.y = 0) : (t.velocity.y = -t.velocity.y * t.bounce.y);
};
},
function (t, e, i) {
var h = i(246),
l = i(1389);
t.exports = function (t, e, i, n) {
var s = h(t, e, i, n),
r = t.immovable,
o = e.immovable;
if (i || 0 === s || (r && o) || t.customSeparateX || e.customSeparateX) return 0 !== s || (t.embedded && e.embedded);
var a = l.Set(t, e, s);
return r || o ? (r ? l.RunImmovableBody1(a) : o && l.RunImmovableBody2(a), !0) : 0 < a || l.Check();
};
},
function (t, e, i) {
var h = i(247),
l = i(1390);
t.exports = function (t, e, i, n) {
var s = h(t, e, i, n),
r = t.immovable,
o = e.immovable;
if (i || 0 === s || (r && o) || t.customSeparateY || e.customSeparateY) return 0 !== s || (t.embedded && e.embedded);
var a = l.Set(t, e, s);
return r || o ? (r ? l.RunImmovableBody1(a) : o && l.RunImmovableBody2(a), !0) : 0 < a || l.Check();
};
},
function (t, e, i) {
var n = i(66),
s = i(0),
r = i(62),
o = i(57),
a = i(3),
h = new s({
initialize: function (t, e) {
var i = e.displayWidth ? e.displayWidth : 64,
n = e.displayHeight ? e.displayHeight : 64;
(this.world = t),
(this.gameObject = e),
(this.debugShowBody = t.defaults.debugShowStaticBody),
(this.debugBodyColor = t.defaults.staticBodyDebugColor),
(this.enable = !0),
(this.isCircle = !1),
(this.radius = 0),
(this.offset = new a()),
(this.position = new a(e.x - i * e.originX, e.y - n * e.originY)),
(this.width = i),
(this.height = n),
(this.halfWidth = Math.abs(this.width / 2)),
(this.halfHeight = Math.abs(this.height / 2)),
(this.center = new a(this.position.x + this.halfWidth, this.position.y + this.halfHeight)),
(this.velocity = a.ZERO),
(this.allowGravity = !1),
(this.gravity = a.ZERO),
(this.bounce = a.ZERO),
(this.onWorldBounds = !1),
(this.onCollide = !1),
(this.onOverlap = !1),
(this.mass = 1),
(this.immovable = !0),
(this.pushable = !1),
(this.customSeparateX = !1),
(this.customSeparateY = !1),
(this.overlapX = 0),
(this.overlapY = 0),
(this.overlapR = 0),
(this.embedded = !1),
(this.collideWorldBounds = !1),
(this.checkCollision = { none: !1, up: !0, down: !0, left: !0, right: !0 }),
(this.touching = { none: !0, up: !1, down: !1, left: !1, right: !1 }),
(this.wasTouching = { none: !0, up: !1, down: !1, left: !1, right: !1 }),
(this.blocked = { none: !0, up: !1, down: !1, left: !1, right: !1 }),
(this.physicsType = r.STATIC_BODY),
(this._dx = 0),
(this._dy = 0);
},
setGameObject: function (t, e) {
return t && t !== this.gameObject && ((this.gameObject.body = null), ((t.body = this).gameObject = t)), e && this.updateFromGameObject(), this;
},
updateFromGameObject: function () {
this.world.staticTree.remove(this);
var t = this.gameObject;
return (
t.getTopLeft(this.position),
(this.width = t.displayWidth),
(this.height = t.displayHeight),
(this.halfWidth = Math.abs(this.width / 2)),
(this.halfHeight = Math.abs(this.height / 2)),
this.center.set(this.position.x + this.halfWidth, this.position.y + this.halfHeight),
this.world.staticTree.insert(this),
this
);
},
setOffset: function (t, e) {
return (
void 0 === e && (e = t),
this.world.staticTree.remove(this),
(this.position.x -= this.offset.x),
(this.position.y -= this.offset.y),
this.offset.set(t, e),
(this.position.x += this.offset.x),
(this.position.y += this.offset.y),
this.updateCenter(),
this.world.staticTree.insert(this),
this
);
},
setSize: function (t, e, i) {
void 0 === i && (i = !0);
var n,
s,
r = this.gameObject;
return (
!t && r.frame && (t = r.frame.realWidth),
!e && r.frame && (e = r.frame.realHeight),
this.world.staticTree.remove(this),
(this.width = t),
(this.height = e),
(this.halfWidth = Math.floor(t / 2)),
(this.halfHeight = Math.floor(e / 2)),
i &&
r.getCenter &&
((n = r.displayWidth / 2),
(s = r.displayHeight / 2),
(this.position.x -= this.offset.x),
(this.position.y -= this.offset.y),
this.offset.set(n - this.halfWidth, s - this.halfHeight),
(this.position.x += this.offset.x),
(this.position.y += this.offset.y)),
this.updateCenter(),
(this.isCircle = !1),
(this.radius = 0),
this.world.staticTree.insert(this),
this
);
},
setCircle: function (t, e, i) {
return (
void 0 === e && (e = this.offset.x),
void 0 === i && (i = this.offset.y),
0 < t
? (this.world.staticTree.remove(this),
(this.isCircle = !0),
(this.radius = t),
(this.width = 2 * t),
(this.height = 2 * t),
(this.halfWidth = Math.floor(this.width / 2)),
(this.halfHeight = Math.floor(this.height / 2)),
this.offset.set(e, i),
this.updateCenter(),
this.world.staticTree.insert(this))
: (this.isCircle = !1),
this
);
},
updateCenter: function () {
this.center.set(this.position.x + this.halfWidth, this.position.y + this.halfHeight);
},
reset: function (t, e) {
var i = this.gameObject;
void 0 === t && (t = i.x), void 0 === e && (e = i.y), this.world.staticTree.remove(this), i.setPosition(t, e), i.getTopLeft(this.position), this.updateCenter(), this.world.staticTree.insert(this);
},
stop: function () {
return this;
},
getBounds: function (t) {
return (t.x = this.x), (t.y = this.y), (t.right = this.right), (t.bottom = this.bottom), t;
},
hitTest: function (t, e) {
return (this.isCircle ? n : o)(this, t, e);
},
postUpdate: function () {},
deltaAbsX: function () {
return 0;
},
deltaAbsY: function () {
return 0;
},
deltaX: function () {
return 0;
},
deltaY: function () {
return 0;
},
deltaZ: function () {
return 0;
},
destroy: function () {
(this.enable = !1), this.world.pendingDestroy.set(this);
},
drawDebug: function (t) {
var e = this.position,
i = e.x + this.halfWidth,
n = e.y + this.halfHeight;
this.debugShowBody && (t.lineStyle(t.defaultStrokeWidth, this.debugBodyColor, 1), this.isCircle ? t.strokeCircle(i, n, this.width / 2) : t.strokeRect(e.x, e.y, this.width, this.height));
},
willDrawDebug: function () {
return this.debugShowBody;
},
setMass: function (t) {
return t <= 0 && (t = 0.1), (this.mass = t), this;
},
x: {
get: function () {
return this.position.x;
},
set: function (t) {
this.world.staticTree.remove(this), (this.position.x = t), this.world.staticTree.insert(this);
},
},
y: {
get: function () {
return this.position.y;
},
set: function (t) {
this.world.staticTree.remove(this), (this.position.y = t), this.world.staticTree.insert(this);
},
},
left: {
get: function () {
return this.position.x;
},
},
right: {
get: function () {
return this.position.x + this.width;
},
},
top: {
get: function () {
return this.position.y;
},
},
bottom: {
get: function () {
return this.position.y + this.height;
},
},
});
t.exports = h;
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t) {
(this.pluginManager = t), (this.game = t.game);
},
init: function () {},
start: function () {},
stop: function () {},
destroy: function () {
(this.pluginManager = null), (this.game = null), (this.scene = null), (this.systems = null);
},
});
t.exports = n;
},
function (t, e, i) {
var h = new (i(3))();
t.exports = function (t, e, i, n) {
var s = i.tilemapLayer,
r = s.cullPaddingX,
o = s.cullPaddingY,
a = s.tilemap.tileToWorldXY(t, e, h, n, s);
return (
a.x > n.worldView.x + s.scaleX * i.tileWidth * (-r - 0.5) &&
a.x < n.worldView.right + s.scaleX * i.tileWidth * (r - 0.5) &&
a.y > n.worldView.y + s.scaleY * i.tileHeight * (-o - 1) &&
a.y < n.worldView.bottom + s.scaleY * i.tileHeight * (o - 0.5)
);
};
},
function (t, e, i) {
var l = i(26);
t.exports = function (t, e, i, n, s, r, o) {
for (var a = l(i, n, s, r, null, o), h = 0; h < a.length; h++) a[h] && a[h].index === t && (a[h].index = e);
};
},
function (t, e, i) {
var n = i(10),
u = i(139),
c = i(76),
d = new n();
t.exports = function (t, e) {
var i = t.tilemapLayer.tilemap,
n = t.tilemapLayer,
s = Math.floor(i.tileWidth * n.scaleX),
r = Math.floor(i.tileHeight * n.scaleY),
o = c(e.worldView.x - n.x, s, 0, !0) - n.cullPaddingX,
a = u(e.worldView.right - n.x, s, 0, !0) + n.cullPaddingX,
h = c(e.worldView.y - n.y, r, 0, !0) - n.cullPaddingY,
l = u(e.worldView.bottom - n.y, r, 0, !0) + n.cullPaddingY;
return d.setTo(o, h, a - o, l - h);
};
},
function (t, e, i) {
var o = i(543),
a = i(159);
t.exports = function (t, e, i, n) {
void 0 === i && (i = []), void 0 === n && (n = 0), (i.length = 0);
var s = t.tilemapLayer,
r = o(t, e);
return (!s.skipCull && 1 === s.scrollFactorX && 1 === s.scrollFactorY) || ((r.left = 0), (r.right = t.width), (r.top = 0), (r.bottom = t.height)), a(t, r, n, i), i;
};
},
function (t, e, i) {
var o = i(546),
a = i(159);
t.exports = function (t, e, i, n) {
void 0 === i && (i = []), void 0 === n && (n = 0), (i.length = 0);
var s,
r = t.tilemapLayer;
return r.skipCull || 1 !== r.scrollFactorX || 1 !== r.scrollFactorY || ((s = o(t, e)), a(t, s, n, i)), i;
};
},
function (t, e, i) {
var h = i(139),
l = i(76);
t.exports = function (t, e) {
var i = t.tilemapLayer.tilemap,
n = t.tilemapLayer,
s = Math.floor(i.tileWidth * n.scaleX),
r = Math.floor(i.tileHeight * n.scaleY),
o = t.hexSideLength,
a = (r - o) / 2 + o;
return {
left: l(e.worldView.x - n.x, s, 0, !0) - n.cullPaddingX,
right: h(e.worldView.right - n.x, s, 0, !0) + n.cullPaddingX,
top: l(e.worldView.y - n.y, a, 0, !0) - n.cullPaddingY,
bottom: h(e.worldView.bottom - n.y, a, 0, !0) + n.cullPaddingY,
};
};
},
function (t, e, i) {
var f = i(541);
t.exports = function (t, e, i, n) {
void 0 === i && (i = []), void 0 === n && (n = 0), (i.length = 0);
var s,
r,
o,
a = t.tilemapLayer,
h = t.data,
l = t.width,
u = t.height,
c = l,
d = u;
if (!a.skipCull)
if (0 === n) {
for (r = 0; r < d; r++)
for (s = 0; h[r] && s < c; s++)
if (f(s, r, t, e)) {
if (!(o = h[r][s]) || -1 === o.index || !o.visible || 0 === o.alpha) continue;
i.push(o);
}
} else if (1 === n) {
for (r = 0; r < d; r++)
for (s = c; h[r] && 0 <= s; s--)
if (f(s, r, t, e)) {
if (!(o = h[r][s]) || -1 === o.index || !o.visible || 0 === o.alpha) continue;
i.push(o);
}
} else if (2 === n) {
for (r = d; 0 <= r; r--)
for (s = 0; h[r] && s < c; s++)
if (f(s, r, t, e)) {
if (!(o = h[r][s]) || -1 === o.index || !o.visible || 0 === o.alpha) continue;
i.push(o);
}
} else if (3 === n)
for (r = d; 0 <= r; r--)
for (s = c; h[r] && 0 <= s; s--)
if (f(s, r, t, e)) {
if (!(o = h[r][s]) || -1 === o.index || !o.visible || 0 === o.alpha) continue;
i.push(o);
}
return (a.tilesDrawn = i.length), (a.tilesTotal = l * u), i;
};
},
function (t, e, i) {
var o = i(549),
a = i(159);
t.exports = function (t, e, i, n) {
void 0 === i && (i = []), void 0 === n && (n = 0), (i.length = 0);
var s,
r = t.tilemapLayer;
return r.skipCull || 1 !== r.scrollFactorX || 1 !== r.scrollFactorY || ((s = o(t, e)), a(t, s, n, i)), i;
};
},
function (t, e, i) {
var o = i(139),
a = i(76);
t.exports = function (t, e) {
var i = t.tilemapLayer.tilemap,
n = t.tilemapLayer,
s = Math.floor(i.tileWidth * n.scaleX),
r = Math.floor(i.tileHeight * n.scaleY);
return {
left: a(e.worldView.x - n.x, s, 0, !0) - n.cullPaddingX,
right: o(e.worldView.right - n.x, s, 0, !0) + n.cullPaddingX,
top: a(e.worldView.y - n.y, r / 2, 0, !0) - n.cullPaddingY,
bottom: o(e.worldView.bottom - n.y, r / 2, 0, !0) + n.cullPaddingY,
};
};
},
function (t, e, i) {
var f = i(3);
t.exports = function (t, e, i, n, s) {
i = i || new f();
var r = s.baseTileWidth,
o = s.baseTileHeight,
a = s.tilemapLayer,
h = 0,
l = 0;
a && ((n = n || a.scene.cameras.main), (h = a.x + n.scrollX * (1 - a.scrollFactorX)), (r *= a.scaleX), (l = a.y + n.scrollY * (1 - a.scrollFactorY)), (o *= a.scaleY));
var u = s.hexSideLength,
c = h + t * r + (e % 2) * (r / 2),
d = l + e * ((o - u) / 2 + u);
return i.set(c, d);
};
},
function (t, e, i) {
var d = i(3);
t.exports = function (t, e, i, n, s) {
i = i || new d();
var r = s.baseTileWidth,
o = s.baseTileHeight,
a = s.tilemapLayer,
h = 0,
l = 0;
a && ((n = n || a.scene.cameras.main), (h = a.x + n.scrollX * (1 - a.scrollFactorX)), (r *= a.scaleX), (l = a.y + n.scrollY * (1 - a.scrollFactorY)), (o *= a.scaleY));
var u = h + (r / 2) * (t - e),
c = l + (t + e) * (o / 2);
return i.set(u, c);
};
},
function (t, e, i) {
var d = i(3);
t.exports = function (t, e, i, n, s) {
i = i || new d();
var r = s.baseTileWidth,
o = s.baseTileHeight,
a = s.tilemapLayer,
h = 0,
l = 0;
a && ((n = n || a.scene.cameras.main), (h = a.x + n.scrollX * (1 - a.scrollFactorX)), (r *= a.scaleX), (l = a.y + n.scrollY * (1 - a.scrollFactorY)), (o *= a.scaleY));
var u = h + t * r + (e % 2) * (r / 2),
c = l + e * (o / 2);
return i.set(u, c);
};
},
function (t, e, i) {
var r = i(253),
o = i(254),
a = i(3);
t.exports = function (t, e, i, n, s) {
return ((i = i || new a(0, 0)).x = r(t, n, s)), (i.y = o(e, n, s)), i;
};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = i.baseTileHeight,
s = i.tilemapLayer,
r = 0;
s && (void 0 === e && (e = s.scene.cameras.main), (r = s.y + e.scrollY * (1 - s.scrollFactorY)), (n *= s.scaleY));
var o = s.tilemap.hexSideLength;
return r + t * ((n - o) / 2 + o);
};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = i.baseTileHeight,
s = i.tilemapLayer,
r = 0;
return s && (void 0 === e && (e = s.scene.cameras.main), (r = s.y + e.scrollY * (1 - s.scrollFactorY)), (n *= s.scaleY)), r + t * (n / 2);
};
},
function (t, e, i) {
var f = i(3);
t.exports = function (t, e, i, n, s, r) {
n = n || new f();
var o = r.baseTileWidth,
a = r.baseTileHeight,
h = r.tilemapLayer;
h && ((s = s || h.scene.cameras.main), (e -= h.y + s.scrollY * (1 - h.scrollFactorY)), (a *= h.scaleY), (t -= h.x + s.scrollX * (1 - h.scrollFactorX)), (o *= h.scaleX));
var l = r.hexSideLength,
u = (a - l) / 2 + l,
c = i ? Math.floor(e / u) : e / u,
d = i ? Math.floor((t - (c % 2) * 0.5 * o) / o) : (t - (c % 2) * 0.5 * o) / o;
return n.set(d, c);
};
},
function (t, e, i) {
var c = i(3);
t.exports = function (t, e, i, n, s, r) {
n = n || new c();
var o = r.baseTileWidth,
a = r.baseTileHeight,
h = r.tilemapLayer;
h && ((s = s || h.scene.cameras.main), (e -= h.y + s.scrollY * (1 - h.scrollFactorY)), (a *= h.scaleY), (t -= h.x + s.scrollX * (1 - h.scrollFactorX)), (o *= h.scaleX));
var l = i ? Math.floor((t / (o / 2) + e / (a / 2)) / 2) : (t / (o / 2) + e / (a / 2)) / 2,
u = i ? Math.floor((e / (a / 2) - t / (o / 2)) / 2) : (e / (a / 2) - t / (o / 2)) / 2;
return n.set(l, u);
};
},
function (t, e, i) {
var c = i(3);
t.exports = function (t, e, i, n, s, r) {
n = n || new c();
var o = r.baseTileWidth,
a = r.baseTileHeight,
h = r.tilemapLayer;
h && ((s = s || h.scene.cameras.main), (e -= h.y + s.scrollY * (1 - h.scrollFactorY)), (a *= h.scaleY), (t -= h.x + s.scrollX * (1 - h.scrollFactorX)), (o *= h.scaleX));
var l = i ? Math.floor(e / (a / 2)) : e / (a / 2),
u = i ? Math.floor((t + (l % 2) * 0.5 * o) / o) : (t + (l % 2) * 0.5 * o) / o;
return n.set(u, l);
};
},
function (t, e, i) {
var o = i(255),
a = i(256),
h = i(3);
t.exports = function (t, e, i, n, s, r) {
return void 0 === i && (i = !0), ((n = n || new h(0, 0)).x = o(t, i, s, r)), (n.y = a(e, i, s, r)), n;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = n.baseTileHeight,
r = n.tilemapLayer;
r && ((i = i || r.scene.cameras.main), (t -= r.y + i.scrollY * (1 - r.scrollFactorY)), (s *= r.scaleY));
var o = n.hexSideLength,
a = (s - o) / 2 + o;
return e ? Math.floor(t / a) : t / a;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = n.baseTileHeight,
r = n.tilemapLayer;
return r && ((i = i || r.scene.cameras.main), (t -= r.y + i.scrollY * (1 - r.scrollFactorY)), (s *= r.scaleY)), e ? Math.floor(t / (s / 2)) : t / (s / 2);
};
},
function (t, e, i) {
var s = i(119);
t.exports = function (t, e, i) {
if (s(t, e, i)) {
var n = i.data[e][t];
return null !== n && -1 < n.index;
}
return !1;
};
},
function (t, e, i) {
var o = i(85),
a = i(119),
h = i(252);
t.exports = function (t, e, i, n, s) {
if ((void 0 === i && (i = !0), void 0 === n && (n = !0), !a(t, e, s))) return null;
var r = s.data[e][t];
return r ? ((s.data[e][t] = i ? null : new o(s, -1, t, e, s.tileWidth, s.tileHeight)), n && r && r.collides && h(t, e, s), r) : null;
};
},
function (t, e, i) {
var a = i(40),
h = i(259),
l = i(565),
u = i(566),
c = i(577);
t.exports = function (t, e, i, n, s, r) {
var o;
switch (e) {
case a.ARRAY_2D:
o = h(t, i, n, s, r);
break;
case a.CSV:
o = l(t, i, n, s, r);
break;
case a.TILED_JSON:
o = u(t, i, r);
break;
case a.WELTMEISTER:
o = c(t, i, r);
break;
default:
o = null;
}
return o;
};
},
function (t, e, i) {
var a = i(40),
h = i(259);
t.exports = function (t, e, i, n, s) {
var r = e
.trim()
.split("\n")
.map(function (t) {
return t.split(",");
}),
o = h(t, r, i, n, s);
return (o.format = a.CSV), o;
};
},
function (t, e, i) {
var r = i(567),
o = i(568),
a = i(29),
h = i(40),
l = i(258),
u = i(121),
c = i(569),
d = i(570),
f = i(573),
p = i(575);
t.exports = function (t, e, i) {
var n = new u({
width: e.width,
height: e.height,
name: t,
tileWidth: e.tilewidth,
tileHeight: e.tileheight,
orientation: l(e.orientation),
format: h.TILED_JSON,
version: e.version,
properties: e.properties,
renderOrder: e.renderorder,
infinite: e.infinite,
});
n.orientation === a.HEXAGONAL && (n.hexSideLength = e.hexsidelength), (n.layers = f(e, i)), (n.images = c(e));
var s = p(e);
return (n.tilesets = s.tilesets), (n.imageCollections = s.imageCollections), (n.objects = d(e)), (n.tiles = o(n)), r(n), n;
};
},
function (t, e, i) {
var l = i(17);
t.exports = function (t) {
for (var e, i, n, s, r, o = 0; o < t.layers.length; o++) {
e = t.layers[o];
for (var a = 0; a < e.data.length; a++) {
r = e.data[a];
for (var h = 0; h < r.length; h++)
null === (i = r[h]) ||
i.index < 0 ||
((n = t.tiles[i.index][2]),
(s = t.tilesets[n]),
(i.width = s.tileWidth),
(i.height = s.tileHeight),
s.tileProperties && s.tileProperties[i.index - s.firstgid] && (i.properties = l(i.properties, s.tileProperties[i.index - s.firstgid])));
}
}
};
},
function (t, e, i) {
var p = i(122);
t.exports = function (t) {
for (var e = [], i = 0; i < t.imageCollections.length; i++)
for (var n = t.imageCollections[i], s = n.images, r = 0; r < s.length; r++) {
var o,
a = s[r];
(o = new p(a.image, a.gid, n.imageWidth, n.imageHeight, 0, 0)).updateTileData(n.imageWidth, n.imageHeight), t.tilesets.push(o);
}
for (i = 0; i < t.tilesets.length; i++)
for (
var h = (o = t.tilesets[i]).tileMargin, l = o.tileMargin, u = 0, c = 0, d = 0, f = o.firstgid;
f < o.firstgid + o.total &&
((e[f] = [h, l, i]), (h += o.tileWidth + o.tileSpacing), ++u !== o.total) &&
(++c !== o.columns || ((h = o.tileMargin), (l += o.tileHeight + o.tileSpacing), (c = 0), ++d !== o.rows));
f++
);
return e;
};
},
function (t, e, i) {
var h = i(2),
l = i(161);
t.exports = function (t) {
for (var e = [], i = [], n = l(t); n.i < n.layers.length || 0 < i.length; )
if (n.i >= n.layers.length) {
if (i.length < 1) break;
n = i.pop();
} else {
var s,
r,
o,
a = n.layers[n.i];
n.i++,
"imagelayer" === a.type
? ((s = h(a, "offsetx", 0) + h(a, "startx", 0)),
(r = h(a, "offsety", 0) + h(a, "starty", 0)),
e.push({ name: n.name + a.name, image: a.image, x: n.x + s + a.x, y: n.y + r + a.y, alpha: n.opacity * a.opacity, visible: n.visible && a.visible, properties: h(a, "properties", {}) }))
: "group" === a.type && ((o = l(t, a, n)), i.push(n), (n = o));
}
return e;
};
},
function (t, e, i) {
var d = i(2),
f = i(260),
p = i(572),
g = i(161);
t.exports = function (t) {
for (var e = [], i = [], n = g(t); n.i < n.layers.length || 0 < i.length; )
if (n.i >= n.layers.length) {
if (i.length < 1) break;
n = i.pop();
} else {
var s,
r = n.layers[n.i];
if ((n.i++, (r.opacity *= n.opacity), (r.visible = n.visible && r.visible), "objectgroup" === r.type)) {
r.name = n.name + r.name;
for (var o = n.x + d(r, "startx", 0) + d(r, "offsetx", 0), a = n.y + d(r, "starty", 0) + d(r, "offsety", 0), h = [], l = 0; l < r.objects.length; l++) {
var u = f(r.objects[l], o, a);
h.push(u);
}
var c = new p(r);
(c.objects = h), e.push(c);
} else "group" === r.type && ((s = g(t, r, n)), i.push(n), (n = s));
}
return e;
};
},
function (t, e, i) {
var r = i(126);
t.exports = function (t, e) {
for (var i = {}, n = 0; n < e.length; n++) {
var s = e[n];
r(t, s) && (i[s] = t[s]);
}
return i;
};
},
function (t, e, i) {
var n = i(0),
s = i(2),
r = new n({
initialize: function (t) {
void 0 === t && (t = {}),
(this.name = s(t, "name", "object layer")),
(this.opacity = s(t, "opacity", 1)),
(this.properties = s(t, "properties", {})),
(this.propertyTypes = s(t, "propertytypes", {})),
(this.type = s(t, "type", "objectgroup")),
(this.visible = s(t, "visible", !0)),
(this.objects = s(t, "objects", []));
},
});
t.exports = r;
},
function (t, e, i) {
var O = i(574),
k = i(29),
R = i(161),
L = i(258),
I = i(2),
D = i(120),
F = i(261),
B = i(85);
t.exports = function (t, e) {
for (var i = I(t, "infinite", !1), n = [], s = [], r = R(t); r.i < r.layers.length || 0 < s.length; )
if (r.i >= r.layers.length) {
if (s.length < 1) break;
r = s.pop();
} else {
var o,
a = r.layers[r.i];
if ((r.i++, "tilelayer" === a.type))
if (a.compression);
else {
if (a.encoding && "base64" === a.encoding) {
if (a.chunks) for (var h = 0; h < a.chunks.length; h++) a.chunks[h].data = O(a.chunks[h].data);
a.data && (a.data = O(a.data)), delete a.encoding;
}
var l,
u,
c = [],
d = 0;
if (i) {
var f,
p = I(a, "startx", 0) + a.x,
g = I(a, "starty", 0) + a.y;
(f = new D({
name: r.name + a.name,
x: r.x + I(a, "offsetx", 0) + p * t.tilewidth,
y: r.y + I(a, "offsety", 0) + g * t.tileheight,
width: a.width,
height: a.height,
tileWidth: t.tilewidth,
tileHeight: t.tileheight,
alpha: r.opacity * a.opacity,
visible: r.visible && a.visible,
properties: I(a, "properties", []),
orientation: L(t.orientation),
})).orientation === k.HEXAGONAL && (f.hexSideLength = t.hexsidelength);
for (var v = 0; v < a.height; v++) {
c.push([null]);
for (var y = 0; y < a.width; y++) c[v][y] = null;
}
for (v = 0, C = a.chunks.length; v < C; v++)
for (var m = a.chunks[v], x = m.x - p, b = m.y - g, w = 0, T = 0, S = m.data.length; T < S; T++) {
var _,
E = d + x,
P = w + b;
0 < (_ = F(m.data[T])).gid
? (((l = new B(f, _.gid, E, P, t.tilewidth, t.tileheight)).rotation = _.rotation), (l.flipX = _.flipped), (c[P][E] = l))
: ((u = e ? null : new B(f, -1, E, P, t.tilewidth, t.tileheight)), (c[P][E] = u)),
++d === m.width && (w++, (d = 0));
}
} else {
(f = new D({
name: r.name + a.name,
x: r.x + I(a, "offsetx", 0) + a.x,
y: r.y + I(a, "offsety", 0) + a.y,
width: a.width,
height: a.height,
tileWidth: t.tilewidth,
tileHeight: t.tileheight,
alpha: r.opacity * a.opacity,
visible: r.visible && a.visible,
properties: I(a, "properties", []),
orientation: L(t.orientation),
})).orientation === k.HEXAGONAL && (f.hexSideLength = t.hexsidelength);
for (var A = [], M = 0, C = a.data.length; M < C; M++)
0 < (_ = F(a.data[M])).gid
? (((l = new B(f, _.gid, d, c.length, t.tilewidth, t.tileheight)).rotation = _.rotation), (l.flipX = _.flipped), A.push(l))
: ((u = e ? null : new B(f, -1, d, c.length, t.tilewidth, t.tileheight)), A.push(u)),
++d === a.width && (c.push(A), (d = 0), (A = []));
}
(f.data = c), n.push(f);
}
else "group" === a.type && ((o = R(t, a, r)), s.push(r), (r = o));
}
return n;
};
},
function (t, e) {
t.exports = function (t) {
for (var e = window.atob(t), i = e.length, n = new Array(i / 4), s = 0; s < i; s += 4) n[s / 4] = (e.charCodeAt(s) | (e.charCodeAt(s + 1) << 8) | (e.charCodeAt(s + 2) << 16) | (e.charCodeAt(s + 3) << 24)) >>> 0;
return n;
};
},
function (t, e, i) {
var w = i(122),
T = i(576),
S = i(260),
_ = i(1453);
t.exports = function (t) {
for (var e, i = [], n = [], s = null, r = 0; r < t.tilesets.length; r++) {
var o = t.tilesets[r];
if (o.source);
else if (o.image) {
var a = new w(o.name, o.firstgid, o.tilewidth, o.tileheight, o.margin, o.spacing);
if (1 < t.version) {
var h = void 0,
l = void 0;
if (Array.isArray(o.tiles)) {
(h = h || {}), (l = l || {});
for (var u = 0; u < o.tiles.length; u++) {
var c,
d,
f = o.tiles[u];
f.properties &&
((c = {}),
f.properties.forEach(function (t) {
c[t.name] = t.value;
}),
(l[f.id] = c)),
f.objectgroup &&
(((h[f.id] || (h[f.id] = {})).objectgroup = f.objectgroup),
f.objectgroup.objects &&
((d = f.objectgroup.objects.map(function (t) {
return S(t);
})),
(h[f.id].objectgroup.objects = d))),
f.animation && ((h[f.id] || (h[f.id] = {})).animation = f.animation),
f.type && ((h[f.id] || (h[f.id] = {})).type = f.type);
}
}
Array.isArray(o.wangsets) && ((h = h || {}), (l = l || {}), _(o.wangsets, h)), h && ((a.tileData = h), (a.tileProperties = l));
} else if ((o.tileproperties && (a.tileProperties = o.tileproperties), o.tiles))
for (e in ((a.tileData = o.tiles), a.tileData)) {
var p,
g = a.tileData[e].objectgroup;
g &&
g.objects &&
((p = g.objects.map(function (t) {
return S(t);
})),
(a.tileData[e].objectgroup.objects = p));
}
a.updateTileData(o.imagewidth, o.imageheight), i.push(a);
} else {
var v = new T(o.name, o.firstgid, o.tilewidth, o.tileheight, o.margin, o.spacing, o.properties),
y = 0;
for (u = 0; u < o.tiles.length; u++) {
var m = (f = o.tiles[u]).image,
x = parseInt(f.id, 10),
b = o.firstgid + x;
v.addImage(b, m), (y = Math.max(x, y));
}
(v.maxId = y), n.push(v);
}
s && (s.lastgid = o.firstgid - 1), (s = o);
}
return { tilesets: i, imageCollections: n };
};
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e, i, n, s, r, o) {
(void 0 === i || i <= 0) && (i = 32),
(void 0 === n || n <= 0) && (n = 32),
void 0 === s && (s = 0),
void 0 === r && (r = 0),
(this.name = t),
(this.firstgid = 0 | e),
(this.imageWidth = 0 | i),
(this.imageHeight = 0 | n),
(this.imageMargin = 0 | s),
(this.imageSpacing = 0 | r),
(this.properties = o || {}),
(this.images = []),
(this.total = 0);
},
containsImageIndex: function (t) {
return t >= this.firstgid && t < this.firstgid + this.total;
},
addImage: function (t, e) {
return this.images.push({ gid: t, image: e }), this.total++, this;
},
});
t.exports = n;
},
function (t, e, i) {
var a = i(40),
h = i(121),
l = i(578),
u = i(579);
t.exports = function (t, e, i) {
if (0 === e.layer.length) return null;
for (var n = 0, s = 0, r = 0; r < e.layer.length; r++) e.layer[r].width > n && (n = e.layer[r].width), e.layer[r].height > s && (s = e.layer[r].height);
var o = new h({ width: n, height: s, name: t, tileWidth: e.layer[0].tilesize, tileHeight: e.layer[0].tilesize, format: a.WELTMEISTER });
return (o.layers = l(e, i)), (o.tilesets = u(e)), o;
};
},
function (t, e, i) {
var d = i(120),
f = i(85);
t.exports = function (t, e) {
for (var i = [], n = 0; n < t.layer.length; n++) {
for (var s = t.layer[n], r = new d({ name: s.name, width: s.width, height: s.height, tileWidth: s.tilesize, tileHeight: s.tilesize, visible: 1 === s.visible }), o = [], a = [], h = 0; h < s.data.length; h++) {
for (var l = 0; l < s.data[h].length; l++) {
var u = s.data[h][l] - 1,
c = -1 < u ? new f(r, u, l, h, s.tilesize, s.tilesize) : e ? null : new f(r, -1, l, h, s.tilesize, s.tilesize);
o.push(c);
}
a.push(o), (o = []);
}
(r.data = a), i.push(r);
}
return i;
};
},
function (t, e, i) {
var o = i(122);
t.exports = function (t) {
for (var e = [], i = [], n = 0; n < t.layer.length; n++) {
var s = t.layer[n],
r = s.tilesetName;
"" !== r && -1 === i.indexOf(r) && (i.push(r), e.push(new o(r, 0, s.tilesize, s.tilesize, 0, 0)));
}
return e;
};
},
function (t, e, i) {
var n = i(0),
S = i(36),
u = i(40),
_ = i(2),
f = i(120),
s = i(29),
E = i(362),
r = i(74),
P = i(73),
p = i(85),
h = i(251),
g = i(581),
c = i(122),
o = new n({
initialize: function (t, e) {
(this.scene = t),
(this.tileWidth = e.tileWidth),
(this.tileHeight = e.tileHeight),
(this.width = e.width),
(this.height = e.height),
(this.orientation = e.orientation),
(this.renderOrder = e.renderOrder),
(this.format = e.format),
(this.version = e.version),
(this.properties = e.properties),
(this.widthInPixels = e.widthInPixels),
(this.heightInPixels = e.heightInPixels),
(this.imageCollections = e.imageCollections),
(this.images = e.images),
(this.layers = e.layers),
(this.tilesets = e.tilesets),
(this.objects = e.objects),
(this.currentLayerIndex = 0),
(this.hexSideLength = e.hexSideLength);
var i = this.orientation;
this._convert = {
WorldToTileXY: h.GetWorldToTileXYFunction(i),
WorldToTileX: h.GetWorldToTileXFunction(i),
WorldToTileY: h.GetWorldToTileYFunction(i),
TileToWorldXY: h.GetTileToWorldXYFunction(i),
TileToWorldX: h.GetTileToWorldXFunction(i),
TileToWorldY: h.GetTileToWorldYFunction(i),
};
},
createBlankDynamicLayer: function (t, e, i, n, s, r, o, a) {
return this.createBlankLayer(t, e, i, n, s, r, o, a);
},
createDynamicLayer: function (t, e, i, n) {
return this.createLayer(t, e, i, n);
},
createStaticLayer: function (t, e, i, n) {
return this.createLayer(t, e, i, n);
},
setRenderOrder: function (t) {
var e = ["right-down", "left-down", "right-up", "left-up"];
return "number" == typeof t && (t = e[t]), -1 < e.indexOf(t) && (this.renderOrder = t), this;
},
addTilesetImage: function (t, e, i, n, s, r, o) {
if (void 0 === t) return null;
if ((null == e && (e = t), !this.scene.sys.textures.exists(e))) return null;
var a = this.scene.sys.textures.get(e),
h = this.getTilesetIndex(t);
if (null === h && this.format === u.TILED_JSON) return null;
var l = this.tilesets[h];
return (
l
? (l.setTileSize(i, n), l.setSpacing(s, r), l.setImage(a))
: (void 0 === i && (i = this.tileWidth),
void 0 === n && (n = this.tileHeight),
void 0 === s && (s = 0),
void 0 === r && (r = 0),
void 0 === o && (o = 0),
(l = new c(t, o, i, n, s, r)).setImage(a),
this.tilesets.push(l)),
l
);
},
copy: function (t, e, i, n, s, r, o, a) {
return null !== (a = this.getLayer(a)) ? (h.Copy(t, e, i, n, s, r, o, a), this) : null;
},
createBlankLayer: function (t, e, i, n, s, r, o, a) {
if (
(void 0 === i && (i = 0),
void 0 === n && (n = 0),
void 0 === s && (s = this.width),
void 0 === r && (r = this.height),
void 0 === o && (o = this.tileWidth),
void 0 === a && (a = this.tileHeight),
null !== this.getLayerIndex(t))
)
return null;
for (var h, l = new f({ name: t, tileWidth: o, tileHeight: a, width: s, height: r, orientation: this.orientation }), u = 0; u < r; u++) {
h = [];
for (var c = 0; c < s; c++) h.push(new p(l, -1, c, u, o, a, this.tileWidth, this.tileHeight));
l.data.push(h);
}
this.layers.push(l), (this.currentLayerIndex = this.layers.length - 1);
var d = new g(this.scene, this, this.currentLayerIndex, e, i, n);
return d.setRenderOrder(this.renderOrder), this.scene.sys.displayList.add(d), d;
},
createLayer: function (t, e, i, n) {
var s = this.getLayerIndex(t);
if (null === s) return null;
var r = this.layers[s];
if (r.tilemapLayer) return null;
(this.currentLayerIndex = s), void 0 === i && (i = r.x), void 0 === n && (n = r.y);
var o = new g(this.scene, this, s, e, i, n);
return o.setRenderOrder(this.renderOrder), this.scene.sys.displayList.add(o), o;
},
createFromObjects: function (t, e) {
var i = [],
n = this.getObjectLayer(t);
if (!n) return i;
Array.isArray(e) || (e = [e]);
for (var s = n.objects, r = 0; r < e.length; r++) {
for (var o, a = e[r], h = _(a, "id", null), l = _(a, "gid", null), u = _(a, "name", null), c = [], d = 0; d < s.length; d++)
(o = s[d]), ((null === h && null === l && null === u) || (null !== h && o.id === h) || (null !== l && o.gid === l) || (null !== u && o.name === u)) && c.push(o);
for (var f = _(a, "classType", P), p = _(a, "scene", this.scene), g = _(a, "container", null), v = _(a, "key", null), y = _(a, "frame", null), m = 0; m < c.length; m++) {
o = c[m];
var x = new f(p);
x.setName(o.name), x.setPosition(o.x, o.y), x.setTexture(v, y), o.width && (x.displayWidth = o.width), o.height && (x.displayHeight = o.height);
var b,
w = { x: x.originX * o.width, y: (x.originY - 1) * o.height };
if (
(o.rotation && ((b = S(o.rotation)), E(w, b), (x.rotation = b)),
(x.x += w.x),
(x.y += w.y),
(void 0 === o.flippedHorizontal && void 0 === o.flippedVertical) || x.setFlip(o.flippedHorizontal, o.flippedVertical),
o.visible || (x.visible = !1),
Array.isArray(o.properties))
)
o.properties.forEach(function (t) {
var e = t.name;
void 0 !== x[e] ? (x[e] = t.value) : x.setData(e, t.value);
});
else for (var T in o.properties) void 0 !== x[T] ? (x[T] = o.properties[T]) : x.setData(T, o.properties[T]);
g ? g.add(x) : p.add.existing(x), i.push(x);
}
}
return i;
},
createFromTiles: function (t, e, i, n, s, r) {
return null === (r = this.getLayer(r)) ? null : h.CreateFromTiles(t, e, i, n, s, r);
},
fill: function (t, e, i, n, s, r, o) {
return void 0 === r && (r = !0), null === (o = this.getLayer(o)) ? null : (h.Fill(t, e, i, n, s, r, o), this);
},
filterObjects: function (t, e, i) {
if ("string" == typeof t) {
if (!(t = this.getObjectLayer(t))) return null;
}
return t.objects.filter(e, i);
},
filterTiles: function (t, e, i, n, s, r, o, a) {
return null === (a = this.getLayer(a)) ? null : h.FilterTiles(t, e, i, n, s, r, o, a);
},
findByIndex: function (t, e, i, n) {
return null === (n = this.getLayer(n)) ? null : h.FindByIndex(t, e, i, n);
},
findObject: function (t, e, i) {
if ("string" == typeof t) {
if (!(t = this.getObjectLayer(t))) return null;
}
return t.objects.find(e, i) || null;
},
findTile: function (t, e, i, n, s, r, o, a) {
return null === (a = this.getLayer(a)) ? null : h.FindTile(t, e, i, n, s, r, o, a);
},
forEachTile: function (t, e, i, n, s, r, o, a) {
return null === (a = this.getLayer(a)) ? null : (h.ForEachTile(t, e, i, n, s, r, o, a), this);
},
getImageIndex: function (t) {
return this.getIndex(this.images, t);
},
getImageLayerNames: function () {
return this.images && Array.isArray(this.images)
? this.images.map(function (t) {
return t.name;
})
: [];
},
getIndex: function (t, e) {
for (var i = 0; i < t.length; i++) if (t[i].name === e) return i;
return null;
},
getLayer: function (t) {
var e = this.getLayerIndex(t);
return null !== e ? this.layers[e] : null;
},
getObjectLayer: function (t) {
var e = this.getIndex(this.objects, t);
return null !== e ? this.objects[e] : null;
},
getObjectLayerNames: function () {
return this.objects && Array.isArray(this.objects)
? this.objects.map(function (t) {
return t.name;
})
: [];
},
getLayerIndex: function (t) {
return void 0 === t ? this.currentLayerIndex : "string" == typeof t ? this.getLayerIndexByName(t) : "number" == typeof t && t < this.layers.length ? t : t instanceof g ? t.layerIndex : null;
},
getLayerIndexByName: function (t) {
return this.getIndex(this.layers, t);
},
getTileAt: function (t, e, i, n) {
return null === (n = this.getLayer(n)) ? null : h.GetTileAt(t, e, i, n);
},
getTileAtWorldXY: function (t, e, i, n, s) {
return null === (s = this.getLayer(s)) ? null : h.GetTileAtWorldXY(t, e, i, n, s);
},
getTileLayerNames: function () {
return this.layers && Array.isArray(this.layers)
? this.layers.map(function (t) {
return t.name;
})
: [];
},
getTilesWithin: function (t, e, i, n, s, r) {
return null === (r = this.getLayer(r)) ? null : h.GetTilesWithin(t, e, i, n, s, r);
},
getTilesWithinShape: function (t, e, i, n) {
return null === (n = this.getLayer(n)) ? null : h.GetTilesWithinShape(t, e, i, n);
},
getTilesWithinWorldXY: function (t, e, i, n, s, r, o) {
return null === (o = this.getLayer(o)) ? null : h.GetTilesWithinWorldXY(t, e, i, n, s, r, o);
},
getTileset: function (t) {
var e = this.getIndex(this.tilesets, t);
return null !== e ? this.tilesets[e] : null;
},
getTilesetIndex: function (t) {
return this.getIndex(this.tilesets, t);
},
hasTileAt: function (t, e, i) {
return null === (i = this.getLayer(i)) ? null : h.HasTileAt(t, e, i);
},
hasTileAtWorldXY: function (t, e, i, n) {
return null === (n = this.getLayer(n)) ? null : h.HasTileAtWorldXY(t, e, i, n);
},
layer: {
get: function () {
return this.layers[this.currentLayerIndex];
},
set: function (t) {
this.setLayer(t);
},
},
putTileAt: function (t, e, i, n, s) {
return void 0 === n && (n = !0), null === (s = this.getLayer(s)) ? null : h.PutTileAt(t, e, i, n, s);
},
putTileAtWorldXY: function (t, e, i, n, s, r) {
return void 0 === n && (n = !0), null === (r = this.getLayer(r)) ? null : h.PutTileAtWorldXY(t, e, i, n, s, r);
},
putTilesAt: function (t, e, i, n, s) {
return void 0 === n && (n = !0), null === (s = this.getLayer(s)) ? null : (h.PutTilesAt(t, e, i, n, s), this);
},
randomize: function (t, e, i, n, s, r) {
return null === (r = this.getLayer(r)) ? null : (h.Randomize(t, e, i, n, s, r), this);
},
calculateFacesAt: function (t, e, i) {
return null === (i = this.getLayer(i)) ? null : (h.CalculateFacesAt(t, e, i), this);
},
calculateFacesWithin: function (t, e, i, n, s) {
return null === (s = this.getLayer(s)) ? null : (h.CalculateFacesWithin(t, e, i, n, s), this);
},
removeLayer: function (t) {
var e = this.getLayerIndex(t);
if (null === e) return null;
r(this.layers, e);
for (var i = e; i < this.layers.length; i++) this.layers[i].tilemapLayer && this.layers[i].tilemapLayer.layerIndex--;
return this.currentLayerIndex === e && (this.currentLayerIndex = 0), this;
},
destroyLayer: function (t) {
var e = this.getLayerIndex(t);
return null !== e ? ((t = this.layers[e]).destroy(), r(this.layers, e), this.currentLayerIndex === e && (this.currentLayerIndex = 0), this) : null;
},
removeAllLayers: function () {
for (var t = this.layers, e = 0; e < t.length; e++) t[e].tilemapLayer && t[e].tilemapLayer.destroy(!1);
return (t.length = 0), (this.currentLayerIndex = 0), this;
},
removeTile: function (t, e, i) {
void 0 === e && (e = -1), void 0 === i && (i = !0);
var n = [];
Array.isArray(t) || (t = [t]);
for (var s = 0; s < t.length; s++) {
var r = t[s];
n.push(this.removeTileAt(r.x, r.y, !0, i, r.tilemapLayer)), -1 < e && this.putTileAt(e, r.x, r.y, i, r.tilemapLayer);
}
return n;
},
removeTileAt: function (t, e, i, n, s) {
return void 0 === i && (i = !0), void 0 === n && (n = !0), null === (s = this.getLayer(s)) ? null : h.RemoveTileAt(t, e, i, n, s);
},
removeTileAtWorldXY: function (t, e, i, n, s, r) {
return void 0 === i && (i = !0), void 0 === n && (n = !0), null === (r = this.getLayer(r)) ? null : h.RemoveTileAtWorldXY(t, e, i, n, s, r);
},
renderDebug: function (t, e, i) {
return null === (i = this.getLayer(i)) ? null : (this.orientation === s.ORTHOGONAL && h.RenderDebug(t, e, i), this);
},
renderDebugFull: function (t, e) {
for (var i = this.layers, n = 0; n < i.length; n++) h.RenderDebug(t, e, i[n]);
return this;
},
replaceByIndex: function (t, e, i, n, s, r, o) {
return null === (o = this.getLayer(o)) ? null : (h.ReplaceByIndex(t, e, i, n, s, r, o), this);
},
setCollision: function (t, e, i, n, s) {
return void 0 === e && (e = !0), void 0 === i && (i = !0), void 0 === s && (s = !0), null === (n = this.getLayer(n)) ? null : (h.SetCollision(t, e, i, n, s), this);
},
setCollisionBetween: function (t, e, i, n, s) {
return void 0 === i && (i = !0), void 0 === n && (n = !0), null === (s = this.getLayer(s)) ? null : (h.SetCollisionBetween(t, e, i, n, s), this);
},
setCollisionByProperty: function (t, e, i, n) {
return void 0 === e && (e = !0), void 0 === i && (i = !0), null === (n = this.getLayer(n)) ? null : (h.SetCollisionByProperty(t, e, i, n), this);
},
setCollisionByExclusion: function (t, e, i, n) {
return void 0 === e && (e = !0), void 0 === i && (i = !0), null === (n = this.getLayer(n)) ? null : (h.SetCollisionByExclusion(t, e, i, n), this);
},
setCollisionFromCollisionGroup: function (t, e, i) {
return void 0 === t && (t = !0), void 0 === e && (e = !0), null === (i = this.getLayer(i)) ? null : (h.SetCollisionFromCollisionGroup(t, e, i), this);
},
setTileIndexCallback: function (t, e, i, n) {
return null === (n = this.getLayer(n)) ? null : (h.SetTileIndexCallback(t, e, i, n), this);
},
setTileLocationCallback: function (t, e, i, n, s, r, o) {
return null === (o = this.getLayer(o)) ? null : (h.SetTileLocationCallback(t, e, i, n, s, r, o), this);
},
setLayer: function (t) {
var e = this.getLayerIndex(t);
return null !== e && (this.currentLayerIndex = e), this;
},
setBaseTileSize: function (t, e) {
(this.tileWidth = t), (this.tileHeight = e), (this.widthInPixels = this.width * t), (this.heightInPixels = this.height * e);
for (var i = 0; i < this.layers.length; i++) {
(this.layers[i].baseTileWidth = t), (this.layers[i].baseTileHeight = e);
for (var n = this.layers[i].data, s = this.layers[i].width, r = this.layers[i].height, o = 0; o < r; o++)
for (var a = 0; a < s; a++) {
var h = n[o][a];
null !== h && h.setSize(void 0, void 0, t, e);
}
}
return this;
},
setLayerTileSize: function (t, e, i) {
if (null === (i = this.getLayer(i))) return this;
(i.tileWidth = t), (i.tileHeight = e);
for (var n = i.data, s = i.width, r = i.height, o = 0; o < r; o++)
for (var a = 0; a < s; a++) {
var h = n[o][a];
null !== h && h.setSize(t, e);
}
return this;
},
shuffle: function (t, e, i, n, s) {
return null === (s = this.getLayer(s)) ? null : (h.Shuffle(t, e, i, n, s), this);
},
swapByIndex: function (t, e, i, n, s, r, o) {
return null === (o = this.getLayer(o)) ? null : (h.SwapByIndex(t, e, i, n, s, r, o), this);
},
tileToWorldX: function (t, e, i) {
return null === (i = this.getLayer(i)) ? null : this._convert.TileToWorldX(t, e, i);
},
tileToWorldY: function (t, e, i) {
return null === (i = this.getLayer(i)) ? null : this._convert.TileToWorldY(t, e, i);
},
tileToWorldXY: function (t, e, i, n, s) {
return null === (s = this.getLayer(s)) ? null : this._convert.TileToWorldXY(t, e, i, n, s);
},
weightedRandomize: function (t, e, i, n, s, r) {
return null === (r = this.getLayer(r)) ? null : (h.WeightedRandomize(e, i, n, s, t, r), this);
},
worldToTileX: function (t, e, i, n) {
return null === (n = this.getLayer(n)) ? null : this._convert.WorldToTileX(t, e, i, n);
},
worldToTileY: function (t, e, i, n) {
return null === (n = this.getLayer(n)) ? null : this._convert.WorldToTileY(t, e, i, n);
},
worldToTileXY: function (t, e, i, n, s, r) {
return null === (r = this.getLayer(r)) ? null : this._convert.WorldToTileXY(t, e, i, n, s, r);
},
destroy: function () {
this.removeAllLayers(), (this.tilesets.length = 0), (this.objects.length = 0), (this.scene = null);
},
});
t.exports = o;
},
function (t, e, i) {
var n = i(0),
s = i(11),
o = i(15),
a = i(251),
r = i(1456),
h = new n({
Extends: o,
Mixins: [s.Alpha, s.BlendMode, s.ComputedSize, s.Depth, s.Flip, s.GetBounds, s.Origin, s.Pipeline, s.Transform, s.Visible, s.ScrollFactor, r],
initialize: function (t, e, i, n, s, r) {
o.call(this, t, "TilemapLayer"),
(this.isTilemap = !0),
(this.tilemap = e),
(this.layerIndex = i),
(this.layer = e.layers[i]),
((this.layer.tilemapLayer = this).tileset = []),
(this.tilesDrawn = 0),
(this.tilesTotal = this.layer.width * this.layer.height),
(this.culledTiles = []),
(this.skipCull = !1),
(this.cullPaddingX = 1),
(this.cullPaddingY = 1),
(this.cullCallback = a.GetCullTilesFunction(this.layer.orientation)),
(this._renderOrder = 0),
(this.gidMap = []),
this.setTilesets(n),
this.setAlpha(this.layer.alpha),
this.setPosition(s, r),
this.setOrigin(),
this.setSize(e.tileWidth * this.layer.width, e.tileHeight * this.layer.height),
this.initPipeline();
},
setTilesets: function (t) {
var e = [],
i = [],
n = this.tilemap;
Array.isArray(t) || (t = [t]);
for (var s = 0; s < t.length; s++) {
var r = t[s];
if (("string" == typeof r && (r = n.getTileset(r)), r)) {
i.push(r);
for (var o = r.firstgid, a = 0; a < r.total; a++) e[o + a] = r;
}
}
(this.gidMap = e), (this.tileset = i);
},
setRenderOrder: function (t) {
return "string" == typeof t && (t = ["right-down", "left-down", "right-up", "left-up"].indexOf(t)), 0 <= t && t < 4 && (this._renderOrder = t), this;
},
calculateFacesAt: function (t, e) {
return a.CalculateFacesAt(t, e, this.layer), this;
},
calculateFacesWithin: function (t, e, i, n) {
return a.CalculateFacesWithin(t, e, i, n, this.layer), this;
},
createFromTiles: function (t, e, i, n, s) {
return a.CreateFromTiles(t, e, i, n, s, this.layer);
},
cull: function (t) {
return this.cullCallback(this.layer, t, this.culledTiles, this._renderOrder);
},
copy: function (t, e, i, n, s, r, o) {
return a.Copy(t, e, i, n, s, r, o, this.layer), this;
},
fill: function (t, e, i, n, s, r) {
return a.Fill(t, e, i, n, s, r, this.layer), this;
},
filterTiles: function (t, e, i, n, s, r, o) {
return a.FilterTiles(t, e, i, n, s, r, o, this.layer);
},
findByIndex: function (t, e, i) {
return a.FindByIndex(t, e, i, this.layer);
},
findTile: function (t, e, i, n, s, r, o) {
return a.FindTile(t, e, i, n, s, r, o, this.layer);
},
forEachTile: function (t, e, i, n, s, r, o) {
return a.ForEachTile(t, e, i, n, s, r, o, this.layer), this;
},
getTileAt: function (t, e, i) {
return a.GetTileAt(t, e, i, this.layer);
},
getTileAtWorldXY: function (t, e, i, n) {
return a.GetTileAtWorldXY(t, e, i, n, this.layer);
},
getTilesWithin: function (t, e, i, n, s) {
return a.GetTilesWithin(t, e, i, n, s, this.layer);
},
getTilesWithinShape: function (t, e, i) {
return a.GetTilesWithinShape(t, e, i, this.layer);
},
getTilesWithinWorldXY: function (t, e, i, n, s, r) {
return a.GetTilesWithinWorldXY(t, e, i, n, s, r, this.layer);
},
hasTileAt: function (t, e) {
return a.HasTileAt(t, e, this.layer);
},
hasTileAtWorldXY: function (t, e, i) {
return a.HasTileAtWorldXY(t, e, i, this.layer);
},
putTileAt: function (t, e, i, n) {
return a.PutTileAt(t, e, i, n, this.layer);
},
putTileAtWorldXY: function (t, e, i, n, s) {
return a.PutTileAtWorldXY(t, e, i, n, s, this.layer);
},
putTilesAt: function (t, e, i, n) {
return a.PutTilesAt(t, e, i, n, this.layer), this;
},
randomize: function (t, e, i, n, s) {
return a.Randomize(t, e, i, n, s, this.layer), this;
},
removeTileAt: function (t, e, i, n) {
return a.RemoveTileAt(t, e, i, n, this.layer);
},
removeTileAtWorldXY: function (t, e, i, n, s) {
return a.RemoveTileAtWorldXY(t, e, i, n, s, this.layer);
},
renderDebug: function (t, e) {
return a.RenderDebug(t, e, this.layer), this;
},
replaceByIndex: function (t, e, i, n, s, r) {
return a.ReplaceByIndex(t, e, i, n, s, r, this.layer), this;
},
setSkipCull: function (t) {
return void 0 === t && (t = !0), (this.skipCull = t), this;
},
setCullPadding: function (t, e) {
return void 0 === t && (t = 1), void 0 === e && (e = 1), (this.cullPaddingX = t), (this.cullPaddingY = e), this;
},
setCollision: function (t, e, i, n) {
return a.SetCollision(t, e, i, this.layer, n), this;
},
setCollisionBetween: function (t, e, i, n) {
return a.SetCollisionBetween(t, e, i, n, this.layer), this;
},
setCollisionByProperty: function (t, e, i) {
return a.SetCollisionByProperty(t, e, i, this.layer), this;
},
setCollisionByExclusion: function (t, e, i) {
return a.SetCollisionByExclusion(t, e, i, this.layer), this;
},
setCollisionFromCollisionGroup: function (t, e) {
return a.SetCollisionFromCollisionGroup(t, e, this.layer), this;
},
setTileIndexCallback: function (t, e, i) {
return a.SetTileIndexCallback(t, e, i, this.layer), this;
},
setTileLocationCallback: function (t, e, i, n, s, r) {
return a.SetTileLocationCallback(t, e, i, n, s, r, this.layer), this;
},
shuffle: function (t, e, i, n) {
return a.Shuffle(t, e, i, n, this.layer), this;
},
swapByIndex: function (t, e, i, n, s, r) {
return a.SwapByIndex(t, e, i, n, s, r, this.layer), this;
},
tileToWorldX: function (t, e) {
return this.tilemap.tileToWorldX(t, e, this);
},
tileToWorldY: function (t, e) {
return this.tilemap.tileToWorldY(t, e, this);
},
tileToWorldXY: function (t, e, i, n) {
return this.tilemap.tileToWorldXY(t, e, i, n, this);
},
weightedRandomize: function (t, e, i, n, s) {
return a.WeightedRandomize(e, i, n, s, t, this.layer), this;
},
worldToTileX: function (t, e, i) {
return this.tilemap.worldToTileX(t, e, i, this);
},
worldToTileY: function (t, e, i) {
return this.tilemap.worldToTileY(t, e, i, this);
},
worldToTileXY: function (t, e, i, n, s) {
return this.tilemap.worldToTileXY(t, e, i, n, s, this);
},
destroy: function (t) {
void 0 === t && (t = !0),
this.tilemap &&
(this.layer.tilemapLayer === this && (this.layer.tilemapLayer = void 0),
t && this.tilemap.removeLayer(this),
(this.tilemap = void 0),
(this.layer = void 0),
(this.culledTiles.length = 0),
(this.cullCallback = null),
(this.gidMap = []),
(this.tileset = []),
o.prototype.destroy.call(this));
},
});
t.exports = h;
},
function (t, e, i) {
var n = i(0),
s = i(2),
r = new n({
initialize: function (t) {
(this.delay = 0),
(this.repeat = 0),
(this.repeatCount = 0),
(this.loop = !1),
this.callback,
this.callbackScope,
this.args,
(this.timeScale = 1),
(this.startAt = 0),
(this.elapsed = 0),
(this.paused = !1),
(this.hasDispatched = !1),
this.reset(t);
},
reset: function (t) {
return (
(this.delay = s(t, "delay", 0)),
(this.repeat = s(t, "repeat", 0)),
(this.loop = s(t, "loop", !1)),
(this.callback = s(t, "callback", void 0)),
(this.callbackScope = s(t, "callbackScope", this.callback)),
(this.args = s(t, "args", [])),
(this.timeScale = s(t, "timeScale", 1)),
(this.startAt = s(t, "startAt", 0)),
(this.paused = s(t, "paused", !1)),
(this.elapsed = this.startAt),
(this.hasDispatched = !1),
(this.repeatCount = -1 === this.repeat || this.loop ? 999999999999 : this.repeat),
this
);
},
getProgress: function () {
return this.elapsed / this.delay;
},
getOverallProgress: function () {
if (0 < this.repeat) {
var t = this.delay + this.delay * this.repeat;
return (this.elapsed + this.delay * (this.repeat - this.repeatCount)) / t;
}
return this.getProgress();
},
getRepeatCount: function () {
return this.repeatCount;
},
getElapsed: function () {
return this.elapsed;
},
getElapsedSeconds: function () {
return 0.001 * this.elapsed;
},
getRemaining: function () {
return this.delay - this.elapsed;
},
getRemainingSeconds: function () {
return 0.001 * this.getRemaining();
},
getOverallRemaining: function () {
return this.delay * (1 + this.repeatCount) - this.elapsed;
},
getOverallRemainingSeconds: function () {
return 0.001 * this.getOverallRemaining();
},
remove: function (t) {
void 0 === t && (t = !1), (this.elapsed = this.delay), (this.hasDispatched = !t), (this.repeatCount = 0);
},
destroy: function () {
(this.callback = void 0), (this.callbackScope = void 0), (this.args = []);
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(1465);
t.exports = function (t) {
var e,
i = [];
if (t.hasOwnProperty("props")) for (e in t.props) "_" !== e.substr(0, 1) && i.push({ key: e, value: t.props[e] });
else for (e in t) -1 === n.indexOf(e) && "_" !== e.substr(0, 1) && i.push({ key: e, value: t[e] });
return i;
};
},
function (t, e, i) {
var n = i(6);
t.exports = function (t) {
var e = n(t, "tweens", null);
return null === e ? [] : ("function" == typeof e && (e = e.call()), Array.isArray(e) || (e = [e]), e);
};
},
function (t, e, i) {
var P = i(265),
A = i(13),
M = i(99),
C = i(80),
O = i(162),
k = i(6),
R = i(264),
L = i(266),
I = i(268);
t.exports = function (t, e, i) {
void 0 === i && (i = P);
var n = k(e, "from", 0),
s = k(e, "to", 1),
r = [{ value: n }],
o = O(e, "delay", i.delay),
a = O(e, "duration", i.duration),
h = k(e, "easeParams", i.easeParams),
l = C(k(e, "ease", i.ease), h),
u = O(e, "hold", i.hold),
c = O(e, "repeat", i.repeat),
d = O(e, "repeatDelay", i.repeatDelay),
f = M(e, "yoyo", i.yoyo),
p = [],
g = R("value", s),
v = I(r[0], 0, "value", g.getEnd, g.getStart, g.getActive, l, o, a, f, u, c, d, !1, !1);
(v.start = n), (v.current = n), (v.to = s), p.push(v);
var y = new L(t, p, r);
(y.offset = A(e, "offset", null)),
(y.completeDelay = A(e, "completeDelay", 0)),
(y.loop = Math.round(A(e, "loop", 0))),
(y.loopDelay = Math.round(A(e, "loopDelay", 0))),
(y.paused = M(e, "paused", !1)),
(y.useFrames = M(e, "useFrames", !1));
for (var m = k(e, "callbackScope", y), x = [y, null], b = L.TYPES, w = 0; w < b.length; w++) {
var T,
S,
_ = b[w],
E = k(e, _, !1);
E && ((T = k(e, _ + "Scope", m)), (S = k(e, _ + "Params", [])), y.setCallback(_, E, x.concat(S), T));
}
return y;
};
},
function (t, e, i) {
var P = i(80),
A = i(6),
M = i(14);
t.exports = function (t, e) {
void 0 === e && (e = {});
var h = A(e, "start", 0),
i = A(e, "ease", null),
n = A(e, "grid", null),
a = A(e, "from", 0),
l = "first" === a,
u = "center" === a,
c = "last" === a,
d = "number" == typeof a,
f = Array.isArray(t),
p = f ? parseFloat(t[0]) : parseFloat(t),
g = f ? parseFloat(t[1]) : 0,
v = Math.max(p, g);
if ((f && (h += p), n)) {
var s,
r,
y = n[0],
m = n[1],
o = 0,
x = 0,
b = [];
c ? ((o = y - 1), (x = m - 1)) : d ? ((o = a % y), (x = Math.floor(a / y))) : u && ((o = (y - 1) / 2), (x = (m - 1) / 2));
for (var w = M.MIN_SAFE_INTEGER, T = 0; T < m; T++) {
b[T] = [];
for (var S = 0; S < y; S++) {
(s = o - S), (r = x - T);
var _ = Math.sqrt(s * s + r * r);
w < _ && (w = _), (b[T][S] = _);
}
}
}
var E = i ? P(i) : null;
return n
? function (t, e, i, n) {
var s,
r = 0,
o = n % y,
a = Math.floor(n / y);
return 0 <= o && o < y && 0 <= a && a < m && (r = b[a][o]), (f ? ((s = g - p), E ? (r / w) * s * E(r / w) : (r / w) * s) : E ? r * p * E(r / w) : r * p) + h;
}
: function (t, e, i, n, s) {
var r, o;
return (
s--,
l ? (r = n) : u ? (r = Math.abs(s / 2 - n)) : c ? (r = s - n) : d && (r = Math.abs(a - n)),
(f ? ((o = u ? ((g - p) / s) * (2 * r) : ((g - p) / s) * r), E ? o * E(r / s) : o) : E ? s * v * E(r / s) : r * p) + h
);
};
};
},
function (t, e, i) {
var _ = i(77),
E = i(265),
P = i(13),
A = i(99),
M = i(80),
C = i(162),
O = i(263),
k = i(584),
R = i(6),
L = i(588),
I = i(163);
t.exports = function (t, e) {
var i = new L(t);
(i.completeDelay = P(e, "completeDelay", 0)), (i.loop = Math.round(P(e, "loop", 0))), (i.loopDelay = Math.round(P(e, "loopDelay", 0))), (i.paused = A(e, "paused", !1)), (i.useFrames = A(e, "useFrames", !1));
var n,
s,
r = R(e, "callbackScope", i),
o = [i],
a = R(e, "onStart", !1);
a && ((n = R(e, "onStartScope", r)), (s = R(e, "onStartParams", [])), i.setCallback("onStart", a, o.concat(s), n));
var h,
l,
u = R(e, "onUpdate", !1);
u && ((h = R(e, "onUpdateScope", r)), (l = R(e, "onUpdateParams", [])), i.setCallback("onUpdate", u, o.concat(l), h));
var c,
d,
f = R(e, "onLoop", !1);
f && ((c = R(e, "onLoopScope", r)), (d = R(e, "onLoopParams", [])), i.setCallback("onLoop", f, o.concat(d), c));
var p,
g,
v = R(e, "onYoyo", !1);
v && ((p = R(e, "onYoyoScope", r)), (g = R(e, "onYoyoParams", [])), i.setCallback("onYoyo", v, o.concat(null, g), p));
var y,
m,
x = R(e, "onComplete", !1);
x && ((y = R(e, "onCompleteScope", r)), (m = R(e, "onCompleteParams", [])), i.setCallback("onComplete", x, o.concat(m), y));
var b = k(e);
if (0 === b.length) return (i.paused = !0), i;
var w = _(E);
w.targets = O(e);
var T = P(e, "totalDuration", 0);
(w.duration = 0 < T ? Math.floor(T / b.length) : C(e, "duration", w.duration)),
(w.delay = C(e, "delay", w.delay)),
(w.easeParams = R(e, "easeParams", w.easeParams)),
(w.ease = M(R(e, "ease", w.ease), w.easeParams)),
(w.hold = C(e, "hold", w.hold)),
(w.repeat = C(e, "repeat", w.repeat)),
(w.repeatDelay = C(e, "repeatDelay", w.repeatDelay)),
(w.yoyo = A(e, "yoyo", w.yoyo)),
(w.flipX = A(e, "flipX", w.flipX)),
(w.flipY = A(e, "flipY", w.flipY));
for (var S = 0; S < b.length; S++) i.queue(I(i, b[S], w));
return i;
};
},
function (t, e, i) {
var n = i(0),
s = i(9),
r = i(267),
o = i(163),
a = i(100),
h = new n({
Extends: s,
initialize: function (t) {
s.call(this),
(this.manager = t),
(this.isTimeline = !0),
(this.data = []),
(this.totalData = 0),
(this.useFrames = !1),
(this.timeScale = 1),
(this.loop = 0),
(this.loopDelay = 0),
(this.loopCounter = 0),
(this.completeDelay = 0),
(this.countdown = 0),
(this.state = a.PENDING_ADD),
(this._pausedState = a.PENDING_ADD),
(this.paused = !1),
(this.elapsed = 0),
(this.totalElapsed = 0),
(this.duration = 0),
(this.progress = 0),
(this.totalDuration = 0),
(this.totalProgress = 0),
(this.callbacks = { onComplete: null, onLoop: null, onStart: null, onUpdate: null, onYoyo: null }),
this.callbackScope;
},
dispatchTimelineEvent: function (t, e) {
this.emit(t, this), e && e.func.apply(e.scope, e.params);
},
setTimeScale: function (t) {
return (this.timeScale = t), this;
},
getTimeScale: function () {
return this.timeScale;
},
isPlaying: function () {
return this.state === a.ACTIVE;
},
add: function (t) {
return this.queue(o(this, t));
},
queue: function (t) {
return this.isPlaying() || ((t.parent = this), (t.parentIsTimeline = !0), this.data.push(t), (this.totalData = this.data.length)), this;
},
hasOffset: function (t) {
return null !== t.offset;
},
isOffsetAbsolute: function (t) {
return "number" == typeof t;
},
isOffsetRelative: function (t) {
if ("string" == typeof t) {
var e = t[0];
if ("-" === e || "+" === e) return !0;
}
return !1;
},
getRelativeOffset: function (t, e) {
var i = t[0],
n = parseFloat(t.substr(2)),
s = e;
switch (i) {
case "+":
s += n;
break;
case "-":
s -= n;
}
return Math.max(0, s);
},
calcDuration: function () {
for (var t = 0, e = 0, i = 0, n = 0; n < this.totalData; n++) {
var s = this.data[n];
s.init(),
this.hasOffset(s)
? this.isOffsetAbsolute(s.offset)
? ((s.calculatedOffset = s.offset), 0 === s.offset && (i = 0))
: this.isOffsetRelative(s.offset) && (s.calculatedOffset = this.getRelativeOffset(s.offset, t))
: (s.calculatedOffset = i),
(t = s.totalDuration + s.calculatedOffset),
(e += s.totalDuration),
(i += s.totalDuration);
}
(this.duration = e),
(this.loopCounter = -1 === this.loop ? 999999999999 : this.loop),
0 < this.loopCounter ? (this.totalDuration = this.duration + this.completeDelay + (this.duration + this.loopDelay) * this.loopCounter) : (this.totalDuration = this.duration + this.completeDelay);
},
init: function () {
return this.calcDuration(), (this.progress = 0), (this.totalProgress = 0), !this.paused || ((this.state = a.PAUSED), !1);
},
resetTweens: function (t) {
for (var e = 0; e < this.totalData; e++) this.data[e].play(t);
},
setCallback: function (t, e, i, n) {
return -1 !== h.TYPES.indexOf(t) && (this.callbacks[t] = { func: e, scope: n, params: i }), this;
},
makeActive: function (t) {
return this.manager.makeActive(t);
},
play: function () {
if (this.state !== a.ACTIVE) {
if (this.paused) return (this.paused = !1), void this.manager.makeActive(this);
this.resetTweens(!1), (this.state = a.ACTIVE), this.dispatchTimelineEvent(r.TIMELINE_START, this.callbacks.onStart);
}
},
nextState: function () {
0 < this.loopCounter
? ((this.elapsed = 0),
(this.progress = 0),
this.loopCounter--,
this.resetTweens(!0),
0 < this.loopDelay ? ((this.countdown = this.loopDelay), (this.state = a.LOOP_DELAY)) : ((this.state = a.ACTIVE), this.dispatchTimelineEvent(r.TIMELINE_LOOP, this.callbacks.onLoop)))
: 0 < this.completeDelay
? ((this.state = a.COMPLETE_DELAY), (this.countdown = this.completeDelay))
: ((this.state = a.PENDING_REMOVE), this.dispatchTimelineEvent(r.TIMELINE_COMPLETE, this.callbacks.onComplete));
},
update: function (t, e) {
if (this.state !== a.PAUSED) {
switch (
(this.useFrames && (e = +this.manager.timeScale),
(e *= this.timeScale),
(this.elapsed += e),
(this.progress = Math.min(this.elapsed / this.duration, 1)),
(this.totalElapsed += e),
(this.totalProgress = Math.min(this.totalElapsed / this.totalDuration, 1)),
this.state)
) {
case a.ACTIVE:
for (var i = this.totalData, n = 0; n < this.totalData; n++) this.data[n].update(t, e) && i--;
this.dispatchTimelineEvent(r.TIMELINE_UPDATE, this.callbacks.onUpdate), 0 === i && this.nextState();
break;
case a.LOOP_DELAY:
(this.countdown -= e), this.countdown <= 0 && ((this.state = a.ACTIVE), this.dispatchTimelineEvent(r.TIMELINE_LOOP, this.callbacks.onLoop));
break;
case a.COMPLETE_DELAY:
(this.countdown -= e), this.countdown <= 0 && ((this.state = a.PENDING_REMOVE), this.dispatchTimelineEvent(r.TIMELINE_COMPLETE, this.callbacks.onComplete));
}
return this.state === a.PENDING_REMOVE;
}
},
stop: function () {
this.state = a.PENDING_REMOVE;
},
pause: function () {
if (this.state !== a.PAUSED) return (this.paused = !0), (this._pausedState = this.state), (this.state = a.PAUSED), this.emit(r.TIMELINE_PAUSE, this), this;
},
resume: function () {
return this.state === a.PAUSED && ((this.paused = !1), (this.state = this._pausedState), this.emit(r.TIMELINE_RESUME, this)), this;
},
hasTarget: function (t) {
for (var e = 0; e < this.data.length; e++) if (this.data[e].hasTarget(t)) return !0;
return !1;
},
destroy: function () {
for (var t = 0; t < this.data.length; t++) this.data[t].stop();
},
});
(h.TYPES = ["onStart", "onUpdate", "onLoop", "onComplete", "onYoyo"]), (t.exports = h);
},
function (t, e, i) {
var o = i(86),
c = i(41),
d = i(32),
f = i(2),
s = i(64),
n = {
parseBody: function (t, e, i, n) {
void 0 === n && (n = {});
for (var s = f(i, "fixtures", []), r = [], o = 0; o < s.length; o++) for (var a = this.parseFixture(s[o]), h = 0; h < a.length; h++) r.push(a[h]);
var l = d.clone(i, !0);
d.extend(l, n, !0), delete l.fixtures, delete l.type;
var u = c.create(l);
return c.setParts(u, r), c.setPosition(u, { x: t, y: e }), u;
},
parseFixture: function (t) {
var e,
i,
n,
s,
r = d.extend({}, !1, t);
return (
delete r.circle,
delete r.vertices,
t.circle ? ((e = f(t.circle, "x")), (i = f(t.circle, "y")), (n = f(t.circle, "radius")), (s = [o.circle(e, i, n, r)])) : t.vertices && (s = this.parseVertices(t.vertices, r)),
s
);
},
parseVertices: function (t, e) {
void 0 === e && (e = {});
for (var i = [], n = 0; n < t.length; n++) s.clockwiseSort(t[n]), i.push(c.create(d.extend({ position: s.centre(t[n]), vertices: t[n] }, e)));
return o.flagCoincidentParts(i);
},
};
t.exports = n;
},
function (t, e, i) {
var l = i(86),
u = i(41),
n = {
parseBody: function (t, e, i, n) {
var s;
void 0 === n && (n = {});
var r = i.vertices;
if (1 === r.length) (n.vertices = r[0]), (s = u.create(n)), l.flagCoincidentParts(s.parts);
else {
for (var o = [], a = 0; a < r.length; a++) {
var h = u.create({ vertices: r[a] });
o.push(h);
}
l.flagCoincidentParts(o), (n.parts = o), (s = u.create(n));
}
return (s.label = i.label), u.setPosition(s, { x: t, y: e }), s;
},
};
t.exports = n;
},
function (t, e, i) {
var f = {};
t.exports = f;
var m = i(118),
g = i(128),
v = i(32),
x = i(41),
p = i(86);
(f.stack = function (t, e, i, n, s, r, o) {
for (var a, h = m.create({ label: "Stack" }), l = t, u = e, c = 0, d = 0; d < n; d++) {
for (var f = 0, p = 0; p < i; p++) {
var g,
v,
y = o(l, u, p, d, a, c);
y
? ((g = y.bounds.max.y - y.bounds.min.y), (v = y.bounds.max.x - y.bounds.min.x), f < g && (f = g), x.translate(y, { x: 0.5 * v, y: 0.5 * g }), (l = y.bounds.max.x + s), m.addBody(h, y), (a = y), (c += 1))
: (l += s);
}
(u += f + r), (l = t);
}
return h;
}),
(f.chain = function (t, e, i, n, s, r) {
for (var o = t.bodies, a = 1; a < o.length; a++) {
var h = o[a - 1],
l = o[a],
u = h.bounds.max.y - h.bounds.min.y,
c = h.bounds.max.x - h.bounds.min.x,
d = l.bounds.max.y - l.bounds.min.y,
f = { bodyA: h, pointA: { x: c * e, y: u * i }, bodyB: l, pointB: { x: (l.bounds.max.x - l.bounds.min.x) * n, y: d * s } },
p = v.extend(f, r);
m.addConstraint(t, g.create(p));
}
return (t.label += " Chain"), t;
}),
(f.mesh = function (t, e, i, n, s) {
for (var r, o, a, h, l = t.bodies, u = 0; u < i; u++) {
for (r = 1; r < e; r++) (o = l[r - 1 + u * e]), (a = l[r + u * e]), m.addConstraint(t, g.create(v.extend({ bodyA: o, bodyB: a }, s)));
if (0 < u)
for (r = 0; r < e; r++)
(o = l[r + (u - 1) * e]),
(a = l[r + u * e]),
m.addConstraint(t, g.create(v.extend({ bodyA: o, bodyB: a }, s))),
n && 0 < r && ((h = l[r - 1 + (u - 1) * e]), m.addConstraint(t, g.create(v.extend({ bodyA: h, bodyB: a }, s)))),
n && r < e - 1 && ((h = l[r + 1 + (u - 1) * e]), m.addConstraint(t, g.create(v.extend({ bodyA: h, bodyB: a }, s))));
}
return (t.label += " Mesh"), t;
}),
(f.pyramid = function (h, t, l, u, c, e, d) {
return f.stack(h, t, l, u, c, e, function (t, e, i, n, s, r) {
var o = Math.min(u, Math.ceil(l / 2)),
a = s ? s.bounds.max.x - s.bounds.min.x : 0;
if (!(o < n || i < (n = o - n) || l - 1 - n < i)) return 1 === r && x.translate(s, { x: (i + (l % 2 == 1 ? 1 : -1)) * a, y: 0 }), d(h + (s ? i * a : 0) + i * c, e, i, n, s, r);
});
}),
(f.newtonsCradle = function (t, e, i, n, s) {
for (var r = m.create({ label: "Newtons Cradle" }), o = 0; o < i; o++) {
var a = p.circle(t + o * (1.9 * n), e + s, n, { inertia: 1 / 0, restitution: 1, friction: 0, frictionAir: 1e-4, slop: 1 }),
h = g.create({ pointA: { x: t + o * (1.9 * n), y: e }, bodyB: a });
m.addBody(r, a), m.addConstraint(r, h);
}
return r;
}),
(f.car = function (t, e, i, n, s) {
var r = x.nextGroup(!0),
o = 0.5 * -i + 20,
a = 0.5 * i - 20,
h = m.create({ label: "Car" }),
l = p.rectangle(t, e, i, n, { collisionFilter: { group: r }, chamfer: { radius: 0.5 * n }, density: 2e-4 }),
u = p.circle(t + o, e + 0, s, { collisionFilter: { group: r }, friction: 0.8 }),
c = p.circle(t + a, e + 0, s, { collisionFilter: { group: r }, friction: 0.8 }),
d = g.create({ bodyB: l, pointB: { x: o, y: 0 }, bodyA: u, stiffness: 1, length: 0 }),
f = g.create({ bodyB: l, pointB: { x: a, y: 0 }, bodyA: c, stiffness: 1, length: 0 });
return m.addBody(h, l), m.addBody(h, u), m.addBody(h, c), m.addConstraint(h, d), m.addConstraint(h, f), h;
}),
(f.softBody = function (t, e, i, n, s, r, o, a, h, l) {
(h = v.extend({ inertia: 1 / 0 }, h)), (l = v.extend({ stiffness: 0.2, render: { type: "line", anchors: !1 } }, l));
var u = f.stack(t, e, i, n, s, r, function (t, e) {
return p.circle(t, e, a, h);
});
return f.mesh(u, i, n, o, l), (u.label = "Soft Body"), u;
});
},
function (t, e, i) {
var x = {};
(t.exports = x), i(84);
var b = i(32);
(x.pathToVertices = function (t, e) {
"undefined" == typeof window || "SVGPathSeg" in window || b.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");
var i,
n,
s,
r,
o,
a,
h,
l,
u,
c,
d,
f = [],
p = 0,
g = 0,
v = 0;
function y(t, e, i) {
var n,
s = i % 2 == 1 && 1 < i;
(u && t == u.x && e == u.y) || ((d = u && s ? ((c = u.x), u.y) : (c = 0)), (n = { x: c + t, y: d + e }), (!s && u) || (u = n), f.push(n), (g = c + t), (v = d + e));
}
function m(t) {
var e = t.pathSegTypeAsLetter.toUpperCase();
if ("Z" !== e) {
switch (e) {
case "M":
case "L":
case "T":
case "C":
case "S":
case "Q":
(g = t.x), (v = t.y);
break;
case "H":
g = t.x;
break;
case "V":
v = t.y;
}
y(g, v, t.pathSegType);
}
}
for (e = e || 15, x._svgPathToAbsolute(t), s = t.getTotalLength(), a = [], i = 0; i < t.pathSegList.numberOfItems; i += 1) a.push(t.pathSegList.getItem(i));
for (h = a.concat(); p < s; ) {
if ((o = a[t.getPathSegAtLength(p)]) != l) {
for (; h.length && h[0] != o; ) m(h.shift());
l = o;
}
switch (o.pathSegTypeAsLetter.toUpperCase()) {
case "C":
case "T":
case "S":
case "Q":
case "A":
y((r = t.getPointAtLength(p)).x, r.y, 0);
}
p += e;
}
for (i = 0, n = h.length; i < n; ++i) m(h[i]);
return f;
}),
(x._svgPathToAbsolute = function (t) {
for (var e, i, n, s, r, o, a = t.pathSegList, h = 0, l = 0, u = a.numberOfItems, c = 0; c < u; ++c) {
var d = a.getItem(c),
f = d.pathSegTypeAsLetter;
if (/[MLHVCSQTA]/.test(f)) "x" in d && (h = d.x), "y" in d && (l = d.y);
else
switch (("x1" in d && (n = h + d.x1), "x2" in d && (r = h + d.x2), "y1" in d && (s = l + d.y1), "y2" in d && (o = l + d.y2), "x" in d && (h += d.x), "y" in d && (l += d.y), f)) {
case "m":
a.replaceItem(t.createSVGPathSegMovetoAbs(h, l), c);
break;
case "l":
a.replaceItem(t.createSVGPathSegLinetoAbs(h, l), c);
break;
case "h":
a.replaceItem(t.createSVGPathSegLinetoHorizontalAbs(h), c);
break;
case "v":
a.replaceItem(t.createSVGPathSegLinetoVerticalAbs(l), c);
break;
case "c":
a.replaceItem(t.createSVGPathSegCurvetoCubicAbs(h, l, n, s, r, o), c);
break;
case "s":
a.replaceItem(t.createSVGPathSegCurvetoCubicSmoothAbs(h, l, r, o), c);
break;
case "q":
a.replaceItem(t.createSVGPathSegCurvetoQuadraticAbs(h, l, n, s), c);
break;
case "t":
a.replaceItem(t.createSVGPathSegCurvetoQuadraticSmoothAbs(h, l), c);
break;
case "a":
a.replaceItem(t.createSVGPathSegArcAbs(h, l, d.r1, d.r2, d.angle, d.largeArcFlag, d.sweepFlag), c);
break;
case "z":
case "Z":
(h = e), (l = i);
}
("M" != f && "m" != f) || ((e = h), (i = l));
}
});
},
function (t, e, i) {
var m = i(86),
x = i(41),
n = i(0),
s = i(249),
o = i(9),
b = i(2),
w = i(126),
T = i(64),
r = new n({
Extends: o,
Mixins: [s.Bounce, s.Collision, s.Friction, s.Gravity, s.Mass, s.Sensor, s.Sleep, s.Static],
initialize: function (t, e, i) {
o.call(this), (this.tile = e), (this.world = t), e.physics.matterBody && e.physics.matterBody.destroy(), (e.physics.matterBody = this);
var n,
s = b(i, "body", null),
r = b(i, "addToWorld", !0);
s ? this.setBody(s, r) : ((n = e.getCollisionGroup()), 0 < b(n, "objects", []).length ? this.setFromTileCollision(i) : this.setFromTileRectangle(i));
},
setFromTileRectangle: function (t) {
void 0 === t && (t = {}), w(t, "isStatic") || (t.isStatic = !0), w(t, "addToWorld") || (t.addToWorld = !0);
var e = this.tile.getBounds(),
i = e.x + e.width / 2,
n = e.y + e.height / 2,
s = m.rectangle(i, n, e.width, e.height, t);
return this.setBody(s, t.addToWorld), this;
},
setFromTileCollision: function (t) {
void 0 === t && (t = {}), w(t, "isStatic") || (t.isStatic = !0), w(t, "addToWorld") || (t.addToWorld = !0);
for (
var e = this.tile.tilemapLayer.scaleX, i = this.tile.tilemapLayer.scaleY, n = this.tile.getLeft(), s = this.tile.getTop(), r = this.tile.getCollisionGroup(), o = b(r, "objects", []), a = [], h = 0;
h < o.length;
h++
) {
var l,
u,
c,
d = o[h],
f = n + d.x * e,
p = s + d.y * i,
g = d.width * e,
v = d.height * i,
y = null;
d.rectangle
? (y = m.rectangle(f + g / 2, p + v / 2, g, v, t))
: d.ellipse
? (y = m.circle(f + g / 2, p + v / 2, g / 2, t))
: (d.polygon || d.polyline) &&
((l = (d.polygon ? d.polygon : d.polyline).map(function (t) {
return { x: t.x * e, y: t.y * i };
})),
(u = T.create(l)),
(f += (c = T.centre(u)).x),
(p += c.y),
(y = m.fromVertices(f, p, u, t))),
y && a.push(y);
}
return 1 === a.length ? this.setBody(a[0], t.addToWorld) : 1 < a.length && ((t.parts = a), this.setBody(x.create(t), t.addToWorld)), this;
},
setBody: function (t, e) {
return void 0 === e && (e = !0), this.body && this.removeBody(), (this.body = t), (this.body.gameObject = this), e && this.world.add(this.body), this;
},
removeBody: function () {
return this.body && (this.world.remove(this.body), (this.body.gameObject = void 0), (this.body = void 0)), this;
},
destroy: function () {
this.removeBody(), (this.tile.physics.matterBody = void 0), this.removeAllListeners();
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(1399);
(n.Body = i(41)),
(n.Composite = i(118)),
(n.World = i(596)),
(n.Detector = i(273)),
(n.Grid = i(597)),
(n.Pairs = i(598)),
(n.Pair = i(250)),
(n.Query = i(1400)),
(n.Resolver = i(599)),
(n.SAT = i(274)),
(n.Constraint = i(128)),
(n.Common = i(32)),
(n.Engine = i(1401)),
(n.Events = i(166)),
(n.Sleeping = i(165)),
(n.Plugin = i(595)),
(n.Bodies = i(86)),
(n.Composites = i(591)),
(n.Axes = i(271)),
(n.Bounds = i(84)),
(n.Svg = i(592)),
(n.Vector = i(83)),
(n.Vertices = i(64)),
(n.World.add = n.Composite.add),
(n.World.remove = n.Composite.remove),
(n.World.addComposite = n.Composite.addComposite),
(n.World.addBody = n.Composite.addBody),
(n.World.addConstraint = n.Composite.addConstraint),
(n.World.clear = n.Composite.clear),
(t.exports = n);
},
function (t, e, i) {
var a = {};
t.exports = a;
var h = i(32);
(a._registry = {}),
(a.register = function (t) {
var e, i, n;
return (
a.isPlugin(t) || h.warn("Plugin.register:", a.toString(t), "does not implement all required fields."),
t.name in a._registry
? ((e = a._registry[t.name]),
(i = a.versionParse(t.version).number),
(n = a.versionParse(e.version).number) < i
? (h.warn("Plugin.register:", a.toString(e), "was upgraded to", a.toString(t)), (a._registry[t.name] = t))
: i < n
? h.warn("Plugin.register:", a.toString(e), "can not be downgraded to", a.toString(t))
: t !== e && h.warn("Plugin.register:", a.toString(t), "is already registered to different plugin object"))
: (a._registry[t.name] = t),
t
);
}),
(a.resolve = function (t) {
return a._registry[a.dependencyParse(t).name];
}),
(a.toString = function (t) {
return "string" == typeof t ? t : (t.name || "anonymous") + "@" + (t.version || t.range || "0.0.0");
}),
(a.isPlugin = function (t) {
return t && t.name && t.version && t.install;
}),
(a.isUsed = function (t, e) {
return -1 < t.used.indexOf(e);
}),
(a.isFor = function (t, e) {
var i = t.for && a.dependencyParse(t.for);
return !t.for || (e.name === i.name && a.versionSatisfies(e.version, i.range));
}),
(a.use = function (t, e) {
if (((t.uses = (t.uses || []).concat(e || [])), 0 !== t.uses.length)) {
for (var i, n = a.dependencies(t), s = h.topologicalSort(n), r = [], o = 0; o < s.length; o += 1)
s[o] !== t.name &&
((i = a.resolve(s[o]))
? a.isUsed(t, i.name) ||
(a.isFor(i, t) || (h.warn("Plugin.use:", a.toString(i), "is for", i.for, "but installed on", a.toString(t) + "."), (i._warned = !0)),
i.install ? i.install(t) : (h.warn("Plugin.use:", a.toString(i), "does not specify an install function."), (i._warned = !0)),
i._warned ? (r.push("🔶 " + a.toString(i)), delete i._warned) : r.push("✅ " + a.toString(i)),
t.used.push(i.name))
: r.push("⌠" + s[o]));
0 < r.length && !i.silent && h.info(r.join(" "));
} else h.warn("Plugin.use:", a.toString(t), "does not specify any dependencies to install.");
}),
(a.dependencies = function (n, t) {
var s = a.dependencyParse(n),
e = s.name;
if (!(e in (t = t || {}))) {
(n = a.resolve(n) || n),
(t[e] = h.map(n.uses || [], function (t) {
a.isPlugin(t) && a.register(t);
var e = a.dependencyParse(t),
i = a.resolve(t);
return (
i && !a.versionSatisfies(i.version, e.range)
? (h.warn("Plugin.dependencies:", a.toString(i), "does not satisfy", a.toString(e), "used by", a.toString(s) + "."), (i._warned = !0), (n._warned = !0))
: i || (h.warn("Plugin.dependencies:", a.toString(t), "used by", a.toString(s), "could not be resolved."), (n._warned = !0)),
e.name
);
}));
for (var i = 0; i < t[e].length; i += 1) a.dependencies(t[e][i], t);
return t;
}
}),
(a.dependencyParse = function (t) {
return h.isString(t)
? (/^[\w-]+(@(\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-]+)?))?$/.test(t) || h.warn("Plugin.dependencyParse:", t, "is not a valid dependency string."), { name: t.split("@")[0], range: t.split("@")[1] || "*" })
: { name: t.name, range: t.range || t.version };
}),
(a.versionParse = function (t) {
/^\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-]+)?$/.test(t) || h.warn("Plugin.versionParse:", t, "is not a valid version or range.");
var e = t.split("-");
t = e[0];
var i = isNaN(Number(t[0])),
n = i ? t.substr(1) : t,
s = h.map(n.split("."), function (t) {
return Number(t);
});
return { isRange: i, version: n, range: t, operator: i ? t[0] : "", parts: s, prerelease: e[1], number: 1e8 * s[0] + 1e4 * s[1] + s[2] };
}),
(a.versionSatisfies = function (t, e) {
e = e || "*";
var i = a.versionParse(e),
n = i.parts,
s = a.versionParse(t),
r = s.parts;
if (i.isRange) {
if ("*" === i.operator || "*" === t) return !0;
if ("~" === i.operator) return r[0] === n[0] && r[1] === n[1] && r[2] >= n[2];
if ("^" === i.operator) return 0 < n[0] ? r[0] === n[0] && s.number >= i.number : 0 < n[1] ? r[1] === n[1] && r[2] >= n[2] : r[2] === n[2];
}
return t === e || "*" === t;
});
},
function (t, e, i) {
var n = {};
t.exports = n;
var s = i(118),
r = (i(128), i(32));
n.create = function (t) {
var e = s.create();
return r.extend(e, { label: "World", gravity: { x: 0, y: 1, scale: 0.001 }, bounds: { min: { x: -1 / 0, y: -1 / 0 }, max: { x: 1 / 0, y: 1 / 0 } } }, t);
};
},
function (t, e, i) {
var m = {};
t.exports = m;
var a = i(250),
n = i(273),
r = i(32);
(m.create = function (t) {
var e = { controller: m, detector: n.collisions, buckets: {}, pairs: {}, pairsList: [], bucketWidth: 48, bucketHeight: 48 };
return r.extend(e, t);
}),
(m.update = function (t, e, i, n) {
for (var s, r, o, a = i.world, h = t.buckets, l = !1, u = i.metrics, c = (u.broadphaseTests = 0); c < e.length; c++) {
var d = e[c];
if ((!d.isSleeping || n) && !(d.bounds.max.x < a.bounds.min.x || d.bounds.min.x > a.bounds.max.x || d.bounds.max.y < a.bounds.min.y || d.bounds.min.y > a.bounds.max.y)) {
var f = m._getRegion(t, d);
if (!d.region || f.id !== d.region.id || n) {
(u.broadphaseTests += 1), (d.region && !n) || (d.region = f);
for (var p = m._regionUnion(f, d.region), g = p.startCol; g <= p.endCol; g++)
for (s = p.startRow; s <= p.endRow; s++) {
r = h[(o = m._getBucketId(g, s))];
var v = g >= f.startCol && g <= f.endCol && s >= f.startRow && s <= f.endRow,
y = g >= d.region.startCol && g <= d.region.endCol && s >= d.region.startRow && s <= d.region.endRow;
!v && y && y && r && m._bucketRemoveBody(t, r, d), (d.region === f || (v && !y) || n) && ((r = r || m._createBucket(h, o)), m._bucketAddBody(t, r, d));
}
(d.region = f), (l = !0);
}
}
}
l && (t.pairsList = m._createActivePairsList(t));
}),
(m.clear = function (t) {
(t.buckets = {}), (t.pairs = {}), (t.pairsList = []);
}),
(m._regionUnion = function (t, e) {
var i = Math.min(t.startCol, e.startCol),
n = Math.max(t.endCol, e.endCol),
s = Math.min(t.startRow, e.startRow),
r = Math.max(t.endRow, e.endRow);
return m._createRegion(i, n, s, r);
}),
(m._getRegion = function (t, e) {
var i = e.bounds,
n = Math.floor(i.min.x / t.bucketWidth),
s = Math.floor(i.max.x / t.bucketWidth),
r = Math.floor(i.min.y / t.bucketHeight),
o = Math.floor(i.max.y / t.bucketHeight);
return m._createRegion(n, s, r, o);
}),
(m._createRegion = function (t, e, i, n) {
return { id: t + "," + e + "," + i + "," + n, startCol: t, endCol: e, startRow: i, endRow: n };
}),
(m._getBucketId = function (t, e) {
return "C" + t + "R" + e;
}),
(m._createBucket = function (t, e) {
return (t[e] = []);
}),
(m._bucketAddBody = function (t, e, i) {
for (var n = 0; n < e.length; n++) {
var s,
r,
o = e[n];
i.id === o.id || (i.isStatic && o.isStatic) || ((s = a.id(i, o)), (r = t.pairs[s]) ? (r[2] += 1) : (t.pairs[s] = [i, o, 1]));
}
e.push(i);
}),
(m._bucketRemoveBody = function (t, e, i) {
e.splice(e.indexOf(i), 1);
for (var n = 0; n < e.length; n++) {
var s = e[n],
r = a.id(i, s),
o = t.pairs[r];
o && --o[2];
}
}),
(m._createActivePairsList = function (t) {
for (var e, i = [], n = r.keys(t.pairs), s = 0; s < n.length; s++) 0 < (e = t.pairs[n[s]])[2] ? i.push(e) : delete t.pairs[n[s]];
return i;
});
},
function (t, e, i) {
var l = {};
t.exports = l;
var d = i(250),
n = i(32);
(l._pairMaxIdleLife = 1e3),
(l.create = function (t) {
return n.extend({ table: {}, list: [], collisionStart: [], collisionActive: [], collisionEnd: [] }, t);
}),
(l.update = function (t, e, i) {
var n,
s,
r,
o,
a = t.list,
h = t.table,
l = t.collisionStart,
u = t.collisionEnd,
c = t.collisionActive;
for (l.length = 0, u.length = 0, o = c.length = 0; o < a.length; o++) a[o].confirmedActive = !1;
for (o = 0; o < e.length; o++)
(n = e[o]).collided && ((r = h[(s = d.id(n.bodyA, n.bodyB))]) ? (r.isActive ? c.push(r) : l.push(r), d.update(r, n, i), (r.confirmedActive = !0)) : ((r = d.create(n, i)), (h[s] = r), l.push(r), a.push(r)));
for (o = 0; o < a.length; o++) (r = a[o]).isActive && !r.confirmedActive && (d.setActive(r, !1, i), u.push(r));
}),
(l.removeOld = function (t, e) {
for (var i, n, s, r = t.list, o = t.table, a = [], h = 0; h < r.length; h++)
(n = (i = r[h]).collision).bodyA.isSleeping || n.bodyB.isSleeping ? (i.timeUpdated = e) : e - i.timeUpdated > l._pairMaxIdleLife && a.push(h);
for (h = 0; h < a.length; h++) delete o[(i = r[(s = a[h] - h)]).id], r.splice(s, 1);
}),
(l.clear = function (t) {
return (t.table = {}), (t.list.length = 0), (t.collisionStart.length = 0), (t.collisionActive.length = 0), (t.collisionEnd.length = 0), t;
});
},
function (t, e, i) {
var U = {};
t.exports = U;
var r = i(64),
Y = i(83),
z = i(32),
o = i(84);
(U._restingThresh = 4),
(U._restingThreshTangent = 6),
(U._positionDampen = 0.9),
(U._positionWarming = 0.8),
(U._frictionNormalMultiplier = 5),
(U.preSolvePosition = function (t) {
for (var e, i, n = 0; n < t.length; n++) (e = t[n]).isActive && ((i = e.activeContacts.length), (e.collision.parentA.totalContacts += i), (e.collision.parentB.totalContacts += i));
}),
(U.solvePosition = function (t, e, i) {
for (var n, s, r, o, a, h, l, u, c, d, f, p, g, v, y, m = i * U._positionDampen, x = 0; x < e.length; x++) {
var b = e[x];
(b.previousPositionImpulse.x = b.positionImpulse.x), (b.previousPositionImpulse.y = b.positionImpulse.y);
}
for (x = 0; x < t.length; x++)
(r = t[x]).isActive &&
!r.isSensor &&
((a = (o = r.collision).parentA),
(h = o.parentB),
(l = o.normal),
(d = a.previousPositionImpulse),
(f = h.previousPositionImpulse),
(c = o.penetration),
(g = f.x - d.x + c.x),
(v = f.y - d.y + c.y),
(u = (n = l.x) * g + (s = l.y) * v),
(y = ((r.separation = u) - r.slop) * m),
(a.isStatic || h.isStatic) && (y *= 2),
a.isStatic || a.isSleeping || ((p = y / a.totalContacts), (a.positionImpulse.x += n * p), (a.positionImpulse.y += s * p)),
h.isStatic || h.isSleeping || ((p = y / h.totalContacts), (h.positionImpulse.x -= n * p), (h.positionImpulse.y -= s * p)));
}),
(U.postSolvePosition = function (t) {
for (var e = 0; e < t.length; e++) {
var i = t[e];
if ((i.totalContacts = 0) !== i.positionImpulse.x || 0 !== i.positionImpulse.y) {
for (var n = 0; n < i.parts.length; n++) {
var s = i.parts[n];
r.translate(s.vertices, i.positionImpulse), o.update(s.bounds, s.vertices, i.velocity), (s.position.x += i.positionImpulse.x), (s.position.y += i.positionImpulse.y);
}
(i.positionPrev.x += i.positionImpulse.x),
(i.positionPrev.y += i.positionImpulse.y),
Y.dot(i.positionImpulse, i.velocity) < 0 ? ((i.positionImpulse.x = 0), (i.positionImpulse.y = 0)) : ((i.positionImpulse.x *= U._positionWarming), (i.positionImpulse.y *= U._positionWarming));
}
}
}),
(U.preSolveVelocity = function (t) {
for (var e, i, n, s, r, o, a, h, l, u, c, d, f, p = Y._temp[0], g = Y._temp[1], v = 0; v < t.length; v++)
if ((i = t[v]).isActive && !i.isSensor)
for (n = i.activeContacts, r = (s = i.collision).parentA, o = s.parentB, a = s.normal, h = s.tangent, e = 0; e < n.length; e++)
(u = (l = n[e]).vertex),
(c = l.normalImpulse),
(d = l.tangentImpulse),
(0 === c && 0 === d) ||
((p.x = a.x * c + h.x * d),
(p.y = a.y * c + h.y * d),
r.isStatic ||
r.isSleeping ||
((f = Y.sub(u, r.position, g)), (r.positionPrev.x += p.x * r.inverseMass), (r.positionPrev.y += p.y * r.inverseMass), (r.anglePrev += Y.cross(f, p) * r.inverseInertia)),
o.isStatic ||
o.isSleeping ||
((f = Y.sub(u, o.position, g)), (o.positionPrev.x -= p.x * o.inverseMass), (o.positionPrev.y -= p.y * o.inverseMass), (o.anglePrev -= Y.cross(f, p) * o.inverseInertia)));
}),
(U.solveVelocity = function (t, e) {
for (var i = e * e, n = Y._temp[0], s = Y._temp[1], r = Y._temp[2], o = Y._temp[3], a = Y._temp[4], h = Y._temp[5], l = 0; l < t.length; l++) {
var u = t[l];
if (u.isActive && !u.isSensor) {
var c = u.collision,
d = c.parentA,
f = c.parentB,
p = c.normal,
g = c.tangent,
v = u.activeContacts,
y = 1 / v.length;
(d.velocity.x = d.position.x - d.positionPrev.x),
(d.velocity.y = d.position.y - d.positionPrev.y),
(f.velocity.x = f.position.x - f.positionPrev.x),
(f.velocity.y = f.position.y - f.positionPrev.y),
(d.angularVelocity = d.angle - d.anglePrev),
(f.angularVelocity = f.angle - f.anglePrev);
for (var m = 0; m < v.length; m++) {
var x = v[m],
b = x.vertex,
w = Y.sub(b, d.position, s),
T = Y.sub(b, f.position, r),
S = Y.add(d.velocity, Y.mult(Y.perp(w), d.angularVelocity), o),
_ = Y.add(f.velocity, Y.mult(Y.perp(T), f.angularVelocity), a),
E = Y.sub(S, _, h),
P = Y.dot(p, E),
A = Y.dot(g, E),
M = Math.abs(A),
C = z.sign(A),
O = (1 + u.restitution) * P,
k = z.clamp(u.separation + P, 0, 1) * U._frictionNormalMultiplier,
R = A,
L = 1 / 0;
M > u.friction * u.frictionStatic * k * i && ((L = M), (R = z.clamp(u.friction * C * i, -L, L)));
var I,
D,
F = Y.cross(w, p),
B = Y.cross(T, p),
N = y / (d.inverseMass + f.inverseMass + d.inverseInertia * F * F + f.inverseInertia * B * B);
(O *= N),
(R *= N),
P < 0 && P * P > U._restingThresh * i ? (x.normalImpulse = 0) : ((I = x.normalImpulse), (x.normalImpulse = Math.min(x.normalImpulse + O, 0)), (O = x.normalImpulse - I)),
A * A > U._restingThreshTangent * i ? (x.tangentImpulse = 0) : ((D = x.tangentImpulse), (x.tangentImpulse = z.clamp(x.tangentImpulse + R, -L, L)), (R = x.tangentImpulse - D)),
(n.x = p.x * O + g.x * R),
(n.y = p.y * O + g.y * R),
d.isStatic || d.isSleeping || ((d.positionPrev.x += n.x * d.inverseMass), (d.positionPrev.y += n.y * d.inverseMass), (d.anglePrev += Y.cross(w, n) * d.inverseInertia)),
f.isStatic || f.isSleeping || ((f.positionPrev.x -= n.x * f.inverseMass), (f.positionPrev.y -= n.y * f.inverseMass), (f.anglePrev -= Y.cross(T, n) * f.inverseInertia));
}
}
}
});
},
function (t, e) {
var i = (function () {
return this;
})();
try {
i = i || new Function("return this")();
} catch (t) {
"object" == typeof window && (i = window);
}
t.exports = i;
},
function (t, e, i) {
var a = i(276);
t.exports = function (t, e, i, n) {
for (var s = t[0], r = 1; r < t.length; r++) {
var o = t[r];
a(o, s, e, i, n), (s = o);
}
return t;
};
},
function (t, e, i) {
var r = i(46);
t.exports = function (t, e, i, n, s) {
return r(t, "angle", e, i, n, s);
};
},
function (t, e) {
t.exports = function (t, e, i) {
for (var n = 0; n < t.length; n++) {
var s = t[n];
e.call(i, s);
}
return t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
void 0 === i && (i = 0);
for (var n = i; n < t.length; n++) {
var s = t[n],
r = !0;
for (var o in e) s[o] !== e[o] && (r = !1);
if (r) return s;
}
return null;
};
},
function (t, e) {
t.exports = function (t, e, i) {
void 0 === i && (i = 0);
for (var n = i; n < t.length; n++) {
var s = t[n],
r = !0;
for (var o in e) s[o] !== e[o] && (r = !1);
if (r) return s;
}
return null;
};
},
function (t, e, i) {
var v = i(289),
y = i(123),
m = i(2),
n = i(1),
x = new (i(129))({ sys: { queueDepthSort: n, events: { once: n } } }, 0, 0, 1, 1);
t.exports = function (t, e) {
void 0 === e && (e = {});
var i = e.hasOwnProperty("width"),
n = e.hasOwnProperty("height"),
s = m(e, "width", -1),
r = m(e, "height", -1),
o = m(e, "cellWidth", 1),
a = m(e, "cellHeight", o),
h = m(e, "position", y.TOP_LEFT),
l = m(e, "x", 0),
u = m(e, "y", 0),
c = 0,
d = 0,
f = s * o,
p = r * a;
x.setPosition(l, u), x.setSize(o, a);
for (var g = 0; g < t.length; g++)
if ((v(t[g], x, h), i && -1 === s)) x.x += o;
else if (n && -1 === r) x.y += a;
else if (n && !i) {
if (((d += a), (x.y += a), d === p && ((d = 0), (c += o), (x.y = u), (x.x += o), c === f))) break;
} else if (((c += o), (x.x += o), c === f && ((c = 0), (d += a), (x.x = l), (x.y += a), d === p))) break;
return t;
};
},
function (t, e, i) {
var s = i(18),
n = {
_alpha: 1,
_alphaTL: 1,
_alphaTR: 1,
_alphaBL: 1,
_alphaBR: 1,
clearAlpha: function () {
return this.setAlpha(1);
},
setAlpha: function (t, e, i, n) {
return void 0 === t && (t = 1), void 0 === e ? (this.alpha = t) : ((this._alphaTL = s(t, 0, 1)), (this._alphaTR = s(e, 0, 1)), (this._alphaBL = s(i, 0, 1)), (this._alphaBR = s(n, 0, 1))), this;
},
alpha: {
get: function () {
return this._alpha;
},
set: function (t) {
var e = s(t, 0, 1);
(this._alpha = e), (this._alphaTL = e), (this._alphaTR = e), (this._alphaBL = e), 0 === (this._alphaBR = e) ? (this.renderFlags &= -3) : (this.renderFlags |= 2);
},
},
alphaTopLeft: {
get: function () {
return this._alphaTL;
},
set: function (t) {
var e = s(t, 0, 1);
0 !== (this._alphaTL = e) && (this.renderFlags |= 2);
},
},
alphaTopRight: {
get: function () {
return this._alphaTR;
},
set: function (t) {
var e = s(t, 0, 1);
0 !== (this._alphaTR = e) && (this.renderFlags |= 2);
},
},
alphaBottomLeft: {
get: function () {
return this._alphaBL;
},
set: function (t) {
var e = s(t, 0, 1);
0 !== (this._alphaBL = e) && (this.renderFlags |= 2);
},
},
alphaBottomRight: {
get: function () {
return this._alphaBR;
},
set: function (t) {
var e = s(t, 0, 1);
0 !== (this._alphaBR = e) && (this.renderFlags |= 2);
},
},
};
t.exports = n;
},
function (t, e) {
t.exports = {
width: 0,
height: 0,
displayWidth: {
get: function () {
return this.scaleX * this.width;
},
set: function (t) {
this.scaleX = t / this.width;
},
},
displayHeight: {
get: function () {
return this.scaleY * this.height;
},
set: function (t) {
this.scaleY = t / this.height;
},
},
setSize: function (t, e) {
return (this.width = t), (this.height = e), this;
},
setDisplaySize: function (t, e) {
return (this.displayWidth = t), (this.displayHeight = e), this;
},
};
},
function (t, e) {
t.exports = {
texture: null,
frame: null,
isCropped: !1,
setCrop: function (t, e, i, n) {
return (
void 0 === t
? (this.isCropped = !1)
: this.frame &&
("number" == typeof t ? this.frame.setCropUVs(this._crop, t, e, i, n, this.flipX, this.flipY) : this.frame.setCropUVs(this._crop, t.x, t.y, t.width, t.height, this.flipX, this.flipY),
(this.isCropped = !0)),
this
);
},
resetCropObject: function () {
return { u0: 0, v0: 0, u1: 0, v1: 0, width: 0, height: 0, x: 0, y: 0, flipX: !1, flipY: !1, cx: 0, cy: 0, cw: 0, ch: 0 };
},
};
},
function (t, e) {
t.exports = {
flipX: !1,
flipY: !1,
toggleFlipX: function () {
return (this.flipX = !this.flipX), this;
},
toggleFlipY: function () {
return (this.flipY = !this.flipY), this;
},
setFlipX: function (t) {
return (this.flipX = t), this;
},
setFlipY: function (t) {
return (this.flipY = t), this;
},
setFlip: function (t, e) {
return (this.flipX = t), (this.flipY = e), this;
},
resetFlip: function () {
return (this.flipX = !1), (this.flipY = !1), this;
},
};
},
function (t, e, i) {
var u = i(10),
n = i(308),
s = i(3),
r = {
prepareBoundsOutput: function (t, e) {
return void 0 === e && (e = !1), 0 !== this.rotation && n(t, this.x, this.y, this.rotation), e && this.parentContainer && this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x, t.y, t), t;
},
getCenter: function (t) {
return void 0 === t && (t = new s()), (t.x = this.x - this.displayWidth * this.originX + this.displayWidth / 2), (t.y = this.y - this.displayHeight * this.originY + this.displayHeight / 2), t;
},
getTopLeft: function (t, e) {
return ((t = t || new s()).x = this.x - this.displayWidth * this.originX), (t.y = this.y - this.displayHeight * this.originY), this.prepareBoundsOutput(t, e);
},
getTopCenter: function (t, e) {
return ((t = t || new s()).x = this.x - this.displayWidth * this.originX + this.displayWidth / 2), (t.y = this.y - this.displayHeight * this.originY), this.prepareBoundsOutput(t, e);
},
getTopRight: function (t, e) {
return ((t = t || new s()).x = this.x - this.displayWidth * this.originX + this.displayWidth), (t.y = this.y - this.displayHeight * this.originY), this.prepareBoundsOutput(t, e);
},
getLeftCenter: function (t, e) {
return ((t = t || new s()).x = this.x - this.displayWidth * this.originX), (t.y = this.y - this.displayHeight * this.originY + this.displayHeight / 2), this.prepareBoundsOutput(t, e);
},
getRightCenter: function (t, e) {
return ((t = t || new s()).x = this.x - this.displayWidth * this.originX + this.displayWidth), (t.y = this.y - this.displayHeight * this.originY + this.displayHeight / 2), this.prepareBoundsOutput(t, e);
},
getBottomLeft: function (t, e) {
return ((t = t || new s()).x = this.x - this.displayWidth * this.originX), (t.y = this.y - this.displayHeight * this.originY + this.displayHeight), this.prepareBoundsOutput(t, e);
},
getBottomCenter: function (t, e) {
return ((t = t || new s()).x = this.x - this.displayWidth * this.originX + this.displayWidth / 2), (t.y = this.y - this.displayHeight * this.originY + this.displayHeight), this.prepareBoundsOutput(t, e);
},
getBottomRight: function (t, e) {
return ((t = t || new s()).x = this.x - this.displayWidth * this.originX + this.displayWidth), (t.y = this.y - this.displayHeight * this.originY + this.displayHeight), this.prepareBoundsOutput(t, e);
},
getBounds: function (t) {
var e, i, n, s, r, o, a, h, l;
return (
void 0 === t && (t = new u()),
this.parentContainer
? ((l = this.parentContainer.getBoundsTransformMatrix()),
this.getTopLeft(t),
l.transformPoint(t.x, t.y, t),
(e = t.x),
(i = t.y),
this.getTopRight(t),
l.transformPoint(t.x, t.y, t),
(n = t.x),
(s = t.y),
this.getBottomLeft(t),
l.transformPoint(t.x, t.y, t),
(r = t.x),
(o = t.y),
this.getBottomRight(t),
l.transformPoint(t.x, t.y, t))
: (this.getTopLeft(t), (e = t.x), (i = t.y), this.getTopRight(t), (n = t.x), (s = t.y), this.getBottomLeft(t), (r = t.x), (o = t.y), this.getBottomRight(t)),
(a = t.x),
(h = t.y),
(t.x = Math.min(e, n, r, a)),
(t.y = Math.min(i, s, o, h)),
(t.width = Math.max(e, n, r, a) - t.x),
(t.height = Math.max(i, s, o, h) - t.y),
t
);
},
};
t.exports = r;
},
function (t, e) {
t.exports = "blur";
},
function (t, e) {
t.exports = "boot";
},
function (t, e) {
t.exports = "contextlost";
},
function (t, e) {
t.exports = "contextrestored";
},
function (t, e) {
t.exports = "destroy";
},
function (t, e) {
t.exports = "focus";
},
function (t, e) {
t.exports = "hidden";
},
function (t, e) {
t.exports = "pause";
},
function (t, e) {
t.exports = "postrender";
},
function (t, e) {
t.exports = "poststep";
},
function (t, e) {
t.exports = "prerender";
},
function (t, e) {
t.exports = "prestep";
},
function (t, e) {
t.exports = "ready";
},
function (t, e) {
t.exports = "resume";
},
function (t, e) {
t.exports = "step";
},
function (t, e) {
t.exports = "visible";
},
function (t, e) {
t.exports = "postrender";
},
function (t, e) {
t.exports = "prerender";
},
function (t, e) {
t.exports = "render";
},
function (t, e) {
t.exports = "resize";
},
function (t, e) {
t.exports = {
_originComponent: !0,
originX: 0.5,
originY: 0.5,
_displayOriginX: 0,
_displayOriginY: 0,
displayOriginX: {
get: function () {
return this._displayOriginX;
},
set: function (t) {
(this._displayOriginX = t), (this.originX = t / this.width);
},
},
displayOriginY: {
get: function () {
return this._displayOriginY;
},
set: function (t) {
(this._displayOriginY = t), (this.originY = t / this.height);
},
},
setOrigin: function (t, e) {
return void 0 === t && (t = 0.5), void 0 === e && (e = t), (this.originX = t), (this.originY = e), this.updateDisplayOrigin();
},
setOriginFromFrame: function () {
return this.frame && this.frame.customPivot ? ((this.originX = this.frame.pivotX), (this.originY = this.frame.pivotY), this.updateDisplayOrigin()) : this.setOrigin();
},
setDisplayOrigin: function (t, e) {
return void 0 === t && (t = 0), void 0 === e && (e = t), (this.displayOriginX = t), (this.displayOriginY = e), this;
},
updateDisplayOrigin: function () {
return (this._displayOriginX = this.originX * this.width), (this._displayOriginY = this.originY * this.height), this;
},
};
},
function (t, e, i) {
var h = i(36),
o = i(99),
a = i(6),
l = i(100),
u = i(3),
n = {
path: null,
rotateToPath: !1,
pathRotationOffset: 0,
pathOffset: null,
pathVector: null,
pathDelta: null,
pathTween: null,
pathConfig: null,
_prevDirection: l.PLAYING_FORWARD,
setPath: function (t, e) {
void 0 === e && (e = this.pathConfig);
var i = this.pathTween;
return i && i.isPlaying() && i.stop(), (this.path = t), e && this.startFollow(e), this;
},
setRotateToPath: function (t, e) {
return void 0 === e && (e = 0), (this.rotateToPath = t), (this.pathRotationOffset = e), this;
},
isFollowing: function () {
var t = this.pathTween;
return t && t.isPlaying();
},
startFollow: function (t, e) {
void 0 === t && (t = {}), void 0 === e && (e = 0);
var i = this.pathTween;
i && i.isPlaying() && i.stop(), "number" == typeof t && (t = { duration: t }), (t.from = a(t, "from", 0)), (t.to = a(t, "to", 1));
var n = o(t, "positionOnPath", !1);
(this.rotateToPath = o(t, "rotateToPath", !1)), (this.pathRotationOffset = a(t, "rotationOffset", 0));
var s,
r = a(t, "startAt", e);
return (
r &&
(t.onStart = function (t) {
var e = t.data[0];
(e.progress = r), (e.elapsed = e.duration * r);
var i = e.ease(e.progress);
(e.current = e.start + (e.end - e.start) * i), (e.target[e.key] = e.current);
}),
this.pathOffset || (this.pathOffset = new u(this.x, this.y)),
this.pathVector || (this.pathVector = new u()),
this.pathDelta || (this.pathDelta = new u()),
this.pathDelta.reset(),
(this.pathTween = this.scene.sys.tweens.addCounter(t)),
this.path.getStartPoint(this.pathOffset),
n && ((this.x = this.pathOffset.x), (this.y = this.pathOffset.y)),
(this.pathOffset.x = this.x - this.pathOffset.x),
(this.pathOffset.y = this.y - this.pathOffset.y),
(this._prevDirection = l.PLAYING_FORWARD),
this.rotateToPath && ((s = this.path.getPoint(0.1)), (this.rotation = Math.atan2(s.y - this.y, s.x - this.x) + h(this.pathRotationOffset))),
(this.pathConfig = t),
this
);
},
pauseFollow: function () {
var t = this.pathTween;
return t && t.isPlaying() && t.pause(), this;
},
resumeFollow: function () {
var t = this.pathTween;
return t && t.isPaused() && t.resume(), this;
},
stopFollow: function () {
var t = this.pathTween;
return t && t.isPlaying() && t.stop(), this;
},
pathUpdate: function () {
var t = this.pathTween;
if (t) {
var e = t.data[0],
i = this.pathDelta,
n = this.pathVector;
if ((i.copy(n).negate(), e.state === l.COMPLETE)) return this.path.getPoint(1, n), i.add(n), n.add(this.pathOffset), void this.setPosition(n.x, n.y);
if (e.state !== l.PLAYING_FORWARD && e.state !== l.PLAYING_BACKWARD) return;
this.path.getPoint(t.getValue(), n), i.add(n), n.add(this.pathOffset);
var s = this.x,
r = this.y;
this.setPosition(n.x, n.y);
var o = this.x - s,
a = this.y - r;
if (0 == o && 0 == a) return;
if (e.state !== this._prevDirection) return void (this._prevDirection = e.state);
this.rotateToPath && (this.rotation = Math.atan2(a, o) + h(this.pathRotationOffset));
}
},
};
t.exports = n;
},
function (t, e) {
var i = {
_sizeComponent: !0,
width: 0,
height: 0,
displayWidth: {
get: function () {
return Math.abs(this.scaleX * this.frame.realWidth);
},
set: function (t) {
this.scaleX = t / this.frame.realWidth;
},
},
displayHeight: {
get: function () {
return Math.abs(this.scaleY * this.frame.realHeight);
},
set: function (t) {
this.scaleY = t / this.frame.realHeight;
},
},
setSizeToFrame: function (t) {
return void 0 === t && (t = this.frame), (this.width = t.realWidth), (this.height = t.realHeight), this;
},
setSize: function (t, e) {
return (this.width = t), (this.height = e), this;
},
setDisplaySize: function (t, e) {
return (this.displayWidth = t), (this.displayHeight = e), this;
},
};
t.exports = i;
},
function (t, e) {
t.exports = {
texture: null,
frame: null,
isCropped: !1,
setTexture: function (t, e) {
return (this.texture = this.scene.sys.textures.get(t)), this.setFrame(e);
},
setFrame: function (t, e, i) {
return (
void 0 === e && (e = !0),
void 0 === i && (i = !0),
(this.frame = this.texture.get(t)),
this.frame.cutWidth && this.frame.cutHeight ? (this.renderFlags |= 8) : (this.renderFlags &= -9),
this._sizeComponent && e && this.setSizeToFrame(),
this._originComponent && i && (this.frame.customPivot ? this.setOrigin(this.frame.pivotX, this.frame.pivotY) : this.updateDisplayOrigin()),
this
);
},
};
},
function (t, e) {
t.exports = {
texture: null,
frame: null,
isCropped: !1,
setCrop: function (t, e, i, n) {
return (
void 0 === t
? (this.isCropped = !1)
: this.frame &&
("number" == typeof t ? this.frame.setCropUVs(this._crop, t, e, i, n, this.flipX, this.flipY) : this.frame.setCropUVs(this._crop, t.x, t.y, t.width, t.height, this.flipX, this.flipY),
(this.isCropped = !0)),
this
);
},
setTexture: function (t, e) {
return (this.texture = this.scene.sys.textures.get(t)), this.setFrame(e);
},
setFrame: function (t, e, i) {
return (
void 0 === e && (e = !0),
void 0 === i && (i = !0),
(this.frame = this.texture.get(t)),
this.frame.cutWidth && this.frame.cutHeight ? (this.renderFlags |= 8) : (this.renderFlags &= -9),
this._sizeComponent && e && this.setSizeToFrame(),
this._originComponent && i && (this.frame.customPivot ? this.setOrigin(this.frame.pivotX, this.frame.pivotY) : this.updateDisplayOrigin()),
this.isCropped && this.frame.updateCropUVs(this._crop, this.flipX, this.flipY),
this
);
},
resetCropObject: function () {
return { u0: 0, v0: 0, u1: 0, v1: 0, width: 0, height: 0, x: 0, y: 0, flipX: !1, flipY: !1, cx: 0, cy: 0, cw: 0, ch: 0 };
},
};
},
function (t, e) {
t.exports = {
tintTopLeft: 16777215,
tintTopRight: 16777215,
tintBottomLeft: 16777215,
tintBottomRight: 16777215,
tintFill: !1,
clearTint: function () {
return this.setTint(16777215), this;
},
setTint: function (t, e, i, n) {
return void 0 === t && (t = 16777215), void 0 === e && (n = i = e = t), (this.tintTopLeft = t), (this.tintTopRight = e), (this.tintBottomLeft = i), (this.tintBottomRight = n), (this.tintFill = !1), this;
},
setTintFill: function (t, e, i, n) {
return this.setTint(t, e, i, n), (this.tintFill = !0), this;
},
tint: {
set: function (t) {
this.setTint(t, t, t, t);
},
},
isTinted: {
get: function () {
var t = 16777215;
return this.tintFill || this.tintTopLeft !== t || this.tintTopRight !== t || this.tintBottomLeft !== t || this.tintBottomRight !== t;
},
},
};
},
function (t, e) {
t.exports = "changedata";
},
function (t, e) {
t.exports = "changedata-";
},
function (t, e) {
t.exports = "destroy";
},
function (t, e) {
t.exports = "removedata";
},
function (t, e) {
t.exports = "setdata";
},
function (t, e) {
t.exports = "addedtoscene";
},
function (t, e) {
t.exports = "destroy";
},
function (t, e) {
t.exports = "removedfromscene";
},
function (t, e) {
t.exports = "complete";
},
function (t, e) {
t.exports = "created";
},
function (t, e) {
t.exports = "error";
},
function (t, e) {
t.exports = "loop";
},
function (t, e) {
t.exports = "play";
},
function (t, e) {
t.exports = "seeked";
},
function (t, e) {
t.exports = "seeking";
},
function (t, e) {
t.exports = "stop";
},
function (t, e) {
t.exports = "timeout";
},
function (t, e) {
t.exports = "unlocked";
},
function (t, e) {
t.exports = "addedtoscene";
},
function (t, e) {
t.exports = "boot";
},
function (t, e) {
t.exports = "create";
},
function (t, e) {
t.exports = "destroy";
},
function (t, e) {
t.exports = "pause";
},
function (t, e) {
t.exports = "postupdate";
},
function (t, e) {
t.exports = "prerender";
},
function (t, e) {
t.exports = "preupdate";
},
function (t, e) {
t.exports = "ready";
},
function (t, e) {
t.exports = "removedfromscene";
},
function (t, e) {
t.exports = "render";
},
function (t, e) {
t.exports = "resume";
},
function (t, e) {
t.exports = "shutdown";
},
function (t, e) {
t.exports = "sleep";
},
function (t, e) {
t.exports = "start";
},
function (t, e) {
t.exports = "transitioncomplete";
},
function (t, e) {
t.exports = "transitioninit";
},
function (t, e) {
t.exports = "transitionout";
},
function (t, e) {
t.exports = "transitionstart";
},
function (t, e) {
t.exports = "transitionwake";
},
function (t, e) {
t.exports = "update";
},
function (t, e) {
t.exports = "wake";
},
function (t, e, i) {
var r = i(46);
t.exports = function (t, e, i, n, s) {
return r(t, "alpha", e, i, n, s);
};
},
function (t, e, i) {
var r = i(46);
t.exports = function (t, e, i, n, s) {
return r(t, "x", e, i, n, s);
};
},
function (t, e, i) {
var a = i(46);
t.exports = function (t, e, i, n, s, r, o) {
return null == i && (i = e), a(t, "x", e, n, r, o), a(t, "y", i, s, r, o);
};
},
function (t, e, i) {
var r = i(46);
t.exports = function (t, e, i, n, s) {
return r(t, "y", e, i, n, s);
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
void 0 === i && (i = 0), void 0 === n && (n = 6.28);
for (var s = i, r = (n - i) / t.length, o = 0; o < t.length; o++) (t[o].x = e.x + e.radius * Math.cos(s)), (t[o].y = e.y + e.radius * Math.sin(s)), (s += r);
return t;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
void 0 === i && (i = 0), void 0 === n && (n = 6.28);
for (var s = i, r = (n - i) / t.length, o = e.width / 2, a = e.height / 2, h = 0; h < t.length; h++) (t[h].x = e.x + o * Math.cos(s)), (t[h].y = e.y + a * Math.sin(s)), (s += r);
return t;
};
},
function (t, e, i) {
var o = i(172);
t.exports = function (t, e) {
for (var i = o(e, t.length), n = 0; n < t.length; n++) {
var s = t[n],
r = i[n];
(s.x = r.x), (s.y = r.y);
}
return t;
};
},
function (t, e, i) {
var r = i(316),
o = i(178),
a = i(179);
t.exports = function (t, e, i) {
void 0 === i && (i = 0);
var n = r(e, !1, t.length);
0 < i ? o(n, i) : i < 0 && a(n, Math.abs(i));
for (var s = 0; s < t.length; s++) (t[s].x = n[s].x), (t[s].y = n[s].y);
return t;
};
},
function (t, e, i) {
var c = i(317);
t.exports = function (t, e, i) {
var n = c({ x1: e.x1, y1: e.y1, x2: e.x2, y2: e.y2 }, i),
s = c({ x1: e.x2, y1: e.y2, x2: e.x3, y2: e.y3 }, i),
r = c({ x1: e.x3, y1: e.y3, x2: e.x1, y2: e.y1 }, i);
n.pop(), s.pop(), r.pop();
for (var o = (n = n.concat(s, r)).length / t.length, a = 0, h = 0; h < t.length; h++) {
var l = t[h],
u = n[Math.floor(a)];
(l.x = u.x), (l.y = u.y), (a += o);
}
return t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
for (var n = 0; n < t.length; n++) {
var s = t[n];
s.anims && s.anims.play(e, i);
}
return t;
};
},
function (t, e, i) {
var n = i(170);
t.exports = function (t, e) {
for (var i = 0; i < t.length; i++) n(e, t[i]);
return t;
};
},
function (t, e, i) {
var n = i(180);
t.exports = function (t, e) {
for (var i = 0; i < t.length; i++) n(e, t[i]);
return t;
};
},
function (t, e, i) {
var n = i(173);
t.exports = function (t, e) {
for (var i = 0; i < t.length; i++) n(e, t[i]);
return t;
};
},
function (t, e, i) {
var n = i(174);
t.exports = function (t, e) {
for (var i = 0; i < t.length; i++) n(e, t[i]);
return t;
};
},
function (t, e, i) {
var n = i(181);
t.exports = function (t, e) {
for (var i = 0; i < t.length; i++) n(e, t[i]);
return t;
};
},
function (t, e, i) {
var r = i(46);
t.exports = function (t, e, i, n, s) {
return r(t, "rotation", e, i, n, s);
};
},
function (t, e, i) {
var a = i(182),
h = i(50);
t.exports = function (t, e, i) {
for (var n = e.x, s = e.y, r = 0; r < t.length; r++) {
var o = t[r];
a(o, n, s, i, Math.max(1, h(o.x, o.y, n, s)));
}
return t;
};
},
function (t, e, i) {
var a = i(182);
t.exports = function (t, e, i, n) {
var s = e.x,
r = e.y;
if (0 === n) return t;
for (var o = 0; o < t.length; o++) a(t[o], s, r, i, n);
return t;
};
},
function (t, e, i) {
var r = i(46);
t.exports = function (t, e, i, n, s) {
return r(t, "scaleX", e, i, n, s);
};
},
function (t, e, i) {
var a = i(46);
t.exports = function (t, e, i, n, s, r, o) {
return null == i && (i = e), a(t, "scaleX", e, n, r, o), a(t, "scaleY", i, s, r, o);
};
},
function (t, e, i) {
var r = i(46);
t.exports = function (t, e, i, n, s) {
return r(t, "scaleY", e, i, n, s);
};
},
function (t, e, i) {
var r = i(27);
t.exports = function (t, e, i, n, s) {
return r(t, "alpha", e, i, n, s);
};
},
function (t, e, i) {
var s = i(27);
t.exports = function (t, e, i, n) {
return s(t, "blendMode", e, 0, i, n);
};
},
function (t, e, i) {
var r = i(27);
t.exports = function (t, e, i, n, s) {
return r(t, "depth", e, i, n, s);
};
},
function (t, e) {
t.exports = function (t, e, i) {
for (var n = 0; n < t.length; n++) t[n].setInteractive(e, i);
return t;
};
},
function (t, e, i) {
var a = i(27);
t.exports = function (t, e, i, n, s, r, o) {
return (
null == i && (i = e),
a(t, "originX", e, n, r, o),
a(t, "originY", i, s, r, o),
t.forEach(function (t) {
t.updateDisplayOrigin();
}),
t
);
};
},
function (t, e, i) {
var r = i(27);
t.exports = function (t, e, i, n, s) {
return r(t, "rotation", e, i, n, s);
};
},
function (t, e, i) {
var a = i(27);
t.exports = function (t, e, i, n, s, r, o) {
return null == i && (i = e), a(t, "scaleX", e, n, r, o), a(t, "scaleY", i, s, r, o);
};
},
function (t, e, i) {
var r = i(27);
t.exports = function (t, e, i, n, s) {
return r(t, "scaleX", e, i, n, s);
};
},
function (t, e, i) {
var r = i(27);
t.exports = function (t, e, i, n, s) {
return r(t, "scaleY", e, i, n, s);
};
},
function (t, e, i) {
var a = i(27);
t.exports = function (t, e, i, n, s, r, o) {
return null == i && (i = e), a(t, "scrollFactorX", e, n, r, o), a(t, "scrollFactorY", i, s, r, o);
};
},
function (t, e, i) {
var r = i(27);
t.exports = function (t, e, i, n, s) {
return r(t, "scrollFactorX", e, i, n, s);
};
},
function (t, e, i) {
var r = i(27);
t.exports = function (t, e, i, n, s) {
return r(t, "scrollFactorY", e, i, n, s);
};
},
function (t, e) {
t.exports = function (t, e, i, n, s) {
for (var r = 0; r < t.length; r++) t[r].setTint(e, i, n, s);
return t;
};
},
function (t, e, i) {
var s = i(27);
t.exports = function (t, e, i, n) {
return s(t, "visible", e, 0, i, n);
};
},
function (t, e, i) {
var r = i(27);
t.exports = function (t, e, i, n, s) {
return r(t, "x", e, i, n, s);
};
},
function (t, e, i) {
var a = i(27);
t.exports = function (t, e, i, n, s, r, o) {
return null == i && (i = e), a(t, "x", e, n, r, o), a(t, "y", i, s, r, o);
};
},
function (t, e, i) {
var r = i(27);
t.exports = function (t, e, i, n, s) {
return r(t, "y", e, i, n, s);
};
},
function (t, e, i) {
var d = i(3);
t.exports = function (t, e, i, n, s) {
var r, o, a;
if ((void 0 === n && (n = 0), void 0 === s && (s = new d()), 1 < t.length))
if (0 === n) {
for (var h = t.length - 1, l = t[h].x, u = t[h].y, c = h - 1; 0 <= c; c--) (r = (a = t[c]).x), (o = a.y), (a.x = l), (a.y = u), (l = r), (u = o);
(t[h].x = e), (t[h].y = i);
} else {
for (l = t[0].x, u = t[0].y, c = 1; c < t.length; c++) (r = (a = t[c]).x), (o = a.y), (a.x = l), (a.y = u), (l = r), (u = o);
(t[0].x = e), (t[0].y = i);
}
else (l = t[0].x), (u = t[0].y), (t[0].x = e), (t[0].y = i);
return (s.x = l), (s.y = u), s;
};
},
function (t, e, i) {
var n = i(131);
t.exports = function (t) {
return n(t);
};
},
function (t, e, i) {
var a = i(183);
t.exports = function (t, e, i, n, s) {
void 0 === s && (s = !1);
var r,
o = Math.abs(n - i) / t.length;
if (s) for (r = 0; r < t.length; r++) t[r][e] += a(r * o, i, n);
else for (r = 0; r < t.length; r++) t[r][e] = a(r * o, i, n);
return t;
};
},
function (t, e, i) {
var a = i(184);
t.exports = function (t, e, i, n, s) {
void 0 === s && (s = !1);
var r,
o = Math.abs(n - i) / t.length;
if (s) for (r = 0; r < t.length; r++) t[r][e] += a(r * o, i, n);
else for (r = 0; r < t.length; r++) t[r][e] = a(r * o, i, n);
return t;
};
},
function (t, e) {
t.exports = function (t, e, i, n, s) {
void 0 === s && (s = !1);
var r,
o = Math.abs(n - i) / t.length;
if (s) for (r = 0; r < t.length; r++) t[r][e] += r * o + i;
else for (r = 0; r < t.length; r++) t[r][e] = r * o + i;
return t;
};
},
function (t, e) {
t.exports = function (t) {
for (var e = 0; e < t.length; e++) t[e].visible = !t[e].visible;
return t;
};
},
function (t, e, i) {
var r = i(68);
t.exports = function (t, e, i) {
void 0 === i && (i = 0);
for (var n = 0; n < t.length; n++) {
var s = t[n];
(s.x = r(s.x, e.left - i, e.right + i)), (s.y = r(s.y, e.top - i, e.bottom + i));
}
return t;
};
},
function (t, e, i) {
t.exports = { Animation: i(185), AnimationFrame: i(319), AnimationManager: i(321), AnimationState: i(164), Events: i(132) };
},
function (t, e) {
t.exports = "add";
},
function (t, e) {
t.exports = "animationcomplete";
},
function (t, e) {
t.exports = "animationcomplete-";
},
function (t, e) {
t.exports = "animationrepeat";
},
function (t, e) {
t.exports = "animationrestart";
},
function (t, e) {
t.exports = "animationstart";
},
function (t, e) {
t.exports = "animationstop";
},
function (t, e) {
t.exports = "animationupdate";
},
function (t, e) {
t.exports = "pauseall";
},
function (t, e) {
t.exports = "remove";
},
function (t, e) {
t.exports = "resumeall";
},
function (t, e, i) {
t.exports = { BaseCache: i(323), CacheManager: i(325), Events: i(324) };
},
function (t, e) {
t.exports = "add";
},
function (t, e) {
t.exports = "remove";
},
function (t, e, i) {
t.exports = { Controls: i(739), Scene2D: i(742) };
},
function (t, e, i) {
t.exports = { FixedKeyControl: i(740), SmoothedKeyControl: i(741) };
},
function (t, e, i) {
var n = i(0),
s = i(6),
r = new n({
initialize: function (t) {
(this.camera = s(t, "camera", null)),
(this.left = s(t, "left", null)),
(this.right = s(t, "right", null)),
(this.up = s(t, "up", null)),
(this.down = s(t, "down", null)),
(this.zoomIn = s(t, "zoomIn", null)),
(this.zoomOut = s(t, "zoomOut", null)),
(this.zoomSpeed = s(t, "zoomSpeed", 0.01)),
(this.minZoom = s(t, "minZoom", 0.001)),
(this.maxZoom = s(t, "maxZoom", 1e3)),
(this.speedX = 0),
(this.speedY = 0);
var e = s(t, "speed", null);
"number" == typeof e ? ((this.speedX = e), (this.speedY = e)) : ((this.speedX = s(t, "speed.x", 0)), (this.speedY = s(t, "speed.y", 0))), (this._zoom = 0), (this.active = null !== this.camera);
},
start: function () {
return (this.active = null !== this.camera), this;
},
stop: function () {
return (this.active = !1), this;
},
setCamera: function (t) {
return (this.camera = t), this;
},
update: function (t) {
var e;
this.active &&
(void 0 === t && (t = 1),
(e = this.camera),
this.up && this.up.isDown ? (e.scrollY -= (this.speedY * t) | 0) : this.down && this.down.isDown && (e.scrollY += (this.speedY * t) | 0),
this.left && this.left.isDown ? (e.scrollX -= (this.speedX * t) | 0) : this.right && this.right.isDown && (e.scrollX += (this.speedX * t) | 0),
this.zoomIn && this.zoomIn.isDown
? ((e.zoom -= this.zoomSpeed), e.zoom < this.minZoom && (e.zoom = this.minZoom))
: this.zoomOut && this.zoomOut.isDown && ((e.zoom += this.zoomSpeed), e.zoom > this.maxZoom && (e.zoom = this.maxZoom)));
},
destroy: function () {
(this.camera = null), (this.left = null), (this.right = null), (this.up = null), (this.down = null), (this.zoomIn = null), (this.zoomOut = null);
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(0),
s = i(6),
r = new n({
initialize: function (t) {
(this.camera = s(t, "camera", null)),
(this.left = s(t, "left", null)),
(this.right = s(t, "right", null)),
(this.up = s(t, "up", null)),
(this.down = s(t, "down", null)),
(this.zoomIn = s(t, "zoomIn", null)),
(this.zoomOut = s(t, "zoomOut", null)),
(this.zoomSpeed = s(t, "zoomSpeed", 0.01)),
(this.minZoom = s(t, "minZoom", 0.001)),
(this.maxZoom = s(t, "maxZoom", 1e3)),
(this.accelX = 0),
(this.accelY = 0);
var e = s(t, "acceleration", null);
"number" == typeof e ? ((this.accelX = e), (this.accelY = e)) : ((this.accelX = s(t, "acceleration.x", 0)), (this.accelY = s(t, "acceleration.y", 0))), (this.dragX = 0), (this.dragY = 0);
var i = s(t, "drag", null);
"number" == typeof i ? ((this.dragX = i), (this.dragY = i)) : ((this.dragX = s(t, "drag.x", 0)), (this.dragY = s(t, "drag.y", 0))), (this.maxSpeedX = 0), (this.maxSpeedY = 0);
var n = s(t, "maxSpeed", null);
"number" == typeof n ? ((this.maxSpeedX = n), (this.maxSpeedY = n)) : ((this.maxSpeedX = s(t, "maxSpeed.x", 0)), (this.maxSpeedY = s(t, "maxSpeed.y", 0))),
(this._speedX = 0),
(this._speedY = 0),
(this._zoom = 0),
(this.active = null !== this.camera);
},
start: function () {
return (this.active = null !== this.camera), this;
},
stop: function () {
return (this.active = !1), this;
},
setCamera: function (t) {
return (this.camera = t), this;
},
update: function (t) {
var e;
this.active &&
(void 0 === t && (t = 1),
(e = this.camera),
0 < this._speedX ? ((this._speedX -= this.dragX * t), this._speedX < 0 && (this._speedX = 0)) : this._speedX < 0 && ((this._speedX += this.dragX * t), 0 < this._speedX && (this._speedX = 0)),
0 < this._speedY ? ((this._speedY -= this.dragY * t), this._speedY < 0 && (this._speedY = 0)) : this._speedY < 0 && ((this._speedY += this.dragY * t), 0 < this._speedY && (this._speedY = 0)),
this.up && this.up.isDown
? ((this._speedY += this.accelY), this._speedY > this.maxSpeedY && (this._speedY = this.maxSpeedY))
: this.down && this.down.isDown && ((this._speedY -= this.accelY), this._speedY < -this.maxSpeedY && (this._speedY = -this.maxSpeedY)),
this.left && this.left.isDown
? ((this._speedX += this.accelX), this._speedX > this.maxSpeedX && (this._speedX = this.maxSpeedX))
: this.right && this.right.isDown && ((this._speedX -= this.accelX), this._speedX < -this.maxSpeedX && (this._speedX = -this.maxSpeedX)),
this.zoomIn && this.zoomIn.isDown ? (this._zoom = -this.zoomSpeed) : this.zoomOut && this.zoomOut.isDown ? (this._zoom = this.zoomSpeed) : (this._zoom = 0),
0 !== this._speedX && (e.scrollX -= (this._speedX * t) | 0),
0 !== this._speedY && (e.scrollY -= (this._speedY * t) | 0),
0 !== this._zoom && ((e.zoom += this._zoom), e.zoom < this.minZoom ? (e.zoom = this.minZoom) : e.zoom > this.maxZoom && (e.zoom = this.maxZoom)));
},
destroy: function () {
(this.camera = null), (this.left = null), (this.right = null), (this.up = null), (this.down = null), (this.zoomIn = null), (this.zoomOut = null);
},
});
t.exports = r;
},
function (t, e, i) {
t.exports = { Camera: i(326), BaseCamera: i(133), CameraManager: i(799), Effects: i(333), Events: i(37) };
},
function (t, e) {
t.exports = "cameradestroy";
},
function (t, e) {
t.exports = "camerafadeincomplete";
},
function (t, e) {
t.exports = "camerafadeinstart";
},
function (t, e) {
t.exports = "camerafadeoutcomplete";
},
function (t, e) {
t.exports = "camerafadeoutstart";
},
function (t, e) {
t.exports = "cameraflashcomplete";
},
function (t, e) {
t.exports = "cameraflashstart";
},
function (t, e) {
t.exports = "followupdate";
},
function (t, e) {
t.exports = "camerapancomplete";
},
function (t, e) {
t.exports = "camerapanstart";
},
function (t, e) {
t.exports = "postrender";
},
function (t, e) {
t.exports = "prerender";
},
function (t, e) {
t.exports = "camerarotatecomplete";
},
function (t, e) {
t.exports = "camerarotatestart";
},
function (t, e) {
t.exports = "camerashakecomplete";
},
function (t, e) {
t.exports = "camerashakestart";
},
function (t, e) {
t.exports = "camerazoomcomplete";
},
function (t, e) {
t.exports = "camerazoomstart";
},
function (t, e, i) {
var n = i(18),
s = i(0),
l = i(37),
r = new s({
initialize: function (t) {
(this.camera = t),
(this.isRunning = !1),
(this.isComplete = !1),
(this.direction = !0),
(this.duration = 0),
(this.red = 0),
(this.green = 0),
(this.blue = 0),
(this.alpha = 0),
(this.progress = 0),
(this._elapsed = 0),
this._onUpdate,
this._onUpdateScope;
},
start: function (t, e, i, n, s, r, o, a) {
if (
(void 0 === t && (t = !0),
void 0 === e && (e = 1e3),
void 0 === i && (i = 0),
void 0 === n && (n = 0),
void 0 === s && (s = 0),
void 0 === r && (r = !1),
void 0 === o && (o = null),
void 0 === a && (a = this.camera.scene),
!r && this.isRunning)
)
return this.camera;
(this.isRunning = !0),
(this.isComplete = !1),
(this.duration = e),
(this.direction = t),
(this.progress = 0),
(this.red = i),
(this.green = n),
(this.blue = s),
(this.alpha = t ? Number.MIN_VALUE : 1),
(this._elapsed = 0),
(this._onUpdate = o),
(this._onUpdateScope = a);
var h = t ? l.FADE_OUT_START : l.FADE_IN_START;
return this.camera.emit(h, this.camera, this, e, i, n, s), this.camera;
},
update: function (t, e) {
this.isRunning &&
((this._elapsed += e),
(this.progress = n(this._elapsed / this.duration, 0, 1)),
this._onUpdate && this._onUpdate.call(this._onUpdateScope, this.camera, this.progress),
this._elapsed < this.duration ? (this.alpha = this.direction ? this.progress : 1 - this.progress) : ((this.alpha = this.direction ? 1 : 0), this.effectComplete()));
},
postRenderCanvas: function (t) {
if (!this.isRunning && !this.isComplete) return !1;
var e = this.camera;
return (t.fillStyle = "rgba(" + this.red + "," + this.green + "," + this.blue + "," + this.alpha + ")"), t.fillRect(e.x, e.y, e.width, e.height), !0;
},
postRenderWebGL: function (t, e) {
if (!this.isRunning && !this.isComplete) return !1;
var i = this.camera,
n = this.red / 255,
s = this.green / 255,
r = this.blue / 255;
return t.drawFillRect(i.x, i.y, i.width, i.height, e(r, s, n, 1), this.alpha), !0;
},
effectComplete: function () {
(this._onUpdate = null), (this._onUpdateScope = null), (this.isRunning = !1), (this.isComplete = !0);
var t = this.direction ? l.FADE_OUT_COMPLETE : l.FADE_IN_COMPLETE;
this.camera.emit(t, this.camera, this);
},
reset: function () {
(this.isRunning = !1), (this.isComplete = !1), (this._onUpdate = null), (this._onUpdateScope = null);
},
destroy: function () {
this.reset(), (this.camera = null);
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(18),
s = i(0),
a = i(37),
r = new s({
initialize: function (t) {
(this.camera = t),
(this.isRunning = !1),
(this.duration = 0),
(this.red = 0),
(this.green = 0),
(this.blue = 0),
(this.alpha = 0),
(this.progress = 0),
(this._elapsed = 0),
this._onUpdate,
this._onUpdateScope;
},
start: function (t, e, i, n, s, r, o) {
return (
void 0 === t && (t = 250),
void 0 === e && (e = 255),
void 0 === i && (i = 255),
void 0 === n && (n = 255),
void 0 === s && (s = !1),
void 0 === r && (r = null),
void 0 === o && (o = this.camera.scene),
(!s && this.isRunning) ||
((this.isRunning = !0),
(this.duration = t),
(this.progress = 0),
(this.red = e),
(this.green = i),
(this.blue = n),
(this.alpha = 1),
(this._elapsed = 0),
(this._onUpdate = r),
(this._onUpdateScope = o),
this.camera.emit(a.FLASH_START, this.camera, this, t, e, i, n)),
this.camera
);
},
update: function (t, e) {
this.isRunning &&
((this._elapsed += e),
(this.progress = n(this._elapsed / this.duration, 0, 1)),
this._onUpdate && this._onUpdate.call(this._onUpdateScope, this.camera, this.progress),
this._elapsed < this.duration ? (this.alpha = 1 - this.progress) : this.effectComplete());
},
postRenderCanvas: function (t) {
if (!this.isRunning) return !1;
var e = this.camera;
return (t.fillStyle = "rgba(" + this.red + "," + this.green + "," + this.blue + "," + this.alpha + ")"), t.fillRect(e.x, e.y, e.width, e.height), !0;
},
postRenderWebGL: function (t, e) {
if (!this.isRunning) return !1;
var i = this.camera,
n = this.red / 255,
s = this.green / 255,
r = this.blue / 255;
return t.drawFillRect(i.x, i.y, i.width, i.height, e(r, s, n, 1), this.alpha), !0;
},
effectComplete: function () {
(this._onUpdate = null), (this._onUpdateScope = null), (this.isRunning = !1), this.camera.emit(a.FLASH_COMPLETE, this.camera, this);
},
reset: function () {
(this.isRunning = !1), (this._onUpdate = null), (this._onUpdateScope = null);
},
destroy: function () {
this.reset(), (this.camera = null);
},
});
t.exports = r;
},
function (t, e, i) {
var a = i(18),
n = i(0),
h = i(134),
l = i(37),
s = i(3),
r = new n({
initialize: function (t) {
(this.camera = t),
(this.isRunning = !1),
(this.duration = 0),
(this.source = new s()),
(this.current = new s()),
(this.destination = new s()),
this.ease,
(this.progress = 0),
(this._elapsed = 0),
this._onUpdate,
this._onUpdateScope;
},
start: function (t, e, i, n, s, r, o) {
void 0 === i && (i = 1e3), void 0 === n && (n = h.Linear), void 0 === s && (s = !1), void 0 === r && (r = null), void 0 === o && (o = this.camera.scene);
var a = this.camera;
return (
(!s && this.isRunning) ||
((this.isRunning = !0),
(this.duration = i),
(this.progress = 0),
this.source.set(a.scrollX, a.scrollY),
this.destination.set(t, e),
a.getScroll(t, e, this.current),
"string" == typeof n && h.hasOwnProperty(n) ? (this.ease = h[n]) : "function" == typeof n && (this.ease = n),
(this._elapsed = 0),
(this._onUpdate = r),
(this._onUpdateScope = o),
this.camera.emit(l.PAN_START, this.camera, this, i, t, e)),
a
);
},
update: function (t, e) {
var i, n, s, r, o;
this.isRunning &&
((this._elapsed += e),
(i = a(this._elapsed / this.duration, 0, 1)),
(this.progress = i),
(n = this.camera),
this._elapsed < this.duration
? ((s = this.ease(i)),
n.getScroll(this.destination.x, this.destination.y, this.current),
(r = this.source.x + (this.current.x - this.source.x) * s),
(o = this.source.y + (this.current.y - this.source.y) * s),
n.setScroll(r, o),
this._onUpdate && this._onUpdate.call(this._onUpdateScope, n, i, r, o))
: (n.centerOn(this.destination.x, this.destination.y), this._onUpdate && this._onUpdate.call(this._onUpdateScope, n, i, n.scrollX, n.scrollY), this.effectComplete()));
},
effectComplete: function () {
(this._onUpdate = null), (this._onUpdateScope = null), (this.isRunning = !1), this.camera.emit(l.PAN_COMPLETE, this.camera, this);
},
reset: function () {
(this.isRunning = !1), (this._onUpdate = null), (this._onUpdateScope = null);
},
destroy: function () {
this.reset(), (this.camera = null), (this.source = null), (this.destination = null);
},
});
t.exports = r;
},
function (t, e) {
t.exports = function (t, e) {
return void 0 === e && (e = 1.70158), t * t * ((e + 1) * t - e);
};
},
function (t, e) {
t.exports = function (t, e) {
return void 0 === e && (e = 1.70158), --t * t * ((e + 1) * t + e) + 1;
};
},
function (t, e) {
t.exports = function (t, e) {
void 0 === e && (e = 1.70158);
var i = 1.525 * e;
return (t *= 2) < 1 ? t * t * ((1 + i) * t - i) * 0.5 : 0.5 * ((t -= 2) * t * ((1 + i) * t + i) + 2);
};
},
function (t, e) {
t.exports = function (t) {
return (t = 1 - t) < 1 / 2.75
? 1 - 7.5625 * t * t
: t < 2 / 2.75
? 1 - (7.5625 * (t -= 1.5 / 2.75) * t + 0.75)
: t < 2.5 / 2.75
? 1 - (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375)
: 1 - (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375);
};
},
function (t, e) {
t.exports = function (t) {
return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + 0.75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375 : 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375;
};
},
function (t, e) {
t.exports = function (t) {
var e = !1;
return (
t < 0.5 ? ((t = 1 - 2 * t), (e = !0)) : (t = 2 * t - 1),
t < 1 / 2.75 ? (t *= 7.5625 * t) : (t = t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + 0.75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375 : 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375),
e ? 0.5 * (1 - t) : 0.5 * t + 0.5
);
};
},
function (t, e) {
t.exports = function (t) {
return 1 - Math.sqrt(1 - t * t);
};
},
function (t, e) {
t.exports = function (t) {
return Math.sqrt(1 - --t * t);
};
},
function (t, e) {
t.exports = function (t) {
return (t *= 2) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);
};
},
function (t, e) {
t.exports = function (t) {
return t * t * t;
};
},
function (t, e) {
t.exports = function (t) {
return --t * t * t + 1;
};
},
function (t, e) {
t.exports = function (t) {
return (t *= 2) < 1 ? 0.5 * t * t * t : 0.5 * ((t -= 2) * t * t + 2);
};
},
function (t, e) {
t.exports = function (t, e, i) {
if ((void 0 === e && (e = 0.1), void 0 === i && (i = 0.1), 0 === t)) return 0;
if (1 === t) return 1;
var n = i / 4;
return e < 1 ? (e = 1) : (n = (i * Math.asin(1 / e)) / (2 * Math.PI)), -e * Math.pow(2, 10 * --t) * Math.sin(((t - n) * (2 * Math.PI)) / i);
};
},
function (t, e) {
t.exports = function (t, e, i) {
if ((void 0 === e && (e = 0.1), void 0 === i && (i = 0.1), 0 === t)) return 0;
if (1 === t) return 1;
var n = i / 4;
return e < 1 ? (e = 1) : (n = (i * Math.asin(1 / e)) / (2 * Math.PI)), e * Math.pow(2, -10 * t) * Math.sin(((t - n) * (2 * Math.PI)) / i) + 1;
};
},
function (t, e) {
t.exports = function (t, e, i) {
if ((void 0 === e && (e = 0.1), void 0 === i && (i = 0.1), 0 === t)) return 0;
if (1 === t) return 1;
var n = i / 4;
return (
e < 1 ? (e = 1) : (n = (i * Math.asin(1 / e)) / (2 * Math.PI)),
(t *= 2) < 1 ? e * Math.pow(2, 10 * --t) * Math.sin(((t - n) * (2 * Math.PI)) / i) * -0.5 : e * Math.pow(2, -10 * --t) * Math.sin(((t - n) * (2 * Math.PI)) / i) * 0.5 + 1
);
};
},
function (t, e) {
t.exports = function (t) {
return Math.pow(2, 10 * (t - 1)) - 0.001;
};
},
function (t, e) {
t.exports = function (t) {
return 1 - Math.pow(2, -10 * t);
};
},
function (t, e) {
t.exports = function (t) {
return (t *= 2) < 1 ? 0.5 * Math.pow(2, 10 * (t - 1)) : 0.5 * (2 - Math.pow(2, -10 * (t - 1)));
};
},
function (t, e) {
t.exports = function (t) {
return t;
};
},
function (t, e) {
t.exports = function (t) {
return t * t;
};
},
function (t, e) {
t.exports = function (t) {
return t * (2 - t);
};
},
function (t, e) {
t.exports = function (t) {
return (t *= 2) < 1 ? 0.5 * t * t : -0.5 * (--t * (t - 2) - 1);
};
},
function (t, e) {
t.exports = function (t) {
return t * t * t * t;
};
},
function (t, e) {
t.exports = function (t) {
return 1 - --t * t * t * t;
};
},
function (t, e) {
t.exports = function (t) {
return (t *= 2) < 1 ? 0.5 * t * t * t * t : -0.5 * ((t -= 2) * t * t * t - 2);
};
},
function (t, e) {
t.exports = function (t) {
return t * t * t * t * t;
};
},
function (t, e) {
t.exports = function (t) {
return --t * t * t * t * t + 1;
};
},
function (t, e) {
t.exports = function (t) {
return (t *= 2) < 1 ? 0.5 * t * t * t * t * t : 0.5 * ((t -= 2) * t * t * t * t + 2);
};
},
function (t, e) {
t.exports = function (t) {
return 0 === t ? 0 : 1 === t ? 1 : 1 - Math.cos((t * Math.PI) / 2);
};
},
function (t, e) {
t.exports = function (t) {
return 0 === t ? 0 : 1 === t ? 1 : Math.sin((t * Math.PI) / 2);
};
},
function (t, e) {
t.exports = function (t) {
return 0 === t ? 0 : 1 === t ? 1 : 0.5 * (1 - Math.cos(Math.PI * t));
};
},
function (t, e) {
t.exports = function (t, e) {
return void 0 === e && (e = 1), t <= 0 ? 0 : 1 <= t ? 1 : (1 / e) * (1 + ((e * t) | 0));
};
},
function (t, e, i) {
var o = i(18),
n = i(0),
r = i(37),
s = i(3),
a = new n({
initialize: function (t) {
(this.camera = t),
(this.isRunning = !1),
(this.duration = 0),
(this.intensity = new s()),
(this.progress = 0),
(this._elapsed = 0),
(this._offsetX = 0),
(this._offsetY = 0),
this._onUpdate,
this._onUpdateScope;
},
start: function (t, e, i, n, s) {
return (
void 0 === t && (t = 100),
void 0 === e && (e = 0.05),
void 0 === i && (i = !1),
void 0 === n && (n = null),
void 0 === s && (s = this.camera.scene),
(!i && this.isRunning) ||
((this.isRunning = !0),
(this.duration = t),
(this.progress = 0),
"number" == typeof e ? this.intensity.set(e) : this.intensity.set(e.x, e.y),
(this._elapsed = 0),
(this._offsetX = 0),
(this._offsetY = 0),
(this._onUpdate = n),
(this._onUpdateScope = s),
this.camera.emit(r.SHAKE_START, this.camera, this, t, e)),
this.camera
);
},
preRender: function () {
this.isRunning && this.camera.matrix.translate(this._offsetX, this._offsetY);
},
update: function (t, e) {
var i, n, s, r;
this.isRunning &&
((this._elapsed += e),
(this.progress = o(this._elapsed / this.duration, 0, 1)),
this._onUpdate && this._onUpdate.call(this._onUpdateScope, this.camera, this.progress),
this._elapsed < this.duration
? ((i = this.intensity),
(n = this.camera.width),
(s = this.camera.height),
(r = this.camera.zoom),
(this._offsetX = (Math.random() * i.x * n * 2 - i.x * n) * r),
(this._offsetY = (Math.random() * i.y * s * 2 - i.y * s) * r),
this.camera.roundPixels && ((this._offsetX = Math.round(this._offsetX)), (this._offsetY = Math.round(this._offsetY))))
: this.effectComplete());
},
effectComplete: function () {
(this._offsetX = 0), (this._offsetY = 0), (this._onUpdate = null), (this._onUpdateScope = null), (this.isRunning = !1), this.camera.emit(r.SHAKE_COMPLETE, this.camera, this);
},
reset: function () {
(this.isRunning = !1), (this._offsetX = 0), (this._offsetY = 0), (this._onUpdate = null), (this._onUpdateScope = null);
},
destroy: function () {
this.reset(), (this.camera = null), (this.intensity = null);
},
});
t.exports = a;
},
function (t, e, i) {
var u = i(18),
n = i(0),
d = i(37),
f = i(134),
s = new n({
initialize: function (t) {
(this.camera = t),
(this.isRunning = !1),
(this.duration = 0),
(this.source = 0),
(this.current = 0),
(this.destination = 0),
this.ease,
(this.progress = 0),
(this._elapsed = 0),
this._onUpdate,
this._onUpdateScope,
(this.clockwise = !0),
(this.shortestPath = !1);
},
start: function (t, e, i, n, s, r, o) {
void 0 === i && (i = 1e3), void 0 === n && (n = f.Linear), void 0 === s && (s = !1), void 0 === r && (r = null), void 0 === o && (o = this.camera.scene), void 0 === e && (e = !1), (this.shortestPath = e);
var a = t;
this.clockwise = !(t < 0) || ((a = -1 * t), !1);
var h = (360 * Math.PI) / 180;
a -= Math.floor(a / h) * h;
var l,
u,
c = this.camera;
return (
(!s && this.isRunning) ||
((this.isRunning = !0),
(this.duration = i),
(this.progress = 0),
(this.source = c.rotation),
(this.destination = a),
"string" == typeof n && f.hasOwnProperty(n) ? (this.ease = f[n]) : "function" == typeof n && (this.ease = n),
(this._elapsed = 0),
(this._onUpdate = r),
(this._onUpdateScope = o),
this.shortestPath &&
(0,
(l = this.destination > this.source ? Math.abs(this.destination - this.source) : Math.abs(this.destination + h) - this.source) <
(u = this.source > this.destination ? Math.abs(this.source - this.destination) : Math.abs(this.source + h) - this.destination)
? (this.clockwise = !0)
: u < l && (this.clockwise = !1)),
this.camera.emit(d.ROTATE_START, this.camera, this, i, a)),
c
);
},
update: function (t, e) {
var i, n, s, r, o, a, h, l;
this.isRunning &&
((this._elapsed += e),
(i = u(this._elapsed / this.duration, 0, 1)),
(this.progress = i),
(n = this.camera),
this._elapsed < this.duration
? ((s = this.ease(i)),
(this.current = n.rotation),
0,
(o = (360 * Math.PI) / 180),
(a = this.destination),
(h = this.current),
!1 === this.clockwise && ((a = this.current), (h = this.destination)),
(r = h <= a ? Math.abs(a - h) : Math.abs(a + o) - h),
0,
(l = this.clockwise ? n.rotation + r * s : n.rotation - r * s),
(n.rotation = l),
this._onUpdate && this._onUpdate.call(this._onUpdateScope, n, i, l))
: ((n.rotation = this.destination), this._onUpdate && this._onUpdate.call(this._onUpdateScope, n, i, this.destination), this.effectComplete()));
},
effectComplete: function () {
(this._onUpdate = null), (this._onUpdateScope = null), (this.isRunning = !1), this.camera.emit(d.ROTATE_COMPLETE, this.camera, this);
},
reset: function () {
(this.isRunning = !1), (this._onUpdate = null), (this._onUpdateScope = null);
},
destroy: function () {
this.reset(), (this.camera = null), (this.source = null), (this.destination = null);
},
});
t.exports = s;
},
function (t, e, i) {
var n = i(18),
s = i(0),
a = i(134),
h = i(37),
r = new s({
initialize: function (t) {
(this.camera = t), (this.isRunning = !1), (this.duration = 0), (this.source = 1), (this.destination = 1), this.ease, (this.progress = 0), (this._elapsed = 0), this._onUpdate, this._onUpdateScope;
},
start: function (t, e, i, n, s, r) {
void 0 === e && (e = 1e3), void 0 === i && (i = a.Linear), void 0 === n && (n = !1), void 0 === s && (s = null), void 0 === r && (r = this.camera.scene);
var o = this.camera;
return (
(!n && this.isRunning) ||
((this.isRunning = !0),
(this.duration = e),
(this.progress = 0),
(this.source = o.zoom),
(this.destination = t),
"string" == typeof i && a.hasOwnProperty(i) ? (this.ease = a[i]) : "function" == typeof i && (this.ease = i),
(this._elapsed = 0),
(this._onUpdate = s),
(this._onUpdateScope = r),
this.camera.emit(h.ZOOM_START, this.camera, this, e, t)),
o
);
},
update: function (t, e) {
this.isRunning &&
((this._elapsed += e),
(this.progress = n(this._elapsed / this.duration, 0, 1)),
this._elapsed < this.duration
? ((this.camera.zoom = this.source + (this.destination - this.source) * this.ease(this.progress)),
this._onUpdate && this._onUpdate.call(this._onUpdateScope, this.camera, this.progress, this.camera.zoom))
: ((this.camera.zoom = this.destination), this._onUpdate && this._onUpdate.call(this._onUpdateScope, this.camera, this.progress, this.destination), this.effectComplete()));
},
effectComplete: function () {
(this._onUpdate = null), (this._onUpdateScope = null), (this.isRunning = !1), this.camera.emit(h.ZOOM_COMPLETE, this.camera, this);
},
reset: function () {
(this.isRunning = !1), (this._onUpdate = null), (this._onUpdateScope = null);
},
destroy: function () {
this.reset(), (this.camera = null);
},
});
t.exports = r;
},
function (t, e, i) {
var a = i(326),
n = i(0),
v = i(2),
s = i(24),
h = i(57),
r = i(104),
o = i(20),
l = new n({
initialize: function (t) {
(this.scene = t),
(this.systems = t.sys),
(this.roundPixels = t.sys.game.config.roundPixels),
(this.cameras = []),
this.main,
this.default,
t.sys.events.once(o.BOOT, this.boot, this),
t.sys.events.on(o.START, this.start, this);
},
boot: function () {
var t = this.systems;
t.settings.cameras ? this.fromJSON(t.settings.cameras) : this.add(),
(this.main = this.cameras[0]),
(this.default = new a(0, 0, t.scale.width, t.scale.height).setScene(this.scene)),
t.game.scale.on(r.RESIZE, this.onResize, this),
this.systems.events.once(o.DESTROY, this.destroy, this);
},
start: function () {
var t;
this.main || ((t = this.systems).settings.cameras ? this.fromJSON(t.settings.cameras) : this.add(), (this.main = this.cameras[0]));
var e = this.systems.events;
e.on(o.UPDATE, this.update, this), e.once(o.SHUTDOWN, this.shutdown, this);
},
add: function (t, e, i, n, s, r) {
void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = this.scene.sys.scale.width), void 0 === n && (n = this.scene.sys.scale.height), void 0 === s && (s = !1), void 0 === r && (r = "");
var o = new a(t, e, i, n);
return o.setName(r), o.setScene(this.scene), o.setRoundPixels(this.roundPixels), (o.id = this.getNextID()), this.cameras.push(o), s && (this.main = o), o;
},
addExisting: function (t, e) {
return void 0 === e && (e = !1), -1 === this.cameras.indexOf(t) ? ((t.id = this.getNextID()), t.setRoundPixels(this.roundPixels), this.cameras.push(t), e && (this.main = t), t) : null;
},
getNextID: function () {
for (var t = this.cameras, e = 1, i = 0; i < 32; i++) {
for (var n = !1, s = 0; s < t.length; s++) {
var r = t[s];
r && r.id === e && (n = !0);
}
if (!n) return e;
e <<= 1;
}
return 0;
},
getTotal: function (t) {
void 0 === t && (t = !1);
for (var e = 0, i = this.cameras, n = 0; n < i.length; n++) {
var s = i[n];
(!t || (t && s.visible)) && e++;
}
return e;
},
fromJSON: function (t) {
Array.isArray(t) || (t = [t]);
for (var e = this.scene.sys.scale.width, i = this.scene.sys.scale.height, n = 0; n < t.length; n++) {
var s = t[n],
r = v(s, "x", 0),
o = v(s, "y", 0),
a = v(s, "width", e),
h = v(s, "height", i),
l = this.add(r, o, a, h);
(l.name = v(s, "name", "")),
(l.zoom = v(s, "zoom", 1)),
(l.rotation = v(s, "rotation", 0)),
(l.scrollX = v(s, "scrollX", 0)),
(l.scrollY = v(s, "scrollY", 0)),
(l.roundPixels = v(s, "roundPixels", !1)),
(l.visible = v(s, "visible", !0));
var u = v(s, "backgroundColor", !1);
u && l.setBackgroundColor(u);
var c,
d,
f,
p,
g = v(s, "bounds", null);
g && ((c = v(g, "x", 0)), (d = v(g, "y", 0)), (f = v(g, "width", e)), (p = v(g, "height", i)), l.setBounds(c, d, f, p));
}
return this;
},
getCamera: function (t) {
for (var e = this.cameras, i = 0; i < e.length; i++) if (e[i].name === t) return e[i];
return null;
},
getCamerasBelowPointer: function (t) {
for (var e = this.cameras, i = t.x, n = t.y, s = [], r = 0; r < e.length; r++) {
var o = e[r];
o.visible && o.inputEnabled && h(o, i, n) && s.unshift(o);
}
return s;
},
remove: function (t, e) {
void 0 === e && (e = !0), Array.isArray(t) || (t = [t]);
for (var i = 0, n = this.cameras, s = 0; s < t.length; s++) {
var r = n.indexOf(t[s]);
-1 !== r && (e ? n[r].destroy() : (n[r].renderList = []), n.splice(r, 1), i++);
}
return !this.main && n[0] && (this.main = n[0]), i;
},
render: function (t, e) {
for (var i = this.scene, n = this.cameras, s = 0; s < this.cameras.length; s++) {
var r,
o = n[s];
o.visible && 0 < o.alpha && (o.preRender(), (r = this.getVisibleChildren(e.getChildren(), o)), t.render(i, r, o));
}
},
getVisibleChildren: function (t, e) {
for (var i = [], n = 0; n < t.length; n++) {
var s = t[n];
s.willRender(e) && i.push(s);
}
return i;
},
resetAll: function () {
for (var t = 0; t < this.cameras.length; t++) this.cameras[t].destroy();
return (this.cameras = []), (this.main = this.add()), this.main;
},
update: function (t, e) {
for (var i = 0; i < this.cameras.length; i++) this.cameras[i].update(t, e);
},
onResize: function (t, e, i, n, s) {
for (var r = 0; r < this.cameras.length; r++) {
var o = this.cameras[r];
0 === o._x && 0 === o._y && o._width === n && o._height === s && o.setSize(e.width, e.height);
}
},
resize: function (t, e) {
for (var i = 0; i < this.cameras.length; i++) this.cameras[i].setSize(t, e);
},
shutdown: function () {
this.main = void 0;
for (var t = 0; t < this.cameras.length; t++) this.cameras[t].destroy();
this.cameras = [];
var e = this.systems.events;
e.off(o.UPDATE, this.update, this), e.off(o.SHUTDOWN, this.shutdown, this);
},
destroy: function () {
this.shutdown(), this.default.destroy(), this.scene.sys.events.off(o.START, this.start, this), (this.scene = null), (this.systems = null);
},
});
s.register("CameraManager", l, "cameras"), (t.exports = l);
},
function (t, e) {
t.exports = "enterfullscreen";
},
function (t, e) {
t.exports = "fullscreenfailed";
},
function (t, e) {
t.exports = "fullscreenunsupported";
},
function (t, e) {
t.exports = "leavefullscreen";
},
function (t, e) {
t.exports = "orientationchange";
},
function (t, e) {
t.exports = "resize";
},
function (t, e, i) {
t.exports = { Config: i(346), CreateRenderer: i(366), DebugHeader: i(384), Events: i(22), TimeStep: i(385), VisibilityHandler: i(387) };
},
function (t, e) {
var i,
n,
s = (t.exports = {});
function r() {
throw new Error("setTimeout has not been defined");
}
function o() {
throw new Error("clearTimeout has not been defined");
}
function a(e) {
if (i === setTimeout) return setTimeout(e, 0);
if ((i === r || !i) && setTimeout) return (i = setTimeout), setTimeout(e, 0);
try {
return i(e, 0);
} catch (t) {
try {
return i.call(null, e, 0);
} catch (t) {
return i.call(this, e, 0);
}
}
}
!(function () {
try {
i = "function" == typeof setTimeout ? setTimeout : r;
} catch (t) {
i = r;
}
try {
n = "function" == typeof clearTimeout ? clearTimeout : o;
} catch (t) {
n = o;
}
})();
var h,
l = [],
u = !1,
c = -1;
function d() {
u && h && ((u = !1), h.length ? (l = h.concat(l)) : (c = -1), l.length && f());
}
function f() {
if (!u) {
var t = a(d);
u = !0;
for (var e = l.length; e; ) {
for (h = l, l = []; ++c < e; ) h && h[c].run();
(c = -1), (e = l.length);
}
(h = null),
(u = !1),
(function (e) {
if (n === clearTimeout) return clearTimeout(e);
if ((n === o || !n) && clearTimeout) return (n = clearTimeout), clearTimeout(e);
try {
n(e);
} catch (t) {
try {
return n.call(null, e);
} catch (t) {
return n.call(this, e);
}
}
})(t);
}
}
function p(t, e) {
(this.fun = t), (this.array = e);
}
function g() {}
(s.nextTick = function (t) {
var e = new Array(arguments.length - 1);
if (1 < arguments.length) for (var i = 1; i < arguments.length; i++) e[i - 1] = arguments[i];
l.push(new p(t, e)), 1 !== l.length || u || a(f);
}),
(p.prototype.run = function () {
this.fun.apply(null, this.array);
}),
(s.title = "browser"),
(s.browser = !0),
(s.env = {}),
(s.argv = []),
(s.version = ""),
(s.versions = {}),
(s.on = g),
(s.addListener = g),
(s.once = g),
(s.off = g),
(s.removeListener = g),
(s.removeAllListeners = g),
(s.emit = g),
(s.prependListener = g),
(s.prependOnceListener = g),
(s.listeners = function (t) {
return [];
}),
(s.binding = function (t) {
throw new Error("process.binding is not supported");
}),
(s.cwd = function () {
return "/";
}),
(s.chdir = function (t) {
throw new Error("process.chdir is not supported");
}),
(s.umask = function () {
return 0;
});
},
function (t, e, i) {
var n = i(136),
s = { gamepads: !1, mspointer: !1, touch: !1, wheelEvent: null };
t.exports =
("function" == typeof importScripts ||
(("ontouchstart" in document.documentElement || (navigator.maxTouchPoints && 1 <= navigator.maxTouchPoints)) && (s.touch = !0),
(navigator.msPointerEnabled || navigator.pointerEnabled) && (s.mspointer = !0),
navigator.getGamepads && (s.gamepads = !0),
"onwheel" in window || (n.ie && "WheelEvent" in window)
? (s.wheelEvent = "wheel")
: "onmousewheel" in window
? (s.wheelEvent = "mousewheel")
: n.firefox && "MouseScrollEvent" in window && (s.wheelEvent = "DOMMouseScroll")),
s);
},
function (t, e, i) {
var s = i(136),
r = { audioData: !1, dolby: !1, m4a: !1, mp3: !1, ogg: !1, opus: !1, wav: !1, webAudio: !1, webm: !1 };
t.exports = (function () {
if ("function" == typeof importScripts) return r;
(r.audioData = !!window.Audio), (r.webAudio = !(!window.AudioContext && !window.webkitAudioContext));
var t,
e,
i = document.createElement("audio"),
n = !!i.canPlayType;
try {
n &&
(i.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, "") && (r.ogg = !0),
(i.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/, "") || i.canPlayType("audio/opus;").replace(/^no$/, "")) && (r.opus = !0),
i.canPlayType("audio/mpeg;").replace(/^no$/, "") && (r.mp3 = !0),
i.canPlayType("audio/wav").replace(/^no$/, "") && (r.wav = !0),
(i.canPlayType("audio/x-m4a;") || i.canPlayType("audio/aac;").replace(/^no$/, "")) && (r.m4a = !0),
i.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, "") && (r.webm = !0),
"" !== i.canPlayType('audio/mp4;codecs="ec-3"') &&
(s.edge
? (r.dolby = !0)
: s.safari &&
9 <= s.safariVersion &&
/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent) &&
((t = parseInt(RegExp.$1, 10)), (e = parseInt(RegExp.$2, 10)), ((10 === t && 11 <= e) || 10 < t) && (r.dolby = !0))));
} catch (t) {}
return r;
})();
},
function (t, e) {
var i = { h264: !1, hls: !1, mp4: !1, ogg: !1, vp9: !1, webm: !1 };
t.exports = (function () {
if ("function" == typeof importScripts) return i;
var t = document.createElement("video"),
e = !!t.canPlayType;
try {
e &&
(t.canPlayType('video/ogg; codecs="theora"').replace(/^no$/, "") && (i.ogg = !0),
t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/, "") && ((i.h264 = !0), (i.mp4 = !0)),
t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/, "") && (i.webm = !0),
t.canPlayType('video/webm; codecs="vp9"').replace(/^no$/, "") && (i.vp9 = !0),
t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/, "") && (i.hls = !0));
} catch (t) {}
return i;
})();
},
function (t, e) {
var r = { available: !1, cancel: "", keyboard: !1, request: "" };
t.exports = (function () {
if ("function" == typeof importScripts) return r;
for (
var t = "Fullscreen", e = "FullScreen", i = ["request" + t, "request" + e, "webkitRequest" + t, "webkitRequest" + e, "msRequest" + t, "msRequest" + e, "mozRequest" + e, "mozRequest" + t], n = 0;
n < i.length;
n++
)
if (document.documentElement[i[n]]) {
(r.available = !0), (r.request = i[n]);
break;
}
var s = ["cancel" + e, "exit" + t, "webkitCancel" + e, "webkitExit" + t, "msCancel" + e, "msExit" + t, "mozCancel" + e, "mozExit" + t];
if (r.available)
for (n = 0; n < s.length; n++)
if (document[s[n]]) {
r.cancel = s[n];
break;
}
return (
window.Element && Element.ALLOW_KEYBOARD_INPUT && !/ Version\/5\.1(?:\.\d+)? Safari\//.test(navigator.userAgent) && (r.keyboard = !0),
Object.defineProperty(r, "active", {
get: function () {
return !!(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement);
},
}),
r
);
})();
},
function (t, e, i) {
t.exports = {
Between: i(349),
BetweenPoints: i(350),
BetweenPointsY: i(813),
BetweenY: i(814),
CounterClockwise: i(815),
Normalize: i(351),
Random: i(816),
RandomDegrees: i(817),
Reverse: i(818),
RotateTo: i(819),
ShortestBetween: i(820),
Wrap: i(269),
WrapDegrees: i(270),
};
},
function (t, e) {
t.exports = function (t, e) {
return Math.atan2(e.x - t.x, e.y - t.y);
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
return Math.atan2(i - t, n - e);
};
},
function (t, e, i) {
var n = i(14);
t.exports = function (t) {
return t > Math.PI && (t -= n.PI2), Math.abs((((t + n.TAU) % n.PI2) - n.PI2) % n.PI2);
};
},
function (t, e, i) {
var n = i(137);
t.exports = function () {
return n(-Math.PI, Math.PI);
};
},
function (t, e, i) {
var n = i(137);
t.exports = function () {
return n(-180, 180);
};
},
function (t, e, i) {
var n = i(351);
t.exports = function (t) {
return n(t + Math.PI);
};
},
function (t, e, i) {
var n = i(14);
t.exports = function (t, e, i) {
return (
void 0 === i && (i = 0.05),
t === e || (Math.abs(e - t) <= i || Math.abs(e - t) >= n.PI2 - i ? (t = e) : (Math.abs(e - t) > Math.PI && (e < t ? (e += n.PI2) : (e -= n.PI2)), t < e ? (t += i) : e < t && (t -= i))),
t
);
};
},
function (t, e) {
t.exports = function (t, e) {
var i = e - t;
return 0 == i ? 0 : i - 360 * Math.floor((i + 180) / 360);
};
},
function (t, e, i) {
t.exports = { Between: i(50), BetweenPoints: i(352), BetweenPointsSquared: i(822), Chebyshev: i(823), Power: i(824), Snake: i(825), Squared: i(353) };
},
function (t, e) {
t.exports = function (t, e) {
var i = t.x - e.x,
n = t.y - e.y;
return i * i + n * n;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
return Math.max(Math.abs(t - i), Math.abs(e - n));
};
},
function (t, e) {
t.exports = function (t, e, i, n, s) {
return void 0 === s && (s = 2), Math.sqrt(Math.pow(i - t, s) + Math.pow(n - e, s));
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
return Math.abs(t - i) + Math.abs(e - n);
};
},
function (t, e, i) {
t.exports = { Back: i(334), Bounce: i(335), Circular: i(336), Cubic: i(337), Elastic: i(338), Expo: i(339), Linear: i(340), Quadratic: i(341), Quartic: i(342), Quintic: i(343), Sine: i(344), Stepped: i(345) };
},
function (t, e, i) {
t.exports = { Ceil: i(828), Equal: i(124), Floor: i(829), GreaterThan: i(354), LessThan: i(355) };
},
function (t, e) {
t.exports = function (t, e) {
return void 0 === e && (e = 1e-4), Math.ceil(t - e);
};
},
function (t, e) {
t.exports = function (t, e) {
return void 0 === e && (e = 1e-4), Math.floor(t + e);
};
},
function (t, e, i) {
t.exports = { Bezier: i(831), CatmullRom: i(832), CubicBezier: i(358), Linear: i(833), QuadraticBezier: i(359), SmoothStep: i(360), SmootherStep: i(834) };
},
function (t, e, i) {
var r = i(356);
t.exports = function (t, e) {
for (var i = 0, n = t.length - 1, s = 0; s <= n; s++) i += Math.pow(1 - e, n - s) * Math.pow(e, s) * t[s] * r(n, s);
return i;
};
},
function (t, e, i) {
var r = i(194);
t.exports = function (t, e) {
var i = t.length - 1,
n = i * e,
s = Math.floor(n);
return t[0] === t[i]
? (e < 0 && (s = Math.floor((n = i * (1 + e)))), r(n - s, t[(s - 1 + i) % i], t[s], t[(s + 1) % i], t[(s + 2) % i]))
: e < 0
? t[0] - (r(-n, t[0], t[0], t[1], t[1]) - t[0])
: 1 < e
? t[i] - (r(n - i, t[i], t[i], t[i - 1], t[i - 1]) - t[i])
: r(n - s, t[s ? s - 1 : 0], t[s], t[i < s + 1 ? i : s + 1], t[i < s + 2 ? i : s + 2]);
};
},
function (t, e, i) {
var r = i(135);
t.exports = function (t, e) {
var i = t.length - 1,
n = i * e,
s = Math.floor(n);
return e < 0 ? r(t[0], t[1], n) : 1 < e ? r(t[i], t[i - 1], i - n) : r(t[s], t[i < s + 1 ? i : s + 1], n - s);
};
},
function (t, e, i) {
var n = i(183);
t.exports = function (t, e, i) {
return e + (i - e) * n(t, 0, 1);
};
},
function (t, e, i) {
t.exports = { GetNext: i(361), IsSize: i(138), IsValue: i(836) };
},
function (t, e) {
t.exports = function (t) {
return 0 < t && 0 == (t & (t - 1));
};
},
function (t, e, i) {
t.exports = { Ceil: i(139), Floor: i(76), To: i(838) };
},
function (t, e) {
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), 0 === e ? t : ((t -= i), (t = e * Math.round(t / e)), n ? (i + t) / e : i + t);
};
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t) {
void 0 === t && (t = [(Date.now() * Math.random()).toString()]), (this.c = 1), (this.s0 = 0), (this.s1 = 0), (this.s2 = 0), (this.n = 0), (this.signs = [-1, 1]), t && this.init(t);
},
rnd: function () {
var t = 2091639 * this.s0 + 2.3283064365386963e-10 * this.c;
return (this.c = 0 | t), (this.s0 = this.s1), (this.s1 = this.s2), (this.s2 = t - this.c), this.s2;
},
hash: function (t) {
var e,
i = this.n;
t = t.toString();
for (var n = 0; n < t.length; n++) (e = 0.02519603282416938 * (i += t.charCodeAt(n))), (e -= i = e >>> 0), (i = (e *= i) >>> 0), (i += 4294967296 * (e -= i));
return 2.3283064365386963e-10 * ((this.n = i) >>> 0);
},
init: function (t) {
"string" == typeof t ? this.state(t) : this.sow(t);
},
sow: function (t) {
if (((this.n = 4022871197), (this.s0 = this.hash(" ")), (this.s1 = this.hash(" ")), (this.s2 = this.hash(" ")), (this.c = 1), t))
for (var e = 0; e < t.length && null != t[e]; e++) {
var i = t[e];
(this.s0 -= this.hash(i)), (this.s0 += ~~(this.s0 < 0)), (this.s1 -= this.hash(i)), (this.s1 += ~~(this.s1 < 0)), (this.s2 -= this.hash(i)), (this.s2 += ~~(this.s2 < 0));
}
},
integer: function () {
return 4294967296 * this.rnd();
},
frac: function () {
return this.rnd() + 11102230246251565e-32 * ((2097152 * this.rnd()) | 0);
},
real: function () {
return this.integer() + this.frac();
},
integerInRange: function (t, e) {
return Math.floor(this.realInRange(0, e - t + 1) + t);
},
between: function (t, e) {
return Math.floor(this.realInRange(0, e - t + 1) + t);
},
realInRange: function (t, e) {
return this.frac() * (e - t) + t;
},
normal: function () {
return 1 - 2 * this.frac();
},
uuid: function () {
var t = "",
e = "";
for (e = t = ""; t++ < 36; e += ~t % 5 | ((3 * t) & 4) ? (15 ^ t ? 8 ^ (this.frac() * (20 ^ t ? 16 : 4)) : 4).toString(16) : "-");
return e;
},
pick: function (t) {
return t[this.integerInRange(0, t.length - 1)];
},
sign: function () {
return this.pick(this.signs);
},
weightedPick: function (t) {
return t[~~(Math.pow(this.frac(), 2) * (t.length - 1) + 0.5)];
},
timestamp: function (t, e) {
return this.realInRange(t || 9466848e5, e || 1577862e6);
},
angle: function () {
return this.integerInRange(-180, 180);
},
rotation: function () {
return this.realInRange(-3.1415926, 3.1415926);
},
state: function (t) {
return (
"string" == typeof t && t.match(/^!rnd/) && ((t = t.split(",")), (this.c = parseFloat(t[1])), (this.s0 = parseFloat(t[2])), (this.s1 = parseFloat(t[3])), (this.s2 = parseFloat(t[4]))),
["!rnd", this.c, this.s0, this.s1, this.s2].join(",")
);
},
shuffle: function (t) {
for (var e = t.length - 1; 0 < e; e--) {
var i = Math.floor(this.frac() * (e + 1)),
n = t[i];
(t[i] = t[e]), (t[e] = n);
}
return t;
},
});
t.exports = n;
},
function (t, e) {
t.exports = function (t) {
for (var e = 0, i = 0; i < t.length; i++) e += +t[i];
return e / t.length;
};
},
function (t, e) {
t.exports = function (t, e, i) {
void 0 === e && (e = 0), void 0 === i && (i = 10);
var n = Math.pow(i, -e);
return Math.ceil(t * n) / n;
};
},
function (t, e) {
t.exports = function (t, e) {
return Math.abs(t - e);
};
},
function (t, e, i) {
var y = i(18),
n = i(0),
s = i(69),
r = i(1),
o = new s(),
a = new n({
initialize: function t(e, i, n, s) {
void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === n && (n = 0), void 0 === s && (s = t.DefaultOrder), (this._x = e), (this._y = i), (this._z = n), (this._order = s), (this.onChangeCallback = r);
},
x: {
get: function () {
return this._x;
},
set: function (t) {
(this._x = t), this.onChangeCallback(this);
},
},
y: {
get: function () {
return this._y;
},
set: function (t) {
(this._y = t), this.onChangeCallback(this);
},
},
z: {
get: function () {
return this._z;
},
set: function (t) {
(this._z = t), this.onChangeCallback(this);
},
},
order: {
get: function () {
return this._order;
},
set: function (t) {
(this._order = t), this.onChangeCallback(this);
},
},
set: function (t, e, i, n) {
return void 0 === n && (n = this._order), (this._x = t), (this._y = e), (this._z = i), (this._order = n), this.onChangeCallback(this), this;
},
copy: function (t) {
return this.set(t.x, t.y, t.z, t.order);
},
setFromQuaternion: function (t, e, i) {
return void 0 === e && (e = this._order), void 0 === i && (i = !1), o.fromQuat(t), this.setFromRotationMatrix(o, e, i);
},
setFromRotationMatrix: function (t, e, i) {
void 0 === e && (e = this._order), void 0 === i && (i = !1);
var n = t.val,
s = n[0],
r = n[4],
o = n[8],
a = n[1],
h = n[5],
l = n[9],
u = n[2],
c = n[6],
d = n[10],
f = 0,
p = 0,
g = 0,
v = 0.99999;
switch (e) {
case "XYZ":
(p = Math.asin(y(o, -1, 1))), Math.abs(o) < v ? ((f = Math.atan2(-l, d)), (g = Math.atan2(-r, s))) : (f = Math.atan2(c, h));
break;
case "YXZ":
(f = Math.asin(-y(l, -1, 1))), Math.abs(l) < v ? ((p = Math.atan2(o, d)), (g = Math.atan2(a, h))) : (p = Math.atan2(-u, s));
break;
case "ZXY":
(f = Math.asin(y(c, -1, 1))), (g = Math.abs(c) < v ? ((p = Math.atan2(-u, d)), Math.atan2(-r, h)) : Math.atan2(a, s));
break;
case "ZYX":
(p = Math.asin(-y(u, -1, 1))), (g = Math.abs(u) < v ? ((f = Math.atan2(c, d)), Math.atan2(a, s)) : Math.atan2(-r, h));
break;
case "YZX":
(g = Math.asin(y(a, -1, 1))), (p = Math.abs(a) < v ? ((f = Math.atan2(-l, h)), Math.atan2(-u, s)) : Math.atan2(o, d));
break;
case "XZY":
(g = Math.asin(-y(r, -1, 1))), Math.abs(r) < v ? ((f = Math.atan2(c, h)), (p = Math.atan2(o, s))) : (f = Math.atan2(-l, d));
}
return (this._x = f), (this._y = p), (this._z = g), (this._order = e), i && this.onChangeCallback(this), this;
},
});
(a.RotationOrders = ["XYZ", "YXZ", "ZXY", "ZYX", "YZX", "XZY"]), (a.DefaultOrder = "XYZ"), (t.exports = a);
},
function (t, e) {
t.exports = function (t, e, i) {
void 0 === e && (e = 0), void 0 === i && (i = 10);
var n = Math.pow(i, -e);
return Math.floor(t * n) / n;
};
},
function (t, e) {
t.exports = function (t, e) {
return t / e / 1e3;
};
},
function (t, e) {
t.exports = function (t) {
return t == parseFloat(t) ? !(t % 2) : void 0;
};
},
function (t, e) {
t.exports = function (t) {
return t === parseFloat(t) ? !(t % 2) : void 0;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return Math.min(t + e, i);
};
},
function (t, e) {
t.exports = function (t) {
var e = t.length;
if (0 === e) return 0;
t.sort(function (t, e) {
return t - e;
});
var i = Math.floor(e / 2);
return e % 2 == 0 ? (t[i] + t[i - 1]) / 2 : t[i];
};
},
function (t, e) {
t.exports = function (t, e, i) {
return Math.max(t - e, i);
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
void 0 === i && (i = e + 1);
var s = (t - e) / (i - e);
return 1 < s ? (void 0 !== n ? (s = (n - t) / (n - i)) < 0 && (s = 0) : (s = 1)) : s < 0 && (s = 0), s;
};
},
function (t, e) {
t.exports = function (t, e) {
void 0 === e && (e = 1);
var i = 2 * Math.random() * Math.PI;
return (t.x = Math.cos(i) * e), (t.y = Math.sin(i) * e), t;
};
},
function (t, e) {
t.exports = function (t, e) {
void 0 === e && (e = 1);
var i = 2 * Math.random() * Math.PI,
n = 2 * Math.random() - 1,
s = Math.sqrt(1 - n * n) * e;
return (t.x = Math.cos(i) * s), (t.y = Math.sin(i) * s), (t.z = n * e), t;
};
},
function (t, e) {
t.exports = function (t, e) {
return void 0 === e && (e = 1), (t.x = (2 * Math.random() - 1) * e), (t.y = (2 * Math.random() - 1) * e), (t.z = (2 * Math.random() - 1) * e), (t.w = (2 * Math.random() - 1) * e), t;
};
},
function (t, e) {
t.exports = function (t, e, i, n, s) {
return (t.x = e + s * Math.cos(n)), (t.y = i + s * Math.sin(n)), t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
void 0 === e && (e = 0), void 0 === i && (i = 10);
var n = Math.pow(i, -e);
return Math.round(t * n) / n;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
void 0 === e && (e = 1), void 0 === i && (i = 1), void 0 === n && (n = 1), (n *= Math.PI / t);
for (var s = [], r = [], o = 0; o < t; o++) (e += (i -= e * n) * n), (s[o] = i), (r[o] = e);
return { sin: r, cos: s, length: t };
};
},
function (t, e, i) {
var o = i(3);
t.exports = function (t, e, i, n) {
void 0 === n && (n = new o());
var s = 0,
r = 0;
return 0 < t && t <= e * i && (s = e - 1 < t ? t - (r = Math.floor(t / e)) * e : t), n.set(s, r);
};
},
function (t, e) {
t.exports = function (t, e, i) {
return Math.abs(t - e) <= i;
};
},
function (t, e, i) {
var n = i(39),
s = i(69),
r = i(365),
o = new s(),
a = new r(),
h = new n();
t.exports = function (t, e, i) {
return a.setAxisAngle(e, i), o.fromRotationTranslation(a, h.set(0, 0, 0)), t.transformMat4(o);
};
},
function (t, e) {
t.exports = "addtexture";
},
function (t, e) {
t.exports = "onerror";
},
function (t, e) {
t.exports = "onload";
},
function (t, e) {
t.exports = "ready";
},
function (t, e) {
t.exports = "removetexture";
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_BITMAP_MASK_FS",
"",
"precision mediump float;",
"",
"uniform vec2 uResolution;",
"uniform sampler2D uMainSampler;",
"uniform sampler2D uMaskSampler;",
"uniform bool uInvertMaskAlpha;",
"",
"void main ()",
"{",
" vec2 uv = gl_FragCoord.xy / uResolution;",
" vec4 mainColor = texture2D(uMainSampler, uv);",
" vec4 maskColor = texture2D(uMaskSampler, uv);",
" float alpha = mainColor.a;",
"",
" if (!uInvertMaskAlpha)",
" {",
" alpha *= (maskColor.a);",
" }",
" else",
" {",
" alpha *= (1.0 - maskColor.a);",
" }",
"",
" gl_FragColor = vec4(mainColor.rgb * alpha, alpha);",
"}",
"",
].join("\n");
},
function (t, e) {
t.exports = ["#define SHADER_NAME PHASER_BITMAP_MASK_VS", "", "precision mediump float;", "", "attribute vec2 inPosition;", "", "void main ()", "{", " gl_Position = vec4(inPosition, 0.0, 1.0);", "}", ""].join("\n");
},
function (t, e) {
t.exports = "pipelineafterflush";
},
function (t, e) {
t.exports = "pipelinebeforeflush";
},
function (t, e) {
t.exports = "pipelinebind";
},
function (t, e) {
t.exports = "pipelineboot";
},
function (t, e) {
t.exports = "pipelinedestroy";
},
function (t, e) {
t.exports = "pipelinerebind";
},
function (t, e) {
t.exports = "pipelineresize";
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_GRAPHICS_FS",
"",
"precision mediump float;",
"",
"varying vec4 outColor;",
"",
"void main ()",
"{",
" gl_FragColor = vec4(outColor.bgr * outColor.a, outColor.a);",
"}",
"",
].join("\n");
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_GRAPHICS_VS",
"",
"precision mediump float;",
"",
"uniform mat4 uProjectionMatrix;",
"",
"attribute vec2 inPosition;",
"attribute vec4 inColor;",
"",
"varying vec4 outColor;",
"",
"void main ()",
"{",
" gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",
"",
" outColor = inColor;",
"}",
"",
].join("\n");
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_LIGHT_FS",
"",
"precision mediump float;",
"",
"struct Light",
"{",
" vec2 position;",
" vec3 color;",
" float intensity;",
" float radius;",
"};",
"",
"const int kMaxLights = %LIGHT_COUNT%;",
"",
"uniform vec4 uCamera; /* x, y, rotation, zoom */",
"uniform vec2 uResolution;",
"uniform sampler2D uMainSampler;",
"uniform sampler2D uNormSampler;",
"uniform vec3 uAmbientLightColor;",
"uniform Light uLights[kMaxLights];",
"uniform mat3 uInverseRotationMatrix;",
"",
"varying vec2 outTexCoord;",
"varying vec4 outTint;",
"",
"void main()",
"{",
" vec3 finalColor = vec3(0.0, 0.0, 0.0);",
" vec4 color = texture2D(uMainSampler, outTexCoord) * vec4(outTint.bgr * outTint.a, outTint.a);",
" vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;",
" vec3 normal = normalize(uInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));",
" vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;",
"",
" for (int index = 0; index < kMaxLights; ++index)",
" {",
" Light light = uLights[index];",
" vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), 0.1);",
" vec3 lightNormal = normalize(lightDir);",
" float distToSurf = length(lightDir) * uCamera.w;",
" float diffuseFactor = max(dot(normal, lightNormal), 0.0);",
" float radius = (light.radius / res.x * uCamera.w) * uCamera.w;",
" float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);",
" vec3 diffuse = light.color * diffuseFactor;",
" finalColor += (attenuation * diffuse) * light.intensity;",
" }",
"",
" vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);",
"",
" gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);",
"}",
"",
].join("\n");
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_MULTI_FS",
"",
"precision mediump float;",
"",
"uniform sampler2D uMainSampler[%count%];",
"",
"varying vec2 outTexCoord;",
"varying float outTexId;",
"varying float outTintEffect;",
"varying vec4 outTint;",
"",
"void main ()",
"{",
" vec4 texture;",
"",
" %forloop%",
"",
" vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);",
"",
" // Multiply texture tint",
" vec4 color = texture * texel;",
"",
" if (outTintEffect == 1.0)",
" {",
" // Solid color + texture alpha",
" color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);",
" }",
" else if (outTintEffect == 2.0)",
" {",
" // Solid color, no texture",
" color = texel;",
" }",
"",
" gl_FragColor = color;",
"}",
"",
].join("\n");
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_MULTI_VS",
"",
"precision mediump float;",
"",
"uniform mat4 uProjectionMatrix;",
"",
"attribute vec2 inPosition;",
"attribute vec2 inTexCoord;",
"attribute float inTexId;",
"attribute float inTintEffect;",
"attribute vec4 inTint;",
"",
"varying vec2 outTexCoord;",
"varying float outTexId;",
"varying float outTintEffect;",
"varying vec4 outTint;",
"",
"void main ()",
"{",
" gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",
"",
" outTexCoord = inTexCoord;",
" outTexId = inTexId;",
" outTint = inTint;",
" outTintEffect = inTintEffect;",
"}",
"",
].join("\n");
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_POINTLIGHT_FS",
"",
"precision mediump float;",
"",
"uniform vec2 uResolution;",
"uniform float uCameraZoom;",
"",
"varying vec4 lightPosition;",
"varying vec4 lightColor;",
"varying float lightRadius;",
"varying float lightAttenuation;",
"",
"void main ()",
"{",
" vec2 center = (lightPosition.xy + 1.0) * (uResolution.xy * 0.5);",
"",
" float distToSurf = length(center - gl_FragCoord.xy);",
"",
" float radius = 1.0 - distToSurf / (lightRadius * uCameraZoom);",
"",
" float intensity = smoothstep(0.0, 1.0, radius * lightAttenuation);",
"",
" vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor;",
"",
" gl_FragColor = vec4(color.rgb * lightColor.a, color.a);",
"}",
"",
].join("\n");
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_POINTLIGHT_VS",
"",
"precision mediump float;",
"",
"uniform mat4 uProjectionMatrix;",
"",
"attribute vec2 inPosition;",
"attribute vec2 inLightPosition;",
"attribute vec4 inLightColor;",
"attribute float inLightRadius;",
"attribute float inLightAttenuation;",
"",
"varying vec4 lightPosition;",
"varying vec4 lightColor;",
"varying float lightRadius;",
"varying float lightAttenuation;",
"",
"void main ()",
"{",
" lightColor = inLightColor;",
" lightRadius = inLightRadius;",
" lightAttenuation = inLightAttenuation;",
" lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);",
"",
" gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",
"}",
"",
].join("\n");
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_SINGLE_FS",
"",
"precision mediump float;",
"",
"uniform sampler2D uMainSampler;",
"",
"varying vec2 outTexCoord;",
"varying float outTintEffect;",
"varying vec4 outTint;",
"",
"void main ()",
"{",
" vec4 texture = texture2D(uMainSampler, outTexCoord);",
" vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);",
"",
" // Multiply texture tint",
" vec4 color = texture * texel;",
"",
" if (outTintEffect == 1.0)",
" {",
" // Solid color + texture alpha",
" color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);",
" }",
" else if (outTintEffect == 2.0)",
" {",
" // Solid color, no texture",
" color = texel;",
" }",
"",
" gl_FragColor = color;",
"}",
"",
].join("\n");
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_SINGLE_VS",
"",
"precision mediump float;",
"",
"uniform mat4 uProjectionMatrix;",
"",
"attribute vec2 inPosition;",
"attribute vec2 inTexCoord;",
"attribute float inTexId;",
"attribute float inTintEffect;",
"attribute vec4 inTint;",
"",
"varying vec2 outTexCoord;",
"varying float outTintEffect;",
"varying vec4 outTint;",
"",
"void main ()",
"{",
" gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",
"",
" outTexCoord = inTexCoord;",
" outTint = inTint;",
" outTintEffect = inTintEffect;",
"}",
"",
].join("\n");
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_ADD_BLEND_FS",
"",
"precision mediump float;",
"",
"uniform sampler2D uMainSampler1;",
"uniform sampler2D uMainSampler2;",
"uniform float uStrength;",
"",
"varying vec2 outTexCoord;",
"",
"void main ()",
"{",
" vec4 frame1 = texture2D(uMainSampler1, outTexCoord);",
" vec4 frame2 = texture2D(uMainSampler2, outTexCoord);",
"",
" gl_FragColor = frame1 + frame2 * uStrength;",
"}",
"",
].join("\n");
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_COLORMATRIX_FS",
"",
"precision mediump float;",
"",
"uniform sampler2D uMainSampler;",
"uniform float uColorMatrix[20];",
"uniform float uAlpha;",
"",
"varying vec2 outTexCoord;",
"",
"void main ()",
"{",
" vec4 c = texture2D(uMainSampler, outTexCoord);",
"",
" if (uAlpha == 0.0)",
" {",
" gl_FragColor = c;",
"",
" return;",
" }",
"",
" if (c.a > 0.0)",
" {",
" c.rgb /= c.a;",
" }",
"",
" vec4 result;",
"",
" result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];",
" result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];",
" result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];",
" result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];",
"",
" vec3 rgb = mix(c.rgb, result.rgb, uAlpha);",
"",
" rgb *= result.a;",
"",
" gl_FragColor = vec4(rgb, result.a);",
"}",
"",
].join("\n");
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_COPY_FS",
"",
"precision mediump float;",
"",
"uniform sampler2D uMainSampler;",
"uniform float uBrightness;",
"",
"varying vec2 outTexCoord;",
"",
"void main ()",
"{",
" gl_FragColor = texture2D(uMainSampler, outTexCoord) * uBrightness;",
"}",
"",
].join("\n");
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_LINEAR_BLEND_FS",
"",
"precision mediump float;",
"",
"uniform sampler2D uMainSampler1;",
"uniform sampler2D uMainSampler2;",
"uniform float uStrength;",
"",
"varying vec2 outTexCoord;",
"",
"void main ()",
"{",
" vec4 frame1 = texture2D(uMainSampler1, outTexCoord);",
" vec4 frame2 = texture2D(uMainSampler2, outTexCoord);",
"",
" gl_FragColor = mix(frame1, frame2 * uStrength, 0.5);",
"}",
"",
].join("\n");
},
function (t, e, i) {
t.exports = { GenerateTexture: i(388), Palettes: i(889) };
},
function (t, e, i) {
t.exports = { ARNE16: i(389), C64: i(890), CGA: i(891), JMP: i(892), MSX: i(893) };
},
function (t, e) {
t.exports = {
0: "#000",
1: "#fff",
2: "#8b4131",
3: "#7bbdc5",
4: "#8b41ac",
5: "#6aac41",
6: "#3931a4",
7: "#d5de73",
8: "#945a20",
9: "#5a4100",
A: "#bd736a",
B: "#525252",
C: "#838383",
D: "#acee8b",
E: "#7b73de",
F: "#acacac",
};
},
function (t, e) {
t.exports = {
0: "#000",
1: "#2234d1",
2: "#0c7e45",
3: "#44aacc",
4: "#8a3622",
5: "#5c2e78",
6: "#aa5c3d",
7: "#b5b5b5",
8: "#5e606e",
9: "#4c81fb",
A: "#6cd947",
B: "#7be2f9",
C: "#eb8a60",
D: "#e23d69",
E: "#ffd93f",
F: "#fff",
};
},
function (t, e) {
t.exports = {
0: "#000",
1: "#191028",
2: "#46af45",
3: "#a1d685",
4: "#453e78",
5: "#7664fe",
6: "#833129",
7: "#9ec2e8",
8: "#dc534b",
9: "#e18d79",
A: "#d6b97b",
B: "#e9d8a1",
C: "#216c4b",
D: "#d365c8",
E: "#afaab9",
F: "#f5f4eb",
};
},
function (t, e) {
t.exports = {
0: "#000",
1: "#191028",
2: "#46af45",
3: "#a1d685",
4: "#453e78",
5: "#7664fe",
6: "#833129",
7: "#9ec2e8",
8: "#dc534b",
9: "#e18d79",
A: "#d6b97b",
B: "#e9d8a1",
C: "#216c4b",
D: "#d365c8",
E: "#afaab9",
F: "#fff",
};
},
function (t, e, i) {
t.exports = { Path: i(895), MoveTo: i(393), CubicBezier: i(390), Curve: i(94), Ellipse: i(391), Line: i(392), QuadraticBezier: i(394), Spline: i(395) };
},
function (t, e, i) {
var n = i(0),
u = i(390),
l = i(391),
s = i(5),
r = i(392),
o = i(393),
a = i(394),
h = i(10),
c = i(395),
d = i(3),
f = i(14),
p = new n({
initialize: function (t, e) {
void 0 === t && (t = 0),
void 0 === e && (e = 0),
(this.name = ""),
(this.curves = []),
(this.cacheLengths = []),
(this.autoClose = !1),
(this.startPoint = new d()),
(this._tmpVec2A = new d()),
(this._tmpVec2B = new d()),
"object" == typeof t ? this.fromJSON(t) : this.startPoint.set(t, e);
},
add: function (t) {
return this.curves.push(t), this;
},
circleTo: function (t, e, i) {
return void 0 === e && (e = !1), this.ellipseTo(t, t, 0, 360, e, i);
},
closePath: function () {
var t = this.curves[0].getPoint(0),
e = this.curves[this.curves.length - 1].getPoint(1);
return t.equals(e) || this.curves.push(new r(e, t)), this;
},
cubicBezierTo: function (t, e, i, n, s, r) {
var o,
a,
h = this.getEndPoint(),
l = t instanceof d ? ((o = t), (a = e), i) : ((o = new d(i, n)), (a = new d(s, r)), new d(t, e));
return this.add(new u(h, o, a, l));
},
quadraticBezierTo: function (t, e, i, n) {
var s,
r = this.getEndPoint(),
o = t instanceof d ? ((s = t), e) : ((s = new d(i, n)), new d(t, e));
return this.add(new a(r, s, o));
},
draw: function (t, e) {
for (var i = 0; i < this.curves.length; i++) {
var n = this.curves[i];
n.active && n.draw(t, e);
}
return t;
},
ellipseTo: function (t, e, i, n, s, r) {
var o = new l(0, 0, t, e, i, n, s, r),
a = this.getEndPoint(this._tmpVec2A),
h = o.getStartPoint(this._tmpVec2B);
return a.subtract(h), (o.x = a.x), (o.y = a.y), this.add(o);
},
fromJSON: function (t) {
(this.curves = []), (this.cacheLengths = []), this.startPoint.set(t.x, t.y), (this.autoClose = t.autoClose);
for (var e = 0; e < t.curves.length; e++) {
var i = t.curves[e];
switch (i.type) {
case "LineCurve":
this.add(r.fromJSON(i));
break;
case "EllipseCurve":
this.add(l.fromJSON(i));
break;
case "SplineCurve":
this.add(c.fromJSON(i));
break;
case "CubicBezierCurve":
this.add(u.fromJSON(i));
break;
case "QuadraticBezierCurve":
this.add(a.fromJSON(i));
}
}
return this;
},
getBounds: function (t, e) {
void 0 === t && (t = new h()), void 0 === e && (e = 16), (t.x = Number.MAX_VALUE), (t.y = Number.MAX_VALUE);
for (var i = new h(), n = f.MIN_SAFE_INTEGER, s = f.MIN_SAFE_INTEGER, r = 0; r < this.curves.length; r++) {
var o = this.curves[r];
o.active && (o.getBounds(i, e), (t.x = Math.min(t.x, i.x)), (t.y = Math.min(t.y, i.y)), (n = Math.max(n, i.right)), (s = Math.max(s, i.bottom)));
}
return (t.right = n), (t.bottom = s), t;
},
getCurveLengths: function () {
if (this.cacheLengths.length === this.curves.length) return this.cacheLengths;
for (var t = [], e = 0, i = 0; i < this.curves.length; i++) (e += this.curves[i].getLength()), t.push(e);
return (this.cacheLengths = t);
},
getEndPoint: function (t) {
return void 0 === t && (t = new d()), 0 < this.curves.length ? this.curves[this.curves.length - 1].getPoint(1, t) : t.copy(this.startPoint), t;
},
getLength: function () {
var t = this.getCurveLengths();
return t[t.length - 1];
},
getPoint: function (t, e) {
void 0 === e && (e = new d());
for (var i = t * this.getLength(), n = this.getCurveLengths(), s = 0; s < n.length; ) {
if (n[s] >= i) {
var r = n[s] - i,
o = this.curves[s],
a = o.getLength(),
h = 0 === a ? 0 : 1 - r / a;
return o.getPointAt(h, e);
}
s++;
}
return null;
},
getPoints: function (t) {
void 0 === t && (t = 12);
for (var e, i = [], n = 0; n < this.curves.length; n++) {
var s = this.curves[n];
if (s.active)
for (var r = s.getResolution(t), o = s.getPoints(r), a = 0; a < o.length; a++) {
var h = o[a];
(e && e.equals(h)) || (i.push(h), (e = h));
}
}
return this.autoClose && 1 < i.length && !i[i.length - 1].equals(i[0]) && i.push(i[0]), i;
},
getRandomPoint: function (t) {
return void 0 === t && (t = new d()), this.getPoint(Math.random(), t);
},
getSpacedPoints: function (t) {
void 0 === t && (t = 40);
for (var e = [], i = 0; i <= t; i++) e.push(this.getPoint(i / t));
return this.autoClose && e.push(e[0]), e;
},
getStartPoint: function (t) {
return void 0 === t && (t = new d()), t.copy(this.startPoint);
},
getTangent: function (t, e) {
void 0 === e && (e = new d());
for (var i = t * this.getLength(), n = this.getCurveLengths(), s = 0; s < n.length; ) {
if (n[s] >= i) {
var r = n[s] - i,
o = this.curves[s],
a = o.getLength(),
h = 0 === a ? 0 : 1 - r / a;
return o.getTangentAt(h, e);
}
s++;
}
return null;
},
lineTo: function (t, e) {
t instanceof d ? this._tmpVec2B.copy(t) : this._tmpVec2B.set(t, e);
var i = this.getEndPoint(this._tmpVec2A);
return this.add(new r([i.x, i.y, this._tmpVec2B.x, this._tmpVec2B.y]));
},
splineTo: function (t) {
return t.unshift(this.getEndPoint()), this.add(new c(t));
},
moveTo: function (t, e) {
return t instanceof d ? this.add(new o(t.x, t.y)) : this.add(new o(t, e));
},
toJSON: function () {
for (var t = [], e = 0; e < this.curves.length; e++) t.push(this.curves[e].toJSON());
return { type: "Path", x: this.startPoint.x, y: this.startPoint.y, autoClose: this.autoClose, curves: t };
},
updateArcLengths: function () {
(this.cacheLengths = []), this.getCurveLengths();
},
destroy: function () {
(this.curves.length = 0), (this.cacheLengths.length = 0), (this.startPoint = void 0);
},
});
s.register("path", function (t, e) {
return new p(t, e);
}),
(t.exports = p);
},
function (t, e, i) {
t.exports = { DataManager: i(101), DataManagerPlugin: i(897), Events: i(315) };
},
function (t, e, i) {
var n = i(0),
s = i(101),
r = i(24),
o = i(20),
a = new n({
Extends: s,
initialize: function (t) {
s.call(this, t, t.sys.events), (this.scene = t), (this.systems = t.sys), t.sys.events.once(o.BOOT, this.boot, this), t.sys.events.on(o.START, this.start, this);
},
boot: function () {
(this.events = this.systems.events), this.events.once(o.DESTROY, this.destroy, this);
},
start: function () {
this.events.once(o.SHUTDOWN, this.shutdown, this);
},
shutdown: function () {
this.systems.events.off(o.SHUTDOWN, this.shutdown, this);
},
destroy: function () {
s.prototype.destroy.call(this), this.events.off(o.START, this.start, this), (this.scene = null), (this.systems = null);
},
});
r.register("DataManagerPlugin", a, "data"), (t.exports = a);
},
function (t, e, i) {
t.exports = { Align: i(899), BaseShader: i(396), Bounds: i(902), Canvas: i(906), Color: i(397), ColorMatrix: i(198), Masks: i(916), RGB: i(200) };
},
function (t, e, i) {
var n = i(123),
s = i(17)(!1, (s = { In: i(900), To: i(901) }), n);
t.exports = s;
},
function (t, e, i) {
t.exports = { BottomCenter: i(290), BottomLeft: i(291), BottomRight: i(292), Center: i(293), LeftCenter: i(295), QuickSet: i(289), RightCenter: i(296), TopCenter: i(297), TopLeft: i(298), TopRight: i(299) };
},
function (t, e, i) {
t.exports = {
BottomCenter: i(277),
BottomLeft: i(278),
BottomRight: i(279),
LeftBottom: i(280),
LeftCenter: i(281),
LeftTop: i(282),
QuickSet: i(276),
RightBottom: i(283),
RightCenter: i(284),
RightTop: i(285),
TopCenter: i(286),
TopLeft: i(287),
TopRight: i(288),
};
},
function (t, e, i) {
t.exports = {
CenterOn: i(294),
GetBottom: i(42),
GetBounds: i(903),
GetCenterX: i(87),
GetCenterY: i(89),
GetLeft: i(43),
GetOffsetX: i(904),
GetOffsetY: i(905),
GetRight: i(44),
GetTop: i(45),
SetBottom: i(55),
SetCenterX: i(88),
SetCenterY: i(90),
SetLeft: i(53),
SetRight: i(54),
SetTop: i(52),
};
},
function (t, e, i) {
var s = i(42),
r = i(43),
o = i(44),
a = i(45);
t.exports = function (t, e) {
void 0 === e && (e = {});
var i = r(t),
n = a(t);
return (e.x = i), (e.y = n), (e.width = o(t) - i), (e.height = s(t) - n), e;
};
},
function (t, e) {
t.exports = function (t) {
return t.width * t.originX;
};
},
function (t, e) {
t.exports = function (t) {
return t.height * t.originY;
};
},
function (t, e, i) {
t.exports = { CanvasInterpolation: i(367), CanvasPool: i(31), Smoothing: i(192), TouchAction: i(907), UserSelect: i(908) };
},
function (t, e) {
t.exports = function (t, e) {
return void 0 === e && (e = "none"), (t.style.msTouchAction = e), (t.style["ms-touch-action"] = e), (t.style["touch-action"] = e), t;
};
},
function (t, e) {
t.exports = function (e, i) {
return (
void 0 === i && (i = "none"),
["-webkit-", "-khtml-", "-moz-", "-ms-", ""].forEach(function (t) {
e.style[t + "user-select"] = i;
}),
(e.style["-webkit-touch-callout"] = i),
(e.style["-webkit-tap-highlight-color"] = "rgba(0, 0, 0, 0)"),
e
);
};
},
function (t, e, i) {
var l = i(103);
t.exports = function (t) {
void 0 === t && (t = 1024);
var e = [],
i = 255,
n = 0,
s = 0;
for (h = 0; h <= 255; h++) e.push({ r: i, g: h, b: s, color: l(i, h, s) });
for (h = n = 255; 0 <= h; h--) e.push({ r: h, g: n, b: s, color: l(h, n, s) });
for (h = i = 0; h <= 255; h++, n--) e.push({ r: i, g: n, b: h, color: l(i, n, h) });
for (s = 255, h = n = 0; h <= 255; h++, s--, i++) e.push({ r: i, g: n, b: s, color: l(i, n, s) });
if (1024 === t) return e;
for (var r = [], o = 0, a = 1024 / t, h = 0; h < t; h++) r.push(e[Math.floor(o)]), (o += a);
return r;
};
},
function (t, e) {
t.exports = function (t) {
var e = { r: (t >> 16) & 255, g: (t >> 8) & 255, b: 255 & t, a: 255 };
return 16777215 < t && (e.a = t >>> 24), e;
};
},
function (t, e, i) {
var h = i(38),
l = i(399);
t.exports = function (t, e, i) {
var n,
s,
r = i,
o = i,
a = i;
return 0 !== e && ((r = l((s = 2 * i - (n = i < 0.5 ? i * (1 + e) : i + e - i * e)), n, t + 1 / 3)), (o = l(s, n, t)), (a = l(s, n, t - 1 / 3))), new h().setGLTo(r, o, a, 1);
};
},
function (t, e, i) {
var s = i(188);
t.exports = function (t, e) {
void 0 === t && (t = 1), void 0 === e && (e = 1);
for (var i = [], n = 0; n <= 359; n++) i.push(s(n / 359, t, e));
return i;
};
},
function (t, e, i) {
function o(t, e, i, n, s, r, o, a) {
void 0 === o && (o = 100), void 0 === a && (a = 0);
var h = a / o;
return { r: l(t, n, h), g: l(e, s, h), b: l(i, r, h) };
}
var l = i(135);
t.exports = {
RGBWithRGB: o,
ColorWithRGB: function (t, e, i, n, s, r) {
return void 0 === s && (s = 100), void 0 === r && (r = 0), o(t.r, t.g, t.b, e, i, n, s, r);
},
ColorWithColor: function (t, e, i, n) {
return void 0 === i && (i = 100), void 0 === n && (n = 0), o(t.r, t.g, t.b, e.r, e.g, e.b, i, n);
},
};
},
function (t, e, i) {
var n = i(195),
s = i(38);
t.exports = function (t, e) {
return void 0 === t && (t = 0), void 0 === e && (e = 255), new s(n(t, e), n(t, e), n(t, e));
};
},
function (t, e, i) {
var r = i(398);
t.exports = function (t, e, i, n, s) {
return void 0 === n && (n = 255), void 0 === s && (s = "#"), "#" === s ? "#" + ((1 << 24) + (t << 16) + (e << 8) + i).toString(16).slice(1, 7) : "0x" + r(n) + r(t) + r(e) + r(i);
};
},
function (t, e, i) {
t.exports = { BitmapMask: i(310), GeometryMask: i(311) };
},
function (t, e, i) {
var n = { AddToDOM: i(142), DOMContentLoaded: i(400), GetInnerHeight: i(401), GetScreenOrientation: i(402), GetTarget: i(407), ParseXML: i(408), RemoveFromDOM: i(202), RequestAnimationFrame: i(386) };
t.exports = n;
},
function (t, e, i) {
t.exports = { EventEmitter: i(919) };
},
function (t, e, i) {
var n = i(0),
s = i(9),
r = i(24),
o = new n({
Extends: s,
initialize: function () {
s.call(this);
},
shutdown: function () {
this.removeAllListeners();
},
destroy: function () {
this.removeAllListeners();
},
});
r.register("EventEmitter", o, "events"), (t.exports = o);
},
function (t, e, i) {
var n = i(142),
s = i(321),
r = i(325),
o = i(31),
a = i(0),
h = i(346),
l = i(921),
u = i(366),
c = i(101),
d = i(384),
f = i(347),
p = i(400),
g = i(9),
v = i(22),
y = i(409),
m = i(24),
x = i(414),
b = i(415),
w = i(417),
T = i(106),
S = i(422),
_ = i(385),
E = i(387),
P = i(426),
A = new a({
initialize: function (t) {
(this.config = new h(t)),
(this.renderer = null),
(this.domContainer = null),
(this.canvas = null),
(this.context = null),
(this.isBooted = !1),
(this.isRunning = !1),
(this.events = new g()),
(this.anims = new s(this)),
(this.textures = new S(this)),
(this.cache = new r(this)),
(this.registry = new c(this)),
(this.input = new y(this, this.config)),
(this.scene = new w(this, this.config.sceneConfig)),
(this.device = f),
(this.scale = new b(this, this.config)),
(this.sound = null),
(this.sound = P.create(this)),
(this.loop = new _(this, this.config.fps)),
(this.plugins = new x(this, this.config)),
(this.pendingDestroy = !1),
(this.removeCanvas = !1),
(this.noReturn = !1),
(this.hasFocus = !1),
p(this.boot.bind(this));
},
boot: function () {
m.hasCore("EventEmitter") &&
((this.isBooted = !0),
this.config.preBoot(this),
this.scale.preBoot(),
u(this),
l(this),
d(this),
n(this.canvas, this.config.parent),
this.textures.once(T.READY, this.texturesReady, this),
this.events.emit(v.BOOT));
},
texturesReady: function () {
this.events.emit(v.READY), this.start();
},
start: function () {
(this.isRunning = !0), this.config.postBoot(this), this.renderer ? this.loop.start(this.step.bind(this)) : this.loop.start(this.headlessStep.bind(this)), E(this);
var t = this.events;
t.on(v.HIDDEN, this.onHidden, this), t.on(v.VISIBLE, this.onVisible, this), t.on(v.BLUR, this.onBlur, this), t.on(v.FOCUS, this.onFocus, this);
},
step: function (t, e) {
if (this.pendingDestroy) return this.runDestroy();
var i = this.events;
i.emit(v.PRE_STEP, t, e), i.emit(v.STEP, t, e), this.scene.update(t, e), i.emit(v.POST_STEP, t, e);
var n = this.renderer;
n.preRender(), i.emit(v.PRE_RENDER, n, t, e), this.scene.render(n), n.postRender(), i.emit(v.POST_RENDER, n, t, e);
},
headlessStep: function (t, e) {
if (this.pendingDestroy) return this.runDestroy();
var i = this.events;
i.emit(v.PRE_STEP, t, e), i.emit(v.STEP, t, e), this.scene.update(t, e), i.emit(v.POST_STEP, t, e), i.emit(v.PRE_RENDER), i.emit(v.POST_RENDER);
},
onHidden: function () {
this.loop.pause(), this.events.emit(v.PAUSE);
},
onVisible: function () {
this.loop.resume(), this.events.emit(v.RESUME);
},
onBlur: function () {
(this.hasFocus = !1), this.loop.blur();
},
onFocus: function () {
(this.hasFocus = !0), this.loop.focus();
},
getFrame: function () {
return this.loop.frame;
},
getTime: function () {
return this.loop.now;
},
destroy: function (t, e) {
void 0 === e && (e = !1), (this.pendingDestroy = !0), (this.removeCanvas = t), (this.noReturn = e);
},
runDestroy: function () {
this.scene.destroy(),
this.events.emit(v.DESTROY),
this.events.removeAllListeners(),
this.renderer && this.renderer.destroy(),
this.removeCanvas && this.canvas && (o.remove(this.canvas), this.canvas.parentNode && this.canvas.parentNode.removeChild(this.canvas)),
this.domContainer && this.domContainer.parentNode.removeChild(this.domContainer),
this.loop.destroy(),
(this.pendingDestroy = !1);
},
});
t.exports = A;
},
function (t, e, i) {
var n = i(142);
t.exports = function (t) {
var e,
i = t.config;
i.parent &&
i.domCreateContainer &&
(((e = document.createElement("div")).style.cssText = [
"display: block;",
"width: " + t.scale.width + "px;",
"height: " + t.scale.height + "px;",
"padding: 0; margin: 0;",
"position: absolute;",
"overflow: hidden;",
"pointer-events: " + i.domPointerEvents + ";",
"transform: scale(1);",
"transform-origin: left top;",
].join(" ")),
(t.domContainer = e),
n(e, i.parent));
};
},
function (t, e) {
t.exports = "boot";
},
function (t, e) {
t.exports = "destroy";
},
function (t, e) {
t.exports = "dragend";
},
function (t, e) {
t.exports = "dragenter";
},
function (t, e) {
t.exports = "drag";
},
function (t, e) {
t.exports = "dragleave";
},
function (t, e) {
t.exports = "dragover";
},
function (t, e) {
t.exports = "dragstart";
},
function (t, e) {
t.exports = "drop";
},
function (t, e) {
t.exports = "gameout";
},
function (t, e) {
t.exports = "gameover";
},
function (t, e) {
t.exports = "gameobjectdown";
},
function (t, e) {
t.exports = "dragend";
},
function (t, e) {
t.exports = "dragenter";
},
function (t, e) {
t.exports = "drag";
},
function (t, e) {
t.exports = "dragleave";
},
function (t, e) {
t.exports = "dragover";
},
function (t, e) {
t.exports = "dragstart";
},
function (t, e) {
t.exports = "drop";
},
function (t, e) {
t.exports = "gameobjectmove";
},
function (t, e) {
t.exports = "gameobjectout";
},
function (t, e) {
t.exports = "gameobjectover";
},
function (t, e) {
t.exports = "pointerdown";
},
function (t, e) {
t.exports = "pointermove";
},
function (t, e) {
t.exports = "pointerout";
},
function (t, e) {
t.exports = "pointerover";
},
function (t, e) {
t.exports = "pointerup";
},
function (t, e) {
t.exports = "wheel";
},
function (t, e) {
t.exports = "gameobjectup";
},
function (t, e) {
t.exports = "gameobjectwheel";
},
function (t, e) {
t.exports = "boot";
},
function (t, e) {
t.exports = "process";
},
function (t, e) {
t.exports = "update";
},
function (t, e) {
t.exports = "pointerdown";
},
function (t, e) {
t.exports = "pointerdownoutside";
},
function (t, e) {
t.exports = "pointermove";
},
function (t, e) {
t.exports = "pointerout";
},
function (t, e) {
t.exports = "pointerover";
},
function (t, e) {
t.exports = "pointerup";
},
function (t, e) {
t.exports = "pointerupoutside";
},
function (t, e) {
t.exports = "wheel";
},
function (t, e) {
t.exports = "pointerlockchange";
},
function (t, e) {
t.exports = "preupdate";
},
function (t, e) {
t.exports = "shutdown";
},
function (t, e) {
t.exports = "start";
},
function (t, e) {
t.exports = "update";
},
function (t, e) {
t.exports = "addfile";
},
function (t, e) {
t.exports = "complete";
},
function (t, e) {
t.exports = "filecomplete";
},
function (t, e) {
t.exports = "filecomplete-";
},
function (t, e) {
t.exports = "loaderror";
},
function (t, e) {
t.exports = "load";
},
function (t, e) {
t.exports = "fileprogress";
},
function (t, e) {
t.exports = "postprocess";
},
function (t, e) {
t.exports = "progress";
},
function (t, e) {
t.exports = "start";
},
function (t, e, i) {
t.exports = {
game: "game",
renderer: "renderer",
anims: "anims",
cache: "cache",
plugins: "plugins",
registry: "registry",
scale: "scale",
sound: "sound",
textures: "textures",
events: "events",
cameras: "cameras",
add: "add",
make: "make",
scenePlugin: "scene",
displayList: "children",
lights: "lights",
data: "data",
input: "input",
load: "load",
time: "time",
tweens: "tweens",
arcadePhysics: "physics",
impactPhysics: "impact",
matterPhysics: "matter",
};
},
function (t, e) {
t.exports = function (t, e, i) {
if (i.getElementsByTagName("TextureAtlas")) {
var n = t.source[e];
t.add("__BASE", e, 0, 0, n.width, n.height);
for (var s = i.getElementsByTagName("SubTexture"), r = 0; r < s.length; r++) {
var o,
a,
h,
l,
u = s[r].attributes,
c = u.name.value,
d = parseInt(u.x.value, 10),
f = parseInt(u.y.value, 10),
p = parseInt(u.width.value, 10),
g = parseInt(u.height.value, 10),
v = t.add(c, e, d, f, p, g);
u.frameX &&
((o = Math.abs(parseInt(u.frameX.value, 10))), (a = Math.abs(parseInt(u.frameY.value, 10))), (h = parseInt(u.frameWidth.value, 10)), (l = parseInt(u.frameHeight.value, 10)), v.setTrim(p, g, o, a, h, l));
}
return t;
}
};
},
function (t, e) {
t.exports = function (t, e) {
var i = t.source[e];
return t.add("__BASE", e, 0, 0, i.width, i.height), t;
};
},
function (t, e) {
t.exports = function (t, e) {
var i = t.source[e];
return t.add("__BASE", e, 0, 0, i.width, i.height), t;
};
},
function (t, e, i) {
var u = i(77);
t.exports = function (t, e, i) {
if (i.frames || i.textures) {
var n = t.source[e];
t.add("__BASE", e, 0, 0, n.width, n.height);
for (var s = Array.isArray(i.textures) ? i.textures[e].frames : i.frames, r = 0; r < s.length; r++) {
var o = s[r],
a = t.add(o.filename, e, o.frame.x, o.frame.y, o.frame.w, o.frame.h);
o.trimmed && a.setTrim(o.sourceSize.w, o.sourceSize.h, o.spriteSourceSize.x, o.spriteSourceSize.y, o.spriteSourceSize.w, o.spriteSourceSize.h), o.rotated && ((a.rotated = !0), a.updateUVsInverted());
var h = o.anchor || o.pivot;
h && ((a.customPivot = !0), (a.pivotX = h.x), (a.pivotY = h.y)), (a.customData = u(o));
}
for (var l in i) "frames" !== l && (Array.isArray(i[l]) ? (t.customData[l] = i[l].slice(0)) : (t.customData[l] = i[l]));
return t;
}
};
},
function (t, e, i) {
var u = i(77);
t.exports = function (t, e, i) {
if (i.frames) {
var n = t.source[e];
t.add("__BASE", e, 0, 0, n.width, n.height);
var s,
r,
o,
a = i.frames;
for (var h in a)
a.hasOwnProperty(h) &&
((s = a[h]),
(r = t.add(h, e, s.frame.x, s.frame.y, s.frame.w, s.frame.h)),
s.trimmed && r.setTrim(s.sourceSize.w, s.sourceSize.h, s.spriteSourceSize.x, s.spriteSourceSize.y, s.spriteSourceSize.w, s.spriteSourceSize.h),
s.rotated && ((r.rotated = !0), r.updateUVsInverted()),
(o = s.anchor || s.pivot) && ((r.customPivot = !0), (r.pivotX = o.x), (r.pivotY = o.y)),
(r.customData = u(s)));
for (var l in i) "frames" !== l && (Array.isArray(i[l]) ? (t.customData[l] = i[l].slice(0)) : (t.customData[l] = i[l]));
return t;
}
};
},
function (t, e, i) {
var T = i(2);
t.exports = function (t, e, i, n, s, r, o) {
var a = T(o, "frameWidth", null),
h = T(o, "frameHeight", a);
if (null === a) throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");
var l = t.source[e];
t.add("__BASE", e, 0, 0, l.width, l.height);
var u = T(o, "startFrame", 0),
c = T(o, "endFrame", -1),
d = T(o, "margin", 0),
f = T(o, "spacing", 0),
p = Math.floor((s - d + f) / (a + f)) * Math.floor((r - d + f) / (h + f));
(p < u || u < -p) && (u = 0), u < 0 && (u = p + u), -1 !== c && (p = u + (c + 1));
for (var g = d, v = d, y = 0, m = 0, x = 0; x < p; x++) {
m = y = 0;
var b = g + a,
w = v + h;
s < b && (y = b - s), r < w && (m = w - r), t.add(x, e, i + g, n + v, a - y, h - m), s < (g += a + f) + a && ((g = d), (v += h + f));
}
return t;
};
},
function (t, e, i) {
var X = i(2);
t.exports = function (t, e, i) {
var n = X(i, "frameWidth", null),
s = X(i, "frameHeight", n);
if (!n) throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");
var r = t.source[0];
t.add("__BASE", 0, 0, 0, r.width, r.height);
var o = X(i, "startFrame", 0),
a = X(i, "endFrame", -1),
h = X(i, "margin", 0),
l = X(i, "spacing", 0),
u = e.cutX,
c = e.cutY,
d = e.cutWidth,
f = e.cutHeight,
p = e.realWidth,
g = e.realHeight,
v = Math.floor((p - h + l) / (n + l)),
y = Math.floor((g - h + l) / (s + l)),
m = v * y,
x = e.x,
b = n - x,
w = n - (p - d - x),
T = e.y,
S = s - T,
_ = s - (g - f - T);
(m < o || o < -m) && (o = 0), o < 0 && (o = m + o), -1 !== a && (m = o + (a + 1));
for (var E = h, P = h, A = 0, M = e.sourceIndex, C = 0; C < y; C++) {
for (var O = 0 === C, k = C === y - 1, R = 0; R < v; R++) {
var L,
I,
D,
F,
B,
N,
U = 0 === R,
Y = R === v - 1,
z = t.add(A, M, u + E, c + P, n, s);
(U || O || Y || k) &&
((L = U ? x : 0),
(I = O ? T : 0),
(F = D = 0),
U && (D += n - b),
Y && (D += n - w),
O && (F += s - S),
k && (F += s - _),
(B = n - D),
(N = s - F),
(z.cutWidth = B),
(z.cutHeight = N),
z.setTrim(n, s, L, I, B, N)),
(E += l),
(E += U ? b : Y ? w : n),
A++;
}
(E = h), (P += l), (P += O ? S : k ? _ : s);
}
return t;
};
},
function (t, e) {
function p(t, e, i, n) {
var s = g - n.y - n.height;
t.add(i, e, n.x, s, n.width, n.height);
}
var g = 0;
t.exports = function (t, e, i) {
var n = t.source[e];
t.add("__BASE", e, 0, 0, n.width, n.height), (g = n.height);
for (var s = i.split("\n"), r = /^[ ]*(- )*(\w+)+[: ]+(.*)/, o = "", a = "", h = { x: 0, y: 0, width: 0, height: 0 }, l = 0; l < s.length; l++) {
var u = s[l].match(r);
if (u) {
var c = "- " === u[1],
d = u[2],
f = u[3];
if ((c && (a !== o && (p(t, e, a, h), (o = a)), (h = { x: 0, y: 0, width: 0, height: 0 })), "name" !== d))
switch (d) {
case "x":
case "y":
case "width":
case "height":
h[d] = parseInt(f, 10);
}
else a = f;
}
}
return a !== o && p(t, e, a, h), t;
};
},
function (t, e) {
t.exports = "complete";
},
function (t, e) {
t.exports = "decoded";
},
function (t, e) {
t.exports = "decodedall";
},
function (t, e) {
t.exports = "destroy";
},
function (t, e) {
t.exports = "detune";
},
function (t, e) {
t.exports = "detune";
},
function (t, e) {
t.exports = "mute";
},
function (t, e) {
t.exports = "rate";
},
function (t, e) {
t.exports = "volume";
},
function (t, e) {
t.exports = "loop";
},
function (t, e) {
t.exports = "looped";
},
function (t, e) {
t.exports = "mute";
},
function (t, e) {
t.exports = "pan";
},
function (t, e) {
t.exports = "pauseall";
},
function (t, e) {
t.exports = "pause";
},
function (t, e) {
t.exports = "play";
},
function (t, e) {
t.exports = "rate";
},
function (t, e) {
t.exports = "resumeall";
},
function (t, e) {
t.exports = "resume";
},
function (t, e) {
t.exports = "seek";
},
function (t, e) {
t.exports = "stopall";
},
function (t, e) {
t.exports = "stop";
},
function (t, e) {
t.exports = "unlocked";
},
function (t, e) {
t.exports = "volume";
},
function (t, e, i) {
var n = {
Events: i(75),
DisplayList: i(1012),
GameObjectCreator: i(16),
GameObjectFactory: i(5),
UpdateList: i(1040),
Components: i(11),
GetCalcMatrix: i(19),
BuildGameObject: i(28),
BuildGameObjectAnimation: i(439),
GameObject: i(15),
BitmapText: i(148),
Blitter: i(213),
Bob: i(440),
Container: i(214),
DOMElement: i(442),
DynamicBitmapText: i(215),
Extern: i(444),
Graphics: i(216),
Group: i(113),
Image: i(125),
Layer: i(219),
Particles: i(1074),
PathFollower: i(457),
RenderTexture: i(221),
RetroFont: i(1082),
Rope: i(223),
Sprite: i(73),
Text: i(224),
GetTextSize: i(458),
MeasureText: i(460),
TextStyle: i(459),
TileSprite: i(225),
Zone: i(129),
Video: i(226),
Shape: i(34),
Arc: i(461),
Curve: i(462),
Ellipse: i(463),
Grid: i(464),
IsoBox: i(465),
IsoTriangle: i(466),
Line: i(467),
Polygon: i(468),
Rectangle: i(473),
Star: i(474),
Triangle: i(475),
Factories: {
Blitter: i(1130),
Container: i(1131),
DOMElement: i(1132),
DynamicBitmapText: i(1133),
Extern: i(1134),
Graphics: i(1135),
Group: i(1136),
Image: i(1137),
Layer: i(1138),
Particles: i(1139),
PathFollower: i(1140),
RenderTexture: i(1141),
Rope: i(1142),
Sprite: i(1143),
StaticBitmapText: i(1144),
Text: i(1145),
TileSprite: i(1146),
Zone: i(1147),
Video: i(1148),
Arc: i(1149),
Curve: i(1150),
Ellipse: i(1151),
Grid: i(1152),
IsoBox: i(1153),
IsoTriangle: i(1154),
Line: i(1155),
Polygon: i(1156),
Rectangle: i(1157),
Star: i(1158),
Triangle: i(1159),
},
Creators: {
Blitter: i(1160),
Container: i(1161),
DynamicBitmapText: i(1162),
Graphics: i(1163),
Group: i(1164),
Image: i(1165),
Layer: i(1166),
Particles: i(1167),
RenderTexture: i(1168),
Rope: i(1169),
Sprite: i(1170),
StaticBitmapText: i(1171),
Text: i(1172),
TileSprite: i(1173),
Zone: i(1174),
Video: i(1175),
},
};
(n.Shader = i(229)),
(n.Mesh = i(230)),
(n.PointLight = i(150)),
(n.Factories.Shader = i(1184)),
(n.Factories.Mesh = i(1185)),
(n.Factories.PointLight = i(1186)),
(n.Creators.Shader = i(1187)),
(n.Creators.Mesh = i(1188)),
(n.Creators.PointLight = i(1189)),
(n.Light = i(481)),
(n.LightsManager = i(482)),
(n.LightsPlugin = i(1190)),
(t.exports = n);
},
function (t, e, i) {
var n = i(0),
s = i(110),
r = i(24),
o = i(75),
a = i(20),
h = i(79),
l = new n({
Extends: s,
initialize: function (t) {
s.call(this, t),
(this.sortChildrenFlag = !1),
(this.scene = t),
(this.systems = t.sys),
(this.events = t.sys.events),
(this.addCallback = this.addChildCallback),
(this.removeCallback = this.removeChildCallback),
this.events.once(a.BOOT, this.boot, this),
this.events.on(a.START, this.start, this);
},
boot: function () {
this.events.once(a.DESTROY, this.destroy, this);
},
addChildCallback: function (t) {
t.displayList && t.displayList !== this && t.removeFromDisplayList(),
t.displayList || (this.queueDepthSort(), (t.displayList = this), t.emit(o.ADDED_TO_SCENE, t, this.scene), this.events.emit(a.ADDED_TO_SCENE, t, this.scene));
},
removeChildCallback: function (t) {
this.queueDepthSort(), (t.displayList = null), t.emit(o.REMOVED_FROM_SCENE, t, this.scene), this.events.emit(a.REMOVED_FROM_SCENE, t, this.scene);
},
start: function () {
this.events.once(a.SHUTDOWN, this.shutdown, this);
},
queueDepthSort: function () {
this.sortChildrenFlag = !0;
},
depthSort: function () {
this.sortChildrenFlag && (h(this.list, this.sortByDepth), (this.sortChildrenFlag = !1));
},
sortByDepth: function (t, e) {
return t._depth - e._depth;
},
getChildren: function () {
return this.list;
},
shutdown: function () {
for (var t = this.list, e = t.length; e--; ) t[e].destroy(!0);
(t.length = 0), this.events.off(a.SHUTDOWN, this.shutdown, this);
},
destroy: function () {
this.shutdown(), this.events.off(a.START, this.start, this), (this.scene = null), (this.systems = null), (this.events = null);
},
});
r.register("DisplayList", l, "displayList"), (t.exports = l);
},
function (t, e, i) {
t.exports = {
CheckMatrix: i(209),
MatrixToString: i(1014),
ReverseColumns: i(1015),
ReverseRows: i(1016),
Rotate180: i(1017),
RotateLeft: i(1018),
RotateMatrix: i(147),
RotateRight: i(1019),
Translate: i(1020),
TransposeMatrix: i(435),
};
},
function (t, e, i) {
var o = i(186),
a = i(209);
t.exports = function (t) {
var e = "";
if (!a(t)) return e;
for (var i = 0; i < t.length; i++) {
for (var n = 0; n < t[i].length; n++) {
var s = t[i][n].toString();
(e += "undefined" !== s ? o(s, 2) : "?"), n < t[i].length - 1 && (e += " |");
}
if (i < t.length - 1) {
e += "\n";
for (var r = 0; r < t[i].length; r++) (e += "---"), r < t[i].length - 1 && (e += "+");
e += "\n";
}
}
return e;
};
},
function (t, e) {
t.exports = function (t) {
return t.reverse();
};
},
function (t, e) {
t.exports = function (t) {
for (var e = 0; e < t.length; e++) t[e].reverse();
return t;
};
},
function (t, e, i) {
var n = i(147);
t.exports = function (t) {
return n(t, 180);
};
},
function (t, e, i) {
var n = i(147);
t.exports = function (t) {
return n(t, 90);
};
},
function (t, e, i) {
var n = i(147);
t.exports = function (t) {
return n(t, -90);
};
},
function (t, e, i) {
var r = i(178),
o = i(179);
t.exports = function (t, e, i) {
if ((void 0 === e && (e = 0), void 0 === i && (i = 0), 0 !== i && (i < 0 ? r(t, Math.abs(i)) : o(t, i)), 0 !== e))
for (var n = 0; n < t.length; n++) {
var s = t[n];
e < 0 ? r(s, Math.abs(e)) : o(s, e);
}
return t;
};
},
function (t, e) {
t.exports = function (t, e, i, n, s) {
if ((void 0 === s && (s = t), 0 < i)) {
var r = i - t.length;
if (r <= 0) return null;
}
if (!Array.isArray(e)) return -1 === t.indexOf(e) ? (t.push(e), n && n.call(s, e), e) : null;
for (var o = e.length - 1; 0 <= o; ) -1 !== t.indexOf(e[o]) && e.splice(o, 1), o--;
if (0 === (o = e.length)) return null;
0 < i && r < o && (e.splice(r), (o = r));
for (var a = 0; a < o; a++) {
var h = e[a];
t.push(h), n && n.call(s, h);
}
return e;
};
},
function (t, e) {
t.exports = function (t, e, i, n, s, r) {
if ((void 0 === i && (i = 0), void 0 === r && (r = t), 0 < n)) {
var o = n - t.length;
if (o <= 0) return null;
}
if (!Array.isArray(e)) return -1 === t.indexOf(e) ? (t.splice(i, 0, e), s && s.call(r, e), e) : null;
for (var a = e.length - 1; 0 <= a; ) -1 !== t.indexOf(e[a]) && e.pop(), a--;
if (0 === (a = e.length)) return null;
0 < n && o < a && (e.splice(o), (a = o));
for (var h = a - 1; 0 <= h; h--) {
var l = e[h];
t.splice(i, 0, l), s && s.call(r, l);
}
return e;
};
},
function (t, e) {
t.exports = function (t, e) {
var i = t.indexOf(e);
return -1 !== i && i < t.length && (t.splice(i, 1), t.push(e)), e;
};
},
function (t, e, i) {
var a = i(78);
t.exports = function (t, e, i, n, s) {
void 0 === n && (n = 0), void 0 === s && (s = t.length);
var r = 0;
if (a(t, n, s)) for (var o = n; o < s; o++) t[o][e] === i && r++;
return r;
};
},
function (t, e) {
t.exports = function (t, e, i) {
for (var n = [null], s = 3; s < arguments.length; s++) n.push(arguments[s]);
for (s = 0; s < t.length; s++) (n[0] = t[s]), e.apply(i, n);
return t;
};
},
function (t, e, i) {
var a = i(78);
t.exports = function (t, e, i, n, s) {
if ((void 0 === n && (n = 0), void 0 === s && (s = t.length), a(t, n, s))) {
for (var r = [null], o = 5; o < arguments.length; o++) r.push(arguments[o]);
for (o = n; o < s; o++) (r[0] = t[o]), e.apply(i, r);
}
return t;
};
},
function (t, e) {
t.exports = function (t, e) {
var i,
n,
s = t.indexOf(e);
return 0 < s && ((i = t[s - 1]), (n = t.indexOf(i)), (t[s] = i), (t[n] = e)), t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = t.indexOf(e);
if (-1 === n || i < 0 || i >= t.length) throw new Error("Supplied index out of bounds");
return n !== i && (t.splice(n, 1), t.splice(i, 0, e)), e;
};
},
function (t, e) {
t.exports = function (t, e) {
var i,
n,
s = t.indexOf(e);
return -1 !== s && s < t.length - 1 && ((i = t[s + 1]), (n = t.indexOf(i)), (t[s] = i), (t[n] = e)), t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
if (e === i) return t;
var n = t.indexOf(e),
s = t.indexOf(i);
if (n < 0 || s < 0) throw new Error("Supplied items must be elements of the same array");
return s < n || (t.splice(n, 1), s === t.length - 1 ? t.push(e) : t.splice(s, 0, e)), t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
if (e === i) return t;
var n = t.indexOf(e),
s = t.indexOf(i);
if (n < 0 || s < 0) throw new Error("Supplied items must be elements of the same array");
return n < s || (t.splice(n, 1), 0 === s ? t.unshift(e) : t.splice(s, 0, e)), t;
};
},
function (t, e, i) {
var o = i(363);
t.exports = function (t, e, i) {
void 0 === t && (t = 0), void 0 === e && (e = null), void 0 === i && (i = 1), null === e && ((e = t), (t = 0));
for (var n = [], s = Math.max(o((e - t) / (i || 1)), 0), r = 0; r < s; r++) n.push(t), (t += i);
return n;
};
},
function (t, e, i) {
var r = i(74);
t.exports = function (t, e, i, n) {
if ((void 0 === n && (n = t), e < 0 || e > t.length - 1)) throw new Error("Index out of bounds");
var s = r(t, e);
return i && i.call(n, s), s;
};
},
function (t, e, i) {
var l = i(78);
t.exports = function (t, e, i, n, s) {
if ((void 0 === e && (e = 0), void 0 === i && (i = t.length), void 0 === s && (s = t), l(t, e, i))) {
var r = i - e,
o = t.splice(e, r);
if (n)
for (var a = 0; a < o.length; a++) {
var h = o[a];
n.call(s, h);
}
return o;
}
return [];
};
},
function (t, e, i) {
var s = i(74);
t.exports = function (t, e, i) {
void 0 === e && (e = 0), void 0 === i && (i = t.length);
var n = e + Math.floor(Math.random() * i);
return s(t, n);
};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = t.indexOf(e),
s = t.indexOf(i);
return -1 !== n && -1 === s && ((t[n] = i), !0);
};
},
function (t, e) {
t.exports = function (t, e) {
var i = t.indexOf(e);
return -1 !== i && 0 < i && (t.splice(i, 1), t.unshift(e)), e;
};
},
function (t, e, i) {
var a = i(78);
t.exports = function (t, e, i, n, s) {
if ((void 0 === n && (n = 0), void 0 === s && (s = t.length), a(t, n, s)))
for (var r = n; r < s; r++) {
var o = t[r];
o.hasOwnProperty(e) && (o[e] = i);
}
return t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
if (e === i) return t;
var n = t.indexOf(e),
s = t.indexOf(i);
if (n < 0 || s < 0) throw new Error("Supplied items must be elements of the same array");
return (t[n] = i), (t[s] = e), t;
};
},
function (t, e, i) {
var n = i(0),
s = i(211),
r = i(24),
o = i(20),
a = new n({
Extends: s,
initialize: function (t) {
s.call(this), (this.checkQueue = !0), (this.scene = t), (this.systems = t.sys), t.sys.events.once(o.BOOT, this.boot, this), t.sys.events.on(o.START, this.start, this);
},
boot: function () {
this.systems.events.once(o.DESTROY, this.destroy, this);
},
start: function () {
var t = this.systems.events;
t.on(o.PRE_UPDATE, this.update, this), t.on(o.UPDATE, this.sceneUpdate, this), t.once(o.SHUTDOWN, this.shutdown, this);
},
sceneUpdate: function (t, e) {
for (var i = this._active, n = i.length, s = 0; s < n; s++) {
var r = i[s];
r.active && r.preUpdate.call(r, t, e);
}
},
shutdown: function () {
for (var t = this._active.length; t--; ) this._active[t].destroy(!0);
for (t = this._pending.length; t--; ) this._pending[t].destroy(!0);
for (t = this._destroy.length; t--; ) this._destroy[t].destroy(!0);
(this._toProcess = 0), (this._pending = []), (this._active = []), (this._destroy = []), this.removeAllListeners();
var e = this.systems.events;
e.off(o.PRE_UPDATE, this.update, this), e.off(o.UPDATE, this.sceneUpdate, this), e.off(o.SHUTDOWN, this.shutdown, this);
},
destroy: function () {
this.shutdown(), this.systems.events.off(o.START, this.start, this), (this.scene = null), (this.systems = null);
},
});
r.register("UpdateList", a, "updateList"), (t.exports = a);
},
function (t, e) {
t.exports = "add";
},
function (t, e) {
t.exports = "remove";
},
function (t, e) {
t.exports = function (t, e, i, n) {
if ((void 0 === i && (i = !1), void 0 === n))
return {
local: { x: 0, y: 0, width: 0, height: 0 },
global: { x: 0, y: 0, width: 0, height: 0 },
lines: { shortest: 0, longest: 0, lengths: null, height: 0 },
wrappedText: "",
words: [],
characters: [],
scaleX: 0,
scaleY: 0,
};
var s,
r,
o,
a = t.text,
h = a.length,
l = t.maxWidth,
u = t.wordWrapCharCode,
c = Number.MAX_VALUE,
d = Number.MAX_VALUE,
f = 0,
p = 0,
g = t.fontData.chars,
v = t.fontData.lineHeight,
y = t.letterSpacing,
m = 0,
x = 0,
b = 0,
w = null,
T = t._align,
S = 0,
_ = t.fontSize / t.fontData.size,
E = _ * t.scaleX,
P = _ * t.scaleY,
A = null,
M = 0,
C = [],
O = Number.MAX_VALUE,
k = 0,
R = 0,
L = 0,
I = [],
D = [],
F = null;
if (0 < l) {
for (U = 0; U < h; U++)
10 !== (b = a.charCodeAt(U))
? (w = g[b]) &&
(null !== A && (s = w.kerning[M]),
b === u
? null !== F && (I.push({ word: F.word, i: F.i, x: F.x * E, y: F.y * P, w: F.w * E, h: F.h * P, cr: !1 }), (F = null))
: (null === F && (F = { word: "", i: U, x: m, y: x, w: 0, h: v, cr: !1 }), (F.word = F.word.concat(a[U])), (F.w += w.xOffset + w.xAdvance + (void 0 !== s ? s : 0))),
(m += w.xAdvance + y),
(A = w),
(M = b))
: (null !== F && (I.push({ word: F.word, i: F.i, x: F.x * E, y: F.y * P, w: F.w * E, h: F.h * P, cr: !0 }), (F = null)), (m = 0), (x += v), (A = null));
null !== F && I.push({ word: F.word, i: F.i, x: F.x * E, y: F.y * P, w: F.w * E, h: F.h * P, cr: !1 }), (A = null);
for (var B = (M = x = m = 0), N = [], U = 0; U < I.length; U++) {
var Y,
z = I[U],
X = z.x,
V = z.x + z.w;
Y && ((B = X - (X - (Y.x + Y.w) + Y.w)), (Y = null)),
l < X - B || l < V - B ? (N.push(z.i - 1), (Y = z.cr ? (N.push(z.i + z.word.length), (B = 0), null) : z)) : z.cr && (N.push(z.i + z.word.length), (B = 0), (Y = null));
}
for (U = N.length - 1; 0 <= U; U--) (r = a), (o = N[U]), "\n", (a = r.substr(0, o) + "\n" + r.substr(o + 1));
(h = (n.wrappedText = a).length), (I = []), (F = null);
}
var G,
j,
H,
W,
K = 0;
for (U = 0; U < h; U++)
10 !== (b = a.charCodeAt(U))
? (w = g[b]) &&
((S = m),
null !== A && (S += void 0 !== (G = w.kerning[M]) ? G : 0),
S < c && (c = S),
x < d && (d = x),
f < (j = S + w.xAdvance) && (f = j),
p < (H = x + v) && (p = H),
(W = w.xOffset + w.xAdvance + (void 0 !== G ? G : 0)),
b === u
? null !== F && (I.push({ word: F.word, i: F.i, x: F.x * E, y: F.y * P, w: F.w * E, h: F.h * P }), (F = null))
: (null === F && (F = { word: "", i: K, x: m, y: x, w: 0, h: v }), (F.word = F.word.concat(a[U])), (F.w += W)),
D.push({ i: K, char: a[U], code: b, x: (w.xOffset + m) * _, y: (w.yOffset + x) * _, w: w.width * _, h: w.height * _, t: x * _, r: j * _, b: v * _, line: R, glyph: w }),
(m += w.xAdvance + y),
(A = w),
(M = b),
(L = j * _),
K++)
: (null !== F && (I.push({ word: F.word, i: F.i, x: F.x * E, y: F.y * P, w: F.w * E, h: F.h * P }), (F = null)), (m = 0), (x += v), (A = null), k < (C[R] = L) && (k = L), L < O && (O = L), R++, (L = 0));
if ((null !== F && I.push({ word: F.word, i: F.i, x: F.x * E, y: F.y * P, w: F.w * E, h: F.h * P }), k < (C[R] = L) && (k = L), L < O && (O = L), 0 < T))
for (var q = 0; q < D.length; q++) {
var Z,
J,
Q = D[q];
1 === T ? ((Z = (k - C[Q.line]) / 2), (Q.x += Z), (Q.r += Z)) : 2 === T && ((J = k - C[Q.line]), (Q.x += J), (Q.r += J));
}
var $ = n.local,
tt = n.global,
et = n.lines;
return (
($.x = c * _),
($.y = d * _),
($.width = f * _),
($.height = p * _),
(tt.x = t.x - t._displayOriginX + c * E),
(tt.y = t.y - t._displayOriginY + d * P),
(tt.width = f * E),
(tt.height = p * P),
(et.shortest = O),
(et.longest = k),
(et.lengths = C),
e &&
(($.x = Math.ceil($.x)),
($.y = Math.ceil($.y)),
($.width = Math.ceil($.width)),
($.height = Math.ceil($.height)),
(tt.x = Math.ceil(tt.x)),
(tt.y = Math.ceil(tt.y)),
(tt.width = Math.ceil(tt.width)),
(tt.height = Math.ceil(tt.height)),
(et.shortest = Math.ceil(O)),
(et.longest = Math.ceil(k))),
i &&
((t._displayOriginX = t.originX * $.width),
(t._displayOriginY = t.originY * $.height),
(tt.x = t.x - t._displayOriginX * t.scaleX),
(tt.y = t.y - t._displayOriginY * t.scaleY),
e && ((tt.x = Math.ceil(tt.x)), (tt.y = Math.ceil(tt.y)))),
(n.words = I),
(n.characters = D),
(n.lines.height = v),
(n.scale = _),
(n.scaleX = t.scaleX),
(n.scaleY = t.scaleY),
n
);
};
},
function (t, e, i) {
var c = i(212);
t.exports = function (t, e, i, n, s, r, o) {
var a = t.sys.textures.get(i),
h = a.get(n),
l = t.sys.cache.xml.get(s);
if (h && l) {
var u = c(l, h, r, o, a);
return t.sys.cache.bitmapFont.add(e, { data: u, texture: i, frame: n, fromAtlas: !0 }), !0;
}
return !1;
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1046)), (s = i(1048));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e, i) {
var F = i(1047),
B = i(19),
N = i(12);
t.exports = function (t, e, i, n) {
if (0 !== e._text.length) {
i.addToRenderList(e);
var s,
r = t.pipelines.set(e.pipeline, e),
o = B(e, i, n).calc,
a = i.roundPixels,
h = i.alpha,
l = e.charColors,
u = e.tintFill,
c = N.getTintAppendFloatAlpha,
d = c(e.tintTopLeft, h * e._alphaTL),
f = c(e.tintTopRight, h * e._alphaTR),
p = c(e.tintBottomLeft, h * e._alphaBL),
g = c(e.tintBottomRight, h * e._alphaBR),
v = e.frame.glTexture,
y = r.setGameObject(e),
m = e.getTextBounds(!1).characters,
x = e.dropShadowX,
b = e.dropShadowY,
w = 0 !== x || 0 !== b;
if ((t.pipelines.preBatch(e), w))
for (var T = e.dropShadowColor, S = e.dropShadowAlpha, _ = c(T, h * S * e._alphaTL), E = c(T, h * S * e._alphaTR), P = c(T, h * S * e._alphaBL), A = c(T, h * S * e._alphaBR), M = 0; M < m.length; M++)
(D = (s = m[M]).glyph), 32 !== s.code && 0 !== D.width && 0 !== D.height && F(r, e, s, D, x, b, o, a, _, E, P, A, 1, v, y);
for (M = 0; M < m.length; M++) {
var C,
O,
k,
R,
L,
I,
D = (s = m[M]).glyph;
32 !== s.code &&
0 !== D.width &&
0 !== D.height &&
(l[s.i]
? ((O = (C = l[s.i]).tintEffect),
(k = c(C.tintTL, h * e._alphaTL)),
(R = c(C.tintTR, h * e._alphaTR)),
(L = c(C.tintBL, h * e._alphaBL)),
(I = c(C.tintBR, h * e._alphaBR)),
F(r, e, s, D, 0, 0, o, a, k, R, L, I, O, v, y))
: F(r, e, s, D, 0, 0, o, a, d, f, p, g, u, v, y));
}
t.pipelines.postBatch(e);
}
};
},
function (t, e) {
t.exports = function (t, e, i, n, s, r, o, a, h, l, u, c, d, f, p) {
var g = i.x - e.displayOriginX + s,
v = i.y - e.displayOriginY + r,
y = g + i.w,
m = v + i.h,
x = o.getXRound(g, v, a),
b = o.getYRound(g, v, a),
w = o.getXRound(g, m, a),
T = o.getYRound(g, m, a),
S = o.getXRound(y, m, a),
_ = o.getYRound(y, m, a),
E = o.getXRound(y, v, a),
P = o.getYRound(y, v, a);
t.batchQuad(e, x, b, w, T, S, _, E, P, n.u0, n.v0, n.u1, n.v1, h, l, u, c, d, f, p);
};
},
function (t, e, i) {
var D = i(30);
t.exports = function (t, e, i, n) {
var s = e._text,
r = s.length,
o = t.currentContext;
if (0 !== r && D(t, o, e, i, n)) {
i.addToRenderList(e);
var a,
h = e.fromAtlas ? e.frame : e.texture.frames.__BASE,
l = e.fontData.chars,
u = e.fontData.lineHeight,
c = e._letterSpacing,
d = 0,
f = 0,
p = null,
g = 0,
v = 0,
y = 0,
m = 0,
x = 0,
b = 0,
w = null,
T = 0,
S = h.source.image,
_ = h.cutX,
E = h.cutY,
P = e._fontSize / e.fontData.size,
A = e._align,
M = 0,
C = 0,
O = e.getTextBounds(!1);
0 < e.maxWidth && (r = (s = O.wrappedText).length);
var k = e._bounds.lines;
1 === A ? (C = (k.longest - k.lengths[0]) / 2) : 2 === A && (C = k.longest - k.lengths[0]), o.translate(-e.displayOriginX, -e.displayOriginY);
for (var R, L = i.roundPixels, I = 0; I < r; I++)
10 !== (a = s.charCodeAt(I))
? (p = l[a]) &&
((g = _ + p.x),
(v = E + p.y),
(y = p.width),
(m = p.height),
(x = p.xOffset + d),
(b = p.yOffset + f),
null !== w && (x += void 0 !== (R = p.kerning[T]) ? R : 0),
(x *= P),
(b *= P),
(x += C),
(d += p.xAdvance + c),
(w = p),
(T = a),
0 !== y && 0 !== m && 32 !== a && (L && ((x = Math.round(x)), (b = Math.round(b))), o.save(), o.translate(x, b), o.scale(P, P), o.drawImage(S, g, v, y, m, 0, 0, y, m), o.restore()))
: (M++, 1 === A ? (C = (k.longest - k.lengths[M]) / 2) : 2 === A && (C = k.longest - k.lengths[M]), (d = 0), (f += u), (w = null));
o.restore();
}
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1050)), (s = i(1051));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e, i) {
var n = i(25),
O = i(12),
k = new n();
t.exports = function (t, e, i, n) {
var s = e.getRenderList();
if (0 !== s.length) {
var r = i.alpha * e.alpha;
if (0 != r) {
i.addToRenderList(e);
var o = t.pipelines.set(this.pipeline, e),
a = i.scrollX * e.scrollFactorX,
h = i.scrollY * e.scrollFactorY,
l = k.copyFrom(i.matrix);
n && (l.multiplyWithOffset(n, -a, -h), (h = a = 0));
var u = e.x - a,
c = e.y - h,
d = -1,
f = i.roundPixels;
t.pipelines.preBatch(e);
for (var p = 0; p < s.length; p++) {
var g,
v,
y,
m,
x,
b,
w,
T,
S,
_,
E,
P,
A = s[p],
M = A.frame,
C = A.alpha * r;
0 != C &&
((g = M.width),
(v = M.height),
(y = u + A.x + M.x),
(m = c + A.y + M.y),
A.flipX && ((g *= -1), (y += M.width)),
A.flipY && ((v *= -1), (m += M.height)),
(x = y + g),
(b = m + v),
(w = l.getX(y, m)),
(T = l.getY(y, m)),
(S = l.getX(x, b)),
(_ = l.getY(x, b)),
(E = O.getTintAppendFloatAlpha(A.tint, C)),
M.sourceIndex !== d && ((P = o.setGameObject(e, M)), (d = M.sourceIndex)),
f && ((w = Math.round(w)), (T = Math.round(T)), (S = Math.round(S)), (_ = Math.round(_))),
o.batchQuad(e, w, T, w, _, S, _, S, T, M.u0, M.v0, M.u1, M.v1, E, E, E, E, !1, M.glTexture, P) && (d = -1));
}
t.pipelines.postBatch(e);
}
}
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = e.getRenderList();
if (0 !== s.length) {
var r = t.currentContext,
o = i.alpha * e.alpha;
if (0 != o) {
i.addToRenderList(e), (r.globalCompositeOperation = t.blendModes[e.blendMode]), (r.imageSmoothingEnabled = !(!t.antialias || e.frame.source.scaleMode));
var a = e.x - i.scrollX * e.scrollFactorX,
h = e.y - i.scrollY * e.scrollFactorY;
r.save(), n && n.copyToContext(r);
for (var l = i.roundPixels, u = 0; u < s.length; u++) {
var c = s[u],
d = c.flipX || c.flipY,
f = c.frame,
p = f.canvasData,
g = f.x,
v = f.y,
y = 1,
m = 1,
x = c.alpha * o;
0 != x &&
((r.globalAlpha = x),
d
? (c.flipX && ((y = -1), (g -= p.width)),
c.flipY && ((m = -1), (v -= p.height)),
r.save(),
r.translate(c.x + a, c.y + h),
r.scale(y, m),
r.drawImage(f.source.image, p.x, p.y, p.width, p.height, g, v, p.width, p.height),
r.restore())
: (l && ((g = Math.round(g)), (v = Math.round(v))), r.drawImage(f.source.image, p.x, p.y, p.width, p.height, g + c.x + a, v + c.y + h, p.width, p.height)));
}
r.restore();
}
}
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1053)), (s = i(1054));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e) {
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = e.list,
r = s.length;
if (0 !== r) {
var o = e.localTransform;
n ? (o.loadIdentity(), o.multiply(n), o.translate(e.x, e.y), o.rotate(e.rotation), o.scale(e.scaleX, e.scaleY)) : o.applyITRS(e.x, e.y, e.rotation, e.scaleX, e.scaleY), t.pipelines.preBatch(e);
var a = -1 !== e.blendMode;
a || t.setBlendMode(0);
for (var h = e.alpha, l = e.scrollFactorX, u = e.scrollFactorY, c = 0; c < r; c++) {
var d,
f,
p,
g,
v,
y,
m,
x,
b = s[c];
b.willRender(i) &&
((g = void 0 !== b.alphaTopLeft ? ((d = b.alphaTopLeft), (f = b.alphaTopRight), (p = b.alphaBottomLeft), b.alphaBottomRight) : (p = f = d = b.alpha)),
(v = b.scrollFactorX),
(y = b.scrollFactorY),
a || b.blendMode === t.currentBlendMode || t.setBlendMode(b.blendMode),
(m = b.mask) && m.preRenderWebGL(t, b, i),
(x = b.type) !== t.currentType && ((t.newType = !0), (t.currentType = x)),
(t.nextTypeMatch = c < r - 1 && s[c + 1].type === t.currentType),
b.setScrollFactor(v * l, y * u),
b.setAlpha(d * h, f * h, p * h, g * h),
b.renderWebGL(t, b, i, o),
b.setAlpha(d, f, p, g),
b.setScrollFactor(v, y),
m && m.postRenderWebGL(t, i),
(t.newType = !1));
}
t.pipelines.postBatch(e);
}
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = e.list;
if (0 !== s.length) {
var r = e.localTransform;
n ? (r.loadIdentity(), r.multiply(n), r.translate(e.x, e.y), r.rotate(e.rotation), r.scale(e.scaleX, e.scaleY)) : r.applyITRS(e.x, e.y, e.rotation, e.scaleX, e.scaleY);
var o = -1 !== e.blendMode;
o || t.setBlendMode(0);
var a = e._alpha,
h = e.scrollFactorX,
l = e.scrollFactorY;
e.mask && e.mask.preRenderCanvas(t, null, i);
for (var u = 0; u < s.length; u++) {
var c,
d,
f,
p = s[u];
p.willRender(i) &&
((c = p.alpha),
(d = p.scrollFactorX),
(f = p.scrollFactorY),
o || p.blendMode === t.currentBlendMode || t.setBlendMode(p.blendMode),
p.setScrollFactor(d * h, f * l),
p.setAlpha(c * a),
p.renderCanvas(t, p, i, r),
p.setAlpha(c),
p.setScrollFactor(d, f));
}
e.mask && e.mask.postRenderCanvas(t);
}
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(443)), (s = i(443));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e) {
t.exports = ["normal", "multiply", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"];
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1058)), (s = i(1059));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e, i) {
var ot = i(19),
n = i(25),
at = i(12),
ht = new n();
t.exports = function (t, e, i, n) {
var s = e.text,
r = s.length;
if (0 !== r) {
i.addToRenderList(e);
var o = t.pipelines.set(e.pipeline, e),
a = ot(e, i, n),
h = a.sprite,
l = a.calc,
u = ht,
c = 0 < e.cropWidth || 0 < e.cropHeight;
c && (o.flush(), t.pushScissor(l.tx, l.ty, e.cropWidth * l.scaleX, e.cropHeight * l.scaleY));
var d,
f,
p,
g,
v = e.frame.glTexture,
y = e.tintFill,
m = at.getTintAppendFloatAlpha(e.tintTopLeft, i.alpha * e._alphaTL),
x = at.getTintAppendFloatAlpha(e.tintTopRight, i.alpha * e._alphaTR),
b = at.getTintAppendFloatAlpha(e.tintBottomLeft, i.alpha * e._alphaBL),
w = at.getTintAppendFloatAlpha(e.tintBottomRight, i.alpha * e._alphaBR),
T = o.setGameObject(e),
S = 0,
_ = 0,
E = 0,
P = e.letterSpacing,
A = e.scrollX,
M = e.scrollY,
C = e.fontData,
O = C.chars,
k = C.lineHeight,
R = e.fontSize / C.size,
L = 0,
I = e._align,
D = 0,
F = 0,
B = e.getTextBounds(!1);
0 < e.maxWidth && (r = (s = B.wrappedText).length);
var N = e._bounds.lines;
1 === I ? (F = (N.longest - N.lengths[0]) / 2) : 2 === I && (F = N.longest - N.lengths[0]);
var U = i.roundPixels,
Y = e.displayCallback,
z = e.callbackData;
t.pipelines.preBatch(e);
for (var X, V, G, j, H, W, K, q, Z, J, Q, $, tt, et, it, nt, st, rt = 0; rt < r; rt++)
10 !== (d = s.charCodeAt(rt))
? (st = O[d]) &&
((f = st.width),
(p = st.height),
(G = st.xOffset + S - A),
(j = st.yOffset + _ - M),
null !== g && (G += void 0 !== (X = st.kerning[E]) ? X : 0),
(S += st.xAdvance + P),
(g = st),
(E = d),
0 !== f &&
0 !== p &&
32 !== d &&
((R = e.fontSize / e.fontData.size),
(L = 0),
Y &&
((z.color = 0),
(z.tint.topLeft = m),
(z.tint.topRight = x),
(z.tint.bottomLeft = b),
(z.tint.bottomRight = w),
(z.index = rt),
(z.charCode = d),
(z.x = G),
(z.y = j),
(z.scale = R),
(z.rotation = L),
(z.data = st.data),
(G = (V = Y(z)).x),
(j = V.y),
(R = V.scale),
(L = V.rotation),
(w = V.color ? ((m = V.color), (x = V.color), (b = V.color), V.color) : ((m = V.tint.topLeft), (x = V.tint.topRight), (b = V.tint.bottomLeft), V.tint.bottomRight)),
(m = at.getTintAppendFloatAlpha(m, i.alpha * e._alphaTL)),
(x = at.getTintAppendFloatAlpha(x, i.alpha * e._alphaTR)),
(b = at.getTintAppendFloatAlpha(b, i.alpha * e._alphaBL)),
(w = at.getTintAppendFloatAlpha(w, i.alpha * e._alphaBR))),
(G *= R),
(j *= R),
(G -= e.displayOriginX),
(j -= e.displayOriginY),
(G += F),
u.applyITRS(G, j, L, R, R),
l.multiply(u, h),
(H = st.u0),
(W = st.v0),
(K = st.u1),
(q = st.v1),
(Z = h.e),
(J = h.f),
(Q = p * h.c + h.e),
($ = p * h.d + h.f),
(tt = f * h.a + p * h.c + h.e),
(et = f * h.b + p * h.d + h.f),
(it = f * h.a + h.e),
(nt = f * h.b + h.f),
U && ((Z = Math.round(Z)), (J = Math.round(J)), (Q = Math.round(Q)), ($ = Math.round($)), (tt = Math.round(tt)), (et = Math.round(et)), (it = Math.round(it)), (nt = Math.round(nt))),
o.batchQuad(e, Z, J, Q, $, tt, et, it, nt, H, W, K, q, m, x, b, w, y, v, T)))
: (D++, 1 === I ? (F = (N.longest - N.lengths[D]) / 2) : 2 === I && (F = N.longest - N.lengths[D]), (S = 0), (_ += k), (g = null));
c && (o.flush(), t.popScissor()), t.pipelines.postBatch(e);
}
};
},
function (t, e, i) {
var U = i(30);
t.exports = function (t, e, i, n) {
var s = e._text,
r = s.length,
o = t.currentContext;
if (0 !== r && U(t, o, e, i, n)) {
i.addToRenderList(e);
var a,
h = e.fromAtlas ? e.frame : e.texture.frames.__BASE,
l = e.displayCallback,
u = e.callbackData,
c = e.fontData.chars,
d = e.fontData.lineHeight,
f = e._letterSpacing,
p = 0,
g = 0,
v = null,
y = 0,
m = 0,
x = 0,
b = 0,
w = 0,
T = 0,
S = null,
_ = 0,
E = e.frame.source.image,
P = h.cutX,
A = h.cutY,
M = 0,
C = 0,
O = e._fontSize / e.fontData.size,
k = e._align,
R = 0,
L = 0;
e.getTextBounds(!1);
var I = e._bounds.lines;
1 === k ? (L = (I.longest - I.lengths[0]) / 2) : 2 === k && (L = I.longest - I.lengths[0]), o.translate(-e.displayOriginX, -e.displayOriginY);
var D = i.roundPixels;
0 < e.cropWidth && 0 < e.cropHeight && (o.beginPath(), o.rect(0, 0, e.cropWidth, e.cropHeight), o.clip());
for (var F, B, N = 0; N < r; N++)
(C = O),
(M = 0),
10 !== (a = s.charCodeAt(N))
? (v = c[a]) &&
((y = P + v.x),
(m = A + v.y),
(x = v.width),
(b = v.height),
(w = v.xOffset + p - e.scrollX),
(T = v.yOffset + g - e.scrollY),
null !== S && (w += void 0 !== (F = v.kerning[_]) ? F : 0),
l && ((u.index = N), (u.charCode = a), (u.x = w), (u.y = T), (u.scale = C), (u.rotation = M), (u.data = v.data), (w = (B = l(u)).x), (T = B.y), (C = B.scale), (M = B.rotation)),
(w *= C),
(T *= C),
(w += L),
(p += v.xAdvance + f),
(S = v),
(_ = a),
0 !== x && 0 !== b && 32 !== a && (D && ((w = Math.round(w)), (T = Math.round(T))), o.save(), o.translate(w, T), o.rotate(M), o.scale(C, C), o.drawImage(E, y, m, x, b, 0, 0, x, b), o.restore()))
: (R++, 1 === k ? (L = (I.longest - I.lengths[R]) / 2) : 2 === k && (L = I.longest - I.lengths[R]), (p = 0), (g += d), (S = null));
o.restore();
}
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1061)), (s = i(1062));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e, i) {
var r = i(19);
t.exports = function (t, e, i, n) {
t.pipelines.clear();
var s = r(e, i, n).calc;
e.render.call(e, t, i, s), t.pipelines.rebind();
};
},
function (t, e) {},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1064)), i(448);
(s = i(448)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e, i) {
function B(t, e, i) {
(this.x = t), (this.y = e), (this.width = i);
}
function N(t, e, i) {
(this.points = []), (this.pointsLength = 1), (this.points[0] = new B(t, e, i));
}
var U = i(217),
Y = i(19),
n = i(25),
z = i(12),
X = [],
V = new n();
t.exports = function (t, e, i, n) {
if (0 !== e.commandBuffer.length) {
i.addToRenderList(e);
var s = t.pipelines.set(e.pipeline, e);
t.pipelines.preBatch(e);
for (
var r = Y(e, i, n).calc,
o = V.loadIdentity(),
a = e.commandBuffer,
h = i.alpha * e.alpha,
l = 1,
u = s.fillTint,
c = s.strokeTint,
d = 0,
f = 0,
p = 0,
g = 2 * Math.PI,
v = [],
y = 0,
m = !0,
x = null,
b = z.getTintAppendFloatAlpha,
w = 0;
w < a.length;
w++
)
switch (a[w]) {
case U.BEGIN_PATH:
(v.length = 0), (m = !(x = null));
break;
case U.CLOSE_PATH:
(m = !1), x && x.points.length && x.points.push(x.points[0]);
break;
case U.FILL_PATH:
for (y = 0; y < v.length; y++) s.batchFillPath(v[y].points, o, r);
break;
case U.STROKE_PATH:
for (y = 0; y < v.length; y++) s.batchStrokePath(v[y].points, l, m, o, r);
break;
case U.LINE_STYLE:
l = a[++w];
var T = b(a[++w], a[++w] * h);
(c.TL = T), (c.TR = T), (c.BL = T), (c.BR = T);
break;
case U.FILL_STYLE:
var S = b(a[++w], a[++w] * h);
(u.TL = S), (u.TR = S), (u.BL = S), (u.BR = S);
break;
case U.GRADIENT_FILL_STYLE:
var _ = a[++w] * h,
E = a[++w] * h,
P = a[++w] * h,
A = a[++w] * h;
(u.TL = b(a[++w], _)), (u.TR = b(a[++w], E)), (u.BL = b(a[++w], P)), (u.BR = b(a[++w], A));
break;
case U.GRADIENT_LINE_STYLE:
l = a[++w];
var M = a[++w] * h;
(c.TL = b(a[++w], M)), (c.TR = b(a[++w], M)), (c.BL = b(a[++w], M)), (c.BR = b(a[++w], M));
break;
case U.ARC:
var C = 0,
O = a[++w],
k = a[++w],
R = a[++w],
L = a[++w],
I = a[++w],
D = a[++w],
F = a[++w];
for (
I -= L,
D ? (I < -g ? (I = -g) : 0 < I && (I = (I % g) - g)) : g < I ? (I = g) : I < 0 && (I = g + (I % g)),
null === x && ((x = new N(O + Math.cos(L) * R, k + Math.sin(L) * R, l)), v.push(x), (C += 0.01));
C < 1 + F;
)
(p = I * C + L), (d = O + Math.cos(p) * R), (f = k + Math.sin(p) * R), x.points.push(new B(d, f, l)), (C += 0.01);
(p = I + L), (d = O + Math.cos(p) * R), (f = k + Math.sin(p) * R), x.points.push(new B(d, f, l));
break;
case U.FILL_RECT:
s.batchFillRect(a[++w], a[++w], a[++w], a[++w], o, r);
break;
case U.FILL_TRIANGLE:
s.batchFillTriangle(a[++w], a[++w], a[++w], a[++w], a[++w], a[++w], o, r);
break;
case U.STROKE_TRIANGLE:
s.batchStrokeTriangle(a[++w], a[++w], a[++w], a[++w], a[++w], a[++w], l, o, r);
break;
case U.LINE_TO:
null !== x ? x.points.push(new B(a[++w], a[++w], l)) : ((x = new N(a[++w], a[++w], l)), v.push(x));
break;
case U.MOVE_TO:
(x = new N(a[++w], a[++w], l)), v.push(x);
break;
case U.SAVE:
X.push(o.copyToArray());
break;
case U.RESTORE:
o.copyFromArray(X.pop());
break;
case U.TRANSLATE:
(O = a[++w]), (k = a[++w]), o.translate(O, k);
break;
case U.SCALE:
(O = a[++w]), (k = a[++w]), o.scale(O, k);
break;
case U.ROTATE:
o.rotate(a[++w]);
}
t.pipelines.postBatch(e);
}
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1066)), (s = i(1067));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e) {
t.exports = function (t, e, i, n) {
i.addToRenderList(e), e.pipeline.batchSprite(e, i, n);
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
i.addToRenderList(e), t.batchSprite(e, e.frame, i, n);
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1069)), (s = i(1070));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e) {
t.exports = function (t, e, i, n) {
i.addToRenderList(e), this.pipeline.batchSprite(e, i, n);
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
i.addToRenderList(e), t.batchSprite(e, e.frame, i, n);
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1072)), (s = i(1073));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e) {
t.exports = function (t, e, i) {
var n = e.list,
s = n.length;
if (0 !== s) {
e.depthSort(), t.pipelines.preBatch(e);
var r = -1 !== e.blendMode;
r || t.setBlendMode(0);
for (var o = e.alpha, a = 0; a < s; a++) {
var h,
l,
u,
c,
d,
f,
p = n[a];
p.willRender(i) &&
((c = void 0 !== p.alphaTopLeft ? ((h = p.alphaTopLeft), (l = p.alphaTopRight), (u = p.alphaBottomLeft), p.alphaBottomRight) : (u = l = h = p.alpha)),
r || p.blendMode === t.currentBlendMode || t.setBlendMode(p.blendMode),
(d = p.mask) && d.preRenderWebGL(t, p, i),
(f = p.type) !== t.currentType && ((t.newType = !0), (t.currentType = f)),
(t.nextTypeMatch = a < s - 1 && n[a + 1].type === t.currentType),
p.setAlpha(h * o, l * o, u * o, c * o),
p.renderWebGL(t, p, i),
p.setAlpha(h, l, u, c),
d && d.postRenderWebGL(t, i),
(t.newType = !1));
}
t.pipelines.postBatch(e);
}
};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = e.list;
if (0 !== n.length) {
e.depthSort();
var s = -1 !== e.blendMode;
s || t.setBlendMode(0);
var r = e._alpha;
e.mask && e.mask.preRenderCanvas(t, null, i);
for (var o = 0; o < n.length; o++) {
var a,
h = n[o];
h.willRender(i) && ((a = h.alpha), s || h.blendMode === t.currentBlendMode || t.setBlendMode(h.blendMode), h.setAlpha(a * r), h.renderCanvas(t, h, i), h.setAlpha(a));
}
e.mask && e.mask.postRenderCanvas(t);
}
};
},
function (t, e, i) {
t.exports = { EmitterOp: i(449), GravityWell: i(450), Particle: i(451), ParticleEmitter: i(452), ParticleEmitterManager: i(220), Zones: i(1078) };
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1076)), (s = i(1077));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e, i) {
var n = i(25),
N = i(12),
U = new n(),
Y = new n(),
z = new n(),
X = new n();
t.exports = function (t, e, i, n) {
var s = e.emitters.list,
r = s.length;
if (0 !== r) {
var o = t.pipelines.set(e.pipeline),
a = U,
h = Y,
l = z,
u = X;
n ? (u.loadIdentity(), u.multiply(n), u.translate(e.x, e.y), u.rotate(e.rotation), u.scale(e.scaleX, e.scaleY)) : u.applyITRS(e.x, e.y, e.rotation, e.scaleX, e.scaleY);
var c = i.roundPixels,
d = e.defaultFrame.glTexture,
f = N.getTintAppendFloatAlpha,
p = o.setGameObject(e, e.defaultFrame);
t.pipelines.preBatch(e);
for (var g = 0; g < r; g++) {
var v = s[g],
y = v.alive,
m = y.length;
if (v.visible && 0 !== m) {
i.addToRenderList(v);
var x = v.scrollFactorX,
b = v.scrollFactorY;
t.setBlendMode(v.blendMode), v.mask && (v.mask.preRenderWebGL(t, v, i), t.pipelines.set(e.pipeline));
for (var w = 0; w < m; w++) {
var T,
S,
_,
E,
P,
A,
M,
C,
O,
k,
R,
L,
I,
D,
F = y[w],
B = F.alpha * i.alpha;
B <= 0 ||
(l.applyITRS(F.x, F.y, F.rotation, F.scaleX, F.scaleY),
a.copyFrom(i.matrix),
a.multiplyWithOffset(u, -i.scrollX * x, -i.scrollY * b),
(l.e = F.x),
(l.f = F.y),
a.multiply(l, h),
(S = -(T = F.frame).halfWidth),
(_ = -T.halfHeight),
(E = S + T.width),
(P = _ + T.height),
(A = h.getXRound(S, _, c)),
(M = h.getYRound(S, _, c)),
(C = h.getXRound(S, P, c)),
(O = h.getYRound(S, P, c)),
(k = h.getXRound(E, P, c)),
(R = h.getYRound(E, P, c)),
(L = h.getXRound(E, _, c)),
(I = h.getYRound(E, _, c)),
(D = f(F.tint, B)),
o.batchQuad(v, A, M, C, O, k, R, L, I, T.u0, T.v0, T.u1, T.v1, D, D, D, D, 0, d, p));
}
v.mask && v.mask.postRenderWebGL(t, i);
}
}
t.pipelines.postBatch(e);
}
};
},
function (t, e, i) {
var n = i(25),
E = new n(),
P = new n(),
A = new n(),
M = new n();
t.exports = function (t, e, i, n) {
var s = e.emitters.list,
r = s.length;
if (0 !== r) {
var o = E.copyFrom(i.matrix),
a = P,
h = A,
l = M;
n ? (l.loadIdentity(), l.multiply(n), l.translate(e.x, e.y), l.rotate(e.rotation), l.scale(e.scaleX, e.scaleY)) : l.applyITRS(e.x, e.y, e.rotation, e.scaleX, e.scaleY);
for (var u = t.currentContext, c = i.roundPixels, d = 0; d < r; d++) {
var f = s[d],
p = f.alive,
g = p.length;
if (f.visible && 0 !== g) {
i.addToRenderList(f);
var v = f.scrollFactorX,
y = f.scrollFactorY;
u.save(), (u.globalCompositeOperation = t.blendModes[f.blendMode]);
for (var m = 0; m < g; m++) {
var x,
b,
w,
T,
S = p[m],
_ = S.alpha * i.alpha;
_ <= 0 ||
(h.applyITRS(S.x, S.y, S.rotation, S.scaleX, S.scaleY),
o.copyFrom(i.matrix),
o.multiplyWithOffset(l, -i.scrollX * v, -i.scrollY * y),
(h.e = S.x),
(h.f = S.y),
o.multiply(h, a),
(b = (x = S.frame).canvasData),
(w = -x.halfWidth),
(T = -x.halfHeight),
(u.globalAlpha = _),
u.save(),
a.setToContext(u),
c && ((w = Math.round(w)), (T = Math.round(T))),
(u.imageSmoothingEnabled = !(!t.antialias || x.source.scaleMode)),
u.drawImage(x.source.image, b.x, b.y, b.width, b.height, w, T, b.width, b.height),
u.restore());
}
u.restore();
}
}
}
};
},
function (t, e, i) {
t.exports = { DeathZone: i(453), EdgeZone: i(454), RandomZone: i(456) };
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1080)), (s = i(1081));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e, i) {
var c = i(12);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = i.alpha,
r = e.renderTarget,
o = r.width,
a = r.height,
h = c.getTintAppendFloatAlpha,
l = t.pipelines.set(e.pipeline),
u = l.setTexture2D(r.texture);
t.pipelines.preBatch(e),
l.batchTexture(
e,
r.texture,
o,
a,
e.x,
e.y,
o,
a,
e.scaleX,
e.scaleY,
e.rotation,
e.flipX,
!e.flipY,
e.scrollFactorX,
e.scrollFactorY,
e.displayOriginX,
e.displayOriginY,
0,
0,
o,
a,
h(e.tintTopLeft, s * e._alphaTL),
h(e.tintTopRight, s * e._alphaTR),
h(e.tintBottomLeft, s * e._alphaBL),
h(e.tintBottomRight, s * e._alphaBR),
e.tintFill,
0,
0,
i,
n,
!0,
u
),
t.resetTextures(),
t.pipelines.postBatch(e);
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
i.addToRenderList(e), t.batchSprite(e, e.frame, i, n);
};
},
function (t, e, i) {
var n = i(1083),
s = i(17)(!1, (s = { Parse: i(1084) }), n);
t.exports = s;
},
function (t, e) {
t.exports = {
TEXT_SET1: " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",
TEXT_SET2: " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",
TEXT_SET3: "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",
TEXT_SET4: "ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",
TEXT_SET5: "ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",
TEXT_SET6: "ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",
TEXT_SET7: "AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",
TEXT_SET8: "0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",
TEXT_SET9: "ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",
TEXT_SET10: "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
TEXT_SET11: "ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789",
};
},
function (t, e, i) {
var C = i(6);
t.exports = function (t, e) {
var i = e.width,
n = e.height,
s = Math.floor(i / 2),
r = Math.floor(n / 2),
o = C(e, "chars", "");
if ("" !== o) {
var a = C(e, "image", ""),
h = t.sys.textures.getFrame(a),
l = h.cutX,
u = h.cutY,
c = h.source.width,
d = h.source.height,
f = C(e, "offset.x", 0),
p = C(e, "offset.y", 0),
g = C(e, "spacing.x", 0),
v = C(e, "spacing.y", 0),
y = C(e, "lineSpacing", 0),
m = C(e, "charsPerRow", null);
null === m && (m = c / i) > o.length && (m = o.length);
for (var x = f, b = p, w = { retroFont: !0, font: a, size: i, lineHeight: n + y, chars: {} }, T = 0, S = 0; S < o.length; S++) {
var _ = o.charCodeAt(S),
E = (l + x) / c,
P = (u + b) / d,
A = (l + x + i) / c,
M = (u + b + n) / d;
(w.chars[_] = { x: x, y: b, width: i, height: n, centerX: s, centerY: r, xOffset: 0, yOffset: 0, xAdvance: i, data: {}, kerning: {}, u0: E, v0: P, u1: A, v1: M }),
++T === m ? ((T = 0), (x = f), (b += n + v)) : (x += i + g);
}
return { data: w, frame: null, texture: a };
}
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1086)), (s = i(1087));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e, i) {
var M = i(19),
C = i(12);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.pipelines.set(e.pipeline, e),
r = M(e, i, n).calc,
o = e.vertices,
a = e.uv,
h = e.colors,
l = e.alphas,
u = e.alpha,
c = C.getTintAppendFloatAlpha,
d = i.roundPixels,
f = o.length,
p = Math.floor(0.5 * f);
s.flush(), t.pipelines.preBatch(e);
var g = s.setGameObject(e),
v = s.vertexViewF32,
y = s.vertexViewU32,
m = s.vertexCount * s.currentShader.vertexComponentCount - 1,
x = 0,
b = e.tintFill;
e.dirty && e.updateVertices();
for (var w = e.debugCallback, T = [], S = 0; S < f; S += 2) {
var _ = o[S + 0],
E = o[S + 1],
P = _ * r.a + E * r.c + r.e,
A = _ * r.b + E * r.d + r.f;
d && ((P = Math.round(P)), (A = Math.round(A))),
(v[++m] = P),
(v[++m] = A),
(v[++m] = a[S + 0]),
(v[++m] = a[S + 1]),
(v[++m] = g),
(v[++m] = b),
(y[++m] = c(h[x], i.alpha * (l[x] * u))),
x++,
w && ((T[S + 0] = P), (T[S + 1] = A));
}
w && w.call(e, e, f, T), (s.vertexCount += p), t.pipelines.postBatch(e);
};
},
function (t, e) {
t.exports = function () {};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1089)), (s = i(1090));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e, i) {
var u = i(12);
t.exports = function (t, e, i, n) {
var s, r, o, a, h, l;
0 !== e.width &&
0 !== e.height &&
(i.addToRenderList(e),
(r = (s = e.frame).width),
(o = s.height),
(a = u.getTintAppendFloatAlpha),
(l = (h = t.pipelines.set(e.pipeline, e)).setTexture2D(s.glTexture, e)),
t.pipelines.preBatch(e),
h.batchTexture(
e,
s.glTexture,
r,
o,
e.x,
e.y,
r / e.style.resolution,
o / e.style.resolution,
e.scaleX,
e.scaleY,
e.rotation,
e.flipX,
e.flipY,
e.scrollFactorX,
e.scrollFactorY,
e.displayOriginX,
e.displayOriginY,
0,
0,
r,
o,
a(e.tintTopLeft, i.alpha * e._alphaTL),
a(e.tintTopRight, i.alpha * e._alphaTR),
a(e.tintBottomLeft, i.alpha * e._alphaBL),
a(e.tintBottomRight, i.alpha * e._alphaBR),
e.tintFill,
0,
0,
i,
n,
!1,
l
),
t.pipelines.postBatch(e));
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
0 !== e.width && 0 !== e.height && (i.addToRenderList(e), t.batchSprite(e, e.frame, i, n));
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1092)), (s = i(1093));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e, i) {
var l = i(12);
t.exports = function (t, e, i, n) {
e.updateCanvas();
var s,
r,
o,
a = e.width,
h = e.height;
0 !== a &&
0 !== h &&
(i.addToRenderList(e),
t.pipelines.preBatch(e),
(s = l.getTintAppendFloatAlpha),
(o = (r = t.pipelines.set(e.pipeline, e)).setTexture2D(e.fillPattern, e)),
r.batchTexture(
e,
e.fillPattern,
e.displayFrame.width * e.tileScaleX,
e.displayFrame.height * e.tileScaleY,
e.x,
e.y,
a,
h,
e.scaleX,
e.scaleY,
e.rotation,
e.flipX,
e.flipY,
e.scrollFactorX,
e.scrollFactorY,
e.originX * a,
e.originY * h,
0,
0,
a,
h,
s(e.tintTopLeft, i.alpha * e._alphaTL),
s(e.tintTopRight, i.alpha * e._alphaTR),
s(e.tintBottomLeft, i.alpha * e._alphaBL),
s(e.tintBottomRight, i.alpha * e._alphaBR),
e.tintFill,
(e.tilePositionX % e.displayFrame.width) / e.displayFrame.width,
(e.tilePositionY % e.displayFrame.height) / e.displayFrame.height,
i,
n,
!1,
o
),
t.pipelines.postBatch(e));
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
e.updateCanvas(), i.addToRenderList(e), t.batchSprite(e, e.frame, i, n);
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1095)), (s = i(1096));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e) {
t.exports = function (t, e, i, n) {
e.videoTexture && (i.addToRenderList(e), e.pipeline.batchSprite(e, i, n));
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
e.videoTexture && (i.addToRenderList(e), t.batchSprite(e, e.frame, i, n));
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1098)), (s = i(1099));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e, i) {
var u = i(19),
c = i(114),
d = i(81);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.pipelines.set(e.pipeline),
r = u(e, i, n),
o = s.calcMatrix.copyFrom(r.calc),
a = e._displayOriginX,
h = e._displayOriginY,
l = i.alpha * e.alpha;
t.pipelines.preBatch(e), e.isFilled && c(s, o, e, l, a, h), e.isStroked && d(s, e, l, a, h), t.pipelines.postBatch(e);
};
},
function (t, e, i) {
var o = i(36),
a = i(48),
h = i(60),
l = i(30);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s,
r = t.currentContext;
l(t, r, e, i, n) &&
((s = e.radius),
r.beginPath(),
r.arc(s - e.originX * (2 * s), s - e.originY * (2 * s), s, o(e._startAngle), o(e._endAngle), e.anticlockwise),
e.closePath && r.closePath(),
e.isFilled && (a(r, e), r.fill()),
e.isStroked && (h(r, e), r.stroke()),
r.restore());
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1101)), (s = i(1102));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e, i) {
var u = i(114),
c = i(19),
d = i(81);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.pipelines.set(e.pipeline),
r = c(e, i, n),
o = s.calcMatrix.copyFrom(r.calc),
a = e._displayOriginX + e._curveBounds.x,
h = e._displayOriginY + e._curveBounds.y,
l = i.alpha * e.alpha;
t.pipelines.preBatch(e), e.isFilled && u(s, o, e, l, a, h), e.isStroked && d(s, e, l, a, h), t.pipelines.postBatch(e);
};
},
function (t, e, i) {
var p = i(48),
g = i(60),
v = i(30);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.currentContext;
if (v(t, s, e, i, n)) {
var r = e._displayOriginX + e._curveBounds.x,
o = e._displayOriginY + e._curveBounds.y,
a = e.pathData,
h = a.length - 1,
l = a[0] - r,
u = a[1] - o;
s.beginPath(), s.moveTo(l, u), e.closePath || (h -= 2);
for (var c = 2; c < h; c += 2) {
var d = a[c] - r,
f = a[c + 1] - o;
s.lineTo(d, f);
}
e.closePath && s.closePath(), e.isFilled && (p(s, e), s.fill()), e.isStroked && (g(s, e), s.stroke()), s.restore();
}
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1104)), (s = i(1105));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e, i) {
var u = i(114),
c = i(19),
d = i(81);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.pipelines.set(e.pipeline),
r = c(e, i, n),
o = s.calcMatrix.copyFrom(r.calc),
a = e._displayOriginX,
h = e._displayOriginY,
l = i.alpha * e.alpha;
t.pipelines.preBatch(e), e.isFilled && u(s, o, e, l, a, h), e.isStroked && d(s, e, l, a, h), t.pipelines.postBatch(e);
};
},
function (t, e, i) {
var p = i(48),
g = i(60),
v = i(30);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.currentContext;
if (v(t, s, e, i, n)) {
var r = e._displayOriginX,
o = e._displayOriginY,
a = e.pathData,
h = a.length - 1,
l = a[0] - r,
u = a[1] - o;
s.beginPath(), s.moveTo(l, u), e.closePath || (h -= 2);
for (var c = 2; c < h; c += 2) {
var d = a[c] - r,
f = a[c + 1] - o;
s.lineTo(d, f);
}
s.closePath(), e.isFilled && (p(s, e), s.fill()), e.isStroked && (g(s, e), s.stroke()), s.restore();
}
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1107)), (s = i(1108));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e, i) {
var k = i(19),
R = i(12);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.pipelines.set(e.pipeline),
r = k(e, i, n);
s.calcMatrix.copyFrom(r.calc).translate(-e._displayOriginX, -e._displayOriginY);
var o,
a,
h = i.alpha * e.alpha,
l = e.width,
u = e.height,
c = e.cellWidth,
d = e.cellHeight,
f = Math.ceil(l / c),
p = Math.ceil(u / d),
g = c,
v = d,
y = c - (f * c - l),
m = d - (p * d - u),
x = e.showCells,
b = e.showAltCells,
w = e.showOutline,
T = 0,
S = 0,
_ = 0,
E = 0,
P = 0;
if ((w && (g--, v--, y === c && y--, m === d && m--), t.pipelines.preBatch(e), x && 0 < e.fillAlpha))
for (o = s.fillTint, a = R.getTintAppendFloatAlpha(e.fillColor, e.fillAlpha * h), o.TL = a, o.TR = a, o.BL = a, o.BR = a, S = 0; S < p; S++)
for (b && (_ = S % 2), T = 0; T < f; T++) b && _ ? (_ = 0) : (_++, (E = T < f - 1 ? g : y), (P = S < p - 1 ? v : m), s.batchFillRect(T * c, S * d, E, P));
if (b && 0 < e.altFillAlpha)
for (o = s.fillTint, a = R.getTintAppendFloatAlpha(e.altFillColor, e.altFillAlpha * h), o.TL = a, o.TR = a, o.BL = a, o.BR = a, S = 0; S < p; S++)
for (b && (_ = S % 2), T = 0; T < f; T++) !b || _ ? ((_ = 0), (E = T < f - 1 ? g : y), (P = S < p - 1 ? v : m), s.batchFillRect(T * c, S * d, E, P)) : (_ = 1);
if (w && 0 < e.outlineFillAlpha) {
var A = s.strokeTint,
M = R.getTintAppendFloatAlpha(e.outlineFillColor, e.outlineFillAlpha * h);
for (A.TL = M, A.TR = M, A.BL = M, A.BR = M, T = 1; T < f; T++) {
var C = T * c;
s.batchLine(C, 0, C, u, 1, 1, 1, 0, !1);
}
for (S = 1; S < p; S++) {
var O = S * d;
s.batchLine(0, O, l, O, 1, 1, 1, 0, !1);
}
}
t.pipelines.postBatch(e);
};
},
function (t, e, i) {
var M = i(48),
C = i(60),
O = i(30);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.currentContext;
if (O(t, s, e, i, n)) {
var r = -e._displayOriginX,
o = -e._displayOriginY,
a = i.alpha * e.alpha,
h = e.width,
l = e.height,
u = e.cellWidth,
c = e.cellHeight,
d = Math.ceil(h / u),
f = Math.ceil(l / c),
p = u,
g = c,
v = u - (d * u - h),
y = c - (f * c - l),
m = e.showCells,
x = e.showAltCells,
b = e.showOutline,
w = 0,
T = 0,
S = 0,
_ = 0,
E = 0;
if ((b && (p--, g--, v === u && v--, y === c && y--), m && 0 < e.fillAlpha))
for (M(s, e), T = 0; T < f; T++) for (x && (S = T % 2), w = 0; w < d; w++) x && S ? (S = 0) : (S++, (_ = w < d - 1 ? p : v), (E = T < f - 1 ? g : y), s.fillRect(r + w * u, o + T * c, _, E));
if (x && 0 < e.altFillAlpha)
for (M(s, e, e.altFillColor, e.altFillAlpha * a), T = 0; T < f; T++)
for (x && (S = T % 2), w = 0; w < d; w++) !x || S ? ((S = 0), (_ = w < d - 1 ? p : v), (E = T < f - 1 ? g : y), s.fillRect(r + w * u, o + T * c, _, E)) : (S = 1);
if (b && 0 < e.outlineFillAlpha) {
for (C(s, e, e.outlineFillColor, e.outlineFillAlpha * a), w = 1; w < d; w++) {
var P = w * u;
s.beginPath(), s.moveTo(P + r, o), s.lineTo(P + r, l + o), s.stroke();
}
for (T = 1; T < f; T++) {
var A = T * c;
s.beginPath(), s.moveTo(r, A + o), s.lineTo(r + h, A + o), s.stroke();
}
}
s.restore();
}
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1110)), (s = i(1111));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e, i) {
var w = i(19),
T = i(12);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s,
r,
o,
a,
h,
l,
u,
c,
d,
f = t.pipelines.set(e.pipeline),
p = w(e, i, n),
g = f.calcMatrix.copyFrom(p.calc),
v = e.width,
y = e.height,
m = v / 2,
x = v / e.projection,
b = i.alpha * e.alpha;
e.isFilled &&
(t.pipelines.preBatch(e),
e.showTop &&
((s = T.getTintAppendFloatAlpha(e.fillTop, b)),
(r = g.getX(-m, -y)),
(o = g.getY(-m, -y)),
(a = g.getX(0, -x - y)),
(h = g.getY(0, -x - y)),
(l = g.getX(m, -y)),
(u = g.getY(m, -y)),
(c = g.getX(0, x - y)),
(d = g.getY(0, x - y)),
f.batchQuad(e, r, o, a, h, l, u, c, d, 0, 0, 1, 1, s, s, s, s, 2)),
e.showLeft &&
((s = T.getTintAppendFloatAlpha(e.fillLeft, b)),
(r = g.getX(-m, 0)),
(o = g.getY(-m, 0)),
(a = g.getX(0, x)),
(h = g.getY(0, x)),
(l = g.getX(0, x - y)),
(u = g.getY(0, x - y)),
(c = g.getX(-m, -y)),
(d = g.getY(-m, -y)),
f.batchQuad(e, r, o, a, h, l, u, c, d, 0, 0, 1, 1, s, s, s, s, 2)),
e.showRight &&
((s = T.getTintAppendFloatAlpha(e.fillRight, b)),
(r = g.getX(m, 0)),
(o = g.getY(m, 0)),
(a = g.getX(0, x)),
(h = g.getY(0, x)),
(l = g.getX(0, x - y)),
(u = g.getY(0, x - y)),
(c = g.getX(m, -y)),
(d = g.getY(m, -y)),
f.batchQuad(e, r, o, a, h, l, u, c, d, 0, 0, 1, 1, s, s, s, s, 2)),
t.pipelines.postBatch(e));
};
},
function (t, e, i) {
var l = i(48),
u = i(30);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s,
r,
o,
a,
h = t.currentContext;
u(t, h, e, i, n) &&
e.isFilled &&
((s = e.width),
(r = e.height),
(o = s / 2),
(a = s / e.projection),
e.showTop && (l(h, e, e.fillTop), h.beginPath(), h.moveTo(-o, -r), h.lineTo(0, -a - r), h.lineTo(o, -r), h.lineTo(o, -1), h.lineTo(0, a - 1), h.lineTo(-o, -1), h.lineTo(-o, -r), h.fill()),
e.showLeft && (l(h, e, e.fillLeft), h.beginPath(), h.moveTo(-o, 0), h.lineTo(0, a), h.lineTo(0, a - r), h.lineTo(-o, -r), h.lineTo(-o, 0), h.fill()),
e.showRight && (l(h, e, e.fillRight), h.beginPath(), h.moveTo(o, 0), h.lineTo(0, a), h.lineTo(0, a - r), h.lineTo(o, -r), h.lineTo(o, 0), h.fill()),
h.restore());
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1113)), (s = i(1114));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e, i) {
var T = i(19),
S = i(12);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s,
r,
o,
a,
h,
l,
u,
c,
d,
f = t.pipelines.set(e.pipeline),
p = T(e, i, n),
g = f.calcMatrix.copyFrom(p.calc),
v = e.width,
y = e.height,
m = v / 2,
x = v / e.projection,
b = e.isReversed,
w = i.alpha * e.alpha;
e.isFilled &&
(t.pipelines.preBatch(e),
e.showTop &&
b &&
((s = S.getTintAppendFloatAlpha(e.fillTop, w)),
(r = g.getX(-m, -y)),
(o = g.getY(-m, -y)),
(a = g.getX(0, -x - y)),
(h = g.getY(0, -x - y)),
(l = g.getX(m, -y)),
(u = g.getY(m, -y)),
(c = g.getX(0, x - y)),
(d = g.getY(0, x - y)),
f.batchQuad(e, r, o, a, h, l, u, c, d, 0, 0, 1, 1, s, s, s, s, 2)),
e.showLeft &&
((s = S.getTintAppendFloatAlpha(e.fillLeft, w)),
(o = b ? ((r = g.getX(-m, -y)), g.getY(-m, -y)) : ((r = g.getX(-m, 0)), g.getY(-m, 0))),
(a = g.getX(0, x)),
(h = g.getY(0, x)),
(l = g.getX(0, x - y)),
(u = g.getY(0, x - y)),
f.batchTri(e, r, o, a, h, l, u, 0, 0, 1, 1, s, s, s, 2)),
e.showRight &&
((s = S.getTintAppendFloatAlpha(e.fillRight, w)),
(o = b ? ((r = g.getX(m, -y)), g.getY(m, -y)) : ((r = g.getX(m, 0)), g.getY(m, 0))),
(a = g.getX(0, x)),
(h = g.getY(0, x)),
(l = g.getX(0, x - y)),
(u = g.getY(0, x - y)),
f.batchTri(e, r, o, a, h, l, u, 0, 0, 1, 1, s, s, s, 2)),
t.pipelines.postBatch(e));
};
},
function (t, e, i) {
var u = i(48),
c = i(30);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s,
r,
o,
a,
h,
l = t.currentContext;
c(t, l, e, i, n) &&
e.isFilled &&
((s = e.width),
(r = e.height),
(o = s / 2),
(a = s / e.projection),
(h = e.isReversed),
e.showTop && h && (u(l, e, e.fillTop), l.beginPath(), l.moveTo(-o, -r), l.lineTo(0, -a - r), l.lineTo(o, -r), l.lineTo(0, a - r), l.fill()),
e.showLeft && (u(l, e, e.fillLeft), l.beginPath(), h ? l.moveTo(-o, -r) : l.moveTo(-o, 0), l.lineTo(0, a), l.lineTo(0, a - r), l.fill()),
e.showRight && (u(l, e, e.fillRight), l.beginPath(), h ? l.moveTo(o, -r) : l.moveTo(o, 0), l.lineTo(0, a), l.lineTo(0, a - r), l.fill()),
l.restore());
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1116)), (s = i(1117));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e, i) {
var f = i(19),
p = i(12);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.pipelines.set(e.pipeline),
r = f(e, i, n);
s.calcMatrix.copyFrom(r.calc);
var o,
a,
h,
l,
u = e._displayOriginX,
c = e._displayOriginY,
d = i.alpha * e.alpha;
t.pipelines.preBatch(e),
e.isStroked &&
((o = s.strokeTint),
(a = p.getTintAppendFloatAlpha(e.strokeColor, e.strokeAlpha * d)),
(o.TL = a),
(o.TR = a),
(o.BL = a),
(o.BR = a),
(h = e._startWidth),
(l = e._endWidth),
s.batchLine(e.geom.x1 - u, e.geom.y1 - c, e.geom.x2 - u, e.geom.y2 - c, h, l, 1, 0, !1, r.sprite, r.camera)),
t.pipelines.postBatch(e);
};
},
function (t, e, i) {
var a = i(60),
h = i(30);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s,
r,
o = t.currentContext;
h(t, o, e, i, n) &&
((s = e._displayOriginX), (r = e._displayOriginY), e.isStroked && (a(o, e), o.beginPath(), o.moveTo(e.geom.x1 - s, e.geom.y1 - r), o.lineTo(e.geom.x2 - s, e.geom.y2 - r), o.stroke()), o.restore());
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1119)), (s = i(1120));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e, i) {
var u = i(114),
c = i(19),
d = i(81);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.pipelines.set(e.pipeline),
r = c(e, i, n),
o = s.calcMatrix.copyFrom(r.calc),
a = e._displayOriginX,
h = e._displayOriginY,
l = i.alpha * e.alpha;
t.pipelines.preBatch(e), e.isFilled && u(s, o, e, l, a, h), e.isStroked && d(s, e, l, a, h), t.pipelines.postBatch(e);
};
},
function (t, e, i) {
var p = i(48),
g = i(60),
v = i(30);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.currentContext;
if (v(t, s, e, i, n)) {
var r = e._displayOriginX,
o = e._displayOriginY,
a = e.pathData,
h = a.length - 1,
l = a[0] - r,
u = a[1] - o;
s.beginPath(), s.moveTo(l, u), e.closePath || (h -= 2);
for (var c = 2; c < h; c += 2) {
var d = a[c] - r,
f = a[c + 1] - o;
s.lineTo(d, f);
}
s.closePath(), e.isFilled && (p(s, e), s.fill()), e.isStroked && (g(s, e), s.stroke()), s.restore();
}
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1122)), (s = i(1123));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e, i) {
var c = i(19),
d = i(81),
f = i(12);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.pipelines.set(e.pipeline),
r = c(e, i, n);
s.calcMatrix.copyFrom(r.calc);
var o,
a,
h = e._displayOriginX,
l = e._displayOriginY,
u = i.alpha * e.alpha;
t.pipelines.preBatch(e),
e.isFilled && ((o = s.fillTint), (a = f.getTintAppendFloatAlpha(e.fillColor, e.fillAlpha * u)), (o.TL = a), (o.TR = a), (o.BL = a), (o.BR = a), s.batchFillRect(-h, -l, e.width, e.height)),
e.isStroked && d(s, e, u, h, l),
t.pipelines.postBatch(e);
};
},
function (t, e, i) {
var a = i(48),
h = i(60),
l = i(30);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s,
r,
o = t.currentContext;
l(t, o, e, i, n) &&
((s = e._displayOriginX),
(r = e._displayOriginY),
e.isFilled && (a(o, e), o.fillRect(-s, -r, e.width, e.height)),
e.isStroked && (h(o, e), o.beginPath(), o.rect(-s, -r, e.width, e.height), o.stroke()),
o.restore());
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1125)), (s = i(1126));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e, i) {
var u = i(114),
c = i(19),
d = i(81);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.pipelines.set(e.pipeline),
r = c(e, i, n),
o = s.calcMatrix.copyFrom(r.calc),
a = e._displayOriginX,
h = e._displayOriginY,
l = i.alpha * e.alpha;
t.pipelines.preBatch(e), e.isFilled && u(s, o, e, l, a, h), e.isStroked && d(s, e, l, a, h), t.pipelines.postBatch(e);
};
},
function (t, e, i) {
var p = i(48),
g = i(60),
v = i(30);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.currentContext;
if (v(t, s, e, i, n)) {
var r = e._displayOriginX,
o = e._displayOriginY,
a = e.pathData,
h = a.length - 1,
l = a[0] - r,
u = a[1] - o;
s.beginPath(), s.moveTo(l, u), e.closePath || (h -= 2);
for (var c = 2; c < h; c += 2) {
var d = a[c] - r,
f = a[c + 1] - o;
s.lineTo(d, f);
}
s.closePath(), e.isFilled && (p(s, e), s.fill()), e.isStroked && (g(s, e), s.stroke()), s.restore();
}
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1128)), (s = i(1129));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e, i) {
var y = i(19),
m = i(81),
x = i(12);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.pipelines.set(e.pipeline),
r = y(e, i, n);
s.calcMatrix.copyFrom(r.calc);
var o,
a,
h,
l,
u,
c,
d,
f,
p = e._displayOriginX,
g = e._displayOriginY,
v = i.alpha * e.alpha;
t.pipelines.preBatch(e),
e.isFilled &&
((o = s.fillTint),
(a = x.getTintAppendFloatAlpha(e.fillColor, e.fillAlpha * v)),
(o.TL = a),
(o.TR = a),
(o.BL = a),
(o.BR = a),
(h = e.geom.x1 - p),
(l = e.geom.y1 - g),
(u = e.geom.x2 - p),
(c = e.geom.y2 - g),
(d = e.geom.x3 - p),
(f = e.geom.y3 - g),
s.batchFillTriangle(h, l, u, c, d, f, r.sprite, r.camera)),
e.isStroked && m(s, e, v, p, g),
t.pipelines.postBatch(e);
};
},
function (t, e, i) {
var f = i(48),
p = i(60),
g = i(30);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s,
r,
o,
a,
h,
l,
u,
c,
d = t.currentContext;
g(t, d, e, i, n) &&
((s = e._displayOriginX),
(r = e._displayOriginY),
(o = e.geom.x1 - s),
(a = e.geom.y1 - r),
(h = e.geom.x2 - s),
(l = e.geom.y2 - r),
(u = e.geom.x3 - s),
(c = e.geom.y3 - r),
d.beginPath(),
d.moveTo(o, a),
d.lineTo(h, l),
d.lineTo(u, c),
d.closePath(),
e.isFilled && (f(d, e), d.fill()),
e.isStroked && (p(d, e), d.stroke()),
d.restore());
};
},
function (t, e, i) {
var s = i(213);
i(5).register("blitter", function (t, e, i, n) {
return this.displayList.add(new s(this.scene, t, e, i, n));
});
},
function (t, e, i) {
var n = i(214);
i(5).register("container", function (t, e, i) {
return this.displayList.add(new n(this.scene, t, e, i));
});
},
function (t, e, i) {
var o = i(442);
i(5).register("dom", function (t, e, i, n, s) {
var r = new o(this.scene, t, e, i, n, s);
return this.displayList.add(r), r;
});
},
function (t, e, i) {
var r = i(215);
i(5).register("dynamicBitmapText", function (t, e, i, n, s) {
return this.displayList.add(new r(this.scene, t, e, i, n, s));
});
},
function (t, e, i) {
var n = i(444);
i(5).register("extern", function () {
var t = new n(this.scene);
return this.displayList.add(t), t;
});
},
function (t, e, i) {
var n = i(216);
i(5).register("graphics", function (t) {
return this.displayList.add(new n(this.scene, t));
});
},
function (t, e, i) {
var n = i(113);
i(5).register("group", function (t, e) {
return this.updateList.add(new n(this.scene, t, e));
});
},
function (t, e, i) {
var s = i(125);
i(5).register("image", function (t, e, i, n) {
return this.displayList.add(new s(this.scene, t, e, i, n));
});
},
function (t, e, i) {
var n = i(219);
i(5).register("layer", function (t) {
return this.displayList.add(new n(this.scene, t));
});
},
function (t, e, i) {
var n = i(5),
s = i(220);
n.register("particles", function (t, e, i) {
return this.displayList.add(new s(this.scene, t, e, i));
});
},
function (t, e, i) {
var n = i(5),
o = i(457);
n.register("follower", function (t, e, i, n, s) {
var r = new o(this.scene, t, e, i, n, s);
return this.displayList.add(r), this.updateList.add(r), r;
});
},
function (t, e, i) {
var n = i(5),
o = i(221);
n.register("renderTexture", function (t, e, i, n, s, r) {
return this.displayList.add(new o(this.scene, t, e, i, n, s, r));
});
},
function (t, e, i) {
var h = i(223);
i(5).register("rope", function (t, e, i, n, s, r, o, a) {
return this.displayList.add(new h(this.scene, t, e, i, n, s, r, o, a));
});
},
function (t, e, i) {
var n = i(5),
r = i(73);
n.register("sprite", function (t, e, i, n) {
var s = new r(this.scene, t, e, i, n);
return this.displayList.add(s), s;
});
},
function (t, e, i) {
var o = i(148);
i(5).register("bitmapText", function (t, e, i, n, s, r) {
return this.displayList.add(new o(this.scene, t, e, i, n, s, r));
});
},
function (t, e, i) {
var s = i(224);
i(5).register("text", function (t, e, i, n) {
return this.displayList.add(new s(this.scene, t, e, i, n));
});
},
function (t, e, i) {
var o = i(225);
i(5).register("tileSprite", function (t, e, i, n, s, r) {
return this.displayList.add(new o(this.scene, t, e, i, n, s, r));
});
},
function (t, e, i) {
var s = i(129);
i(5).register("zone", function (t, e, i, n) {
return this.displayList.add(new s(this.scene, t, e, i, n));
});
},
function (t, e, i) {
var n = i(226);
i(5).register("video", function (t, e, i) {
return this.displayList.add(new n(this.scene, t, e, i));
});
},
function (t, e, i) {
var h = i(461),
n = i(5);
n.register("arc", function (t, e, i, n, s, r, o, a) {
return this.displayList.add(new h(this.scene, t, e, i, n, s, r, o, a));
}),
n.register("circle", function (t, e, i, n, s) {
return this.displayList.add(new h(this.scene, t, e, i, 0, 360, !1, n, s));
});
},
function (t, e, i) {
var n = i(5),
r = i(462);
n.register("curve", function (t, e, i, n, s) {
return this.displayList.add(new r(this.scene, t, e, i, n, s));
});
},
function (t, e, i) {
var o = i(463);
i(5).register("ellipse", function (t, e, i, n, s, r) {
return this.displayList.add(new o(this.scene, t, e, i, n, s, r));
});
},
function (t, e, i) {
var n = i(5),
u = i(464);
n.register("grid", function (t, e, i, n, s, r, o, a, h, l) {
return this.displayList.add(new u(this.scene, t, e, i, n, s, r, o, a, h, l));
});
},
function (t, e, i) {
var n = i(5),
a = i(465);
n.register("isobox", function (t, e, i, n, s, r, o) {
return this.displayList.add(new a(this.scene, t, e, i, n, s, r, o));
});
},
function (t, e, i) {
var n = i(5),
h = i(466);
n.register("isotriangle", function (t, e, i, n, s, r, o, a) {
return this.displayList.add(new h(this.scene, t, e, i, n, s, r, o, a));
});
},
function (t, e, i) {
var n = i(5),
h = i(467);
n.register("line", function (t, e, i, n, s, r, o, a) {
return this.displayList.add(new h(this.scene, t, e, i, n, s, r, o, a));
});
},
function (t, e, i) {
var n = i(5),
r = i(468);
n.register("polygon", function (t, e, i, n, s) {
return this.displayList.add(new r(this.scene, t, e, i, n, s));
});
},
function (t, e, i) {
var n = i(5),
o = i(473);
n.register("rectangle", function (t, e, i, n, s, r) {
return this.displayList.add(new o(this.scene, t, e, i, n, s, r));
});
},
function (t, e, i) {
var a = i(474);
i(5).register("star", function (t, e, i, n, s, r, o) {
return this.displayList.add(new a(this.scene, t, e, i, n, s, r, o));
});
},
function (t, e, i) {
var n = i(5),
u = i(475);
n.register("triangle", function (t, e, i, n, s, r, o, a, h, l) {
return this.displayList.add(new u(this.scene, t, e, i, n, s, r, o, a, h, l));
});
},
function (t, e, i) {
var r = i(213),
o = i(28),
n = i(16),
a = i(13);
n.register("blitter", function (t, e) {
void 0 === t && (t = {});
var i = a(t, "key", null),
n = a(t, "frame", null),
s = new r(this.scene, 0, 0, i, n);
return void 0 !== e && (t.add = e), o(this.scene, s, t), s;
});
},
function (t, e, i) {
var o = i(28),
a = i(214),
n = i(16),
h = i(13);
n.register("container", function (t, e) {
void 0 === t && (t = {});
var i = h(t, "x", 0),
n = h(t, "y", 0),
s = h(t, "children", null),
r = new a(this.scene, i, n, s);
return void 0 !== e && (t.add = e), o(this.scene, r, t), r;
});
},
function (t, e, i) {
var o = i(215),
a = i(28),
n = i(16),
h = i(13);
n.register("dynamicBitmapText", function (t, e) {
void 0 === t && (t = {});
var i = h(t, "font", ""),
n = h(t, "text", ""),
s = h(t, "size", !1),
r = new o(this.scene, 0, 0, i, n, s);
return void 0 !== e && (t.add = e), a(this.scene, r, t), r;
});
},
function (t, e, i) {
var n = i(16),
s = i(216);
n.register("graphics", function (t, e) {
void 0 === t && (t = {}), void 0 !== e && (t.add = e);
var i = new s(this.scene, t);
return t.add && this.scene.sys.displayList.add(i), i;
});
},
function (t, e, i) {
var n = i(16),
s = i(113);
n.register("group", function (t) {
return new s(this.scene, null, t);
});
},
function (t, e, i) {
var r = i(28),
n = i(16),
o = i(13),
a = i(125);
n.register("image", function (t, e) {
void 0 === t && (t = {});
var i = o(t, "key", null),
n = o(t, "frame", null),
s = new a(this.scene, 0, 0, i, n);
return void 0 !== e && (t.add = e), r(this.scene, s, t), s;
});
},
function (t, e, i) {
var s = i(28),
r = i(219),
n = i(16),
o = i(13);
n.register("layer", function (t, e) {
void 0 === t && (t = {});
var i = o(t, "children", null),
n = new r(this.scene, i);
return void 0 !== e && (t.add = e), s(this.scene, n, t), n;
});
},
function (t, e, i) {
var n = i(16),
o = i(13),
a = i(2),
h = i(220);
n.register("particles", function (t, e) {
void 0 === t && (t = {});
var i = o(t, "key", null),
n = o(t, "frame", null),
s = a(t, "emitters", null),
r = new h(this.scene, i, n, s);
return void 0 !== e && (t.add = e), a(t, "add", !1) ? this.displayList.add(r) : this.updateList.add(r), r;
});
},
function (t, e, i) {
var l = i(28),
n = i(16),
u = i(13),
c = i(221);
n.register("renderTexture", function (t, e) {
void 0 === t && (t = {});
var i = u(t, "x", 0),
n = u(t, "y", 0),
s = u(t, "width", 32),
r = u(t, "height", 32),
o = u(t, "key", void 0),
a = u(t, "frame", void 0),
h = new c(this.scene, i, n, s, r, o, a);
return void 0 !== e && (t.add = e), l(this.scene, h, t), h;
});
},
function (t, e, i) {
var l = i(28),
n = i(16),
u = i(13),
c = i(6),
d = i(223);
n.register("rope", function (t, e) {
void 0 === t && (t = {});
var i = u(t, "key", null),
n = u(t, "frame", null),
s = u(t, "horizontal", !0),
r = c(t, "points", void 0),
o = c(t, "colors", void 0),
a = c(t, "alphas", void 0),
h = new d(this.scene, 0, 0, i, n, r, s, o, a);
return void 0 !== e && (t.add = e), l(this.scene, h, t), t.add || this.updateList.add(h), h;
});
},
function (t, e, i) {
var r = i(28),
o = i(439),
n = i(16),
a = i(13),
h = i(73);
n.register("sprite", function (t, e) {
void 0 === t && (t = {});
var i = a(t, "key", null),
n = a(t, "frame", null),
s = new h(this.scene, 0, 0, i, n);
return void 0 !== e && (t.add = e), r(this.scene, s, t), o(s, t), s;
});
},
function (t, e, i) {
var a = i(148),
h = i(28),
n = i(16),
l = i(13),
u = i(6);
n.register("bitmapText", function (t, e) {
void 0 === t && (t = {});
var i = u(t, "font", ""),
n = l(t, "text", ""),
s = l(t, "size", !1),
r = u(t, "align", 0),
o = new a(this.scene, 0, 0, i, n, s, r);
return void 0 !== e && (t.add = e), h(this.scene, o, t), o;
});
},
function (t, e, i) {
var o = i(28),
n = i(16),
a = i(13),
h = i(224);
n.register("text", function (t, e) {
void 0 === t && (t = {});
var i = a(t, "text", ""),
n = a(t, "style", null),
s = a(t, "padding", null);
null !== s && (n.padding = s);
var r = new h(this.scene, 0, 0, i, n);
return void 0 !== e && (t.add = e), o(this.scene, r, t), (r.autoRound = a(t, "autoRound", !0)), (r.resolution = a(t, "resolution", 1)), r;
});
},
function (t, e, i) {
var l = i(28),
n = i(16),
u = i(13),
c = i(225);
n.register("tileSprite", function (t, e) {
void 0 === t && (t = {});
var i = u(t, "x", 0),
n = u(t, "y", 0),
s = u(t, "width", 512),
r = u(t, "height", 512),
o = u(t, "key", ""),
a = u(t, "frame", ""),
h = new c(this.scene, i, n, s, r, o, a);
return void 0 !== e && (t.add = e), l(this.scene, h, t), h;
});
},
function (t, e, i) {
var n = i(16),
r = i(13),
o = i(129);
n.register("zone", function (t) {
var e = r(t, "x", 0),
i = r(t, "y", 0),
n = r(t, "width", 1),
s = r(t, "height", n);
return new o(this.scene, e, i, n, s);
});
},
function (t, e, i) {
var s = i(28),
n = i(16),
r = i(13),
o = i(226);
n.register("video", function (t, e) {
void 0 === t && (t = {});
var i = r(t, "key", null),
n = new o(this.scene, 0, 0, i);
return void 0 !== e && (t.add = e), s(this.scene, n, t), t.add || this.updateList.add(n), n;
});
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1177)), (s = i(1178));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e, i) {
var r = i(19);
t.exports = function (t, e, i, n) {
var s;
e.shader &&
(i.addToRenderList(e),
t.pipelines.clear(),
e.renderToTexture ? e.load() : ((s = r(e, i, n).calc), (t.width === e._rendererWidth && t.height === e._rendererHeight) || e.projOrtho(0, t.width, t.height, 0), e.load(s.matrix)),
e.flush(),
t.pipelines.rebind());
};
},
function (t, e) {
t.exports = function () {};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1180)), (s = i(1181));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e, i) {
var M = i(19);
t.exports = function (t, e, i, n) {
var s = e.faces,
r = s.length;
if (0 !== r) {
i.addToRenderList(e);
var o = t.pipelines.set(e.pipeline, e),
a = M(e, i, n).calc,
h = o.setGameObject(e),
l = o.vertexViewF32,
u = o.vertexViewU32,
c = o.vertexCount * o.currentShader.vertexComponentCount - 1,
d = e.tintFill,
f = [],
p = e.debugCallback,
g = a.a,
v = a.b,
y = a.c,
m = a.d,
x = a.e,
b = a.f,
w = e.viewPosition.z,
T = e.hideCCW,
S = i.roundPixels,
_ = i.alpha * e.alpha,
E = 0;
t.pipelines.preBatch(e);
for (var P = 0; P < r; P++) {
var A = s[P];
A.isInView(i, T, w, _, g, v, y, m, x, b, S) && (o.shouldFlush(3) && (o.flush(), (c = 0)), (c = A.load(l, u, c, h, d)), E++, (o.vertexCount += 3), p && f.push(A));
}
(e.totalFrame += E), p && p.call(e, e, f), t.pipelines.postBatch(e);
}
};
},
function (t, e) {
t.exports = function () {};
},
function (t, e, i) {
var n = i(1),
s = i(1);
n = i(1183);
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e, i) {
var T = i(19);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.pipelines.set(e.pipeline),
r = T(e, i, n).calc,
o = e.width,
a = e.height,
h = -e._radius,
l = -e._radius,
u = h + o,
c = l + a,
d = r.getX(0, 0),
f = r.getY(0, 0),
p = r.getX(h, l),
g = r.getY(h, l),
v = r.getX(h, c),
y = r.getY(h, c),
m = r.getX(u, c),
x = r.getY(u, c),
b = r.getX(u, l),
w = r.getY(u, l);
t.pipelines.preBatch(e), s.batchPointLight(e, i, p, g, v, y, m, x, b, w, d, f), t.pipelines.postBatch(e);
};
},
function (t, e, i) {
var a = i(229);
i(5).register("shader", function (t, e, i, n, s, r, o) {
return this.displayList.add(new a(this.scene, t, e, i, n, s, r, o));
});
},
function (t, e, i) {
var c = i(230);
i(5).register("mesh", function (t, e, i, n, s, r, o, a, h, l, u) {
return this.displayList.add(new c(this.scene, t, e, i, n, s, r, o, a, h, l, u));
});
},
function (t, e, i) {
var n = i(5),
o = i(150);
n.register("pointlight", function (t, e, i, n, s, r) {
return this.displayList.add(new o(this.scene, t, e, i, n, s, r));
});
},
function (t, e, i) {
var h = i(28),
n = i(16),
l = i(13),
u = i(229);
n.register("shader", function (t, e) {
void 0 === t && (t = {});
var i = l(t, "key", null),
n = l(t, "x", 0),
s = l(t, "y", 0),
r = l(t, "width", 128),
o = l(t, "height", 128),
a = new u(this.scene, i, n, s, r, o);
return void 0 !== e && (t.add = e), h(this.scene, a, t), a;
});
},
function (t, e, i) {
var d = i(28),
n = i(16),
f = i(13),
p = i(6),
g = i(230);
n.register("mesh", function (t, e) {
void 0 === t && (t = {});
var i = f(t, "key", null),
n = f(t, "frame", null),
s = p(t, "vertices", []),
r = p(t, "uvs", []),
o = p(t, "indicies", []),
a = p(t, "containsZ", !1),
h = p(t, "normals", []),
l = p(t, "colors", 16777215),
u = p(t, "alphas", 1),
c = new g(this.scene, 0, 0, i, n, s, r, o, a, h, l, u);
return void 0 !== e && (t.add = e), d(this.scene, c, t), c;
});
},
function (t, e, i) {
var a = i(28),
n = i(16),
h = i(13),
l = i(150);
n.register("pointlight", function (t, e) {
void 0 === t && (t = {});
var i = h(t, "color", 16777215),
n = h(t, "radius", 128),
s = h(t, "intensity", 1),
r = h(t, "attenuation", 0.1),
o = new l(this.scene, 0, 0, i, n, s, r);
return void 0 !== e && (t.add = e), a(this.scene, o, t), o;
});
},
function (t, e, i) {
var n = i(0),
s = i(482),
r = i(24),
o = i(20),
a = new n({
Extends: s,
initialize: function (t) {
(this.scene = t), (this.systems = t.sys), t.sys.settings.isBooted || t.sys.events.once(o.BOOT, this.boot, this), s.call(this);
},
boot: function () {
var t = this.systems.events;
t.on(o.SHUTDOWN, this.shutdown, this), t.on(o.DESTROY, this.destroy, this);
},
destroy: function () {
this.shutdown(), (this.scene = void 0), (this.systems = void 0);
},
});
r.register("LightsPlugin", a, "lights"), (t.exports = a);
},
function (t, e, i) {
var n = i(65);
(n.Area = i(1192)),
(n.Circumference = i(302)),
(n.CircumferencePoint = i(169)),
(n.Clone = i(1193)),
(n.Contains = i(66)),
(n.ContainsPoint = i(1194)),
(n.ContainsRect = i(1195)),
(n.CopyFrom = i(1196)),
(n.Equals = i(1197)),
(n.GetBounds = i(1198)),
(n.GetPoint = i(300)),
(n.GetPoints = i(301)),
(n.Offset = i(1199)),
(n.OffsetPoint = i(1200)),
(n.Random = i(170)),
(t.exports = n);
},
function (t, e) {
t.exports = function (t) {
return 0 < t.radius ? Math.PI * t.radius * t.radius : 0;
};
},
function (t, e, i) {
var n = i(65);
t.exports = function (t) {
return new n(t.x, t.y, t.radius);
};
},
function (t, e, i) {
var n = i(66);
t.exports = function (t, e) {
return n(t, e.x, e.y);
};
},
function (t, e, i) {
var n = i(66);
t.exports = function (t, e) {
return n(t, e.x, e.y) && n(t, e.right, e.y) && n(t, e.x, e.bottom) && n(t, e.right, e.bottom);
};
},
function (t, e) {
t.exports = function (t, e) {
return e.setTo(t.x, t.y, t.radius);
};
},
function (t, e) {
t.exports = function (t, e) {
return t.x === e.x && t.y === e.y && t.radius === e.radius;
};
},
function (t, e, i) {
var n = i(10);
t.exports = function (t, e) {
return void 0 === e && (e = new n()), (e.x = t.left), (e.y = t.top), (e.width = t.diameter), (e.height = t.diameter), e;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return (t.x += e), (t.y += i), t;
};
},
function (t, e) {
t.exports = function (t, e) {
return (t.x += e.x), (t.y += e.y), t;
};
},
function (t, e, i) {
var n = i(111);
(n.Area = i(1202)),
(n.Circumference = i(447)),
(n.CircumferencePoint = i(218)),
(n.Clone = i(1203)),
(n.Contains = i(112)),
(n.ContainsPoint = i(1204)),
(n.ContainsRect = i(1205)),
(n.CopyFrom = i(1206)),
(n.Equals = i(1207)),
(n.GetBounds = i(1208)),
(n.GetPoint = i(445)),
(n.GetPoints = i(446)),
(n.Offset = i(1209)),
(n.OffsetPoint = i(1210)),
(n.Random = i(180)),
(t.exports = n);
},
function (t, e) {
t.exports = function (t) {
return t.isEmpty() ? 0 : t.getMajorRadius() * t.getMinorRadius() * Math.PI;
};
},
function (t, e, i) {
var n = i(111);
t.exports = function (t) {
return new n(t.x, t.y, t.width, t.height);
};
},
function (t, e, i) {
var n = i(112);
t.exports = function (t, e) {
return n(t, e.x, e.y);
};
},
function (t, e, i) {
var n = i(112);
t.exports = function (t, e) {
return n(t, e.x, e.y) && n(t, e.right, e.y) && n(t, e.x, e.bottom) && n(t, e.right, e.bottom);
};
},
function (t, e) {
t.exports = function (t, e) {
return e.setTo(t.x, t.y, t.width, t.height);
};
},
function (t, e) {
t.exports = function (t, e) {
return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
};
},
function (t, e, i) {
var n = i(10);
t.exports = function (t, e) {
return void 0 === e && (e = new n()), (e.x = t.left), (e.y = t.top), (e.width = t.width), (e.height = t.height), e;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return (t.x += e), (t.y += i), t;
};
},
function (t, e) {
t.exports = function (t, e) {
return (t.x += e.x), (t.y += e.y), t;
};
},
function (t, e, i) {
var g = i(4),
v = i(231);
t.exports = function (t, e, i) {
var n, s, r, o, a, h, l, u, c, d, f, p;
return (
void 0 === i && (i = []),
v(t, e) &&
((n = t.x),
(s = t.y),
(r = t.radius),
(o = e.x),
(a = e.y),
(h = e.radius),
s === a
? 0 == (p = (f = -2 * a) * f - 4 * (d = 1) * (o * o + (l = (h * h - r * r - o * o + n * n) / (2 * (n - o))) * l - 2 * o * l + a * a - h * h))
? i.push(new g(l, -f / (2 * d)))
: 0 < p && (i.push(new g(l, (-f + Math.sqrt(p)) / (2 * d))), i.push(new g(l, (-f - Math.sqrt(p)) / (2 * d))))
: 0 ==
(p =
(f = 2 * s * (u = (n - o) / (s - a)) - 2 * (c = (h * h - r * r - o * o + n * n - a * a + s * s) / (2 * (s - a))) * u - 2 * n) * f - 4 * (d = u * u + 1) * (n * n + s * s + c * c - r * r - 2 * s * c))
? ((l = -f / (2 * d)), i.push(new g(l, c - l * u)))
: 0 < p && ((l = (-f + Math.sqrt(p)) / (2 * d)), i.push(new g(l, c - l * u)), (l = (-f - Math.sqrt(p)) / (2 * d)), i.push(new g(l, c - l * u)))),
i
);
};
},
function (t, e, i) {
var a = i(232),
h = i(151);
t.exports = function (t, e, i) {
var n, s, r, o;
return void 0 === i && (i = []), h(t, e) && ((n = e.getLineA()), (s = e.getLineB()), (r = e.getLineC()), (o = e.getLineD()), a(n, t, i), a(s, t, i), a(r, t, i), a(o, t, i)), i;
};
},
function (t, e, i) {
var h = i(140),
l = i(487),
u = new (i(47))();
function c(t, e, i, n, s) {
var r = Math.cos(t),
o = Math.sin(t);
u.setTo(e, i, e + r, i + o);
var a = l(u, n);
a && s.push(new h(a.x, a.y, t, a.w));
}
function d(t, e) {
return t.z - e.z;
}
t.exports = function (t, e, i) {
Array.isArray(i) || (i = [i]);
for (var n = [], s = [], r = 0; r < i.length; r++)
for (var o = i[r].points, a = 0; a < o.length; a++) {
var h = Math.atan2(o[a].y - e, o[a].x - t);
-1 === s.indexOf(h) && (c(h, t, e, i, n), c(h - 1e-5, t, e, i, n), c(h + 1e-5, t, e, i, n), s.push(h));
}
return n.sort(d);
};
},
function (t, e, i) {
var n = i(10),
s = i(152);
t.exports = function (t, e, i) {
return void 0 === i && (i = new n()), s(t, e) && ((i.x = Math.max(t.x, e.x)), (i.y = Math.max(t.y, e.y)), (i.width = Math.min(t.right, e.right) - i.x), (i.height = Math.min(t.bottom, e.bottom) - i.y)), i;
};
},
function (t, e, i) {
var a = i(234),
h = i(152);
t.exports = function (t, e, i) {
var n, s, r, o;
return void 0 === i && (i = []), h(t, e) && ((n = t.getLineA()), (s = t.getLineB()), (r = t.getLineC()), (o = t.getLineD()), a(n, e, i), a(s, e, i), a(r, e, i), a(o, e, i)), i;
};
},
function (t, e, i) {
var o = i(489),
a = i(234);
t.exports = function (t, e, i) {
var n, s, r;
return void 0 === i && (i = []), o(t, e) && ((n = e.getLineA()), (s = e.getLineB()), (r = e.getLineC()), a(n, t, i), a(s, t, i), a(r, t, i)), i;
};
},
function (t, e, i) {
var o = i(232),
a = i(491);
t.exports = function (t, e, i) {
var n, s, r;
return void 0 === i && (i = []), a(t, e) && ((n = t.getLineA()), (s = t.getLineB()), (r = t.getLineC()), o(n, e, i), o(s, e, i), o(r, e, i)), i;
};
},
function (t, e, i) {
var o = i(494),
a = i(492);
t.exports = function (t, e, i) {
var n, s, r;
return void 0 === i && (i = []), o(t, e) && ((n = e.getLineA()), (s = e.getLineB()), (r = e.getLineC()), a(t, n, i), a(t, s, i), a(t, r, i)), i;
};
},
function (t, e, i) {
var o = i(496);
t.exports = function (t, e) {
if (!o(t, e)) return !1;
var i = Math.min(e.x1, e.x2),
n = Math.max(e.x1, e.x2),
s = Math.min(e.y1, e.y2),
r = Math.max(e.y1, e.y2);
return t.x >= i && t.x <= n && t.y >= s && t.y <= r;
};
},
function (t, e) {
t.exports = function (t, e, i, n, s, r) {
return void 0 === r && (r = 0), !(e > t.right + r || i < t.left - r || n > t.bottom + r || s < t.top - r);
};
},
function (t, e, i) {
var n = i(47);
(n.Angle = i(97)),
(n.BresenhamPoints = i(317)),
(n.CenterOn = i(1222)),
(n.Clone = i(1223)),
(n.CopyFrom = i(1224)),
(n.Equals = i(1225)),
(n.Extend = i(1226)),
(n.GetEasedPoints = i(1227)),
(n.GetMidPoint = i(1228)),
(n.GetNearestPoint = i(1229)),
(n.GetNormal = i(1230)),
(n.GetPoint = i(307)),
(n.GetPoints = i(172)),
(n.GetShortestDistance = i(1231)),
(n.Height = i(1232)),
(n.Length = i(67)),
(n.NormalAngle = i(497)),
(n.NormalX = i(1233)),
(n.NormalY = i(1234)),
(n.Offset = i(1235)),
(n.PerpSlope = i(1236)),
(n.Random = i(173)),
(n.ReflectAngle = i(1237)),
(n.Rotate = i(1238)),
(n.RotateAroundPoint = i(1239)),
(n.RotateAroundXY = i(236)),
(n.SetToAngle = i(1240)),
(n.Slope = i(1241)),
(n.Width = i(1242)),
(t.exports = n);
},
function (t, e) {
t.exports = function (t, e, i) {
var n = e - (t.x1 + t.x2) / 2,
s = i - (t.y1 + t.y2) / 2;
return (t.x1 += n), (t.y1 += s), (t.x2 += n), (t.y2 += s), t;
};
},
function (t, e, i) {
var n = i(47);
t.exports = function (t) {
return new n(t.x1, t.y1, t.x2, t.y2);
};
},
function (t, e) {
t.exports = function (t, e) {
return e.setTo(t.x1, t.y1, t.x2, t.y2);
};
},
function (t, e) {
t.exports = function (t, e) {
return t.x1 === e.x1 && t.y1 === e.y1 && t.x2 === e.x2 && t.y2 === e.y2;
};
},
function (t, e, i) {
var o = i(67);
t.exports = function (t, e, i) {
void 0 === i && (i = e);
var n = o(t),
s = t.x2 - t.x1,
r = t.y2 - t.y1;
return e && ((t.x1 = t.x1 - (s / n) * e), (t.y1 = t.y1 - (r / n) * e)), i && ((t.x2 = t.x2 + (s / n) * i), (t.y2 = t.y2 + (r / n) * i)), t;
};
},
function (t, e, i) {
var m = i(352),
x = i(80),
b = i(4);
t.exports = function (t, e, i, n, s) {
void 0 === n && (n = 0), void 0 === s && (s = []);
var r,
o = [],
a = t.x1,
h = t.y1,
l = t.x2 - a,
u = t.y2 - h,
c = x(e, s),
d = i - 1;
for (g = 0; g < d; g++) (r = c(g / d)), o.push(new b(a + l * r, h + u * r));
if (((r = c(1)), o.push(new b(a + l * r, h + u * r)), 0 < n)) {
for (var f = o[0], p = [f], g = 1; g < o.length - 1; g++) {
var v = o[g];
m(f, v) >= n && (p.push(v), (f = v));
}
var y = o[o.length - 1];
return m(f, y) < n && p.pop(), p.push(y), p;
}
return o;
};
},
function (t, e, i) {
var n = i(4);
t.exports = function (t, e) {
return void 0 === e && (e = new n()), (e.x = (t.x1 + t.x2) / 2), (e.y = (t.y1 + t.y2) / 2), e;
};
},
function (t, e, i) {
var l = i(4);
t.exports = function (t, e, i) {
void 0 === i && (i = new l());
var n = t.x1,
s = t.y1,
r = t.x2,
o = t.y2,
a = (r - n) * (r - n) + (o - s) * (o - s);
if (0 == a) return i;
var h = ((e.x - n) * (r - n) + (e.y - s) * (o - s)) / a;
return (i.x = n + h * (r - n)), (i.y = s + h * (o - s)), i;
};
},
function (t, e, i) {
var n = i(14),
s = i(97),
r = i(4);
t.exports = function (t, e) {
void 0 === e && (e = new r());
var i = s(t) - n.TAU;
return (e.x = Math.cos(i)), (e.y = Math.sin(i)), e;
};
},
function (t, e) {
t.exports = function (t, e) {
var i = t.x1,
n = t.y1,
s = t.x2,
r = t.y2,
o = (s - i) * (s - i) + (r - n) * (r - n);
if (0 == o) return !1;
var a = ((n - e.y) * (s - i) - (i - e.x) * (r - n)) / o;
return Math.abs(a) * Math.sqrt(o);
};
},
function (t, e) {
t.exports = function (t) {
return Math.abs(t.y1 - t.y2);
};
},
function (t, e, i) {
var n = i(14),
s = i(97);
t.exports = function (t) {
return Math.cos(s(t) - n.TAU);
};
},
function (t, e, i) {
var n = i(14),
s = i(97);
t.exports = function (t) {
return Math.sin(s(t) - n.TAU);
};
},
function (t, e) {
t.exports = function (t, e, i) {
return (t.x1 += e), (t.y1 += i), (t.x2 += e), (t.y2 += i), t;
};
},
function (t, e) {
t.exports = function (t) {
return -(t.x2 - t.x1) / (t.y2 - t.y1);
};
},
function (t, e, i) {
var n = i(97),
s = i(497);
t.exports = function (t, e) {
return 2 * s(e) - Math.PI - n(t);
};
},
function (t, e, i) {
var s = i(236);
t.exports = function (t, e) {
var i = (t.x1 + t.x2) / 2,
n = (t.y1 + t.y2) / 2;
return s(t, i, n, e);
};
},
function (t, e, i) {
var n = i(236);
t.exports = function (t, e, i) {
return n(t, e.x, e.y, i);
};
},
function (t, e) {
t.exports = function (t, e, i, n, s) {
return (t.x1 = e), (t.y1 = i), (t.x2 = e + Math.cos(n) * s), (t.y2 = i + Math.sin(n) * s), t;
};
},
function (t, e) {
t.exports = function (t) {
return (t.y2 - t.y1) / (t.x2 - t.x1);
};
},
function (t, e) {
t.exports = function (t) {
return Math.abs(t.x1 - t.x2);
};
},
function (t, e, i) {
var n = { Face: i(116), GenerateGridVerts: i(1244), GenerateObjVerts: i(480), GenerateVerts: i(479), ParseObj: i(498), ParseObjMaterial: i(499), RotateFace: i(1245), Vertex: i(117) };
t.exports = n;
},
function (t, e, i) {
var rt = i(116),
ot = i(2),
n = i(69),
s = i(39),
at = i(117),
ht = new s(),
lt = new s(),
ut = new n();
t.exports = function (t) {
var e = ot(t, "mesh"),
i = ot(t, "texture", null),
n = ot(t, "frame"),
s = ot(t, "width", 1),
r = ot(t, "height", s),
o = ot(t, "widthSegments", 1),
a = ot(t, "heightSegments", o),
h = ot(t, "x", 0),
l = ot(t, "y", 0),
u = ot(t, "z", 0),
c = ot(t, "rotateX", 0),
d = ot(t, "rotateY", 0),
f = ot(t, "rotateZ", 0),
p = ot(t, "zIsUp", !0),
g = ot(t, "isOrtho", !!e && e.dirtyCache[11]),
v = ot(t, "colors", [16777215]),
y = ot(t, "alphas", [1]),
m = ot(t, "tile", !1),
x = ot(t, "flipY", !1),
b = ot(t, "width", null),
w = { faces: [], verts: [] };
if ((ht.set(h, l, u), lt.set(c, d, f), ut.fromRotationXYTranslation(lt, ht, p), !i && e)) i = e.texture;
else {
if (!e || "string" != typeof i) return w;
i = e.scene.sys.textures.get(i);
}
var T = i.get(n);
!b && g && i && e && ((s = T.width / e.height), (r = T.height / e.height));
var S = s / 2,
_ = r / 2,
E = Math.floor(o),
P = Math.floor(a),
A = E + 1,
M = P + 1,
C = s / E,
O = r / P,
k = [],
R = [],
L = 0,
I = 1,
D = 0,
F = 1;
T && ((L = T.u0), (I = T.u1), (F = x ? ((D = T.v1), T.v0) : ((D = T.v0), T.v1)));
for (var B = I - L, N = F - D, U = 0; U < M; U++)
for (var Y = U * O - _, z = 0; z < A; z++) {
var X = z * C - S;
R.push(X, -Y);
var V = L + (z / E) * B,
G = D + (U / P) * N;
k.push(V, G);
}
Array.isArray(v) || (v = [v]), Array.isArray(y) || (y = [y]);
var j = 0,
H = 0;
for (U = 0; U < P; U++)
for (z = 0; z < E; z++) {
var W = 2 * (z + A * U),
K = 2 * (z + A * (U + 1)),
q = 2 * (z + 1 + A * (U + 1)),
Z = 2 * (z + 1 + A * U),
J = v[H],
Q = y[j],
$ = new at(R[W], R[1 + W], 0, k[W], k[1 + W], J, Q).transformMat4(ut),
tt = new at(R[K], R[1 + K], 0, k[K], k[1 + K], J, Q).transformMat4(ut),
et = new at(R[Z], R[1 + Z], 0, k[Z], k[1 + Z], J, Q).transformMat4(ut),
it = new at(R[K], R[1 + K], 0, k[K], k[1 + K], J, Q).transformMat4(ut),
nt = new at(R[q], R[1 + q], 0, k[q], k[1 + q], J, Q).transformMat4(ut),
st = new at(R[Z], R[1 + Z], 0, k[Z], k[1 + Z], J, Q).transformMat4(ut);
m && ($.setUVs(L, F), tt.setUVs(L, D), et.setUVs(I, F), it.setUVs(L, D), nt.setUVs(I, D), st.setUVs(I, F)),
++H === v.length && (H = 0),
++j === y.length && (j = 0),
w.verts.push($, tt, et, it, nt, st),
w.faces.push(new rt($, tt, et), new rt(it, nt, st));
}
return e && ((e.faces = e.faces.concat(w.faces)), (e.vertices = e.vertices.concat(w.verts))), w;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s, r, o;
void 0 === i && void 0 === n && ((r = (s = t.getInCenter()).x), (o = s.y));
var a = Math.cos(e),
h = Math.sin(e),
l = t.vertex1,
u = t.vertex2,
c = t.vertex3,
d = l.x - r,
f = l.y - o;
l.set(d * a - f * h + r, d * h + f * a + o), (d = u.x - r), (f = u.y - o), u.set(d * a - f * h + r, d * h + f * a + o), (d = c.x - r), (f = c.y - o), c.set(d * a - f * h + r, d * h + f * a + o);
};
},
function (t, e, i) {
var n = i(4);
(n.Ceil = i(1247)),
(n.Clone = i(1248)),
(n.CopyFrom = i(1249)),
(n.Equals = i(1250)),
(n.Floor = i(1251)),
(n.GetCentroid = i(1252)),
(n.GetMagnitude = i(500)),
(n.GetMagnitudeSq = i(501)),
(n.GetRectangleFromPoints = i(1253)),
(n.Interpolate = i(1254)),
(n.Invert = i(1255)),
(n.Negative = i(1256)),
(n.Project = i(1257)),
(n.ProjectUnit = i(1258)),
(n.SetMagnitude = i(1259)),
(t.exports = n);
},
function (t, e) {
t.exports = function (t) {
return t.setTo(Math.ceil(t.x), Math.ceil(t.y));
};
},
function (t, e, i) {
var n = i(4);
t.exports = function (t) {
return new n(t.x, t.y);
};
},
function (t, e) {
t.exports = function (t, e) {
return e.setTo(t.x, t.y);
};
},
function (t, e) {
t.exports = function (t, e) {
return t.x === e.x && t.y === e.y;
};
},
function (t, e) {
t.exports = function (t) {
return t.setTo(Math.floor(t.x), Math.floor(t.y));
};
},
function (t, e, i) {
var s = i(4);
t.exports = function (t, e) {
if ((void 0 === e && (e = new s()), !Array.isArray(t))) throw new Error("GetCentroid points argument must be an array");
var i = t.length;
if (i < 1) throw new Error("GetCentroid points array must not be empty");
if (1 === i) (e.x = t[0].x), (e.y = t[0].y);
else {
for (var n = 0; n < i; n++) (e.x += t[n].x), (e.y += t[n].y);
(e.x /= i), (e.y /= i);
}
return e;
};
},
function (t, e, i) {
var h = i(10);
t.exports = function (t, e) {
void 0 === e && (e = new h());
for (var i = Number.NEGATIVE_INFINITY, n = Number.POSITIVE_INFINITY, s = Number.NEGATIVE_INFINITY, r = Number.POSITIVE_INFINITY, o = 0; o < t.length; o++) {
var a = t[o];
a.x > i && (i = a.x), a.x < n && (n = a.x), a.y > s && (s = a.y), a.y < r && (r = a.y);
}
return (e.x = n), (e.y = r), (e.width = i - n), (e.height = s - r), e;
};
},
function (t, e, i) {
var s = i(4);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = new s()), (n.x = t.x + (e.x - t.x) * i), (n.y = t.y + (e.y - t.y) * i), n;
};
},
function (t, e) {
t.exports = function (t) {
return t.setTo(t.y, t.x);
};
},
function (t, e, i) {
var n = i(4);
t.exports = function (t, e) {
return void 0 === e && (e = new n()), e.setTo(-t.x, -t.y);
};
},
function (t, e, i) {
var s = i(4),
r = i(501);
t.exports = function (t, e, i) {
void 0 === i && (i = new s());
var n = (t.x * e.x + t.y * e.y) / r(e);
return 0 != n && ((i.x = n * e.x), (i.y = n * e.y)), i;
};
},
function (t, e, i) {
var s = i(4);
t.exports = function (t, e, i) {
void 0 === i && (i = new s());
var n = t.x * e.x + t.y * e.y;
return 0 != n && ((i.x = n * e.x), (i.y = n * e.y)), i;
};
},
function (t, e, i) {
var n = i(500);
t.exports = function (t, e) {
var i;
return (0 === t.x && 0 === t.y) || ((i = n(t)), (t.x /= i), (t.y /= i)), (t.x *= e), (t.y *= e), t;
};
},
function (t, e, i) {
var n = i(227);
(n.Clone = i(1261)),
(n.Contains = i(228)),
(n.ContainsPoint = i(1262)),
(n.Earcut = i(59)),
(n.GetAABB = i(469)),
(n.GetNumberArray = i(1263)),
(n.GetPoints = i(470)),
(n.Perimeter = i(471)),
(n.Reverse = i(1264)),
(n.Simplify = i(1265)),
(n.Smooth = i(472)),
(n.Translate = i(1266)),
(t.exports = n);
},
function (t, e, i) {
var n = i(227);
t.exports = function (t) {
return new n(t.points);
};
},
function (t, e, i) {
var n = i(228);
t.exports = function (t, e) {
return n(t, e.x, e.y);
};
},
function (t, e) {
t.exports = function (t, e) {
void 0 === e && (e = []);
for (var i = 0; i < t.points.length; i++) e.push(t.points[i].x), e.push(t.points[i].y);
return e;
};
},
function (t, e) {
t.exports = function (t) {
return t.points.reverse(), t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
void 0 === e && (e = 1), void 0 === i && (i = !1);
var n,
s,
r,
o,
a,
h = t.points;
return (
2 < h.length &&
((n = e * e),
i ||
(h = (function (t, e) {
for (var i, n, s, r, o, a = t[0], h = [a], l = 1, u = t.length; l < u; l++) (s = a), void 0, e < (r = (n = i = t[l]).x - s.x) * r + (o = n.y - s.y) * o && (h.push(i), (a = i));
return a !== i && h.push(i), h;
})(h, n)),
t.setTo(
((r = n),
(o = (s = h).length - 1),
(a = [s[0]]),
(function t(e, i, n, s, r) {
for (var o, a, h, l, u, c, d, f, p, g = s, v = i + 1; v < n; v++) {
var y =
((a = e[v]),
(h = e[i]),
(l = e[n]),
(p = f = d = c = u = void 0),
(c = h.x),
(d = h.y),
(f = l.x - c),
(p = l.y - d),
(0 === f && 0 === p) || (1 < (u = ((a.x - c) * f + (a.y - d) * p) / (f * f + p * p)) ? ((c = l.x), (d = l.y)) : 0 < u && ((c += f * u), (d += p * u))),
(f = a.x - c) * f + (p = a.y - d) * p);
g < y && ((o = v), (g = y));
}
s < g && (1 < o - i && t(e, i, o, s, r), r.push(e[o]), 1 < n - o && t(e, o, n, s, r));
})(s, 0, o, r, a),
a.push(s[o]),
a)
)),
t
);
};
},
function (t, e) {
t.exports = function (t, e, i) {
for (var n = t.points, s = 0; s < n.length; s++) (n[s].x += e), (n[s].y += i);
return t;
};
},
function (t, e) {
t.exports = function (t) {
return t.width * t.height;
};
},
function (t, e) {
t.exports = function (t) {
return (t.x = Math.ceil(t.x)), (t.y = Math.ceil(t.y)), t;
};
},
function (t, e) {
t.exports = function (t) {
return (t.x = Math.ceil(t.x)), (t.y = Math.ceil(t.y)), (t.width = Math.ceil(t.width)), (t.height = Math.ceil(t.height)), t;
};
},
function (t, e, i) {
var n = i(10);
t.exports = function (t) {
return new n(t.x, t.y, t.width, t.height);
};
},
function (t, e, i) {
var n = i(57);
t.exports = function (t, e) {
return n(t, e.x, e.y);
};
},
function (t, e) {
t.exports = function (t, e) {
return e.setTo(t.x, t.y, t.width, t.height);
};
},
function (t, e) {
t.exports = function (t, e) {
return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
};
},
function (t, e, i) {
var n = i(237);
t.exports = function (t, e) {
var i = n(t);
return i < n(e) ? t.setSize(e.height * i, e.height) : t.setSize(e.width, e.width / i), t.setPosition(e.centerX - t.width / 2, e.centerY - t.height / 2);
};
},
function (t, e, i) {
var n = i(237);
t.exports = function (t, e) {
var i = n(t);
return i > n(e) ? t.setSize(e.height * i, e.height) : t.setSize(e.width, e.width / i), t.setPosition(e.centerX - t.width / 2, e.centerY - t.height / 2);
};
},
function (t, e) {
t.exports = function (t) {
return (t.x = Math.floor(t.x)), (t.y = Math.floor(t.y)), t;
};
},
function (t, e) {
t.exports = function (t) {
return (t.x = Math.floor(t.x)), (t.y = Math.floor(t.y)), (t.width = Math.floor(t.width)), (t.height = Math.floor(t.height)), t;
};
},
function (t, e, i) {
var r = i(10);
t.exports = function (t, e, i, n, s) {
return void 0 === s && (s = new r()), s.setTo(Math.min(t, i), Math.min(e, n), Math.abs(t - i), Math.abs(e - n));
};
},
function (t, e, i) {
var n = i(4);
t.exports = function (t, e) {
return void 0 === e && (e = new n()), (e.x = t.centerX), (e.y = t.centerY), e;
};
},
function (t, e, i) {
var n = i(4);
t.exports = function (t, e) {
return void 0 === e && (e = new n()), (e.x = t.width), (e.y = t.height), e;
};
},
function (t, e, i) {
var r = i(190);
t.exports = function (t, e, i) {
var n = t.centerX,
s = t.centerY;
return t.setSize(t.width + 2 * e, t.height + 2 * i), r(t, n, s);
};
},
function (t, e, i) {
var n = i(10),
s = i(152);
t.exports = function (t, e, i) {
return (
void 0 === i && (i = new n()), s(t, e) ? ((i.x = Math.max(t.x, e.x)), (i.y = Math.max(t.y, e.y)), (i.width = Math.min(t.right, e.right) - i.x), (i.height = Math.min(t.bottom, e.bottom) - i.y)) : i.setEmpty(), i
);
};
},
function (t, e) {
t.exports = function (t, e) {
for (var i = t.x, n = t.right, s = t.y, r = t.bottom, o = 0; o < e.length; o++) (i = Math.min(i, e[o].x)), (n = Math.max(n, e[o].x)), (s = Math.min(s, e[o].y)), (r = Math.max(r, e[o].y));
return (t.x = i), (t.y = s), (t.width = n - i), (t.height = r - s), t;
};
},
function (t, e) {
t.exports = function (t, e) {
var i = Math.min(t.x, e.x),
n = Math.max(t.right, e.right);
(t.x = i), (t.width = n - i);
var s = Math.min(t.y, e.y),
r = Math.max(t.bottom, e.bottom);
return (t.y = s), (t.height = r - s), t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = Math.min(t.x, e),
s = Math.max(t.right, e);
(t.x = n), (t.width = s - n);
var r = Math.min(t.y, i),
o = Math.max(t.bottom, i);
return (t.y = r), (t.height = o - r), t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return (t.x += e), (t.y += i), t;
};
},
function (t, e) {
t.exports = function (t, e) {
return (t.x += e.x), (t.y += e.y), t;
};
},
function (t, e) {
t.exports = function (t, e) {
return t.x < e.right && t.right > e.x && t.y < e.bottom && t.bottom > e.y;
};
},
function (t, e, i) {
var a = i(4),
h = i(36);
t.exports = function (t, e, i) {
void 0 === i && (i = new a()), (e = h(e));
var n = Math.sin(e),
s = Math.cos(e),
r = 0 < s ? t.width / 2 : t.width / -2,
o = 0 < n ? t.height / 2 : t.height / -2;
return Math.abs(r * n) < Math.abs(o * s) ? (o = (r * n) / s) : (r = (o * s) / n), (i.x = r + t.centerX), (i.y = o + t.centerY), i;
};
},
function (t, e, i) {
var n = i(195),
s = i(503),
r = i(4);
t.exports = function (t, e, i) {
if ((void 0 === i && (i = new r()), s(t, e)))
switch (n(0, 3)) {
case 0:
(i.x = t.x + Math.random() * (e.right - t.x)), (i.y = t.y + Math.random() * (e.top - t.y));
break;
case 1:
(i.x = e.x + Math.random() * (t.right - e.x)), (i.y = e.bottom + Math.random() * (t.bottom - e.bottom));
break;
case 2:
(i.x = t.x + Math.random() * (e.x - t.x)), (i.y = e.y + Math.random() * (t.bottom - e.y));
break;
case 3:
(i.x = e.right + Math.random() * (t.right - e.right)), (i.y = t.y + Math.random() * (e.bottom - t.y));
}
return i;
};
},
function (t, e) {
t.exports = function (t, e) {
return t.width === e.width && t.height === e.height;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return void 0 === i && (i = e), (t.width *= e), (t.height *= i), t;
};
},
function (t, e, i) {
var n = i(82);
(n.Area = i(1294)),
(n.BuildEquilateral = i(1295)),
(n.BuildFromPolygon = i(1296)),
(n.BuildRight = i(1297)),
(n.CenterOn = i(1298)),
(n.Centroid = i(504)),
(n.CircumCenter = i(1299)),
(n.CircumCircle = i(1300)),
(n.Clone = i(1301)),
(n.Contains = i(115)),
(n.ContainsArray = i(235)),
(n.ContainsPoint = i(1302)),
(n.CopyFrom = i(1303)),
(n.Decompose = i(495)),
(n.Equals = i(1304)),
(n.GetPoint = i(476)),
(n.GetPoints = i(477)),
(n.InCenter = i(506)),
(n.Perimeter = i(1305)),
(n.Offset = i(505)),
(n.Random = i(181)),
(n.Rotate = i(1306)),
(n.RotateAroundPoint = i(1307)),
(n.RotateAroundXY = i(238)),
(t.exports = n);
},
function (t, e) {
t.exports = function (t) {
var e = t.x1,
i = t.y1,
n = t.x2,
s = t.y2,
r = t.x3,
o = t.y3;
return Math.abs(((r - e) * (s - i) - (n - e) * (o - i)) / 2);
};
},
function (t, e, i) {
var s = i(82);
t.exports = function (t, e, i) {
var n = i * (Math.sqrt(3) / 2);
return new s(t, e, t + i / 2, e + n, t - i / 2, e + n);
};
},
function (t, e, i) {
var v = i(59),
y = i(82);
t.exports = function (t, e, i, n, s) {
void 0 === e && (e = null), void 0 === i && (i = 1), void 0 === n && (n = 1), void 0 === s && (s = []);
for (var r, o, a, h, l, u, c, d, f, p = v(t, e), g = 0; g < p.length; g += 3)
(r = p[g]), (o = p[g + 1]), (a = p[g + 2]), (h = t[2 * r] * i), (l = t[2 * r + 1] * n), (u = t[2 * o] * i), (c = t[2 * o + 1] * n), (d = t[2 * a] * i), (f = t[2 * a + 1] * n), s.push(new y(h, l, u, c, d, f));
return s;
};
},
function (t, e, i) {
var s = i(82);
t.exports = function (t, e, i, n) {
return void 0 === n && (n = i), new s(t, e, t, e - n, t + i, e);
};
},
function (t, e, i) {
var a = i(504),
h = i(505);
t.exports = function (t, e, i, n) {
void 0 === n && (n = a);
var s = n(t),
r = e - s.x,
o = i - s.y;
return h(t, r, o);
};
},
function (t, e, i) {
var c = i(3);
t.exports = function (t, e) {
void 0 === e && (e = new c());
var i = t.x3,
n = t.y3,
s = t.x1 - i,
r = t.y1 - n,
o = t.x2 - i,
a = t.y2 - n,
h = 2 * (s * a - r * o),
l = r * (o * o + a * a) - (s * s + r * r) * a,
u = s * (o * o + a * a) - (s * s + r * r) * o;
return (e.x = i - l / h), (e.y = n + u / h), e;
};
},
function (t, e, i) {
var x = i(65);
t.exports = function (t, e) {
void 0 === e && (e = new x());
var i,
n,
s,
r,
o = t.x1,
a = t.y1,
h = t.x2,
l = t.y2,
u = t.x3,
c = t.y3,
d = h - o,
f = l - a,
p = u - o,
g = c - a,
v = d * (o + h) + f * (a + l),
y = p * (o + u) + g * (a + c),
m = 2 * (d * (c - l) - f * (u - h));
return (
Math.abs(m) < 1e-6
? ((i = Math.min(o, h, u)), (n = Math.min(a, l, c)), (s = 0.5 * (Math.max(o, h, u) - i)), (r = 0.5 * (Math.max(a, l, c) - n)), (e.x = i + s), (e.y = n + r))
: ((e.x = (g * v - f * y) / m), (e.y = (d * y - p * v) / m), (s = e.x - o), (r = e.y - a)),
(e.radius = Math.sqrt(s * s + r * r)),
e
);
};
},
function (t, e, i) {
var n = i(82);
t.exports = function (t) {
return new n(t.x1, t.y1, t.x2, t.y2, t.x3, t.y3);
};
},
function (t, e, i) {
var n = i(115);
t.exports = function (t, e) {
return n(t, e.x, e.y);
};
},
function (t, e) {
t.exports = function (t, e) {
return e.setTo(t.x1, t.y1, t.x2, t.y2, t.x3, t.y3);
};
},
function (t, e) {
t.exports = function (t, e) {
return t.x1 === e.x1 && t.y1 === e.y1 && t.x2 === e.x2 && t.y2 === e.y2 && t.x3 === e.x3 && t.y3 === e.y3;
};
},
function (t, e, i) {
var s = i(67);
t.exports = function (t) {
var e = t.getLineA(),
i = t.getLineB(),
n = t.getLineC();
return s(e) + s(i) + s(n);
};
},
function (t, e, i) {
var n = i(238),
s = i(506);
t.exports = function (t, e) {
var i = s(t);
return n(t, i.x, i.y, e);
};
},
function (t, e, i) {
var n = i(238);
t.exports = function (t, e, i) {
return n(t, e.x, e.y, i);
};
},
function (t, e, i) {
var n = i(203),
s = i(17)(
!1,
(s = {
CreatePixelPerfectHandler: i(507),
CreateInteractiveObject: i(508),
Events: i(51),
Gamepad: i(1309),
InputManager: i(409),
InputPlugin: i(1321),
InputPluginCache: i(153),
Keyboard: i(1322),
Mouse: i(1336),
Pointer: i(412),
Touch: i(1337),
}),
n
);
t.exports = s;
},
function (t, e, i) {
t.exports = { Axis: i(509), Button: i(510), Events: i(239), Gamepad: i(511), GamepadPlugin: i(1316), Configs: i(1317) };
},
function (t, e) {
t.exports = "down";
},
function (t, e) {
t.exports = "up";
},
function (t, e) {
t.exports = "connected";
},
function (t, e) {
t.exports = "disconnected";
},
function (t, e) {
t.exports = "down";
},
function (t, e) {
t.exports = "up";
},
function (t, e, i) {
var n = i(0),
s = i(9),
r = i(239),
h = i(511),
o = i(6),
a = i(153),
l = i(51),
u = new n({
Extends: s,
initialize: function (t) {
s.call(this),
(this.scene = t.scene),
(this.settings = this.scene.sys.settings),
(this.sceneInputPlugin = t),
(this.enabled = !0),
this.target,
(this.gamepads = []),
(this.queue = []),
this.onGamepadHandler,
this._pad1,
this._pad2,
this._pad3,
this._pad4,
t.pluginEvents.once(l.BOOT, this.boot, this),
t.pluginEvents.on(l.START, this.start, this);
},
boot: function () {
var t = this.scene.sys.game,
e = this.settings.input,
i = t.config;
(this.enabled = o(e, "gamepad", i.inputGamepad) && t.device.input.gamepads),
(this.target = o(e, "gamepad.target", i.inputGamepadEventTarget)),
this.sceneInputPlugin.pluginEvents.once(l.DESTROY, this.destroy, this);
},
start: function () {
this.enabled && (this.startListeners(), this.refreshPads()), this.sceneInputPlugin.pluginEvents.once(l.SHUTDOWN, this.shutdown, this);
},
isActive: function () {
return this.enabled && this.scene.sys.isActive();
},
startListeners: function () {
function t(t) {
!t.defaultPrevented && e.isActive() && (e.refreshPads(), e.queue.push(t));
}
var e = this,
i = this.target;
(this.onGamepadHandler = t), i.addEventListener("gamepadconnected", t, !1), i.addEventListener("gamepaddisconnected", t, !1), this.sceneInputPlugin.pluginEvents.on(l.UPDATE, this.update, this);
},
stopListeners: function () {
this.target.removeEventListener("gamepadconnected", this.onGamepadHandler),
this.target.removeEventListener("gamepaddisconnected", this.onGamepadHandler),
this.sceneInputPlugin.pluginEvents.off(l.UPDATE, this.update);
for (var t = 0; t < this.gamepads.length; t++) this.gamepads[t].removeAllListeners();
},
disconnectAll: function () {
for (var t = 0; t < this.gamepads.length; t++) this.gamepads[t].pad.connected = !1;
},
refreshPads: function () {
var t = navigator.getGamepads();
if (t)
for (var e = this.gamepads, i = 0; i < t.length; i++) {
var n,
s,
r,
o,
a = t[i];
a &&
((n = a.id),
(r = e[(s = a.index)])
? r.id !== n
? (r.destroy(), (e[s] = new h(this, a)))
: r.update(a)
: ((o = new h(this, a)), (e[s] = o), this._pad1 ? (this._pad2 ? (this._pad3 ? this._pad4 || (this._pad4 = o) : (this._pad3 = o)) : (this._pad2 = o)) : (this._pad1 = o)));
}
else this.disconnectAll();
},
getAll: function () {
for (var t = [], e = this.gamepads, i = 0; i < e.length; i++) e[i] && t.push(e[i]);
return t;
},
getPad: function (t) {
for (var e = this.gamepads, i = 0; i < e.length; i++) if (e[i] && e[i].index === t) return e[i];
},
update: function () {
if (this.enabled) {
this.refreshPads();
var t = this.queue.length;
if (0 !== t)
for (var e = this.queue.splice(0, t), i = 0; i < t; i++) {
var n = e[i],
s = this.getPad(n.gamepad.index);
"gamepadconnected" === n.type ? this.emit(r.CONNECTED, s, n) : "gamepaddisconnected" === n.type && this.emit(r.DISCONNECTED, s, n);
}
}
},
shutdown: function () {
this.stopListeners(), this.removeAllListeners();
},
destroy: function () {
this.shutdown();
for (var t = 0; t < this.gamepads.length; t++) this.gamepads[t] && this.gamepads[t].destroy();
(this.gamepads = []), (this.scene = null), (this.settings = null), (this.sceneInputPlugin = null), (this.target = null);
},
total: {
get: function () {
return this.gamepads.length;
},
},
pad1: {
get: function () {
return this._pad1;
},
},
pad2: {
get: function () {
return this._pad2;
},
},
pad3: {
get: function () {
return this._pad3;
},
},
pad4: {
get: function () {
return this._pad4;
},
},
});
a.register("GamepadPlugin", u, "gamepad", "gamepad", "inputGamepad"), (t.exports = u);
},
function (t, e, i) {
t.exports = { DUALSHOCK_4: i(1318), SNES_USB: i(1319), XBOX_360: i(1320) };
},
function (t, e) {
t.exports = {
UP: 12,
DOWN: 13,
LEFT: 14,
RIGHT: 15,
SHARE: 8,
OPTIONS: 9,
PS: 16,
TOUCHBAR: 17,
X: 0,
CIRCLE: 1,
SQUARE: 2,
TRIANGLE: 3,
L1: 4,
R1: 5,
L2: 6,
R2: 7,
L3: 10,
R3: 11,
LEFT_STICK_H: 0,
LEFT_STICK_V: 1,
RIGHT_STICK_H: 2,
RIGHT_STICK_V: 3,
};
},
function (t, e) {
t.exports = { UP: 12, DOWN: 13, LEFT: 14, RIGHT: 15, SELECT: 8, START: 9, B: 0, A: 1, Y: 2, X: 3, LEFT_SHOULDER: 4, RIGHT_SHOULDER: 5 };
},
function (t, e) {
t.exports = {
UP: 12,
DOWN: 13,
LEFT: 14,
RIGHT: 15,
MENU: 16,
A: 0,
B: 1,
X: 2,
Y: 3,
LB: 4,
RB: 5,
LT: 6,
RT: 7,
BACK: 8,
START: 9,
LS: 10,
RS: 11,
LEFT_STICK_H: 0,
LEFT_STICK_V: 1,
RIGHT_STICK_H: 2,
RIGHT_STICK_V: 3,
};
},
function (t, e, i) {
var o = i(65),
a = i(66),
n = i(0),
h = i(203),
p = i(508),
s = i(507),
r = i(50),
l = i(111),
u = i(112),
g = i(51),
c = i(9),
v = i(2),
d = i(56),
f = i(153),
y = i(7),
m = i(24),
x = i(10),
b = i(57),
w = i(20),
T = i(82),
S = i(115),
_ = new n({
Extends: c,
initialize: function (t) {
c.call(this),
(this.scene = t),
(this.systems = t.sys),
(this.settings = t.sys.settings),
(this.manager = t.sys.game.input),
(this.pluginEvents = new c()),
(this.enabled = !0),
this.displayList,
this.cameras,
f.install(this),
(this.mouse = this.manager.mouse),
(this.topOnly = !0),
(this.pollRate = -1),
(this._pollTimer = 0);
var e = { cancelled: !1 };
(this._eventContainer = {
stopPropagation: function () {
e.cancelled = !0;
},
}),
(this._eventData = e),
(this.dragDistanceThreshold = 0),
(this.dragTimeThreshold = 0),
(this._temp = []),
(this._tempZones = []),
(this._list = []),
(this._pendingInsertion = []),
(this._pendingRemoval = []),
(this._draggable = []),
(this._drag = { 0: [], 1: [], 2: [], 3: [], 4: [], 5: [], 6: [], 7: [], 8: [], 9: [], 10: [] }),
(this._dragState = []),
(this._over = { 0: [], 1: [], 2: [], 3: [], 4: [], 5: [], 6: [], 7: [], 8: [], 9: [], 10: [] }),
(this._validTypes = ["onDown", "onUp", "onOver", "onOut", "onMove", "onDragStart", "onDrag", "onDragEnd", "onDragEnter", "onDragLeave", "onDragOver", "onDrop"]),
(this._updatedThisFrame = !1),
t.sys.events.once(w.BOOT, this.boot, this),
t.sys.events.on(w.START, this.start, this);
},
boot: function () {
(this.cameras = this.systems.cameras), (this.displayList = this.systems.displayList), this.systems.events.once(w.DESTROY, this.destroy, this), this.pluginEvents.emit(g.BOOT);
},
start: function () {
var t = this.systems.events;
t.on(w.TRANSITION_START, this.transitionIn, this),
t.on(w.TRANSITION_OUT, this.transitionOut, this),
t.on(w.TRANSITION_COMPLETE, this.transitionComplete, this),
t.on(w.PRE_UPDATE, this.preUpdate, this),
t.once(w.SHUTDOWN, this.shutdown, this),
this.manager.events.on(g.GAME_OUT, this.onGameOut, this),
this.manager.events.on(g.GAME_OVER, this.onGameOver, this),
(this.enabled = !0),
(this._dragState = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]),
this.pluginEvents.emit(g.START);
},
onGameOver: function (t) {
this.isActive() && this.emit(g.GAME_OVER, t.timeStamp, t);
},
onGameOut: function (t) {
this.isActive() && this.emit(g.GAME_OUT, t.timeStamp, t);
},
preUpdate: function () {
this.pluginEvents.emit(g.PRE_UPDATE);
var t = this._pendingRemoval,
e = this._pendingInsertion,
i = t.length,
n = e.length;
if (0 !== i || 0 !== n) {
for (var s = this._list, r = 0; r < i; r++) {
var o = t[r],
a = s.indexOf(o);
-1 < a && (s.splice(a, 1), this.clear(o, !0));
}
(t.length = 0), (this._pendingRemoval.length = 0), (this._list = s.concat(e.splice(0)));
}
},
isActive: function () {
return this.enabled && this.scene.sys.isActive();
},
updatePoll: function (t, e) {
if (!this.isActive()) return !1;
if ((this.pluginEvents.emit(g.UPDATE, t, e), this._updatedThisFrame)) return (this._updatedThisFrame = !1);
for (var i = this.manager, n = i.pointers, s = i.pointersTotal, r = 0; r < s; r++) n[r].updateMotion();
if (0 === this._list.length) return !1;
var o = this.pollRate;
if (-1 === o) return !1;
if (0 < o) {
if (((this._pollTimer -= e), !(this._pollTimer < 0))) return !1;
this._pollTimer = this.pollRate;
}
var a = !1;
for (r = 0; r < s; r++) {
var h = 0,
l = n[r];
(this._tempZones = []),
(this._temp = this.hitTestPointer(l)),
this.sortGameObjects(this._temp, l),
this.sortDropZones(this._tempZones),
this.topOnly && (this._temp.length && this._temp.splice(1), this._tempZones.length && this._tempZones.splice(1)),
(h += this.processOverOutEvents(l)),
2 === this.getDragState(l) && this.processDragThresholdEvent(l, t),
0 < h && (a = !0);
}
return a;
},
update: function (t, e) {
if (!this.isActive()) return !1;
for (var i = e.length, n = !1, s = 0; s < i; s++) {
var r = 0,
o = e[s];
switch (
((this._tempZones = []),
(this._temp = this.hitTestPointer(o)),
this.sortGameObjects(this._temp, o),
this.sortDropZones(this._tempZones),
this.topOnly && (this._temp.length && this._temp.splice(1), this._tempZones.length && this._tempZones.splice(1)),
t)
) {
case h.MOUSE_DOWN:
(r += this.processDragDownEvent(o)), (r += this.processDownEvents(o)), (r += this.processOverOutEvents(o));
break;
case h.MOUSE_UP:
(r += this.processDragUpEvent(o)), (r += this.processUpEvents(o)), (r += this.processOverOutEvents(o));
break;
case h.TOUCH_START:
(r += this.processDragDownEvent(o)), (r += this.processDownEvents(o)), (r += this.processOverEvents(o));
break;
case h.TOUCH_END:
case h.TOUCH_CANCEL:
(r += this.processDragUpEvent(o)), (r += this.processUpEvents(o)), (r += this.processOutEvents(o));
break;
case h.MOUSE_MOVE:
case h.TOUCH_MOVE:
(r += this.processDragMoveEvent(o)), (r += this.processMoveEvents(o)), (r += this.processOverOutEvents(o));
break;
case h.MOUSE_WHEEL:
r += this.processWheelEvent(o);
}
0 < r && (n = !0);
}
return (this._updatedThisFrame = !0), n;
},
clear: function (t, e) {
void 0 === e && (e = !1);
var i = t.input;
if (i) {
e || this.queueForRemoval(t), (i.gameObject = void 0), (i.target = void 0), (i.hitArea = void 0), (i.hitAreaCallback = void 0), (i.callbackContext = void 0), (t.input = null);
var n = this._draggable.indexOf(t);
return (
-1 < n && this._draggable.splice(n, 1),
-1 < (n = this._drag[0].indexOf(t)) && this._drag[0].splice(n, 1),
-1 < (n = this._over[0].indexOf(t)) && (this._over[0].splice(n, 1), this.manager.resetCursor(i)),
t
);
}
},
disable: function (t) {
t.input.enabled = !1;
},
enable: function (t, e, i, n) {
return void 0 === n && (n = !1), t.input ? (t.input.enabled = !0) : this.setHitArea(t, e, i), t.input && n && !t.input.dropZone && (t.input.dropZone = n), this;
},
hitTestPointer: function (t) {
for (var e = this.cameras.getCamerasBelowPointer(t), i = 0; i < e.length; i++) {
for (var n = e[i], s = this.manager.hitTest(t, this._list, n), r = 0; r < s.length; r++) {
var o = s[r];
o.input.dropZone && this._tempZones.push(o);
}
if (0 < s.length) return (t.camera = n), s;
}
return (t.camera = e[0]), [];
},
processDownEvents: function (t) {
for (var e = 0, i = this._temp, n = this._eventData, s = this._eventContainer, r = (n.cancelled = !1), o = 0; o < i.length; o++) {
var a = i[o];
if (a.input) {
if ((e++, a.emit(g.GAMEOBJECT_POINTER_DOWN, t, a.input.localX, a.input.localY, s), n.cancelled || !a.input)) {
r = !0;
break;
}
if ((this.emit(g.GAMEOBJECT_DOWN, t, a, s), n.cancelled || !a.input)) {
r = !0;
break;
}
}
}
return !r && this.manager && (t.downElement === this.manager.game.canvas ? this.emit(g.POINTER_DOWN, t, i) : this.emit(g.POINTER_DOWN_OUTSIDE, t)), e;
},
getDragState: function (t) {
return this._dragState[t.id];
},
setDragState: function (t, e) {
this._dragState[t.id] = e;
},
processDragThresholdEvent: function (t, e) {
var i = !1,
n = this.dragTimeThreshold,
s = this.dragDistanceThreshold;
if ((((0 < s && r(t.x, t.y, t.downX, t.downY) >= s) || (0 < n && e >= t.downTime + n)) && (i = !0), i)) return this.setDragState(t, 3), this.processDragStartList(t);
},
processDragStartList: function (t) {
if (3 !== this.getDragState(t)) return 0;
for (var e = this._drag[t.id], i = 0; i < e.length; i++) {
var n = e[i],
s = n.input;
(s.dragState = 2),
(s.dragStartX = n.x),
(s.dragStartY = n.y),
(s.dragStartXGlobal = t.worldX),
(s.dragStartYGlobal = t.worldY),
(s.dragX = s.dragStartXGlobal - s.dragStartX),
(s.dragY = s.dragStartYGlobal - s.dragStartY),
n.emit(g.GAMEOBJECT_DRAG_START, t, s.dragX, s.dragY),
this.emit(g.DRAG_START, t, n);
}
return this.setDragState(t, 4), e.length;
},
processDragDownEvent: function (t) {
var e = this._temp;
if (0 === this._draggable.length || 0 === e.length || !t.primaryDown || 0 !== this.getDragState(t)) return 0;
this.setDragState(t, 1);
for (var i = [], n = 0; n < e.length; n++) {
var s = e[n];
s.input.draggable && 0 === s.input.dragState && i.push(s);
}
return 0 === i.length
? (this.setDragState(t, 0), 0)
: (1 < i.length && (this.sortGameObjects(i, t), this.topOnly && i.splice(1)),
(this._drag[t.id] = i),
0 === this.dragDistanceThreshold && 0 === this.dragTimeThreshold ? (this.setDragState(t, 3), this.processDragStartList(t)) : (this.setDragState(t, 2), 0));
},
processDragMoveEvent: function (t) {
if ((2 === this.getDragState(t) && this.processDragThresholdEvent(t, this.manager.game.loop.now), 4 !== this.getDragState(t))) return 0;
for (var e = this._tempZones, i = this._drag[t.id], n = 0; n < i.length; n++) {
var s,
r,
o,
a,
h,
l,
u,
c,
d = i[n],
f = d.input,
p = f.target;
p
? 0 === (s = e.indexOf(p))
? (d.emit(g.GAMEOBJECT_DRAG_OVER, t, p), this.emit(g.DRAG_OVER, t, d, p))
: 0 < s
? (d.emit(g.GAMEOBJECT_DRAG_LEAVE, t, p), this.emit(g.DRAG_LEAVE, t, d, p), (f.target = e[0]), (p = f.target), d.emit(g.GAMEOBJECT_DRAG_ENTER, t, p), this.emit(g.DRAG_ENTER, t, d, p))
: (d.emit(g.GAMEOBJECT_DRAG_LEAVE, t, p),
this.emit(g.DRAG_LEAVE, t, d, p),
e[0] ? ((f.target = e[0]), (p = f.target), d.emit(g.GAMEOBJECT_DRAG_ENTER, t, p), this.emit(g.DRAG_ENTER, t, d, p)) : (f.target = null))
: !p && e[0] && ((f.target = e[0]), (p = f.target), d.emit(g.GAMEOBJECT_DRAG_ENTER, t, p), this.emit(g.DRAG_ENTER, t, d, p)),
(o = d.parentContainer
? ((a = t.worldX - f.dragStartXGlobal),
(h = t.worldY - f.dragStartYGlobal),
(l = d.getParentRotation()),
(u = a * Math.cos(l) + h * Math.sin(l)),
(c = h * Math.cos(l) - a * Math.sin(l)),
(u *= 1 / d.parentContainer.scaleX),
(c *= 1 / d.parentContainer.scaleY),
(r = u + f.dragStartX),
c + f.dragStartY)
: ((r = t.worldX - f.dragX), t.worldY - f.dragY)),
d.emit(g.GAMEOBJECT_DRAG, t, r, o),
this.emit(g.DRAG, t, d, r, o);
}
return i.length;
},
processDragUpEvent: function (t) {
for (var e = this._drag[t.id], i = 0; i < e.length; i++) {
var n,
s,
r = e[i],
o = r.input;
o &&
2 === o.dragState &&
((o.dragState = 0),
(o.dragX = o.localX - r.displayOriginX),
(o.dragY = o.localY - r.displayOriginY),
(n = !1),
(s = o.target) && (r.emit(g.GAMEOBJECT_DROP, t, s), this.emit(g.DROP, t, r, s), (n = !(o.target = null))),
r.input && (r.emit(g.GAMEOBJECT_DRAG_END, t, o.dragX, o.dragY, n), this.emit(g.DRAG_END, t, r, n)));
}
return this.setDragState(t, 0), e.splice(0), 0;
},
processMoveEvents: function (t) {
for (var e = 0, i = this._temp, n = this._eventData, s = this._eventContainer, r = (n.cancelled = !1), o = 0; o < i.length; o++) {
var a = i[o];
if (a.input) {
if ((e++, a.emit(g.GAMEOBJECT_POINTER_MOVE, t, a.input.localX, a.input.localY, s), n.cancelled || !a.input)) {
r = !0;
break;
}
if ((this.emit(g.GAMEOBJECT_MOVE, t, a, s), n.cancelled || !a.input)) {
r = !0;
break;
}
if (this.topOnly) break;
}
}
return r || this.emit(g.POINTER_MOVE, t, i), e;
},
processWheelEvent: function (t) {
for (var e = 0, i = this._temp, n = this._eventData, s = this._eventContainer, r = (n.cancelled = !1), o = t.deltaX, a = t.deltaY, h = t.deltaZ, l = 0; l < i.length; l++) {
var u = i[l];
if (u.input) {
if ((e++, u.emit(g.GAMEOBJECT_POINTER_WHEEL, t, o, a, h, s), n.cancelled || !u.input)) {
r = !0;
break;
}
if ((this.emit(g.GAMEOBJECT_WHEEL, t, u, o, a, h, s), n.cancelled || !u.input)) {
r = !0;
break;
}
}
}
return r || this.emit(g.POINTER_WHEEL, t, i, o, a, h), e;
},
processOverEvents: function (t) {
var e = this._temp,
i = 0,
n = e.length,
s = [];
if (0 < n) {
for (var r = this.manager, o = this._eventData, a = this._eventContainer, h = (o.cancelled = !1), l = 0; l < n; l++) {
var u = e[l];
if (u.input) {
if ((s.push(u), r.setCursor(u.input), u.emit(g.GAMEOBJECT_POINTER_OVER, t, u.input.localX, u.input.localY, a), i++, o.cancelled || !u.input)) {
h = !0;
break;
}
if ((this.emit(g.GAMEOBJECT_OVER, t, u, a), o.cancelled || !u.input)) {
h = !0;
break;
}
}
}
h || this.emit(g.POINTER_OVER, t, s);
}
return (this._over[t.id] = s), i;
},
processOutEvents: function (t) {
var e = this._over[t.id],
i = 0,
n = e.length;
if (0 < n) {
var s = this.manager,
r = this._eventData,
o = this._eventContainer,
a = (r.cancelled = !1);
this.sortGameObjects(e, t);
for (var h = 0; h < n; h++) {
var l = e[h];
if ((l = e[h]).input) {
if ((s.resetCursor(l.input), l.emit(g.GAMEOBJECT_POINTER_OUT, t, o), i++, r.cancelled || !l.input)) {
a = !0;
break;
}
if ((this.emit(g.GAMEOBJECT_OUT, t, l, o), r.cancelled || !l.input)) {
a = !0;
break;
}
a || this.emit(g.POINTER_OUT, t, e);
}
}
this._over[t.id] = [];
}
return i;
},
processOverOutEvents: function (t) {
for (var e, i = this._temp, n = [], s = [], r = [], o = this._over[t.id], a = this._drag[t.id], h = this.manager, l = 0; l < o.length; l++)
(e = o[l]), -1 === i.indexOf(e) && -1 === a.indexOf(e) ? n.push(e) : r.push(e);
for (l = 0; l < i.length; l++) (e = i[l]), -1 === o.indexOf(e) && s.push(e);
var u = n.length,
c = 0,
d = this._eventData,
f = this._eventContainer,
p = (d.cancelled = !1);
if (0 < u) {
for (this.sortGameObjects(n, t), l = 0; l < u; l++)
if ((e = n[l]).input) {
if ((h.resetCursor(e.input), e.emit(g.GAMEOBJECT_POINTER_OUT, t, f), c++, d.cancelled || !e.input)) {
p = !0;
break;
}
if ((this.emit(g.GAMEOBJECT_OUT, t, e, f), d.cancelled || !e.input)) {
p = !0;
break;
}
}
p || this.emit(g.POINTER_OUT, t, n);
}
if (((u = s.length), (p = d.cancelled = !1), 0 < u)) {
for (this.sortGameObjects(s, t), l = 0; l < u; l++)
if ((e = s[l]).input) {
if ((h.setCursor(e.input), e.emit(g.GAMEOBJECT_POINTER_OVER, t, e.input.localX, e.input.localY, f), c++, d.cancelled || !e.input)) {
p = !0;
break;
}
if ((this.emit(g.GAMEOBJECT_OVER, t, e, f), d.cancelled || !e.input)) {
p = !0;
break;
}
}
p || this.emit(g.POINTER_OVER, t, s);
}
return (o = r.concat(s)), (this._over[t.id] = this.sortGameObjects(o, t)), c;
},
processUpEvents: function (t) {
for (var e = this._temp, i = this._eventData, n = this._eventContainer, s = (i.cancelled = !1), r = 0; r < e.length; r++) {
var o = e[r];
if (o.input) {
if ((o.emit(g.GAMEOBJECT_POINTER_UP, t, o.input.localX, o.input.localY, n), i.cancelled || !o.input)) {
s = !0;
break;
}
if ((this.emit(g.GAMEOBJECT_UP, t, o, n), i.cancelled || !o.input)) {
s = !0;
break;
}
}
}
return !s && this.manager && (t.upElement === this.manager.game.canvas ? this.emit(g.POINTER_UP, t, e) : this.emit(g.POINTER_UP_OUTSIDE, t)), e.length;
},
queueForInsertion: function (t) {
return -1 === this._pendingInsertion.indexOf(t) && -1 === this._list.indexOf(t) && this._pendingInsertion.push(t), this;
},
queueForRemoval: function (t) {
return this._pendingRemoval.push(t), this;
},
setDraggable: function (t, e) {
void 0 === e && (e = !0), Array.isArray(t) || (t = [t]);
for (var i = 0; i < t.length; i++) {
var n = t[i];
n.input.draggable = e;
var s = this._draggable.indexOf(n);
e && -1 === s ? this._draggable.push(n) : !e && -1 < s && this._draggable.splice(s, 1);
}
return this;
},
makePixelPerfect: function (t) {
void 0 === t && (t = 1);
var e = this.systems.textures;
return s(e, t);
},
setHitArea: function (t, e, i) {
if (void 0 === e) return this.setHitAreaFromTexture(t);
Array.isArray(t) || (t = [t]);
var n,
s,
r = !1,
o = !1,
a = !1,
h = !1,
l = !1,
u = !0;
y(e)
? ((e = v((n = e), "hitArea", null)),
(i = v(n, "hitAreaCallback", null)),
(r = v(n, "draggable", !1)),
(o = v(n, "dropZone", !1)),
(a = v(n, "cursor", !1)),
(h = v(n, "useHandCursor", !1)),
(l = v(n, "pixelPerfect", !1)),
(s = v(n, "alphaTolerance", 1)),
l && ((e = {}), (i = this.makePixelPerfect(s))),
(e && i) || (this.setHitAreaFromTexture(t), (u = !1)))
: "function" != typeof e || i || ((i = e), (e = {}));
for (var c = 0; c < t.length; c++) {
var d,
f = t[c];
(l && "Container" === f.type) ||
(((d = f.input ? f.input : p(f, e, i)).customHitArea = u), (d.dropZone = o), (d.cursor = h ? "pointer" : a), (f.input = d), r && this.setDraggable(f), this.queueForInsertion(f));
}
return this;
},
setHitAreaCircle: function (t, e, i, n, s) {
void 0 === s && (s = a);
var r = new o(e, i, n);
return this.setHitArea(t, r, s);
},
setHitAreaEllipse: function (t, e, i, n, s, r) {
void 0 === r && (r = u);
var o = new l(e, i, n, s);
return this.setHitArea(t, o, r);
},
setHitAreaFromTexture: function (t, e) {
void 0 === e && (e = b), Array.isArray(t) || (t = [t]);
for (var i = 0; i < t.length; i++) {
var n = t[i],
s = n.frame,
r = 0,
o = 0;
n.width ? ((r = n.width), (o = n.height)) : s && ((r = s.realWidth), (o = s.realHeight)),
("Container" !== n.type || (0 !== r && 0 !== o)) && 0 !== r && 0 !== o && ((n.input = p(n, new x(0, 0, r, o), e)), this.queueForInsertion(n));
}
return this;
},
setHitAreaRectangle: function (t, e, i, n, s, r) {
void 0 === r && (r = b);
var o = new x(e, i, n, s);
return this.setHitArea(t, o, r);
},
setHitAreaTriangle: function (t, e, i, n, s, r, o, a) {
void 0 === a && (a = S);
var h = new T(e, i, n, s, r, o);
return this.setHitArea(t, h, a);
},
enableDebug: function (o, a) {
void 0 === a && (a = 65280);
var t = o.input;
if (!t || !t.hitArea) return this;
var e = t.hitArea,
i = e.type,
h = t.hitAreaDebug,
n = this.systems.add,
s = this.systems.updateList;
h && (s.remove(h), h.destroy(), (h = null));
var l = 0,
u = 0;
switch (i) {
case d.CIRCLE:
(h = n.arc(0, 0, e.radius)), (l = e.x - e.radius), (u = e.y - e.radius);
break;
case d.ELLIPSE:
(h = n.ellipse(0, 0, e.width, e.height)), (l = e.x - e.width / 2), (u = e.y - e.height / 2);
break;
case d.LINE:
h = n.line(0, 0, e.x1, e.y1, e.x2, e.y2);
break;
case d.POLYGON:
h = n.polygon(0, 0, e.points);
break;
case d.RECTANGLE:
(h = n.rectangle(0, 0, e.width, e.height)), (l = e.x), (u = e.y);
break;
case d.TRIANGLE:
h = n.triangle(0, 0, e.x1, e.y1, e.x2, e.y2, e.x3, e.y3);
}
return (
h &&
((h.isFilled = !1),
(h.preUpdate = function () {
h.setStrokeStyle(1 / o.scale, a), h.setDisplayOrigin(o.displayOriginX, o.displayOriginY);
var t,
e = o.x,
i = o.y,
n = o.rotation,
s = o.scaleX,
r = o.scaleY;
o.parentContainer && ((e = (t = o.getWorldTransformMatrix()).tx), (i = t.ty), (n = t.rotation), (s = t.scaleX), (r = t.scaleY)),
h.setRotation(n),
h.setScale(s, r),
h.setPosition(e + l, i + u),
h.setScrollFactor(o.scrollFactorX, o.scrollFactorY),
h.setDepth(o.depth);
}),
s.add(h),
(t.hitAreaDebug = h)),
this
);
},
removeDebug: function (t) {
var e,
i = t.input;
return i && i.hitAreaDebug && ((e = i.hitAreaDebug), this.systems.updateList.remove(e), e.destroy(), (i.hitAreaDebug = null)), this;
},
setPollAlways: function () {
return this.setPollRate(0);
},
setPollOnMove: function () {
return this.setPollRate(-1);
},
setPollRate: function (t) {
return (this.pollRate = t), (this._pollTimer = 0), this;
},
setGlobalTopOnly: function (t) {
return (this.manager.globalTopOnly = t), this;
},
setTopOnly: function (t) {
return (this.topOnly = t), this;
},
sortGameObjects: function (t, e) {
if (t.length < 2) return t;
var i = e.camera.renderList;
return t.sort(function (t, e) {
return i.indexOf(e) - i.indexOf(t);
});
},
sortDropZones: function (t) {
return t.length < 2 ? t : (this.scene.sys.depthSort(), t.sort(this.sortDropZoneHandler.bind(this)));
},
sortDropZoneHandler: function (t, e) {
if (t.parentContainer || e.parentContainer) {
if (t.parentContainer === e.parentContainer) return e.parentContainer.getIndex(e) - t.parentContainer.getIndex(t);
if (t.parentContainer === e) return -1;
if (e.parentContainer === t) return 1;
for (var i = t.getIndexList(), n = e.getIndexList(), s = Math.min(i.length, n.length), r = 0; r < s; r++) {
var o = i[r],
a = n[r];
if (o !== a) return a - o;
}
return n.length - i.length;
}
return this.displayList.getIndex(e) - this.displayList.getIndex(t);
},
stopPropagation: function () {
return (this.manager._tempSkip = !0), this;
},
addPointer: function (t) {
return this.manager.addPointer(t);
},
setDefaultCursor: function (t) {
return this.manager.setDefaultCursor(t), this;
},
transitionIn: function () {
this.enabled = this.settings.transitionAllowInput;
},
transitionComplete: function () {
this.settings.transitionAllowInput || (this.enabled = !0);
},
transitionOut: function () {
this.enabled = this.settings.transitionAllowInput;
},
shutdown: function () {
this.pluginEvents.emit(g.SHUTDOWN), (this._temp.length = 0), (this._list.length = 0), (this._draggable.length = 0), (this._pendingRemoval.length = 0), (this._pendingInsertion.length = 0);
for (var t = (this._dragState.length = 0); t < 10; t++) (this._drag[t] = []), (this._over[t] = []);
this.removeAllListeners();
var e = this.manager;
e.canvas.style.cursor = e.defaultCursor;
var i = this.systems.events;
i.off(w.TRANSITION_START, this.transitionIn, this),
i.off(w.TRANSITION_OUT, this.transitionOut, this),
i.off(w.TRANSITION_COMPLETE, this.transitionComplete, this),
i.off(w.PRE_UPDATE, this.preUpdate, this),
e.events.off(g.GAME_OUT, this.onGameOut, this),
e.events.off(g.GAME_OVER, this.onGameOver, this),
i.off(w.SHUTDOWN, this.shutdown, this);
},
destroy: function () {
this.shutdown(),
this.pluginEvents.emit(g.DESTROY),
this.pluginEvents.removeAllListeners(),
this.scene.sys.events.off(w.START, this.start, this),
(this.scene = null),
(this.cameras = null),
(this.manager = null),
(this.events = null),
(this.mouse = null);
},
x: {
get: function () {
return this.manager.activePointer.x;
},
},
y: {
get: function () {
return this.manager.activePointer.y;
},
},
isOver: {
get: function () {
return this.manager.isOver;
},
},
mousePointer: {
get: function () {
return this.manager.mousePointer;
},
},
activePointer: {
get: function () {
return this.manager.activePointer;
},
},
pointer1: {
get: function () {
return this.manager.pointers[1];
},
},
pointer2: {
get: function () {
return this.manager.pointers[2];
},
},
pointer3: {
get: function () {
return this.manager.pointers[3];
},
},
pointer4: {
get: function () {
return this.manager.pointers[4];
},
},
pointer5: {
get: function () {
return this.manager.pointers[5];
},
},
pointer6: {
get: function () {
return this.manager.pointers[6];
},
},
pointer7: {
get: function () {
return this.manager.pointers[7];
},
},
pointer8: {
get: function () {
return this.manager.pointers[8];
},
},
pointer9: {
get: function () {
return this.manager.pointers[9];
},
},
pointer10: {
get: function () {
return this.manager.pointers[10];
},
},
});
m.register("InputPlugin", _, "input"), (t.exports = _);
},
function (t, e, i) {
t.exports = {
Events: i(154),
KeyboardManager: i(410),
KeyboardPlugin: i(1330),
Key: i(512),
KeyCodes: i(143),
KeyCombo: i(513),
AdvanceKeyCombo: i(515),
ProcessKeyCombo: i(514),
ResetKeyCombo: i(516),
JustDown: i(1332),
JustUp: i(1333),
DownDuration: i(1334),
UpDuration: i(1335),
};
},
function (t, e) {
t.exports = "keydown";
},
function (t, e) {
t.exports = "keyup";
},
function (t, e) {
t.exports = "keycombomatch";
},
function (t, e) {
t.exports = "down";
},
function (t, e) {
t.exports = "keydown-";
},
function (t, e) {
t.exports = "keyup-";
},
function (t, e) {
t.exports = "up";
},
function (t, e, i) {
var n = i(0),
s = i(9),
h = i(154),
r = i(22),
o = i(6),
a = i(51),
l = i(153),
u = i(512),
c = i(143),
d = i(513),
f = i(1331),
p = i(20),
g = i(76),
v = new n({
Extends: s,
initialize: function (t) {
s.call(this),
(this.game = t.systems.game),
(this.scene = t.scene),
(this.settings = this.scene.sys.settings),
(this.sceneInputPlugin = t),
(this.manager = t.manager.keyboard),
(this.enabled = !0),
(this.keys = []),
(this.combos = []),
(this.prevCode = null),
(this.prevTime = 0),
(this.prevType = null),
t.pluginEvents.once(a.BOOT, this.boot, this),
t.pluginEvents.on(a.START, this.start, this);
},
boot: function () {
var t = this.settings.input;
this.enabled = o(t, "keyboard", !0);
var e = o(t, "keyboard.capture", null);
e && this.addCaptures(e), this.sceneInputPlugin.pluginEvents.once(a.DESTROY, this.destroy, this);
},
start: function () {
this.sceneInputPlugin.manager.events.on(a.MANAGER_PROCESS, this.update, this),
this.sceneInputPlugin.pluginEvents.once(a.SHUTDOWN, this.shutdown, this),
this.game.events.on(r.BLUR, this.resetKeys, this),
this.scene.sys.events.on(p.PAUSE, this.resetKeys, this),
this.scene.sys.events.on(p.SLEEP, this.resetKeys, this);
},
isActive: function () {
return this.enabled && this.scene.sys.isActive();
},
addCapture: function (t) {
return this.manager.addCapture(t), this;
},
removeCapture: function (t) {
return this.manager.removeCapture(t), this;
},
getCaptures: function () {
return this.manager.captures;
},
enableGlobalCapture: function () {
return (this.manager.preventDefault = !0), this;
},
disableGlobalCapture: function () {
return (this.manager.preventDefault = !1), this;
},
clearCaptures: function () {
return this.manager.clearCaptures(), this;
},
createCursorKeys: function () {
return this.addKeys({ up: c.UP, down: c.DOWN, left: c.LEFT, right: c.RIGHT, space: c.SPACE, shift: c.SHIFT });
},
addKeys: function (t, e, i) {
void 0 === e && (e = !0), void 0 === i && (i = !1);
var n = {};
if ("string" == typeof t) {
t = t.split(",");
for (var s = 0; s < t.length; s++) {
var r = t[s].trim();
r && (n[r] = this.addKey(r, e, i));
}
} else for (var o in t) n[o] = this.addKey(t[o], e, i);
return n;
},
addKey: function (t, e, i) {
void 0 === e && (e = !0), void 0 === i && (i = !1);
var n = this.keys;
if (t instanceof u) {
var s = n.indexOf(t);
return -1 < s ? (n[s] = t) : (n[t.keyCode] = t), e && this.addCapture(t.keyCode), t.setEmitOnRepeat(i), t;
}
return "string" == typeof t && (t = c[t.toUpperCase()]), n[t] || ((n[t] = new u(this, t)), e && this.addCapture(t), n[t].setEmitOnRepeat(i)), n[t];
},
removeKey: function (t, e) {
void 0 === e && (e = !1);
var i,
n,
s = this.keys;
return (
t instanceof u ? -1 < (n = s.indexOf(t)) && ((i = this.keys[n]), (this.keys[n] = void 0)) : "string" == typeof t && (t = c[t.toUpperCase()]),
s[t] && ((i = s[t]), (s[t] = void 0)),
i && ((i.plugin = null), e && i.destroy()),
this
);
},
removeAllKeys: function (t) {
for (var e = this.keys, i = 0; i < e.length; i++) {
var n = e[i];
n && ((e[i] = void 0), t && n.destroy());
}
return this;
},
createCombo: function (t, e) {
return new d(this, t, e);
},
checkDown: function (t, e) {
if ((void 0 === e && (e = 0), this.enabled && t.isDown)) {
var i = g(this.time - t.timeDown, e);
if (i > t._tick) return (t._tick = i), !0;
}
return !1;
},
update: function () {
var t = this.manager.queue,
e = t.length;
if (this.isActive() && 0 !== e)
for (var i = this.keys, n = 0; n < e; n++) {
var s = t[n],
r = s.keyCode,
o = i[r],
a = !1;
void 0 === s.cancelled &&
((s.cancelled = 0),
(s.stopImmediatePropagation = function () {
s.cancelled = 1;
}),
(s.stopPropagation = function () {
s.cancelled = -1;
})),
-1 !== s.cancelled &&
((r === this.prevCode && s.timeStamp === this.prevTime && s.type === this.prevType) ||
((this.prevCode = r),
(this.prevTime = s.timeStamp),
(this.prevType = s.type),
"keydown" === s.type
? (o && ((a = o.isDown), o.onDown(s)), s.cancelled || (o && a) || (f[r] && this.emit(h.KEY_DOWN + f[r], s), s.cancelled || this.emit(h.ANY_KEY_DOWN, s)))
: (o && o.onUp(s), s.cancelled || (f[r] && this.emit(h.KEY_UP + f[r], s), s.cancelled || this.emit(h.ANY_KEY_UP, s))),
1 === s.cancelled && (s.cancelled = 0)));
}
},
resetKeys: function () {
for (var t = this.keys, e = 0; e < t.length; e++) t[e] && t[e].reset();
return this;
},
shutdown: function () {
this.removeAllKeys(!0),
this.removeAllListeners(),
this.sceneInputPlugin.manager.events.off(a.MANAGER_PROCESS, this.update, this),
this.game.events.off(r.BLUR, this.resetKeys),
this.scene.sys.events.off(p.PAUSE, this.resetKeys, this),
this.scene.sys.events.off(p.SLEEP, this.resetKeys, this),
(this.queue = []);
},
destroy: function () {
this.shutdown();
for (var t = this.keys, e = 0; e < t.length; e++) t[e] && t[e].destroy();
(this.keys = []), (this.combos = []), (this.queue = []), (this.scene = null), (this.settings = null), (this.sceneInputPlugin = null), (this.manager = null);
},
time: {
get: function () {
return this.sceneInputPlugin.manager.time;
},
},
});
l.register("KeyboardPlugin", v, "keyboard", "keyboard", "inputKeyboard"), (t.exports = v);
},
function (t, e, i) {
var n = i(143),
s = {};
for (var r in n) s[n[r]] = r;
t.exports = s;
},
function (t, e) {
t.exports = function (t) {
return !!t._justDown && !(t._justDown = !1);
};
},
function (t, e) {
t.exports = function (t) {
return !!t._justUp && !(t._justUp = !1);
};
},
function (t, e) {
t.exports = function (t, e) {
void 0 === e && (e = 50);
var i = t.plugin.game.loop.time - t.timeDown;
return t.isDown && i < e;
};
},
function (t, e) {
t.exports = function (t, e) {
void 0 === e && (e = 50);
var i = t.plugin.game.loop.time - t.timeUp;
return t.isUp && i < e;
};
},
function (t, e, i) {
t.exports = { MouseManager: i(411) };
},
function (t, e, i) {
t.exports = { TouchManager: i(413) };
},
function (t, e, i) {
var n = i(21),
s = i(17)(
!1,
(s = { Events: i(95), FileTypes: i(1339), File: i(23), FileTypesManager: i(8), GetURL: i(155), LoaderPlugin: i(1365), MergeXHRSettings: i(240), MultiFile: i(49), XHRLoader: i(517), XHRSettings: i(156) }),
n
);
t.exports = s;
},
function (t, e, i) {
t.exports = {
AnimationJSONFile: i(1340),
AsepriteFile: i(1341),
AtlasJSONFile: i(1342),
AtlasXMLFile: i(1343),
AudioFile: i(518),
AudioSpriteFile: i(1344),
BinaryFile: i(1345),
BitmapFontFile: i(1346),
CSSFile: i(1347),
GLSLFile: i(1348),
HTML5AudioFile: i(519),
HTMLFile: i(1349),
HTMLTextureFile: i(1350),
ImageFile: i(71),
JSONFile: i(61),
MultiAtlasFile: i(1351),
MultiScriptFile: i(1352),
OBJFile: i(1353),
PackFile: i(1354),
PluginFile: i(1355),
SceneFile: i(1356),
ScenePluginFile: i(1357),
ScriptFile: i(520),
SpriteSheetFile: i(1358),
SVGFile: i(1359),
TextFile: i(242),
TilemapCSVFile: i(1360),
TilemapImpactFile: i(1361),
TilemapJSONFile: i(1362),
UnityAtlasFile: i(1363),
VideoFile: i(1364),
XMLFile: i(241),
};
},
function (t, e, i) {
var n = i(0),
s = i(8),
r = i(61),
o = i(95),
a = new n({
Extends: r,
initialize: function (t, e, i, n, s) {
r.call(this, t, e, i, n, s), (this.type = "animationJSON");
},
onProcess: function () {
this.loader.once(o.POST_PROCESS, this.onLoadComplete, this), r.prototype.onProcess.call(this);
},
onLoadComplete: function () {
this.loader.systems.anims.fromJSON(this.data);
},
});
s.register("animation", function (t, e, i, n) {
if (Array.isArray(t)) for (var s = 0; s < t.length; s++) this.addFile(new a(this, t[s]));
else this.addFile(new a(this, t, e, n, i));
return this;
}),
(t.exports = a);
},
function (t, e, i) {
var n = i(0),
s = i(8),
l = i(2),
u = i(71),
c = i(7),
d = i(61),
f = i(49),
a = new n({
Extends: f,
initialize: function (t, e, i, n, s, r) {
var o,
a,
h = c(e)
? ((e = l((a = e), "key")),
(o = new u(t, { key: e, url: l(a, "textureURL"), extension: l(a, "textureExtension", "png"), normalMap: l(a, "normalMap"), xhrSettings: l(a, "textureXhrSettings") })),
new d(t, { key: e, url: l(a, "atlasURL"), extension: l(a, "atlasExtension", "json"), xhrSettings: l(a, "atlasXhrSettings") }))
: ((o = new u(t, e, i, s)), new d(t, e, n, r));
o.linkFile ? f.call(this, t, "atlasjson", e, [o, h, o.linkFile]) : f.call(this, t, "atlasjson", e, [o, h]);
},
addToCache: function () {
var t, e, i;
this.isReadyToProcess() &&
((t = this.files[0]), (e = this.files[1]), (i = this.files[2] ? this.files[2].data : null), this.loader.textureManager.addAtlas(t.key, t.data, e.data, i), e.addToCache(), (this.complete = !0));
},
});
s.register("aseprite", function (t, e, i, n, s) {
var r;
if (Array.isArray(t)) for (var o = 0; o < t.length; o++) (r = new a(this, t[o])), this.addFile(r.files);
else (r = new a(this, t, e, i, n, s)), this.addFile(r.files);
return this;
}),
(t.exports = a);
},
function (t, e, i) {
var n = i(0),
s = i(8),
l = i(2),
u = i(71),
c = i(7),
d = i(61),
f = i(49),
a = new n({
Extends: f,
initialize: function (t, e, i, n, s, r) {
var o,
a,
h = c(e)
? ((e = l((a = e), "key")),
(o = new u(t, { key: e, url: l(a, "textureURL"), extension: l(a, "textureExtension", "png"), normalMap: l(a, "normalMap"), xhrSettings: l(a, "textureXhrSettings") })),
new d(t, { key: e, url: l(a, "atlasURL"), extension: l(a, "atlasExtension", "json"), xhrSettings: l(a, "atlasXhrSettings") }))
: ((o = new u(t, e, i, s)), new d(t, e, n, r));
o.linkFile ? f.call(this, t, "atlasjson", e, [o, h, o.linkFile]) : f.call(this, t, "atlasjson", e, [o, h]);
},
addToCache: function () {
var t, e, i;
this.isReadyToProcess() &&
((t = this.files[0]), (e = this.files[1]), (i = this.files[2] ? this.files[2].data : null), this.loader.textureManager.addAtlas(t.key, t.data, e.data, i), e.pendingDestroy(), (this.complete = !0));
},
});
s.register("atlas", function (t, e, i, n, s) {
var r;
if (Array.isArray(t)) for (var o = 0; o < t.length; o++) (r = new a(this, t[o])), this.addFile(r.files);
else (r = new a(this, t, e, i, n, s)), this.addFile(r.files);
return this;
}),
(t.exports = a);
},
function (t, e, i) {
var n = i(0),
s = i(8),
l = i(2),
u = i(71),
c = i(7),
d = i(49),
f = i(241),
a = new n({
Extends: d,
initialize: function (t, e, i, n, s, r) {
var o,
a,
h = c(e)
? ((e = l((a = e), "key")),
(o = new u(t, { key: e, url: l(a, "textureURL"), extension: l(a, "textureExtension", "png"), normalMap: l(a, "normalMap"), xhrSettings: l(a, "textureXhrSettings") })),
new f(t, { key: e, url: l(a, "atlasURL"), extension: l(a, "atlasExtension", "xml"), xhrSettings: l(a, "atlasXhrSettings") }))
: ((o = new u(t, e, i, s)), new f(t, e, n, r));
o.linkFile ? d.call(this, t, "atlasxml", e, [o, h, o.linkFile]) : d.call(this, t, "atlasxml", e, [o, h]);
},
addToCache: function () {
var t, e, i;
this.isReadyToProcess() &&
((t = this.files[0]), (e = this.files[1]), (i = this.files[2] ? this.files[2].data : null), this.loader.textureManager.addAtlasXML(t.key, t.data, e.data, i), e.pendingDestroy(), (this.complete = !0));
},
});
s.register("atlasXML", function (t, e, i, n, s) {
var r;
if (Array.isArray(t)) for (var o = 0; o < t.length; o++) (r = new a(this, t[o])), this.addFile(r.files);
else (r = new a(this, t, e, i, n, s)), this.addFile(r.files);
return this;
}),
(t.exports = a);
},
function (t, e, i) {
var u = i(518),
n = i(0),
s = i(8),
c = i(2),
d = i(7),
f = i(61),
p = i(49),
g = new n({
Extends: p,
initialize: function (t, e, i, n, s, r, o) {
var a, h, l;
d(e) && ((e = c((a = e), "key")), (i = c(a, "jsonURL")), (n = c(a, "audioURL")), (s = c(a, "audioConfig")), (r = c(a, "audioXhrSettings")), (o = c(a, "jsonXhrSettings"))),
n
? (l = u.create(t, e, n, s, r)) && ((h = new f(t, e, i, o)), p.call(this, t, "audiosprite", e, [l, h]), (this.config.resourceLoad = !1))
: ((h = new f(t, e, i, o)), p.call(this, t, "audiosprite", e, [h]), (this.config.resourceLoad = !0), (this.config.audioConfig = s), (this.config.audioXhrSettings = r));
},
onFileComplete: function (t) {
var e, i, n, s;
-1 !== this.files.indexOf(t) &&
(this.pending--,
this.config.resourceLoad &&
"json" === t.type &&
t.data.hasOwnProperty("resources") &&
((e = t.data.resources),
(i = c(this.config, "audioConfig")),
(n = c(this.config, "audioXhrSettings")),
(s = u.create(this.loader, t.key, e, i, n)) && (this.addToMultiFile(s), this.loader.addFile(s))));
},
addToCache: function () {
var t, e;
this.isReadyToProcess() && ((t = this.files[0]), (e = this.files[1]), t.addToCache(), e.addToCache(), (this.complete = !0));
},
});
s.register("audioSprite", function (t, e, i, n, s, r) {
var o,
a = this.systems.game,
h = a.config.audio,
l = a.device.audio;
if ((h && h.noAudio) || (!l.webAudio && !l.audioData)) return this;
if (Array.isArray(t)) for (var u = 0; u < t.length; u++) (o = new g(this, t[u])).files && this.addFile(o.files);
else (o = new g(this, t, e, i, n, s, r)).files && this.addFile(o.files);
return this;
});
},
function (t, e, i) {
var n = i(0),
s = i(21),
h = i(23),
r = i(8),
l = i(2),
u = i(7),
o = new n({
Extends: h,
initialize: function (t, e, i, n, s) {
var r,
o = "bin";
u(e) && ((e = l((r = e), "key")), (i = l(r, "url")), (n = l(r, "xhrSettings")), (o = l(r, "extension", o)), (s = l(r, "dataType", s)));
var a = { type: "binary", cache: t.cacheManager.binary, extension: o, responseType: "arraybuffer", key: e, url: i, xhrSettings: n, config: { dataType: s } };
h.call(this, t, a);
},
onProcess: function () {
this.state = s.FILE_PROCESSING;
var t = this.config.dataType;
(this.data = t ? new t(this.xhrLoader.response) : this.xhrLoader.response), this.onProcessComplete();
},
});
r.register("binary", function (t, e, i, n) {
if (Array.isArray(t)) for (var s = 0; s < t.length; s++) this.addFile(new o(this, t[s]));
else this.addFile(new o(this, t, e, n, i));
return this;
}),
(t.exports = o);
},
function (t, e, i) {
var n = i(0),
s = i(8),
l = i(2),
u = i(71),
c = i(7),
d = i(49),
r = i(212),
f = i(241),
a = new n({
Extends: d,
initialize: function (t, e, i, n, s, r) {
var o,
a,
h = c(e)
? ((e = l((a = e), "key")),
(o = new u(t, { key: e, url: l(a, "textureURL"), extension: l(a, "textureExtension", "png"), normalMap: l(a, "normalMap"), xhrSettings: l(a, "textureXhrSettings") })),
new f(t, { key: e, url: l(a, "fontDataURL"), extension: l(a, "fontDataExtension", "xml"), xhrSettings: l(a, "fontDataXhrSettings") }))
: ((o = new u(t, e, i, s)), new f(t, e, n, r));
o.linkFile ? d.call(this, t, "bitmapfont", e, [o, h, o.linkFile]) : d.call(this, t, "bitmapfont", e, [o, h]);
},
addToCache: function () {
var t, e, i, n;
this.isReadyToProcess() &&
((t = this.files[0]),
(e = this.files[1]),
t.addToCache(),
e.pendingDestroy(),
(i = t.cache.get(t.key)),
(n = r(e.data, t.cache.getFrame(t.key), 0, 0, i)),
this.loader.cacheManager.bitmapFont.add(t.key, { data: n, texture: t.key, frame: null }),
(this.complete = !0));
},
});
s.register("bitmapFont", function (t, e, i, n, s) {
var r;
if (Array.isArray(t)) for (var o = 0; o < t.length; o++) (r = new a(this, t[o])), this.addFile(r.files);
else (r = new a(this, t, e, i, n, s)), this.addFile(r.files);
return this;
}),
(t.exports = a);
},
function (t, e, i) {
var n = i(0),
s = i(21),
a = i(23),
r = i(8),
h = i(2),
l = i(7),
o = new n({
Extends: a,
initialize: function (t, e, i, n) {
var s,
r = "css";
l(e) && ((e = h((s = e), "key")), (i = h(s, "url")), (n = h(s, "xhrSettings")), (r = h(s, "extension", r)));
var o = { type: "script", cache: !1, extension: r, responseType: "text", key: e, url: i, xhrSettings: n };
a.call(this, t, o);
},
onProcess: function () {
(this.state = s.FILE_PROCESSING),
(this.data = document.createElement("style")),
(this.data.defer = !1),
(this.data.innerHTML = this.xhrLoader.responseText),
document.head.appendChild(this.data),
this.onProcessComplete();
},
});
r.register("css", function (t, e, i) {
if (Array.isArray(t)) for (var n = 0; n < t.length; n++) this.addFile(new o(this, t[n]));
else this.addFile(new o(this, t, e, i));
return this;
}),
(t.exports = o);
},
function (t, e, i) {
var n = i(0),
s = i(21),
h = i(23),
r = i(8),
l = i(2),
u = i(7),
a = i(396),
o = new n({
Extends: h,
initialize: function (t, e, i, n, s) {
var r,
o = "glsl";
u(e) ? ((e = l((r = e), "key")), (i = l(r, "url")), (n = l(r, "shaderType", "fragment")), (s = l(r, "xhrSettings")), (o = l(r, "extension", o))) : void 0 === n && (n = "fragment");
var a = { type: "glsl", cache: t.cacheManager.shader, extension: o, responseType: "text", key: e, url: i, config: { shaderType: n }, xhrSettings: s };
h.call(this, t, a);
},
onProcess: function () {
(this.state = s.FILE_PROCESSING), (this.data = this.xhrLoader.responseText), this.onProcessComplete();
},
addToCache: function () {
var t = this.data.split("\n"),
e = this.extractBlock(t, 0);
if (e)
for (; e; ) {
var i,
n = this.getShaderName(e.header),
s = this.getShaderType(e.header),
r = this.getShaderUniforms(e.header),
o = e.shader;
this.cache.has(n)
? ((i = this.cache.get(n)), "fragment" === s ? (i.fragmentSrc = o) : (i.vertexSrc = o), i.uniforms || (i.uniforms = r))
: "fragment" === s
? this.cache.add(n, new a(n, o, "", r))
: this.cache.add(n, new a(n, "", o, r)),
(e = this.extractBlock(t, e.offset));
}
else "fragment" === this.config.shaderType ? this.cache.add(this.key, new a(this.key, this.data)) : this.cache.add(this.key, new a(this.key, "", this.data));
this.pendingDestroy();
},
getShaderName: function (t) {
for (var e = 0; e < t.length; e++) {
var i = t[e].trim();
if ("name:" === i.substring(0, 5)) return i.substring(5).trim();
}
return this.key;
},
getShaderType: function (t) {
for (var e = 0; e < t.length; e++) {
var i = t[e].trim();
if ("type:" === i.substring(0, 5)) return i.substring(5).trim();
}
return this.config.shaderType;
},
getShaderUniforms: function (t) {
for (var e = {}, i = 0; i < t.length; i++) {
var n = t[i].trim();
if ("uniform." === n.substring(0, 8)) {
var s = n.indexOf(":");
if (s) {
var r = n.substring(8, s);
try {
e[r] = JSON.parse(n.substring(s + 1));
} catch (t) {}
}
}
}
return e;
},
extractBlock: function (t, e) {
for (var i = -1, n = -1, s = -1, r = !1, o = !1, a = [], h = [], l = e; l < t.length; l++) {
var u = t[l].trim();
if ("---" === u)
if (-1 === i) (i = l), (r = !0);
else {
if (!r) {
o = !1;
break;
}
(n = l), (o = !(r = !1));
}
else r ? a.push(u) : o && (h.push(u), (s = l));
}
return r || -1 === n ? null : { header: a, shader: h.join("\n"), offset: s };
},
});
r.register("glsl", function (t, e, i, n) {
if (Array.isArray(t)) for (var s = 0; s < t.length; s++) this.addFile(new o(this, t[s]));
else this.addFile(new o(this, t, e, i, n));
return this;
}),
(t.exports = o);
},
function (t, e, i) {
var n = i(0),
s = i(21),
a = i(23),
r = i(8),
h = i(2),
l = i(7),
o = new n({
Extends: a,
initialize: function (t, e, i, n) {
var s,
r = "html";
l(e) && ((e = h((s = e), "key")), (i = h(s, "url")), (n = h(s, "xhrSettings")), (r = h(s, "extension", r)));
var o = { type: "text", cache: t.cacheManager.html, extension: r, responseType: "text", key: e, url: i, xhrSettings: n };
a.call(this, t, o);
},
onProcess: function () {
(this.state = s.FILE_PROCESSING), (this.data = this.xhrLoader.responseText), this.onProcessComplete();
},
});
r.register("html", function (t, e, i) {
if (Array.isArray(t)) for (var n = 0; n < t.length; n++) this.addFile(new o(this, t[n]));
else this.addFile(new o(this, t, e, i));
return this;
}),
(t.exports = o);
},
function (t, e, i) {
var n = i(0),
o = i(21),
l = i(23),
s = i(8),
u = i(2),
c = i(7),
a = new n({
Extends: l,
initialize: function (t, e, i, n, s, r) {
void 0 === n && (n = 512), void 0 === s && (s = 512);
var o,
a = "html";
c(e) && ((e = u((o = e), "key")), (i = u(o, "url")), (r = u(o, "xhrSettings")), (a = u(o, "extension", a)), (n = u(o, "width", n)), (s = u(o, "height", s)));
var h = { type: "html", cache: t.textureManager, extension: a, responseType: "text", key: e, url: i, xhrSettings: r, config: { width: n, height: s } };
l.call(this, t, h);
},
onProcess: function () {
this.state = o.FILE_PROCESSING;
var t = this.config.width,
e = this.config.height,
i = [];
i.push('");
var n = [i.join("\n")],
s = this;
try {
var r = new window.Blob(n, { type: "image/svg+xml;charset=utf-8" });
} catch (t) {
return (s.state = o.FILE_ERRORED), void s.onProcessComplete();
}
(this.data = new Image()),
(this.data.crossOrigin = this.crossOrigin),
(this.data.onload = function () {
l.revokeObjectURL(s.data), s.onProcessComplete();
}),
(this.data.onerror = function () {
l.revokeObjectURL(s.data), s.onProcessError();
}),
l.createObjectURL(this.data, r, "image/svg+xml");
},
addToCache: function () {
var t = this.cache.addImage(this.key, this.data);
this.pendingDestroy(t);
},
});
s.register("htmlTexture", function (t, e, i, n, s) {
if (Array.isArray(t)) for (var r = 0; r < t.length; r++) this.addFile(new a(this, t[r]));
else this.addFile(new a(this, t, e, i, n, s));
return this;
}),
(t.exports = a);
},
function (t, e, i) {
var n = i(0),
s = i(8),
v = i(2),
y = i(71),
l = i(7),
u = i(61),
c = i(49),
a = new n({
Extends: c,
initialize: function (t, e, i, n, s, r, o) {
var a;
l(e) && ((e = v((a = e), "key")), (i = v(a, "url", !1) ? v(a, "url") : v(a, "atlasURL")), (r = v(a, "xhrSettings")), (n = v(a, "path")), (s = v(a, "baseURL")), (o = v(a, "textureXhrSettings")));
var h = new u(t, e, i, r);
c.call(this, t, "multiatlas", e, [h]), (this.config.path = n), (this.config.baseURL = s), (this.config.textureXhrSettings = o);
},
onFileComplete: function (t) {
if (-1 !== this.files.indexOf(t) && (this.pending--, "json" === t.type && t.data.hasOwnProperty("textures"))) {
var e = t.data.textures,
i = this.config,
n = this.loader,
s = n.baseURL,
r = n.path,
o = n.prefix,
a = v(i, "baseURL", this.baseURL),
h = v(i, "path", this.path),
l = v(i, "prefix", this.prefix),
u = v(i, "textureXhrSettings");
n.setBaseURL(a), n.setPath(h), n.setPrefix(l);
for (var c = 0; c < e.length; c++) {
var d,
f = e[c].image,
p = "MA" + this.multiKeyIndex + "_" + f,
g = new y(n, p, f, u);
this.addToMultiFile(g), n.addFile(g), e[c].normalMap && (((d = new y(n, p, e[c].normalMap, u)).type = "normalMap"), g.setLink(d), this.addToMultiFile(d), n.addFile(d));
}
n.setBaseURL(s), n.setPath(r), n.setPrefix(o);
}
},
addToCache: function () {
if (this.isReadyToProcess()) {
for (var t = this.files[0], e = [], i = [], n = [], s = 1; s < this.files.length; s++) {
var r = this.files[s];
if ("normalMap" !== r.type)
for (var o = r.key.indexOf("_"), a = r.key.substr(o + 1), h = r.data, l = 0; l < t.data.textures.length; l++) {
var u = t.data.textures[l];
if (u.image === a) {
i.push(h), e.push(u), r.linkFile && n.push(r.linkFile.data);
break;
}
}
}
for (0 === n.length && (n = void 0), this.loader.textureManager.addAtlasJSONArray(this.key, i, e, n), this.complete = !0, s = 0; s < this.files.length; s++) this.files[s].pendingDestroy();
}
},
});
s.register("multiatlas", function (t, e, i, n, s) {
var r;
if (Array.isArray(t)) for (var o = 0; o < t.length; o++) (r = new a(this, t[o])), this.addFile(r.files);
else (r = new a(this, t, e, i, n, s)), this.addFile(r.files);
return this;
}),
(t.exports = a);
},
function (t, e, i) {
var n = i(0),
s = i(8),
l = i(2),
u = i(7),
c = i(49),
d = i(520),
r = new n({
Extends: c,
initialize: function (t, e, i, n) {
var s,
r = "js",
o = [];
u(e) && ((e = l((s = e), "key")), (i = l(s, "url")), (n = l(s, "xhrSettings")), (r = l(s, "extension", r))), Array.isArray(i) || (i = [i]);
for (var a = 0; a < i.length; a++) {
var h = new d(t, { key: e + "_" + a.toString(), url: i[a], extension: r, xhrSettings: n });
(h.onProcess = function () {
this.onProcessComplete();
}),
o.push(h);
}
c.call(this, t, "scripts", e, o);
},
addToCache: function () {
if (this.isReadyToProcess()) {
for (var t = 0; t < this.files.length; t++) {
var e = this.files[t];
(e.data = document.createElement("script")),
(e.data.language = "javascript"),
(e.data.type = "text/javascript"),
(e.data.defer = !1),
(e.data.text = e.xhrLoader.responseText),
document.head.appendChild(e.data);
}
this.complete = !0;
}
},
});
s.register("scripts", function (t, e, i) {
var n;
if (Array.isArray(t)) for (var s = 0; s < t.length; s++) (n = new r(this, t[s])), this.addFile(n.files);
else (n = new r(this, t, e, i)), this.addFile(n.files);
return this;
}),
(t.exports = r);
},
function (t, e, i) {
var n = i(0),
s = i(8),
u = i(2),
c = i(7),
d = i(49),
r = i(498),
o = i(499),
f = i(242),
a = new n({
Extends: d,
initialize: function (t, e, i, n, s, r) {
var o,
a,
h,
l = t.cacheManager.obj;
c(e)
? ((e = u((h = e), "key")),
(o = new f(t, { key: e, type: "obj", cache: l, url: u(h, "url"), extension: u(h, "extension", "obj"), xhrSettings: u(h, "xhrSettings"), config: { flipUV: u(h, "flipUV", s) } })),
(n = u(h, "matURL")) && (a = new f(t, { key: e, type: "mat", cache: l, url: n, extension: u(h, "matExtension", "mat"), xhrSettings: u(h, "xhrSettings") })))
: ((o = new f(t, { key: e, url: i, type: "obj", cache: l, extension: "obj", xhrSettings: r, config: { flipUV: s } })),
n && (a = new f(t, { key: e, url: n, type: "mat", cache: l, extension: "mat", xhrSettings: r }))),
d.call(this, t, "obj", e, [o, a]);
},
addToCache: function () {
var t, e, i;
this.isReadyToProcess() && ((t = this.files[0]), (e = this.files[1]), (i = r(t.data, t.config.flipUV)), e && (i.materials = o(e.data)), t.cache.add(t.key, i), (this.complete = !0));
},
});
s.register("obj", function (t, e, i, n, s) {
var r;
if (Array.isArray(t)) for (var o = 0; o < t.length; o++) (r = new a(this, t[o])), this.addFile(r.files);
else (r = new a(this, t, e, i, n, s)), this.addFile(r.files);
return this;
}),
(t.exports = a);
},
function (t, e, i) {
var n = i(0),
s = i(21),
r = i(8),
o = i(61),
a = new n({
Extends: o,
initialize: function (t, e, i, n, s) {
o.call(this, t, e, i, n, s), (this.type = "packfile");
},
onProcess: function () {
this.state !== s.FILE_POPULATED && ((this.state = s.FILE_PROCESSING), (this.data = JSON.parse(this.xhrLoader.responseText))), this.loader.addPack(this.data, this.config), this.onProcessComplete();
},
});
r.register("pack", function (t, e, i, n) {
if (Array.isArray(t)) for (var s = 0; s < t.length; s++) this.addFile(new a(this, t[s]));
else this.addFile(new a(this, t, e, n, i));
return this;
}),
(t.exports = a);
},
function (t, e, i) {
var n = i(0),
l = i(21),
u = i(23),
s = i(8),
c = i(2),
d = i(7),
o = new n({
Extends: u,
initialize: function (t, e, i, n, s, r) {
var o,
a = "js";
d(e) && ((e = c((o = e), "key")), (i = c(o, "url")), (r = c(o, "xhrSettings")), (a = c(o, "extension", a)), (n = c(o, "start")), (s = c(o, "mapping")));
var h = { type: "plugin", cache: !1, extension: a, responseType: "text", key: e, url: i, xhrSettings: r, config: { start: n, mapping: s } };
u.call(this, t, h), "function" == typeof i && ((this.data = i), (this.state = l.FILE_POPULATED));
},
onProcess: function () {
var t,
e = this.loader.systems.plugins,
i = this.config,
n = c(i, "start", !1),
s = c(i, "mapping", null);
this.state === l.FILE_POPULATED
? e.install(this.key, this.data, n, s)
: ((this.state = l.FILE_PROCESSING),
(this.data = document.createElement("script")),
(this.data.language = "javascript"),
(this.data.type = "text/javascript"),
(this.data.defer = !1),
(this.data.text = this.xhrLoader.responseText),
document.head.appendChild(this.data),
(t = e.install(this.key, window[this.key], n, s)),
(n || s) && ((this.loader.systems[s] = t), (this.loader.scene[s] = t))),
this.onProcessComplete();
},
});
s.register("plugin", function (t, e, i, n, s) {
if (Array.isArray(t)) for (var r = 0; r < t.length; r++) this.addFile(new o(this, t[r]));
else this.addFile(new o(this, t, e, i, n, s));
return this;
}),
(t.exports = o);
},
function (t, e, i) {
var n = i(0),
s = i(21),
a = i(23),
r = i(8),
h = i(2),
l = i(7),
o = new n({
Extends: a,
initialize: function (t, e, i, n) {
var s,
r = "js";
l(e) && ((e = h((s = e), "key")), (i = h(s, "url")), (n = h(s, "xhrSettings")), (r = h(s, "extension", r)));
var o = { type: "text", extension: r, responseType: "text", key: e, url: i, xhrSettings: n };
a.call(this, t, o);
},
onProcess: function () {
(this.state = s.FILE_PROCESSING), (this.data = this.xhrLoader.responseText), this.onProcessComplete();
},
addToCache: function () {
var t = this.data.concat("(function(){\nreturn new " + this.key + "();\n}).call(this);"),
e = eval;
this.loader.sceneManager.add(this.key, e(t)), (this.complete = !0);
},
});
r.register("sceneFile", function (t, e, i) {
if (Array.isArray(t)) for (var n = 0; n < t.length; n++) this.addFile(new o(this, t[n]));
else this.addFile(new o(this, t, e, i));
return this;
}),
(t.exports = o);
},
function (t, e, i) {
var n = i(0),
l = i(21),
u = i(23),
s = i(8),
c = i(2),
d = i(7),
o = new n({
Extends: u,
initialize: function (t, e, i, n, s, r) {
var o,
a = "js";
d(e) && ((e = c((o = e), "key")), (i = c(o, "url")), (r = c(o, "xhrSettings")), (a = c(o, "extension", a)), (n = c(o, "systemKey")), (s = c(o, "sceneKey")));
var h = { type: "scenePlugin", cache: !1, extension: a, responseType: "text", key: e, url: i, xhrSettings: r, config: { systemKey: n, sceneKey: s } };
u.call(this, t, h), "function" == typeof i && ((this.data = i), (this.state = l.FILE_POPULATED));
},
onProcess: function () {
var t = this.loader.systems.plugins,
e = this.config,
i = this.key,
n = c(e, "systemKey", i),
s = c(e, "sceneKey", i);
this.state === l.FILE_POPULATED
? t.installScenePlugin(n, this.data, s, this.loader.scene, !0)
: ((this.state = l.FILE_PROCESSING),
(this.data = document.createElement("script")),
(this.data.language = "javascript"),
(this.data.type = "text/javascript"),
(this.data.defer = !1),
(this.data.text = this.xhrLoader.responseText),
document.head.appendChild(this.data),
t.installScenePlugin(n, window[this.key], s, this.loader.scene, !0)),
this.onProcessComplete();
},
});
s.register("scenePlugin", function (t, e, i, n, s) {
if (Array.isArray(t)) for (var r = 0; r < t.length; r++) this.addFile(new o(this, t[r]));
else this.addFile(new o(this, t, e, i, n, s));
return this;
}),
(t.exports = o);
},
function (t, e, i) {
var n = i(0),
s = i(8),
r = i(71),
o = new n({
Extends: r,
initialize: function (t, e, i, n, s) {
r.call(this, t, e, i, s, n), (this.type = "spritesheet");
},
addToCache: function () {
var t = this.cache.addSpriteSheet(this.key, this.data, this.config);
this.pendingDestroy(t);
},
});
s.register("spritesheet", function (t, e, i, n) {
if (Array.isArray(t)) for (var s = 0; s < t.length; s++) this.addFile(new o(this, t[s]));
else this.addFile(new o(this, t, e, i, n));
return this;
}),
(t.exports = o);
},
function (t, e, i) {
var n = i(0),
f = i(21),
p = i(23),
s = i(8),
h = i(2),
l = i(7),
r = new n({
Extends: p,
initialize: function (t, e, i, n, s) {
var r,
o = "svg";
l(e) && ((e = h((r = e), "key")), (i = h(r, "url")), (n = h(r, "svgConfig", {})), (s = h(r, "xhrSettings")), (o = h(r, "extension", o)));
var a = { type: "svg", cache: t.textureManager, extension: o, responseType: "text", key: e, url: i, xhrSettings: s, config: { width: h(n, "width"), height: h(n, "height"), scale: h(n, "scale") } };
p.call(this, t, a);
},
onProcess: function () {
this.state = f.FILE_PROCESSING;
var t = this.xhrLoader.responseText,
e = [t],
i = this.config.width,
n = this.config.height,
s = this.config.scale;
t: if ((i && n) || s) {
var r,
o = new DOMParser().parseFromString(t, "text/xml").getElementsByTagName("svg")[0],
a = o.hasAttribute("viewBox"),
h = parseFloat(o.getAttribute("width")),
l = parseFloat(o.getAttribute("height"));
if ((!a && h && l ? o.setAttribute("viewBox", "0 0 " + h + " " + l) : !a || h || l || ((h = (r = o.getAttribute("viewBox").split(/\s+|,/))[2]), (l = r[3])), s)) {
if (!h || !l) break t;
(i = h * s), (n = l * s);
}
o.setAttribute("width", i.toString() + "px"), o.setAttribute("height", n.toString() + "px"), (e = [new XMLSerializer().serializeToString(o)]);
}
try {
var u = new window.Blob(e, { type: "image/svg+xml;charset=utf-8" });
} catch (t) {
return void this.onProcessError();
}
(this.data = new Image()), (this.data.crossOrigin = this.crossOrigin);
var c = this,
d = !1;
(this.data.onload = function () {
d || p.revokeObjectURL(c.data), c.onProcessComplete();
}),
(this.data.onerror = function () {
d ? c.onProcessError() : ((d = !0), p.revokeObjectURL(c.data), (c.data.src = "data:image/svg+xml," + encodeURIComponent(e.join(""))));
}),
p.createObjectURL(this.data, u, "image/svg+xml");
},
addToCache: function () {
var t = this.cache.addImage(this.key, this.data);
this.pendingDestroy(t);
},
});
s.register("svg", function (t, e, i, n) {
if (Array.isArray(t)) for (var s = 0; s < t.length; s++) this.addFile(new r(this, t[s]));
else this.addFile(new r(this, t, e, i, n));
return this;
}),
(t.exports = r);
},
function (t, e, i) {
var n = i(0),
s = i(21),
a = i(23),
r = i(8),
h = i(2),
l = i(7),
u = i(40),
o = new n({
Extends: a,
initialize: function (t, e, i, n) {
var s,
r = "csv";
l(e) && ((e = h((s = e), "key")), (i = h(s, "url")), (n = h(s, "xhrSettings")), (r = h(s, "extension", r)));
var o = { type: "tilemapCSV", cache: t.cacheManager.tilemap, extension: r, responseType: "text", key: e, url: i, xhrSettings: n };
a.call(this, t, o), (this.tilemapFormat = u.CSV);
},
onProcess: function () {
(this.state = s.FILE_PROCESSING), (this.data = this.xhrLoader.responseText), this.onProcessComplete();
},
addToCache: function () {
var t = { format: this.tilemapFormat, data: this.data };
this.cache.add(this.key, t), this.pendingDestroy(t);
},
});
r.register("tilemapCSV", function (t, e, i) {
if (Array.isArray(t)) for (var n = 0; n < t.length; n++) this.addFile(new o(this, t[n]));
else this.addFile(new o(this, t, e, i));
return this;
}),
(t.exports = o);
},
function (t, e, i) {
var n = i(0),
s = i(8),
r = i(61),
o = i(40),
a = new n({
Extends: r,
initialize: function (t, e, i, n) {
r.call(this, t, e, i, n), (this.type = "tilemapJSON"), (this.cache = t.cacheManager.tilemap);
},
addToCache: function () {
var t = { format: o.WELTMEISTER, data: this.data };
this.cache.add(this.key, t), this.pendingDestroy(t);
},
});
s.register("tilemapImpact", function (t, e, i) {
if (Array.isArray(t)) for (var n = 0; n < t.length; n++) this.addFile(new a(this, t[n]));
else this.addFile(new a(this, t, e, i));
return this;
}),
(t.exports = a);
},
function (t, e, i) {
var n = i(0),
s = i(8),
r = i(61),
o = i(40),
a = new n({
Extends: r,
initialize: function (t, e, i, n) {
r.call(this, t, e, i, n), (this.type = "tilemapJSON"), (this.cache = t.cacheManager.tilemap);
},
addToCache: function () {
var t = { format: o.TILED_JSON, data: this.data };
this.cache.add(this.key, t), this.pendingDestroy(t);
},
});
s.register("tilemapTiledJSON", function (t, e, i) {
if (Array.isArray(t)) for (var n = 0; n < t.length; n++) this.addFile(new a(this, t[n]));
else this.addFile(new a(this, t, e, i));
return this;
}),
(t.exports = a);
},
function (t, e, i) {
var n = i(0),
s = i(8),
l = i(2),
u = i(71),
c = i(7),
d = i(49),
f = i(242),
a = new n({
Extends: d,
initialize: function (t, e, i, n, s, r) {
var o,
a,
h = c(e)
? ((e = l((a = e), "key")),
(o = new u(t, { key: e, url: l(a, "textureURL"), extension: l(a, "textureExtension", "png"), normalMap: l(a, "normalMap"), xhrSettings: l(a, "textureXhrSettings") })),
new f(t, { key: e, url: l(a, "atlasURL"), extension: l(a, "atlasExtension", "txt"), xhrSettings: l(a, "atlasXhrSettings") }))
: ((o = new u(t, e, i, s)), new f(t, e, n, r));
o.linkFile ? d.call(this, t, "unityatlas", e, [o, h, o.linkFile]) : d.call(this, t, "unityatlas", e, [o, h]);
},
addToCache: function () {
var t, e, i;
this.isReadyToProcess() &&
((t = this.files[0]), (e = this.files[1]), (i = this.files[2] ? this.files[2].data : null), this.loader.textureManager.addUnityAtlas(t.key, t.data, e.data, i), e.pendingDestroy(), (this.complete = !0));
},
});
s.register("unityAtlas", function (t, e, i, n, s) {
var r;
if (Array.isArray(t)) for (var o = 0; o < t.length; o++) (r = new a(this, t[o])), this.addFile(r.files);
else (r = new a(this, t, e, i, n, s)), this.addFile(r.files);
return this;
}),
(t.exports = a);
},
function (t, e, i) {
var n = i(0),
s = i(21),
h = i(23),
r = i(8),
o = i(155),
l = i(2),
u = i(7),
c = new n({
Extends: h,
initialize: function (t, e, i, n, s, r, o) {
void 0 === n && (n = "loadeddata"), void 0 === s && (s = !1), void 0 === r && (r = !1), "loadeddata" !== n && "canplay" !== n && "canplaythrough" !== n && (n = "loadeddata");
var a = { type: "video", cache: t.cacheManager.video, extension: i.type, responseType: "blob", key: e, url: i.url, xhrSettings: o, config: { loadEvent: n, asBlob: s, noAudio: r } };
(this.onLoadCallback = this.onVideoLoadHandler.bind(this)), (this.onErrorCallback = this.onVideoErrorHandler.bind(this)), h.call(this, t, a);
},
onProcess: function () {
var t, e;
(this.state = s.FILE_PROCESSING),
this.config.asBlob
? ((t = this.createVideoElement()),
(this.data = t),
((e = this).data.onloadeddata = function () {
e.onProcessComplete();
}),
(this.data.onerror = function () {
h.revokeObjectURL(e.data), e.onProcessError();
}),
h.createObjectURL(t, this.xhrLoader.response, ""),
t.load())
: this.onProcessComplete();
},
createVideoElement: function () {
var t = document.createElement("video");
return (
(t.controls = !1),
(t.crossOrigin = this.loader.crossOrigin),
this.config.noAudio && ((t.muted = !0), (t.defaultMuted = !0), t.setAttribute("autoplay", "autoplay")),
t.setAttribute("playsinline", "playsinline"),
t.setAttribute("preload", "auto"),
t
);
},
onVideoLoadHandler: function (t) {
var e = t.target;
e.removeEventListener(this.config.loadEvent, this.onLoadCallback, !0), e.removeEventListener("error", this.onErrorCallback, !0), (this.data = e), this.resetXHR(), this.loader.nextFile(this, !0);
},
onVideoErrorHandler: function (t) {
var e = t.target;
e && (e.removeEventListener(this.config.loadEvent, this.onLoadCallback, !0), e.removeEventListener("error", this.onErrorCallback, !0)), this.resetXHR(), this.loader.nextFile(this, !1);
},
load: function () {
var t,
e = this.config.loadEvent;
this.config.asBlob
? h.prototype.load.call(this)
: ((this.percentComplete = 0),
(t = this.createVideoElement()).addEventListener(e, this.onLoadCallback, !0),
t.addEventListener("error", this.onErrorCallback, !0),
(t.src = o(this, this.loader.baseURL)),
t.load());
},
});
(c.create = function (t, e, i, n, s, r, o) {
var a = t.systems.game;
u(e) && ((i = l(e, "url", [])), (n = l(e, "loadEvent", "loadeddata")), (s = l(e, "asBlob", !1)), (r = l(e, "noAudio", !1)), (o = l(e, "xhrSettings")), (e = l(e, "key")));
var h = c.getVideoURL(a, i);
if (h) return new c(t, e, h, n, s, r, o);
}),
(c.getVideoURL = function (t, e) {
Array.isArray(e) || (e = [e]);
for (var i = 0; i < e.length; i++) {
var n,
s = l(e[i], "url", e[i]);
if (0 === s.indexOf("blob:")) return { url: s, type: "" };
if (((n = 0 === s.indexOf("data:") ? s.split(",")[0].match(/\/(.*?);/) : s.match(/\.([a-zA-Z0-9]+)($|\?)/)), (n = l(e[i], "type", n ? n[1] : "").toLowerCase()), t.device.video[n])) return { url: s, type: n };
}
return null;
}),
r.register("video", function (t, e, i, n, s, r) {
var o;
if (Array.isArray(t)) for (var a = 0; a < t.length; a++) (o = c.create(this, t[a])) && this.addFile(o);
else (o = c.create(this, t, e, i, n, s, r)) && this.addFile(o);
return this;
}),
(t.exports = c);
},
function (t, e, i) {
var n = i(0),
s = i(21),
r = i(149),
o = i(9),
a = i(95),
h = i(8),
v = i(2),
l = i(24),
u = i(20),
c = i(156),
d = new n({
Extends: o,
initialize: function (t) {
o.call(this);
var e = t.sys.game.config,
i = t.sys.settings.loader;
(this.scene = t),
(this.systems = t.sys),
(this.cacheManager = t.sys.cache),
(this.textureManager = t.sys.textures),
(this.sceneManager = t.sys.game.scene),
h.install(this),
(this.prefix = ""),
(this.path = ""),
(this.baseURL = ""),
this.setBaseURL(v(i, "baseURL", e.loaderBaseURL)),
this.setPath(v(i, "path", e.loaderPath)),
this.setPrefix(v(i, "prefix", e.loaderPrefix)),
(this.maxParallelDownloads = v(i, "maxParallelDownloads", e.loaderMaxParallelDownloads)),
(this.xhr = c(
v(i, "responseType", e.loaderResponseType),
v(i, "async", e.loaderAsync),
v(i, "user", e.loaderUser),
v(i, "password", e.loaderPassword),
v(i, "timeout", e.loaderTimeout),
v(i, "withCredentials", e.loaderWithCredentials)
)),
(this.crossOrigin = v(i, "crossOrigin", e.loaderCrossOrigin)),
(this.totalToLoad = 0),
(this.progress = 0),
(this.list = new r()),
(this.inflight = new r()),
(this.queue = new r()),
(this._deleteQueue = new r()),
(this.totalFailed = 0),
(this.totalComplete = 0),
(this.state = s.LOADER_IDLE),
(this.multiKeyIndex = 0),
t.sys.events.once(u.BOOT, this.boot, this),
t.sys.events.on(u.START, this.pluginStart, this);
},
boot: function () {
this.systems.events.once(u.DESTROY, this.destroy, this);
},
pluginStart: function () {
this.systems.events.once(u.SHUTDOWN, this.shutdown, this);
},
setBaseURL: function (t) {
return void 0 === t && (t = ""), "" !== t && "/" !== t.substr(-1) && (t = t.concat("/")), (this.baseURL = t), this;
},
setPath: function (t) {
return void 0 === t && (t = ""), "" !== t && "/" !== t.substr(-1) && (t = t.concat("/")), (this.path = t), this;
},
setPrefix: function (t) {
return void 0 === t && (t = ""), (this.prefix = t), this;
},
setCORS: function (t) {
return (this.crossOrigin = t), this;
},
addFile: function (t) {
Array.isArray(t) || (t = [t]);
for (var e = 0; e < t.length; e++) {
var i = t[e];
this.keyExists(i) || (this.list.set(i), this.emit(a.ADD, i.key, i.type, this, i), this.isLoading() && (this.totalToLoad++, this.updateProgress()));
}
},
keyExists: function (e) {
var i = e.hasCacheConflict();
return (
i ||
this.list.iterate(function (t) {
if (t.type === e.type && t.key === e.key) return !(i = !0);
}),
!i &&
this.isLoading() &&
(this.inflight.iterate(function (t) {
if (t.type === e.type && t.key === e.key) return !(i = !0);
}),
this.queue.iterate(function (t) {
if (t.type === e.type && t.key === e.key) return !(i = !0);
})),
i
);
},
addPack: function (t, e) {
e && t.hasOwnProperty(e) && (t = { packKey: t[e] });
var i = 0,
n = this.baseURL,
s = this.path,
r = this.prefix;
for (var o in t)
if (Object.prototype.hasOwnProperty.call(t, o)) {
var a = t[o],
h = v(a, "baseURL", n),
l = v(a, "path", s),
u = v(a, "prefix", r),
c = v(a, "files", null),
d = v(a, "defaultType", "void");
if (Array.isArray(c)) {
this.setBaseURL(h), this.setPath(l), this.setPrefix(u);
for (var f = 0; f < c.length; f++) {
var p = c[f],
g = p.hasOwnProperty("type") ? p.type : d;
this[g] && (this[g](p), i++);
}
}
}
return this.setBaseURL(n), this.setPath(s), this.setPrefix(r), 0 < i;
},
isLoading: function () {
return this.state === s.LOADER_LOADING || this.state === s.LOADER_PROCESSING;
},
isReady: function () {
return this.state === s.LOADER_IDLE || this.state === s.LOADER_COMPLETE;
},
start: function () {
this.isReady() &&
((this.progress = 0),
(this.totalFailed = 0),
(this.totalComplete = 0),
(this.totalToLoad = this.list.size),
this.emit(a.START, this),
0 === this.list.size
? this.loadComplete()
: ((this.state = s.LOADER_LOADING), this.inflight.clear(), this.queue.clear(), this.updateProgress(), this.checkLoadQueue(), this.systems.events.on(u.UPDATE, this.update, this)));
},
updateProgress: function () {
(this.progress = 1 - (this.list.size + this.inflight.size) / this.totalToLoad), this.emit(a.PROGRESS, this.progress);
},
update: function () {
this.state === s.LOADER_LOADING && 0 < this.list.size && this.inflight.size < this.maxParallelDownloads && this.checkLoadQueue();
},
checkLoadQueue: function () {
this.list.each(function (t) {
if (
((t.state === s.FILE_POPULATED || (t.state === s.FILE_PENDING && this.inflight.size < this.maxParallelDownloads)) &&
(this.inflight.set(t), this.list.delete(t), t.crossOrigin || (t.crossOrigin = this.crossOrigin), t.load()),
this.inflight.size === this.maxParallelDownloads)
)
return !1;
}, this);
},
nextFile: function (t, e) {
this.inflight &&
(this.inflight.delete(t),
this.updateProgress(),
e ? (this.totalComplete++, this.queue.set(t), this.emit(a.FILE_LOAD, t), t.onProcess()) : (this.totalFailed++, this._deleteQueue.set(t), this.emit(a.FILE_LOAD_ERROR, t), this.fileProcessComplete(t)));
},
fileProcessComplete: function (t) {
this.scene &&
this.systems &&
this.systems.game &&
!this.systems.game.pendingDestroy &&
(t.state === s.FILE_ERRORED ? t.multiFile && t.multiFile.onFileFailed(t) : t.state === s.FILE_COMPLETE && (t.multiFile ? t.multiFile.isReadyToProcess() && t.multiFile.addToCache() : t.addToCache()),
this.queue.delete(t),
0 === this.list.size && 0 === this.inflight.size && 0 === this.queue.size && this.loadComplete());
},
loadComplete: function () {
this.emit(a.POST_PROCESS, this),
this.list.clear(),
this.inflight.clear(),
this.queue.clear(),
(this.progress = 1),
(this.state = s.LOADER_COMPLETE),
this.systems.events.off(u.UPDATE, this.update, this),
this._deleteQueue.iterateLocal("destroy"),
this._deleteQueue.clear(),
this.emit(a.COMPLETE, this, this.totalComplete, this.totalFailed);
},
flagForRemoval: function (t) {
this._deleteQueue.set(t);
},
saveJSON: function (t, e) {
return this.save(JSON.stringify(t), e);
},
save: function (t, e, i) {
void 0 === e && (e = "file.json"), void 0 === i && (i = "application/json");
var n = new Blob([t], { type: i }),
s = URL.createObjectURL(n),
r = document.createElement("a");
return (r.download = e), (r.textContent = "Download " + e), (r.href = s), r.click(), this;
},
reset: function () {
this.list.clear(), this.inflight.clear(), this.queue.clear();
var t = this.systems.game.config,
e = this.systems.settings.loader;
this.setBaseURL(v(e, "baseURL", t.loaderBaseURL)), this.setPath(v(e, "path", t.loaderPath)), this.setPrefix(v(e, "prefix", t.loaderPrefix)), (this.state = s.LOADER_IDLE);
},
shutdown: function () {
this.reset(), (this.state = s.LOADER_SHUTDOWN), this.systems.events.off(u.UPDATE, this.update, this), this.systems.events.off(u.SHUTDOWN, this.shutdown, this);
},
destroy: function () {
this.shutdown(),
(this.state = s.LOADER_DESTROYED),
this.systems.events.off(u.UPDATE, this.update, this),
this.systems.events.off(u.START, this.pluginStart, this),
(this.list = null),
(this.inflight = null),
(this.queue = null),
(this.scene = null),
(this.systems = null),
(this.textureManager = null),
(this.cacheManager = null),
(this.sceneManager = null);
},
});
l.register("Loader", d, "load"), (t.exports = d);
},
function (t, e, i) {
var n = i(62),
s = i(17)(
!1,
(s = {
ArcadePhysics: i(1367),
Body: i(527),
Collider: i(528),
Components: i(243),
Events: i(245),
Factory: i(521),
GetOverlapX: i(246),
GetOverlapY: i(247),
SeparateX: i(537),
SeparateY: i(538),
Group: i(524),
Image: i(522),
Sprite: i(157),
StaticBody: i(539),
StaticGroup: i(525),
Tilemap: i(1391),
World: i(526),
}),
n
);
t.exports = s;
},
function (t, e, i) {
var n = i(0),
s = i(36),
o = i(50),
c = i(353),
r = i(521),
a = i(2),
h = i(127),
l = i(523),
u = i(244),
d = i(24),
f = i(20),
p = i(3),
g = i(526),
v = new n({
initialize: function (t) {
(this.scene = t), (this.systems = t.sys), (this.config = this.getConfig()), this.world, this.add, t.sys.events.once(f.BOOT, this.boot, this), t.sys.events.on(f.START, this.start, this);
},
boot: function () {
(this.world = new g(this.scene, this.config)), (this.add = new r(this.world)), this.systems.events.once(f.DESTROY, this.destroy, this);
},
start: function () {
this.world || ((this.world = new g(this.scene, this.config)), (this.add = new r(this.world)));
var t = this.systems.events;
a(this.config, "customUpdate", !1) || t.on(f.UPDATE, this.world.update, this.world), t.on(f.POST_UPDATE, this.world.postUpdate, this.world), t.once(f.SHUTDOWN, this.shutdown, this);
},
enableUpdate: function () {
this.systems.events.on(f.UPDATE, this.world.update, this.world);
},
disableUpdate: function () {
this.systems.events.off(f.UPDATE, this.world.update, this.world);
},
getConfig: function () {
var t = this.systems.game.config.physics,
e = this.systems.settings.physics;
return h(a(e, "arcade", {}), a(t, "arcade", {}));
},
overlap: function (t, e, i, n, s) {
return void 0 === i && (i = null), void 0 === n && (n = null), void 0 === s && (s = i), this.world.collideObjects(t, e, i, n, s, !0);
},
collide: function (t, e, i, n, s) {
return void 0 === i && (i = null), void 0 === n && (n = null), void 0 === s && (s = i), this.world.collideObjects(t, e, i, n, s, !1);
},
collideTiles: function (t, e, i, n, s) {
return this.world.collideTiles(t, e, i, n, s);
},
overlapTiles: function (t, e, i, n, s) {
return this.world.overlapTiles(t, e, i, n, s);
},
pause: function () {
return this.world.pause();
},
resume: function () {
return this.world.resume();
},
accelerateTo: function (t, e, i, n, s, r) {
void 0 === n && (n = 60);
var o = Math.atan2(i - t.y, e - t.x);
return t.body.acceleration.setToPolar(o, n), void 0 !== s && void 0 !== r && t.body.maxVelocity.set(s, r), o;
},
accelerateToObject: function (t, e, i, n, s) {
return this.accelerateTo(t, e.x, e.y, i, n, s);
},
closest: function (t, e) {
e = e || this.world.bodies.entries;
for (var i = Number.MAX_VALUE, n = null, s = t.x, r = t.y, o = e.length, a = 0; a < o; a++) {
var h,
l = e[a],
u = l.body || l;
t !== l && t !== u && t !== u.gameObject && t !== u.center && (h = c(s, r, u.center.x, u.center.y)) < i && ((n = l), (i = h));
}
return n;
},
furthest: function (t, e) {
e = e || this.world.bodies.entries;
for (var i = -1, n = null, s = t.x, r = t.y, o = e.length, a = 0; a < o; a++) {
var h,
l = e[a],
u = l.body || l;
t !== l && t !== u && t !== u.gameObject && t !== u.center && i < (h = c(s, r, u.center.x, u.center.y)) && ((n = l), (i = h));
}
return n;
},
moveTo: function (t, e, i, n, s) {
void 0 === n && (n = 60), void 0 === s && (s = 0);
var r = Math.atan2(i - t.y, e - t.x);
return 0 < s && (n = o(t.x, t.y, e, i) / (s / 1e3)), t.body.velocity.setToPolar(r, n), r;
},
moveToObject: function (t, e, i, n) {
return this.moveTo(t, e.x, e.y, i, n);
},
velocityFromAngle: function (t, e, i) {
return void 0 === e && (e = 60), void 0 === i && (i = new p()), i.setToPolar(s(t), e);
},
velocityFromRotation: function (t, e, i) {
return void 0 === e && (e = 60), void 0 === i && (i = new p()), i.setToPolar(t, e);
},
overlapRect: function (t, e, i, n, s, r) {
return u(this.world, t, e, i, n, s, r);
},
overlapCirc: function (t, e, i, n, s) {
return l(this.world, t, e, i, n, s);
},
shutdown: function () {
var t;
this.world &&
((t = this.systems.events).off(f.UPDATE, this.world.update, this.world),
t.off(f.POST_UPDATE, this.world.postUpdate, this.world),
t.off(f.SHUTDOWN, this.shutdown, this),
this.add.destroy(),
this.world.destroy(),
(this.add = null),
(this.world = null));
},
destroy: function () {
this.shutdown(), this.scene.sys.events.off(f.START, this.start, this), (this.scene = null), (this.systems = null);
},
});
d.register("ArcadePhysics", v, "arcadePhysics"), (t.exports = v);
},
function (t, e) {
t.exports = {
setAcceleration: function (t, e) {
return this.body.acceleration.set(t, e), this;
},
setAccelerationX: function (t) {
return (this.body.acceleration.x = t), this;
},
setAccelerationY: function (t) {
return (this.body.acceleration.y = t), this;
},
};
},
function (t, e) {
t.exports = {
setAngularVelocity: function (t) {
return (this.body.angularVelocity = t), this;
},
setAngularAcceleration: function (t) {
return (this.body.angularAcceleration = t), this;
},
setAngularDrag: function (t) {
return (this.body.angularDrag = t), this;
},
};
},
function (t, e) {
t.exports = {
setBounce: function (t, e) {
return this.body.bounce.set(t, e), this;
},
setBounceX: function (t) {
return (this.body.bounce.x = t), this;
},
setBounceY: function (t) {
return (this.body.bounce.y = t), this;
},
setCollideWorldBounds: function (t, e, i) {
return this.body.setCollideWorldBounds(t, e, i), this;
},
};
},
function (t, e) {
t.exports = {
setDebug: function (t, e, i) {
return (this.debugShowBody = t), (this.debugShowVelocity = e), (this.debugBodyColor = i), this;
},
setDebugBodyColor: function (t) {
return (this.body.debugBodyColor = t), this;
},
debugShowBody: {
get: function () {
return this.body.debugShowBody;
},
set: function (t) {
this.body.debugShowBody = t;
},
},
debugShowVelocity: {
get: function () {
return this.body.debugShowVelocity;
},
set: function (t) {
this.body.debugShowVelocity = t;
},
},
debugBodyColor: {
get: function () {
return this.body.debugBodyColor;
},
set: function (t) {
this.body.debugBodyColor = t;
},
},
};
},
function (t, e) {
t.exports = {
setDrag: function (t, e) {
return this.body.drag.set(t, e), this;
},
setDragX: function (t) {
return (this.body.drag.x = t), this;
},
setDragY: function (t) {
return (this.body.drag.y = t), this;
},
setDamping: function (t) {
return (this.body.useDamping = t), this;
},
};
},
function (t, e) {
t.exports = {
enableBody: function (t, e, i, n, s) {
return t && this.body.reset(e, i), n && (this.body.gameObject.active = !0), s && (this.body.gameObject.visible = !0), (this.body.enable = !0), this;
},
disableBody: function (t, e) {
return void 0 === t && (t = !1), void 0 === e && (e = !1), this.body.stop(), (this.body.enable = !1), t && (this.body.gameObject.active = !1), e && (this.body.gameObject.visible = !1), this;
},
refreshBody: function () {
return this.body.updateFromGameObject(), this;
},
};
},
function (t, e) {
t.exports = {
setFriction: function (t, e) {
return this.body.friction.set(t, e), this;
},
setFrictionX: function (t) {
return (this.body.friction.x = t), this;
},
setFrictionY: function (t) {
return (this.body.friction.y = t), this;
},
};
},
function (t, e) {
t.exports = {
setGravity: function (t, e) {
return this.body.gravity.set(t, e), this;
},
setGravityX: function (t) {
return (this.body.gravity.x = t), this;
},
setGravityY: function (t) {
return (this.body.gravity.y = t), this;
},
};
},
function (t, e) {
t.exports = {
setImmovable: function (t) {
return void 0 === t && (t = !0), (this.body.immovable = t), this;
},
};
},
function (t, e) {
t.exports = {
setMass: function (t) {
return (this.body.mass = t), this;
},
};
},
function (t, e) {
t.exports = {
setPushable: function (t) {
return void 0 === t && (t = !0), (this.body.pushable = t), this;
},
};
},
function (t, e) {
t.exports = {
setOffset: function (t, e) {
return this.body.setOffset(t, e), this;
},
setSize: function (t, e, i) {
return this.body.setSize(t, e, i), this;
},
setBodySize: function (t, e, i) {
return this.body.setSize(t, e, i), this;
},
setCircle: function (t, e, i) {
return this.body.setCircle(t, e, i), this;
},
};
},
function (t, e) {
t.exports = {
setVelocity: function (t, e) {
return this.body.setVelocity(t, e), this;
},
setVelocityX: function (t) {
return this.body.setVelocityX(t), this;
},
setVelocityY: function (t) {
return this.body.setVelocityY(t), this;
},
setMaxVelocity: function (t, e) {
return this.body.maxVelocity.set(t, e), this;
},
};
},
function (t, e) {
t.exports = "collide";
},
function (t, e) {
t.exports = "overlap";
},
function (t, e) {
t.exports = "pause";
},
function (t, e) {
t.exports = "resume";
},
function (t, e) {
t.exports = "tilecollide";
},
function (t, e) {
t.exports = "tileoverlap";
},
function (t, e) {
t.exports = "worldbounds";
},
function (t, e) {
t.exports = "worldstep";
},
function (t, e) {
var r,
o,
a,
h,
l,
u,
c,
d,
f,
p,
g,
v,
y,
m,
x,
b,
w,
T = function () {
return p && x && o.blocked.right
? (r.processX(-w, c, !1, !0), 1)
: f && b && o.blocked.left
? (r.processX(w, c, !0), 1)
: y && b && r.blocked.right
? (o.processX(-w, d, !1, !0), 2)
: v && x && r.blocked.left
? (o.processX(w, d, !0), 2)
: 0;
},
S = function (t) {
var e;
return (
a && h
? ((w *= 0.5), 0 === t || 3 === t ? (r.processX(w, l), o.processX(-w, u)) : (r.processX(-w, l), o.processX(w, u)))
: a && !h
? 0 === t || 3 === t
? r.processX(w, c, !0)
: r.processX(-w, c, !1, !0)
: !a && h
? 0 === t || 3 === t
? o.processX(-w, d, !1, !0)
: o.processX(w, d, !0)
: ((e = 0.5 * w),
0 === t
? m
? (r.processX(w, 0, !0), o.processX(0, null, !1, !0))
: y
? (r.processX(e, 0, !0), o.processX(-e, 0, !1, !0))
: (r.processX(e, o.velocity.x, !0), o.processX(-e, null, !1, !0))
: 1 === t
? g
? (r.processX(0, null, !1, !0), o.processX(w, 0, !0))
: p
? (r.processX(-e, 0, !1, !0), o.processX(e, 0, !0))
: (r.processX(-e, null, !1, !0), o.processX(e, r.velocity.x, !0))
: 2 === t
? m
? (r.processX(-w, 0, !1, !0), o.processX(0, null, !0))
: v
? (r.processX(-e, 0, !1, !0), o.processX(e, 0, !0))
: (r.processX(-e, o.velocity.x, !1, !0), o.processX(e, null, !0))
: 3 === t && (g ? (r.processX(0, null, !0), o.processX(-w, 0, !1, !0)) : f ? (r.processX(e, 0, !0), o.processX(-e, 0, !1, !0)) : (r.processX(e, o.velocity.y, !0), o.processX(-e, null, !1, !0)))),
!0
);
};
t.exports = {
BlockCheck: T,
Check: function () {
var t = r.velocity.x,
e = o.velocity.x,
i = Math.sqrt((e * e * o.mass) / r.mass) * (0 < e ? 1 : -1),
n = Math.sqrt((t * t * r.mass) / o.mass) * (0 < t ? 1 : -1),
s = 0.5 * (i + n);
return (n -= s), (l = s + (i -= s) * r.bounce.x), (u = s + n * o.bounce.x), f && b ? S(0) : v && x ? S(1) : p && x ? S(2) : !(!y || !b) && S(3);
},
Set: function (t, e, i) {
o = e;
var n = (r = t).velocity.x,
s = o.velocity.x;
return (
(a = r.pushable),
(f = r._dx < 0),
(p = 0 < r._dx),
(g = 0 === r._dx),
(x = Math.abs(r.right - o.x) <= Math.abs(o.right - r.x)),
(c = s - n * r.bounce.x),
(h = o.pushable),
(v = o._dx < 0),
(y = 0 < o._dx),
(m = 0 === o._dx),
(b = !x),
(d = n - s * o.bounce.x),
(w = Math.abs(i)),
T()
);
},
Run: S,
RunImmovableBody1: function (t) {
1 === t ? (o.velocity.x = 0) : x ? o.processX(w, d, !0) : o.processX(-w, d, !1, !0), r.moves && ((o.y += (r.y - r.prev.y) * r.friction.y), (o._dy = o.y - o.prev.y));
},
RunImmovableBody2: function (t) {
2 === t ? (r.velocity.x = 0) : b ? r.processX(w, c, !0) : r.processX(-w, c, !1, !0), o.moves && ((r.y += (o.y - o.prev.y) * o.friction.y), (r._dy = r.y - r.prev.y));
},
};
},
function (t, e) {
var r,
o,
a,
h,
l,
u,
c,
d,
f,
p,
g,
v,
y,
m,
x,
b,
w,
T = function () {
return p && x && o.blocked.down
? (r.processY(-w, c, !1, !0), 1)
: f && b && o.blocked.up
? (r.processY(w, c, !0), 1)
: y && b && r.blocked.down
? (o.processY(-w, d, !1, !0), 2)
: v && x && r.blocked.up
? (o.processY(w, d, !0), 2)
: 0;
},
S = function (t) {
var e;
return (
a && h
? ((w *= 0.5), 0 === t || 3 === t ? (r.processY(w, l), o.processY(-w, u)) : (r.processY(-w, l), o.processY(w, u)))
: a && !h
? 0 === t || 3 === t
? r.processY(w, c, !0)
: r.processY(-w, c, !1, !0)
: !a && h
? 0 === t || 3 === t
? o.processY(-w, d, !1, !0)
: o.processY(w, d, !0)
: ((e = 0.5 * w),
0 === t
? m
? (r.processY(w, 0, !0), o.processY(0, null, !1, !0))
: y
? (r.processY(e, 0, !0), o.processY(-e, 0, !1, !0))
: (r.processY(e, o.velocity.y, !0), o.processY(-e, null, !1, !0))
: 1 === t
? g
? (r.processY(0, null, !1, !0), o.processY(w, 0, !0))
: p
? (r.processY(-e, 0, !1, !0), o.processY(e, 0, !0))
: (r.processY(-e, null, !1, !0), o.processY(e, r.velocity.y, !0))
: 2 === t
? m
? (r.processY(-w, 0, !1, !0), o.processY(0, null, !0))
: v
? (r.processY(-e, 0, !1, !0), o.processY(e, 0, !0))
: (r.processY(-e, o.velocity.y, !1, !0), o.processY(e, null, !0))
: 3 === t && (g ? (r.processY(0, null, !0), o.processY(-w, 0, !1, !0)) : f ? (r.processY(e, 0, !0), o.processY(-e, 0, !1, !0)) : (r.processY(e, o.velocity.y, !0), o.processY(-e, null, !1, !0)))),
!0
);
};
t.exports = {
BlockCheck: T,
Check: function () {
var t = r.velocity.y,
e = o.velocity.y,
i = Math.sqrt((e * e * o.mass) / r.mass) * (0 < e ? 1 : -1),
n = Math.sqrt((t * t * r.mass) / o.mass) * (0 < t ? 1 : -1),
s = 0.5 * (i + n);
return (n -= s), (l = s + (i -= s) * r.bounce.y), (u = s + n * o.bounce.y), f && b ? S(0) : v && x ? S(1) : p && x ? S(2) : !(!y || !b) && S(3);
},
Set: function (t, e, i) {
o = e;
var n = (r = t).velocity.y,
s = o.velocity.y;
return (
(a = r.pushable),
(f = r._dy < 0),
(p = 0 < r._dy),
(g = 0 === r._dy),
(x = Math.abs(r.bottom - o.y) <= Math.abs(o.bottom - r.y)),
(c = s - n * r.bounce.y),
(h = o.pushable),
(v = o._dy < 0),
(y = 0 < o._dy),
(m = 0 === o._dy),
(b = !x),
(d = n - s * o.bounce.y),
(w = Math.abs(i)),
T()
);
},
Run: S,
RunImmovableBody1: function (t) {
1 === t ? (o.velocity.y = 0) : x ? o.processY(w, d, !0) : o.processY(-w, d, !1, !0), r.moves && ((o.x += (r.x - r.prev.x) * r.friction.x), (o._dx = o.x - o.prev.x));
},
RunImmovableBody2: function (t) {
2 === t ? (r.velocity.y = 0) : b ? r.processY(w, c, !0) : r.processY(-w, c, !1, !0), o.moves && ((r.x += (o.x - o.prev.x) * o.friction.x), (r._dx = r.x - r.prev.x));
},
};
},
function (t, e, i) {
var n = { ProcessTileCallbacks: i(530), ProcessTileSeparationX: i(534), ProcessTileSeparationY: i(536), SeparateTile: i(532), TileCheckX: i(533), TileCheckY: i(535), TileIntersectsBody: i(248) };
t.exports = n;
},
function (t, e, i) {
var n = i(0),
r = i(3),
s = new n({
initialize: function () {
(this.boundsCenter = new r()), (this.centerDiff = new r());
},
parseBody: function (t) {
if (!(t = t.hasOwnProperty("body") ? t.body : t).hasOwnProperty("bounds") || !t.hasOwnProperty("centerOfMass")) return !1;
var e = this.boundsCenter,
i = this.centerDiff,
n = t.bounds.max.x - t.bounds.min.x,
s = t.bounds.max.y - t.bounds.min.y,
r = n * t.centerOfMass.x,
o = s * t.centerOfMass.y;
return e.set(n / 2, s / 2), i.set(r - e.x, o - e.y), !0;
},
getTopLeft: function (t, e, i) {
if ((void 0 === e && (e = 0), void 0 === i && (i = 0), this.parseBody(t))) {
var n = this.boundsCenter,
s = this.centerDiff;
return new r(e + n.x + s.x, i + n.y + s.y);
}
return !1;
},
getTopCenter: function (t, e, i) {
if ((void 0 === e && (e = 0), void 0 === i && (i = 0), this.parseBody(t))) {
var n = this.boundsCenter,
s = this.centerDiff;
return new r(e + s.x, i + n.y + s.y);
}
return !1;
},
getTopRight: function (t, e, i) {
if ((void 0 === e && (e = 0), void 0 === i && (i = 0), this.parseBody(t))) {
var n = this.boundsCenter,
s = this.centerDiff;
return new r(e - (n.x - s.x), i + n.y + s.y);
}
return !1;
},
getLeftCenter: function (t, e, i) {
if ((void 0 === e && (e = 0), void 0 === i && (i = 0), this.parseBody(t))) {
var n = this.boundsCenter,
s = this.centerDiff;
return new r(e + n.x + s.x, i + s.y);
}
return !1;
},
getCenter: function (t, e, i) {
if ((void 0 === e && (e = 0), void 0 === i && (i = 0), this.parseBody(t))) {
var n = this.centerDiff;
return new r(e + n.x, i + n.y);
}
return !1;
},
getRightCenter: function (t, e, i) {
if ((void 0 === e && (e = 0), void 0 === i && (i = 0), this.parseBody(t))) {
var n = this.boundsCenter,
s = this.centerDiff;
return new r(e - (n.x - s.x), i + s.y);
}
return !1;
},
getBottomLeft: function (t, e, i) {
if ((void 0 === e && (e = 0), void 0 === i && (i = 0), this.parseBody(t))) {
var n = this.boundsCenter,
s = this.centerDiff;
return new r(e + n.x + s.x, i - (n.y - s.y));
}
return !1;
},
getBottomCenter: function (t, e, i) {
if ((void 0 === e && (e = 0), void 0 === i && (i = 0), this.parseBody(t))) {
var n = this.boundsCenter,
s = this.centerDiff;
return new r(e + s.x, i - (n.y - s.y));
}
return !1;
},
getBottomRight: function (t, e, i) {
if ((void 0 === e && (e = 0), void 0 === i && (i = 0), this.parseBody(t))) {
var n = this.boundsCenter,
s = this.centerDiff;
return new r(e - (n.x - s.x), i - (n.y - s.y));
}
return !1;
},
});
t.exports = s;
},
function (t, e) {
function s(t, e, i, n) {
var s = e[0] - t[0],
r = e[1] - t[1],
o = n[0] - i[0],
a = n[1] - i[1];
if (o * r - a * s != 0) {
var h = (s * (i[1] - t[1]) + r * (t[0] - i[0])) / (o * r - a * s),
l = (o * (t[1] - i[1]) + a * (i[0] - t[0])) / (a * s - o * r);
return 0 <= h && h <= 1 && 0 <= l && l <= 1;
}
}
function l(t, e, i) {
return (e[0] - t[0]) * (i[1] - t[1]) - (i[0] - t[0]) * (e[1] - t[1]);
}
function _(t, e, i) {
return 0 < l(t, e, i);
}
function E(t, e, i) {
return 0 <= l(t, e, i);
}
function P(t, e, i) {
return l(t, e, i) < 0;
}
function A(t, e, i) {
return l(t, e, i) <= 0;
}
t.exports = {
decomp: function (t) {
var e = (function t(e) {
for (var i = [], n = [], s = [], r = [], o = Number.MAX_VALUE, a = 0; a < e.length; ++a)
if (k(e, a))
for (var h = 0; h < e.length; ++h)
if (f(e, a, h)) {
(n = t(p(e, a, h, r))), (s = t(p(e, h, a, r)));
for (var l = 0; l < s.length; l++) n.push(s[l]);
n.length < o && ((o = (i = n).length), i.push([C(e, a), C(e, h)]));
}
return i;
})(t);
return 0 < e.length
? (function t(e, i) {
if (0 === i.length) return [e];
if (i instanceof Array && i.length && i[0] instanceof Array && 2 === i[0].length && i[0][0] instanceof Array) {
for (var n = [e], s = 0; s < i.length; s++)
for (var r = i[s], o = 0; o < n.length; o++) {
var a = t(n[o], r);
if (a) {
n.splice(o, 1), n.push(a[0], a[1]);
break;
}
}
return n;
}
(r = i), (s = e.indexOf(r[0])), (o = e.indexOf(r[1]));
return -1 !== s && -1 !== o && [p(e, s, o), p(e, o, s)];
})(t, e)
: [t];
},
quickDecomp: function t(e, i, n, s, r, o, a) {
(o = o || 100), (a = a || 0), (r = r || 25), (i = void 0 !== i ? i : []), (n = n || []), (s = s || []);
var h = [0, 0],
l = [0, 0],
u = [0, 0],
c = 0,
d = 0,
f = 0,
p = 0,
g = 0,
v = 0,
y = 0,
m = [],
x = [],
b = e,
w = e;
if (w.length < 3) return i;
if (o < ++a) return i;
for (var T = 0; T < e.length; ++T)
if (k(b, T)) {
n.push(b[T]), (c = d = Number.MAX_VALUE);
for (var S = 0; S < e.length; ++S)
_(C(b, T - 1), C(b, T), C(b, S)) &&
A(C(b, T - 1), C(b, T), C(b, S - 1)) &&
((u = L(C(b, T - 1), C(b, T), C(b, S), C(b, S - 1))), P(C(b, T + 1), C(b, T), u) && (f = M(b[T], u)) < d && ((d = f), (l = u), (v = S))),
_(C(b, T + 1), C(b, T), C(b, S + 1)) &&
A(C(b, T + 1), C(b, T), C(b, S)) &&
((u = L(C(b, T + 1), C(b, T), C(b, S), C(b, S + 1))), _(C(b, T - 1), C(b, T), u) && (f = M(b[T], u)) < c && ((c = f), (h = u), (g = S)));
if (v === (g + 1) % e.length)
(u[0] = (l[0] + h[0]) / 2),
(u[1] = (l[1] + h[1]) / 2),
s.push(u),
T < g
? (O(m, b, T, g + 1), m.push(u), x.push(u), 0 !== v && O(x, b, v, b.length), O(x, b, 0, T + 1))
: (0 !== T && O(m, b, T, b.length), O(m, b, 0, g + 1), m.push(u), x.push(u), O(x, b, v, T + 1));
else {
if ((g < v && (g += e.length), (p = Number.MAX_VALUE), g < v)) return i;
for (S = v; S <= g; ++S) E(C(b, T - 1), C(b, T), C(b, S)) && A(C(b, T + 1), C(b, T), C(b, S)) && (f = M(C(b, T), C(b, S))) < p && R(b, T, S) && ((p = f), (y = S % e.length));
T < y ? (O(m, b, T, y + 1), 0 !== y && O(x, b, y, w.length), O(x, b, 0, T + 1)) : (0 !== T && O(m, b, T, w.length), O(m, b, 0, y + 1), O(x, b, y, T + 1));
}
return m.length < x.length ? (t(m, i, n, s, r, o, a), t(x, i, n, s, r, o, a)) : (t(x, i, n, s, r, o, a), t(m, i, n, s, r, o, a)), i;
}
return i.push(e), i;
},
isSimple: function (t) {
var e,
i = t;
for (e = 0; e < i.length - 1; e++) for (var n = 0; n < e - 1; n++) if (s(i[e], i[e + 1], i[n], i[n + 1])) return !1;
for (e = 1; e < i.length - 2; e++) if (s(i[0], i[i.length - 1], i[e], i[e + 1])) return !1;
return !0;
},
removeCollinearPoints: function (t, e) {
for (var i = 0, n = t.length - 1; 3 < t.length && 0 <= n; --n)
!(function (t, e, i, n) {
if (n) {
var s = u,
r = c;
(s[0] = e[0] - t[0]), (s[1] = e[1] - t[1]), (r[0] = i[0] - e[0]), (r[1] = i[1] - e[1]);
var o = s[0] * r[0] + s[1] * r[1],
a = Math.sqrt(s[0] * s[0] + s[1] * s[1]),
h = Math.sqrt(r[0] * r[0] + r[1] * r[1]);
return Math.acos(o / (a * h)) < n;
}
return 0 === l(t, e, i);
})(C(t, n - 1), C(t, n), C(t, n + 1), e) || (t.splice(n % t.length, 1), i++);
return i;
},
removeDuplicatePoints: function (t, e) {
for (var i = t.length - 1; 1 <= i; --i) for (var n = t[i], s = i - 1; 0 <= s; --s) (r = n), (o = t[s]), (a = e), !g(r[0], o[0], a) || !g(r[1], o[1], a) || t.splice(i, 1);
var r, o, a;
},
makeCCW: function (t) {
for (var e = 0, i = t, n = 1; n < t.length; ++n) (i[n][1] < i[e][1] || (i[n][1] === i[e][1] && i[n][0] > i[e][0])) && (e = n);
return (
!_(C(t, e - 1), C(t, e), C(t, e + 1)) &&
((function (t) {
for (var e = [], i = t.length, n = 0; n !== i; n++) e.push(t.pop());
for (n = 0; n !== i; n++) t[n] = e[n];
})(t),
!0)
);
},
};
var u = [],
c = [];
function M(t, e) {
var i = e[0] - t[0],
n = e[1] - t[1];
return i * i + n * n;
}
function C(t, e) {
var i = t.length;
return t[e < 0 ? (e % i) + i : e % i];
}
function O(t, e, i, n) {
for (var s = i; s < n; s++) t.push(e[s]);
}
function k(t, e) {
return P(C(t, e - 1), C(t, e), C(t, e + 1));
}
var h = [],
d = [];
function f(t, e, i) {
var n,
s,
r = h,
o = d;
if (!E(C(t, e + 1), C(t, e), C(t, i)) || !A(C(t, e - 1), C(t, e), C(t, i))) {
s = M(C(t, e), C(t, i));
for (var a = 0; a !== t.length; ++a)
if (
(a + 1) % t.length !== e &&
a !== e &&
E(C(t, e), C(t, i), C(t, a + 1)) &&
A(C(t, e), C(t, i), C(t, a)) &&
((r[0] = C(t, e)),
(r[1] = C(t, i)),
(o[0] = C(t, a)),
(o[1] = C(t, a + 1)),
(n = (function (t, e, i) {
i = i || 0;
var n = [0, 0],
s = t[1][1] - t[0][1],
r = t[0][0] - t[1][0],
o = s * t[0][0] + r * t[0][1],
a = e[1][1] - e[0][1],
h = e[0][0] - e[1][0],
l = a * e[0][0] + h * e[0][1],
u = s * h - a * r;
return g(u, 0, i) || ((n[0] = (h * o - r * l) / u), (n[1] = (s * l - a * o) / u)), n;
})(r, o)),
M(C(t, e), n) < s)
)
return;
return 1;
}
}
function R(t, e, i) {
for (var n = 0; n !== t.length; ++n) if (n !== e && n !== i && (n + 1) % t.length !== e && (n + 1) % t.length !== i && s(C(t, e), C(t, i), C(t, n), C(t, n + 1))) return;
return 1;
}
function p(t, e, i, n) {
var s = n || [];
if (((s.length = 0), e < i)) for (var r = e; r <= i; r++) s.push(t[r]);
else {
for (r = 0; r <= i; r++) s.push(t[r]);
for (r = e; r < t.length; r++) s.push(t[r]);
}
return s;
}
function L(t, e, i, n, s) {
s = s || 0;
var r = e[1] - t[1],
o = t[0] - e[0],
a = r * t[0] + o * t[1],
h = n[1] - i[1],
l = i[0] - n[0],
u = h * i[0] + l * i[1],
c = r * l - h * o;
return g(c, 0, s) ? [0, 0] : [(l * a - o * u) / c, (r * u - h * a) / c];
}
function g(t, e, i) {
return (i = i || 0), Math.abs(t - e) <= i;
}
},
function (t, e, i) {
var c = i(86),
n = i(0),
d = i(591),
o = i(128),
f = i(592),
s = i(1395),
p = i(1396),
a = i(1397),
r = i(593),
h = i(589),
l = i(590),
u = i(1398),
g = i(64),
v = new n({
initialize: function (t) {
(this.world = t), (this.scene = t.scene), (this.sys = t.scene.sys);
},
rectangle: function (t, e, i, n, s) {
var r = c.rectangle(t, e, i, n, s);
return this.world.add(r), r;
},
trapezoid: function (t, e, i, n, s, r) {
var o = c.trapezoid(t, e, i, n, s, r);
return this.world.add(o), o;
},
circle: function (t, e, i, n, s) {
var r = c.circle(t, e, i, n, s);
return this.world.add(r), r;
},
polygon: function (t, e, i, n, s) {
var r = c.polygon(t, e, i, n, s);
return this.world.add(r), r;
},
fromVertices: function (t, e, i, n, s, r, o) {
"string" == typeof i && (i = g.fromPath(i));
var a = c.fromVertices(t, e, i, n, s, r, o);
return this.world.add(a), a;
},
fromPhysicsEditor: function (t, e, i, n, s) {
void 0 === s && (s = !0);
var r = h.parseBody(t, e, i, n);
return s && !this.world.has(r) && this.world.add(r), r;
},
fromSVG: function (t, e, i, n, s, r) {
void 0 === n && (n = 1), void 0 === s && (s = {}), void 0 === r && (r = !0);
for (var o = i.getElementsByTagName("path"), a = [], h = 0; h < o.length; h++) {
var l = f.pathToVertices(o[h], 30);
1 !== n && g.scale(l, n, n), a.push(l);
}
var u = c.fromVertices(t, e, a, s);
return r && this.world.add(u), u;
},
fromJSON: function (t, e, i, n, s) {
void 0 === n && (n = {}), void 0 === s && (s = !0);
var r = l.parseBody(t, e, i, n);
return r && s && this.world.add(r), r;
},
imageStack: function (n, s, t, e, i, r, o, a, h) {
void 0 === o && (o = 0), void 0 === a && (a = 0), void 0 === h && (h = {});
var l = this.world,
u = this.sys.displayList;
h.addToWorld = !1;
var c = d.stack(t, e, i, r, o, a, function (t, e) {
var i = new p(l, t, e, n, s, h);
return u.add(i), i.body;
});
return l.add(c), c;
},
stack: function (t, e, i, n, s, r, o) {
var a = d.stack(t, e, i, n, s, r, o);
return this.world.add(a), a;
},
pyramid: function (t, e, i, n, s, r, o) {
var a = d.pyramid(t, e, i, n, s, r, o);
return this.world.add(a), a;
},
chain: function (t, e, i, n, s, r) {
return d.chain(t, e, i, n, s, r);
},
mesh: function (t, e, i, n, s) {
return d.mesh(t, e, i, n, s);
},
newtonsCradle: function (t, e, i, n, s) {
var r = d.newtonsCradle(t, e, i, n, s);
return this.world.add(r), r;
},
car: function (t, e, i, n, s) {
var r = d.car(t, e, i, n, s);
return this.world.add(r), r;
},
softBody: function (t, e, i, n, s, r, o, a, h, l) {
var u = d.softBody(t, e, i, n, s, r, o, a, h, l);
return this.world.add(u), u;
},
joint: function (t, e, i, n, s) {
return this.constraint(t, e, i, n, s);
},
spring: function (t, e, i, n, s) {
return this.constraint(t, e, i, n, s);
},
constraint: function (t, e, i, n, s) {
void 0 === n && (n = 1), void 0 === s && (s = {}), (s.bodyA = "body" === t.type ? t : t.body), (s.bodyB = "body" === e.type ? e : e.body), isNaN(i) || (s.length = i), (s.stiffness = n);
var r = o.create(s);
return this.world.add(r), r;
},
worldConstraint: function (t, e, i, n) {
void 0 === i && (i = 1), void 0 === n && (n = {}), (n.bodyB = "body" === t.type ? t : t.body), isNaN(e) || (n.length = e), (n.stiffness = i);
var s = o.create(n);
return this.world.add(s), s;
},
mouseSpring: function (t) {
return this.pointerConstraint(t);
},
pointerConstraint: function (t) {
void 0 === t && (t = {}), t.hasOwnProperty("render") || (t.render = { visible: !1 });
var e = new u(this.scene, this.world, t);
return this.world.add(e.constraint), e;
},
image: function (t, e, i, n, s) {
var r = new p(this.world, t, e, i, n, s);
return this.sys.displayList.add(r), r;
},
tileBody: function (t, e) {
return new r(this.world, t, e);
},
sprite: function (t, e, i, n, s) {
var r = new a(this.world, t, e, i, n, s);
return this.sys.displayList.add(r), this.sys.updateList.add(r), r;
},
gameObject: function (t, e, i) {
return s(this.world, t, e, i);
},
destroy: function () {
(this.world = null), (this.scene = null), (this.sys = null);
},
});
t.exports = v;
},
function (t, e, i) {
var a = i(249),
h = i(2),
l = i(3);
t.exports = function (t, n, e, i) {
void 0 === e && (e = {}), void 0 === i && (i = !0);
var s,
r = n.x,
o = n.y;
return (
(n.body = { temp: !0, position: { x: r, y: o } }),
[a.Bounce, a.Collision, a.Force, a.Friction, a.Gravity, a.Mass, a.Sensor, a.SetBody, a.Sleep, a.Static, a.Transform, a.Velocity].forEach(function (t) {
for (var e in t)
((i = t[e]).get && "function" == typeof i.get) || (i.set && "function" == typeof i.set) ? Object.defineProperty(n, e, { get: t[e].get, set: t[e].set }) : Object.defineProperty(n, e, { value: t[e] });
var i;
}),
(n.world = t),
(n._tempVec2 = new l(r, o)),
e.hasOwnProperty("type") && "body" === e.type ? n.setExistingBody(e, i) : ((s = (s = h(e, "shape", null)) || "rectangle"), (e.addToWorld = i), n.setBody(s, e)),
n
);
};
},
function (t, e, i) {
var n = i(0),
s = i(249),
a = i(15),
h = i(2),
r = i(125),
o = i(167),
l = i(3),
u = new n({
Extends: r,
Mixins: [s.Bounce, s.Collision, s.Force, s.Friction, s.Gravity, s.Mass, s.Sensor, s.SetBody, s.Sleep, s.Static, s.Transform, s.Velocity, o],
initialize: function (t, e, i, n, s, r) {
a.call(this, t.scene, "Image"), (this._crop = this.resetCropObject()), this.setTexture(n, s), this.setSizeToFrame(), this.setOrigin(), (this.world = t), (this._tempVec2 = new l(e, i));
var o = h(r, "shape", null);
o ? this.setBody(o, r) : this.setRectangle(this.width, this.height, r), this.setPosition(e, i), this.initPipeline();
},
});
t.exports = u;
},
function (t, e, i) {
var a = i(164),
n = i(0),
s = i(249),
h = i(15),
l = i(2),
r = i(167),
o = i(73),
u = i(3),
c = new n({
Extends: o,
Mixins: [s.Bounce, s.Collision, s.Force, s.Friction, s.Gravity, s.Mass, s.Sensor, s.SetBody, s.Sleep, s.Static, s.Transform, s.Velocity, r],
initialize: function (t, e, i, n, s, r) {
h.call(this, t.scene, "Sprite"),
(this._crop = this.resetCropObject()),
(this.anims = new a(this)),
this.setTexture(n, s),
this.setSizeToFrame(),
this.setOrigin(),
(this.world = t),
(this._tempVec2 = new u(e, i));
var o = l(r, "shape", null);
o ? this.setBody(o, r) : this.setRectangle(this.width, this.height, r), this.setPosition(e, i), this.initPipeline();
},
});
t.exports = c;
},
function (t, e, i) {
var o = i(84),
n = i(0),
a = i(118),
s = i(128),
h = i(273),
l = i(272),
r = i(51),
u = i(127),
c = i(165),
d = i(3),
f = i(64),
p = new n({
initialize: function (t, e, i) {
void 0 === i && (i = {}),
(this.scene = t),
(this.world = e),
(this.camera = null),
(this.pointer = null),
(this.active = !0),
(this.position = new d()),
(this.body = null),
(this.part = null),
(this.constraint = s.create(
u(i, { label: "Pointer Constraint", pointA: { x: 0, y: 0 }, pointB: { x: 0, y: 0 }, length: 0.01, stiffness: 0.1, angularStiffness: 1, collisionFilter: { category: 1, mask: 4294967295, group: 0 } })
)),
this.world.on(l.BEFORE_UPDATE, this.update, this),
t.sys.input.on(r.POINTER_DOWN, this.onDown, this),
t.sys.input.on(r.POINTER_UP, this.onUp, this);
},
onDown: function (t) {
this.pointer || ((this.pointer = t), (this.camera = t.camera));
},
onUp: function (t) {
t === this.pointer && (this.pointer = null);
},
getBody: function (t) {
var e = this.position,
i = this.constraint;
this.camera.getWorldPoint(t.x, t.y, e);
for (var n = a.allBodies(this.world.localWorld), s = 0; s < n.length; s++) {
var r = n[s];
if (!r.ignorePointer && o.contains(r.bounds, e) && h.canCollide(r.collisionFilter, i.collisionFilter) && this.hitTestBody(r, e)) return this.world.emit(l.DRAG_START, r, this.part, this), !0;
}
return !1;
},
hitTestBody: function (t, e) {
for (var i = this.constraint, n = t.parts.length, s = 1 < n ? 1 : 0; s < n; s++) {
var r = t.parts[s];
if (f.contains(r.vertices, e))
return (i.pointA = e), (i.pointB = { x: e.x - t.position.x, y: e.y - t.position.y }), (i.bodyB = t), (i.angleB = t.angle), c.set(t, !1), (this.part = r), (this.body = t), !0;
}
return !1;
},
update: function () {
var t = this.pointer,
e = this.body;
if (this.active && t)
if (t.isDown || !e) {
if (t.isDown) {
if (!e && !this.getBody(t)) return;
e = this.body;
var i = this.position,
n = this.constraint;
this.camera.getWorldPoint(t.x, t.y, i), (n.pointA.x = i.x), (n.pointA.y = i.y), c.set(e, !1), this.world.emit(l.DRAG, e, this);
}
} else this.stopDrag();
else e && this.stopDrag();
},
stopDrag: function () {
var t = this.body,
e = this.constraint;
(e.bodyB = null), (e.pointB = null), (this.pointer = null), (this.body = null), (this.part = null), t && this.world.emit(l.DRAG_END, t, this);
},
destroy: function () {
this.world.removeConstraint(this.constraint),
(this.pointer = null),
(this.constraint = null),
(this.body = null),
(this.part = null),
this.world.off(l.BEFORE_UPDATE, this.update),
this.scene.sys.input.off(r.POINTER_DOWN, this.onDown, this),
this.scene.sys.input.off(r.POINTER_UP, this.onUp, this);
},
});
t.exports = p;
},
function (t, e, i) {
var n = {};
t.exports = n;
var s = i(595),
r = i(32);
(n.name = "matter-js"),
(n.version = "0.14.2"),
(n.uses = []),
(n.used = []),
(n.use = function () {
s.use(n, Array.prototype.slice.call(arguments));
}),
(n.before = function (t, e) {
return (t = t.replace(/^Matter./, "")), r.chainPathBefore(n, t, e);
}),
(n.after = function (t, e) {
return (t = t.replace(/^Matter./, "")), r.chainPathAfter(n, t, e);
});
},
function (t, e, i) {
var d = {};
t.exports = d;
var f = i(83),
h = i(274),
l = i(84),
p = i(86),
a = i(64);
(d.collides = function (t, e) {
for (var i = [], n = 0; n < e.length; n++) {
var s = e[n];
if (t !== s && l.overlaps(s.bounds, t.bounds))
for (var r = 1 === s.parts.length ? 0 : 1; r < s.parts.length; r++) {
var o = s.parts[r];
if (l.overlaps(o.bounds, t.bounds)) {
var a = h.collides(o, t);
if (a.collided) {
i.push(a);
break;
}
}
}
}
return i;
}),
(d.ray = function (t, e, i, n) {
n = n || 1e-100;
for (var s = f.angle(e, i), r = f.magnitude(f.sub(e, i)), o = 0.5 * (i.x + e.x), a = 0.5 * (i.y + e.y), h = p.rectangle(o, a, r, n, { angle: s }), l = d.collides(h, t), u = 0; u < l.length; u += 1) {
var c = l[u];
c.body = c.bodyB = c.bodyA;
}
return l;
}),
(d.region = function (t, e, i) {
for (var n = [], s = 0; s < t.length; s++) {
var r = t[s],
o = l.overlaps(r.bounds, e);
((o && !i) || (!o && i)) && n.push(r);
}
return n;
}),
(d.point = function (t, e) {
for (var i = [], n = 0; n < t.length; n++) {
var s = t[n];
if (l.contains(s.bounds, e))
for (var r = 1 === s.parts.length ? 0 : 1; r < s.parts.length; r++) {
var o = s.parts[r];
if (l.contains(o.bounds, e) && a.contains(o.vertices, e)) {
i.push(s);
break;
}
}
}
return i;
});
},
function (t, e, i) {
var p = {};
t.exports = p;
var s = i(596),
g = i(165),
v = i(599),
y = i(598),
m = i(1523),
r = i(597),
x = i(166),
b = i(118),
w = i(128),
o = i(32),
a = i(41);
(p.create = function (t, e) {
(e = (e = o.isElement(t) ? e : t) || {}), ((t = o.isElement(t) ? t : null) || e.render) && o.warn("Engine.create: engine.render is deprecated (see docs)");
var i = { positionIterations: 6, velocityIterations: 4, constraintIterations: 2, enableSleeping: !1, events: [], plugin: {}, timing: { timestamp: 0, timeScale: 1 }, broadphase: { controller: r } },
n = o.extend(i, e);
return (
(n.world = e.world || s.create(n.world)), (n.pairs = y.create()), (n.broadphase = n.broadphase.controller.create(n.broadphase)), (n.metrics = n.metrics || { extended: !1 }), (n.metrics = m.create(n.metrics)), n
);
}),
(p.update = function (t, e, i) {
(e = e || 1e3 / 60), (i = i || 1);
var n,
s,
r = t.world,
o = t.timing,
a = t.broadphase;
o.timestamp += e * o.timeScale;
var h = { timestamp: o.timestamp };
x.trigger(t, "beforeUpdate", h);
var l = b.allBodies(r),
u = b.allConstraints(r);
for (
m.reset(t.metrics), t.enableSleeping && g.update(l, o.timeScale), p._bodiesApplyGravity(l, r.gravity), p._bodiesUpdate(l, e, o.timeScale, i, r.bounds), w.preSolveAll(l), n = 0;
n < t.constraintIterations;
n++
)
w.solveAll(u, o.timeScale);
w.postSolveAll(l), (s = a.controller ? (r.isModified && a.controller.clear(a), a.controller.update(a, l, t, r.isModified), a.pairsList) : l), r.isModified && b.setModified(r, !1, !1, !0);
var c = a.detector(s, t),
d = t.pairs,
f = o.timestamp;
for (
y.update(d, c, f),
y.removeOld(d, f),
t.enableSleeping && g.afterCollisions(d.list, o.timeScale),
0 < d.collisionStart.length && x.trigger(t, "collisionStart", { pairs: d.collisionStart }),
v.preSolvePosition(d.list),
n = 0;
n < t.positionIterations;
n++
)
v.solvePosition(d.list, l, o.timeScale);
for (v.postSolvePosition(l), w.preSolveAll(l), n = 0; n < t.constraintIterations; n++) w.solveAll(u, o.timeScale);
for (w.postSolveAll(l), v.preSolveVelocity(d.list), n = 0; n < t.velocityIterations; n++) v.solveVelocity(d.list, o.timeScale);
return (
0 < d.collisionActive.length && x.trigger(t, "collisionActive", { pairs: d.collisionActive }),
0 < d.collisionEnd.length && x.trigger(t, "collisionEnd", { pairs: d.collisionEnd }),
m.update(t.metrics, t),
p._bodiesClearForces(l),
x.trigger(t, "afterUpdate", h),
t
);
}),
(p.merge = function (t, e) {
if ((o.extend(t, e), e.world)) {
(t.world = e.world), p.clear(t);
for (var i = b.allBodies(t.world), n = 0; n < i.length; n++) {
var s = i[n];
g.set(s, !1), (s.id = o.nextId());
}
}
}),
(p.clear = function (t) {
var e = t.world;
y.clear(t.pairs);
var i,
n = t.broadphase;
n.controller && ((i = b.allBodies(e)), n.controller.clear(n), n.controller.update(n, i, t, !0));
}),
(p._bodiesClearForces = function (t) {
for (var e = 0; e < t.length; e++) {
var i = t[e];
(i.force.x = 0), (i.force.y = 0), (i.torque = 0);
}
}),
(p._bodiesApplyGravity = function (t, e) {
var i = void 0 !== e.scale ? e.scale : 0.001;
if ((0 !== e.x || 0 !== e.y) && 0 !== i)
for (var n = 0; n < t.length; n++) {
var s = t[n];
s.ignoreGravity || s.isStatic || s.isSleeping || ((s.force.x += s.mass * e.x * i * s.gravityScale.x), (s.force.y += s.mass * e.y * i * s.gravityScale.y));
}
}),
(p._bodiesUpdate = function (t, e, i, n, s) {
for (var r = 0; r < t.length; r++) {
var o = t[r];
o.isStatic || o.isSleeping || a.update(o, e, i, n);
}
});
},
function (t, e, i) {
var o = i(86),
n = i(41),
s = i(0),
m = i(32),
u = i(118),
b = i(1401),
w = i(9),
a = i(272),
T = i(2),
S = i(6),
r = i(41),
h = i(166),
l = i(593),
c = i(596),
x = i(83),
d = new s({
Extends: w,
initialize: function (t, e) {
w.call(this), (this.scene = t), (this.engine = b.create(e)), (this.localWorld = this.engine.world);
var i = S(e, "gravity", null);
i ? this.setGravity(i.x, i.y, i.scale) : !1 === i && this.setGravity(0, 0, 0),
(this.walls = { left: null, right: null, top: null, bottom: null }),
(this.enabled = S(e, "enabled", !0)),
(this.correction = S(e, "correction", 1)),
(this.getDelta = S(e, "getDelta", this.update60Hz));
var n = T(e, "runner", {}),
s = T(n, "fps", !1),
r = T(n, "fps", 60),
o = T(n, "delta", 1e3 / r),
a = T(n, "deltaMin", 1e3 / r),
h = T(n, "deltaMax", 1e3 / (0.5 * r));
s || (r = 1e3 / o),
(this.runner = {
fps: r,
correction: T(n, "correction", 1),
deltaSampleSize: T(n, "deltaSampleSize", 60),
counterTimestamp: 0,
frameCounter: 0,
deltaHistory: [],
timePrev: null,
timeScalePrev: 1,
frameRequestId: null,
isFixed: T(n, "isFixed", !1),
delta: o,
deltaMin: a,
deltaMax: h,
}),
(this.autoUpdate = S(e, "autoUpdate", !0));
var l,
u,
c,
d,
f,
p,
g,
v,
y,
m,
x = S(e, "debug", !1);
(this.drawDebug = "object" == typeof x || x),
this.debugGraphic,
(this.debugConfig = {
showAxes: T(x, "showAxes", !1),
showAngleIndicator: T(x, "showAngleIndicator", !1),
angleColor: T(x, "angleColor", 15208787),
showBroadphase: T(x, "showBroadphase", !1),
broadphaseColor: T(x, "broadphaseColor", 16757760),
showBounds: T(x, "showBounds", !1),
boundsColor: T(x, "boundsColor", 16777215),
showVelocity: T(x, "showVelocity", !1),
velocityColor: T(x, "velocityColor", 44783),
showCollisions: T(x, "showCollisions", !1),
collisionColor: T(x, "collisionColor", 16094476),
showSeparations: T(x, "showSeparations", !1),
separationColor: T(x, "separationColor", 16753920),
showBody: T(x, "showBody", !0),
showStaticBody: T(x, "showStaticBody", !0),
showInternalEdges: T(x, "showInternalEdges", !1),
renderFill: T(x, "renderFill", !1),
renderLine: T(x, "renderLine", !0),
fillColor: T(x, "fillColor", 1075465),
fillOpacity: T(x, "fillOpacity", 1),
lineColor: T(x, "lineColor", 2678297),
lineOpacity: T(x, "lineOpacity", 1),
lineThickness: T(x, "lineThickness", 1),
staticFillColor: T(x, "staticFillColor", 857979),
staticLineColor: T(x, "staticLineColor", 1255396),
showSleeping: T(x, "showSleeping", !1),
staticBodySleepOpacity: T(x, "staticBodySleepOpacity", 0.7),
sleepFillColor: T(x, "sleepFillColor", 4605510),
sleepLineColor: T(x, "sleepLineColor", 10066585),
showSensors: T(x, "showSensors", !0),
sensorFillColor: T(x, "sensorFillColor", 857979),
sensorLineColor: T(x, "sensorLineColor", 1255396),
showPositions: T(x, "showPositions", !0),
positionSize: T(x, "positionSize", 4),
positionColor: T(x, "positionColor", 14697178),
showJoint: T(x, "showJoint", !0),
jointColor: T(x, "jointColor", 14737474),
jointLineOpacity: T(x, "jointLineOpacity", 1),
jointLineThickness: T(x, "jointLineThickness", 2),
pinSize: T(x, "pinSize", 4),
pinColor: T(x, "pinColor", 4382944),
springColor: T(x, "springColor", 14697184),
anchorColor: T(x, "anchorColor", 15724527),
anchorSize: T(x, "anchorSize", 4),
showConvexHulls: T(x, "showConvexHulls", !1),
hullColor: T(x, "hullColor", 14091216),
}),
this.drawDebug && this.createDebugGraphic(),
this.setEventsProxy(),
T(e, "setBounds", !1) &&
("boolean" == typeof (l = e.setBounds)
? this.setBounds()
: ((u = T(l, "x", 0)),
(c = T(l, "y", 0)),
(d = T(l, "width", t.sys.scale.width)),
(f = T(l, "height", t.sys.scale.height)),
(p = T(l, "thickness", 64)),
(g = T(l, "left", !0)),
(v = T(l, "right", !0)),
(y = T(l, "top", !0)),
(m = T(l, "bottom", !0)),
this.setBounds(u, c, d, f, p, g, v, y, m)));
},
setCompositeRenderStyle: function (t) {
for (var e, i, n = t.bodies, s = t.constraints, r = t.composites, o = 0; o < n.length; o++)
(i = (e = n[o]).render), this.setBodyRenderStyle(e, i.lineColor, i.lineOpacity, i.lineThickness, i.fillColor, i.fillOpacity);
for (o = 0; o < s.length; o++) (i = (e = s[o]).render), this.setConstraintRenderStyle(e, i.lineColor, i.lineOpacity, i.lineThickness, i.pinSize, i.anchorColor, i.anchorSize);
for (o = 0; o < r.length; o++) (e = r[o]), this.setCompositeRenderStyle(e);
return this;
},
setBodyRenderStyle: function (t, e, i, n, s, r) {
var o = t.render,
a = this.debugConfig;
return (
o &&
(null == e && (e = t.isStatic ? a.staticLineColor : a.lineColor),
null == i && (i = a.lineOpacity),
null == n && (n = a.lineThickness),
null == s && (s = t.isStatic ? a.staticFillColor : a.fillColor),
null == r && (r = a.fillOpacity),
!1 !== e && (o.lineColor = e),
!1 !== i && (o.lineOpacity = i),
!1 !== n && (o.lineThickness = n),
!1 !== s && (o.fillColor = s),
!1 !== r && (o.fillOpacity = r)),
this
);
},
setConstraintRenderStyle: function (t, e, i, n, s, r, o) {
var a,
h = t.render,
l = this.debugConfig;
return (
h &&
(null == e && ("line" === (a = h.type) ? (e = l.jointColor) : "pin" === a ? (e = l.pinColor) : "spring" === a && (e = l.springColor)),
null == i && (i = l.jointLineOpacity),
null == n && (n = l.jointLineThickness),
null == s && (s = l.pinSize),
null == r && (r = l.anchorColor),
null == o && (o = l.anchorSize),
!1 !== e && (h.lineColor = e),
!1 !== i && (h.lineOpacity = i),
!1 !== n && (h.lineThickness = n),
!1 !== s && (h.pinSize = s),
!1 !== r && (h.anchorColor = r),
!1 !== o && (h.anchorSize = o)),
this
);
},
setEventsProxy: function () {
var r = this,
t = this.engine,
e = this.localWorld;
this.drawDebug &&
(h.on(e, "compositeModified", function (t) {
r.setCompositeRenderStyle(t);
}),
h.on(e, "beforeAdd", function (t) {
for (var e = [].concat(t.object), i = 0; i < e.length; i++) {
var n = e[i],
s = n.render;
"body" === n.type
? r.setBodyRenderStyle(n, s.lineColor, s.lineOpacity, s.lineThickness, s.fillColor, s.fillOpacity)
: "composite" === n.type
? r.setCompositeRenderStyle(n)
: "constraint" === n.type && r.setConstraintRenderStyle(n, s.lineColor, s.lineOpacity, s.lineThickness, s.pinSize, s.anchorColor, s.anchorSize);
}
})),
h.on(e, "beforeAdd", function (t) {
r.emit(a.BEFORE_ADD, t);
}),
h.on(e, "afterAdd", function (t) {
r.emit(a.AFTER_ADD, t);
}),
h.on(e, "beforeRemove", function (t) {
r.emit(a.BEFORE_REMOVE, t);
}),
h.on(e, "afterRemove", function (t) {
r.emit(a.AFTER_REMOVE, t);
}),
h.on(t, "beforeUpdate", function (t) {
r.emit(a.BEFORE_UPDATE, t);
}),
h.on(t, "afterUpdate", function (t) {
r.emit(a.AFTER_UPDATE, t);
}),
h.on(t, "collisionStart", function (t) {
var e,
i,
n = t.pairs;
0 < n.length && ((e = n[0].bodyA), (i = n[0].bodyB)), r.emit(a.COLLISION_START, t, e, i);
}),
h.on(t, "collisionActive", function (t) {
var e,
i,
n = t.pairs;
0 < n.length && ((e = n[0].bodyA), (i = n[0].bodyB)), r.emit(a.COLLISION_ACTIVE, t, e, i);
}),
h.on(t, "collisionEnd", function (t) {
var e,
i,
n = t.pairs;
0 < n.length && ((e = n[0].bodyA), (i = n[0].bodyB)), r.emit(a.COLLISION_END, t, e, i);
});
},
setBounds: function (t, e, i, n, s, r, o, a, h) {
return (
void 0 === t && (t = 0),
void 0 === e && (e = 0),
void 0 === i && (i = this.scene.sys.scale.width),
void 0 === n && (n = this.scene.sys.scale.height),
void 0 === s && (s = 64),
void 0 === r && (r = !0),
void 0 === o && (o = !0),
void 0 === a && (a = !0),
void 0 === h && (h = !0),
this.updateWall(r, "left", t - s, e - s, s, n + 2 * s),
this.updateWall(o, "right", t + i, e - s, s, n + 2 * s),
this.updateWall(a, "top", t, e - s, i, s),
this.updateWall(h, "bottom", t, e + n, i, s),
this
);
},
updateWall: function (t, e, i, n, s, r) {
var o = this.walls[e];
t
? (o && c.remove(this.localWorld, o), (i += s / 2), (n += r / 2), (this.walls[e] = this.create(i, n, s, r, { isStatic: !0, friction: 0, frictionStatic: 0 })))
: (o && c.remove(this.localWorld, o), (this.walls[e] = null));
},
createDebugGraphic: function () {
var t = this.scene.sys.add.graphics({ x: 0, y: 0 });
return t.setDepth(Number.MAX_VALUE), (this.debugGraphic = t), (this.drawDebug = !0), t;
},
disableGravity: function () {
return (this.localWorld.gravity.x = 0), (this.localWorld.gravity.y = 0), (this.localWorld.gravity.scale = 0), this;
},
setGravity: function (t, e, i) {
return void 0 === t && (t = 0), void 0 === e && (e = 1), (this.localWorld.gravity.x = t), (this.localWorld.gravity.y = e), void 0 !== i && (this.localWorld.gravity.scale = i), this;
},
create: function (t, e, i, n, s) {
var r = o.rectangle(t, e, i, n, s);
return c.add(this.localWorld, r), r;
},
add: function (t) {
return c.add(this.localWorld, t), this;
},
remove: function (t, e) {
Array.isArray(t) || (t = [t]);
for (var i = 0; i < t.length; i++) {
var n = t[i],
s = n.body ? n.body : n;
u.remove(this.localWorld, s, e);
}
return this;
},
removeConstraint: function (t, e) {
return u.remove(this.localWorld, t, e), this;
},
convertTilemapLayer: function (t, e) {
var i = t.layer,
n = t.getTilesWithin(0, 0, i.width, i.height, { isColliding: !0 });
return this.convertTiles(n, e), this;
},
convertTiles: function (t, e) {
if (0 === t.length) return this;
for (var i = 0; i < t.length; i++) new l(this, t[i], e);
return this;
},
nextGroup: function (t) {
return r.nextGroup(t);
},
nextCategory: function () {
return r.nextCategory();
},
pause: function () {
return (this.enabled = !1), this.emit(a.PAUSE), this;
},
resume: function () {
return (this.enabled = !0), this.emit(a.RESUME), this;
},
update: function (t, e) {
var i, n, s, r;
this.enabled &&
this.autoUpdate &&
((i = this.engine),
(n = this.runner),
(s = i.timing),
(r = this.correction),
n.isFixed
? (e = this.getDelta(t, e))
: ((e = t - n.timePrev || n.delta),
(n.timePrev = t),
n.deltaHistory.push(e),
(n.deltaHistory = n.deltaHistory.slice(-n.deltaSampleSize)),
(r = (e = (e = (e = Math.min.apply(null, n.deltaHistory)) < n.deltaMin ? n.deltaMin : e) > n.deltaMax ? n.deltaMax : e) / n.delta),
(n.delta = e)),
0 !== n.timeScalePrev && (r *= s.timeScale / n.timeScalePrev),
0 === s.timeScale && (r = 0),
(n.timeScalePrev = s.timeScale),
(n.correction = r),
(n.frameCounter += 1),
1e3 <= t - n.counterTimestamp && ((n.fps = n.frameCounter * ((t - n.counterTimestamp) / 1e3)), (n.counterTimestamp = t), (n.frameCounter = 0)),
b.update(i, e, r));
},
step: function (t, e) {
b.update(this.engine, t, e);
},
update60Hz: function () {
return 1e3 / 60;
},
update30Hz: function () {
return 1e3 / 30;
},
has: function (t) {
var e = t.hasOwnProperty("body") ? t.body : t;
return null !== u.get(this.localWorld, e.id, e.type);
},
getAllBodies: function () {
return u.allBodies(this.localWorld);
},
getAllConstraints: function () {
return u.allConstraints(this.localWorld);
},
getAllComposites: function () {
return u.allComposites(this.localWorld);
},
postUpdate: function () {
var t, e, i, n;
this.drawDebug &&
((t = this.debugConfig),
(e = this.engine),
(i = this.debugGraphic),
(n = u.allBodies(this.localWorld)),
this.debugGraphic.clear(),
t.showBroadphase && e.broadphase.controller && this.renderGrid(e.broadphase, i, t.broadphaseColor, 0.5),
t.showBounds && this.renderBodyBounds(n, i, t.boundsColor, 0.5),
(t.showBody || t.showStaticBody) && this.renderBodies(n),
t.showJoint && this.renderJoints(),
(t.showAxes || t.showAngleIndicator) && this.renderBodyAxes(n, i, t.showAxes, t.angleColor, 0.5),
t.showVelocity && this.renderBodyVelocity(n, i, t.velocityColor, 1, 2),
t.showSeparations && this.renderSeparations(e.pairs.list, i, t.separationColor),
t.showCollisions && this.renderCollisions(e.pairs.list, i, t.collisionColor));
},
renderGrid: function (t, e, i, n) {
e.lineStyle(1, i, n);
for (var s = m.keys(t.buckets), r = 0; r < s.length; r++) {
var o,
a = s[r];
t.buckets[a].length < 2 || ((o = a.split(/C|R/)), e.strokeRect(parseInt(o[1], 10) * t.bucketWidth, parseInt(o[2], 10) * t.bucketHeight, t.bucketWidth, t.bucketHeight));
}
return this;
},
renderSeparations: function (t, e, i) {
e.lineStyle(1, i, 1);
for (var n = 0; n < t.length; n++) {
var s,
r,
o,
a,
h,
l,
u,
c = t[n];
c.isActive &&
((r = (s = c.collision).bodyA),
(o = s.bodyB),
(a = r.position),
(h = o.position),
(l = s.penetration),
(u = r.isStatic || o.isStatic ? 1 : 4),
o.isStatic && (u = 0),
e.lineBetween(h.x, h.y, h.x - l.x * u, h.y - l.y * u),
(u = r.isStatic || o.isStatic ? 1 : 4),
r.isStatic && (u = 0),
e.lineBetween(a.x, a.y, a.x - l.x * u, a.y - l.y * u));
}
return this;
},
renderCollisions: function (t, e, i) {
var n, s, r, o, a, h;
for (e.lineStyle(1, i, 0.5), e.fillStyle(i, 1), n = 0; n < t.length; n++)
if ((s = t[n]).isActive)
for (var l = 0; l < s.activeContacts.length; l++) {
var u = s.activeContacts[l].vertex;
e.fillRect(u.x - 2, u.y - 2, 5, 5);
}
for (n = 0; n < t.length; n++)
(s = t[n]).isActive &&
((r = s.collision),
0 < (o = s.activeContacts).length &&
((a = o[0].vertex.x),
(h = o[0].vertex.y),
2 === o.length && ((a = (o[0].vertex.x + o[1].vertex.x) / 2), (h = (o[0].vertex.y + o[1].vertex.y) / 2)),
r.bodyB === r.supports[0].body || r.bodyA.isStatic ? e.lineBetween(a - 8 * r.normal.x, h - 8 * r.normal.y, a, h) : e.lineBetween(a + 8 * r.normal.x, h + 8 * r.normal.y, a, h)));
return this;
},
renderBodyBounds: function (t, e, i, n) {
e.lineStyle(1, i, n);
for (var s = 0; s < t.length; s++) {
var r = t[s];
if (r.render.visible) {
var o = r.bounds;
if (o) e.strokeRect(o.min.x, o.min.y, o.max.x - o.min.x, o.max.y - o.min.y);
else
for (var a = r.parts, h = 1 < a.length ? 1 : 0; h < a.length; h++) {
var l = a[h];
e.strokeRect(l.bounds.min.x, l.bounds.min.y, l.bounds.max.x - l.bounds.min.x, l.bounds.max.y - l.bounds.min.y);
}
}
}
return this;
},
renderBodyAxes: function (t, e, i, n, s) {
e.lineStyle(1, n, s);
for (var r = 0; r < t.length; r++) {
var o,
a,
h,
l = t[r],
u = l.parts;
if (l.render.visible)
if (i)
for (a = 1 < u.length ? 1 : 0; a < u.length; a++)
for (o = u[a], h = 0; h < o.axes.length; h++) {
var c = o.axes[h];
e.lineBetween(o.position.x, o.position.y, o.position.x + 20 * c.x, o.position.y + 20 * c.y);
}
else
for (a = 1 < u.length ? 1 : 0; a < u.length; a++)
for (o = u[a], h = 0; h < o.axes.length; h++)
e.lineBetween(o.position.x, o.position.y, (o.vertices[0].x + o.vertices[o.vertices.length - 1].x) / 2, (o.vertices[0].y + o.vertices[o.vertices.length - 1].y) / 2);
}
return this;
},
renderBodyVelocity: function (t, e, i, n, s) {
e.lineStyle(s, i, n);
for (var r = 0; r < t.length; r++) {
var o = t[r];
o.render.visible && e.lineBetween(o.position.x, o.position.y, o.position.x + 2 * (o.position.x - o.positionPrev.x), o.position.y + 2 * (o.position.y - o.positionPrev.y));
}
return this;
},
renderBodies: function (t) {
for (
var e = this.debugGraphic,
i = this.debugConfig,
n = i.showBody,
s = i.showStaticBody,
r = i.showSleeping,
o = i.showInternalEdges,
a = i.showConvexHulls,
h = i.renderFill,
l = i.renderLine,
u = i.staticBodySleepOpacity,
c = i.sleepFillColor,
d = i.sleepLineColor,
f = i.hullColor,
p = 0;
p < t.length;
p++
) {
var g,
v,
y,
m,
x,
b,
w = t[p];
w.render.visible &&
((!s && w.isStatic) ||
(!n && !w.isStatic) ||
((g = w.render.lineColor),
(v = w.render.lineOpacity),
(y = w.render.lineThickness),
(m = w.render.fillColor),
(x = w.render.fillOpacity),
r && w.isSleeping && (w.isStatic ? ((v *= u), (x *= u)) : ((g = d), (m = c))),
h || (m = null),
l || (g = null),
this.renderBody(w, e, o, g, v, y, m, x),
(b = w.parts.length),
a && 1 < b && this.renderConvexHull(w, e, f, y)));
}
},
renderBody: function (t, e, i, n, s, r, o, a) {
void 0 === n && (n = null), void 0 === s && (s = null), void 0 === r && (r = 1), void 0 === o && (o = null), void 0 === a && (a = null);
for (var h, l, u, c = this.debugConfig, d = c.sensorFillColor, f = c.sensorLineColor, p = t.parts, g = p.length, v = 1 < g ? 1 : 0; v < g; v++) {
var y = p[v],
m = y.render,
x = m.opacity;
if (m.visible && 0 !== x && (!y.isSensor || c.showSensors)) {
var b = y.circleRadius;
if ((e.beginPath(), y.isSensor ? (null !== o && e.fillStyle(d, a * x), null !== n && e.lineStyle(r, f, s * x)) : (null !== o && e.fillStyle(o, a * x), null !== n && e.lineStyle(r, n, s * x)), b))
e.arc(y.position.x, y.position.y, b, 0, 2 * Math.PI);
else {
var w = y.vertices,
T = w.length;
e.moveTo(w[0].x, w[0].y);
for (var S = 1; S < T; S++) {
var _,
E = w[S];
!w[S - 1].isInternal || i ? e.lineTo(E.x, E.y) : e.moveTo(E.x, E.y), S < T && E.isInternal && !i && ((_ = (S + 1) % T), e.moveTo(w[_].x, w[_].y));
}
e.closePath();
}
null !== o && e.fillPath(), null !== n && e.strokePath();
}
}
return (
c.showPositions && !t.isStatic && ((h = t.position.x), (l = t.position.y), (u = Math.ceil(c.positionSize / 2)), e.fillStyle(c.positionColor, 1), e.fillRect(h - u, l - u, c.positionSize, c.positionSize)),
this
);
},
renderConvexHull: function (t, e, i, n) {
if ((void 0 === n && (n = 1), 1 < t.parts.length)) {
var s = t.vertices;
e.lineStyle(n, i), e.beginPath(), e.moveTo(s[0].x, s[0].y);
for (var r = 1; r < s.length; r++) e.lineTo(s[r].x, s[r].y);
e.lineTo(s[0].x, s[0].y), e.strokePath();
}
return this;
},
renderJoints: function () {
for (var t = this.debugGraphic, e = u.allConstraints(this.localWorld), i = 0; i < e.length; i++) {
var n = e[i].render,
s = n.lineColor,
r = n.lineOpacity,
o = n.lineThickness,
a = n.pinSize,
h = n.anchorColor,
l = n.anchorSize;
this.renderConstraint(e[i], t, s, r, o, a, h, l);
}
},
renderConstraint: function (t, e, i, n, s, r, o, a) {
var h = t.render;
if (!h.visible || !t.pointA || !t.pointB) return this;
e.lineStyle(s, i, n);
var l,
u = t.bodyA,
c = t.bodyB,
d = u ? x.add(u.position, t.pointA) : t.pointA;
if ("pin" === h.type) e.strokeCircle(d.x, d.y, r);
else {
if (((l = c ? x.add(c.position, t.pointB) : t.pointB), e.beginPath(), e.moveTo(d.x, d.y), "spring" === h.type))
for (var f, p = x.sub(l, d), g = x.perp(x.normalise(p)), v = Math.ceil(m.clamp(t.length / 5, 12, 20)), y = 1; y < v; y += 1)
(f = y % 2 == 0 ? 1 : -1), e.lineTo(d.x + p.x * (y / v) + g.x * f * 4, d.y + p.y * (y / v) + g.y * f * 4);
e.lineTo(l.x, l.y);
}
return e.strokePath(), h.anchors && 0 < a && (e.fillStyle(o), e.fillCircle(d.x, d.y, a), e.fillCircle(l.x, l.y, a)), this;
},
resetCollisionIDs: function () {
return (n._nextCollidingGroupId = 1), (n._nextNonCollidingGroupId = -1), (n._nextCategory = 1), this;
},
shutdown: function () {
h.off(this.engine), this.removeAllListeners(), c.clear(this.localWorld, !1), b.clear(this.engine), this.drawDebug && this.debugGraphic.destroy();
},
destroy: function () {
this.shutdown();
},
});
t.exports = d;
},
function (t, e, i) {
t.exports = { BasePlugin: i(540), DefaultPlugins: i(197), PluginCache: i(24), PluginManager: i(414), ScenePlugin: i(1404) };
},
function (t, e, i) {
var n = i(540),
s = i(0),
r = i(20),
o = new s({
Extends: n,
initialize: function (t, e, i) {
n.call(this, e), (this.scene = t), (this.systems = t.sys), (this.pluginKey = i), t.sys.events.once(r.BOOT, this.boot, this);
},
boot: function () {},
destroy: function () {
(this.pluginManager = null), (this.game = null), (this.scene = null), (this.systems = null);
},
});
t.exports = o;
},
function (t, e, i) {
t.exports = { Canvas: i(1406), Events: i(91), Snapshot: i(1407), WebGL: i(1408) };
},
function (t, e, i) {
t.exports = { CanvasRenderer: i(368), GetBlendModes: i(370), SetTransform: i(30) };
},
function (t, e, i) {
t.exports = { Canvas: i(369), WebGL: i(383) };
},
function (t, e, i) {
var n = i(107),
s = i(17)(!1, (s = { PipelineManager: i(372), Pipelines: i(1409), RenderTarget: i(141), Utils: i(12), WebGLPipeline: i(58), WebGLRenderer: i(371), WebGLShader: i(375) }), n);
t.exports = s;
},
function (t, e, i) {
var n = i(92),
s = i(17)(
!1,
(s = {
BitmapMaskPipeline: i(373),
Events: i(374),
GraphicsPipeline: i(376),
LightPipeline: i(377),
MultiPipeline: i(108),
PointLightPipeline: i(378),
PostFXPipeline: i(1410),
RopePipeline: i(379),
SinglePipeline: i(380),
UtilityPipeline: i(381),
}),
n
);
t.exports = s;
},
function (t, e, i) {
var n = i(0),
s = i(198),
r = i(2),
o = i(1411),
a = i(382),
h = i(58),
l = new n({
Extends: h,
initialize: function (t) {
(t.renderTarget = r(t, "renderTarget", 1)),
(t.fragShader = r(t, "fragShader", o)),
(t.vertShader = r(t, "vertShader", a)),
(t.attributes = r(t, "attributes", [
{ name: "inPosition", size: 2 },
{ name: "inTexCoord", size: 2 },
])),
(t.batchSize = 1),
(t.vertices = [-1, -1, 0, 0, -1, 1, 0, 1, 1, 1, 1, 1, -1, -1, 0, 0, 1, 1, 1, 1, 1, -1, 1, 0]),
h.call(this, t),
(this.isPostFX = !0),
this.gameObject,
(this.colorMatrix = new s()),
this.fullFrame1,
this.fullFrame2,
this.halfFrame1,
this.halfFrame2,
this.renderer.isBooted && ((this.manager = this.renderer.pipelines), this.boot());
},
boot: function () {
h.prototype.boot.call(this);
var t = this.manager.UTILITY_PIPELINE;
(this.fullFrame1 = t.fullFrame1), (this.fullFrame2 = t.fullFrame2), (this.halfFrame1 = t.halfFrame1), (this.halfFrame2 = t.halfFrame2), this.set1i("uMainSampler", 0);
},
onDraw: function (t) {
this.bindAndDraw(t);
},
copyFrame: function (t, e, i, n, s) {
this.manager.copyFrame(t, e, i, n, s);
},
copyToGame: function (t) {
this.manager.copyToGame(t);
},
drawFrame: function (t, e, i) {
this.manager.drawFrame(t, e, i, this.colorMatrix);
},
blendFrames: function (t, e, i, n, s) {
this.manager.blendFrames(t, e, i, n, s);
},
blendFramesAdditive: function (t, e, i, n, s) {
this.manager.blendFramesAdditive(t, e, i, n, s);
},
clearFrame: function (t, e) {
this.manager.clearFrame(t, e);
},
blitFrame: function (t, e, i, n, s, r) {
this.manager.blitFrame(t, e, i, n, s, r);
},
copyFrameRect: function (t, e, i, n, s, r, o, a) {
this.manager.copyFrameRect(t, e, i, n, s, r, o, a);
},
bindAndDraw: function (t, e, i, n, s) {
void 0 === i && (i = !0), void 0 === n && (n = !0);
var r = this.gl,
o = this.renderer;
this.bind(s),
this.set1i("uMainSampler", 0),
e
? (r.viewport(0, 0, e.width, e.height),
r.bindFramebuffer(r.FRAMEBUFFER, e.framebuffer),
r.framebufferTexture2D(r.FRAMEBUFFER, r.COLOR_ATTACHMENT0, r.TEXTURE_2D, e.texture, 0),
i && (n ? r.clearColor(0, 0, 0, 0) : r.clearColor(0, 0, 0, 1), r.clear(r.COLOR_BUFFER_BIT)))
: (o.popFramebuffer(!1, !1, !1), o.currentFramebuffer || r.viewport(0, 0, o.width, o.height)),
r.activeTexture(r.TEXTURE0),
r.bindTexture(r.TEXTURE_2D, t.texture),
r.bufferData(r.ARRAY_BUFFER, this.vertexData, r.STATIC_DRAW),
r.drawArrays(r.TRIANGLES, 0, 6),
e ? (r.bindTexture(r.TEXTURE_2D, null), r.bindFramebuffer(r.FRAMEBUFFER, null)) : o.resetTextures();
},
});
t.exports = l;
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_POSTFX_FS",
"",
"precision mediump float;",
"",
"uniform sampler2D uMainSampler;",
"",
"varying vec2 outTexCoord;",
"",
"void main ()",
"{",
" gl_FragColor = texture2D(uMainSampler, outTexCoord);",
"}",
"",
].join("\n");
},
function (t, e, i) {
var n = i(17),
s = i(201),
r = n(!1, (r = { Center: i(403), Events: i(104), Orientation: i(404), ScaleManager: i(415), ScaleModes: i(405), Zoom: i(406) }), s.CENTER);
(r = n(!1, (r = n(!1, (r = n(!1, r, s.ORIENTATION)), s.SCALE_MODE)), s.ZOOM)), (t.exports = r);
},
function (t, e, i) {
var n = i(144),
s = i(17)(!1, (s = { Events: i(20), GetPhysicsPlugins: i(419), GetScenePlugins: i(420), SceneManager: i(417), ScenePlugin: i(1414), Settings: i(421), Systems: i(204) }), n);
t.exports = s;
},
function (t, e, i) {
var n = i(18),
s = i(0),
a = i(20),
h = i(2),
r = i(24),
o = new s({
initialize: function (t) {
(this.scene = t),
(this.systems = t.sys),
(this.settings = t.sys.settings),
(this.key = t.sys.settings.key),
(this.manager = t.sys.game.scene),
(this.transitionProgress = 0),
(this._elapsed = 0),
(this._target = null),
(this._duration = 0),
this._onUpdate,
this._onUpdateScope,
(this._willSleep = !1),
(this._willRemove = !1),
t.sys.events.once(a.BOOT, this.boot, this),
t.sys.events.on(a.START, this.pluginStart, this);
},
boot: function () {
this.systems.events.once(a.DESTROY, this.destroy, this);
},
pluginStart: function () {
(this._target = null), this.systems.events.once(a.SHUTDOWN, this.shutdown, this);
},
start: function (t, e) {
return void 0 === t && (t = this.key), this.manager.queueOp("stop", this.key), this.manager.queueOp("start", t, e), this;
},
restart: function (t) {
var e = this.key;
return this.manager.queueOp("stop", e), this.manager.queueOp("start", e, t), this;
},
transition: function (t) {
void 0 === t && (t = {});
var e = h(t, "target", !1),
i = this.manager.getScene(e);
if (!e || !this.checkValidTransition(i)) return !1;
var n = h(t, "duration", 1e3);
(this._elapsed = 0), (this._target = i), (this._duration = n), (this._willSleep = h(t, "sleep", !1)), (this._willRemove = h(t, "remove", !1));
var s = h(t, "onUpdate", null);
s && ((this._onUpdate = s), (this._onUpdateScope = h(t, "onUpdateScope", this.scene)));
var r = h(t, "allowInput", !1);
this.settings.transitionAllowInput = r;
var o = i.sys.settings;
return (
(o.isTransition = !0),
(o.transitionFrom = this.scene),
(o.transitionDuration = n),
(o.transitionAllowInput = r),
h(t, "moveAbove", !1) ? this.manager.moveAbove(this.key, e) : h(t, "moveBelow", !1) && this.manager.moveBelow(this.key, e),
i.sys.isSleeping() ? i.sys.wake(h(t, "data")) : this.manager.start(e, h(t, "data")),
this.systems.events.emit(a.TRANSITION_OUT, i, n),
this.systems.events.on(a.UPDATE, this.step, this),
!0
);
},
checkValidTransition: function (t) {
return !(!t || t.sys.isActive() || t.sys.isTransitioning() || t === this.scene || this.systems.isTransitioning());
},
step: function (t, e) {
(this._elapsed += e),
(this.transitionProgress = n(this._elapsed / this._duration, 0, 1)),
this._onUpdate && this._onUpdate.call(this._onUpdateScope, this.transitionProgress),
this._elapsed >= this._duration && this.transitionComplete();
},
transitionComplete: function () {
var t = this._target.sys,
e = this._target.sys.settings;
this.systems.events.off(a.UPDATE, this.step, this),
t.events.emit(a.TRANSITION_COMPLETE, this.scene),
(e.isTransition = !1),
(e.transitionFrom = null),
(this._duration = 0),
(this._target = null),
(this._onUpdate = null),
(this._onUpdateScope = null),
this._willRemove ? this.manager.remove(this.key) : this._willSleep ? this.systems.sleep() : this.manager.stop(this.key);
},
add: function (t, e, i, n) {
return this.manager.add(t, e, i, n);
},
launch: function (t, e) {
return t && t !== this.key && this.manager.queueOp("start", t, e), this;
},
run: function (t, e) {
return t && t !== this.key && this.manager.queueOp("run", t, e), this;
},
pause: function (t, e) {
return void 0 === t && (t = this.key), this.manager.queueOp("pause", t, e), this;
},
resume: function (t, e) {
return void 0 === t && (t = this.key), this.manager.queueOp("resume", t, e), this;
},
sleep: function (t, e) {
return void 0 === t && (t = this.key), this.manager.queueOp("sleep", t, e), this;
},
wake: function (t, e) {
return void 0 === t && (t = this.key), this.manager.queueOp("wake", t, e), this;
},
switch: function (t) {
return t !== this.key && this.manager.queueOp("switch", this.key, t), this;
},
stop: function (t, e) {
return void 0 === t && (t = this.key), this.manager.queueOp("stop", t, e), this;
},
setActive: function (t, e, i) {
void 0 === e && (e = this.key);
var n = this.manager.getScene(e);
return n && n.sys.setActive(t, i), this;
},
setVisible: function (t, e) {
void 0 === e && (e = this.key);
var i = this.manager.getScene(e);
return i && i.sys.setVisible(t), this;
},
isSleeping: function (t) {
return void 0 === t && (t = this.key), this.manager.isSleeping(t);
},
isActive: function (t) {
return void 0 === t && (t = this.key), this.manager.isActive(t);
},
isPaused: function (t) {
return void 0 === t && (t = this.key), this.manager.isPaused(t);
},
isVisible: function (t) {
return void 0 === t && (t = this.key), this.manager.isVisible(t);
},
swapPosition: function (t, e) {
return void 0 === e && (e = this.key), t !== e && this.manager.swapPosition(t, e), this;
},
moveAbove: function (t, e) {
return void 0 === e && (e = this.key), t !== e && this.manager.moveAbove(t, e), this;
},
moveBelow: function (t, e) {
return void 0 === e && (e = this.key), t !== e && this.manager.moveBelow(t, e), this;
},
remove: function (t) {
return void 0 === t && (t = this.key), this.manager.remove(t), this;
},
moveUp: function (t) {
return void 0 === t && (t = this.key), this.manager.moveUp(t), this;
},
moveDown: function (t) {
return void 0 === t && (t = this.key), this.manager.moveDown(t), this;
},
bringToTop: function (t) {
return void 0 === t && (t = this.key), this.manager.bringToTop(t), this;
},
sendToBack: function (t) {
return void 0 === t && (t = this.key), this.manager.sendToBack(t), this;
},
get: function (t) {
return this.manager.getScene(t);
},
getIndex: function (t) {
return void 0 === t && (t = this.key), this.manager.getIndex(t);
},
shutdown: function () {
var t = this.systems.events;
t.off(a.SHUTDOWN, this.shutdown, this), t.off(a.POST_UPDATE, this.step, this), t.off(a.TRANSITION_OUT);
},
destroy: function () {
this.shutdown(), this.scene.sys.events.off(a.START, this.start, this), (this.scene = null), (this.systems = null), (this.settings = null), (this.manager = null);
},
});
r.register("ScenePlugin", o, "scenePlugin"), (t.exports = o);
},
function (t, e, i) {
t.exports = { Events: i(438), List: i(110), Map: i(102), ProcessQueue: i(211), RTree: i(531), Set: i(149), Size: i(416) };
},
function (t, e, i) {
var n = i(17),
s = i(1417),
r = n(!1, (r = { CanvasTexture: i(423), Events: i(106), FilterMode: s, Frame: i(109), Parsers: i(425), Texture: i(206), TextureManager: i(422), TextureSource: i(424) }), s);
t.exports = r;
},
function (t, e) {
t.exports = { LINEAR: 0, NEAREST: 1 };
},
function (t, e, i) {
var n = i(17),
s = i(1419),
r = n(
!1,
(r = {
Components: i(251),
Parsers: i(1452),
Formats: i(40),
ImageCollection: i(576),
ParseToTilemap: i(262),
Tile: i(85),
Tilemap: i(580),
TilemapCreator: i(1459),
TilemapFactory: i(1460),
Tileset: i(122),
TilemapLayer: i(581),
Orientation: i(29),
LayerData: i(120),
MapData: i(121),
ObjectLayer: i(572),
}),
s.ORIENTATION
);
t.exports = r;
},
function (t, e, i) {
var n = { ORIENTATION: i(29) };
t.exports = n;
},
function (t, e, i) {
var p = i(26),
g = i(63);
t.exports = function (t, e, i, n, s, r, o, a) {
void 0 === o && (o = !0), t < 0 && (t = 0), e < 0 && (e = 0);
for (var h = p(t, e, i, n, null, a), l = s - t, u = r - e, c = 0; c < h.length; c++) {
var d = h[c].x + l,
f = h[c].y + u;
0 <= d && d < a.width && 0 <= f && f < a.height && a.data[f][d] && a.data[f][d].copy(h[c]);
}
o && g(s - 1, r - 1, i + 2, n + 2, a);
};
},
function (t, e, i) {
var d = i(26),
f = i(542);
t.exports = function (t, e, i, n, s, r) {
(i = i || {}), Array.isArray(t) || (t = [t]);
var o = r.tilemapLayer;
(n = n || o.scene), (s = s || n.cameras.main);
for (var a = d(0, 0, r.width, r.height, null, r), h = [], l = 0; l < a.length; l++) {
var u,
c = a[l];
-1 !== t.indexOf(c.index) && ((u = o.tileToWorldXY(c.x, c.y, void 0, s, r)), (i.x = u.x), (i.y = u.y), h.push(n.make.sprite(i)));
}
if ("number" == typeof e) for (l = 0; l < t.length; l++) f(t[l], e, 0, 0, r.width, r.height, r);
else if (Array.isArray(e)) for (l = 0; l < t.length; l++) f(t[l], e[l], 0, 0, r.width, r.height, r);
return h;
};
},
function (t, e, i) {
var u = i(26),
c = i(63),
d = i(72);
t.exports = function (t, e, i, n, s, r, o) {
for (var a = -1 !== o.collideIndexes.indexOf(t), h = u(e, i, n, s, null, o), l = 0; l < h.length; l++) (h[l].index = t), d(h[l], a);
r && c(e - 1, i - 1, n + 2, s + 2, o);
};
},
function (t, e, i) {
var h = i(26);
t.exports = function (t, e, i, n, s, r, o, a) {
return h(i, n, s, r, o, a).filter(t, e);
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
void 0 === e && (e = 0), void 0 === i && (i = !1);
var s,
r,
o,
a = 0;
if (i) {
for (r = n.height - 1; 0 <= r; r--)
for (s = n.width - 1; 0 <= s; s--)
if ((o = n.data[r][s]) && o.index === t) {
if (a === e) return o;
a += 1;
}
} else
for (r = 0; r < n.height; r++)
for (s = 0; s < n.width; s++)
if ((o = n.data[r][s]) && o.index === t) {
if (a === e) return o;
a += 1;
}
return null;
};
},
function (t, e, i) {
var h = i(26);
t.exports = function (t, e, i, n, s, r, o, a) {
return h(i, n, s, r, o, a).find(t, e) || null;
};
},
function (t, e, i) {
var h = i(26);
t.exports = function (t, e, i, n, s, r, o, a) {
h(i, n, s, r, o, a).forEach(t, e);
};
},
function (t, e, i) {
var n = i(29),
s = i(544),
r = i(545),
o = i(547),
a = i(1),
h = i(548);
t.exports = function (t) {
return t === n.ORTHOGONAL ? s : t === n.HEXAGONAL ? r : t === n.STAGGERED ? h : t === n.ISOMETRIC ? o : a;
};
},
function (t, e, i) {
var r = i(158),
o = new (i(3))();
t.exports = function (t, e, i, n, s) {
return s.tilemapLayer.worldToTileXY(t, e, !0, o, n), r(o.x, o.y, i, s);
};
},
function (t, e, i) {
function m(t, e) {
return w.RectangleToTriangle(e, t);
}
var x = i(483),
b = i(26),
w = i(484),
T = i(1),
n = i(3),
S = new n(),
_ = new n(),
E = new n();
t.exports = function (t, e, i, n) {
if (void 0 === t) return [];
var s = T;
t instanceof x.Circle ? (s = w.CircleToRectangle) : t instanceof x.Rectangle ? (s = w.RectangleToRectangle) : t instanceof x.Triangle ? (s = m) : t instanceof x.Line && (s = w.LineToRectangle),
n.tilemapLayer.worldToTileXY(t.left, t.top, !0, _, i);
var r = _.x,
o = _.y;
n.tilemapLayer.worldToTileXY(t.right, t.bottom, !0, E, i);
var a = Math.ceil(E.x),
h = Math.ceil(E.y),
l = Math.max(a - r, 1),
u = Math.max(h - o, 1),
c = b(r, o, l, u, e, n),
d = n.tileWidth,
f = n.tileHeight;
n.tilemapLayer && ((d *= n.tilemapLayer.scaleX), (f *= n.tilemapLayer.scaleY));
for (var p = [], g = new x.Rectangle(0, 0, d, f), v = 0; v < c.length; v++) {
var y = c[v];
n.tilemapLayer.tileToWorldXY(y.x, y.y, S, i), (g.x = S.x), (g.y = S.y), s(t, g) && p.push(y);
}
return p;
};
},
function (t, e, i) {
var n = i(29),
s = i(1),
r = i(253);
t.exports = function (t) {
return t === n.ORTHOGONAL ? r : s;
};
},
function (t, e, i) {
var n = i(29),
s = i(550),
r = i(551),
o = i(1),
a = i(552),
h = i(553);
t.exports = function (t) {
return t === n.ORTHOGONAL ? h : t === n.ISOMETRIC ? r : t === n.HEXAGONAL ? s : t === n.STAGGERED ? a : o;
};
},
function (t, e, i) {
var n = i(29),
s = i(554),
r = i(1),
o = i(555),
a = i(254);
t.exports = function (t) {
return t === n.ORTHOGONAL ? a : t === n.HEXAGONAL ? s : t === n.STAGGERED ? o : r;
};
},
function (t, e, i) {
var n = i(29),
s = i(1),
r = i(255);
t.exports = function (t) {
return t === n.ORTHOGONAL ? r : s;
};
},
function (t, e, i) {
var n = i(29),
s = i(556),
r = i(557),
o = i(1),
a = i(558),
h = i(559);
t.exports = function (t) {
return t === n.ORTHOGONAL ? h : t === n.ISOMETRIC ? r : t === n.HEXAGONAL ? s : t === n.STAGGERED ? a : o;
};
},
function (t, e, i) {
var n = i(29),
s = i(560),
r = i(1),
o = i(561),
a = i(256);
t.exports = function (t) {
return t === n.ORTHOGONAL ? a : t === n.HEXAGONAL ? s : t === n.STAGGERED ? o : r;
};
},
function (t, e, i) {
var o = i(562),
a = new (i(3))();
t.exports = function (t, e, i, n) {
n.tilemapLayer.worldToTileXY(t, e, !0, a, i);
var s = a.x,
r = a.y;
return o(s, r, n);
};
},
function (t, e, i) {
var o = i(257),
a = new (i(3))();
t.exports = function (t, e, i, n, s, r) {
return r.tilemapLayer.worldToTileXY(e, i, !0, a, s, r), o(t, a.x, a.y, n, r);
};
},
function (t, e, i) {
var u = i(63),
c = i(257);
t.exports = function (t, e, i, n, s) {
if ((void 0 === n && (n = !0), !Array.isArray(t))) return null;
Array.isArray(t[0]) || (t = [t]);
for (var r = t.length, o = t[0].length, a = 0; a < r; a++)
for (var h = 0; h < o; h++) {
var l = t[a][h];
c(l, e + h, i + a, !1, s);
}
n && u(e - 1, i - 1, o + 2, r + 2, s);
};
},
function (t, e, i) {
var h = i(26),
l = i(210);
t.exports = function (t, e, i, n, s, r) {
var o,
a = h(t, e, i, n, {}, r);
if (!s) for (s = [], o = 0; o < a.length; o++) -1 === s.indexOf(a[o].index) && s.push(a[o].index);
for (o = 0; o < a.length; o++) a[o].index = l(s);
};
},
function (t, e, i) {
var o = i(563),
a = new (i(3))();
t.exports = function (t, e, i, n, s, r) {
return r.tilemapLayer.worldToTileXY(t, e, !0, a, s, r), o(a.x, a.y, i, n, r);
};
},
function (t, e, i) {
var p = i(26),
n = i(397),
g = new n(105, 210, 231, 150),
v = new n(243, 134, 48, 200),
y = new n(40, 39, 37, 150);
t.exports = function (t, e, i) {
void 0 === e && (e = {});
var n = void 0 !== e.tileColor ? e.tileColor : g,
s = void 0 !== e.collidingTileColor ? e.collidingTileColor : v,
r = void 0 !== e.faceColor ? e.faceColor : y,
o = p(0, 0, i.width, i.height, null, i);
t.translateCanvas(i.tilemapLayer.x, i.tilemapLayer.y), t.scaleCanvas(i.tilemapLayer.scaleX, i.tilemapLayer.scaleY);
for (var a = 0; a < o.length; a++) {
var h = o[a],
l = h.width,
u = h.height,
c = h.pixelX,
d = h.pixelY,
f = h.collides ? s : n;
null !== f && (t.fillStyle(f.color, f.alpha / 255), t.fillRect(c, d, l, u)),
(c += 1),
(d += 1),
(l -= 2),
(u -= 2),
null !== r &&
(t.lineStyle(1, r.color, r.alpha / 255),
h.faceTop && t.lineBetween(c, d, c + l, d),
h.faceRight && t.lineBetween(c + l, d, c + l, d + u),
h.faceBottom && t.lineBetween(c, d + u, c + l, d + u),
h.faceLeft && t.lineBetween(c, d, c, d + u));
}
};
},
function (t, e, i) {
var l = i(72),
u = i(63),
c = i(160);
t.exports = function (t, e, i, n, s) {
void 0 === e && (e = !0), void 0 === i && (i = !0), void 0 === s && (s = !0), Array.isArray(t) || (t = [t]);
for (var r = 0; r < t.length; r++) c(t[r], e, n);
if (s)
for (var o = 0; o < n.height; o++)
for (var a = 0; a < n.width; a++) {
var h = n.data[o][a];
h && -1 !== t.indexOf(h.index) && l(h, e);
}
i && u(0, 0, n.width, n.height, n);
};
},
function (t, e, i) {
var u = i(72),
c = i(63),
d = i(160);
t.exports = function (t, e, i, n, s, r) {
if ((void 0 === i && (i = !0), void 0 === n && (n = !0), void 0 === r && (r = !0), !(e < t))) {
for (var o = t; o <= e; o++) d(o, i, s);
if (r)
for (var a = 0; a < s.height; a++)
for (var h = 0; h < s.width; h++) {
var l = s.data[a][h];
l && l.index >= t && l.index <= e && u(l, i);
}
n && c(0, 0, s.width, s.height, s);
}
};
},
function (t, e, i) {
var a = i(72),
h = i(63),
l = i(160);
t.exports = function (t, e, i, n) {
void 0 === e && (e = !0), void 0 === i && (i = !0), Array.isArray(t) || (t = [t]);
for (var s = 0; s < n.height; s++)
for (var r = 0; r < n.width; r++) {
var o = n.data[s][r];
o && -1 === t.indexOf(o.index) && (a(o, e), l(o.index, e, n));
}
i && h(0, 0, n.width, n.height, n);
};
},
function (t, e, i) {
var u = i(72),
c = i(63),
d = i(126);
t.exports = function (t, e, i, n) {
void 0 === e && (e = !0), void 0 === i && (i = !0);
for (var s = 0; s < n.height; s++)
for (var r = 0; r < n.width; r++) {
var o = n.data[s][r];
if (o)
for (var a in t)
if (d(o.properties, a)) {
var h = t[a];
Array.isArray(h) || (h = [h]);
for (var l = 0; l < h.length; l++) o.properties[a] === h[l] && u(o, e);
}
}
i && c(0, 0, n.width, n.height, n);
};
},
function (t, e, i) {
var a = i(72),
h = i(63);
t.exports = function (t, e, i) {
void 0 === t && (t = !0), void 0 === e && (e = !0);
for (var n = 0; n < i.height; n++)
for (var s = 0; s < i.width; s++) {
var r,
o = i.data[n][s];
o && (r = o.getCollisionGroup()) && r.objects && 0 < r.objects.length && a(o, t);
}
e && h(0, 0, i.width, i.height, i);
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
if ("number" == typeof t) n.callbacks[t] = null !== e ? { callback: e, callbackContext: i } : void 0;
else for (var s = 0, r = t.length; s < r; s++) n.callbacks[t[s]] = null !== e ? { callback: e, callbackContext: i } : void 0;
};
},
function (t, e, i) {
var l = i(26);
t.exports = function (t, e, i, n, s, r, o) {
for (var a = l(t, e, i, n, null, o), h = 0; h < a.length; h++) a[h].setCollisionCallback(s, r);
};
},
function (t, e, i) {
var h = i(26),
l = i(131);
t.exports = function (t, e, i, n, s) {
var r = h(t, e, i, n, null, s),
o = r.map(function (t) {
return t.index;
});
l(o);
for (var a = 0; a < r.length; a++) r[a].index = o[a];
};
},
function (t, e, i) {
var l = i(26);
t.exports = function (t, e, i, n, s, r, o) {
for (var a = l(i, n, s, r, null, o), h = 0; h < a.length; h++) a[h] && (a[h].index === t ? (a[h].index = e) : a[h].index === e && (a[h].index = t));
};
},
function (t, e, i) {
var p = i(26);
t.exports = function (t, e, i, n, s, r) {
if (s) {
for (var o = p(t, e, i, n, null, r), a = 0, h = 0; h < s.length; h++) a += s[h].weight;
if (!(a <= 0))
for (h = 0; h < o.length; h++) {
for (var l = Math.random() * a, u = 0, c = -1, d = 0; d < s.length; d++)
if (l <= (u += s[d].weight)) {
var f = s[d].index;
c = Array.isArray(f) ? f[Math.floor(Math.random() * f.length)] : f;
break;
}
o[h].index = c;
}
}
};
},
function (t, e, i) {
t.exports = { FromOrientationString: i(258), Parse: i(564), Parse2DArray: i(259), ParseCSV: i(565), Impact: i(1454), Tiled: i(1455) };
},
function (t, e) {
t.exports = function (t, e) {
for (var i = 0; i < t.length; i++) {
var n = t[i],
s = i;
if ((n.name && "" !== n.name && (s = n.name), Array.isArray(n.wangtiles) && 0 < n.wangtiles.length)) {
var r,
o,
a,
h = {},
l = {};
if (Array.isArray(n.edgecolors)) for (r = 0; r < n.edgecolors.length; r++) (a = 1 + r), "" !== (o = n.edgecolors[r]).name && (h[a] = o.name);
if (Array.isArray(n.cornercolors)) for (r = 0; r < n.cornercolors.length; r++) (a = 1 + r), "" !== (o = n.cornercolors[r]).name && (l[a] = o.name);
if (Array.isArray(n.colors)) for (r = 0; r < n.colors.length; r++) (a = 1 + r), "" !== (o = n.colors[r]).name && (h[a] = l[a] = o.name);
for (var u = [h, l, h, l, h, l, h, l], c = 0; c < n.wangtiles.length; c++) {
for (var d, f = n.wangtiles[c], p = (p = e[f.tileid] || (e[f.tileid] = {})).wangid || (p.wangid = {}), g = [], v = 0; v < Math.min(u.length, f.wangid.length); v++)
0 !== (o = f.wangid[v]) ? (void 0 === (d = u[v][o]) ? g.push(o) : g.push(d)) : g.push(void 0);
p[s] = g;
}
}
}
};
},
function (t, e, i) {
t.exports = { ParseTileLayers: i(578), ParseTilesets: i(579), ParseWeltmeister: i(577) };
},
function (t, e, i) {
t.exports = {
AssignTileProperties: i(567),
Base64Decode: i(574),
BuildTilesetIndex: i(568),
CreateGroupLayer: i(161),
ParseGID: i(261),
ParseImageLayers: i(569),
ParseJSONTiled: i(566),
ParseObject: i(260),
ParseObjectLayers: i(570),
ParseTileLayers: i(573),
ParseTilesets: i(575),
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1457)), (s = i(1458));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e, i) {
var M = i(12);
t.exports = function (t, e, i) {
var n = e.cull(i),
s = n.length,
r = i.alpha * e.alpha;
if (!(0 === s || r <= 0)) {
var o = e.gidMap,
a = t.pipelines.set(e.pipeline, e),
h = M.getTintAppendFloatAlpha,
l = e.scrollFactorX,
u = e.scrollFactorY,
c = e.x,
d = e.y,
f = e.scaleX,
p = e.scaleY;
t.pipelines.preBatch(e);
for (var g = 0; g < s; g++) {
var v,
y,
m,
x,
b,
w,
T,
S,
_,
E,
P = n[g],
A = o[P.index];
A &&
null !== (v = A.getTileTextureCoordinates(P.index)) &&
((y = A.glTexture),
(m = a.setTexture2D(y, e)),
(x = A.tileWidth),
(b = A.tileHeight),
(w = v.x),
(T = v.y),
(S = 0.5 * A.tileWidth),
(_ = 0.5 * A.tileHeight),
(E = h(P.tint, r * P.alpha)),
a.batchTexture(
e,
y,
y.width,
y.height,
c + (S + P.pixelX) * f,
d + (_ + P.pixelY) * p,
P.width,
P.height,
f,
p,
P.rotation,
P.flipX,
P.flipY,
l,
u,
S,
_,
w,
T,
x,
b,
E,
E,
E,
E,
!1,
0,
0,
i,
null,
!0,
m
));
}
t.pipelines.postBatch(e);
}
};
},
function (t, e, i) {
var n = i(25),
w = new n(),
T = new n(),
S = new n();
t.exports = function (t, e, i, n) {
var s = e.cull(i),
r = s.length,
o = i.alpha * e.alpha;
if (!(0 === r || o <= 0)) {
var a = w,
h = T,
l = S;
h.applyITRS(e.x, e.y, e.rotation, e.scaleX, e.scaleY), a.copyFrom(i.matrix);
var u = t.currentContext,
c = e.gidMap;
u.save(),
n
? (a.multiplyWithOffset(n, -i.scrollX * e.scrollFactorX, -i.scrollY * e.scrollFactorY), (h.e = e.x), (h.f = e.y), a.multiply(h, l), l.copyToContext(u))
: ((h.e -= i.scrollX * e.scrollFactorX), (h.f -= i.scrollY * e.scrollFactorY), h.copyToContext(u)),
(!t.antialias || 1 < e.scaleX || 1 < e.scaleY) && (u.imageSmoothingEnabled = !1);
for (var d = 0; d < r; d++) {
var f,
p,
g,
v,
y,
m,
x = s[d],
b = c[x.index];
b &&
((f = b.image.getSourceImage()),
null !== (p = b.getTileTextureCoordinates(x.index)) &&
((y = 0.5 * (g = b.tileWidth)),
(m = 0.5 * (v = b.tileHeight)),
u.save(),
u.translate(x.pixelX + y, x.pixelY + m),
0 !== x.rotation && u.rotate(x.rotation),
(x.flipX || x.flipY) && u.scale(x.flipX ? -1 : 1, x.flipY ? -1 : 1),
(u.globalAlpha = o * x.alpha),
u.drawImage(f, p.x, p.y, g, v, -y, -m, g, v),
u.restore()));
}
u.restore();
}
};
},
function (t, e, i) {
var n = i(16),
s = i(262);
n.register("tilemap", function (t) {
var e = void 0 !== t ? t : {};
return s(this.scene, e.key, e.tileWidth, e.tileHeight, e.width, e.height, e.data, e.insertNull);
});
},
function (t, e, i) {
var n = i(5),
a = i(262);
n.register("tilemap", function (t, e, i, n, s, r, o) {
return null === t && (t = void 0), null === e && (e = void 0), null === i && (i = void 0), null === n && (n = void 0), null === s && (s = void 0), a(this.scene, t, e, i, n, s, r, o);
});
},
function (t, e, i) {
t.exports = { Clock: i(1462), TimerEvent: i(582) };
},
function (t, e, i) {
var n = i(0),
s = i(24),
r = i(20),
o = i(582),
a = i(93),
h = new n({
initialize: function (t) {
(this.scene = t),
(this.systems = t.sys),
(this.now = 0),
(this.timeScale = 1),
(this.paused = !1),
(this._active = []),
(this._pendingInsertion = []),
(this._pendingRemoval = []),
t.sys.events.once(r.BOOT, this.boot, this),
t.sys.events.on(r.START, this.start, this);
},
boot: function () {
(this.now = this.systems.game.loop.time), this.systems.events.once(r.DESTROY, this.destroy, this);
},
start: function () {
var t = this.systems.events;
t.on(r.PRE_UPDATE, this.preUpdate, this), t.on(r.UPDATE, this.update, this), t.once(r.SHUTDOWN, this.shutdown, this);
},
addEvent: function (t) {
var e;
return (
t instanceof o ? ((e = t), this.removeEvent(e), (e.elapsed = e.startAt), (e.hasDispatched = !1), (e.repeatCount = -1 === e.repeat || e.loop ? 999999999999 : e.repeat)) : (e = new o(t)),
this._pendingInsertion.push(e),
e
);
},
delayedCall: function (t, e, i, n) {
return this.addEvent({ delay: t, callback: e, args: i, callbackScope: n });
},
clearPendingEvents: function () {
return (this._pendingInsertion = []), this;
},
removeEvent: function (t) {
Array.isArray(t) || (t = [t]);
for (var e = 0; e < t.length; e++) {
var i = t[e];
a(this._pendingRemoval, i), a(this._pendingInsertion, i), a(this._active, i);
}
return this;
},
removeAllEvents: function () {
return (this._pendingRemoval = this._pendingRemoval.concat(this._active)), this;
},
preUpdate: function () {
var t = this._pendingRemoval.length,
e = this._pendingInsertion.length;
if (0 !== t || 0 !== e) {
for (var i, n = 0; n < t; n++) {
i = this._pendingRemoval[n];
var s = this._active.indexOf(i);
-1 < s && this._active.splice(s, 1), i.destroy();
}
for (n = 0; n < e; n++) (i = this._pendingInsertion[n]), this._active.push(i);
(this._pendingRemoval.length = 0), (this._pendingInsertion.length = 0);
}
},
update: function (t, e) {
if (((this.now = t), !this.paused)) {
e *= this.timeScale;
for (var i = 0; i < this._active.length; i++) {
var n,
s = this._active[i];
s.paused ||
((s.elapsed += e * s.timeScale),
s.elapsed >= s.delay &&
((n = s.elapsed - s.delay),
(s.elapsed = s.delay),
!s.hasDispatched && s.callback && ((s.hasDispatched = !0), s.callback.apply(s.callbackScope, s.args)),
0 < s.repeatCount ? (s.repeatCount--, (s.elapsed = n), (s.hasDispatched = !1)) : this._pendingRemoval.push(s)));
}
}
},
shutdown: function () {
for (var t = 0; t < this._pendingInsertion.length; t++) this._pendingInsertion[t].destroy();
for (t = 0; t < this._active.length; t++) this._active[t].destroy();
for (t = 0; t < this._pendingRemoval.length; t++) this._pendingRemoval[t].destroy();
(this._active.length = 0), (this._pendingRemoval.length = 0), (this._pendingInsertion.length = 0);
var e = this.systems.events;
e.off(r.PRE_UPDATE, this.preUpdate, this), e.off(r.UPDATE, this.update, this), e.off(r.SHUTDOWN, this.shutdown, this);
},
destroy: function () {
this.shutdown(), this.scene.sys.events.off(r.START, this.start, this), (this.scene = null), (this.systems = null);
},
});
s.register("Clock", h, "time"), (t.exports = h);
},
function (t, e, i) {
var n = i(100),
s = i(17)(!1, (s = { Builders: i(1464), Events: i(267), TweenManager: i(1480), Tween: i(266), TweenData: i(268), Timeline: i(588) }), n);
t.exports = s;
},
function (t, e, i) {
t.exports = {
GetBoolean: i(99),
GetEaseFunction: i(80),
GetNewValue: i(162),
GetProps: i(583),
GetTargets: i(263),
GetTweens: i(584),
GetValueOp: i(264),
NumberTweenBuilder: i(585),
StaggerBuilder: i(586),
TimelineBuilder: i(587),
TweenBuilder: i(163),
};
},
function (t, e) {
t.exports = [
"callbackScope",
"completeDelay",
"delay",
"duration",
"ease",
"easeParams",
"flipX",
"flipY",
"hold",
"loop",
"loopDelay",
"offset",
"onActive",
"onActiveParams",
"onActiveScope",
"onComplete",
"onCompleteParams",
"onCompleteScope",
"onLoop",
"onLoopParams",
"onLoopScope",
"onRepeat",
"onRepeatParams",
"onRepeatScope",
"onStart",
"onStartParams",
"onStartScope",
"onStop",
"onStopParams",
"onStopScope",
"onUpdate",
"onUpdateParams",
"onUpdateScope",
"onYoyo",
"onYoyoParams",
"onYoyoScope",
"paused",
"props",
"repeat",
"repeatDelay",
"targets",
"useFrames",
"yoyo",
];
},
function (t, e) {
t.exports = "complete";
},
function (t, e) {
t.exports = "loop";
},
function (t, e) {
t.exports = "pause";
},
function (t, e) {
t.exports = "resume";
},
function (t, e) {
t.exports = "start";
},
function (t, e) {
t.exports = "update";
},
function (t, e) {
t.exports = "active";
},
function (t, e) {
t.exports = "complete";
},
function (t, e) {
t.exports = "loop";
},
function (t, e) {
t.exports = "repeat";
},
function (t, e) {
t.exports = "start";
},
function (t, e) {
t.exports = "stop";
},
function (t, e) {
t.exports = "update";
},
function (t, e) {
t.exports = "yoyo";
},
function (t, e, i) {
var n = i(93),
s = i(0),
r = i(585),
o = i(24),
a = i(20),
h = i(586),
l = i(587),
u = i(100),
c = i(163),
d = new s({
initialize: function (t) {
(this.scene = t),
(this.systems = t.sys),
(this.timeScale = 1),
(this._add = []),
(this._pending = []),
(this._active = []),
(this._destroy = []),
(this._toProcess = 0),
t.sys.events.once(a.BOOT, this.boot, this),
t.sys.events.on(a.START, this.start, this);
},
boot: function () {
this.systems.events.once(a.DESTROY, this.destroy, this);
},
start: function () {
var t = this.systems.events;
t.on(a.PRE_UPDATE, this.preUpdate, this), t.on(a.UPDATE, this.update, this), t.once(a.SHUTDOWN, this.shutdown, this), (this.timeScale = 1);
},
createTimeline: function (t) {
return l(this, t);
},
timeline: function (t) {
var e = l(this, t);
return e.paused || (this._add.push(e), this._toProcess++), e;
},
create: function (t) {
return c(this, t);
},
add: function (t) {
var e = c(this, t);
return this._add.push(e), this._toProcess++, e;
},
existing: function (t) {
return this._add.push(t), this._toProcess++, this;
},
addCounter: function (t) {
var e = r(this, t);
return this._add.push(e), this._toProcess++, e;
},
stagger: function (t, e) {
return h(t, e);
},
preUpdate: function () {
if (0 !== this._toProcess) {
for (var t, e = this._destroy, i = this._active, n = this._pending, s = 0; s < e.length; s++) {
t = e[s];
var r = i.indexOf(t);
-1 === r ? -1 < (r = n.indexOf(t)) && ((t.state = u.REMOVED), n.splice(r, 1)) : ((t.state = u.REMOVED), i.splice(r, 1));
}
for (e.length = 0, e = this._add, s = 0; s < e.length; s++) (t = e[s]).state === u.PENDING_ADD && (t.init() ? (t.play(), this._active.push(t)) : this._pending.push(t));
(e.length = 0), (this._toProcess = 0);
}
},
update: function (t, e) {
var i,
n = this._active;
e *= this.timeScale;
for (var s = 0; s < n.length; s++) (i = n[s]).update(t, e) && (this._destroy.push(i), this._toProcess++);
},
remove: function (t) {
return n(this._add, t), n(this._pending, t), n(this._active, t), n(this._destroy, t), (t.state = u.REMOVED), this;
},
makeActive: function (t) {
if (-1 !== this._add.indexOf(t) || -1 !== this._active.indexOf(t)) return this;
var e = this._pending.indexOf(t);
return -1 !== e && this._pending.splice(e, 1), this._add.push(t), (t.state = u.PENDING_ADD), this._toProcess++, this;
},
each: function (t, e) {
for (var i = [null], n = 1; n < arguments.length; n++) i.push(arguments[n]);
for (var s in this.list) (i[0] = this.list[s]), t.apply(e, i);
},
getAllTweens: function () {
for (var t = this._active, e = [], i = 0; i < t.length; i++) e.push(t[i]);
return e;
},
getGlobalTimeScale: function () {
return this.timeScale;
},
getTweensOf: function (t, e) {
void 0 === e && (e = !1);
var i,
n,
s,
r = this._active,
o = [];
for (Array.isArray(t) || (t = [t]), n = 0; n < r.length; n++) for (i = r[n], s = 0; s < t.length; s++) i.hasTarget(t[s]) && o.push(i);
if (e) for (r = this._pending, n = 0; n < r.length; n++) for (i = r[n], s = 0; s < t.length; s++) i.hasTarget(t[s]) && o.push(i);
return o;
},
isTweening: function (t) {
for (var e, i = this._active, n = 0; n < i.length; n++) if ((e = i[n]).hasTarget(t) && e.isPlaying()) return !0;
return !1;
},
killAll: function () {
for (var t = this.getAllTweens(), e = 0; e < t.length; e++) t[e].stop();
return this;
},
killTweensOf: function (t) {
for (var e = this.getTweensOf(t), i = 0; i < e.length; i++) e[i].stop();
return this;
},
pauseAll: function () {
for (var t = this._active, e = 0; e < t.length; e++) t[e].pause();
return this;
},
resumeAll: function () {
for (var t = this._active, e = 0; e < t.length; e++) t[e].resume();
return this;
},
setGlobalTimeScale: function (t) {
return (this.timeScale = t), this;
},
shutdown: function () {
this.killAll(), (this._add = []), (this._pending = []), (this._active = []), (this._destroy = []), (this._toProcess = 0);
var t = this.systems.events;
t.off(a.PRE_UPDATE, this.preUpdate, this), t.off(a.UPDATE, this.update, this), t.off(a.SHUTDOWN, this.shutdown, this);
},
destroy: function () {
this.shutdown(), this.scene.sys.events.off(a.START, this.start, this), (this.scene = null), (this.systems = null);
},
});
o.register("TweenManager", d, "tweens"), (t.exports = d);
},
function (t, e, i) {
t.exports = { Array: i(208), Base64: i(1482), Objects: i(1484), String: i(1488), NOOP: i(1) };
},
function (t, e, i) {
t.exports = { ArrayBufferToBase64: i(1483), Base64ToArrayBuffer: i(433) };
},
function (t, e) {
var o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
t.exports = function (t, e) {
for (var i = new Uint8Array(t), n = i.length, s = e ? "data:" + e + ";base64," : "", r = 0; r < n; r += 3)
(s += o[i[r] >> 2]), (s += o[((3 & i[r]) << 4) | (i[r + 1] >> 4)]), (s += o[((15 & i[r + 1]) << 2) | (i[r + 2] >> 6)]), (s += o[63 & i[r + 2]]);
return n % 3 == 2 ? (s = s.substring(0, s.length - 1) + "=") : n % 3 == 1 && (s = s.substring(0, s.length - 2) + "=="), s;
};
},
function (t, e, i) {
t.exports = {
Clone: i(77),
DeepCopy: i(175),
Extend: i(17),
GetAdvancedValue: i(13),
GetFastValue: i(2),
GetMinMaxValue: i(1485),
GetValue: i(6),
HasAll: i(1486),
HasAny: i(455),
HasValue: i(126),
IsPlainObject: i(7),
Merge: i(127),
MergeRight: i(1487),
Pick: i(571),
SetValue: i(478),
};
},
function (t, e, i) {
var o = i(6),
a = i(18);
t.exports = function (t, e, i, n, s) {
void 0 === s && (s = i);
var r = o(t, e, s);
return a(r, i, n);
};
},
function (t, e) {
t.exports = function (t, e) {
for (var i = 0; i < e.length; i++) if (!t.hasOwnProperty(e[i])) return !1;
return !0;
};
},
function (t, e, i) {
var s = i(77);
t.exports = function (t, e) {
var i = s(t);
for (var n in e) i.hasOwnProperty(n) && (i[n] = e[n]);
return i;
};
},
function (t, e, i) {
t.exports = { Format: i(1489), Pad: i(186), RemoveAt: i(1490), Reverse: i(1491), UppercaseFirst: i(205), UUID: i(222) };
},
function (t, e) {
t.exports = function (t, i) {
return t.replace(/%([0-9]+)/g, function (t, e) {
return i[Number(e) - 1];
});
};
},
function (t, e) {
t.exports = function (t, e) {
return 0 === e ? t.slice(1) : t.slice(0, e - 1) + t.slice(e);
};
},
function (t, e) {
t.exports = function (t) {
return t.split("").reverse().join("");
};
},
function (t, e, i) {
t.exports = {
SoundManagerCreator: i(426),
Events: i(70),
BaseSound: i(146),
BaseSoundManager: i(145),
WebAudioSound: i(434),
WebAudioSoundManager: i(432),
HTML5AudioSound: i(429),
HTML5AudioSoundManager: i(427),
NoAudioSound: i(431),
NoAudioSoundManager: i(430),
};
},
function (t, e, i) {
t.exports = { Arcade: i(1366), Matter: i(1494) };
},
function (t, e, i) {
t.exports = {
BodyBounds: i(1392),
Components: i(249),
Events: i(272),
Factory: i(1394),
MatterGameObject: i(1395),
Image: i(1396),
Matter: i(594),
MatterPhysics: i(1524),
PolyDecomp: i(1393),
Sprite: i(1397),
TileBody: i(593),
PhysicsEditorParser: i(589),
PhysicsJSONParser: i(590),
PointerConstraint: i(1398),
World: i(1402),
};
},
function (t, e) {
t.exports = {
setBounce: function (t) {
return (this.body.restitution = t), this;
},
};
},
function (t, e) {
var i = {
setCollisionCategory: function (t) {
return (this.body.collisionFilter.category = t), this;
},
setCollisionGroup: function (t) {
return (this.body.collisionFilter.group = t), this;
},
setCollidesWith: function (t) {
var e = 0;
if (Array.isArray(t)) for (var i = 0; i < t.length; i++) e |= t[i];
else e = t;
return (this.body.collisionFilter.mask = e), this;
},
setOnCollide: function (t) {
return (this.body.onCollideCallback = t), this;
},
setOnCollideEnd: function (t) {
return (this.body.onCollideEndCallback = t), this;
},
setOnCollideActive: function (t) {
return (this.body.onCollideActiveCallback = t), this;
},
setOnCollideWith: function (t, e) {
Array.isArray(t) || (t = [t]);
for (var i = 0; i < t.length; i++) {
var n = t[i].hasOwnProperty("body") ? t[i].body : t[i];
this.body.setOnCollideWith(n, e);
}
return this;
},
};
t.exports = i;
},
function (t, e, i) {
var n = i(41),
s = {
applyForce: function (t) {
return this._tempVec2.set(this.body.position.x, this.body.position.y), n.applyForce(this.body, this._tempVec2, t), this;
},
applyForceFrom: function (t, e) {
return n.applyForce(this.body, t, e), this;
},
thrust: function (t) {
var e = this.body.angle;
return this._tempVec2.set(t * Math.cos(e), t * Math.sin(e)), n.applyForce(this.body, { x: this.body.position.x, y: this.body.position.y }, this._tempVec2), this;
},
thrustLeft: function (t) {
var e = this.body.angle - Math.PI / 2;
return this._tempVec2.set(t * Math.cos(e), t * Math.sin(e)), n.applyForce(this.body, { x: this.body.position.x, y: this.body.position.y }, this._tempVec2), this;
},
thrustRight: function (t) {
var e = this.body.angle + Math.PI / 2;
return this._tempVec2.set(t * Math.cos(e), t * Math.sin(e)), n.applyForce(this.body, { x: this.body.position.x, y: this.body.position.y }, this._tempVec2), this;
},
thrustBack: function (t) {
var e = this.body.angle - Math.PI;
return this._tempVec2.set(t * Math.cos(e), t * Math.sin(e)), n.applyForce(this.body, { x: this.body.position.x, y: this.body.position.y }, this._tempVec2), this;
},
};
t.exports = s;
},
function (t, e) {
t.exports = {
setFriction: function (t, e, i) {
return (this.body.friction = t), void 0 !== e && (this.body.frictionAir = e), void 0 !== i && (this.body.frictionStatic = i), this;
},
setFrictionAir: function (t) {
return (this.body.frictionAir = t), this;
},
setFrictionStatic: function (t) {
return (this.body.frictionStatic = t), this;
},
};
},
function (t, e) {
t.exports = {
setIgnoreGravity: function (t) {
return (this.body.ignoreGravity = t), this;
},
};
},
function (t, e, i) {
var n = i(41),
s = i(3),
r = {
setMass: function (t) {
return n.setMass(this.body, t), this;
},
setDensity: function (t) {
return n.setDensity(this.body, t), this;
},
centerOfMass: {
get: function () {
return new s(this.body.centerOfMass.x, this.body.centerOfMass.y);
},
},
};
t.exports = r;
},
function (t, e) {
t.exports = {
setSensor: function (t) {
return (this.body.isSensor = t), this;
},
isSensor: function () {
return this.body.isSensor;
},
};
},
function (t, e, i) {
var y = i(86),
m = i(41),
u = i(124),
x = i(2),
b = i(589),
w = i(590),
T = i(64),
n = {
setRectangle: function (t, e, i) {
return this.setBody({ type: "rectangle", width: t, height: e }, i);
},
setCircle: function (t, e) {
return this.setBody({ type: "circle", radius: t }, e);
},
setPolygon: function (t, e, i) {
return this.setBody({ type: "polygon", sides: e, radius: t }, i);
},
setTrapezoid: function (t, e, i, n) {
return this.setBody({ type: "trapezoid", width: t, height: e, slope: i }, n);
},
setExistingBody: function (t, e) {
void 0 === e && (e = !0), this.body && this.world.remove(this.body, !0), (this.body = t);
for (var i = 0; i < t.parts.length; i++) t.parts[i].gameObject = this;
var n,
s,
r,
o,
a,
h,
l = this;
return (
(t.destroy = function () {
l.world.remove(l.body, !0), (l.body.gameObject = null);
}),
e && (this.world.has(t) && this.world.remove(t, !0), this.world.add(t)),
this._originComponent &&
((n = t.render.sprite.xOffset),
(s = t.render.sprite.yOffset),
(r = t.centerOfMass.x),
(o = t.centerOfMass.y),
u(r, 0.5) && u(o, 0.5) ? this.setOrigin(n + 0.5, s + 0.5) : ((a = t.centerOffset.x), (h = t.centerOffset.y), this.setOrigin(n + a / this.displayWidth, s + h / this.displayHeight))),
this
);
},
setBody: function (t, e) {
if (!t) return this;
"string" == typeof t && (t = { type: t });
var i = x(t, "type", "rectangle"),
n = x(t, "x", this._tempVec2.x),
s = x(t, "y", this._tempVec2.y),
r = x(t, "width", this.width),
o = x(t, "height", this.height);
switch (i) {
case "rectangle":
l = y.rectangle(n, s, r, o, e);
break;
case "circle":
var a = x(t, "radius", Math.max(r, o) / 2),
h = x(t, "maxSides", 25),
l = y.circle(n, s, a, e, h);
break;
case "trapezoid":
var u = x(t, "slope", 0.5);
l = y.trapezoid(n, s, r, o, u, e);
break;
case "polygon":
var c = x(t, "sides", 5),
d = x(t, "radius", Math.max(r, o) / 2);
l = y.polygon(n, s, c, d, e);
break;
case "fromVertices":
case "fromVerts":
var f,
p,
g,
v = x(t, "verts", null);
v &&
("string" == typeof v && (v = T.fromPath(v)),
(l =
this.body && !this.body.hasOwnProperty("temp")
? (m.setVertices(this.body, v), this.body)
: ((f = x(t, "flagInternal", !1)), (p = x(t, "removeCollinear", 0.01)), (g = x(t, "minimumArea", 10)), y.fromVertices(n, s, v, e, f, p, g))));
break;
case "fromPhysicsEditor":
l = b.parseBody(n, s, t, e);
break;
case "fromPhysicsTracer":
l = w.parseBody(n, s, t, e);
}
return l && this.setExistingBody(l, t.addToWorld), this;
},
};
t.exports = n;
},
function (t, e, i) {
var n = i(272),
s = i(165),
r = i(166),
o = {
setToSleep: function () {
return s.set(this.body, !0), this;
},
setAwake: function () {
return s.set(this.body, !1), this;
},
setSleepThreshold: function (t) {
return void 0 === t && (t = 60), (this.body.sleepThreshold = t), this;
},
setSleepEvents: function (t, e) {
return this.setSleepStartEvent(t), this.setSleepEndEvent(e), this;
},
setSleepStartEvent: function (t) {
var e;
return (
t
? ((e = this.world),
r.on(this.body, "sleepStart", function (t) {
e.emit(n.SLEEP_START, t, this);
}))
: r.off(this.body, "sleepStart"),
this
);
},
setSleepEndEvent: function (t) {
var e;
return (
t
? ((e = this.world),
r.on(this.body, "sleepEnd", function (t) {
e.emit(n.SLEEP_END, t, this);
}))
: r.off(this.body, "sleepEnd"),
this
);
},
};
t.exports = o;
},
function (t, e) {
t.exports = "afteradd";
},
function (t, e) {
t.exports = "afterremove";
},
function (t, e) {
t.exports = "afterupdate";
},
function (t, e) {
t.exports = "beforeadd";
},
function (t, e) {
t.exports = "beforeremove";
},
function (t, e) {
t.exports = "beforeupdate";
},
function (t, e) {
t.exports = "collisionactive";
},
function (t, e) {
t.exports = "collisionend";
},
function (t, e) {
t.exports = "collisionstart";
},
function (t, e) {
t.exports = "dragend";
},
function (t, e) {
t.exports = "drag";
},
function (t, e) {
t.exports = "dragstart";
},
function (t, e) {
t.exports = "pause";
},
function (t, e) {
t.exports = "resume";
},
function (t, e) {
t.exports = "sleepend";
},
function (t, e) {
t.exports = "sleepstart";
},
function (t, e, i) {
var n = i(41),
s = {
setStatic: function (t) {
return n.setStatic(this.body, t), this;
},
isStatic: function () {
return this.body.isStatic;
},
};
t.exports = s;
},
function (t, e, i) {
var r = i(41),
n = i(14),
s = i(269),
o = i(270),
a = {
x: {
get: function () {
return this.body.position.x;
},
set: function (t) {
this._tempVec2.set(t, this.y), r.setPosition(this.body, this._tempVec2);
},
},
y: {
get: function () {
return this.body.position.y;
},
set: function (t) {
this._tempVec2.set(this.x, t), r.setPosition(this.body, this._tempVec2);
},
},
scaleX: {
get: function () {
return this._scaleX;
},
set: function (t) {
var e = 1 / this._scaleX,
i = 1 / this._scaleY;
(this._scaleX = t), 0 === this._scaleX ? (this.renderFlags &= -5) : (this.renderFlags |= 4), r.scale(this.body, e, i), r.scale(this.body, t, this._scaleY);
},
},
scaleY: {
get: function () {
return this._scaleY;
},
set: function (t) {
var e = 1 / this._scaleX,
i = 1 / this._scaleY;
(this._scaleY = t), 0 === this._scaleY ? (this.renderFlags &= -5) : (this.renderFlags |= 4), r.scale(this.body, e, i), r.scale(this.body, this._scaleX, t);
},
},
angle: {
get: function () {
return o(this.body.angle * n.RAD_TO_DEG);
},
set: function (t) {
this.rotation = o(t) * n.DEG_TO_RAD;
},
},
rotation: {
get: function () {
return this.body.angle;
},
set: function (t) {
(this._rotation = s(t)), r.setAngle(this.body, this._rotation);
},
},
setPosition: function (t, e) {
return void 0 === t && (t = 0), void 0 === e && (e = t), this._tempVec2.set(t, e), r.setPosition(this.body, this._tempVec2), this;
},
setRotation: function (t) {
return void 0 === t && (t = 0), (this._rotation = s(t)), r.setAngle(this.body, t), this;
},
setFixedRotation: function () {
return r.setInertia(this.body, 1 / 0), this;
},
setAngle: function (t) {
return void 0 === t && (t = 0), (this.angle = t), r.setAngle(this.body, this.rotation), this;
},
setScale: function (t, e, i) {
void 0 === t && (t = 1), void 0 === e && (e = t);
var n = 1 / this._scaleX,
s = 1 / this._scaleY;
return (this._scaleX = t), (this._scaleY = e), r.scale(this.body, n, s, i), r.scale(this.body, t, e, i), this;
},
};
t.exports = a;
},
function (t, e, i) {
var n = i(41),
s = {
setAngularVelocity: function (t) {
return n.setAngularVelocity(this.body, t), this;
},
setVelocityX: function (t) {
return this._tempVec2.set(t, this.body.velocity.y), n.setVelocity(this.body, this._tempVec2), this;
},
setVelocityY: function (t) {
return this._tempVec2.set(this.body.velocity.x, t), n.setVelocity(this.body, this._tempVec2), this;
},
setVelocity: function (t, e) {
return this._tempVec2.set(t, e), n.setVelocity(this.body, this._tempVec2), this;
},
};
t.exports = s;
},
function (t, e, i) {
var n = {};
t.exports = n;
var s = i(118),
r = i(32);
(n.create = function (t) {
return r.extend(
{
extended: !1,
narrowDetections: 0,
narrowphaseTests: 0,
narrowReuse: 0,
narrowReuseCount: 0,
midphaseTests: 0,
broadphaseTests: 0,
narrowEff: 1e-4,
midEff: 1e-4,
broadEff: 1e-4,
collisions: 0,
buckets: 0,
bodies: 0,
pairs: 0,
},
!1,
t
);
}),
(n.reset = function (t) {
t.extended &&
((t.narrowDetections = 0),
(t.narrowphaseTests = 0),
(t.narrowReuse = 0),
(t.narrowReuseCount = 0),
(t.midphaseTests = 0),
(t.broadphaseTests = 0),
(t.narrowEff = 0),
(t.midEff = 0),
(t.broadEff = 0),
(t.collisions = 0),
(t.buckets = 0),
(t.pairs = 0),
(t.bodies = 0));
}),
(n.update = function (t, e) {
var i, n;
t.extended &&
((i = e.world),
(n = s.allBodies(i)),
(t.collisions = t.narrowDetections),
(t.pairs = e.pairs.list.length),
(t.bodies = n.length),
(t.midEff = (t.narrowDetections / (t.midphaseTests || 1)).toFixed(2)),
(t.narrowEff = (t.narrowDetections / (t.narrowphaseTests || 1)).toFixed(2)),
(t.broadEff = (1 - t.broadphaseTests / (n.length || 1)).toFixed(2)),
(t.narrowReuse = (t.narrowReuseCount / (t.narrowphaseTests || 1)).toFixed(2)));
});
},
function (t, e, i) {
var r = i(123),
n = i(271),
s = i(86),
o = i(41),
a = i(1392),
h = i(84),
l = i(0),
u = i(118),
c = i(591),
d = i(128),
f = i(273),
p = i(50),
g = i(1394),
v = i(2),
y = i(6),
m = i(597),
x = i(1525),
b = i(1526),
w = i(1399),
T = i(1527),
S = i(127),
_ = i(250),
E = i(598),
P = i(595),
A = i(24),
M = i(1400),
C = i(599),
O = i(274),
k = i(20),
R = i(592),
L = i(83),
I = i(64),
D = i(1402),
F = new l({
initialize: function (t) {
(this.scene = t),
(this.systems = t.sys),
(this.config = this.getConfig()),
this.world,
this.add,
this.bodyBounds,
(this.body = o),
(this.composite = u),
(this.detector = f),
(this.grid = m),
(this.pair = _),
(this.pairs = E),
(this.query = M),
(this.resolver = C),
(this.sat = O),
(this.constraint = d),
(this.bodies = s),
(this.composites = c),
(this.axes = n),
(this.bounds = h),
(this.svg = R),
(this.vector = L),
(this.vertices = I),
(this.verts = I),
(this._tempVec2 = L.create()),
y(this.config, "plugins.collisionevents", !0) && this.enableCollisionEventsPlugin(),
y(this.config, "plugins.attractors", !1) && this.enableAttractorPlugin(),
y(this.config, "plugins.wrap", !1) && this.enableWrapPlugin(),
(C._restingThresh = y(this.config, "restingThresh", 4)),
(C._restingThreshTangent = y(this.config, "restingThreshTangent", 6)),
(C._positionDampen = y(this.config, "positionDampen", 0.9)),
(C._positionWarming = y(this.config, "positionWarming", 0.8)),
(C._frictionNormalMultiplier = y(this.config, "frictionNormalMultiplier", 5)),
t.sys.events.once(k.BOOT, this.boot, this),
t.sys.events.on(k.START, this.start, this);
},
boot: function () {
(this.world = new D(this.scene, this.config)), (this.add = new g(this.world)), (this.bodyBounds = new a()), this.systems.events.once(k.DESTROY, this.destroy, this);
},
start: function () {
this.world || ((this.world = new D(this.scene, this.config)), (this.add = new g(this.world)));
var t = this.systems.events;
t.on(k.UPDATE, this.world.update, this.world), t.on(k.POST_UPDATE, this.world.postUpdate, this.world), t.once(k.SHUTDOWN, this.shutdown, this);
},
getConfig: function () {
var t = this.systems.game.config.physics,
e = this.systems.settings.physics;
return S(v(e, "matter", {}), v(t, "matter", {}));
},
enableAttractorPlugin: function () {
return P.register(x), P.use(w, x), this;
},
enableWrapPlugin: function () {
return P.register(T), P.use(w, T), this;
},
enableCollisionEventsPlugin: function () {
return P.register(b), P.use(w, b), this;
},
pause: function () {
return this.world.pause();
},
resume: function () {
return this.world.resume();
},
set60Hz: function () {
return (this.world.getDelta = this.world.update60Hz), (this.world.autoUpdate = !0), this;
},
set30Hz: function () {
return (this.world.getDelta = this.world.update30Hz), (this.world.autoUpdate = !0), this;
},
step: function (t, e) {
this.world.step(t, e);
},
containsPoint: function (t, e, i) {
t = this.getMatterBodies(t);
var n = L.create(e, i);
return 0 < M.point(t, n).length;
},
intersectPoint: function (t, e, i) {
i = this.getMatterBodies(i);
var n = L.create(t, e),
s = [];
return (
M.point(i, n).forEach(function (t) {
-1 === s.indexOf(t) && s.push(t);
}),
s
);
},
intersectRect: function (t, e, i, n, s, r) {
void 0 === s && (s = !1), (r = this.getMatterBodies(r));
var o = { min: { x: t, y: e }, max: { x: t + i, y: e + n } },
a = [];
return (
M.region(r, o, s).forEach(function (t) {
-1 === a.indexOf(t) && a.push(t);
}),
a
);
},
intersectRay: function (t, e, i, n, s, r) {
void 0 === s && (s = 1), (r = this.getMatterBodies(r));
for (var o = [], a = M.ray(r, L.create(t, e), L.create(i, n), s), h = 0; h < a.length; h++) o.push(a[h].body);
return o;
},
intersectBody: function (t, e) {
e = this.getMatterBodies(e);
for (var i = [], n = M.collides(t, e), s = 0; s < n.length; s++) {
var r = n[s];
r.bodyA === t ? i.push(r.bodyB) : i.push(r.bodyA);
}
return i;
},
overlap: function (t, e, i, n, s) {
void 0 === i && (i = null), void 0 === n && (n = null), void 0 === s && (s = i), Array.isArray(t) || (t = [t]), (t = this.getMatterBodies(t)), (e = this.getMatterBodies(e));
for (var r = !1, o = 0; o < t.length; o++)
for (var a = t[o], h = M.collides(a, e), l = 0; l < h.length; l++) {
var u = h[l],
c = u.bodyA.id === a.id ? u.bodyB : u.bodyA;
if (!n || n.call(s, a, c, u))
if (((r = !0), i)) i.call(s, a, c, u);
else if (!n) return !0;
}
return r;
},
setCollisionCategory: function (t, e) {
return (
(t = this.getMatterBodies(t)).forEach(function (t) {
t.collisionFilter.category = e;
}),
this
);
},
setCollisionGroup: function (t, e) {
return (
(t = this.getMatterBodies(t)).forEach(function (t) {
t.collisionFilter.group = e;
}),
this
);
},
setCollidesWith: function (t, e) {
t = this.getMatterBodies(t);
var i = 0;
if (Array.isArray(e)) for (var n = 0; n < e.length; n++) i |= e[n];
else i = e;
return (
t.forEach(function (t) {
t.collisionFilter.mask = i;
}),
this
);
},
getMatterBodies: function (t) {
if (!t) return this.world.getAllBodies();
Array.isArray(t) || (t = [t]);
for (var e = [], i = 0; i < t.length; i++) {
var n = t[i].hasOwnProperty("body") ? t[i].body : t[i];
e.push(n);
}
return e;
},
setVelocity: function (t, e, i) {
t = this.getMatterBodies(t);
var n = this._tempVec2;
return (
(n.x = e),
(n.y = i),
t.forEach(function (t) {
o.setVelocity(t, n);
}),
this
);
},
setVelocityX: function (t, e) {
t = this.getMatterBodies(t);
var i = this._tempVec2;
return (
(i.x = e),
t.forEach(function (t) {
(i.y = t.velocity.y), o.setVelocity(t, i);
}),
this
);
},
setVelocityY: function (t, e) {
t = this.getMatterBodies(t);
var i = this._tempVec2;
return (
(i.y = e),
t.forEach(function (t) {
(i.x = t.velocity.x), o.setVelocity(t, i);
}),
this
);
},
setAngularVelocity: function (t, e) {
return (
(t = this.getMatterBodies(t)).forEach(function (t) {
o.setAngularVelocity(t, e);
}),
this
);
},
applyForce: function (t, e) {
t = this.getMatterBodies(t);
var i = this._tempVec2;
return (
t.forEach(function (t) {
(i.x = t.position.x), (i.y = t.position.y), o.applyForce(t, i, e);
}),
this
);
},
applyForceFromPosition: function (t, e, i, n) {
t = this.getMatterBodies(t);
var s = this._tempVec2;
return (
t.forEach(function (t) {
void 0 === n && (n = t.angle), (s.x = i * Math.cos(n)), (s.y = i * Math.sin(n)), o.applyForce(t, e, s);
}),
this
);
},
applyForceFromAngle: function (t, e, i) {
t = this.getMatterBodies(t);
var n = this._tempVec2;
return (
t.forEach(function (t) {
void 0 === i && (i = t.angle), (n.x = e * Math.cos(i)), (n.y = e * Math.sin(i)), o.applyForce(t, { x: t.position.x, y: t.position.y }, n);
}),
this
);
},
getConstraintLength: function (t) {
var e = t.pointA.x,
i = t.pointA.y,
n = t.pointB.x,
s = t.pointB.y;
return t.bodyA && ((e += t.bodyA.position.x), (i += t.bodyA.position.y)), t.bodyB && ((n += t.bodyB.position.x), (s += t.bodyB.position.y)), p(e, i, n, s);
},
alignBody: function (t, e, i, n) {
var s;
switch (((t = t.hasOwnProperty("body") ? t.body : t), n)) {
case r.TOP_LEFT:
case r.LEFT_TOP:
s = this.bodyBounds.getTopLeft(t, e, i);
break;
case r.TOP_CENTER:
s = this.bodyBounds.getTopCenter(t, e, i);
break;
case r.TOP_RIGHT:
case r.RIGHT_TOP:
s = this.bodyBounds.getTopRight(t, e, i);
break;
case r.LEFT_CENTER:
s = this.bodyBounds.getLeftCenter(t, e, i);
break;
case r.CENTER:
s = this.bodyBounds.getCenter(t, e, i);
break;
case r.RIGHT_CENTER:
s = this.bodyBounds.getRightCenter(t, e, i);
break;
case r.LEFT_BOTTOM:
case r.BOTTOM_LEFT:
s = this.bodyBounds.getBottomLeft(t, e, i);
break;
case r.BOTTOM_CENTER:
s = this.bodyBounds.getBottomCenter(t, e, i);
break;
case r.BOTTOM_RIGHT:
case r.RIGHT_BOTTOM:
s = this.bodyBounds.getBottomRight(t, e, i);
}
return s && o.setPosition(t, s), this;
},
shutdown: function () {
var t = this.systems.events;
this.world && (t.off(k.UPDATE, this.world.update, this.world), t.off(k.POST_UPDATE, this.world.postUpdate, this.world)),
t.off(k.SHUTDOWN, this.shutdown, this),
this.add && this.add.destroy(),
this.world && this.world.destroy(),
(this.add = null),
(this.world = null);
},
destroy: function () {
this.shutdown(), this.scene.sys.events.off(k.START, this.start, this), (this.scene = null), (this.systems = null);
},
});
A.register("MatterPhysics", F, "matterPhysics"), (t.exports = F);
},
function (t, e, i) {
var u = i(594),
a = {
name: "matter-attractors",
version: "0.1.7",
for: "matter-js@^0.14.2",
silent: !0,
install: function (t) {
t.after("Body.create", function () {
a.Body.init(this);
}),
t.before("Engine.update", function (t) {
a.Engine.update(t);
});
},
Body: {
init: function (t) {
t.plugin.attractors = t.plugin.attractors || [];
},
},
Engine: {
update: function (t) {
for (var e = u.Composite.allBodies(t.world), i = 0; i < e.length; i++) {
var n = e[i],
s = n.plugin.attractors;
if (s && 0 < s.length)
for (var r = 0; r < e.length; r++) {
var o = e[r];
if (i !== r)
for (var a = 0; a < s.length; a++) {
var h = s[a],
l = h;
u.Common.isFunction(h) && (l = h(n, o)), l && u.Body.applyForce(o, o.position, l);
}
}
}
},
},
Attractors: {
gravityConstant: 0.001,
gravity: function (t, e) {
var i = u.Vector.sub(e.position, t.position),
n = u.Vector.magnitudeSquared(i) || 1e-4,
s = u.Vector.normalise(i),
r = -a.Attractors.gravityConstant * ((t.mass * e.mass) / n),
o = u.Vector.mult(s, r);
u.Body.applyForce(t, t.position, u.Vector.neg(o)), u.Body.applyForce(e, e.position, o);
},
},
};
t.exports = a;
},
function (t, e) {
t.exports = {
name: "matter-collision-events",
version: "0.1.6",
for: "matter-js@^0.14.2",
silent: !0,
install: function (n) {
n.after("Engine.create", function () {
n.Events.on(this, "collisionStart", function (t) {
t.pairs.map(function (t) {
var e = t.bodyA,
i = t.bodyB;
e.gameObject && e.gameObject.emit("collide", e, i, t),
i.gameObject && i.gameObject.emit("collide", i, e, t),
n.Events.trigger(e, "onCollide", { pair: t }),
n.Events.trigger(i, "onCollide", { pair: t }),
e.onCollideCallback && e.onCollideCallback(t),
i.onCollideCallback && i.onCollideCallback(t),
e.onCollideWith[i.id] && e.onCollideWith[i.id](i, t),
i.onCollideWith[e.id] && i.onCollideWith[e.id](e, t);
});
}),
n.Events.on(this, "collisionActive", function (t) {
t.pairs.map(function (t) {
var e = t.bodyA,
i = t.bodyB;
e.gameObject && e.gameObject.emit("collideActive", e, i, t),
i.gameObject && i.gameObject.emit("collideActive", i, e, t),
n.Events.trigger(e, "onCollideActive", { pair: t }),
n.Events.trigger(i, "onCollideActive", { pair: t }),
e.onCollideActiveCallback && e.onCollideActiveCallback(t),
i.onCollideActiveCallback && i.onCollideActiveCallback(t);
});
}),
n.Events.on(this, "collisionEnd", function (t) {
t.pairs.map(function (t) {
var e = t.bodyA,
i = t.bodyB;
e.gameObject && e.gameObject.emit("collideEnd", e, i, t),
i.gameObject && i.gameObject.emit("collideEnd", i, e, t),
n.Events.trigger(e, "onCollideEnd", { pair: t }),
n.Events.trigger(i, "onCollideEnd", { pair: t }),
e.onCollideEndCallback && e.onCollideEndCallback(t),
i.onCollideEndCallback && i.onCollideEndCallback(t);
});
});
});
},
};
},
function (t, e, i) {
var a = i(594),
h = {
name: "matter-wrap",
version: "0.1.4",
for: "matter-js@^0.14.2",
silent: !0,
install: function (t) {
t.after("Engine.update", function () {
h.Engine.update(this);
});
},
Engine: {
update: function (t) {
for (var e = t.world, i = a.Composite.allBodies(e), n = a.Composite.allComposites(e), s = 0; s < i.length; s += 1) {
var r = i[s];
r.plugin.wrap && h.Body.wrap(r, r.plugin.wrap);
}
for (s = 0; s < n.length; s += 1) {
var o = n[s];
o.plugin.wrap && h.Composite.wrap(o, o.plugin.wrap);
}
},
},
Bounds: {
wrap: function (t, e) {
var i = null,
n = null;
if (
(void 0 !== e.min.x && void 0 !== e.max.x && (t.min.x > e.max.x ? (i = e.min.x - t.max.x) : t.max.x < e.min.x && (i = e.max.x - t.min.x)),
void 0 !== e.min.y && void 0 !== e.max.y && (t.min.y > e.max.y ? (n = e.min.y - t.max.y) : t.max.y < e.min.y && (n = e.max.y - t.min.y)),
null !== i || null !== n)
)
return { x: i || 0, y: n || 0 };
},
},
Body: {
wrap: function (t, e) {
var i = h.Bounds.wrap(t.bounds, e);
return i && a.Body.translate(t, i), i;
},
},
Composite: {
bounds: function (t) {
for (var e = a.Composite.allBodies(t), i = [], n = 0; n < e.length; n += 1) {
var s = e[n];
i.push(s.bounds.min, s.bounds.max);
}
return a.Bounds.create(i);
},
wrap: function (t, e) {
var i = h.Bounds.wrap(h.Composite.bounds(t), e);
return i && a.Composite.translate(t, i), i;
},
},
};
t.exports = h;
},
function (s, t, r) {
(function (t) {
var e = r(33),
i = r(17),
n = {
Actions: r(275),
Animations: r(723),
BlendModes: r(35),
Cache: r(735),
Cameras: r(738),
Core: r(806),
Class: r(0),
Create: r(888),
Curves: r(894),
Data: r(896),
Display: r(898),
DOM: r(917),
Events: r(918),
Game: r(920),
GameObjects: r(1011),
Geom: r(483),
Input: r(1308),
Loader: r(1338),
Math: r(193),
Physics: r(1493),
Plugins: r(1403),
Renderer: r(1405),
Scale: r(1412),
ScaleModes: r(168),
Scene: r(418),
Scenes: r(1413),
Structs: r(1415),
Textures: r(1416),
Tilemaps: r(1418),
Time: r(1461),
Tweens: r(1463),
Utils: r(1481),
};
(n.Sound = r(1492)), (n = i(!1, n, e)), (s.exports = n), (t.Phaser = n);
}.call(this, r(600)));
},
]),
(s.c = n),
(s.d = function (t, e, i) {
s.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: i });
}),
(s.r = function (t) {
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 });
}),
(s.t = function (e, t) {
if ((1 & t && (e = s(e)), 8 & t)) return e;
if (4 & t && "object" == typeof e && e && e.__esModule) return e;
var i = Object.create(null);
if ((s.r(i), Object.defineProperty(i, "default", { enumerable: !0, value: e }), 2 & t && "string" != typeof e))
for (var n in e)
s.d(
i,
n,
function (t) {
return e[t];
}.bind(null, n)
);
return i;
}),
(s.n = function (t) {
var e =
t && t.__esModule
? function () {
return t.default;
}
: function () {
return t;
};
return s.d(e, "a", e), e;
}),
(s.o = function (t, e) {
return Object.prototype.hasOwnProperty.call(t, e);
}),
(s.p = ""),
s((s.s = 1528))
);
function s(t) {
if (n[t]) return n[t].exports;
var e = (n[t] = { i: t, l: !1, exports: {} });
return i[t].call(e.exports, e, e.exports, s), (e.l = !0), e.exports;
}
var i, n;
}),
(function (t, e) {
"object" == typeof exports && "undefined" != typeof module
? e(exports)
: "function" == typeof define && define.amd
? define(["exports"], e)
: e(((t = "undefined" != typeof globalThis ? globalThis : t || self).h5branding = t.h5branding || {}));
})(this, function (r) {
"use strict";
var s,
U = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {};
function c() {
throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs");
}
function t(t, e) {
return t((e = { exports: {} }), e.exports), e.exports;
}
t(function (t, e) {
t.exports = (function () {
function h(t) {
return "function" == typeof t;
}
var i = Array.isArray
? Array.isArray
: function (t) {
return "[object Array]" === Object.prototype.toString.call(t);
},
n = 0,
e = void 0,
s = void 0,
a = function (t, e) {
(d[n] = t), (d[n + 1] = e), 2 === (n += 2) && (s ? s(f) : m());
},
t = "undefined" != typeof window ? window : void 0,
r = t || {},
o = r.MutationObserver || r.WebKitMutationObserver,
l = "undefined" == typeof self && "undefined" != typeof process && "[object process]" === {}.toString.call(process),
u = "undefined" != typeof Uint8ClampedArray && "undefined" != typeof importScripts && "undefined" != typeof MessageChannel;
function c() {
var t = setTimeout;
return function () {
return t(f, 1);
};
}
var d = new Array(1e3);
function f() {
for (var t = 0; t < n; t += 2) {
var e = d[t],
i = d[t + 1];
e(i), (d[t] = void 0), (d[t + 1] = void 0);
}
n = 0;
}
var p,
g,
v,
y,
m = void 0;
function x(t, e) {
var i = this,
n = new this.constructor(T);
void 0 === n[w] && F(n);
var s = i._state;
if (s) {
var r = arguments[s - 1];
a(function () {
return I(s, n, r, i._result);
});
} else R(i, n, t, e);
return n;
}
function b(t) {
if (t && "object" == typeof t && t.constructor === this) return t;
var e = new this(T);
return M(e, t), e;
}
m = l
? function () {
return process.nextTick(f);
}
: o
? ((g = 0),
(v = new o(f)),
(y = document.createTextNode("")),
v.observe(y, { characterData: !0 }),
function () {
y.data = g = ++g % 2;
})
: u
? (((p = new MessageChannel()).port1.onmessage = f),
function () {
return p.port2.postMessage(0);
})
: void 0 === t
? (function () {
try {
var t = Function("return this")().require("vertx");
return void 0 === (e = t.runOnLoop || t.runOnContext)
? c()
: function () {
e(f);
};
} catch (t) {
return c();
}
})()
: c();
var w = Math.random().toString(36).substring(2);
function T() {}
var S = void 0,
_ = 1,
E = 2;
function P(t, e, i, n) {
try {
t.call(e, i, n);
} catch (t) {
return t;
}
}
function A(t, e, i) {
var n, s, r, o;
e.constructor === t.constructor && i === x && e.constructor.resolve === b
? ((r = t),
(o = e)._state === _
? O(r, o._result)
: o._state === E
? k(r, o._result)
: R(
o,
void 0,
function (t) {
return M(r, t);
},
function (t) {
return k(r, t);
}
))
: void 0 === i
? O(t, e)
: h(i)
? ((n = e),
(s = i),
a(function (e) {
var i = !1,
t = P(
s,
n,
function (t) {
i || ((i = !0), n !== t ? M(e, t) : O(e, t));
},
function (t) {
i || ((i = !0), k(e, t));
},
e._label
);
!i && t && ((i = !0), k(e, t));
}, t))
: O(t, e);
}
function M(e, t) {
if (e === t) k(e, new TypeError("You cannot resolve a promise with itself"));
else if (((s = typeof (n = t)), null === n || ("object" !== s && "function" !== s))) O(e, t);
else {
var i = void 0;
try {
i = t.then;
} catch (t) {
return void k(e, t);
}
A(e, t, i);
}
var n, s;
}
function C(t) {
t._onerror && t._onerror(t._result), L(t);
}
function O(t, e) {
t._state === S && ((t._result = e), (t._state = _), 0 !== t._subscribers.length && a(L, t));
}
function k(t, e) {
t._state === S && ((t._state = E), (t._result = e), a(C, t));
}
function R(t, e, i, n) {
var s = t._subscribers,
r = s.length;
(t._onerror = null), (s[r] = e), (s[r + _] = i), (s[r + E] = n), 0 === r && t._state && a(L, t);
}
function L(t) {
var e = t._subscribers,
i = t._state;
if (0 !== e.length) {
for (var n = void 0, s = void 0, r = t._result, o = 0; o < e.length; o += 3) (n = e[o]), (s = e[o + i]), n ? I(i, n, s, r) : s(r);
t._subscribers.length = 0;
}
}
function I(t, e, i, n) {
var s = h(i),
r = void 0,
o = void 0,
a = !0;
if (s) {
try {
r = i(n);
} catch (t) {
(a = !1), (o = t);
}
if (e === r) return void k(e, new TypeError("A promises callback cannot return that same promise."));
} else r = n;
e._state !== S || (s && a ? M(e, r) : !1 === a ? k(e, o) : t === _ ? O(e, r) : t === E && k(e, r));
}
var D = 0;
function F(t) {
(t[w] = D++), (t._state = void 0), (t._result = void 0), (t._subscribers = []);
}
var B = (function () {
function t(t, e) {
(this._instanceConstructor = t),
(this.promise = new t(T)),
this.promise[w] || F(this.promise),
i(e)
? ((this.length = e.length),
(this._remaining = e.length),
(this._result = new Array(this.length)),
0 === this.length ? O(this.promise, this._result) : ((this.length = this.length || 0), this._enumerate(e), 0 === this._remaining && O(this.promise, this._result)))
: k(this.promise, new Error("Array Methods must be provided an Array"));
}
return (
(t.prototype._enumerate = function (t) {
for (var e = 0; this._state === S && e < t.length; e++) this._eachEntry(t[e], e);
}),
(t.prototype._eachEntry = function (e, t) {
var i = this._instanceConstructor,
n = i.resolve;
if (n === b) {
var s = void 0,
r = void 0,
o = !1;
try {
s = e.then;
} catch (t) {
(o = !0), (r = t);
}
if (s === x && e._state !== S) this._settledAt(e._state, t, e._result);
else if ("function" != typeof s) this._remaining--, (this._result[t] = e);
else if (i === N) {
var a = new i(T);
o ? k(a, r) : A(a, e, s), this._willSettleAt(a, t);
} else
this._willSettleAt(
new i(function (t) {
return t(e);
}),
t
);
} else this._willSettleAt(n(e), t);
}),
(t.prototype._settledAt = function (t, e, i) {
var n = this.promise;
n._state === S && (this._remaining--, t === E ? k(n, i) : (this._result[e] = i)), 0 === this._remaining && O(n, this._result);
}),
(t.prototype._willSettleAt = function (t, e) {
var i = this;
R(
t,
void 0,
function (t) {
return i._settledAt(_, e, t);
},
function (t) {
return i._settledAt(E, e, t);
}
);
}),
t
);
})(),
N = (function () {
function e(t) {
(this[w] = D++),
(this._result = this._state = void 0),
(this._subscribers = []),
T !== t &&
("function" != typeof t &&
(function () {
throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");
})(),
this instanceof e
? (function (e, t) {
try {
t(
function (t) {
M(e, t);
},
function (t) {
k(e, t);
}
);
} catch (t) {
k(e, t);
}
})(this, t)
: (function () {
throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
})());
}
return (
(e.prototype.catch = function (t) {
return this.then(null, t);
}),
(e.prototype.finally = function (e) {
var i = this.constructor;
return h(e)
? this.then(
function (t) {
return i.resolve(e()).then(function () {
return t;
});
},
function (t) {
return i.resolve(e()).then(function () {
throw t;
});
}
)
: this.then(e, e);
}),
e
);
})();
return (
(N.prototype.then = x),
(N.all = function (t) {
return new B(this, t).promise;
}),
(N.race = function (s) {
var r = this;
return i(s)
? new r(function (t, e) {
for (var i = s.length, n = 0; n < i; n++) r.resolve(s[n]).then(t, e);
})
: new r(function (t, e) {
return e(new TypeError("You must pass an array to race."));
});
}),
(N.resolve = b),
(N.reject = function (t) {
var e = new this(T);
return k(e, t), e;
}),
(N._setScheduler = function (t) {
s = t;
}),
(N._setAsap = function (t) {
a = t;
}),
(N._asap = a),
(N.polyfill = function () {
var t = void 0;
if (void 0 !== U) t = U;
else if ("undefined" != typeof self) t = self;
else
try {
t = Function("return this")();
} catch (t) {
throw new Error("polyfill failed because global object is unavailable in this environment");
}
var e = t.Promise;
if (e) {
var i = null;
try {
i = Object.prototype.toString.call(e.resolve());
} catch (t) {}
if ("[object Promise]" === i && !e.cast) return;
}
t.Promise = N;
}),
(N.Promise = N)
);
})();
}).polyfill();
var e,
n = (function () {
function t() {}
return (
(t.has = function (t) {
var e = t.lastIndexOf(".");
if (e <= 0 || e >= t.length - 1) return !1;
var i = t.lastIndexOf(".", e - 1);
if (i <= 0 || e - 1 <= i) return !1;
var n = s[t.slice(e + 1)];
return !!n && 0 <= n.indexOf(" " + t.slice(i + 1, e) + " ");
}),
(t.is = function (t) {
var e = t.lastIndexOf(".");
if (e <= 0 || e >= t.length - 1) return !1;
if (0 <= t.lastIndexOf(".", e - 1)) return !1;
var i = s[t.slice(e + 1)];
return !!i && 0 <= i.indexOf(" " + t.slice(0, e) + " ");
}),
(t.get = function (t) {
var e = t.lastIndexOf(".");
if (e <= 0 || e >= t.length - 1) return null;
var i = t.lastIndexOf(".", e - 1);
if (i <= 0 || e - 1 <= i) return null;
var n = s[t.slice(e + 1)];
return n ? (n.indexOf(" " + t.slice(i + 1, e) + " ") < 0 ? null : t.slice(i + 1)) : null;
}),
t
);
})(),
o = (function () {
function t() {}
return (
(t.setList = function (t) {
s = t || {};
}),
(t.getDomain = function (t) {
if (!s) return null;
var e = t.match(/\./g);
if (e && e.length < 2) return t;
var i = this.getTld(t);
if (!i) return null;
var n = t.length - i.length - 1;
return (n = t.lastIndexOf(".", n - 1) + 1), t.substring(n) || "";
}),
(t.getTld = function (t) {
if (!s) return "";
var e = t.lastIndexOf("."),
i = t.substring(e + 1);
return (s[i.toLowerCase()] && n.get(t)) || i;
}),
(t.KEY = "Domains"),
t
);
})(),
a = (function () {
function t() {
this.cache = {};
}
return (
Object.defineProperty(t, "instance", {
get: function () {
return void 0 === t.classInstance && (t.classInstance = new t()), t.classInstance;
},
enumerable: !1,
configurable: !0,
}),
(t.prototype.load = function (e, t, i) {
var n = this;
return this.contains(e)
? Promise.reject("Already in cache.")
: ((this.cache[e] = { url: t, data: null }),
this.requestXhr(t, i)
.then(function (t) {
return n.loadComplete(e, t);
})
.catch(function (t) {
return n.remove(e), Promise.reject(t);
}));
}),
(t.prototype.loadComplete = function (t, e) {
if (!this.contains(t)) return Promise.reject("Item was removed from cache before loading was complete.");
try {
var i = JSON.parse(e);
return (this.cache[t].data = i), Promise.resolve(i);
} catch (t) {
return Promise.reject("There was an error parsing JSON file.");
}
}),
(t.prototype.remove = function (t) {
this.contains(t) && delete this.cache[t];
}),
(t.prototype.get = function (t) {
return this.contains(t) ? this.cache[t].data : null;
}),
(t.prototype.contains = function (t) {
return this.cache.hasOwnProperty(t);
}),
(t.prototype.isLoading = function (t) {
return this.contains(t) && null === this.cache[t].data;
}),
(t.prototype.isLoaded = function (t) {
return this.contains(t) && null !== this.cache[t].data;
}),
(t.prototype.loadScript = function (n, t, s) {
return new Promise(function (t, e) {
var i = document.createElement("script");
(i.src = n),
(i.async = !1),
(i.onload = function () {
"function" == typeof s && s(), t();
}),
document.head.appendChild(i);
});
}),
(t.prototype.requestXhr = function (i, n) {
var s;
return (
void 0 === n && (n = "application/json"),
window.XMLHttpRequest
? ((s = new XMLHttpRequest()),
new Promise(function (t, e) {
s.onreadystatechange = function () {
4 === s.readyState &&
(200 === s.status ? (t(s.responseText), (s.onreadystatechange = null)) : 0 < s.status && (e("There was a problem with the request: status ".concat(s.status)), (s.onreadystatechange = null)));
};
try {
s.open("GET", i, !0), s.setRequestHeader("Content-Type", n), s.send();
} catch (t) {
e("Error: Unable to send request, CORS not allowed.");
}
}))
: Promise.reject("Unable to send request, XMLHttpRequest not supported.")
);
}),
t
);
})();
function i(r, o, a, h) {
return new (a || (a = Promise))(function (t, e) {
function i(t) {
try {
s(h.next(t));
} catch (t) {
e(t);
}
}
function n(t) {
try {
s(h.throw(t));
} catch (t) {
e(t);
}
}
function s(e) {
e.done
? t(e.value)
: new a(function (t) {
t(e.value);
}).then(i, n);
}
s((h = h.apply(r, o || [])).next());
});
}
function u(i, n) {
var s,
r,
o,
t,
a = {
label: 0,
sent: function () {
if (1 & o[0]) throw o[1];
return o[1];
},
trys: [],
ops: [],
};
return (
(t = { next: e(0), throw: e(1), return: e(2) }),
"function" == typeof Symbol &&
(t[Symbol.iterator] = function () {
return this;
}),
t
);
function e(e) {
return function (t) {
return (function (e) {
if (s) throw new TypeError("Generator is already executing.");
for (; a; )
try {
if (((s = 1), r && (o = 2 & e[0] ? r.return : e[0] ? r.throw || ((o = r.return) && o.call(r), 0) : r.next) && !(o = o.call(r, e[1])).done)) return o;
switch (((r = 0), o && (e = [2 & e[0], o.value]), e[0])) {
case 0:
case 1:
o = e;
break;
case 4:
return a.label++, { value: e[1], done: !1 };
case 5:
a.label++, (r = e[1]), (e = [0]);
continue;
case 7:
(e = a.ops.pop()), a.trys.pop();
continue;
default:
if (!(o = 0 < (o = a.trys).length && o[o.length - 1]) && (6 === e[0] || 2 === e[0])) {
a = 0;
continue;
}
if (3 === e[0] && (!o || (e[1] > o[0] && e[1] < o[3]))) {
a.label = e[1];
break;
}
if (6 === e[0] && a.label < o[1]) {
(a.label = o[1]), (o = e);
break;
}
if (o && a.label < o[2]) {
(a.label = o[2]), a.ops.push(e);
break;
}
o[2] && a.ops.pop(), a.trys.pop();
continue;
}
e = n.call(i, a);
} catch (t) {
(e = [6, t]), (r = 0);
} finally {
s = o = 0;
}
if (5 & e[0]) throw e[1];
return { value: e[0] ? e[1] : void 0, done: !0 };
})([e, t]);
};
}
}
(r.BrandingDomain = void 0),
((e = r.BrandingDomain || (r.BrandingDomain = {}))[(e.Neutral = 0)] = "Neutral"),
(e[(e.Yepi = 1)] = "Yepi"),
(e[(e.Spele = 2)] = "Spele"),
(e[(e.Funnygames = 3)] = "Funnygames"),
(e[(e.Kizi = 4)] = "Kizi"),
(e[(e.PlayCell = 5)] = "PlayCell"),
(e[(e.GameCell = 6)] = "GameCell"),
(e[(e.Bild = 7)] = "Bild"),
(e[(e.AGame = 8)] = "AGame"),
(e[(e.Admeen = 9)] = "Admeen"),
(e[(e.PlayTime = 10)] = "PlayTime"),
(e[(e.Zigiz = 11)] = "Zigiz");
var h,
l = (function () {
function t() {}
return (
(t.isBip = function () {
return -1 !== window.location.search.indexOf("bipgaming") || "bip.fbrq.io" === window.location.host;
}),
(t.isPlaycellApp = function () {
return -1 !== window.location.search.indexOf("playcellApp");
}),
(t.isAGame = function () {
return -1 !== window.location.search.indexOf("agame");
}),
(t.isAirfi = function () {
return !!window.hasOwnProperty("airfi") && window.airfi;
}),
(t.isPlaytime = function () {
return -1 !== window.location.host.indexOf("playtime.nl");
}),
(t.isBild = function () {
return "bild.fbrq.io" === window.location.host || -1 !== window.location.host.indexOf("contentfleet.com");
}),
(t.isYandex = function () {
return window.hasOwnProperty("_YaSDK") || window.hasOwnProperty("YaGames");
}),
(t.getYandexBaseURL = function () {
var t, e;
if ((null === (e = null === (t = window.YandexGamesSDKEnvironment) || void 0 === t ? void 0 : t.browser) || void 0 === e ? void 0 : e.lang) && "en" === window.YandexGamesSDKEnvironment.browser.lang)
return "yandex.com";
return "yandex.ru";
}),
t
);
})();
(r.UtmTargets = void 0),
((h = r.UtmTargets || (r.UtmTargets = {}))[(h.splashscreen = 0)] = "splashscreen"),
(h[(h.logo = 1)] = "logo"),
(h[(h.facebook = 2)] = "facebook"),
(h[(h.twitter = 3)] = "twitter"),
(h[(h.playstore = 4)] = "playstore"),
(h[(h.appstore = 5)] = "appstore"),
(h[(h.more_games = 6)] = "more_games"),
(h[(h.download_game = 7)] = "download_game"),
(h[(h.walkthrough = 8)] = "walkthrough"),
(h[(h.disclaimer = 9)] = "disclaimer"),
(h[(h.highscores = 10)] = "highscores");
var d = (function () {
function t() {}
return (
(t.getProtocol = function (t) {
return t ? "https://" : "//";
}),
(t.getUtmContent = function (t) {
return "string" == typeof t ? t : r.UtmTargets[t];
}),
(t.getDomainURL = function (t, e) {
var i;
switch (t) {
case r.BrandingDomain.Spele:
i = e + "www.spele.nl";
break;
case r.BrandingDomain.Yepi:
i = e + "www.yepi.com";
break;
case r.BrandingDomain.Admeen:
i = "https://media.admeen.com/branding/link.php";
break;
case r.BrandingDomain.PlayCell:
i = e + "www.playcell.com";
break;
case r.BrandingDomain.GameCell:
i = e + "www.gamecell.com";
break;
case r.BrandingDomain.Kizi:
i = e + "www.kizi.com";
break;
case r.BrandingDomain.Bild:
i = e + "www.bildspielt.de";
break;
case r.BrandingDomain.Funnygames:
i = e + "www.funnygames.nu";
break;
case r.BrandingDomain.PlayTime:
i = e + "playtime.nl";
break;
default:
case r.BrandingDomain.AGame:
i = e + "www.agame.com";
break;
case r.BrandingDomain.Zigiz:
i = e + "m.zigiz.com";
}
return i;
}),
(t.getPromoURL = function (t, e, i, n, s) {
return window.hasOwnProperty("_YaSDK") || window.hasOwnProperty("YaGames")
? "https://".concat(l.getYandexBaseURL(), "/games/developer?name=Azerion")
: t === r.BrandingDomain.Admeen
? "https://media.admeen.com/branding/link.php"
: t === r.BrandingDomain.Bild
? e
: e + "/?utm_source=" + i + "&utm_medium=html5&utm_term=" + n + "&utm_content=" + s + "&utm_campaign=Gamedistribution";
}),
t
);
})();
function f(t, e, i) {
var n = document.createElement("script");
n.setAttribute("src", t + "?v=" + e), "function" == typeof i && (n.onload = i), document.body.appendChild(n);
}
var p = (function () {
function t() {}
return (
(t.loadPortalScript = function (t) {
t &&
t.hasOwnProperty("minijuegos") &&
-1 !== t.minijuegos.indexOf(v.getSourceSite()) &&
(void 0 !== window.mpConfig ? (window.mpConfig.partner = "orange-games") : (window.mpConfig = { partner: "orange-games" }), f("https://ext.minijuegosgratis.com/external-host/main.js", Date.now() / 1e3)),
t &&
t.hasOwnProperty("kongregate") &&
-1 !== t.kongregate.indexOf(v.getSourceSite()) &&
f("https://cdn1.kongregate.com/javascripts/kongregate_api.js", Date.now() / 1e3, function () {
"undefined" != typeof kongregateAPI &&
kongregateAPI.loadAPI(function () {
window.kongregate = kongregateAPI.getAPI();
});
}),
t && t.hasOwnProperty("newgrounds") && -1 !== t.newgrounds.indexOf(v.getSourceSite()) && f("https://cdn.fbrq.io/@azerion/splash/assets/scripts/newgroundsio.min.js", Date.now() / 1e3);
}),
t
);
})(),
g = (function () {
function s() {}
return (
(s.preload = function (t) {
var e = Promise.all([
a.instance.load(o.KEY, "".concat(v.ASSET_LOCATION, "json/domains.json?v=").concat(t), "text/plain"),
a.instance.load(s.SITELOCK_PORTALS, "".concat(v.ASSET_LOCATION, "json/sitelock.json?v=").concat(t), "text/plain"),
]);
return (
Promise.all([
a.instance.load(s.INTERNAL_PORTALS_KEY, "".concat(v.ASSET_LOCATION, "json/internal.json?v=").concat(t), "text/plain"),
a.instance.load(s.CONTRACTED_PORTALS_KEY, "".concat(v.ASSET_LOCATION, "json/contracted.json?v=").concat(t), "text/plain"),
a.instance.load(s.SPECIAL_PORTALS_KEY, "".concat(v.ASSET_LOCATION, "json/special.json?v=").concat(t), "text/plain"),
]),
e
.then(function (t) {
var e = t[0],
i = t[1];
o.setList(e), p.loadPortalScript(i), s.setSiteLock(i);
})
.catch(function () {})
);
}),
(s.setSiteLock = function (t) {
s.siteLocks = t;
}),
Object.defineProperty(s, "brandingLogoUrl", {
get: function () {
var t;
switch (
(v.isOnDevice() || l.isAirfi() ? (v.ASSET_LOCATION = "assets/") : "fbrq.io" === v.getSourceSite(!0) && (v.ASSET_LOCATION = "https://" + window.location.host + "/@azerion/splash/assets/"),
v.getBrandingDomain())
) {
case r.BrandingDomain.Spele:
t = "spele";
break;
case r.BrandingDomain.PlayCell:
t = "playcell";
break;
case r.BrandingDomain.GameCell:
t = "gamecell";
break;
case r.BrandingDomain.Yepi:
t = "yepi";
break;
case r.BrandingDomain.Admeen:
t = "admeen";
break;
case r.BrandingDomain.Bild:
t = "bild";
break;
case r.BrandingDomain.Kizi:
t = "kizi";
break;
case r.BrandingDomain.Funnygames:
t = "funnygames";
break;
case r.BrandingDomain.PlayTime:
t = "playtime";
break;
default:
case r.BrandingDomain.AGame:
t = "agame";
break;
case r.BrandingDomain.Zigiz:
t = "zigiz";
}
return v.ASSET_LOCATION + "images/branding_logo_" + t + "_small.png";
},
enumerable: !1,
configurable: !0,
}),
Object.defineProperty(s, "brandingBackgroundColor", {
get: function () {
var t;
switch (v.getBrandingDomain()) {
case r.BrandingDomain.Spele:
t = "#4a72ad";
break;
case r.BrandingDomain.PlayCell:
t = "#52a1e1";
break;
case r.BrandingDomain.GameCell:
t = "#c600b2";
break;
case r.BrandingDomain.Yepi:
t = "#0573a7";
break;
case r.BrandingDomain.AGame:
t = "#0C486C";
break;
case r.BrandingDomain.Admeen:
t = "#4267B2";
break;
case r.BrandingDomain.Bild:
t = "#de0000";
break;
default:
case r.BrandingDomain.Kizi:
t = "#012f50";
break;
case r.BrandingDomain.Funnygames:
t = "#33b0ff";
break;
case r.BrandingDomain.PlayTime:
case r.BrandingDomain.Zigiz:
t = "#023a63";
}
return t;
},
enumerable: !1,
configurable: !0,
}),
(s.blockedDomain = function () {
return v.isOnDevice() || s.isSpecial();
}),
(s.createCampaignURL = function (t, e) {
var i = v.getSourceSite(),
n = v.getBrandingDomain(),
s = d.getProtocol(v.isOnDevice()),
r = d.getDomainURL(n, s),
o = d.getUtmContent(e);
return d.getPromoURL(n, r, i, t, o);
}),
(s.openCampaignLink = function (t, e) {
var i,
n = s.createCampaignURL(t, e);
s.blockedDomain() || ((i = window.open(n)) && i.focus && i.focus());
}),
(s.isInternal = function () {
return s.hostMatchesList(a.instance.get(s.INTERNAL_PORTALS_KEY));
}),
(s.isContracted = function () {
return s.hostMatchesList(a.instance.get(s.CONTRACTED_PORTALS_KEY));
}),
(s.isSpecial = function () {
return s.hostMatchesList(a.instance.get(s.SPECIAL_PORTALS_KEY));
}),
(s.isAdmeen = function () {
if (!s.siteLocks || !s.siteLocks.hasOwnProperty("admeen")) return !1;
var t = s.siteLocks.admeen;
return s.hostMatchesList(t);
}),
(s.isKongregate = function () {
if (!s.siteLocks || !s.siteLocks.hasOwnProperty("kongregate")) return !1;
var t = s.siteLocks.kongregate;
return s.hostMatchesList(t);
}),
(s.isNewgrounds = function () {
if (!s.siteLocks || !s.siteLocks.hasOwnProperty("newgrounds")) return !1;
var t = s.siteLocks.newgrounds;
return s.hostMatchesList(t);
}),
(s.crossPromoAllowed = function () {
var t = s.siteLocks.yandex;
return s.hostMatchesList(t);
}),
(s.outGoingLinksAllowed = function () {
return !(l.isAirfi() || s.isSpecial() || s.isContracted()) && (!window.hasOwnProperty("fbrqLA") || window.fbrqLA);
}),
(s.hostMatchesList = function (t) {
t = t || [];
for (var e = v.getSourceSite(), i = 0; i < t.length; i++) if (e === t[i]) return !0;
return !1;
}),
(s.LOGO_KEY = "branding_logo"),
(s.INTERNAL_PORTALS_KEY = "branding_portals"),
(s.CONTRACTED_PORTALS_KEY = "branding_contracted"),
(s.SPECIAL_PORTALS_KEY = "branding_special"),
(s.SITELOCK_PORTALS = "sitelock_portals"),
(s.DOMAIN_OVERWRITE = null),
(s.analyticsEnabled = !0),
s
);
})(),
v = (function () {
function n() {}
return (
(n.loadHost = function () {
return i(this, void 0, void 0, function () {
var e, i;
return u(this, function (t) {
switch (t.label) {
case 0:
if (((e = document.referrer || window.location.host), !window.hasOwnProperty("gdsdk"))) return [3, 4];
t.label = 1;
case 1:
return t.trys.push([1, 3, , 4]), [4, window.gdsdk.getSession()];
case 2:
return (i = t.sent()), (e = i.location.parentDomain), [3, 4];
case 3:
return t.sent(), [3, 4];
case 4:
return (n.HOST = e), [2];
}
});
});
}),
(n.getSourceSite = function (t) {
void 0 === t && (t = !1);
var e = n.HOST;
if (
(t && (e = window.location.host),
-1 !== e.indexOf("embed.gamedistribution.com") && -1 !== window.location.search.indexOf("gd_sdk_referrer_url") && (e = n.getUrlParameter("gd_sdk_referrer_url") || e),
(e = decodeURIComponent(e)),
l.isBild())
)
return "bildspielt.de";
if (l.isBip()) return "bipgaming.com";
e = (e = -1 < e.indexOf("://") ? e.split("/")[2] : e.split("/")[0]).split(":")[0];
var i = o.getDomain(e);
return null !== i ? i : (3 === e.split(".").length && (e = e.substr(e.indexOf(".") + 1)), e);
}),
(n.getBrandingDomain = function () {
if (window.hasOwnProperty("fbrqBD") && window.fbrqBD in r.BrandingDomain) return window.fbrqBD;
if (g.DOMAIN_OVERWRITE) return g.DOMAIN_OVERWRITE;
var t = n.getSourceSite();
if (g.isAdmeen()) return r.BrandingDomain.Admeen;
if (l.isPlaycellApp() || l.isBip()) return r.BrandingDomain.PlayCell;
switch (t) {
case "spele.nl":
return r.BrandingDomain.Spele;
case "yepi.com":
return r.BrandingDomain.Yepi;
case "oyunskor.com":
case "barbioyunu.com.tr":
case "bebekoyunu.com.tr":
case "oyunkolu.com":
case "oyungemisi.com":
case "oyunlar1.com":
case "oyunkuzusu.com":
case "kraloyun.com":
case "rekoroyun.com":
case "oyundedem.com":
case "oyunoyna.com":
case "pastaoyunu.com.tr":
case "playcell.com":
return r.BrandingDomain.PlayCell;
case "gamecell.com":
return r.BrandingDomain.GameCell;
case "playxl.com":
return r.BrandingDomain.Admeen;
case "kizi.com":
return r.BrandingDomain.Kizi;
case "bildspielt.de":
return r.BrandingDomain.Bild;
case "funnygames.nl":
return r.BrandingDomain.Funnygames;
case "playtime.nl":
return r.BrandingDomain.PlayTime;
default:
case "agame.com":
return r.BrandingDomain.AGame;
case "gmbl.nl":
case "zigiz.com":
return r.BrandingDomain.Zigiz;
case "coolmathgames.com":
return r.BrandingDomain.Neutral;
}
}),
(n.getReferrer = function (t) {
return -1 !== t.indexOf("?ref=") ? t.substr(t.indexOf("?ref=") + 5) : t;
}),
(n.inIframe = function () {
try {
return window.self !== window.top;
} catch (t) {
return !0;
}
}),
(n.inGDGameZone = function () {
return -1 !== document.referrer.indexOf("html5.gamedistribution.com");
}),
(n.getDomain = function (t) {
var e = document.createElement("a");
return (e.href = t), e.origin;
}),
(n.isOnDevice = function () {
return void 0 !== window.cordova && !/(gamedistribution\.com)/.test(window.location.hostname);
}),
(n.isTc = function () {
return /(teamcity\.azerdev\.com)/.test(window.location.host);
}),
(n.getRandomRange = function (t, e) {
return (Math.random() * (e - t) + t) | 0;
}),
(n.getUrlParameter = function (t) {
t = t.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var e = new RegExp("[\\?&]" + t + "=([^]*)").exec(location.search);
return null === e ? "" : decodeURIComponent(e[1].replace(/\+/g, " "));
}),
(n.intTimeToString = function (t) {
var e = Math.floor(t / 3600),
i = Math.floor((t % 3600) / 60),
n = t % 60;
return (e < 10 ? "0" + e : e.toString()) + ":" + (i < 10 ? "0" + i : i.toString()) + ":" + (n < 10 ? "0" + n : n.toString());
}),
(n.LANGUAGE = "en"),
(n.HOST = document.referrer || window.location.host),
(n.ASSET_LOCATION = window.hasOwnProperty("fbrqSA") && !0 === window.fbrqSA ? "assets/" : "https://cdn.fbrq.io/@azerion/splash/assets/"),
n
);
})(),
y = t(function (t, e) {
t.exports = (function r(o, a, h) {
function l(i, t) {
if (!a[i]) {
if (!o[i]) {
var e = c;
if (!t && e) return e(i, !0);
if (u) return u(i, !0);
var n = new Error("Cannot find module '" + i + "'");
throw ((n.code = "MODULE_NOT_FOUND"), n);
}
var s = (a[i] = { exports: {} });
o[i][0].call(
s.exports,
function (t) {
var e = o[i][1][t];
return l(e || t);
},
s,
s.exports,
r,
o,
a,
h
);
}
return a[i].exports;
}
for (var u = c, t = 0; t < h.length; t++) l(h[t]);
return l;
})(
{
1: [
function (t, n, b) {
(function () {
var v,
e = this || Function("return this")(),
y = (function () {
var c,
i,
d,
f,
p,
g,
t = Date.now
? Date.now
: function () {
return +new Date();
},
v = "undefined" != typeof SHIFTY_DEBUG_NOW ? SHIFTY_DEBUG_NOW : t;
function s() {}
function r(t, e) {
var i;
for (i in t) Object.hasOwnProperty.call(t, i) && e(i);
}
function o(e, i) {
return (
r(i, function (t) {
e[t] = i[t];
}),
e
);
}
function a(e, i) {
r(i, function (t) {
void 0 === e[t] && (e[t] = i[t]);
});
}
function y(t, e, i, n, s, r, o) {
var a,
h,
l,
u = t < r ? 0 : (t - r) / s;
for (a in e) e.hasOwnProperty(a) && ((h = o[a]), (l = "function" == typeof h ? h : c[h]), (e[a] = m(i[a], n[a], l, u)));
return e;
}
function m(t, e, i, n) {
return t + (e - t) * i(n);
}
function x(e, i) {
var n = u.prototype.filter,
s = e._filterArgs;
r(n, function (t) {
void 0 !== n[t][i] && n[t][i].apply(e, s);
});
}
function h(t, e, i, n, s, r, o, a, h, l, u) {
(d = e + i + n),
(f = Math.min(u || v(), d)),
(p = d <= f),
(g = n - (d - f)),
t.isPlaying() &&
(p
? (h(o, t._attachment, g), t.stop(!0))
: ((t._scheduleId = l(t._timeoutHandler, 1e3 / 60)),
x(t, "beforeTween"),
f < e + i ? y(1, s, r, o, 1, 1, a) : y(f, s, r, o, n, e + i, a),
x(t, "afterTween"),
h(s, t._attachment, g)));
}
function l(t, e) {
var i = {},
n = typeof e;
return (
r(
t,
"string" === n || "function" === n
? function (t) {
i[t] = e;
}
: function (t) {
i[t] || (i[t] = e[t] || "linear");
}
),
i
);
}
function u(t, e) {
(this._currentState = t || {}), (this._configured = !1), (this._scheduleFunction = i), void 0 !== e && this.setConfig(e);
}
return (
(i =
("undefined" != typeof window &&
(window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
(window.mozCancelRequestAnimationFrame && window.mozRequestAnimationFrame))) ||
setTimeout),
(u.prototype.tween = function (t) {
return this._isTweening ? this : ((void 0 === t && this._configured) || this.setConfig(t), (this._timestamp = v()), this._start(this.get(), this._attachment), this.resume());
}),
(u.prototype.setConfig = function (t) {
(t = t || {}),
(this._configured = !0),
(this._attachment = t.attachment),
(this._pausedAtTime = null),
(this._scheduleId = null),
(this._delay = t.delay || 0),
(this._start = t.start || s),
(this._step = t.step || s),
(this._finish = t.finish || s),
(this._duration = t.duration || 500),
(this._currentState = o({}, t.from || this.get())),
(this._originalState = this.get()),
(this._targetState = o({}, t.to || this.get()));
var e = this;
this._timeoutHandler = function () {
h(e, e._timestamp, e._delay, e._duration, e._currentState, e._originalState, e._targetState, e._easing, e._step, e._scheduleFunction);
};
var i = this._currentState,
n = this._targetState;
return a(n, i), (this._easing = l(i, t.easing || "linear")), (this._filterArgs = [i, this._originalState, n, this._easing]), x(this, "tweenCreated"), this;
}),
(u.prototype.get = function () {
return o({}, this._currentState);
}),
(u.prototype.set = function (t) {
this._currentState = t;
}),
(u.prototype.pause = function () {
return (this._pausedAtTime = v()), (this._isPaused = !0), this;
}),
(u.prototype.resume = function () {
return this._isPaused && (this._timestamp += v() - this._pausedAtTime), (this._isPaused = !1), (this._isTweening = !0), this._timeoutHandler(), this;
}),
(u.prototype.seek = function (t) {
t = Math.max(t, 0);
var e = v();
return (
this._timestamp + t === 0 ||
((this._timestamp = e - t),
this.isPlaying() ||
((this._isTweening = !0),
(this._isPaused = !1),
h(this, this._timestamp, this._delay, this._duration, this._currentState, this._originalState, this._targetState, this._easing, this._step, this._scheduleFunction, e),
this.pause())),
this
);
}),
(u.prototype.stop = function (t) {
return (
(this._isTweening = !1),
(this._isPaused = !1),
(this._timeoutHandler = s),
(e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.oCancelAnimationFrame || e.msCancelAnimationFrame || e.mozCancelRequestAnimationFrame || e.clearTimeout)(this._scheduleId),
t &&
(x(this, "beforeTween"),
y(1, this._currentState, this._originalState, this._targetState, 1, 0, this._easing),
x(this, "afterTween"),
x(this, "afterTweenEnd"),
this._finish.call(this, this._currentState, this._attachment)),
this
);
}),
(u.prototype.isPlaying = function () {
return this._isTweening && !this._isPaused;
}),
(u.prototype.setScheduleFunction = function (t) {
this._scheduleFunction = t;
}),
(u.prototype.dispose = function () {
var t;
for (t in this) this.hasOwnProperty(t) && delete this[t];
}),
(u.prototype.filter = {}),
(c = u.prototype.formula = {
linear: function (t) {
return t;
},
}),
o(u, { now: v, each: r, tweenProps: y, tweenProp: m, applyFilter: x, shallowCopy: o, defaults: a, composeEasingObject: l }),
"function" == typeof SHIFTY_DEBUG_NOW && (e.timeoutHandler = h),
"object" == typeof b ? (n.exports = u) : void 0 === e.Tweenable && (e.Tweenable = u),
u
);
})();
y.shallowCopy(y.prototype.formula, {
easeInQuad: function (t) {
return Math.pow(t, 2);
},
easeOutQuad: function (t) {
return -(Math.pow(t - 1, 2) - 1);
},
easeInOutQuad: function (t) {
return (t /= 0.5) < 1 ? 0.5 * Math.pow(t, 2) : -0.5 * ((t -= 2) * t - 2);
},
easeInCubic: function (t) {
return Math.pow(t, 3);
},
easeOutCubic: function (t) {
return Math.pow(t - 1, 3) + 1;
},
easeInOutCubic: function (t) {
return (t /= 0.5) < 1 ? 0.5 * Math.pow(t, 3) : 0.5 * (Math.pow(t - 2, 3) + 2);
},
easeInQuart: function (t) {
return Math.pow(t, 4);
},
easeOutQuart: function (t) {
return -(Math.pow(t - 1, 4) - 1);
},
easeInOutQuart: function (t) {
return (t /= 0.5) < 1 ? 0.5 * Math.pow(t, 4) : -0.5 * ((t -= 2) * Math.pow(t, 3) - 2);
},
easeInQuint: function (t) {
return Math.pow(t, 5);
},
easeOutQuint: function (t) {
return Math.pow(t - 1, 5) + 1;
},
easeInOutQuint: function (t) {
return (t /= 0.5) < 1 ? 0.5 * Math.pow(t, 5) : 0.5 * (Math.pow(t - 2, 5) + 2);
},
easeInSine: function (t) {
return 1 - Math.cos(t * (Math.PI / 2));
},
easeOutSine: function (t) {
return Math.sin(t * (Math.PI / 2));
},
easeInOutSine: function (t) {
return -0.5 * (Math.cos(Math.PI * t) - 1);
},
easeInExpo: function (t) {
return 0 === t ? 0 : Math.pow(2, 10 * (t - 1));
},
easeOutExpo: function (t) {
return 1 === t ? 1 : 1 - Math.pow(2, -10 * t);
},
easeInOutExpo: function (t) {
return 0 === t ? 0 : 1 === t ? 1 : (t /= 0.5) < 1 ? 0.5 * Math.pow(2, 10 * (t - 1)) : 0.5 * (2 - Math.pow(2, -10 * --t));
},
easeInCirc: function (t) {
return -(Math.sqrt(1 - t * t) - 1);
},
easeOutCirc: function (t) {
return Math.sqrt(1 - Math.pow(t - 1, 2));
},
easeInOutCirc: function (t) {
return (t /= 0.5) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);
},
easeOutBounce: function (t) {
return t < 1 / 2.75
? 7.5625 * t * t
: t < 2 / 2.75
? 7.5625 * (t -= 1.5 / 2.75) * t + 0.75
: t < 2.5 / 2.75
? 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375
: 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375;
},
easeInBack: function (t) {
return t * t * (2.70158 * t - 1.70158);
},
easeOutBack: function (t) {
return (t -= 1) * t * (2.70158 * t + 1.70158) + 1;
},
easeInOutBack: function (t) {
var e = 1.70158;
return (t /= 0.5) < 1 ? t * t * ((1 + (e *= 1.525)) * t - e) * 0.5 : 0.5 * ((t -= 2) * t * ((1 + (e *= 1.525)) * t + e) + 2);
},
elastic: function (t) {
return -1 * Math.pow(4, -8 * t) * Math.sin(((6 * t - 1) * (2 * Math.PI)) / 2) + 1;
},
swingFromTo: function (t) {
var e = 1.70158;
return (t /= 0.5) < 1 ? t * t * ((1 + (e *= 1.525)) * t - e) * 0.5 : 0.5 * ((t -= 2) * t * ((1 + (e *= 1.525)) * t + e) + 2);
},
swingFrom: function (t) {
return t * t * (2.70158 * t - 1.70158);
},
swingTo: function (t) {
return (t -= 1) * t * (2.70158 * t + 1.70158) + 1;
},
bounce: function (t) {
return t < 1 / 2.75
? 7.5625 * t * t
: t < 2 / 2.75
? 7.5625 * (t -= 1.5 / 2.75) * t + 0.75
: t < 2.5 / 2.75
? 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375
: 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375;
},
bouncePast: function (t) {
return t < 1 / 2.75
? 7.5625 * t * t
: t < 2 / 2.75
? 2 - (7.5625 * (t -= 1.5 / 2.75) * t + 0.75)
: t < 2.5 / 2.75
? 2 - (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375)
: 2 - (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375);
},
easeFromTo: function (t) {
return (t /= 0.5) < 1 ? 0.5 * Math.pow(t, 4) : -0.5 * ((t -= 2) * Math.pow(t, 3) - 2);
},
easeFrom: function (t) {
return Math.pow(t, 4);
},
easeTo: function (t) {
return Math.pow(t, 0.25);
},
}),
(function () {
function u(t, e, i, n, s, r) {
var o,
l = 0,
u = 0,
c = 0,
a = 0,
h = 0,
d = 0;
function f(t) {
return ((l * t + u) * t + c) * t;
}
function p(t) {
return 0 <= t ? t : 0 - t;
}
function g(t, e) {
var i, n, s, r, o, a, h;
for (s = t, a = 0; a < 8; a++) {
if (p((r = f(s) - t)) < e) return s;
if (p((o = (3 * l * (h = s) + 2 * u) * h + c)) < 1e-6) break;
s -= r / o;
}
if (((n = 1), (s = t) < (i = 0))) return i;
if (n < s) return n;
for (; i < n; ) {
if (p((r = f(s)) - t) < e) return s;
r < t ? (i = s) : (n = s), (s = 0.5 * (n - i) + i);
}
return s;
}
return (l = 1 - (c = 3 * e) - (u = 3 * (n - e) - c)), (a = 1 - (d = 3 * i) - (h = 3 * (s - i) - d)), (o = g(t, 1 / (200 * r))), ((a * o + h) * o + d) * o;
}
(y.setBezierFunction = function (t, e, i, n, s) {
var r,
o,
a,
h,
l =
((r = e),
(o = i),
(a = n),
(h = s),
function (t) {
return u(t, r, o, a, h, 1);
});
return (l.displayName = t), (l.x1 = e), (l.y1 = i), (l.x2 = n), (l.y2 = s), (y.prototype.formula[t] = l);
}),
(y.unsetBezierFunction = function (t) {
delete y.prototype.formula[t];
});
})(),
((v = new y())._filterArgs = []),
(y.interpolate = function (t, e, i, n, s) {
var r = y.shallowCopy({}, t),
o = s || 0,
a = y.composeEasingObject(t, n || "linear");
v.set({});
var h = v._filterArgs;
(h.length = 0), (h[0] = r), (h[1] = t), (h[2] = e), (h[3] = a), y.applyFilter(v, "tweenCreated"), y.applyFilter(v, "beforeTween");
var l,
u,
c,
d,
f,
p,
g = ((l = t), (u = r), (c = e), (d = i), (f = a), (p = o), y.tweenProps(d, u, l, c, 1, p, f));
return y.applyFilter(v, "afterTween"), g;
}),
(function (a) {
var h = /(\d|\-|\.)/,
l = /([^\-0-9\.]+)/g,
r = /[0-9.\-]+/g,
o = new RegExp("rgb\\(" + r.source + /,\s*/.source + r.source + /,\s*/.source + r.source + "\\)", "g"),
u = /^.*\(/,
n = /#([0-9]|[a-f]){3,6}/gi,
c = "VAL";
function s(i) {
a.each(i, function (t) {
var e = i[t];
"string" == typeof e && e.match(n) && (i[t] = g(n, e, d));
});
}
function d(t) {
var e,
i =
(3 === (e = (e = t).replace(/#/, "")).length && (e = (e = e.split(""))[0] + e[0] + e[1] + e[1] + e[2] + e[2]),
(f[0] = p(e.substr(0, 2))),
(f[1] = p(e.substr(2, 2))),
(f[2] = p(e.substr(4, 2))),
f);
return "rgb(" + i[0] + "," + i[1] + "," + i[2] + ")";
}
var f = [];
function p(t) {
return parseInt(t, 16);
}
function g(t, e, i) {
var n = e.match(t),
s = e.replace(t, c);
if (n) for (var r, o = n.length, a = 0; a < o; a++) (r = n.shift()), (s = s.replace(c, i(r)));
return s;
}
function v(t) {
for (var e = t.match(r), i = e.length, n = t.match(u)[0], s = 0; s < i; s++) n += parseInt(e[s], 10) + ",";
return (n = n.slice(0, -1) + ")");
}
function y(r) {
var o = {};
return (
a.each(r, function (t) {
var e,
i,
n = r[t];
if ("string" == typeof n) {
var s = w(n);
o[t] = {
formatString: ((e = n), (i = e.match(l)), i ? (1 === i.length || e.charAt(0).match(h)) && i.unshift("") : (i = ["", ""]), i.join(c)),
chunkNames: (function (t, e) {
var i,
n = [],
s = t.length;
for (i = 0; i < s; i++) n.push("_" + e + "_" + i);
return n;
})(s, t),
};
}
}),
o
);
}
function m(r, o) {
a.each(o, function (t) {
for (var e = r[t], i = w(e), n = i.length, s = 0; s < n; s++) r[o[t].chunkNames[s]] = +i[s];
delete r[t];
});
}
function x(s, r) {
a.each(r, function (t) {
var e = s[t],
i = (function (t, e) {
for (var i, n = {}, s = e.length, r = 0; r < s; r++) (i = e[r]), (n[i] = t[i]), delete t[i];
return n;
})(s, r[t].chunkNames),
n = (function (t, e) {
b.length = 0;
for (var i = e.length, n = 0; n < i; n++) b.push(t[e[n]]);
return b;
})(i, r[t].chunkNames);
(e = (function (t, e) {
for (var i = t, n = e.length, s = 0; s < n; s++) i = i.replace(c, +e[s].toFixed(4));
return i;
})(r[t].formatString, n)),
(s[t] = g(o, e, v));
});
}
var b = [];
function w(t) {
return t.match(r);
}
a.prototype.filter.token = {
tweenCreated: function (t, e, i, n) {
s(t), s(e), s(i), (this._tokenData = y(t));
},
beforeTween: function (t, e, i, n) {
var h, l;
(h = n),
(l = this._tokenData),
a.each(l, function (t) {
var e,
i = l[t],
n = i.chunkNames,
s = n.length,
r = h[t];
if ("string" == typeof r) {
var o = r.split(" "),
a = o[o.length - 1];
for (e = 0; e < s; e++) h[n[e]] = o[e] || a;
} else for (e = 0; e < s; e++) h[n[e]] = r;
delete h[t];
}),
m(t, this._tokenData),
m(e, this._tokenData),
m(i, this._tokenData);
},
afterTween: function (t, e, i, n) {
var h, l;
x(t, this._tokenData),
x(e, this._tokenData),
x(i, this._tokenData),
(h = n),
(l = this._tokenData),
a.each(l, function (t) {
var e = l[t],
i = e.chunkNames,
n = i.length,
s = h[i[0]],
r = typeof s;
if ("string" === r) {
for (var o = "", a = 0; a < n; a++) (o += " " + h[i[a]]), delete h[i[a]];
h[t] = o.substr(1);
} else h[t] = s;
});
},
};
})(y);
}.call(null));
},
{},
],
2: [
function (t, e, i) {
var n = t("./shape"),
s = t("./utils"),
r = function (t, e) {
(this._pathTemplate = "M 50,50 m 0,-{radius} a {radius},{radius} 0 1 1 0,{2radius} a {radius},{radius} 0 1 1 0,-{2radius}"), (this.containerAspectRatio = 1), n.apply(this, arguments);
};
(((r.prototype = new n()).constructor = r).prototype._pathString = function (t) {
var e = t.strokeWidth;
t.trailWidth && t.trailWidth > t.strokeWidth && (e = t.trailWidth);
var i = 50 - e / 2;
return s.render(this._pathTemplate, { radius: i, "2radius": 2 * i });
}),
(r.prototype._trailString = function (t) {
return this._pathString(t);
}),
(e.exports = r);
},
{ "./shape": 7, "./utils": 9 },
],
3: [
function (t, e, i) {
var n = t("./shape"),
s = t("./utils"),
r = function (t, e) {
(this._pathTemplate = "M 0,{center} L 100,{center}"), n.apply(this, arguments);
};
(((r.prototype = new n()).constructor = r).prototype._initializeSvg = function (t, e) {
t.setAttribute("viewBox", "0 0 100 " + e.strokeWidth), t.setAttribute("preserveAspectRatio", "none");
}),
(r.prototype._pathString = function (t) {
return s.render(this._pathTemplate, { center: t.strokeWidth / 2 });
}),
(r.prototype._trailString = function (t) {
return this._pathString(t);
}),
(e.exports = r);
},
{ "./shape": 7, "./utils": 9 },
],
4: [
function (t, e, i) {
e.exports = { Line: t("./line"), Circle: t("./circle"), SemiCircle: t("./semicircle"), Square: t("./square"), Path: t("./path"), Shape: t("./shape"), utils: t("./utils") };
},
{ "./circle": 2, "./line": 3, "./path": 5, "./semicircle": 6, "./shape": 7, "./square": 8, "./utils": 9 },
],
5: [
function (t, e, i) {
var u = t("shifty"),
c = t("./utils"),
n = { easeIn: "easeInCubic", easeOut: "easeOutCubic", easeInOut: "easeInOutCubic" },
s = function t(e, i) {
if (!(this instanceof t)) throw new Error("Constructor was called without new keyword");
var n;
(i = c.extend({ duration: 800, easing: "linear", from: {}, to: {}, step: function () {} }, i)),
(n = c.isString(e) ? document.querySelector(e) : e),
(this.path = n),
(this._opts = i),
(this._tweenable = null);
var s = this.path.getTotalLength();
(this.path.style.strokeDasharray = s + " " + s), this.set(0);
};
(s.prototype.value = function () {
var t = this._getComputedDashOffset(),
e = this.path.getTotalLength(),
i = 1 - t / e;
return parseFloat(i.toFixed(6), 10);
}),
(s.prototype.set = function (t) {
this.stop(), (this.path.style.strokeDashoffset = this._progressToOffset(t));
var e = this._opts.step;
if (c.isFunction(e)) {
var i = this._easing(this._opts.easing),
n = this._calculateTo(t, i),
s = this._opts.shape || this;
e(n, s, this._opts.attachment);
}
}),
(s.prototype.stop = function () {
this._stopTween(), (this.path.style.strokeDashoffset = this._getComputedDashOffset());
}),
(s.prototype.animate = function (t, i, e) {
(i = i || {}), c.isFunction(i) && ((e = i), (i = {}));
var n = c.extend({}, i),
s = c.extend({}, this._opts);
i = c.extend(s, i);
var r = this._easing(i.easing),
o = this._resolveFromAndTo(t, r, n);
this.stop(), this.path.getBoundingClientRect();
var a = this._getComputedDashOffset(),
h = this._progressToOffset(t),
l = this;
(this._tweenable = new u()),
this._tweenable.tween({
from: c.extend({ offset: a }, o.from),
to: c.extend({ offset: h }, o.to),
duration: i.duration,
easing: r,
step: function (t) {
l.path.style.strokeDashoffset = t.offset;
var e = i.shape || l;
i.step(t, e, i.attachment);
},
finish: function (t) {
c.isFunction(e) && e();
},
});
}),
(s.prototype._getComputedDashOffset = function () {
var t = window.getComputedStyle(this.path, null);
return parseFloat(t.getPropertyValue("stroke-dashoffset"), 10);
}),
(s.prototype._progressToOffset = function (t) {
var e = this.path.getTotalLength();
return e - t * e;
}),
(s.prototype._resolveFromAndTo = function (t, e, i) {
return i.from && i.to ? { from: i.from, to: i.to } : { from: this._calculateFrom(e), to: this._calculateTo(t, e) };
}),
(s.prototype._calculateFrom = function (t) {
return u.interpolate(this._opts.from, this._opts.to, this.value(), t);
}),
(s.prototype._calculateTo = function (t, e) {
return u.interpolate(this._opts.from, this._opts.to, t, e);
}),
(s.prototype._stopTween = function () {
null !== this._tweenable && (this._tweenable.stop(), (this._tweenable = null));
}),
(s.prototype._easing = function (t) {
return n.hasOwnProperty(t) ? n[t] : t;
}),
(e.exports = s);
},
{ "./utils": 9, shifty: 1 },
],
6: [
function (t, e, i) {
var n = t("./shape"),
s = t("./circle"),
r = t("./utils"),
o = function (t, e) {
(this._pathTemplate = "M 50,50 m -{radius},0 a {radius},{radius} 0 1 1 {2radius},0"), (this.containerAspectRatio = 2), n.apply(this, arguments);
};
(((o.prototype = new n()).constructor = o).prototype._initializeSvg = function (t, e) {
t.setAttribute("viewBox", "0 0 100 50");
}),
(o.prototype._initializeTextContainer = function (t, e, i) {
t.text.style && ((i.style.top = "auto"), (i.style.bottom = "0"), t.text.alignToBottom ? r.setStyle(i, "transform", "translate(-50%, 0)") : r.setStyle(i, "transform", "translate(-50%, 50%)"));
}),
(o.prototype._pathString = s.prototype._pathString),
(o.prototype._trailString = s.prototype._trailString),
(e.exports = o);
},
{ "./circle": 2, "./shape": 7, "./utils": 9 },
],
7: [
function (t, e, i) {
var o = t("./path"),
a = t("./utils"),
n = "Object is destroyed",
s = function t(e, i) {
if (!(this instanceof t)) throw new Error("Constructor was called without new keyword");
if (0 !== arguments.length) {
(this._opts = a.extend(
{
color: "#555",
strokeWidth: 1,
trailColor: null,
trailWidth: null,
fill: null,
text: {
style: { color: null, position: "absolute", left: "50%", top: "50%", padding: 0, margin: 0, transform: { prefix: !0, value: "translate(-50%, -50%)" } },
autoStyleContainer: !0,
alignToBottom: !0,
value: null,
className: "progressbar-text",
},
svgStyle: { display: "block", width: "100%" },
warnings: !1,
},
i,
!0
)),
a.isObject(i) && void 0 !== i.svgStyle && (this._opts.svgStyle = i.svgStyle),
a.isObject(i) && a.isObject(i.text) && void 0 !== i.text.style && (this._opts.text.style = i.text.style);
var n,
s = this._createSvgView(this._opts);
if (!(n = a.isString(e) ? document.querySelector(e) : e)) throw new Error("Container does not exist: " + e);
(this._container = n),
this._container.appendChild(s.svg),
this._opts.warnings && this._warnContainerAspectRatio(this._container),
this._opts.svgStyle && a.setStyles(s.svg, this._opts.svgStyle),
(this.svg = s.svg),
(this.path = s.path),
(this.trail = s.trail),
(this.text = null);
var r = a.extend({ attachment: void 0, shape: this }, this._opts);
(this._progressPath = new o(s.path, r)), a.isObject(this._opts.text) && null !== this._opts.text.value && this.setText(this._opts.text.value);
}
};
(s.prototype.animate = function (t, e, i) {
if (null === this._progressPath) throw new Error(n);
this._progressPath.animate(t, e, i);
}),
(s.prototype.stop = function () {
if (null === this._progressPath) throw new Error(n);
void 0 !== this._progressPath && this._progressPath.stop();
}),
(s.prototype.destroy = function () {
if (null === this._progressPath) throw new Error(n);
this.stop(),
this.svg.parentNode.removeChild(this.svg),
(this.svg = null),
(this.path = null),
(this.trail = null),
(this._progressPath = null) !== this.text && (this.text.parentNode.removeChild(this.text), (this.text = null));
}),
(s.prototype.set = function (t) {
if (null === this._progressPath) throw new Error(n);
this._progressPath.set(t);
}),
(s.prototype.value = function () {
if (null === this._progressPath) throw new Error(n);
return void 0 === this._progressPath ? 0 : this._progressPath.value();
}),
(s.prototype.setText = function (t) {
if (null === this._progressPath) throw new Error(n);
null === this.text && ((this.text = this._createTextContainer(this._opts, this._container)), this._container.appendChild(this.text)),
a.isObject(t) ? (a.removeChildren(this.text), this.text.appendChild(t)) : (this.text.innerHTML = t);
}),
(s.prototype._createSvgView = function (t) {
var e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
this._initializeSvg(e, t);
var i = null;
(t.trailColor || t.trailWidth) && ((i = this._createTrail(t)), e.appendChild(i));
var n = this._createPath(t);
return e.appendChild(n), { svg: e, path: n, trail: i };
}),
(s.prototype._initializeSvg = function (t, e) {
t.setAttribute("viewBox", "0 0 100 100");
}),
(s.prototype._createPath = function (t) {
var e = this._pathString(t);
return this._createPathElement(e, t);
}),
(s.prototype._createTrail = function (t) {
var e = this._trailString(t),
i = a.extend({}, t);
return (
i.trailColor || (i.trailColor = "#eee"), i.trailWidth || (i.trailWidth = i.strokeWidth), (i.color = i.trailColor), (i.strokeWidth = i.trailWidth), (i.fill = null), this._createPathElement(e, i)
);
}),
(s.prototype._createPathElement = function (t, e) {
var i = document.createElementNS("http://www.w3.org/2000/svg", "path");
return i.setAttribute("d", t), i.setAttribute("stroke", e.color), i.setAttribute("stroke-width", e.strokeWidth), e.fill ? i.setAttribute("fill", e.fill) : i.setAttribute("fill-opacity", "0"), i;
}),
(s.prototype._createTextContainer = function (t, e) {
var i = document.createElement("div");
i.className = t.text.className;
var n = t.text.style;
return n && (t.text.autoStyleContainer && (e.style.position = "relative"), a.setStyles(i, n), n.color || (i.style.color = t.color)), this._initializeTextContainer(t, e, i), i;
}),
(s.prototype._initializeTextContainer = function (t, e, i) {}),
(s.prototype._pathString = function (t) {
throw new Error("Override this function for each progress bar");
}),
(s.prototype._trailString = function (t) {
throw new Error("Override this function for each progress bar");
}),
(s.prototype._warnContainerAspectRatio = function (t) {
if (this.containerAspectRatio) {
var e = window.getComputedStyle(t, null),
i = parseFloat(e.getPropertyValue("width"), 10),
n = parseFloat(e.getPropertyValue("height"), 10);
a.floatEquals(this.containerAspectRatio, i / n);
}
}),
(e.exports = s);
},
{ "./path": 5, "./utils": 9 },
],
8: [
function (t, e, i) {
var n = t("./shape"),
s = t("./utils"),
r = function (t, e) {
(this._pathTemplate = "M 0,{halfOfStrokeWidth} L {width},{halfOfStrokeWidth} L {width},{width} L {halfOfStrokeWidth},{width} L {halfOfStrokeWidth},{strokeWidth}"),
(this._trailTemplate = "M {startMargin},{halfOfStrokeWidth} L {width},{halfOfStrokeWidth} L {width},{width} L {halfOfStrokeWidth},{width} L {halfOfStrokeWidth},{halfOfStrokeWidth}"),
n.apply(this, arguments);
};
(((r.prototype = new n()).constructor = r).prototype._pathString = function (t) {
var e = 100 - t.strokeWidth / 2;
return s.render(this._pathTemplate, { width: e, strokeWidth: t.strokeWidth, halfOfStrokeWidth: t.strokeWidth / 2 });
}),
(r.prototype._trailString = function (t) {
var e = 100 - t.strokeWidth / 2;
return s.render(this._trailTemplate, { width: e, strokeWidth: t.strokeWidth, halfOfStrokeWidth: t.strokeWidth / 2, startMargin: t.strokeWidth / 2 - t.trailWidth / 2 });
}),
(e.exports = r);
},
{ "./shape": 7, "./utils": 9 },
],
9: [
function (t, e, i) {
var o = "Webkit Moz O ms".split(" ");
function n(t, e, i) {
for (var n = t.style, s = 0; s < o.length; ++s) {
var r = o[s];
n[r + a(e)] = i;
}
n[e] = i;
}
function a(t) {
return t.charAt(0).toUpperCase() + t.slice(1);
}
function h(t) {
if (((e = t), "[object Array]" === Object.prototype.toString.call(e))) return !1;
var e,
i = typeof t;
return "object" === i && !!t;
}
function s(t, e) {
for (var i in t)
if (t.hasOwnProperty(i)) {
var n = t[i];
e(n, i);
}
}
e.exports = {
extend: function t(e, i, n) {
for (var s in ((e = e || {}), (n = n || !1), (i = i || {})))
if (i.hasOwnProperty(s)) {
var r = e[s],
o = i[s];
n && h(r) && h(o) ? (e[s] = t(r, o, n)) : (e[s] = o);
}
return e;
},
render: function (t, e) {
var i = t;
for (var n in e)
if (e.hasOwnProperty(n)) {
var s = e[n],
r = "\\{" + n + "\\}",
o = new RegExp(r, "g");
i = i.replace(o, s);
}
return i;
},
setStyle: n,
setStyles: function (i, t) {
s(t, function (t, e) {
null != t && (h(t) && !0 === t.prefix ? n(i, e, t.value) : (i.style[e] = t));
});
},
capitalize: a,
isString: function (t) {
return "string" == typeof t || t instanceof String;
},
isFunction: function (t) {
return "function" == typeof t;
},
isObject: h,
forEachObject: s,
floatEquals: function (t, e) {
return Math.abs(t - e) < 0.001;
},
removeChildren: function (t) {
for (; t.firstChild; ) t.removeChild(t.firstChild);
},
};
},
{},
],
},
{},
[4]
)(4);
});
var m = (function () {
function e(t) {
(this.circleLoader = null),
(this.loaded = !1),
(this.showPlayButton = "undefined" == typeof playBtn || playBtn),
(this.progress = 0),
(this.options = { gameId: "12346", gameTitle: "Place Holder", gameName: "place-holder", libs: [], version: "dev", barColor: "white", gaMeasurementId: "none" }),
(this.options.gameId = t.gameId),
(this.options.gameTitle = t.gameTitle),
(this.options.version = t.version),
(this.options.barColor = t.barColor ? t.barColor : this.options.barColor),
(this.options.libs = t.libs),
(this.options.gaMeasurementId = t.gaMeasurementId);
}
return (
(e.getInstance = function (t) {
if (!e.instance) {
if (!t) throw new Error("Can not create new SplashLoader instance without options!");
e.instance = new e(t);
}
return e.instance;
}),
(e.prototype.create = function () {
return i(this, void 0, void 0, function () {
var n, s, r, o, a, h, l;
return u(this, function (t) {
switch (t.label) {
case 0:
return (
(n =
"\n #h5branding-center {\n position: absolute;\n top: 45%;\n left: 50%;\n transform: translate(-50%, -20%);\n text-align: center;\n width: 100%;\n }\n #h5branding-wrapper {\n position: relative;\n z-index: 665;\n width: 150px;\n height: 150px;\n display:inline-block;\n margin: 35px 40px 96px 40px;\n }\n\n #h5branding-version {\n position: absolute;\n right: 10px;\n font-family: Helvetica, Arial, sans-serif;\n color: #ffffff;\n font-size: 0.8em;\n top: 10px;\n display: none;\n }\n\n #h5branding-wrapper > #h5branding-bar, #h5branding-wrapper > img {\n box-shadow: inset 10px 10px 20px 5px rgba(0, 0, 0, 0.5);\n border-radius: 50%;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n #h5branding-ad {\n position: relative;\n z-index: 667;\n border-radius: 5px;\n border: 3px solid white;\n background: rgba(256, 256, 256, 0.2);\n width: 336px;\n height: 280px;\n display: none;\n margin: 0px 10px 0px 10px;\n }\n\n #h5branding-wrapper > img {\n /* Needs appropriate vendor prefixes */\n box-sizing: border-box;\n\n /* This needs to be equal to strokeWidth */\n padding: 4%;\n }\n\n #h5branding-wrapper > img {\n border-radius: 50%;\n box-shadow: inset 0 5px 5px rgba(0, 0, 0, 0.5), 5px 5px 7px rgba(0, 0, 0, 0.3);\n }\n\n #h5branding-container {\n box-sizing: border-box;\n position: absolute;\n z-index: 664;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: #000;\n overflow: hidden;\n }\n\n #h5branding-background {\n position: absolute;\n top: -25%;\n left: -25%;\n width: 150%;\n height: 150%;\n background-blend-mode: multiply;\n background-size: cover;\n filter: blur(40px) brightness(1.5);\n }\n\n @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {\n /* IE10+ CSS styles go here */\n #h5branding-background {\n background-image: none !important;\n }\n }\n\n #h5branding-logo {\n position: absolute;\n margin: 0 auto;\n left: 0;\n right: 0;\n text-align: center;\n top: 10%;\n }\n\n #h5branding-logo > img {\n height: 150px;\n }\n\n #h5branding-title {\n position: absolute;\n width: 100%;\n background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.5) 50%, transparent);\n color: #fff;\n text-shadow: 0 0 1px rgba(0, 0, 0, 0.7);\n bottom:10%;\n padding: 15px 0;\n text-align: center;\n font-size: 18px;\n font-family: Helvetica, Arial, sans-serif;\n font-weight: bold;\n line-height: 100%;\n }\n\n #h5branding-button {\n /* border: 0; */\n padding: 10px 22px;\n border-radius: 5px;\n border: 3px solid white;\n background: linear-gradient(0deg, #dddddd, #ffffff);\n color: #222;\n text-transform: uppercase;\n text-shadow: 0 0 1px #fff;\n font-family: Helvetica, Arial, sans-serif;\n font-weight: bold;\n font-size: 18px;\n cursor: pointer;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);\n display: none;\n width: 150px;\n position: absolute;\n top: 170px;\n margin: 0 auto;\n left: 0;\n right: 0;\n }\n\n @media (orientation: portrait) and (max-width: 1080px) {\n #h5branding-logo > img {\n height: initial;\n width:100%;\n }\n }\n\n @media (orientation: landscape) and (max-height: 640px) {\n #h5branding-title {\n display: none;\n }\n\n #h5branding-logo > img {\n height: 100px;\n }\n }\n\n @media (orientation: landscape) and (max-height: 460px) {\n #h5branding-title {\n display: none;\n }\n\n #h5branding-wrapper {\n width: 110px;\n height: 110px;\n margin: 0;\n }\n\n #h5branding-logo {\n top: 0;\n transform: scale(0.7, 0.7);\n }\n\n #h5branding-button {\n top: initial;\n width: 110px;\n font-size: 14px;\n position: absolute;\n top: 140px;\n left: 0;\n right: 0;\n }\n\n #h5branding-ad {\n display: none !important;\n }\n }\n\n @media (orientation: portrait) and (max-width: 250px) {\n #h5branding-logo {\n top: 2%;\n }\n }\n\n @media (orientation: landscape) and (max-width: 330px) {\n #h5branding-button {\n top: 120px;\n }\n\n #h5branding-logo > img {\n height: 70px;\n }\n }\n\n @media (max-width: 600px) and (max-height: 850px) {\n #h5branding-ad {\n display: none !important;\n }\n }\n\n @media (max-width: 600px) and (max-height: 1100px) {\n #h5branding-center {\n top: 40%;\n }\n\n #h5branding-title {\n bottom: 5%\n }\n }\n\n @media (max-width: 600px) and (max-height: 900px) {\n #h5branding-title {\n display: none\n }\n }\n\n @media (orientation: landscape) and (min-width: 800px) {\n #h5branding-wrapper {\n margin-left: 120px;\n margin-right: 120px;\n }\n }\n\n "),
(e = this.getGameLogoUrl()),
(i = this.options.gameTitle),
(s = '\n
\n \n \n \n
\n
\n

\n
\n
\n
\n
\n '
)
.concat(i, "
\n ")),
(r = document.head || document.getElementsByTagName("head")[0]),
((o = document.createElement("style")).type = "text/css"),
o.styleSheet ? (o.styleSheet.cssText = n) : o.appendChild(document.createTextNode(n)),
r.appendChild(o),
((a = document.createElement("div")).innerHTML = s),
(a.id = "h5branding-container"),
(h = document.body || document.getElementsByTagName("body")[0]).insertBefore(a, h.firstChild),
(this.circleLoader = new y.Circle("#h5branding-bar", { strokeWidth: 3, color: this.options.barColor })),
(l = document.getElementById("h5branding-version")) && (l.innerHTML = this.options.version),
[4, this.loadLibs()]
);
case 1:
return t.sent(), [4, v.loadHost()];
case 2:
return t.sent(), [4, this.loadBranding()];
case 3:
return t.sent(), (this.loaded = !0), [2];
}
var e, i;
});
});
}),
(e.prototype.loadBranding = function () {
return i(this, void 0, void 0, function () {
var e, i, n;
return u(this, function (t) {
switch (t.label) {
case 0:
return [4, g.preload(Date.now().toString())];
case 1:
return (
t.sent(),
(e = document.getElementById("h5branding-background")) && (e.style.backgroundColor = g.brandingBackgroundColor),
(i = document.getElementById("h5branding-logo")) &&
v.getBrandingDomain() !== r.BrandingDomain.Neutral &&
(((n = document.createElement("img")).src = g.brandingLogoUrl.replace("_small", "")), i.appendChild(n)),
[2]
);
}
});
});
}),
(e.prototype.loadLibs = function () {
var i = this,
n = this.options.libs.map(function (t, e) {
return a.instance.loadScript(t, !0, function () {
i.setScriptloadProgress(n.length, e + 1);
});
});
return Promise.all(n);
}),
Object.defineProperty(e.prototype, "bannerAllowed", {
get: function () {
var t = document.body.clientWidth,
e = document.body.clientHeight;
return this.progress < 100 && !(e < t && e <= 460) && !(t < 600 && e < 850);
},
enumerable: !1,
configurable: !0,
}),
(e.prototype.showBanner = function () {
if (!this.bannerAllowed) return null;
var t = document.getElementById("h5branding-ad");
return t ? ((t.style.display = "inline-flex"), t) : null;
}),
(e.prototype.setScriptloadProgress = function (t, e) {
var i = (0.3 * e) / t;
this.circleLoader.animate(i, null, function () {});
}),
(e.prototype.setLoadProgress = function (t) {
var e = this;
if (this.loaded)
if (((t = 30 + 0.7 * t), 100 === (this.progress = t))) {
var i = document.querySelector("#h5branding-button");
this.circleLoader.animate(1, null, function () {
!v.inGDGameZone() && i && !0 === e.showPlayButton ? (i.style.display = "block") : (v.inGDGameZone() || !1 === e.showPlayButton) && e.onPlayButtonClick();
});
} else this.circleLoader.animate(t / 100, null, function () {});
}),
(e.prototype.setButtonCallback = function (t) {
this.buttonCallback = t;
}),
(e.prototype.onPlayButtonClick = function () {
this.buttonCallback && this.buttonCallback();
}),
(e.prototype.destroy = function () {
var t = document.querySelector("#h5branding-container");
null !== t && null !== t.parentNode && t.parentNode.removeChild(t);
}),
(e.prototype.getGameLogoUrl = function () {
return "assets/icon.jpeg";
}),
e
);
})();
(r.Branding = g), (r.Domain = o), (r.Hosts = l), (r.SplashLoader = m), (r.Utils = v), Object.defineProperty(r, "__esModule", { value: !0 });
}),
(function (t, e) {
"object" == typeof exports && "undefined" != typeof module ? e(exports) : "function" == typeof define && define.amd ? define(["exports"], e) : e((t.h5ads = t.h5ads || {}));
})(this, function (o) {
"use strict";
var n = function (t, e) {
return (n =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);
})(t, e);
};
var t,
i,
e,
s =
((function (t) {
var n = Object.prototype.hasOwnProperty,
f = "~";
function i() {}
function a(t, e, i) {
(this.fn = t), (this.context = e), (this.once = i || !1);
}
function s(t, e, i, n, s) {
if ("function" != typeof i) throw new TypeError("The listener must be a function");
var r = new a(i, n || t, s),
o = f ? f + e : e;
return t._events[o] ? (t._events[o].fn ? (t._events[o] = [t._events[o], r]) : t._events[o].push(r)) : ((t._events[o] = r), t._eventsCount++), t;
}
function l(t, e) {
0 == --t._eventsCount ? (t._events = new i()) : delete t._events[e];
}
function e() {
(this._events = new i()), (this._eventsCount = 0);
}
Object.create && ((i.prototype = Object.create(null)), new i().__proto__ || (f = !1)),
(e.prototype.eventNames = function () {
var t,
e,
i = [];
if (0 === this._eventsCount) return i;
for (e in (t = this._events)) n.call(t, e) && i.push(f ? e.slice(1) : e);
return Object.getOwnPropertySymbols ? i.concat(Object.getOwnPropertySymbols(t)) : i;
}),
(e.prototype.listeners = function (t) {
var e = f ? f + t : t,
i = this._events[e];
if (!i) return [];
if (i.fn) return [i.fn];
for (var n = 0, s = i.length, r = new Array(s); n < s; n++) r[n] = i[n].fn;
return r;
}),
(e.prototype.listenerCount = function (t) {
var e = f ? f + t : t,
i = this._events[e];
return i ? (i.fn ? 1 : i.length) : 0;
}),
(e.prototype.emit = function (t, e, i, n, s, r) {
var o = f ? f + t : t;
if (!this._events[o]) return !1;
var a,
h,
l = this._events[o],
u = arguments.length;
if (l.fn) {
switch ((l.once && this.removeListener(t, l.fn, void 0, !0), u)) {
case 1:
return l.fn.call(l.context), !0;
case 2:
return l.fn.call(l.context, e), !0;
case 3:
return l.fn.call(l.context, e, i), !0;
case 4:
return l.fn.call(l.context, e, i, n), !0;
case 5:
return l.fn.call(l.context, e, i, n, s), !0;
case 6:
return l.fn.call(l.context, e, i, n, s, r), !0;
}
for (h = 1, a = new Array(u - 1); h < u; h++) a[h - 1] = arguments[h];
l.fn.apply(l.context, a);
} else {
var c,
d = l.length;
for (h = 0; h < d; h++)
switch ((l[h].once && this.removeListener(t, l[h].fn, void 0, !0), u)) {
case 1:
l[h].fn.call(l[h].context);
break;
case 2:
l[h].fn.call(l[h].context, e);
break;
case 3:
l[h].fn.call(l[h].context, e, i);
break;
case 4:
l[h].fn.call(l[h].context, e, i, n);
break;
default:
if (!a) for (c = 1, a = new Array(u - 1); c < u; c++) a[c - 1] = arguments[c];
l[h].fn.apply(l[h].context, a);
}
}
return !0;
}),
(e.prototype.on = function (t, e, i) {
return s(this, t, e, i, !1);
}),
(e.prototype.once = function (t, e, i) {
return s(this, t, e, i, !0);
}),
(e.prototype.removeListener = function (t, e, i, n) {
var s = f ? f + t : t;
if (!this._events[s]) return this;
if (!e) return l(this, s), this;
var r = this._events[s];
if (r.fn) r.fn !== e || (n && !r.once) || (i && r.context !== i) || l(this, s);
else {
for (var o = 0, a = [], h = r.length; o < h; o++) (r[o].fn !== e || (n && !r[o].once) || (i && r[o].context !== i)) && a.push(r[o]);
a.length ? (this._events[s] = 1 === a.length ? a[0] : a) : l(this, s);
}
return this;
}),
(e.prototype.removeAllListeners = function (t) {
var e;
return t ? ((e = f ? f + t : t), this._events[e] && l(this, e)) : ((this._events = new i()), (this._eventsCount = 0)), this;
}),
(e.prototype.off = e.prototype.removeListener),
(e.prototype.addListener = e.prototype.on),
(e.prefixed = f),
(e.EventEmitter = e),
(t.exports = e);
})((t = { exports: {} }), t.exports),
t.exports);
((e = i || (i = {}))[(e.AdMob = 0)] = "AdMob"), (e[(e.MoPub = 1)] = "MoPub"), (e[(e.Chartboost = 2)] = "Chartboost"), (e[(e.Heyzap = 3)] = "Heyzap");
var r,
a,
h,
l,
u = (function () {
function t(t, e) {
if (((this.adsEnabled = !1), (this.bannerShowable = !1), (this.interstitialShowable = !1), (this.insentiveShowable = !1), Cocoon && Cocoon.Ad)) {
switch (((this.adsEnabled = !0), t)) {
default:
case i.AdMob:
this.cocoonProvider = Cocoon.Ad.AdMob;
break;
case i.Chartboost:
this.cocoonProvider = Cocoon.Ad.Chartboost;
break;
case i.Heyzap:
this.cocoonProvider = Cocoon.Ad.Heyzap;
break;
case i.MoPub:
this.cocoonProvider = Cocoon.Ad.MoPub;
}
this.cocoonProvider.configure(e);
}
}
return (
(t.prototype.setManager = function (t) {
(this.adManager = t), this.adManager.emit(o.AdEvents.AD_PROVIDER_LOADED);
}),
(t.prototype.showAd = function (t) {
if (this.adsEnabled) {
if (t === o.AdType.banner) {
if (!this.bannerShowable || null === this.banner) return;
this.adManager.emit(o.AdEvents.BANNER_SHOWN, this.banner.width, this.banner.height), (this.adManager.bannerActive = !0), this.banner.show();
}
if (t === o.AdType.interstitial) {
if (!this.interstitialShowable || null === this.interstitial) return void this.adManager.emit(o.AdEvents.CONTENT_RESUMED, o.AdType.interstitial);
this.interstitial.show();
}
if (t === o.AdType.rewarded) {
if (!this.insentiveShowable || null === this.insentive) return void this.adManager.emit(o.AdEvents.CONTENT_RESUMED, o.AdType.rewarded);
this.insentive.show();
}
} else t !== o.AdType.banner && this.adManager.emit(o.AdEvents.CONTENT_RESUMED);
}),
(t.prototype.adAvailable = function (t) {
return !0;
}),
(t.prototype.preloadAd = function (t, e, i) {
var n = this;
this.adsEnabled &&
(this.destroyAd(t),
t === o.AdType.banner &&
((this.banner = this.cocoonProvider.createBanner(e)),
i && this.banner.setLayout(i),
this.banner.on("load", function () {
n.bannerShowable = !0;
}),
this.banner.on("fail", function () {
(n.bannerShowable = !1), (n.banner = null);
}),
this.banner.on("click", function () {
n.adManager.emit(o.AdEvents.AD_CLICKED, o.AdType.banner);
}),
this.banner.on("show", function () {}),
this.banner.on("dismiss", function () {}),
this.banner.load()),
t === o.AdType.interstitial &&
((this.interstitial = this.cocoonProvider.createInterstitial(e)),
this.interstitial.on("load", function () {
n.interstitialShowable = !0;
}),
this.interstitial.on("fail", function () {
(n.interstitialShowable = !1), (n.interstitial = null);
}),
this.interstitial.on("click", function () {
n.adManager.emit(o.AdEvents.AD_CLICKED, o.AdType.interstitial);
}),
this.interstitial.on("show", function () {
n.adManager.emit(o.AdEvents.CONTENT_PAUSED, o.AdType.interstitial);
}),
this.interstitial.on("dismiss", function () {
n.adManager.emit(o.AdEvents.CONTENT_RESUMED, o.AdType.interstitial), (n.interstitialShowable = !1), (n.interstitial = null);
}),
this.interstitial.load()),
t === o.AdType.rewarded &&
((this.insentive = this.cocoonProvider.createRewardedVideo(e)),
this.insentive.on("load", function () {
n.insentiveShowable = !0;
}),
this.insentive.on("fail", function () {
(n.insentiveShowable = !1), (n.insentive = null);
}),
this.insentive.on("click", function () {
n.adManager.emit(o.AdEvents.AD_CLICKED, o.AdType.rewarded);
}),
this.insentive.on("show", function () {
n.adManager.emit(o.AdEvents.CONTENT_PAUSED, o.AdType.rewarded);
}),
this.insentive.on("dismiss", function () {
n.adManager.emit(o.AdEvents.CONTENT_RESUMED, o.AdType.rewarded), (n.insentiveShowable = !1), (n.insentive = null);
}),
this.insentive.on("reward", function () {
n.adManager.emit(o.AdEvents.AD_REWARDED, o.AdType.rewarded), (n.insentiveShowable = !1), (n.insentive = null);
}),
this.insentive.load()));
}),
(t.prototype.destroyAd = function (t) {
if (this.adsEnabled) {
if (t === o.AdType.banner && null !== this.banner) {
try {
this.cocoonProvider.releaseBanner(this.banner);
} catch (t) {}
(this.banner = null), (this.bannerShowable = !1);
}
t === o.AdType.interstitial && null !== this.interstitial && (this.cocoonProvider.releaseInterstitial(this.interstitial), (this.interstitial = null), (this.interstitialShowable = !1));
}
}),
(t.prototype.hideAd = function (t) {
this.adsEnabled &&
(t === o.AdType.interstitial && null !== this.interstitial && this.interstitial.hide(),
t === o.AdType.banner &&
null !== this.banner &&
(this.adManager.bannerActive && ((this.adManager.bannerActive = !1), this.adManager.emit(o.AdEvents.BANNER_HIDDEN, this.banner.width, this.banner.height)), this.banner.hide()),
t === o.AdType.rewarded && null !== this.insentive && this.insentive.hide());
}),
t
);
})(),
c = (function () {
function t(t, e, i) {
void 0 === i && (i = !1),
(this.adsEnabled = !1),
void 0 === cordova.plugins ||
(void 0 !== cordova.plugins && void 0 === cordova.plugins.gdApi) ||
(i && cordova.plugins.gdApi.enableTestAds(),
this.setAdListeners(),
cordova.plugins.gdApi.init(
[t, e],
function (t) {},
function (t) {}
));
}
return (
(t.prototype.setAdListeners = function () {
var e = this;
cordova.plugins.gdApi.setAdListener(
function (t) {
switch (t.event) {
case "BANNER_STARTED":
e.adManager.emit(o.AdEvents.CONTENT_PAUSED);
break;
case "API_IS_READY":
e.adsEnabled = !0;
break;
case "API_ALREADY_INITIALIZED":
break;
case "BANNER_CLOSED":
case "API_NOT_READY":
case "BANNER_FAILED":
e.adManager.emit(o.AdEvents.CONTENT_RESUMED);
}
},
function (t) {
e.adsEnabled = !1;
}
);
}),
(t.prototype.setManager = function (t) {
(this.adManager = t), this.adManager.emit(o.AdEvents.AD_PROVIDER_LOADED);
}),
(t.prototype.showAd = function (t) {
var e = this;
this.adsEnabled
? cordova.plugins.gdApi.showBanner(
function (t) {},
function (t) {
e.adManager.emit(o.AdEvents.CONTENT_RESUMED);
}
)
: this.adManager.emit(o.AdEvents.CONTENT_RESUMED);
}),
(t.prototype.adAvailable = function (t) {
return !0;
}),
(t.prototype.preloadAd = function (t) {}),
(t.prototype.destroyAd = function (t) {}),
(t.prototype.hideAd = function (t) {}),
t
);
})(),
d = (function () {
function t() {
var e = this;
if (((this.adsEnabled = !1), (this.rewardedLoaded = !1), "undefined" != typeof gamedockSDK)) {
gamedockSDK.on("PrivacyPolicyStatus", function (t) {
e.adManager.emit(o.AdEvents.AD_PROVIDER_LOADED);
}),
gamedockSDK.initialise(!1, { shouldBlock: !0, requiredAge: 12 }, !0, "PRODUCTION", []),
gamedockSDK.on("AdAvailable", function (t) {
switch (t.type) {
case "interstitial":
e.interstitalAvailable();
break;
case "rewardVideo":
e.rewardedChanged(!0);
break;
case "banner":
throw new Error("Not yet implemented.");
}
}),
gamedockSDK.on("AdNotAvailable", function (t) {
switch (t.type) {
case "interstitial":
case "rewardVideo":
e.resumeGameplay();
break;
case "banner":
throw new Error("Not yet implemented.");
}
}),
gamedockSDK.on("AdFinished", function (t) {
switch (t.type) {
case "interstitial":
e.resumeGameplay();
break;
case "rewardVideo":
e.rewardVideoFinished(t.reason);
break;
case "banner":
throw new Error("Not yet implemented.");
}
});
}
}
return (
(t.prototype.setManager = function (t) {
this.adManager = t;
}),
(t.prototype.showAd = function (t) {
if ((void 0 === t && (t = o.AdType.interstitial), "undefined" != typeof gamedockSDK))
switch (t) {
case o.AdType.interstitial:
this.adManager.emit(o.AdEvents.CONTENT_PAUSED), gamedockSDK.requestInterstitial();
break;
case o.AdType.rewarded:
if (!this.adAvailable(o.AdType.rewarded)) {
this.resumeGameplay();
break;
}
this.adManager.emit(o.AdEvents.CONTENT_PAUSED), this.rewardedChanged(!1), gamedockSDK.playRewardVideo();
break;
default:
this.resumeGameplay();
}
}),
(t.prototype.interstitalAvailable = function () {
"undefined" != typeof gamedockSDK && gamedockSDK.playInterstitial();
}),
(t.prototype.rewardVideoFinished = function (t) {
switch (t) {
case "dismiss":
this.resumeGameplay();
break;
case "close":
this.adManager.emit(o.AdEvents.AD_REWARDED);
}
}),
(t.prototype.resumeGameplay = function () {
this.adManager.emit(o.AdEvents.CONTENT_RESUMED);
}),
(t.prototype.preloadAd = function (t) {
if ((void 0 === t && (t = o.AdType.interstitial), "undefined" != typeof gamedockSDK))
switch (t) {
case o.AdType.rewarded:
if (this.rewardedLoaded) return;
gamedockSDK.requestRewardVideo();
}
}),
(t.prototype.destroyAd = function () {}),
(t.prototype.hideAd = function () {}),
(t.prototype.adAvailable = function (t) {
switch (t) {
case o.AdType.rewarded:
return this.rewardedLoaded;
}
return !1;
}),
(t.prototype.rewardedChanged = function (t) {
this.rewardedLoaded = t;
}),
t
);
})(),
f = (function () {
function t(t) {
var e = this;
(this.adsEnabled = !1),
(this.adsEnabled = !0),
HeyzapAds.start(t).then(
function () {},
function (t) {
e.adsEnabled = !1;
}
);
}
return (
(t.prototype.setManager = function (t) {
(this.adManager = t), this.adManager.emit(o.AdEvents.AD_PROVIDER_LOADED);
}),
(t.prototype.showAd = function (t, e) {
var i = this;
switch ((this.adsEnabled || this.adManager.emit(o.AdEvents.CONTENT_RESUMED), t)) {
case o.AdType.interstitial:
HeyzapAds.InterstitialAd.addEventListener(HeyzapAds.InterstitialAd.Events.HIDE, function () {
i.adManager.emit(o.AdEvents.CONTENT_RESUMED, HeyzapAds.InterstitialAd.Events.HIDE);
}),
HeyzapAds.InterstitialAd.addEventListener(HeyzapAds.InterstitialAd.Events.SHOW_FAILED, function () {
i.adManager.emit(o.AdEvents.CONTENT_RESUMED, HeyzapAds.InterstitialAd.Events.SHOW_FAILED);
}),
HeyzapAds.InterstitialAd.addEventListener(HeyzapAds.InterstitialAd.Events.CLICKED, function () {
i.adManager.emit(o.AdEvents.AD_CLICKED, HeyzapAds.InterstitialAd.Events.CLICKED);
}),
HeyzapAds.InterstitialAd.show().then(
function () {
i.adManager.emit(o.AdEvents.CONTENT_PAUSED);
},
function (t) {
i.adManager.emit(o.AdEvents.CONTENT_RESUMED);
}
);
break;
case o.AdType.interstitial:
HeyzapAds.VideoAd.addEventListener(HeyzapAds.VideoAd.Events.HIDE, function () {
i.adManager.emit(o.AdEvents.CONTENT_RESUMED, HeyzapAds.VideoAd.Events.HIDE);
}),
HeyzapAds.VideoAd.addEventListener(HeyzapAds.VideoAd.Events.SHOW_FAILED, function () {
i.adManager.emit(o.AdEvents.CONTENT_RESUMED, HeyzapAds.VideoAd.Events.SHOW_FAILED);
}),
HeyzapAds.VideoAd.addEventListener(HeyzapAds.VideoAd.Events.CLICKED, function () {
i.adManager.emit(o.AdEvents.AD_CLICKED, HeyzapAds.VideoAd.Events.CLICKED);
}),
HeyzapAds.VideoAd.show().then(
function () {
i.adManager.emit(o.AdEvents.CONTENT_PAUSED);
},
function (t) {
i.adManager.emit(o.AdEvents.CONTENT_RESUMED);
}
);
break;
case o.AdType.rewarded:
HeyzapAds.IncentivizedAd.addEventListener(HeyzapAds.IncentivizedAd.Events.HIDE, function () {
i.adManager.emit(o.AdEvents.CONTENT_RESUMED, HeyzapAds.IncentivizedAd.Events.HIDE);
}),
HeyzapAds.IncentivizedAd.addEventListener(HeyzapAds.IncentivizedAd.Events.SHOW_FAILED, function () {
i.adManager.emit(o.AdEvents.CONTENT_RESUMED, HeyzapAds.IncentivizedAd.Events.SHOW_FAILED);
}),
HeyzapAds.IncentivizedAd.addEventListener(HeyzapAds.IncentivizedAd.Events.CLICKED, function () {
i.adManager.emit(o.AdEvents.AD_CLICKED, HeyzapAds.IncentivizedAd.Events.CLICKED);
}),
HeyzapAds.IncentivizedAd.show().then(
function () {
i.adManager.emit(o.AdEvents.CONTENT_PAUSED);
},
function (t) {
i.adManager.emit(o.AdEvents.CONTENT_RESUMED);
}
);
break;
case o.AdType.banner:
if (void 0 === e) return;
HeyzapAds.BannerAd.show(e).then(
function () {},
function (t) {}
);
}
}),
(t.prototype.adAvailable = function (t) {
return !0;
}),
(t.prototype.preloadAd = function (t) {
this.adsEnabled &&
t === o.AdType.rewarded &&
HeyzapAds.IncentivizedAd.fetch().then(
function () {},
function (t) {}
);
}),
(t.prototype.destroyAd = function (t) {
this.adsEnabled &&
t === o.AdType.banner &&
HeyzapAds.BannerAd.destroy().then(
function () {},
function (t) {}
);
}),
(t.prototype.hideAd = function (t) {
this.adsEnabled &&
t === o.AdType.banner &&
HeyzapAds.BannerAd.hide().then(
function () {},
function (t) {}
);
}),
t
);
})(),
p = (function () {
function t(t) {
var e = this;
if (((this.adsEnabled = !1), (this.interstitialLoaded = !1), (this.rewardedLoaded = !1), "undefined" != typeof IronSourceAds)) {
IronSourceAds.init({ appKey: t });
var i = function () {
return e.resumeGameplay();
};
window.addEventListener("interstitialClosed", i),
window.addEventListener("interstitialShowFailed", i),
window.addEventListener("interstitialLoaded", function () {
return e.interstitialChanged(!0);
}),
window.addEventListener("rewardedVideoClosed", i),
window.addEventListener("rewardedVideoFailed", i),
IronSourceAds.hasRewardedVideo({ onSuccess: this.rewardedChanged.bind(this) }),
window.addEventListener("rewardedVideoAvailabilityChanged", function (t) {
return e.rewardedChanged(t.available);
});
}
}
return (
(t.prototype.setManager = function (t) {
(this.adManager = t), this.adManager.emit(o.AdEvents.AD_PROVIDER_LOADED);
}),
(t.prototype.showAd = function (t) {
switch ((void 0 === t && (t = o.AdType.interstitial), t)) {
case o.AdType.interstitial:
if (!this.interstitialLoaded) {
this.resumeGameplay();
break;
}
this.interstitialChanged(!1), this.adManager.emit(o.AdEvents.CONTENT_PAUSED), IronSourceAds.showInterstitial();
break;
case o.AdType.rewarded:
if (!this.rewardedLoaded) {
this.resumeGameplay();
break;
}
this.adManager.emit(o.AdEvents.CONTENT_PAUSED), IronSourceAds.showRewardedVideo();
break;
default:
this.resumeGameplay();
}
}),
(t.prototype.resumeGameplay = function () {
this.adManager.emit(o.AdEvents.CONTENT_RESUMED);
}),
(t.prototype.preloadAd = function (t) {
void 0 === t && (t = o.AdType.interstitial), t === o.AdType.interstitial && IronSourceAds.loadInterstitial();
}),
(t.prototype.destroyAd = function () {}),
(t.prototype.hideAd = function () {}),
(t.prototype.adAvailable = function (t) {
switch (t) {
case o.AdType.interstitial:
return this.interstitialLoaded;
case o.AdType.rewarded:
return this.rewardedLoaded;
}
return !1;
}),
(t.prototype.interstitialChanged = function (t) {
this.interstitialLoaded = t;
}),
(t.prototype.rewardedChanged = function (t) {
this.rewardedLoaded = t;
}),
t
);
})();
((a = r || (r = {})).interstitial = "interstitial"),
(a.rewarded = "rewarded"),
(a.display = "display"),
((h = o.GameDistributionBannerSize || (o.GameDistributionBannerSize = {}))[(h.LargeRectangle = 0)] = "LargeRectangle"),
(h[(h.MediumRectangle = 1)] = "MediumRectangle"),
(h[(h.Billboard = 2)] = "Billboard"),
(h[(h.Leaderboard = 3)] = "Leaderboard"),
(h[(h.Skyscraper = 4)] = "Skyscraper"),
(h[(h.WideSkyscraper = 5)] = "WideSkyscraper"),
((l = o.GameDistributionAlignment || (o.GameDistributionAlignment = {}))[(l.TopLeft = 0)] = "TopLeft"),
(l[(l.TopCenter = 1)] = "TopCenter"),
(l[(l.TopRight = 2)] = "TopRight"),
(l[(l.CenterLeft = 3)] = "CenterLeft"),
(l[(l.Center = 4)] = "Center"),
(l[(l.CenterRight = 5)] = "CenterRight"),
(l[(l.BottomLeft = 6)] = "BottomLeft"),
(l[(l.BottomCenter = 7)] = "BottomCenter"),
(l[(l.BottomRight = 8)] = "BottomRight");
var g,
v,
y = (function () {
function t() {
(this.scaleFactor = 1),
(this.offsetX = 0),
(this.offsetY = 0),
(this.element = document.createElement("div")),
(this.element.style.position = "absolute"),
(this.element.style.top = "0px"),
(this.element.style.left = "0px"),
(this.element.id = "banner-" + Date.now() + ((1e7 * Math.random()) | 0)),
document.body.appendChild(this.element);
}
return (
(t.prototype.loadBanner = function () {
return "undefined" == typeof gdsdk ? Promise.reject("GD Sdk not available, probably due to adblocker") : gdsdk.showAd(r.display, { containerId: this.element.id });
}),
(t.prototype.destroy = function () {
document.body.removeChild(this.element), this.resizeListener && window.removeEventListener("resize", this.resizeListener), delete this.element, delete this.parent, delete this.alignment;
}),
(t.prototype.alignIn = function (t, e) {
var i = this;
this.parent ||
((this.parent = t),
(this.alignment = e),
(this.resizeListener = function () {
return i.resize();
}),
window.addEventListener("resize", this.resizeListener),
this.resize());
}),
(t.prototype.setOffset = function (t, e) {
void 0 === t && (t = 0), void 0 === e && (e = 0), (this.offsetX = t), (this.offsetY = e), this.resize();
}),
(t.prototype.resize = function () {
if (this.parent) {
var t = this.parent.getBoundingClientRect();
switch (this.alignment) {
case o.GameDistributionAlignment.TopLeft:
this.position(t.left, t.top);
break;
case o.GameDistributionAlignment.TopCenter:
this.position(t.left + t.width / 2 - (this.width * this.scaleFactor) / 2, t.top);
break;
case o.GameDistributionAlignment.TopRight:
this.position(t.left + t.width - this.width * this.scaleFactor, t.top);
break;
case o.GameDistributionAlignment.CenterLeft:
this.position(t.left, t.top + t.height / 2 - (this.height * this.scaleFactor) / 2);
break;
case o.GameDistributionAlignment.Center:
this.position(t.left + t.width / 2 - (this.width * this.scaleFactor) / 2, t.top + t.height / 2 - (this.height * this.scaleFactor) / 2);
break;
case o.GameDistributionAlignment.CenterRight:
this.position(t.left + t.width - this.width * this.scaleFactor, t.top + t.height / 2 - (this.height * this.scaleFactor) / 2);
break;
case o.GameDistributionAlignment.BottomLeft:
this.position(t.left, t.top + t.height - this.height * this.scaleFactor);
break;
case o.GameDistributionAlignment.BottomCenter:
this.position(t.left + t.width / 2 - (this.width * this.scaleFactor) / 2, t.top + t.height - this.height * this.scaleFactor);
break;
case o.GameDistributionAlignment.BottomRight:
this.position(t.left + t.width - this.width * this.scaleFactor, t.top + t.height - this.height * this.scaleFactor);
}
}
}),
(t.prototype.setSize = function (t) {
var e, i;
switch (t) {
default:
case o.GameDistributionBannerSize.LargeRectangle:
(e = 336), (i = 280);
break;
case o.GameDistributionBannerSize.MediumRectangle:
(e = 300), (i = 250);
break;
case o.GameDistributionBannerSize.Billboard:
(e = 970), (i = 250);
break;
case o.GameDistributionBannerSize.Leaderboard:
(e = 728), (i = 90);
break;
case o.GameDistributionBannerSize.Skyscraper:
(e = 120), (i = 600);
break;
case o.GameDistributionBannerSize.WideSkyscraper:
(e = 160), (i = 600);
}
(this.width = e), (this.height = i), (this.element.style.width = e + "px"), (this.element.style.height = i + "px");
}),
(t.prototype.position = function (t, e) {
(this.element.style.left = t + this.offsetX + "px"), (this.element.style.top = e + this.offsetY + "px");
}),
(t.prototype.scale = function (t) {
(this.element.style.transformOrigin = "left top"), (this.scaleFactor = t), (this.element.style.transform = "scale(" + t + ")");
}),
t
);
})(),
m = (function () {
function t(t) {
var e,
i,
n,
s,
r = this;
(this.adsEnabled = !1),
(this.hasRewarded = !1),
(this.adShowing = !1),
(window.GD_OPTIONS = {
gameId: t,
advertisementSettings: { autoplay: !1 },
onEvent: function (t) {
switch (t.name) {
case "SDK_GAME_PAUSE":
r.adManager.emit(o.AdEvents.CONTENT_PAUSED);
break;
case "SDK_READY":
r.sdkLoaded();
}
},
}),
(e = document),
(i = "gamedistribution-jssdk"),
(s = e.getElementsByTagName("script")[0]),
e.getElementById(i) || (((n = e.createElement("script")).id = i), (n.src = "//html5.api.gamedistribution.com/main.min.js"), s.parentNode && s.parentNode.insertBefore(n, s));
}
return (
(t.prototype.setManager = function (t) {
(this.adManager = t), this.adManager.emit(o.AdEvents.AD_PROVIDER_LOADED);
}),
(t.prototype.sdkLoaded = function () {
this.adsEnabled = !0;
}),
(t.prototype.showAd = function (t) {
var e = this;
if (this.adsEnabled) {
if ("undefined" == typeof gdsdk || (gdsdk && void 0 === gdsdk.showAd)) return (this.adsEnabled = !1), void this.adManager.emit(o.AdEvents.CONTENT_RESUMED);
gdsdk
.showAd(t === o.AdType.rewarded ? r.rewarded : r.interstitial)
.then(function () {
t === o.AdType.rewarded && (e.adManager.emit(o.AdEvents.AD_REWARDED), (e.hasRewarded = !1)), e.adManager.emit(o.AdEvents.CONTENT_RESUMED);
})
.catch(function () {
t === o.AdType.rewarded && e.hasRewarded && (e.hasRewarded = !1), e.adManager.emit(o.AdEvents.CONTENT_RESUMED);
});
} else this.adManager.emit(o.AdEvents.CONTENT_RESUMED);
}),
(t.prototype.createBanner = function (t) {
if (this.adsEnabled) {
var e = new y();
return e.setSize(t), e;
}
}),
(t.prototype.loadBanner = function (t) {
if (this.adsEnabled) {
var e = new y();
return e.setSize(t), e.loadBanner(), e;
}
}),
(t.prototype.preloadAd = function (t) {
var e = this;
!this.hasRewarded &&
this.adsEnabled &&
t === o.AdType.rewarded &&
gdsdk.preloadAd(r.rewarded).then(function () {
(e.hasRewarded = !0), e.adManager.emit(o.AdEvents.AD_LOADED, t);
});
}),
(t.prototype.adAvailable = function (t) {
return t !== o.AdType.rewarded || this.hasRewarded;
}),
(t.prototype.destroyAd = function () {}),
(t.prototype.hideAd = function () {}),
(t.prototype.areAdsEnabled = function () {
var t = document.createElement("script");
(t.id = "debug-test-ad"), (t.src = "https://storage.googleapis.com/cdn.fbrq.io/anyad.js"), document.body.appendChild(t);
return new Promise(function (t) {
window.setTimeout(function () {
t(
(function () {
var t = !0;
if ((document.getElementById("az-test-ad") || (t = !1), document.getElementById("debug-test-ad"))) {
var e = document.getElementById("debug-test-ad");
try {
e.parentNode.removeChild(e);
} catch (t) {}
}
if (document.getElementById("az-test-ad")) {
var i = document.getElementById("az-test-ad");
try {
i.parentNode.removeChild(i);
} catch (t) {}
}
return t;
})()
);
}, 100);
});
}),
t
);
})();
((v = g || (g = {}))[(v.start = 0)] = "start"), (v[(v.firstQuartile = 1)] = "firstQuartile"), (v[(v.midPoint = 2)] = "midPoint"), (v[(v.thirdQuartile = 3)] = "thirdQuartile"), (v[(v.complete = 4)] = "complete");
var x,
b,
w = (function () {
function t(t, e) {
(this.googleEnabled = !1),
(this.adsEnabled = !0),
(this.adTagUrl = ""),
(this.adRequested = !1),
this.areAdsEnabled(),
"undefined" != typeof google &&
((this.googleEnabled = !0),
(this.gameContent = "string" == typeof t.parentElement ? document.getElementById(t.parentElement) : t.parentElement),
(this.gameContent.style.position = "absolute"),
(this.gameContent.style.width = "100%"),
(this.adContent = this.gameContent.parentNode.appendChild(document.createElement("div"))),
(this.adContent.id = "phaser-ad-container"),
(this.adContent.style.position = "absolute"),
(this.adContent.style.zIndex = "9999"),
(this.adContent.style.display = "none"),
(this.adContent.style.top = "0"),
(this.adContent.style.left = "0"),
(this.adContent.style.width = "100%"),
(this.adContent.style.height = "100%"),
(this.adContent.style.overflow = "hidden"),
(this.adTagUrl = e),
(this.adDisplay = new google.ima.AdDisplayContainer(this.adContent)),
google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),
google.ima.settings.setLocale("nl"),
(this.adLoader = new google.ima.AdsLoader(this.adDisplay)),
this.adLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED, this.onAdManagerLoader, !1, this),
this.adLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, this.onAdError, !1, this));
}
return (
(t.prototype.setManager = function (t) {
(this.adManager = t), this.adManager.emit(o.AdEvents.AD_PROVIDER_LOADED);
}),
(t.prototype.showAd = function (t, e) {
if (!this.adRequested)
if ((this.adsEnabled || this.adManager.emit(o.AdEvents.AD_DISABLED, !0), this.googleEnabled)) {
this.adDisplay.initialize();
var i = new google.ima.AdsRequest();
i.adTagUrl = this.adTagUrl + this.parseCustomParams(e);
var n = window.innerWidth,
s = window.innerHeight;
document.body.clientHeight < window.innerHeight && ((s = document.body.clientHeight), (n = document.body.clientWidth)),
(i.linearAdSlotWidth = n),
(i.linearAdSlotHeight = s),
(i.nonLinearAdSlotWidth = n),
(i.nonLinearAdSlotHeight = s),
(i.forceNonLinearFullSlot = !0);
try {
(this.adRequested = !0), this.adLoader.requestAds(i);
} catch (t) {
this.onContentResumeRequested();
}
} else this.onContentResumeRequested();
}),
(t.prototype.adAvailable = function (t) {
return !0;
}),
(t.prototype.preloadAd = function () {}),
(t.prototype.destroyAd = function () {}),
(t.prototype.hideAd = function () {}),
(t.prototype.onAdManagerLoader = function (t) {
var e = this,
i = new google.ima.AdsRenderingSettings();
i.restoreCustomPlaybackStateOnAdBreakComplete = !0;
var n = t.getAdsManager(this.gameContent, i);
(this.adsManager = n).addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED, this.onContentPauseRequested, !1, this),
n.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED, this.onContentResumeRequested, !1, this),
n.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, this.onAdError, !1, this),
[
google.ima.AdEvent.Type.ALL_ADS_COMPLETED,
google.ima.AdEvent.Type.CLICK,
google.ima.AdEvent.Type.COMPLETE,
google.ima.AdEvent.Type.FIRST_QUARTILE,
google.ima.AdEvent.Type.LOADED,
google.ima.AdEvent.Type.MIDPOINT,
google.ima.AdEvent.Type.PAUSED,
google.ima.AdEvent.Type.STARTED,
google.ima.AdEvent.Type.THIRD_QUARTILE,
].forEach(function (t) {
n.addEventListener(t, e.onAdEvent, !1, e);
});
try {
this.adContent.style.display = "block";
var s = window.innerWidth,
r = window.innerHeight;
this.adsManager.init(s, r, google.ima.ViewMode.NORMAL),
this.adsManager.start(),
(this.resizeListener = function () {
null !== e.adsManager && e.adsManager.resize(window.innerWidth, window.innerHeight, google.ima.ViewMode.NORMAL);
}),
window.addEventListener("resize", this.resizeListener);
} catch (t) {
this.onAdError(t);
}
}),
(t.prototype.onAdEvent = function (t) {
switch (t.type) {
case google.ima.AdEvent.Type.CLICK:
this.adManager.emit(o.AdEvents.AD_CLICKED);
break;
case google.ima.AdEvent.Type.LOADED:
this.adRequested = !1;
var e = t.getAd();
e.isLinear() || this.onContentResumeRequested();
break;
case google.ima.AdEvent.Type.STARTED:
this.adManager.emit(o.AdEvents.AD_PROGRESSION, g.start);
break;
case google.ima.AdEvent.Type.FIRST_QUARTILE:
this.adManager.emit(o.AdEvents.AD_PROGRESSION, g.firstQuartile);
break;
case google.ima.AdEvent.Type.MIDPOINT:
this.adManager.emit(o.AdEvents.AD_PROGRESSION, g.midPoint);
break;
case google.ima.AdEvent.Type.THIRD_QUARTILE:
this.adManager.emit(o.AdEvents.AD_PROGRESSION, g.thirdQuartile);
break;
case google.ima.AdEvent.Type.COMPLETE:
this.adManager.emit(o.AdEvents.AD_PROGRESSION, g.complete);
break;
case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:
this.onContentResumeRequested();
}
}),
(t.prototype.onAdError = function (t) {
null !== this.adsManager && (this.adsManager.destroy(), null !== this.resizeListener && window.removeEventListener("resize", this.resizeListener)),
this.adRequested && (this.adRequested = !1),
this.onContentResumeRequested();
}),
(t.prototype.onContentPauseRequested = function () {
this.adManager.emit(o.AdEvents.CONTENT_PAUSED);
}),
(t.prototype.onContentResumeRequested = function () {
"undefined" != typeof google && (this.adContent.style.display = "none"), this.adManager.emit(o.AdEvents.CONTENT_RESUMED);
}),
(t.prototype.parseCustomParams = function (t) {
if (void 0 === t) return "";
var e = "";
for (var i in t) {
if (t.hasOwnProperty(i)) 0 < e.length && (e += "&"), (e += i + "=" + (Array.isArray(t[i]) ? t[i].join(",") : t[i]));
}
return "&cust_params=" + encodeURIComponent(e);
}),
(t.prototype.areAdsEnabled = function () {
var e = this,
i = document.createElement("div");
(i.innerHTML = " "), (i.className = "adsbox"), (i.style.position = "absolute"), (i.style.fontSize = "10px"), document.body.appendChild(i);
window.setTimeout(function () {
var t;
e.adsEnabled = ((t = !0), 0 === i.offsetHeight && (t = !1), i.parentNode && i.parentNode.removeChild(i), t);
}, 100);
}),
t
);
})();
((x = o.AdEvents || (o.AdEvents = {})).CONTENT_PAUSED = "onContentPaused"),
(x.CONTENT_RESUMED = "onContentResumed"),
(x.AD_PROGRESSION = "onAdProgression"),
(x.AD_DISABLED = "onAdsDisabled"),
(x.AD_CLICKED = "onAdClicked"),
(x.AD_REWARDED = "onAdRewardGranted"),
(x.BANNER_SHOWN = "onBannerShown"),
(x.BANNER_HIDDEN = "onBannerHidden"),
(x.AD_LOADED = "onAdLoaded"),
(x.AD_PROVIDER_LOADED = "onAdProviderLoaded"),
((b = o.AdType || (o.AdType = {}))[(b.interstitial = 0)] = "interstitial"),
(b[(b.rewarded = 1)] = "rewarded"),
(b[(b.banner = 2)] = "banner");
var T = (function (e) {
function t() {
var t = (null !== e && e.apply(this, arguments)) || this;
return (t.bannerActive = !1), (t.provider = null), t;
}
return (
(function (t, e) {
function i() {
this.constructor = t;
}
n(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
})(t, e),
(t.prototype.setAdProvider = function (t) {
(this.provider = t), this.provider.setManager(this);
}),
(t.prototype.showAd = function (t) {
for (var e = [], i = 1; i < arguments.length; i++) e[i - 1] = arguments[i];
if (null === this.provider) throw new Error("Can not request an ad without an provider, please attach an ad provider!");
e.unshift(t), this.provider.showAd.apply(this.provider, e);
}),
(t.prototype.createBanner = function () {
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
return this.provider.loadBanner.apply(this.provider, t);
}),
(t.prototype.loadBanner = function () {
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
return "function" == typeof this.provider.loadBanner ? this.provider.loadBanner.apply(this.provider, t) : null;
}),
(t.prototype.preloadAd = function (t) {
for (var e = [], i = 1; i < arguments.length; i++) e[i - 1] = arguments[i];
if (null === this.provider) throw new Error("Can not preload an ad without an provider, please attach an ad provider!");
e.unshift(t), this.provider.preloadAd.apply(this.provider, e);
}),
(t.prototype.destroyAd = function (t) {
for (var e = [], i = 1; i < arguments.length; i++) e[i - 1] = arguments[i];
if (null === this.provider) throw new Error("Can not destroy an ad without an provider, please attach an ad provider!");
e.unshift(t), this.provider.destroyAd.apply(this.provider, e);
}),
(t.prototype.hideAd = function (t) {
for (var e = [], i = 1; i < arguments.length; i++) e[i - 1] = arguments[i];
if (null === this.provider) throw new Error("Can not hide an ad without an provider, please attach an ad provider!");
e.unshift(t), this.provider.hideAd.apply(this.provider, e);
}),
(t.prototype.adsEnabled = function () {
if (null === this.provider) throw new Error("Can not hide an ad without an provider, please attach an ad provider!");
return this.provider.adsEnabled;
}),
(t.prototype.adAvailable = function (t) {
for (var e = [], i = 1; i < arguments.length; i++) e[i - 1] = arguments[i];
if (null === this.provider) throw new Error("Can not hide an ad without an provider, please attach an ad provider!");
return e.unshift(t), this.provider.adAvailable.apply(this.provider, e);
}),
t
);
})(s),
S = new T();
(o.H5AdWrapper = T),
(o.adWrapper = S),
(o.CocoonAds = u),
(o.CordovaGamedistribution = c),
(o.CordovaGamedock = d),
(o.CordovaHeyzap = f),
(o.CordovaIronSource = p),
(o.GameDistribution = m),
(o.GameDistributionBanner = y),
(o.Ima3 = w),
Object.defineProperty(o, "__esModule", { value: !0 });
}),
(window.SpinePlugin = (function (i) {
var n = {};
function s(t) {
if (n[t]) return n[t].exports;
var e = (n[t] = { i: t, l: !1, exports: {} });
return i[t].call(e.exports, e, e.exports, s), (e.l = !0), e.exports;
}
return (
(s.m = i),
(s.c = n),
(s.d = function (t, e, i) {
s.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: i });
}),
(s.r = function (t) {
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 });
}),
(s.t = function (e, t) {
if ((1 & t && (e = s(e)), 8 & t)) return e;
if (4 & t && "object" == typeof e && e && e.__esModule) return e;
var i = Object.create(null);
if ((s.r(i), Object.defineProperty(i, "default", { enumerable: !0, value: e }), 2 & t && "string" != typeof e))
for (var n in e)
s.d(
i,
n,
function (t) {
return e[t];
}.bind(null, n)
);
return i;
}),
(s.n = function (t) {
var e =
t && t.__esModule
? function () {
return t.default;
}
: function () {
return t;
};
return s.d(e, "a", e), e;
}),
(s.o = function (t, e) {
return Object.prototype.hasOwnProperty.call(t, e);
}),
(s.p = ""),
s((s.s = 63))
);
})([
function (t, e) {
function r(t, e, i, n) {
for (var s in e)
if (e.hasOwnProperty(s)) {
var r =
((l = e),
(u = s),
(f = d = void 0),
(f = (c = i) ? l[u] : Object.getOwnPropertyDescriptor(l, u)),
!c && f.value && "object" == typeof f.value && (f = f.value),
!(!f || !(((d = f).get && "function" == typeof d.get) || (d.set && "function" == typeof d.set))) && (void 0 === f.enumerable && (f.enumerable = !0), void 0 === f.configurable && (f.configurable = !0), f));
if (!1 !== r) {
if (((o = (n || t).prototype), (a = s), (h = void 0), (h = Object.getOwnPropertyDescriptor(o, a)) && (h.value && "object" == typeof h.value && (h = h.value), !1 === h.configurable))) {
if (p.ignoreFinals) continue;
throw new Error("cannot override final property '" + s + "', set Class.ignoreFinals = true to skip");
}
Object.defineProperty(t.prototype, s, r);
} else t.prototype[s] = e[s];
}
var o, a, h, l, u, c, d, f;
}
function o(t, e) {
if (e) {
Array.isArray(e) || (e = [e]);
for (var i = 0; i < e.length; i++) r(t, e[i].prototype || e[i]);
}
}
function p(t) {
var e, i, n;
if ((t = t || {}).initialize) {
if ("function" != typeof t.initialize) throw new Error("initialize must be a function");
(n = t.initialize), delete t.initialize;
} else
n = t.Extends
? ((i = t.Extends),
function () {
i.apply(this, arguments);
})
: function () {};
t.Extends ? ((n.prototype = Object.create(t.Extends.prototype)), (n.prototype.constructor = n), (e = t.Extends), delete t.Extends) : (n.prototype.constructor = n);
var s = null;
return t.Mixins && ((s = t.Mixins), delete t.Mixins), o(n, s), r(n, t, !0, e), n;
}
(p.extend = r), (p.mixin = o), (p.ignoreFinals = !1), (t.exports = p);
},
function (t, e) {
t.exports = function () {};
},
function (t, e, i) {
var n = i(0),
s = i(32),
r = new n({
initialize: function (t, e) {
(this.x = 0), (this.y = 0), "object" == typeof t ? ((this.x = t.x || 0), (this.y = t.y || 0)) : (void 0 === e && (e = t), (this.x = t || 0), (this.y = e || 0));
},
clone: function () {
return new r(this.x, this.y);
},
copy: function (t) {
return (this.x = t.x || 0), (this.y = t.y || 0), this;
},
setFromObject: function (t) {
return (this.x = t.x || 0), (this.y = t.y || 0), this;
},
set: function (t, e) {
return void 0 === e && (e = t), (this.x = t), (this.y = e), this;
},
setTo: function (t, e) {
return this.set(t, e);
},
setToPolar: function (t, e) {
return null == e && (e = 1), (this.x = Math.cos(t) * e), (this.y = Math.sin(t) * e), this;
},
equals: function (t) {
return this.x === t.x && this.y === t.y;
},
fuzzyEquals: function (t, e) {
return s(this.x, t.x, e) && s(this.y, t.y, e);
},
angle: function () {
var t = Math.atan2(this.y, this.x);
return t < 0 && (t += 2 * Math.PI), t;
},
setAngle: function (t) {
return this.setToPolar(t, this.length());
},
add: function (t) {
return (this.x += t.x), (this.y += t.y), this;
},
subtract: function (t) {
return (this.x -= t.x), (this.y -= t.y), this;
},
multiply: function (t) {
return (this.x *= t.x), (this.y *= t.y), this;
},
scale: function (t) {
return isFinite(t) ? ((this.x *= t), (this.y *= t)) : ((this.x = 0), (this.y = 0)), this;
},
divide: function (t) {
return (this.x /= t.x), (this.y /= t.y), this;
},
negate: function () {
return (this.x = -this.x), (this.y = -this.y), this;
},
distance: function (t) {
var e = t.x - this.x,
i = t.y - this.y;
return Math.sqrt(e * e + i * i);
},
distanceSq: function (t) {
var e = t.x - this.x,
i = t.y - this.y;
return e * e + i * i;
},
length: function () {
var t = this.x,
e = this.y;
return Math.sqrt(t * t + e * e);
},
setLength: function (t) {
return this.normalize().scale(t);
},
lengthSq: function () {
var t = this.x,
e = this.y;
return t * t + e * e;
},
normalize: function () {
var t = this.x,
e = this.y,
i = t * t + e * e;
return 0 < i && ((i = 1 / Math.sqrt(i)), (this.x = t * i), (this.y = e * i)), this;
},
normalizeRightHand: function () {
var t = this.x;
return (this.x = -1 * this.y), (this.y = t), this;
},
normalizeLeftHand: function () {
var t = this.x;
return (this.x = this.y), (this.y = -1 * t), this;
},
dot: function (t) {
return this.x * t.x + this.y * t.y;
},
cross: function (t) {
return this.x * t.y - this.y * t.x;
},
lerp: function (t, e) {
void 0 === e && (e = 0);
var i = this.x,
n = this.y;
return (this.x = i + e * (t.x - i)), (this.y = n + e * (t.y - n)), this;
},
transformMat3: function (t) {
var e = this.x,
i = this.y,
n = t.val;
return (this.x = n[0] * e + n[3] * i + n[6]), (this.y = n[1] * e + n[4] * i + n[7]), this;
},
transformMat4: function (t) {
var e = this.x,
i = this.y,
n = t.val;
return (this.x = n[0] * e + n[4] * i + n[12]), (this.y = n[1] * e + n[5] * i + n[13]), this;
},
reset: function () {
return (this.x = 0), (this.y = 0), this;
},
limit: function (t) {
var e = this.length();
return e && t < e && this.scale(t / e), this;
},
reflect: function (t) {
return (t = t.clone().normalize()), this.subtract(t.scale(2 * this.dot(t)));
},
mirror: function (t) {
return this.reflect(t).negate();
},
rotate: function (t) {
var e = Math.cos(t),
i = Math.sin(t);
return this.set(e * this.x - i * this.y, i * this.x + e * this.y);
},
});
(r.ZERO = new r()), (r.RIGHT = new r(1, 0)), (r.LEFT = new r(-1, 0)), (r.UP = new r(0, -1)), (r.DOWN = new r(0, 1)), (r.ONE = new r(1, 1)), (t.exports = r);
},
function (t, e) {
t.exports = function (t, e, i) {
return Math.max(e, Math.min(i, t));
};
},
function (t, e) {
var i = {
PI2: 2 * Math.PI,
TAU: 0.5 * Math.PI,
EPSILON: 1e-6,
DEG_TO_RAD: Math.PI / 180,
RAD_TO_DEG: 180 / Math.PI,
RND: null,
MIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER || -9007199254740991,
MAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER || 9007199254740991,
};
t.exports = i;
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = t.length;
if (e < 0 || s < e || i <= e || s < i || s < e + i) {
if (n) throw new Error("Range Error: Values outside acceptable range");
return !1;
}
return !0;
};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = i - e;
return e + ((((t - e) % n) + n) % n);
};
},
function (t, e) {
t.exports = function (t) {
if ("object" != typeof t || t.nodeType || t === t.window) return !1;
try {
if (t.constructor && !{}.hasOwnProperty.call(t.constructor.prototype, "isPrototypeOf")) return !1;
} catch (t) {
return !1;
}
return !0;
};
},
function (t, e, i) {
var n = i(4);
t.exports = function (t) {
return t > Math.PI && (t -= n.PI2), Math.abs((((t + n.TAU) % n.PI2) - n.PI2) % n.PI2);
};
},
function (t, e, i) {
var n = i(4);
t.exports = function (t) {
return t * n.RAD_TO_DEG;
};
},
function (t, e) {
t.exports = function (t, e, i) {
if (t && "number" != typeof t) {
if (t.hasOwnProperty(e)) return t[e];
if (-1 === e.indexOf(".")) return i;
for (var n = e.split("."), s = t, r = i, o = 0; o < n.length; o++) {
if (!s.hasOwnProperty(n[o])) {
r = i;
break;
}
(r = s[n[o]]), (s = s[n[o]]);
}
return r;
}
return i;
};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = typeof t;
return t && "number" != n && "string" != n && t.hasOwnProperty(e) && void 0 !== t[e] ? t[e] : i;
};
},
function (t, e) {
t.exports = function (t, e) {
if (!(e >= t.length)) {
for (var i = t.length - 1, n = t[e], s = e; s < i; s++) t[s] = t[s + 1];
return (t.length = i), n;
}
};
},
function (t, e, i) {
var n = i(0),
s = i(26),
r = new n({
initialize: function (t, e) {
void 0 === t && (t = 0), void 0 === e && (e = t), (this.type = s.POINT), (this.x = t), (this.y = e);
},
setTo: function (t, e) {
return void 0 === t && (t = 0), void 0 === e && (e = t), (this.x = t), (this.y = e), this;
},
});
t.exports = r;
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e, i) {
(this.x = 0), (this.y = 0), (this.z = 0), "object" == typeof t ? ((this.x = t.x || 0), (this.y = t.y || 0), (this.z = t.z || 0)) : ((this.x = t || 0), (this.y = e || 0), (this.z = i || 0));
},
up: function () {
return (this.x = 0), (this.y = 1), (this.z = 0), this;
},
min: function (t) {
return (this.x = Math.min(this.x, t.x)), (this.y = Math.min(this.y, t.y)), (this.z = Math.min(this.z, t.z)), this;
},
max: function (t) {
return (this.x = Math.max(this.x, t.x)), (this.y = Math.max(this.y, t.y)), (this.z = Math.max(this.z, t.z)), this;
},
clone: function () {
return new n(this.x, this.y, this.z);
},
addVectors: function (t, e) {
return (this.x = t.x + e.x), (this.y = t.y + e.y), (this.z = t.z + e.z), this;
},
crossVectors: function (t, e) {
var i = t.x,
n = t.y,
s = t.z,
r = e.x,
o = e.y,
a = e.z;
return (this.x = n * a - s * o), (this.y = s * r - i * a), (this.z = i * o - n * r), this;
},
equals: function (t) {
return this.x === t.x && this.y === t.y && this.z === t.z;
},
copy: function (t) {
return (this.x = t.x), (this.y = t.y), (this.z = t.z || 0), this;
},
set: function (t, e, i) {
return "object" == typeof t ? ((this.x = t.x || 0), (this.y = t.y || 0), (this.z = t.z || 0)) : ((this.x = t || 0), (this.y = e || 0), (this.z = i || 0)), this;
},
setFromMatrixPosition: function (t) {
return this.fromArray(t.val, 12);
},
setFromMatrixColumn: function (t, e) {
return this.fromArray(t.val, 4 * e);
},
fromArray: function (t, e) {
return void 0 === e && (e = 0), (this.x = t[e]), (this.y = t[e + 1]), (this.z = t[e + 2]), this;
},
add: function (t) {
return (this.x += t.x), (this.y += t.y), (this.z += t.z || 0), this;
},
addScalar: function (t) {
return (this.x += t), (this.y += t), (this.z += t), this;
},
addScale: function (t, e) {
return (this.x += t.x * e), (this.y += t.y * e), (this.z += t.z * e || 0), this;
},
subtract: function (t) {
return (this.x -= t.x), (this.y -= t.y), (this.z -= t.z || 0), this;
},
multiply: function (t) {
return (this.x *= t.x), (this.y *= t.y), (this.z *= t.z || 1), this;
},
scale: function (t) {
return isFinite(t) ? ((this.x *= t), (this.y *= t), (this.z *= t)) : ((this.x = 0), (this.y = 0), (this.z = 0)), this;
},
divide: function (t) {
return (this.x /= t.x), (this.y /= t.y), (this.z /= t.z || 1), this;
},
negate: function () {
return (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), this;
},
distance: function (t) {
var e = t.x - this.x,
i = t.y - this.y,
n = t.z - this.z || 0;
return Math.sqrt(e * e + i * i + n * n);
},
distanceSq: function (t) {
var e = t.x - this.x,
i = t.y - this.y,
n = t.z - this.z || 0;
return e * e + i * i + n * n;
},
length: function () {
var t = this.x,
e = this.y,
i = this.z;
return Math.sqrt(t * t + e * e + i * i);
},
lengthSq: function () {
var t = this.x,
e = this.y,
i = this.z;
return t * t + e * e + i * i;
},
normalize: function () {
var t = this.x,
e = this.y,
i = this.z,
n = t * t + e * e + i * i;
return 0 < n && ((n = 1 / Math.sqrt(n)), (this.x = t * n), (this.y = e * n), (this.z = i * n)), this;
},
dot: function (t) {
return this.x * t.x + this.y * t.y + this.z * t.z;
},
cross: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.x,
r = t.y,
o = t.z;
return (this.x = i * o - n * r), (this.y = n * s - e * o), (this.z = e * r - i * s), this;
},
lerp: function (t, e) {
void 0 === e && (e = 0);
var i = this.x,
n = this.y,
s = this.z;
return (this.x = i + e * (t.x - i)), (this.y = n + e * (t.y - n)), (this.z = s + e * (t.z - s)), this;
},
applyMatrix3: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.val;
return (this.x = s[0] * e + s[3] * i + s[6] * n), (this.y = s[1] * e + s[4] * i + s[7] * n), (this.z = s[2] * e + s[5] * i + s[8] * n), this;
},
applyMatrix4: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.val,
r = 1 / (s[3] * e + s[7] * i + s[11] * n + s[15]);
return (this.x = (s[0] * e + s[4] * i + s[8] * n + s[12]) * r), (this.y = (s[1] * e + s[5] * i + s[9] * n + s[13]) * r), (this.z = (s[2] * e + s[6] * i + s[10] * n + s[14]) * r), this;
},
transformMat3: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.val;
return (this.x = e * s[0] + i * s[3] + n * s[6]), (this.y = e * s[1] + i * s[4] + n * s[7]), (this.z = e * s[2] + i * s[5] + n * s[8]), this;
},
transformMat4: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.val;
return (this.x = s[0] * e + s[4] * i + s[8] * n + s[12]), (this.y = s[1] * e + s[5] * i + s[9] * n + s[13]), (this.z = s[2] * e + s[6] * i + s[10] * n + s[14]), this;
},
transformCoordinates: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.val,
r = e * s[0] + i * s[4] + n * s[8] + s[12],
o = e * s[1] + i * s[5] + n * s[9] + s[13],
a = e * s[2] + i * s[6] + n * s[10] + s[14],
h = e * s[3] + i * s[7] + n * s[11] + s[15];
return (this.x = r / h), (this.y = o / h), (this.z = a / h), this;
},
transformQuat: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.x,
r = t.y,
o = t.z,
a = t.w,
h = a * e + r * n - o * i,
l = a * i + o * e - s * n,
u = a * n + s * i - r * e,
c = -s * e - r * i - o * n;
return (this.x = h * a + c * -s + l * -o - u * -r), (this.y = l * a + c * -r + u * -s - h * -o), (this.z = u * a + c * -o + h * -r - l * -s), this;
},
project: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.val,
r = s[0],
o = s[1],
a = s[2],
h = s[3],
l = s[4],
u = s[5],
c = s[6],
d = s[7],
f = s[8],
p = s[9],
g = s[10],
v = s[11],
y = s[12],
m = s[13],
x = s[14],
b = 1 / (e * h + i * d + n * v + s[15]);
return (this.x = (e * r + i * l + n * f + y) * b), (this.y = (e * o + i * u + n * p + m) * b), (this.z = (e * a + i * c + n * g + x) * b), this;
},
projectViewMatrix: function (t, e) {
return this.applyMatrix4(t).applyMatrix4(e);
},
unprojectViewMatrix: function (t, e) {
return this.applyMatrix4(t).applyMatrix4(e);
},
unproject: function (t, e) {
var i = t.x,
n = t.y,
s = t.z,
r = t.w,
o = this.x - i,
a = r - this.y - 1 - n,
h = this.z;
return (this.x = (2 * o) / s - 1), (this.y = (2 * a) / r - 1), (this.z = 2 * h - 1), this.project(e);
},
reset: function () {
return (this.x = 0), (this.y = 0), (this.z = 0), this;
},
});
(n.ZERO = new n()),
(n.RIGHT = new n(1, 0, 0)),
(n.LEFT = new n(-1, 0, 0)),
(n.UP = new n(0, -1, 0)),
(n.DOWN = new n(0, 1, 0)),
(n.FORWARD = new n(0, 0, 1)),
(n.BACK = new n(0, 0, -1)),
(n.ONE = new n(1, 1, 1)),
(t.exports = n);
},
function (t, e) {
t.exports = {
LOADER_IDLE: 0,
LOADER_LOADING: 1,
LOADER_PROCESSING: 2,
LOADER_COMPLETE: 3,
LOADER_SHUTDOWN: 4,
LOADER_DESTROYED: 5,
FILE_PENDING: 10,
FILE_LOADING: 11,
FILE_LOADED: 12,
FILE_FAILED: 13,
FILE_PROCESSING: 14,
FILE_ERRORED: 16,
FILE_COMPLETE: 17,
FILE_DESTROYED: 18,
FILE_POPULATED: 19,
};
},
function (t, e, i) {
var n = i(24),
s = i(57);
t.exports = function (t, e) {
if ((void 0 === e && (e = 90), !n(t))) return null;
if (("string" != typeof e && (e = ((e % 360) + 360) % 360), 90 === e || -270 === e || "rotateLeft" === e)) (t = s(t)).reverse();
else if (-90 === e || 270 === e || "rotateRight" === e) t.reverse(), (t = s(t));
else if (180 === Math.abs(e) || "rotate180" === e) {
for (var i = 0; i < t.length; i++) t[i].reverse();
t.reverse();
}
return t;
};
},
function (t, e) {
t.exports = {
SKIP_CHECK: -1,
NORMAL: 0,
ADD: 1,
MULTIPLY: 2,
SCREEN: 3,
OVERLAY: 4,
DARKEN: 5,
LIGHTEN: 6,
COLOR_DODGE: 7,
COLOR_BURN: 8,
HARD_LIGHT: 9,
SOFT_LIGHT: 10,
DIFFERENCE: 11,
EXCLUSION: 12,
HUE: 13,
SATURATION: 14,
COLOR: 15,
LUMINOSITY: 16,
ERASE: 17,
SOURCE_IN: 18,
SOURCE_OUT: 19,
SOURCE_ATOP: 20,
DESTINATION_OVER: 21,
DESTINATION_IN: 22,
DESTINATION_OUT: 23,
DESTINATION_ATOP: 24,
LIGHTER: 25,
COPY: 26,
XOR: 27,
};
},
function (t, e) {
t.exports = function (t, e) {
return Math.random() * (e - t) + t;
};
},
function (t, e, i) {
var n = i(4);
t.exports = function (t) {
return t * n.DEG_TO_RAD;
};
},
function (t, e, i) {
var n = i(0),
s = i(14),
r = new n({
initialize: function (t) {
(this.val = new Float32Array(16)), t ? this.copy(t) : this.identity();
},
clone: function () {
return new r(this);
},
set: function (t) {
return this.copy(t);
},
setValues: function (t, e, i, n, s, r, o, a, h, l, u, c, d, f, p, g) {
var v = this.val;
return (v[0] = t), (v[1] = e), (v[2] = i), (v[3] = n), (v[4] = s), (v[5] = r), (v[6] = o), (v[7] = a), (v[8] = h), (v[9] = l), (v[10] = u), (v[11] = c), (v[12] = d), (v[13] = f), (v[14] = p), (v[15] = g), this;
},
copy: function (t) {
var e = t.val;
return this.setValues(e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8], e[9], e[10], e[11], e[12], e[13], e[14], e[15]);
},
fromArray: function (t) {
return this.setValues(t[0], t[1], t[2], t[3], t[4], t[5], t[6], t[7], t[8], t[9], t[10], t[11], t[12], t[13], t[14], t[15]);
},
zero: function () {
return this.setValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
},
transform: function (t, e, i) {
var n = h.fromQuat(i).val,
s = e.x,
r = e.y,
o = e.z;
return this.setValues(n[0] * s, n[1] * s, n[2] * s, 0, n[4] * r, n[5] * r, n[6] * r, 0, n[8] * o, n[9] * o, n[10] * o, 0, t.x, t.y, t.z, 1);
},
xyz: function (t, e, i) {
this.identity();
var n = this.val;
return (n[12] = t), (n[13] = e), (n[14] = i), this;
},
scaling: function (t, e, i) {
this.zero();
var n = this.val;
return (n[0] = t), (n[5] = e), (n[10] = i), (n[15] = 1), this;
},
identity: function () {
return this.setValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
},
transpose: function () {
var t = this.val,
e = t[1],
i = t[2],
n = t[3],
s = t[6],
r = t[7],
o = t[11];
return (t[1] = t[4]), (t[2] = t[8]), (t[3] = t[12]), (t[4] = e), (t[6] = t[9]), (t[7] = t[13]), (t[8] = i), (t[9] = s), (t[11] = t[14]), (t[12] = n), (t[13] = r), (t[14] = o), this;
},
getInverse: function (t) {
return this.copy(t), this.invert();
},
invert: function () {
var t = this.val,
e = t[0],
i = t[1],
n = t[2],
s = t[3],
r = t[4],
o = t[5],
a = t[6],
h = t[7],
l = t[8],
u = t[9],
c = t[10],
d = t[11],
f = t[12],
p = t[13],
g = t[14],
v = t[15],
y = e * o - i * r,
m = e * a - n * r,
x = e * h - s * r,
b = i * a - n * o,
w = i * h - s * o,
T = n * h - s * a,
S = l * p - u * f,
_ = l * g - c * f,
E = l * v - d * f,
P = u * g - c * p,
A = u * v - d * p,
M = c * v - d * g,
C = y * M - m * A + x * P + b * E - w * _ + T * S;
return C
? ((C = 1 / C),
this.setValues(
(o * M - a * A + h * P) * C,
(n * A - i * M - s * P) * C,
(p * T - g * w + v * b) * C,
(c * w - u * T - d * b) * C,
(a * E - r * M - h * _) * C,
(e * M - n * E + s * _) * C,
(g * x - f * T - v * m) * C,
(l * T - c * x + d * m) * C,
(r * A - o * E + h * S) * C,
(i * E - e * A - s * S) * C,
(f * w - p * x + v * y) * C,
(u * x - l * w - d * y) * C,
(o * _ - r * P - a * S) * C,
(e * P - i * _ + n * S) * C,
(p * m - f * b - g * y) * C,
(l * b - u * m + c * y) * C
))
: this;
},
adjoint: function () {
var t = this.val,
e = t[0],
i = t[1],
n = t[2],
s = t[3],
r = t[4],
o = t[5],
a = t[6],
h = t[7],
l = t[8],
u = t[9],
c = t[10],
d = t[11],
f = t[12],
p = t[13],
g = t[14],
v = t[15];
return this.setValues(
o * (c * v - d * g) - u * (a * v - h * g) + p * (a * d - h * c),
-(i * (c * v - d * g) - u * (n * v - s * g) + p * (n * d - s * c)),
i * (a * v - h * g) - o * (n * v - s * g) + p * (n * h - s * a),
-(i * (a * d - h * c) - o * (n * d - s * c) + u * (n * h - s * a)),
-(r * (c * v - d * g) - l * (a * v - h * g) + f * (a * d - h * c)),
e * (c * v - d * g) - l * (n * v - s * g) + f * (n * d - s * c),
-(e * (a * v - h * g) - r * (n * v - s * g) + f * (n * h - s * a)),
e * (a * d - h * c) - r * (n * d - s * c) + l * (n * h - s * a),
r * (u * v - d * p) - l * (o * v - h * p) + f * (o * d - h * u),
-(e * (u * v - d * p) - l * (i * v - s * p) + f * (i * d - s * u)),
e * (o * v - h * p) - r * (i * v - s * p) + f * (i * h - s * o),
-(e * (o * d - h * u) - r * (i * d - s * u) + l * (i * h - s * o)),
-(r * (u * g - c * p) - l * (o * g - a * p) + f * (o * c - a * u)),
e * (u * g - c * p) - l * (i * g - n * p) + f * (i * c - n * u),
-(e * (o * g - a * p) - r * (i * g - n * p) + f * (i * a - n * o)),
e * (o * c - a * u) - r * (i * c - n * u) + l * (i * a - n * o)
);
},
determinant: function () {
var t = this.val,
e = t[0],
i = t[1],
n = t[2],
s = t[3],
r = t[4],
o = t[5],
a = t[6],
h = t[7],
l = t[8],
u = t[9],
c = t[10],
d = t[11],
f = t[12],
p = t[13],
g = t[14],
v = t[15];
return (
(e * o - i * r) * (c * v - d * g) -
(e * a - n * r) * (u * v - d * p) +
(e * h - s * r) * (u * g - c * p) +
(i * a - n * o) * (l * v - d * f) -
(i * h - s * o) * (l * g - c * f) +
(n * h - s * a) * (l * p - u * f)
);
},
multiply: function (t) {
var e = this.val,
i = e[0],
n = e[1],
s = e[2],
r = e[3],
o = e[4],
a = e[5],
h = e[6],
l = e[7],
u = e[8],
c = e[9],
d = e[10],
f = e[11],
p = e[12],
g = e[13],
v = e[14],
y = e[15],
m = t.val,
x = m[0],
b = m[1],
w = m[2],
T = m[3];
return (
(e[0] = x * i + b * o + w * u + T * p),
(e[1] = x * n + b * a + w * c + T * g),
(e[2] = x * s + b * h + w * d + T * v),
(e[3] = x * r + b * l + w * f + T * y),
(x = m[4]),
(b = m[5]),
(w = m[6]),
(T = m[7]),
(e[4] = x * i + b * o + w * u + T * p),
(e[5] = x * n + b * a + w * c + T * g),
(e[6] = x * s + b * h + w * d + T * v),
(e[7] = x * r + b * l + w * f + T * y),
(x = m[8]),
(b = m[9]),
(w = m[10]),
(T = m[11]),
(e[8] = x * i + b * o + w * u + T * p),
(e[9] = x * n + b * a + w * c + T * g),
(e[10] = x * s + b * h + w * d + T * v),
(e[11] = x * r + b * l + w * f + T * y),
(x = m[12]),
(b = m[13]),
(w = m[14]),
(T = m[15]),
(e[12] = x * i + b * o + w * u + T * p),
(e[13] = x * n + b * a + w * c + T * g),
(e[14] = x * s + b * h + w * d + T * v),
(e[15] = x * r + b * l + w * f + T * y),
this
);
},
multiplyLocal: function (t) {
var e = this.val,
i = t.val;
return this.setValues(
e[0] * i[0] + e[1] * i[4] + e[2] * i[8] + e[3] * i[12],
e[0] * i[1] + e[1] * i[5] + e[2] * i[9] + e[3] * i[13],
e[0] * i[2] + e[1] * i[6] + e[2] * i[10] + e[3] * i[14],
e[0] * i[3] + e[1] * i[7] + e[2] * i[11] + e[3] * i[15],
e[4] * i[0] + e[5] * i[4] + e[6] * i[8] + e[7] * i[12],
e[4] * i[1] + e[5] * i[5] + e[6] * i[9] + e[7] * i[13],
e[4] * i[2] + e[5] * i[6] + e[6] * i[10] + e[7] * i[14],
e[4] * i[3] + e[5] * i[7] + e[6] * i[11] + e[7] * i[15],
e[8] * i[0] + e[9] * i[4] + e[10] * i[8] + e[11] * i[12],
e[8] * i[1] + e[9] * i[5] + e[10] * i[9] + e[11] * i[13],
e[8] * i[2] + e[9] * i[6] + e[10] * i[10] + e[11] * i[14],
e[8] * i[3] + e[9] * i[7] + e[10] * i[11] + e[11] * i[15],
e[12] * i[0] + e[13] * i[4] + e[14] * i[8] + e[15] * i[12],
e[12] * i[1] + e[13] * i[5] + e[14] * i[9] + e[15] * i[13],
e[12] * i[2] + e[13] * i[6] + e[14] * i[10] + e[15] * i[14],
e[12] * i[3] + e[13] * i[7] + e[14] * i[11] + e[15] * i[15]
);
},
premultiply: function (t) {
return this.multiplyMatrices(t, this);
},
multiplyMatrices: function (t, e) {
var i = t.val,
n = e.val,
s = i[0],
r = i[4],
o = i[8],
a = i[12],
h = i[1],
l = i[5],
u = i[9],
c = i[13],
d = i[2],
f = i[6],
p = i[10],
g = i[14],
v = i[3],
y = i[7],
m = i[11],
x = i[15],
b = n[0],
w = n[4],
T = n[8],
S = n[12],
_ = n[1],
E = n[5],
P = n[9],
A = n[13],
M = n[2],
C = n[6],
O = n[10],
k = n[14],
R = n[3],
L = n[7],
I = n[11],
D = n[15];
return this.setValues(
s * b + r * _ + o * M + a * R,
h * b + l * _ + u * M + c * R,
d * b + f * _ + p * M + g * R,
v * b + y * _ + m * M + x * R,
s * w + r * E + o * C + a * L,
h * w + l * E + u * C + c * L,
d * w + f * E + p * C + g * L,
v * w + y * E + m * C + x * L,
s * T + r * P + o * O + a * I,
h * T + l * P + u * O + c * I,
d * T + f * P + p * O + g * I,
v * T + y * P + m * O + x * I,
s * S + r * A + o * k + a * D,
h * S + l * A + u * k + c * D,
d * S + f * A + p * k + g * D,
v * S + y * A + m * k + x * D
);
},
translate: function (t) {
return this.translateXYZ(t.x, t.y, t.z);
},
translateXYZ: function (t, e, i) {
var n = this.val;
return (n[12] = n[0] * t + n[4] * e + n[8] * i + n[12]), (n[13] = n[1] * t + n[5] * e + n[9] * i + n[13]), (n[14] = n[2] * t + n[6] * e + n[10] * i + n[14]), (n[15] = n[3] * t + n[7] * e + n[11] * i + n[15]), this;
},
scale: function (t) {
return this.scaleXYZ(t.x, t.y, t.z);
},
scaleXYZ: function (t, e, i) {
var n = this.val;
return (
(n[0] = n[0] * t),
(n[1] = n[1] * t),
(n[2] = n[2] * t),
(n[3] = n[3] * t),
(n[4] = n[4] * e),
(n[5] = n[5] * e),
(n[6] = n[6] * e),
(n[7] = n[7] * e),
(n[8] = n[8] * i),
(n[9] = n[9] * i),
(n[10] = n[10] * i),
(n[11] = n[11] * i),
this
);
},
makeRotationAxis: function (t, e) {
var i = Math.cos(e),
n = Math.sin(e),
s = 1 - i,
r = t.x,
o = t.y,
a = t.z,
h = s * r,
l = s * o;
return this.setValues(h * r + i, h * o - n * a, h * a + n * o, 0, h * o + n * a, l * o + i, l * a - n * r, 0, h * a - n * o, l * a + n * r, s * a * a + i, 0, 0, 0, 0, 1);
},
rotate: function (t, e) {
var i = this.val,
n = e.x,
s = e.y,
r = e.z,
o = Math.sqrt(n * n + s * s + r * r);
if (Math.abs(o) < 1e-6) return this;
(n *= o = 1 / o), (s *= o), (r *= o);
var a = Math.sin(t),
h = Math.cos(t),
l = 1 - h,
u = i[0],
c = i[1],
d = i[2],
f = i[3],
p = i[4],
g = i[5],
v = i[6],
y = i[7],
m = i[8],
x = i[9],
b = i[10],
w = i[11],
T = i[12],
S = i[13],
_ = i[14],
E = i[15],
P = n * n * l + h,
A = s * n * l + r * a,
M = r * n * l - s * a,
C = n * s * l - r * a,
O = s * s * l + h,
k = r * s * l + n * a,
R = n * r * l + s * a,
L = s * r * l - n * a,
I = r * r * l + h;
return this.setValues(
u * P + p * A + m * M,
c * P + g * A + x * M,
d * P + v * A + b * M,
f * P + y * A + w * M,
u * C + p * O + m * k,
c * C + g * O + x * k,
d * C + v * O + b * k,
f * C + y * O + w * k,
u * R + p * L + m * I,
c * R + g * L + x * I,
d * R + v * L + b * I,
f * R + y * L + w * I,
T,
S,
_,
E
);
},
rotateX: function (t) {
var e = this.val,
i = Math.sin(t),
n = Math.cos(t),
s = e[4],
r = e[5],
o = e[6],
a = e[7],
h = e[8],
l = e[9],
u = e[10],
c = e[11];
return (e[4] = s * n + h * i), (e[5] = r * n + l * i), (e[6] = o * n + u * i), (e[7] = a * n + c * i), (e[8] = h * n - s * i), (e[9] = l * n - r * i), (e[10] = u * n - o * i), (e[11] = c * n - a * i), this;
},
rotateY: function (t) {
var e = this.val,
i = Math.sin(t),
n = Math.cos(t),
s = e[0],
r = e[1],
o = e[2],
a = e[3],
h = e[8],
l = e[9],
u = e[10],
c = e[11];
return (e[0] = s * n - h * i), (e[1] = r * n - l * i), (e[2] = o * n - u * i), (e[3] = a * n - c * i), (e[8] = s * i + h * n), (e[9] = r * i + l * n), (e[10] = o * i + u * n), (e[11] = a * i + c * n), this;
},
rotateZ: function (t) {
var e = this.val,
i = Math.sin(t),
n = Math.cos(t),
s = e[0],
r = e[1],
o = e[2],
a = e[3],
h = e[4],
l = e[5],
u = e[6],
c = e[7];
return (e[0] = s * n + h * i), (e[1] = r * n + l * i), (e[2] = o * n + u * i), (e[3] = a * n + c * i), (e[4] = h * n - s * i), (e[5] = l * n - r * i), (e[6] = u * n - o * i), (e[7] = c * n - a * i), this;
},
fromRotationTranslation: function (t, e) {
var i = t.x,
n = t.y,
s = t.z,
r = t.w,
o = i + i,
a = n + n,
h = s + s,
l = i * o,
u = i * a,
c = i * h,
d = n * a,
f = n * h,
p = s * h,
g = r * o,
v = r * a,
y = r * h;
return this.setValues(1 - (d + p), u + y, c - v, 0, u - y, 1 - (l + p), f + g, 0, c + v, f - g, 1 - (l + d), 0, e.x, e.y, e.z, 1);
},
fromQuat: function (t) {
var e = t.x,
i = t.y,
n = t.z,
s = t.w,
r = e + e,
o = i + i,
a = n + n,
h = e * r,
l = e * o,
u = e * a,
c = i * o,
d = i * a,
f = n * a,
p = s * r,
g = s * o,
v = s * a;
return this.setValues(1 - (c + f), l + v, u - g, 0, l - v, 1 - (h + f), d + p, 0, u + g, d - p, 1 - (h + c), 0, 0, 0, 0, 1);
},
frustum: function (t, e, i, n, s, r) {
var o = 1 / (e - t),
a = 1 / (n - i),
h = 1 / (s - r);
return this.setValues(2 * s * o, 0, 0, 0, 0, 2 * s * a, 0, 0, (e + t) * o, (n + i) * a, (r + s) * h, -1, 0, 0, r * s * 2 * h, 0);
},
perspective: function (t, e, i, n) {
var s = 1 / Math.tan(t / 2),
r = 1 / (i - n);
return this.setValues(s / e, 0, 0, 0, 0, s, 0, 0, 0, 0, (n + i) * r, -1, 0, 0, 2 * n * i * r, 0);
},
perspectiveLH: function (t, e, i, n) {
return this.setValues((2 * i) / t, 0, 0, 0, 0, (2 * i) / e, 0, 0, 0, 0, -n / (i - n), 1, 0, 0, (i * n) / (i - n), 0);
},
ortho: function (t, e, i, n, s, r) {
var o = 0 == (o = t - e) ? o : 1 / o,
a = 0 == (a = i - n) ? a : 1 / a,
h = 0 == (h = s - r) ? h : 1 / h;
return this.setValues(-2 * o, 0, 0, 0, 0, -2 * a, 0, 0, 0, 0, 2 * h, 0, (t + e) * o, (n + i) * a, (r + s) * h, 1);
},
lookAtRH: function (t, e, i) {
var n = this.val;
return (
u.subVectors(t, e),
0 === u.getLengthSquared() && (u.z = 1),
u.normalize(),
o.crossVectors(i, u),
0 === o.getLengthSquared() && (1 === Math.abs(i.z) ? (u.x += 1e-4) : (u.z += 1e-4), u.normalize(), o.crossVectors(i, u)),
o.normalize(),
a.crossVectors(u, o),
(n[0] = o.x),
(n[1] = o.y),
(n[2] = o.z),
(n[4] = a.x),
(n[5] = a.y),
(n[6] = a.z),
(n[8] = u.x),
(n[9] = u.y),
(n[10] = u.z),
this
);
},
lookAt: function (t, e, i) {
var n = t.x,
s = t.y,
r = t.z,
o = i.x,
a = i.y,
h = i.z,
l = e.x,
u = e.y,
c = e.z;
if (Math.abs(n - l) < 1e-6 && Math.abs(s - u) < 1e-6 && Math.abs(r - c) < 1e-6) return this.identity();
var d = n - l,
f = s - u,
p = r - c,
g = 1 / Math.sqrt(d * d + f * f + p * p),
v = a * (p *= g) - h * (f *= g),
y = h * (d *= g) - o * p,
m = o * f - a * d;
(g = Math.sqrt(v * v + y * y + m * m)) ? ((v *= g = 1 / g), (y *= g), (m *= g)) : (m = y = v = 0);
var x = f * m - p * y,
b = p * v - d * m,
w = d * y - f * v;
return (
(g = Math.sqrt(x * x + b * b + w * w)) ? ((x *= g = 1 / g), (b *= g), (w *= g)) : (w = b = x = 0),
this.setValues(v, x, d, 0, y, b, f, 0, m, w, p, 0, -(v * n + y * s + m * r), -(x * n + b * s + w * r), -(d * n + f * s + p * r), 1)
);
},
yawPitchRoll: function (t, e, i) {
this.zero(), h.zero(), l.zero();
var n = this.val,
s = h.val,
r = l.val,
o = Math.sin(i),
a = Math.cos(i);
return (
(n[10] = 1),
(n[15] = 1),
(n[0] = a),
(n[1] = o),
(n[4] = -o),
(n[5] = a),
(o = Math.sin(e)),
(a = Math.cos(e)),
(s[0] = 1),
(s[15] = 1),
(s[5] = a),
(s[10] = a),
(s[9] = -o),
(s[6] = o),
(o = Math.sin(t)),
(a = Math.cos(t)),
(r[5] = 1),
(r[15] = 1),
(r[0] = a),
(r[2] = -o),
(r[8] = o),
(r[10] = a),
this.multiplyLocal(h),
this.multiplyLocal(l),
this
);
},
setWorldMatrix: function (t, e, i, n, s) {
return this.yawPitchRoll(t.y, t.x, t.z), h.scaling(i.x, i.y, i.z), l.xyz(e.x, e.y, e.z), this.multiplyLocal(h), this.multiplyLocal(l), n && this.multiplyLocal(n), s && this.multiplyLocal(s), this;
},
multiplyToMat4: function (t, e) {
var i = this.val,
n = t.val,
s = i[0],
r = i[1],
o = i[2],
a = i[3],
h = i[4],
l = i[5],
u = i[6],
c = i[7],
d = i[8],
f = i[9],
p = i[10],
g = i[11],
v = i[12],
y = i[13],
m = i[14],
x = i[15],
b = n[0],
w = n[1],
T = n[2],
S = n[3],
_ = n[4],
E = n[5],
P = n[6],
A = n[7],
M = n[8],
C = n[9],
O = n[10],
k = n[11],
R = n[12],
L = n[13],
I = n[14],
D = n[15];
return e.setValues(
b * s + w * h + T * d + S * v,
w * r + w * l + T * f + S * y,
T * o + w * u + T * p + S * m,
S * a + w * c + T * g + S * x,
_ * s + E * h + P * d + A * v,
_ * r + E * l + P * f + A * y,
_ * o + E * u + P * p + A * m,
_ * a + E * c + P * g + A * x,
M * s + C * h + O * d + k * v,
M * r + C * l + O * f + k * y,
M * o + C * u + O * p + k * m,
M * a + C * c + O * g + k * x,
R * s + L * h + I * d + D * v,
R * r + L * l + I * f + D * y,
R * o + L * u + I * p + D * m,
R * a + L * c + I * g + D * x
);
},
fromRotationXYTranslation: function (t, e, i) {
var n = e.x,
s = e.y,
r = e.z,
o = Math.sin(t.x),
a = Math.cos(t.x),
h = Math.sin(t.y),
l = Math.cos(t.y),
u = n,
c = s,
d = r,
f = -o,
p = 0 - f * h,
g = 0 - a * h,
v = f * l,
y = a * l;
return i || ((u = l * n + h * r), (c = p * n + a * s + v * r), (d = g * n + o * s + y * r)), this.setValues(l, p, g, 0, 0, a, o, 0, h, v, y, 0, u, c, d, 1);
},
getMaxScaleOnAxis: function () {
var t = this.val,
e = t[0] * t[0] + t[1] * t[1] + t[2] * t[2],
i = t[4] * t[4] + t[5] * t[5] + t[6] * t[6],
n = t[8] * t[8] + t[9] * t[9] + t[10] * t[10];
return Math.sqrt(Math.max(e, i, n));
},
}),
h = new r(),
l = new r(),
o = new s(),
a = new s(),
u = new s();
t.exports = r;
},
function (t, e, i) {
var n = i(0),
s = i(15),
r = i(205),
o = i(11),
a = i(216),
h = i(45),
l = i(217),
u = i(46),
c = new n({
initialize: function (t, e) {
(this.loader = t), (this.cache = o(e, "cache", !1)), (this.type = o(e, "type", !1)), (this.key = o(e, "key", !1));
var i = this.key;
if ((t.prefix && "" !== t.prefix && (this.key = t.prefix + i), !this.type || !this.key)) throw new Error("Invalid Loader." + this.type + " key");
var n = o(e, "url");
void 0 === n ? (n = t.path + i + "." + o(e, "extension", "")) : "string" != typeof n || n.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/) || (n = t.path + n),
(this.url = n),
(this.src = ""),
(this.xhrSettings = u(o(e, "responseType", void 0))),
o(e, "xhrSettings", !1) && (this.xhrSettings = h(this.xhrSettings, o(e, "xhrSettings", {}))),
(this.xhrLoader = null),
(this.state = "function" == typeof this.url ? s.FILE_POPULATED : s.FILE_PENDING),
(this.bytesTotal = 0),
(this.bytesLoaded = -1),
(this.percentComplete = -1),
(this.crossOrigin = void 0),
(this.data = void 0),
(this.config = o(e, "config", {})),
this.multiFile,
this.linkFile;
},
setLink: function (t) {
(this.linkFile = t).linkFile = this;
},
resetXHR: function () {
this.xhrLoader && ((this.xhrLoader.onload = void 0), (this.xhrLoader.onerror = void 0), (this.xhrLoader.onprogress = void 0));
},
load: function () {
this.state === s.FILE_POPULATED
? this.loader.nextFile(this, !0)
: ((this.state = s.FILE_LOADING), (this.src = a(this, this.loader.baseURL)), 0 === this.src.indexOf("data:") || (this.xhrLoader = l(this, this.loader.xhr)));
},
onLoad: function (t, e) {
var i = t.responseURL && 0 === t.responseURL.indexOf("file://") && 0 === e.target.status,
n = !(e.target && 200 !== e.target.status) || i;
4 === t.readyState && 400 <= t.status && t.status <= 599 && (n = !1), (this.state = s.FILE_LOADED), this.resetXHR(), this.loader.nextFile(this, n);
},
onError: function () {
this.resetXHR(), this.loader.nextFile(this, !1);
},
onProgress: function (t) {
t.lengthComputable &&
((this.bytesLoaded = t.loaded), (this.bytesTotal = t.total), (this.percentComplete = Math.min(this.bytesLoaded / this.bytesTotal, 1)), this.loader.emit(r.FILE_PROGRESS, this, this.percentComplete));
},
onProcess: function () {
(this.state = s.FILE_PROCESSING), this.onProcessComplete();
},
onProcessComplete: function () {
(this.state = s.FILE_COMPLETE), this.multiFile && this.multiFile.onFileComplete(this), this.loader.fileProcessComplete(this);
},
onProcessError: function () {
(this.state = s.FILE_ERRORED), this.multiFile && this.multiFile.onFileFailed(this), this.loader.fileProcessComplete(this);
},
hasCacheConflict: function () {
return this.cache && this.cache.exists(this.key);
},
addToCache: function () {
this.cache && this.cache.add(this.key, this.data), this.pendingDestroy();
},
pendingDestroy: function (t) {
void 0 === t && (t = this.data);
var e = this.key,
i = this.type;
this.loader.emit(r.FILE_COMPLETE, e, i, t), this.loader.emit(r.FILE_KEY_COMPLETE + i + "-" + e, e, i, t), this.loader.flagForRemoval(this);
},
destroy: function () {
(this.loader = null), (this.cache = null), (this.xhrSettings = null), (this.multiFile = null), (this.linkFile = null), (this.data = null);
},
});
(c.createObjectURL = function (t, e, i) {
var n;
"function" == typeof URL
? (t.src = URL.createObjectURL(e))
: (((n = new FileReader()).onload = function () {
t.removeAttribute("crossOrigin"), (t.src = "data:" + (e.type || i) + ";base64," + n.result.split(",")[1]);
}),
(n.onerror = t.onerror),
n.readAsDataURL(e));
}),
(c.revokeObjectURL = function (t) {
"function" == typeof URL && URL.revokeObjectURL(t.src);
}),
(t.exports = c);
},
function (t, e) {
var i = {},
n = {
install: function (t) {
for (var e in i) t[e] = i[e];
},
register: function (t, e) {
i[t] = e;
},
destroy: function () {
i = {};
},
};
t.exports = n;
},
function (t, e, i) {
var n = i(0),
r = i(4),
c = i(2),
s = new n({
initialize: function (t, e, i, n, s, r) {
void 0 === t && (t = 1),
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 1),
void 0 === s && (s = 0),
void 0 === r && (r = 0),
(this.matrix = new Float32Array([t, e, i, n, s, r, 0, 0, 1])),
(this.decomposedMatrix = { translateX: 0, translateY: 0, scaleX: 1, scaleY: 1, rotation: 0 });
},
a: {
get: function () {
return this.matrix[0];
},
set: function (t) {
this.matrix[0] = t;
},
},
b: {
get: function () {
return this.matrix[1];
},
set: function (t) {
this.matrix[1] = t;
},
},
c: {
get: function () {
return this.matrix[2];
},
set: function (t) {
this.matrix[2] = t;
},
},
d: {
get: function () {
return this.matrix[3];
},
set: function (t) {
this.matrix[3] = t;
},
},
e: {
get: function () {
return this.matrix[4];
},
set: function (t) {
this.matrix[4] = t;
},
},
f: {
get: function () {
return this.matrix[5];
},
set: function (t) {
this.matrix[5] = t;
},
},
tx: {
get: function () {
return this.matrix[4];
},
set: function (t) {
this.matrix[4] = t;
},
},
ty: {
get: function () {
return this.matrix[5];
},
set: function (t) {
this.matrix[5] = t;
},
},
rotation: {
get: function () {
return Math.acos(this.a / this.scaleX) * (Math.atan(-this.c / this.a) < 0 ? -1 : 1);
},
},
rotationNormalized: {
get: function () {
var t = this.matrix,
e = t[0],
i = t[1],
n = t[2],
s = t[3];
return e || i ? (0 < i ? Math.acos(e / this.scaleX) : -Math.acos(e / this.scaleX)) : n || s ? r.TAU - (0 < s ? Math.acos(-n / this.scaleY) : -Math.acos(n / this.scaleY)) : 0;
},
},
scaleX: {
get: function () {
return Math.sqrt(this.a * this.a + this.b * this.b);
},
},
scaleY: {
get: function () {
return Math.sqrt(this.c * this.c + this.d * this.d);
},
},
loadIdentity: function () {
var t = this.matrix;
return (t[0] = 1), (t[1] = 0), (t[2] = 0), (t[3] = 1), (t[4] = 0), (t[5] = 0), this;
},
translate: function (t, e) {
var i = this.matrix;
return (i[4] = i[0] * t + i[2] * e + i[4]), (i[5] = i[1] * t + i[3] * e + i[5]), this;
},
scale: function (t, e) {
var i = this.matrix;
return (i[0] *= t), (i[1] *= t), (i[2] *= e), (i[3] *= e), this;
},
rotate: function (t) {
var e = Math.sin(t),
i = Math.cos(t),
n = this.matrix,
s = n[0],
r = n[1],
o = n[2],
a = n[3];
return (n[0] = s * i + o * e), (n[1] = r * i + a * e), (n[2] = s * -e + o * i), (n[3] = r * -e + a * i), this;
},
multiply: function (t, e) {
var i = this.matrix,
n = t.matrix,
s = i[0],
r = i[1],
o = i[2],
a = i[3],
h = i[4],
l = i[5],
u = n[0],
c = n[1],
d = n[2],
f = n[3],
p = n[4],
g = n[5],
v = void 0 === e ? this : e;
return (v.a = u * s + c * o), (v.b = u * r + c * a), (v.c = d * s + f * o), (v.d = d * r + f * a), (v.e = p * s + g * o + h), (v.f = p * r + g * a + l), v;
},
multiplyWithOffset: function (t, e, i) {
var n = this.matrix,
s = t.matrix,
r = n[0],
o = n[1],
a = n[2],
h = n[3],
l = e * r + i * a + n[4],
u = e * o + i * h + n[5],
c = s[0],
d = s[1],
f = s[2],
p = s[3],
g = s[4],
v = s[5];
return (n[0] = c * r + d * a), (n[1] = c * o + d * h), (n[2] = f * r + p * a), (n[3] = f * o + p * h), (n[4] = g * r + v * a + l), (n[5] = g * o + v * h + u), this;
},
transform: function (t, e, i, n, s, r) {
var o = this.matrix,
a = o[0],
h = o[1],
l = o[2],
u = o[3],
c = o[4],
d = o[5];
return (o[0] = t * a + e * l), (o[1] = t * h + e * u), (o[2] = i * a + n * l), (o[3] = i * h + n * u), (o[4] = s * a + r * l + c), (o[5] = s * h + r * u + d), this;
},
transformPoint: function (t, e, i) {
void 0 === i && (i = { x: 0, y: 0 });
var n = this.matrix,
s = n[0],
r = n[1],
o = n[2],
a = n[3],
h = n[4],
l = n[5];
return (i.x = t * s + e * o + h), (i.y = t * r + e * a + l), i;
},
invert: function () {
var t = this.matrix,
e = t[0],
i = t[1],
n = t[2],
s = t[3],
r = t[4],
o = t[5],
a = e * s - i * n;
return (t[0] = s / a), (t[1] = -i / a), (t[2] = -n / a), (t[3] = e / a), (t[4] = (n * o - s * r) / a), (t[5] = -(e * o - i * r) / a), this;
},
copyFrom: function (t) {
var e = this.matrix;
return (e[0] = t.a), (e[1] = t.b), (e[2] = t.c), (e[3] = t.d), (e[4] = t.e), (e[5] = t.f), this;
},
copyFromArray: function (t) {
var e = this.matrix;
return (e[0] = t[0]), (e[1] = t[1]), (e[2] = t[2]), (e[3] = t[3]), (e[4] = t[4]), (e[5] = t[5]), this;
},
copyToContext: function (t) {
var e = this.matrix;
return t.transform(e[0], e[1], e[2], e[3], e[4], e[5]), t;
},
setToContext: function (t) {
var e = this.matrix;
return t.setTransform(e[0], e[1], e[2], e[3], e[4], e[5]), t;
},
copyToArray: function (t) {
var e = this.matrix;
return void 0 === t ? (t = [e[0], e[1], e[2], e[3], e[4], e[5]]) : ((t[0] = e[0]), (t[1] = e[1]), (t[2] = e[2]), (t[3] = e[3]), (t[4] = e[4]), (t[5] = e[5])), t;
},
setTransform: function (t, e, i, n, s, r) {
var o = this.matrix;
return (o[0] = t), (o[1] = e), (o[2] = i), (o[3] = n), (o[4] = s), (o[5] = r), this;
},
decomposeMatrix: function () {
var t,
e,
i = this.decomposedMatrix,
n = this.matrix,
s = n[0],
r = n[1],
o = n[2],
a = n[3],
h = s * a - r * o;
return (
(i.translateX = n[4]),
(i.translateY = n[5]),
s || r
? ((t = Math.sqrt(s * s + r * r)), (i.rotation = 0 < r ? Math.acos(s / t) : -Math.acos(s / t)), (i.scaleX = t), (i.scaleY = h / t))
: o || a
? ((e = Math.sqrt(o * o + a * a)), (i.rotation = 0.5 * Math.PI - (0 < a ? Math.acos(-o / e) : -Math.acos(o / e))), (i.scaleX = h / e), (i.scaleY = e))
: ((i.rotation = 0), (i.scaleX = 0), (i.scaleY = 0)),
i
);
},
applyITRS: function (t, e, i, n, s) {
var r = this.matrix,
o = Math.sin(i),
a = Math.cos(i);
return (r[4] = t), (r[5] = e), (r[0] = a * n), (r[1] = o * n), (r[2] = -o * s), (r[3] = a * s), this;
},
applyInverse: function (t, e, i) {
void 0 === i && (i = new c());
var n = this.matrix,
s = n[0],
r = n[1],
o = n[2],
a = n[3],
h = n[4],
l = n[5],
u = 1 / (s * a + o * -r);
return (i.x = a * u * t + -o * u * e + (l * o - h * a) * u), (i.y = s * u * e + -r * u * t + (-l * s + h * r) * u), i;
},
getX: function (t, e) {
return t * this.a + e * this.c + this.e;
},
getY: function (t, e) {
return t * this.b + e * this.d + this.f;
},
getXRound: function (t, e, i) {
var n = this.getX(t, e);
return i && (n = Math.round(n)), n;
},
getYRound: function (t, e, i) {
var n = this.getY(t, e);
return i && (n = Math.round(n)), n;
},
getCSSMatrix: function () {
var t = this.matrix;
return "matrix(" + t[0] + "," + t[1] + "," + t[2] + "," + t[3] + "," + t[4] + "," + t[5] + ")";
},
destroy: function () {
(this.matrix = null), (this.decomposedMatrix = null);
},
});
t.exports = s;
},
function (t, e) {
t.exports = function (t) {
if (!Array.isArray(t) || t.length < 2 || !Array.isArray(t[0])) return !1;
for (var e = t[0].length, i = 1; i < t.length; i++) if (t[i].length !== e) return !1;
return !0;
};
},
function (t, e, i) {
var n = i(0),
s = i(299),
r = i(61),
o = i(300),
a = i(26),
h = i(301),
l = i(306),
u = new n({
initialize: function (t, e, i, n) {
void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === n && (n = 0), (this.type = a.RECTANGLE), (this.x = t), (this.y = e), (this.width = i), (this.height = n);
},
contains: function (t, e) {
return s(this, t, e);
},
getPoint: function (t, e) {
return r(this, t, e);
},
getPoints: function (t, e, i) {
return o(this, t, e, i);
},
getRandomPoint: function (t) {
return l(this, t);
},
setTo: function (t, e, i, n) {
return (this.x = t), (this.y = e), (this.width = i), (this.height = n), this;
},
setEmpty: function () {
return this.setTo(0, 0, 0, 0);
},
setPosition: function (t, e) {
return void 0 === e && (e = t), (this.x = t), (this.y = e), this;
},
setSize: function (t, e) {
return void 0 === e && (e = t), (this.width = t), (this.height = e), this;
},
isEmpty: function () {
return this.width <= 0 || this.height <= 0;
},
getLineA: function (t) {
return void 0 === t && (t = new h()), t.setTo(this.x, this.y, this.right, this.y), t;
},
getLineB: function (t) {
return void 0 === t && (t = new h()), t.setTo(this.right, this.y, this.right, this.bottom), t;
},
getLineC: function (t) {
return void 0 === t && (t = new h()), t.setTo(this.right, this.bottom, this.x, this.bottom), t;
},
getLineD: function (t) {
return void 0 === t && (t = new h()), t.setTo(this.x, this.bottom, this.x, this.y), t;
},
left: {
get: function () {
return this.x;
},
set: function (t) {
t >= this.right ? (this.width = 0) : (this.width = this.right - t), (this.x = t);
},
},
right: {
get: function () {
return this.x + this.width;
},
set: function (t) {
t <= this.x ? (this.width = 0) : (this.width = t - this.x);
},
},
top: {
get: function () {
return this.y;
},
set: function (t) {
t >= this.bottom ? (this.height = 0) : (this.height = this.bottom - t), (this.y = t);
},
},
bottom: {
get: function () {
return this.y + this.height;
},
set: function (t) {
t <= this.y ? (this.height = 0) : (this.height = t - this.y);
},
},
centerX: {
get: function () {
return this.x + this.width / 2;
},
set: function (t) {
this.x = t - this.width / 2;
},
},
centerY: {
get: function () {
return this.y + this.height / 2;
},
set: function (t) {
this.y = t - this.height / 2;
},
},
});
t.exports = u;
},
function (t, e) {
t.exports = { CIRCLE: 0, ELLIPSE: 1, LINE: 2, POINT: 3, POLYGON: 4, RECTANGLE: 5, TRIANGLE: 6 };
},
function (t, e, i) {
var u = i(7),
c = function () {
var t,
e,
i,
n,
s,
r,
o = arguments[0] || {},
a = 1,
h = arguments.length,
l = !1;
for ("boolean" == typeof o && ((l = o), (o = arguments[1] || {}), (a = 2)), h === a && ((o = this), --a); a < h; a++)
if (null != (t = arguments[a]))
for (e in t)
(i = o[e]), o !== (n = t[e]) && (l && n && (u(n) || (s = Array.isArray(n))) ? ((r = s ? ((s = !1), i && Array.isArray(i) ? i : []) : i && u(i) ? i : {}), (o[e] = c(l, r, n))) : void 0 !== n && (o[e] = n));
return o;
};
t.exports = c;
},
function (t, e) {
t.exports = function (t, e, i, n) {
return Math.atan2(n - e, i - t);
};
},
function (t, e) {
t.exports = function (t) {
return 0 <= (t %= 2 * Math.PI) ? t : t + 2 * Math.PI;
};
},
function (t, e, i) {
var n = i(6);
t.exports = function (t) {
return n(t, -Math.PI, Math.PI);
};
},
function (t, e, i) {
var n = i(6);
t.exports = function (t) {
return n(t, -180, 180);
};
},
function (t, e) {
t.exports = function (t, e, i) {
return void 0 === i && (i = 1e-4), Math.abs(t - e) < i;
};
},
function (t, e, i) {
var n = i(34);
t.exports = function (t, e) {
return n(t) / n(e) / n(t - e);
};
},
function (t, e) {
t.exports = function (t) {
if (0 === t) return 1;
for (var e = t; --t; ) e *= t;
return e;
};
},
function (t, e) {
t.exports = function (t, e, i, n, s) {
var r = 0.5 * (n - e),
o = 0.5 * (s - i),
a = t * t;
return (2 * i - 2 * n + r + o) * (t * a) + (-3 * i + 3 * n - 2 * r - o) * a + r * t + i;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return (e - t) * i + t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return t <= e ? 0 : i <= t ? 1 : (t = (t - e) / (i - e)) * t * (3 - 2 * t);
};
},
function (t, e) {
t.exports = function (t, e, i) {
return (t = Math.max(0, Math.min(1, (t - e) / (i - e)))) * t * t * (t * (6 * t - 15) + 10);
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = Math.cos(n),
r = Math.sin(n),
o = t.x - e,
a = t.y - i;
return (t.x = o * s - a * r + e), (t.y = o * r + a * s + i), t;
};
},
function (t, e) {
t.exports = function (t) {
return 0 < t ? Math.ceil(t) : Math.floor(t);
};
},
function (t, e, i) {
var g = i(2);
t.exports = function (t, e, i, n, s, r, o, a) {
void 0 === a && (a = new g());
var h = Math.sin(s),
l = Math.cos(s),
u = l * r,
c = h * r,
d = -h * o,
f = l * o,
p = 1 / (u * f + d * -c);
return (a.x = f * p * t + -d * p * e + (n * d - i * f) * p), (a.y = u * p * e + -c * p * t + (-n * u + i * c) * p), a;
};
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t) {
(this.val = new Float32Array(9)), t ? this.copy(t) : this.identity();
},
clone: function () {
return new n(this);
},
set: function (t) {
return this.copy(t);
},
copy: function (t) {
var e = this.val,
i = t.val;
return (e[0] = i[0]), (e[1] = i[1]), (e[2] = i[2]), (e[3] = i[3]), (e[4] = i[4]), (e[5] = i[5]), (e[6] = i[6]), (e[7] = i[7]), (e[8] = i[8]), this;
},
fromMat4: function (t) {
var e = t.val,
i = this.val;
return (i[0] = e[0]), (i[1] = e[1]), (i[2] = e[2]), (i[3] = e[4]), (i[4] = e[5]), (i[5] = e[6]), (i[6] = e[8]), (i[7] = e[9]), (i[8] = e[10]), this;
},
fromArray: function (t) {
var e = this.val;
return (e[0] = t[0]), (e[1] = t[1]), (e[2] = t[2]), (e[3] = t[3]), (e[4] = t[4]), (e[5] = t[5]), (e[6] = t[6]), (e[7] = t[7]), (e[8] = t[8]), this;
},
identity: function () {
var t = this.val;
return (t[0] = 1), (t[1] = 0), (t[2] = 0), (t[3] = 0), (t[4] = 1), (t[5] = 0), (t[6] = 0), (t[7] = 0), (t[8] = 1), this;
},
transpose: function () {
var t = this.val,
e = t[1],
i = t[2],
n = t[5];
return (t[1] = t[3]), (t[2] = t[6]), (t[3] = e), (t[5] = t[7]), (t[6] = i), (t[7] = n), this;
},
invert: function () {
var t = this.val,
e = t[0],
i = t[1],
n = t[2],
s = t[3],
r = t[4],
o = t[5],
a = t[6],
h = t[7],
l = t[8],
u = l * r - o * h,
c = -l * s + o * a,
d = h * s - r * a,
f = e * u + i * c + n * d;
return f
? ((f = 1 / f),
(t[0] = u * f),
(t[1] = (-l * i + n * h) * f),
(t[2] = (o * i - n * r) * f),
(t[3] = c * f),
(t[4] = (l * e - n * a) * f),
(t[5] = (-o * e + n * s) * f),
(t[6] = d * f),
(t[7] = (-h * e + i * a) * f),
(t[8] = (r * e - i * s) * f),
this)
: null;
},
adjoint: function () {
var t = this.val,
e = t[0],
i = t[1],
n = t[2],
s = t[3],
r = t[4],
o = t[5],
a = t[6],
h = t[7],
l = t[8];
return (
(t[0] = r * l - o * h),
(t[1] = n * h - i * l),
(t[2] = i * o - n * r),
(t[3] = o * a - s * l),
(t[4] = e * l - n * a),
(t[5] = n * s - e * o),
(t[6] = s * h - r * a),
(t[7] = i * a - e * h),
(t[8] = e * r - i * s),
this
);
},
determinant: function () {
var t = this.val,
e = t[0],
i = t[1],
n = t[2],
s = t[3],
r = t[4],
o = t[5],
a = t[6],
h = t[7],
l = t[8];
return e * (l * r - o * h) + i * (-l * s + o * a) + n * (h * s - r * a);
},
multiply: function (t) {
var e = this.val,
i = e[0],
n = e[1],
s = e[2],
r = e[3],
o = e[4],
a = e[5],
h = e[6],
l = e[7],
u = e[8],
c = t.val,
d = c[0],
f = c[1],
p = c[2],
g = c[3],
v = c[4],
y = c[5],
m = c[6],
x = c[7],
b = c[8];
return (
(e[0] = d * i + f * r + p * h),
(e[1] = d * n + f * o + p * l),
(e[2] = d * s + f * a + p * u),
(e[3] = g * i + v * r + y * h),
(e[4] = g * n + v * o + y * l),
(e[5] = g * s + v * a + y * u),
(e[6] = m * i + x * r + b * h),
(e[7] = m * n + x * o + b * l),
(e[8] = m * s + x * a + b * u),
this
);
},
translate: function (t) {
var e = this.val,
i = t.x,
n = t.y;
return (e[6] = i * e[0] + n * e[3] + e[6]), (e[7] = i * e[1] + n * e[4] + e[7]), (e[8] = i * e[2] + n * e[5] + e[8]), this;
},
rotate: function (t) {
var e = this.val,
i = e[0],
n = e[1],
s = e[2],
r = e[3],
o = e[4],
a = e[5],
h = Math.sin(t),
l = Math.cos(t);
return (e[0] = l * i + h * r), (e[1] = l * n + h * o), (e[2] = l * s + h * a), (e[3] = l * r - h * i), (e[4] = l * o - h * n), (e[5] = l * a - h * s), this;
},
scale: function (t) {
var e = this.val,
i = t.x,
n = t.y;
return (e[0] = i * e[0]), (e[1] = i * e[1]), (e[2] = i * e[2]), (e[3] = n * e[3]), (e[4] = n * e[4]), (e[5] = n * e[5]), this;
},
fromQuat: function (t) {
var e = t.x,
i = t.y,
n = t.z,
s = t.w,
r = e + e,
o = i + i,
a = n + n,
h = e * r,
l = e * o,
u = e * a,
c = i * o,
d = i * a,
f = n * a,
p = s * r,
g = s * o,
v = s * a,
y = this.val;
return (y[0] = 1 - (c + f)), (y[3] = l + v), (y[6] = u - g), (y[1] = l - v), (y[4] = 1 - (h + f)), (y[7] = d + p), (y[2] = u + g), (y[5] = d - p), (y[8] = 1 - (h + c)), this;
},
normalFromMat4: function (t) {
var e = t.val,
i = this.val,
n = e[0],
s = e[1],
r = e[2],
o = e[3],
a = e[4],
h = e[5],
l = e[6],
u = e[7],
c = e[8],
d = e[9],
f = e[10],
p = e[11],
g = e[12],
v = e[13],
y = e[14],
m = e[15],
x = n * h - s * a,
b = n * l - r * a,
w = n * u - o * a,
T = s * l - r * h,
S = s * u - o * h,
_ = r * u - o * l,
E = c * v - d * g,
P = c * y - f * g,
A = c * m - p * g,
M = d * y - f * v,
C = d * m - p * v,
O = f * m - p * y,
k = x * O - b * C + w * M + T * A - S * P + _ * E;
return k
? ((k = 1 / k),
(i[0] = (h * O - l * C + u * M) * k),
(i[1] = (l * A - a * O - u * P) * k),
(i[2] = (a * C - h * A + u * E) * k),
(i[3] = (r * C - s * O - o * M) * k),
(i[4] = (n * O - r * A + o * P) * k),
(i[5] = (s * A - n * C - o * E) * k),
(i[6] = (v * _ - y * S + m * T) * k),
(i[7] = (y * w - g * _ - m * b) * k),
(i[8] = (g * S - v * w + m * x) * k),
this)
: null;
},
});
t.exports = n;
},
function (t, e, i) {
var n = i(0),
s = i(42),
r = i(1),
o = i(14),
a = new Int8Array([1, 2, 0]),
h = new Float32Array([0, 0, 0]),
l = new o(1, 0, 0),
u = new o(0, 1, 0),
c = new o(),
d = new s(),
f = new n({
initialize: function (t, e, i, n) {
(this.onChangeCallback = r), this.set(t, e, i, n);
},
x: {
get: function () {
return this._x;
},
set: function (t) {
(this._x = t), this.onChangeCallback(this);
},
},
y: {
get: function () {
return this._y;
},
set: function (t) {
(this._y = t), this.onChangeCallback(this);
},
},
z: {
get: function () {
return this._z;
},
set: function (t) {
(this._z = t), this.onChangeCallback(this);
},
},
w: {
get: function () {
return this._w;
},
set: function (t) {
(this._w = t), this.onChangeCallback(this);
},
},
copy: function (t) {
return this.set(t);
},
set: function (t, e, i, n, s) {
return (
void 0 === s && (s = !0),
"object" == typeof t ? ((this._x = t.x || 0), (this._y = t.y || 0), (this._z = t.z || 0), (this._w = t.w || 0)) : ((this._x = t || 0), (this._y = e || 0), (this._z = i || 0), (this._w = n || 0)),
s && this.onChangeCallback(this),
this
);
},
add: function (t) {
return (this._x += t.x), (this._y += t.y), (this._z += t.z), (this._w += t.w), this.onChangeCallback(this), this;
},
subtract: function (t) {
return (this._x -= t.x), (this._y -= t.y), (this._z -= t.z), (this._w -= t.w), this.onChangeCallback(this), this;
},
scale: function (t) {
return (this._x *= t), (this._y *= t), (this._z *= t), (this._w *= t), this.onChangeCallback(this), this;
},
length: function () {
var t = this.x,
e = this.y,
i = this.z,
n = this.w;
return Math.sqrt(t * t + e * e + i * i + n * n);
},
lengthSq: function () {
var t = this.x,
e = this.y,
i = this.z,
n = this.w;
return t * t + e * e + i * i + n * n;
},
normalize: function () {
var t = this.x,
e = this.y,
i = this.z,
n = this.w,
s = t * t + e * e + i * i + n * n;
return 0 < s && ((s = 1 / Math.sqrt(s)), (this._x = t * s), (this._y = e * s), (this._z = i * s), (this._w = n * s)), this.onChangeCallback(this), this;
},
dot: function (t) {
return this.x * t.x + this.y * t.y + this.z * t.z + this.w * t.w;
},
lerp: function (t, e) {
void 0 === e && (e = 0);
var i = this.x,
n = this.y,
s = this.z,
r = this.w;
return this.set(i + e * (t.x - i), n + e * (t.y - n), s + e * (t.z - s), r + e * (t.w - r));
},
rotationTo: function (t, e) {
var i = t.x * e.x + t.y * e.y + t.z * e.z;
return i < -0.999999
? (c.copy(l).cross(t).length() < 1e-6 && c.copy(u).cross(t), c.normalize(), this.setAxisAngle(c, Math.PI))
: 0.999999 < i
? this.set(0, 0, 0, 1)
: (c.copy(t).cross(e), (this._x = c.x), (this._y = c.y), (this._z = c.z), (this._w = 1 + i), this.normalize());
},
setAxes: function (t, e, i) {
var n = d.val;
return (n[0] = e.x), (n[3] = e.y), (n[6] = e.z), (n[1] = i.x), (n[4] = i.y), (n[7] = i.z), (n[2] = -t.x), (n[5] = -t.y), (n[8] = -t.z), this.fromMat3(d).normalize();
},
identity: function () {
return this.set(0, 0, 0, 1);
},
setAxisAngle: function (t, e) {
e *= 0.5;
var i = Math.sin(e);
return this.set(i * t.x, i * t.y, i * t.z, Math.cos(e));
},
multiply: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = this.w,
r = t.x,
o = t.y,
a = t.z,
h = t.w;
return this.set(e * h + s * r + i * a - n * o, i * h + s * o + n * r - e * a, n * h + s * a + e * o - i * r, s * h - e * r - i * o - n * a);
},
slerp: function (t, e) {
var i = this.x,
n = this.y,
s = this.z,
r = this.w,
o = t.x,
a = t.y,
h = t.z,
l = t.w,
u = i * o + n * a + s * h + r * l;
u < 0 && ((u = -u), (o = -o), (a = -a), (h = -h), (l = -l));
var c,
d,
f = 1 - e,
p = e;
return 1e-6 < 1 - u && ((c = Math.acos(u)), (d = Math.sin(c)), (f = Math.sin((1 - e) * c) / d), (p = Math.sin(e * c) / d)), this.set(f * i + p * o, f * n + p * a, f * s + p * h, f * r + p * l);
},
invert: function () {
var t = this.x,
e = this.y,
i = this.z,
n = this.w,
s = t * t + e * e + i * i + n * n,
r = s ? 1 / s : 0;
return this.set(-t * r, -e * r, -i * r, n * r);
},
conjugate: function () {
return (this._x = -this.x), (this._y = -this.y), (this._z = -this.z), this.onChangeCallback(this), this;
},
rotateX: function (t) {
t *= 0.5;
var e = this.x,
i = this.y,
n = this.z,
s = this.w,
r = Math.sin(t),
o = Math.cos(t);
return this.set(e * o + s * r, i * o + n * r, n * o - i * r, s * o - e * r);
},
rotateY: function (t) {
t *= 0.5;
var e = this.x,
i = this.y,
n = this.z,
s = this.w,
r = Math.sin(t),
o = Math.cos(t);
return this.set(e * o - n * r, i * o + s * r, n * o + e * r, s * o - i * r);
},
rotateZ: function (t) {
t *= 0.5;
var e = this.x,
i = this.y,
n = this.z,
s = this.w,
r = Math.sin(t),
o = Math.cos(t);
return this.set(e * o + i * r, i * o - e * r, n * o + s * r, s * o - n * r);
},
calculateW: function () {
var t = this.x,
e = this.y,
i = this.z;
return (this.w = -Math.sqrt(1 - t * t - e * e - i * i)), this;
},
setFromEuler: function (t, e) {
var i = t.x / 2,
n = t.y / 2,
s = t.z / 2,
r = Math.cos(i),
o = Math.cos(n),
a = Math.cos(s),
h = Math.sin(i),
l = Math.sin(n),
u = Math.sin(s);
switch (t.order) {
case "XYZ":
this.set(h * o * a + r * l * u, r * l * a - h * o * u, r * o * u + h * l * a, r * o * a - h * l * u, e);
break;
case "YXZ":
this.set(h * o * a + r * l * u, r * l * a - h * o * u, r * o * u - h * l * a, r * o * a + h * l * u, e);
break;
case "ZXY":
this.set(h * o * a - r * l * u, r * l * a + h * o * u, r * o * u + h * l * a, r * o * a - h * l * u, e);
break;
case "ZYX":
this.set(h * o * a - r * l * u, r * l * a + h * o * u, r * o * u - h * l * a, r * o * a + h * l * u, e);
break;
case "YZX":
this.set(h * o * a + r * l * u, r * l * a + h * o * u, r * o * u - h * l * a, r * o * a - h * l * u, e);
break;
case "XZY":
this.set(h * o * a - r * l * u, r * l * a - h * o * u, r * o * u + h * l * a, r * o * a + h * l * u, e);
}
return this;
},
setFromRotationMatrix: function (t) {
var e,
i = t.val,
n = i[0],
s = i[4],
r = i[8],
o = i[1],
a = i[5],
h = i[9],
l = i[2],
u = i[6],
c = i[10],
d = n + a + c;
return (
0 < d
? ((e = 0.5 / Math.sqrt(d + 1)), this.set((u - h) * e, (r - l) * e, (o - s) * e, 0.25 / e))
: a < n && c < n
? ((e = 2 * Math.sqrt(1 + n - a - c)), this.set(0.25 * e, (s + o) / e, (r + l) / e, (u - h) / e))
: c < a
? ((e = 2 * Math.sqrt(1 + a - n - c)), this.set((s + o) / e, 0.25 * e, (h + u) / e, (r - l) / e))
: ((e = 2 * Math.sqrt(1 + c - n - a)), this.set((r + l) / e, (h + u) / e, 0.25 * e, (o - s) / e)),
this
);
},
fromMat3: function (t) {
var e,
i,
n,
s,
r = t.val,
o = r[0] + r[4] + r[8];
return (
0 < o
? ((s = Math.sqrt(o + 1)), (this.w = 0.5 * s), (s = 0.5 / s), (this._x = (r[7] - r[5]) * s), (this._y = (r[2] - r[6]) * s), (this._z = (r[3] - r[1]) * s))
: ((e = 0),
r[4] > r[0] && (e = 1),
r[8] > r[3 * e + e] && (e = 2),
(i = a[e]),
(n = a[i]),
(s = Math.sqrt(r[3 * e + e] - r[3 * i + i] - r[3 * n + n] + 1)),
(h[e] = 0.5 * s),
(s = 0.5 / s),
(h[i] = (r[3 * i + e] + r[3 * e + i]) * s),
(h[n] = (r[3 * n + e] + r[3 * e + n]) * s),
(this._x = h[0]),
(this._y = h[1]),
(this._z = h[2]),
(this._w = (r[3 * n + i] - r[3 * i + n]) * s)),
this.onChangeCallback(this),
this
);
},
});
t.exports = f;
},
function (t, e, i) {
t.exports = {
ADDED_TO_SCENE: i(180),
BOOT: i(181),
CREATE: i(182),
DESTROY: i(183),
PAUSE: i(184),
POST_UPDATE: i(185),
PRE_RENDER: i(186),
PRE_UPDATE: i(187),
READY: i(188),
REMOVED_FROM_SCENE: i(189),
RENDER: i(190),
RESUME: i(191),
SHUTDOWN: i(192),
SLEEP: i(193),
START: i(194),
TRANSITION_COMPLETE: i(195),
TRANSITION_INIT: i(196),
TRANSITION_OUT: i(197),
TRANSITION_START: i(198),
TRANSITION_WAKE: i(199),
UPDATE: i(200),
WAKE: i(201),
};
},
function (t, e, i) {
var s = i(27),
r = i(46);
t.exports = function (t, e) {
var i = void 0 === t ? r() : s({}, t);
if (e) for (var n in e) void 0 !== e[n] && (i[n] = e[n]);
return i;
};
},
function (t, e) {
t.exports = function (t, e, i, n, s, r) {
return (
void 0 === t && (t = ""),
void 0 === e && (e = !0),
void 0 === i && (i = ""),
void 0 === n && (n = ""),
void 0 === s && (s = 0),
void 0 === r && (r = !1),
{ responseType: t, async: e, user: i, password: n, timeout: s, headers: void 0, header: void 0, headerValue: void 0, requestedWith: !1, overrideMimeType: void 0, withCredentials: r }
);
};
},
function (t, e) {
t.exports = {
width: 0,
height: 0,
displayWidth: {
get: function () {
return this.scaleX * this.width;
},
set: function (t) {
this.scaleX = t / this.width;
},
},
displayHeight: {
get: function () {
return this.scaleY * this.height;
},
set: function (t) {
this.scaleY = t / this.height;
},
},
setSize: function (t, e) {
return (this.width = t), (this.height = e), this;
},
setDisplaySize: function (t, e) {
return (this.displayWidth = t), (this.displayHeight = e), this;
},
};
},
function (t, e) {
t.exports = {
_depth: 0,
depth: {
get: function () {
return this._depth;
},
set: function (t) {
this.displayList && this.displayList.queueDepthSort(), (this._depth = t);
},
},
setDepth: function (t) {
return void 0 === t && (t = 0), (this.depth = t), this;
},
};
},
function (t, e) {
t.exports = {
flipX: !1,
flipY: !1,
toggleFlipX: function () {
return (this.flipX = !this.flipX), this;
},
toggleFlipY: function () {
return (this.flipY = !this.flipY), this;
},
setFlipX: function (t) {
return (this.flipX = t), this;
},
setFlipY: function (t) {
return (this.flipY = t), this;
},
setFlip: function (t, e) {
return (this.flipX = t), (this.flipY = e), this;
},
resetFlip: function () {
return (this.flipX = !1), (this.flipY = !1), this;
},
};
},
function (t, e) {
t.exports = {
scrollFactorX: 1,
scrollFactorY: 1,
setScrollFactor: function (t, e) {
return void 0 === e && (e = t), (this.scrollFactorX = t), (this.scrollFactorY = e), this;
},
};
},
function (t, e, i) {
var n = i(4),
s = i(23),
h = i(41),
r = i(30),
o = i(31),
l = i(2),
a = {
_scaleX: 1,
_scaleY: 1,
_rotation: 0,
x: 0,
y: 0,
z: 0,
w: 0,
scale: {
get: function () {
return (this._scaleX + this._scaleY) / 2;
},
set: function (t) {
(this._scaleX = t), 0 === (this._scaleY = t) ? (this.renderFlags &= -5) : (this.renderFlags |= 4);
},
},
scaleX: {
get: function () {
return this._scaleX;
},
set: function (t) {
0 === (this._scaleX = t) ? (this.renderFlags &= -5) : (this.renderFlags |= 4);
},
},
scaleY: {
get: function () {
return this._scaleY;
},
set: function (t) {
0 === (this._scaleY = t) ? (this.renderFlags &= -5) : (this.renderFlags |= 4);
},
},
angle: {
get: function () {
return o(this._rotation * n.RAD_TO_DEG);
},
set: function (t) {
this.rotation = o(t) * n.DEG_TO_RAD;
},
},
rotation: {
get: function () {
return this._rotation;
},
set: function (t) {
this._rotation = r(t);
},
},
setPosition: function (t, e, i, n) {
return void 0 === t && (t = 0), void 0 === e && (e = t), void 0 === i && (i = 0), void 0 === n && (n = 0), (this.x = t), (this.y = e), (this.z = i), (this.w = n), this;
},
copyPosition: function (t) {
return void 0 !== t.x && (this.x = t.x), void 0 !== t.y && (this.y = t.y), void 0 !== t.z && (this.z = t.z), void 0 !== t.w && (this.w = t.w), this;
},
setRandomPosition: function (t, e, i, n) {
return (
void 0 === t && (t = 0),
void 0 === e && (e = 0),
void 0 === i && (i = this.scene.sys.scale.width),
void 0 === n && (n = this.scene.sys.scale.height),
(this.x = t + Math.random() * i),
(this.y = e + Math.random() * n),
this
);
},
setRotation: function (t) {
return void 0 === t && (t = 0), (this.rotation = t), this;
},
setAngle: function (t) {
return void 0 === t && (t = 0), (this.angle = t), this;
},
setScale: function (t, e) {
return void 0 === t && (t = 1), void 0 === e && (e = t), (this.scaleX = t), (this.scaleY = e), this;
},
setX: function (t) {
return void 0 === t && (t = 0), (this.x = t), this;
},
setY: function (t) {
return void 0 === t && (t = 0), (this.y = t), this;
},
setZ: function (t) {
return void 0 === t && (t = 0), (this.z = t), this;
},
setW: function (t) {
return void 0 === t && (t = 0), (this.w = t), this;
},
getLocalTransformMatrix: function (t) {
return void 0 === t && (t = new s()), t.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY);
},
getWorldTransformMatrix: function (t, e) {
void 0 === t && (t = new s()), void 0 === e && (e = new s());
var i = this.parentContainer;
if (!i) return this.getLocalTransformMatrix(t);
for (t.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY); i; ) e.applyITRS(i.x, i.y, i._rotation, i._scaleX, i._scaleY), e.multiply(t, t), (i = i.parentContainer);
return t;
},
getLocalPoint: function (t, e, i, n) {
i = i || new l();
var s = (n = n || this.scene.sys.cameras.main).scrollX,
r = n.scrollY,
o = t + s * this.scrollFactorX - s,
a = e + r * this.scrollFactorY - r;
return (
this.parentContainer ? this.getWorldTransformMatrix().applyInverse(o, a, i) : h(o, a, this.x, this.y, this.rotation, this.scaleX, this.scaleY, i),
this._originComponent && ((i.x += this._displayOriginX), (i.y += this._displayOriginY)),
i
);
},
getParentRotation: function () {
for (var t = 0, e = this.parentContainer; e; ) (t += e.rotation), (e = e.parentContainer);
return t;
},
};
t.exports = a;
},
function (t, e) {
t.exports = {
_visible: !0,
visible: {
get: function () {
return this._visible;
},
set: function (t) {
t ? ((this._visible = !0), (this.renderFlags |= 1)) : ((this._visible = !1), (this.renderFlags &= -2));
},
},
setVisible: function (t) {
return (this.visible = t), this;
},
};
},
function (t, e, i) {
var n = i(0),
s = i(54),
r = i(222),
o = i(229),
a = i(55),
h = i(44),
l = new n({
Extends: o,
initialize: function (t, e) {
o.call(this),
(this.scene = t),
(this.displayList = null),
(this.type = e),
(this.state = 0),
(this.parentContainer = null),
(this.name = ""),
(this.active = !0),
(this.tabIndex = -1),
(this.data = null),
(this.renderFlags = 15),
(this.cameraFilter = 0),
(this.input = null),
(this.body = null),
(this.ignoreDestroy = !1),
this.on(a.ADDED_TO_SCENE, this.addedToScene, this),
this.on(a.REMOVED_FROM_SCENE, this.removedFromScene, this),
t.sys.queueDepthSort();
},
setActive: function (t) {
return (this.active = t), this;
},
setName: function (t) {
return (this.name = t), this;
},
setState: function (t) {
return (this.state = t), this;
},
setDataEnabled: function () {
return this.data || (this.data = new r(this)), this;
},
setData: function (t, e) {
return this.data || (this.data = new r(this)), this.data.set(t, e), this;
},
incData: function (t, e) {
return this.data || (this.data = new r(this)), this.data.inc(t, e), this;
},
toggleData: function (t) {
return this.data || (this.data = new r(this)), this.data.toggle(t), this;
},
getData: function (t) {
return this.data || (this.data = new r(this)), this.data.get(t);
},
setInteractive: function (t, e, i) {
return this.scene.sys.input.enable(this, t, e, i), this;
},
disableInteractive: function () {
return this.input && (this.input.enabled = !1), this;
},
removeInteractive: function () {
return this.scene.sys.input.clear(this), (this.input = void 0), this;
},
addedToScene: function () {},
removedFromScene: function () {},
update: function () {},
toJSON: function () {
return s(this);
},
willRender: function (t) {
return !(l.RENDER_MASK !== this.renderFlags || (0 !== this.cameraFilter && this.cameraFilter & t.id));
},
getIndexList: function () {
for (var t = this, e = this.parentContainer, i = []; e && (i.unshift(e.getIndex(t)), (t = e).parentContainer); ) e = e.parentContainer;
return this.displayList ? i.unshift(this.displayList.getIndex(t)) : i.unshift(this.scene.sys.displayList.getIndex(t)), i;
},
addToDisplayList: function (t) {
return (
void 0 === t && (t = this.scene.sys.displayList),
this.displayList && this.displayList !== t && this.removeFromDisplayList(),
t.exists(this) || ((this.displayList = t).add(this, !0), t.queueDepthSort(), this.emit(a.ADDED_TO_SCENE, this, this.scene), t.events.emit(h.ADDED_TO_SCENE, this, this.scene)),
this
);
},
addToUpdateList: function () {
return this.scene && this.preUpdate && this.scene.sys.updateList.add(this), this;
},
removeFromDisplayList: function () {
var t = this.displayList || this.scene.sys.displayList;
return t.exists(this) && (t.remove(this, !0), t.queueDepthSort(), (this.displayList = null), this.emit(a.REMOVED_FROM_SCENE, this, this.scene), t.events.emit(h.REMOVED_FROM_SCENE, this, this.scene)), this;
},
removeFromUpdateList: function () {
return this.scene && this.preUpdate && this.scene.sys.updateList.remove(this), this;
},
destroy: function () {
this.scene &&
!this.ignoreDestroy &&
(this.preDestroy && this.preDestroy.call(this),
this.emit(a.DESTROY, this),
this.removeAllListeners(),
this.postPipelines && this.resetPostPipeline(!0),
this.removeFromDisplayList(),
this.removeFromUpdateList(),
this.input && (this.scene.sys.input.clear(this), (this.input = void 0)),
this.data && (this.data.destroy(), (this.data = void 0)),
this.body && (this.body.destroy(), (this.body = void 0)),
(this.active = !1),
(this.visible = !1),
(this.scene = void 0),
(this.parentContainer = void 0));
},
});
(l.RENDER_MASK = 15), (t.exports = l);
},
function (t, e) {
t.exports = function (t) {
var e = {
name: t.name,
type: t.type,
x: t.x,
y: t.y,
depth: t.depth,
scale: { x: t.scaleX, y: t.scaleY },
origin: { x: t.originX, y: t.originY },
flipX: t.flipX,
flipY: t.flipY,
rotation: t.rotation,
alpha: t.alpha,
visible: t.visible,
blendMode: t.blendMode,
textureKey: "",
frameKey: "",
data: {},
};
return t.texture && ((e.textureKey = t.texture.key), (e.frameKey = t.frame.name)), e;
};
},
function (t, e, i) {
t.exports = {
ADDED_TO_SCENE: i(230),
DESTROY: i(231),
REMOVED_FROM_SCENE: i(232),
VIDEO_COMPLETE: i(233),
VIDEO_CREATED: i(234),
VIDEO_ERROR: i(235),
VIDEO_LOOP: i(236),
VIDEO_PLAY: i(237),
VIDEO_SEEKED: i(238),
VIDEO_SEEKING: i(239),
VIDEO_STOP: i(240),
VIDEO_TIMEOUT: i(241),
VIDEO_UNLOCKED: i(242),
};
},
function (t, e, i) {
var n = i(23),
o = new n(),
a = new n(),
h = new n(),
l = { camera: o, sprite: a, calc: h };
t.exports = function (t, e, i) {
var n = o,
s = a,
r = h;
return (
s.applyITRS(t.x, t.y, t.rotation, t.scaleX, t.scaleY),
n.copyFrom(e.matrix),
i ? (n.multiplyWithOffset(i, -e.scrollX * t.scrollFactorX, -e.scrollY * t.scrollFactorY), (s.e = t.x), (s.f = t.y)) : ((s.e -= e.scrollX * t.scrollFactorX), (s.f -= e.scrollY * t.scrollFactorY)),
n.multiply(s, r),
l
);
};
},
function (t, e) {
t.exports = function (t) {
for (var e = t.length, i = t[0].length, n = new Array(i), s = 0; s < i; s++) {
n[s] = new Array(e);
for (var r = e - 1; -1 < r; r--) n[s][r] = t[r][s];
}
return n;
};
},
function (t, e) {
t.exports = function (t, e) {
void 0 === e && (e = 1);
for (var i = null, n = 0; n < e; n++) (i = t.shift()), t.push(i);
return i;
};
},
function (t, e) {
t.exports = function (t, e) {
void 0 === e && (e = 1);
for (var i = null, n = 0; n < e; n++) (i = t.pop()), t.unshift(i);
return i;
};
},
function (t, e) {
t.exports = function (t) {
for (var e = t.length - 1; 0 < e; e--) {
var i = Math.floor(Math.random() * (e + 1)),
n = t[e];
(t[e] = t[i]), (t[i] = n);
}
return t;
};
},
function (t, e, i) {
var s = i(62),
r = i(13);
t.exports = function (t, e, i) {
if ((void 0 === i && (i = new r()), e <= 0 || 1 <= e)) return (i.x = t.x), (i.y = t.y), i;
var n = s(t) * e;
return (
0.5 < e
? (n -= t.width + t.height) <= t.width
? ((i.x = t.right - n), (i.y = t.bottom))
: ((i.x = t.x), (i.y = t.bottom - (n - t.width)))
: n <= t.width
? ((i.x = t.x + n), (i.y = t.y))
: ((i.x = t.right), (i.y = t.y + (n - t.width))),
i
);
};
},
function (t, e) {
t.exports = function (t) {
return 2 * (t.width + t.height);
};
},
function (t, e, i) {
var n,
c = i(64),
s = i(0),
p = i(10),
r = i(177),
o = i(178),
g = i(202),
h = i(203),
d = i(221),
a = i(254),
l = i(1),
u = new s({
Extends: o,
initialize: function (t, e, u) {
o.call(this, t, e, u);
var i = e.game;
(this.isWebGL = 2 === i.config.renderType),
(this.cache = i.cache.addCustom("spine")),
(this.spineTextures = i.cache.addCustom("spineTextures")),
(this.json = i.cache.json),
(this.textures = i.textures),
(this.drawDebug = !1),
this.gl,
this.renderer,
this.sceneRenderer,
this.skeletonRenderer,
this.skeletonDebugRenderer,
(this.plugin = g),
this.temp1,
this.temp2,
this.isWebGL
? ((this.runtime = g.webgl), (this.renderer = i.renderer), (this.gl = i.renderer.gl), (this.getAtlas = this.getAtlasWebGL))
: ((this.runtime = g.canvas), (this.renderer = i.renderer), (this.getAtlas = this.getAtlasCanvas)),
this.renderer || (this.renderer = { width: i.scale.width, height: i.scale.height, preRender: l, postRender: l, render: l, destroy: l }),
e.registerFileType("spine", this.spineFileCallback, t),
e.registerGameObject(
"spine",
function (t, e, i, n, s) {
var r = this.scene.sys[u],
o = new d(this.scene, r, t, e, i, n, s);
return this.displayList.add(o), this.updateList.add(o), o;
},
function (t, e) {
void 0 === t && (t = {});
var i = p(t, "key", null),
n = p(t, "animationName", null),
s = p(t, "loop", !1),
r = this.scene.sys[u],
o = new d(this.scene, r, 0, 0, i, n, s);
void 0 !== e && (t.add = e), c(this.scene, o, t);
var a = p(t, "skinName", !1);
a && o.setSkinByName(a);
var h = p(t, "slotName", !1),
l = p(t, "attachmentName", null);
return h && o.setAttachment(h, l), o.refresh();
}
),
e.registerGameObject(
"spineContainer",
function (t, e, i) {
var n = this.scene.sys[u],
s = new a(this.scene, n, t, e, i);
return this.displayList.add(s), s;
},
function (t, e) {
void 0 === t && (t = {});
var i = p(t, "x", 0),
n = p(t, "y", 0),
s = p(t, "children", null),
r = this.scene.sys[u],
o = new a(this.scene, r, i, n, s);
return void 0 !== e && (t.add = e), c(this.scene, o, t), o;
}
);
},
boot: function () {
this.isWebGL ? (this.bootWebGL(), this.onResize(), this.game.scale.on(r, this.onResize, this)) : this.bootCanvas();
var t = this.systems.events;
t.once("shutdown", this.shutdown, this), t.once("destroy", this.destroy, this), this.game.events.once("destroy", this.gameDestroy, this);
},
bootCanvas: function () {
this.skeletonRenderer = new g.canvas.SkeletonRenderer(this.scene.sys.context);
},
bootWebGL: function () {
function t(t, e) {
var i;
(t === this.srcBlend && e === this.dstBlend) || ((i = this.context.gl), (this.srcBlend = t), (this.dstBlend = e), this.isDrawing && (this.flush(), i.blendFunc(this.srcBlend, this.dstBlend)));
}
n || (((n = new g.webgl.SceneRenderer(this.renderer.canvas, this.gl, !0)).batcher.setBlendMode = t), (n.shapes.setBlendMode = t)),
(this.sceneRenderer = n),
(this.skeletonRenderer = n.skeletonRenderer),
(this.skeletonDebugRenderer = n.skeletonDebugRenderer),
(this.temp1 = new g.webgl.Vector3(0, 0, 0)),
(this.temp2 = new g.webgl.Vector3(0, 0, 0));
},
getAtlasCanvas: function (t) {
var e = this.cache.get(t);
if (e) {
var i,
n = this.spineTextures;
return n.has(t)
? n.get(t)
: ((i = this.textures),
new g.TextureAtlas(e.data, function (t) {
return new g.canvas.CanvasTexture(i.get(e.prefix + t).getSourceImage());
}));
}
},
getAtlasWebGL: function (t) {
var e = this.cache.get(t);
if (e) {
var i,
n,
s = this.spineTextures;
return s.has(t)
? s.get(t)
: ((i = this.textures),
(n = this.sceneRenderer.context.gl).pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1),
new g.TextureAtlas(e.data, function (t) {
return new g.webgl.GLTexture(n, i.get(e.prefix + t).getSourceImage(), !1);
}));
}
},
spineFileCallback: function (t, e, i, n, s, r) {
var o;
if (Array.isArray(t)) for (var a = 0; a < t.length; a++) (o = new h(this, t[a])), this.addFile(o.files);
else (o = new h(this, t, e, i, n, s, r)), this.addFile(o.files);
return this;
},
worldToLocal: function (t, e, i, n) {
var s = this.temp1,
r = this.temp2,
o = this.sceneRenderer.camera;
s.set(t + i.x, e - i.y, 0);
var a = o.viewportWidth,
h = o.viewportHeight;
return o.screenToWorld(s, a, h), n && null !== n.parent ? (n.parent.worldToLocal(r.set(s.x - i.x, s.y - i.y, 0)), new g.Vector2(r.x, r.y)) : n ? new g.Vector2(s.x - i.x, s.y - i.y) : new g.Vector2(s.x, s.y);
},
getVector2: function (t, e) {
return new g.Vector2(t, e);
},
getVector3: function (t, e, i) {
return new g.webgl.Vector3(t, e, i);
},
setDebugBones: function (t) {
return void 0 === t && (t = !0), (this.skeletonDebugRenderer.drawBones = t), this;
},
setDebugRegionAttachments: function (t) {
return void 0 === t && (t = !0), (this.skeletonDebugRenderer.drawRegionAttachments = t), this;
},
setDebugBoundingBoxes: function (t) {
return void 0 === t && (t = !0), (this.skeletonDebugRenderer.drawBoundingBoxes = t), this;
},
setDebugMeshHull: function (t) {
return void 0 === t && (t = !0), (this.skeletonDebugRenderer.drawMeshHull = t), this;
},
setDebugMeshTriangles: function (t) {
return void 0 === t && (t = !0), (this.skeletonDebugRenderer.drawMeshTriangles = t), this;
},
setDebugPaths: function (t) {
return void 0 === t && (t = !0), (this.skeletonDebugRenderer.drawPaths = t), this;
},
setDebugSkeletonXY: function (t) {
return void 0 === t && (t = !0), (this.skeletonDebugRenderer.drawSkeletonXY = t), this;
},
setDebugClipping: function (t) {
return void 0 === t && (t = !0), (this.skeletonDebugRenderer.drawClipping = t), this;
},
setEffect: function (t) {
return (this.sceneRenderer.skeletonRenderer.vertexEffect = t), this;
},
createSkeleton: function (t, e) {
var i,
n = t,
s = t,
r = -1 !== t.indexOf(".");
r && ((n = (i = t.split(".")).shift()), (s = i.join(".")));
var o = this.cache.get(n),
a = this.getAtlas(n);
if (!a) return null;
this.spineTextures.has(n) || this.spineTextures.add(n, a);
var h,
l,
u = o.preMultipliedAlpha,
c = new g.AtlasAttachmentLoader(a),
d = new g.SkeletonJson(c);
if ((l = e || ((h = this.json.get(n)), r ? p(h, s) : h))) {
var f = d.readSkeletonData(l);
return { skeletonData: f, skeleton: new g.Skeleton(f), preMultipliedAlpha: u };
}
return null;
},
createAnimationState: function (t) {
var e = new g.AnimationStateData(t.data);
return { stateData: e, state: new g.AnimationState(e) };
},
getBounds: function (t) {
var e = new g.Vector2(),
i = new g.Vector2();
return t.getBounds(e, i, []), { offset: e, size: i };
},
onResize: function () {
var t = this.renderer,
e = this.sceneRenderer,
i = t.width,
n = t.height;
(e.camera.position.x = i / 2), (e.camera.position.y = n / 2), e.camera.setViewport(i, n);
},
shutdown: function () {
this.systems.events.off("shutdown", this.shutdown, this), this.isWebGL && this.game.scale.off(r, this.onResize, this);
},
destroy: function () {
this.shutdown(),
(this.game = null),
(this.scene = null),
(this.systems = null),
(this.cache = null),
(this.spineTextures = null),
(this.json = null),
(this.textures = null),
(this.skeletonRenderer = null),
(this.gl = null);
},
gameDestroy: function () {
this.pluginManager.removeGameObject("spine", !0, !0), this.pluginManager.removeGameObject("spineContainer", !0, !0), (this.pluginManager = null), n && (n.dispose(), (n = null)), (this.sceneRenderer = null);
},
});
(u.SpineGameObject = d), (u.SpineContainer = a), (t.exports = u);
},
function (t, e, i) {
var l = i(17),
u = i(65);
t.exports = function (t, e, i) {
(e.x = u(i, "x", 0)), (e.y = u(i, "y", 0)), (e.depth = u(i, "depth", 0)), (e.flipX = u(i, "flipX", !1)), (e.flipY = u(i, "flipY", !1));
var n = u(i, "scale", null);
"number" == typeof n ? e.setScale(n) : null !== n && ((e.scaleX = u(n, "x", 1)), (e.scaleY = u(n, "y", 1)));
var s = u(i, "scrollFactor", null);
"number" == typeof s ? e.setScrollFactor(s) : null !== s && ((e.scrollFactorX = u(s, "x", 1)), (e.scrollFactorY = u(s, "y", 1))), (e.rotation = u(i, "rotation", 0));
var r = u(i, "angle", null);
null !== r && (e.angle = r), (e.alpha = u(i, "alpha", 1));
var o,
a,
h = u(i, "origin", null);
return (
"number" == typeof h ? e.setOrigin(h) : null !== h && ((o = u(h, "x", 0.5)), (a = u(h, "y", 0.5)), e.setOrigin(o, a)),
(e.blendMode = u(i, "blendMode", l.NORMAL)),
(e.visible = u(i, "visible", !0)),
u(i, "add", !0) && t.sys.displayList.add(e),
e.preUpdate && t.sys.updateList.add(e),
e
);
};
},
function (t, e, i) {
var s = i(66),
r = i(10);
t.exports = function (t, e, i) {
var n = r(t, e, null);
if (null === n) return i;
if (Array.isArray(n)) return s.RND.pick(n);
if ("object" == typeof n) {
if (n.hasOwnProperty("randInt")) return s.RND.integerInRange(n.randInt[0], n.randInt[1]);
if (n.hasOwnProperty("randFloat")) return s.RND.realInRange(n.randFloat[0], n.randFloat[1]);
} else if ("function" == typeof n) return n(e);
return n;
};
},
function (t, e, i) {
var n = i(4),
s = i(27)(
!1,
(s = {
Angle: i(67),
Distance: i(76),
Easing: i(84),
Fuzzy: i(129),
Interpolation: i(134),
Pow2: i(142),
Snap: i(146),
RandomDataGenerator: i(150),
Average: i(151),
Bernstein: i(33),
Between: i(152),
CatmullRom: i(35),
CeilTo: i(153),
Clamp: i(3),
DegToRad: i(19),
Difference: i(154),
Euler: i(155),
Factorial: i(34),
FloatBetween: i(18),
FloorTo: i(156),
FromPercent: i(157),
GetSpeed: i(158),
IsEven: i(159),
IsEvenStrict: i(160),
Linear: i(36),
MaxAdd: i(161),
Median: i(162),
MinSub: i(163),
Percent: i(164),
RadToDeg: i(9),
RandomXY: i(165),
RandomXYZ: i(166),
RandomXYZW: i(167),
Rotate: i(168),
RotateAround: i(39),
RotateAroundDistance: i(169),
RotateTo: i(170),
RoundAwayFromZero: i(40),
RoundTo: i(171),
SinCosTableGenerator: i(172),
SmootherStep: i(38),
SmoothStep: i(37),
ToXY: i(173),
TransformXY: i(41),
Within: i(174),
Wrap: i(6),
Vector2: i(2),
Vector3: i(14),
Vector4: i(175),
Matrix3: i(42),
Matrix4: i(20),
Quaternion: i(43),
RotateVec3: i(176),
}),
n
);
t.exports = s;
},
function (t, e, i) {
t.exports = {
Between: i(28),
BetweenPoints: i(68),
BetweenPointsY: i(69),
BetweenY: i(70),
CounterClockwise: i(8),
Normalize: i(29),
Random: i(71),
RandomDegrees: i(72),
Reverse: i(73),
RotateTo: i(74),
ShortestBetween: i(75),
Wrap: i(30),
WrapDegrees: i(31),
};
},
function (t, e) {
t.exports = function (t, e) {
return Math.atan2(e.y - t.y, e.x - t.x);
};
},
function (t, e) {
t.exports = function (t, e) {
return Math.atan2(e.x - t.x, e.y - t.y);
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
return Math.atan2(i - t, n - e);
};
},
function (t, e, i) {
var n = i(18);
t.exports = function () {
return n(-Math.PI, Math.PI);
};
},
function (t, e, i) {
var n = i(18);
t.exports = function () {
return n(-180, 180);
};
},
function (t, e, i) {
var n = i(29);
t.exports = function (t) {
return n(t + Math.PI);
};
},
function (t, e, i) {
var n = i(4);
t.exports = function (t, e, i) {
return void 0 === i && (i = 0.05), t === e || (Math.abs(e - t) <= i || Math.abs(e - t) >= n.PI2 - i ? (t = e) : (Math.abs(e - t) > Math.PI && (e < t ? (e += n.PI2) : (e -= n.PI2)), t < e ? (t += i) : e < t && (t -= i))), t;
};
},
function (t, e) {
t.exports = function (t, e) {
var i = e - t;
return 0 == i ? 0 : i - 360 * Math.floor((i + 180) / 360);
};
},
function (t, e, i) {
t.exports = { Between: i(77), BetweenPoints: i(78), BetweenPointsSquared: i(79), Chebyshev: i(80), Power: i(81), Snake: i(82), Squared: i(83) };
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = t - i,
r = e - n;
return Math.sqrt(s * s + r * r);
};
},
function (t, e) {
t.exports = function (t, e) {
var i = t.x - e.x,
n = t.y - e.y;
return Math.sqrt(i * i + n * n);
};
},
function (t, e) {
t.exports = function (t, e) {
var i = t.x - e.x,
n = t.y - e.y;
return i * i + n * n;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
return Math.max(Math.abs(t - i), Math.abs(e - n));
};
},
function (t, e) {
t.exports = function (t, e, i, n, s) {
return void 0 === s && (s = 2), Math.sqrt(Math.pow(i - t, s) + Math.pow(n - e, s));
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
return Math.abs(t - i) + Math.abs(e - n);
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = t - i,
r = e - n;
return s * s + r * r;
};
},
function (t, e, i) {
t.exports = { Back: i(85), Bounce: i(89), Circular: i(93), Cubic: i(97), Elastic: i(101), Expo: i(105), Linear: i(109), Quadratic: i(111), Quartic: i(115), Quintic: i(119), Sine: i(123), Stepped: i(127) };
},
function (t, e, i) {
t.exports = { In: i(86), Out: i(87), InOut: i(88) };
},
function (t, e) {
t.exports = function (t, e) {
return void 0 === e && (e = 1.70158), t * t * ((e + 1) * t - e);
};
},
function (t, e) {
t.exports = function (t, e) {
return void 0 === e && (e = 1.70158), --t * t * ((e + 1) * t + e) + 1;
};
},
function (t, e) {
t.exports = function (t, e) {
void 0 === e && (e = 1.70158);
var i = 1.525 * e;
return (t *= 2) < 1 ? t * t * ((1 + i) * t - i) * 0.5 : 0.5 * ((t -= 2) * t * ((1 + i) * t + i) + 2);
};
},
function (t, e, i) {
t.exports = { In: i(90), Out: i(91), InOut: i(92) };
},
function (t, e) {
t.exports = function (t) {
return (t = 1 - t) < 1 / 2.75
? 1 - 7.5625 * t * t
: t < 2 / 2.75
? 1 - (7.5625 * (t -= 1.5 / 2.75) * t + 0.75)
: t < 2.5 / 2.75
? 1 - (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375)
: 1 - (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375);
};
},
function (t, e) {
t.exports = function (t) {
return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + 0.75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375 : 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375;
};
},
function (t, e) {
t.exports = function (t) {
var e = !1;
return (
t < 0.5 ? ((t = 1 - 2 * t), (e = !0)) : (t = 2 * t - 1),
t < 1 / 2.75 ? (t *= 7.5625 * t) : (t = t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + 0.75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375 : 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375),
e ? 0.5 * (1 - t) : 0.5 * t + 0.5
);
};
},
function (t, e, i) {
t.exports = { In: i(94), Out: i(95), InOut: i(96) };
},
function (t, e) {
t.exports = function (t) {
return 1 - Math.sqrt(1 - t * t);
};
},
function (t, e) {
t.exports = function (t) {
return Math.sqrt(1 - --t * t);
};
},
function (t, e) {
t.exports = function (t) {
return (t *= 2) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);
};
},
function (t, e, i) {
t.exports = { In: i(98), Out: i(99), InOut: i(100) };
},
function (t, e) {
t.exports = function (t) {
return t * t * t;
};
},
function (t, e) {
t.exports = function (t) {
return --t * t * t + 1;
};
},
function (t, e) {
t.exports = function (t) {
return (t *= 2) < 1 ? 0.5 * t * t * t : 0.5 * ((t -= 2) * t * t + 2);
};
},
function (t, e, i) {
t.exports = { In: i(102), Out: i(103), InOut: i(104) };
},
function (t, e) {
t.exports = function (t, e, i) {
if ((void 0 === e && (e = 0.1), void 0 === i && (i = 0.1), 0 === t)) return 0;
if (1 === t) return 1;
var n = i / 4;
return e < 1 ? (e = 1) : (n = (i * Math.asin(1 / e)) / (2 * Math.PI)), -e * Math.pow(2, 10 * --t) * Math.sin(((t - n) * (2 * Math.PI)) / i);
};
},
function (t, e) {
t.exports = function (t, e, i) {
if ((void 0 === e && (e = 0.1), void 0 === i && (i = 0.1), 0 === t)) return 0;
if (1 === t) return 1;
var n = i / 4;
return e < 1 ? (e = 1) : (n = (i * Math.asin(1 / e)) / (2 * Math.PI)), e * Math.pow(2, -10 * t) * Math.sin(((t - n) * (2 * Math.PI)) / i) + 1;
};
},
function (t, e) {
t.exports = function (t, e, i) {
if ((void 0 === e && (e = 0.1), void 0 === i && (i = 0.1), 0 === t)) return 0;
if (1 === t) return 1;
var n = i / 4;
return (
e < 1 ? (e = 1) : (n = (i * Math.asin(1 / e)) / (2 * Math.PI)),
(t *= 2) < 1 ? e * Math.pow(2, 10 * --t) * Math.sin(((t - n) * (2 * Math.PI)) / i) * -0.5 : e * Math.pow(2, -10 * --t) * Math.sin(((t - n) * (2 * Math.PI)) / i) * 0.5 + 1
);
};
},
function (t, e, i) {
t.exports = { In: i(106), Out: i(107), InOut: i(108) };
},
function (t, e) {
t.exports = function (t) {
return Math.pow(2, 10 * (t - 1)) - 0.001;
};
},
function (t, e) {
t.exports = function (t) {
return 1 - Math.pow(2, -10 * t);
};
},
function (t, e) {
t.exports = function (t) {
return (t *= 2) < 1 ? 0.5 * Math.pow(2, 10 * (t - 1)) : 0.5 * (2 - Math.pow(2, -10 * (t - 1)));
};
},
function (t, e, i) {
t.exports = i(110);
},
function (t, e) {
t.exports = function (t) {
return t;
};
},
function (t, e, i) {
t.exports = { In: i(112), Out: i(113), InOut: i(114) };
},
function (t, e) {
t.exports = function (t) {
return t * t;
};
},
function (t, e) {
t.exports = function (t) {
return t * (2 - t);
};
},
function (t, e) {
t.exports = function (t) {
return (t *= 2) < 1 ? 0.5 * t * t : -0.5 * (--t * (t - 2) - 1);
};
},
function (t, e, i) {
t.exports = { In: i(116), Out: i(117), InOut: i(118) };
},
function (t, e) {
t.exports = function (t) {
return t * t * t * t;
};
},
function (t, e) {
t.exports = function (t) {
return 1 - --t * t * t * t;
};
},
function (t, e) {
t.exports = function (t) {
return (t *= 2) < 1 ? 0.5 * t * t * t * t : -0.5 * ((t -= 2) * t * t * t - 2);
};
},
function (t, e, i) {
t.exports = { In: i(120), Out: i(121), InOut: i(122) };
},
function (t, e) {
t.exports = function (t) {
return t * t * t * t * t;
};
},
function (t, e) {
t.exports = function (t) {
return --t * t * t * t * t + 1;
};
},
function (t, e) {
t.exports = function (t) {
return (t *= 2) < 1 ? 0.5 * t * t * t * t * t : 0.5 * ((t -= 2) * t * t * t * t + 2);
};
},
function (t, e, i) {
t.exports = { In: i(124), Out: i(125), InOut: i(126) };
},
function (t, e) {
t.exports = function (t) {
return 0 === t ? 0 : 1 === t ? 1 : 1 - Math.cos((t * Math.PI) / 2);
};
},
function (t, e) {
t.exports = function (t) {
return 0 === t ? 0 : 1 === t ? 1 : Math.sin((t * Math.PI) / 2);
};
},
function (t, e) {
t.exports = function (t) {
return 0 === t ? 0 : 1 === t ? 1 : 0.5 * (1 - Math.cos(Math.PI * t));
};
},
function (t, e, i) {
t.exports = i(128);
},
function (t, e) {
t.exports = function (t, e) {
return void 0 === e && (e = 1), t <= 0 ? 0 : 1 <= t ? 1 : (1 / e) * (1 + ((e * t) | 0));
};
},
function (t, e, i) {
t.exports = { Ceil: i(130), Equal: i(32), Floor: i(131), GreaterThan: i(132), LessThan: i(133) };
},
function (t, e) {
t.exports = function (t, e) {
return void 0 === e && (e = 1e-4), Math.ceil(t - e);
};
},
function (t, e) {
t.exports = function (t, e) {
return void 0 === e && (e = 1e-4), Math.floor(t + e);
};
},
function (t, e) {
t.exports = function (t, e, i) {
return void 0 === i && (i = 1e-4), e - i < t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return void 0 === i && (i = 1e-4), t < e + i;
};
},
function (t, e, i) {
t.exports = { Bezier: i(135), CatmullRom: i(136), CubicBezier: i(137), Linear: i(138), QuadraticBezier: i(139), SmoothStep: i(140), SmootherStep: i(141) };
},
function (t, e, i) {
var r = i(33);
t.exports = function (t, e) {
for (var i = 0, n = t.length - 1, s = 0; s <= n; s++) i += Math.pow(1 - e, n - s) * Math.pow(e, s) * t[s] * r(n, s);
return i;
};
},
function (t, e, i) {
var r = i(35);
t.exports = function (t, e) {
var i = t.length - 1,
n = i * e,
s = Math.floor(n);
return t[0] === t[i]
? (e < 0 && (s = Math.floor((n = i * (1 + e)))), r(n - s, t[(s - 1 + i) % i], t[s], t[(s + 1) % i], t[(s + 2) % i]))
: e < 0
? t[0] - (r(-n, t[0], t[0], t[1], t[1]) - t[0])
: 1 < e
? t[i] - (r(n - i, t[i], t[i], t[i - 1], t[i - 1]) - t[i])
: r(n - s, t[s ? s - 1 : 0], t[s], t[i < s + 1 ? i : s + 1], t[i < s + 2 ? i : s + 2]);
};
},
function (t, e) {
t.exports = function (t, e, i, n, s) {
return (l = 1 - t) * l * l * e + 3 * (h = 1 - (a = t)) * h * a * i + 3 * (1 - (o = t)) * o * o * n + (r = t) * r * r * s;
var r, o, a, h, l;
};
},
function (t, e, i) {
var r = i(36);
t.exports = function (t, e) {
var i = t.length - 1,
n = i * e,
s = Math.floor(n);
return e < 0 ? r(t[0], t[1], n) : 1 < e ? r(t[i], t[i - 1], i - n) : r(t[s], t[i < s + 1 ? i : s + 1], n - s);
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
return (o = 1 - t) * o * e + 2 * (1 - (r = t)) * r * i + (s = t) * s * n;
var s, r, o;
};
},
function (t, e, i) {
var n = i(37);
t.exports = function (t, e, i) {
return e + (i - e) * n(t, 0, 1);
};
},
function (t, e, i) {
var n = i(38);
t.exports = function (t, e, i) {
return e + (i - e) * n(t, 0, 1);
};
},
function (t, e, i) {
t.exports = { GetNext: i(143), IsSize: i(144), IsValue: i(145) };
},
function (t, e) {
t.exports = function (t) {
var e = Math.log(t) / 0.6931471805599453;
return 1 << Math.ceil(e);
};
},
function (t, e) {
t.exports = function (t, e) {
return 0 < t && 0 == (t & (t - 1)) && 0 < e && 0 == (e & (e - 1));
};
},
function (t, e) {
t.exports = function (t) {
return 0 < t && 0 == (t & (t - 1));
};
},
function (t, e, i) {
t.exports = { Ceil: i(147), Floor: i(148), To: i(149) };
},
function (t, e) {
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), 0 === e ? t : ((t -= i), (t = e * Math.ceil(t / e)), n ? (i + t) / e : i + t);
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), 0 === e ? t : ((t -= i), (t = e * Math.floor(t / e)), n ? (i + t) / e : i + t);
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), 0 === e ? t : ((t -= i), (t = e * Math.round(t / e)), n ? (i + t) / e : i + t);
};
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t) {
void 0 === t && (t = [(Date.now() * Math.random()).toString()]), (this.c = 1), (this.s0 = 0), (this.s1 = 0), (this.s2 = 0), (this.n = 0), (this.signs = [-1, 1]), t && this.init(t);
},
rnd: function () {
var t = 2091639 * this.s0 + 2.3283064365386963e-10 * this.c;
return (this.c = 0 | t), (this.s0 = this.s1), (this.s1 = this.s2), (this.s2 = t - this.c), this.s2;
},
hash: function (t) {
var e,
i = this.n;
t = t.toString();
for (var n = 0; n < t.length; n++) (e = 0.02519603282416938 * (i += t.charCodeAt(n))), (e -= i = e >>> 0), (i = (e *= i) >>> 0), (i += 4294967296 * (e -= i));
return 2.3283064365386963e-10 * ((this.n = i) >>> 0);
},
init: function (t) {
"string" == typeof t ? this.state(t) : this.sow(t);
},
sow: function (t) {
if (((this.n = 4022871197), (this.s0 = this.hash(" ")), (this.s1 = this.hash(" ")), (this.s2 = this.hash(" ")), (this.c = 1), t))
for (var e = 0; e < t.length && null != t[e]; e++) {
var i = t[e];
(this.s0 -= this.hash(i)), (this.s0 += ~~(this.s0 < 0)), (this.s1 -= this.hash(i)), (this.s1 += ~~(this.s1 < 0)), (this.s2 -= this.hash(i)), (this.s2 += ~~(this.s2 < 0));
}
},
integer: function () {
return 4294967296 * this.rnd();
},
frac: function () {
return this.rnd() + 11102230246251565e-32 * ((2097152 * this.rnd()) | 0);
},
real: function () {
return this.integer() + this.frac();
},
integerInRange: function (t, e) {
return Math.floor(this.realInRange(0, e - t + 1) + t);
},
between: function (t, e) {
return Math.floor(this.realInRange(0, e - t + 1) + t);
},
realInRange: function (t, e) {
return this.frac() * (e - t) + t;
},
normal: function () {
return 1 - 2 * this.frac();
},
uuid: function () {
var t = "",
e = "";
for (e = t = ""; t++ < 36; e += ~t % 5 | ((3 * t) & 4) ? (15 ^ t ? 8 ^ (this.frac() * (20 ^ t ? 16 : 4)) : 4).toString(16) : "-");
return e;
},
pick: function (t) {
return t[this.integerInRange(0, t.length - 1)];
},
sign: function () {
return this.pick(this.signs);
},
weightedPick: function (t) {
return t[~~(Math.pow(this.frac(), 2) * (t.length - 1) + 0.5)];
},
timestamp: function (t, e) {
return this.realInRange(t || 9466848e5, e || 1577862e6);
},
angle: function () {
return this.integerInRange(-180, 180);
},
rotation: function () {
return this.realInRange(-3.1415926, 3.1415926);
},
state: function (t) {
return (
"string" == typeof t && t.match(/^!rnd/) && ((t = t.split(",")), (this.c = parseFloat(t[1])), (this.s0 = parseFloat(t[2])), (this.s1 = parseFloat(t[3])), (this.s2 = parseFloat(t[4]))),
["!rnd", this.c, this.s0, this.s1, this.s2].join(",")
);
},
shuffle: function (t) {
for (var e = t.length - 1; 0 < e; e--) {
var i = Math.floor(this.frac() * (e + 1)),
n = t[i];
(t[i] = t[e]), (t[e] = n);
}
return t;
},
});
t.exports = n;
},
function (t, e) {
t.exports = function (t) {
for (var e = 0, i = 0; i < t.length; i++) e += +t[i];
return e / t.length;
};
},
function (t, e) {
t.exports = function (t, e) {
return Math.floor(Math.random() * (e - t + 1) + t);
};
},
function (t, e) {
t.exports = function (t, e, i) {
void 0 === e && (e = 0), void 0 === i && (i = 10);
var n = Math.pow(i, -e);
return Math.ceil(t * n) / n;
};
},
function (t, e) {
t.exports = function (t, e) {
return Math.abs(t - e);
};
},
function (t, e, i) {
var y = i(3),
n = i(0),
s = i(20),
r = i(1),
o = new s(),
a = new n({
initialize: function t(e, i, n, s) {
void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === n && (n = 0), void 0 === s && (s = t.DefaultOrder), (this._x = e), (this._y = i), (this._z = n), (this._order = s), (this.onChangeCallback = r);
},
x: {
get: function () {
return this._x;
},
set: function (t) {
(this._x = t), this.onChangeCallback(this);
},
},
y: {
get: function () {
return this._y;
},
set: function (t) {
(this._y = t), this.onChangeCallback(this);
},
},
z: {
get: function () {
return this._z;
},
set: function (t) {
(this._z = t), this.onChangeCallback(this);
},
},
order: {
get: function () {
return this._order;
},
set: function (t) {
(this._order = t), this.onChangeCallback(this);
},
},
set: function (t, e, i, n) {
return void 0 === n && (n = this._order), (this._x = t), (this._y = e), (this._z = i), (this._order = n), this.onChangeCallback(this), this;
},
copy: function (t) {
return this.set(t.x, t.y, t.z, t.order);
},
setFromQuaternion: function (t, e, i) {
return void 0 === e && (e = this._order), void 0 === i && (i = !1), o.fromQuat(t), this.setFromRotationMatrix(o, e, i);
},
setFromRotationMatrix: function (t, e, i) {
void 0 === e && (e = this._order), void 0 === i && (i = !1);
var n = t.val,
s = n[0],
r = n[4],
o = n[8],
a = n[1],
h = n[5],
l = n[9],
u = n[2],
c = n[6],
d = n[10],
f = 0,
p = 0,
g = 0,
v = 0.99999;
switch (e) {
case "XYZ":
(p = Math.asin(y(o, -1, 1))), Math.abs(o) < v ? ((f = Math.atan2(-l, d)), (g = Math.atan2(-r, s))) : (f = Math.atan2(c, h));
break;
case "YXZ":
(f = Math.asin(-y(l, -1, 1))), Math.abs(l) < v ? ((p = Math.atan2(o, d)), (g = Math.atan2(a, h))) : (p = Math.atan2(-u, s));
break;
case "ZXY":
(f = Math.asin(y(c, -1, 1))), (g = Math.abs(c) < v ? ((p = Math.atan2(-u, d)), Math.atan2(-r, h)) : Math.atan2(a, s));
break;
case "ZYX":
(p = Math.asin(-y(u, -1, 1))), (g = Math.abs(u) < v ? ((f = Math.atan2(c, d)), Math.atan2(a, s)) : Math.atan2(-r, h));
break;
case "YZX":
(g = Math.asin(y(a, -1, 1))), (p = Math.abs(a) < v ? ((f = Math.atan2(-l, h)), Math.atan2(-u, s)) : Math.atan2(o, d));
break;
case "XZY":
(g = Math.asin(-y(r, -1, 1))), Math.abs(r) < v ? ((f = Math.atan2(c, h)), (p = Math.atan2(o, s))) : (f = Math.atan2(-l, d));
}
return (this._x = f), (this._y = p), (this._z = g), (this._order = e), i && this.onChangeCallback(this), this;
},
});
(a.RotationOrders = ["XYZ", "YXZ", "ZXY", "ZYX", "YZX", "XZY"]), (a.DefaultOrder = "XYZ"), (t.exports = a);
},
function (t, e) {
t.exports = function (t, e, i) {
void 0 === e && (e = 0), void 0 === i && (i = 10);
var n = Math.pow(i, -e);
return Math.floor(t * n) / n;
};
},
function (t, e, i) {
var n = i(3);
t.exports = function (t, e, i) {
return (i - e) * (t = n(t, 0, 1)) + e;
};
},
function (t, e) {
t.exports = function (t, e) {
return t / e / 1e3;
};
},
function (t, e) {
t.exports = function (t) {
return t == parseFloat(t) ? !(t % 2) : void 0;
};
},
function (t, e) {
t.exports = function (t) {
return t === parseFloat(t) ? !(t % 2) : void 0;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return Math.min(t + e, i);
};
},
function (t, e) {
t.exports = function (t) {
var e = t.length;
if (0 === e) return 0;
t.sort(function (t, e) {
return t - e;
});
var i = Math.floor(e / 2);
return e % 2 == 0 ? (t[i] + t[i - 1]) / 2 : t[i];
};
},
function (t, e) {
t.exports = function (t, e, i) {
return Math.max(t - e, i);
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
void 0 === i && (i = e + 1);
var s = (t - e) / (i - e);
return 1 < s ? (void 0 !== n ? (s = (n - t) / (n - i)) < 0 && (s = 0) : (s = 1)) : s < 0 && (s = 0), s;
};
},
function (t, e) {
t.exports = function (t, e) {
void 0 === e && (e = 1);
var i = 2 * Math.random() * Math.PI;
return (t.x = Math.cos(i) * e), (t.y = Math.sin(i) * e), t;
};
},
function (t, e) {
t.exports = function (t, e) {
void 0 === e && (e = 1);
var i = 2 * Math.random() * Math.PI,
n = 2 * Math.random() - 1,
s = Math.sqrt(1 - n * n) * e;
return (t.x = Math.cos(i) * s), (t.y = Math.sin(i) * s), (t.z = n * e), t;
};
},
function (t, e) {
t.exports = function (t, e) {
return void 0 === e && (e = 1), (t.x = (2 * Math.random() - 1) * e), (t.y = (2 * Math.random() - 1) * e), (t.z = (2 * Math.random() - 1) * e), (t.w = (2 * Math.random() - 1) * e), t;
};
},
function (t, e) {
t.exports = function (t, e) {
var i = t.x,
n = t.y;
return (t.x = i * Math.cos(e) - n * Math.sin(e)), (t.y = i * Math.sin(e) + n * Math.cos(e)), t;
};
},
function (t, e) {
t.exports = function (t, e, i, n, s) {
var r = n + Math.atan2(t.y - i, t.x - e);
return (t.x = e + s * Math.cos(r)), (t.y = i + s * Math.sin(r)), t;
};
},
function (t, e) {
t.exports = function (t, e, i, n, s) {
return (t.x = e + s * Math.cos(n)), (t.y = i + s * Math.sin(n)), t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
void 0 === e && (e = 0), void 0 === i && (i = 10);
var n = Math.pow(i, -e);
return Math.round(t * n) / n;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
void 0 === e && (e = 1), void 0 === i && (i = 1), void 0 === n && (n = 1), (n *= Math.PI / t);
for (var s = [], r = [], o = 0; o < t; o++) (e += (i -= e * n) * n), (s[o] = i), (r[o] = e);
return { sin: r, cos: s, length: t };
};
},
function (t, e, i) {
var o = i(2);
t.exports = function (t, e, i, n) {
void 0 === n && (n = new o());
var s = 0,
r = 0;
return 0 < t && t <= e * i && ((s = e - 1 < t ? t - (r = Math.floor(t / e)) * e : t), n.set(s, r)), n;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return Math.abs(t - e) <= i;
};
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e, i, n) {
(this.x = 0),
(this.y = 0),
(this.z = 0),
(this.w = 0),
"object" == typeof t ? ((this.x = t.x || 0), (this.y = t.y || 0), (this.z = t.z || 0), (this.w = t.w || 0)) : ((this.x = t || 0), (this.y = e || 0), (this.z = i || 0), (this.w = n || 0));
},
clone: function () {
return new n(this.x, this.y, this.z, this.w);
},
copy: function (t) {
return (this.x = t.x), (this.y = t.y), (this.z = t.z || 0), (this.w = t.w || 0), this;
},
equals: function (t) {
return this.x === t.x && this.y === t.y && this.z === t.z && this.w === t.w;
},
set: function (t, e, i, n) {
return "object" == typeof t ? ((this.x = t.x || 0), (this.y = t.y || 0), (this.z = t.z || 0), (this.w = t.w || 0)) : ((this.x = t || 0), (this.y = e || 0), (this.z = i || 0), (this.w = n || 0)), this;
},
add: function (t) {
return (this.x += t.x), (this.y += t.y), (this.z += t.z || 0), (this.w += t.w || 0), this;
},
subtract: function (t) {
return (this.x -= t.x), (this.y -= t.y), (this.z -= t.z || 0), (this.w -= t.w || 0), this;
},
scale: function (t) {
return (this.x *= t), (this.y *= t), (this.z *= t), (this.w *= t), this;
},
length: function () {
var t = this.x,
e = this.y,
i = this.z,
n = this.w;
return Math.sqrt(t * t + e * e + i * i + n * n);
},
lengthSq: function () {
var t = this.x,
e = this.y,
i = this.z,
n = this.w;
return t * t + e * e + i * i + n * n;
},
normalize: function () {
var t = this.x,
e = this.y,
i = this.z,
n = this.w,
s = t * t + e * e + i * i + n * n;
return 0 < s && ((s = 1 / Math.sqrt(s)), (this.x = t * s), (this.y = e * s), (this.z = i * s), (this.w = n * s)), this;
},
dot: function (t) {
return this.x * t.x + this.y * t.y + this.z * t.z + this.w * t.w;
},
lerp: function (t, e) {
void 0 === e && (e = 0);
var i = this.x,
n = this.y,
s = this.z,
r = this.w;
return (this.x = i + e * (t.x - i)), (this.y = n + e * (t.y - n)), (this.z = s + e * (t.z - s)), (this.w = r + e * (t.w - r)), this;
},
multiply: function (t) {
return (this.x *= t.x), (this.y *= t.y), (this.z *= t.z || 1), (this.w *= t.w || 1), this;
},
divide: function (t) {
return (this.x /= t.x), (this.y /= t.y), (this.z /= t.z || 1), (this.w /= t.w || 1), this;
},
distance: function (t) {
var e = t.x - this.x,
i = t.y - this.y,
n = t.z - this.z || 0,
s = t.w - this.w || 0;
return Math.sqrt(e * e + i * i + n * n + s * s);
},
distanceSq: function (t) {
var e = t.x - this.x,
i = t.y - this.y,
n = t.z - this.z || 0,
s = t.w - this.w || 0;
return e * e + i * i + n * n + s * s;
},
negate: function () {
return (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), (this.w = -this.w), this;
},
transformMat4: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = this.w,
r = t.val;
return (
(this.x = r[0] * e + r[4] * i + r[8] * n + r[12] * s),
(this.y = r[1] * e + r[5] * i + r[9] * n + r[13] * s),
(this.z = r[2] * e + r[6] * i + r[10] * n + r[14] * s),
(this.w = r[3] * e + r[7] * i + r[11] * n + r[15] * s),
this
);
},
transformQuat: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.x,
r = t.y,
o = t.z,
a = t.w,
h = a * e + r * n - o * i,
l = a * i + o * e - s * n,
u = a * n + s * i - r * e,
c = -s * e - r * i - o * n;
return (this.x = h * a + c * -s + l * -o - u * -r), (this.y = l * a + c * -r + u * -s - h * -o), (this.z = u * a + c * -o + h * -r - l * -s), this;
},
reset: function () {
return (this.x = 0), (this.y = 0), (this.z = 0), (this.w = 0), this;
},
});
(n.prototype.sub = n.prototype.subtract),
(n.prototype.mul = n.prototype.multiply),
(n.prototype.div = n.prototype.divide),
(n.prototype.dist = n.prototype.distance),
(n.prototype.distSq = n.prototype.distanceSq),
(n.prototype.len = n.prototype.length),
(n.prototype.lenSq = n.prototype.lengthSq),
(t.exports = n);
},
function (t, e, i) {
var n = i(14),
s = i(20),
r = i(43),
o = new s(),
a = new r(),
h = new n();
t.exports = function (t, e, i) {
return a.setAxisAngle(e, i), o.fromRotationTranslation(a, h.set(0, 0, 0)), t.transformMat4(o);
};
},
function (t, e) {
t.exports = "resize";
},
function (t, e, i) {
var n = i(179),
s = i(0),
r = i(44),
o = new s({
Extends: n,
initialize: function (t, e, i) {
n.call(this, e), (this.scene = t), (this.systems = t.sys), (this.pluginKey = i), t.sys.events.once(r.BOOT, this.boot, this);
},
boot: function () {},
destroy: function () {
(this.pluginManager = null), (this.game = null), (this.scene = null), (this.systems = null);
},
});
t.exports = o;
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t) {
(this.pluginManager = t), (this.game = t.game);
},
init: function () {},
start: function () {},
stop: function () {},
destroy: function () {
(this.pluginManager = null), (this.game = null), (this.scene = null), (this.systems = null);
},
});
t.exports = n;
},
function (t, e) {
t.exports = "addedtoscene";
},
function (t, e) {
t.exports = "boot";
},
function (t, e) {
t.exports = "create";
},
function (t, e) {
t.exports = "destroy";
},
function (t, e) {
t.exports = "pause";
},
function (t, e) {
t.exports = "postupdate";
},
function (t, e) {
t.exports = "prerender";
},
function (t, e) {
t.exports = "preupdate";
},
function (t, e) {
t.exports = "ready";
},
function (t, e) {
t.exports = "removedfromscene";
},
function (t, e) {
t.exports = "render";
},
function (t, e) {
t.exports = "resume";
},
function (t, e) {
t.exports = "shutdown";
},
function (t, e) {
t.exports = "sleep";
},
function (t, e) {
t.exports = "start";
},
function (t, e) {
t.exports = "transitioncomplete";
},
function (t, e) {
t.exports = "transitioninit";
},
function (t, e) {
t.exports = "transitionout";
},
function (t, e) {
t.exports = "transitionstart";
},
function (t, e) {
t.exports = "transitionwake";
},
function (t, e) {
t.exports = "update";
},
function (t, e) {
t.exports = "wake";
},
function (ni, t) {
(function () {
var n,
t,
e,
f,
i,
r,
s,
o,
a,
k,
h,
l,
u,
c,
ht,
d,
p,
g,
v,
K,
y,
m,
x,
b,
w,
T,
S,
_,
E,
P,
A,
M,
C,
O,
q,
R,
L,
I,
D,
F,
B,
N,
U,
Y,
z,
X,
V,
G,
j,
H,
W,
Z,
J,
Q,
$,
tt,
et,
it,
nt,
st,
rt,
ot,
at,
lt,
ut,
ct,
dt,
ft,
pt,
gt,
vt,
yt,
mt,
xt,
bt,
wt,
Tt,
St,
_t,
Et,
Pt,
At,
Mt,
Ct,
Ot,
kt,
Rt,
Lt,
It,
Dt,
Ft,
Bt,
Nt,
Ut,
Yt,
zt,
Xt,
Vt,
Gt,
jt,
Ht,
Wt,
Kt,
qt,
Zt,
Jt,
Qt,
$t,
te,
ee,
ie,
ne,
se,
re,
oe,
ae,
he,
le,
ue,
ce,
de,
fe,
pe,
ge,
ve,
ye =
(this && this.__extends) ||
((n = function (t, e) {
return (n =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
function i() {
this.constructor = t;
}
n(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
});
function me(t) {
if (((this.animationToMixTime = {}), (this.defaultMix = 0), null == t)) throw new Error("skeletonData cannot be null.");
this.skeletonData = t;
}
function xe(t, e) {
void 0 === e && (e = ""), (this.assets = {}), (this.errors = {}), (this.toLoad = 0), (this.loaded = 0), (this.rawDataUris = {}), (this.textureLoader = t), (this.pathPrefix = e);
}
function be(t) {
this.atlas = t;
}
function we(t, e, i) {
if (
((this.children = new Array()),
(this.x = 0),
(this.y = 0),
(this.rotation = 0),
(this.scaleX = 0),
(this.scaleY = 0),
(this.shearX = 0),
(this.shearY = 0),
(this.ax = 0),
(this.ay = 0),
(this.arotation = 0),
(this.ascaleX = 0),
(this.ascaleY = 0),
(this.ashearX = 0),
(this.ashearY = 0),
(this.appliedValid = !1),
(this.a = 0),
(this.b = 0),
(this.c = 0),
(this.d = 0),
(this.worldY = 0),
(this.worldX = 0),
(this.sorted = !1),
(this.active = !1),
null == t)
)
throw new Error("data cannot be null.");
if (null == e) throw new Error("skeleton cannot be null.");
(this.data = t), (this.skeleton = e), (this.parent = i), this.setToSetupPose();
}
function Te(t, e) {
if (((this.bendDirection = 0), (this.compress = !1), (this.stretch = !1), (this.mix = 1), (this.softness = 0), (this.active = !1), null == t)) throw new Error("data cannot be null.");
if (null == e) throw new Error("skeleton cannot be null.");
(this.data = t), (this.mix = t.mix), (this.softness = t.softness), (this.bendDirection = t.bendDirection), (this.compress = t.compress), (this.stretch = t.stretch), (this.bones = new Array());
for (var i = 0; i < t.bones.length; i++) this.bones.push(e.findBone(t.bones[i].name));
this.target = e.findBone(t.target.name);
}
function Se(t) {
var e = g.call(this, t, 0, !1) || this;
return (e.bones = new Array()), (e.bendDirection = 1), (e.compress = !1), (e.stretch = !1), (e.uniform = !1), (e.mix = 1), (e.softness = 0), e;
}
function _e(t, e) {
if (
((this.position = 0),
(this.spacing = 0),
(this.rotateMix = 0),
(this.translateMix = 0),
(this.spaces = new Array()),
(this.positions = new Array()),
(this.world = new Array()),
(this.curves = new Array()),
(this.lengths = new Array()),
(this.segments = new Array()),
(this.active = !1),
null == t)
)
throw new Error("data cannot be null.");
if (null == e) throw new Error("skeleton cannot be null.");
(this.data = t), (this.bones = new Array());
for (var i = 0, n = t.bones.length; i < n; i++) this.bones.push(e.findBone(t.bones[i].name));
(this.target = e.findSlot(t.target.name)), (this.position = t.position), (this.spacing = t.spacing), (this.rotateMix = t.rotateMix), (this.translateMix = t.translateMix);
}
function Ee(t) {
var e = x.call(this, t, 0, !1) || this;
return (e.bones = new Array()), e;
}
function Pe(t) {
(this.toLoad = new Array()), (this.assets = {}), (this.clientId = t);
}
function Ae(t) {
void 0 === t && (t = ""), (this.clientAssets = {}), (this.queuedAssets = {}), (this.rawAssets = {}), (this.errors = {}), (this.pathPrefix = t);
}
function Me(t) {
if (((this._updateCache = new Array()), (this.updateCacheReset = new Array()), (this.time = 0), (this.scaleX = 1), (this.scaleY = 1), (this.x = 0), (this.y = 0), null == t)) throw new Error("data cannot be null.");
(this.data = t), (this.bones = new Array());
for (var e = 0; e < t.bones.length; e++) {
var i,
n = t.bones[e],
s = void 0;
null == n.parent ? (s = new A.Bone(n, this, null)) : ((i = this.bones[n.parent.index]), (s = new A.Bone(n, this, i)), i.children.push(s)), this.bones.push(s);
}
for (this.slots = new Array(), this.drawOrder = new Array(), e = 0; e < t.slots.length; e++) {
var r = t.slots[e],
o = ((s = this.bones[r.boneData.index]), new A.Slot(r, s));
this.slots.push(o), this.drawOrder.push(o);
}
for (this.ikConstraints = new Array(), e = 0; e < t.ikConstraints.length; e++) {
var a = t.ikConstraints[e];
this.ikConstraints.push(new A.IkConstraint(a, this));
}
for (this.transformConstraints = new Array(), e = 0; e < t.transformConstraints.length; e++) {
var h = t.transformConstraints[e];
this.transformConstraints.push(new A.TransformConstraint(h, this));
}
for (this.pathConstraints = new Array(), e = 0; e < t.pathConstraints.length; e++) {
var l = t.pathConstraints[e];
this.pathConstraints.push(new A.PathConstraint(l, this));
}
(this.color = new A.Color(1, 1, 1, 1)), this.updateCache();
}
function Ce() {
(this.minX = 0),
(this.minY = 0),
(this.maxX = 0),
(this.maxY = 0),
(this.boundingBoxes = new Array()),
(this.polygons = new Array()),
(this.polygonPool = new C.Pool(function () {
return C.Utils.newFloatArray(16);
}));
}
function Oe() {
(this.triangulator = new q.Triangulator()),
(this.clippingPolygon = new Array()),
(this.clipOutput = new Array()),
(this.clippedVertices = new Array()),
(this.clippedTriangles = new Array()),
(this.scratch = new Array());
}
function ke() {
(this.bones = new Array()),
(this.slots = new Array()),
(this.skins = new Array()),
(this.events = new Array()),
(this.animations = new Array()),
(this.ikConstraints = new Array()),
(this.transformConstraints = new Array()),
(this.pathConstraints = new Array()),
(this.fps = 0);
}
function Re(t, e) {
if (((this.deform = new Array()), null == t)) throw new Error("data cannot be null.");
if (null == e) throw new Error("bone cannot be null.");
(this.data = t), (this.bone = e), (this.color = new D.Color()), (this.darkColor = null == t.darkColor ? null : new D.Color()), this.setToSetupPose();
}
function Le(t, e) {
if (((this.rotateMix = 0), (this.translateMix = 0), (this.scaleMix = 0), (this.shearMix = 0), (this.temp = new N.Vector2()), (this.active = !1), null == t)) throw new Error("data cannot be null.");
if (null == e) throw new Error("skeleton cannot be null.");
(this.data = t), (this.rotateMix = t.rotateMix), (this.translateMix = t.translateMix), (this.scaleMix = t.scaleMix), (this.shearMix = t.shearMix), (this.bones = new Array());
for (var i = 0; i < t.bones.length; i++) this.bones.push(e.findBone(t.bones[i].name));
this.target = e.findBone(t.target.name);
}
function Ie(t) {
var e = z.call(this, t, 0, !1) || this;
return (
(e.bones = new Array()),
(e.rotateMix = 0),
(e.translateMix = 0),
(e.scaleMix = 0),
(e.shearMix = 0),
(e.offsetRotation = 0),
(e.offsetX = 0),
(e.offsetY = 0),
(e.offsetScaleX = 0),
(e.offsetScaleY = 0),
(e.offsetShearY = 0),
(e.relative = !1),
(e.local = !1),
e
);
}
function De() {
(this.convexPolygons = new Array()),
(this.convexPolygonsIndices = new Array()),
(this.indicesArray = new Array()),
(this.isConcaveArray = new Array()),
(this.triangles = new Array()),
(this.polygonPool = new V.Pool(function () {
return new Array();
})),
(this.polygonIndicesPool = new V.Pool(function () {
return new Array();
}));
}
function Fe(t) {
var e = J.call(this, t) || this;
return (e.color = new Z.Color(1, 1, 1, 1)), e;
}
function Be(t) {
var e = tt.call(this, t) || this;
return (e.color = new $.Color(0.2275, 0.2275, 0.8078, 1)), e;
}
function Ne(t) {
var e = nt.call(this, t) || this;
return (e.color = new it.Color(1, 1, 1, 1)), (e.tempColor = new it.Color(0, 0, 0, 0)), e;
}
function Ue(t) {
var e = ot.call(this, t) || this;
return (e.closed = !1), (e.constantSpeed = !1), (e.color = new rt.Color(1, 1, 1, 1)), e;
}
function Ye(t) {
var e = ut.call(this, t) || this;
return (e.color = new lt.Color(0.38, 0.94, 0, 1)), e;
}
function ze(t) {
var e = ft.call(this, t) || this;
return (
(e.x = 0),
(e.y = 0),
(e.scaleX = 1),
(e.scaleY = 1),
(e.rotation = 0),
(e.width = 0),
(e.height = 0),
(e.color = new dt.Color(1, 1, 1, 1)),
(e.offset = dt.Utils.newFloatArray(8)),
(e.uvs = dt.Utils.newFloatArray(8)),
(e.tempColor = new dt.Color(1, 1, 1, 1)),
e
);
}
function Xe(t, e) {
(this.jitterX = 0), (this.jitterY = 0), (this.jitterX = t), (this.jitterY = e);
}
function Ve(t) {
(this.centerX = 0), (this.centerY = 0), (this.radius = 0), (this.angle = 0), (this.worldX = 0), (this.worldY = 0), (this.radius = t);
}
function Ge(t) {
return (
void 0 === t && (t = ""),
wt.call(
this,
function (t) {
return new xt.canvas.CanvasTexture(t);
},
t
) || this
);
}
function je(t) {
return Et.call(this, t) || this;
}
function He(t) {
(this.triangleRendering = !1), (this.debugRendering = !1), (this.vertices = At.Utils.newFloatArray(8192)), (this.tempColor = new At.Color()), (this.ctx = t);
}
function We(e, t) {
return (
void 0 === t && (t = ""),
Rt.call(
this,
function (t) {
return new Ot.webgl.GLTexture(e, t);
},
t
) || this
);
}
function Ke(t, e) {
(this.position = new Dt.Vector3(0, 0, 0)),
(this.direction = new Dt.Vector3(0, 0, -1)),
(this.up = new Dt.Vector3(0, 1, 0)),
(this.near = 0),
(this.far = 100),
(this.zoom = 1),
(this.viewportWidth = 0),
(this.viewportHeight = 0),
(this.projectionView = new Dt.Matrix4()),
(this.inverseProjectionView = new Dt.Matrix4()),
(this.projection = new Dt.Matrix4()),
(this.view = new Dt.Matrix4()),
(this.tmp = new Dt.Vector3()),
(this.viewportWidth = t),
(this.viewportHeight = e),
this.update();
}
function qe(t, e, i) {
void 0 === i && (i = !1);
var n = Ut.call(this, e) || this;
return (
(n.texture = null),
(n.boundUnit = 0),
(n.useMipMaps = !1),
(n.context = t instanceof Nt.ManagedWebGLRenderingContext ? t : new Nt.ManagedWebGLRenderingContext(t)),
(n.useMipMaps = i),
n.restore(),
n.context.addRestorable(n),
n
);
}
function Ze(t, e, i) {
if ((void 0 === e && (e = !0), void 0 === i && (i = 10920), (this.isDrawing = !1), (this.shader = null), (this.lastTexture = null), (this.verticesLength = 0), (this.indicesLength = 0), 10920 < i))
throw new Error("Can't have more than 10920 triangles per batch: " + i);
this.context = t instanceof Gt.ManagedWebGLRenderingContext ? t : new Gt.ManagedWebGLRenderingContext(t);
var n = e ? [new Gt.Position2Attribute(), new Gt.ColorAttribute(), new Gt.TexCoordAttribute(), new Gt.Color2Attribute()] : [new Gt.Position2Attribute(), new Gt.ColorAttribute(), new Gt.TexCoordAttribute()];
(this.mesh = new Gt.Mesh(t, n, i, 3 * i)), (this.srcBlend = this.context.gl.SRC_ALPHA), (this.dstBlend = this.context.gl.ONE_MINUS_SRC_ALPHA);
}
function Je(t, e, i) {
void 0 === i && (i = !0),
(this.twoColorTint = !1),
(this.activeRenderer = null),
(this.QUAD = [0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0]),
(this.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0]),
(this.WHITE = new Ht.Color(1, 1, 1, 1)),
(this.canvas = t),
(this.context = e instanceof Wt.ManagedWebGLRenderingContext ? e : new Wt.ManagedWebGLRenderingContext(e)),
(this.twoColorTint = i),
(this.camera = new Wt.OrthoCamera(t.width, t.height)),
(this.batcherShader = i ? Wt.Shader.newTwoColoredTextured(this.context) : Wt.Shader.newColoredTextured(this.context)),
(this.batcher = new Wt.PolygonBatcher(this.context, i)),
(this.shapesShader = Wt.Shader.newColored(this.context)),
(this.shapes = new Wt.ShapeRenderer(this.context)),
(this.skeletonRenderer = new Wt.SkeletonRenderer(this.context, i)),
(this.skeletonDebugRenderer = new Wt.SkeletonDebugRenderer(this.context));
}
function Qe(t, e, i) {
(this.vertexShader = e),
(this.fragmentShader = i),
(this.vs = null),
(this.fs = null),
(this.program = null),
(this.tmp2x2 = new Float32Array(4)),
(this.tmp3x3 = new Float32Array(9)),
(this.tmp4x4 = new Float32Array(16)),
(this.vsSource = e),
(this.fsSource = i),
(this.context = t instanceof Qt.ManagedWebGLRenderingContext ? t : new Qt.ManagedWebGLRenderingContext(t)),
this.context.addRestorable(this),
this.compile();
}
function $e(t, e) {
if ((void 0 === e && (e = 10920), (this.isDrawing = !1), (this.shapeType = ie.Filled), (this.color = new te.Color(1, 1, 1, 1)), (this.vertexIndex = 0), (this.tmp = new te.Vector2()), 10920 < e))
throw new Error("Can't have more than 10920 triangles per batch: " + e);
(this.context = t instanceof ee.ManagedWebGLRenderingContext ? t : new ee.ManagedWebGLRenderingContext(t)),
(this.mesh = new ee.Mesh(t, [new ee.Position2Attribute(), new ee.ColorAttribute()], e, 0)),
(this.srcBlend = this.context.gl.SRC_ALPHA),
(this.dstBlend = this.context.gl.ONE_MINUS_SRC_ALPHA);
}
function ti(t) {
(this.boneLineColor = new re.Color(1, 0, 0, 1)),
(this.boneOriginColor = new re.Color(0, 1, 0, 1)),
(this.attachmentLineColor = new re.Color(0, 0, 1, 0.5)),
(this.triangleLineColor = new re.Color(1, 0.64, 0, 0.5)),
(this.pathColor = new re.Color().setFromString("FF7F00")),
(this.clipColor = new re.Color(0.8, 0, 0, 2)),
(this.aabbColor = new re.Color(0, 1, 0, 0.5)),
(this.drawBones = !0),
(this.drawRegionAttachments = !0),
(this.drawBoundingBoxes = !0),
(this.drawMeshHull = !0),
(this.drawMeshTriangles = !0),
(this.drawPaths = !0),
(this.drawSkeletonXY = !1),
(this.drawClipping = !0),
(this.premultipliedAlpha = !1),
(this.scale = 1),
(this.boneWidth = 2),
(this.bounds = new re.SkeletonBounds()),
(this.temp = new Array()),
(this.vertices = re.Utils.newFloatArray(2048)),
(this.context = t instanceof oe.ManagedWebGLRenderingContext ? t : new oe.ManagedWebGLRenderingContext(t));
}
function ei(t, e) {
void 0 === e && (e = !0),
(this.premultipliedAlpha = !1),
(this.vertexEffect = null),
(this.tempColor = new he.Color()),
(this.tempColor2 = new he.Color()),
(this.vertexSize = 8),
(this.twoColorTint = !1),
(this.renderable = new ue(null, 0, 0)),
(this.clipper = new he.SkeletonClipping()),
(this.temp = new he.Vector2()),
(this.temp2 = new he.Vector2()),
(this.temp3 = new he.Color()),
(this.temp4 = new he.Color()),
(this.twoColorTint = e) && (this.vertexSize += 4),
(this.vertices = he.Utils.newFloatArray(1024 * this.vertexSize));
}
function ii(t, e, i) {
void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 0), (this.x = 0), (this.y = 0), (this.z = 0), (this.x = t), (this.y = e), (this.z = i);
}
!(function (z) {
var X,
t,
v,
e,
i,
n,
V =
((s.prototype.hasTimeline = function (t) {
return 1 == this.timelineIds[t];
}),
(s.prototype.apply = function (t, e, i, n, s, r, o, a) {
if (null == t) throw new Error("skeleton cannot be null.");
n && 0 != this.duration && ((i %= this.duration), 0 < e && (e %= this.duration));
for (var h = this.timelines, l = 0, u = h.length; l < u; l++) h[l].apply(t, e, i, s, r, o, a);
}),
(s.binarySearch = function (t, e, i) {
void 0 === i && (i = 1);
var n = 0,
s = t.length / i - 2;
if (0 == s) return i;
for (var r = s >>> 1; ; ) {
if ((t[(r + 1) * i] <= e ? (n = r + 1) : (s = r), n == s)) return (n + 1) * i;
r = (n + s) >>> 1;
}
}),
(s.linearSearch = function (t, e, i) {
for (var n = 0, s = t.length - i; n <= s; n += i) if (t[n] > e) return n;
return -1;
}),
s);
function s(t, e, i) {
if (null == t) throw new Error("name cannot be null.");
if (null == e) throw new Error("timelines cannot be null.");
(this.name = t), (this.timelines = e), (this.timelineIds = []);
for (var n = 0; n < e.length; n++) this.timelineIds[e[n].getPropertyId()] = !0;
this.duration = i;
}
(z.Animation = V),
((t = X = z.MixBlend || (z.MixBlend = {}))[(t.setup = 0)] = "setup"),
(t[(t.first = 1)] = "first"),
(t[(t.replace = 2)] = "replace"),
(t[(t.add = 3)] = "add"),
((e = v = z.MixDirection || (z.MixDirection = {}))[(e.mixIn = 0)] = "mixIn"),
(e[(e.mixOut = 1)] = "mixOut"),
((n = i = z.TimelineType || (z.TimelineType = {}))[(n.rotate = 0)] = "rotate"),
(n[(n.translate = 1)] = "translate"),
(n[(n.scale = 2)] = "scale"),
(n[(n.shear = 3)] = "shear"),
(n[(n.attachment = 4)] = "attachment"),
(n[(n.color = 5)] = "color"),
(n[(n.deform = 6)] = "deform"),
(n[(n.event = 7)] = "event"),
(n[(n.drawOrder = 8)] = "drawOrder"),
(n[(n.ikConstraint = 9)] = "ikConstraint"),
(n[(n.transformConstraint = 10)] = "transformConstraint"),
(n[(n.pathConstraintPosition = 11)] = "pathConstraintPosition"),
(n[(n.pathConstraintSpacing = 12)] = "pathConstraintSpacing"),
(n[(n.pathConstraintMix = 13)] = "pathConstraintMix"),
(n[(n.twoColor = 14)] = "twoColor");
var r =
((m.prototype.getFrameCount = function () {
return this.curves.length / m.BEZIER_SIZE + 1;
}),
(m.prototype.setLinear = function (t) {
this.curves[t * m.BEZIER_SIZE] = m.LINEAR;
}),
(m.prototype.setStepped = function (t) {
this.curves[t * m.BEZIER_SIZE] = m.STEPPED;
}),
(m.prototype.getCurveType = function (t) {
var e = t * m.BEZIER_SIZE;
if (e == this.curves.length) return m.LINEAR;
var i = this.curves[e];
return i == m.LINEAR ? m.LINEAR : i == m.STEPPED ? m.STEPPED : m.BEZIER;
}),
(m.prototype.setCurve = function (t, e, i, n, s) {
var r = 0.03 * (2 * -e + n),
o = 0.03 * (2 * -i + s),
a = 0.006 * (3 * (e - n) + 1),
h = 0.006 * (3 * (i - s) + 1),
l = 2 * r + a,
u = 2 * o + h,
c = 0.3 * e + r + 0.16666667 * a,
d = 0.3 * i + o + 0.16666667 * h,
f = t * m.BEZIER_SIZE,
p = this.curves;
p[f++] = m.BEZIER;
for (var g = c, v = d, y = f + m.BEZIER_SIZE - 1; f < y; f += 2) (p[f] = g), (p[f + 1] = v), (c += l), (d += u), (l += a), (u += h), (g += c), (v += d);
}),
(m.prototype.getCurvePercent = function (t, e) {
e = z.MathUtils.clamp(e, 0, 1);
var i = this.curves,
n = t * m.BEZIER_SIZE,
s = i[n];
if (s == m.LINEAR) return e;
if (s == m.STEPPED) return 0;
for (var r = 0, o = ++n, a = n + m.BEZIER_SIZE - 1; n < a; n += 2)
if (e <= (r = i[n])) {
var h,
l = void 0;
return (h = n == o ? (l = 0) : ((l = i[n - 2]), i[n - 1])) + ((i[n + 1] - h) * (e - l)) / (r - l);
}
var u = i[n - 1];
return u + ((1 - u) * (e - r)) / (1 - r);
}),
(m.LINEAR = 0),
(m.STEPPED = 1),
(m.BEZIER = 2),
(m.BEZIER_SIZE = 19),
m);
function m(t) {
if (t <= 0) throw new Error("frameCount must be > 0: " + t);
this.curves = z.Utils.newFloatArray((t - 1) * m.BEZIER_SIZE);
}
z.CurveTimeline = r;
var o,
a =
(ye(y, (o = r)),
(y.prototype.getPropertyId = function () {
return (i.rotate << 24) + this.boneIndex;
}),
(y.prototype.setFrame = function (t, e, i) {
(t <<= 1), (this.frames[t] = e), (this.frames[t + y.ROTATION] = i);
}),
(y.prototype.apply = function (t, e, i, n, s, r, o) {
var a = this.frames,
h = t.bones[this.boneIndex];
if (h.active)
if (i < a[0])
switch (r) {
case X.setup:
return void (h.rotation = h.data.rotation);
case X.first:
var l = h.data.rotation - h.rotation;
h.rotation += (l - 360 * (16384 - ((16384.499999999996 - l / 360) | 0))) * s;
}
else if (i >= a[a.length - y.ENTRIES]) {
var u = a[a.length + y.PREV_ROTATION];
switch (r) {
case X.setup:
h.rotation = h.data.rotation + u * s;
break;
case X.first:
case X.replace:
(u += h.data.rotation - h.rotation), (u -= 360 * (16384 - ((16384.499999999996 - u / 360) | 0)));
case X.add:
h.rotation += u * s;
}
} else {
var c = V.binarySearch(a, i, y.ENTRIES),
d = a[c + y.PREV_ROTATION],
f = a[c],
p = this.getCurvePercent((c >> 1) - 1, 1 - (i - f) / (a[c + y.PREV_TIME] - f)),
g = d + ((g = a[c + y.ROTATION] - d) - 360 * (16384 - ((16384.499999999996 - g / 360) | 0))) * p;
switch (r) {
case X.setup:
h.rotation = h.data.rotation + (g - 360 * (16384 - ((16384.499999999996 - g / 360) | 0))) * s;
break;
case X.first:
case X.replace:
g += h.data.rotation - h.rotation;
case X.add:
h.rotation += (g - 360 * (16384 - ((16384.499999999996 - g / 360) | 0))) * s;
}
}
}),
(y.ENTRIES = 2),
(y.PREV_TIME = -2),
(y.PREV_ROTATION = -1),
(y.ROTATION = 1),
y);
function y(t) {
var e = o.call(this, t) || this;
return (e.frames = z.Utils.newFloatArray(t << 1)), e;
}
z.RotateTimeline = a;
var h,
l =
(ye(p, (h = r)),
(p.prototype.getPropertyId = function () {
return (i.translate << 24) + this.boneIndex;
}),
(p.prototype.setFrame = function (t, e, i, n) {
(t *= p.ENTRIES), (this.frames[t] = e), (this.frames[t + p.X] = i), (this.frames[t + p.Y] = n);
}),
(p.prototype.apply = function (t, e, i, n, s, r, o) {
var a = this.frames,
h = t.bones[this.boneIndex];
if (h.active)
if (i < a[0])
switch (r) {
case X.setup:
return (h.x = h.data.x), void (h.y = h.data.y);
case X.first:
(h.x += (h.data.x - h.x) * s), (h.y += (h.data.y - h.y) * s);
}
else {
var l,
u,
c,
d = 0,
f = 0;
switch (
(i >= a[a.length - p.ENTRIES]
? ((d = a[a.length + p.PREV_X]), (f = a[a.length + p.PREV_Y]))
: ((d = a[(l = V.binarySearch(a, i, p.ENTRIES)) + p.PREV_X]),
(f = a[l + p.PREV_Y]),
(u = a[l]),
(c = this.getCurvePercent(l / p.ENTRIES - 1, 1 - (i - u) / (a[l + p.PREV_TIME] - u))),
(d += (a[l + p.X] - d) * c),
(f += (a[l + p.Y] - f) * c)),
r)
) {
case X.setup:
(h.x = h.data.x + d * s), (h.y = h.data.y + f * s);
break;
case X.first:
case X.replace:
(h.x += (h.data.x + d - h.x) * s), (h.y += (h.data.y + f - h.y) * s);
break;
case X.add:
(h.x += d * s), (h.y += f * s);
}
}
}),
(p.ENTRIES = 3),
(p.PREV_TIME = -3),
(p.PREV_X = -2),
(p.PREV_Y = -1),
(p.X = 1),
(p.Y = 2),
p);
function p(t) {
var e = h.call(this, t) || this;
return (e.frames = z.Utils.newFloatArray(t * p.ENTRIES)), e;
}
z.TranslateTimeline = l;
var u,
c =
(ye(x, (u = l)),
(x.prototype.getPropertyId = function () {
return (i.scale << 24) + this.boneIndex;
}),
(x.prototype.apply = function (t, e, i, n, s, r, o) {
var a = this.frames,
h = t.bones[this.boneIndex];
if (h.active)
if (i < a[0])
switch (r) {
case X.setup:
return (h.scaleX = h.data.scaleX), void (h.scaleY = h.data.scaleY);
case X.first:
(h.scaleX += (h.data.scaleX - h.scaleX) * s), (h.scaleY += (h.data.scaleY - h.scaleY) * s);
}
else {
var l,
u,
c,
d = 0,
f = 0;
if (
((f =
i >= a[a.length - x.ENTRIES]
? ((d = a[a.length + x.PREV_X] * h.data.scaleX), a[a.length + x.PREV_Y] * h.data.scaleY)
: ((d = a[(l = V.binarySearch(a, i, x.ENTRIES)) + x.PREV_X]),
(f = a[l + x.PREV_Y]),
(u = a[l]),
(c = this.getCurvePercent(l / x.ENTRIES - 1, 1 - (i - u) / (a[l + x.PREV_TIME] - u))),
(d = (d + (a[l + x.X] - d) * c) * h.data.scaleX),
(f + (a[l + x.Y] - f) * c) * h.data.scaleY)),
1 == s)
)
r == X.add ? ((h.scaleX += d - h.data.scaleX), (h.scaleY += f - h.data.scaleY)) : ((h.scaleX = d), (h.scaleY = f));
else {
var p = 0,
g = 0;
if (o == v.mixOut)
switch (r) {
case X.setup:
(p = h.data.scaleX), (g = h.data.scaleY), (h.scaleX = p + (Math.abs(d) * z.MathUtils.signum(p) - p) * s), (h.scaleY = g + (Math.abs(f) * z.MathUtils.signum(g) - g) * s);
break;
case X.first:
case X.replace:
(p = h.scaleX), (g = h.scaleY), (h.scaleX = p + (Math.abs(d) * z.MathUtils.signum(p) - p) * s), (h.scaleY = g + (Math.abs(f) * z.MathUtils.signum(g) - g) * s);
break;
case X.add:
(p = h.scaleX), (g = h.scaleY), (h.scaleX = p + (Math.abs(d) * z.MathUtils.signum(p) - h.data.scaleX) * s), (h.scaleY = g + (Math.abs(f) * z.MathUtils.signum(g) - h.data.scaleY) * s);
}
else
switch (r) {
case X.setup:
(p = Math.abs(h.data.scaleX) * z.MathUtils.signum(d)), (g = Math.abs(h.data.scaleY) * z.MathUtils.signum(f)), (h.scaleX = p + (d - p) * s), (h.scaleY = g + (f - g) * s);
break;
case X.first:
case X.replace:
(p = Math.abs(h.scaleX) * z.MathUtils.signum(d)), (g = Math.abs(h.scaleY) * z.MathUtils.signum(f)), (h.scaleX = p + (d - p) * s), (h.scaleY = g + (f - g) * s);
break;
case X.add:
(p = z.MathUtils.signum(d)),
(g = z.MathUtils.signum(f)),
(h.scaleX = Math.abs(h.scaleX) * p + (d - Math.abs(h.data.scaleX) * p) * s),
(h.scaleY = Math.abs(h.scaleY) * g + (f - Math.abs(h.data.scaleY) * g) * s);
}
}
}
}),
x);
function x(t) {
return u.call(this, t) || this;
}
z.ScaleTimeline = c;
var d,
f =
(ye(g, (d = l)),
(g.prototype.getPropertyId = function () {
return (i.shear << 24) + this.boneIndex;
}),
(g.prototype.apply = function (t, e, i, n, s, r, o) {
var a = this.frames,
h = t.bones[this.boneIndex];
if (h.active)
if (i < a[0])
switch (r) {
case X.setup:
return (h.shearX = h.data.shearX), void (h.shearY = h.data.shearY);
case X.first:
(h.shearX += (h.data.shearX - h.shearX) * s), (h.shearY += (h.data.shearY - h.shearY) * s);
}
else {
var l,
u,
c,
d = 0,
f = 0;
switch (
(i >= a[a.length - g.ENTRIES]
? ((d = a[a.length + g.PREV_X]), (f = a[a.length + g.PREV_Y]))
: ((d = a[(l = V.binarySearch(a, i, g.ENTRIES)) + g.PREV_X]),
(f = a[l + g.PREV_Y]),
(u = a[l]),
(c = this.getCurvePercent(l / g.ENTRIES - 1, 1 - (i - u) / (a[l + g.PREV_TIME] - u))),
(d += (a[l + g.X] - d) * c),
(f += (a[l + g.Y] - f) * c)),
r)
) {
case X.setup:
(h.shearX = h.data.shearX + d * s), (h.shearY = h.data.shearY + f * s);
break;
case X.first:
case X.replace:
(h.shearX += (h.data.shearX + d - h.shearX) * s), (h.shearY += (h.data.shearY + f - h.shearY) * s);
break;
case X.add:
(h.shearX += d * s), (h.shearY += f * s);
}
}
}),
g);
function g(t) {
return d.call(this, t) || this;
}
z.ShearTimeline = f;
var b,
w =
(ye(T, (b = r)),
(T.prototype.getPropertyId = function () {
return (i.color << 24) + this.slotIndex;
}),
(T.prototype.setFrame = function (t, e, i, n, s, r) {
(t *= T.ENTRIES), (this.frames[t] = e), (this.frames[t + T.R] = i), (this.frames[t + T.G] = n), (this.frames[t + T.B] = s), (this.frames[t + T.A] = r);
}),
(T.prototype.apply = function (t, e, i, n, s, r, o) {
var a = t.slots[this.slotIndex];
if (a.bone.active) {
var h = this.frames;
if (i < h[0])
switch (r) {
case X.setup:
return void a.color.setFromColor(a.data.color);
case X.first:
var l = a.color,
u = a.data.color;
l.add((u.r - l.r) * s, (u.g - l.g) * s, (u.b - l.b) * s, (u.a - l.a) * s);
}
else {
var c,
d,
f,
p,
g = 0,
v = 0,
y = 0,
m = 0;
i >= h[h.length - T.ENTRIES]
? ((g = h[(c = h.length) + T.PREV_R]), (v = h[c + T.PREV_G]), (y = h[c + T.PREV_B]), (m = h[c + T.PREV_A]))
: ((g = h[(d = V.binarySearch(h, i, T.ENTRIES)) + T.PREV_R]),
(v = h[d + T.PREV_G]),
(y = h[d + T.PREV_B]),
(m = h[d + T.PREV_A]),
(f = h[d]),
(p = this.getCurvePercent(d / T.ENTRIES - 1, 1 - (i - f) / (h[d + T.PREV_TIME] - f))),
(g += (h[d + T.R] - g) * p),
(v += (h[d + T.G] - v) * p),
(y += (h[d + T.B] - y) * p),
(m += (h[d + T.A] - m) * p)),
1 == s ? a.color.set(g, v, y, m) : ((l = a.color), r == X.setup && l.setFromColor(a.data.color), l.add((g - l.r) * s, (v - l.g) * s, (y - l.b) * s, (m - l.a) * s));
}
}
}),
(T.ENTRIES = 5),
(T.PREV_TIME = -5),
(T.PREV_R = -4),
(T.PREV_G = -3),
(T.PREV_B = -2),
(T.PREV_A = -1),
(T.R = 1),
(T.G = 2),
(T.B = 3),
(T.A = 4),
T);
function T(t) {
var e = b.call(this, t) || this;
return (e.frames = z.Utils.newFloatArray(t * T.ENTRIES)), e;
}
z.ColorTimeline = w;
var S,
_ =
(ye(E, (S = r)),
(E.prototype.getPropertyId = function () {
return (i.twoColor << 24) + this.slotIndex;
}),
(E.prototype.setFrame = function (t, e, i, n, s, r, o, a, h) {
(t *= E.ENTRIES),
(this.frames[t] = e),
(this.frames[t + E.R] = i),
(this.frames[t + E.G] = n),
(this.frames[t + E.B] = s),
(this.frames[t + E.A] = r),
(this.frames[t + E.R2] = o),
(this.frames[t + E.G2] = a),
(this.frames[t + E.B2] = h);
}),
(E.prototype.apply = function (t, e, i, n, s, r, o) {
var a = t.slots[this.slotIndex];
if (a.bone.active) {
var h = this.frames;
if (i < h[0])
switch (r) {
case X.setup:
return a.color.setFromColor(a.data.color), void a.darkColor.setFromColor(a.data.darkColor);
case X.first:
var l = a.color,
u = a.darkColor,
c = a.data.color,
d = a.data.darkColor;
l.add((c.r - l.r) * s, (c.g - l.g) * s, (c.b - l.b) * s, (c.a - l.a) * s), u.add((d.r - u.r) * s, (d.g - u.g) * s, (d.b - u.b) * s, 0);
}
else {
var f,
p,
g,
v,
y = 0,
m = 0,
x = 0,
b = 0,
w = 0,
T = 0,
S = 0;
i >= h[h.length - E.ENTRIES]
? ((y = h[(f = h.length) + E.PREV_R]), (m = h[f + E.PREV_G]), (x = h[f + E.PREV_B]), (b = h[f + E.PREV_A]), (w = h[f + E.PREV_R2]), (T = h[f + E.PREV_G2]), (S = h[f + E.PREV_B2]))
: ((y = h[(p = V.binarySearch(h, i, E.ENTRIES)) + E.PREV_R]),
(m = h[p + E.PREV_G]),
(x = h[p + E.PREV_B]),
(b = h[p + E.PREV_A]),
(w = h[p + E.PREV_R2]),
(T = h[p + E.PREV_G2]),
(S = h[p + E.PREV_B2]),
(g = h[p]),
(v = this.getCurvePercent(p / E.ENTRIES - 1, 1 - (i - g) / (h[p + E.PREV_TIME] - g))),
(y += (h[p + E.R] - y) * v),
(m += (h[p + E.G] - m) * v),
(x += (h[p + E.B] - x) * v),
(b += (h[p + E.A] - b) * v),
(w += (h[p + E.R2] - w) * v),
(T += (h[p + E.G2] - T) * v),
(S += (h[p + E.B2] - S) * v)),
1 == s
? (a.color.set(y, m, x, b), a.darkColor.set(w, T, S, 1))
: ((l = a.color),
(u = a.darkColor),
r == X.setup && (l.setFromColor(a.data.color), u.setFromColor(a.data.darkColor)),
l.add((y - l.r) * s, (m - l.g) * s, (x - l.b) * s, (b - l.a) * s),
u.add((w - u.r) * s, (T - u.g) * s, (S - u.b) * s, 0));
}
}
}),
(E.ENTRIES = 8),
(E.PREV_TIME = -8),
(E.PREV_R = -7),
(E.PREV_G = -6),
(E.PREV_B = -5),
(E.PREV_A = -4),
(E.PREV_R2 = -3),
(E.PREV_G2 = -2),
(E.PREV_B2 = -1),
(E.R = 1),
(E.G = 2),
(E.B = 3),
(E.A = 4),
(E.R2 = 5),
(E.G2 = 6),
(E.B2 = 7),
E);
function E(t) {
var e = S.call(this, t) || this;
return (e.frames = z.Utils.newFloatArray(t * E.ENTRIES)), e;
}
z.TwoColorTimeline = _;
var P =
((A.prototype.getPropertyId = function () {
return (i.attachment << 24) + this.slotIndex;
}),
(A.prototype.getFrameCount = function () {
return this.frames.length;
}),
(A.prototype.setFrame = function (t, e, i) {
(this.frames[t] = e), (this.attachmentNames[t] = i);
}),
(A.prototype.apply = function (t, e, i, n, s, r, o) {
var a,
h,
l,
u = t.slots[this.slotIndex];
u.bone.active &&
(o != v.mixOut
? i < (a = this.frames)[0]
? (r != X.setup && r != X.first) || this.setAttachment(t, u, u.data.attachmentName)
: (0,
(h = i >= a[a.length - 1] ? a.length - 1 : V.binarySearch(a, i, 1) - 1),
(l = this.attachmentNames[h]),
t.slots[this.slotIndex].setAttachment(null == l ? null : t.getAttachment(this.slotIndex, l)))
: r == X.setup && this.setAttachment(t, u, u.data.attachmentName));
}),
(A.prototype.setAttachment = function (t, e, i) {
e.attachment = null == i ? null : t.getAttachment(this.slotIndex, i);
}),
A);
function A(t) {
(this.frames = z.Utils.newFloatArray(t)), (this.attachmentNames = new Array(t));
}
z.AttachmentTimeline = P;
var M,
C = null,
O =
(ye(k, (M = r)),
(k.prototype.getPropertyId = function () {
return (i.deform << 27) + +this.attachment.id + this.slotIndex;
}),
(k.prototype.setFrame = function (t, e, i) {
(this.frames[t] = e), (this.frameVertices[t] = i);
}),
(k.prototype.apply = function (t, e, i, n, s, r, o) {
var a = t.slots[this.slotIndex];
if (a.bone.active) {
var h = a.getAttachment();
if (h instanceof z.VertexAttachment && h.deformAttachment == this.attachment) {
var l = a.deform;
0 == l.length && (r = X.setup);
var u = this.frameVertices,
c = u[0].length,
d = this.frames;
if (i < d[0]) {
var f = h;
switch (r) {
case X.setup:
return void (l.length = 0);
case X.first:
if (1 == s) {
l.length = 0;
break;
}
var p = z.Utils.setArraySize(l, c);
if (null == f.bones) for (var g = f.vertices, v = 0; v < c; v++) p[v] += (g[v] - p[v]) * s;
else for (s = 1 - s, v = 0; v < c; v++) p[v] *= s;
}
} else {
var y = z.Utils.setArraySize(l, c);
if (i >= d[d.length - 1]) {
var m = u[d.length - 1];
if (1 == s)
if (r == X.add)
if (null == (f = h).bones) {
g = f.vertices;
for (var x = 0; x < c; x++) y[x] += m[x] - g[x];
} else for (var b = 0; b < c; b++) y[b] += m[b];
else z.Utils.arrayCopy(m, 0, y, 0, c);
else
switch (r) {
case X.setup:
if (null == h.bones) {
g = h.vertices;
for (var w = 0; w < c; w++) {
var T = g[w];
y[w] = T + (m[w] - T) * s;
}
} else for (var S = 0; S < c; S++) y[S] = m[S] * s;
break;
case X.first:
case X.replace:
for (var _ = 0; _ < c; _++) y[_] += (m[_] - y[_]) * s;
break;
case X.add:
if (null == (f = h).bones) {
g = f.vertices;
for (var E = 0; E < c; E++) y[E] += (m[E] - g[E]) * s;
} else for (var P = 0; P < c; P++) y[P] += m[P] * s;
}
} else {
var A = V.binarySearch(d, i),
M = u[A - 1],
C = u[A],
O = d[A],
k = this.getCurvePercent(A - 1, 1 - (i - O) / (d[A - 1] - O));
if (1 == s)
if (r == X.add)
if (null == (f = h).bones) {
g = f.vertices;
for (var R = 0; R < c; R++) {
var L = M[R];
y[R] += L + (C[R] - L) * k - g[R];
}
} else for (var I = 0; I < c; I++) (L = M[I]), (y[I] += L + (C[I] - L) * k);
else for (var D = 0; D < c; D++) (L = M[D]), (y[D] = L + (C[D] - L) * k);
else
switch (r) {
case X.setup:
if (null == h.bones) {
g = h.vertices;
for (var F = 0; F < c; F++) (L = M[F]), (T = g[F]), (y[F] = T + (L + (C[F] - L) * k - T) * s);
} else for (var B = 0; B < c; B++) (L = M[B]), (y[B] = (L + (C[B] - L) * k) * s);
break;
case X.first:
case X.replace:
for (var N = 0; N < c; N++) (L = M[N]), (y[N] += (L + (C[N] - L) * k - y[N]) * s);
break;
case X.add:
if (null == (f = h).bones) {
g = f.vertices;
for (var U = 0; U < c; U++) (L = M[U]), (y[U] += (L + (C[U] - L) * k - g[U]) * s);
} else for (var Y = 0; Y < c; Y++) (L = M[Y]), (y[Y] += (L + (C[Y] - L) * k) * s);
}
}
}
}
}
}),
k);
function k(t) {
var e = M.call(this, t) || this;
return (e.frames = z.Utils.newFloatArray(t)), (e.frameVertices = new Array(t)), null == C && (C = z.Utils.newFloatArray(64)), e;
}
z.DeformTimeline = O;
var R =
((L.prototype.getPropertyId = function () {
return i.event << 24;
}),
(L.prototype.getFrameCount = function () {
return this.frames.length;
}),
(L.prototype.setFrame = function (t, e) {
(this.frames[t] = e.time), (this.events[t] = e);
}),
(L.prototype.apply = function (t, e, i, n, s, r, o) {
if (null != n) {
var a = this.frames,
h = this.frames.length;
if (i < e) this.apply(t, e, Number.MAX_VALUE, n, s, r, o), (e = -1);
else if (e >= a[h - 1]) return;
if (!(i < a[0])) {
var l = 0;
if (e < a[0]) l = 0;
else for (var u = a[(l = V.binarySearch(a, e))]; 0 < l && a[l - 1] == u; ) l--;
for (; l < h && i >= a[l]; l++) n.push(this.events[l]);
}
}
}),
L);
function L(t) {
(this.frames = z.Utils.newFloatArray(t)), (this.events = new Array(t));
}
z.EventTimeline = R;
var I =
((D.prototype.getPropertyId = function () {
return i.drawOrder << 24;
}),
(D.prototype.getFrameCount = function () {
return this.frames.length;
}),
(D.prototype.setFrame = function (t, e, i) {
(this.frames[t] = e), (this.drawOrders[t] = i);
}),
(D.prototype.apply = function (t, e, i, n, s, r, o) {
var a = t.drawOrder,
h = t.slots;
if (o != v.mixOut) {
var l = this.frames;
if (i < l[0]) (r != X.setup && r != X.first) || z.Utils.arrayCopy(t.slots, 0, t.drawOrder, 0, t.slots.length);
else {
var u = i >= l[l.length - 1] ? l.length - 1 : V.binarySearch(l, i) - 1,
c = this.drawOrders[u];
if (null == c) z.Utils.arrayCopy(h, 0, a, 0, h.length);
else for (var d = 0, f = c.length; d < f; d++) a[d] = h[c[d]];
}
} else r == X.setup && z.Utils.arrayCopy(t.slots, 0, t.drawOrder, 0, t.slots.length);
}),
D);
function D(t) {
(this.frames = z.Utils.newFloatArray(t)), (this.drawOrders = new Array(t));
}
z.DrawOrderTimeline = I;
var F,
B =
(ye(N, (F = r)),
(N.prototype.getPropertyId = function () {
return (i.ikConstraint << 24) + this.ikConstraintIndex;
}),
(N.prototype.setFrame = function (t, e, i, n, s, r, o) {
(t *= N.ENTRIES),
(this.frames[t] = e),
(this.frames[t + N.MIX] = i),
(this.frames[t + N.SOFTNESS] = n),
(this.frames[t + N.BEND_DIRECTION] = s),
(this.frames[t + N.COMPRESS] = r ? 1 : 0),
(this.frames[t + N.STRETCH] = o ? 1 : 0);
}),
(N.prototype.apply = function (t, e, i, n, s, r, o) {
var a,
h,
l,
u,
c,
d = this.frames,
f = t.ikConstraints[this.ikConstraintIndex];
if (f.active)
if (i < d[0])
switch (r) {
case X.setup:
return (f.mix = f.data.mix), (f.softness = f.data.softness), (f.bendDirection = f.data.bendDirection), (f.compress = f.data.compress), void (f.stretch = f.data.stretch);
case X.first:
(f.mix += (f.data.mix - f.mix) * s), (f.softness += (f.data.softness - f.softness) * s), (f.bendDirection = f.data.bendDirection), (f.compress = f.data.compress), (f.stretch = f.data.stretch);
}
else
i >= d[d.length - N.ENTRIES]
? r == X.setup
? ((f.mix = f.data.mix + (d[d.length + N.PREV_MIX] - f.data.mix) * s),
(f.softness = f.data.softness + (d[d.length + N.PREV_SOFTNESS] - f.data.softness) * s),
o == v.mixOut
? ((f.bendDirection = f.data.bendDirection), (f.compress = f.data.compress), (f.stretch = f.data.stretch))
: ((f.bendDirection = d[d.length + N.PREV_BEND_DIRECTION]), (f.compress = 0 != d[d.length + N.PREV_COMPRESS]), (f.stretch = 0 != d[d.length + N.PREV_STRETCH])))
: ((f.mix += (d[d.length + N.PREV_MIX] - f.mix) * s),
(f.softness += (d[d.length + N.PREV_SOFTNESS] - f.softness) * s),
o == v.mixIn && ((f.bendDirection = d[d.length + N.PREV_BEND_DIRECTION]), (f.compress = 0 != d[d.length + N.PREV_COMPRESS]), (f.stretch = 0 != d[d.length + N.PREV_STRETCH])))
: ((h = d[(a = V.binarySearch(d, i, N.ENTRIES)) + N.PREV_MIX]),
(l = d[a + N.PREV_SOFTNESS]),
(u = d[a]),
(c = this.getCurvePercent(a / N.ENTRIES - 1, 1 - (i - u) / (d[a + N.PREV_TIME] - u))),
r == X.setup
? ((f.mix = f.data.mix + (h + (d[a + N.MIX] - h) * c - f.data.mix) * s),
(f.softness = f.data.softness + (l + (d[a + N.SOFTNESS] - l) * c - f.data.softness) * s),
o == v.mixOut
? ((f.bendDirection = f.data.bendDirection), (f.compress = f.data.compress), (f.stretch = f.data.stretch))
: ((f.bendDirection = d[a + N.PREV_BEND_DIRECTION]), (f.compress = 0 != d[a + N.PREV_COMPRESS]), (f.stretch = 0 != d[a + N.PREV_STRETCH])))
: ((f.mix += (h + (d[a + N.MIX] - h) * c - f.mix) * s),
(f.softness += (l + (d[a + N.SOFTNESS] - l) * c - f.softness) * s),
o == v.mixIn && ((f.bendDirection = d[a + N.PREV_BEND_DIRECTION]), (f.compress = 0 != d[a + N.PREV_COMPRESS]), (f.stretch = 0 != d[a + N.PREV_STRETCH]))));
}),
(N.ENTRIES = 6),
(N.PREV_TIME = -6),
(N.PREV_MIX = -5),
(N.PREV_SOFTNESS = -4),
(N.PREV_BEND_DIRECTION = -3),
(N.PREV_COMPRESS = -2),
(N.PREV_STRETCH = -1),
(N.MIX = 1),
(N.SOFTNESS = 2),
(N.BEND_DIRECTION = 3),
(N.COMPRESS = 4),
(N.STRETCH = 5),
N);
function N(t) {
var e = F.call(this, t) || this;
return (e.frames = z.Utils.newFloatArray(t * N.ENTRIES)), e;
}
z.IkConstraintTimeline = B;
var U,
Y =
(ye(G, (U = r)),
(G.prototype.getPropertyId = function () {
return (i.transformConstraint << 24) + this.transformConstraintIndex;
}),
(G.prototype.setFrame = function (t, e, i, n, s, r) {
(t *= G.ENTRIES), (this.frames[t] = e), (this.frames[t + G.ROTATE] = i), (this.frames[t + G.TRANSLATE] = n), (this.frames[t + G.SCALE] = s), (this.frames[t + G.SHEAR] = r);
}),
(G.prototype.apply = function (t, e, i, n, s, r, o) {
var a = this.frames,
h = t.transformConstraints[this.transformConstraintIndex];
if (h.active)
if (i < a[0]) {
var l = h.data;
switch (r) {
case X.setup:
return (h.rotateMix = l.rotateMix), (h.translateMix = l.translateMix), (h.scaleMix = l.scaleMix), void (h.shearMix = l.shearMix);
case X.first:
(h.rotateMix += (l.rotateMix - h.rotateMix) * s),
(h.translateMix += (l.translateMix - h.translateMix) * s),
(h.scaleMix += (l.scaleMix - h.scaleMix) * s),
(h.shearMix += (l.shearMix - h.shearMix) * s);
}
} else {
var u,
c,
d,
f,
p = 0,
g = 0,
v = 0,
y = 0;
i >= a[a.length - G.ENTRIES]
? ((p = a[(u = a.length) + G.PREV_ROTATE]), (g = a[u + G.PREV_TRANSLATE]), (v = a[u + G.PREV_SCALE]), (y = a[u + G.PREV_SHEAR]))
: ((p = a[(c = V.binarySearch(a, i, G.ENTRIES)) + G.PREV_ROTATE]),
(g = a[c + G.PREV_TRANSLATE]),
(v = a[c + G.PREV_SCALE]),
(y = a[c + G.PREV_SHEAR]),
(d = a[c]),
(f = this.getCurvePercent(c / G.ENTRIES - 1, 1 - (i - d) / (a[c + G.PREV_TIME] - d))),
(p += (a[c + G.ROTATE] - p) * f),
(g += (a[c + G.TRANSLATE] - g) * f),
(v += (a[c + G.SCALE] - v) * f),
(y += (a[c + G.SHEAR] - y) * f)),
r == X.setup
? ((l = h.data),
(h.rotateMix = l.rotateMix + (p - l.rotateMix) * s),
(h.translateMix = l.translateMix + (g - l.translateMix) * s),
(h.scaleMix = l.scaleMix + (v - l.scaleMix) * s),
(h.shearMix = l.shearMix + (y - l.shearMix) * s))
: ((h.rotateMix += (p - h.rotateMix) * s), (h.translateMix += (g - h.translateMix) * s), (h.scaleMix += (v - h.scaleMix) * s), (h.shearMix += (y - h.shearMix) * s));
}
}),
(G.ENTRIES = 5),
(G.PREV_TIME = -5),
(G.PREV_ROTATE = -4),
(G.PREV_TRANSLATE = -3),
(G.PREV_SCALE = -2),
(G.PREV_SHEAR = -1),
(G.ROTATE = 1),
(G.TRANSLATE = 2),
(G.SCALE = 3),
(G.SHEAR = 4),
G);
function G(t) {
var e = U.call(this, t) || this;
return (e.frames = z.Utils.newFloatArray(t * G.ENTRIES)), e;
}
z.TransformConstraintTimeline = Y;
var j,
H =
(ye(W, (j = r)),
(W.prototype.getPropertyId = function () {
return (i.pathConstraintPosition << 24) + this.pathConstraintIndex;
}),
(W.prototype.setFrame = function (t, e, i) {
(t *= W.ENTRIES), (this.frames[t] = e), (this.frames[t + W.VALUE] = i);
}),
(W.prototype.apply = function (t, e, i, n, s, r, o) {
var a = this.frames,
h = t.pathConstraints[this.pathConstraintIndex];
if (h.active)
if (i < a[0])
switch (r) {
case X.setup:
return void (h.position = h.data.position);
case X.first:
h.position += (h.data.position - h.position) * s;
}
else {
var l,
u,
c,
d = 0;
i >= a[a.length - W.ENTRIES]
? (d = a[a.length + W.PREV_VALUE])
: ((d = a[(l = V.binarySearch(a, i, W.ENTRIES)) + W.PREV_VALUE]),
(u = a[l]),
(c = this.getCurvePercent(l / W.ENTRIES - 1, 1 - (i - u) / (a[l + W.PREV_TIME] - u))),
(d += (a[l + W.VALUE] - d) * c)),
r == X.setup ? (h.position = h.data.position + (d - h.data.position) * s) : (h.position += (d - h.position) * s);
}
}),
(W.ENTRIES = 2),
(W.PREV_TIME = -2),
(W.PREV_VALUE = -1),
(W.VALUE = 1),
W);
function W(t) {
var e = j.call(this, t) || this;
return (e.frames = z.Utils.newFloatArray(t * W.ENTRIES)), e;
}
z.PathConstraintPositionTimeline = H;
var K,
q =
(ye(Z, (K = H)),
(Z.prototype.getPropertyId = function () {
return (i.pathConstraintSpacing << 24) + this.pathConstraintIndex;
}),
(Z.prototype.apply = function (t, e, i, n, s, r, o) {
var a = this.frames,
h = t.pathConstraints[this.pathConstraintIndex];
if (h.active)
if (i < a[0])
switch (r) {
case X.setup:
return void (h.spacing = h.data.spacing);
case X.first:
h.spacing += (h.data.spacing - h.spacing) * s;
}
else {
var l,
u,
c,
d = 0;
i >= a[a.length - Z.ENTRIES]
? (d = a[a.length + Z.PREV_VALUE])
: ((d = a[(l = V.binarySearch(a, i, Z.ENTRIES)) + Z.PREV_VALUE]),
(u = a[l]),
(c = this.getCurvePercent(l / Z.ENTRIES - 1, 1 - (i - u) / (a[l + Z.PREV_TIME] - u))),
(d += (a[l + Z.VALUE] - d) * c)),
r == X.setup ? (h.spacing = h.data.spacing + (d - h.data.spacing) * s) : (h.spacing += (d - h.spacing) * s);
}
}),
Z);
function Z(t) {
return K.call(this, t) || this;
}
z.PathConstraintSpacingTimeline = q;
var J,
Q =
(ye($, (J = r)),
($.prototype.getPropertyId = function () {
return (i.pathConstraintMix << 24) + this.pathConstraintIndex;
}),
($.prototype.setFrame = function (t, e, i, n) {
(t *= $.ENTRIES), (this.frames[t] = e), (this.frames[t + $.ROTATE] = i), (this.frames[t + $.TRANSLATE] = n);
}),
($.prototype.apply = function (t, e, i, n, s, r, o) {
var a = this.frames,
h = t.pathConstraints[this.pathConstraintIndex];
if (h.active)
if (i < a[0])
switch (r) {
case X.setup:
return (h.rotateMix = h.data.rotateMix), void (h.translateMix = h.data.translateMix);
case X.first:
(h.rotateMix += (h.data.rotateMix - h.rotateMix) * s), (h.translateMix += (h.data.translateMix - h.translateMix) * s);
}
else {
var l,
u,
c,
d = 0,
f = 0;
i >= a[a.length - $.ENTRIES]
? ((d = a[a.length + $.PREV_ROTATE]), (f = a[a.length + $.PREV_TRANSLATE]))
: ((d = a[(l = V.binarySearch(a, i, $.ENTRIES)) + $.PREV_ROTATE]),
(f = a[l + $.PREV_TRANSLATE]),
(u = a[l]),
(c = this.getCurvePercent(l / $.ENTRIES - 1, 1 - (i - u) / (a[l + $.PREV_TIME] - u))),
(d += (a[l + $.ROTATE] - d) * c),
(f += (a[l + $.TRANSLATE] - f) * c)),
r == X.setup
? ((h.rotateMix = h.data.rotateMix + (d - h.data.rotateMix) * s), (h.translateMix = h.data.translateMix + (f - h.data.translateMix) * s))
: ((h.rotateMix += (d - h.rotateMix) * s), (h.translateMix += (f - h.translateMix) * s));
}
}),
($.ENTRIES = 3),
($.PREV_TIME = -3),
($.PREV_ROTATE = -2),
($.PREV_TRANSLATE = -1),
($.ROTATE = 1),
($.TRANSLATE = 2),
$);
function $(t) {
var e = J.call(this, t) || this;
return (e.frames = z.Utils.newFloatArray(t * $.ENTRIES)), e;
}
z.PathConstraintMixTimeline = Q;
})((ge = ge || {})),
(function (P) {
var t =
((A.prototype.update = function (t) {
t *= this.timeScale;
for (var e = this.tracks, i = 0, n = e.length; i < n; i++) {
var s = e[i];
if (null != s) {
(s.animationLast = s.nextAnimationLast), (s.trackLast = s.nextTrackLast);
var r = t * s.timeScale;
if (0 < s.delay) {
if (((s.delay -= r), 0 < s.delay)) continue;
(r = -s.delay), (s.delay = 0);
}
var o = s.next;
if (null != o) {
var a = s.trackLast - o.delay;
if (0 <= a) {
for (o.delay = 0, o.trackTime += 0 == s.timeScale ? 0 : (a / s.timeScale + t) * o.timeScale, s.trackTime += r, this.setCurrent(i, o, !0); null != o.mixingFrom; )
(o.mixTime += t), (o = o.mixingFrom);
continue;
}
} else if (s.trackLast >= s.trackEnd && null == s.mixingFrom) {
(e[i] = null), this.queue.end(s), this.disposeNext(s);
continue;
}
if (null != s.mixingFrom && this.updateMixingFrom(s, t)) {
var h = s.mixingFrom;
for ((s.mixingFrom = null) != h && (h.mixingTo = null); null != h; ) this.queue.end(h), (h = h.mixingFrom);
}
s.trackTime += r;
}
}
this.queue.drain();
}),
(A.prototype.updateMixingFrom = function (t, e) {
var i = t.mixingFrom;
if (null == i) return !0;
var n = this.updateMixingFrom(i, e);
return (
(i.animationLast = i.nextAnimationLast),
(i.trackLast = i.nextTrackLast),
0 < t.mixTime && t.mixTime >= t.mixDuration
? ((0 != i.totalAlpha && 0 != t.mixDuration) || ((t.mixingFrom = i.mixingFrom), null != i.mixingFrom && (i.mixingFrom.mixingTo = t), (t.interruptAlpha = i.interruptAlpha), this.queue.end(i)), n)
: ((i.trackTime += e * i.timeScale), (t.mixTime += e), !1)
);
}),
(A.prototype.apply = function (t) {
if (null == t) throw new Error("skeleton cannot be null.");
this.animationsChanged && this._animationsChanged();
for (var e = this.events, i = this.tracks, n = !1, s = 0, r = i.length; s < r; s++) {
var o = i[s];
if (!(null == o || 0 < o.delay)) {
n = !0;
var a = 0 == s ? P.MixBlend.first : o.mixBlend,
h = o.alpha;
null != o.mixingFrom ? (h *= this.applyMixingFrom(o, t, a)) : o.trackTime >= o.trackEnd && null == o.next && (h = 0);
var l = o.animationLast,
u = o.getAnimationTime(),
c = o.animation.timelines.length,
d = o.animation.timelines;
if ((0 == s && 1 == h) || a == P.MixBlend.add)
for (var f = 0; f < c; f++) {
P.Utils.webkit602BugfixHelper(h, a);
var p = d[f];
p instanceof P.AttachmentTimeline ? this.applyAttachmentTimeline(p, t, u, a, !0) : p.apply(t, l, u, e, h, a, P.MixDirection.mixIn);
}
else {
var g = o.timelineMode,
v = 0 == o.timelinesRotation.length;
v && P.Utils.setArraySize(o.timelinesRotation, c << 1, null);
var y = o.timelinesRotation;
for (f = 0; f < c; f++) {
var m = d[f],
x = g[f] == A.SUBSEQUENT ? a : P.MixBlend.setup;
m instanceof P.RotateTimeline
? this.applyRotateTimeline(m, t, u, h, x, y, f << 1, v)
: m instanceof P.AttachmentTimeline
? this.applyAttachmentTimeline(m, t, u, a, !0)
: (P.Utils.webkit602BugfixHelper(h, a), m.apply(t, l, u, e, h, x, P.MixDirection.mixIn));
}
}
this.queueEvents(o, u), (e.length = 0), (o.nextAnimationLast = u), (o.nextTrackLast = o.trackTime);
}
}
for (var b = this.unkeyedState + A.SETUP, w = t.slots, T = 0, S = t.slots.length; T < S; T++) {
var _,
E = w[T];
E.attachmentState == b && ((_ = E.data.attachmentName), (E.attachment = null == _ ? null : t.getAttachment(E.data.index, _)));
}
return (this.unkeyedState += 2), this.queue.drain(), n;
}),
(A.prototype.applyMixingFrom = function (t, e, i) {
var n = t.mixingFrom;
null != n.mixingFrom && this.applyMixingFrom(n, e, i);
var s = 0;
0 == t.mixDuration ? ((s = 1), i == P.MixBlend.first && (i = P.MixBlend.setup)) : (1 < (s = t.mixTime / t.mixDuration) && (s = 1), i != P.MixBlend.first && (i = n.mixBlend));
var r = s < n.eventThreshold ? this.events : null,
o = s < n.attachmentThreshold,
a = s < n.drawOrderThreshold,
h = n.animationLast,
l = n.getAnimationTime(),
u = n.animation.timelines.length,
c = n.animation.timelines,
d = n.alpha * t.interruptAlpha,
f = d * (1 - s);
if (i == P.MixBlend.add) for (var p = 0; p < u; p++) c[p].apply(e, h, l, r, f, i, P.MixDirection.mixOut);
else {
var g = n.timelineMode,
v = n.timelineHoldMix,
y = 0 == n.timelinesRotation.length;
y && P.Utils.setArraySize(n.timelinesRotation, u << 1, null);
var m = n.timelinesRotation;
for (p = n.totalAlpha = 0; p < u; p++) {
var x = c[p],
b = P.MixDirection.mixOut,
w = void 0,
T = 0;
switch (g[p]) {
case A.SUBSEQUENT:
if (!a && x instanceof P.DrawOrderTimeline) continue;
(w = i), (T = f);
break;
case A.FIRST:
(w = P.MixBlend.setup), (T = f);
break;
case A.HOLD_SUBSEQUENT:
(w = i), (T = d);
break;
case A.HOLD_FIRST:
(w = P.MixBlend.setup), (T = d);
break;
default:
w = P.MixBlend.setup;
var S = v[p];
T = d * Math.max(0, 1 - S.mixTime / S.mixDuration);
}
(n.totalAlpha += T),
x instanceof P.RotateTimeline
? this.applyRotateTimeline(x, e, l, T, w, m, p << 1, y)
: x instanceof P.AttachmentTimeline
? this.applyAttachmentTimeline(x, e, l, w, o)
: (P.Utils.webkit602BugfixHelper(T, i), a && x instanceof P.DrawOrderTimeline && w == P.MixBlend.setup && (b = P.MixDirection.mixIn), x.apply(e, h, l, r, T, w, b));
}
}
return 0 < t.mixDuration && this.queueEvents(n, l), (this.events.length = 0), (n.nextAnimationLast = l), (n.nextTrackLast = n.trackTime), s;
}),
(A.prototype.applyAttachmentTimeline = function (t, e, i, n, s) {
var r,
o,
a = e.slots[t.slotIndex];
a.bone.active &&
(i < (r = t.frames)[0]
? (n != P.MixBlend.setup && n != P.MixBlend.first) || this.setAttachment(e, a, a.data.attachmentName, s)
: ((o = i >= r[r.length - 1] ? r.length - 1 : P.Animation.binarySearch(r, i) - 1), this.setAttachment(e, a, t.attachmentNames[o], s)),
a.attachmentState <= this.unkeyedState && (a.attachmentState = this.unkeyedState + A.SETUP));
}),
(A.prototype.setAttachment = function (t, e, i, n) {
(e.attachment = null == i ? null : t.getAttachment(e.data.index, i)), n && (e.attachmentState = this.unkeyedState + A.CURRENT);
}),
(A.prototype.applyRotateTimeline = function (t, e, i, n, s, r, o, a) {
if ((a && (r[o] = 0), 1 != n)) {
var h = t,
l = h.frames,
u = e.bones[h.boneIndex];
if (u.active) {
var c = 0,
d = 0;
if (i < l[0])
switch (s) {
case P.MixBlend.setup:
u.rotation = u.data.rotation;
default:
return;
case P.MixBlend.first:
(c = u.rotation), (d = u.data.rotation);
}
else {
var f, p, g, v;
c = s == P.MixBlend.setup ? u.data.rotation : u.rotation;
i >= l[l.length - P.RotateTimeline.ENTRIES]
? (d = u.data.rotation + l[l.length + P.RotateTimeline.PREV_ROTATION])
: ((p = l[(f = P.Animation.binarySearch(l, i, P.RotateTimeline.ENTRIES)) + P.RotateTimeline.PREV_ROTATION]),
(g = l[f]),
(v = h.getCurvePercent((f >> 1) - 1, 1 - (i - g) / (l[f + P.RotateTimeline.PREV_TIME] - g))),
(d = l[f + P.RotateTimeline.ROTATION] - p),
(d = p + (d -= 360 * (16384 - ((16384.499999999996 - d / 360) | 0))) * v + u.data.rotation),
(d -= 360 * (16384 - ((16384.499999999996 - d / 360) | 0))));
}
var y,
m,
x,
b,
w = 0,
T = d - c;
0 == (T -= 360 * (16384 - ((16384.499999999996 - T / 360) | 0)))
? (w = r[o])
: ((y = 0),
(m = a ? ((y = 0), T) : ((y = r[o]), r[o + 1])),
(x = 0 < T),
(b = 0 <= y),
P.MathUtils.signum(m) != P.MathUtils.signum(T) && Math.abs(m) <= 90 && (180 < Math.abs(y) && (y += 360 * P.MathUtils.signum(y)), (b = x)),
(w = T + y - (y % 360)),
b != x && (w += 360 * P.MathUtils.signum(y)),
(r[o] = w)),
(r[o + 1] = T),
(c += w * n),
(u.rotation = c - 360 * (16384 - ((16384.499999999996 - c / 360) | 0)));
}
} else t.apply(e, 0, i, null, 1, s, P.MixDirection.mixIn);
}),
(A.prototype.queueEvents = function (t, e) {
for (var i = t.animationStart, n = t.animationEnd, s = n - i, r = t.trackLast % s, o = this.events, a = 0, h = o.length; a < h; a++) {
var l = o[a];
if (l.time < r) break;
l.time > n || this.queue.event(t, l);
}
for ((t.loop ? 0 == s || r > t.trackTime % s : n <= e && t.animationLast < n) && this.queue.complete(t); a < h; a++) o[a].time < i || this.queue.event(t, o[a]);
}),
(A.prototype.clearTracks = function () {
var t = this.queue.drainDisabled;
this.queue.drainDisabled = !0;
for (var e = 0, i = this.tracks.length; e < i; e++) this.clearTrack(e);
(this.tracks.length = 0), (this.queue.drainDisabled = t), this.queue.drain();
}),
(A.prototype.clearTrack = function (t) {
if (!(t >= this.tracks.length)) {
var e = this.tracks[t];
if (null != e) {
this.queue.end(e), this.disposeNext(e);
for (var i = e; ; ) {
var n = i.mixingFrom;
if (null == n) break;
this.queue.end(n), (i.mixingFrom = null), (i.mixingTo = null), (i = n);
}
(this.tracks[e.trackIndex] = null), this.queue.drain();
}
}
}),
(A.prototype.setCurrent = function (t, e, i) {
var n = this.expandToIndex(t);
(this.tracks[t] = e),
null != n &&
(i && this.queue.interrupt(n),
(((e.mixingFrom = n).mixingTo = e).mixTime = 0),
null != n.mixingFrom && 0 < n.mixDuration && (e.interruptAlpha *= Math.min(1, n.mixTime / n.mixDuration)),
(n.timelinesRotation.length = 0)),
this.queue.start(e);
}),
(A.prototype.setAnimation = function (t, e, i) {
var n = this.data.skeletonData.findAnimation(e);
if (null == n) throw new Error("Animation not found: " + e);
return this.setAnimationWith(t, n, i);
}),
(A.prototype.setAnimationWith = function (t, e, i) {
if (null == e) throw new Error("animation cannot be null.");
var n = !0,
s = this.expandToIndex(t);
null != s && (-1 == s.nextTrackLast ? ((this.tracks[t] = s.mixingFrom), this.queue.interrupt(s), this.queue.end(s), this.disposeNext(s), (s = s.mixingFrom), (n = !1)) : this.disposeNext(s));
var r = this.trackEntry(t, e, i, s);
return this.setCurrent(t, r, n), this.queue.drain(), r;
}),
(A.prototype.addAnimation = function (t, e, i, n) {
var s = this.data.skeletonData.findAnimation(e);
if (null == s) throw new Error("Animation not found: " + e);
return this.addAnimationWith(t, s, i, n);
}),
(A.prototype.addAnimationWith = function (t, e, i, n) {
if (null == e) throw new Error("animation cannot be null.");
var s = this.expandToIndex(t);
if (null != s) for (; null != s.next; ) s = s.next;
var r,
o = this.trackEntry(t, e, i, s);
return (
null == s
? (this.setCurrent(t, o, !0), this.queue.drain())
: ((s.next = o),
n <= 0 &&
(0 != (r = s.animationEnd - s.animationStart)
? (s.loop ? (n += r * (1 + ((s.trackTime / r) | 0))) : (n += Math.max(r, s.trackTime)), (n -= this.data.getMix(s.animation, e)))
: (n = s.trackTime))),
(o.delay = n),
o
);
}),
(A.prototype.setEmptyAnimation = function (t, e) {
var i = this.setAnimationWith(t, A.emptyAnimation, !1);
return (i.mixDuration = e), (i.trackEnd = e), i;
}),
(A.prototype.addEmptyAnimation = function (t, e, i) {
i <= 0 && (i -= e);
var n = this.addAnimationWith(t, A.emptyAnimation, !1, i);
return (n.mixDuration = e), (n.trackEnd = e), n;
}),
(A.prototype.setEmptyAnimations = function (t) {
var e = this.queue.drainDisabled;
this.queue.drainDisabled = !0;
for (var i = 0, n = this.tracks.length; i < n; i++) {
var s = this.tracks[i];
null != s && this.setEmptyAnimation(s.trackIndex, t);
}
(this.queue.drainDisabled = e), this.queue.drain();
}),
(A.prototype.expandToIndex = function (t) {
return t < this.tracks.length ? this.tracks[t] : (P.Utils.ensureArrayCapacity(this.tracks, t + 1, null), (this.tracks.length = t + 1), null);
}),
(A.prototype.trackEntry = function (t, e, i, n) {
var s = this.trackEntryPool.obtain();
return (
(s.trackIndex = t),
(s.animation = e),
(s.loop = i),
(s.holdPrevious = !1),
(s.eventThreshold = 0),
(s.attachmentThreshold = 0),
(s.drawOrderThreshold = 0),
(s.animationStart = 0),
(s.animationEnd = e.duration),
(s.animationLast = -1),
(s.nextAnimationLast = -1),
(s.delay = 0),
(s.trackTime = 0),
(s.trackLast = -1),
(s.nextTrackLast = -1),
(s.trackEnd = Number.MAX_VALUE),
(s.timeScale = 1),
(s.alpha = 1),
(s.interruptAlpha = 1),
(s.mixTime = 0),
(s.mixDuration = null == n ? 0 : this.data.getMix(n.animation, e)),
(s.mixBlend = P.MixBlend.replace),
s
);
}),
(A.prototype.disposeNext = function (t) {
for (var e = t.next; null != e; ) this.queue.dispose(e), (e = e.next);
t.next = null;
}),
(A.prototype._animationsChanged = function () {
(this.animationsChanged = !1), this.propertyIDs.clear();
for (var t = 0, e = this.tracks.length; t < e; t++) {
var i = this.tracks[t];
if (null != i) {
for (; null != i.mixingFrom; ) i = i.mixingFrom;
for (; (null != i.mixingFrom && i.mixBlend == P.MixBlend.add) || this.computeHold(i), null != (i = i.mixingTo); );
}
}
}),
(A.prototype.computeHold = function (t) {
var e = t.mixingTo,
i = t.animation.timelines,
n = t.animation.timelines.length,
s = P.Utils.setArraySize(t.timelineMode, n);
t.timelineHoldMix.length = 0;
var r = P.Utils.setArraySize(t.timelineHoldMix, n),
o = this.propertyIDs;
if (null != e && e.holdPrevious) for (var a = 0; a < n; a++) s[a] = o.add(i[a].getPropertyId()) ? A.HOLD_FIRST : A.HOLD_SUBSEQUENT;
else
t: for (a = 0; a < n; a++) {
var h = i[a],
l = h.getPropertyId();
if (o.add(l))
if (null == e || h instanceof P.AttachmentTimeline || h instanceof P.DrawOrderTimeline || h instanceof P.EventTimeline || !e.animation.hasTimeline(l)) s[a] = A.FIRST;
else {
for (var u = e.mixingTo; null != u; u = u.mixingTo)
if (!u.animation.hasTimeline(l)) {
if (0 < t.mixDuration) {
(s[a] = A.HOLD_MIX), (r[a] = u);
continue t;
}
break;
}
s[a] = A.HOLD_FIRST;
}
else s[a] = A.SUBSEQUENT;
}
}),
(A.prototype.getCurrent = function (t) {
return t >= this.tracks.length ? null : this.tracks[t];
}),
(A.prototype.addListener = function (t) {
if (null == t) throw new Error("listener cannot be null.");
this.listeners.push(t);
}),
(A.prototype.removeListener = function (t) {
var e = this.listeners.indexOf(t);
0 <= e && this.listeners.splice(e, 1);
}),
(A.prototype.clearListeners = function () {
this.listeners.length = 0;
}),
(A.prototype.clearListenerNotifications = function () {
this.queue.clear();
}),
(A.emptyAnimation = new P.Animation("", [], 0)),
(A.SUBSEQUENT = 0),
(A.FIRST = 1),
(A.HOLD_SUBSEQUENT = 2),
(A.HOLD_FIRST = 3),
(A.HOLD_MIX = 4),
(A.SETUP = 1),
(A.CURRENT = 2),
A);
function A(t) {
(this.tracks = new Array()),
(this.timeScale = 1),
(this.unkeyedState = 0),
(this.events = new Array()),
(this.listeners = new Array()),
(this.queue = new s(this)),
(this.propertyIDs = new P.IntSet()),
(this.animationsChanged = !1),
(this.trackEntryPool = new P.Pool(function () {
return new e();
})),
(this.data = t);
}
P.AnimationState = t;
var e =
((i.prototype.reset = function () {
(this.next = null),
(this.mixingFrom = null),
(this.mixingTo = null),
(this.animation = null),
(this.listener = null),
(this.timelineMode.length = 0),
(this.timelineHoldMix.length = 0),
(this.timelinesRotation.length = 0);
}),
(i.prototype.getAnimationTime = function () {
if (this.loop) {
var t = this.animationEnd - this.animationStart;
return 0 == t ? this.animationStart : (this.trackTime % t) + this.animationStart;
}
return Math.min(this.trackTime + this.animationStart, this.animationEnd);
}),
(i.prototype.setAnimationLast = function (t) {
(this.animationLast = t), (this.nextAnimationLast = t);
}),
(i.prototype.isComplete = function () {
return this.trackTime >= this.animationEnd - this.animationStart;
}),
(i.prototype.resetRotationDirections = function () {
this.timelinesRotation.length = 0;
}),
i);
function i() {
(this.mixBlend = P.MixBlend.replace), (this.timelineMode = new Array()), (this.timelineHoldMix = new Array()), (this.timelinesRotation = new Array());
}
P.TrackEntry = e;
var a,
n,
s =
((r.prototype.start = function (t) {
this.objects.push(a.start), this.objects.push(t), (this.animState.animationsChanged = !0);
}),
(r.prototype.interrupt = function (t) {
this.objects.push(a.interrupt), this.objects.push(t);
}),
(r.prototype.end = function (t) {
this.objects.push(a.end), this.objects.push(t), (this.animState.animationsChanged = !0);
}),
(r.prototype.dispose = function (t) {
this.objects.push(a.dispose), this.objects.push(t);
}),
(r.prototype.complete = function (t) {
this.objects.push(a.complete), this.objects.push(t);
}),
(r.prototype.event = function (t, e) {
this.objects.push(a.event), this.objects.push(t), this.objects.push(e);
}),
(r.prototype.drain = function () {
if (!this.drainDisabled) {
this.drainDisabled = !0;
for (var t = this.objects, e = this.animState.listeners, i = 0; i < t.length; i += 2) {
var n = t[i],
s = t[i + 1];
switch (n) {
case a.start:
null != s.listener && s.listener.start && s.listener.start(s);
for (var r = 0; r < e.length; r++) e[r].start && e[r].start(s);
break;
case a.interrupt:
for (null != s.listener && s.listener.interrupt && s.listener.interrupt(s), r = 0; r < e.length; r++) e[r].interrupt && e[r].interrupt(s);
break;
case a.end:
for (null != s.listener && s.listener.end && s.listener.end(s), r = 0; r < e.length; r++) e[r].end && e[r].end(s);
case a.dispose:
for (null != s.listener && s.listener.dispose && s.listener.dispose(s), r = 0; r < e.length; r++) e[r].dispose && e[r].dispose(s);
this.animState.trackEntryPool.free(s);
break;
case a.complete:
for (null != s.listener && s.listener.complete && s.listener.complete(s), r = 0; r < e.length; r++) e[r].complete && e[r].complete(s);
break;
case a.event:
var o = t[2 + i++];
for (null != s.listener && s.listener.event && s.listener.event(s, o), r = 0; r < e.length; r++) e[r].event && e[r].event(s, o);
}
}
this.clear(), (this.drainDisabled = !1);
}
}),
(r.prototype.clear = function () {
this.objects.length = 0;
}),
r);
function r(t) {
(this.objects = []), (this.drainDisabled = !1), (this.animState = t);
}
(P.EventQueue = s),
((n = a = P.EventType || (P.EventType = {}))[(n.start = 0)] = "start"),
(n[(n.interrupt = 1)] = "interrupt"),
(n[(n.end = 2)] = "end"),
(n[(n.dispose = 3)] = "dispose"),
(n[(n.complete = 4)] = "complete"),
(n[(n.event = 5)] = "event");
var o =
((h.prototype.start = function (t) {}),
(h.prototype.interrupt = function (t) {}),
(h.prototype.end = function (t) {}),
(h.prototype.dispose = function (t) {}),
(h.prototype.complete = function (t) {}),
(h.prototype.event = function (t, e) {}),
h);
function h() {}
P.AnimationStateAdapter = o;
})((ge = ge || {})),
(t = ge = ge || {}),
(me.prototype.setMix = function (t, e, i) {
var n = this.skeletonData.findAnimation(t);
if (null == n) throw new Error("Animation not found: " + t);
var s = this.skeletonData.findAnimation(e);
if (null == s) throw new Error("Animation not found: " + e);
this.setMixWith(n, s, i);
}),
(me.prototype.setMixWith = function (t, e, i) {
if (null == t) throw new Error("from cannot be null.");
if (null == e) throw new Error("to cannot be null.");
var n = t.name + "." + e.name;
this.animationToMixTime[n] = i;
}),
(me.prototype.getMix = function (t, e) {
var i = t.name + "." + e.name,
n = this.animationToMixTime[i];
return void 0 === n ? this.defaultMix : n;
}),
(e = me),
(t.AnimationStateData = e),
(f = ge = ge || {}),
(xe.prototype.downloadText = function (t, e, i) {
var n = new XMLHttpRequest();
n.overrideMimeType("text/html"),
this.rawDataUris[t] && (t = this.rawDataUris[t]),
n.open("GET", t, !0),
(n.onload = function () {
200 == n.status ? e(n.responseText) : i(n.status, n.responseText);
}),
(n.onerror = function () {
i(n.status, n.responseText);
}),
n.send();
}),
(xe.prototype.downloadBinary = function (t, e, i) {
var n = new XMLHttpRequest();
this.rawDataUris[t] && (t = this.rawDataUris[t]),
n.open("GET", t, !0),
(n.responseType = "arraybuffer"),
(n.onload = function () {
200 == n.status ? e(new Uint8Array(n.response)) : i(n.status, n.responseText);
}),
(n.onerror = function () {
i(n.status, n.responseText);
}),
n.send();
}),
(xe.prototype.setRawDataURI = function (t, e) {
this.rawDataUris[this.pathPrefix + t] = e;
}),
(xe.prototype.loadBinary = function (i, e, n) {
var s = this;
void 0 === e && (e = null),
void 0 === n && (n = null),
(i = this.pathPrefix + i),
this.toLoad++,
this.downloadBinary(
i,
function (t) {
(s.assets[i] = t), e && e(i, t), s.toLoad--, s.loaded++;
},
function (t, e) {
(s.errors[i] = "Couldn't load binary " + i + ": status " + status + ", " + e), n && n(i, "Couldn't load binary " + i + ": status " + status + ", " + e), s.toLoad--, s.loaded++;
}
);
}),
(xe.prototype.loadText = function (i, e, n) {
var s = this;
void 0 === e && (e = null),
void 0 === n && (n = null),
(i = this.pathPrefix + i),
this.toLoad++,
this.downloadText(
i,
function (t) {
(s.assets[i] = t), e && e(i, t), s.toLoad--, s.loaded++;
},
function (t, e) {
(s.errors[i] = "Couldn't load text " + i + ": status " + status + ", " + e), n && n(i, "Couldn't load text " + i + ": status " + status + ", " + e), s.toLoad--, s.loaded++;
}
);
}),
(xe.prototype.loadTexture = function (i, n, e) {
var s = this;
void 0 === n && (n = null), void 0 === e && (e = null);
var r = (i = this.pathPrefix + i);
this.toLoad++;
var o = new Image();
(o.crossOrigin = "anonymous"),
(o.onload = function (t) {
var e = s.textureLoader(o);
(s.assets[r] = e), s.toLoad--, s.loaded++, n && n(i, o);
}),
(o.onerror = function (t) {
(s.errors[i] = "Couldn't load image " + i), s.toLoad--, s.loaded++, e && e(i, "Couldn't load image " + i);
}),
this.rawDataUris[i] && (i = this.rawDataUris[i]),
(o.src = i);
}),
(xe.prototype.loadTextureAtlas = function (h, l, u) {
var c = this;
void 0 === l && (l = null), void 0 === u && (u = null);
var d = 0 <= h.lastIndexOf("/") ? h.substring(0, h.lastIndexOf("/")) : "";
(h = this.pathPrefix + h),
this.toLoad++,
this.downloadText(
h,
function (r) {
var o = { count: 0 },
a = new Array();
try {
new f.TextureAtlas(r, function (t) {
a.push("" == d ? t : d + "/" + t);
var e = document.createElement("img");
return (e.width = 16), (e.height = 16), new f.FakeTexture(e);
});
} catch (e) {
var t = e;
return (c.errors[h] = "Couldn't load texture atlas " + h + ": " + t.message), u && u(h, "Couldn't load texture atlas " + h + ": " + t.message), c.toLoad--, void c.loaded++;
}
for (var e = 0, i = a; e < i.length; e++)
!(function (t) {
var s = !1;
c.loadTexture(
t,
function (t, e) {
if ((o.count++, o.count == a.length))
if (s) (c.errors[h] = "Couldn't load texture atlas page " + t + "} of atlas " + h), u && u(h, "Couldn't load texture atlas page " + t + " of atlas " + h), c.toLoad--, c.loaded++;
else
try {
var i = new f.TextureAtlas(r, function (t) {
return c.get("" == d ? t : d + "/" + t);
});
(c.assets[h] = i), l && l(h, i), c.toLoad--, c.loaded++;
} catch (t) {
var n = t;
(c.errors[h] = "Couldn't load texture atlas " + h + ": " + n.message), u && u(h, "Couldn't load texture atlas " + h + ": " + n.message), c.toLoad--, c.loaded++;
}
},
function (t, e) {
(s = !0),
o.count++,
o.count == a.length &&
((c.errors[h] = "Couldn't load texture atlas page " + t + "} of atlas " + h), u && u(h, "Couldn't load texture atlas page " + t + " of atlas " + h), c.toLoad--, c.loaded++);
}
);
})(i[e]);
},
function (t, e) {
(c.errors[h] = "Couldn't load texture atlas " + h + ": status " + status + ", " + e), u && u(h, "Couldn't load texture atlas " + h + ": status " + status + ", " + e), c.toLoad--, c.loaded++;
}
);
}),
(xe.prototype.get = function (t) {
return (t = this.pathPrefix + t), this.assets[t];
}),
(xe.prototype.remove = function (t) {
t = this.pathPrefix + t;
var e = this.assets[t];
e.dispose && e.dispose(), (this.assets[t] = null);
}),
(xe.prototype.removeAll = function () {
for (var t in this.assets) {
var e = this.assets[t];
e.dispose && e.dispose();
}
this.assets = {};
}),
(xe.prototype.isLoadingComplete = function () {
return 0 == this.toLoad;
}),
(xe.prototype.getToLoad = function () {
return this.toLoad;
}),
(xe.prototype.getLoaded = function () {
return this.loaded;
}),
(xe.prototype.dispose = function () {
this.removeAll();
}),
(xe.prototype.hasErrors = function () {
return 0 < Object.keys(this.errors).length;
}),
(xe.prototype.getErrors = function () {
return this.errors;
}),
(i = xe),
(f.AssetManager = i),
(r = ge = ge || {}),
(be.prototype.newRegionAttachment = function (t, e, i) {
var n = this.atlas.findRegion(i);
if (null == n) throw new Error("Region not found in atlas: " + i + " (region attachment: " + e + ")");
n.renderObject = n;
var s = new r.RegionAttachment(e);
return s.setRegion(n), s;
}),
(be.prototype.newMeshAttachment = function (t, e, i) {
var n = this.atlas.findRegion(i);
if (null == n) throw new Error("Region not found in atlas: " + i + " (mesh attachment: " + e + ")");
n.renderObject = n;
var s = new r.MeshAttachment(e);
return (s.region = n), s;
}),
(be.prototype.newBoundingBoxAttachment = function (t, e) {
return new r.BoundingBoxAttachment(e);
}),
(be.prototype.newPathAttachment = function (t, e) {
return new r.PathAttachment(e);
}),
(be.prototype.newPointAttachment = function (t, e) {
return new r.PointAttachment(e);
}),
(be.prototype.newClippingAttachment = function (t, e) {
return new r.ClippingAttachment(e);
}),
(s = be),
(r.AtlasAttachmentLoader = s),
((a = (o = ge = ge || {}).BlendMode || (o.BlendMode = {}))[(a.Normal = 0)] = "Normal"),
(a[(a.Additive = 1)] = "Additive"),
(a[(a.Multiply = 2)] = "Multiply"),
(a[(a.Screen = 3)] = "Screen"),
(k = ge = ge || {}),
(we.prototype.isActive = function () {
return this.active;
}),
(we.prototype.update = function () {
this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);
}),
(we.prototype.updateWorldTransform = function () {
this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);
}),
(we.prototype.updateWorldTransformWith = function (t, e, i, n, s, r, o) {
(this.ax = t), (this.ay = e), (this.arotation = i), (this.ascaleX = n), (this.ascaleY = s), (this.ashearX = r), (this.ashearY = o), (this.appliedValid = !0);
var a = this.parent;
if (null == a) {
var h = this.skeleton,
l = i + 90 + o,
u = h.scaleX,
c = h.scaleY;
return (
(this.a = k.MathUtils.cosDeg(i + r) * n * u),
(this.b = k.MathUtils.cosDeg(l) * s * u),
(this.c = k.MathUtils.sinDeg(i + r) * n * c),
(this.d = k.MathUtils.sinDeg(l) * s * c),
(this.worldX = t * u + h.x),
void (this.worldY = e * c + h.y)
);
}
var d = a.a,
f = a.b,
p = a.c,
g = a.d;
switch (((this.worldX = d * t + f * e + a.worldX), (this.worldY = p * t + g * e + a.worldY), this.data.transformMode)) {
case k.TransformMode.Normal:
l = i + 90 + o;
var v = k.MathUtils.cosDeg(i + r) * n,
y = k.MathUtils.cosDeg(l) * s,
m = k.MathUtils.sinDeg(i + r) * n,
x = k.MathUtils.sinDeg(l) * s;
return (this.a = d * v + f * m), (this.b = d * y + f * x), (this.c = p * v + g * m), void (this.d = p * y + g * x);
case k.TransformMode.OnlyTranslation:
(l = i + 90 + o), (this.a = k.MathUtils.cosDeg(i + r) * n), (this.b = k.MathUtils.cosDeg(l) * s), (this.c = k.MathUtils.sinDeg(i + r) * n), (this.d = k.MathUtils.sinDeg(l) * s);
break;
case k.TransformMode.NoRotationOrReflection:
var b,
w =
i +
r -
(b =
1e-4 < (S = d * d + p * p)
? ((S = Math.abs(d * g - f * p) / S), (d /= this.skeleton.scaleX), (f = (p /= this.skeleton.scaleY) * S), (g = d * S), Math.atan2(p, d) * k.MathUtils.radDeg)
: ((p = d = 0), 90 - Math.atan2(g, f) * k.MathUtils.radDeg)),
T = i + o - b + 90;
(v = k.MathUtils.cosDeg(w) * n), (y = k.MathUtils.cosDeg(T) * s), (m = k.MathUtils.sinDeg(w) * n), (x = k.MathUtils.sinDeg(T) * s);
(this.a = d * v - f * m), (this.b = d * y - f * x), (this.c = p * v + g * m), (this.d = p * y + g * x);
break;
case k.TransformMode.NoScale:
case k.TransformMode.NoScaleOrReflection:
var S,
_ = k.MathUtils.cosDeg(i),
E = k.MathUtils.sinDeg(i),
P = (d * _ + f * E) / this.skeleton.scaleX,
A = (p * _ + g * E) / this.skeleton.scaleY;
1e-5 < (S = Math.sqrt(P * P + A * A)) && (S = 1 / S),
(P *= S),
(A *= S),
(S = Math.sqrt(P * P + A * A)),
this.data.transformMode == k.TransformMode.NoScale && d * g - f * p < 0 != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0) && (S = -S);
var M = Math.PI / 2 + Math.atan2(A, P),
C = Math.cos(M) * S,
O = Math.sin(M) * S;
(v = k.MathUtils.cosDeg(r) * n), (y = k.MathUtils.cosDeg(90 + o) * s), (m = k.MathUtils.sinDeg(r) * n), (x = k.MathUtils.sinDeg(90 + o) * s);
(this.a = P * v + C * m), (this.b = P * y + C * x), (this.c = A * v + O * m), (this.d = A * y + O * x);
}
(this.a *= this.skeleton.scaleX), (this.b *= this.skeleton.scaleX), (this.c *= this.skeleton.scaleY), (this.d *= this.skeleton.scaleY);
}),
(we.prototype.setToSetupPose = function () {
var t = this.data;
(this.x = t.x), (this.y = t.y), (this.rotation = t.rotation), (this.scaleX = t.scaleX), (this.scaleY = t.scaleY), (this.shearX = t.shearX), (this.shearY = t.shearY);
}),
(we.prototype.getWorldRotationX = function () {
return Math.atan2(this.c, this.a) * k.MathUtils.radDeg;
}),
(we.prototype.getWorldRotationY = function () {
return Math.atan2(this.d, this.b) * k.MathUtils.radDeg;
}),
(we.prototype.getWorldScaleX = function () {
return Math.sqrt(this.a * this.a + this.c * this.c);
}),
(we.prototype.getWorldScaleY = function () {
return Math.sqrt(this.b * this.b + this.d * this.d);
}),
(we.prototype.updateAppliedTransform = function () {
this.appliedValid = !0;
var t = this.parent;
if (null == t)
return (
(this.ax = this.worldX),
(this.ay = this.worldY),
(this.arotation = Math.atan2(this.c, this.a) * k.MathUtils.radDeg),
(this.ascaleX = Math.sqrt(this.a * this.a + this.c * this.c)),
(this.ascaleY = Math.sqrt(this.b * this.b + this.d * this.d)),
(this.ashearX = 0),
void (this.ashearY = Math.atan2(this.a * this.b + this.c * this.d, this.a * this.d - this.b * this.c) * k.MathUtils.radDeg)
);
var e = t.a,
i = t.b,
n = t.c,
s = t.d,
r = 1 / (e * s - i * n),
o = this.worldX - t.worldX,
a = this.worldY - t.worldY;
(this.ax = o * s * r - a * i * r), (this.ay = a * e * r - o * n * r);
var h,
l = r * s,
u = r * e,
c = r * i,
d = r * n,
f = l * this.a - c * this.c,
p = l * this.b - c * this.d,
g = u * this.c - d * this.a,
v = u * this.d - d * this.b;
(this.ashearX = 0),
(this.ascaleX = Math.sqrt(f * f + g * g)),
1e-4 < this.ascaleX
? ((h = f * v - p * g), (this.ascaleY = h / this.ascaleX), (this.ashearY = Math.atan2(f * p + g * v, h) * k.MathUtils.radDeg), (this.arotation = Math.atan2(g, f) * k.MathUtils.radDeg))
: ((this.ascaleX = 0), (this.ascaleY = Math.sqrt(p * p + v * v)), (this.ashearY = 0), (this.arotation = 90 - Math.atan2(v, p) * k.MathUtils.radDeg));
}),
(we.prototype.worldToLocal = function (t) {
var e = this.a,
i = this.b,
n = this.c,
s = this.d,
r = 1 / (e * s - i * n),
o = t.x - this.worldX,
a = t.y - this.worldY;
return (t.x = o * s * r - a * i * r), (t.y = a * e * r - o * n * r), t;
}),
(we.prototype.localToWorld = function (t) {
var e = t.x,
i = t.y;
return (t.x = e * this.a + i * this.b + this.worldX), (t.y = e * this.c + i * this.d + this.worldY), t;
}),
(we.prototype.worldToLocalRotation = function (t) {
var e = k.MathUtils.sinDeg(t),
i = k.MathUtils.cosDeg(t);
return Math.atan2(this.a * e - this.c * i, this.d * i - this.b * e) * k.MathUtils.radDeg + this.rotation - this.shearX;
}),
(we.prototype.localToWorldRotation = function (t) {
t -= this.rotation - this.shearX;
var e = k.MathUtils.sinDeg(t),
i = k.MathUtils.cosDeg(t);
return Math.atan2(i * this.c + e * this.d, i * this.a + e * this.b) * k.MathUtils.radDeg;
}),
(we.prototype.rotateWorld = function (t) {
var e = this.a,
i = this.b,
n = this.c,
s = this.d,
r = k.MathUtils.cosDeg(t),
o = k.MathUtils.sinDeg(t);
(this.a = r * e - o * n), (this.b = r * i - o * s), (this.c = o * e + r * n), (this.d = o * i + r * s), (this.appliedValid = !1);
}),
(h = we),
(k.Bone = h),
((l = ge = ge || {}).BoneData = function (t, e, i) {
if (
((this.x = 0),
(this.y = 0),
(this.rotation = 0),
(this.scaleX = 1),
(this.scaleY = 1),
(this.shearX = 0),
(this.shearY = 0),
(this.transformMode = u.Normal),
(this.skinRequired = !1),
(this.color = new l.Color()),
t < 0)
)
throw new Error("index must be >= 0.");
if (null == e) throw new Error("name cannot be null.");
(this.index = t), (this.name = e), (this.parent = i);
}),
((c = u = l.TransformMode || (l.TransformMode = {}))[(c.Normal = 0)] = "Normal"),
(c[(c.OnlyTranslation = 1)] = "OnlyTranslation"),
(c[(c.NoRotationOrReflection = 2)] = "NoRotationOrReflection"),
(c[(c.NoScale = 3)] = "NoScale"),
(c[(c.NoScaleOrReflection = 4)] = "NoScaleOrReflection"),
((ge || (ge = {})).ConstraintData = function (t, e, i) {
(this.name = t), (this.order = e), (this.skinRequired = i);
}),
((ge || (ge = {})).Event = function (t, e) {
if (null == e) throw new Error("data cannot be null.");
(this.time = t), (this.data = e);
}),
((ge || (ge = {})).EventData = function (t) {
this.name = t;
}),
(ht = ge = ge || {}),
(Te.prototype.isActive = function () {
return this.active;
}),
(Te.prototype.apply = function () {
this.update();
}),
(Te.prototype.update = function () {
var t = this.target,
e = this.bones;
switch (e.length) {
case 1:
this.apply1(e[0], t.worldX, t.worldY, this.compress, this.stretch, this.data.uniform, this.mix);
break;
case 2:
this.apply2(e[0], e[1], t.worldX, t.worldY, this.bendDirection, this.stretch, this.softness, this.mix);
}
}),
(Te.prototype.apply1 = function (t, e, i, n, s, r, o) {
t.appliedValid || t.updateAppliedTransform();
var a = t.parent,
h = a.a,
l = a.b,
u = a.c,
c = a.d,
d = -t.ashearX - t.arotation,
f = 0,
p = 0;
switch (t.data.transformMode) {
case ht.TransformMode.OnlyTranslation:
(f = e - t.worldX), (p = i - t.worldY);
break;
case ht.TransformMode.NoRotationOrReflection:
var g = Math.abs(h * c - l * u) / (h * h + u * u),
v = h / t.skeleton.scaleX,
y = u / t.skeleton.scaleY;
(l = -y * g * t.skeleton.scaleX), (c = v * g * t.skeleton.scaleY);
d += Math.atan2(y, v) * ht.MathUtils.radDeg;
default:
var m = e - a.worldX,
x = i - a.worldY,
b = h * c - l * u;
(f = (m * c - x * l) / b - t.ax), (p = (x * h - m * u) / b - t.ay);
}
(d += Math.atan2(p, f) * ht.MathUtils.radDeg), t.ascaleX < 0 && (d += 180), 180 < d ? (d -= 360) : d < -180 && (d += 360);
var w = t.ascaleX,
T = t.ascaleY;
if (n || s) {
switch (t.data.transformMode) {
case ht.TransformMode.NoScale:
case ht.TransformMode.NoScaleOrReflection:
(f = e - t.worldX), (p = i - t.worldY);
}
var S = t.data.length * w,
_ = Math.sqrt(f * f + p * p);
((n && _ < S) || (s && S < _ && 1e-4 < S)) && ((w *= g = (_ / S - 1) * o + 1), r && (T *= g));
}
t.updateWorldTransformWith(t.ax, t.ay, t.arotation + d * o, w, T, t.ashearX, t.ashearY);
}),
(Te.prototype.apply2 = function (t, e, i, n, s, r, o, a) {
if (0 != a) {
t.appliedValid || t.updateAppliedTransform(), e.appliedValid || e.updateAppliedTransform();
var h,
l = t.ax,
u = t.ay,
c = t.ascaleX,
d = c,
f = t.ascaleY,
p = e.ascaleX,
g = 0,
v = 0;
v = c < 0 ? ((c = -c), (g = 180), -1) : ((g = 0), 1);
f < 0 && ((f = -f), (v = -v)), (h = p < 0 ? ((p = -p), 180) : 0);
var y = e.ax,
m = 0,
x = 0,
b = t.a,
w = t.b,
T = t.c,
S = t.d,
_ = Math.abs(c - f) <= 1e-4,
E = _ ? ((x = b * y + w * (m = e.ay) + t.worldX), T * y + S * m + t.worldY) : ((m = 0), (x = b * y + t.worldX), T * y + t.worldY),
P = t.parent;
(b = P.a), (w = P.b);
T = P.c;
var A,
M = 1 / (b * (S = P.d) - w * T),
C = x - P.worldX,
O = E - P.worldY,
k = (C * S - O * w) * M - l,
R = (O * b - C * T) * M - u,
L = Math.sqrt(k * k + R * R),
I = e.data.length * p;
if (L < 1e-4) return this.apply1(t, i, n, !1, r, !1, a), void e.updateWorldTransformWith(y, m, 0, e.ascaleX, e.ascaleY, e.ashearX, e.ashearY);
var D,
F,
B,
N = ((C = i - P.worldX) * S - (O = n - P.worldY) * w) * M - l,
U = (O * b - C * T) * M - u,
Y = N * N + U * U;
0 != o && ((o *= (c * (p + 1)) / 2), 0 < (F = (D = Math.sqrt(Y)) - L - I * c + o) && (Y = (N -= (B = (F - o * (1 - (B = Math.min(1, F / (2 * o)) - 1) * B)) / D) * N) * N + (U -= B * U) * U));
t: if (_) {
var z = (Y - L * L - (I *= c) * I) / (2 * L * I);
z < -1 ? (z = -1) : 1 < z && ((z = 1), r && (d *= (Math.sqrt(Y) / (L + I) - 1) * a + 1)), (A = Math.acos(z) * s), (b = L + I * z), (w = I * Math.sin(A)), (rt = Math.atan2(U * b - N * w, N * b + U * w));
} else {
var X = (b = c * I) * b,
V = (w = f * I) * w,
G = Math.atan2(U, N),
j = -2 * V * L,
H = V - X;
if (0 <= (S = j * j - 4 * H * (T = V * L * L + X * Y - X * V))) {
var W = Math.sqrt(S);
j < 0 && (W = -W);
var K = (W = -(j + W) / 2) / H,
q = T / W,
Z = Math.abs(K) < Math.abs(q) ? K : q;
if (Z * Z <= Y) {
(O = Math.sqrt(Y - Z * Z) * s), (rt = G - Math.atan2(O, Z)), (A = Math.atan2(O / f, (Z - L) / c));
break t;
}
}
var J = ht.MathUtils.PI,
Q = L - b,
$ = Q * Q,
tt = 0,
et = 0,
it = L + b,
nt = it * it,
st = 0;
-1 <= (T = (-b * L) / (X - V)) &&
T <= 1 &&
((T = Math.acos(T)), (S = (C = b * Math.cos(T) + L) * C + (O = w * Math.sin(T)) * O) < $ && ((J = T), ($ = S), (Q = C), (tt = O)), nt < S && ((et = T), (nt = S), (it = C), (st = O))),
(A = Y <= ($ + nt) / 2 ? ((rt = G - Math.atan2(tt * s, Q)), J * s) : ((rt = G - Math.atan2(st * s, it)), et * s));
}
var rt,
ot = Math.atan2(m, y) * v,
at = t.arotation;
180 < (rt = (rt - ot) * ht.MathUtils.radDeg + g - at) ? (rt -= 360) : rt < -180 && (rt += 360),
t.updateWorldTransformWith(l, u, at + rt * a, d, t.ascaleY, 0, 0),
(at = e.arotation),
180 < (A = ((A + ot) * ht.MathUtils.radDeg - e.ashearX) * v + h - at) ? (A -= 360) : A < -180 && (A += 360),
e.updateWorldTransformWith(y, m, at + A * a, e.ascaleX, e.ascaleY, e.ashearX, e.ashearY);
} else e.updateWorldTransform();
}),
(d = Te),
(ht.IkConstraint = d),
(p = ge = ge || {}),
(g = p.ConstraintData),
ye(Se, g),
(v = Se),
(p.IkConstraintData = v),
(K = ge = ge || {}),
(_e.prototype.isActive = function () {
return this.active;
}),
(_e.prototype.apply = function () {
this.update();
}),
(_e.prototype.update = function () {
var t = this.target.getAttachment();
if (t instanceof K.PathAttachment) {
var e = this.rotateMix,
i = this.translateMix,
n = 0 < e;
if (0 < i || n) {
var s = this.data,
r = s.spacingMode == K.SpacingMode.Percent,
o = s.rotateMode,
a = o == K.RotateMode.Tangent,
h = o == K.RotateMode.ChainScale,
l = this.bones.length,
u = a ? l : l + 1,
c = this.bones,
d = K.Utils.setArraySize(this.spaces, u),
f = null,
p = this.spacing;
if (h || !r) {
h && (f = K.Utils.setArraySize(this.lengths, l));
for (var g = s.spacingMode == K.SpacingMode.Length, v = 0, y = u - 1; v < y; ) {
var m,
x,
b = (P = c[v]).data.length;
b < _e.epsilon
? (h && (f[v] = 0), (d[++v] = 0))
: r
? (h && ((M = b * P.a), (C = b * P.c), (m = Math.sqrt(M * M + C * C)), (f[v] = m)), (d[++v] = p))
: ((M = b * P.a), (C = b * P.c), (x = Math.sqrt(M * M + C * C)), h && (f[v] = x), (d[++v] = ((g ? b + p : p) * x) / b));
}
} else for (v = 1; v < u; v++) d[v] = p;
var w = this.computeWorldPositions(t, u, a, s.positionMode == K.PositionMode.Percent, r),
T = w[0],
S = w[1],
_ = s.offsetRotation,
E = !1;
0 == _ ? (E = o == K.RotateMode.Chain) : ((E = !1), (_ *= 0 < (A = this.target.bone).a * A.d - A.b * A.c ? K.MathUtils.degRad : -K.MathUtils.degRad));
v = 0;
for (var P, A = 3; v < l; v++, A += 3) {
((P = c[v]).worldX += (T - P.worldX) * i), (P.worldY += (S - P.worldY) * i);
var M,
C,
O,
k,
R,
L,
I,
D,
F,
B,
N,
U,
Y = (M = w[A]) - T,
z = (C = w[A + 1]) - S;
!h || (0 != (O = f[v]) && ((k = (Math.sqrt(Y * Y + z * z) / O - 1) * e + 1), (P.a *= k), (P.c *= k))),
(T = M),
(S = C),
n &&
((R = P.a),
(L = P.b),
(I = P.c),
(D = P.d),
(B = F = U = 0),
(U = a ? w[A - 1] : 0 == d[v + 1] ? w[A + 2] : Math.atan2(z, Y)),
(U -= Math.atan2(I, R)),
E ? ((F = Math.cos(U)), (B = Math.sin(U)), (T += ((N = P.data.length) * (F * R - B * I) - Y) * e), (S += (N * (B * R + F * I) - z) * e)) : (U += _),
U > K.MathUtils.PI ? (U -= K.MathUtils.PI2) : U < -K.MathUtils.PI && (U += K.MathUtils.PI2),
(U *= e),
(F = Math.cos(U)),
(B = Math.sin(U)),
(P.a = F * R - B * I),
(P.b = F * L - B * D),
(P.c = B * R + F * I),
(P.d = B * L + F * D)),
(P.appliedValid = !1);
}
}
}
}),
(_e.prototype.computeWorldPositions = function (t, e, i, n, s) {
var r = this.target,
o = this.position,
a = this.spaces,
h = K.Utils.setArraySize(this.positions, 3 * e + 2),
l = null,
u = t.closed,
c = t.worldVerticesLength,
d = c / 6,
f = _e.NONE;
if (!t.constantSpeed) {
var p = t.lengths,
g = p[(d -= u ? 1 : 2)];
if ((n && (o *= g), s)) for (var v = 1; v < e; v++) a[v] *= g;
l = K.Utils.setArraySize(this.world, 8);
v = 0;
for (var y = 0, m = 0; v < e; v++, y += 3) {
var x = (o += V = a[v]);
if (u) (x %= g) < 0 && (x += g), (m = 0);
else {
if (x < 0) {
f != _e.BEFORE && ((f = _e.BEFORE), t.computeWorldVertices(r, 2, 4, l, 0, 2)), this.addBeforePosition(x, l, 0, h, y);
continue;
}
if (g < x) {
f != _e.AFTER && ((f = _e.AFTER), t.computeWorldVertices(r, c - 6, 4, l, 0, 2)), this.addAfterPosition(x - g, l, 0, h, y);
continue;
}
}
for (; ; m++) {
var b = p[m];
if (!(b < x)) {
0 == m ? (x /= b) : (x = (x - (H = p[m - 1])) / (b - H));
break;
}
}
m != f && ((f = m), u && m == d ? (t.computeWorldVertices(r, c - 4, 4, l, 0, 2), t.computeWorldVertices(r, 0, 4, l, 4, 2)) : t.computeWorldVertices(r, 6 * m + 2, 8, l, 0, 2)),
this.addCurvePosition(x, l[0], l[1], l[2], l[3], l[4], l[5], l[6], l[7], h, y, i || (0 < v && 0 == V));
}
return h;
}
u
? ((c += 2), (l = K.Utils.setArraySize(this.world, c)), t.computeWorldVertices(r, 2, c - 4, l, 0, 2), t.computeWorldVertices(r, 0, 2, l, c - 4, 2), (l[c - 2] = l[0]), (l[c - 1] = l[1]))
: (d--, (c -= 4), (l = K.Utils.setArraySize(this.world, c)), t.computeWorldVertices(r, 2, c, l, 0, 2));
for (var w = K.Utils.setArraySize(this.curves, d), T = 0, S = l[0], _ = l[1], E = 0, P = 0, A = 0, M = 0, C = 0, O = 0, k = 0, R = 0, L = 0, I = 0, D = 0, F = 0, B = 0, N = 0, U = ((v = 0), 2); v < d; v++, U += 6)
(E = l[U]),
(P = l[U + 1]),
(A = l[U + 2]),
(M = l[U + 3]),
(D = 2 * (k = 0.1875 * (S - 2 * E + A)) + (L = 0.09375 * (3 * (E - A) - S + (C = l[U + 4])))),
(F = 2 * (R = 0.1875 * (_ - 2 * P + M)) + (I = 0.09375 * (3 * (P - M) - _ + (O = l[U + 5])))),
(B = 0.75 * (E - S) + k + 0.16666667 * L),
(N = 0.75 * (P - _) + R + 0.16666667 * I),
(T += Math.sqrt(B * B + N * N)),
(B += D),
(N += F),
(D += L),
(F += I),
(T += Math.sqrt(B * B + N * N)),
(B += D),
(N += F),
(T += Math.sqrt(B * B + N * N)),
(B += D + L),
(N += F + I),
(T += Math.sqrt(B * B + N * N)),
(w[v] = T),
(S = C),
(_ = O);
if (((o *= n ? T : T / t.lengths[d - 1]), s)) for (v = 1; v < e; v++) a[v] *= T;
for (var Y = this.segments, z = 0, X = ((v = 0), (y = 0), (m = 0), 0); v < e; v++, y += 3) {
var V;
x = o += V = a[v];
if (u) (x %= T) < 0 && (x += T), (m = 0);
else {
if (x < 0) {
this.addBeforePosition(x, l, 0, h, y);
continue;
}
if (T < x) {
this.addAfterPosition(x - T, l, c - 4, h, y);
continue;
}
}
for (; ; m++) {
var G = w[m];
if (!(G < x)) {
0 == m ? (x /= G) : (x = (x - (H = w[m - 1])) / (G - H));
break;
}
}
if (m != f) {
var j = 6 * (f = m);
(S = l[j]),
(_ = l[j + 1]),
(E = l[j + 2]),
(P = l[j + 3]),
(A = l[j + 4]),
(M = l[j + 5]),
(D = 2 * (k = 0.03 * (S - 2 * E + A)) + (L = 0.006 * (3 * (E - A) - S + (C = l[j + 6])))),
(F = 2 * (R = 0.03 * (_ - 2 * P + M)) + (I = 0.006 * (3 * (P - M) - _ + (O = l[j + 7])))),
(B = 0.3 * (E - S) + k + 0.16666667 * L),
(N = 0.3 * (P - _) + R + 0.16666667 * I),
(z = Math.sqrt(B * B + N * N));
for (Y[0] = z, j = 1; j < 8; j++) (B += D), (N += F), (D += L), (F += I), (z += Math.sqrt(B * B + N * N)), (Y[j] = z);
(B += D), (N += F), (z += Math.sqrt(B * B + N * N)), (Y[8] = z), (B += D + L), (N += F + I), (z += Math.sqrt(B * B + N * N)), (Y[9] = z), (X = 0);
}
for (x *= z; ; X++) {
var H,
W = Y[X];
if (!(W < x)) {
0 == X ? (x /= W) : (x = X + (x - (H = Y[X - 1])) / (W - H));
break;
}
}
this.addCurvePosition(0.1 * x, S, _, E, P, A, M, C, O, h, y, i || (0 < v && 0 == V));
}
return h;
}),
(_e.prototype.addBeforePosition = function (t, e, i, n, s) {
var r = e[i],
o = e[i + 1],
a = e[i + 2] - r,
h = e[i + 3] - o,
l = Math.atan2(h, a);
(n[s] = r + t * Math.cos(l)), (n[s + 1] = o + t * Math.sin(l)), (n[s + 2] = l);
}),
(_e.prototype.addAfterPosition = function (t, e, i, n, s) {
var r = e[i + 2],
o = e[i + 3],
a = r - e[i],
h = o - e[i + 1],
l = Math.atan2(h, a);
(n[s] = r + t * Math.cos(l)), (n[s + 1] = o + t * Math.sin(l)), (n[s + 2] = l);
}),
(_e.prototype.addCurvePosition = function (t, e, i, n, s, r, o, a, h, l, u, c) {
if (0 == t || isNaN(t)) return (l[u] = e), (l[u + 1] = i), void (l[u + 2] = Math.atan2(s - i, n - e));
var d = t * t,
f = d * t,
p = 1 - t,
g = p * p,
v = g * p,
y = p * t,
m = 3 * y,
x = p * m,
b = m * t,
w = e * v + n * x + r * b + a * f,
T = i * v + s * x + o * b + h * f;
(l[u] = w), (l[u + 1] = T), c && (l[u + 2] = t < 0.001 ? Math.atan2(s - i, n - e) : Math.atan2(T - (i * g + s * y * 2 + o * d), w - (e * g + n * y * 2 + r * d)));
}),
(_e.NONE = -1),
(_e.BEFORE = -2),
(_e.AFTER = -3),
(_e.epsilon = 1e-5),
(y = _e),
(K.PathConstraint = y),
(m = ge = ge || {}),
(x = m.ConstraintData),
ye(Ee, x),
(S = Ee),
(m.PathConstraintData = S),
((b = m.PositionMode || (m.PositionMode = {}))[(b.Fixed = 0)] = "Fixed"),
(b[(b.Percent = 1)] = "Percent"),
((w = m.SpacingMode || (m.SpacingMode = {}))[(w.Length = 0)] = "Length"),
(w[(w.Fixed = 1)] = "Fixed"),
(w[(w.Percent = 2)] = "Percent"),
((T = m.RotateMode || (m.RotateMode = {}))[(T.Tangent = 0)] = "Tangent"),
(T[(T.Chain = 1)] = "Chain"),
(T[(T.ChainScale = 2)] = "ChainScale"),
(_ = ge = ge || {}),
(Pe.prototype.loaded = function () {
var t = 0;
for (var e in this.assets) t++;
return t;
}),
(E = Pe),
(Ae.prototype.queueAsset = function (t, e, i) {
var n = this.clientAssets[t];
return null == n && ((n = new E(t)), (this.clientAssets[t] = n)), null !== e && (n.textureLoader = e), n.toLoad.push(i), this.queuedAssets[i] !== i && ((this.queuedAssets[i] = i), !0);
}),
(Ae.prototype.loadText = function (t, e) {
var i,
n = this;
(e = this.pathPrefix + e),
this.queueAsset(t, null, e) &&
((i = new XMLHttpRequest()).overrideMimeType("text/html"),
(i.onreadystatechange = function () {
i.readyState == XMLHttpRequest.DONE && (200 <= i.status && i.status < 300 ? (n.rawAssets[e] = i.responseText) : (n.errors[e] = "Couldn't load text " + e + ": status " + i.status + ", " + i.responseText));
}),
i.open("GET", e, !0),
i.send());
}),
(Ae.prototype.loadJson = function (t, e) {
var i,
n = this;
(e = this.pathPrefix + e),
this.queueAsset(t, null, e) &&
((i = new XMLHttpRequest()).overrideMimeType("text/html"),
(i.onreadystatechange = function () {
i.readyState == XMLHttpRequest.DONE &&
(200 <= i.status && i.status < 300 ? (n.rawAssets[e] = JSON.parse(i.responseText)) : (n.errors[e] = "Couldn't load text " + e + ": status " + i.status + ", " + i.responseText));
}),
i.open("GET", e, !0),
i.send());
}),
(Ae.prototype.loadTexture = function (t, e, i) {
var n,
s = this;
(i = this.pathPrefix + i),
this.queueAsset(t, e, i) &&
(("undefined" != typeof window && "undefined" != typeof navigator && window.document) || "undefined" == typeof importScripts
? (((n = new Image()).crossOrigin = "anonymous"),
(n.onload = function (t) {
s.rawAssets[i] = n;
}),
(n.onerror = function (t) {
s.errors[i] = "Couldn't load image " + i;
}),
(n.src = i))
: fetch(i, { mode: "cors" })
.then(function (t) {
return t.ok || (s.errors[i] = "Couldn't load image " + i), t.blob();
})
.then(function (t) {
return createImageBitmap(t, { premultiplyAlpha: "none", colorSpaceConversion: "none" });
})
.then(function (t) {
s.rawAssets[i] = t;
}));
}),
(Ae.prototype.get = function (t, e) {
e = this.pathPrefix + e;
var i = this.clientAssets[t];
return null == i || i.assets[e];
}),
(Ae.prototype.updateClientAssets = function (t) {
for (var e = !("undefined" != typeof window && "undefined" != typeof navigator && window.document) && "undefined" != typeof importScripts, i = 0; i < t.toLoad.length; i++) {
var n = t.toLoad[i];
if (null == t.assets[n]) {
var s = this.rawAssets[n];
if (null == s) continue;
e ? (s instanceof ImageBitmap ? (t.assets[n] = t.textureLoader(s)) : (t.assets[n] = s)) : s instanceof HTMLImageElement ? (t.assets[n] = t.textureLoader(s)) : (t.assets[n] = s);
}
}
}),
(Ae.prototype.isLoadingComplete = function (t) {
var e = this.clientAssets[t];
return null == e || (this.updateClientAssets(e), e.toLoad.length == e.loaded());
}),
(Ae.prototype.dispose = function () {}),
(Ae.prototype.hasErrors = function () {
return 0 < Object.keys(this.errors).length;
}),
(Ae.prototype.getErrors = function () {
return this.errors;
}),
(P = Ae),
(_.SharedAssetManager = P),
(A = ge = ge || {}),
(Me.prototype.updateCache = function () {
(this._updateCache.length = 0), (this.updateCacheReset.length = 0);
for (var t = this.bones, e = 0, i = t.length; e < i; e++) ((s = t[e]).sorted = s.data.skinRequired), (s.active = !s.sorted);
if (null != this.skin) {
var n = this.skin.bones;
for (e = 0, i = this.skin.bones.length; e < i; e++) for (var s = this.bones[n[e].index]; (s.sorted = !1), (s.active = !0), null != (s = s.parent); );
}
var r = this.ikConstraints,
o = this.transformConstraints,
a = this.pathConstraints,
h = r.length,
l = o.length,
u = a.length,
c = h + l + u;
t: for (e = 0; e < c; e++) {
for (var d = 0; d < h; d++)
if ((f = r[d]).data.order == e) {
this.sortIkConstraint(f);
continue t;
}
for (d = 0; d < l; d++)
if ((f = o[d]).data.order == e) {
this.sortTransformConstraint(f);
continue t;
}
var f;
for (d = 0; d < u; d++)
if ((f = a[d]).data.order == e) {
this.sortPathConstraint(f);
continue t;
}
}
for (e = 0, i = t.length; e < i; e++) this.sortBone(t[e]);
}),
(Me.prototype.sortIkConstraint = function (t) {
var e, i, n, s;
(t.active = t.target.isActive() && (!t.data.skinRequired || (null != this.skin && A.Utils.contains(this.skin.constraints, t.data, !0)))),
t.active &&
((e = t.target),
this.sortBone(e),
(n = (i = t.bones)[0]),
this.sortBone(n),
1 < i.length && ((s = i[i.length - 1]), -1 < this._updateCache.indexOf(s) || this.updateCacheReset.push(s)),
this._updateCache.push(t),
this.sortReset(n.children),
(i[i.length - 1].sorted = !0));
}),
(Me.prototype.sortPathConstraint = function (t) {
if (((t.active = t.target.bone.isActive() && (!t.data.skinRequired || (null != this.skin && A.Utils.contains(this.skin.constraints, t.data, !0)))), t.active)) {
var e = t.target,
i = e.data.index,
n = e.bone;
null != this.skin && this.sortPathConstraintAttachment(this.skin, i, n), null != this.data.defaultSkin && this.data.defaultSkin != this.skin && this.sortPathConstraintAttachment(this.data.defaultSkin, i, n);
for (var s = 0, r = this.data.skins.length; s < r; s++) this.sortPathConstraintAttachment(this.data.skins[s], i, n);
var o = e.getAttachment();
o instanceof A.PathAttachment && this.sortPathConstraintAttachmentWith(o, n);
var a = t.bones,
h = a.length;
for (s = 0; s < h; s++) this.sortBone(a[s]);
for (this._updateCache.push(t), s = 0; s < h; s++) this.sortReset(a[s].children);
for (s = 0; s < h; s++) a[s].sorted = !0;
}
}),
(Me.prototype.sortTransformConstraint = function (t) {
if (((t.active = t.target.isActive() && (!t.data.skinRequired || (null != this.skin && A.Utils.contains(this.skin.constraints, t.data, !0)))), t.active)) {
this.sortBone(t.target);
var e = t.bones,
i = e.length;
if (t.data.local)
for (var n = 0; n < i; n++) {
var s = e[n];
this.sortBone(s.parent), -1 < this._updateCache.indexOf(s) || this.updateCacheReset.push(s);
}
else for (n = 0; n < i; n++) this.sortBone(e[n]);
this._updateCache.push(t);
for (var r = 0; r < i; r++) this.sortReset(e[r].children);
for (r = 0; r < i; r++) e[r].sorted = !0;
}
}),
(Me.prototype.sortPathConstraintAttachment = function (t, e, i) {
var n = t.attachments[e];
if (n) for (var s in n) this.sortPathConstraintAttachmentWith(n[s], i);
}),
(Me.prototype.sortPathConstraintAttachmentWith = function (t, e) {
if (t instanceof A.PathAttachment) {
var i = t.bones;
if (null == i) this.sortBone(e);
else
for (var n = this.bones, s = 0; s < i.length; )
for (var r = i[s++], o = s + r; s < o; s++) {
var a = i[s];
this.sortBone(n[a]);
}
}
}),
(Me.prototype.sortBone = function (t) {
var e;
t.sorted || (null != (e = t.parent) && this.sortBone(e), (t.sorted = !0), this._updateCache.push(t));
}),
(Me.prototype.sortReset = function (t) {
for (var e = 0, i = t.length; e < i; e++) {
var n = t[e];
n.active && (n.sorted && this.sortReset(n.children), (n.sorted = !1));
}
}),
(Me.prototype.updateWorldTransform = function () {
for (var t = this.updateCacheReset, e = 0, i = t.length; e < i; e++) {
var n = t[e];
(n.ax = n.x), (n.ay = n.y), (n.arotation = n.rotation), (n.ascaleX = n.scaleX), (n.ascaleY = n.scaleY), (n.ashearX = n.shearX), (n.ashearY = n.shearY), (n.appliedValid = !0);
}
var s = this._updateCache;
for (e = 0, i = s.length; e < i; e++) s[e].update();
}),
(Me.prototype.setToSetupPose = function () {
this.setBonesToSetupPose(), this.setSlotsToSetupPose();
}),
(Me.prototype.setBonesToSetupPose = function () {
for (var t = this.bones, e = 0, i = t.length; e < i; e++) t[e].setToSetupPose();
var n = this.ikConstraints;
for (e = 0, i = n.length; e < i; e++) ((a = n[e]).mix = a.data.mix), (a.softness = a.data.softness), (a.bendDirection = a.data.bendDirection), (a.compress = a.data.compress), (a.stretch = a.data.stretch);
var s = this.transformConstraints;
for (e = 0, i = s.length; e < i; e++) {
var r = (a = s[e]).data;
(a.rotateMix = r.rotateMix), (a.translateMix = r.translateMix), (a.scaleMix = r.scaleMix), (a.shearMix = r.shearMix);
}
var o = this.pathConstraints;
for (e = 0, i = o.length; e < i; e++) {
var a;
r = (a = o[e]).data;
(a.position = r.position), (a.spacing = r.spacing), (a.rotateMix = r.rotateMix), (a.translateMix = r.translateMix);
}
}),
(Me.prototype.setSlotsToSetupPose = function () {
var t = this.slots;
A.Utils.arrayCopy(t, 0, this.drawOrder, 0, t.length);
for (var e = 0, i = t.length; e < i; e++) t[e].setToSetupPose();
}),
(Me.prototype.getRootBone = function () {
return 0 == this.bones.length ? null : this.bones[0];
}),
(Me.prototype.findBone = function (t) {
if (null == t) throw new Error("boneName cannot be null.");
for (var e = this.bones, i = 0, n = e.length; i < n; i++) {
var s = e[i];
if (s.data.name == t) return s;
}
return null;
}),
(Me.prototype.findBoneIndex = function (t) {
if (null == t) throw new Error("boneName cannot be null.");
for (var e = this.bones, i = 0, n = e.length; i < n; i++) if (e[i].data.name == t) return i;
return -1;
}),
(Me.prototype.findSlot = function (t) {
if (null == t) throw new Error("slotName cannot be null.");
for (var e = this.slots, i = 0, n = e.length; i < n; i++) {
var s = e[i];
if (s.data.name == t) return s;
}
return null;
}),
(Me.prototype.findSlotIndex = function (t) {
if (null == t) throw new Error("slotName cannot be null.");
for (var e = this.slots, i = 0, n = e.length; i < n; i++) if (e[i].data.name == t) return i;
return -1;
}),
(Me.prototype.setSkinByName = function (t) {
var e = this.data.findSkin(t);
if (null == e) throw new Error("Skin not found: " + t);
this.setSkin(e);
}),
(Me.prototype.setSkin = function (t) {
if (t != this.skin) {
if (null != t)
if (null != this.skin) t.attachAll(this, this.skin);
else
for (var e = this.slots, i = 0, n = e.length; i < n; i++) {
var s,
r = e[i],
o = r.data.attachmentName;
null == o || (null != (s = t.getAttachment(i, o)) && r.setAttachment(s));
}
(this.skin = t), this.updateCache();
}
}),
(Me.prototype.getAttachmentByName = function (t, e) {
return this.getAttachment(this.data.findSlotIndex(t), e);
}),
(Me.prototype.getAttachment = function (t, e) {
if (null == e) throw new Error("attachmentName cannot be null.");
if (null != this.skin) {
var i = this.skin.getAttachment(t, e);
if (null != i) return i;
}
return null != this.data.defaultSkin ? this.data.defaultSkin.getAttachment(t, e) : null;
}),
(Me.prototype.setAttachment = function (t, e) {
if (null == t) throw new Error("slotName cannot be null.");
for (var i = this.slots, n = 0, s = i.length; n < s; n++) {
var r = i[n];
if (r.data.name == t) {
var o = null;
if (null != e && null == (o = this.getAttachment(n, e))) throw new Error("Attachment not found: " + e + ", for slot: " + t);
return void r.setAttachment(o);
}
}
throw new Error("Slot not found: " + t);
}),
(Me.prototype.findIkConstraint = function (t) {
if (null == t) throw new Error("constraintName cannot be null.");
for (var e = this.ikConstraints, i = 0, n = e.length; i < n; i++) {
var s = e[i];
if (s.data.name == t) return s;
}
return null;
}),
(Me.prototype.findTransformConstraint = function (t) {
if (null == t) throw new Error("constraintName cannot be null.");
for (var e = this.transformConstraints, i = 0, n = e.length; i < n; i++) {
var s = e[i];
if (s.data.name == t) return s;
}
return null;
}),
(Me.prototype.findPathConstraint = function (t) {
if (null == t) throw new Error("constraintName cannot be null.");
for (var e = this.pathConstraints, i = 0, n = e.length; i < n; i++) {
var s = e[i];
if (s.data.name == t) return s;
}
return null;
}),
(Me.prototype.getBounds = function (t, e, i) {
if ((void 0 === i && (i = new Array(2)), null == t)) throw new Error("offset cannot be null.");
if (null == e) throw new Error("size cannot be null.");
for (var n = this.drawOrder, s = Number.POSITIVE_INFINITY, r = Number.POSITIVE_INFINITY, o = Number.NEGATIVE_INFINITY, a = Number.NEGATIVE_INFINITY, h = 0, l = n.length; h < l; h++) {
var u = n[h];
if (u.bone.active) {
var c,
d = 0,
f = null,
p = u.getAttachment();
if (
(p instanceof A.RegionAttachment
? ((d = 8), (f = A.Utils.setArraySize(i, d, 0)), p.computeWorldVertices(u.bone, f, 0, 2))
: p instanceof A.MeshAttachment && ((d = (c = p).worldVerticesLength), (f = A.Utils.setArraySize(i, d, 0)), c.computeWorldVertices(u, 0, d, f, 0, 2)),
null != f)
)
for (var g = 0, v = f.length; g < v; g += 2) {
var y = f[g],
m = f[g + 1];
(s = Math.min(s, y)), (r = Math.min(r, m)), (o = Math.max(o, y)), (a = Math.max(a, m));
}
}
}
t.set(s, r), e.set(o - s, a - r);
}),
(Me.prototype.update = function (t) {
this.time += t;
}),
(M = Me),
(A.Skeleton = M),
(function (G) {
var t =
((j.prototype.readSkeletonData = function (t) {
var e = this.scale,
i = new G.SkeletonData();
i.name = "";
var n = new x(t);
if (((i.hash = n.readString()), (i.version = n.readString()), "3.8.75" == i.version)) throw new Error("Unsupported skeleton data, please export with a newer version of Spine.");
(i.x = n.readFloat()), (i.y = n.readFloat()), (i.width = n.readFloat()), (i.height = n.readFloat());
var s = n.readBoolean();
s && ((i.fps = n.readFloat()), (i.imagesPath = n.readString()), (i.audioPath = n.readString()));
for (var r = 0, o = ((r = n.readInt(!0)), 0); o < r; o++) n.strings.push(n.readString());
for (r = n.readInt(!0), o = 0; o < r; o++) {
var a = n.readString(),
h = 0 == o ? null : i.bones[n.readInt(!0)];
((c = new G.BoneData(o, a, h)).rotation = n.readFloat()),
(c.x = n.readFloat() * e),
(c.y = n.readFloat() * e),
(c.scaleX = n.readFloat()),
(c.scaleY = n.readFloat()),
(c.shearX = n.readFloat()),
(c.shearY = n.readFloat()),
(c.length = n.readFloat() * e),
(c.transformMode = j.TransformModeValues[n.readInt(!0)]),
(c.skinRequired = n.readBoolean()),
s && G.Color.rgba8888ToColor(c.color, n.readInt32()),
i.bones.push(c);
}
for (r = n.readInt(!0), o = 0; o < r; o++) {
var l = n.readString(),
u = i.bones[n.readInt(!0)],
c = new G.SlotData(o, l, u);
G.Color.rgba8888ToColor(c.color, n.readInt32());
var d = n.readInt32();
-1 != d && G.Color.rgb888ToColor((c.darkColor = new G.Color()), d), (c.attachmentName = n.readStringRef()), (c.blendMode = j.BlendModeValues[n.readInt(!0)]), i.slots.push(c);
}
r = n.readInt(!0);
o = 0;
for (var f = void 0; o < r; o++) {
((c = new G.IkConstraintData(n.readString())).order = n.readInt(!0)), (c.skinRequired = n.readBoolean()), (f = n.readInt(!0));
for (var p = 0; p < f; p++) c.bones.push(i.bones[n.readInt(!0)]);
(c.target = i.bones[n.readInt(!0)]),
(c.mix = n.readFloat()),
(c.softness = n.readFloat() * e),
(c.bendDirection = n.readByte()),
(c.compress = n.readBoolean()),
(c.stretch = n.readBoolean()),
(c.uniform = n.readBoolean()),
i.ikConstraints.push(c);
}
for (r = n.readInt(!0), f = void (o = 0); o < r; o++) {
for ((c = new G.TransformConstraintData(n.readString())).order = n.readInt(!0), c.skinRequired = n.readBoolean(), f = n.readInt(!0), p = 0; p < f; p++) c.bones.push(i.bones[n.readInt(!0)]);
(c.target = i.bones[n.readInt(!0)]),
(c.local = n.readBoolean()),
(c.relative = n.readBoolean()),
(c.offsetRotation = n.readFloat()),
(c.offsetX = n.readFloat() * e),
(c.offsetY = n.readFloat() * e),
(c.offsetScaleX = n.readFloat()),
(c.offsetScaleY = n.readFloat()),
(c.offsetShearY = n.readFloat()),
(c.rotateMix = n.readFloat()),
(c.translateMix = n.readFloat()),
(c.scaleMix = n.readFloat()),
(c.shearMix = n.readFloat()),
i.transformConstraints.push(c);
}
for (r = n.readInt(!0), f = void (o = 0); o < r; o++) {
for ((c = new G.PathConstraintData(n.readString())).order = n.readInt(!0), c.skinRequired = n.readBoolean(), f = n.readInt(!0), p = 0; p < f; p++) c.bones.push(i.bones[n.readInt(!0)]);
(c.target = i.slots[n.readInt(!0)]),
(c.positionMode = j.PositionModeValues[n.readInt(!0)]),
(c.spacingMode = j.SpacingModeValues[n.readInt(!0)]),
(c.rotateMode = j.RotateModeValues[n.readInt(!0)]),
(c.offsetRotation = n.readFloat()),
(c.position = n.readFloat()),
c.positionMode == G.PositionMode.Fixed && (c.position *= e),
(c.spacing = n.readFloat()),
(c.spacingMode != G.SpacingMode.Length && c.spacingMode != G.SpacingMode.Fixed) || (c.spacing *= e),
(c.rotateMix = n.readFloat()),
(c.translateMix = n.readFloat()),
i.pathConstraints.push(c);
}
var g = this.readSkin(n, i, !0, s);
for (null != g && ((i.defaultSkin = g), i.skins.push(g)), o = i.skins.length, G.Utils.setArraySize(i.skins, (r = o + n.readInt(!0))); o < r; o++) i.skins[o] = this.readSkin(n, i, !1, s);
for (r = this.linkedMeshes.length, o = 0; o < r; o++) {
var v = this.linkedMeshes[o],
y = null == v.skin ? i.defaultSkin : i.findSkin(v.skin);
if (null == y) throw new Error("Skin not found: " + v.skin);
var m = y.getAttachment(v.slotIndex, v.parent);
if (null == m) throw new Error("Parent mesh not found: " + v.parent);
(v.mesh.deformAttachment = v.inheritDeform ? m : v.mesh), v.mesh.setParentMesh(m), v.mesh.updateUVs();
}
for (this.linkedMeshes.length = 0, r = n.readInt(!0), o = 0; o < r; o++)
((c = new G.EventData(n.readStringRef())).intValue = n.readInt(!1)),
(c.floatValue = n.readFloat()),
(c.stringValue = n.readString()),
(c.audioPath = n.readString()),
null != c.audioPath && ((c.volume = n.readFloat()), (c.balance = n.readFloat())),
i.events.push(c);
for (r = n.readInt(!0), o = 0; o < r; o++) i.animations.push(this.readAnimation(n, n.readString(), i));
return i;
}),
(j.prototype.readSkin = function (t, e, i, n) {
var s = null,
r = 0;
if (i) {
if (0 == (r = t.readInt(!0))) return null;
s = new G.Skin("default");
} else {
(s = new G.Skin(t.readStringRef())).bones.length = t.readInt(!0);
for (var o = 0, a = s.bones.length; o < a; o++) s.bones[o] = e.bones[t.readInt(!0)];
for (o = 0, a = t.readInt(!0); o < a; o++) s.constraints.push(e.ikConstraints[t.readInt(!0)]);
for (o = 0, a = t.readInt(!0); o < a; o++) s.constraints.push(e.transformConstraints[t.readInt(!0)]);
for (o = 0, a = t.readInt(!0); o < a; o++) s.constraints.push(e.pathConstraints[t.readInt(!0)]);
r = t.readInt(!0);
}
for (o = 0; o < r; o++)
for (var h = t.readInt(!0), l = 0, u = t.readInt(!0); l < u; l++) {
var c = t.readStringRef(),
d = this.readAttachment(t, e, s, h, c, n);
null != d && s.setAttachment(h, c, d);
}
return s;
}),
(j.prototype.readAttachment = function (t, e, i, n, s, r) {
var o = this.scale,
a = t.readStringRef();
null == a && (a = s);
var h = t.readByte();
switch (j.AttachmentTypeValues[h]) {
case G.AttachmentType.Region:
var l = t.readStringRef(),
u = t.readFloat(),
c = t.readFloat(),
d = t.readFloat(),
f = t.readFloat(),
p = t.readFloat(),
g = t.readFloat(),
v = t.readFloat(),
y = t.readInt32();
null == l && (l = a);
var m = this.attachmentLoader.newRegionAttachment(i, a, l);
return null == m
? null
: ((m.path = l), (m.x = c * o), (m.y = d * o), (m.scaleX = f), (m.scaleY = p), (m.rotation = u), (m.width = g * o), (m.height = v * o), G.Color.rgba8888ToColor(m.color, y), m.updateOffset(), m);
case G.AttachmentType.BoundingBox:
var x = t.readInt(!0),
b = this.readVertices(t, x),
w = ((y = r ? t.readInt32() : 0), this.attachmentLoader.newBoundingBoxAttachment(i, a));
return null == w ? null : ((w.worldVerticesLength = x << 1), (w.vertices = b.vertices), (w.bones = b.bones), r && G.Color.rgba8888ToColor(w.color, y), w);
case G.AttachmentType.Mesh:
(l = t.readStringRef()), (y = t.readInt32()), (x = t.readInt(!0));
var T = this.readFloatArray(t, x << 1, 1),
S = this.readShortArray(t),
_ = ((b = this.readVertices(t, x)), t.readInt(!0)),
E = null;
(g = 0), (v = 0);
return (
r && ((E = this.readShortArray(t)), (g = t.readFloat()), (v = t.readFloat())),
null == l && (l = a),
null == (P = this.attachmentLoader.newMeshAttachment(i, a, l))
? null
: ((P.path = l),
G.Color.rgba8888ToColor(P.color, y),
(P.bones = b.bones),
(P.vertices = b.vertices),
(P.worldVerticesLength = x << 1),
(P.triangles = S),
(P.regionUVs = T),
P.updateUVs(),
(P.hullLength = _ << 1),
r && ((P.edges = E), (P.width = g * o), (P.height = v * o)),
P)
);
case G.AttachmentType.LinkedMesh:
(l = t.readStringRef()), (y = t.readInt32());
var P,
A = t.readStringRef(),
M = t.readStringRef(),
C = t.readBoolean();
(g = 0), (v = 0);
return (
r && ((g = t.readFloat()), (v = t.readFloat())),
null == l && (l = a),
null == (P = this.attachmentLoader.newMeshAttachment(i, a, l))
? null
: ((P.path = l), G.Color.rgba8888ToColor(P.color, y), r && ((P.width = g * o), (P.height = v * o)), this.linkedMeshes.push(new N(P, A, n, M, C)), P)
);
case G.AttachmentType.Path:
for (var O = t.readBoolean(), k = t.readBoolean(), R = ((x = t.readInt(!0)), (b = this.readVertices(t, x)), G.Utils.newArray(x / 3, 0)), L = 0, I = R.length; L < I; L++) R[L] = t.readFloat() * o;
return (
(y = r ? t.readInt32() : 0),
null == (l = this.attachmentLoader.newPathAttachment(i, a))
? null
: ((l.closed = O), (l.constantSpeed = k), (l.worldVerticesLength = x << 1), (l.vertices = b.vertices), (l.bones = b.bones), (l.lengths = R), r && G.Color.rgba8888ToColor(l.color, y), l)
);
case G.AttachmentType.Point:
(u = t.readFloat()), (c = t.readFloat()), (d = t.readFloat()), (y = r ? t.readInt32() : 0);
var D = this.attachmentLoader.newPointAttachment(i, a);
return null == D ? null : ((D.x = c * o), (D.y = d * o), (D.rotation = u), r && G.Color.rgba8888ToColor(D.color, y), D);
case G.AttachmentType.Clipping:
var F = t.readInt(!0),
B = ((x = t.readInt(!0)), (b = this.readVertices(t, x)), (y = r ? t.readInt32() : 0), this.attachmentLoader.newClippingAttachment(i, a));
return null == B ? null : ((B.endSlot = e.slots[F]), (B.worldVerticesLength = x << 1), (B.vertices = b.vertices), (B.bones = b.bones), r && G.Color.rgba8888ToColor(B.color, y), B);
}
return null;
}),
(j.prototype.readVertices = function (t, e) {
var i = e << 1,
n = new u(),
s = this.scale;
if (!t.readBoolean()) return (n.vertices = this.readFloatArray(t, i, s)), n;
for (var r = new Array(), o = new Array(), a = 0; a < e; a++) {
var h = t.readInt(!0);
o.push(h);
for (var l = 0; l < h; l++) o.push(t.readInt(!0)), r.push(t.readFloat() * s), r.push(t.readFloat() * s), r.push(t.readFloat());
}
return (n.vertices = G.Utils.toFloatArray(r)), (n.bones = o), n;
}),
(j.prototype.readFloatArray = function (t, e, i) {
var n = new Array(e);
if (1 == i) for (var s = 0; s < e; s++) n[s] = t.readFloat();
else for (s = 0; s < e; s++) n[s] = t.readFloat() * i;
return n;
}),
(j.prototype.readShortArray = function (t) {
for (var e = t.readInt(!0), i = new Array(e), n = 0; n < e; n++) i[n] = t.readShort();
return i;
}),
(j.prototype.readAnimation = function (t, e, i) {
for (var n = new Array(), s = this.scale, r = 0, o = new G.Color(), a = new G.Color(), h = 0, l = t.readInt(!0); h < l; h++)
for (var u = t.readInt(!0), c = 0, d = t.readInt(!0); c < d; c++) {
var f = t.readByte(),
p = t.readInt(!0);
switch (f) {
case j.SLOT_ATTACHMENT:
(m = new G.AttachmentTimeline(p)).slotIndex = u;
for (var g = 0; g < p; g++) m.setFrame(g, t.readFloat(), t.readStringRef());
n.push(m), (r = Math.max(r, m.frames[p - 1]));
break;
case j.SLOT_COLOR:
for ((m = new G.ColorTimeline(p)).slotIndex = u, g = 0; g < p; g++) {
var v = t.readFloat();
G.Color.rgba8888ToColor(o, t.readInt32()), m.setFrame(g, v, o.r, o.g, o.b, o.a), g < p - 1 && this.readCurve(t, g, m);
}
n.push(m), (r = Math.max(r, m.frames[(p - 1) * G.ColorTimeline.ENTRIES]));
break;
case j.SLOT_TWO_COLOR:
for ((m = new G.TwoColorTimeline(p)).slotIndex = u, g = 0; g < p; g++)
(v = t.readFloat()),
G.Color.rgba8888ToColor(o, t.readInt32()),
G.Color.rgb888ToColor(a, t.readInt32()),
m.setFrame(g, v, o.r, o.g, o.b, o.a, a.r, a.g, a.b),
g < p - 1 && this.readCurve(t, g, m);
n.push(m), (r = Math.max(r, m.frames[(p - 1) * G.TwoColorTimeline.ENTRIES]));
}
}
for (h = 0, l = t.readInt(!0); h < l; h++) {
var y = t.readInt(!0);
for (c = 0, d = t.readInt(!0); c < d; c++)
switch (((f = t.readByte()), (p = t.readInt(!0)), f)) {
case j.BONE_ROTATE:
for ((m = new G.RotateTimeline(p)).boneIndex = y, g = 0; g < p; g++) m.setFrame(g, t.readFloat(), t.readFloat()), g < p - 1 && this.readCurve(t, g, m);
n.push(m), (r = Math.max(r, m.frames[(p - 1) * G.RotateTimeline.ENTRIES]));
break;
case j.BONE_TRANSLATE:
case j.BONE_SCALE:
case j.BONE_SHEAR:
var m = void 0,
x = 1;
for (f == j.BONE_SCALE ? (m = new G.ScaleTimeline(p)) : f == j.BONE_SHEAR ? (m = new G.ShearTimeline(p)) : ((m = new G.TranslateTimeline(p)), (x = s)), m.boneIndex = y, g = 0; g < p; g++)
m.setFrame(g, t.readFloat(), t.readFloat() * x, t.readFloat() * x), g < p - 1 && this.readCurve(t, g, m);
n.push(m), (r = Math.max(r, m.frames[(p - 1) * G.TranslateTimeline.ENTRIES]));
}
}
for (h = 0, l = t.readInt(!0); h < l; h++) {
var b = t.readInt(!0);
p = t.readInt(!0);
for ((m = new G.IkConstraintTimeline(p)).ikConstraintIndex = b, g = 0; g < p; g++)
m.setFrame(g, t.readFloat(), t.readFloat(), t.readFloat() * s, t.readByte(), t.readBoolean(), t.readBoolean()), g < p - 1 && this.readCurve(t, g, m);
n.push(m), (r = Math.max(r, m.frames[(p - 1) * G.IkConstraintTimeline.ENTRIES]));
}
for (h = 0, l = t.readInt(!0); h < l; h++) {
for (b = t.readInt(!0), p = t.readInt(!0), (m = new G.TransformConstraintTimeline(p)).transformConstraintIndex = b, g = 0; g < p; g++)
m.setFrame(g, t.readFloat(), t.readFloat(), t.readFloat(), t.readFloat(), t.readFloat()), g < p - 1 && this.readCurve(t, g, m);
n.push(m), (r = Math.max(r, m.frames[(p - 1) * G.TransformConstraintTimeline.ENTRIES]));
}
for (h = 0, l = t.readInt(!0); h < l; h++) {
b = t.readInt(!0);
var w = i.pathConstraints[b];
for (c = 0, d = t.readInt(!0); c < d; c++)
switch (((f = t.readByte()), (p = t.readInt(!0)), f)) {
case j.PATH_POSITION:
case j.PATH_SPACING:
(m = void 0), (x = 1);
for (
f == j.PATH_SPACING
? ((m = new G.PathConstraintSpacingTimeline(p)), (w.spacingMode != G.SpacingMode.Length && w.spacingMode != G.SpacingMode.Fixed) || (x = s))
: ((m = new G.PathConstraintPositionTimeline(p)), w.positionMode == G.PositionMode.Fixed && (x = s)),
m.pathConstraintIndex = b,
g = 0;
g < p;
g++
)
m.setFrame(g, t.readFloat(), t.readFloat() * x), g < p - 1 && this.readCurve(t, g, m);
n.push(m), (r = Math.max(r, m.frames[(p - 1) * G.PathConstraintPositionTimeline.ENTRIES]));
break;
case j.PATH_MIX:
for ((m = new G.PathConstraintMixTimeline(p)).pathConstraintIndex = b, g = 0; g < p; g++) m.setFrame(g, t.readFloat(), t.readFloat(), t.readFloat()), g < p - 1 && this.readCurve(t, g, m);
n.push(m), (r = Math.max(r, m.frames[(p - 1) * G.PathConstraintMixTimeline.ENTRIES]));
}
}
for (h = 0, l = t.readInt(!0); h < l; h++) {
var T = i.skins[t.readInt(!0)];
for (c = 0, d = t.readInt(!0); c < d; c++) {
u = t.readInt(!0);
for (var S = 0, _ = t.readInt(!0); S < _; S++) {
var E = T.getAttachment(u, t.readStringRef()),
P = null != E.bones,
A = E.vertices,
M = P ? (A.length / 3) * 2 : A.length;
p = t.readInt(!0);
for ((m = new G.DeformTimeline(p)).slotIndex = u, m.attachment = E, g = 0; g < p; g++) {
v = t.readFloat();
var C = void 0,
O = t.readInt(!0);
if (0 == O) C = P ? G.Utils.newFloatArray(M) : A;
else {
C = G.Utils.newFloatArray(M);
var k = t.readInt(!0);
if (((O += k), 1 == s)) for (var R = k; R < O; R++) C[R] = t.readFloat();
else for (R = k; R < O; R++) C[R] = t.readFloat() * s;
if (!P) {
R = 0;
for (var L = C.length; R < L; R++) C[R] += A[R];
}
}
m.setFrame(g, v, C), g < p - 1 && this.readCurve(t, g, m);
}
n.push(m), (r = Math.max(r, m.frames[p - 1]));
}
}
}
var I = t.readInt(!0);
if (0 < I) {
m = new G.DrawOrderTimeline(I);
var D = i.slots.length;
for (h = 0; h < I; h++) {
v = t.readFloat();
var F = t.readInt(!0),
B = G.Utils.newArray(D, 0);
for (c = D - 1; 0 <= c; c--) B[c] = -1;
var N = G.Utils.newArray(D - F, 0),
U = 0,
Y = 0;
for (c = 0; c < F; c++) {
for (u = t.readInt(!0); U != u; ) N[Y++] = U++;
B[U + t.readInt(!0)] = U++;
}
for (; U < D; ) N[Y++] = U++;
for (c = D - 1; 0 <= c; c--) -1 == B[c] && (B[c] = N[--Y]);
m.setFrame(h, v, B);
}
n.push(m), (r = Math.max(r, m.frames[I - 1]));
}
var z = t.readInt(!0);
if (0 < z) {
for (m = new G.EventTimeline(z), h = 0; h < z; h++) {
v = t.readFloat();
var X = i.events[t.readInt(!0)],
V = new G.Event(v, X);
(V.intValue = t.readInt(!1)),
(V.floatValue = t.readFloat()),
(V.stringValue = t.readBoolean() ? t.readString() : X.stringValue),
null != V.data.audioPath && ((V.volume = t.readFloat()), (V.balance = t.readFloat())),
m.setFrame(h, V);
}
n.push(m), (r = Math.max(r, m.frames[z - 1]));
}
return new G.Animation(e, n, r);
}),
(j.prototype.readCurve = function (t, e, i) {
switch (t.readByte()) {
case j.CURVE_STEPPED:
i.setStepped(e);
break;
case j.CURVE_BEZIER:
this.setCurve(i, e, t.readFloat(), t.readFloat(), t.readFloat(), t.readFloat());
}
}),
(j.prototype.setCurve = function (t, e, i, n, s, r) {
t.setCurve(e, i, n, s, r);
}),
(j.AttachmentTypeValues = [0, 1, 2, 3, 4, 5, 6]),
(j.TransformModeValues = [G.TransformMode.Normal, G.TransformMode.OnlyTranslation, G.TransformMode.NoRotationOrReflection, G.TransformMode.NoScale, G.TransformMode.NoScaleOrReflection]),
(j.PositionModeValues = [G.PositionMode.Fixed, G.PositionMode.Percent]),
(j.SpacingModeValues = [G.SpacingMode.Length, G.SpacingMode.Fixed, G.SpacingMode.Percent]),
(j.RotateModeValues = [G.RotateMode.Tangent, G.RotateMode.Chain, G.RotateMode.ChainScale]),
(j.BlendModeValues = [G.BlendMode.Normal, G.BlendMode.Additive, G.BlendMode.Multiply, G.BlendMode.Screen]),
(j.BONE_ROTATE = 0),
(j.BONE_TRANSLATE = 1),
(j.BONE_SCALE = 2),
(j.BONE_SHEAR = 3),
(j.SLOT_ATTACHMENT = 0),
(j.SLOT_COLOR = 1),
(j.SLOT_TWO_COLOR = 2),
(j.PATH_POSITION = 0),
(j.PATH_SPACING = 1),
(j.PATH_MIX = 2),
(j.CURVE_LINEAR = 0),
(j.CURVE_STEPPED = 1),
(j.CURVE_BEZIER = 2),
j);
function j(t) {
(this.scale = 1), (this.linkedMeshes = new Array()), (this.attachmentLoader = t);
}
G.SkeletonBinary = t;
var x =
((e.prototype.readByte = function () {
return this.buffer.getInt8(this.index++);
}),
(e.prototype.readShort = function () {
var t = this.buffer.getInt16(this.index);
return (this.index += 2), t;
}),
(e.prototype.readInt32 = function () {
var t = this.buffer.getInt32(this.index);
return (this.index += 4), t;
}),
(e.prototype.readInt = function (t) {
var e = this.readByte(),
i = 127 & e;
return (
0 != (128 & e) &&
((i |= (127 & (e = this.readByte())) << 7),
0 != (128 & e) && ((i |= (127 & (e = this.readByte())) << 14), 0 != (128 & e) && ((i |= (127 & (e = this.readByte())) << 21), 0 != (128 & e) && (i |= (127 & this.readByte()) << 28)))),
t ? i : (i >>> 1) ^ -(1 & i)
);
}),
(e.prototype.readStringRef = function () {
var t = this.readInt(!0);
return 0 == t ? null : this.strings[t - 1];
}),
(e.prototype.readString = function () {
var t = this.readInt(!0);
switch (t) {
case 0:
return null;
case 1:
return "";
}
t--;
for (var e = "", i = 0; i < t; ) {
var n = this.readByte();
switch (n >> 4) {
case 12:
case 13:
(e += String.fromCharCode(((31 & n) << 6) | (63 & this.readByte()))), (i += 2);
break;
case 14:
(e += String.fromCharCode(((15 & n) << 12) | ((63 & this.readByte()) << 6) | (63 & this.readByte()))), (i += 3);
break;
default:
(e += String.fromCharCode(n)), i++;
}
}
return e;
}),
(e.prototype.readFloat = function () {
var t = this.buffer.getFloat32(this.index);
return (this.index += 4), t;
}),
(e.prototype.readBoolean = function () {
return 0 != this.readByte();
}),
e);
function e(t, e, i, n) {
void 0 === e && (e = new Array()), void 0 === i && (i = 0), void 0 === n && (n = new DataView(t.buffer)), (this.strings = e), (this.index = i), (this.buffer = n);
}
var N = function (t, e, i, n, s) {
(this.mesh = t), (this.skin = e), (this.slotIndex = i), (this.parent = n), (this.inheritDeform = s);
},
u = function (t, e) {
void 0 === t && (t = null), void 0 === e && (e = null), (this.bones = t), (this.vertices = e);
};
})((ge = ge || {})),
(C = ge = ge || {}),
(Ce.prototype.update = function (t, e) {
if (null == t) throw new Error("skeleton cannot be null.");
var i = this.boundingBoxes,
n = this.polygons,
s = this.polygonPool,
r = t.slots,
o = r.length;
(i.length = 0), s.freeAll(n);
for (var a = (n.length = 0); a < o; a++) {
var h,
l,
u,
c = r[a];
c.bone.active &&
(h = c.getAttachment()) instanceof C.BoundingBoxAttachment &&
((l = h), i.push(l), (u = s.obtain()).length != l.worldVerticesLength && (u = C.Utils.newFloatArray(l.worldVerticesLength)), n.push(u), l.computeWorldVertices(c, 0, l.worldVerticesLength, u, 0, 2));
}
e ? this.aabbCompute() : ((this.minX = Number.POSITIVE_INFINITY), (this.minY = Number.POSITIVE_INFINITY), (this.maxX = Number.NEGATIVE_INFINITY), (this.maxY = Number.NEGATIVE_INFINITY));
}),
(Ce.prototype.aabbCompute = function () {
for (var t = Number.POSITIVE_INFINITY, e = Number.POSITIVE_INFINITY, i = Number.NEGATIVE_INFINITY, n = Number.NEGATIVE_INFINITY, s = this.polygons, r = 0, o = s.length; r < o; r++)
for (var a = s[r], h = a, l = 0, u = a.length; l < u; l += 2) {
var c = h[l],
d = h[l + 1];
(t = Math.min(t, c)), (e = Math.min(e, d)), (i = Math.max(i, c)), (n = Math.max(n, d));
}
(this.minX = t), (this.minY = e), (this.maxX = i), (this.maxY = n);
}),
(Ce.prototype.aabbContainsPoint = function (t, e) {
return t >= this.minX && t <= this.maxX && e >= this.minY && e <= this.maxY;
}),
(Ce.prototype.aabbIntersectsSegment = function (t, e, i, n) {
var s = this.minX,
r = this.minY,
o = this.maxX,
a = this.maxY;
if ((t <= s && i <= s) || (e <= r && n <= r) || (o <= t && o <= i) || (a <= e && a <= n)) return !1;
var h = (n - e) / (i - t),
l = h * (s - t) + e;
if (r < l && l < a) return !0;
if (r < (l = h * (o - t) + e) && l < a) return !0;
var u = (r - e) / h + t;
return (s < u && u < o) || (s < (u = (a - e) / h + t) && u < o);
}),
(Ce.prototype.aabbIntersectsSkeleton = function (t) {
return this.minX < t.maxX && this.maxX > t.minX && this.minY < t.maxY && this.maxY > t.minY;
}),
(Ce.prototype.containsPoint = function (t, e) {
for (var i = this.polygons, n = 0, s = i.length; n < s; n++) if (this.containsPointPolygon(i[n], t, e)) return this.boundingBoxes[n];
return null;
}),
(Ce.prototype.containsPointPolygon = function (t, e, i) {
for (var n = t, s = t.length, r = s - 2, o = !1, a = 0; a < s; a += 2) {
var h,
l = n[a + 1],
u = n[r + 1];
!((l < i && i <= u) || (u < i && i <= l)) || ((h = n[a]) + ((i - l) / (u - l)) * (n[r] - h) < e && (o = !o)), (r = a);
}
return o;
}),
(Ce.prototype.intersectsSegment = function (t, e, i, n) {
for (var s = this.polygons, r = 0, o = s.length; r < o; r++) if (this.intersectsSegmentPolygon(s[r], t, e, i, n)) return this.boundingBoxes[r];
return null;
}),
(Ce.prototype.intersectsSegmentPolygon = function (t, e, i, n, s) {
for (var r = t, o = t.length, a = e - n, h = i - s, l = e * s - i * n, u = r[o - 2], c = r[o - 1], d = 0; d < o; d += 2) {
var f = r[d],
p = r[d + 1],
g = u * p - c * f,
v = u - f,
y = c - p,
m = a * y - h * v,
x = (l * v - a * g) / m;
if (((u <= x && x <= f) || (f <= x && x <= u)) && ((e <= x && x <= n) || (n <= x && x <= e))) {
var b = (l * y - h * g) / m;
if (((c <= b && b <= p) || (p <= b && b <= c)) && ((i <= b && b <= s) || (s <= b && b <= i))) return !0;
}
(u = f), (c = p);
}
return !1;
}),
(Ce.prototype.getPolygon = function (t) {
if (null == t) throw new Error("boundingBox cannot be null.");
var e = this.boundingBoxes.indexOf(t);
return -1 == e ? null : this.polygons[e];
}),
(Ce.prototype.getWidth = function () {
return this.maxX - this.minX;
}),
(Ce.prototype.getHeight = function () {
return this.maxY - this.minY;
}),
(O = Ce),
(C.SkeletonBounds = O),
(q = ge = ge || {}),
(Oe.prototype.clipStart = function (t, e) {
if (null != this.clipAttachment) return 0;
var i = (this.clipAttachment = e).worldVerticesLength,
n = q.Utils.setArraySize(this.clippingPolygon, i);
e.computeWorldVertices(t, 0, i, n, 0, 2);
var s = this.clippingPolygon;
Oe.makeClockwise(s);
for (var r = (this.clippingPolygons = this.triangulator.decompose(s, this.triangulator.triangulate(s))), o = 0, a = r.length; o < a; o++) {
var h = r[o];
Oe.makeClockwise(h), h.push(h[0]), h.push(h[1]);
}
return r.length;
}),
(Oe.prototype.clipEndWithSlot = function (t) {
null != this.clipAttachment && this.clipAttachment.endSlot == t.data && this.clipEnd();
}),
(Oe.prototype.clipEnd = function () {
null != this.clipAttachment && ((this.clipAttachment = null), (this.clippingPolygons = null), (this.clippedVertices.length = 0), (this.clippedTriangles.length = 0), (this.clippingPolygon.length = 0));
}),
(Oe.prototype.isClipping = function () {
return null != this.clipAttachment;
}),
(Oe.prototype.clipTriangles = function (t, e, i, n, s, r, o, a) {
var h = this.clipOutput,
l = this.clippedVertices,
u = this.clippedTriangles,
c = this.clippingPolygons,
d = this.clippingPolygons.length,
f = a ? 12 : 8,
p = 0;
l.length = 0;
t: for (var g = (u.length = 0); g < n; g += 3)
for (
var v = i[g] << 1, y = t[v], m = t[1 + v], x = s[v], b = s[1 + v], w = t[(v = i[g + 1] << 1)], T = t[1 + v], S = s[v], _ = s[1 + v], E = t[(v = i[g + 2] << 1)], P = t[1 + v], A = s[v], M = s[1 + v], C = 0;
C < d;
C++
) {
var O = l.length;
if (!this.clip(y, m, w, T, E, P, c[C], h)) {
((U = q.Utils.setArraySize(l, O + 3 * f))[O] = y),
(U[O + 1] = m),
(U[O + 2] = r.r),
(U[O + 3] = r.g),
(U[O + 4] = r.b),
(U[O + 5] = r.a),
a
? ((U[O + 6] = x),
(U[O + 7] = b),
(U[O + 8] = o.r),
(U[O + 9] = o.g),
(U[O + 10] = o.b),
(U[O + 11] = o.a),
(U[O + 12] = w),
(U[O + 13] = T),
(U[O + 14] = r.r),
(U[O + 15] = r.g),
(U[O + 16] = r.b),
(U[O + 17] = r.a),
(U[O + 18] = S),
(U[O + 19] = _),
(U[O + 20] = o.r),
(U[O + 21] = o.g),
(U[O + 22] = o.b),
(U[O + 23] = o.a),
(U[O + 24] = E),
(U[O + 25] = P),
(U[O + 26] = r.r),
(U[O + 27] = r.g),
(U[O + 28] = r.b),
(U[O + 29] = r.a),
(U[O + 30] = A),
(U[O + 31] = M),
(U[O + 32] = o.r),
(U[O + 33] = o.g),
(U[O + 34] = o.b),
(U[O + 35] = o.a))
: ((U[O + 6] = x),
(U[O + 7] = b),
(U[O + 8] = w),
(U[O + 9] = T),
(U[O + 10] = r.r),
(U[O + 11] = r.g),
(U[O + 12] = r.b),
(U[O + 13] = r.a),
(U[O + 14] = S),
(U[O + 15] = _),
(U[O + 16] = E),
(U[O + 17] = P),
(U[O + 18] = r.r),
(U[O + 19] = r.g),
(U[O + 20] = r.b),
(U[O + 21] = r.a),
(U[O + 22] = A),
(U[O + 23] = M)),
(O = u.length),
((K = q.Utils.setArraySize(u, O + 3))[O] = p),
(K[O + 1] = p + 1),
(K[O + 2] = p + 2),
(p += 3);
continue t;
}
var k = h.length;
if (0 != k) {
for (var R = T - P, L = E - w, I = y - E, D = P - m, F = 1 / (R * I + L * (m - P)), B = k >> 1, N = this.clipOutput, U = q.Utils.setArraySize(l, O + B * f), Y = 0; Y < k; Y += 2) {
var z = N[Y],
X = N[Y + 1];
(U[O] = z), (U[O + 1] = X), (U[O + 2] = r.r), (U[O + 3] = r.g), (U[O + 4] = r.b), (U[O + 5] = r.a);
var V = z - E,
G = X - P,
j = (R * V + L * G) * F,
H = (D * V + I * G) * F,
W = 1 - j - H;
(U[O + 6] = x * j + S * H + A * W), (U[O + 7] = b * j + _ * H + M * W), a && ((U[O + 8] = o.r), (U[O + 9] = o.g), (U[O + 10] = o.b), (U[O + 11] = o.a)), (O += f);
}
O = u.length;
var K = q.Utils.setArraySize(u, O + 3 * (B - 2));
for (B--, Y = 1; Y < B; Y++) (K[O] = p), (K[O + 1] = p + Y), (K[O + 2] = p + Y + 1), (O += 3);
p += 1 + B;
}
}
}),
(Oe.prototype.clip = function (t, e, i, n, s, r, o, a) {
var h = a,
l = !1,
u = null;
2 <= o.length % 4 ? ((u = a), (a = this.scratch)) : (u = this.scratch), (u.length = 0), u.push(t), u.push(e), u.push(i), u.push(n), u.push(s), u.push(r), u.push(t), u.push(e), (a.length = 0);
for (var c = o, d = o.length - 4, f = 0; ; f += 2) {
for (var p = c[f], g = c[f + 1], v = c[f + 2], y = c[f + 3], m = p - v, x = g - y, b = u, w = u.length - 2, T = a.length, S = 0; S < w; S += 2) {
var _ = b[S],
E = b[S + 1],
P = b[S + 2],
A = b[S + 3],
M = 0 < m * (A - y) - x * (P - v);
if (0 < m * (E - y) - x * (_ - v)) {
if (M) {
a.push(P), a.push(A);
continue;
}
var C,
O,
k,
R = (C = A - E) * (v - p) - (O = P - _) * (y - g);
1e-6 < Math.abs(R) ? ((k = (O * (g - E) - C * (p - _)) / R), a.push(p + (v - p) * k), a.push(g + (y - g) * k)) : (a.push(p), a.push(g));
} else
M &&
((R = (C = A - E) * (v - p) - (O = P - _) * (y - g)),
1e-6 < Math.abs(R) ? ((k = (O * (g - E) - C * (p - _)) / R), a.push(p + (v - p) * k), a.push(g + (y - g) * k)) : (a.push(p), a.push(g)),
a.push(P),
a.push(A));
l = !0;
}
if (T == a.length) return !(h.length = 0);
if ((a.push(a[0]), a.push(a[1]), f == d)) break;
var L = a;
((a = u).length = 0), (u = L);
}
if (h != a) {
f = h.length = 0;
for (var I = a.length - 2; f < I; f++) h[f] = a[f];
} else h.length = h.length - 2;
return l;
}),
(Oe.makeClockwise = function (t) {
for (var e, i, n, s = t, r = t.length, o = s[r - 2] * s[1] - s[0] * s[r - 1], a = 0, h = r - 3; a < h; a += 2) (e = s[a]), (i = s[a + 1]), (n = s[a + 2]), (o += e * s[a + 3] - n * i);
if (!(o < 0)) {
a = 0;
var l = r - 2;
for (h = r >> 1; a < h; a += 2) {
var u = s[a],
c = s[a + 1],
d = l - a;
(s[a] = s[d]), (s[a + 1] = s[1 + d]), (s[d] = u), (s[1 + d] = c);
}
}
}),
(R = Oe),
(q.SkeletonClipping = R),
(L = ge = ge || {}),
(ke.prototype.findBone = function (t) {
if (null == t) throw new Error("boneName cannot be null.");
for (var e = this.bones, i = 0, n = e.length; i < n; i++) {
var s = e[i];
if (s.name == t) return s;
}
return null;
}),
(ke.prototype.findBoneIndex = function (t) {
if (null == t) throw new Error("boneName cannot be null.");
for (var e = this.bones, i = 0, n = e.length; i < n; i++) if (e[i].name == t) return i;
return -1;
}),
(ke.prototype.findSlot = function (t) {
if (null == t) throw new Error("slotName cannot be null.");
for (var e = this.slots, i = 0, n = e.length; i < n; i++) {
var s = e[i];
if (s.name == t) return s;
}
return null;
}),
(ke.prototype.findSlotIndex = function (t) {
if (null == t) throw new Error("slotName cannot be null.");
for (var e = this.slots, i = 0, n = e.length; i < n; i++) if (e[i].name == t) return i;
return -1;
}),
(ke.prototype.findSkin = function (t) {
if (null == t) throw new Error("skinName cannot be null.");
for (var e = this.skins, i = 0, n = e.length; i < n; i++) {
var s = e[i];
if (s.name == t) return s;
}
return null;
}),
(ke.prototype.findEvent = function (t) {
if (null == t) throw new Error("eventDataName cannot be null.");
for (var e = this.events, i = 0, n = e.length; i < n; i++) {
var s = e[i];
if (s.name == t) return s;
}
return null;
}),
(ke.prototype.findAnimation = function (t) {
if (null == t) throw new Error("animationName cannot be null.");
for (var e = this.animations, i = 0, n = e.length; i < n; i++) {
var s = e[i];
if (s.name == t) return s;
}
return null;
}),
(ke.prototype.findIkConstraint = function (t) {
if (null == t) throw new Error("constraintName cannot be null.");
for (var e = this.ikConstraints, i = 0, n = e.length; i < n; i++) {
var s = e[i];
if (s.name == t) return s;
}
return null;
}),
(ke.prototype.findTransformConstraint = function (t) {
if (null == t) throw new Error("constraintName cannot be null.");
for (var e = this.transformConstraints, i = 0, n = e.length; i < n; i++) {
var s = e[i];
if (s.name == t) return s;
}
return null;
}),
(ke.prototype.findPathConstraint = function (t) {
if (null == t) throw new Error("constraintName cannot be null.");
for (var e = this.pathConstraints, i = 0, n = e.length; i < n; i++) {
var s = e[i];
if (s.name == t) return s;
}
return null;
}),
(ke.prototype.findPathConstraintIndex = function (t) {
if (null == t) throw new Error("pathConstraintName cannot be null.");
for (var e = this.pathConstraints, i = 0, n = e.length; i < n; i++) if (e[i].name == t) return i;
return -1;
}),
(I = ke),
(L.SkeletonData = I),
(function (tt) {
var t =
((I.prototype.readSkeletonData = function (t) {
var e = this.scale,
i = new tt.SkeletonData(),
n = "string" == typeof t ? JSON.parse(t) : t,
s = n.skeleton;
if (null != s) {
if (((i.hash = s.hash), (i.version = s.spine), "3.8.75" == i.version)) throw new Error("Unsupported skeleton data, please export with a newer version of Spine.");
(i.x = s.x), (i.y = s.y), (i.width = s.width), (i.height = s.height), (i.fps = s.fps), (i.imagesPath = s.images);
}
if (n.bones)
for (var r = 0; r < n.bones.length; r++) {
var o = n.bones[r],
a = null,
h = this.getValue(o, "parent", null);
if (null != h && null == (a = i.findBone(h))) throw new Error("Parent bone not found: " + h);
((d = new tt.BoneData(i.bones.length, o.name, a)).length = this.getValue(o, "length", 0) * e),
(d.x = this.getValue(o, "x", 0) * e),
(d.y = this.getValue(o, "y", 0) * e),
(d.rotation = this.getValue(o, "rotation", 0)),
(d.scaleX = this.getValue(o, "scaleX", 1)),
(d.scaleY = this.getValue(o, "scaleY", 1)),
(d.shearX = this.getValue(o, "shearX", 0)),
(d.shearY = this.getValue(o, "shearY", 0)),
(d.transformMode = I.transformModeFromString(this.getValue(o, "transform", "normal"))),
(d.skinRequired = this.getValue(o, "skin", !1)),
i.bones.push(d);
}
if (n.slots)
for (r = 0; r < n.slots.length; r++) {
var l = (_ = n.slots[r]).name,
u = _.bone,
c = i.findBone(u);
if (null == c) throw new Error("Slot bone not found: " + u);
var d = new tt.SlotData(i.slots.length, l, c),
f = this.getValue(_, "color", null);
null != f && d.color.setFromString(f);
var p = this.getValue(_, "dark", null);
null != p && ((d.darkColor = new tt.Color(1, 1, 1, 1)), d.darkColor.setFromString(p)),
(d.attachmentName = this.getValue(_, "attachment", null)),
(d.blendMode = I.blendModeFromString(this.getValue(_, "blend", "normal"))),
i.slots.push(d);
}
if (n.ik)
for (r = 0; r < n.ik.length; r++) {
var g = n.ik[r];
((d = new tt.IkConstraintData(g.name)).order = this.getValue(g, "order", 0)), (d.skinRequired = this.getValue(g, "skin", !1));
for (var v = 0; v < g.bones.length; v++) {
if (((u = g.bones[v]), null == (b = i.findBone(u)))) throw new Error("IK bone not found: " + u);
d.bones.push(b);
}
var y = g.target;
if (((d.target = i.findBone(y)), null == d.target)) throw new Error("IK target bone not found: " + y);
(d.mix = this.getValue(g, "mix", 1)),
(d.softness = this.getValue(g, "softness", 0) * e),
(d.bendDirection = this.getValue(g, "bendPositive", !0) ? 1 : -1),
(d.compress = this.getValue(g, "compress", !1)),
(d.stretch = this.getValue(g, "stretch", !1)),
(d.uniform = this.getValue(g, "uniform", !1)),
i.ikConstraints.push(d);
}
if (n.transform)
for (r = 0; r < n.transform.length; r++) {
for (g = n.transform[r], (d = new tt.TransformConstraintData(g.name)).order = this.getValue(g, "order", 0), d.skinRequired = this.getValue(g, "skin", !1), v = 0; v < g.bones.length; v++) {
if (((u = g.bones[v]), null == (b = i.findBone(u)))) throw new Error("Transform constraint bone not found: " + u);
d.bones.push(b);
}
if (((y = g.target), (d.target = i.findBone(y)), null == d.target)) throw new Error("Transform constraint target bone not found: " + y);
(d.local = this.getValue(g, "local", !1)),
(d.relative = this.getValue(g, "relative", !1)),
(d.offsetRotation = this.getValue(g, "rotation", 0)),
(d.offsetX = this.getValue(g, "x", 0) * e),
(d.offsetY = this.getValue(g, "y", 0) * e),
(d.offsetScaleX = this.getValue(g, "scaleX", 0)),
(d.offsetScaleY = this.getValue(g, "scaleY", 0)),
(d.offsetShearY = this.getValue(g, "shearY", 0)),
(d.rotateMix = this.getValue(g, "rotateMix", 1)),
(d.translateMix = this.getValue(g, "translateMix", 1)),
(d.scaleMix = this.getValue(g, "scaleMix", 1)),
(d.shearMix = this.getValue(g, "shearMix", 1)),
i.transformConstraints.push(d);
}
if (n.path)
for (r = 0; r < n.path.length; r++) {
for (g = n.path[r], (d = new tt.PathConstraintData(g.name)).order = this.getValue(g, "order", 0), d.skinRequired = this.getValue(g, "skin", !1), v = 0; v < g.bones.length; v++) {
if (((u = g.bones[v]), null == (b = i.findBone(u)))) throw new Error("Transform constraint bone not found: " + u);
d.bones.push(b);
}
if (((y = g.target), (d.target = i.findSlot(y)), null == d.target)) throw new Error("Path target slot not found: " + y);
(d.positionMode = I.positionModeFromString(this.getValue(g, "positionMode", "percent"))),
(d.spacingMode = I.spacingModeFromString(this.getValue(g, "spacingMode", "length"))),
(d.rotateMode = I.rotateModeFromString(this.getValue(g, "rotateMode", "tangent"))),
(d.offsetRotation = this.getValue(g, "rotation", 0)),
(d.position = this.getValue(g, "position", 0)),
d.positionMode == tt.PositionMode.Fixed && (d.position *= e),
(d.spacing = this.getValue(g, "spacing", 0)),
(d.spacingMode != tt.SpacingMode.Length && d.spacingMode != tt.SpacingMode.Fixed) || (d.spacing *= e),
(d.rotateMix = this.getValue(g, "rotateMix", 1)),
(d.translateMix = this.getValue(g, "translateMix", 1)),
i.pathConstraints.push(d);
}
if (n.skins)
for (r = 0; r < n.skins.length; r++) {
var m = n.skins[r],
x = new tt.Skin(m.name);
if (m.bones)
for (var b, w = 0; w < m.bones.length; w++) {
if (null == (b = i.findBone(m.bones[w]))) throw new Error("Skin bone not found: " + m.bones[r]);
x.bones.push(b);
}
if (m.ik)
for (w = 0; w < m.ik.length; w++) {
if (null == (T = i.findIkConstraint(m.ik[w]))) throw new Error("Skin IK constraint not found: " + m.ik[r]);
x.constraints.push(T);
}
if (m.transform)
for (w = 0; w < m.transform.length; w++) {
if (null == (T = i.findTransformConstraint(m.transform[w]))) throw new Error("Skin transform constraint not found: " + m.transform[r]);
x.constraints.push(T);
}
if (m.path) {
var T;
for (w = 0; w < m.path.length; w++) {
if (null == (T = i.findPathConstraint(m.path[w]))) throw new Error("Skin path constraint not found: " + m.path[r]);
x.constraints.push(T);
}
}
for (var l in m.attachments) {
var S = i.findSlot(l);
if (null == S) throw new Error("Slot not found: " + l);
var _ = m.attachments[l];
for (var E in _) {
var P = this.readAttachment(_[E], x, S.index, E, i);
null != P && x.setAttachment(S.index, E, P);
}
}
i.skins.push(x), "default" == x.name && (i.defaultSkin = x);
}
r = 0;
for (var A = this.linkedMeshes.length; r < A; r++) {
var M = this.linkedMeshes[r];
if (null == (x = null == M.skin ? i.defaultSkin : i.findSkin(M.skin))) throw new Error("Skin not found: " + M.skin);
var C = x.getAttachment(M.slotIndex, M.parent);
if (null == C) throw new Error("Parent mesh not found: " + M.parent);
(M.mesh.deformAttachment = M.inheritDeform ? C : M.mesh), M.mesh.setParentMesh(C), M.mesh.updateUVs();
}
if (((this.linkedMeshes.length = 0), n.events))
for (var O in n.events) {
var k = n.events[O];
((d = new tt.EventData(O)).intValue = this.getValue(k, "int", 0)),
(d.floatValue = this.getValue(k, "float", 0)),
(d.stringValue = this.getValue(k, "string", "")),
(d.audioPath = this.getValue(k, "audio", null)),
null != d.audioPath && ((d.volume = this.getValue(k, "volume", 1)), (d.balance = this.getValue(k, "balance", 0))),
i.events.push(d);
}
if (n.animations)
for (var R in n.animations) {
var L = n.animations[R];
this.readAnimation(L, R, i);
}
return i;
}),
(I.prototype.readAttachment = function (t, e, i, n, s) {
var r = this.scale;
switch (((n = this.getValue(t, "name", n)), this.getValue(t, "type", "region"))) {
case "region":
var o = this.getValue(t, "path", n),
a = this.attachmentLoader.newRegionAttachment(e, n, o);
return null == a
? null
: ((a.path = o),
(a.x = this.getValue(t, "x", 0) * r),
(a.y = this.getValue(t, "y", 0) * r),
(a.scaleX = this.getValue(t, "scaleX", 1)),
(a.scaleY = this.getValue(t, "scaleY", 1)),
(a.rotation = this.getValue(t, "rotation", 0)),
(a.width = t.width * r),
(a.height = t.height * r),
null != (x = this.getValue(t, "color", null)) && a.color.setFromString(x),
a.updateOffset(),
a);
case "boundingbox":
var h = this.attachmentLoader.newBoundingBoxAttachment(e, n);
return null == h ? null : (this.readVertices(t, h, t.vertexCount << 1), null != (x = this.getValue(t, "color", null)) && h.color.setFromString(x), h);
case "mesh":
case "linkedmesh":
o = this.getValue(t, "path", n);
var l = this.attachmentLoader.newMeshAttachment(e, n, o);
if (null == l) return null;
(l.path = o), null != (x = this.getValue(t, "color", null)) && l.color.setFromString(x), (l.width = this.getValue(t, "width", 0) * r), (l.height = this.getValue(t, "height", 0) * r);
var u = this.getValue(t, "parent", null);
if (null != u) return this.linkedMeshes.push(new b(l, this.getValue(t, "skin", null), i, u, this.getValue(t, "deform", !0))), l;
var c = t.uvs;
return (
this.readVertices(t, l, c.length), (l.triangles = t.triangles), (l.regionUVs = c), l.updateUVs(), (l.edges = this.getValue(t, "edges", null)), (l.hullLength = 2 * this.getValue(t, "hull", 0)), l
);
case "path":
if (null == (o = this.attachmentLoader.newPathAttachment(e, n))) return null;
(o.closed = this.getValue(t, "closed", !1)), (o.constantSpeed = this.getValue(t, "constantSpeed", !0));
var d = t.vertexCount;
this.readVertices(t, o, d << 1);
for (var f = tt.Utils.newArray(d / 3, 0), p = 0; p < t.lengths.length; p++) f[p] = t.lengths[p] * r;
return (o.lengths = f), null != (x = this.getValue(t, "color", null)) && o.color.setFromString(x), o;
case "point":
var g = this.attachmentLoader.newPointAttachment(e, n);
return null == g
? null
: ((g.x = this.getValue(t, "x", 0) * r),
(g.y = this.getValue(t, "y", 0) * r),
(g.rotation = this.getValue(t, "rotation", 0)),
null != (x = this.getValue(t, "color", null)) && g.color.setFromString(x),
g);
case "clipping":
var v = this.attachmentLoader.newClippingAttachment(e, n);
if (null == v) return null;
var y = this.getValue(t, "end", null);
if (null != y) {
var m = s.findSlot(y);
if (null == m) throw new Error("Clipping end slot not found: " + y);
v.endSlot = m;
}
var x;
d = t.vertexCount;
return this.readVertices(t, v, d << 1), null != (x = this.getValue(t, "color", null)) && v.color.setFromString(x), v;
}
return null;
}),
(I.prototype.readVertices = function (t, e, i) {
var n = this.scale;
e.worldVerticesLength = i;
var s = t.vertices;
if (i != s.length) {
for (var r = new Array(), o = new Array(), a = 0, h = s.length; a < h; ) {
var l = s[a++];
o.push(l);
for (var u = a + 4 * l; a < u; a += 4) o.push(s[a]), r.push(s[a + 1] * n), r.push(s[a + 2] * n), r.push(s[a + 3]);
}
(e.bones = o), (e.vertices = tt.Utils.toFloatArray(r));
} else {
var c = tt.Utils.toFloatArray(s);
if (1 != n) for (a = 0, h = s.length; a < h; a++) c[a] *= n;
e.vertices = c;
}
}),
(I.prototype.readAnimation = function (t, e, i) {
var n = this.scale,
s = new Array(),
r = 0;
if (t.slots)
for (var o in t.slots) {
var a = t.slots[o];
if (-1 == (q = i.findSlotIndex(o))) throw new Error("Slot not found: " + o);
for (var h in a) {
var l = a[h];
if ("attachment" == h) {
(x = new tt.AttachmentTimeline(l.length)).slotIndex = q;
for (var u = 0, c = 0; c < l.length; c++) {
var d = l[c];
x.setFrame(u++, this.getValue(d, "time", 0), d.name);
}
s.push(x), (r = Math.max(r, x.frames[x.getFrameCount() - 1]));
} else if ("color" == h) {
for ((x = new tt.ColorTimeline(l.length)).slotIndex = q, c = u = 0; c < l.length; c++) {
d = l[c];
var f = new tt.Color();
f.setFromString(d.color), x.setFrame(u, this.getValue(d, "time", 0), f.r, f.g, f.b, f.a), this.readCurve(d, x, u), u++;
}
s.push(x), (r = Math.max(r, x.frames[(x.getFrameCount() - 1) * tt.ColorTimeline.ENTRIES]));
} else {
if ("twoColor" != h) throw new Error("Invalid timeline type for a slot: " + h + " (" + o + ")");
for ((x = new tt.TwoColorTimeline(l.length)).slotIndex = q, c = u = 0; c < l.length; c++) {
d = l[c];
var p = new tt.Color(),
g = new tt.Color();
p.setFromString(d.light), g.setFromString(d.dark), x.setFrame(u, this.getValue(d, "time", 0), p.r, p.g, p.b, p.a, g.r, g.g, g.b), this.readCurve(d, x, u), u++;
}
s.push(x), (r = Math.max(r, x.frames[(x.getFrameCount() - 1) * tt.TwoColorTimeline.ENTRIES]));
}
}
}
if (t.bones)
for (var v in t.bones) {
var y = t.bones[v],
m = i.findBoneIndex(v);
if (-1 == m) throw new Error("Bone not found: " + v);
for (var h in y)
if (((l = y[h]), "rotate" === h)) {
for ((x = new tt.RotateTimeline(l.length)).boneIndex = m, c = u = 0; c < l.length; c++)
(d = l[c]), x.setFrame(u, this.getValue(d, "time", 0), this.getValue(d, "angle", 0)), this.readCurve(d, x, u), u++;
s.push(x), (r = Math.max(r, x.frames[(x.getFrameCount() - 1) * tt.RotateTimeline.ENTRIES]));
} else {
if ("translate" !== h && "scale" !== h && "shear" !== h) throw new Error("Invalid timeline type for a bone: " + h + " (" + v + ")");
var x = null,
b = 1,
w = 0;
for (
"scale" === h ? ((x = new tt.ScaleTimeline(l.length)), (w = 1)) : "shear" === h ? (x = new tt.ShearTimeline(l.length)) : ((x = new tt.TranslateTimeline(l.length)), (b = n)),
x.boneIndex = m,
c = u = 0;
c < l.length;
c++
) {
d = l[c];
var T = this.getValue(d, "x", w),
S = this.getValue(d, "y", w);
x.setFrame(u, this.getValue(d, "time", 0), T * b, S * b), this.readCurve(d, x, u), u++;
}
s.push(x), (r = Math.max(r, x.frames[(x.getFrameCount() - 1) * tt.TranslateTimeline.ENTRIES]));
}
}
if (t.ik)
for (var _ in t.ik) {
var E = t.ik[_],
P = i.findIkConstraint(_);
for ((x = new tt.IkConstraintTimeline(E.length)).ikConstraintIndex = i.ikConstraints.indexOf(P), c = u = 0; c < E.length; c++)
(d = E[c]),
x.setFrame(
u,
this.getValue(d, "time", 0),
this.getValue(d, "mix", 1),
this.getValue(d, "softness", 0) * n,
this.getValue(d, "bendPositive", !0) ? 1 : -1,
this.getValue(d, "compress", !1),
this.getValue(d, "stretch", !1)
),
this.readCurve(d, x, u),
u++;
s.push(x), (r = Math.max(r, x.frames[(x.getFrameCount() - 1) * tt.IkConstraintTimeline.ENTRIES]));
}
if (t.transform)
for (var _ in t.transform) {
for (
E = t.transform[_], P = i.findTransformConstraint(_), (x = new tt.TransformConstraintTimeline(E.length)).transformConstraintIndex = i.transformConstraints.indexOf(P), c = u = 0;
c < E.length;
c++
)
(d = E[c]),
x.setFrame(u, this.getValue(d, "time", 0), this.getValue(d, "rotateMix", 1), this.getValue(d, "translateMix", 1), this.getValue(d, "scaleMix", 1), this.getValue(d, "shearMix", 1)),
this.readCurve(d, x, u),
u++;
s.push(x), (r = Math.max(r, x.frames[(x.getFrameCount() - 1) * tt.TransformConstraintTimeline.ENTRIES]));
}
if (t.path)
for (var _ in t.path) {
E = t.path[_];
var A = i.findPathConstraintIndex(_);
if (-1 == A) throw new Error("Path constraint not found: " + _);
var M = i.pathConstraints[A];
for (var h in E)
if (((l = E[h]), "position" === h || "spacing" === h)) {
(x = null), (b = 1);
for (
"spacing" === h
? ((x = new tt.PathConstraintSpacingTimeline(l.length)), (M.spacingMode != tt.SpacingMode.Length && M.spacingMode != tt.SpacingMode.Fixed) || (b = n))
: ((x = new tt.PathConstraintPositionTimeline(l.length)), M.positionMode == tt.PositionMode.Fixed && (b = n)),
x.pathConstraintIndex = A,
c = u = 0;
c < l.length;
c++
)
(d = l[c]), x.setFrame(u, this.getValue(d, "time", 0), this.getValue(d, h, 0) * b), this.readCurve(d, x, u), u++;
s.push(x), (r = Math.max(r, x.frames[(x.getFrameCount() - 1) * tt.PathConstraintPositionTimeline.ENTRIES]));
} else if ("mix" === h) {
for ((x = new tt.PathConstraintMixTimeline(l.length)).pathConstraintIndex = A, c = u = 0; c < l.length; c++)
(d = l[c]), x.setFrame(u, this.getValue(d, "time", 0), this.getValue(d, "rotateMix", 1), this.getValue(d, "translateMix", 1)), this.readCurve(d, x, u), u++;
s.push(x), (r = Math.max(r, x.frames[(x.getFrameCount() - 1) * tt.PathConstraintMixTimeline.ENTRIES]));
}
}
if (t.deform)
for (var C in t.deform) {
var O = t.deform[C],
k = i.findSkin(C);
if (null == k) throw new Error("Skin not found: " + C);
for (var o in O) {
if (((a = O[o]), -1 == (q = i.findSlotIndex(o)))) throw new Error("Slot not found: " + a.name);
for (var h in a) {
l = a[h];
var R = k.getAttachment(q, h);
if (null == R) throw new Error("Deform attachment not found: " + l.name);
var L = null != R.bones,
I = R.vertices,
D = L ? (I.length / 3) * 2 : I.length;
((x = new tt.DeformTimeline(l.length)).slotIndex = q), (x.attachment = R);
u = 0;
for (var F = 0; F < l.length; F++) {
d = l[F];
var B = void 0,
N = this.getValue(d, "vertices", null);
if (null == N) B = L ? tt.Utils.newFloatArray(D) : I;
else {
B = tt.Utils.newFloatArray(D);
var U = this.getValue(d, "offset", 0);
if ((tt.Utils.arrayCopy(N, 0, B, U, N.length), 1 != n)) for (var Y = (c = U) + N.length; c < Y; c++) B[c] *= n;
if (!L) for (c = 0; c < D; c++) B[c] += I[c];
}
x.setFrame(u, this.getValue(d, "time", 0), B), this.readCurve(d, x, u), u++;
}
s.push(x), (r = Math.max(r, x.frames[x.getFrameCount() - 1]));
}
}
}
var z = t.drawOrder;
if ((null == z && (z = t.draworder), null != z)) {
x = new tt.DrawOrderTimeline(z.length);
var X = i.slots.length;
for (u = 0, F = 0; F < z.length; F++) {
var V = z[F],
G = null,
j = this.getValue(V, "offsets", null);
if (null != j) {
G = tt.Utils.newArray(X, -1);
var H = tt.Utils.newArray(X - j.length, 0),
W = 0,
K = 0;
for (c = 0; c < j.length; c++) {
var q,
Z = j[c];
if (-1 == (q = i.findSlotIndex(Z.slot))) throw new Error("Slot not found: " + Z.slot);
for (; W != q; ) H[K++] = W++;
G[W + Z.offset] = W++;
}
for (; W < X; ) H[K++] = W++;
for (c = X - 1; 0 <= c; c--) -1 == G[c] && (G[c] = H[--K]);
}
x.setFrame(u++, this.getValue(V, "time", 0), G);
}
s.push(x), (r = Math.max(r, x.frames[x.getFrameCount() - 1]));
}
if (t.events) {
for (x = new tt.EventTimeline(t.events.length), c = u = 0; c < t.events.length; c++) {
var J = t.events[c],
Q = i.findEvent(J.name);
if (null == Q) throw new Error("Event not found: " + J.name);
var $ = new tt.Event(tt.Utils.toSinglePrecision(this.getValue(J, "time", 0)), Q);
($.intValue = this.getValue(J, "int", Q.intValue)),
($.floatValue = this.getValue(J, "float", Q.floatValue)),
($.stringValue = this.getValue(J, "string", Q.stringValue)),
null != $.data.audioPath && (($.volume = this.getValue(J, "volume", 1)), ($.balance = this.getValue(J, "balance", 0))),
x.setFrame(u++, $);
}
s.push(x), (r = Math.max(r, x.frames[x.getFrameCount() - 1]));
}
if (isNaN(r)) throw new Error("Error while parsing animation, duration is NaN");
i.animations.push(new tt.Animation(e, s, r));
}),
(I.prototype.readCurve = function (t, e, i) {
var n;
t.hasOwnProperty("curve") && ("stepped" == t.curve ? e.setStepped(i) : ((n = t.curve), e.setCurve(i, n, this.getValue(t, "c2", 0), this.getValue(t, "c3", 1), this.getValue(t, "c4", 1))));
}),
(I.prototype.getValue = function (t, e, i) {
return void 0 !== t[e] ? t[e] : i;
}),
(I.blendModeFromString = function (t) {
if ("normal" == (t = t.toLowerCase())) return tt.BlendMode.Normal;
if ("additive" == t) return tt.BlendMode.Additive;
if ("multiply" == t) return tt.BlendMode.Multiply;
if ("screen" == t) return tt.BlendMode.Screen;
throw new Error("Unknown blend mode: " + t);
}),
(I.positionModeFromString = function (t) {
if ("fixed" == (t = t.toLowerCase())) return tt.PositionMode.Fixed;
if ("percent" == t) return tt.PositionMode.Percent;
throw new Error("Unknown position mode: " + t);
}),
(I.spacingModeFromString = function (t) {
if ("length" == (t = t.toLowerCase())) return tt.SpacingMode.Length;
if ("fixed" == t) return tt.SpacingMode.Fixed;
if ("percent" == t) return tt.SpacingMode.Percent;
throw new Error("Unknown position mode: " + t);
}),
(I.rotateModeFromString = function (t) {
if ("tangent" == (t = t.toLowerCase())) return tt.RotateMode.Tangent;
if ("chain" == t) return tt.RotateMode.Chain;
if ("chainscale" == t) return tt.RotateMode.ChainScale;
throw new Error("Unknown rotate mode: " + t);
}),
(I.transformModeFromString = function (t) {
if ("normal" == (t = t.toLowerCase())) return tt.TransformMode.Normal;
if ("onlytranslation" == t) return tt.TransformMode.OnlyTranslation;
if ("norotationorreflection" == t) return tt.TransformMode.NoRotationOrReflection;
if ("noscale" == t) return tt.TransformMode.NoScale;
if ("noscaleorreflection" == t) return tt.TransformMode.NoScaleOrReflection;
throw new Error("Unknown transform mode: " + t);
}),
I);
function I(t) {
(this.scale = 1), (this.linkedMeshes = new Array()), (this.attachmentLoader = t);
}
tt.SkeletonJson = t;
var b = function (t, e, i, n, s) {
(this.mesh = t), (this.skin = e), (this.slotIndex = i), (this.parent = n), (this.inheritDeform = s);
};
})((ge = ge || {})),
(function (h) {
var r = function (t, e, i) {
(this.slotIndex = t), (this.name = e), (this.attachment = i);
};
h.SkinEntry = r;
var t =
((e.prototype.setAttachment = function (t, e, i) {
if (null == i) throw new Error("attachment cannot be null.");
var n = this.attachments;
t >= n.length && (n.length = t + 1), n[t] || (n[t] = {}), (n[t][e] = i);
}),
(e.prototype.addSkin = function (t) {
for (var e = 0; e < t.bones.length; e++) {
for (var i = t.bones[e], n = !1, s = 0; s < this.bones.length; s++)
if (this.bones[s] == i) {
n = !0;
break;
}
n || this.bones.push(i);
}
for (e = 0; e < t.constraints.length; e++) {
var r = t.constraints[e];
for (n = !1, s = 0; s < this.constraints.length; s++)
if (this.constraints[s] == r) {
n = !0;
break;
}
n || this.constraints.push(r);
}
var o = t.getAttachments();
for (e = 0; e < o.length; e++) {
var a = o[e];
this.setAttachment(a.slotIndex, a.name, a.attachment);
}
}),
(e.prototype.copySkin = function (t) {
for (var e = 0; e < t.bones.length; e++) {
for (var i = t.bones[e], n = !1, s = 0; s < this.bones.length; s++)
if (this.bones[s] == i) {
n = !0;
break;
}
n || this.bones.push(i);
}
for (e = 0; e < t.constraints.length; e++) {
var r = t.constraints[e];
for (n = !1, s = 0; s < this.constraints.length; s++)
if (this.constraints[s] == r) {
n = !0;
break;
}
n || this.constraints.push(r);
}
var o = t.getAttachments();
for (e = 0; e < o.length; e++) {
var a = o[e];
null != a.attachment &&
(a.attachment instanceof h.MeshAttachment ? (a.attachment = a.attachment.newLinkedMesh()) : (a.attachment = a.attachment.copy()), this.setAttachment(a.slotIndex, a.name, a.attachment));
}
}),
(e.prototype.getAttachment = function (t, e) {
var i = this.attachments[t];
return i ? i[e] : null;
}),
(e.prototype.removeAttachment = function (t, e) {
var i = this.attachments[t];
i && (i[e] = null);
}),
(e.prototype.getAttachments = function () {
for (var t = new Array(), e = 0; e < this.attachments.length; e++) {
var i = this.attachments[e];
if (i)
for (var n in i) {
var s = i[n];
s && t.push(new r(e, n, s));
}
}
return t;
}),
(e.prototype.getAttachmentsForSlot = function (t, e) {
var i = this.attachments[t];
if (i)
for (var n in i) {
var s = i[n];
s && e.push(new r(t, n, s));
}
}),
(e.prototype.clear = function () {
(this.attachments.length = 0), (this.bones.length = 0), (this.constraints.length = 0);
}),
(e.prototype.attachAll = function (t, e) {
for (var i = 0, n = 0; n < t.slots.length; n++) {
var s = t.slots[n],
r = s.getAttachment();
if (r && i < e.attachments.length) {
var o = e.attachments[i];
for (var a in o)
if (r == o[a]) {
var h = this.getAttachment(i, a);
null != h && s.setAttachment(h);
break;
}
}
i++;
}
}),
e);
function e(t) {
if (((this.attachments = new Array()), (this.bones = Array()), (this.constraints = new Array()), null == t)) throw new Error("name cannot be null.");
this.name = t;
}
h.Skin = t;
})((ge = ge || {})),
(D = ge = ge || {}),
(Re.prototype.getSkeleton = function () {
return this.bone.skeleton;
}),
(Re.prototype.getAttachment = function () {
return this.attachment;
}),
(Re.prototype.setAttachment = function (t) {
this.attachment != t && ((this.attachment = t), (this.attachmentTime = this.bone.skeleton.time), (this.deform.length = 0));
}),
(Re.prototype.setAttachmentTime = function (t) {
this.attachmentTime = this.bone.skeleton.time - t;
}),
(Re.prototype.getAttachmentTime = function () {
return this.bone.skeleton.time - this.attachmentTime;
}),
(Re.prototype.setToSetupPose = function () {
this.color.setFromColor(this.data.color),
null != this.darkColor && this.darkColor.setFromColor(this.data.darkColor),
null == this.data.attachmentName ? (this.attachment = null) : ((this.attachment = null), this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName)));
}),
(F = Re),
(D.Slot = F),
((B = ge = ge || {}).SlotData = function (t, e, i) {
if (((this.color = new B.Color(1, 1, 1, 1)), t < 0)) throw new Error("index must be >= 0.");
if (null == e) throw new Error("name cannot be null.");
if (null == i) throw new Error("boneData cannot be null.");
(this.index = t), (this.name = e), (this.boneData = i);
}),
(function (t) {
var e,
i,
n,
s,
r =
((o.prototype.getImage = function () {
return this._image;
}),
(o.filterFromString = function (t) {
switch (t.toLowerCase()) {
case "nearest":
return e.Nearest;
case "linear":
return e.Linear;
case "mipmap":
return e.MipMap;
case "mipmapnearestnearest":
return e.MipMapNearestNearest;
case "mipmaplinearnearest":
return e.MipMapLinearNearest;
case "mipmapnearestlinear":
return e.MipMapNearestLinear;
case "mipmaplinearlinear":
return e.MipMapLinearLinear;
default:
throw new Error("Unknown texture filter " + t);
}
}),
(o.wrapFromString = function (t) {
switch (t.toLowerCase()) {
case "mirroredtepeat":
return n.MirroredRepeat;
case "clamptoedge":
return n.ClampToEdge;
case "repeat":
return n.Repeat;
default:
throw new Error("Unknown texture wrap " + t);
}
}),
o);
function o(t) {
this._image = t;
}
(t.Texture = r),
((i = e = t.TextureFilter || (t.TextureFilter = {}))[(i.Nearest = 9728)] = "Nearest"),
(i[(i.Linear = 9729)] = "Linear"),
(i[(i.MipMap = 9987)] = "MipMap"),
(i[(i.MipMapNearestNearest = 9984)] = "MipMapNearestNearest"),
(i[(i.MipMapLinearNearest = 9985)] = "MipMapLinearNearest"),
(i[(i.MipMapNearestLinear = 9986)] = "MipMapNearestLinear"),
(i[(i.MipMapLinearLinear = 9987)] = "MipMapLinearLinear"),
((s = n = t.TextureWrap || (t.TextureWrap = {}))[(s.MirroredRepeat = 33648)] = "MirroredRepeat"),
(s[(s.ClampToEdge = 33071)] = "ClampToEdge"),
(s[(s.Repeat = 10497)] = "Repeat"),
(t.TextureRegion = function () {
(this.u = 0), (this.v = 0), (this.u2 = 0), (this.v2 = 0), (this.width = 0), (this.height = 0), (this.rotate = !1), (this.offsetX = 0), (this.offsetY = 0), (this.originalWidth = 0), (this.originalHeight = 0);
});
var a,
h = (ye(l, (a = r)), (l.prototype.setFilters = function (t, e) {}), (l.prototype.setWraps = function (t, e) {}), (l.prototype.dispose = function () {}), l);
function l() {
return (null !== a && a.apply(this, arguments)) || this;
}
t.FakeTexture = h;
})((ge = ge || {})),
(function (f) {
var t =
((e.prototype.load = function (t, e) {
if (null == e) throw new Error("textureLoader cannot be null.");
for (var i = new p(t), n = new Array(4), s = null; ; ) {
var r,
o,
a,
h,
l,
u,
c,
d = i.readLine();
if (null == d) break;
0 == (d = d.trim()).length
? (s = null)
: s
? (((r = new v()).name = d),
(r.page = s),
"true" == (o = i.readValue()).toLocaleLowerCase() ? (r.degrees = 90) : "false" == o.toLocaleLowerCase() ? (r.degrees = 0) : (r.degrees = parseFloat(o)),
(r.rotate = 90 == r.degrees),
i.readTuple(n),
(a = parseInt(n[0])),
(h = parseInt(n[1])),
i.readTuple(n),
(l = parseInt(n[0])),
(u = parseInt(n[1])),
(r.u = a / s.width),
(r.v = h / s.height),
r.rotate ? ((r.u2 = (a + u) / s.width), (r.v2 = (h + l) / s.height)) : ((r.u2 = (a + l) / s.width), (r.v2 = (h + u) / s.height)),
(r.x = a),
(r.y = h),
(r.width = Math.abs(l)),
(r.height = Math.abs(u)),
4 == i.readTuple(n) && 4 == i.readTuple(n) && i.readTuple(n),
(r.originalWidth = parseInt(n[0])),
(r.originalHeight = parseInt(n[1])),
i.readTuple(n),
(r.offsetX = parseInt(n[0])),
(r.offsetY = parseInt(n[1])),
(r.index = parseInt(i.readValue())),
(r.texture = s.texture),
this.regions.push(r))
: (((s = new g()).name = d),
2 == i.readTuple(n) && ((s.width = parseInt(n[0])), (s.height = parseInt(n[1])), i.readTuple(n)),
i.readTuple(n),
(s.minFilter = f.Texture.filterFromString(n[0])),
(s.magFilter = f.Texture.filterFromString(n[1])),
(c = i.readValue()),
(s.uWrap = f.TextureWrap.ClampToEdge),
(s.vWrap = f.TextureWrap.ClampToEdge),
"x" == c ? (s.uWrap = f.TextureWrap.Repeat) : "y" == c ? (s.vWrap = f.TextureWrap.Repeat) : "xy" == c && (s.uWrap = s.vWrap = f.TextureWrap.Repeat),
(s.texture = e(d)),
s.texture.setFilters(s.minFilter, s.magFilter),
s.texture.setWraps(s.uWrap, s.vWrap),
(s.width = s.texture.getImage().width),
(s.height = s.texture.getImage().height),
this.pages.push(s));
}
}),
(e.prototype.findRegion = function (t) {
for (var e = 0; e < this.regions.length; e++) if (this.regions[e].name == t) return this.regions[e];
return null;
}),
(e.prototype.dispose = function () {
for (var t = 0; t < this.pages.length; t++) this.pages[t].texture.dispose();
}),
e);
function e(t, e) {
(this.pages = new Array()), (this.regions = new Array()), this.load(t, e);
}
f.TextureAtlas = t;
var p =
((i.prototype.readLine = function () {
return this.index >= this.lines.length ? null : this.lines[this.index++];
}),
(i.prototype.readValue = function () {
var t = this.readLine(),
e = t.indexOf(":");
if (-1 == e) throw new Error("Invalid line: " + t);
return t.substring(e + 1).trim();
}),
(i.prototype.readTuple = function (t) {
var e = this.readLine(),
i = e.indexOf(":");
if (-1 == i) throw new Error("Invalid line: " + e);
for (var n = 0, s = i + 1; n < 3; n++) {
var r = e.indexOf(",", s);
if (-1 == r) break;
(t[n] = e.substr(s, r - s).trim()), (s = r + 1);
}
return (t[n] = e.substring(s).trim()), n + 1;
}),
i);
function i(t) {
(this.index = 0), (this.lines = t.split(/\r\n|\r|\n/));
}
var g = function () {};
f.TextureAtlasPage = g;
var n,
v = ((n = f.TextureRegion), ye(s, n), s);
function s() {
return (null !== n && n.apply(this, arguments)) || this;
}
f.TextureAtlasRegion = v;
})((ge = ge || {})),
(N = ge = ge || {}),
(Le.prototype.isActive = function () {
return this.active;
}),
(Le.prototype.apply = function () {
this.update();
}),
(Le.prototype.update = function () {
this.data.local ? (this.data.relative ? this.applyRelativeLocal() : this.applyAbsoluteLocal()) : this.data.relative ? this.applyRelativeWorld() : this.applyAbsoluteWorld();
}),
(Le.prototype.applyAbsoluteWorld = function () {
for (
var t = this.rotateMix,
e = this.translateMix,
i = this.scaleMix,
n = this.shearMix,
s = this.target,
r = s.a,
o = s.b,
a = s.c,
h = s.d,
l = 0 < r * h - o * a ? N.MathUtils.degRad : -N.MathUtils.degRad,
u = this.data.offsetRotation * l,
c = this.data.offsetShearY * l,
d = this.bones,
f = 0,
p = d.length;
f < p;
f++
) {
var g,
v,
y,
m,
x,
b,
w,
T,
S,
_,
E,
P = d[f],
A = !1;
0 != t &&
((g = P.a),
(w = P.b),
(v = P.c),
(T = P.d),
(_ = Math.atan2(a, r) - Math.atan2(v, g) + u) > N.MathUtils.PI ? (_ -= N.MathUtils.PI2) : _ < -N.MathUtils.PI && (_ += N.MathUtils.PI2),
(_ *= t),
(y = Math.cos(_)),
(m = Math.sin(_)),
(P.a = y * g - m * v),
(P.b = y * w - m * T),
(P.c = m * g + y * v),
(P.d = m * w + y * T),
(A = !0)),
0 != e && ((x = this.temp), s.localToWorld(x.set(this.data.offsetX, this.data.offsetY)), (P.worldX += (x.x - P.worldX) * e), (P.worldY += (x.y - P.worldY) * e), (A = !0)),
0 < i &&
((E = Math.sqrt(P.a * P.a + P.c * P.c)),
(b = Math.sqrt(r * r + a * a)),
1e-5 < E && (E = (E + (b - E + this.data.offsetScaleX) * i) / E),
(P.a *= E),
(P.c *= E),
(E = Math.sqrt(P.b * P.b + P.d * P.d)),
(b = Math.sqrt(o * o + h * h)),
1e-5 < E && (E = (E + (b - E + this.data.offsetScaleY) * i) / E),
(P.b *= E),
(P.d *= E),
(A = !0)),
0 < n &&
((w = P.b),
(T = P.d),
(S = Math.atan2(T, w)),
(_ = Math.atan2(h, o) - Math.atan2(a, r) - (S - Math.atan2(P.c, P.a))) > N.MathUtils.PI ? (_ -= N.MathUtils.PI2) : _ < -N.MathUtils.PI && (_ += N.MathUtils.PI2),
(_ = S + (_ + c) * n),
(E = Math.sqrt(w * w + T * T)),
(P.b = Math.cos(_) * E),
(P.d = Math.sin(_) * E),
(A = !0)),
A && (P.appliedValid = !1);
}
}),
(Le.prototype.applyRelativeWorld = function () {
for (
var t = this.rotateMix,
e = this.translateMix,
i = this.scaleMix,
n = this.shearMix,
s = this.target,
r = s.a,
o = s.b,
a = s.c,
h = s.d,
l = 0 < r * h - o * a ? N.MathUtils.degRad : -N.MathUtils.degRad,
u = this.data.offsetRotation * l,
c = this.data.offsetShearY * l,
d = this.bones,
f = 0,
p = d.length;
f < p;
f++
) {
var g,
v,
y,
m,
x,
b,
w,
T,
S,
_ = d[f],
E = !1;
0 != t &&
((g = _.a),
(w = _.b),
(v = _.c),
(T = _.d),
(b = Math.atan2(a, r) + u) > N.MathUtils.PI ? (b -= N.MathUtils.PI2) : b < -N.MathUtils.PI && (b += N.MathUtils.PI2),
(b *= t),
(y = Math.cos(b)),
(m = Math.sin(b)),
(_.a = y * g - m * v),
(_.b = y * w - m * T),
(_.c = m * g + y * v),
(_.d = m * w + y * T),
(E = !0)),
0 != e && ((x = this.temp), s.localToWorld(x.set(this.data.offsetX, this.data.offsetY)), (_.worldX += x.x * e), (_.worldY += x.y * e), (E = !0)),
0 < i &&
((S = (Math.sqrt(r * r + a * a) - 1 + this.data.offsetScaleX) * i + 1), (_.a *= S), (_.c *= S), (S = (Math.sqrt(o * o + h * h) - 1 + this.data.offsetScaleY) * i + 1), (_.b *= S), (_.d *= S), (E = !0)),
0 < n &&
((b = Math.atan2(h, o) - Math.atan2(a, r)) > N.MathUtils.PI ? (b -= N.MathUtils.PI2) : b < -N.MathUtils.PI && (b += N.MathUtils.PI2),
(w = _.b),
(T = _.d),
(b = Math.atan2(T, w) + (b - N.MathUtils.PI / 2 + c) * n),
(S = Math.sqrt(w * w + T * T)),
(_.b = Math.cos(b) * S),
(_.d = Math.sin(b) * S),
(E = !0)),
E && (_.appliedValid = !1);
}
}),
(Le.prototype.applyAbsoluteLocal = function () {
var t = this.rotateMix,
e = this.translateMix,
i = this.scaleMix,
n = this.shearMix,
s = this.target;
s.appliedValid || s.updateAppliedTransform();
for (var r = this.bones, o = 0, a = r.length; o < a; o++) {
var h = r[o];
h.appliedValid || h.updateAppliedTransform();
var l = h.arotation;
0 != t && ((p = s.arotation - l + this.data.offsetRotation), (l += (p -= 360 * (16384 - ((16384.499999999996 - p / 360) | 0))) * t));
var u = h.ax,
c = h.ay;
0 != e && ((u += (s.ax - u + this.data.offsetX) * e), (c += (s.ay - c + this.data.offsetY) * e));
var d = h.ascaleX,
f = h.ascaleY;
0 != i && (1e-5 < d && (d = (d + (s.ascaleX - d + this.data.offsetScaleX) * i) / d), 1e-5 < f && (f = (f + (s.ascaleY - f + this.data.offsetScaleY) * i) / f));
var p,
g = h.ashearY;
0 != n && ((p = s.ashearY - g + this.data.offsetShearY), (p -= 360 * (16384 - ((16384.499999999996 - p / 360) | 0))), (h.shearY += p * n)), h.updateWorldTransformWith(u, c, l, d, f, h.ashearX, g);
}
}),
(Le.prototype.applyRelativeLocal = function () {
var t = this.rotateMix,
e = this.translateMix,
i = this.scaleMix,
n = this.shearMix,
s = this.target;
s.appliedValid || s.updateAppliedTransform();
for (var r = this.bones, o = 0, a = r.length; o < a; o++) {
var h = r[o];
h.appliedValid || h.updateAppliedTransform();
var l = h.arotation;
0 != t && (l += (s.arotation + this.data.offsetRotation) * t);
var u = h.ax,
c = h.ay;
0 != e && ((u += (s.ax + this.data.offsetX) * e), (c += (s.ay + this.data.offsetY) * e));
var d = h.ascaleX,
f = h.ascaleY;
0 != i && (1e-5 < d && (d *= (s.ascaleX - 1 + this.data.offsetScaleX) * i + 1), 1e-5 < f && (f *= (s.ascaleY - 1 + this.data.offsetScaleY) * i + 1));
var p = h.ashearY;
0 != n && (p += (s.ashearY + this.data.offsetShearY) * n), h.updateWorldTransformWith(u, c, l, d, f, h.ashearX, p);
}
}),
(U = Le),
(N.TransformConstraint = U),
(Y = ge = ge || {}),
(z = Y.ConstraintData),
ye(Ie, z),
(X = Ie),
(Y.TransformConstraintData = X),
(V = ge = ge || {}),
(De.prototype.triangulate = function (t) {
for (var e = t, i = t.length >> 1, n = this.indicesArray, s = (n.length = 0); s < i; s++) n[s] = s;
for (var r = this.isConcaveArray, o = ((s = r.length = 0), i); s < o; ++s) r[s] = De.isConcave(s, i, e, n);
var a = this.triangles;
for (a.length = 0; 3 < i; ) {
for (var h = i - 1, l = ((s = 0), 1); ; ) {
t: if (!r[s]) {
for (var u = n[h] << 1, c = n[s] << 1, d = n[l] << 1, f = e[u], p = e[1 + u], g = e[c], v = e[1 + c], y = e[d], m = e[1 + d], x = (l + 1) % i; x != h; x = (x + 1) % i)
if (r[x]) {
var b = n[x] << 1,
w = e[b],
T = e[1 + b];
if (De.positiveArea(y, m, f, p, w, T) && De.positiveArea(f, p, g, v, w, T) && De.positiveArea(g, v, y, m, w, T)) break t;
}
break;
}
if (0 == l) {
do {
if (!r[s]) break;
s--;
} while (0 < s);
break;
}
(h = s), (l = ((s = l) + 1) % i);
}
a.push(n[(i + s - 1) % i]), a.push(n[s]), a.push(n[(s + 1) % i]), n.splice(s, 1), r.splice(s, 1);
var S = (--i + s - 1) % i,
_ = s == i ? 0 : s;
(r[S] = De.isConcave(S, i, e, n)), (r[_] = De.isConcave(_, i, e, n));
}
return 3 == i && (a.push(n[2]), a.push(n[0]), a.push(n[1])), a;
}),
(De.prototype.decompose = function (t, e) {
var i = t,
n = this.convexPolygons;
this.polygonPool.freeAll(n), (n.length = 0);
var s = this.convexPolygonsIndices;
this.polygonIndicesPool.freeAll(s), (s.length = 0);
var r = this.polygonIndicesPool.obtain();
r.length = 0;
for (var o = this.polygonPool.obtain(), a = -1, h = (o.length = 0), l = 0, u = e.length; l < u; l += 3) {
var c = e[l] << 1,
d = e[l + 1] << 1,
f = e[l + 2] << 1,
p = i[c],
g = i[1 + c],
v = i[d],
y = i[1 + d],
m = i[f],
x = i[1 + f],
b = !1;
a == c && ((w = o.length - 4), (A = De.winding(o[w], o[w + 1], o[w + 2], o[w + 3], m, x)), (M = De.winding(m, x, o[0], o[1], o[2], o[3])), A == h && M == h && (o.push(m), o.push(x), r.push(f), (b = !0))),
b ||
(0 < o.length ? (n.push(o), s.push(r)) : (this.polygonPool.free(o), this.polygonIndicesPool.free(r)),
((o = this.polygonPool.obtain()).length = 0),
o.push(p),
o.push(g),
o.push(v),
o.push(y),
o.push(m),
o.push(x),
((r = this.polygonIndicesPool.obtain()).length = 0),
r.push(c),
r.push(d),
r.push(f),
(h = De.winding(p, g, v, y, m, x)),
(a = c));
}
for (0 < o.length && (n.push(o), s.push(r)), l = 0, u = n.length; l < u; l++)
if (0 != (r = s[l]).length)
for (
var w,
T,
S,
_,
E,
P,
A,
M,
C = r[0],
O = r[r.length - 1],
k = (o = n[l])[(w = o.length - 4)],
R = o[w + 1],
L = o[w + 2],
I = o[w + 3],
D = o[0],
F = o[1],
B = o[2],
N = o[3],
U = De.winding(k, R, L, I, D, F),
Y = 0;
Y < u;
Y++
)
Y != l &&
3 == (T = s[Y]).length &&
((S = T[0]),
(_ = T[1]),
(E = T[2]),
(m = (P = n[Y])[P.length - 2]),
(x = P[P.length - 1]),
S == C &&
_ == O &&
((A = De.winding(k, R, L, I, m, x)),
(M = De.winding(m, x, D, F, B, N)),
A == U && M == U && ((P.length = 0), (T.length = 0), o.push(m), o.push(x), r.push(E), (k = L), (R = I), (L = m), (I = x), (Y = 0))));
for (l = n.length - 1; 0 <= l; l--) 0 == (o = n[l]).length && (n.splice(l, 1), this.polygonPool.free(o), (r = s[l]), s.splice(l, 1), this.polygonIndicesPool.free(r));
return n;
}),
(De.isConcave = function (t, e, i, n) {
var s = n[(e + t - 1) % e] << 1,
r = n[t] << 1,
o = n[(t + 1) % e] << 1;
return !this.positiveArea(i[s], i[1 + s], i[r], i[1 + r], i[o], i[1 + o]);
}),
(De.positiveArea = function (t, e, i, n, s, r) {
return 0 <= t * (r - n) + i * (e - r) + s * (n - e);
}),
(De.winding = function (t, e, i, n, s, r) {
var o = i - t,
a = n - e;
return 0 <= s * a - r * o + o * e - t * a ? 1 : -1;
}),
(G = De),
(V.Triangulator = G),
(function (t) {
var e =
((i.prototype.add = function (t) {
var e = this.contains(t);
return (this.array[0 | t] = 0 | t), !e;
}),
(i.prototype.contains = function (t) {
return null != this.array[0 | t];
}),
(i.prototype.remove = function (t) {
this.array[0 | t] = void 0;
}),
(i.prototype.clear = function () {
this.array.length = 0;
}),
i);
function i() {
this.array = new Array();
}
t.IntSet = e;
var n =
((s.prototype.set = function (t, e, i, n) {
return (this.r = t), (this.g = e), (this.b = i), (this.a = n), this.clamp(), this;
}),
(s.prototype.setFromColor = function (t) {
return (this.r = t.r), (this.g = t.g), (this.b = t.b), (this.a = t.a), this;
}),
(s.prototype.setFromString = function (t) {
return (
(t = "#" == t.charAt(0) ? t.substr(1) : t),
(this.r = parseInt(t.substr(0, 2), 16) / 255),
(this.g = parseInt(t.substr(2, 2), 16) / 255),
(this.b = parseInt(t.substr(4, 2), 16) / 255),
(this.a = (8 != t.length ? 255 : parseInt(t.substr(6, 2), 16)) / 255),
this
);
}),
(s.prototype.add = function (t, e, i, n) {
return (this.r += t), (this.g += e), (this.b += i), (this.a += n), this.clamp(), this;
}),
(s.prototype.clamp = function () {
return (
this.r < 0 ? (this.r = 0) : 1 < this.r && (this.r = 1),
this.g < 0 ? (this.g = 0) : 1 < this.g && (this.g = 1),
this.b < 0 ? (this.b = 0) : 1 < this.b && (this.b = 1),
this.a < 0 ? (this.a = 0) : 1 < this.a && (this.a = 1),
this
);
}),
(s.rgba8888ToColor = function (t, e) {
(t.r = ((4278190080 & e) >>> 24) / 255), (t.g = ((16711680 & e) >>> 16) / 255), (t.b = ((65280 & e) >>> 8) / 255), (t.a = (255 & e) / 255);
}),
(s.rgb888ToColor = function (t, e) {
(t.r = ((16711680 & e) >>> 16) / 255), (t.g = ((65280 & e) >>> 8) / 255), (t.b = (255 & e) / 255);
}),
(s.WHITE = new s(1, 1, 1, 1)),
(s.RED = new s(1, 0, 0, 1)),
(s.GREEN = new s(0, 1, 0, 1)),
(s.BLUE = new s(0, 0, 1, 1)),
(s.MAGENTA = new s(1, 0, 1, 1)),
s);
function s(t, e, i, n) {
void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === n && (n = 0), (this.r = t), (this.g = e), (this.b = i), (this.a = n);
}
t.Color = n;
var r =
((o.clamp = function (t, e, i) {
return t < e ? e : i < t ? i : t;
}),
(o.cosDeg = function (t) {
return Math.cos(t * o.degRad);
}),
(o.sinDeg = function (t) {
return Math.sin(t * o.degRad);
}),
(o.signum = function (t) {
return 0 < t ? 1 : t < 0 ? -1 : 0;
}),
(o.toInt = function (t) {
return 0 < t ? Math.floor(t) : Math.ceil(t);
}),
(o.cbrt = function (t) {
var e = Math.pow(Math.abs(t), 1 / 3);
return t < 0 ? -e : e;
}),
(o.randomTriangular = function (t, e) {
return o.randomTriangularWith(t, e, 0.5 * (t + e));
}),
(o.randomTriangularWith = function (t, e, i) {
var n = Math.random(),
s = e - t;
return n <= (i - t) / s ? t + Math.sqrt(n * s * (i - t)) : e - Math.sqrt((1 - n) * s * (e - i));
}),
(o.PI2 = 2 * (o.PI = 3.1415927)),
(o.radDeg = o.radiansToDegrees = 180 / o.PI),
(o.degRad = o.degreesToRadians = o.PI / 180),
o);
function o() {}
t.MathUtils = r;
var a =
((h.prototype.apply = function (t, e, i) {
return t + (e - t) * this.applyInternal(i);
}),
h);
function h() {}
t.Interpolation = a;
var l,
u =
(ye(c, (l = a)),
(c.prototype.applyInternal = function (t) {
return t <= 0.5 ? Math.pow(2 * t, this.power) / 2 : Math.pow(2 * (t - 1), this.power) / (this.power % 2 == 0 ? -2 : 2) + 1;
}),
c);
function c(t) {
var e = l.call(this) || this;
return (e.power = 2), (e.power = t), e;
}
t.Pow = u;
var d,
f =
(ye(p, (d = u)),
(p.prototype.applyInternal = function (t) {
return Math.pow(t - 1, this.power) * (this.power % 2 == 0 ? -1 : 1) + 1;
}),
p);
function p(t) {
return d.call(this, t) || this;
}
t.PowOut = f;
var g =
((v.arrayCopy = function (t, e, i, n, s) {
for (var r = e, o = n; r < e + s; r++, o++) i[o] = t[r];
}),
(v.setArraySize = function (t, e, i) {
void 0 === i && (i = 0);
var n = t.length;
if (n == e) return t;
if (n < (t.length = e)) for (var s = n; s < e; s++) t[s] = i;
return t;
}),
(v.ensureArrayCapacity = function (t, e, i) {
return void 0 === i && (i = 0), t.length >= e ? t : v.setArraySize(t, e, i);
}),
(v.newArray = function (t, e) {
for (var i = new Array(t), n = 0; n < t; n++) i[n] = e;
return i;
}),
(v.newFloatArray = function (t) {
if (v.SUPPORTS_TYPED_ARRAYS) return new Float32Array(t);
for (var e = new Array(t), i = 0; i < e.length; i++) e[i] = 0;
return e;
}),
(v.newShortArray = function (t) {
if (v.SUPPORTS_TYPED_ARRAYS) return new Int16Array(t);
for (var e = new Array(t), i = 0; i < e.length; i++) e[i] = 0;
return e;
}),
(v.toFloatArray = function (t) {
return v.SUPPORTS_TYPED_ARRAYS ? new Float32Array(t) : t;
}),
(v.toSinglePrecision = function (t) {
return v.SUPPORTS_TYPED_ARRAYS ? Math.fround(t) : t;
}),
(v.webkit602BugfixHelper = function (t, e) {}),
(v.contains = function (t, e, i) {
void 0 === i && (i = !0);
for (var n = 0; n < t.length; n++) if (t[n] == e) return !0;
return !1;
}),
(v.SUPPORTS_TYPED_ARRAYS = "undefined" != typeof Float32Array),
v);
function v() {}
t.Utils = g;
var y =
((m.logBones = function (t) {
for (var e = 0; e < t.bones.length; e++) t.bones[e];
}),
m);
function m() {}
t.DebugUtils = y;
var x =
((b.prototype.obtain = function () {
return 0 < this.items.length ? this.items.pop() : this.instantiator();
}),
(b.prototype.free = function (t) {
t.reset && t.reset(), this.items.push(t);
}),
(b.prototype.freeAll = function (t) {
for (var e = 0; e < t.length; e++) this.free(t[e]);
}),
(b.prototype.clear = function () {
this.items.length = 0;
}),
b);
function b(t) {
(this.items = new Array()), (this.instantiator = t);
}
t.Pool = x;
var w =
((T.prototype.set = function (t, e) {
return (this.x = t), (this.y = e), this;
}),
(T.prototype.length = function () {
var t = this.x,
e = this.y;
return Math.sqrt(t * t + e * e);
}),
(T.prototype.normalize = function () {
var t = this.length();
return 0 != t && ((this.x /= t), (this.y /= t)), this;
}),
T);
function T(t, e) {
void 0 === t && (t = 0), void 0 === e && (e = 0), (this.x = t), (this.y = e);
}
t.Vector2 = w;
var S =
((_.prototype.update = function () {
var t = Date.now() / 1e3;
(this.delta = t - this.lastTime),
(this.frameTime += this.delta),
(this.totalTime += this.delta),
this.delta > this.maxDelta && (this.delta = this.maxDelta),
(this.lastTime = t),
this.frameCount++,
1 < this.frameTime && ((this.framesPerSecond = this.frameCount / this.frameTime), (this.frameTime = 0), (this.frameCount = 0));
}),
_);
function _() {
(this.maxDelta = 0.064), (this.framesPerSecond = 0), (this.delta = 0), (this.totalTime = 0), (this.lastTime = Date.now() / 1e3), (this.frameCount = 0), (this.frameTime = 0);
}
t.TimeKeeper = S;
var E =
((P.prototype.hasEnoughData = function () {
return this.addedValues >= this.values.length;
}),
(P.prototype.addValue = function (t) {
this.addedValues < this.values.length && this.addedValues++, (this.values[this.lastValue++] = t), this.lastValue > this.values.length - 1 && (this.lastValue = 0), (this.dirty = !0);
}),
(P.prototype.getMean = function () {
if (this.hasEnoughData()) {
if (this.dirty) {
for (var t = 0, e = 0; e < this.values.length; e++) t += this.values[e];
(this.mean = t / this.values.length), (this.dirty = !1);
}
return this.mean;
}
return 0;
}),
P);
function P(t) {
void 0 === t && (t = 32), (this.addedValues = 0), (this.lastValue = 0), (this.mean = 0), (this.dirty = !0), (this.values = new Array(t));
}
t.WindowedMean = E;
})((ge = ge || {})),
Math.fround ||
(Math.fround =
((j = new Float32Array(1)),
function (t) {
return (j[0] = t), j[0];
})),
(function (e) {
function t(t) {
if (null == t) throw new Error("name cannot be null.");
this.name = t;
}
e.Attachment = t;
var i,
n =
(ye(s, (i = t)),
(s.prototype.computeWorldVertices = function (t, e, i, n, s, r) {
i = s + (i >> 1) * r;
var o = t.bone.skeleton,
a = t.deform,
h = this.vertices,
l = this.bones;
if (null != l) {
for (var u = 0, c = 0, d = 0; d < e; d += 2) (u += (v = l[u]) + 1), (c += v);
var f = o.bones;
if (0 == a.length)
for (T = s, S = 3 * c; T < i; T += r) {
var p = 0,
g = 0,
v = l[u++];
for (v += u; u < v; u++, S += 3) {
var y = f[l[u]],
m = h[S],
x = h[S + 1],
b = h[S + 2];
(p += (m * y.a + x * y.b + y.worldX) * b), (g += (m * y.c + x * y.d + y.worldY) * b);
}
(n[T] = p), (n[T + 1] = g);
}
else
for (var w = a, T = s, S = 3 * c, _ = c << 1; T < i; T += r) {
for (g = p = 0, v = l[u++], v += u; u < v; u++, S += 3, _ += 2)
(y = f[l[u]]), (m = h[S] + w[_]), (x = h[S + 1] + w[_ + 1]), (b = h[S + 2]), (p += (m * y.a + x * y.b + y.worldX) * b), (g += (m * y.c + x * y.d + y.worldY) * b);
(n[T] = p), (n[T + 1] = g);
}
} else {
0 < a.length && (h = a);
var E = (y = t.bone).worldX,
P = y.worldY,
A = y.a,
M = ((S = y.b), y.c),
C = y.d,
O = e;
for (T = s; T < i; O += 2, T += r) {
(m = h[O]), (x = h[O + 1]);
(n[T] = m * A + x * S + E), (n[T + 1] = m * M + x * C + P);
}
}
}),
(s.prototype.copyTo = function (t) {
null != this.bones ? ((t.bones = new Array(this.bones.length)), e.Utils.arrayCopy(this.bones, 0, t.bones, 0, this.bones.length)) : (t.bones = null),
null != this.vertices ? ((t.vertices = e.Utils.newFloatArray(this.vertices.length)), e.Utils.arrayCopy(this.vertices, 0, t.vertices, 0, this.vertices.length)) : (t.vertices = null),
(t.worldVerticesLength = this.worldVerticesLength),
(t.deformAttachment = this.deformAttachment);
}),
(s.nextID = 0),
s);
function s(t) {
var e = i.call(this, t) || this;
return (e.id = (65535 & s.nextID++) << 11), (e.worldVerticesLength = 0), (e.deformAttachment = e);
}
e.VertexAttachment = n;
})((ge = ge || {})),
((W = (H = ge = ge || {}).AttachmentType || (H.AttachmentType = {}))[(W.Region = 0)] = "Region"),
(W[(W.BoundingBox = 1)] = "BoundingBox"),
(W[(W.Mesh = 2)] = "Mesh"),
(W[(W.LinkedMesh = 3)] = "LinkedMesh"),
(W[(W.Path = 4)] = "Path"),
(W[(W.Point = 5)] = "Point"),
(W[(W.Clipping = 6)] = "Clipping"),
(Z = ge = ge || {}),
(J = Z.VertexAttachment),
ye(Fe, J),
(Fe.prototype.copy = function () {
var t = new Fe(this.name);
return this.copyTo(t), t.color.setFromColor(this.color), t;
}),
(Q = Fe),
(Z.BoundingBoxAttachment = Q),
($ = ge = ge || {}),
(tt = $.VertexAttachment),
ye(Be, tt),
(Be.prototype.copy = function () {
var t = new Be(this.name);
return this.copyTo(t), (t.endSlot = this.endSlot), t.color.setFromColor(this.color), t;
}),
(et = Be),
($.ClippingAttachment = et),
(it = ge = ge || {}),
(nt = it.VertexAttachment),
ye(Ne, nt),
(Ne.prototype.updateUVs = function () {
var t = this.regionUVs;
(null != this.uvs && this.uvs.length == t.length) || (this.uvs = it.Utils.newFloatArray(t.length));
var e = this.uvs,
i = this.uvs.length,
n = this.region.u,
s = this.region.v,
r = 0,
o = 0;
if (this.region instanceof it.TextureAtlasRegion) {
var a = this.region,
h = a.texture.getImage().width,
l = a.texture.getImage().height;
switch (a.degrees) {
case 90:
(n -= (a.originalHeight - a.offsetY - a.height) / h), (s -= (a.originalWidth - a.offsetX - a.width) / l), (r = a.originalHeight / h), (o = a.originalWidth / l);
for (var u = 0; u < i; u += 2) (e[u] = n + t[u + 1] * r), (e[u + 1] = s + (1 - t[u]) * o);
return;
case 180:
for (n -= (a.originalWidth - a.offsetX - a.width) / h, s -= a.offsetY / l, r = a.originalWidth / h, o = a.originalHeight / l, u = 0; u < i; u += 2)
(e[u] = n + (1 - t[u]) * r), (e[u + 1] = s + (1 - t[u + 1]) * o);
return;
case 270:
for (n -= a.offsetY / h, s -= a.offsetX / l, r = a.originalHeight / h, o = a.originalWidth / l, u = 0; u < i; u += 2) (e[u] = n + (1 - t[u + 1]) * r), (e[u + 1] = s + t[u] * o);
return;
}
(n -= a.offsetX / h), (s -= (a.originalHeight - a.offsetY - a.height) / l), (r = a.originalWidth / h), (o = a.originalHeight / l);
} else null == this.region ? ((n = s = 0), (r = o = 1)) : ((r = this.region.u2 - n), (o = this.region.v2 - s));
for (u = 0; u < i; u += 2) (e[u] = n + t[u] * r), (e[u + 1] = s + t[u + 1] * o);
}),
(Ne.prototype.getParentMesh = function () {
return this.parentMesh;
}),
(Ne.prototype.setParentMesh = function (t) {
null != (this.parentMesh = t) &&
((this.bones = t.bones),
(this.vertices = t.vertices),
(this.worldVerticesLength = t.worldVerticesLength),
(this.regionUVs = t.regionUVs),
(this.triangles = t.triangles),
(this.hullLength = t.hullLength),
(this.worldVerticesLength = t.worldVerticesLength));
}),
(Ne.prototype.copy = function () {
if (null != this.parentMesh) return this.newLinkedMesh();
var t = new Ne(this.name);
return (
(t.region = this.region),
(t.path = this.path),
t.color.setFromColor(this.color),
this.copyTo(t),
(t.regionUVs = new Array(this.regionUVs.length)),
it.Utils.arrayCopy(this.regionUVs, 0, t.regionUVs, 0, this.regionUVs.length),
(t.uvs = new Array(this.uvs.length)),
it.Utils.arrayCopy(this.uvs, 0, t.uvs, 0, this.uvs.length),
(t.triangles = new Array(this.triangles.length)),
it.Utils.arrayCopy(this.triangles, 0, t.triangles, 0, this.triangles.length),
(t.hullLength = this.hullLength),
null != this.edges && ((t.edges = new Array(this.edges.length)), it.Utils.arrayCopy(this.edges, 0, t.edges, 0, this.edges.length)),
(t.width = this.width),
(t.height = this.height),
t
);
}),
(Ne.prototype.newLinkedMesh = function () {
var t = new Ne(this.name);
return (
(t.region = this.region), (t.path = this.path), t.color.setFromColor(this.color), (t.deformAttachment = this.deformAttachment), t.setParentMesh(null != this.parentMesh ? this.parentMesh : this), t.updateUVs(), t
);
}),
(st = Ne),
(it.MeshAttachment = st),
(rt = ge = ge || {}),
(ot = rt.VertexAttachment),
ye(Ue, ot),
(Ue.prototype.copy = function () {
var t = new Ue(this.name);
return (
this.copyTo(t),
(t.lengths = new Array(this.lengths.length)),
rt.Utils.arrayCopy(this.lengths, 0, t.lengths, 0, this.lengths.length),
(t.closed = closed),
(t.constantSpeed = this.constantSpeed),
t.color.setFromColor(this.color),
t
);
}),
(at = Ue),
(rt.PathAttachment = at),
(lt = ge = ge || {}),
(ut = lt.VertexAttachment),
ye(Ye, ut),
(Ye.prototype.computeWorldPosition = function (t, e) {
return (e.x = this.x * t.a + this.y * t.b + t.worldX), (e.y = this.x * t.c + this.y * t.d + t.worldY), e;
}),
(Ye.prototype.computeWorldRotation = function (t) {
var e = lt.MathUtils.cosDeg(this.rotation),
i = lt.MathUtils.sinDeg(this.rotation),
n = e * t.a + i * t.b,
s = e * t.c + i * t.d;
return Math.atan2(s, n) * lt.MathUtils.radDeg;
}),
(Ye.prototype.copy = function () {
var t = new Ye(this.name);
return (t.x = this.x), (t.y = this.y), (t.rotation = this.rotation), t.color.setFromColor(this.color), t;
}),
(ct = Ye),
(lt.PointAttachment = ct),
(dt = ge = ge || {}),
(ft = dt.Attachment),
ye(ze, ft),
(ze.prototype.updateOffset = function () {
var t = (this.width / this.region.originalWidth) * this.scaleX,
e = (this.height / this.region.originalHeight) * this.scaleY,
i = (-this.width / 2) * this.scaleX + this.region.offsetX * t,
n = (-this.height / 2) * this.scaleY + this.region.offsetY * e,
s = i + this.region.width * t,
r = n + this.region.height * e,
o = (this.rotation * Math.PI) / 180,
a = Math.cos(o),
h = Math.sin(o),
l = i * a + this.x,
u = i * h,
c = n * a + this.y,
d = n * h,
f = s * a + this.x,
p = s * h,
g = r * a + this.y,
v = r * h,
y = this.offset;
(y[ze.OX1] = l - d), (y[ze.OY1] = c + u), (y[ze.OX2] = l - v), (y[ze.OY2] = g + u), (y[ze.OX3] = f - v), (y[ze.OY3] = g + p), (y[ze.OX4] = f - d), (y[ze.OY4] = c + p);
}),
(ze.prototype.setRegion = function (t) {
this.region = t;
var e = this.uvs;
t.rotate
? ((e[2] = t.u), (e[3] = t.v2), (e[4] = t.u), (e[5] = t.v), (e[6] = t.u2), (e[7] = t.v), (e[0] = t.u2), (e[1] = t.v2))
: ((e[0] = t.u), (e[1] = t.v2), (e[2] = t.u), (e[3] = t.v), (e[4] = t.u2), (e[5] = t.v), (e[6] = t.u2), (e[7] = t.v2));
}),
(ze.prototype.computeWorldVertices = function (t, e, i, n) {
var s = this.offset,
r = t.worldX,
o = t.worldY,
a = t.a,
h = t.b,
l = t.c,
u = t.d,
c = s[ze.OX1],
d = s[ze.OY1];
(e[i] = c * a + d * h + r),
(e[i + 1] = c * l + d * u + o),
(i += n),
(c = s[ze.OX2]),
(d = s[ze.OY2]),
(e[i] = c * a + d * h + r),
(e[i + 1] = c * l + d * u + o),
(i += n),
(c = s[ze.OX3]),
(d = s[ze.OY3]),
(e[i] = c * a + d * h + r),
(e[i + 1] = c * l + d * u + o),
(i += n),
(c = s[ze.OX4]),
(d = s[ze.OY4]),
(e[i] = c * a + d * h + r),
(e[i + 1] = c * l + d * u + o);
}),
(ze.prototype.copy = function () {
var t = new ze(this.name);
return (
(t.region = this.region),
(t.rendererObject = this.rendererObject),
(t.path = this.path),
(t.x = this.x),
(t.y = this.y),
(t.scaleX = this.scaleX),
(t.scaleY = this.scaleY),
(t.rotation = this.rotation),
(t.width = this.width),
(t.height = this.height),
dt.Utils.arrayCopy(this.uvs, 0, t.uvs, 0, 8),
dt.Utils.arrayCopy(this.offset, 0, t.offset, 0, 8),
t.color.setFromColor(this.color),
t
);
}),
(ze.OX1 = 0),
(ze.OY1 = 1),
(ze.OX2 = 2),
(ze.OY2 = 3),
(ze.OX3 = 4),
(ze.OY3 = 5),
(ze.OX4 = 6),
(ze.OY4 = 7),
(ze.X1 = 0),
(ze.Y1 = 1),
(ze.C1R = 2),
(ze.C1G = 3),
(ze.C1B = 4),
(ze.C1A = 5),
(ze.U1 = 6),
(ze.V1 = 7),
(ze.X2 = 8),
(ze.Y2 = 9),
(ze.C2R = 10),
(ze.C2G = 11),
(ze.C2B = 12),
(ze.C2A = 13),
(ze.U2 = 14),
(ze.V2 = 15),
(ze.X3 = 16),
(ze.Y3 = 17),
(ze.C3R = 18),
(ze.C3G = 19),
(ze.C3B = 20),
(ze.C3A = 21),
(ze.U3 = 22),
(ze.V3 = 23),
(ze.X4 = 24),
(ze.Y4 = 25),
(ze.C4R = 26),
(ze.C4G = 27),
(ze.C4B = 28),
(ze.C4A = 29),
(ze.U4 = 30),
(ze.V4 = 31),
(pt = ze),
(dt.RegionAttachment = pt),
(gt = ge = ge || {}),
(Xe.prototype.begin = function (t) {}),
(Xe.prototype.transform = function (t, e, i, n) {
(t.x += gt.MathUtils.randomTriangular(-this.jitterX, this.jitterY)), (t.y += gt.MathUtils.randomTriangular(-this.jitterX, this.jitterY));
}),
(Xe.prototype.end = function () {}),
(vt = Xe),
(gt.JitterEffect = vt),
(yt = ge = ge || {}),
(Ve.prototype.begin = function (t) {
(this.worldX = t.x + this.centerX), (this.worldY = t.y + this.centerY);
}),
(Ve.prototype.transform = function (t, e, i, n) {
var s,
r,
o,
a = this.angle * yt.MathUtils.degreesToRadians,
h = t.x - this.worldX,
l = t.y - this.worldY,
u = Math.sqrt(h * h + l * l);
u < this.radius && ((s = Ve.interpolation.apply(0, a, (this.radius - u) / this.radius)), (r = Math.cos(s)), (o = Math.sin(s)), (t.x = r * h - o * l + this.worldX), (t.y = o * h + r * l + this.worldY));
}),
(Ve.prototype.end = function () {}),
(Ve.interpolation = new yt.PowOut(2)),
(mt = Ve),
(yt.SwirlEffect = mt),
(bt = (xt = ge = ge || {}).canvas || (xt.canvas = {})),
(wt = xt.AssetManager),
ye(Ge, wt),
(Tt = Ge),
(bt.AssetManager = Tt),
(_t = (St = ge = ge || {}).canvas || (St.canvas = {})),
(Et = St.Texture),
ye(je, Et),
(je.prototype.setFilters = function (t, e) {}),
(je.prototype.setWraps = function (t, e) {}),
(je.prototype.dispose = function () {}),
(Pt = je),
(_t.CanvasTexture = Pt),
(Mt = (At = ge = ge || {}).canvas || (At.canvas = {})),
(He.prototype.draw = function (t) {
this.triangleRendering ? this.drawTriangles(t) : this.drawImages(t);
}),
(He.prototype.drawImages = function (t) {
var e = this.ctx,
i = t.drawOrder;
this.debugRendering && (e.strokeStyle = "green"), e.save();
for (var n = 0, s = i.length; n < s; n++) {
var r,
o,
a,
h,
l,
u,
c,
d,
f,
p,
g,
v,
y,
m,
x,
b = i[n];
b.bone.active &&
((h = a = o = null),
(r = b.getAttachment()) instanceof At.RegionAttachment &&
((h = (a = (o = r).region).texture.getImage()),
(l = b.bone.skeleton.color),
(u = b.color),
(c = o.color),
(d = l.a * u.a * c.a),
(f = this.tempColor).set(l.r * u.r * c.r, l.g * u.g * c.g, l.b * u.b * c.b, d),
(p = r),
(g = b.bone),
(m = a.width),
(x = a.height),
e.save(),
e.transform(g.a, g.c, g.b, g.d, g.worldX, g.worldY),
e.translate(r.offset[0], r.offset[1]),
e.rotate((r.rotation * Math.PI) / 180),
(v = p.width / m),
e.scale(v * r.scaleX, v * r.scaleY),
e.translate(m / 2, x / 2),
r.region.rotate && ((y = m), (m = x), (x = y), e.rotate(-Math.PI / 2)),
e.scale(1, -1),
e.translate(-m / 2, -x / 2),
(1 == f.r && 1 == f.g && 1 == f.b && 1 == f.a) || (e.globalAlpha = f.a),
e.drawImage(h, a.x, a.y, m, x, 0, 0, m, x),
this.debugRendering && e.strokeRect(0, 0, m, x),
e.restore()));
}
e.restore();
}),
(He.prototype.drawTriangles = function (t) {
for (var e = null, i = this.vertices, n = null, s = t.drawOrder, r = 0, o = s.length; r < o; r++) {
var a = s[r],
h = a.getAttachment(),
l = null;
if (h instanceof At.RegionAttachment) {
var u = h;
(i = this.computeRegionVertices(a, u, !1)), (n = He.QUAD_TRIANGLES), (l = u.region.texture.getImage());
} else {
if (!(h instanceof At.MeshAttachment)) continue;
var c = h;
(i = this.computeMeshVertices(a, c, !1)), (n = c.triangles), (l = c.region.renderObject.texture.getImage());
}
if (null != l) {
var d = a.data.blendMode;
d != e && (e = d);
var f = a.bone.skeleton.color,
p = a.color,
g = h.color,
v = f.a * p.a * g.a,
y = this.tempColor;
y.set(f.r * p.r * g.r, f.g * p.g * g.g, f.b * p.b * g.b, v);
var m = this.ctx;
(1 == y.r && 1 == y.g && 1 == y.b && 1 == y.a) || (m.globalAlpha = y.a);
for (var x = 0; x < n.length; x += 3) {
var b = 8 * n[x],
w = 8 * n[x + 1],
T = 8 * n[x + 2],
S = i[b],
_ = i[1 + b],
E = i[6 + b],
P = i[7 + b],
A = i[w],
M = i[1 + w],
C = i[6 + w],
O = i[7 + w],
k = i[T],
R = i[1 + T],
L = i[6 + T],
I = i[7 + T];
this.drawTriangle(l, S, _, E, P, A, M, C, O, k, R, L, I), this.debugRendering && ((m.strokeStyle = "green"), m.beginPath(), m.moveTo(S, _), m.lineTo(A, M), m.lineTo(k, R), m.lineTo(S, _), m.stroke());
}
}
}
this.ctx.globalAlpha = 1;
}),
(He.prototype.drawTriangle = function (t, e, i, n, s, r, o, a, h, l, u, c, d) {
var f = this.ctx;
(n *= t.width), (s *= t.height), (a *= t.width), (h *= t.height), (c *= t.width), (d *= t.height), f.beginPath(), f.moveTo(e, i), f.lineTo(r, o), f.lineTo(l, u), f.closePath();
var p = 1 / ((a -= n) * (d -= s) - (c -= n) * (h -= s)),
g = (d * (r -= e) - h * (l -= e)) * p,
v = (d * (o -= i) - h * (u -= i)) * p,
y = (a * l - c * r) * p,
m = (a * u - c * o) * p,
x = e - g * n - y * s,
b = i - v * n - m * s;
f.save(), f.transform(g, v, y, m, x, b), f.clip(), f.drawImage(t, 0, 0), f.restore();
}),
(He.prototype.computeRegionVertices = function (t, e, i) {
var n = t.bone.skeleton.color,
s = t.color,
r = e.color,
o = n.a * s.a * r.a,
a = i ? o : 1,
h = this.tempColor;
h.set(n.r * s.r * r.r * a, n.g * s.g * r.g * a, n.b * s.b * r.b * a, o), e.computeWorldVertices(t.bone, this.vertices, 0, He.VERTEX_SIZE);
var l = this.vertices,
u = e.uvs;
return (
(l[At.RegionAttachment.C1R] = h.r),
(l[At.RegionAttachment.C1G] = h.g),
(l[At.RegionAttachment.C1B] = h.b),
(l[At.RegionAttachment.C1A] = h.a),
(l[At.RegionAttachment.U1] = u[0]),
(l[At.RegionAttachment.V1] = u[1]),
(l[At.RegionAttachment.C2R] = h.r),
(l[At.RegionAttachment.C2G] = h.g),
(l[At.RegionAttachment.C2B] = h.b),
(l[At.RegionAttachment.C2A] = h.a),
(l[At.RegionAttachment.U2] = u[2]),
(l[At.RegionAttachment.V2] = u[3]),
(l[At.RegionAttachment.C3R] = h.r),
(l[At.RegionAttachment.C3G] = h.g),
(l[At.RegionAttachment.C3B] = h.b),
(l[At.RegionAttachment.C3A] = h.a),
(l[At.RegionAttachment.U3] = u[4]),
(l[At.RegionAttachment.V3] = u[5]),
(l[At.RegionAttachment.C4R] = h.r),
(l[At.RegionAttachment.C4G] = h.g),
(l[At.RegionAttachment.C4B] = h.b),
(l[At.RegionAttachment.C4A] = h.a),
(l[At.RegionAttachment.U4] = u[6]),
(l[At.RegionAttachment.V4] = u[7]),
l
);
}),
(He.prototype.computeMeshVertices = function (t, e, i) {
var n = t.bone.skeleton.color,
s = t.color,
r = e.color,
o = n.a * s.a * r.a,
a = i ? o : 1,
h = this.tempColor;
h.set(n.r * s.r * r.r * a, n.g * s.g * r.g * a, n.b * s.b * r.b * a, o);
var l = e.worldVerticesLength / 2;
this.vertices.length < e.worldVerticesLength && (this.vertices = At.Utils.newFloatArray(e.worldVerticesLength));
var u = this.vertices;
e.computeWorldVertices(t, 0, e.worldVerticesLength, u, 0, He.VERTEX_SIZE);
for (var c = e.uvs, d = 0, f = l, p = 0, g = 2; d < f; d++) (u[g++] = h.r), (u[g++] = h.g), (u[g++] = h.b), (u[g++] = h.a), (u[g++] = c[p++]), (u[g++] = c[p++]), (g += 2);
return u;
}),
(He.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0]),
(He.VERTEX_SIZE = 8),
(Ct = He),
(Mt.SkeletonRenderer = Ct),
(kt = (Ot = ge = ge || {}).webgl || (Ot.webgl = {})),
(Rt = Ot.AssetManager),
ye(We, Rt),
(Lt = We),
(kt.AssetManager = Lt),
(It = ge = ge || {}),
(Dt = It.webgl || (It.webgl = {})),
(Ke.prototype.update = function () {
var t = this.projection,
e = this.view,
i = this.projectionView,
n = this.inverseProjectionView,
s = this.zoom,
r = this.viewportWidth,
o = this.viewportHeight;
t.ortho(s * (-r / 2), s * (r / 2), s * (-o / 2), s * (o / 2), this.near, this.far), e.lookAt(this.position, this.direction, this.up), i.set(t.values), i.multiply(e), n.set(i.values).invert();
}),
(Ke.prototype.screenToWorld = function (t, e, i) {
var n = t.x,
s = i - t.y - 1,
r = this.tmp;
return (r.x = (2 * n) / e - 1), (r.y = (2 * s) / i - 1), (r.z = 2 * t.z - 1), r.project(this.inverseProjectionView), t.set(r.x, r.y, r.z), t;
}),
(Ke.prototype.setViewport = function (t, e) {
(this.viewportWidth = t), (this.viewportHeight = e);
}),
(Ft = Ke),
(Dt.OrthoCamera = Ft),
(Bt = ge = ge || {}),
(Nt = Bt.webgl || (Bt.webgl = {})),
(Ut = Bt.Texture),
ye(qe, Ut),
(qe.prototype.setFilters = function (t, e) {
var i = this.context.gl;
this.bind(), i.texParameteri(i.TEXTURE_2D, i.TEXTURE_MIN_FILTER, t), i.texParameteri(i.TEXTURE_2D, i.TEXTURE_MAG_FILTER, qe.validateMagFilter(e));
}),
(qe.validateMagFilter = function (t) {
switch (t) {
case Bt.TextureFilter.MipMap:
case Bt.TextureFilter.MipMapLinearLinear:
case Bt.TextureFilter.MipMapLinearNearest:
case Bt.TextureFilter.MipMapNearestLinear:
case Bt.TextureFilter.MipMapNearestNearest:
return Bt.TextureFilter.Linear;
default:
return t;
}
}),
(qe.prototype.setWraps = function (t, e) {
var i = this.context.gl;
this.bind(), i.texParameteri(i.TEXTURE_2D, i.TEXTURE_WRAP_S, t), i.texParameteri(i.TEXTURE_2D, i.TEXTURE_WRAP_T, e);
}),
(qe.prototype.update = function (t) {
var e = this.context.gl;
this.texture || (this.texture = this.context.gl.createTexture()),
this.bind(),
qe.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL && e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1),
e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, e.RGBA, e.UNSIGNED_BYTE, this._image),
e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.LINEAR),
e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, t ? e.LINEAR_MIPMAP_LINEAR : e.LINEAR),
e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE),
e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE),
t && e.generateMipmap(e.TEXTURE_2D);
}),
(qe.prototype.restore = function () {
(this.texture = null), this.update(this.useMipMaps);
}),
(qe.prototype.bind = function (t) {
void 0 === t && (t = 0);
var e = this.context.gl;
(this.boundUnit = t), e.activeTexture(e.TEXTURE0 + t), e.bindTexture(e.TEXTURE_2D, this.texture);
}),
(qe.prototype.unbind = function () {
var t = this.context.gl;
t.activeTexture(t.TEXTURE0 + this.boundUnit), t.bindTexture(t.TEXTURE_2D, null);
}),
(qe.prototype.dispose = function () {
this.context.removeRestorable(this), this.context.gl.deleteTexture(this.texture);
}),
(qe.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL = !1),
(Yt = qe),
(Nt.GLTexture = Yt),
(function (f) {
(f.M00 = 0), (f.M01 = 4), (f.M02 = 8), (f.M03 = 12), (f.M10 = 1), (f.M11 = 5), (f.M12 = 9), (f.M13 = 13), (f.M20 = 2), (f.M21 = 6), (f.M22 = 10), (f.M23 = 14), (f.M30 = 3), (f.M31 = 7), (f.M32 = 11), (f.M33 = 15);
var t =
((a.prototype.set = function (t) {
return this.values.set(t), this;
}),
(a.prototype.transpose = function () {
var t = this.temp,
e = this.values;
return (
(t[f.M00] = e[f.M00]),
(t[f.M01] = e[f.M10]),
(t[f.M02] = e[f.M20]),
(t[f.M03] = e[f.M30]),
(t[f.M10] = e[f.M01]),
(t[f.M11] = e[f.M11]),
(t[f.M12] = e[f.M21]),
(t[f.M13] = e[f.M31]),
(t[f.M20] = e[f.M02]),
(t[f.M21] = e[f.M12]),
(t[f.M22] = e[f.M22]),
(t[f.M23] = e[f.M32]),
(t[f.M30] = e[f.M03]),
(t[f.M31] = e[f.M13]),
(t[f.M32] = e[f.M23]),
(t[f.M33] = e[f.M33]),
this.set(t)
);
}),
(a.prototype.identity = function () {
var t = this.values;
return (
(t[f.M00] = 1),
(t[f.M01] = 0),
(t[f.M02] = 0),
(t[f.M03] = 0),
(t[f.M10] = 0),
(t[f.M11] = 1),
(t[f.M12] = 0),
(t[f.M13] = 0),
(t[f.M20] = 0),
(t[f.M21] = 0),
(t[f.M22] = 1),
(t[f.M23] = 0),
(t[f.M30] = 0),
(t[f.M31] = 0),
(t[f.M32] = 0),
(t[f.M33] = 1),
this
);
}),
(a.prototype.invert = function () {
var t = this.values,
e = this.temp,
i =
t[f.M30] * t[f.M21] * t[f.M12] * t[f.M03] -
t[f.M20] * t[f.M31] * t[f.M12] * t[f.M03] -
t[f.M30] * t[f.M11] * t[f.M22] * t[f.M03] +
t[f.M10] * t[f.M31] * t[f.M22] * t[f.M03] +
t[f.M20] * t[f.M11] * t[f.M32] * t[f.M03] -
t[f.M10] * t[f.M21] * t[f.M32] * t[f.M03] -
t[f.M30] * t[f.M21] * t[f.M02] * t[f.M13] +
t[f.M20] * t[f.M31] * t[f.M02] * t[f.M13] +
t[f.M30] * t[f.M01] * t[f.M22] * t[f.M13] -
t[f.M00] * t[f.M31] * t[f.M22] * t[f.M13] -
t[f.M20] * t[f.M01] * t[f.M32] * t[f.M13] +
t[f.M00] * t[f.M21] * t[f.M32] * t[f.M13] +
t[f.M30] * t[f.M11] * t[f.M02] * t[f.M23] -
t[f.M10] * t[f.M31] * t[f.M02] * t[f.M23] -
t[f.M30] * t[f.M01] * t[f.M12] * t[f.M23] +
t[f.M00] * t[f.M31] * t[f.M12] * t[f.M23] +
t[f.M10] * t[f.M01] * t[f.M32] * t[f.M23] -
t[f.M00] * t[f.M11] * t[f.M32] * t[f.M23] -
t[f.M20] * t[f.M11] * t[f.M02] * t[f.M33] +
t[f.M10] * t[f.M21] * t[f.M02] * t[f.M33] +
t[f.M20] * t[f.M01] * t[f.M12] * t[f.M33] -
t[f.M00] * t[f.M21] * t[f.M12] * t[f.M33] -
t[f.M10] * t[f.M01] * t[f.M22] * t[f.M33] +
t[f.M00] * t[f.M11] * t[f.M22] * t[f.M33];
if (0 == i) throw new Error("non-invertible matrix");
var n = 1 / i;
return (
(e[f.M00] =
t[f.M12] * t[f.M23] * t[f.M31] - t[f.M13] * t[f.M22] * t[f.M31] + t[f.M13] * t[f.M21] * t[f.M32] - t[f.M11] * t[f.M23] * t[f.M32] - t[f.M12] * t[f.M21] * t[f.M33] + t[f.M11] * t[f.M22] * t[f.M33]),
(e[f.M01] =
t[f.M03] * t[f.M22] * t[f.M31] - t[f.M02] * t[f.M23] * t[f.M31] - t[f.M03] * t[f.M21] * t[f.M32] + t[f.M01] * t[f.M23] * t[f.M32] + t[f.M02] * t[f.M21] * t[f.M33] - t[f.M01] * t[f.M22] * t[f.M33]),
(e[f.M02] =
t[f.M02] * t[f.M13] * t[f.M31] - t[f.M03] * t[f.M12] * t[f.M31] + t[f.M03] * t[f.M11] * t[f.M32] - t[f.M01] * t[f.M13] * t[f.M32] - t[f.M02] * t[f.M11] * t[f.M33] + t[f.M01] * t[f.M12] * t[f.M33]),
(e[f.M03] =
t[f.M03] * t[f.M12] * t[f.M21] - t[f.M02] * t[f.M13] * t[f.M21] - t[f.M03] * t[f.M11] * t[f.M22] + t[f.M01] * t[f.M13] * t[f.M22] + t[f.M02] * t[f.M11] * t[f.M23] - t[f.M01] * t[f.M12] * t[f.M23]),
(e[f.M10] =
t[f.M13] * t[f.M22] * t[f.M30] - t[f.M12] * t[f.M23] * t[f.M30] - t[f.M13] * t[f.M20] * t[f.M32] + t[f.M10] * t[f.M23] * t[f.M32] + t[f.M12] * t[f.M20] * t[f.M33] - t[f.M10] * t[f.M22] * t[f.M33]),
(e[f.M11] =
t[f.M02] * t[f.M23] * t[f.M30] - t[f.M03] * t[f.M22] * t[f.M30] + t[f.M03] * t[f.M20] * t[f.M32] - t[f.M00] * t[f.M23] * t[f.M32] - t[f.M02] * t[f.M20] * t[f.M33] + t[f.M00] * t[f.M22] * t[f.M33]),
(e[f.M12] =
t[f.M03] * t[f.M12] * t[f.M30] - t[f.M02] * t[f.M13] * t[f.M30] - t[f.M03] * t[f.M10] * t[f.M32] + t[f.M00] * t[f.M13] * t[f.M32] + t[f.M02] * t[f.M10] * t[f.M33] - t[f.M00] * t[f.M12] * t[f.M33]),
(e[f.M13] =
t[f.M02] * t[f.M13] * t[f.M20] - t[f.M03] * t[f.M12] * t[f.M20] + t[f.M03] * t[f.M10] * t[f.M22] - t[f.M00] * t[f.M13] * t[f.M22] - t[f.M02] * t[f.M10] * t[f.M23] + t[f.M00] * t[f.M12] * t[f.M23]),
(e[f.M20] =
t[f.M11] * t[f.M23] * t[f.M30] - t[f.M13] * t[f.M21] * t[f.M30] + t[f.M13] * t[f.M20] * t[f.M31] - t[f.M10] * t[f.M23] * t[f.M31] - t[f.M11] * t[f.M20] * t[f.M33] + t[f.M10] * t[f.M21] * t[f.M33]),
(e[f.M21] =
t[f.M03] * t[f.M21] * t[f.M30] - t[f.M01] * t[f.M23] * t[f.M30] - t[f.M03] * t[f.M20] * t[f.M31] + t[f.M00] * t[f.M23] * t[f.M31] + t[f.M01] * t[f.M20] * t[f.M33] - t[f.M00] * t[f.M21] * t[f.M33]),
(e[f.M22] =
t[f.M01] * t[f.M13] * t[f.M30] - t[f.M03] * t[f.M11] * t[f.M30] + t[f.M03] * t[f.M10] * t[f.M31] - t[f.M00] * t[f.M13] * t[f.M31] - t[f.M01] * t[f.M10] * t[f.M33] + t[f.M00] * t[f.M11] * t[f.M33]),
(e[f.M23] =
t[f.M03] * t[f.M11] * t[f.M20] - t[f.M01] * t[f.M13] * t[f.M20] - t[f.M03] * t[f.M10] * t[f.M21] + t[f.M00] * t[f.M13] * t[f.M21] + t[f.M01] * t[f.M10] * t[f.M23] - t[f.M00] * t[f.M11] * t[f.M23]),
(e[f.M30] =
t[f.M12] * t[f.M21] * t[f.M30] - t[f.M11] * t[f.M22] * t[f.M30] - t[f.M12] * t[f.M20] * t[f.M31] + t[f.M10] * t[f.M22] * t[f.M31] + t[f.M11] * t[f.M20] * t[f.M32] - t[f.M10] * t[f.M21] * t[f.M32]),
(e[f.M31] =
t[f.M01] * t[f.M22] * t[f.M30] - t[f.M02] * t[f.M21] * t[f.M30] + t[f.M02] * t[f.M20] * t[f.M31] - t[f.M00] * t[f.M22] * t[f.M31] - t[f.M01] * t[f.M20] * t[f.M32] + t[f.M00] * t[f.M21] * t[f.M32]),
(e[f.M32] =
t[f.M02] * t[f.M11] * t[f.M30] - t[f.M01] * t[f.M12] * t[f.M30] - t[f.M02] * t[f.M10] * t[f.M31] + t[f.M00] * t[f.M12] * t[f.M31] + t[f.M01] * t[f.M10] * t[f.M32] - t[f.M00] * t[f.M11] * t[f.M32]),
(e[f.M33] =
t[f.M01] * t[f.M12] * t[f.M20] - t[f.M02] * t[f.M11] * t[f.M20] + t[f.M02] * t[f.M10] * t[f.M21] - t[f.M00] * t[f.M12] * t[f.M21] - t[f.M01] * t[f.M10] * t[f.M22] + t[f.M00] * t[f.M11] * t[f.M22]),
(t[f.M00] = e[f.M00] * n),
(t[f.M01] = e[f.M01] * n),
(t[f.M02] = e[f.M02] * n),
(t[f.M03] = e[f.M03] * n),
(t[f.M10] = e[f.M10] * n),
(t[f.M11] = e[f.M11] * n),
(t[f.M12] = e[f.M12] * n),
(t[f.M13] = e[f.M13] * n),
(t[f.M20] = e[f.M20] * n),
(t[f.M21] = e[f.M21] * n),
(t[f.M22] = e[f.M22] * n),
(t[f.M23] = e[f.M23] * n),
(t[f.M30] = e[f.M30] * n),
(t[f.M31] = e[f.M31] * n),
(t[f.M32] = e[f.M32] * n),
(t[f.M33] = e[f.M33] * n),
this
);
}),
(a.prototype.determinant = function () {
var t = this.values;
return (
t[f.M30] * t[f.M21] * t[f.M12] * t[f.M03] -
t[f.M20] * t[f.M31] * t[f.M12] * t[f.M03] -
t[f.M30] * t[f.M11] * t[f.M22] * t[f.M03] +
t[f.M10] * t[f.M31] * t[f.M22] * t[f.M03] +
t[f.M20] * t[f.M11] * t[f.M32] * t[f.M03] -
t[f.M10] * t[f.M21] * t[f.M32] * t[f.M03] -
t[f.M30] * t[f.M21] * t[f.M02] * t[f.M13] +
t[f.M20] * t[f.M31] * t[f.M02] * t[f.M13] +
t[f.M30] * t[f.M01] * t[f.M22] * t[f.M13] -
t[f.M00] * t[f.M31] * t[f.M22] * t[f.M13] -
t[f.M20] * t[f.M01] * t[f.M32] * t[f.M13] +
t[f.M00] * t[f.M21] * t[f.M32] * t[f.M13] +
t[f.M30] * t[f.M11] * t[f.M02] * t[f.M23] -
t[f.M10] * t[f.M31] * t[f.M02] * t[f.M23] -
t[f.M30] * t[f.M01] * t[f.M12] * t[f.M23] +
t[f.M00] * t[f.M31] * t[f.M12] * t[f.M23] +
t[f.M10] * t[f.M01] * t[f.M32] * t[f.M23] -
t[f.M00] * t[f.M11] * t[f.M32] * t[f.M23] -
t[f.M20] * t[f.M11] * t[f.M02] * t[f.M33] +
t[f.M10] * t[f.M21] * t[f.M02] * t[f.M33] +
t[f.M20] * t[f.M01] * t[f.M12] * t[f.M33] -
t[f.M00] * t[f.M21] * t[f.M12] * t[f.M33] -
t[f.M10] * t[f.M01] * t[f.M22] * t[f.M33] +
t[f.M00] * t[f.M11] * t[f.M22] * t[f.M33]
);
}),
(a.prototype.translate = function (t, e, i) {
var n = this.values;
return (n[f.M03] += t), (n[f.M13] += e), (n[f.M23] += i), this;
}),
(a.prototype.copy = function () {
return new a().set(this.values);
}),
(a.prototype.projection = function (t, e, i, n) {
this.identity();
var s = 1 / Math.tan((i * (Math.PI / 180)) / 2),
r = (e + t) / (t - e),
o = (2 * e * t) / (t - e),
a = this.values;
return (
(a[f.M00] = s / n),
(a[f.M10] = 0),
(a[f.M20] = 0),
(a[f.M30] = 0),
(a[f.M01] = 0),
(a[f.M11] = s),
(a[f.M21] = 0),
(a[f.M31] = 0),
(a[f.M02] = 0),
(a[f.M12] = 0),
(a[f.M22] = r),
(a[f.M32] = -1),
(a[f.M03] = 0),
(a[f.M13] = 0),
(a[f.M23] = o),
(a[f.M33] = 0),
this
);
}),
(a.prototype.ortho2d = function (t, e, i, n) {
return this.ortho(t, t + i, e, e + n, 0, 1);
}),
(a.prototype.ortho = function (t, e, i, n, s, r) {
this.identity();
var o = 2 / (e - t),
a = 2 / (n - i),
h = -2 / (r - s),
l = -(e + t) / (e - t),
u = -(n + i) / (n - i),
c = -(r + s) / (r - s),
d = this.values;
return (
(d[f.M00] = o),
(d[f.M10] = 0),
(d[f.M20] = 0),
(d[f.M30] = 0),
(d[f.M01] = 0),
(d[f.M11] = a),
(d[f.M21] = 0),
(d[f.M31] = 0),
(d[f.M02] = 0),
(d[f.M12] = 0),
(d[f.M22] = h),
(d[f.M32] = 0),
(d[f.M03] = l),
(d[f.M13] = u),
(d[f.M23] = c),
(d[f.M33] = 1),
this
);
}),
(a.prototype.multiply = function (t) {
var e = this.temp,
i = this.values,
n = t.values;
return (
(e[f.M00] = i[f.M00] * n[f.M00] + i[f.M01] * n[f.M10] + i[f.M02] * n[f.M20] + i[f.M03] * n[f.M30]),
(e[f.M01] = i[f.M00] * n[f.M01] + i[f.M01] * n[f.M11] + i[f.M02] * n[f.M21] + i[f.M03] * n[f.M31]),
(e[f.M02] = i[f.M00] * n[f.M02] + i[f.M01] * n[f.M12] + i[f.M02] * n[f.M22] + i[f.M03] * n[f.M32]),
(e[f.M03] = i[f.M00] * n[f.M03] + i[f.M01] * n[f.M13] + i[f.M02] * n[f.M23] + i[f.M03] * n[f.M33]),
(e[f.M10] = i[f.M10] * n[f.M00] + i[f.M11] * n[f.M10] + i[f.M12] * n[f.M20] + i[f.M13] * n[f.M30]),
(e[f.M11] = i[f.M10] * n[f.M01] + i[f.M11] * n[f.M11] + i[f.M12] * n[f.M21] + i[f.M13] * n[f.M31]),
(e[f.M12] = i[f.M10] * n[f.M02] + i[f.M11] * n[f.M12] + i[f.M12] * n[f.M22] + i[f.M13] * n[f.M32]),
(e[f.M13] = i[f.M10] * n[f.M03] + i[f.M11] * n[f.M13] + i[f.M12] * n[f.M23] + i[f.M13] * n[f.M33]),
(e[f.M20] = i[f.M20] * n[f.M00] + i[f.M21] * n[f.M10] + i[f.M22] * n[f.M20] + i[f.M23] * n[f.M30]),
(e[f.M21] = i[f.M20] * n[f.M01] + i[f.M21] * n[f.M11] + i[f.M22] * n[f.M21] + i[f.M23] * n[f.M31]),
(e[f.M22] = i[f.M20] * n[f.M02] + i[f.M21] * n[f.M12] + i[f.M22] * n[f.M22] + i[f.M23] * n[f.M32]),
(e[f.M23] = i[f.M20] * n[f.M03] + i[f.M21] * n[f.M13] + i[f.M22] * n[f.M23] + i[f.M23] * n[f.M33]),
(e[f.M30] = i[f.M30] * n[f.M00] + i[f.M31] * n[f.M10] + i[f.M32] * n[f.M20] + i[f.M33] * n[f.M30]),
(e[f.M31] = i[f.M30] * n[f.M01] + i[f.M31] * n[f.M11] + i[f.M32] * n[f.M21] + i[f.M33] * n[f.M31]),
(e[f.M32] = i[f.M30] * n[f.M02] + i[f.M31] * n[f.M12] + i[f.M32] * n[f.M22] + i[f.M33] * n[f.M32]),
(e[f.M33] = i[f.M30] * n[f.M03] + i[f.M31] * n[f.M13] + i[f.M32] * n[f.M23] + i[f.M33] * n[f.M33]),
this.set(this.temp)
);
}),
(a.prototype.multiplyLeft = function (t) {
var e = this.temp,
i = this.values,
n = t.values;
return (
(e[f.M00] = n[f.M00] * i[f.M00] + n[f.M01] * i[f.M10] + n[f.M02] * i[f.M20] + n[f.M03] * i[f.M30]),
(e[f.M01] = n[f.M00] * i[f.M01] + n[f.M01] * i[f.M11] + n[f.M02] * i[f.M21] + n[f.M03] * i[f.M31]),
(e[f.M02] = n[f.M00] * i[f.M02] + n[f.M01] * i[f.M12] + n[f.M02] * i[f.M22] + n[f.M03] * i[f.M32]),
(e[f.M03] = n[f.M00] * i[f.M03] + n[f.M01] * i[f.M13] + n[f.M02] * i[f.M23] + n[f.M03] * i[f.M33]),
(e[f.M10] = n[f.M10] * i[f.M00] + n[f.M11] * i[f.M10] + n[f.M12] * i[f.M20] + n[f.M13] * i[f.M30]),
(e[f.M11] = n[f.M10] * i[f.M01] + n[f.M11] * i[f.M11] + n[f.M12] * i[f.M21] + n[f.M13] * i[f.M31]),
(e[f.M12] = n[f.M10] * i[f.M02] + n[f.M11] * i[f.M12] + n[f.M12] * i[f.M22] + n[f.M13] * i[f.M32]),
(e[f.M13] = n[f.M10] * i[f.M03] + n[f.M11] * i[f.M13] + n[f.M12] * i[f.M23] + n[f.M13] * i[f.M33]),
(e[f.M20] = n[f.M20] * i[f.M00] + n[f.M21] * i[f.M10] + n[f.M22] * i[f.M20] + n[f.M23] * i[f.M30]),
(e[f.M21] = n[f.M20] * i[f.M01] + n[f.M21] * i[f.M11] + n[f.M22] * i[f.M21] + n[f.M23] * i[f.M31]),
(e[f.M22] = n[f.M20] * i[f.M02] + n[f.M21] * i[f.M12] + n[f.M22] * i[f.M22] + n[f.M23] * i[f.M32]),
(e[f.M23] = n[f.M20] * i[f.M03] + n[f.M21] * i[f.M13] + n[f.M22] * i[f.M23] + n[f.M23] * i[f.M33]),
(e[f.M30] = n[f.M30] * i[f.M00] + n[f.M31] * i[f.M10] + n[f.M32] * i[f.M20] + n[f.M33] * i[f.M30]),
(e[f.M31] = n[f.M30] * i[f.M01] + n[f.M31] * i[f.M11] + n[f.M32] * i[f.M21] + n[f.M33] * i[f.M31]),
(e[f.M32] = n[f.M30] * i[f.M02] + n[f.M31] * i[f.M12] + n[f.M32] * i[f.M22] + n[f.M33] * i[f.M32]),
(e[f.M33] = n[f.M30] * i[f.M03] + n[f.M31] * i[f.M13] + n[f.M32] * i[f.M23] + n[f.M33] * i[f.M33]),
this.set(this.temp)
);
}),
(a.prototype.lookAt = function (t, e, i) {
a.initTemps();
var n = a.xAxis,
s = a.yAxis,
r = a.zAxis;
r.setFrom(e).normalize(), n.setFrom(e).normalize(), n.cross(i).normalize(), s.setFrom(n).cross(r).normalize(), this.identity();
var o = this.values;
return (
(o[f.M00] = n.x),
(o[f.M01] = n.y),
(o[f.M02] = n.z),
(o[f.M10] = s.x),
(o[f.M11] = s.y),
(o[f.M12] = s.z),
(o[f.M20] = -r.x),
(o[f.M21] = -r.y),
(o[f.M22] = -r.z),
a.tmpMatrix.identity(),
(a.tmpMatrix.values[f.M03] = -t.x),
(a.tmpMatrix.values[f.M13] = -t.y),
(a.tmpMatrix.values[f.M23] = -t.z),
this.multiply(a.tmpMatrix),
this
);
}),
(a.initTemps = function () {
null === a.xAxis && (a.xAxis = new f.Vector3()), null === a.yAxis && (a.yAxis = new f.Vector3()), null === a.zAxis && (a.zAxis = new f.Vector3());
}),
(a.xAxis = null),
(a.yAxis = null),
(a.zAxis = null),
(a.tmpMatrix = new a()),
a);
function a() {
(this.temp = new Float32Array(16)), (this.values = new Float32Array(16));
var t = this.values;
(t[f.M00] = 1), (t[f.M11] = 1), (t[f.M22] = 1), (t[f.M33] = 1);
}
f.Matrix4 = t;
})((zt = ge = ge || {}).webgl || (zt.webgl = {})),
(function (r) {
var t =
((e.prototype.getAttributes = function () {
return this.attributes;
}),
(e.prototype.maxVertices = function () {
return this.vertices.length / this.elementsPerVertex;
}),
(e.prototype.numVertices = function () {
return this.verticesLength / this.elementsPerVertex;
}),
(e.prototype.setVerticesLength = function (t) {
(this.dirtyVertices = !0), (this.verticesLength = t);
}),
(e.prototype.getVertices = function () {
return this.vertices;
}),
(e.prototype.maxIndices = function () {
return this.indices.length;
}),
(e.prototype.numIndices = function () {
return this.indicesLength;
}),
(e.prototype.setIndicesLength = function (t) {
(this.dirtyIndices = !0), (this.indicesLength = t);
}),
(e.prototype.getIndices = function () {
return this.indices;
}),
(e.prototype.getVertexSizeInFloats = function () {
for (var t = 0, e = 0; e < this.attributes.length; e++) t += this.attributes[e].numElements;
return t;
}),
(e.prototype.setVertices = function (t) {
if (((this.dirtyVertices = !0), t.length > this.vertices.length)) throw Error("Mesh can't store more than " + this.maxVertices() + " vertices");
this.vertices.set(t, 0), (this.verticesLength = t.length);
}),
(e.prototype.setIndices = function (t) {
if (((this.dirtyIndices = !0), t.length > this.indices.length)) throw Error("Mesh can't store more than " + this.maxIndices() + " indices");
this.indices.set(t, 0), (this.indicesLength = t.length);
}),
(e.prototype.draw = function (t, e) {
this.drawWithOffset(t, e, 0, 0 < this.indicesLength ? this.indicesLength : this.verticesLength / this.elementsPerVertex);
}),
(e.prototype.drawWithOffset = function (t, e, i, n) {
var s = this.context.gl;
(this.dirtyVertices || this.dirtyIndices) && this.update(), this.bind(t), 0 < this.indicesLength ? s.drawElements(e, n, s.UNSIGNED_SHORT, 2 * i) : s.drawArrays(e, i, n), this.unbind(t);
}),
(e.prototype.bind = function (t) {
var e = this.context.gl;
e.bindBuffer(e.ARRAY_BUFFER, this.verticesBuffer);
for (var i = 0, n = 0; n < this.attributes.length; n++) {
var s = this.attributes[n],
r = t.getAttributeLocation(s.name);
e.enableVertexAttribArray(r), e.vertexAttribPointer(r, s.numElements, e.FLOAT, !1, 4 * this.elementsPerVertex, 4 * i), (i += s.numElements);
}
0 < this.indicesLength && e.bindBuffer(e.ELEMENT_ARRAY_BUFFER, this.indicesBuffer);
}),
(e.prototype.unbind = function (t) {
for (var e = this.context.gl, i = 0; i < this.attributes.length; i++) {
var n = this.attributes[i],
s = t.getAttributeLocation(n.name);
e.disableVertexAttribArray(s);
}
e.bindBuffer(e.ARRAY_BUFFER, null), 0 < this.indicesLength && e.bindBuffer(e.ELEMENT_ARRAY_BUFFER, null);
}),
(e.prototype.update = function () {
var t = this.context.gl;
this.dirtyVertices &&
(this.verticesBuffer || (this.verticesBuffer = t.createBuffer()),
t.bindBuffer(t.ARRAY_BUFFER, this.verticesBuffer),
t.bufferData(t.ARRAY_BUFFER, this.vertices.subarray(0, this.verticesLength), t.DYNAMIC_DRAW),
(this.dirtyVertices = !1)),
this.dirtyIndices &&
(this.indicesBuffer || (this.indicesBuffer = t.createBuffer()),
t.bindBuffer(t.ELEMENT_ARRAY_BUFFER, this.indicesBuffer),
t.bufferData(t.ELEMENT_ARRAY_BUFFER, this.indices.subarray(0, this.indicesLength), t.DYNAMIC_DRAW),
(this.dirtyIndices = !1));
}),
(e.prototype.restore = function () {
(this.verticesBuffer = null), (this.indicesBuffer = null), this.update();
}),
(e.prototype.dispose = function () {
this.context.removeRestorable(this);
var t = this.context.gl;
t.deleteBuffer(this.verticesBuffer), t.deleteBuffer(this.indicesBuffer);
}),
e);
function e(t, e, i, n) {
(this.attributes = e),
(this.verticesLength = 0),
(this.dirtyVertices = !1),
(this.indicesLength = 0),
(this.dirtyIndices = !1),
(this.elementsPerVertex = 0),
(this.context = t instanceof r.ManagedWebGLRenderingContext ? t : new r.ManagedWebGLRenderingContext(t));
for (var s = (this.elementsPerVertex = 0); s < e.length; s++) this.elementsPerVertex += e[s].numElements;
(this.vertices = new Float32Array(i * this.elementsPerVertex)), (this.indices = new Uint16Array(n)), this.context.addRestorable(this);
}
function i(t, e, i) {
(this.name = t), (this.type = e), (this.numElements = i);
}
(r.Mesh = t), (r.VertexAttribute = i);
var n,
s = (ye(o, (n = i)), o);
function o() {
return n.call(this, r.Shader.POSITION, y.Float, 2) || this;
}
r.Position2Attribute = s;
var a,
h = (ye(l, (a = i)), l);
function l() {
return a.call(this, r.Shader.POSITION, y.Float, 3) || this;
}
r.Position3Attribute = h;
var u,
c = (ye(d, (u = i)), d);
function d(t) {
return void 0 === t && (t = 0), u.call(this, r.Shader.TEXCOORDS + (0 == t ? "" : t), y.Float, 2) || this;
}
r.TexCoordAttribute = c;
var f,
p = (ye(g, (f = i)), g);
function g() {
return f.call(this, r.Shader.COLOR, y.Float, 4) || this;
}
r.ColorAttribute = p;
var v,
y,
m,
x = (ye(b, (v = i)), b);
function b() {
return v.call(this, r.Shader.COLOR2, y.Float, 4) || this;
}
(r.Color2Attribute = x), ((m = y = r.VertexAttributeType || (r.VertexAttributeType = {}))[(m.Float = 0)] = "Float");
})((Xt = ge = ge || {}).webgl || (Xt.webgl = {})),
(Vt = ge = ge || {}),
(Gt = Vt.webgl || (Vt.webgl = {})),
(Ze.prototype.begin = function (t) {
var e = this.context.gl;
if (this.isDrawing) throw new Error("PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()");
(this.drawCalls = 0), (this.shader = t), (this.lastTexture = null), (this.isDrawing = !0), e.enable(e.BLEND), e.blendFunc(this.srcBlend, this.dstBlend);
}),
(Ze.prototype.setBlendMode = function (t, e) {
var i = this.context.gl;
(this.srcBlend = t), (this.dstBlend = e), this.isDrawing && (this.flush(), i.blendFunc(this.srcBlend, this.dstBlend));
}),
(Ze.prototype.draw = function (t, e, i) {
t != this.lastTexture ? (this.flush(), (this.lastTexture = t)) : (this.verticesLength + e.length > this.mesh.getVertices().length || this.indicesLength + i.length > this.mesh.getIndices().length) && this.flush();
var n = this.mesh.numVertices();
this.mesh.getVertices().set(e, this.verticesLength), (this.verticesLength += e.length), this.mesh.setVerticesLength(this.verticesLength);
for (var s = this.mesh.getIndices(), r = this.indicesLength, o = 0; o < i.length; r++, o++) s[r] = i[o] + n;
(this.indicesLength += i.length), this.mesh.setIndicesLength(this.indicesLength);
}),
(Ze.prototype.flush = function () {
var t = this.context.gl;
0 != this.verticesLength &&
(this.lastTexture.bind(), this.mesh.draw(this.shader, t.TRIANGLES), (this.verticesLength = 0), (this.indicesLength = 0), this.mesh.setVerticesLength(0), this.mesh.setIndicesLength(0), this.drawCalls++);
}),
(Ze.prototype.end = function () {
var t = this.context.gl;
if (!this.isDrawing) throw new Error("PolygonBatch is not drawing. Call PolygonBatch.begin() before calling PolygonBatch.end()");
(0 < this.verticesLength || 0 < this.indicesLength) && this.flush(), (this.shader = null), (this.lastTexture = null), (this.isDrawing = !1), t.disable(t.BLEND);
}),
(Ze.prototype.getDrawCalls = function () {
return this.drawCalls;
}),
(Ze.prototype.dispose = function () {
this.mesh.dispose();
}),
(jt = Ze),
(Gt.PolygonBatcher = jt),
(Ht = ge = ge || {}),
(Wt = Ht.webgl || (Ht.webgl = {})),
(Je.prototype.begin = function () {
this.camera.update(), this.enableRenderer(this.batcher);
}),
(Je.prototype.drawSkeleton = function (t, e, i, n) {
void 0 === e && (e = !1), void 0 === i && (i = -1), void 0 === n && (n = -1), this.enableRenderer(this.batcher), (this.skeletonRenderer.premultipliedAlpha = e), this.skeletonRenderer.draw(this.batcher, t, i, n);
}),
(Je.prototype.drawSkeletonDebug = function (t, e, i) {
void 0 === e && (e = !1), void 0 === i && (i = null), this.enableRenderer(this.shapes), (this.skeletonDebugRenderer.premultipliedAlpha = e), this.skeletonDebugRenderer.draw(this.shapes, t, i);
}),
(Je.prototype.drawTexture = function (t, e, i, n, s, r) {
void 0 === r && (r = null), this.enableRenderer(this.batcher), null === r && (r = this.WHITE);
var o = this.QUAD,
a = 0;
(o[a++] = e),
(o[a++] = i),
(o[a++] = r.r),
(o[a++] = r.g),
(o[a++] = r.b),
(o[a++] = r.a),
(o[a++] = 0),
(o[a++] = 1),
this.twoColorTint && ((o[a++] = 0), (o[a++] = 0), (o[a++] = 0), (o[a++] = 0)),
(o[a++] = e + n),
(o[a++] = i),
(o[a++] = r.r),
(o[a++] = r.g),
(o[a++] = r.b),
(o[a++] = r.a),
(o[a++] = 1),
(o[a++] = 1),
this.twoColorTint && ((o[a++] = 0), (o[a++] = 0), (o[a++] = 0), (o[a++] = 0)),
(o[a++] = e + n),
(o[a++] = i + s),
(o[a++] = r.r),
(o[a++] = r.g),
(o[a++] = r.b),
(o[a++] = r.a),
(o[a++] = 1),
(o[a++] = 0),
this.twoColorTint && ((o[a++] = 0), (o[a++] = 0), (o[a++] = 0), (o[a++] = 0)),
(o[a++] = e),
(o[a++] = i + s),
(o[a++] = r.r),
(o[a++] = r.g),
(o[a++] = r.b),
(o[a++] = r.a),
(o[a++] = 0),
(o[a++] = 0),
this.twoColorTint && ((o[a++] = 0), (o[a++] = 0), (o[a++] = 0), (o[a++] = 0)),
this.batcher.draw(t, o, this.QUAD_TRIANGLES);
}),
(Je.prototype.drawTextureUV = function (t, e, i, n, s, r, o, a, h, l) {
void 0 === l && (l = null), this.enableRenderer(this.batcher), null === l && (l = this.WHITE);
var u = this.QUAD,
c = 0;
(u[c++] = e),
(u[c++] = i),
(u[c++] = l.r),
(u[c++] = l.g),
(u[c++] = l.b),
(u[c++] = l.a),
(u[c++] = r),
(u[c++] = o),
this.twoColorTint && ((u[c++] = 0), (u[c++] = 0), (u[c++] = 0), (u[c++] = 0)),
(u[c++] = e + n),
(u[c++] = i),
(u[c++] = l.r),
(u[c++] = l.g),
(u[c++] = l.b),
(u[c++] = l.a),
(u[c++] = a),
(u[c++] = o),
this.twoColorTint && ((u[c++] = 0), (u[c++] = 0), (u[c++] = 0), (u[c++] = 0)),
(u[c++] = e + n),
(u[c++] = i + s),
(u[c++] = l.r),
(u[c++] = l.g),
(u[c++] = l.b),
(u[c++] = l.a),
(u[c++] = a),
(u[c++] = h),
this.twoColorTint && ((u[c++] = 0), (u[c++] = 0), (u[c++] = 0), (u[c++] = 0)),
(u[c++] = e),
(u[c++] = i + s),
(u[c++] = l.r),
(u[c++] = l.g),
(u[c++] = l.b),
(u[c++] = l.a),
(u[c++] = r),
(u[c++] = h),
this.twoColorTint && ((u[c++] = 0), (u[c++] = 0), (u[c++] = 0), (u[c++] = 0)),
this.batcher.draw(t, u, this.QUAD_TRIANGLES);
}),
(Je.prototype.drawTextureRotated = function (t, e, i, n, s, r, o, a, h, l) {
void 0 === h && (h = null), void 0 === l && (l = !1), this.enableRenderer(this.batcher), null === h && (h = this.WHITE);
var u,
c,
d = this.QUAD,
f = e + r,
p = i + o,
g = -r,
v = -o,
y = n - r,
m = s - o,
x = g,
b = v,
w = g,
T = m,
S = y,
_ = m,
E = y,
P = v,
A = 0,
M = 0,
C = 0,
O = 0,
k = 0,
R = 0,
L = 0,
I = 0;
(O =
0 != a
? ((C = (k = (u = Ht.MathUtils.cosDeg(a)) * S - (c = Ht.MathUtils.sinDeg(a)) * _) + ((A = u * x - c * b) - (L = u * w - c * T))), (R = c * S + u * _) + ((M = c * x + u * b) - (I = c * w + u * T)))
: ((A = x), (M = b), (L = w), (I = T), (k = S), (R = _), (C = E), P)),
(A += f),
(M += p),
(C += f),
(O += p),
(k += f),
(R += p),
(L += f),
(I += p);
var D = 0;
(d[D++] = A),
(d[D++] = M),
(d[D++] = h.r),
(d[D++] = h.g),
(d[D++] = h.b),
(d[D++] = h.a),
(d[D++] = 0),
(d[D++] = 1),
this.twoColorTint && ((d[D++] = 0), (d[D++] = 0), (d[D++] = 0), (d[D++] = 0)),
(d[D++] = C),
(d[D++] = O),
(d[D++] = h.r),
(d[D++] = h.g),
(d[D++] = h.b),
(d[D++] = h.a),
(d[D++] = 1),
(d[D++] = 1),
this.twoColorTint && ((d[D++] = 0), (d[D++] = 0), (d[D++] = 0), (d[D++] = 0)),
(d[D++] = k),
(d[D++] = R),
(d[D++] = h.r),
(d[D++] = h.g),
(d[D++] = h.b),
(d[D++] = h.a),
(d[D++] = 1),
(d[D++] = 0),
this.twoColorTint && ((d[D++] = 0), (d[D++] = 0), (d[D++] = 0), (d[D++] = 0)),
(d[D++] = L),
(d[D++] = I),
(d[D++] = h.r),
(d[D++] = h.g),
(d[D++] = h.b),
(d[D++] = h.a),
(d[D++] = 0),
(d[D++] = 0),
this.twoColorTint && ((d[D++] = 0), (d[D++] = 0), (d[D++] = 0), (d[D++] = 0)),
this.batcher.draw(t, d, this.QUAD_TRIANGLES);
}),
(Je.prototype.drawRegion = function (t, e, i, n, s, r, o) {
void 0 === r && (r = null), void 0 === o && (o = !1), this.enableRenderer(this.batcher), null === r && (r = this.WHITE);
var a = this.QUAD,
h = 0;
(a[h++] = e),
(a[h++] = i),
(a[h++] = r.r),
(a[h++] = r.g),
(a[h++] = r.b),
(a[h++] = r.a),
(a[h++] = t.u),
(a[h++] = t.v2),
this.twoColorTint && ((a[h++] = 0), (a[h++] = 0), (a[h++] = 0), (a[h++] = 0)),
(a[h++] = e + n),
(a[h++] = i),
(a[h++] = r.r),
(a[h++] = r.g),
(a[h++] = r.b),
(a[h++] = r.a),
(a[h++] = t.u2),
(a[h++] = t.v2),
this.twoColorTint && ((a[h++] = 0), (a[h++] = 0), (a[h++] = 0), (a[h++] = 0)),
(a[h++] = e + n),
(a[h++] = i + s),
(a[h++] = r.r),
(a[h++] = r.g),
(a[h++] = r.b),
(a[h++] = r.a),
(a[h++] = t.u2),
(a[h++] = t.v),
this.twoColorTint && ((a[h++] = 0), (a[h++] = 0), (a[h++] = 0), (a[h++] = 0)),
(a[h++] = e),
(a[h++] = i + s),
(a[h++] = r.r),
(a[h++] = r.g),
(a[h++] = r.b),
(a[h++] = r.a),
(a[h++] = t.u),
(a[h++] = t.v),
this.twoColorTint && ((a[h++] = 0), (a[h++] = 0), (a[h++] = 0), (a[h++] = 0)),
this.batcher.draw(t.texture, a, this.QUAD_TRIANGLES);
}),
(Je.prototype.line = function (t, e, i, n, s, r) {
void 0 === s && (s = null), void 0 === r && (r = null), this.enableRenderer(this.shapes), this.shapes.line(t, e, i, n, s);
}),
(Je.prototype.triangle = function (t, e, i, n, s, r, o, a, h, l) {
void 0 === a && (a = null), void 0 === h && (h = null), void 0 === l && (l = null), this.enableRenderer(this.shapes), this.shapes.triangle(t, e, i, n, s, r, o, a, h, l);
}),
(Je.prototype.quad = function (t, e, i, n, s, r, o, a, h, l, u, c, d) {
void 0 === l && (l = null), void 0 === u && (u = null), void 0 === c && (c = null), void 0 === d && (d = null), this.enableRenderer(this.shapes), this.shapes.quad(t, e, i, n, s, r, o, a, h, l, u, c, d);
}),
(Je.prototype.rect = function (t, e, i, n, s, r) {
void 0 === r && (r = null), this.enableRenderer(this.shapes), this.shapes.rect(t, e, i, n, s, r);
}),
(Je.prototype.rectLine = function (t, e, i, n, s, r, o) {
void 0 === o && (o = null), this.enableRenderer(this.shapes), this.shapes.rectLine(t, e, i, n, s, r, o);
}),
(Je.prototype.polygon = function (t, e, i, n) {
void 0 === n && (n = null), this.enableRenderer(this.shapes), this.shapes.polygon(t, e, i, n);
}),
(Je.prototype.circle = function (t, e, i, n, s, r) {
void 0 === s && (s = null), void 0 === r && (r = 0), this.enableRenderer(this.shapes), this.shapes.circle(t, e, i, n, s, r);
}),
(Je.prototype.curve = function (t, e, i, n, s, r, o, a, h, l) {
void 0 === l && (l = null), this.enableRenderer(this.shapes), this.shapes.curve(t, e, i, n, s, r, o, a, h, l);
}),
(Je.prototype.end = function () {
this.activeRenderer === this.batcher ? this.batcher.end() : this.activeRenderer === this.shapes && this.shapes.end(), (this.activeRenderer = null);
}),
(Je.prototype.resize = function (t) {
var e,
i,
n,
s,
r,
o = this.canvas,
a = o.clientWidth,
h = o.clientHeight;
(o.width == a && o.height == h) || ((o.width = a), (o.height = h)),
this.context.gl.viewport(0, 0, o.width, o.height),
t === Kt.Stretch ||
(t === Kt.Expand
? this.camera.setViewport(a, h)
: t === Kt.Fit &&
((e = o.width),
(i = o.height),
(n = this.camera.viewportWidth),
(r = (s = this.camera.viewportHeight) / n < i / e ? n / e : s / i),
(this.camera.viewportWidth = e * r),
(this.camera.viewportHeight = i * r))),
this.camera.update();
}),
(Je.prototype.enableRenderer = function (t) {
this.activeRenderer !== t &&
(this.end(),
t instanceof Wt.PolygonBatcher
? (this.batcherShader.bind(),
this.batcherShader.setUniform4x4f(Wt.Shader.MVP_MATRIX, this.camera.projectionView.values),
this.batcherShader.setUniformi("u_texture", 0),
this.batcher.begin(this.batcherShader),
(this.activeRenderer = this.batcher))
: t instanceof Wt.ShapeRenderer
? (this.shapesShader.bind(), this.shapesShader.setUniform4x4f(Wt.Shader.MVP_MATRIX, this.camera.projectionView.values), this.shapes.begin(this.shapesShader), (this.activeRenderer = this.shapes))
: (this.activeRenderer = this.skeletonDebugRenderer));
}),
(Je.prototype.dispose = function () {
this.batcher.dispose(), this.batcherShader.dispose(), this.shapes.dispose(), this.shapesShader.dispose(), this.skeletonDebugRenderer.dispose();
}),
(Zt = Je),
(Wt.SceneRenderer = Zt),
((qt = Kt = Wt.ResizeMode || (Wt.ResizeMode = {}))[(qt.Stretch = 0)] = "Stretch"),
(qt[(qt.Expand = 1)] = "Expand"),
(qt[(qt.Fit = 2)] = "Fit"),
(Jt = ge = ge || {}),
(Qt = Jt.webgl || (Jt.webgl = {})),
(Qe.prototype.getProgram = function () {
return this.program;
}),
(Qe.prototype.getVertexShader = function () {
return this.vertexShader;
}),
(Qe.prototype.getFragmentShader = function () {
return this.fragmentShader;
}),
(Qe.prototype.getVertexShaderSource = function () {
return this.vsSource;
}),
(Qe.prototype.getFragmentSource = function () {
return this.fsSource;
}),
(Qe.prototype.compile = function () {
var t = this.context.gl;
try {
(this.vs = this.compileShader(t.VERTEX_SHADER, this.vertexShader)), (this.fs = this.compileShader(t.FRAGMENT_SHADER, this.fragmentShader)), (this.program = this.compileProgram(this.vs, this.fs));
} catch (t) {
throw (this.dispose(), t);
}
}),
(Qe.prototype.compileShader = function (t, e) {
var i = this.context.gl,
n = i.createShader(t);
if ((i.shaderSource(n, e), i.compileShader(n), !i.getShaderParameter(n, i.COMPILE_STATUS))) {
var s = "Couldn't compile shader: " + i.getShaderInfoLog(n);
if ((i.deleteShader(n), !i.isContextLost())) throw new Error(s);
}
return n;
}),
(Qe.prototype.compileProgram = function (t, e) {
var i = this.context.gl,
n = i.createProgram();
if ((i.attachShader(n, t), i.attachShader(n, e), i.linkProgram(n), !i.getProgramParameter(n, i.LINK_STATUS))) {
var s = "Couldn't compile shader program: " + i.getProgramInfoLog(n);
if ((i.deleteProgram(n), !i.isContextLost())) throw new Error(s);
}
return n;
}),
(Qe.prototype.restore = function () {
this.compile();
}),
(Qe.prototype.bind = function () {
this.context.gl.useProgram(this.program);
}),
(Qe.prototype.unbind = function () {
this.context.gl.useProgram(null);
}),
(Qe.prototype.setUniformi = function (t, e) {
this.context.gl.uniform1i(this.getUniformLocation(t), e);
}),
(Qe.prototype.setUniformf = function (t, e) {
this.context.gl.uniform1f(this.getUniformLocation(t), e);
}),
(Qe.prototype.setUniform2f = function (t, e, i) {
this.context.gl.uniform2f(this.getUniformLocation(t), e, i);
}),
(Qe.prototype.setUniform3f = function (t, e, i, n) {
this.context.gl.uniform3f(this.getUniformLocation(t), e, i, n);
}),
(Qe.prototype.setUniform4f = function (t, e, i, n, s) {
this.context.gl.uniform4f(this.getUniformLocation(t), e, i, n, s);
}),
(Qe.prototype.setUniform2x2f = function (t, e) {
var i = this.context.gl;
this.tmp2x2.set(e), i.uniformMatrix2fv(this.getUniformLocation(t), !1, this.tmp2x2);
}),
(Qe.prototype.setUniform3x3f = function (t, e) {
var i = this.context.gl;
this.tmp3x3.set(e), i.uniformMatrix3fv(this.getUniformLocation(t), !1, this.tmp3x3);
}),
(Qe.prototype.setUniform4x4f = function (t, e) {
var i = this.context.gl;
this.tmp4x4.set(e), i.uniformMatrix4fv(this.getUniformLocation(t), !1, this.tmp4x4);
}),
(Qe.prototype.getUniformLocation = function (t) {
var e = this.context.gl,
i = e.getUniformLocation(this.program, t);
if (!i && !e.isContextLost()) throw new Error("Couldn't find location for uniform " + t);
return i;
}),
(Qe.prototype.getAttributeLocation = function (t) {
var e = this.context.gl,
i = e.getAttribLocation(this.program, t);
if (-1 == i && !e.isContextLost()) throw new Error("Couldn't find location for attribute " + t);
return i;
}),
(Qe.prototype.dispose = function () {
this.context.removeRestorable(this);
var t = this.context.gl;
this.vs && (t.deleteShader(this.vs), (this.vs = null)), this.fs && (t.deleteShader(this.fs), (this.fs = null)), this.program && (t.deleteProgram(this.program), (this.program = null));
}),
(Qe.newColoredTextured = function (t) {
return new Qe(
t,
"\n\t\t\t\tattribute vec4 " +
Qe.POSITION +
";\n\t\t\t\tattribute vec4 " +
Qe.COLOR +
";\n\t\t\t\tattribute vec2 " +
Qe.TEXCOORDS +
";\n\t\t\t\tuniform mat4 " +
Qe.MVP_MATRIX +
";\n\t\t\t\tvarying vec4 v_color;\n\t\t\t\tvarying vec2 v_texCoords;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_color = " +
Qe.COLOR +
";\n\t\t\t\t\tv_texCoords = " +
Qe.TEXCOORDS +
";\n\t\t\t\t\tgl_Position = " +
Qe.MVP_MATRIX +
" * " +
Qe.POSITION +
";\n\t\t\t\t}\n\t\t\t",
"\n\t\t\t\t#ifdef GL_ES\n\t\t\t\t\t#define LOWP lowp\n\t\t\t\t\tprecision mediump float;\n\t\t\t\t#else\n\t\t\t\t\t#define LOWP\n\t\t\t\t#endif\n\t\t\t\tvarying LOWP vec4 v_color;\n\t\t\t\tvarying vec2 v_texCoords;\n\t\t\t\tuniform sampler2D u_texture;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tgl_FragColor = v_color * texture2D(u_texture, v_texCoords);\n\t\t\t\t}\n\t\t\t"
);
}),
(Qe.newTwoColoredTextured = function (t) {
return new Qe(
t,
"\n\t\t\t\tattribute vec4 " +
Qe.POSITION +
";\n\t\t\t\tattribute vec4 " +
Qe.COLOR +
";\n\t\t\t\tattribute vec4 " +
Qe.COLOR2 +
";\n\t\t\t\tattribute vec2 " +
Qe.TEXCOORDS +
";\n\t\t\t\tuniform mat4 " +
Qe.MVP_MATRIX +
";\n\t\t\t\tvarying vec4 v_light;\n\t\t\t\tvarying vec4 v_dark;\n\t\t\t\tvarying vec2 v_texCoords;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_light = " +
Qe.COLOR +
";\n\t\t\t\t\tv_dark = " +
Qe.COLOR2 +
";\n\t\t\t\t\tv_texCoords = " +
Qe.TEXCOORDS +
";\n\t\t\t\t\tgl_Position = " +
Qe.MVP_MATRIX +
" * " +
Qe.POSITION +
";\n\t\t\t\t}\n\t\t\t",
"\n\t\t\t\t#ifdef GL_ES\n\t\t\t\t\t#define LOWP lowp\n\t\t\t\t\tprecision mediump float;\n\t\t\t\t#else\n\t\t\t\t\t#define LOWP\n\t\t\t\t#endif\n\t\t\t\tvarying LOWP vec4 v_light;\n\t\t\t\tvarying LOWP vec4 v_dark;\n\t\t\t\tvarying vec2 v_texCoords;\n\t\t\t\tuniform sampler2D u_texture;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tvec4 texColor = texture2D(u_texture, v_texCoords);\n\t\t\t\t\tgl_FragColor.a = texColor.a * v_light.a;\n\t\t\t\t\tgl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb;\n\t\t\t\t}\n\t\t\t"
);
}),
(Qe.newColored = function (t) {
return new Qe(
t,
"\n\t\t\t\tattribute vec4 " +
Qe.POSITION +
";\n\t\t\t\tattribute vec4 " +
Qe.COLOR +
";\n\t\t\t\tuniform mat4 " +
Qe.MVP_MATRIX +
";\n\t\t\t\tvarying vec4 v_color;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_color = " +
Qe.COLOR +
";\n\t\t\t\t\tgl_Position = " +
Qe.MVP_MATRIX +
" * " +
Qe.POSITION +
";\n\t\t\t\t}\n\t\t\t",
"\n\t\t\t\t#ifdef GL_ES\n\t\t\t\t\t#define LOWP lowp\n\t\t\t\t\tprecision mediump float;\n\t\t\t\t#else\n\t\t\t\t\t#define LOWP\n\t\t\t\t#endif\n\t\t\t\tvarying LOWP vec4 v_color;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tgl_FragColor = v_color;\n\t\t\t\t}\n\t\t\t"
);
}),
(Qe.MVP_MATRIX = "u_projTrans"),
(Qe.POSITION = "a_position"),
(Qe.COLOR = "a_color"),
(Qe.COLOR2 = "a_color2"),
(Qe.TEXCOORDS = "a_texCoords"),
(Qe.SAMPLER = "u_texture"),
($t = Qe),
(Qt.Shader = $t),
(te = ge = ge || {}),
(ee = te.webgl || (te.webgl = {})),
($e.prototype.begin = function (t) {
if (this.isDrawing) throw new Error("ShapeRenderer.begin() has already been called");
(this.shader = t), (this.vertexIndex = 0), (this.isDrawing = !0);
var e = this.context.gl;
e.enable(e.BLEND), e.blendFunc(this.srcBlend, this.dstBlend);
}),
($e.prototype.setBlendMode = function (t, e) {
var i = this.context.gl;
(this.srcBlend = t), (this.dstBlend = e), this.isDrawing && (this.flush(), i.blendFunc(this.srcBlend, this.dstBlend));
}),
($e.prototype.setColor = function (t) {
this.color.setFromColor(t);
}),
($e.prototype.setColorWith = function (t, e, i, n) {
this.color.set(t, e, i, n);
}),
($e.prototype.point = function (t, e, i) {
void 0 === i && (i = null), this.check(ie.Point, 1), null === i && (i = this.color), this.vertex(t, e, i);
}),
($e.prototype.line = function (t, e, i, n, s) {
void 0 === s && (s = null), this.check(ie.Line, 2), this.mesh.getVertices(), this.vertexIndex, null === s && (s = this.color), this.vertex(t, e, s), this.vertex(i, n, s);
}),
($e.prototype.triangle = function (t, e, i, n, s, r, o, a, h, l) {
void 0 === a && (a = null),
void 0 === h && (h = null),
void 0 === l && (l = null),
this.check(t ? ie.Filled : ie.Line, 3),
this.mesh.getVertices(),
this.vertexIndex,
null === a && (a = this.color),
null === h && (h = this.color),
null === l && (l = this.color),
t ? (this.vertex(e, i, a), this.vertex(n, s, h), this.vertex(r, o, l)) : (this.vertex(e, i, a), this.vertex(n, s, h), this.vertex(n, s, a), this.vertex(r, o, h), this.vertex(r, o, a), this.vertex(e, i, h));
}),
($e.prototype.quad = function (t, e, i, n, s, r, o, a, h, l, u, c, d) {
void 0 === l && (l = null),
void 0 === u && (u = null),
void 0 === c && (c = null),
void 0 === d && (d = null),
this.check(t ? ie.Filled : ie.Line, 3),
this.mesh.getVertices(),
this.vertexIndex,
null === l && (l = this.color),
null === u && (u = this.color),
null === c && (c = this.color),
null === d && (d = this.color),
t
? (this.vertex(e, i, l), this.vertex(n, s, u), this.vertex(r, o, c), this.vertex(r, o, c))
: (this.vertex(e, i, l), this.vertex(n, s, u), this.vertex(n, s, u), this.vertex(r, o, c), this.vertex(r, o, c), this.vertex(a, h, d)),
this.vertex(a, h, d),
this.vertex(e, i, l);
}),
($e.prototype.rect = function (t, e, i, n, s, r) {
void 0 === r && (r = null), this.quad(t, e, i, e + n, i, e + n, i + s, e, i + s, r, r, r, r);
}),
($e.prototype.rectLine = function (t, e, i, n, s, r, o) {
void 0 === o && (o = null), this.check(t ? ie.Filled : ie.Line, 8), null === o && (o = this.color);
var a = this.tmp.set(s - i, e - n);
a.normalize(), (r *= 0.5);
var h = a.x * r,
l = a.y * r;
t
? (this.vertex(e + h, i + l, o), this.vertex(e - h, i - l, o), this.vertex(n + h, s + l, o), this.vertex(n - h, s - l, o), this.vertex(n + h, s + l, o))
: (this.vertex(e + h, i + l, o),
this.vertex(e - h, i - l, o),
this.vertex(n + h, s + l, o),
this.vertex(n - h, s - l, o),
this.vertex(n + h, s + l, o),
this.vertex(e + h, i + l, o),
this.vertex(n - h, s - l, o)),
this.vertex(e - h, i - l, o);
}),
($e.prototype.x = function (t, e, i) {
this.line(t - i, e - i, t + i, e + i), this.line(t - i, e + i, t + i, e - i);
}),
($e.prototype.polygon = function (t, e, i, n) {
if ((void 0 === n && (n = null), i < 3)) throw new Error("Polygon must contain at least 3 vertices");
this.check(ie.Line, 2 * i), null === n && (n = this.color), this.mesh.getVertices(), this.vertexIndex, (i <<= 1);
for (var s = t[(e <<= 1)], r = t[e + 1], o = e + i, a = e, h = e + i - 2; a < h; a += 2) {
var l = t[a],
u = t[a + 1],
c = 0,
d = o <= a + 2 ? ((c = s), r) : ((c = t[a + 2]), t[a + 3]);
this.vertex(l, u, n), this.vertex(c, d, n);
}
}),
($e.prototype.circle = function (t, e, i, n, s, r) {
if ((void 0 === s && (s = null), void 0 === r && (r = 0), 0 === r && (r = Math.max(1, (6 * te.MathUtils.cbrt(n)) | 0)), r <= 0)) throw new Error("segments must be > 0.");
null === s && (s = this.color);
var o = (2 * te.MathUtils.PI) / r,
a = Math.cos(o),
h = Math.sin(o),
l = n,
u = 0;
if (t) {
for (this.check(ie.Filled, 3 * r + 3), r--, d = 0; d < r; d++) {
this.vertex(e, i, s), this.vertex(e + l, i + u, s);
var c = l;
(l = a * l - h * u), (u = h * c + a * u), this.vertex(e + l, i + u, s);
}
this.vertex(e, i, s), this.vertex(e + l, i + u, s);
} else {
this.check(ie.Line, 2 * r + 2);
for (var d = 0; d < r; d++) {
this.vertex(e + l, i + u, s);
var f = l;
(l = a * l - h * u), (u = h * f + a * u);
this.vertex(e + l, i + u, s);
}
this.vertex(e + l, i + u, s);
}
(l = n), (u = 0), this.vertex(e + l, i + u, s);
}),
($e.prototype.curve = function (t, e, i, n, s, r, o, a, h, l) {
void 0 === l && (l = null), this.check(ie.Line, 2 * h + 2), null === l && (l = this.color);
for (
var u = 1 / h,
c = u * u,
d = u * u * u,
f = 3 * u,
p = 3 * c,
g = 6 * c,
v = 6 * d,
y = t - 2 * i + s,
m = e - 2 * n + r,
x = 3 * (i - s) - t + o,
b = 3 * (n - r) - e + a,
w = t,
T = e,
S = (i - t) * f + y * p + x * d,
_ = (n - e) * f + m * p + b * d,
E = y * g + x * v,
P = m * g + b * v,
A = x * v,
M = b * v;
0 < h--;
)
this.vertex(w, T, l), (w += S), (T += _), (S += E), (_ += P), (E += A), (P += M), this.vertex(w, T, l);
this.vertex(w, T, l), this.vertex(o, a, l);
}),
($e.prototype.vertex = function (t, e, i) {
var n = this.vertexIndex,
s = this.mesh.getVertices();
(s[n++] = t), (s[n++] = e), (s[n++] = i.r), (s[n++] = i.g), (s[n++] = i.b), (s[n++] = i.a), (this.vertexIndex = n);
}),
($e.prototype.end = function () {
if (!this.isDrawing) throw new Error("ShapeRenderer.begin() has not been called");
this.flush(), this.context.gl.disable(this.context.gl.BLEND), (this.isDrawing = !1);
}),
($e.prototype.flush = function () {
0 != this.vertexIndex && (this.mesh.setVerticesLength(this.vertexIndex), this.mesh.draw(this.shader, this.shapeType), (this.vertexIndex = 0));
}),
($e.prototype.check = function (t, e) {
if (!this.isDrawing) throw new Error("ShapeRenderer.begin() has not been called");
if (this.shapeType == t) {
if (!(this.mesh.maxVertices() - this.mesh.numVertices() < e)) return;
this.flush();
} else this.flush(), (this.shapeType = t);
}),
($e.prototype.dispose = function () {
this.mesh.dispose();
}),
(se = $e),
(ee.ShapeRenderer = se),
((ne = ie = ee.ShapeType || (ee.ShapeType = {}))[(ne.Point = 0)] = "Point"),
(ne[(ne.Line = 1)] = "Line"),
(ne[(ne.Filled = 4)] = "Filled"),
(re = ge = ge || {}),
(oe = re.webgl || (re.webgl = {})),
(ti.prototype.draw = function (t, e, i) {
void 0 === i && (i = null);
var n = e.x,
s = e.y,
r = this.context.gl,
o = this.premultipliedAlpha ? r.ONE : r.SRC_ALPHA;
t.setBlendMode(o, r.ONE_MINUS_SRC_ALPHA);
var a = e.bones;
if (this.drawBones) {
t.setColor(this.boneLineColor);
for (var h = 0, l = a.length; h < l; h++) {
var u = a[h];
(i && -1 < i.indexOf(u.data.name)) ||
(null != u.parent && ((T = n + u.data.length * u.a + u.worldX), (S = s + u.data.length * u.c + u.worldY), t.rectLine(!0, n + u.worldX, s + u.worldY, T, S, this.boneWidth * this.scale)));
}
this.drawSkeletonXY && t.x(n, s, 4 * this.scale);
}
if (this.drawRegionAttachments)
for (t.setColor(this.attachmentLineColor), h = 0, l = (U = e.slots).length; h < l; h++)
(z = (Y = U[h]).getAttachment()) instanceof re.RegionAttachment &&
((d = this.vertices), z.computeWorldVertices(Y.bone, d, 0, 2), t.line(d[0], d[1], d[2], d[3]), t.line(d[2], d[3], d[4], d[5]), t.line(d[4], d[5], d[6], d[7]), t.line(d[6], d[7], d[0], d[1]));
if (this.drawMeshHull || this.drawMeshTriangles)
for (h = 0, l = (U = e.slots).length; h < l; h++)
if ((Y = U[h]).bone.active && (z = Y.getAttachment()) instanceof re.MeshAttachment) {
var c = z,
d = this.vertices;
c.computeWorldVertices(Y, 0, c.worldVerticesLength, d, 0, 2);
var f = c.triangles,
p = c.hullLength;
if (this.drawMeshTriangles) {
t.setColor(this.triangleLineColor);
for (var g = 0, v = f.length; g < v; g += 3) {
var y = 2 * f[g],
m = 2 * f[g + 1],
x = 2 * f[g + 2];
t.triangle(!1, d[y], d[1 + y], d[m], d[1 + m], d[x], d[1 + x]);
}
}
if (this.drawMeshHull && 0 < p) {
t.setColor(this.attachmentLineColor);
var b = d[(p = 2 * (p >> 1)) - 2],
w = d[p - 1];
for (g = 0, v = p; g < v; g += 2) {
var T = d[g],
S = d[g + 1];
t.line(T, S, b, w), (b = T), (w = S);
}
}
}
if (this.drawBoundingBoxes) {
var _ = this.bounds;
_.update(e, !0), t.setColor(this.aabbColor), t.rect(!1, _.minX, _.minY, _.getWidth(), _.getHeight());
var E = _.polygons,
P = _.boundingBoxes;
for (h = 0, l = E.length; h < l; h++) {
var A = E[h];
t.setColor(P[h].color), t.polygon(A, 0, A.length);
}
}
if (this.drawPaths)
for (h = 0, l = (U = e.slots).length; h < l; h++)
if ((Y = U[h]).bone.active && (z = Y.getAttachment()) instanceof re.PathAttachment) {
var M = z,
C = ((v = M.worldVerticesLength), (this.temp = re.Utils.setArraySize(this.temp, v, 0)));
M.computeWorldVertices(Y, 0, v, C, 0, 2);
var O = this.pathColor,
k = C[2],
R = C[3],
L = 0,
I = 0;
for (
M.closed &&
(t.setColor(O),
(D = C[0]),
(F = C[1]),
(B = C[v - 2]),
(N = C[v - 1]),
(L = C[v - 4]),
(I = C[v - 3]),
t.curve(k, R, D, F, B, N, L, I, 32),
t.setColor(ti.LIGHT_GRAY),
t.line(k, R, D, F),
t.line(L, I, B, N)),
v -= 4,
g = 4;
g < v;
g += 6
) {
var D = C[g],
F = C[g + 1],
B = C[g + 2],
N = C[g + 3];
(L = C[g + 4]), (I = C[g + 5]), t.setColor(O), t.curve(k, R, D, F, B, N, L, I, 32), t.setColor(ti.LIGHT_GRAY), t.line(k, R, D, F), t.line(L, I, B, N), (k = L), (R = I);
}
}
if (this.drawBones) for (t.setColor(this.boneOriginColor), h = 0, l = a.length; h < l; h++) (u = a[h]), (i && -1 < i.indexOf(u.data.name)) || t.circle(!0, n + u.worldX, s + u.worldY, 3 * this.scale, ti.GREEN, 8);
if (this.drawClipping) {
var U = e.slots;
t.setColor(this.clipColor);
var Y, z;
for (h = 0, l = U.length; h < l; h++)
if ((Y = U[h]).bone.active && (z = Y.getAttachment()) instanceof re.ClippingAttachment) {
var X = z;
(v = X.worldVerticesLength), (C = this.temp = re.Utils.setArraySize(this.temp, v, 0));
X.computeWorldVertices(Y, 0, v, C, 0, 2);
for (var V = 0, G = C.length; V < G; V += 2) (T = C[V]), (S = C[V + 1]), (L = C[(V + 2) % C.length]), (I = C[(V + 3) % C.length]), t.line(T, S, L, I);
}
}
}),
(ti.prototype.dispose = function () {}),
(ti.LIGHT_GRAY = new re.Color(192 / 255, 192 / 255, 192 / 255, 1)),
(ti.GREEN = new re.Color(0, 1, 0, 1)),
(ae = ti),
(oe.SkeletonDebugRenderer = ae),
(he = ge = ge || {}),
(le = he.webgl || (he.webgl = {})),
(ue = function (t, e, i) {
(this.vertices = t), (this.numVertices = e), (this.numFloats = i);
}),
(ei.prototype.draw = function (t, e, i, n) {
void 0 === i && (i = -1), void 0 === n && (n = -1);
var s = this.clipper,
r = this.premultipliedAlpha,
o = this.twoColorTint,
a = null,
h = this.temp,
l = this.temp2,
u = this.temp3,
c = this.temp4,
d = this.renderable,
f = null,
p = null,
g = e.drawOrder,
v = null,
y = e.color,
m = o ? 12 : 8,
x = !1;
-1 == i && (x = !0);
for (var b = 0, w = g.length; b < w; b++) {
var T = s.isClipping() ? 2 : m,
S = g[b];
if (S.bone.active)
if ((0 <= i && i == S.data.index && (x = !0), x)) {
0 <= n && n == S.data.index && (x = !1);
var _ = S.getAttachment(),
E = null;
if (_ instanceof he.RegionAttachment) {
var P = _;
(d.vertices = this.vertices),
(d.numVertices = 4),
(d.numFloats = T << 2),
P.computeWorldVertices(S.bone, d.vertices, 0, T),
(p = ei.QUAD_TRIANGLES),
(f = P.uvs),
(E = P.region.renderObject.texture),
(v = P.color);
} else {
if (!(_ instanceof he.MeshAttachment)) {
if (_ instanceof he.ClippingAttachment) {
s.clipStart(S, _);
continue;
}
s.clipEndWithSlot(S);
continue;
}
var A = _;
(d.vertices = this.vertices),
(d.numVertices = A.worldVerticesLength >> 1),
(d.numFloats = d.numVertices * T),
d.numFloats > d.vertices.length && (d.vertices = this.vertices = he.Utils.newFloatArray(d.numFloats)),
A.computeWorldVertices(S, 0, A.worldVerticesLength, d.vertices, 0, T),
(p = A.triangles),
(E = A.region.renderObject.texture),
(f = A.uvs),
(v = A.color);
}
if (null != E) {
var M = S.color,
C = this.tempColor;
(C.r = y.r * M.r * v.r), (C.g = y.g * M.g * v.g), (C.b = y.b * M.b * v.b), (C.a = y.a * M.a * v.a), r && ((C.r *= C.a), (C.g *= C.a), (C.b *= C.a));
var O = this.tempColor2;
null == S.darkColor ? O.set(0, 0, 0, 1) : (r ? ((O.r = S.darkColor.r * C.a), (O.g = S.darkColor.g * C.a), (O.b = S.darkColor.b * C.a)) : O.setFromColor(S.darkColor), (O.a = r ? 1 : 0));
var k = S.data.blendMode;
if ((k != a && ((a = k), t.setBlendMode(le.WebGLBlendModeConverter.getSourceGLBlendMode(a, r), le.WebGLBlendModeConverter.getDestGLBlendMode(a))), s.isClipping())) {
s.clipTriangles(d.vertices, d.numFloats, p, p.length, f, C, O, o);
var R = new Float32Array(s.clippedVertices),
L = s.clippedTriangles;
if (null != this.vertexEffect) {
var I = this.vertexEffect,
D = R;
if (o)
for (var F = 0, B = R.length; F < B; F += m)
(h.x = D[F]),
(h.y = D[F + 1]),
u.set(D[F + 2], D[F + 3], D[F + 4], D[F + 5]),
(l.x = D[F + 6]),
(l.y = D[F + 7]),
c.set(D[F + 8], D[F + 9], D[F + 10], D[F + 11]),
I.transform(h, l, u, c),
(D[F] = h.x),
(D[F + 1] = h.y),
(D[F + 2] = u.r),
(D[F + 3] = u.g),
(D[F + 4] = u.b),
(D[F + 5] = u.a),
(D[F + 6] = l.x),
(D[F + 7] = l.y),
(D[F + 8] = c.r),
(D[F + 9] = c.g),
(D[F + 10] = c.b),
(D[F + 11] = c.a);
else {
F = 0;
for (var N = R.length; F < N; F += m)
(h.x = D[F]),
(h.y = D[F + 1]),
u.set(D[F + 2], D[F + 3], D[F + 4], D[F + 5]),
(l.x = D[F + 6]),
(l.y = D[F + 7]),
c.set(0, 0, 0, 0),
I.transform(h, l, u, c),
(D[F] = h.x),
(D[F + 1] = h.y),
(D[F + 2] = u.r),
(D[F + 3] = u.g),
(D[F + 4] = u.b),
(D[F + 5] = u.a),
(D[F + 6] = l.x),
(D[F + 7] = l.y);
}
}
t.draw(E, R, L);
} else {
if (((D = d.vertices), null != this.vertexEffect))
if (((I = this.vertexEffect), o)) {
F = 0;
for (var U = 0, Y = d.numFloats; F < Y; F += m, U += 2)
(h.x = D[F]),
(h.y = D[F + 1]),
(l.x = f[U]),
(l.y = f[U + 1]),
u.setFromColor(C),
c.setFromColor(O),
I.transform(h, l, u, c),
(D[F] = h.x),
(D[F + 1] = h.y),
(D[F + 2] = u.r),
(D[F + 3] = u.g),
(D[F + 4] = u.b),
(D[F + 5] = u.a),
(D[F + 6] = l.x),
(D[F + 7] = l.y),
(D[F + 8] = c.r),
(D[F + 9] = c.g),
(D[F + 10] = c.b),
(D[F + 11] = c.a);
} else {
(F = 0), (U = 0);
for (var z = d.numFloats; F < z; F += m, U += 2)
(h.x = D[F]),
(h.y = D[F + 1]),
(l.x = f[U]),
(l.y = f[U + 1]),
u.setFromColor(C),
c.set(0, 0, 0, 0),
I.transform(h, l, u, c),
(D[F] = h.x),
(D[F + 1] = h.y),
(D[F + 2] = u.r),
(D[F + 3] = u.g),
(D[F + 4] = u.b),
(D[F + 5] = u.a),
(D[F + 6] = l.x),
(D[F + 7] = l.y);
}
else if (o) {
(F = 2), (U = 0);
for (var X = d.numFloats; F < X; F += m, U += 2)
(D[F] = C.r), (D[F + 1] = C.g), (D[F + 2] = C.b), (D[F + 3] = C.a), (D[F + 4] = f[U]), (D[F + 5] = f[U + 1]), (D[F + 6] = O.r), (D[F + 7] = O.g), (D[F + 8] = O.b), (D[F + 9] = O.a);
} else {
(F = 2), (U = 0);
for (var V = d.numFloats; F < V; F += m, U += 2) (D[F] = C.r), (D[F + 1] = C.g), (D[F + 2] = C.b), (D[F + 3] = C.a), (D[F + 4] = f[U]), (D[F + 5] = f[U + 1]);
}
var G = d.vertices.subarray(0, d.numFloats);
t.draw(E, G, p);
}
}
s.clipEndWithSlot(S);
} else s.clipEndWithSlot(S);
else s.clipEndWithSlot(S);
}
s.clipEnd();
}),
(ei.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0]),
(ce = ei),
(le.SkeletonRenderer = ce),
(de = ge = ge || {}),
(fe = de.webgl || (de.webgl = {})),
(ii.prototype.setFrom = function (t) {
return (this.x = t.x), (this.y = t.y), (this.z = t.z), this;
}),
(ii.prototype.set = function (t, e, i) {
return (this.x = t), (this.y = e), (this.z = i), this;
}),
(ii.prototype.add = function (t) {
return (this.x += t.x), (this.y += t.y), (this.z += t.z), this;
}),
(ii.prototype.sub = function (t) {
return (this.x -= t.x), (this.y -= t.y), (this.z -= t.z), this;
}),
(ii.prototype.scale = function (t) {
return (this.x *= t), (this.y *= t), (this.z *= t), this;
}),
(ii.prototype.normalize = function () {
var t = this.length();
return 0 == t || ((t = 1 / t), (this.x *= t), (this.y *= t), (this.z *= t)), this;
}),
(ii.prototype.cross = function (t) {
return this.set(this.y * t.z - this.z * t.y, this.z * t.x - this.x * t.z, this.x * t.y - this.y * t.x);
}),
(ii.prototype.multiply = function (t) {
var e = t.values;
return this.set(
this.x * e[fe.M00] + this.y * e[fe.M01] + this.z * e[fe.M02] + e[fe.M03],
this.x * e[fe.M10] + this.y * e[fe.M11] + this.z * e[fe.M12] + e[fe.M13],
this.x * e[fe.M20] + this.y * e[fe.M21] + this.z * e[fe.M22] + e[fe.M23]
);
}),
(ii.prototype.project = function (t) {
var e = t.values,
i = 1 / (this.x * e[fe.M30] + this.y * e[fe.M31] + this.z * e[fe.M32] + e[fe.M33]);
return this.set(
(this.x * e[fe.M00] + this.y * e[fe.M01] + this.z * e[fe.M02] + e[fe.M03]) * i,
(this.x * e[fe.M10] + this.y * e[fe.M11] + this.z * e[fe.M12] + e[fe.M13]) * i,
(this.x * e[fe.M20] + this.y * e[fe.M21] + this.z * e[fe.M22] + e[fe.M23]) * i
);
}),
(ii.prototype.dot = function (t) {
return this.x * t.x + this.y * t.y + this.z * t.z;
}),
(ii.prototype.length = function () {
return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
}),
(ii.prototype.distance = function (t) {
var e = t.x - this.x,
i = t.y - this.y,
n = t.z - this.z;
return Math.sqrt(e * e + i * i + n * n);
}),
(pe = ii),
(fe.Vector3 = pe),
(function (t) {
var e =
((i.prototype.setupCanvas = function (t, e) {
var n = this;
(this.gl = t.getContext("webgl2", e) || t.getContext("webgl", e)),
(this.canvas = t).addEventListener("webglcontextlost", function (t) {
t && t.preventDefault();
}),
t.addEventListener("webglcontextrestored", function (t) {
for (var e = 0, i = n.restorables.length; e < i; e++) n.restorables[e].restore();
});
}),
(i.prototype.addRestorable = function (t) {
this.restorables.push(t);
}),
(i.prototype.removeRestorable = function (t) {
var e = this.restorables.indexOf(t);
-1 < e && this.restorables.splice(e, 1);
}),
i);
function i(t, e) {
void 0 === e && (e = { alpha: "true" }), (this.restorables = new Array()), t instanceof HTMLCanvasElement || t instanceof EventTarget ? this.setupCanvas(t, e) : ((this.gl = t), (this.canvas = this.gl.canvas));
}
t.ManagedWebGLRenderingContext = e;
var n =
((s.getDestGLBlendMode = function (t) {
switch (t) {
case ve.BlendMode.Normal:
return s.ONE_MINUS_SRC_ALPHA;
case ve.BlendMode.Additive:
return s.ONE;
case ve.BlendMode.Multiply:
case ve.BlendMode.Screen:
return s.ONE_MINUS_SRC_ALPHA;
default:
throw new Error("Unknown blend mode: " + t);
}
}),
(s.getSourceGLBlendMode = function (t, e) {
switch ((void 0 === e && (e = !1), t)) {
case ve.BlendMode.Normal:
case ve.BlendMode.Additive:
return e ? s.ONE : s.SRC_ALPHA;
case ve.BlendMode.Multiply:
return s.DST_COLOR;
case ve.BlendMode.Screen:
return s.ONE;
default:
throw new Error("Unknown blend mode: " + t);
}
}),
(s.ZERO = 0),
(s.ONE = 1),
(s.SRC_COLOR = 768),
(s.ONE_MINUS_SRC_COLOR = 769),
(s.SRC_ALPHA = 770),
(s.ONE_MINUS_SRC_ALPHA = 771),
(s.DST_ALPHA = 772),
(s.ONE_MINUS_DST_ALPHA = 773),
(s.DST_COLOR = 774),
s);
function s() {}
t.WebGLBlendModeConverter = n;
})((ve = ge = ge || {}).webgl || (ve.webgl = {})),
(ni.exports = ge);
}.call(window));
},
function (t, e, i) {
var n = i(0),
y = i(11),
m = i(204),
f = i(7),
p = i(218),
g = i(219),
v = i(220),
s = new n({
Extends: g,
initialize: function (t, e, i, n, s, r, o) {
var a,
h,
l,
u = [],
c = t.cacheManager.custom.spine;
if (f(e)) {
var d = e;
for (
e = y(d, "key"),
h = new p(t, { key: e, url: y(d, "jsonURL"), extension: y(d, "jsonExtension", "json"), xhrSettings: y(d, "jsonXhrSettings") }),
n = y(d, "atlasURL"),
s = y(d, "preMultipliedAlpha"),
Array.isArray(n) || (n = [n]),
a = 0;
a < n.length;
a++
)
((l = new v(t, { key: e + "!" + a, url: n[a], extension: y(d, "atlasExtension", "atlas"), xhrSettings: y(d, "atlasXhrSettings") })).cache = c), u.push(l);
} else for (h = new p(t, e, i, r), Array.isArray(n) || (n = [n]), a = 0; a < n.length; a++) ((l = new v(t, e + "!" + a, n[a], o)).cache = c), u.push(l);
u.unshift(h), g.call(this, t, "spine", e, u), (this.config.preMultipliedAlpha = s);
},
onFileComplete: function (t) {
if (-1 !== this.files.indexOf(t) && (this.pending--, "text" === t.type)) {
for (var e = t.data.split("\n"), i = [], n = 0; n < e.length; n++) {
var s = e[n];
"" === s.trim() && n < e.length - 1 && ((s = e[n + 1]), i.push(s));
}
var r = this.config,
o = this.loader,
a = o.baseURL,
h = o.path,
l = o.prefix,
u = y(r, "baseURL", this.baseURL),
c = y(r, "path", t.src.match(/^.*\//))[0],
d = y(r, "prefix", this.prefix),
f = y(r, "textureXhrSettings");
o.setBaseURL(u), o.setPath(c), o.setPrefix(d);
for (var p = 0; p < i.length; p++) {
var g = i[p],
v = new m(o, g, g, f);
o.keyExists(v) || (this.addToMultiFile(v), o.addFile(v));
}
o.setBaseURL(a), o.setPath(h), o.setPrefix(l);
}
},
addToCache: function () {
if (this.isReadyToProcess()) {
var t;
this.files[0].addToCache();
for (var e = "", i = "", n = !!this.config.preMultipliedAlpha, s = this.loader.textureManager, r = 1; r < this.files.length; r++) {
var o,
a,
h,
l = this.files[r];
"text" === l.type ? ((e = l.key.replace(/![\d]$/, "")), (t = l.cache), (i = i.concat(l.data))) : ((a = (o = l.key.trim()).indexOf("!")), (h = o.substr(a + 1)), s.exists(h) || s.addImage(h, l.data)),
l.pendingDestroy();
}
t.add(e, { preMultipliedAlpha: n, data: i, prefix: this.prefix }), (this.complete = !0);
}
},
});
t.exports = s;
},
function (t, e, i) {
var n = i(0),
s = i(15),
c = i(21),
r = i(22),
d = i(11),
f = i(7),
o = new n({
Extends: c,
initialize: function t(e, i, n, s, r) {
var o,
a,
h = "png";
f(i) && ((i = d((a = i), "key")), (n = d(a, "url")), (o = d(a, "normalMap")), (s = d(a, "xhrSettings")), (h = d(a, "extension", h)), (r = d(a, "frameConfig"))), Array.isArray(n) && ((o = n[1]), (n = n[0]));
var l,
u = { type: "image", cache: e.textureManager, extension: h, responseType: "blob", key: i, url: n, xhrSettings: s, config: r };
c.call(this, e, u), o && (((l = new t(e, this.key, o, s, r)).type = "normalMap"), this.setLink(l), e.addFile(l));
},
onProcess: function () {
(this.state = s.FILE_PROCESSING), (this.data = new Image()), (this.data.crossOrigin = this.crossOrigin);
var t = this;
(this.data.onload = function () {
c.revokeObjectURL(t.data), t.onProcessComplete();
}),
(this.data.onerror = function () {
c.revokeObjectURL(t.data), t.onProcessError();
}),
c.createObjectURL(this.data, this.xhrLoader.response, "image/png");
},
addToCache: function () {
var t,
e = this.linkFile;
e && e.state === s.FILE_COMPLETE
? ((t = "image" === this.type ? this.cache.addImage(this.key, this.data, e.data) : this.cache.addImage(e.key, e.data, this.data)), this.pendingDestroy(t), e.pendingDestroy(t))
: e || ((t = this.cache.addImage(this.key, this.data)), this.pendingDestroy(t));
},
});
r.register("image", function (t, e, i) {
if (Array.isArray(t)) for (var n = 0; n < t.length; n++) this.addFile(new o(this, t[n]));
else this.addFile(new o(this, t, e, i));
return this;
}),
(t.exports = o);
},
function (t, e, i) {
t.exports = { ADD: i(206), COMPLETE: i(207), FILE_COMPLETE: i(208), FILE_KEY_COMPLETE: i(209), FILE_LOAD_ERROR: i(210), FILE_LOAD: i(211), FILE_PROGRESS: i(212), POST_PROCESS: i(213), PROGRESS: i(214), START: i(215) };
},
function (t, e) {
t.exports = "addfile";
},
function (t, e) {
t.exports = "complete";
},
function (t, e) {
t.exports = "filecomplete";
},
function (t, e) {
t.exports = "filecomplete-";
},
function (t, e) {
t.exports = "loaderror";
},
function (t, e) {
t.exports = "load";
},
function (t, e) {
t.exports = "fileprogress";
},
function (t, e) {
t.exports = "postprocess";
},
function (t, e) {
t.exports = "progress";
},
function (t, e) {
t.exports = "start";
},
function (t, e) {
t.exports = function (t, e) {
return !!t.url && (t.url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/) ? t.url : e + t.url);
};
},
function (t, e, i) {
var r = i(45);
t.exports = function (t, e) {
var i = r(e, t.xhrSettings),
n = new XMLHttpRequest();
if ((n.open("GET", t.src, i.async, i.user, i.password), (n.responseType = t.xhrSettings.responseType), (n.timeout = i.timeout), i.headers)) for (var s in i.headers) n.setRequestHeader(s, i.headers[s]);
return (
i.header && i.headerValue && n.setRequestHeader(i.header, i.headerValue),
i.requestedWith && n.setRequestHeader("X-Requested-With", i.requestedWith),
i.overrideMimeType && n.overrideMimeType(i.overrideMimeType),
i.withCredentials && (n.withCredentials = !0),
(n.onload = t.onLoad.bind(t, n)),
(n.onerror = t.onError.bind(t, n)),
(n.onprogress = t.onProgress.bind(t)),
n.send(),
n
);
};
},
function (t, e, i) {
var n = i(0),
h = i(15),
l = i(21),
s = i(22),
u = i(11),
c = i(10),
d = i(7),
r = new n({
Extends: l,
initialize: function (t, e, i, n, s) {
var r,
o = "json";
d(e) && ((e = u((r = e), "key")), (i = u(r, "url")), (n = u(r, "xhrSettings")), (o = u(r, "extension", o)), (s = u(r, "dataKey", s)));
var a = { type: "json", cache: t.cacheManager.json, extension: o, responseType: "text", key: e, url: i, xhrSettings: n, config: s };
l.call(this, t, a), d(i) && ((this.data = s ? c(i, s) : i), (this.state = h.FILE_POPULATED));
},
onProcess: function () {
if (this.state !== h.FILE_POPULATED) {
this.state = h.FILE_PROCESSING;
try {
var t = JSON.parse(this.xhrLoader.responseText);
} catch (t) {
throw (this.onProcessError(), t);
}
var e = this.config;
this.data = "string" == typeof e ? c(t, e, t) : t;
}
this.onProcessComplete();
},
});
s.register("json", function (t, e, i, n) {
if (Array.isArray(t)) for (var s = 0; s < t.length; s++) this.addFile(new r(this, t[s]));
else this.addFile(new r(this, t, e, n, i));
return this;
}),
(t.exports = r);
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e, i, n) {
var s = [];
n.forEach(function (t) {
t && s.push(t);
}),
(this.loader = t),
(this.type = e),
(this.key = i),
(this.multiKeyIndex = t.multiKeyIndex++),
(this.files = s),
(this.complete = !1),
(this.pending = s.length),
(this.failed = 0),
(this.config = {}),
(this.baseURL = t.baseURL),
(this.path = t.path),
(this.prefix = t.prefix);
for (var r = 0; r < s.length; r++) s[r].multiFile = this;
},
isReadyToProcess: function () {
return 0 === this.pending && 0 === this.failed && !this.complete;
},
addToMultiFile: function (t) {
return this.files.push(t), (t.multiFile = this).pending++, (this.complete = !1), this;
},
onFileComplete: function (t) {
-1 !== this.files.indexOf(t) && this.pending--;
},
onFileFailed: function (t) {
-1 !== this.files.indexOf(t) && this.failed++;
},
});
t.exports = n;
},
function (t, e, i) {
var n = i(0),
s = i(15),
l = i(21),
r = i(22),
u = i(11),
c = i(7),
o = new n({
Extends: l,
initialize: function (t, e, i, n) {
var s,
r = "text",
o = "txt",
a = t.cacheManager.text;
c(e) && ((e = u((s = e), "key")), (i = u(s, "url")), (n = u(s, "xhrSettings")), (o = u(s, "extension", o)), (r = u(s, "type", r)), (a = u(s, "cache", a)));
var h = { type: r, cache: a, extension: o, responseType: "text", key: e, url: i, xhrSettings: n };
l.call(this, t, h);
},
onProcess: function () {
(this.state = s.FILE_PROCESSING), (this.data = this.xhrLoader.responseText), this.onProcessComplete();
},
});
r.register("text", function (t, e, i) {
if (Array.isArray(t)) for (var n = 0; n < t.length; n++) this.addFile(new o(this, t[n]));
else this.addFile(new o(this, t, e, i));
return this;
}),
(t.exports = o);
},
function (t, e, i) {
var h = i(28),
l = i(3),
n = i(0),
s = i(47),
r = i(48),
o = i(49),
a = i(50),
u = i(51),
c = i(52),
d = i(8),
f = i(19),
p = i(53),
g = i(9),
v = i(243),
y = i(250),
m = new n({
Extends: p,
Mixins: [s, r, o, a, u, c, y],
initialize: function (t, e, i, n, s, r, o) {
p.call(this, t, "Spine"),
(this.plugin = e),
(this.skeleton = null),
(this.skeletonData = null),
(this.state = null),
(this.stateData = null),
(this.root = null),
(this.bounds = null),
(this.drawDebug = !1),
(this.timeScale = 1),
(this.displayOriginX = 0),
(this.displayOriginY = 0),
(this.preMultipliedAlpha = !1),
(this.blendMode = -1),
this.setPosition(i, n),
s && this.setSkeleton(s, r, o);
},
willRender: function (t, e) {
var i,
n,
s = !this.skeleton || !(15 !== this.renderFlags || (0 !== this.cameraFilter && this.cameraFilter & t.id));
return e || s || !this.parentContainer || ((n = (i = this.plugin).sceneRenderer), i.gl && n.batcher.isDrawing && (n.end(), i.renderer.pipelines.rebind())), s;
},
setAlpha: function (t, e) {
var i;
return void 0 === t && (t = 1), e ? (i = this.findSlot(e)) && (i.color.a = l(t, 0, 1)) : (this.alpha = t), this;
},
alpha: {
get: function () {
return this.skeleton.color.a;
},
set: function (t) {
var e = l(t, 0, 1);
this.skeleton && (this.skeleton.color.a = e), 0 === e ? (this.renderFlags &= -3) : (this.renderFlags |= 2);
},
},
red: {
get: function () {
return this.skeleton.color.r;
},
set: function (t) {
var e = l(t, 0, 1);
this.skeleton && (this.skeleton.color.r = e);
},
},
green: {
get: function () {
return this.skeleton.color.g;
},
set: function (t) {
var e = l(t, 0, 1);
this.skeleton && (this.skeleton.color.g = e);
},
},
blue: {
get: function () {
return this.skeleton.color.b;
},
set: function (t) {
var e = l(t, 0, 1);
this.skeleton && (this.skeleton.color.b = e);
},
},
setColor: function (t, e) {
void 0 === t && (t = 16777215);
var i,
n = ((t >> 16) & 255) / 255,
s = ((t >> 8) & 255) / 255,
r = (255 & t) / 255,
o = 16777215 < t ? (t >>> 24) / 255 : null,
a = this.skeleton;
return !e || ((i = this.findSlot(e)) && (a = i)), (a.color.r = n), (a.color.g = s), (a.color.b = r), null !== o && (a.color.a = o), this;
},
setSkeletonFromJSON: function (t, e, i, n) {
return this.setSkeleton(t, e, i, n);
},
setSkeleton: function (t, e, i, n) {
this.state && (this.state.clearListeners(), this.state.clearListenerNotifications());
var s = this.plugin.createSkeleton(t, n);
(this.skeletonData = s.skeletonData), (this.preMultipliedAlpha = s.preMultipliedAlpha);
var r = s.skeleton;
return (
r.setSkin(),
r.setToSetupPose(),
(this.skeleton = r),
(s = this.plugin.createAnimationState(r)),
this.state && (this.state.clearListeners(), this.state.clearListenerNotifications()),
(this.state = s.state),
(this.stateData = s.stateData),
this.state.addListener({
event: this.onEvent.bind(this),
complete: this.onComplete.bind(this),
start: this.onStart.bind(this),
end: this.onEnd.bind(this),
dispose: this.onDispose.bind(this),
interrupted: this.onInterrupted.bind(this),
}),
e && this.setAnimation(0, e, i),
(this.root = this.getRootBone()),
this.root && (this.root.rotation = g(d(this.rotation)) + 90),
this.state.apply(r),
r.updateCache(),
this.updateSize()
);
},
onComplete: function (t) {
this.emit(v.COMPLETE, t);
},
onDispose: function (t) {
this.emit(v.DISPOSE, t);
},
onEnd: function (t) {
this.emit(v.END, t);
},
onEvent: function (t, e) {
this.emit(v.EVENT, t, e);
},
onInterrupted: function (t) {
this.emit(v.INTERRUPTED, t);
},
onStart: function (t) {
this.emit(v.START, t);
},
refresh: function () {
return this.root && (this.root.rotation = g(d(this.rotation)) + 90), this.updateSize(), this.skeleton.updateCache(), this;
},
setSize: function (t, e, i, n) {
var s = this.skeleton;
return (
void 0 === t && (t = s.data.width),
void 0 === e && (e = s.data.height),
void 0 === i && (i = 0),
void 0 === n && (n = 0),
(this.width = t),
(this.height = e),
(this.displayOriginX = s.x - i),
(this.displayOriginY = s.y - n),
this
);
},
setOffset: function (t, e) {
var i = this.skeleton;
return void 0 === t && (t = 0), void 0 === e && (e = 0), (this.displayOriginX = i.x - t), (this.displayOriginY = i.y - e), this;
},
updateSize: function () {
var t = this.skeleton,
e = this.plugin.renderer.height,
i = this.scaleX,
n = this.scaleY;
(t.x = this.x), (t.y = e - this.y), (t.scaleX = 1), (t.scaleY = 1), t.updateWorldTransform();
var s = this.getBounds();
return (
(this.width = s.size.x),
(this.height = s.size.y),
(this.displayOriginX = this.x - s.offset.x),
(this.displayOriginY = this.y - (e - (this.height + s.offset.y))),
(t.scaleX = i),
(t.scaleY = n),
t.updateWorldTransform(),
this
);
},
scaleX: {
get: function () {
return this._scaleX;
},
set: function (t) {
(this._scaleX = t), this.refresh();
},
},
scaleY: {
get: function () {
return this._scaleY;
},
set: function (t) {
(this._scaleY = t), this.refresh();
},
},
getBoneList: function () {
var t = [],
e = this.skeletonData;
if (e) for (var i = 0; i < e.bones.length; i++) t.push(e.bones[i].name);
return t;
},
getSkinList: function () {
var t = [],
e = this.skeletonData;
if (e) for (var i = 0; i < e.skins.length; i++) t.push(e.skins[i].name);
return t;
},
getSlotList: function () {
for (var t = [], e = this.skeleton, i = 0; i < e.slots.length; i++) t.push(e.slots[i].data.name);
return t;
},
getAnimationList: function () {
var t = [],
e = this.skeletonData;
if (e) for (var i = 0; i < e.animations.length; i++) t.push(e.animations[i].name);
return t;
},
getCurrentAnimation: function (t) {
void 0 === t && (t = 0);
var e = this.state.getCurrent(t);
if (e) return e.animation;
},
play: function (t, e, i) {
return this.setAnimation(0, t, e, i), this;
},
setAnimation: function (t, e, i, n) {
if ((void 0 === i && (i = !1), void 0 === n && (n = !1), n && this.state)) {
var s = this.state.getCurrent(t);
if (s && s.animation.name === e && !s.isComplete()) return;
}
if (this.findAnimation(e)) return this.state.setAnimation(t, e, i);
},
addAnimation: function (t, e, i, n) {
return void 0 === i && (i = !1), void 0 === n && (n = 0), this.state.addAnimation(t, e, i, n);
},
setEmptyAnimation: function (t, e) {
return this.state.setEmptyAnimation(t, e);
},
clearTrack: function (t) {
return this.state.clearTrack(t), this;
},
clearTracks: function () {
return this.state.clearTracks(), this;
},
setSkinByName: function (t) {
var e = this.skeleton;
return e.setSkinByName(t), e.setSlotsToSetupPose(), this.state.apply(e), this;
},
setSkin: function (t) {
var e = this.skeleton;
return e.setSkin(t), e.setSlotsToSetupPose(), this.state.apply(e), this;
},
setMix: function (t, e, i) {
return this.stateData.setMix(t, e, i), this;
},
getAttachment: function (t, e) {
return this.skeleton.getAttachment(t, e);
},
getAttachmentByName: function (t, e) {
return this.skeleton.getAttachmentByName(t, e);
},
setAttachment: function (t, e) {
if (Array.isArray(t) && Array.isArray(e) && t.length === e.length) for (var i = 0; i < t.length; i++) this.skeleton.setAttachment(t[i], e[i]);
else this.skeleton.setAttachment(t, e);
return this;
},
setToSetupPose: function () {
return this.skeleton.setToSetupPose(), this;
},
setSlotsToSetupPose: function () {
return this.skeleton.setSlotsToSetupPose(), this;
},
setBonesToSetupPose: function () {
return this.skeleton.setBonesToSetupPose(), this;
},
getRootBone: function () {
return this.skeleton.getRootBone();
},
angleBoneToXY: function (t, e, i, n, s, r) {
void 0 === n && (n = 0), void 0 === s && (s = 0), void 0 === r && (r = 360);
var o = this.plugin.renderer.height,
a = d(h(t.worldX, o - t.worldY, e, i) + f(n));
return (t.rotation = l(g(a), s, r)), this;
},
findBone: function (t) {
return this.skeleton.findBone(t);
},
findBoneIndex: function (t) {
return this.skeleton.findBoneIndex(t);
},
findSlot: function (t) {
return this.skeleton.findSlot(t);
},
findSlotIndex: function (t) {
return this.skeleton.findSlotIndex(t);
},
findSkin: function (t) {
return this.skeletonData.findSkin(t);
},
findEvent: function (t) {
return this.skeletonData.findEvent(t);
},
findAnimation: function (t) {
return this.skeletonData.findAnimation(t);
},
findIkConstraint: function (t) {
return this.skeletonData.findIkConstraint(t);
},
findTransformConstraint: function (t) {
return this.skeletonData.findTransformConstraint(t);
},
findPathConstraint: function (t) {
return this.skeletonData.findPathConstraint(t);
},
findPathConstraintIndex: function (t) {
return this.skeletonData.findPathConstraintIndex(t);
},
getBounds: function () {
return this.plugin.getBounds(this.skeleton);
},
preUpdate: function (t, e) {
var i = this.skeleton;
this.state.update((e / 1e3) * this.timeScale), this.state.apply(i);
},
preDestroy: function () {
this.state && (this.state.clearListeners(), this.state.clearListenerNotifications()), (this.plugin = null), (this.skeleton = null), (this.skeletonData = null), (this.state = null), (this.stateData = null);
},
});
t.exports = m;
},
function (t, e, i) {
var n = i(0),
a = i(223),
s = new n({
initialize: function (t, e) {
(this.parent = t),
(this.events = e) || (this.events = t.events ? t.events : t),
(this.list = {}),
(this.values = {}),
(this._frozen = !1),
!t.hasOwnProperty("sys") && this.events && this.events.once(a.DESTROY, this.destroy, this);
},
get: function (t) {
var e = this.list;
if (Array.isArray(t)) {
for (var i = [], n = 0; n < t.length; n++) i.push(e[t[n]]);
return i;
}
return e[t];
},
getAll: function () {
var t = {};
for (var e in this.list) this.list.hasOwnProperty(e) && (t[e] = this.list[e]);
return t;
},
query: function (t) {
var e = {};
for (var i in this.list) this.list.hasOwnProperty(i) && i.match(t) && (e[i] = this.list[i]);
return e;
},
set: function (t, e) {
if (this._frozen) return this;
if ("string" == typeof t) return this.setValue(t, e);
for (var i in t) this.setValue(i, t[i]);
return this;
},
inc: function (t, e) {
if (this._frozen) return this;
void 0 === e && (e = 1);
var i = this.get(t);
return void 0 === i && (i = 0), this.set(t, i + e), this;
},
toggle: function (t) {
return this._frozen || this.set(t, !this.get(t)), this;
},
setValue: function (i, t) {
return (
this._frozen ||
(this.has(i)
? (this.values[i] = t)
: ((s = (n = this).list),
(r = this.events),
(o = this.parent),
Object.defineProperty(this.values, i, {
enumerable: !0,
configurable: !0,
get: function () {
return s[i];
},
set: function (t) {
var e;
n._frozen || ((e = s[i]), (s[i] = t), r.emit(a.CHANGE_DATA, o, i, t, e), r.emit(a.CHANGE_DATA_KEY + i, o, t, e));
},
}),
(s[i] = t),
r.emit(a.SET_DATA, o, i, t))),
this
);
var n, s, r, o;
},
each: function (t, e) {
for (var i = [this.parent, null, void 0], n = 1; n < arguments.length; n++) i.push(arguments[n]);
for (var s in this.list) (i[1] = s), (i[2] = this.list[s]), t.apply(e, i);
return this;
},
merge: function (t, e) {
for (var i in (void 0 === e && (e = !0), t)) t.hasOwnProperty(i) && (e || (!e && !this.has(i))) && this.setValue(i, t[i]);
return this;
},
remove: function (t) {
if (this._frozen) return this;
if (!Array.isArray(t)) return this.removeValue(t);
for (var e = 0; e < t.length; e++) this.removeValue(t[e]);
return this;
},
removeValue: function (t) {
var e;
return this.has(t) && ((e = this.list[t]), delete this.list[t], delete this.values[t], this.events.emit(a.REMOVE_DATA, this.parent, t, e)), this;
},
pop: function (t) {
var e = void 0;
return !this._frozen && this.has(t) && ((e = this.list[t]), delete this.list[t], delete this.values[t], this.events.emit(a.REMOVE_DATA, this.parent, t, e)), e;
},
has: function (t) {
return this.list.hasOwnProperty(t);
},
setFreeze: function (t) {
return (this._frozen = t), this;
},
reset: function () {
for (var t in this.list) delete this.list[t], delete this.values[t];
return (this._frozen = !1), this;
},
destroy: function () {
this.reset(), this.events.off(a.CHANGE_DATA), this.events.off(a.SET_DATA), this.events.off(a.REMOVE_DATA), (this.parent = null);
},
freeze: {
get: function () {
return this._frozen;
},
set: function (t) {
this._frozen = !!t;
},
},
count: {
get: function () {
var t = 0;
for (var e in this.list) void 0 !== this.list[e] && t++;
return t;
},
},
});
t.exports = s;
},
function (t, e, i) {
t.exports = { CHANGE_DATA: i(224), CHANGE_DATA_KEY: i(225), DESTROY: i(226), REMOVE_DATA: i(227), SET_DATA: i(228) };
},
function (t, e) {
t.exports = "changedata";
},
function (t, e) {
t.exports = "changedata-";
},
function (t, e) {
t.exports = "destroy";
},
function (t, e) {
t.exports = "removedata";
},
function (t, e) {
t.exports = "setdata";
},
function (t, e, i) {
"use strict";
var n = Object.prototype.hasOwnProperty,
f = "~";
function s() {}
function a(t, e, i) {
(this.fn = t), (this.context = e), (this.once = i || !1);
}
function r(t, e, i, n, s) {
if ("function" != typeof i) throw new TypeError("The listener must be a function");
var r = new a(i, n || t, s),
o = f ? f + e : e;
return t._events[o] ? (t._events[o].fn ? (t._events[o] = [t._events[o], r]) : t._events[o].push(r)) : ((t._events[o] = r), t._eventsCount++), t;
}
function l(t, e) {
0 == --t._eventsCount ? (t._events = new s()) : delete t._events[e];
}
function o() {
(this._events = new s()), (this._eventsCount = 0);
}
Object.create && ((s.prototype = Object.create(null)), new s().__proto__ || (f = !1)),
(o.prototype.eventNames = function () {
var t,
e,
i = [];
if (0 === this._eventsCount) return i;
for (e in (t = this._events)) n.call(t, e) && i.push(f ? e.slice(1) : e);
return Object.getOwnPropertySymbols ? i.concat(Object.getOwnPropertySymbols(t)) : i;
}),
(o.prototype.listeners = function (t) {
var e = f ? f + t : t,
i = this._events[e];
if (!i) return [];
if (i.fn) return [i.fn];
for (var n = 0, s = i.length, r = new Array(s); n < s; n++) r[n] = i[n].fn;
return r;
}),
(o.prototype.listenerCount = function (t) {
var e = f ? f + t : t,
i = this._events[e];
return i ? (i.fn ? 1 : i.length) : 0;
}),
(o.prototype.emit = function (t, e, i, n, s, r) {
var o = f ? f + t : t;
if (!this._events[o]) return !1;
var a,
h = this._events[o],
l = arguments.length;
if (h.fn) {
switch ((h.once && this.removeListener(t, h.fn, void 0, !0), l)) {
case 1:
return h.fn.call(h.context), !0;
case 2:
return h.fn.call(h.context, e), !0;
case 3:
return h.fn.call(h.context, e, i), !0;
case 4:
return h.fn.call(h.context, e, i, n), !0;
case 5:
return h.fn.call(h.context, e, i, n, s), !0;
case 6:
return h.fn.call(h.context, e, i, n, s, r), !0;
}
for (d = 1, a = new Array(l - 1); d < l; d++) a[d - 1] = arguments[d];
h.fn.apply(h.context, a);
} else
for (var u, c = h.length, d = 0; d < c; d++)
switch ((h[d].once && this.removeListener(t, h[d].fn, void 0, !0), l)) {
case 1:
h[d].fn.call(h[d].context);
break;
case 2:
h[d].fn.call(h[d].context, e);
break;
case 3:
h[d].fn.call(h[d].context, e, i);
break;
case 4:
h[d].fn.call(h[d].context, e, i, n);
break;
default:
if (!a) for (u = 1, a = new Array(l - 1); u < l; u++) a[u - 1] = arguments[u];
h[d].fn.apply(h[d].context, a);
}
return !0;
}),
(o.prototype.on = function (t, e, i) {
return r(this, t, e, i, !1);
}),
(o.prototype.once = function (t, e, i) {
return r(this, t, e, i, !0);
}),
(o.prototype.removeListener = function (t, e, i, n) {
var s = f ? f + t : t;
if (!this._events[s]) return this;
if (!e) return l(this, s), this;
var r = this._events[s];
if (r.fn) r.fn !== e || (n && !r.once) || (i && r.context !== i) || l(this, s);
else {
for (var o = 0, a = [], h = r.length; o < h; o++) (r[o].fn !== e || (n && !r[o].once) || (i && r[o].context !== i)) && a.push(r[o]);
a.length ? (this._events[s] = 1 === a.length ? a[0] : a) : l(this, s);
}
return this;
}),
(o.prototype.removeAllListeners = function (t) {
var e;
return t ? ((e = f ? f + t : t), this._events[e] && l(this, e)) : ((this._events = new s()), (this._eventsCount = 0)), this;
}),
(o.prototype.off = o.prototype.removeListener),
(o.prototype.addListener = o.prototype.on),
(o.prefixed = f),
(o.EventEmitter = o),
(t.exports = o);
},
function (t, e) {
t.exports = "addedtoscene";
},
function (t, e) {
t.exports = "destroy";
},
function (t, e) {
t.exports = "removedfromscene";
},
function (t, e) {
t.exports = "complete";
},
function (t, e) {
t.exports = "created";
},
function (t, e) {
t.exports = "error";
},
function (t, e) {
t.exports = "loop";
},
function (t, e) {
t.exports = "play";
},
function (t, e) {
t.exports = "seeked";
},
function (t, e) {
t.exports = "seeking";
},
function (t, e) {
t.exports = "stop";
},
function (t, e) {
t.exports = "timeout";
},
function (t, e) {
t.exports = "unlocked";
},
function (t, e, i) {
t.exports = { COMPLETE: i(244), DISPOSE: i(245), END: i(246), EVENT: i(247), INTERRUPTED: i(248), START: i(249) };
},
function (t, e) {
t.exports = "complete";
},
function (t, e) {
t.exports = "dispose";
},
function (t, e) {
t.exports = "end";
},
function (t, e) {
t.exports = "event";
},
function (t, e) {
t.exports = "interrupted";
},
function (t, e) {
t.exports = "start";
},
function (t, e, i) {
var n = i(1),
s = i(1),
r = i(1);
(n = i(251)), (r = i(252)), (s = i(253));
t.exports = { renderWebGL: n, renderCanvas: s, renderDirect: r };
},
function (t, e, i) {
var g = i(3),
v = i(8),
y = i(56),
m = i(9),
x = i(6);
t.exports = function (t, e, i, n, s) {
var r = e.plugin,
o = e.skeleton,
a = r.sceneRenderer;
t.newType && (t.pipelines.clear(), a.begin());
var h = e.scrollFactorX,
l = e.scrollFactorY,
u = o.color.a;
s && ((e.scrollFactorX = s.scrollFactorX), (e.scrollFactorY = s.scrollFactorY), (o.color.a = g(u * s.alpha, 0, 1))), i.addToRenderList(e);
var c,
d,
f = y(e, i, n).calc,
p = t.height;
(o.x = f.tx),
(o.y = p - f.ty),
(o.scaleX = f.scaleX),
(o.scaleY = f.scaleY),
e.scaleX < 0 ? ((o.scaleX *= -1), (e.root.rotation = x(m(f.rotationNormalized) - 180, 0, 360))) : (e.root.rotation = x(m(v(f.rotationNormalized)) + 90, 0, 360)),
e.scaleY < 0 && ((o.scaleY *= -1), e.scaleX < 0 ? (e.root.rotation -= 2 * m(f.rotationNormalized)) : (e.root.rotation += 2 * m(f.rotationNormalized))),
o.updateWorldTransform(),
a.drawSkeleton(o, e.preMultipliedAlpha),
s && ((e.scrollFactorX = h), (e.scrollFactorY = l), (o.color.a = u)),
(r.drawDebug || e.drawDebug) && ((c = o.x), (d = o.y), (o.x = 0), (o.y = 0), a.drawSkeletonDebug(o, e.preMultipliedAlpha), (o.x = c), (o.y = d)),
t.nextTypeMatch || (a.end(), t.pipelines.rebind());
};
},
function (t, e, i) {
var g = i(3),
v = i(8),
y = i(56),
m = i(9),
x = i(6);
t.exports = function (t, e, i, n, s) {
var r = e.plugin,
o = e.skeleton,
a = r.sceneRenderer;
t.pipelines.clear(), a.begin();
var h = e.scrollFactorX,
l = e.scrollFactorY,
u = o.color.a;
s && ((e.scrollFactorX = s.scrollFactorX), (e.scrollFactorY = s.scrollFactorY), (o.color.a = g(u * s.alpha, 0, 1))), i.addToRenderList(e);
var c,
d,
f = y(e, i, n).calc,
p = t.height;
(o.x = f.tx),
(o.y = p - f.ty),
(o.scaleX = f.scaleX),
(o.scaleY = f.scaleY),
e.scaleX < 0 ? ((o.scaleX *= -1), (e.root.rotation = x(m(f.rotationNormalized) - 180, 0, 360))) : (e.root.rotation = x(m(v(f.rotationNormalized)) + 90, 0, 360)),
e.scaleY < 0 && ((o.scaleY *= -1), e.scaleX < 0 ? (e.root.rotation -= 2 * m(f.rotationNormalized)) : (e.root.rotation += 2 * m(f.rotationNormalized))),
o.updateWorldTransform(),
a.drawSkeleton(o, e.preMultipliedAlpha),
s && ((e.scrollFactorX = h), (e.scrollFactorY = l), (o.color.a = u)),
(r.drawDebug || e.drawDebug) && ((c = o.x), (d = o.y), (o.x = 0), (o.y = 0), a.drawSkeletonDebug(o, e.preMultipliedAlpha), (o.x = c), (o.y = d)),
a.end(),
t.pipelines.rebind();
};
},
function (t, e, i) {
var c = i(8),
d = i(9),
f = i(6);
t.exports = function (t, e, i, n) {
var s = t.currentContext,
r = e.plugin,
o = e.skeleton,
a = r.skeletonRenderer,
h = t._tempMatrix1,
l = t._tempMatrix2,
u = t._tempMatrix3;
i.addToRenderList(e),
l.applyITRS(e.x, e.y, e.rotation, Math.abs(e.scaleX), Math.abs(e.scaleY)),
h.copyFrom(i.matrix),
n ? (h.multiplyWithOffset(n, -i.scrollX * e.scrollFactorX, -i.scrollY * e.scrollFactorY), (l.e = e.x), (l.f = e.y)) : ((l.e -= i.scrollX * e.scrollFactorX), (l.f -= i.scrollY * e.scrollFactorY)),
h.multiply(l, u),
(o.x = u.tx),
(o.y = u.ty),
(o.scaleX = u.scaleX),
(o.scaleY = -1 * u.scaleY),
e.scaleX < 0 ? ((o.scaleX *= -1), (e.root.rotation = d(u.rotationNormalized))) : (e.root.rotation = f(d(c(u.rotationNormalized)) + 90, 0, 360)),
e.scaleY < 0 && ((o.scaleY *= -1), e.scaleX < 0 ? (e.root.rotation -= 2 * d(u.rotationNormalized)) : (e.root.rotation += 2 * d(u.rotationNormalized))),
i.renderToTexture && ((o.y = u.ty), (o.scaleY *= -1)),
o.updateWorldTransform(),
(a.ctx = s),
(a.debugRendering = r.drawDebug || e.drawDebug),
s.save(),
a.draw(o),
s.restore();
};
},
function (t, e, i) {
var n = i(0),
r = i(255),
s = i(347),
o = new n({
Extends: r,
Mixins: [s],
initialize: function (t, e, i, n, s) {
r.call(this, t, i, n, s), (this.type = "Spine"), (this.plugin = e);
},
preDestroy: function () {
this.removeAll(!!this.exclusive), this.localTransform.destroy(), this.tempTransformMatrix.destroy(), (this.list = []), (this._displayList = null), (this.plugin = null);
},
});
t.exports = o;
},
function (t, e, i) {
var r = i(256),
s = i(17),
n = i(0),
o = i(293),
a = i(55),
h = i(53),
l = i(25),
u = i(343),
c = i(346),
d = i(2),
f = new n({
Extends: h,
Mixins: [o.AlphaSingle, o.BlendMode, o.ComputedSize, o.Depth, o.Mask, o.Pipeline, o.Transform, o.Visible, u],
initialize: function (t, e, i, n) {
h.call(this, t, "Container"),
(this.list = []),
(this.exclusive = !0),
(this.maxSize = -1),
(this.position = 0),
(this.localTransform = new o.TransformMatrix()),
(this.tempTransformMatrix = new o.TransformMatrix()),
(this._sortKey = ""),
(this._sysEvents = t.sys.events),
(this.scrollFactorX = 1),
(this.scrollFactorY = 1),
this.initPipeline(),
this.setPosition(e, i),
this.clearAlpha(),
this.setBlendMode(s.SKIP_CHECK),
n && this.add(n);
},
originX: {
get: function () {
return 0.5;
},
},
originY: {
get: function () {
return 0.5;
},
},
displayOriginX: {
get: function () {
return 0.5 * this.width;
},
},
displayOriginY: {
get: function () {
return 0.5 * this.height;
},
},
setExclusive: function (t) {
return void 0 === t && (t = !0), (this.exclusive = t), this;
},
getBounds: function (t) {
var e;
if (
(void 0 === t && (t = new l()),
t.setTo(this.x, this.y, 0, 0),
this.parentContainer && ((e = this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x, this.y)), t.setTo(e.x, e.y, 0, 0)),
0 < this.list.length)
) {
var i = this.list,
n = new l(),
s = !1;
t.setEmpty();
for (var r = 0; r < i.length; r++) {
var o = i[r];
o.getBounds && (o.getBounds(n), s ? c(n, t, t) : (t.setTo(n.x, n.y, n.width, n.height), (s = !0)));
}
}
return t;
},
addHandler: function (t) {
t.once(a.DESTROY, this.remove, this), this.exclusive && (t.parentContainer && t.parentContainer.remove(t), t.removeFromDisplayList(), (t.parentContainer = this));
},
removeHandler: function (t) {
t.off(a.DESTROY, this.remove), this.exclusive && ((t.parentContainer = null), t.addToDisplayList());
},
pointToContainer: function (t, e) {
void 0 === e && (e = new d()), this.parentContainer ? this.parentContainer.pointToContainer(t, e) : (e = new d(t.x, t.y));
var i = this.tempTransformMatrix;
return i.applyITRS(this.x, this.y, this.rotation, this.scaleX, this.scaleY), i.invert(), i.transformPoint(t.x, t.y, e), e;
},
getBoundsTransformMatrix: function () {
return this.getWorldTransformMatrix(this.tempTransformMatrix, this.localTransform);
},
add: function (t) {
return r.Add(this.list, t, this.maxSize, this.addHandler, this), this;
},
addAt: function (t, e) {
return r.AddAt(this.list, t, e, this.maxSize, this.addHandler, this), this;
},
getAt: function (t) {
return this.list[t];
},
getIndex: function (t) {
return this.list.indexOf(t);
},
sort: function (i, t) {
return (
i &&
(void 0 === t &&
(t = function (t, e) {
return t[i] - e[i];
}),
r.StableSort(this.list, t)),
this
);
},
getByName: function (t) {
return r.GetFirst(this.list, "name", t);
},
getRandom: function (t, e) {
return r.GetRandom(this.list, t, e);
},
getFirst: function (t, e, i, n) {
return r.GetFirst(this.list, t, e, i, n);
},
getAll: function (t, e, i, n) {
return r.GetAll(this.list, t, e, i, n);
},
count: function (t, e, i, n) {
return r.CountAllMatching(this.list, t, e, i, n);
},
swap: function (t, e) {
return r.Swap(this.list, t, e), this;
},
moveTo: function (t, e) {
return r.MoveTo(this.list, t, e), this;
},
remove: function (t, e) {
var i = r.Remove(this.list, t, this.removeHandler, this);
if (e && i) {
Array.isArray(i) || (i = [i]);
for (var n = 0; n < i.length; n++) i[n].destroy();
}
return this;
},
removeAt: function (t, e) {
var i = r.RemoveAt(this.list, t, this.removeHandler, this);
return e && i && i.destroy(), this;
},
removeBetween: function (t, e, i) {
var n = r.RemoveBetween(this.list, t, e, this.removeHandler, this);
if (i) for (var s = 0; s < n.length; s++) n[s].destroy();
return this;
},
removeAll: function (t) {
var e = r.RemoveBetween(this.list, 0, this.list.length, this.removeHandler, this);
if (t) for (var i = 0; i < e.length; i++) e[i].destroy();
return this;
},
bringToTop: function (t) {
return r.BringToTop(this.list, t), this;
},
sendToBack: function (t) {
return r.SendToBack(this.list, t), this;
},
moveUp: function (t) {
return r.MoveUp(this.list, t), this;
},
moveDown: function (t) {
return r.MoveDown(this.list, t), this;
},
reverse: function () {
return this.list.reverse(), this;
},
shuffle: function () {
return r.Shuffle(this.list), this;
},
replace: function (t, e, i) {
return r.Replace(this.list, t, e) && (this.addHandler(e), this.removeHandler(t), i && t.destroy()), this;
},
exists: function (t) {
return -1 < this.list.indexOf(t);
},
setAll: function (t, e, i, n) {
return r.SetAll(this.list, t, e, i, n), this;
},
each: function (t, e) {
for (var i = [null], n = this.list.slice(), s = n.length, r = 2; r < arguments.length; r++) i.push(arguments[r]);
for (r = 0; r < s; r++) (i[0] = n[r]), t.apply(e, i);
return this;
},
iterate: function (t, e) {
for (var i = [null], n = 2; n < arguments.length; n++) i.push(arguments[n]);
for (n = 0; n < this.list.length; n++) (i[0] = this.list[n]), t.apply(e, i);
return this;
},
setScrollFactor: function (t, e, i) {
return void 0 === e && (e = t), void 0 === i && (i = !1), (this.scrollFactorX = t), (this.scrollFactorY = e), i && (r.SetAll(this.list, "scrollFactorX", t), r.SetAll(this.list, "scrollFactorY", e)), this;
},
length: {
get: function () {
return this.list.length;
},
},
first: {
get: function () {
return (this.position = 0) < this.list.length ? this.list[0] : null;
},
},
last: {
get: function () {
return 0 < this.list.length ? ((this.position = this.list.length - 1), this.list[this.position]) : null;
},
},
next: {
get: function () {
return this.position < this.list.length ? (this.position++, this.list[this.position]) : null;
},
},
previous: {
get: function () {
return 0 < this.position ? (this.position--, this.list[this.position]) : null;
},
},
preDestroy: function () {
this.removeAll(!!this.exclusive), this.localTransform.destroy(), this.tempTransformMatrix.destroy(), (this.list = []);
},
});
t.exports = f;
},
function (t, e, i) {
t.exports = {
Matrix: i(257),
Add: i(266),
AddAt: i(267),
BringToTop: i(268),
CountAllMatching: i(269),
Each: i(270),
EachInRange: i(271),
FindClosestInSorted: i(272),
GetAll: i(273),
GetFirst: i(274),
GetRandom: i(275),
MoveDown: i(276),
MoveTo: i(277),
MoveUp: i(278),
NumberArray: i(279),
NumberArrayStep: i(280),
QuickSelect: i(281),
Range: i(282),
Remove: i(283),
RemoveAt: i(284),
RemoveBetween: i(285),
RemoveRandomElement: i(286),
Replace: i(287),
RotateLeft: i(58),
RotateRight: i(59),
SafeRange: i(5),
SendToBack: i(288),
SetAll: i(289),
Shuffle: i(60),
SortByDigits: i(290),
SpliceOne: i(12),
StableSort: i(291),
Swap: i(292),
};
},
function (t, e, i) {
t.exports = { CheckMatrix: i(24), MatrixToString: i(258), ReverseColumns: i(260), ReverseRows: i(261), Rotate180: i(262), RotateLeft: i(263), RotateMatrix: i(16), RotateRight: i(264), Translate: i(265), TransposeMatrix: i(57) };
},
function (t, e, i) {
var o = i(259),
a = i(24);
t.exports = function (t) {
var e = "";
if (!a(t)) return e;
for (var i = 0; i < t.length; i++) {
for (var n = 0; n < t[i].length; n++) {
var s = t[i][n].toString();
(e += "undefined" !== s ? o(s, 2) : "?"), n < t[i].length - 1 && (e += " |");
}
if (i < t.length - 1) {
e += "\n";
for (var r = 0; r < t[i].length; r++) (e += "---"), r < t[i].length - 1 && (e += "+");
e += "\n";
}
}
return e;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s;
if ((void 0 === e && (e = 0), void 0 === i && (i = " "), void 0 === n && (n = 3), e + 1 >= (t = t.toString()).length))
switch (n) {
case 1:
t = new Array(e + 1 - t.length).join(i) + t;
break;
case 3:
var r = Math.ceil((s = e - t.length) / 2);
t = new Array(s - r + 1).join(i) + t + new Array(r + 1).join(i);
break;
default:
t += new Array(e + 1 - t.length).join(i);
}
return t;
};
},
function (t, e) {
t.exports = function (t) {
return t.reverse();
};
},
function (t, e) {
t.exports = function (t) {
for (var e = 0; e < t.length; e++) t[e].reverse();
return t;
};
},
function (t, e, i) {
var n = i(16);
t.exports = function (t) {
return n(t, 180);
};
},
function (t, e, i) {
var n = i(16);
t.exports = function (t) {
return n(t, 90);
};
},
function (t, e, i) {
var n = i(16);
t.exports = function (t) {
return n(t, -90);
};
},
function (t, e, i) {
var r = i(58),
o = i(59);
t.exports = function (t, e, i) {
if ((void 0 === e && (e = 0), void 0 === i && (i = 0), 0 !== i && (i < 0 ? r(t, Math.abs(i)) : o(t, i)), 0 !== e))
for (var n = 0; n < t.length; n++) {
var s = t[n];
e < 0 ? r(s, Math.abs(e)) : o(s, e);
}
return t;
};
},
function (t, e) {
t.exports = function (t, e, i, n, s) {
if ((void 0 === s && (s = t), 0 < i)) {
var r = i - t.length;
if (r <= 0) return null;
}
if (!Array.isArray(e)) return -1 === t.indexOf(e) ? (t.push(e), n && n.call(s, e), e) : null;
for (var o = e.length - 1; 0 <= o; ) -1 !== t.indexOf(e[o]) && e.splice(o, 1), o--;
if (0 === (o = e.length)) return null;
0 < i && r < o && (e.splice(r), (o = r));
for (var a = 0; a < o; a++) {
var h = e[a];
t.push(h), n && n.call(s, h);
}
return e;
};
},
function (t, e) {
t.exports = function (t, e, i, n, s, r) {
if ((void 0 === i && (i = 0), void 0 === r && (r = t), 0 < n)) {
var o = n - t.length;
if (o <= 0) return null;
}
if (!Array.isArray(e)) return -1 === t.indexOf(e) ? (t.splice(i, 0, e), s && s.call(r, e), e) : null;
for (var a = e.length - 1; 0 <= a; ) -1 !== t.indexOf(e[a]) && e.pop(), a--;
if (0 === (a = e.length)) return null;
0 < n && o < a && (e.splice(o), (a = o));
for (var h = a - 1; 0 <= h; h--) {
var l = e[h];
t.splice(i, 0, l), s && s.call(r, l);
}
return e;
};
},
function (t, e) {
t.exports = function (t, e) {
var i = t.indexOf(e);
return -1 !== i && i < t.length && (t.splice(i, 1), t.push(e)), e;
};
},
function (t, e, i) {
var a = i(5);
t.exports = function (t, e, i, n, s) {
void 0 === n && (n = 0), void 0 === s && (s = t.length);
var r = 0;
if (a(t, n, s)) for (var o = n; o < s; o++) t[o][e] === i && r++;
return r;
};
},
function (t, e) {
t.exports = function (t, e, i) {
for (var n = [null], s = 3; s < arguments.length; s++) n.push(arguments[s]);
for (s = 0; s < t.length; s++) (n[0] = t[s]), e.apply(i, n);
return t;
};
},
function (t, e, i) {
var a = i(5);
t.exports = function (t, e, i, n, s) {
if ((void 0 === n && (n = 0), void 0 === s && (s = t.length), a(t, n, s))) {
for (var r = [null], o = 5; o < arguments.length; o++) r.push(arguments[o]);
for (o = n; o < s; o++) (r[0] = t[o]), e.apply(i, r);
}
return t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
if (!e.length) return NaN;
if (1 === e.length) return e[0];
var n,
s,
r = 1;
if (i) {
if (t < e[0][i]) return e[0];
for (; e[r][i] < t; ) r++;
} else for (; e[r] < t; ) r++;
return r > e.length && (r = e.length), i ? ((n = e[r - 1][i]), (s = e[r][i]) - t <= t - n ? e[r] : e[r - 1]) : ((n = e[r - 1]), (s = e[r]) - t <= t - n ? s : n);
};
},
function (t, e, i) {
var h = i(5);
t.exports = function (t, e, i, n, s) {
void 0 === n && (n = 0), void 0 === s && (s = t.length);
var r = [];
if (h(t, n, s))
for (var o = n; o < s; o++) {
var a = t[o];
(!e || (e && void 0 === i && a.hasOwnProperty(e)) || (e && void 0 !== i && a[e] === i)) && r.push(a);
}
return r;
};
},
function (t, e, i) {
var a = i(5);
t.exports = function (t, e, i, n, s) {
if ((void 0 === n && (n = 0), void 0 === s && (s = t.length), a(t, n, s)))
for (var r = n; r < s; r++) {
var o = t[r];
if (!e || (e && void 0 === i && o.hasOwnProperty(e)) || (e && void 0 !== i && o[e] === i)) return o;
}
return null;
};
},
function (t, e) {
t.exports = function (t, e, i) {
void 0 === e && (e = 0), void 0 === i && (i = t.length);
var n = e + Math.floor(Math.random() * i);
return void 0 === t[n] ? null : t[n];
};
},
function (t, e) {
t.exports = function (t, e) {
var i,
n,
s = t.indexOf(e);
return 0 < s && ((i = t[s - 1]), (n = t.indexOf(i)), (t[s] = i), (t[n] = e)), t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = t.indexOf(e);
if (-1 === n || i < 0 || i >= t.length) throw new Error("Supplied index out of bounds");
return n !== i && (t.splice(n, 1), t.splice(i, 0, e)), e;
};
},
function (t, e) {
t.exports = function (t, e) {
var i,
n,
s = t.indexOf(e);
return -1 !== s && s < t.length - 1 && ((i = t[s + 1]), (n = t.indexOf(i)), (t[s] = i), (t[n] = e)), t;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s,
r = [],
o = !1;
if (((i || n) && ((o = !0), (i = i || ""), (n = n || "")), e < t)) for (s = t; e <= s; s--) o ? r.push(i + s.toString() + n) : r.push(s);
else for (s = t; s <= e; s++) o ? r.push(i + s.toString() + n) : r.push(s);
return r;
};
},
function (t, e, i) {
var o = i(40);
t.exports = function (t, e, i) {
void 0 === t && (t = 0), void 0 === e && (e = null), void 0 === i && (i = 1), null === e && ((e = t), (t = 0));
for (var n = [], s = Math.max(o((e - t) / (i || 1)), 0), r = 0; r < s; r++) n.push(t), (t += i);
return n;
};
},
function (t, e) {
function g(t, e, i) {
var n = t[e];
(t[e] = t[i]), (t[i] = n);
}
function v(t, e) {
return t < e ? -1 : e < t ? 1 : 0;
}
var y = function (t, e, i, n, s) {
for (void 0 === i && (i = 0), void 0 === n && (n = t.length - 1), void 0 === s && (s = v); i < n; ) {
var r, o, a, h, l, u, c;
600 < n - i &&
((r = n - i + 1),
(o = e - i + 1),
(a = Math.log(r)),
(h = 0.5 * Math.exp((2 * a) / 3)),
(l = 0.5 * Math.sqrt((a * h * (r - h)) / r) * (o - r / 2 < 0 ? -1 : 1)),
(u = Math.max(i, Math.floor(e - (o * h) / r + l))),
(c = Math.min(n, Math.floor(e + ((r - o) * h) / r + l))),
y(t, e, u, c, s));
var d = t[e],
f = i,
p = n;
for (g(t, i, e), 0 < s(t[n], d) && g(t, i, n); f < p; ) {
for (g(t, f, p), f++, p--; s(t[f], d) < 0; ) f++;
for (; 0 < s(t[p], d); ) p--;
}
0 === s(t[i], d) ? g(t, i, p) : g(t, ++p, n), p <= e && (i = p + 1), e <= p && (n = p - 1);
}
};
t.exports = y;
},
function (t, e, i) {
var f = i(10),
p = i(60);
t.exports = function (t, e, i) {
var n,
s = f(i, "max", 0),
r = f(i, "qty", 1),
o = f(i, "random", !1),
a = f(i, "randomB", !1),
h = f(i, "repeat", 0),
l = f(i, "yoyo", !1),
u = [];
a && p(e), -1 === h && (h = 0 === s ? 0 : ((n = t.length * e.length * r), l && (n *= 2), Math.ceil(s / n)));
for (var c = 0; c <= h; c++) {
var d = (function (t, e, i) {
for (var n = [], s = 0; s < t.length; s++) for (var r = 0; r < e.length; r++) for (var o = 0; o < i; o++) n.push({ a: t[s], b: e[r] });
return n;
})(t, e, r);
o && p(d), (u = u.concat(d)), l && (d.reverse(), (u = u.concat(d)));
}
return s && u.splice(s), u;
};
},
function (t, e, i) {
var h = i(12);
t.exports = function (t, e, i, n) {
if ((void 0 === n && (n = t), !Array.isArray(e))) return -1 !== (o = t.indexOf(e)) ? (h(t, o), i && i.call(n, e), e) : null;
for (var s = e.length - 1, r = []; 0 <= s; ) {
var o,
a = e[s];
-1 !== (o = t.indexOf(a)) && (h(t, o), r.push(a), i && i.call(n, a)), s--;
}
return r;
};
},
function (t, e, i) {
var r = i(12);
t.exports = function (t, e, i, n) {
if ((void 0 === n && (n = t), e < 0 || e > t.length - 1)) throw new Error("Index out of bounds");
var s = r(t, e);
return i && i.call(n, s), s;
};
},
function (t, e, i) {
var l = i(5);
t.exports = function (t, e, i, n, s) {
if ((void 0 === e && (e = 0), void 0 === i && (i = t.length), void 0 === s && (s = t), l(t, e, i))) {
var r = i - e,
o = t.splice(e, r);
if (n)
for (var a = 0; a < o.length; a++) {
var h = o[a];
n.call(s, h);
}
return o;
}
return [];
};
},
function (t, e, i) {
var s = i(12);
t.exports = function (t, e, i) {
void 0 === e && (e = 0), void 0 === i && (i = t.length);
var n = e + Math.floor(Math.random() * i);
return s(t, n);
};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = t.indexOf(e),
s = t.indexOf(i);
return -1 !== n && -1 === s && ((t[n] = i), !0);
};
},
function (t, e) {
t.exports = function (t, e) {
var i = t.indexOf(e);
return -1 !== i && 0 < i && (t.splice(i, 1), t.unshift(e)), e;
};
},
function (t, e, i) {
var a = i(5);
t.exports = function (t, e, i, n, s) {
if ((void 0 === n && (n = 0), void 0 === s && (s = t.length), a(t, n, s)))
for (var r = n; r < s; r++) {
var o = t[r];
o.hasOwnProperty(e) && (o[e] = i);
}
return t;
};
},
function (t, e) {
t.exports = function (t) {
var i = /\D/g;
return (
t.sort(function (t, e) {
return parseInt(t.replace(i, ""), 10) - parseInt(e.replace(i, ""), 10);
}),
t
);
};
},
function (t, e) {
function n(t, e) {
return String(t).localeCompare(e);
}
function o(t, e, i, n) {
for (var s, r, o, a, h = t.length, l = 0, u = 2 * i, c = 0; c < h; c += u)
for (r = (s = c + i) + i, h < s && (s = h), h < r && (r = h), o = c, a = s; ; )
if (o < s && a < r) e(t[o], t[a]) <= 0 ? (n[l++] = t[o++]) : (n[l++] = t[a++]);
else if (o < s) n[l++] = t[o++];
else {
if (!(a < r)) break;
n[l++] = t[a++];
}
}
t.exports = function (t, e) {
void 0 === e && (e = n);
var i = (function (t, e) {
var i = t.length;
if (i <= 1) return t;
for (var n = new Array(i), s = 1; s < i; s *= 2) {
o(t, e, s, n);
var r = t;
(t = n), (n = r);
}
return t;
})(t, e);
return i !== t && o(i, null, t.length, t), t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
if (e !== i) {
var n = t.indexOf(e),
s = t.indexOf(i);
if (n < 0 || s < 0) throw new Error("Supplied items must be elements of the same array");
return (t[n] = i), (t[s] = e), t;
}
};
},
function (t, e, i) {
t.exports = {
Alpha: i(294),
AlphaSingle: i(295),
BlendMode: i(296),
ComputedSize: i(47),
Crop: i(297),
Depth: i(48),
Flip: i(49),
GetBounds: i(298),
Mask: i(307),
Origin: i(332),
PathFollower: i(333),
Pipeline: i(336),
ScrollFactor: i(50),
Size: i(339),
Texture: i(340),
TextureCrop: i(341),
Tint: i(342),
ToJSON: i(54),
Transform: i(51),
TransformMatrix: i(23),
Visible: i(52),
};
},
function (t, e, i) {
var s = i(3),
n = {
_alpha: 1,
_alphaTL: 1,
_alphaTR: 1,
_alphaBL: 1,
_alphaBR: 1,
clearAlpha: function () {
return this.setAlpha(1);
},
setAlpha: function (t, e, i, n) {
return void 0 === t && (t = 1), void 0 === e ? (this.alpha = t) : ((this._alphaTL = s(t, 0, 1)), (this._alphaTR = s(e, 0, 1)), (this._alphaBL = s(i, 0, 1)), (this._alphaBR = s(n, 0, 1))), this;
},
alpha: {
get: function () {
return this._alpha;
},
set: function (t) {
var e = s(t, 0, 1);
(this._alpha = e), (this._alphaTL = e), (this._alphaTR = e), (this._alphaBL = e), 0 === (this._alphaBR = e) ? (this.renderFlags &= -3) : (this.renderFlags |= 2);
},
},
alphaTopLeft: {
get: function () {
return this._alphaTL;
},
set: function (t) {
var e = s(t, 0, 1);
0 !== (this._alphaTL = e) && (this.renderFlags |= 2);
},
},
alphaTopRight: {
get: function () {
return this._alphaTR;
},
set: function (t) {
var e = s(t, 0, 1);
0 !== (this._alphaTR = e) && (this.renderFlags |= 2);
},
},
alphaBottomLeft: {
get: function () {
return this._alphaBL;
},
set: function (t) {
var e = s(t, 0, 1);
0 !== (this._alphaBL = e) && (this.renderFlags |= 2);
},
},
alphaBottomRight: {
get: function () {
return this._alphaBR;
},
set: function (t) {
var e = s(t, 0, 1);
0 !== (this._alphaBR = e) && (this.renderFlags |= 2);
},
},
};
t.exports = n;
},
function (t, e, i) {
var n = i(3),
s = {
_alpha: 1,
clearAlpha: function () {
return this.setAlpha(1);
},
setAlpha: function (t) {
return void 0 === t && (t = 1), (this.alpha = t), this;
},
alpha: {
get: function () {
return this._alpha;
},
set: function (t) {
var e = n(t, 0, 1);
0 === (this._alpha = e) ? (this.renderFlags &= -3) : (this.renderFlags |= 2);
},
},
};
t.exports = s;
},
function (t, e, i) {
var n = i(17),
s = {
_blendMode: n.NORMAL,
blendMode: {
get: function () {
return this._blendMode;
},
set: function (t) {
"string" == typeof t && (t = n[t]), -1 <= (t |= 0) && (this._blendMode = t);
},
},
setBlendMode: function (t) {
return (this.blendMode = t), this;
},
};
t.exports = s;
},
function (t, e) {
t.exports = {
texture: null,
frame: null,
isCropped: !1,
setCrop: function (t, e, i, n) {
return (
void 0 === t
? (this.isCropped = !1)
: this.frame &&
("number" == typeof t ? this.frame.setCropUVs(this._crop, t, e, i, n, this.flipX, this.flipY) : this.frame.setCropUVs(this._crop, t.x, t.y, t.width, t.height, this.flipX, this.flipY), (this.isCropped = !0)),
this
);
},
resetCropObject: function () {
return { u0: 0, v0: 0, u1: 0, v1: 0, width: 0, height: 0, x: 0, y: 0, flipX: !1, flipY: !1, cx: 0, cy: 0, cw: 0, ch: 0 };
},
};
},
function (t, e, i) {
var u = i(25),
n = i(39),
s = i(2),
r = {
prepareBoundsOutput: function (t, e) {
return void 0 === e && (e = !1), 0 !== this.rotation && n(t, this.x, this.y, this.rotation), e && this.parentContainer && this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x, t.y, t), t;
},
getCenter: function (t) {
return void 0 === t && (t = new s()), (t.x = this.x - this.displayWidth * this.originX + this.displayWidth / 2), (t.y = this.y - this.displayHeight * this.originY + this.displayHeight / 2), t;
},
getTopLeft: function (t, e) {
return ((t = t || new s()).x = this.x - this.displayWidth * this.originX), (t.y = this.y - this.displayHeight * this.originY), this.prepareBoundsOutput(t, e);
},
getTopCenter: function (t, e) {
return ((t = t || new s()).x = this.x - this.displayWidth * this.originX + this.displayWidth / 2), (t.y = this.y - this.displayHeight * this.originY), this.prepareBoundsOutput(t, e);
},
getTopRight: function (t, e) {
return ((t = t || new s()).x = this.x - this.displayWidth * this.originX + this.displayWidth), (t.y = this.y - this.displayHeight * this.originY), this.prepareBoundsOutput(t, e);
},
getLeftCenter: function (t, e) {
return ((t = t || new s()).x = this.x - this.displayWidth * this.originX), (t.y = this.y - this.displayHeight * this.originY + this.displayHeight / 2), this.prepareBoundsOutput(t, e);
},
getRightCenter: function (t, e) {
return ((t = t || new s()).x = this.x - this.displayWidth * this.originX + this.displayWidth), (t.y = this.y - this.displayHeight * this.originY + this.displayHeight / 2), this.prepareBoundsOutput(t, e);
},
getBottomLeft: function (t, e) {
return ((t = t || new s()).x = this.x - this.displayWidth * this.originX), (t.y = this.y - this.displayHeight * this.originY + this.displayHeight), this.prepareBoundsOutput(t, e);
},
getBottomCenter: function (t, e) {
return ((t = t || new s()).x = this.x - this.displayWidth * this.originX + this.displayWidth / 2), (t.y = this.y - this.displayHeight * this.originY + this.displayHeight), this.prepareBoundsOutput(t, e);
},
getBottomRight: function (t, e) {
return ((t = t || new s()).x = this.x - this.displayWidth * this.originX + this.displayWidth), (t.y = this.y - this.displayHeight * this.originY + this.displayHeight), this.prepareBoundsOutput(t, e);
},
getBounds: function (t) {
var e, i, n, s, r, o, a, h, l;
return (
void 0 === t && (t = new u()),
this.parentContainer
? ((l = this.parentContainer.getBoundsTransformMatrix()),
this.getTopLeft(t),
l.transformPoint(t.x, t.y, t),
(e = t.x),
(i = t.y),
this.getTopRight(t),
l.transformPoint(t.x, t.y, t),
(n = t.x),
(s = t.y),
this.getBottomLeft(t),
l.transformPoint(t.x, t.y, t),
(r = t.x),
(o = t.y),
this.getBottomRight(t),
l.transformPoint(t.x, t.y, t))
: (this.getTopLeft(t), (e = t.x), (i = t.y), this.getTopRight(t), (n = t.x), (s = t.y), this.getBottomLeft(t), (r = t.x), (o = t.y), this.getBottomRight(t)),
(a = t.x),
(h = t.y),
(t.x = Math.min(e, n, r, a)),
(t.y = Math.min(i, s, o, h)),
(t.width = Math.max(e, n, r, a) - t.x),
(t.height = Math.max(i, s, o, h) - t.y),
t
);
},
};
t.exports = r;
},
function (t, e) {
t.exports = function (t, e, i) {
return !(t.width <= 0 || t.height <= 0) && t.x <= e && t.x + t.width >= e && t.y <= i && t.y + t.height >= i;
};
},
function (t, e, i) {
var o = i(61),
a = i(62);
t.exports = function (t, e, i, n) {
void 0 === n && (n = []), !e && 0 < i && (e = a(t) / i);
for (var s = 0; s < e; s++) {
var r = s / e;
n.push(o(t, r));
}
return n;
};
},
function (t, e, i) {
var n = i(0),
s = i(302),
r = i(303),
o = i(26),
a = i(305),
h = i(2),
l = new n({
initialize: function (t, e, i, n) {
void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === n && (n = 0), (this.type = o.LINE), (this.x1 = t), (this.y1 = e), (this.x2 = i), (this.y2 = n);
},
getPoint: function (t, e) {
return s(this, t, e);
},
getPoints: function (t, e, i) {
return r(this, t, e, i);
},
getRandomPoint: function (t) {
return a(this, t);
},
setTo: function (t, e, i, n) {
return void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === n && (n = 0), (this.x1 = t), (this.y1 = e), (this.x2 = i), (this.y2 = n), this;
},
getPointA: function (t) {
return void 0 === t && (t = new h()), t.set(this.x1, this.y1), t;
},
getPointB: function (t) {
return void 0 === t && (t = new h()), t.set(this.x2, this.y2), t;
},
left: {
get: function () {
return Math.min(this.x1, this.x2);
},
set: function (t) {
this.x1 <= this.x2 ? (this.x1 = t) : (this.x2 = t);
},
},
right: {
get: function () {
return Math.max(this.x1, this.x2);
},
set: function (t) {
this.x1 > this.x2 ? (this.x1 = t) : (this.x2 = t);
},
},
top: {
get: function () {
return Math.min(this.y1, this.y2);
},
set: function (t) {
this.y1 <= this.y2 ? (this.y1 = t) : (this.y2 = t);
},
},
bottom: {
get: function () {
return Math.max(this.y1, this.y2);
},
set: function (t) {
this.y1 > this.y2 ? (this.y1 = t) : (this.y2 = t);
},
},
});
t.exports = l;
},
function (t, e, i) {
var n = i(13);
t.exports = function (t, e, i) {
return void 0 === i && (i = new n()), (i.x = t.x1 + (t.x2 - t.x1) * e), (i.y = t.y1 + (t.y2 - t.y1) * e), i;
};
},
function (t, e, i) {
var d = i(304),
f = i(13);
t.exports = function (t, e, i, n) {
void 0 === n && (n = []), !e && 0 < i && (e = d(t) / i);
for (var s = t.x1, r = t.y1, o = t.x2, a = t.y2, h = 0; h < e; h++) {
var l = h / e,
u = s + (o - s) * l,
c = r + (a - r) * l;
n.push(new f(u, c));
}
return n;
};
},
function (t, e) {
t.exports = function (t) {
return Math.sqrt((t.x2 - t.x1) * (t.x2 - t.x1) + (t.y2 - t.y1) * (t.y2 - t.y1));
};
},
function (t, e, i) {
var n = i(13);
t.exports = function (t, e) {
void 0 === e && (e = new n());
var i = Math.random();
return (e.x = t.x1 + i * (t.x2 - t.x1)), (e.y = t.y1 + i * (t.y2 - t.y1)), e;
};
},
function (t, e, i) {
var n = i(13);
t.exports = function (t, e) {
return void 0 === e && (e = new n()), (e.x = t.x + Math.random() * t.width), (e.y = t.y + Math.random() * t.height), e;
};
},
function (t, e, i) {
var n = i(308),
s = i(331),
r = {
mask: null,
setMask: function (t) {
return (this.mask = t), this;
},
clearMask: function (t) {
return void 0 === t && (t = !1), t && this.mask && this.mask.destroy(), (this.mask = null), this;
},
createBitmapMask: function (t) {
return void 0 === t && (this.texture || this.shader) && (t = this), new n(this.scene, t);
},
createGeometryMask: function (t) {
return void 0 === t && "Graphics" === this.type && (t = this), new s(this.scene, t);
},
};
t.exports = r;
},
function (t, e, i) {
var n = i(0),
s = i(309),
r = i(326),
o = new n({
initialize: function (t, e) {
var i = t.sys.renderer;
(this.renderer = i),
(this.bitmapMask = e),
(this.maskTexture = null),
(this.mainTexture = null),
(this.dirty = !0),
(this.mainFramebuffer = null),
(this.maskFramebuffer = null),
(this.invertAlpha = !1),
(this.isStencil = !1),
this.createMask(),
t.sys.game.events.on(s.CONTEXT_RESTORED, this.createMask, this),
i && i.on(r.RESIZE, this.createMask, this);
},
createMask: function () {
var t,
e,
i,
n,
s,
r,
o = this.renderer;
o &&
o.gl &&
(this.mainTexture && this.clearMask(),
(t = o.width),
(e = o.height),
(i = 0 == (t & (t - 1)) && 0 == (e & (e - 1))),
(n = o.gl),
(s = i ? n.REPEAT : n.CLAMP_TO_EDGE),
(r = n.LINEAR),
(this.mainTexture = o.createTexture2D(0, r, r, s, s, n.RGBA, null, t, e)),
(this.maskTexture = o.createTexture2D(0, r, r, s, s, n.RGBA, null, t, e)),
(this.mainFramebuffer = o.createFramebuffer(t, e, this.mainTexture, !0)),
(this.maskFramebuffer = o.createFramebuffer(t, e, this.maskTexture, !0)));
},
clearMask: function () {
var t = this.renderer;
t &&
t.gl &&
this.mainTexture &&
(t.deleteTexture(this.mainTexture),
t.deleteTexture(this.maskTexture),
t.deleteFramebuffer(this.mainFramebuffer),
t.deleteFramebuffer(this.maskFramebuffer),
(this.mainTexture = null),
(this.maskTexture = null),
(this.mainFramebuffer = null),
(this.maskFramebuffer = null));
},
setBitmap: function (t) {
this.bitmapMask = t;
},
preRenderWebGL: function (t, e, i) {
t.pipelines.BITMAPMASK_PIPELINE.beginMask(this, e, i);
},
postRenderWebGL: function (t, e) {
t.pipelines.BITMAPMASK_PIPELINE.endMask(this, e);
},
preRenderCanvas: function () {},
postRenderCanvas: function () {},
destroy: function () {
this.clearMask(), this.renderer && this.renderer.off(r.RESIZE, this.createMask, this), (this.bitmapMask = null), (this.prevFramebuffer = null), (this.renderer = null);
},
});
t.exports = o;
},
function (t, e, i) {
t.exports = {
BLUR: i(310),
BOOT: i(311),
CONTEXT_LOST: i(312),
CONTEXT_RESTORED: i(313),
DESTROY: i(314),
FOCUS: i(315),
HIDDEN: i(316),
PAUSE: i(317),
POST_RENDER: i(318),
POST_STEP: i(319),
PRE_RENDER: i(320),
PRE_STEP: i(321),
READY: i(322),
RESUME: i(323),
STEP: i(324),
VISIBLE: i(325),
};
},
function (t, e) {
t.exports = "blur";
},
function (t, e) {
t.exports = "boot";
},
function (t, e) {
t.exports = "contextlost";
},
function (t, e) {
t.exports = "contextrestored";
},
function (t, e) {
t.exports = "destroy";
},
function (t, e) {
t.exports = "focus";
},
function (t, e) {
t.exports = "hidden";
},
function (t, e) {
t.exports = "pause";
},
function (t, e) {
t.exports = "postrender";
},
function (t, e) {
t.exports = "poststep";
},
function (t, e) {
t.exports = "prerender";
},
function (t, e) {
t.exports = "prestep";
},
function (t, e) {
t.exports = "ready";
},
function (t, e) {
t.exports = "resume";
},
function (t, e) {
t.exports = "step";
},
function (t, e) {
t.exports = "visible";
},
function (t, e, i) {
t.exports = { POST_RENDER: i(327), PRE_RENDER: i(328), RENDER: i(329), RESIZE: i(330) };
},
function (t, e) {
t.exports = "postrender";
},
function (t, e) {
t.exports = "prerender";
},
function (t, e) {
t.exports = "render";
},
function (t, e) {
t.exports = "resize";
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e) {
(this.geometryMask = e), (this.invertAlpha = !1), (this.isStencil = !0), (this.level = 0);
},
setShape: function (t) {
return (this.geometryMask = t), this;
},
setInvertAlpha: function (t) {
return void 0 === t && (t = !0), (this.invertAlpha = t), this;
},
preRenderWebGL: function (t, e, i) {
var n = t.gl;
t.flush(),
0 === t.maskStack.length && (n.enable(n.STENCIL_TEST), n.clear(n.STENCIL_BUFFER_BIT), (t.maskCount = 0)),
t.currentCameraMask.mask !== this && (t.currentMask.mask = this),
t.maskStack.push({ mask: this, camera: i }),
this.applyStencil(t, i, !0),
t.maskCount++;
},
applyStencil: function (t, e, i) {
var n = t.gl,
s = this.geometryMask,
r = t.maskCount;
n.colorMask(!1, !1, !1, !1),
i ? (n.stencilFunc(n.EQUAL, r, 255), n.stencilOp(n.KEEP, n.KEEP, n.INCR)) : (n.stencilFunc(n.EQUAL, r + 1, 255), n.stencilOp(n.KEEP, n.KEEP, n.DECR)),
s.renderWebGL(t, s, e),
t.flush(),
n.colorMask(!0, !0, !0, !0),
n.stencilOp(n.KEEP, n.KEEP, n.KEEP),
i ? (this.invertAlpha ? n.stencilFunc(n.NOTEQUAL, r + 1, 255) : n.stencilFunc(n.EQUAL, r + 1, 255)) : this.invertAlpha ? n.stencilFunc(n.NOTEQUAL, r, 255) : n.stencilFunc(n.EQUAL, r, 255);
},
postRenderWebGL: function (t) {
var e = t.gl;
t.maskStack.pop(), t.maskCount--, t.flush();
var i,
n = t.currentMask;
0 === t.maskStack.length
? ((n.mask = null), e.disable(e.STENCIL_TEST))
: ((i = t.maskStack[t.maskStack.length - 1]).mask.applyStencil(t, i.camera, !1), t.currentCameraMask.mask !== i.mask ? ((n.mask = i.mask), (n.camera = i.camera)) : (n.mask = null));
},
preRenderCanvas: function (t, e, i) {
var n = this.geometryMask;
t.currentContext.save(), n.renderCanvas(t, n, i, null, null, !0), t.currentContext.clip();
},
postRenderCanvas: function (t) {
t.currentContext.restore();
},
destroy: function () {
this.geometryMask = null;
},
});
t.exports = n;
},
function (t, e) {
t.exports = {
_originComponent: !0,
originX: 0.5,
originY: 0.5,
_displayOriginX: 0,
_displayOriginY: 0,
displayOriginX: {
get: function () {
return this._displayOriginX;
},
set: function (t) {
(this._displayOriginX = t), (this.originX = t / this.width);
},
},
displayOriginY: {
get: function () {
return this._displayOriginY;
},
set: function (t) {
(this._displayOriginY = t), (this.originY = t / this.height);
},
},
setOrigin: function (t, e) {
return void 0 === t && (t = 0.5), void 0 === e && (e = t), (this.originX = t), (this.originY = e), this.updateDisplayOrigin();
},
setOriginFromFrame: function () {
return this.frame && this.frame.customPivot ? ((this.originX = this.frame.pivotX), (this.originY = this.frame.pivotY), this.updateDisplayOrigin()) : this.setOrigin();
},
setDisplayOrigin: function (t, e) {
return void 0 === t && (t = 0), void 0 === e && (e = t), (this.displayOriginX = t), (this.displayOriginY = e), this;
},
updateDisplayOrigin: function () {
return (this._displayOriginX = this.originX * this.width), (this._displayOriginY = this.originY * this.height), this;
},
};
},
function (t, e, i) {
var h = i(19),
o = i(334),
a = i(10),
l = i(335),
u = i(2),
n = {
path: null,
rotateToPath: !1,
pathRotationOffset: 0,
pathOffset: null,
pathVector: null,
pathDelta: null,
pathTween: null,
pathConfig: null,
_prevDirection: l.PLAYING_FORWARD,
setPath: function (t, e) {
void 0 === e && (e = this.pathConfig);
var i = this.pathTween;
return i && i.isPlaying() && i.stop(), (this.path = t), e && this.startFollow(e), this;
},
setRotateToPath: function (t, e) {
return void 0 === e && (e = 0), (this.rotateToPath = t), (this.pathRotationOffset = e), this;
},
isFollowing: function () {
var t = this.pathTween;
return t && t.isPlaying();
},
startFollow: function (t, e) {
void 0 === t && (t = {}), void 0 === e && (e = 0);
var i = this.pathTween;
i && i.isPlaying() && i.stop(), "number" == typeof t && (t = { duration: t }), (t.from = a(t, "from", 0)), (t.to = a(t, "to", 1));
var n = o(t, "positionOnPath", !1);
(this.rotateToPath = o(t, "rotateToPath", !1)), (this.pathRotationOffset = a(t, "rotationOffset", 0));
var s,
r = a(t, "startAt", e);
return (
r &&
(t.onStart = function (t) {
var e = t.data[0];
(e.progress = r), (e.elapsed = e.duration * r);
var i = e.ease(e.progress);
(e.current = e.start + (e.end - e.start) * i), (e.target[e.key] = e.current);
}),
this.pathOffset || (this.pathOffset = new u(this.x, this.y)),
this.pathVector || (this.pathVector = new u()),
this.pathDelta || (this.pathDelta = new u()),
this.pathDelta.reset(),
(this.pathTween = this.scene.sys.tweens.addCounter(t)),
this.path.getStartPoint(this.pathOffset),
n && ((this.x = this.pathOffset.x), (this.y = this.pathOffset.y)),
(this.pathOffset.x = this.x - this.pathOffset.x),
(this.pathOffset.y = this.y - this.pathOffset.y),
(this._prevDirection = l.PLAYING_FORWARD),
this.rotateToPath && ((s = this.path.getPoint(0.1)), (this.rotation = Math.atan2(s.y - this.y, s.x - this.x) + h(this.pathRotationOffset))),
(this.pathConfig = t),
this
);
},
pauseFollow: function () {
var t = this.pathTween;
return t && t.isPlaying() && t.pause(), this;
},
resumeFollow: function () {
var t = this.pathTween;
return t && t.isPaused() && t.resume(), this;
},
stopFollow: function () {
var t = this.pathTween;
return t && t.isPlaying() && t.stop(), this;
},
pathUpdate: function () {
var t = this.pathTween;
if (t) {
var e = t.data[0],
i = this.pathDelta,
n = this.pathVector;
if ((i.copy(n).negate(), e.state === l.COMPLETE)) return this.path.getPoint(1, n), i.add(n), n.add(this.pathOffset), void this.setPosition(n.x, n.y);
if (e.state !== l.PLAYING_FORWARD && e.state !== l.PLAYING_BACKWARD) return;
this.path.getPoint(t.getValue(), n), i.add(n), n.add(this.pathOffset);
var s = this.x,
r = this.y;
this.setPosition(n.x, n.y);
var o = this.x - s,
a = this.y - r;
if (0 == o && 0 == a) return;
if (e.state !== this._prevDirection) return void (this._prevDirection = e.state);
this.rotateToPath && (this.rotation = Math.atan2(a, o) + h(this.pathRotationOffset));
}
},
};
t.exports = n;
},
function (t, e) {
t.exports = function (t, e, i) {
return t && t.hasOwnProperty(e) ? t[e] : i;
};
},
function (t, e) {
t.exports = {
CREATED: 0,
INIT: 1,
DELAY: 2,
OFFSET_DELAY: 3,
PENDING_RENDER: 4,
PLAYING_FORWARD: 5,
PLAYING_BACKWARD: 6,
HOLD_DELAY: 7,
REPEAT_DELAY: 8,
COMPLETE: 9,
PENDING_ADD: 20,
PAUSED: 21,
LOOP_DELAY: 22,
ACTIVE: 23,
COMPLETE_DELAY: 24,
PENDING_REMOVE: 25,
REMOVED: 26,
};
},
function (t, e, i) {
var a = i(337),
s = i(338),
r = i(12),
n = {
defaultPipeline: null,
pipeline: null,
hasPostPipeline: !1,
postPipelines: null,
pipelineData: null,
initPipeline: function (t) {
void 0 === t && (t = s.MULTI_PIPELINE);
var e = this.scene.sys.renderer;
if (!e) return !1;
var i = e.pipelines;
if (((this.postPipelines = []), (this.pipelineData = {}), i)) {
var n = i.get(t);
if (n) return (this.defaultPipeline = n), (this.pipeline = n), !0;
}
return !1;
},
setPipeline: function (t, e, i) {
var n = this.scene.sys.renderer;
if (!n) return this;
var s,
r = n.pipelines;
return r && ((s = r.get(t)) && (this.pipeline = s), e && (this.pipelineData = i ? a(e) : e)), this;
},
setPostPipeline: function (t, e, i) {
var n = this.scene.sys.renderer;
if (!n) return this;
var s = n.pipelines;
if (s) {
Array.isArray(t) || (t = [t]);
for (var r = 0; r < t.length; r++) {
var o = s.getPostPipeline(t[r], this);
o && this.postPipelines.push(o);
}
e && (this.pipelineData = i ? a(e) : e);
}
return (this.hasPostPipeline = 0 < this.postPipelines.length), this;
},
setPipelineData: function (t, e) {
var i = this.pipelineData;
return void 0 === e ? delete i[t] : (i[t] = e), this;
},
getPostPipeline: function (t) {
for (var e = this.postPipelines, i = [], n = 0; n < e.length; n++) {
var s = e[n];
(("string" == typeof t && s.name === t) || s instanceof t) && i.push(s);
}
return 1 === i.length ? i[0] : i;
},
resetPipeline: function (t, e) {
return void 0 === t && (t = !1), void 0 === e && (e = !1), (this.pipeline = this.defaultPipeline), t && ((this.postPipelines = []), (this.hasPostPipeline = !1)), e && (this.pipelineData = {}), null !== this.pipeline;
},
resetPostPipeline: function (t) {
void 0 === t && (t = !1);
for (var e = this.postPipelines, i = 0; i < e.length; i++) e[i].destroy();
(this.postPipelines = []), (this.hasPostPipeline = !1), t && (this.pipelineData = {});
},
removePostPipeline: function (t) {
for (var e = this.postPipelines, i = e.length - 1; 0 <= i; i--) {
var n = e[i];
(("string" == typeof t && n.name === t) || ("string" != typeof t && n instanceof t)) && (n.destroy(), r(e, i));
}
return (this.hasPostPipeline = 0 < this.postPipelines.length), this;
},
getPipelineName: function () {
return this.pipeline.name;
},
};
t.exports = n;
},
function (t, e) {
var s = function (t) {
var e, i, n;
if ("object" != typeof t || null === t) return t;
for (n in ((e = Array.isArray(t) ? [] : {}), t)) (i = t[n]), (e[n] = s(i));
return e;
};
t.exports = s;
},
function (t, e) {
t.exports = {
BITMAPMASK_PIPELINE: "BitmapMaskPipeline",
LIGHT_PIPELINE: "Light2D",
POINTLIGHT_PIPELINE: "PointLightPipeline",
SINGLE_PIPELINE: "SinglePipeline",
MULTI_PIPELINE: "MultiPipeline",
ROPE_PIPELINE: "RopePipeline",
GRAPHICS_PIPELINE: "GraphicsPipeline",
POSTFX_PIPELINE: "PostFXPipeline",
UTILITY_PIPELINE: "UtilityPipeline",
};
},
function (t, e) {
var i = {
_sizeComponent: !0,
width: 0,
height: 0,
displayWidth: {
get: function () {
return Math.abs(this.scaleX * this.frame.realWidth);
},
set: function (t) {
this.scaleX = t / this.frame.realWidth;
},
},
displayHeight: {
get: function () {
return Math.abs(this.scaleY * this.frame.realHeight);
},
set: function (t) {
this.scaleY = t / this.frame.realHeight;
},
},
setSizeToFrame: function (t) {
return void 0 === t && (t = this.frame), (this.width = t.realWidth), (this.height = t.realHeight), this;
},
setSize: function (t, e) {
return (this.width = t), (this.height = e), this;
},
setDisplaySize: function (t, e) {
return (this.displayWidth = t), (this.displayHeight = e), this;
},
};
t.exports = i;
},
function (t, e) {
t.exports = {
texture: null,
frame: null,
isCropped: !1,
setTexture: function (t, e) {
return (this.texture = this.scene.sys.textures.get(t)), this.setFrame(e);
},
setFrame: function (t, e, i) {
return (
void 0 === e && (e = !0),
void 0 === i && (i = !0),
(this.frame = this.texture.get(t)),
this.frame.cutWidth && this.frame.cutHeight ? (this.renderFlags |= 8) : (this.renderFlags &= -9),
this._sizeComponent && e && this.setSizeToFrame(),
this._originComponent && i && (this.frame.customPivot ? this.setOrigin(this.frame.pivotX, this.frame.pivotY) : this.updateDisplayOrigin()),
this
);
},
};
},
function (t, e) {
t.exports = {
texture: null,
frame: null,
isCropped: !1,
setCrop: function (t, e, i, n) {
return (
void 0 === t
? (this.isCropped = !1)
: this.frame &&
("number" == typeof t ? this.frame.setCropUVs(this._crop, t, e, i, n, this.flipX, this.flipY) : this.frame.setCropUVs(this._crop, t.x, t.y, t.width, t.height, this.flipX, this.flipY), (this.isCropped = !0)),
this
);
},
setTexture: function (t, e) {
return (this.texture = this.scene.sys.textures.get(t)), this.setFrame(e);
},
setFrame: function (t, e, i) {
return (
void 0 === e && (e = !0),
void 0 === i && (i = !0),
(this.frame = this.texture.get(t)),
this.frame.cutWidth && this.frame.cutHeight ? (this.renderFlags |= 8) : (this.renderFlags &= -9),
this._sizeComponent && e && this.setSizeToFrame(),
this._originComponent && i && (this.frame.customPivot ? this.setOrigin(this.frame.pivotX, this.frame.pivotY) : this.updateDisplayOrigin()),
this.isCropped && this.frame.updateCropUVs(this._crop, this.flipX, this.flipY),
this
);
},
resetCropObject: function () {
return { u0: 0, v0: 0, u1: 0, v1: 0, width: 0, height: 0, x: 0, y: 0, flipX: !1, flipY: !1, cx: 0, cy: 0, cw: 0, ch: 0 };
},
};
},
function (t, e) {
t.exports = {
tintTopLeft: 16777215,
tintTopRight: 16777215,
tintBottomLeft: 16777215,
tintBottomRight: 16777215,
tintFill: !1,
clearTint: function () {
return this.setTint(16777215), this;
},
setTint: function (t, e, i, n) {
return void 0 === t && (t = 16777215), void 0 === e && (n = i = e = t), (this.tintTopLeft = t), (this.tintTopRight = e), (this.tintBottomLeft = i), (this.tintBottomRight = n), (this.tintFill = !1), this;
},
setTintFill: function (t, e, i, n) {
return this.setTint(t, e, i, n), (this.tintFill = !0), this;
},
tint: {
set: function (t) {
this.setTint(t, t, t, t);
},
},
isTinted: {
get: function () {
var t = 16777215;
return this.tintFill || this.tintTopLeft !== t || this.tintTopRight !== t || this.tintBottomLeft !== t || this.tintBottomRight !== t;
},
},
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(344)), (s = i(345));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = e.list,
r = s.length;
if (0 !== r) {
i.addToRenderList(e);
var o = e.localTransform;
n ? (o.loadIdentity(), o.multiply(n), o.translate(e.x, e.y), o.rotate(e.rotation), o.scale(e.scaleX, e.scaleY)) : o.applyITRS(e.x, e.y, e.rotation, e.scaleX, e.scaleY), t.pipelines.preBatch(e);
var a = -1 !== e.blendMode;
a || t.setBlendMode(0);
for (var h = e.alpha, l = e.scrollFactorX, u = e.scrollFactorY, c = 0; c < r; c++) {
var d,
f,
p,
g,
v,
y,
m,
x,
b = s[c];
b.willRender(i) &&
((g = void 0 !== b.alphaTopLeft ? ((d = b.alphaTopLeft), (f = b.alphaTopRight), (p = b.alphaBottomLeft), b.alphaBottomRight) : (p = f = d = b.alpha)),
(v = b.scrollFactorX),
(y = b.scrollFactorY),
a || b.blendMode === t.currentBlendMode || t.setBlendMode(b.blendMode),
(m = b.mask) && m.preRenderWebGL(t, b, i),
(x = b.type) !== t.currentType && ((t.newType = !0), (t.currentType = x)),
(t.nextTypeMatch = c < r - 1 && s[c + 1].type === t.currentType),
b.setScrollFactor(v * l, y * u),
b.setAlpha(d * h, f * h, p * h, g * h),
b.renderWebGL(t, b, i, o),
b.setAlpha(d, f, p, g),
b.setScrollFactor(v, y),
m && m.postRenderWebGL(t, i),
(t.newType = !1));
}
t.pipelines.postBatch(e);
}
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = e.list;
if (0 !== s.length) {
i.addToRenderList(e);
var r = e.localTransform;
n ? (r.loadIdentity(), r.multiply(n), r.translate(e.x, e.y), r.rotate(e.rotation), r.scale(e.scaleX, e.scaleY)) : r.applyITRS(e.x, e.y, e.rotation, e.scaleX, e.scaleY);
var o = -1 !== e.blendMode;
o || t.setBlendMode(0);
var a = e._alpha,
h = e.scrollFactorX,
l = e.scrollFactorY;
e.mask && e.mask.preRenderCanvas(t, null, i);
for (var u = 0; u < s.length; u++) {
var c,
d,
f,
p = s[u];
p.willRender(i) &&
((c = p.alpha),
(d = p.scrollFactorX),
(f = p.scrollFactorY),
o || p.blendMode === t.currentBlendMode || t.setBlendMode(p.blendMode),
p.setScrollFactor(d * h, f * l),
p.setAlpha(c * a),
p.renderCanvas(t, p, i, r),
p.setAlpha(c),
p.setScrollFactor(d, f));
}
e.mask && e.mask.postRenderCanvas(t);
}
};
},
function (t, e, i) {
var a = i(25);
t.exports = function (t, e, i) {
void 0 === i && (i = new a());
var n = Math.min(t.x, e.x),
s = Math.min(t.y, e.y),
r = Math.max(t.right, e.right) - n,
o = Math.max(t.bottom, e.bottom) - s;
return i.setTo(n, s, r, o);
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(348)), (s = i(349));
t.exports = { renderWebGL: n, renderCanvas: s };
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = e.plugin.sceneRenderer,
r = e.list;
if (0 !== r.length) {
i.addToRenderList(e);
var o = e.localTransform;
n ? (o.loadIdentity(), o.multiply(n), o.translate(e.x, e.y), o.rotate(e.rotation), o.scale(e.scaleX, e.scaleY)) : o.applyITRS(e.x, e.y, e.rotation, e.scaleX, e.scaleY), t.newType && (t.pipelines.clear(), s.begin());
var a = t.nextTypeMatch;
(t.nextTypeMatch = !0), (t.newType = !1);
for (var h = 0; h < r.length; h++) {
var l,
u = r[h];
u.willRender(i, e) &&
((l = u.mask) && (s.end(), t.pipelines.rebind(), l.preRenderWebGL(t, u, i), t.pipelines.clear(), s.begin()),
u.renderWebGL(t, u, i, o, e),
l && (s.end(), t.pipelines.rebind(), l.postRenderWebGL(t, i), t.pipelines.clear(), s.begin()));
}
(t.nextTypeMatch = a) || (s.end(), t.pipelines.rebind());
} else s.batcher.isDrawing && t.finalType && (s.end(), t.pipelines.rebind());
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = e.list;
if (0 !== s.length) {
i.addToRenderList(e);
var r = e.localTransform;
n ? (r.loadIdentity(), r.multiply(n), r.translate(e.x, e.y), r.rotate(e.rotation), r.scale(e.scaleX, e.scaleY)) : r.applyITRS(e.x, e.y, e.rotation, e.scaleX, e.scaleY);
var o = -1 !== e.blendMode;
o || t.setBlendMode(0);
var a = e._alpha,
h = e.scrollFactorX,
l = e.scrollFactorY;
e.mask && e.mask.preRenderCanvas(t, null, i);
for (var u = 0; u < s.length; u++) {
var c,
d,
f,
p = s[u];
p.willRender(i) &&
((c = p.alpha),
(d = p.scrollFactorX),
(f = p.scrollFactorY),
o || p.blendMode === t.currentBlendMode || t.setBlendMode(p.blendMode),
p.setScrollFactor(d * h, f * l),
p.setAlpha(c * a),
p.renderCanvas(t, p, i, r),
p.setAlpha(c),
p.setScrollFactor(d, f));
}
e.mask && e.mask.postRenderCanvas(t);
}
};
},
])),
(function (t, e) {
"object" == typeof exports && "object" == typeof module
? (module.exports = e(require("phaser")))
: "function" == typeof define && define.amd
? define(["phaser"], e)
: "object" == typeof exports
? (exports.NineSlice = e(require("phaser")))
: (t.NineSlice = e(t.Phaser));
})(window, function (i) {
return (function (i) {
var n = {};
function s(t) {
if (n[t]) return n[t].exports;
var e = (n[t] = { i: t, l: !1, exports: {} });
return i[t].call(e.exports, e, e.exports, s), (e.l = !0), e.exports;
}
return (
(s.m = i),
(s.c = n),
(s.d = function (t, e, i) {
s.o(t, e) || Object.defineProperty(t, e, { configurable: !1, enumerable: !0, get: i });
}),
(s.r = function (t) {
Object.defineProperty(t, "__esModule", { value: !0 });
}),
(s.n = function (t) {
var e =
t && t.__esModule
? function () {
return t.default;
}
: function () {
return t;
};
return s.d(e, "a", e), e;
}),
(s.o = function (t, e) {
return Object.prototype.hasOwnProperty.call(t, e);
}),
(s.p = ""),
s((s.s = 6))
);
})([
function (t, e) {
t.exports = i;
},
function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (e.EVENTS = void 0);
var n = (function () {
function n(t, e) {
for (var i = 0; i < e.length; i++) {
var n = e[i];
(n.enumerable = n.enumerable || !1), (n.configurable = !0), "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n);
}
}
return function (t, e, i) {
return e && n(t.prototype, e), i && n(t, i), t;
};
})(),
f = s(i(0)),
p = s(i(4));
function s(t) {
return t && t.__esModule ? t : { default: t };
}
var u = function (t) {
return {
tl: { x: t.topLeft.width, y: t.topLeft.height },
tr: { x: t.topRight.width, y: t.topRight.height },
bl: { x: t.bottomLeft.width, y: t.bottomLeft.height },
br: { x: t.bottomRight.width, y: t.bottomRight.height },
};
},
g = (e.EVENTS = { UPDATE_SAFE_BOUNDS: "updatesafebounds" }),
r = (function (t) {
function d(t, e) {
var i = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
!(function (t, e) {
if (!(t instanceof d)) throw new TypeError("Cannot call a class as a function");
})(this);
var n = (function (t, e) {
if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !e || ("object" != typeof e && "function" != typeof e) ? t : e;
})(this, (d.__proto__ || Object.getPrototypeOf(d)).call(this, t, 0, 0, 32, 32));
(n.initFrames = n.initFrames.bind(n)),
(n.getUsableBounds = n.getUsableBounds.bind(n)),
(n.drawFrames = n.drawFrames.bind(n)),
(n.resize = n.resize.bind(n)),
(n.updateSafeBounds = n.updateSafeBounds.bind(n)),
(n.enableDebugDraw = n.enableDebugDraw.bind(n)),
(n.events = new f.default.Events.EventEmitter()),
(n.sliceConfig = (function (t) {
var e = t;
if ("number" == typeof e.sourceLayout.width) {
var i = e.sourceLayout,
n = i.width,
s = i.height;
e.sourceLayout = { topLeft: { width: n, height: s } };
}
var r = e.sourceLayout;
(r.topRight = r.topRight || r.topLeft), (r.bottomRight = r.bottomRight || r.topLeft), (r.bottomLeft = r.bottomLeft || r.topLeft);
var o = Math.max(r.topLeft.height, r.topRight.height),
a = Math.max(r.topRight.width, r.bottomRight.width),
h = Math.max(r.bottomLeft.height, r.bottomRight.height),
l = Math.max(r.topLeft.width, r.bottomLeft.width);
if ((e.safeOffsets || (e.safeOffsets = { top: o, right: a, bottom: h, left: l }), void 0 === e.minSizing || !1 !== e.minSizing)) {
var u = e.safeOffsets;
e.minSizing = { width: u ? Math.max(u.left + u.right, l + a) : l + a, height: u ? Math.max(u.top + u.bottom, o + h) : o + h };
} else e.minSizing = !1;
return e;
})(e)),
(n._safeBounds = new f.default.Geom.Rectangle());
var s = n.sliceConfig,
r = s.sourceKey,
o = s.sourceFrame;
if (((n.sourceTex = t.sys.textures.get(n.sliceConfig.sourceKey)), !r)) throw new Error("NineSlice requires a texture sourceKey to be specified.");
if (!n.sourceTex || "__MISSING" === n.sourceTex.key) throw new Error("Expected source image " + r + " not found.");
(n._framePrefix = "" + (0, p.default)(JSON.stringify({ sourceKey: r, sourceFrame: o }, 404))),
(n.mkFrameName = function (t) {
return n._framePrefix + "-" + t;
}),
(n._frameCache = {});
var a = "string" == typeof o || "number" == typeof o ? o : "__BASE";
(n.sourceFrame = n.sourceTex.get(a)), n.initFrames(), (n._initalized = !0);
var h = i.x,
l = i.y,
u = i.width,
c = i.height;
return n.setPosition(h || 0, l || 0), n.resize(u || n.sourceFrame.width, c || n.sourceFrame.height), n.updateSafeBounds(), n;
}
return (
(function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function, not " + typeof e);
(t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } })), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : (t.__proto__ = e));
})(d, f.default.GameObjects.RenderTexture),
n(d, [
{
key: "updateSafeBounds",
value: function () {
if (this._initalized) {
var t = this.sliceConfig.safeOffsets,
e = t.top,
i = t.right,
n = t.bottom,
s = t.left,
r = this.x + s,
o = this.y + e,
a = this.width - (s + i),
h = this.height - (e + n),
l = this._safeBounds,
u = l.x,
c = l.y,
d = l.width,
f = l.height;
(r === u && o === c && a === d && h === f) ||
(this._safeBounds.setTo(this.x + s, this.y + e, this.width - (s + i), this.height - (e + n)), this.events.emit(g.UPDATE_SAFE_BOUNDS, this, this._safeBounds)),
this._g && (this._g.lineStyle(1, 65280), this._g.strokeRectShape(this._safeBounds));
}
},
},
{
key: "resize",
value: function (t, e) {
var i = (this.sliceConfig || {}).minSizing,
n = i ? Math.max(i.height, e) : e,
s = i ? Math.max(i.width, t) : t;
if (e < n || t < s);
(function t(e, i, n) {
null === e && (e = Function.prototype);
var s = Object.getOwnPropertyDescriptor(e, i);
if (void 0 === s) {
var r = Object.getPrototypeOf(e);
return null === r ? void 0 : t(r, i, n);
}
if ("value" in s) return s.value;
var o = s.get;
return void 0 !== o ? o.call(n) : void 0;
})(d.prototype.__proto__ || Object.getPrototypeOf(d.prototype), "resize", this).call(this, s, n),
this._initalized && (this._g && this._g.clear(), this.drawFrames(), this.updateSafeBounds());
},
},
{
key: "initFrames",
value: function () {
var o = this,
a = this.sourceTex,
t = this.sourceFrame.width,
e = this.sourceFrame.height,
h = this.sourceFrame.cutX,
l = this.sourceFrame.cutY,
i = function (t, e, i, n, s) {
var r = o.mkFrameName(t);
a.has(r) ? (o._frameCache[t] = a.frames[r]) : (o._frameCache[t] = a.add(r, 0, h + e, l + i, n, s));
},
n = u(this.sliceConfig.sourceLayout);
i("topLeft", 0, 0, n.tl.x, n.tl.y),
i("topRight", t - n.tr.x, 0, n.tr.x, n.tr.y),
i("bottomRight", t - n.br.x, e - n.br.y, n.br.x, n.br.y),
i("bottomLeft", 0, e - n.bl.y, n.bl.x, n.bl.y),
i("topMiddle", n.tl.x, 0, t - (n.tl.x + n.tr.x), Math.max(n.tl.y, n.tr.y)),
i("bottomMiddle", n.bl.x, e - Math.max(n.bl.y, n.br.y), t - (n.bl.x + n.br.x), Math.max(n.bl.y, n.br.y)),
i("leftMiddle", 0, n.tl.y, Math.max(n.tl.x, n.bl.x), e - (n.tl.y + n.bl.y)),
i("rightMiddle", t - Math.max(n.tr.x, n.br.x), n.tr.y, Math.max(n.tr.x, n.br.x), e - n.tr.y - n.br.y);
var s = Math.min(n.tl.x, n.bl.x),
r = Math.min(n.tl.y, n.tr.y);
i("center", s, r, t - s - Math.min(n.tr.x, n.br.x), e - r - Math.min(n.br.y, n.bl.y));
},
},
{
key: "getUsableBounds",
value: function () {
return this._initalized ? this._safeBounds : null;
},
},
{
key: "drawFrames",
value: function () {
var h = this;
if (this._initalized) {
this._g && this._g.lineStyle(1, 16711680);
var t = u(this.sliceConfig.sourceLayout),
e = this._frameCache,
i = function (t, e, i, n, s) {
if (0 < n && 0 < s) {
h._g && h._g.strokeRect(h.x + e, h.y + i, n, s);
var r = h.scene.make.image({ key: h.sourceTex.key, frame: t.name, x: 0, y: 0 }),
o = n / t.width,
a = s / t.height;
r.setOrigin(0).setScale(o, a), h.draw(r, e, i), r.destroy();
}
},
n = Math.min(t.tl.x, t.bl.x),
s = Math.min(t.tr.x, t.br.x),
r = Math.min(t.tl.y, t.tr.y),
o = Math.min(t.bl.y, t.br.y);
this.clear(),
i(e.center, n, r, this.width - n - s, this.height - r - o),
i(e.topMiddle, t.tl.x, 0, this.width - t.tl.x - t.tr.x, e.topMiddle.height),
i(e.bottomMiddle, t.bl.x, this.height - e.bottomMiddle.height, this.width - t.bl.x - t.br.x, e.bottomMiddle.height),
i(e.leftMiddle, 0, t.tl.y, e.leftMiddle.width, this.height - t.tl.y - t.bl.y),
i(e.rightMiddle, this.width - t.tr.x, t.tr.y, e.rightMiddle.width, this.height - t.tr.y - t.br.y),
i(e.topLeft, 0, 0, t.tl.x, t.tl.y),
i(e.topRight, this.width - t.tr.x, 0, t.tr.x, t.tr.y),
i(e.bottomRight, this.width - t.br.x, this.height - t.br.y, t.br.x, t.br.y),
i(e.bottomLeft, 0, this.height - t.bl.y, t.bl.x, t.bl.y);
}
},
},
{
key: "enableDebugDraw",
value: function () {
var t = !(0 < arguments.length && void 0 !== arguments[0]) || arguments[0];
this._g && this._g.clear(), (this._g = t ? this.scene.add.graphics(this.x, this.y) : null), this.drawFrames(), this.updateSafeBounds();
},
},
{
key: "y",
get: function () {
return this._y;
},
set: function (t) {
this._y !== t && (this._g && (this._g.clear(), this.drawFrames()), (this._y = t), this.updateSafeBounds());
},
},
{
key: "x",
get: function () {
return this._x;
},
set: function (t) {
this._x !== t && (this._g && (this._g.clear(), this.drawFrames()), (this._x = t), this.updateSafeBounds());
},
},
]),
d
);
})();
e.default = r;
},
function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }),
(e.default = function (t) {
switch (t.length) {
case 1:
return [t[0], t[0], t[0], t[0]];
case 2:
return [t[0], t[1], t[0], t[1]];
case 3:
return [t[0], t[1], t[2], t[1]];
case 4:
return t;
}
throw new Error("Received ${arr.length} offset values, expected 1 to 4.");
});
},
function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var P =
"function" == typeof Symbol && "symbol" == typeof Symbol.iterator
? function (t) {
return typeof t;
}
: function (t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
},
A = function (t, e) {
if (Array.isArray(t)) return t;
if (Symbol.iterator in Object(t))
return (function (t, e) {
var i = [],
n = !0,
s = !1,
r = void 0;
try {
for (var o, a = t[Symbol.iterator](); !(n = (o = a.next()).done) && (i.push(o.value), !e || i.length !== e); n = !0);
} catch (t) {
(s = !0), (r = t);
} finally {
try {
!n && a.return && a.return();
} finally {
if (s) throw r;
}
}
return i;
})(t, e);
throw new TypeError("Invalid attempt to destructure non-iterable instance");
},
n = (function () {
function n(t, e) {
for (var i = 0; i < e.length; i++) {
var n = e[i];
(n.enumerable = n.enumerable || !1), (n.configurable = !0), "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n);
}
}
return function (t, e, i) {
return e && n(t.prototype, e), i && n(t, i), t;
};
})(),
s = r(i(0)),
M = r(i(1)),
C = r(i(2));
function r(t) {
return t && t.__esModule ? t : { default: t };
}
var o = (function (t) {
function i(t) {
!(function (t, e) {
if (!(t instanceof i)) throw new TypeError("Cannot call a class as a function");
})(this);
var e = (function (t, e) {
if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !e || ("object" != typeof e && "function" != typeof e) ? t : e;
})(this, (i.__proto__ || Object.getPrototypeOf(i)).call(this, t));
return t.registerGameObject("nineslice", e.addNineSlice, e.makeNineSlice), e;
}
return (
(function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function, not " + typeof e);
(t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } })), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : (t.__proto__ = e));
})(i, s.default.Plugins.BasePlugin),
n(i, [
{
key: "addNineSlice",
value: function () {
for (var t = arguments.length, e = Array(t), i = 0; i < t; i++) e[i] = arguments[i];
var n = a(this.scene, e);
return this.displayList.add(n), n;
},
},
{
key: "makeNineSlice",
value: function () {
for (var t = arguments.length, e = Array(t), i = 0; i < t; i++) e[i] = arguments[i];
return a(this.scene, e);
},
},
]),
i
);
})();
e.default = o;
var a = function (t, e) {
if (2 === e.length) return new M.default(t, e[0], e[1]);
if (e.length < 6) throw new Error("Expected at least 6 arguments to NineSlice creator, received " + e.length + ".");
e.length;
var i = A(e, 6),
n = i[0],
s = i[1],
r = i[2],
o = i[3],
a = i[4],
h = i[5],
l = {},
u = { x: n, y: s, width: r, height: o };
if ("string" == typeof a) l.sourceKey = a;
else {
var c = a.key,
d = a.frame;
(l.sourceKey = c), ("string" != typeof d && "number" != typeof d) || (l.sourceFrame = a.frame);
}
if ("number" == typeof h) l.sourceLayout = { width: h, height: h };
else if (Array.isArray(h)) {
var f = (0, C.default)(h),
p = A(f, 4),
g = p[0],
v = p[1],
y = p[2],
m = p[3];
l.sourceLayout = { topLeft: { width: m, height: g }, topRight: { width: v, height: g }, bottomRight: { width: v, height: y }, bottomLeft: { width: m, height: y } };
} else l.sourceLayout = h;
if (6 < e.length)
if ("number" == typeof e[6]) {
var x = e[6];
l.safeOffsets = { top: x, right: x, bottom: x, left: x };
} else {
if (!Array.isArray(e[6])) throw new Error("Expected argument number or array for argument 7, got " + P(e[6]) + ".");
var b = (0, C.default)(e[6]),
w = A(b, 4),
T = w[0],
S = w[1],
_ = w[2],
E = w[3];
l.safeOffsets = { top: T, right: S, bottom: _, left: E };
}
return new M.default(t, l, u);
},
h = { key: "NineSlice", plugin: o, start: !0 };
o.DefaultCfg = h;
},
function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }),
(e.default = function (t, e) {
var i, n, s, r, o, a, h, l;
for (i = 3 & t.length, n = t.length - i, s = e, o = 3432918353, a = 461845907, l = 0; l < n; )
(h = (255 & t.charCodeAt(l)) | ((255 & t.charCodeAt(++l)) << 8) | ((255 & t.charCodeAt(++l)) << 16) | ((255 & t.charCodeAt(++l)) << 24)),
++l,
(s =
27492 +
(65535 &
(r =
(5 *
(65535 &
(s =
((s ^= h = ((65535 & (h = ((h = ((65535 & h) * o + ((((h >>> 16) * o) & 65535) << 16)) & 4294967295) << 15) | (h >>> 17))) * a + ((((h >>> 16) * a) & 65535) << 16)) & 4294967295) <<
13) |
(s >>> 19))) +
(((5 * (s >>> 16)) & 65535) << 16)) &
4294967295)) +
(((58964 + (r >>> 16)) & 65535) << 16));
switch (((h = 0), i)) {
case 3:
h ^= (255 & t.charCodeAt(l + 2)) << 16;
case 2:
h ^= (255 & t.charCodeAt(l + 1)) << 8;
case 1:
s ^= h = ((65535 & (h = ((h = ((65535 & (h ^= 255 & t.charCodeAt(l))) * o + ((((h >>> 16) * o) & 65535) << 16)) & 4294967295) << 15) | (h >>> 17))) * a + ((((h >>> 16) * a) & 65535) << 16)) & 4294967295;
}
return (
(s ^= t.length),
(s = (2246822507 * (65535 & (s ^= s >>> 16)) + (((2246822507 * (s >>> 16)) & 65535) << 16)) & 4294967295),
(s = (3266489909 * (65535 & (s ^= s >>> 13)) + (((3266489909 * (s >>> 16)) & 65535) << 16)) & 4294967295),
(s ^= s >>> 16) >>> 0
);
});
},
function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = i(1);
Object.defineProperty(e, "NineSlice", {
enumerable: !0,
get: function () {
return r(n).default;
},
}),
Object.defineProperty(e, "EVENTS", {
enumerable: !0,
get: function () {
return n.EVENTS;
},
});
var s = i(3);
function r(t) {
return t && t.__esModule ? t : { default: t };
}
Object.defineProperty(e, "Plugin", {
enumerable: !0,
get: function () {
return r(s).default;
},
});
},
function (t, e, i) {
t.exports = i(5);
},
]);
}),
(function (t, e) {
"object" == typeof exports && "undefined" != typeof module ? (module.exports = e()) : "function" == typeof define && define.amd ? define(e) : ((t = "undefined" != typeof globalThis ? globalThis : t || self).i18next = e());
})(this, function () {
"use strict";
function N(t) {
return (N =
"function" == typeof Symbol && "symbol" == typeof Symbol.iterator
? function (t) {
return typeof t;
}
: function (t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
})(t);
}
function a(t, e) {
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
}
function n(t, e) {
for (var i = 0; i < e.length; i++) {
var n = e[i];
(n.enumerable = n.enumerable || !1), (n.configurable = !0), "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n);
}
}
function h(t, e, i) {
return e && n(t.prototype, e), i && n(t, i), t;
}
function l(t) {
if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return t;
}
function i(t, e) {
return (i =
Object.setPrototypeOf ||
function (t, e) {
return (t.__proto__ = e), t;
})(t, e);
}
function e(t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
(t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } })), e && i(t, e);
}
function u(t, e) {
return !e || ("object" !== N(e) && "function" != typeof e) ? l(t) : e;
}
function c(t) {
return (c = Object.setPrototypeOf
? Object.getPrototypeOf
: function (t) {
return t.__proto__ || Object.getPrototypeOf(t);
})(t);
}
function s(t, e, i) {
return e in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : (t[e] = i), t;
}
function r(e, t) {
var i = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var n = Object.getOwnPropertySymbols(e);
t &&
(n = n.filter(function (t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable;
})),
i.push.apply(i, n);
}
return i;
}
function o(e) {
for (var t = 1; t < arguments.length; t++) {
var i = null != arguments[t] ? arguments[t] : {};
t % 2
? r(Object(i), !0).forEach(function (t) {
s(e, t, i[t]);
})
: Object.getOwnPropertyDescriptors
? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i))
: r(Object(i)).forEach(function (t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(i, t));
});
}
return e;
}
var d = {
type: "logger",
log: function (t) {
this.output("log", t);
},
warn: function (t) {
this.output("warn", t);
},
error: function (t) {
this.output("error", t);
},
output: function (t, e) {
console && console[t];
},
},
f = new ((function () {
function i(t) {
var e = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {};
a(this, i), this.init(t, e);
}
return (
h(i, [
{
key: "init",
value: function (t) {
var e = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {};
(this.prefix = e.prefix || "i18next:"), (this.logger = t || d), (this.options = e), (this.debug = e.debug);
},
},
{
key: "setDebug",
value: function (t) {
this.debug = t;
},
},
{
key: "log",
value: function () {
for (var t = arguments.length, e = new Array(t), i = 0; i < t; i++) e[i] = arguments[i];
return this.forward(e, "log", "", !0);
},
},
{
key: "warn",
value: function () {
for (var t = arguments.length, e = new Array(t), i = 0; i < t; i++) e[i] = arguments[i];
return this.forward(e, "warn", "", !0);
},
},
{
key: "error",
value: function () {
for (var t = arguments.length, e = new Array(t), i = 0; i < t; i++) e[i] = arguments[i];
return this.forward(e, "error", "");
},
},
{
key: "deprecate",
value: function () {
for (var t = arguments.length, e = new Array(t), i = 0; i < t; i++) e[i] = arguments[i];
return this.forward(e, "warn", "WARNING DEPRECATED: ", !0);
},
},
{
key: "forward",
value: function (t, e, i, n) {
return n && !this.debug ? null : ("string" == typeof t[0] && (t[0] = "".concat(i).concat(this.prefix, " ").concat(t[0])), this.logger[e](t));
},
},
{
key: "create",
value: function (t) {
return new i(this.logger, o(o({}, { prefix: "".concat(this.prefix, ":").concat(t, ":") }), this.options));
},
},
]),
i
);
})())(),
p = (function () {
function t() {
a(this, t), (this.observers = {});
}
return (
h(t, [
{
key: "on",
value: function (t, e) {
var i = this;
return (
t.split(" ").forEach(function (t) {
(i.observers[t] = i.observers[t] || []), i.observers[t].push(e);
}),
this
);
},
},
{
key: "off",
value: function (t, e) {
this.observers[t] &&
(e
? (this.observers[t] = this.observers[t].filter(function (t) {
return t !== e;
}))
: delete this.observers[t]);
},
},
{
key: "emit",
value: function (e) {
for (var t = arguments.length, i = new Array(1 < t ? t - 1 : 0), n = 1; n < t; n++) i[n - 1] = arguments[n];
this.observers[e] &&
[].concat(this.observers[e]).forEach(function (t) {
t.apply(void 0, i);
}),
this.observers["*"] &&
[].concat(this.observers["*"]).forEach(function (t) {
t.apply(t, [e].concat(i));
});
},
},
]),
t
);
})();
function g() {
var i,
n,
t = new Promise(function (t, e) {
(i = t), (n = e);
});
return (t.resolve = i), (t.reject = n), t;
}
function v(t) {
return null == t ? "" : "" + t;
}
function y(t, e, i) {
function n(t) {
return t && -1 < t.indexOf("###") ? t.replace(/###/g, ".") : t;
}
function s() {
return !t || "string" == typeof t;
}
for (var r = "string" != typeof e ? [].concat(e) : e.split("."); 1 < r.length; ) {
if (s()) return {};
var o = n(r.shift());
!t[o] && i && (t[o] = new i()), (t = Object.prototype.hasOwnProperty.call(t, o) ? t[o] : {});
}
return s() ? {} : { obj: t, k: n(r.shift()) };
}
function m(t, e, i) {
var n = y(t, e, Object);
n.obj[n.k] = i;
}
function x(t, e) {
var i = y(t, e),
n = i.obj,
s = i.k;
if (n) return n[s];
}
function b(t, e, i) {
var n = x(t, i);
return void 0 !== n ? n : x(e, i);
}
function w(t) {
return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
}
var T = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'", "/": "/" };
function S(t) {
return "string" == typeof t
? t.replace(/[&<>"'\/]/g, function (t) {
return T[t];
})
: t;
}
var _ = "undefined" != typeof window && window.navigator && window.navigator.userAgent && -1 < window.navigator.userAgent.indexOf("MSIE"),
E = [" ", ",", "?", "!", ";"];
function P(e, t) {
var i = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var n = Object.getOwnPropertySymbols(e);
t &&
(n = n.filter(function (t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable;
})),
i.push.apply(i, n);
}
return i;
}
function A(e) {
for (var t = 1; t < arguments.length; t++) {
var i = null != arguments[t] ? arguments[t] : {};
t % 2
? P(Object(i), !0).forEach(function (t) {
s(e, t, i[t]);
})
: Object.getOwnPropertyDescriptors
? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i))
: P(Object(i)).forEach(function (t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(i, t));
});
}
return e;
}
var M = (function (t) {
e(o, p);
var n,
s,
r =
((n = o),
(s = (function () {
if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
if (Reflect.construct.sham) return !1;
if ("function" == typeof Proxy) return !0;
try {
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), !0;
} catch (t) {
return !1;
}
})()),
function () {
var t,
e = c(n);
if (s) {
var i = c(this).constructor;
t = Reflect.construct(e, arguments, i);
} else t = e.apply(this, arguments);
return u(this, t);
});
function o(t) {
var e,
i = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : { ns: ["translation"], defaultNS: "translation" };
return (
a(this, o),
(e = r.call(this)),
_ && p.call(l(e)),
(e.data = t || {}),
(e.options = i),
void 0 === e.options.keySeparator && (e.options.keySeparator = "."),
void 0 === e.options.ignoreJSONStructure && (e.options.ignoreJSONStructure = !0),
e
);
}
return (
h(o, [
{
key: "addNamespaces",
value: function (t) {
this.options.ns.indexOf(t) < 0 && this.options.ns.push(t);
},
},
{
key: "removeNamespaces",
value: function (t) {
var e = this.options.ns.indexOf(t);
-1 < e && this.options.ns.splice(e, 1);
},
},
{
key: "getResource",
value: function (t, e, i) {
var n = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : {},
s = void 0 !== n.keySeparator ? n.keySeparator : this.options.keySeparator,
r = void 0 !== n.ignoreJSONStructure ? n.ignoreJSONStructure : this.options.ignoreJSONStructure,
o = [t, e];
i && "string" != typeof i && (o = o.concat(i)), i && "string" == typeof i && (o = o.concat(s ? i.split(s) : i)), -1 < t.indexOf(".") && (o = t.split("."));
var a = x(this.data, o);
return a || !r || "string" != typeof i
? a
: (function t(e, i) {
var n = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : ".";
if (e) {
if (e[i]) return e[i];
for (var s = i.split(n), r = e, o = 0; o < s.length; ++o) {
if (!r) return;
if ("string" == typeof r[s[o]] && o + 1 < s.length) return;
if (void 0 === r[s[o]]) {
for (var a = 2, h = s.slice(o, o + a).join(n), l = r[h]; void 0 === l && s.length > o + a; ) a++, (l = r[(h = s.slice(o, o + a).join(n))]);
if (void 0 === l) return;
if (i.endsWith(h)) {
if ("string" == typeof l) return l;
if (h && "string" == typeof l[h]) return l[h];
}
var u = s.slice(o + a).join(n);
return u ? t(l, u, n) : void 0;
}
r = r[s[o]];
}
return r;
}
})(this.data && this.data[t] && this.data[t][e], i, s);
},
},
{
key: "addResource",
value: function (t, e, i, n) {
var s = 4 < arguments.length && void 0 !== arguments[4] ? arguments[4] : { silent: !1 },
r = this.options.keySeparator;
void 0 === r && (r = ".");
var o = [t, e];
i && (o = o.concat(r ? i.split(r) : i)), -1 < t.indexOf(".") && ((n = e), (e = (o = t.split("."))[1])), this.addNamespaces(e), m(this.data, o, n), s.silent || this.emit("added", t, e, i, n);
},
},
{
key: "addResources",
value: function (t, e, i) {
var n = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : { silent: !1 };
for (var s in i) ("string" != typeof i[s] && "[object Array]" !== Object.prototype.toString.apply(i[s])) || this.addResource(t, e, s, i[s], { silent: !0 });
n.silent || this.emit("added", t, e, i);
},
},
{
key: "addResourceBundle",
value: function (t, e, i, n, s) {
var r = 5 < arguments.length && void 0 !== arguments[5] ? arguments[5] : { silent: !1 },
o = [t, e];
-1 < t.indexOf(".") && ((n = i), (i = e), (e = (o = t.split("."))[1])), this.addNamespaces(e);
var a = x(this.data, o) || {};
n
? (function t(e, i, n) {
for (var s in i)
"__proto__" !== s &&
"constructor" !== s &&
(s in e ? ("string" == typeof e[s] || e[s] instanceof String || "string" == typeof i[s] || i[s] instanceof String ? n && (e[s] = i[s]) : t(e[s], i[s], n)) : (e[s] = i[s]));
return e;
})(a, i, s)
: (a = A(A({}, a), i)),
m(this.data, o, a),
r.silent || this.emit("added", t, e, i);
},
},
{
key: "removeResourceBundle",
value: function (t, e) {
this.hasResourceBundle(t, e) && delete this.data[t][e], this.removeNamespaces(e), this.emit("removed", t, e);
},
},
{
key: "hasResourceBundle",
value: function (t, e) {
return void 0 !== this.getResource(t, e);
},
},
{
key: "getResourceBundle",
value: function (t, e) {
return e || (e = this.options.defaultNS), "v1" === this.options.compatibilityAPI ? A(A({}, {}), this.getResource(t, e)) : this.getResource(t, e);
},
},
{
key: "getDataByLanguage",
value: function (t) {
return this.data[t];
},
},
{
key: "hasLanguageSomeTranslations",
value: function (t) {
var e = this.getDataByLanguage(t);
return !!((e && Object.keys(e)) || []).find(function (t) {
return e[t] && 0 < Object.keys(e[t]).length;
});
},
},
{
key: "toJSON",
value: function () {
return this.data;
},
},
]),
o
);
})(),
C = {
processors: {},
addPostProcessor: function (t) {
this.processors[t.name] = t;
},
handle: function (t, e, i, n, s) {
var r = this;
return (
t.forEach(function (t) {
r.processors[t] && (e = r.processors[t].process(e, i, n, s));
}),
e
);
},
};
function O(e, t) {
var i = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var n = Object.getOwnPropertySymbols(e);
t &&
(n = n.filter(function (t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable;
})),
i.push.apply(i, n);
}
return i;
}
function U(e) {
for (var t = 1; t < arguments.length; t++) {
var i = null != arguments[t] ? arguments[t] : {};
t % 2
? O(Object(i), !0).forEach(function (t) {
s(e, t, i[t]);
})
: Object.getOwnPropertyDescriptors
? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i))
: O(Object(i)).forEach(function (t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(i, t));
});
}
return e;
}
var k = {},
R = (function (t) {
e(B, p);
var n,
s,
o =
((n = B),
(s = (function () {
if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
if (Reflect.construct.sham) return !1;
if ("function" == typeof Proxy) return !0;
try {
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), !0;
} catch (t) {
return !1;
}
})()),
function () {
var t,
e = c(n);
if (s) {
var i = c(this).constructor;
t = Reflect.construct(e, arguments, i);
} else t = e.apply(this, arguments);
return u(this, t);
});
function B(t) {
var e,
i,
n,
s,
r = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {};
return (
a(this, B),
(e = o.call(this)),
_ && p.call(l(e)),
(i = ["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"]),
(n = t),
(s = l(e)),
i.forEach(function (t) {
n[t] && (s[t] = n[t]);
}),
(e.options = r),
void 0 === e.options.keySeparator && (e.options.keySeparator = "."),
(e.logger = f.create("translator")),
e
);
}
return (
h(
B,
[
{
key: "changeLanguage",
value: function (t) {
t && (this.language = t);
},
},
{
key: "exists",
value: function (t) {
var e = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : { interpolation: {} };
if (null == t) return !1;
var i = this.resolve(t, e);
return i && void 0 !== i.res;
},
},
{
key: "extractFromKey",
value: function (t, e) {
var i = void 0 !== e.nsSeparator ? e.nsSeparator : this.options.nsSeparator;
void 0 === i && (i = ":");
var n = void 0 !== e.keySeparator ? e.keySeparator : this.options.keySeparator,
s = e.ns || this.options.defaultNS || [],
r = i && -1 < t.indexOf(i),
o = !(
this.options.userDefinedKeySeparator ||
e.keySeparator ||
this.options.userDefinedNsSeparator ||
e.nsSeparator ||
(function (t, e, i) {
(e = e || ""), (i = i || "");
var n = E.filter(function (t) {
return e.indexOf(t) < 0 && i.indexOf(t) < 0;
});
if (0 === n.length) return !0;
var s = new RegExp(
"(".concat(
n
.map(function (t) {
return "?" === t ? "\\?" : t;
})
.join("|"),
")"
)
),
r = !s.test(t);
if (!r) {
var o = t.indexOf(i);
0 < o && !s.test(t.substring(0, o)) && (r = !0);
}
return r;
})(t, i, n)
);
if (r && !o) {
var a = t.match(this.interpolator.nestingRegexp);
if (a && 0 < a.length) return { key: t, namespaces: s };
var h = t.split(i);
(i !== n || (i === n && -1 < this.options.ns.indexOf(h[0]))) && (s = h.shift()), (t = h.join(n));
}
return "string" == typeof s && (s = [s]), { key: t, namespaces: s };
},
},
{
key: "translate",
value: function (t, s, e) {
var r = this;
if (("object" !== N(s) && this.options.overloadTranslationOptionHandler && (s = this.options.overloadTranslationOptionHandler(arguments)), s || (s = {}), null == t)) return "";
Array.isArray(t) || (t = [String(t)]);
var i = void 0 !== s.keySeparator ? s.keySeparator : this.options.keySeparator,
n = this.extractFromKey(t[t.length - 1], s),
o = n.key,
a = n.namespaces,
h = a[a.length - 1],
l = s.lng || this.language,
u = s.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
if (l && "cimode" === l.toLowerCase()) {
if (u) {
var c = s.nsSeparator || this.options.nsSeparator;
return h + c + o;
}
return o;
}
var d = this.resolve(t, s),
f = d && d.res,
p = (d && d.usedKey) || o,
g = (d && d.exactUsedKey) || o,
v = Object.prototype.toString.apply(f),
y = void 0 !== s.joinArrays ? s.joinArrays : this.options.joinArrays,
m = !this.i18nFormat || this.i18nFormat.handleAsObject;
if (
m &&
f &&
"string" != typeof f &&
"boolean" != typeof f &&
"number" != typeof f &&
["[object Number]", "[object Function]", "[object RegExp]"].indexOf(v) < 0 &&
("string" != typeof y || "[object Array]" !== v)
) {
if (!s.returnObjects && !this.options.returnObjects)
return (
this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!"),
this.options.returnedObjectHandler
? this.options.returnedObjectHandler(p, f, U(U({}, s), {}, { ns: a }))
: "key '".concat(o, " (").concat(this.language, ")' returned an object instead of string.")
);
if (i) {
var x = "[object Array]" === v,
b = x ? [] : {},
w = x ? g : p;
for (var T in f)
if (Object.prototype.hasOwnProperty.call(f, T)) {
var S = "".concat(w).concat(i).concat(T);
(b[T] = this.translate(S, U(U({}, s), { joinArrays: !1, ns: a }))), b[T] === S && (b[T] = f[T]);
}
f = b;
}
} else if (m && "string" == typeof y && "[object Array]" === v) (f = f.join(y)) && (f = this.extendTranslation(f, t, s, e));
else {
var _ = !1,
E = !1,
P = void 0 !== s.count && "string" != typeof s.count,
A = B.hasDefaultValue(s),
M = P ? this.pluralResolver.getSuffix(l, s.count, s) : "",
C = s["defaultValue".concat(M)] || s.defaultValue;
!this.isValidLookup(f) && A && ((_ = !0), (f = C)), this.isValidLookup(f) || ((E = !0), (f = o));
var O = (s.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && E ? void 0 : f,
k = A && C !== f && this.options.updateMissing;
if (E || _ || k) {
if ((this.logger.log(k ? "updateKey" : "missingKey", l, h, o, k ? C : f), i)) {
var R = this.resolve(o, U(U({}, s), {}, { keySeparator: !1 }));
R &&
R.res &&
this.logger.warn(
"Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format."
);
}
var L = [],
I = this.languageUtils.getFallbackCodes(this.options.fallbackLng, s.lng || this.language);
if ("fallback" === this.options.saveMissingTo && I && I[0]) for (var D = 0; D < I.length; D++) L.push(I[D]);
else "all" === this.options.saveMissingTo ? (L = this.languageUtils.toResolveHierarchy(s.lng || this.language)) : L.push(s.lng || this.language);
var F = function (t, e, i) {
var n = A && i !== f ? i : O;
r.options.missingKeyHandler ? r.options.missingKeyHandler(t, h, e, n, k, s) : r.backendConnector && r.backendConnector.saveMissing && r.backendConnector.saveMissing(t, h, e, n, k, s),
r.emit("missingKey", t, h, e, f);
};
this.options.saveMissing &&
(this.options.saveMissingPlurals && P
? L.forEach(function (e) {
r.pluralResolver.getSuffixes(e).forEach(function (t) {
F([e], o + t, s["defaultValue".concat(t)] || C);
});
})
: F(L, o, C));
}
(f = this.extendTranslation(f, t, s, d, e)),
E && f === o && this.options.appendNamespaceToMissingKey && (f = "".concat(h, ":").concat(o)),
(E || _) && this.options.parseMissingKeyHandler && (f = this.options.parseMissingKeyHandler(f));
}
return f;
},
},
{
key: "extendTranslation",
value: function (t, n, s, e, r) {
var o = this;
if (this.i18nFormat && this.i18nFormat.parse) t = this.i18nFormat.parse(t, s, e.usedLng, e.usedNS, e.usedKey, { resolved: e });
else if (!s.skipInterpolation) {
s.interpolation && this.interpolator.init(U(U({}, s), { interpolation: U(U({}, this.options.interpolation), s.interpolation) }));
var i,
a = "string" == typeof t && (s && s.interpolation && void 0 !== s.interpolation.skipOnVariables ? s.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
if (a) {
var h = t.match(this.interpolator.nestingRegexp);
i = h && h.length;
}
var l = s.replace && "string" != typeof s.replace ? s.replace : s;
if ((this.options.interpolation.defaultVariables && (l = U(U({}, this.options.interpolation.defaultVariables), l)), (t = this.interpolator.interpolate(t, l, s.lng || this.language, s)), a)) {
var u = t.match(this.interpolator.nestingRegexp);
i < (u && u.length) && (s.nest = !1);
}
!1 !== s.nest &&
(t = this.interpolator.nest(
t,
function () {
for (var t = arguments.length, e = new Array(t), i = 0; i < t; i++) e[i] = arguments[i];
return r && r[0] === e[0] && !s.context ? (o.logger.warn("It seems you are nesting recursively key: ".concat(e[0], " in key: ").concat(n[0])), null) : o.translate.apply(o, e.concat([n]));
},
s
)),
s.interpolation && this.interpolator.reset();
}
var c = s.postProcess || this.options.postProcess,
d = "string" == typeof c ? [c] : c;
return null != t && d && d.length && !1 !== s.applyPostProcessor && (t = C.handle(d, t, n, this.options && this.options.postProcessPassResolved ? U({ i18nResolved: e }, s) : s, this)), t;
},
},
{
key: "resolve",
value: function (t) {
var u,
s,
c,
d,
f,
p = this,
g = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {};
return (
"string" == typeof t && (t = [t]),
t.forEach(function (t) {
if (!p.isValidLookup(u)) {
var e = p.extractFromKey(t, g),
o = e.key;
s = o;
var i = e.namespaces;
p.options.fallbackNS && (i = i.concat(p.options.fallbackNS));
var a = void 0 !== g.count && "string" != typeof g.count,
h = a && !g.ordinal && 0 === g.count && p.pluralResolver.shouldUseIntlApi(),
l = void 0 !== g.context && ("string" == typeof g.context || "number" == typeof g.context) && "" !== g.context,
n = g.lngs ? g.lngs : p.languageUtils.toResolveHierarchy(g.lng || p.language, g.fallbackLng);
i.forEach(function (r) {
p.isValidLookup(u) ||
((f = r),
!k["".concat(n[0], "-").concat(r)] &&
p.utils &&
p.utils.hasLoadedNamespace &&
!p.utils.hasLoadedNamespace(f) &&
((k["".concat(n[0], "-").concat(r)] = !0),
p.logger.warn(
'key "'.concat(s, '" for languages "').concat(n.join(", "), '" won\'t get resolved as namespace "').concat(f, '" was not yet loaded'),
"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"
)),
n.forEach(function (t) {
if (!p.isValidLookup(u)) {
d = t;
var e,
i,
n = [o];
if (p.i18nFormat && p.i18nFormat.addLookupKeys) p.i18nFormat.addLookupKeys(n, o, t, r, g);
else if ((a && (i = p.pluralResolver.getSuffix(t, g.count, g)), a && (n.push(o + i), h && n.push(o + "_zero")), l)) {
var s = "".concat(o).concat(p.options.contextSeparator).concat(g.context);
n.push(s), a && (n.push(s + i), h && n.push(s + "_zero"));
}
for (; (e = n.pop()); ) p.isValidLookup(u) || ((c = e), (u = p.getResource(t, r, e, g)));
}
}));
});
}
}),
{ res: u, usedKey: s, exactUsedKey: c, usedLng: d, usedNS: f }
);
},
},
{
key: "isValidLookup",
value: function (t) {
return !(void 0 === t || (!this.options.returnNull && null === t) || (!this.options.returnEmptyString && "" === t));
},
},
{
key: "getResource",
value: function (t, e, i) {
var n = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : {};
return this.i18nFormat && this.i18nFormat.getResource ? this.i18nFormat.getResource(t, e, i, n) : this.resourceStore.getResource(t, e, i, n);
},
},
],
[
{
key: "hasDefaultValue",
value: function (t) {
for (var e in t) if (Object.prototype.hasOwnProperty.call(t, e) && "defaultValue" === e.substring(0, "defaultValue".length) && void 0 !== t[e]) return !0;
return !1;
},
},
]
),
B
);
})();
function L(t) {
return t.charAt(0).toUpperCase() + t.slice(1);
}
var I = (function () {
function e(t) {
a(this, e), (this.options = t), (this.supportedLngs = this.options.supportedLngs || !1), (this.logger = f.create("languageUtils"));
}
return (
h(e, [
{
key: "getScriptPartFromCode",
value: function (t) {
if (!t || t.indexOf("-") < 0) return null;
var e = t.split("-");
return 2 === e.length ? null : (e.pop(), "x" === e[e.length - 1].toLowerCase() ? null : this.formatLanguageCode(e.join("-")));
},
},
{
key: "getLanguagePartFromCode",
value: function (t) {
if (!t || t.indexOf("-") < 0) return t;
var e = t.split("-");
return this.formatLanguageCode(e[0]);
},
},
{
key: "formatLanguageCode",
value: function (t) {
if ("string" == typeof t && -1 < t.indexOf("-")) {
var e = ["hans", "hant", "latn", "cyrl", "cans", "mong", "arab"],
i = t.split("-");
return (
this.options.lowerCaseLng
? (i = i.map(function (t) {
return t.toLowerCase();
}))
: 2 === i.length
? ((i[0] = i[0].toLowerCase()), (i[1] = i[1].toUpperCase()), -1 < e.indexOf(i[1].toLowerCase()) && (i[1] = L(i[1].toLowerCase())))
: 3 === i.length &&
((i[0] = i[0].toLowerCase()),
2 === i[1].length && (i[1] = i[1].toUpperCase()),
"sgn" !== i[0] && 2 === i[2].length && (i[2] = i[2].toUpperCase()),
-1 < e.indexOf(i[1].toLowerCase()) && (i[1] = L(i[1].toLowerCase())),
-1 < e.indexOf(i[2].toLowerCase()) && (i[2] = L(i[2].toLowerCase()))),
i.join("-")
);
}
return this.options.cleanCode || this.options.lowerCaseLng ? t.toLowerCase() : t;
},
},
{
key: "isSupportedCode",
value: function (t) {
return (
("languageOnly" === this.options.load || this.options.nonExplicitSupportedLngs) && (t = this.getLanguagePartFromCode(t)),
!this.supportedLngs || !this.supportedLngs.length || -1 < this.supportedLngs.indexOf(t)
);
},
},
{
key: "getBestMatchFromCodes",
value: function (t) {
var i,
n = this;
return t
? (t.forEach(function (t) {
if (!i) {
var e = n.formatLanguageCode(t);
(n.options.supportedLngs && !n.isSupportedCode(e)) || (i = e);
}
}),
!i &&
this.options.supportedLngs &&
t.forEach(function (t) {
if (!i) {
var e = n.getLanguagePartFromCode(t);
if (n.isSupportedCode(e)) return (i = e);
i = n.options.supportedLngs.find(function (t) {
if (0 === t.indexOf(e)) return t;
});
}
}),
i || (i = this.getFallbackCodes(this.options.fallbackLng)[0]),
i)
: null;
},
},
{
key: "getFallbackCodes",
value: function (t, e) {
if (!t) return [];
if (("function" == typeof t && (t = t(e)), "string" == typeof t && (t = [t]), "[object Array]" === Object.prototype.toString.apply(t))) return t;
if (!e) return t.default || [];
var i = t[e];
return i || (i = t[this.getScriptPartFromCode(e)]), i || (i = t[this.formatLanguageCode(e)]), i || (i = t[this.getLanguagePartFromCode(e)]), i || (i = t.default), i || [];
},
},
{
key: "toResolveHierarchy",
value: function (t, e) {
var i = this,
n = this.getFallbackCodes(e || this.options.fallbackLng || [], t),
s = [],
r = function (t) {
t && (i.isSupportedCode(t) ? s.push(t) : i.logger.warn("rejecting language code not found in supportedLngs: ".concat(t)));
};
return (
"string" == typeof t && -1 < t.indexOf("-")
? ("languageOnly" !== this.options.load && r(this.formatLanguageCode(t)),
"languageOnly" !== this.options.load && "currentOnly" !== this.options.load && r(this.getScriptPartFromCode(t)),
"currentOnly" !== this.options.load && r(this.getLanguagePartFromCode(t)))
: "string" == typeof t && r(this.formatLanguageCode(t)),
n.forEach(function (t) {
s.indexOf(t) < 0 && r(i.formatLanguageCode(t));
}),
s
);
},
},
]),
e
);
})(),
D = [
{ lngs: ["ach", "ak", "am", "arn", "br", "fil", "gun", "ln", "mfe", "mg", "mi", "oc", "pt", "pt-BR", "tg", "tl", "ti", "tr", "uz", "wa"], nr: [1, 2], fc: 1 },
{
lngs: [
"af",
"an",
"ast",
"az",
"bg",
"bn",
"ca",
"da",
"de",
"dev",
"el",
"en",
"eo",
"es",
"et",
"eu",
"fi",
"fo",
"fur",
"fy",
"gl",
"gu",
"ha",
"hi",
"hu",
"hy",
"ia",
"it",
"kk",
"kn",
"ku",
"lb",
"mai",
"ml",
"mn",
"mr",
"nah",
"nap",
"nb",
"ne",
"nl",
"nn",
"no",
"nso",
"pa",
"pap",
"pms",
"ps",
"pt-PT",
"rm",
"sco",
"se",
"si",
"so",
"son",
"sq",
"sv",
"sw",
"ta",
"te",
"tk",
"ur",
"yo",
],
nr: [1, 2],
fc: 2,
},
{ lngs: ["ay", "bo", "cgg", "fa", "ht", "id", "ja", "jbo", "ka", "km", "ko", "ky", "lo", "ms", "sah", "su", "th", "tt", "ug", "vi", "wo", "zh"], nr: [1], fc: 3 },
{ lngs: ["be", "bs", "cnr", "dz", "hr", "ru", "sr", "uk"], nr: [1, 2, 5], fc: 4 },
{ lngs: ["ar"], nr: [0, 1, 2, 3, 11, 100], fc: 5 },
{ lngs: ["cs", "sk"], nr: [1, 2, 5], fc: 6 },
{ lngs: ["csb", "pl"], nr: [1, 2, 5], fc: 7 },
{ lngs: ["cy"], nr: [1, 2, 3, 8], fc: 8 },
{ lngs: ["fr"], nr: [1, 2], fc: 9 },
{ lngs: ["ga"], nr: [1, 2, 3, 7, 11], fc: 10 },
{ lngs: ["gd"], nr: [1, 2, 3, 20], fc: 11 },
{ lngs: ["is"], nr: [1, 2], fc: 12 },
{ lngs: ["jv"], nr: [0, 1], fc: 13 },
{ lngs: ["kw"], nr: [1, 2, 3, 4], fc: 14 },
{ lngs: ["lt"], nr: [1, 2, 10], fc: 15 },
{ lngs: ["lv"], nr: [1, 2, 0], fc: 16 },
{ lngs: ["mk"], nr: [1, 2], fc: 17 },
{ lngs: ["mnk"], nr: [0, 1, 2], fc: 18 },
{ lngs: ["mt"], nr: [1, 2, 11, 20], fc: 19 },
{ lngs: ["or"], nr: [2, 1], fc: 2 },
{ lngs: ["ro"], nr: [1, 2, 20], fc: 20 },
{ lngs: ["sl"], nr: [5, 1, 2, 3], fc: 21 },
{ lngs: ["he", "iw"], nr: [1, 2, 20, 21], fc: 22 },
],
F = {
1: function (t) {
return Number(1 < t);
},
2: function (t) {
return Number(1 != t);
},
3: function (t) {
return 0;
},
4: function (t) {
return Number(t % 10 == 1 && t % 100 != 11 ? 0 : 2 <= t % 10 && t % 10 <= 4 && (t % 100 < 10 || 20 <= t % 100) ? 1 : 2);
},
5: function (t) {
return Number(0 == t ? 0 : 1 == t ? 1 : 2 == t ? 2 : 3 <= t % 100 && t % 100 <= 10 ? 3 : 11 <= t % 100 ? 4 : 5);
},
6: function (t) {
return Number(1 == t ? 0 : 2 <= t && t <= 4 ? 1 : 2);
},
7: function (t) {
return Number(1 == t ? 0 : 2 <= t % 10 && t % 10 <= 4 && (t % 100 < 10 || 20 <= t % 100) ? 1 : 2);
},
8: function (t) {
return Number(1 == t ? 0 : 2 == t ? 1 : 8 != t && 11 != t ? 2 : 3);
},
9: function (t) {
return Number(2 <= t);
},
10: function (t) {
return Number(1 == t ? 0 : 2 == t ? 1 : t < 7 ? 2 : t < 11 ? 3 : 4);
},
11: function (t) {
return Number(1 == t || 11 == t ? 0 : 2 == t || 12 == t ? 1 : 2 < t && t < 20 ? 2 : 3);
},
12: function (t) {
return Number(t % 10 != 1 || t % 100 == 11);
},
13: function (t) {
return Number(0 !== t);
},
14: function (t) {
return Number(1 == t ? 0 : 2 == t ? 1 : 3 == t ? 2 : 3);
},
15: function (t) {
return Number(t % 10 == 1 && t % 100 != 11 ? 0 : 2 <= t % 10 && (t % 100 < 10 || 20 <= t % 100) ? 1 : 2);
},
16: function (t) {
return Number(t % 10 == 1 && t % 100 != 11 ? 0 : 0 !== t ? 1 : 2);
},
17: function (t) {
return Number(1 == t || (t % 10 == 1 && t % 100 != 11) ? 0 : 1);
},
18: function (t) {
return Number(0 == t ? 0 : 1 == t ? 1 : 2);
},
19: function (t) {
return Number(1 == t ? 0 : 0 == t || (1 < t % 100 && t % 100 < 11) ? 1 : 10 < t % 100 && t % 100 < 20 ? 2 : 3);
},
20: function (t) {
return Number(1 == t ? 0 : 0 == t || (0 < t % 100 && t % 100 < 20) ? 1 : 2);
},
21: function (t) {
return Number(t % 100 == 1 ? 1 : t % 100 == 2 ? 2 : t % 100 == 3 || t % 100 == 4 ? 3 : 0);
},
22: function (t) {
return Number(1 == t ? 0 : 2 == t ? 1 : (t < 0 || 10 < t) && t % 10 == 0 ? 2 : 3);
},
},
t = ["v1", "v2", "v3"],
B = { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 },
Y = (function () {
function n(t) {
var i,
e = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {};
a(this, n),
(this.languageUtils = t),
(this.options = e),
(this.logger = f.create("pluralResolver")),
(this.options.compatibilityJSON && "v4" !== this.options.compatibilityJSON) ||
("undefined" != typeof Intl && Intl.PluralRules) ||
((this.options.compatibilityJSON = "v3"), this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),
(this.rules =
((i = {}),
D.forEach(function (e) {
e.lngs.forEach(function (t) {
i[t] = { numbers: e.nr, plurals: F[e.fc] };
});
}),
i));
}
return (
h(n, [
{
key: "addRule",
value: function (t, e) {
this.rules[t] = e;
},
},
{
key: "getRule",
value: function (t) {
var e = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {};
if (this.shouldUseIntlApi())
try {
return new Intl.PluralRules(t, { type: e.ordinal ? "ordinal" : "cardinal" });
} catch (t) {
return;
}
return this.rules[t] || this.rules[this.languageUtils.getLanguagePartFromCode(t)];
},
},
{
key: "needsPlural",
value: function (t) {
var e = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {},
i = this.getRule(t, e);
return this.shouldUseIntlApi() ? i && 1 < i.resolvedOptions().pluralCategories.length : i && 1 < i.numbers.length;
},
},
{
key: "getPluralFormsOfKey",
value: function (t, e) {
var i = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : {};
return this.getSuffixes(t, i).map(function (t) {
return "".concat(e).concat(t);
});
},
},
{
key: "getSuffixes",
value: function (e) {
var i = this,
n = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {},
t = this.getRule(e, n);
return t
? this.shouldUseIntlApi()
? t
.resolvedOptions()
.pluralCategories.sort(function (t, e) {
return B[t] - B[e];
})
.map(function (t) {
return "".concat(i.options.prepend).concat(t);
})
: t.numbers.map(function (t) {
return i.getSuffix(e, t, n);
})
: [];
},
},
{
key: "getSuffix",
value: function (t, e) {
var i = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : {},
n = this.getRule(t, i);
return n ? (this.shouldUseIntlApi() ? "".concat(this.options.prepend).concat(n.select(e)) : this.getSuffixRetroCompatible(n, e)) : (this.logger.warn("no plural rule found for: ".concat(t)), "");
},
},
{
key: "getSuffixRetroCompatible",
value: function (t, e) {
var i = this,
n = t.noAbs ? t.plurals(e) : t.plurals(Math.abs(e)),
s = t.numbers[n];
this.options.simplifyPluralSuffix && 2 === t.numbers.length && 1 === t.numbers[0] && (2 === s ? (s = "plural") : 1 === s && (s = ""));
var r = function () {
return i.options.prepend && s.toString() ? i.options.prepend + s.toString() : s.toString();
};
return "v1" === this.options.compatibilityJSON
? 1 === s
? ""
: "number" == typeof s
? "_plural_".concat(s.toString())
: r()
: "v2" === this.options.compatibilityJSON
? r()
: this.options.simplifyPluralSuffix && 2 === t.numbers.length && 1 === t.numbers[0]
? r()
: this.options.prepend && n.toString()
? this.options.prepend + n.toString()
: n.toString();
},
},
{
key: "shouldUseIntlApi",
value: function () {
return !t.includes(this.options.compatibilityJSON);
},
},
]),
n
);
})();
function z(e, t) {
var i = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var n = Object.getOwnPropertySymbols(e);
t &&
(n = n.filter(function (t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable;
})),
i.push.apply(i, n);
}
return i;
}
function X(e) {
for (var t = 1; t < arguments.length; t++) {
var i = null != arguments[t] ? arguments[t] : {};
t % 2
? z(Object(i), !0).forEach(function (t) {
s(e, t, i[t]);
})
: Object.getOwnPropertyDescriptors
? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i))
: z(Object(i)).forEach(function (t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(i, t));
});
}
return e;
}
var V = (function () {
function e() {
var t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {};
a(this, e),
(this.logger = f.create("interpolator")),
(this.options = t),
(this.format =
(t.interpolation && t.interpolation.format) ||
function (t) {
return t;
}),
this.init(t);
}
return (
h(e, [
{
key: "init",
value: function () {
var t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {};
t.interpolation || (t.interpolation = { escapeValue: !0 });
var e = t.interpolation;
(this.escape = void 0 !== e.escape ? e.escape : S),
(this.escapeValue = void 0 === e.escapeValue || e.escapeValue),
(this.useRawValueToEscape = void 0 !== e.useRawValueToEscape && e.useRawValueToEscape),
(this.prefix = e.prefix ? w(e.prefix) : e.prefixEscaped || "{{"),
(this.suffix = e.suffix ? w(e.suffix) : e.suffixEscaped || "}}"),
(this.formatSeparator = e.formatSeparator ? e.formatSeparator : e.formatSeparator || ","),
(this.unescapePrefix = e.unescapeSuffix ? "" : e.unescapePrefix || "-"),
(this.unescapeSuffix = this.unescapePrefix ? "" : e.unescapeSuffix || ""),
(this.nestingPrefix = e.nestingPrefix ? w(e.nestingPrefix) : e.nestingPrefixEscaped || w("$t(")),
(this.nestingSuffix = e.nestingSuffix ? w(e.nestingSuffix) : e.nestingSuffixEscaped || w(")")),
(this.nestingOptionsSeparator = e.nestingOptionsSeparator ? e.nestingOptionsSeparator : e.nestingOptionsSeparator || ","),
(this.maxReplaces = e.maxReplaces ? e.maxReplaces : 1e3),
(this.alwaysFormat = void 0 !== e.alwaysFormat && e.alwaysFormat),
this.resetRegExp();
},
},
{
key: "reset",
value: function () {
this.options && this.init(this.options);
},
},
{
key: "resetRegExp",
value: function () {
var t = "".concat(this.prefix, "(.+?)").concat(this.suffix);
this.regexp = new RegExp(t, "g");
var e = "".concat(this.prefix).concat(this.unescapePrefix, "(.+?)").concat(this.unescapeSuffix).concat(this.suffix);
this.regexpUnescape = new RegExp(e, "g");
var i = "".concat(this.nestingPrefix, "(.+?)").concat(this.nestingSuffix);
this.nestingRegexp = new RegExp(i, "g");
},
},
{
key: "interpolate",
value: function (s, r, o, a) {
var h,
l,
u,
c = this,
d = (this.options && this.options.interpolation && this.options.interpolation.defaultVariables) || {};
function e(t) {
return t.replace(/\$/g, "$$$$");
}
var f = function (t) {
if (t.indexOf(c.formatSeparator) < 0) {
var e = b(r, d, t);
return c.alwaysFormat ? c.format(e, void 0, o, X(X(X({}, a), r), {}, { interpolationkey: t })) : e;
}
var i = t.split(c.formatSeparator),
n = i.shift().trim(),
s = i.join(c.formatSeparator).trim();
return c.format(b(r, d, n), s, o, X(X(X({}, a), r), {}, { interpolationkey: n }));
};
this.resetRegExp();
var p = (a && a.missingInterpolationHandler) || this.options.missingInterpolationHandler,
g = a && a.interpolation && void 0 !== a.interpolation.skipOnVariables ? a.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
return (
[
{
regex: this.regexpUnescape,
safeValue: function (t) {
return e(t);
},
},
{
regex: this.regexp,
safeValue: function (t) {
return c.escapeValue ? e(c.escape(t)) : e(t);
},
},
].forEach(function (t) {
for (u = 0; (h = t.regex.exec(s)); ) {
var e = h[1].trim();
if (void 0 === (l = f(e)))
if ("function" == typeof p) {
var i = p(s, h, a);
l = "string" == typeof i ? i : "";
} else if (a && a.hasOwnProperty(e)) l = "";
else {
if (g) {
l = h[0];
continue;
}
c.logger.warn("missed to pass in variable ".concat(e, " for interpolating ").concat(s)), (l = "");
}
else "string" == typeof l || c.useRawValueToEscape || (l = v(l));
var n = t.safeValue(l);
if (((s = s.replace(h[0], n)), g ? ((t.regex.lastIndex += n.length), (t.regex.lastIndex -= h[0].length)) : (t.regex.lastIndex = 0), ++u >= c.maxReplaces)) break;
}
}),
s
);
},
},
{
key: "nest",
value: function (t, e) {
var i,
n,
s = this,
r = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : {},
o = X({}, r);
function a(t, e) {
var i = this.nestingOptionsSeparator;
if (t.indexOf(i) < 0) return t;
var n = t.split(new RegExp("".concat(i, "[ ]*{"))),
s = "{".concat(n[1]);
(t = n[0]), (s = (s = this.interpolate(s, o)).replace(/'/g, '"'));
try {
(o = JSON.parse(s)), e && (o = X(X({}, e), o));
} catch (e) {
return this.logger.warn("failed parsing options string in nesting for key ".concat(t), e), "".concat(t).concat(i).concat(s);
}
return delete o.defaultValue, t;
}
for (o.applyPostProcessor = !1, delete o.defaultValue; (i = this.nestingRegexp.exec(t)); ) {
var h = [],
l = !1;
if (-1 !== i[0].indexOf(this.formatSeparator) && !/{.*}/.test(i[1])) {
var u = i[1].split(this.formatSeparator).map(function (t) {
return t.trim();
});
(i[1] = u.shift()), (h = u), (l = !0);
}
if ((n = e(a.call(this, i[1].trim(), o), o)) && i[0] === t && "string" != typeof n) return n;
"string" != typeof n && (n = v(n)),
n || (this.logger.warn("missed to resolve ".concat(i[1], " for nesting ").concat(t)), (n = "")),
l &&
(n = h.reduce(function (t, e) {
return s.format(t, e, r.lng, X(X({}, r), {}, { interpolationkey: i[1].trim() }));
}, n.trim())),
(t = t.replace(i[0], n)),
(this.regexp.lastIndex = 0);
}
return t;
},
},
]),
e
);
})();
function G(t, e) {
(null == e || e > t.length) && (e = t.length);
for (var i = 0, n = new Array(e); i < e; i++) n[i] = t[i];
return n;
}
function j(e, t) {
var i = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var n = Object.getOwnPropertySymbols(e);
t &&
(n = n.filter(function (t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable;
})),
i.push.apply(i, n);
}
return i;
}
function H(e) {
for (var t = 1; t < arguments.length; t++) {
var i = null != arguments[t] ? arguments[t] : {};
t % 2
? j(Object(i), !0).forEach(function (t) {
s(e, t, i[t]);
})
: Object.getOwnPropertyDescriptors
? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i))
: j(Object(i)).forEach(function (t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(i, t));
});
}
return e;
}
var W = (function () {
function e() {
var t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {};
a(this, e),
(this.logger = f.create("formatter")),
(this.options = t),
(this.formats = {
number: function (t, e, i) {
return new Intl.NumberFormat(e, i).format(t);
},
currency: function (t, e, i) {
return new Intl.NumberFormat(e, H(H({}, i), {}, { style: "currency" })).format(t);
},
datetime: function (t, e, i) {
return new Intl.DateTimeFormat(e, H({}, i)).format(t);
},
relativetime: function (t, e, i) {
return new Intl.RelativeTimeFormat(e, H({}, i)).format(t, i.range || "day");
},
list: function (t, e, i) {
return new Intl.ListFormat(e, H({}, i)).format(t);
},
}),
this.init(t);
}
return (
h(e, [
{
key: "init",
value: function (t) {
var e = (1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : { interpolation: {} }).interpolation;
this.formatSeparator = e.formatSeparator ? e.formatSeparator : e.formatSeparator || ",";
},
},
{
key: "add",
value: function (t, e) {
this.formats[t.toLowerCase().trim()] = e;
},
},
{
key: "format",
value: function (t, e, h, l) {
var u = this;
return e.split(this.formatSeparator).reduce(function (t, e) {
var i = (function (t) {
var e = t.toLowerCase().trim(),
r = {};
if (-1 < t.indexOf("(")) {
var i = t.split("(");
e = i[0].toLowerCase().trim();
var n = i[1].substring(0, i[1].length - 1);
"currency" === e && n.indexOf(":") < 0
? r.currency || (r.currency = n.trim())
: "relativetime" === e && n.indexOf(":") < 0
? r.range || (r.range = n.trim())
: n.split(";").forEach(function (t) {
if (t) {
var e =
(function (t) {
if (Array.isArray(t)) return t;
})((s = t.split(":"))) ||
(function (t) {
if ("undefined" != typeof Symbol && Symbol.iterator in Object(t)) return Array.from(t);
})(s) ||
(function (t, e) {
if (t) {
if ("string" == typeof t) return G(t, void 0);
var i = Object.prototype.toString.call(t).slice(8, -1);
return (
"Object" === i && t.constructor && (i = t.constructor.name),
"Map" === i || "Set" === i ? Array.from(t) : "Arguments" === i || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i) ? G(t, void 0) : void 0
);
}
})(s) ||
(function () {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
})(),
i = e[0],
n = e.slice(1).join(":");
"false" === n.trim() && (r[i.trim()] = !1),
"true" === n.trim() && (r[i.trim()] = !0),
isNaN(n.trim()) || (r[i.trim()] = parseInt(n.trim(), 10)),
r[i.trim()] || (r[i.trim()] = n.trim());
}
var s;
});
}
return { formatName: e, formatOptions: r };
})(e),
n = i.formatName,
s = i.formatOptions;
if (u.formats[n]) {
var r = t;
try {
var o = (l && l.formatParams && l.formatParams[l.interpolationkey]) || {},
a = o.locale || o.lng || l.locale || l.lng || h;
r = u.formats[n](t, a, H(H(H({}, s), l), o));
} catch (t) {
u.logger.warn(t);
}
return r;
}
return u.logger.warn("there was no format function for ".concat(n)), t;
}, t);
},
},
]),
e
);
})();
function K(e, t) {
var i = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var n = Object.getOwnPropertySymbols(e);
t &&
(n = n.filter(function (t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable;
})),
i.push.apply(i, n);
}
return i;
}
function q(e) {
for (var t = 1; t < arguments.length; t++) {
var i = null != arguments[t] ? arguments[t] : {};
t % 2
? K(Object(i), !0).forEach(function (t) {
s(e, t, i[t]);
})
: Object.getOwnPropertyDescriptors
? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i))
: K(Object(i)).forEach(function (t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(i, t));
});
}
return e;
}
var Z = (function (t) {
e(o, p);
var n,
s,
r =
((n = o),
(s = (function () {
if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
if (Reflect.construct.sham) return !1;
if ("function" == typeof Proxy) return !0;
try {
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), !0;
} catch (t) {
return !1;
}
})()),
function () {
var t,
e = c(n);
if (s) {
var i = c(this).constructor;
t = Reflect.construct(e, arguments, i);
} else t = e.apply(this, arguments);
return u(this, t);
});
function o(t, e, i) {
var n,
s = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : {};
return (
a(this, o),
(n = r.call(this)),
_ && p.call(l(n)),
(n.backend = t),
(n.store = e),
(n.services = i),
(n.languageUtils = i.languageUtils),
(n.options = s),
(n.logger = f.create("backendConnector")),
(n.state = {}),
(n.queue = []),
n.backend && n.backend.init && n.backend.init(i, s.backend, s),
n
);
}
return (
h(o, [
{
key: "queueLoad",
value: function (t, e, s, i) {
var r = this,
o = [],
a = [],
h = [],
l = [];
return (
t.forEach(function (i) {
var n = !0;
e.forEach(function (t) {
var e = "".concat(i, "|").concat(t);
!s.reload && r.store.hasResourceBundle(i, t)
? (r.state[e] = 2)
: r.state[e] < 0 || (1 === r.state[e] ? a.indexOf(e) < 0 && a.push(e) : ((r.state[e] = 1), (n = !1), a.indexOf(e) < 0 && a.push(e), o.indexOf(e) < 0 && o.push(e), l.indexOf(t) < 0 && l.push(t)));
}),
n || h.push(i);
}),
(o.length || a.length) && this.queue.push({ pending: a, loaded: {}, errors: [], callback: i }),
{ toLoad: o, pending: a, toLoadLanguages: h, toLoadNamespaces: l }
);
},
},
{
key: "loaded",
value: function (o, a, t) {
var e = o.split("|"),
h = e[0],
l = e[1];
a && this.emit("failedLoading", h, l, a), t && this.store.addResourceBundle(h, l, t), (this.state[o] = a ? -1 : 2);
var u = {};
this.queue.forEach(function (t) {
var e, i, n, s, r;
(e = t.loaded),
(i = l),
((s = (n = y(e, [h], Object)).obj)[(r = n.k)] = s[r] || []),
s[r].push(i),
(function (t, e) {
for (var i = t.indexOf(e); -1 !== i; ) t.splice(i, 1), (i = t.indexOf(e));
})(t.pending, o),
a && t.errors.push(a),
0 !== t.pending.length ||
t.done ||
(Object.keys(t.loaded).forEach(function (e) {
u[e] || (u[e] = []),
t.loaded[e].length &&
t.loaded[e].forEach(function (t) {
u[e].indexOf(t) < 0 && u[e].push(t);
});
}),
(t.done = !0),
t.errors.length ? t.callback(t.errors) : t.callback());
}),
this.emit("loaded", u),
(this.queue = this.queue.filter(function (t) {
return !t.done;
}));
},
},
{
key: "read",
value: function (i, n, s) {
var r = this,
o = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : 0,
a = 4 < arguments.length && void 0 !== arguments[4] ? arguments[4] : 350,
h = 5 < arguments.length ? arguments[5] : void 0;
return i.length
? this.backend[s](i, n, function (t, e) {
t && e && o < 5
? setTimeout(function () {
r.read.call(r, i, n, s, o + 1, 2 * a, h);
}, a)
: h(t, e);
})
: h(null, {});
},
},
{
key: "prepareLoading",
value: function (t, e) {
var i = this,
n = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : {},
s = 3 < arguments.length ? arguments[3] : void 0;
if (!this.backend) return this.logger.warn("No backend was added via i18next.use. Will not load resources."), s && s();
"string" == typeof t && (t = this.languageUtils.toResolveHierarchy(t)), "string" == typeof e && (e = [e]);
var r = this.queueLoad(t, e, n, s);
if (!r.toLoad.length) return r.pending.length || s(), null;
r.toLoad.forEach(function (t) {
i.loadOne(t);
});
},
},
{
key: "load",
value: function (t, e, i) {
this.prepareLoading(t, e, {}, i);
},
},
{
key: "reload",
value: function (t, e, i) {
this.prepareLoading(t, e, { reload: !0 }, i);
},
},
{
key: "loadOne",
value: function (i) {
var n = this,
s = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : "",
t = i.split("|"),
r = t[0],
o = t[1];
this.read(r, o, "read", void 0, void 0, function (t, e) {
t && n.logger.warn("".concat(s, "loading namespace ").concat(o, " for language ").concat(r, " failed"), t),
!t && e && n.logger.log("".concat(s, "loaded namespace ").concat(o, " for language ").concat(r), e),
n.loaded(i, t, e);
});
},
},
{
key: "saveMissing",
value: function (t, e, i, n, s) {
var r = 5 < arguments.length && void 0 !== arguments[5] ? arguments[5] : {};
this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(e)
? this.logger.warn(
'did not save key "'.concat(i, '" as the namespace "').concat(e, '" was not yet loaded'),
"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"
)
: null != i && "" !== i && (this.backend && this.backend.create && this.backend.create(t, e, i, n, null, q(q({}, r), {}, { isUpdate: s })), t && t[0] && this.store.addResource(t[0], e, i, n));
},
},
]),
o
);
})();
function J(t) {
return (
"string" == typeof t.ns && (t.ns = [t.ns]),
"string" == typeof t.fallbackLng && (t.fallbackLng = [t.fallbackLng]),
"string" == typeof t.fallbackNS && (t.fallbackNS = [t.fallbackNS]),
t.supportedLngs && t.supportedLngs.indexOf("cimode") < 0 && (t.supportedLngs = t.supportedLngs.concat(["cimode"])),
t
);
}
function Q(e, t) {
var i = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var n = Object.getOwnPropertySymbols(e);
t &&
(n = n.filter(function (t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable;
})),
i.push.apply(i, n);
}
return i;
}
function $(e) {
for (var t = 1; t < arguments.length; t++) {
var i = null != arguments[t] ? arguments[t] : {};
t % 2
? Q(Object(i), !0).forEach(function (t) {
s(e, t, i[t]);
})
: Object.getOwnPropertyDescriptors
? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i))
: Q(Object(i)).forEach(function (t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(i, t));
});
}
return e;
}
function tt() {}
var et = (function (t) {
e(o, p);
var n,
s,
r =
((n = o),
(s = (function () {
if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
if (Reflect.construct.sham) return !1;
if ("function" == typeof Proxy) return !0;
try {
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), !0;
} catch (t) {
return !1;
}
})()),
function () {
var t,
e = c(n);
if (s) {
var i = c(this).constructor;
t = Reflect.construct(e, arguments, i);
} else t = e.apply(this, arguments);
return u(this, t);
});
function o() {
var t,
e,
i = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {},
n = 1 < arguments.length ? arguments[1] : void 0;
if (
(a(this, o),
(t = r.call(this)),
_ && p.call(l(t)),
(t.options = J(i)),
(t.services = {}),
(t.logger = f),
(t.modules = { external: [] }),
(e = l(t)),
Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(function (t) {
"function" == typeof e[t] && (e[t] = e[t].bind(e));
}),
n && !t.isInitialized && !i.isClone)
) {
if (!t.options.initImmediate) return t.init(i, n), u(t, l(t));
setTimeout(function () {
t.init(i, n);
}, 0);
}
return t;
}
return (
h(o, [
{
key: "init",
value: function () {
var s = this,
t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {},
i = 1 < arguments.length ? arguments[1] : void 0;
"function" == typeof t && ((i = t), (t = {})), !t.defaultNS && t.ns && ("string" == typeof t.ns ? (t.defaultNS = t.ns) : t.ns.indexOf("translation") < 0 && (t.defaultNS = t.ns[0]));
var e = {
debug: !1,
initImmediate: !0,
ns: ["translation"],
defaultNS: ["translation"],
fallbackLng: ["dev"],
fallbackNS: !1,
supportedLngs: !1,
nonExplicitSupportedLngs: !1,
load: "all",
preload: !1,
simplifyPluralSuffix: !0,
keySeparator: ".",
nsSeparator: ":",
pluralSeparator: "_",
contextSeparator: "_",
partialBundledLanguages: !1,
saveMissing: !1,
updateMissing: !1,
saveMissingTo: "fallback",
saveMissingPlurals: !0,
missingKeyHandler: !1,
missingInterpolationHandler: !1,
postProcess: !1,
postProcessPassResolved: !1,
returnNull: !0,
returnEmptyString: !0,
returnObjects: !1,
joinArrays: !1,
returnedObjectHandler: !1,
parseMissingKeyHandler: !1,
appendNamespaceToMissingKey: !1,
appendNamespaceToCIMode: !1,
overloadTranslationOptionHandler: function (t) {
var e = {};
if (("object" === N(t[1]) && (e = t[1]), "string" == typeof t[1] && (e.defaultValue = t[1]), "string" == typeof t[2] && (e.tDescription = t[2]), "object" === N(t[2]) || "object" === N(t[3]))) {
var i = t[3] || t[2];
Object.keys(i).forEach(function (t) {
e[t] = i[t];
});
}
return e;
},
interpolation: {
escapeValue: !0,
format: function (t, e, i, n) {
return t;
},
prefix: "{{",
suffix: "}}",
formatSeparator: ",",
unescapePrefix: "-",
nestingPrefix: "$t(",
nestingSuffix: ")",
nestingOptionsSeparator: ",",
maxReplaces: 1e3,
skipOnVariables: !0,
},
};
function n(t) {
return t ? ("function" == typeof t ? new t() : t) : null;
}
if (
((this.options = $($($({}, e), this.options), J(t))),
"v1" !== this.options.compatibilityAPI && (this.options.interpolation = $($({}, e.interpolation), this.options.interpolation)),
void 0 !== t.keySeparator && (this.options.userDefinedKeySeparator = t.keySeparator),
void 0 !== t.nsSeparator && (this.options.userDefinedNsSeparator = t.nsSeparator),
!this.options.isClone)
) {
var r;
this.modules.logger ? f.init(n(this.modules.logger), this.options) : f.init(null, this.options), this.modules.formatter ? (r = this.modules.formatter) : "undefined" != typeof Intl && (r = W);
var o = new I(this.options);
this.store = new M(this.options.resources, this.options);
var a = this.services;
(a.logger = f),
(a.resourceStore = this.store),
(a.languageUtils = o),
(a.pluralResolver = new Y(o, { prepend: this.options.pluralSeparator, compatibilityJSON: this.options.compatibilityJSON, simplifyPluralSuffix: this.options.simplifyPluralSuffix })),
!r ||
(this.options.interpolation.format && this.options.interpolation.format !== e.interpolation.format) ||
((a.formatter = n(r)), a.formatter.init(a, this.options), (this.options.interpolation.format = a.formatter.format.bind(a.formatter))),
(a.interpolator = new V(this.options)),
(a.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }),
(a.backendConnector = new Z(n(this.modules.backend), a.resourceStore, a, this.options)),
a.backendConnector.on("*", function (t) {
for (var e = arguments.length, i = new Array(1 < e ? e - 1 : 0), n = 1; n < e; n++) i[n - 1] = arguments[n];
s.emit.apply(s, [t].concat(i));
}),
this.modules.languageDetector && ((a.languageDetector = n(this.modules.languageDetector)), a.languageDetector.init(a, this.options.detection, this.options)),
this.modules.i18nFormat && ((a.i18nFormat = n(this.modules.i18nFormat)), a.i18nFormat.init && a.i18nFormat.init(this)),
(this.translator = new R(this.services, this.options)),
this.translator.on("*", function (t) {
for (var e = arguments.length, i = new Array(1 < e ? e - 1 : 0), n = 1; n < e; n++) i[n - 1] = arguments[n];
s.emit.apply(s, [t].concat(i));
}),
this.modules.external.forEach(function (t) {
t.init && t.init(s);
});
}
if (((this.format = this.options.interpolation.format), i || (i = tt), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng)) {
var h = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
0 < h.length && "dev" !== h[0] && (this.options.lng = h[0]);
}
this.services.languageDetector || this.options.lng || this.logger.warn("init: no languageDetector is used and no lng is defined"),
["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach(function (e) {
s[e] = function () {
var t;
return (t = s.store)[e].apply(t, arguments);
};
}),
["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach(function (e) {
s[e] = function () {
var t;
return (t = s.store)[e].apply(t, arguments), s;
};
});
var l = g(),
u = function () {
var t = function (t, e) {
s.isInitialized && !s.initializedStoreOnce && s.logger.warn("init: i18next is already initialized. You should call init just once!"),
(s.isInitialized = !0),
s.options.isClone || s.logger.log("initialized", s.options),
s.emit("initialized", s.options),
l.resolve(e),
i(t, e);
};
if (s.languages && "v1" !== s.options.compatibilityAPI && !s.isInitialized) return t(null, s.t.bind(s));
s.changeLanguage(s.options.lng, t);
};
return this.options.resources || !this.options.initImmediate ? u() : setTimeout(u, 0), l;
},
},
{
key: "loadResources",
value: function (t) {
var e = this,
i = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : tt,
n = "string" == typeof t ? t : this.language;
if (("function" == typeof t && (i = t), !this.options.resources || this.options.partialBundledLanguages)) {
if (n && "cimode" === n.toLowerCase()) return i();
var s = [],
r = function (t) {
t &&
e.services.languageUtils.toResolveHierarchy(t).forEach(function (t) {
s.indexOf(t) < 0 && s.push(t);
});
};
n
? r(n)
: this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(function (t) {
return r(t);
}),
this.options.preload &&
this.options.preload.forEach(function (t) {
return r(t);
}),
this.services.backendConnector.load(s, this.options.ns, i);
} else i(null);
},
},
{
key: "reloadResources",
value: function (t, e, i) {
var n = g();
return (
t || (t = this.languages),
e || (e = this.options.ns),
i || (i = tt),
this.services.backendConnector.reload(t, e, function (t) {
n.resolve(), i(t);
}),
n
);
},
},
{
key: "use",
value: function (t) {
if (!t) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
if (!t.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
return (
"backend" === t.type && (this.modules.backend = t),
("logger" === t.type || (t.log && t.warn && t.error)) && (this.modules.logger = t),
"languageDetector" === t.type && (this.modules.languageDetector = t),
"i18nFormat" === t.type && (this.modules.i18nFormat = t),
"postProcessor" === t.type && C.addPostProcessor(t),
"formatter" === t.type && (this.modules.formatter = t),
"3rdParty" === t.type && this.modules.external.push(t),
this
);
},
},
{
key: "changeLanguage",
value: function (e, s) {
var r = this;
this.isLanguageChangingTo = e;
var o = g();
this.emit("languageChanging", e);
var a = function (t) {
if (((r.language = t), (r.languages = r.services.languageUtils.toResolveHierarchy(t)), (r.resolvedLanguage = void 0), !(-1 < ["cimode", "dev"].indexOf(t))))
for (var e = 0; e < r.languages.length; e++) {
var i = r.languages[e];
if (!(-1 < ["cimode", "dev"].indexOf(i)) && r.store.hasLanguageSomeTranslations(i)) {
r.resolvedLanguage = i;
break;
}
}
},
t = function (t) {
e || t || !r.services.languageDetector || (t = []);
var n = "string" == typeof t ? t : r.services.languageUtils.getBestMatchFromCodes(t);
n && (r.language || a(n), r.translator.language || r.translator.changeLanguage(n), r.services.languageDetector && r.services.languageDetector.cacheUserLanguage(n)),
r.loadResources(n, function (t) {
var e, i;
(e = t),
(i = n) ? (a(i), r.translator.changeLanguage(i), (r.isLanguageChangingTo = void 0), r.emit("languageChanged", i), r.logger.log("languageChanged", i)) : (r.isLanguageChangingTo = void 0),
o.resolve(function () {
return r.t.apply(r, arguments);
}),
s &&
s(e, function () {
return r.t.apply(r, arguments);
});
});
};
return (
e || !this.services.languageDetector || this.services.languageDetector.async
? !e && this.services.languageDetector && this.services.languageDetector.async
? this.services.languageDetector.detect(t)
: t(e)
: t(this.services.languageDetector.detect()),
o
);
},
},
{
key: "getFixedT",
value: function (t, e, l) {
var u = this,
i = function t(e, i) {
var n;
if ("object" !== N(i)) {
for (var s = arguments.length, r = new Array(2 < s ? s - 2 : 0), o = 2; o < s; o++) r[o - 2] = arguments[o];
n = u.options.overloadTranslationOptionHandler([e, i].concat(r));
} else n = $({}, i);
(n.lng = n.lng || t.lng), (n.lngs = n.lngs || t.lngs), (n.ns = n.ns || t.ns);
var a = u.options.keySeparator || ".",
h = l ? "".concat(l).concat(a).concat(e) : e;
return u.t(h, n);
};
return "string" == typeof t ? (i.lng = t) : (i.lngs = t), (i.ns = e), (i.keyPrefix = l), i;
},
},
{
key: "t",
value: function () {
var t;
return this.translator && (t = this.translator).translate.apply(t, arguments);
},
},
{
key: "exists",
value: function () {
var t;
return this.translator && (t = this.translator).exists.apply(t, arguments);
},
},
{
key: "setDefaultNamespace",
value: function (t) {
this.options.defaultNS = t;
},
},
{
key: "hasLoadedNamespace",
value: function (t) {
var n = this,
e = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {};
if (!this.isInitialized) return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
if (!this.languages || !this.languages.length) return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
var i = this.resolvedLanguage || this.languages[0],
s = !!this.options && this.options.fallbackLng,
r = this.languages[this.languages.length - 1];
if ("cimode" === i.toLowerCase()) return !0;
var o = function (t, e) {
var i = n.services.backendConnector.state["".concat(t, "|").concat(e)];
return -1 === i || 2 === i;
};
if (e.precheck) {
var a = e.precheck(this, o);
if (void 0 !== a) return a;
}
return !!this.hasResourceBundle(i, t) || !this.services.backendConnector.backend || !(!o(i, t) || (s && !o(r, t)));
},
},
{
key: "loadNamespaces",
value: function (t, e) {
var i = this,
n = g();
return this.options.ns
? ("string" == typeof t && (t = [t]),
t.forEach(function (t) {
i.options.ns.indexOf(t) < 0 && i.options.ns.push(t);
}),
this.loadResources(function (t) {
n.resolve(), e && e(t);
}),
n)
: (e && e(), Promise.resolve());
},
},
{
key: "loadLanguages",
value: function (t, e) {
var i = g();
"string" == typeof t && (t = [t]);
var n = this.options.preload || [],
s = t.filter(function (t) {
return n.indexOf(t) < 0;
});
return s.length
? ((this.options.preload = n.concat(s)),
this.loadResources(function (t) {
i.resolve(), e && e(t);
}),
i)
: (e && e(), Promise.resolve());
},
},
{
key: "dir",
value: function (t) {
return (
t || (t = this.resolvedLanguage || (this.languages && 0 < this.languages.length ? this.languages[0] : this.language)),
t
? -1 <
[
"ar",
"shu",
"sqr",
"ssh",
"xaa",
"yhd",
"yud",
"aao",
"abh",
"abv",
"acm",
"acq",
"acw",
"acx",
"acy",
"adf",
"ads",
"aeb",
"aec",
"afb",
"ajp",
"apc",
"apd",
"arb",
"arq",
"ars",
"ary",
"arz",
"auz",
"avl",
"ayh",
"ayl",
"ayn",
"ayp",
"bbz",
"pga",
"he",
"iw",
"ps",
"pbt",
"pbu",
"pst",
"prp",
"prd",
"ug",
"ur",
"ydd",
"yds",
"yih",
"ji",
"yi",
"hbo",
"men",
"xmn",
"fa",
"jpr",
"peo",
"pes",
"prs",
"dv",
"sam",
"ckb",
].indexOf(this.services.languageUtils.getLanguagePartFromCode(t)) || 1 < t.toLowerCase().indexOf("-arab")
? "rtl"
: "ltr"
: "rtl"
);
},
},
{
key: "cloneInstance",
value: function () {
var e = this,
t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {},
i = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : tt,
n = $($($({}, this.options), t), { isClone: !0 }),
s = new o(n);
return (
["store", "services", "language"].forEach(function (t) {
s[t] = e[t];
}),
(s.services = $({}, this.services)),
(s.services.utils = { hasLoadedNamespace: s.hasLoadedNamespace.bind(s) }),
(s.translator = new R(s.services, s.options)),
s.translator.on("*", function (t) {
for (var e = arguments.length, i = new Array(1 < e ? e - 1 : 0), n = 1; n < e; n++) i[n - 1] = arguments[n];
s.emit.apply(s, [t].concat(i));
}),
s.init(n, i),
(s.translator.options = s.options),
(s.translator.backendConnector.services.utils = { hasLoadedNamespace: s.hasLoadedNamespace.bind(s) }),
s
);
},
},
{
key: "toJSON",
value: function () {
return { options: this.options, store: this.store, language: this.language, languages: this.languages, resolvedLanguage: this.resolvedLanguage };
},
},
]),
o
);
})();
s(et, "createInstance", function () {
var t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {},
e = 1 < arguments.length ? arguments[1] : void 0;
return new et(t, e);
});
var it = et.createInstance();
return (it.createInstance = et.createInstance), it;
}),
(function (t, e) {
"object" == typeof exports && "undefined" != typeof module
? (module.exports = e())
: "function" == typeof define && define.amd
? define(e)
: ((t = "undefined" != typeof globalThis ? globalThis : t || self).i18nextBrowserLanguageDetector = e());
})(this, function () {
"use strict";
function s(t, e) {
for (var i = 0; i < e.length; i++) {
var n = e[i];
(n.enumerable = n.enumerable || !1), (n.configurable = !0), "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n);
}
}
var t = [],
r = t.forEach,
o = t.slice;
var a = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,
i = function (t, e, i, n) {
var s = 4 < arguments.length && void 0 !== arguments[4] ? arguments[4] : { path: "/", sameSite: "strict" };
i && ((s.expires = new Date()), s.expires.setTime(s.expires.getTime() + 60 * i * 1e3)),
n && (s.domain = n),
(document.cookie = (function (t, e, i) {
var n = i || {};
n.path = n.path || "/";
var s = t + "=" + encodeURIComponent(e);
if (0 < n.maxAge) {
var r = n.maxAge - 0;
if (isNaN(r)) throw new Error("maxAge should be a Number");
s += "; Max-Age=" + Math.floor(r);
}
if (n.domain) {
if (!a.test(n.domain)) throw new TypeError("option domain is invalid");
s += "; Domain=" + n.domain;
}
if (n.path) {
if (!a.test(n.path)) throw new TypeError("option path is invalid");
s += "; Path=" + n.path;
}
if (n.expires) {
if ("function" != typeof n.expires.toUTCString) throw new TypeError("option expires is invalid");
s += "; Expires=" + n.expires.toUTCString();
}
if ((n.httpOnly && (s += "; HttpOnly"), n.secure && (s += "; Secure"), n.sameSite))
switch ("string" == typeof n.sameSite ? n.sameSite.toLowerCase() : n.sameSite) {
case !0:
s += "; SameSite=Strict";
break;
case "lax":
s += "; SameSite=Lax";
break;
case "strict":
s += "; SameSite=Strict";
break;
case "none":
s += "; SameSite=None";
break;
default:
throw new TypeError("option sameSite is invalid");
}
return s;
})(t, encodeURIComponent(e), s));
},
n = function (t) {
for (var e = t + "=", i = document.cookie.split(";"), n = 0; n < i.length; n++) {
for (var s = i[n]; " " === s.charAt(0); ) s = s.substring(1, s.length);
if (0 === s.indexOf(e)) return s.substring(e.length, s.length);
}
return null;
},
h = {
name: "cookie",
lookup: function (t) {
var e;
if (t.lookupCookie && "undefined" != typeof document) {
var i = n(t.lookupCookie);
i && (e = i);
}
return e;
},
cacheUserLanguage: function (t, e) {
e.lookupCookie && "undefined" != typeof document && i(e.lookupCookie, t, e.cookieMinutes, e.cookieDomain, e.cookieOptions);
},
},
l = {
name: "querystring",
lookup: function (t) {
var e;
if ("undefined" != typeof window)
for (var i = window.location.search.substring(1).split("&"), n = 0; n < i.length; n++) {
var s = i[n].indexOf("=");
if (0 < s) i[n].substring(0, s) === t.lookupQuerystring && (e = i[n].substring(s + 1));
}
return e;
},
},
e = null,
u = function () {
if (null !== e) return e;
try {
e = "undefined" !== window && null !== window.localStorage;
var t = "i18next.translate.boo";
window.localStorage.setItem(t, "foo"), window.localStorage.removeItem(t);
} catch (t) {
e = !1;
}
return e;
},
c = {
name: "localStorage",
lookup: function (t) {
var e;
if (t.lookupLocalStorage && u()) {
var i = window.localStorage.getItem(t.lookupLocalStorage);
i && (e = i);
}
return e;
},
cacheUserLanguage: function (t, e) {
e.lookupLocalStorage && u() && window.localStorage.setItem(e.lookupLocalStorage, t);
},
},
d = null,
f = function () {
if (null !== d) return d;
try {
d = "undefined" !== window && null !== window.sessionStorage;
var t = "i18next.translate.boo";
window.sessionStorage.setItem(t, "foo"), window.sessionStorage.removeItem(t);
} catch (t) {
d = !1;
}
return d;
},
p = {
name: "sessionStorage",
lookup: function (t) {
var e;
if (t.lookupSessionStorage && f()) {
var i = window.sessionStorage.getItem(t.lookupSessionStorage);
i && (e = i);
}
return e;
},
cacheUserLanguage: function (t, e) {
e.lookupSessionStorage && f() && window.sessionStorage.setItem(e.lookupSessionStorage, t);
},
},
g = {
name: "navigator",
lookup: function (t) {
var e = [];
if ("undefined" != typeof navigator) {
if (navigator.languages) for (var i = 0; i < navigator.languages.length; i++) e.push(navigator.languages[i]);
navigator.userLanguage && e.push(navigator.userLanguage), navigator.language && e.push(navigator.language);
}
return 0 < e.length ? e : void 0;
},
},
v = {
name: "htmlTag",
lookup: function (t) {
var e,
i = t.htmlTag || ("undefined" != typeof document ? document.documentElement : null);
return i && "function" == typeof i.getAttribute && (e = i.getAttribute("lang")), e;
},
},
y = {
name: "path",
lookup: function (t) {
var e;
if ("undefined" != typeof window) {
var i = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
if (i instanceof Array)
if ("number" == typeof t.lookupFromPathIndex) {
if ("string" != typeof i[t.lookupFromPathIndex]) return;
e = i[t.lookupFromPathIndex].replace("/", "");
} else e = i[0].replace("/", "");
}
return e;
},
},
m = {
name: "subdomain",
lookup: function (t) {
var e;
if ("undefined" != typeof window) {
var i = window.location.href.match(/(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/gi);
i instanceof Array &&
(e =
"number" == typeof t.lookupFromSubdomainIndex
? i[t.lookupFromSubdomainIndex].replace("http://", "").replace("https://", "").replace(".", "")
: i[0].replace("http://", "").replace("https://", "").replace(".", ""));
}
return e;
},
};
var x = (function () {
function i(t) {
var e = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {};
!(function (t, e) {
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
})(this, i),
(this.type = "languageDetector"),
(this.detectors = {}),
this.init(t, e);
}
var t, e, n;
return (
(t = i),
(e = [
{
key: "init",
value: function (t) {
var e = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {},
i = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : {};
(this.services = t),
(this.options = (function (i) {
return (
r.call(o.call(arguments, 1), function (t) {
if (t) for (var e in t) void 0 === i[e] && (i[e] = t[e]);
}),
i
);
})(e, this.options || {}, {
order: ["querystring", "cookie", "localStorage", "sessionStorage", "navigator", "htmlTag"],
lookupQuerystring: "lng",
lookupCookie: "i18next",
lookupLocalStorage: "i18nextLng",
lookupSessionStorage: "i18nextLng",
caches: ["localStorage"],
excludeCacheFor: ["cimode"],
})),
this.options.lookupFromUrlIndex && (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex),
(this.i18nOptions = i),
this.addDetector(h),
this.addDetector(l),
this.addDetector(c),
this.addDetector(p),
this.addDetector(g),
this.addDetector(v),
this.addDetector(y),
this.addDetector(m);
},
},
{
key: "addDetector",
value: function (t) {
this.detectors[t.name] = t;
},
},
{
key: "detect",
value: function (t) {
var i = this;
t || (t = this.options.order);
var n = [];
return (
t.forEach(function (t) {
if (i.detectors[t]) {
var e = i.detectors[t].lookup(i.options);
e && "string" == typeof e && (e = [e]), e && (n = n.concat(e));
}
}),
this.services.languageUtils.getBestMatchFromCodes ? n : 0 < n.length ? n[0] : null
);
},
},
{
key: "cacheUserLanguage",
value: function (e, t) {
var i = this;
t || (t = this.options.caches),
t &&
((this.options.excludeCacheFor && -1 < this.options.excludeCacheFor.indexOf(e)) ||
t.forEach(function (t) {
i.detectors[t] && i.detectors[t].cacheUserLanguage(e, i.options);
}));
},
},
]) && s(t.prototype, e),
n && s(t, n),
Object.defineProperty(t, "prototype", { writable: !1 }),
i
);
})();
return (x.type = "languageDetector"), x;
}),
"function" == typeof define && define.amd ? define(x) : "object" == typeof exports ? (module.exports = x()) : (this.SAT = x()),
(function (t, e) {
"object" == typeof exports && "undefined" != typeof module
? (module.exports = e())
: "function" == typeof define && define.amd
? define(e)
: ((t = "undefined" != typeof globalThis ? globalThis : t || self).rexbbcodetextplugin = e());
})(this, function () {
"use strict";
function l(t) {
return (l =
"function" == typeof Symbol && "symbol" == typeof Symbol.iterator
? function (t) {
return typeof t;
}
: function (t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
})(t);
}
function d(t, e) {
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
}
function n(t, e) {
for (var i = 0; i < e.length; i++) {
var n = e[i];
(n.enumerable = n.enumerable || !1), (n.configurable = !0), "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n);
}
}
function s(t, e, i) {
return e && n(t.prototype, e), i && n(t, i), t;
}
function t(t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
(t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } })), e && i(t, e);
}
function o(t) {
return (o = Object.setPrototypeOf
? Object.getPrototypeOf
: function (t) {
return t.__proto__ || Object.getPrototypeOf(t);
})(t);
}
function i(t, e) {
return (i =
Object.setPrototypeOf ||
function (t, e) {
return (t.__proto__ = e), t;
})(t, e);
}
function f(t) {
if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return t;
}
function e(s) {
var r = (function () {
if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
if (Reflect.construct.sham) return !1;
if ("function" == typeof Proxy) return !0;
try {
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), !0;
} catch (t) {
return !1;
}
})();
return function () {
var t,
e,
i = o(s);
if (r) {
var n = o(this).constructor;
t = Reflect.construct(i, arguments, n);
} else t = i.apply(this, arguments);
return this, !(e = t) || ("object" != typeof e && "function" != typeof e) ? f(this) : e;
};
}
function r(t) {
var e = y.create(this),
i = e.getContext("2d");
t.syncFont(e, i);
var n = i.measureText(t.testString);
if (n.hasOwnProperty("actualBoundingBoxAscent") && n.hasOwnProperty("actualBoundingBoxDescent")) {
var s = n.actualBoundingBoxAscent,
r = n.actualBoundingBoxDescent,
o = { ascent: s, descent: r, fontSize: s + r };
return y.remove(e), o;
}
var a = Math.ceil(n.width * t.baselineX),
h = a,
l = 2 * h;
if (
((h = (h * t.baselineY) | 0),
(e.width = a),
(e.height = l),
(i.fillStyle = "#f00"),
i.fillRect(0, 0, a, l),
(i.font = t._font),
(i.textBaseline = "alphabetic"),
(i.fillStyle = "#000"),
i.fillText(t.testString, 0, h),
(o = { ascent: 0, descent: 0, fontSize: 0 }),
!i.getImageData(0, 0, a, l))
)
return (o.ascent = h), (o.descent = h + 6), (o.fontSize = o.ascent + o.descent), y.remove(e), o;
var u,
c,
d = i.getImageData(0, 0, a, l).data,
f = d.length,
p = 4 * a,
g = 0,
v = !1;
for (u = 0; u < h; u++) {
for (c = 0; c < p; c += 4)
if (255 !== d[g + c]) {
v = !0;
break;
}
if (v) break;
g += p;
}
for (o.ascent = h - u, g = f - p, v = !1, u = l; h < u; u--) {
for (c = 0; c < p; c += 4)
if (255 !== d[g + c]) {
v = !0;
break;
}
if (v) break;
g -= p;
}
return (o.descent = u - h), (o.fontSize = o.ascent + o.descent), y.remove(e), o;
}
function a(t, e, i) {
if (null == t) return t;
switch (l(t)) {
case "string":
return t;
case "number":
return "#".concat(g(Math.floor(t).toString(16), 6, "0", 1));
case "function":
return t(e, i);
case "object":
return t.hasOwnProperty("r")
? t.hasOwnProperty("a")
? "rgba(".concat(t.r, ",").concat(t.g, ",").concat(t.b, ",").concat(t.a, ")")
: "rgb(".concat(t.r, ",").concat(t.g, ",").concat(t.b, ")")
: t.hasOwnProperty("h")
? t.hasOwnProperty("a")
? "hsla(".concat(t.h, ",").concat(t.s, ",").concat(t.l, ",").concat(t.a, ")")
: "hsl(".concat(t.h, ",").concat(t.s, ",").concat(t.l, ")")
: t;
default:
return t;
}
}
function T(t, e) {
var i = Array.isArray(t);
if (
(void 0 === e
? (e = i ? [] : {})
: (function (t) {
if (Array.isArray(t)) t.length = 0;
else for (var e in t) delete t[e];
})(e),
i)
) {
e.length = t.length;
for (var n = 0, s = t.length; n < s; n++) e[n] = t[n];
} else for (var r in t) e[r] = t[r];
return e;
}
function h() {}
function S(t, e, i, n, s) {
n <= 0 && (i = q);
var r = Q;
if (($.pushMultiple(r), !t || !t.length)) return r;
for (var o, a, h, l = t.split(J), u = 0, c = l.length; u < c; u++)
if (((o = l[u]), (h = u === c - 1 ? H : W), i !== q)) {
var d, f;
if (((a = 0 === u ? n - s : n), o.length <= 100 && (b = e(o)) <= a)) {
r.push($.newline(o, b, h));
continue;
}
for (var p, g = "", v = "", y = 0, m = 0, x = (d = i === Z ? o.split(" ") : o).length; m < x; m++)
(f = d[m]),
i === Z ? ((g += f), m < x - 1 && (g += " ")) : (g += f),
a < (p = e(g)) && (0 === m ? r.push($.newline("", 0, K)) : (r.push($.newline(v, y, K)), (g = f), i === Z && m < x - 1 && (g += " "), (p = e(g))), (a = n)),
(v = g),
(y = p);
r.push($.newline(v, y, h));
} else {
var b = e(o);
r.push($.newline(o, b, h));
}
return r;
}
var u = Phaser.Renderer.WebGL.Utils,
c = {
renderWebGL: function (t, e, i, n) {
if (0 !== e.width && 0 !== e.height) {
i.addToRenderList(e);
var s = e.frame,
r = s.width,
o = s.height,
a = u.getTintAppendFloatAlpha,
h = t.pipelines.set(e.pipeline, e),
l = h.setTexture2D(s.glTexture, e);
t.pipelines.preBatch(e),
h.batchTexture(
e,
s.glTexture,
r,
o,
e.x,
e.y,
r / e.style.resolution,
o / e.style.resolution,
e.scaleX,
e.scaleY,
e.rotation,
e.flipX,
e.flipY,
e.scrollFactorX,
e.scrollFactorY,
e.displayOriginX,
e.displayOriginY,
0,
0,
r,
o,
a(e.tintTopLeft, i.alpha * e._alphaTL),
a(e.tintTopRight, i.alpha * e._alphaTR),
a(e.tintBottomLeft, i.alpha * e._alphaBL),
a(e.tintBottomRight, i.alpha * e._alphaBR),
e.tintFill,
0,
0,
i,
n,
!1,
l
),
t.pipelines.postBatch(e);
}
},
renderCanvas: function (t, e, i, n) {
0 !== e.width && 0 !== e.height && (i.addToRenderList(e), t.batchSprite(e, e.frame, i, n));
},
},
y = Phaser.Display.Canvas.CanvasPool,
p = /(?:\r\n|\r|\n)/,
g = Phaser.Utils.String.Pad,
v = Phaser.Utils.Objects.GetAdvancedValue,
m = Phaser.Utils.Objects.GetValue,
x = {
backgroundColor: ["backgroundColor", null, a],
backgroundColor2: ["backgroundColor2", null, a],
backgroundHorizontalGradient: ["backgroundHorizontalGradient", !0, null],
backgroundStrokeColor: ["backgroundStrokeColor", null, a],
backgroundStrokeLineWidth: ["backgroundStrokeLineWidth", 2, null],
backgroundCornerRadius: ["backgroundCornerRadius", 0, null],
backgroundCornerIteration: ["backgroundCornerIteration", null, null],
fontFamily: ["fontFamily", "Courier", null],
fontSize: ["fontSize", "16px", null],
fontStyle: ["fontStyle", "", null],
color: ["color", "#fff", a],
stroke: ["stroke", "#fff", a],
strokeThickness: ["strokeThickness", 0, null],
shadowOffsetX: ["shadow.offsetX", 0, null],
shadowOffsetY: ["shadow.offsetY", 0, null],
shadowColor: ["shadow.color", "#000", a],
shadowBlur: ["shadow.blur", 0, null],
shadowStroke: ["shadow.stroke", !1, null],
shadowFill: ["shadow.fill", !1, null],
underlineColor: ["underline.color", "#000", a],
underlineThickness: ["underline.thickness", 0, null],
underlineOffset: ["underline.offset", 0, null],
halign: ["halign", "left", null],
valign: ["valign", "top", null],
maxLines: ["maxLines", 0, null],
fixedWidth: ["fixedWidth", 0, null],
fixedHeight: ["fixedHeight", 0, null],
resolution: ["resolution", 0, null],
lineSpacing: ["lineSpacing", 0, null],
rtl: ["rtl", !1, null],
testString: ["testString", "|MÉqgy", null],
baselineX: ["baselineX", 1.2, null],
baselineY: ["baselineY", 1.4, null],
wrapMode: ["wrap.mode", 0, null],
wrapWidth: ["wrap.width", 0, null],
},
b = (function () {
function n(t, e) {
d(this, n),
(this.parent = t),
this.backgroundColor,
this.backgroundColor2,
this.backgroundHorizontalGradient,
this.backgroundStrokeColor,
this.backgroundStrokeLineWidth,
this.backgroundCornerRadius,
this.backgroundCornerIteration,
this.fontFamily,
this.fontSize,
this.fontStyle,
this.color,
this.stroke,
this.strokeThickness,
this.shadowOffsetX,
this.shadowOffsetY,
this.shadowColor,
this.shadowBlur,
this.shadowStroke,
this.shadowFill,
this.underlineColor,
this.underlineThickness,
this.underlineOffset,
this.halign,
this.valign,
this.maxLines,
this.fixedWidth,
this.fixedHeight,
this.resolution,
this.lineSpacing,
this.rtl,
this.testString,
this.baselineX,
this.baselineY,
this._font,
this.setStyle(e, !1);
var i = m(e, "metrics", !1);
this.metrics = i ? { ascent: m(i, "ascent", 0), descent: m(i, "descent", 0), fontSize: m(i, "fontSize", 0) } : r(this);
}
return (
s(n, [
{
key: "canvas",
get: function () {
return this.parent.canvasText.canvas;
},
},
{
key: "context",
get: function () {
return this.parent.canvasText.context;
},
},
{
key: "isWrapFitMode",
get: function () {
return 0 < this.fixedWidth && 0 !== this.wrapMode && 0 === this.wrapWidth;
},
},
{
key: "setStyle",
value: function (t, e) {
if ((void 0 === e && (e = !0), t && t.hasOwnProperty("wrap"))) {
var i = t.wrap;
if (i.hasOwnProperty("mode")) {
var n = i.mode;
"string" == typeof n && (i.mode = w[n]);
} else i.hasOwnProperty("width") && (i.mode = 1);
}
for (var s in (t && t.hasOwnProperty("fontSize") && "number" == typeof t.fontSize && (t.fontSize = t.fontSize.toString() + "px"), x)) {
var r = x[s],
o = r[0],
a = r[1],
h = r[2],
l = v(t, o, a);
h && (l = h(l)), (this[s] = l);
}
var u = m(t, "font", null);
this._font = null === u ? this.fontStyle + " " + this.fontSize + " " + this.fontFamily : u;
var c = m(t, "fill", null);
return null !== c && (this.color = c), e ? this.update(!0) : this.parent;
},
},
{
key: "syncFont",
value: function (t, e) {
e.font = this._font;
},
},
{
key: "syncStyle",
value: function (t, e) {
(e.textBaseline = "alphabetic"), (e.fillStyle = this.color), (e.strokeStyle = this.stroke), (e.lineWidth = this.strokeThickness), (e.lineCap = "round"), (e.lineJoin = "round");
},
},
{
key: "syncShadow",
value: function (t, e) {
e
? ((t.shadowOffsetX = this.shadowOffsetX), (t.shadowOffsetY = this.shadowOffsetY), (t.shadowColor = this.shadowColor), (t.shadowBlur = this.shadowBlur))
: ((t.shadowOffsetX = 0), (t.shadowOffsetY = 0), (t.shadowColor = 0), (t.shadowBlur = 0));
},
},
{
key: "update",
value: function (t) {
return t && ((this._font = this.fontStyle + " " + this.fontSize + " " + this.fontFamily), (this.metrics = r(this))), this.parent.updateText(t);
},
},
{
key: "buildFont",
value: function () {
var t = this.fontStyle + " " + this.fontSize + " " + this.fontFamily;
return t !== this._font && (this._font = t), this;
},
},
{
key: "setFont",
value: function (t) {
return (
"string" == typeof t
? ((this.fontFamily = t), (this.fontSize = ""), (this.fontStyle = ""))
: ((this.fontFamily = m(t, "fontFamily", "Courier")), (this.fontSize = m(t, "fontSize", "16px")), (this.fontStyle = m(t, "fontStyle", ""))),
this.update(!0)
);
},
},
{
key: "setFontFamily",
value: function (t) {
return (this.fontFamily = t), this.update(!0);
},
},
{
key: "setFontStyle",
value: function (t) {
return (this.fontStyle = t), this.update(!0);
},
},
{
key: "setFontSize",
value: function (t) {
return "number" == typeof t && (t = t.toString() + "px"), (this.fontSize = t), this.update(!0);
},
},
{
key: "setTestString",
value: function (t) {
return (this.testString = t), this.update(!0);
},
},
{
key: "setFixedSize",
value: function (t, e) {
return (this.fixedWidth = t), (this.fixedHeight = e), t && (this.parent.width = t), e && (this.parent.height = e), this.update(this.isWrapFitMode);
},
},
{
key: "setResolution",
value: function (t) {
return (this.resolution = t), this.update(!1);
},
},
{
key: "setLineSpacing",
value: function (t) {
return (this.lineSpacing = t), this.update(!1);
},
},
{
key: "setBackgroundColor",
value: function (t, e, i) {
return void 0 === i && (i = !0), (this.backgroundColor = a(t, this.canvas, this.context)), (this.backgroundColor2 = a(e, this.canvas, this.context)), (this.backgroundHorizontalGradient = i), this.update(!1);
},
},
{
key: "setBackgroundStrokeColor",
value: function (t, e) {
return (this.backgroundStrokeColor = a(t, this.canvas, this.context)), (this.backgroundStrokeLineWidth = e), this.update(!1);
},
},
{
key: "setBackgroundCornerRadius",
value: function (t, e) {
return (this.backgroundCornerRadius = t), (this.backgroundCornerIteration = e), this.update(!1);
},
},
{
key: "setFill",
value: function (t) {
return (this.color = a(t, this.canvas, this.context)), this.update(!1);
},
},
{
key: "setColor",
value: function (t) {
return (this.color = a(t, this.canvas, this.context)), this.update(!1);
},
},
{
key: "setStroke",
value: function (t, e) {
return void 0 === t ? (this.strokeThickness = 0) : (void 0 === e && (e = this.strokeThickness), (this.stroke = a(t, this.canvas, this.context)), (this.strokeThickness = e)), this.update(!0);
},
},
{
key: "setShadow",
value: function (t, e, i, n, s, r) {
return (
void 0 === t && (t = 0),
void 0 === e && (e = 0),
void 0 === i && (i = "#000"),
void 0 === n && (n = 0),
void 0 === s && (s = !1),
void 0 === r && (r = !0),
(this.shadowOffsetX = t),
(this.shadowOffsetY = e),
(this.shadowColor = a(i, this.canvas, this.context)),
(this.shadowBlur = n),
(this.shadowStroke = s),
(this.shadowFill = r),
this.update(!1)
);
},
},
{
key: "setShadowOffset",
value: function (t, e) {
return void 0 === t && (t = 0), void 0 === e && (e = t), (this.shadowOffsetX = t), (this.shadowOffsetY = e), this.update(!1);
},
},
{
key: "setShadowColor",
value: function (t) {
return void 0 === t && (t = "#000"), (this.shadowColor = a(t, this.canvas, this.context)), this.update(!1);
},
},
{
key: "setShadowBlur",
value: function (t) {
return void 0 === t && (t = 0), (this.shadowBlur = t), this.update(!1);
},
},
{
key: "setShadowStroke",
value: function (t) {
return (this.shadowStroke = t), this.update(!1);
},
},
{
key: "setShadowFill",
value: function (t) {
return (this.shadowFill = t), this.update(!1);
},
},
{
key: "setUnderline",
value: function (t, e, i) {
return (
void 0 === t && (t = "#000"),
void 0 === e && (e = 0),
void 0 === i && (i = 0),
(this.underlineColor = a(t, this.canvas, this.context)),
(this.underlineThickness = e),
(this.underlineOffset = i),
this.update(!1)
);
},
},
{
key: "setUnderlineColor",
value: function (t) {
return void 0 === t && (t = "#000"), (this.underlineColor = a(t, this.canvas, this.context)), this.update(!1);
},
},
{
key: "setUnderlineThickness",
value: function (t) {
return void 0 === t && (t = 0), (this.underlineThickness = t), this.update(!1);
},
},
{
key: "setUnderlineOffset",
value: function (t) {
return void 0 === t && (t = 0), (this.underlineOffset = t), this.update(!1);
},
},
{
key: "setWrapMode",
value: function (t) {
return "string" == typeof t && (t = w[t.toLowerCase()] || 0), (this.wrapMode = t), this.update(!0);
},
},
{
key: "setWrapWidth",
value: function (t) {
return (this.wrapWidth = t), this.update(!1);
},
},
{
key: "setAlign",
value: function (t, e) {
return void 0 === t && (t = "left"), void 0 === e && (e = "top"), (this.halign = t), (this.valign = e), this.update(!1);
},
},
{
key: "setHAlign",
value: function (t) {
return void 0 === t && (t = "left"), (this.halign = t), this.update(!1);
},
},
{
key: "setVAlign",
value: function (t) {
return void 0 === t && (t = "top"), (this.valign = t), this.update(!1);
},
},
{
key: "setMaxLines",
value: function (t) {
return void 0 === t && (t = 0), (this.maxLines = t), this.update(!1);
},
},
{
key: "getTextMetrics",
value: function () {
var t = this.metrics;
return { ascent: t.ascent, descent: t.descent, fontSize: t.fontSize };
},
},
{
key: "lineHeight",
get: function () {
return this.metrics.fontSize + this.strokeThickness + this.lineSpacing;
},
},
{
key: "toJSON",
value: function () {
var t = {};
for (var e in x) t[e] = this[e];
return (t.metrics = this.getTextMetrics()), t;
},
},
{
key: "destroy",
value: function () {
this.parent = void 0;
},
},
]),
n
);
})(),
w = { none: 0, word: 1, char: 2, character: 2 },
_ = Phaser.Utils.Objects.GetValue,
B = (function () {
function r(t, e, i, n, s) {
d(this, r), (this.cornerRadius = {}), (this._width = 0), (this._height = 0), this.setTo(t, e, i, n, s);
}
return (
s(r, [
{
key: "setTo",
value: function (t, e, i, n, s) {
return this.setPosition(t, e), this.setRadius(s), this.setSize(i, n), this;
},
},
{
key: "setPosition",
value: function (t, e) {
return void 0 === t && (t = 0), void 0 === e && (e = t), (this.x = t), (this.y = e), this;
},
},
{
key: "setRadius",
value: function (t) {
var e, i;
void 0 === t && (t = 0), (i = "number" == typeof t ? (e = t) : ((e = _(t, "x", 0)), _(t, "y", 0)));
var n = this.cornerRadius;
return (n.tl = E(_(t, "tl", void 0), e, i)), (n.tr = E(_(t, "tr", void 0), e, i)), (n.bl = E(_(t, "bl", void 0), e, i)), (n.br = E(_(t, "br", void 0), e, i)), this;
},
},
{
key: "setSize",
value: function (t, e) {
return (this.width = t), (this.height = e), this;
},
},
{
key: "minWidth",
get: function () {
var t = this.cornerRadius;
return Math.max(t.tl.x + t.tr.x, t.bl.x + t.br.x);
},
},
{
key: "minHeight",
get: function () {
var t = this.cornerRadius;
return Math.max(t.tl.y + t.bl.y, t.tr.y + t.br.y);
},
},
{
key: "width",
get: function () {
return this._width;
},
set: function (t) {
null == t && (t = 0), (this._width = Math.max(t, this.minWidth));
},
},
{
key: "height",
get: function () {
return this._height;
},
set: function (t) {
null == t && (t = 0), (this._height = Math.max(t, this.minHeight));
},
},
{
key: "radius",
get: function () {
var t = this.cornerRadius;
return Math.max(t.tl.x, t.tl.y, t.tr.x, t.tr.y, t.bl.x, t.bl.y, t.br.x, t.br.y);
},
},
]),
r
);
})(),
E = function (t, e, i) {
return void 0 === t ? { x: e, y: i } : "number" == typeof t ? { x: t, y: t } : t;
},
P = Phaser.Math.DegToRad,
N = P(0),
U = P(90),
Y = P(180),
z = P(270),
X = function (t, e, i, n, s, r, o, a) {
if (null == a) t.ellipse(e, i, n, s, 0, r, o);
else for (var h, l, u, c = (o - r) / (a += 1), d = 0; d <= a; d++) (u = r + c * d), (h = e + n * Math.cos(u)), (l = i + s * Math.sin(u)), t.lineTo(h, l);
},
A = {
draw: function (t, e, i, n) {
var s = this.penManager;
this.hitAreaManager.clear();
var r = this.context;
r.save();
var o = this.defaultStyle;
this.clear(),
(function (t, e, i, n, s, r, o, a) {
if (null != e || null != i) {
var h = t.canvas.width,
l = t.canvas.height;
null == i && (n = 0);
var u = n / 2;
(h -= n),
(l -= n),
t.canvas,
(c = t.context),
(p = e),
(g = i),
(v = n),
(y = r),
(m = o),
(x = c),
(_ = a),
(L = (k = (O = new B((b = u), (w = u), (T = d = h), (S = f = l), s)).minWidth) <= T ? 1 : T / k),
(I = (R = O.minHeight) <= S ? 1 : S / R),
(D = O.cornerRadius),
x.save(),
x.beginPath(),
x.translate(b, w),
(M = T - (P = (E = D.br).x * L)),
(C = S - (A = E.y * I)),
x.moveTo(T, C),
0 < P && 0 < A ? X(x, M, C, P, A, N, U, _) : (x.lineTo(T, S), x.lineTo(M, S)),
(M = P = (E = D.bl).x * L),
(C = S - (A = E.y * I)),
x.lineTo(P, S),
0 < P && 0 < A ? X(x, M, C, P, A, U, Y, _) : (x.lineTo(0, S), x.lineTo(0, C)),
(M = P = (E = D.tl).x * L),
(C = A = E.y * I),
x.lineTo(0, C),
0 < P && 0 < A ? X(x, M, C, P, A, Y, z, _) : (x.lineTo(0, 0), x.lineTo(M, 0)),
(M = T - (P = (E = D.tr).x * L)),
(C = A = E.y * I),
x.lineTo(M, 0),
0 < P && 0 < A ? X(x, M, C, P, A, z, N, _) : (x.lineTo(T, 0), x.lineTo(T, C)),
x.closePath(),
x.restore(),
null != p && (null != y && ((F = m ? c.createLinearGradient(0, 0, d, 0) : c.createLinearGradient(0, 0, 0, f)).addColorStop(0, p), F.addColorStop(1, y), (p = F)), (c.fillStyle = p), c.fill()),
null != g && 0 < v && ((c.strokeStyle = g), (c.lineWidth = v), c.stroke());
}
var c, d, f, p, g, v, y, m, x, b, w, T, S, _, E, P, A, M, C, O, k, R, L, I, D, F;
})(this, o.backgroundColor, o.backgroundStrokeColor, o.backgroundStrokeLineWidth, o.backgroundCornerRadius, o.backgroundColor2, o.backgroundHorizontalGradient, o.backgroundCornerIteration),
(t += this.startXOffset),
(e += this.startYOffset);
var a,
h,
l,
u,
c,
d,
f = o.halign,
p = o.valign,
g = o.lineHeight,
v = s.lines,
y = v.length,
m = o.maxLines;
(u = (l = 0 < m && m < y ? ((h = m), "center" === p ? Math.floor((y - h) / 2) : "bottom" === p ? y - h : 0) : ((h = y), 0)) + h),
(d = "center" === p ? Math.max((n - h * g) / 2, 0) : "bottom" === p ? Math.max(n - h * g - 2, 0) : 0),
(d += e);
for (var x = l; x < u; x++)
if (0 !== (a = s.getLineWidth(x))) {
(c = "center" === f ? (i - a) / 2 : "right" === f ? i - a : 0), (c += t);
for (var b = v[x], w = 0, T = b.length; w < T; w++) this.drawPen(b[w], c, d);
}
r.restore();
},
drawPen: function (t, e, i) {
(e += t.x), (i += t.y + (t.prop.y || 0));
var n = this.canvas,
s = this.context;
s.save();
var r = this.parser.propToContextStyle(this.defaultStyle, t.prop);
r.buildFont(),
r.syncFont(n, s),
r.syncStyle(n, s),
0 < r.underlineThickness && 0 < t.width && this.drawUnderline(e, i, t.width, r),
t.isTextPen && this.drawText(e, i, t.text, r),
t.isImagePen && this.drawImage(e, i, t.prop.img, r),
s.restore(),
t.hasAreaMarker && 0 < t.width && this.hitAreaManager.add(t.prop.area, e, i - this.startYOffset, t.width, this.defaultStyle.lineHeight);
},
clear: function () {
var t = this.canvas;
this.context.clearRect(0, 0, t.width, t.height);
},
drawUnderline: function (t, e, i, n) {
(e += n.underlineOffset - n.underlineThickness / 2), this.autoRound && ((t = Math.round(t)), (e = Math.round(e)));
var s = this.context,
r = s.lineCap;
(s.lineCap = "butt"), (s.strokeStyle = n.underlineColor), (s.lineWidth = n.underlineThickness), s.beginPath(), s.moveTo(t, e), s.lineTo(t + i, e), s.stroke(), (s.lineCap = r);
},
drawText: function (t, e, i, n) {
this.autoRound && ((t = Math.round(t)), (e = Math.round(e)));
var s = this.context;
n.strokeThickness && (n.syncShadow(s, n.shadowStroke), s.strokeText(i, t, e)), n.color && "none" !== n.color && (n.syncShadow(s, n.shadowFill), s.fillText(i, t, e));
},
drawImage: function (t, e, i) {
(e -= this.startYOffset), this.parent.imageManager.draw(i, this.context, t, e, this.autoRound);
},
},
M = (function () {
function t() {
d(this, t), (this.items = []);
}
return (
s(t, [
{
key: "destroy",
value: function () {
this.clear(), (this.items = void 0);
},
},
{
key: "pop",
value: function () {
return 0 < this.items.length ? this.items.pop() : null;
},
},
{
key: "push",
value: function (t) {
return this.items.push(t), this;
},
},
{
key: "pushMultiple",
value: function (t) {
return this.items.push.apply(this.items, t), (t.length = 0), this;
},
},
{
key: "clear",
value: function () {
return (this.items.length = 0), this;
},
},
]),
t
);
})(),
C = Phaser.Utils.Objects.GetValue,
O = (function () {
function e(t) {
d(this, e), (this.prop = {}), this.resetFromJSON(t);
}
return (
s(e, [
{
key: "resetFromJSON",
value: function (t) {
(this.text = C(t, "text", "")), (this.x = C(t, "x", 0)), (this.y = C(t, "y", 0)), (this.width = C(t, "width", 0));
var e = C(t, "prop", null);
null === e && (e = {}), (this.prop = e), (this.newLineMode = C(t, "newLineMode", 0)), (this.startIndex = C(t, "startIndex", 0));
},
},
{
key: "plainText",
get: function () {
var t = this.text;
return 1 === this.newLineMode && (t += "\n"), t;
},
},
{
key: "wrapText",
get: function () {
var t = this.text;
return 0 !== this.newLineMode && (t += "\n"), t;
},
},
{
key: "rawTextLength",
get: function () {
var t = this.text.length;
return 1 === this.newLineMode && (t += 1), t;
},
},
{
key: "endIndex",
get: function () {
return this.startIndex + this.rawTextLength;
},
},
{
key: "lastX",
get: function () {
return this.x + this.width;
},
},
{
key: "isTextPen",
get: function () {
return "" !== this.text;
},
},
{
key: "isImagePen",
get: function () {
return !!this.prop.img;
},
},
{
key: "hasAreaMarker",
get: function () {
return !!this.prop.area;
},
},
]),
e
);
})(),
k = Phaser.Utils.Objects.GetFastValue,
R = new M(),
L = new M(),
I = (function () {
function a(t) {
d(this, a),
(this.pens = []),
(this.lines = []),
(this.maxLinesWidth = void 0),
(this.PensPool = k(t, "pensPool", R)),
(this.LinesPool = k(t, "linesPool", L)),
(this.tagToText = k(t, "tagToText", h)),
(this.tagToTextScope = k(t, "tagToTextScope", void 0));
}
return (
s(a, [
{
key: "destroy",
value: function () {
this.freePens(), (this.tagToText = void 0), (this.tagToTextScope = void 0);
},
},
{
key: "freePens",
value: function () {
for (var t = 0, e = this.lines.length; t < e; t++) this.lines[t].length = 0;
this.PensPool.pushMultiple(this.pens), this.LinesPool.pushMultiple(this.lines), (this.maxLinesWidth = void 0);
},
},
{
key: "addTextPen",
value: function (t, e, i, n, s, r) {
var o = this.PensPool.pop();
return null == o && (o = new O()), (D.text = t), (D.x = e), (D.y = i), (D.width = n), (D.prop = s), (D.newLineMode = r), o.resetFromJSON(D), this.addPen(o), this;
},
},
{
key: "addImagePen",
value: function (t, e, i, n) {
return this.addTextPen("", t, e, i, n, 0), this;
},
},
{
key: "addNewLinePen",
value: function () {
var t = this.lastPen,
e = t ? t.lastX : 0,
i = t ? t.y : 0,
n = t ? T(t.prop) : null;
return this.addTextPen("", e, i, 0, n, 2), this;
},
},
{
key: "addPen",
value: function (t) {
var e = this.lastPen;
(t.startIndex = null == e ? 0 : e.endIndex), this.pens.push(t);
var i = this.lastLine;
null == i && ((i = this.LinesPool.pop() || []), this.lines.push(i)), i.push(t), 0 !== t.newLineMode && ((i = this.LinesPool.pop() || []), this.lines.push(i)), (this.maxLinesWidth = void 0);
},
},
{
key: "clone",
value: function (t) {
null == t && (t = new a()), t.freePens();
for (var e = 0, i = this.lines.length; e < i; e++)
for (var n = this.lines[e], s = 0, r = n.length; s < r; s++) {
var o = n[s];
t.addPen(o.text, o.x, o.y, o.width, T(o.prop), o.newLineMode);
}
return t;
},
},
{
key: "lastPen",
get: function () {
return this.pens[this.pens.length - 1];
},
},
{
key: "lastLine",
get: function () {
return this.lines[this.lines.length - 1];
},
},
{
key: "getLineStartIndex",
value: function (t) {
if (t >= this.lines.length) return this.getLineEndIndex(t);
var e = this.lines[t];
return e && e[0] ? e[0].startIndex : 0;
},
},
{
key: "getLineEndIndex",
value: function (t) {
t >= this.lines.length && (t = this.lines.length - 1);
var e,
i,
n = !1;
for (e = t; 0 <= e && !(n = null != (i = this.lines[e]) && 0 < i.length); e--);
return n ? i[i.length - 1].endIndex : 0;
},
},
{
key: "getLineWidth",
value: function (t) {
var e = this.lines[t];
if (!e) return 0;
var i = e[e.length - 1];
return null == i ? 0 : i.lastX;
},
},
{
key: "getMaxLineWidth",
value: function () {
if (void 0 !== this.maxLinesWidth) return this.maxLinesWidth;
for (var t, e = 0, i = 0, n = this.lines.length; i < n; i++) e < (t = this.getLineWidth(i)) && (e = t);
return (this.maxLinesWidth = e);
},
},
{
key: "getLineWidths",
value: function () {
for (var t = [], e = 0, i = this.lines.length; e < i; e++) t.push(this.getLineWidth(e));
return t;
},
},
{
key: "linesCount",
get: function () {
return this.lines.length;
},
},
{
key: "plainText",
get: function () {
for (var t = "", e = this.pens, i = 0, n = e.length; i < n; i++) t += e[i].plainText;
return t;
},
},
{
key: "rawTextLength",
get: function () {
for (var t = 0, e = this.pens, i = 0, n = this.pens.length; i < n; i++) t += e[i].rawTextLength;
return t;
},
},
{
key: "getSliceTagText",
value: function (t, e, i) {
if ((void 0 === t && (t = 0), void 0 === e)) {
var n = this.lastPen;
if (null == n) return "";
e = n.endIndex;
}
void 0 === i && (i = !1);
for (
var s, r, o, a, h, l, u = "", c = 0, d = this.pens.length;
c < d &&
((a = (s = this.pens[c]).endIndex) <= t ||
((s = this.pens[c]),
(r = i ? s.wrapText : s.plainText),
(h = s.prop),
(t <= (o = s.startIndex) && a <= e) || (r = r.substring(t - o, e - o)),
this.tagToTextScope ? (u += this.tagToText.call(this.tagToTextScope, r, h, l)) : (u += this.tagToText(r, h, l)),
(l = h),
!(e <= a)));
c++
);
return u;
},
},
]),
a
);
})(),
D = {},
F = Phaser.Geom.Rectangle,
V = new M(),
G = (function () {
function t() {
d(this, t), (this.hitAreas = []);
}
return (
s(t, [
{
key: "destroy",
value: function () {
this.clear();
},
},
{
key: "clear",
value: function () {
return V.pushMultiple(this.hitAreas), this;
},
},
{
key: "add",
value: function (t, e, i, n, s) {
var r = V.pop();
return null === r ? (r = new F(e, i, n, s)) : r.setTo(e, i, n, s), (r.key = t), this.hitAreas.push(r), this;
},
},
{
key: "getFirstHitArea",
value: function (t, e) {
for (var i, n = this.hitAreas, s = 0, r = n.length; s < r; s++) if ((i = n[s]).contains(t, e)) return i;
return null;
},
},
{
key: "drawBounds",
value: function (t, e, i) {
void 0 === e && (e = 16777215), i && t.save().scaleCanvas(i.scaleX, i.scaleY).rotateCanvas(i.rotation).translateCanvas(i.x, i.y);
for (var n, s = this.hitAreas, r = 0, o = s.length; r < o; r++) (n = s[r]), t.lineStyle(1, e).strokeRect(n.x, n.y, n.width, n.height);
return i && t.restore(), this;
},
},
]),
t
);
})(),
j = function (t, e, i, n) {
var s = this.hitAreaManager.getFirstHitArea(i, n);
if (null !== s) {
var r = s.key;
this.parent.emit("".concat(t, "-").concat(r), e, i, n), this.parent.emit(t, r, e, i, n);
}
},
H = 0,
W = 1,
K = 2,
q = 0,
Z = 1,
J = p,
Q = [],
$ = new M();
$.newline = function (t, e, i) {
var n = this.pop();
return null === n && (n = {}), (n.text = t), (n.width = e), (n.newLineMode = i), n;
};
var tt = Phaser.Utils.Objects.GetValue,
et = (function () {
function i(t) {
d(this, i),
(this.parent = t.parent),
(this.context = tt(t, "context", null)),
(this.canvas = this.context.canvas),
(this.parser = tt(t, "parser", null)),
(this.defaultStyle = tt(t, "style", null)),
(this.autoRound = !0),
(this.pensPool = tt(t, "pensPool", null)),
(this.penManager = this.newPenManager()),
(this._tmpPenManager = null),
(this.hitAreaManager = new G());
var e = this.context;
this.getTextWidth = function (t) {
return e.measureText(t).width;
};
}
return (
s(i, [
{
key: "destroy",
value: function () {
(this.context = void 0),
(this.canvas = void 0),
(this.parser = void 0),
(this.defaultStyle = void 0),
this.penManager && (this.penManager.destroy(), (this.penManager = void 0)),
this._tmpPenManager && (this._tmpPenManager.destroy(), (this._tmpPenManager = void 0)),
this.hitAreaManager && (this.hitAreaManager.destroy(), (this.hitAreaManager = void 0));
},
},
{
key: "updatePenManager",
value: function (t, e, i, n, s) {
if ((void 0 === s && (s = this.penManager), s.freePens(), "" === t)) return s;
if (this.parent.style.isWrapFitMode) {
var r = this.parent.padding;
i = this.parent.style.fixedWidth - r.left - r.right;
}
for (var o, a, h, l, u, c = this.canvas, d = this.context, f = 0, p = 0, g = this.parser.splitText(t), v = 0, y = g.length; v < y; v++)
if (((o = (l = this.parser.tagTextToProp(g[v], a)).plainText), (a = l.prop).img)) {
var m = this.imageManager.getOuterWidth(a.img);
0 < i && 0 !== e && i < f + m && (s.addNewLinePen(), (p += n), (f = 0)), s.addImagePen(f, p, m, T(a)), (f += m);
} else if ("" !== o) {
d.save(), (h = this.parser.propToContextStyle(this.defaultStyle, a)).buildFont(), h.syncFont(c, d), h.syncStyle(c, d);
for (
var x,
b = 0,
w = (u = S(
o,
function (t) {
return d.measureText(t).width;
},
e,
i,
f
)).length;
b < w;
b++
)
(x = u[b]), s.addTextPen(x.text, f, p, x.width, T(a), x.newLineMode), 0 !== x.newLineMode ? ((f = 0), (p += n)) : (f += x.width);
d.restore();
}
return s;
},
},
{
key: "startXOffset",
get: function () {
return this.defaultStyle.strokeThickness / 2;
},
},
{
key: "startYOffset",
get: function () {
var t = this.defaultStyle;
return t.strokeThickness / 2 + t.metrics.ascent;
},
},
{
key: "lines",
get: function () {
return this.penManager.lines;
},
},
{
key: "desplayLinesCount",
get: function () {
var t = this.penManager.linesCount,
e = this.defaultStyle.maxLines;
return 0 < e && e < t && (t = e), t;
},
},
{
key: "linesWidth",
get: function () {
return this.penManager.getMaxLineWidth();
},
},
{
key: "linesHeight",
get: function () {
var t = this.desplayLinesCount,
e = this.defaultStyle.lineHeight * t;
return 0 < t && (e -= this.defaultStyle.lineSpacing), e;
},
},
{
key: "imageManager",
get: function () {
return this.parent.imageManager;
},
},
{
key: "newPenManager",
value: function () {
return new I({ pensPool: this.pensPool, tagToText: this.parser.propToTagText, tagToTextScope: this.parser });
},
},
{
key: "tmpPenManager",
get: function () {
return null === this._tmpPenManager && (this._tmpPenManager = this.newPenManager()), this._tmpPenManager;
},
},
{
key: "getPlainText",
value: function (t, e, i) {
var n;
if (null == t) n = this.penManager.plainText;
else {
var s = this.parser.splitText(t, 1);
n = "";
for (var r = 0, o = s.length; r < o; r++) n += s[r];
}
return (null == e && null == i) || (null == e && (e = 0), null == i && (i = n.length), (n = n.substring(e, i))), n;
},
},
{
key: "getPenManager",
value: function (t, e) {
if (void 0 === t) return this.copyPenManager(e, this.penManager);
void 0 === e && (e = this.newPenManager());
var i = this.defaultStyle;
return this.updatePenManager(t, i.wrapMode, i.wrapWidth, i.lineHeight, e), e;
},
},
{
key: "getText",
value: function (t, e, i, n) {
if (null == t) return this.penManager.getSliceTagText(e, i, n);
var s = this.tmpPenManager,
r = this.defaultStyle;
return this.updatePenManager(t, r.wrapMode, r.wrapWidth, r.lineHeight, s), s.getSliceTagText(e, i, n);
},
},
{
key: "copyPenManager",
value: function (t, e) {
return void 0 === e && (e = this.penManager), e.copy(t);
},
},
{
key: "getTextWidth",
value: function (t) {
return void 0 === t && (t = this.penManager), t.getMaxLineWidth();
},
},
{
key: "getLastPen",
value: function (t) {
return void 0 === t && (t = this.penManager), t.lastPen;
},
},
]),
i
);
})(),
it = {
setInteractive: function () {
this.parent
.on(
"pointerdown",
function (t, e, i, n) {
j.call(this, "areadown", t, e, i);
},
this
)
.on(
"pointerup",
function (t, e, i, n) {
j.call(this, "areaup", t, e, i);
},
this
);
},
};
function nt(t, e) {
void 0 === e && (e = { key: t }), e.hasOwnProperty("key") || (e.key = t);
var i = e.key,
n = e.frame,
s = e.width,
r = e.height;
if (void 0 === s || void 0 === r) {
var o = this.textureManager.getFrame(i, n),
a = o ? o.cutWidth : 0,
h = o ? o.cutHeight : 0;
void 0 === s && void 0 === r ? ((s = a), (r = h)) : void 0 === s ? (s = a * (r / h)) : void 0 === r && (r = h * (s / a));
}
this.images[t] = { key: i, frame: n, width: s, height: r, y: st(e, "y", 0), left: st(e, "left", 0), right: st(e, "right", 0) };
}
Object.assign(et.prototype, A, it);
var st = Phaser.Utils.Objects.GetValue,
rt = (function () {
function e(t) {
d(this, e), (this.textureManager = t.textures), (this.images = {});
}
return (
s(e, [
{
key: "destroy",
value: function () {
(this.textureManager = void 0), (this.images = void 0);
},
},
{
key: "add",
value: function (t, e) {
if ("string" == typeof t) nt.call(this, t, e);
else if (Array.isArray(t)) for (var i = 0, n = (s = t).length; i < n; i++) nt.call(this, s[i]);
else {
var s = t;
for (var t in s) nt.call(this, t, s[t]);
}
return this;
},
},
{
key: "has",
value: function (t) {
return this.images.hasOwnProperty(t);
},
},
{
key: "remove",
value: function (t) {
return this.has(t) && delete this.images[t], this;
},
},
{
key: "get",
value: function (t) {
return this.images.hasOwnProperty(t) || (this.textureManager.exists(t) && this.add(t)), this.images[t];
},
},
{
key: "getOuterWidth",
value: function (t) {
var e = this.get(t);
return e ? e.width + e.left + e.right : 0;
},
},
{
key: "getFrame",
value: function (t) {
var e = this.get(t);
return e ? this.textureManager.getFrame(e.key, e.frame) : void 0;
},
},
{
key: "hasTexture",
value: function (t) {
return !!this.getFrame(t);
},
},
]),
e
);
})(),
ot = {
draw: function (t, e, i, n, s) {
var r = this.get(t);
(i += r.left), (n += r.y), s && ((i = Math.round(i)), (n = Math.round(n)));
var o = this.textureManager.getFrame(r.key, r.frame);
e.drawImage(o.source.image, o.cutX, o.cutY, o.cutWidth, o.cutHeight, i, n, r.width, r.height);
},
};
Object.assign(rt.prototype, ot);
var at = Phaser.Utils.Objects.IsPlainObject,
ht = Phaser.DOM.AddToDOM,
lt = Phaser.Display.Canvas.CanvasPool,
ut = Phaser.GameObjects.GameObject,
ct = Phaser.Utils.Objects.GetValue,
dt = Phaser.DOM.RemoveFromDOM,
ft = p,
pt = {},
gt = (function () {
t(c, ut);
var u = e(c);
function c(t, e, i, n, s, r, o) {
var a;
if ((d(this, c), at(e))) {
var h = e;
(e = ct(h, "x", 0)), (i = ct(h, "y", 0)), (n = ct(h, "text", "")), (s = ct(h, "style", ""));
}
if (
(void 0 === e && (e = 0),
void 0 === i && (i = 0),
((a = u.call(this, t, r)).renderer = t.sys.game.renderer),
a.setPosition(e, i),
a.setOrigin(0, 0),
a.initPipeline(),
(a.canvas = lt.create(f(a))),
(a.context = a.canvas.getContext("2d")),
s)
) {
if (s.hasOwnProperty("align")) {
var l = s.align;
delete s.align, (s.halign = l);
}
s.hasOwnProperty("stroke") && !s.hasOwnProperty("strokeThickness") && (s.strokeThickness = 1);
}
return (
(a.style = new b(f(a), s)),
(a.autoRound = !0),
(a._text = void 0),
(a.padding = { left: 0, right: 0, top: 0, bottom: 0 }),
(a.width = 1),
(a.height = 1),
(a.dirty = !1),
0 === a.style.resolution && (a.style.resolution = 1),
(a._crop = a.resetCropObject()),
(a.texture = t.sys.textures.addCanvas(null, a.canvas, !0)),
(a.frame = a.texture.get()),
(a.frame.source.resolution = a.style.resolution),
a.renderer.gl && (a.renderer.deleteTexture(a.frame.source.glTexture), (a.frame.source.glTexture = null)),
pt.hasOwnProperty(r) || (pt[r] = new M()),
(a.canvasText = new et({ parent: f(a), context: a.context, parser: o, style: a.style, pensPool: pt[r] })),
s && s.padding && a.setPadding(s.padding),
(a._imageManager = void 0),
a.setText(n),
t.sys.game.events.on(
"contextrestored",
function () {
this.dirty = !0;
},
f(a)
),
a
);
}
return (
s(c, [
{
key: "text",
get: function () {
return this._text;
},
set: function (t) {
this.setText(t);
},
},
{
key: "initRTL",
value: function () {
this.style.rtl && ((this.canvas.dir = "rtl"), (this.context.direction = "rtl"), (this.canvas.style.display = "none"), ht(this.canvas, this.scene.sys.canvas), (this.originX = 1));
},
},
{
key: "setText",
value: function (t) {
return t || 0 === t || (t = ""), Array.isArray(t) && (t = t.join("\n")), t !== this._text && ((this._text = t.toString()), this.updateText()), this;
},
},
{
key: "setStyle",
value: function (t) {
return this.style.setStyle(t);
},
},
{
key: "setFont",
value: function (t) {
return this.style.setFont(t);
},
},
{
key: "setFontFamily",
value: function (t) {
return this.style.setFontFamily(t);
},
},
{
key: "setFontSize",
value: function (t) {
return this.style.setFontSize(t);
},
},
{
key: "setFontStyle",
value: function (t) {
return this.style.setFontStyle(t);
},
},
{
key: "setFixedSize",
value: function (t, e) {
return this.style.setFixedSize(t, e);
},
},
{
key: "setBackgroundColor",
value: function (t, e, i) {
return this.style.setBackgroundColor(t, e, i);
},
},
{
key: "setBackgroundStrokeColor",
value: function (t, e) {
return this.style.setBackgroundStrokeColor(t, e);
},
},
{
key: "setBackgroundCornerRadius",
value: function (t, e) {
return this.style.setBackgroundCornerRadius(t, e);
},
},
{
key: "setFill",
value: function (t) {
return this.style.setFill(t);
},
},
{
key: "setColor",
value: function (t) {
return this.style.setColor(t);
},
},
{
key: "setStroke",
value: function (t, e) {
return this.style.setStroke(t, e);
},
},
{
key: "setShadow",
value: function (t, e, i, n, s, r) {
return this.style.setShadow(t, e, i, n, s, r);
},
},
{
key: "setShadowOffset",
value: function (t, e) {
return this.style.setShadowOffset(t, e);
},
},
{
key: "setShadowColor",
value: function (t) {
return this.style.setShadowColor(t);
},
},
{
key: "setShadowBlur",
value: function (t) {
return this.style.setShadowBlur(t);
},
},
{
key: "setShadowStroke",
value: function (t) {
return this.style.setShadowStroke(t);
},
},
{
key: "setShadowFill",
value: function (t) {
return this.style.setShadowFill(t);
},
},
{
key: "setWrapMode",
value: function (t) {
return this.style.setWrapMode(t);
},
},
{
key: "setWrapWidth",
value: function (t) {
return this.style.setWrapWidth(t);
},
},
{
key: "setAlign",
value: function (t) {
return this.style.setHAlign(t);
},
},
{
key: "setLineSpacing",
value: function (t) {
return this.style.setLineSpacing(t);
},
},
{
key: "setPadding",
value: function (t, e, i, n) {
if ("object" === l(t)) {
var s = t,
r = ct(s, "x", null);
i = null !== r ? (t = r) : ((t = ct(s, "left", 0)), ct(s, "right", t));
var o = ct(s, "y", null);
n = null !== o ? (e = o) : ((e = ct(s, "top", 0)), ct(s, "bottom", e));
} else void 0 === t && (t = 0), void 0 === e && (e = t), void 0 === i && (i = t), void 0 === n && (n = e);
return (this.padding.left = t), (this.padding.top = e), (this.padding.right = i), (this.padding.bottom = n), this.updateText(!1);
},
},
{
key: "setResolution",
value: function (t) {
return this.style.setResolution(t);
},
},
{
key: "setMaxLines",
value: function (t) {
return this.style.setMaxLines(t);
},
},
{
key: "updateText",
value: function (t) {
void 0 === t && (t = !0);
var e = this.canvasText,
i = this.style;
t && e.updatePenManager(this._text, i.wrapMode, i.wrapWidth, i.lineHeight);
var n,
s,
r = this.padding;
0 === i.fixedWidth ? ((this.width = e.linesWidth + r.left + r.right), (n = e.linesWidth)) : ((this.width = i.fixedWidth), (n = this.width - r.left - r.right) < e.linesWidth && (n = e.linesWidth)),
0 === i.fixedHeight
? ((this.height = e.linesHeight + r.top + r.bottom), (s = e.linesHeight))
: ((this.height = i.fixedHeight), (s = this.height - r.top - r.bottom) < e.linesHeight && (s = e.linesHeight));
var o = this.width,
a = this.height;
this.updateDisplayOrigin();
var h = i.resolution;
(o *= h), (a *= h), (o = Math.max(Math.ceil(o), 1)), (a = Math.max(Math.ceil(a), 1));
var l = this.canvas,
u = this.context;
l.width !== o || l.height !== a ? ((l.width = o), (l.height = a), this.frame.setSize(o, a)) : u.clearRect(0, 0, o, a),
u.save(),
u.scale(h, h),
e.draw(r.left, r.top, n, s),
u.restore(),
this.renderer.gl && ((this.frame.source.glTexture = this.renderer.canvasToTexture(l, this.frame.source.glTexture, !0)), (this.frame.glTexture = this.frame.source.glTexture)),
(this.dirty = !0);
var c = this.input;
return c && !c.customHitArea && ((c.hitArea.width = this.width), (c.hitArea.height = this.height)), this;
},
},
{
key: "getTextMetrics",
value: function () {
return this.style.getTextMetrics();
},
},
{
key: "toJSON",
value: function () {
var t = vt.ToJSON(this),
e = {
autoRound: this.autoRound,
text: this._text,
style: this.style.toJSON(),
resolution: this.resolution,
padding: { left: this.padding.left, right: this.padding.right, top: this.padding.top, bottom: this.padding.bottom },
};
return (t.data = e), t;
},
},
{
key: "preDestroy",
value: function () {
this.style.rtl && dt(this.canvas), lt.remove(this.canvas), this.canvasText.destroy(), (this.canvasText = void 0), this._imageManager && (this._imageManager.destroy(), (this._imageManager = void 0));
},
},
{
key: "setInteractive",
value: function (t, e, i) {
return ut.prototype.setInteractive.call(this, t, e, i), this.canvasText.setInteractive(), this;
},
},
{
key: "getWrappedText",
value: function (t, e, i) {
return (t = this.canvasText.getText(t, e, i, !0)).split(ft);
},
},
{
key: "getPlainText",
value: function (t, e, i) {
return this.canvasText.getPlainText(t, e, i);
},
},
{
key: "getText",
value: function (t, e, i) {
return this.canvasText.getText(t, e, i, !1);
},
},
{
key: "getSubString",
value: function (t, e, i) {
return this.getText(t, e, i);
},
},
{
key: "copyPenManager",
value: function (t) {
return this.canvasText.copyPenManager(t);
},
},
{
key: "getPenManager",
value: function (t, e) {
return this.canvasText.getPenManager(t, e);
},
},
{
key: "setSize",
value: function (t, e) {
return this.setFixedSize(t, e);
},
},
{
key: "resize",
value: function (t, e) {
return this.setFixedSize(t, e);
},
},
{
key: "lineSpacing",
get: function () {
return this.style.lineSpacing;
},
set: function (t) {
this.setLineSpacing(t);
},
},
{
key: "imageManager",
get: function () {
return this._imageManager || (this._imageManager = new rt(this.scene)), this._imageManager;
},
},
{
key: "addImage",
value: function (t, e) {
return this.imageManager.add(t, e), this;
},
},
{
key: "drawAreaBounds",
value: function (t, e) {
return this.canvasText.hitAreaManager.drawBounds(t, e, this), this;
},
},
]),
c
);
})(),
vt = Phaser.GameObjects.Components;
Phaser.Class.mixin(gt, [vt.Alpha, vt.BlendMode, vt.ComputedSize, vt.Crop, vt.Depth, vt.Flip, vt.GetBounds, vt.Mask, vt.Origin, vt.Pipeline, vt.ScrollFactor, vt.Tint, vt.Transform, vt.Visible, c]);
var yt = { plainText: null, prevProp: null },
mt = new b(),
xt = {},
bt = {
splitText: function (t, e) {
for (var i = [], n = 0; ; ) {
var s = St.exec(t);
if (!s) {
var r = t.length;
return n < r && i.push(t.substring(n, r)), i;
}
var o = s[0],
a = St.lastIndex - o.length;
n < a && i.push(t.substring(n, a)), void 0 === e && i.push(o), (n = St.lastIndex);
}
},
tagTextToProp: function (t, e) {
var i, n;
null == e && (e = {}),
e.img && wt(e, Ht, "img"),
(i = _t.test(t)
? (wt(e, Wt, "b", !0), "")
: Et.test(t)
? (wt(e, Ht, "b"), "")
: Pt.test(t)
? (wt(e, Wt, "i", !0), "")
: At.test(t)
? (wt(e, Ht, "i"), "")
: Mt.test(t)
? ((n = t.match(Mt)), wt(e, Wt, "size", "".concat(n[1], "px")), "")
: Ct.test(t)
? (wt(e, Ht, "size"), "")
: Ot.test(t)
? ((n = t.match(Ot)), wt(e, Wt, "color", n[1]), "")
: kt.test(t)
? (wt(e, Ht, "color"), "")
: Rt.test(t)
? ((n = t.match(Rt)), wt(e, Wt, "u", !0), "")
: Lt.test(t)
? ((n = t.match(Lt)), wt(e, Wt, "u", n[1]), "")
: It.test(t)
? (wt(e, Ht, "u"), "")
: Dt.test(t)
? (wt(e, Wt, "shadow", !0), "")
: Ft.test(t)
? (wt(e, Ht, "shadow"), "")
: Bt.test(t)
? (wt(e, Wt, "stroke", !0), "")
: Nt.test(t)
? ((n = t.match(Nt)), wt(e, Wt, "stroke", n[1]), "")
: Ut.test(t)
? (wt(e, Ht, "stroke"), "")
: Yt.test(t)
? ((n = t.match(Yt)), wt(e, Wt, "y", parseFloat(n[1])), "")
: zt.test(t)
? (wt(e, Ht, "y"), "")
: Xt.test(t)
? ((n = t.match(Xt)), wt(e, Wt, "img", n[1]), "")
: Vt.test(t)
? (wt(e, Ht, "img"), "")
: Gt.test(t)
? ((n = t.match(Gt)), wt(e, Wt, "area", n[1]), "")
: jt.test(t)
? (wt(e, Ht, "area"), "")
: t);
var s = yt;
return (s.plainText = i), (s.prop = e), s;
},
propToContextStyle: function (t, e) {
var i = mt;
if (e.hasOwnProperty("img")) i.image = e.img;
else {
if (((i.image = null), e.hasOwnProperty("family") ? (i.fontFamily = e.family) : (i.fontFamily = t.fontFamily), e.hasOwnProperty("size"))) {
var n = e.size;
"number" == typeof n && (n = "".concat(n, "px")), (i.fontSize = n);
} else i.fontSize = t.fontSize;
(i.fontStyle = Tt(e.b, e.i)),
e.hasOwnProperty("color") ? (i.color = e.color) : (i.color = t.color),
e.hasOwnProperty("stroke") ? (!0 === e.stroke ? (i.stroke = t.stroke) : (i.stroke = e.stroke), (i.strokeThickness = t.strokeThickness)) : ((i.stroke = t.stroke), (i.strokeThickness = 0));
}
return (
e.hasOwnProperty("shadow")
? (!0 === e.shadow ? (i.shadowColor = t.shadowColor) : (i.shadowColor = e.shadow),
(i.shadowOffsetX = t.shadowOffsetX),
(i.shadowOffsetY = t.shadowOffsetY),
(i.shadowBlur = t.shadowBlur),
(i.shadowStroke = !0),
(i.shadowFill = !0))
: ((i.shadowColor = "#000"), (i.shadowOffsetX = 0), (i.shadowOffsetY = 0), (i.shadowBlur = 0), (i.shadowStroke = !1), (i.shadowFill = !1)),
e.hasOwnProperty("u")
? (!0 === e.u ? (i.underlineColor = t.underlineColor) : (i.underlineColor = e.u), (i.underlineThickness = t.underlineThickness), (i.underlineOffset = t.underlineOffset))
: ((i.underlineColor = "#000"), (i.underlineThickness = 0), (i.underlineOffset = 0)),
i
);
},
propToTagText: function (t, e, i) {
null == i && (i = xt);
var n = [];
for (var s in i) e.hasOwnProperty(s) || n.push("[/".concat(s, "]"));
for (var s in e) {
var r = e[s];
if (i[s] !== r)
switch (s) {
case "size":
n.push("[size=".concat(r.replace("px", ""), "]"));
break;
case "color":
case "stroke":
case "img":
case "y":
n.push("[".concat(s, "=").concat(r, "]"));
break;
case "u":
!0 === r ? n.push("[u]") : n.push("[u=".concat(r, "]"));
break;
default:
n.push("[".concat(s, "]"));
}
}
return n.push(t), n.join("");
},
},
wt = function (t, e, i, n) {
return e === Wt ? (t[i] = n) : t.hasOwnProperty(i) && delete t[i], t;
},
Tt = function (t, e) {
return t && e ? "bold italic" : t ? "bold" : e ? "italic" : "";
},
St = /\[b\]|\[\/b\]|\[i\]|\[\/i\]|\[size=(\d+)\]|\[\/size\]|\[color=([a-z]+|#[0-9abcdef]+)\]|\[\/color\]|\[u\]|\[u=([a-z]+|#[0-9abcdef]+)\]|\[\/u\]|\[shadow\]|\[\/shadow\]|\[stroke\]|\[stroke=([a-z]+|#[0-9abcdef]+)\]|\[\/stroke\]|\[img=([^\]]+)\]|\[\/img\]|\[area=([^\]]+)\]|\[\/area\]|\[y=([-.0-9]+)\]|\[\/y\]/gi,
_t = /\[b\]/i,
Et = /\[\/b\]/i,
Pt = /\[i\]/i,
At = /\[\/i\]/i,
Mt = /\[size=(\d+)\]/i,
Ct = /\[\/size\]/i,
Ot = /\[color=([a-z]+|#[0-9abcdef]+)\]/i,
kt = /\[\/color\]/i,
Rt = /\[u\]/i,
Lt = /\[u=([a-z]+|#[0-9abcdef]+)\]/i,
It = /\[\/u\]/i,
Dt = /\[shadow\]/i,
Ft = /\[\/shadow\]/i,
Bt = /\[stroke\]/i,
Nt = /\[stroke=([a-z]+|#[0-9abcdef]+)\]/i,
Ut = /\[\/stroke\]/i,
Yt = /\[y=([-.0-9]+)\]/i,
zt = /\[\/y\]/i,
Xt = /\[img=([^\]]+)\]/i,
Vt = /\[\/img\]/i,
Gt = /\[area=([^\]]+)\]/i,
jt = /\[\/area\]/i,
Ht = !1,
Wt = !0,
Kt = (function () {
t(o, gt);
var r = e(o);
function o(t, e, i, n, s) {
return d(this, o), r.call(this, t, e, i, n, s, "rexBBCodeText", bt);
}
return o;
})();
function qt(t, e, i, n) {
var s = new Kt(this.scene, t, e, i, n);
return this.scene.add.existing(s), s;
}
var Zt = Phaser.Utils.Objects.GetAdvancedValue,
Jt = Phaser.GameObjects.BuildGameObject;
function Qt(t, e) {
void 0 === t && (t = {}), void 0 !== e && (t.add = e);
var i = Zt(t, "text", ""),
n = Zt(t, "style", null),
s = Zt(t, "padding", null);
null !== s && (n.padding = s);
var r = new Kt(this.scene, 0, 0, i, n);
return Jt(this.scene, r, t), (r.autoRound = Zt(t, "autoRound", !0)), r;
}
function $t(t) {
return null == t || "" === t || 0 === t.length;
}
var te = (function () {
t(n, Phaser.Plugins.BasePlugin);
var i = e(n);
function n(t) {
var e;
return d(this, n), (e = i.call(this, t)), t.registerGameObject("rexBBCodeText", qt, Qt), e;
}
return (
s(n, [
{
key: "start",
value: function () {
this.game.events.on("destroy", this.destroy, this);
},
},
]),
n
);
})();
return (
(function (h, t, e) {
if ("object" === l(h))
if ($t(t)) {
if (null == e) return;
"object" === l(e) && (h = e);
} else {
"string" == typeof t && (t = t.split("."));
var i = t.pop();
(function (t, e, i) {
var n = h;
if (!$t(e)) {
var s;
"string" == typeof e && (e = e.split("."));
for (var r = 0, o = e.length; r < o; r++) {
var a;
(null != n[(s = e[r])] && "object" === l(n[s])) || ((a = {}), (n[s] = a)), (n = n[s]);
}
}
return n;
})(0, t)[i] = e;
}
})(window, "RexPlugins.GameObjects.BBCodeText", Kt),
te
);
}),
(function (t, e) {
"object" == typeof exports && "undefined" != typeof module ? e(exports) : "function" == typeof define && define.amd ? define(["exports"], e) : e((t.h5Analytics = t.h5Analytics || {}));
})(this, function (t) {
"use strict";
var n = function (t, e) {
return (n =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);
})(t, e);
};
var e,
l,
i,
h,
s,
r,
o,
a,
u,
c,
d,
f,
p = (function () {
function t() {
this.providers = [];
}
return (
(t.prototype.loadScript = function (e) {
this.providers.forEach(function (t) {
return t.loadScript(e);
});
}),
(t.prototype.create = function (e) {
this.providers.forEach(function (t) {
return t.create(e);
});
}),
(t.prototype.sendScreenView = function (e) {
this.providers.forEach(function (t) {
return t.sendScreenView(e);
});
}),
(t.prototype.sendEvent = function (e, i) {
this.providers.forEach(function (t) {
return t.sendEvent(e, i);
});
}),
(t.prototype.sendCustomEvent = function (e, i) {
this.providers.forEach(function (t) {
return t.sendCustomEvent(e, i);
});
}),
(t.prototype.sendGenericEvent = function (e, i, n) {
this.providers.forEach(function (t) {
return t.sendGenericEvent(e, i, n);
});
}),
(t.prototype.addProgressionEvent = function (e, i, n, s, r) {
this.providers.forEach(function (t) {
return t.addProgressionEvent(e, i, n, s, r);
});
}),
(t.prototype.addDesignEvent = function (e, i) {
this.providers.forEach(function (t) {
return t.addDesignEvent(e, i);
});
}),
t
);
})(),
v =
v ||
(function (a, t) {
var e = {},
i = (e.lib = {}),
n = function () {},
s = (i.Base = {
extend: function (t) {
n.prototype = this;
var e = new n();
return (
t && e.mixIn(t),
e.hasOwnProperty("init") ||
(e.init = function () {
e.$super.init.apply(this, arguments);
}),
((e.init.prototype = e).$super = this),
e
);
},
create: function () {
var t = this.extend();
return t.init.apply(t, arguments), t;
},
init: function () {},
mixIn: function (t) {
for (var e in t) t.hasOwnProperty(e) && (this[e] = t[e]);
t.hasOwnProperty("toString") && (this.toString = t.toString);
},
clone: function () {
return this.init.prototype.extend(this);
},
}),
h = (i.WordArray = s.extend({
init: function (t, e) {
(t = this.words = t || []), (this.sigBytes = null != e ? e : 4 * t.length);
},
toString: function (t) {
return (t || o).stringify(this);
},
concat: function (t) {
var e = this.words,
i = t.words,
n = this.sigBytes;
if (((t = t.sigBytes), this.clamp(), n % 4)) for (var s = 0; s < t; s++) e[(n + s) >>> 2] |= ((i[s >>> 2] >>> (24 - (s % 4) * 8)) & 255) << (24 - ((n + s) % 4) * 8);
else if (65535 < i.length) for (s = 0; s < t; s += 4) e[(n + s) >>> 2] = i[s >>> 2];
else e.push.apply(e, i);
return (this.sigBytes += t), this;
},
clamp: function () {
var t = this.words,
e = this.sigBytes;
(t[e >>> 2] &= 4294967295 << (32 - (e % 4) * 8)), (t.length = a.ceil(e / 4));
},
clone: function () {
var t = s.clone.call(this);
return (t.words = this.words.slice(0)), t;
},
random: function (t) {
for (var e = [], i = 0; i < t; i += 4) e.push((4294967296 * a.random()) | 0);
return new h.init(e, t);
},
})),
r = (e.enc = {}),
o = (r.Hex = {
stringify: function (t) {
var e = t.words;
t = t.sigBytes;
for (var i = [], n = 0; n < t; n++) {
var s = (e[n >>> 2] >>> (24 - (n % 4) * 8)) & 255;
i.push((s >>> 4).toString(16)), i.push((15 & s).toString(16));
}
return i.join("");
},
parse: function (t) {
for (var e = t.length, i = [], n = 0; n < e; n += 2) i[n >>> 3] |= parseInt(t.substr(n, 2), 16) << (24 - (n % 8) * 4);
return new h.init(i, e / 2);
},
}),
l = (r.Latin1 = {
stringify: function (t) {
var e = t.words;
t = t.sigBytes;
for (var i = [], n = 0; n < t; n++) i.push(String.fromCharCode((e[n >>> 2] >>> (24 - (n % 4) * 8)) & 255));
return i.join("");
},
parse: function (t) {
for (var e = t.length, i = [], n = 0; n < e; n++) i[n >>> 2] |= (255 & t.charCodeAt(n)) << (24 - (n % 4) * 8);
return new h.init(i, e);
},
}),
u = (r.Utf8 = {
stringify: function (t) {
try {
return decodeURIComponent(escape(l.stringify(t)));
} catch (t) {
throw Error("Malformed UTF-8 data");
}
},
parse: function (t) {
return l.parse(unescape(encodeURIComponent(t)));
},
}),
c = (i.BufferedBlockAlgorithm = s.extend({
reset: function () {
(this._data = new h.init()), (this._nDataBytes = 0);
},
_append: function (t) {
"string" == typeof t && (t = u.parse(t)), this._data.concat(t), (this._nDataBytes += t.sigBytes);
},
_process: function (t) {
var e = this._data,
i = e.words,
n = e.sigBytes,
s = this.blockSize,
r = n / (4 * s);
if (((t = (r = t ? a.ceil(r) : a.max((0 | r) - this._minBufferSize, 0)) * s), (n = a.min(4 * t, n)), t)) {
for (var o = 0; o < t; o += s) this._doProcessBlock(i, o);
(o = i.splice(0, t)), (e.sigBytes -= n);
}
return new h.init(o, n);
},
clone: function () {
var t = s.clone.call(this);
return (t._data = this._data.clone()), t;
},
_minBufferSize: 0,
}));
i.Hasher = c.extend({
cfg: s.extend(),
init: function (t) {
(this.cfg = this.cfg.extend(t)), this.reset();
},
reset: function () {
c.reset.call(this), this._doReset();
},
update: function (t) {
return this._append(t), this._process(), this;
},
finalize: function (t) {
return t && this._append(t), this._doFinalize();
},
blockSize: 16,
_createHelper: function (i) {
return function (t, e) {
return new i.init(e).finalize(t);
};
},
_createHmacHelper: function (i) {
return function (t, e) {
return new d.HMAC.init(i, e).finalize(t);
};
},
});
var d = (e.algo = {});
return e;
})(Math);
!(function (s) {
for (
var t = v,
e = (n = t.lib).WordArray,
i = n.Hasher,
n = t.algo,
r = [],
p = [],
o = function (t) {
return (4294967296 * (t - (0 | t))) | 0;
},
a = 2,
h = 0;
h < 64;
) {
var l;
t: {
l = a;
for (var u = s.sqrt(l), c = 2; c <= u; c++)
if (!(l % c)) {
l = !1;
break t;
}
l = !0;
}
l && (h < 8 && (r[h] = o(s.pow(a, 0.5))), (p[h] = o(s.pow(a, 1 / 3))), h++), a++;
}
var g = [];
n = n.SHA256 = i.extend({
_doReset: function () {
this._hash = new e.init(r.slice(0));
},
_doProcessBlock: function (t, e) {
for (var i = this._hash.words, n = i[0], s = i[1], r = i[2], o = i[3], a = i[4], h = i[5], l = i[6], u = i[7], c = 0; c < 64; c++) {
if (c < 16) g[c] = 0 | t[e + c];
else {
var d = g[c - 15],
f = g[c - 2];
g[c] = (((d << 25) | (d >>> 7)) ^ ((d << 14) | (d >>> 18)) ^ (d >>> 3)) + g[c - 7] + (((f << 15) | (f >>> 17)) ^ ((f << 13) | (f >>> 19)) ^ (f >>> 10)) + g[c - 16];
}
(d = u + (((a << 26) | (a >>> 6)) ^ ((a << 21) | (a >>> 11)) ^ ((a << 7) | (a >>> 25))) + ((a & h) ^ (~a & l)) + p[c] + g[c]),
(f = (((n << 30) | (n >>> 2)) ^ ((n << 19) | (n >>> 13)) ^ ((n << 10) | (n >>> 22))) + ((n & s) ^ (n & r) ^ (s & r))),
(u = l),
(l = h),
(h = a),
(a = (o + d) | 0),
(o = r),
(r = s),
(s = n),
(n = (d + f) | 0);
}
(i[0] = (i[0] + n) | 0), (i[1] = (i[1] + s) | 0), (i[2] = (i[2] + r) | 0), (i[3] = (i[3] + o) | 0), (i[4] = (i[4] + a) | 0), (i[5] = (i[5] + h) | 0), (i[6] = (i[6] + l) | 0), (i[7] = (i[7] + u) | 0);
},
_doFinalize: function () {
var t = this._data,
e = t.words,
i = 8 * this._nDataBytes,
n = 8 * t.sigBytes;
return (e[n >>> 5] |= 128 << (24 - (n % 32))), (e[14 + (((n + 64) >>> 9) << 4)] = s.floor(i / 4294967296)), (e[15 + (((n + 64) >>> 9) << 4)] = i), (t.sigBytes = 4 * e.length), this._process(), this._hash;
},
clone: function () {
var t = i.clone.call(this);
return (t._hash = this._hash.clone()), t;
},
});
(t.SHA256 = i._createHelper(n)), (t.HmacSHA256 = i._createHmacHelper(n));
})(Math),
(l = (e = v).enc.Utf8),
(e.algo.HMAC = e.lib.Base.extend({
init: function (t, e) {
(t = this._hasher = new t.init()), "string" == typeof e && (e = l.parse(e));
var i = t.blockSize,
n = 4 * i;
e.sigBytes > n && (e = t.finalize(e)), e.clamp();
for (var s = (this._oKey = e.clone()), r = (this._iKey = e.clone()), o = s.words, a = r.words, h = 0; h < i; h++) (o[h] ^= 1549556828), (a[h] ^= 909522486);
(s.sigBytes = r.sigBytes = n), this.reset();
},
reset: function () {
var t = this._hasher;
t.reset(), t.update(this._iKey);
},
update: function (t) {
return this._hasher.update(t), this;
},
finalize: function (t) {
var e = this._hasher;
return (t = e.finalize(t)), e.reset(), e.finalize(this._oKey.clone().concat(t));
},
})),
(h = (i = v).lib.WordArray),
(i.enc.Base64 = {
stringify: function (t) {
var e = t.words,
i = t.sigBytes,
n = this._map;
t.clamp(), (t = []);
for (var s = 0; s < i; s += 3)
for (
var r = (((e[s >>> 2] >>> (24 - (s % 4) * 8)) & 255) << 16) | (((e[(s + 1) >>> 2] >>> (24 - ((s + 1) % 4) * 8)) & 255) << 8) | ((e[(s + 2) >>> 2] >>> (24 - ((s + 2) % 4) * 8)) & 255), o = 0;
o < 4 && s + 0.75 * o < i;
o++
)
t.push(n.charAt((r >>> (6 * (3 - o))) & 63));
if ((e = n.charAt(64))) for (; t.length % 4; ) t.push(e);
return t.join("");
},
parse: function (t) {
var e = t.length,
i = this._map;
(n = i.charAt(64)) && -1 != (n = t.indexOf(n)) && (e = n);
for (var n = [], s = 0, r = 0; r < e; r++)
if (r % 4) {
var o = i.indexOf(t.charAt(r - 1)) << ((r % 4) * 2),
a = i.indexOf(t.charAt(r)) >>> (6 - (r % 4) * 2);
(n[s >>> 2] |= (o | a) << (24 - (s % 4) * 8)), s++;
}
return h.create(n, s);
},
_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
}),
(s = St || (St = {})),
((r = s.EGAErrorSeverity || (s.EGAErrorSeverity = {}))[(r.Undefined = 0)] = "Undefined"),
(r[(r.Debug = 1)] = "Debug"),
(r[(r.Info = 2)] = "Info"),
(r[(r.Warning = 3)] = "Warning"),
(r[(r.Error = 4)] = "Error"),
(r[(r.Critical = 5)] = "Critical"),
((o = s.EGAGender || (s.EGAGender = {}))[(o.Undefined = 0)] = "Undefined"),
(o[(o.Male = 1)] = "Male"),
(o[(o.Female = 2)] = "Female"),
((a = s.EGAProgressionStatus || (s.EGAProgressionStatus = {}))[(a.Undefined = 0)] = "Undefined"),
(a[(a.Start = 1)] = "Start"),
(a[(a.Complete = 2)] = "Complete"),
(a[(a.Fail = 3)] = "Fail"),
((u = s.EGAResourceFlowType || (s.EGAResourceFlowType = {}))[(u.Undefined = 0)] = "Undefined"),
(u[(u.Source = 1)] = "Source"),
(u[(u.Sink = 2)] = "Sink"),
(c = s.http || (s.http = {})),
((d = c.EGASdkErrorType || (c.EGASdkErrorType = {}))[(d.Undefined = 0)] = "Undefined"),
(d[(d.Rejected = 1)] = "Rejected"),
((f = c.EGAHTTPApiResponse || (c.EGAHTTPApiResponse = {}))[(f.NoResponse = 0)] = "NoResponse"),
(f[(f.BadResponse = 1)] = "BadResponse"),
(f[(f.RequestTimeout = 2)] = "RequestTimeout"),
(f[(f.JsonEncodeFailed = 3)] = "JsonEncodeFailed"),
(f[(f.JsonDecodeFailed = 4)] = "JsonDecodeFailed"),
(f[(f.InternalServerError = 5)] = "InternalServerError"),
(f[(f.BadRequest = 6)] = "BadRequest"),
(f[(f.Unauthorized = 7)] = "Unauthorized"),
(f[(f.UnknownResponseCode = 8)] = "UnknownResponseCode"),
(f[(f.Ok = 9)] = "Ok");
var g,
y,
m,
x,
b,
w,
T,
S,
_,
E,
P,
A,
M,
C,
O,
k,
R,
L,
I,
D,
F,
B,
N,
U,
Y,
z,
X,
V,
G,
j,
H,
W,
K,
q,
Z,
J,
Q,
$,
tt,
et,
it,
nt,
st,
rt,
ot,
at,
ht,
lt,
ut,
ct,
dt,
ft,
pt,
gt,
vt,
yt,
mt,
xt,
bt,
wt,
Tt,
St,
_t,
Et,
Pt,
At,
Mt,
Ct,
Ot,
kt,
Rt,
Lt,
It,
Dt;
St.EGAErrorSeverity, St.EGAGender, St.EGAProgressionStatus, St.EGAResourceFlowType;
(function (t) {
var n, e;
((e = n || (n = {}))[(e.Error = 0)] = "Error"), (e[(e.Warning = 1)] = "Warning"), (e[(e.Info = 2)] = "Info"), (e[(e.Debug = 3)] = "Debug");
var i = (function () {
function i() {
i.debugEnabled = !1;
}
return (
(i.setInfoLog = function (t) {
i.instance.infoLogEnabled = t;
}),
(i.setVerboseLog = function (t) {
i.instance.infoLogVerboseEnabled = t;
}),
(i.i = function (t) {
if (i.instance.infoLogEnabled) {
var e = "Info/" + i.Tag + ": " + t;
i.instance.sendNotificationMessage(e, n.Info);
}
}),
(i.w = function (t) {
var e = "Warning/" + i.Tag + ": " + t;
i.instance.sendNotificationMessage(e, n.Warning);
}),
(i.e = function (t) {
var e = "Error/" + i.Tag + ": " + t;
i.instance.sendNotificationMessage(e, n.Error);
}),
(i.ii = function (t) {
if (i.instance.infoLogVerboseEnabled) {
var e = "Verbose/" + i.Tag + ": " + t;
i.instance.sendNotificationMessage(e, n.Info);
}
}),
(i.d = function (t) {
if (i.debugEnabled) {
var e = "Debug/" + i.Tag + ": " + t;
i.instance.sendNotificationMessage(e, n.Debug);
}
}),
(i.prototype.sendNotificationMessage = function (t, e) {
switch (e) {
case n.Error:
case n.Warning:
break;
case n.Debug:
console.debug;
break;
case n.Info:
}
}),
(i.instance = new i()),
(i.Tag = "GameAnalytics"),
i
);
})();
t.GALogger = i;
})((g = St || (St = {})).logging || (g.logging = {})),
(y = St || (St = {})),
(m = y.utilities || (y.utilities = {})),
(x = y.logging.GALogger),
(b = (function () {
function u() {}
return (
(u.getHmac = function (t, e) {
var i = v.HmacSHA256(e, t);
return v.enc.Base64.stringify(i);
}),
(u.stringMatch = function (t, e) {
return !(!t || !e) && e.test(t);
}),
(u.joinStringArray = function (t, e) {
for (var i = "", n = 0, s = t.length; n < s; n++) 0 < n && (i += e), (i += t[n]);
return i;
}),
(u.stringArrayContainsString = function (t, e) {
if (0 === t.length) return !1;
for (var i in t) if (t[i] === e) return !0;
return !1;
}),
(u.encode64 = function (t) {
t = encodeURI(t);
for (
var e, i, n, s, r, o = "", a = 0, h = 0, l = 0;
(n = (e = t.charCodeAt(l++)) >> 2),
(s = ((3 & e) << 4) | ((i = t.charCodeAt(l++)) >> 4)),
(r = ((15 & i) << 2) | ((a = t.charCodeAt(l++)) >> 6)),
(h = 63 & a),
isNaN(i) ? (r = h = 64) : isNaN(a) && (h = 64),
(o = o + u.keyStr.charAt(n) + u.keyStr.charAt(s) + u.keyStr.charAt(r) + u.keyStr.charAt(h)),
(e = i = a = 0),
(n = s = r = h = 0),
l < t.length;
);
return o;
}),
(u.decode64 = function (t) {
var e,
i,
n,
s,
r = "",
o = 0,
a = 0,
h = 0;
for (
/[^A-Za-z0-9\+\/\=]/g.exec(t) && x.w("There were invalid base64 characters in the input text. Valid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='. Expect errors in decoding."),
t = t.replace(/[^A-Za-z0-9\+\/\=]/g, "");
(e = (u.keyStr.indexOf(t.charAt(h++)) << 2) | ((n = u.keyStr.indexOf(t.charAt(h++))) >> 4)),
(i = ((15 & n) << 4) | ((s = u.keyStr.indexOf(t.charAt(h++))) >> 2)),
(o = ((3 & s) << 6) | (a = u.keyStr.indexOf(t.charAt(h++)))),
(r += String.fromCharCode(e)),
64 != s && (r += String.fromCharCode(i)),
64 != a && (r += String.fromCharCode(o)),
(e = i = o = 0),
(n = s = a = 0),
h < t.length;
);
return decodeURI(r);
}),
(u.timeIntervalSince1970 = function () {
var t = new Date();
return Math.round(t.getTime() / 1e3);
}),
(u.createGuid = function () {
return (u.s4() + u.s4() + "-" + u.s4() + "-4" + u.s4().substr(0, 3) + "-" + u.s4() + "-" + u.s4() + u.s4() + u.s4()).toLowerCase();
}),
(u.s4 = function () {
return ((65536 * (1 + Math.random())) | 0).toString(16).substring(1);
}),
(u.keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),
u
);
})()),
(m.GAUtilities = b),
(w = St || (St = {})),
(T = w.validators || (w.validators = {})),
(S = w.logging.GALogger),
(_ = w.http.EGASdkErrorType),
(E = w.utilities.GAUtilities),
(P = (function () {
function a() {}
return (
(a.validateBusinessEvent = function (t, e, i, n, s) {
return a.validateCurrency(t)
? e < 0
? (S.w("Validation fail - business event - amount. Cannot be less than 0. Failed amount: " + e), !1)
: a.validateShortString(i, !0)
? a.validateEventPartLength(n, !1)
? a.validateEventPartCharacters(n)
? a.validateEventPartLength(s, !1)
? !!a.validateEventPartCharacters(s) || (S.w("Validation fail - business event - itemId: Cannot contain other characters than A-z, 0-9, -_., ()!?. String: " + s), !1)
: (S.w("Validation fail - business event - itemId. Cannot be (null), empty or above 64 characters. String: " + s), !1)
: (S.w("Validation fail - business event - itemType: Cannot contain other characters than A-z, 0-9, -_., ()!?. String: " + n), !1)
: (S.w("Validation fail - business event - itemType: Cannot be (null), empty or above 64 characters. String: " + n), !1)
: (S.w("Validation fail - business event - cartType. Cannot be above 32 length. String: " + i), !1)
: (S.w("Validation fail - business event - currency: Cannot be (null) and need to be A-Z, 3 characters and in the standard at openexchangerates.org. Failed currency: " + t), !1);
}),
(a.validateResourceEvent = function (t, e, i, n, s, r, o) {
return t == w.EGAResourceFlowType.Undefined
? (S.w("Validation fail - resource event - flowType: Invalid flow type."), !1)
: e
? E.stringArrayContainsString(r, e)
? 0 < i
? n
? a.validateEventPartLength(n, !1)
? a.validateEventPartCharacters(n)
? E.stringArrayContainsString(o, n)
? a.validateEventPartLength(s, !1)
? !!a.validateEventPartCharacters(s) || (S.w("Validation fail - resource event - itemId: Cannot contain other characters than A-z, 0-9, -_., ()!?. String: " + s), !1)
: (S.w("Validation fail - resource event - itemId: Cannot be (null), empty or above 64 characters. String: " + s), !1)
: (S.w("Validation fail - resource event - itemType: Not found in list of pre-defined available resource itemTypes. String: " + n), !1)
: (S.w("Validation fail - resource event - itemType: Cannot contain other characters than A-z, 0-9, -_., ()!?. String: " + n), !1)
: (S.w("Validation fail - resource event - itemType: Cannot be (null), empty or above 64 characters. String: " + n), !1)
: (S.w("Validation fail - resource event - itemType: Cannot be (null)"), !1)
: (S.w("Validation fail - resource event - amount: Float amount cannot be 0 or negative. Value: " + i), !1)
: (S.w("Validation fail - resource event - currency: Not found in list of pre-defined available resource currencies. String: " + e), !1)
: (S.w("Validation fail - resource event - currency: Cannot be (null)"), !1);
}),
(a.validateProgressionEvent = function (t, e, i, n) {
if (t == w.EGAProgressionStatus.Undefined) return S.w("Validation fail - progression event: Invalid progression status."), !1;
if (n && !i && e) return S.w("Validation fail - progression event: 03 found but 01+02 are invalid. Progression must be set as either 01, 01+02 or 01+02+03."), !1;
if (i && !e) return S.w("Validation fail - progression event: 02 found but not 01. Progression must be set as either 01, 01+02 or 01+02+03"), !1;
if (!e) return S.w("Validation fail - progression event: progression01 not valid. Progressions must be set as either 01, 01+02 or 01+02+03"), !1;
if (!a.validateEventPartLength(e, !1)) return S.w("Validation fail - progression event - progression01: Cannot be (null), empty or above 64 characters. String: " + e), !1;
if (!a.validateEventPartCharacters(e)) return S.w("Validation fail - progression event - progression01: Cannot contain other characters than A-z, 0-9, -_., ()!?. String: " + e), !1;
if (i) {
if (!a.validateEventPartLength(i, !0)) return S.w("Validation fail - progression event - progression02: Cannot be empty or above 64 characters. String: " + i), !1;
if (!a.validateEventPartCharacters(i)) return S.w("Validation fail - progression event - progression02: Cannot contain other characters than A-z, 0-9, -_., ()!?. String: " + i), !1;
}
if (n) {
if (!a.validateEventPartLength(n, !0)) return S.w("Validation fail - progression event - progression03: Cannot be empty or above 64 characters. String: " + n), !1;
if (!a.validateEventPartCharacters(n)) return S.w("Validation fail - progression event - progression03: Cannot contain other characters than A-z, 0-9, -_., ()!?. String: " + n), !1;
}
return !0;
}),
(a.validateDesignEvent = function (t, e) {
return a.validateEventIdLength(t)
? !!a.validateEventIdCharacters(t) || (S.w("Validation fail - design event - eventId: Non valid characters. Only allowed A-z, 0-9, -_., ()!?. String: " + t), !1)
: (S.w("Validation fail - design event - eventId: Cannot be (null) or empty. Only 5 event parts allowed seperated by :. Each part need to be 32 characters or less. String: " + t), !1);
}),
(a.validateErrorEvent = function (t, e) {
return t == w.EGAErrorSeverity.Undefined
? (S.w("Validation fail - error event - severity: Severity was unsupported value."), !1)
: !!a.validateLongString(e, !0) || (S.w("Validation fail - error event - message: Message cannot be above 8192 characters."), !1);
}),
(a.validateSdkErrorEvent = function (t, e, i) {
return !(!a.validateKeys(t, e) || (i === _.Undefined && (S.w("Validation fail - sdk error event - type: Type was unsupported value."), 1)));
}),
(a.validateKeys = function (t, e) {
return !(!E.stringMatch(t, /^[A-z0-9]{32}$/) || !E.stringMatch(e, /^[A-z0-9]{40}$/));
}),
(a.validateCurrency = function (t) {
return !!t && !!E.stringMatch(t, /^[A-Z]{3}$/);
}),
(a.validateEventPartLength = function (t, e) {
return !(!e || t) || (!!t && !(64 < t.length));
}),
(a.validateEventPartCharacters = function (t) {
return !!E.stringMatch(t, /^[A-Za-z0-9\s\-_\.\(\)\!\?]{1,64}$/);
}),
(a.validateEventIdLength = function (t) {
return !!t && !!E.stringMatch(t, /^[^:]{1,64}(?::[^:]{1,64}){0,4}$/);
}),
(a.validateEventIdCharacters = function (t) {
return !!t && !!E.stringMatch(t, /^[A-Za-z0-9\s\-_\.\(\)\!\?]{1,64}(:[A-Za-z0-9\s\-_\.\(\)\!\?]{1,64}){0,4}$/);
}),
(a.validateAndCleanInitRequestResponse = function (e) {
if (null == e) return S.w("validateInitRequestResponse failed - no response dictionary."), null;
var t = {};
try {
t.enabled = e.enabled;
} catch (t) {
return S.w("validateInitRequestResponse failed - invalid type in 'enabled' field."), null;
}
try {
var i = e.server_ts;
if (!(0 < i)) return S.w("validateInitRequestResponse failed - invalid value in 'server_ts' field."), null;
t.server_ts = i;
} catch (t) {
return S.w("validateInitRequestResponse failed - invalid type in 'server_ts' field. type=" + typeof e.server_ts + ", value=" + e.server_ts + ", " + t), null;
}
try {
var n = e.configurations;
t.configurations = n;
} catch (t) {
return S.w("validateInitRequestResponse failed - invalid type in 'configurations' field. type=" + typeof e.configurations + ", value=" + e.configurations + ", " + t), null;
}
return t;
}),
(a.validateBuild = function (t) {
return !!a.validateShortString(t, !1);
}),
(a.validateSdkWrapperVersion = function (t) {
return !!E.stringMatch(t, /^(unity|unreal|gamemaker|cocos2d|construct|defold) [0-9]{0,5}(\.[0-9]{0,5}){0,2}$/);
}),
(a.validateEngineVersion = function (t) {
return !(!t || !E.stringMatch(t, /^(unity|unreal|gamemaker|cocos2d|construct|defold) [0-9]{0,5}(\.[0-9]{0,5}){0,2}$/));
}),
(a.validateUserId = function (t) {
return !!a.validateString(t, !1) || (S.w("Validation fail - user id: id cannot be (null), empty or above 64 characters."), !1);
}),
(a.validateShortString = function (t, e) {
return !(!e || t) || !(!t || 32 < t.length);
}),
(a.validateString = function (t, e) {
return !(!e || t) || !(!t || 64 < t.length);
}),
(a.validateLongString = function (t, e) {
return !(!e || t) || !(!t || 8192 < t.length);
}),
(a.validateConnectionType = function (t) {
return E.stringMatch(t, /^(wwan|wifi|lan|offline)$/);
}),
(a.validateCustomDimensions = function (t) {
return a.validateArrayOfStrings(20, 32, !1, "custom dimensions", t);
}),
(a.validateResourceCurrencies = function (t) {
if (!a.validateArrayOfStrings(20, 64, !1, "resource currencies", t)) return !1;
for (var e = 0; e < t.length; ++e) if (!E.stringMatch(t[e], /^[A-Za-z]+$/)) return S.w("resource currencies validation failed: a resource currency can only be A-Z, a-z. String was: " + t[e]), !1;
return !0;
}),
(a.validateResourceItemTypes = function (t) {
if (!a.validateArrayOfStrings(20, 32, !1, "resource item types", t)) return !1;
for (var e = 0; e < t.length; ++e)
if (!a.validateEventPartCharacters(t[e])) return S.w("resource item types validation failed: a resource item type cannot contain other characters than A-z, 0-9, -_., ()!?. String was: " + t[e]), !1;
return !0;
}),
(a.validateDimension01 = function (t, e) {
return !t || !!E.stringArrayContainsString(e, t);
}),
(a.validateDimension02 = function (t, e) {
return !t || !!E.stringArrayContainsString(e, t);
}),
(a.validateDimension03 = function (t, e) {
return !t || !!E.stringArrayContainsString(e, t);
}),
(a.validateArrayOfStrings = function (t, e, i, n, s) {
var r = n;
if ((r || (r = "Array"), !s)) return S.w(r + " validation failed: array cannot be null. "), !1;
if (0 == i && 0 == s.length) return S.w(r + " validation failed: array cannot be empty. "), !1;
if (0 < t && s.length > t) return S.w(r + " validation failed: array cannot exceed " + t + " values. It has " + s.length + " values."), !1;
for (var o = 0; o < s.length; ++o) {
var a = s[o] ? s[o].length : 0;
if (0 === a) return S.w(r + " validation failed: contained an empty string. Array=" + JSON.stringify(s)), !1;
if (0 < e && e < a) return S.w(r + " validation failed: a string exceeded max allowed length (which is: " + e + "). String was: " + s[o]), !1;
}
return !0;
}),
(a.validateFacebookId = function (t) {
return !!a.validateString(t, !1) || (S.w("Validation fail - facebook id: id cannot be (null), empty or above 64 characters."), !1);
}),
(a.validateGender = function (t) {
if (isNaN(Number(w.EGAGender[t]))) {
if (t == w.EGAGender.Undefined || (t != w.EGAGender.Male && t != w.EGAGender.Female)) return S.w("Validation fail - gender: Has to be 'male' or 'female'. Was: " + t), !1;
} else if (t == w.EGAGender[w.EGAGender.Undefined] || (t != w.EGAGender[w.EGAGender.Male] && t != w.EGAGender[w.EGAGender.Female])) return S.w("Validation fail - gender: Has to be 'male' or 'female'. Was: " + t), !1;
return !0;
}),
(a.validateBirthyear = function (t) {
return !(t < 0 || 9999 < t) || (S.w("Validation fail - birthYear: Cannot be (null) or invalid range."), !1);
}),
(a.validateClientTs = function (t) {
return !(t < -4294967294 || 4294967294 < t);
}),
a
);
})()),
(T.GAValidator = P),
(function (t) {
var e = function (t, e, i) {
(this.name = t), (this.value = e), (this.version = i);
};
t.NameValueVersion = e;
var u = function (t, e) {
(this.name = t), (this.version = e);
};
t.NameVersion = u;
var i = (function () {
function s() {}
return (
(s.touch = function () {}),
(s.getRelevantSdkVersion = function () {
return s.sdkGameEngineVersion ? s.sdkGameEngineVersion : s.sdkWrapperVersion;
}),
(s.getConnectionType = function () {
return s.connectionType;
}),
(s.updateConnectionType = function () {
s.connectionType = navigator.onLine ? ("ios" === s.buildPlatform || "android" === s.buildPlatform ? "wwan" : "lan") : "offline";
}),
(s.getOSVersionString = function () {
return s.buildPlatform + " " + s.osVersionPair.version;
}),
(s.runtimePlatformToString = function () {
return s.osVersionPair.name;
}),
(s.getBrowserVersionString = function () {
var t,
e = navigator.userAgent,
i = e.match(/(opera|chrome|safari|firefox|ubrowser|msie|trident|fbav(?=\/))\/?\s*(\d+)/i) || [];
if (0 == i.length && "ios" === s.buildPlatform) return "webkit_" + s.osVersion;
if (/trident/i.test(i[1])) return "IE " + ((t = /\brv[ :]+(\d+)/g.exec(e) || [])[1] || "");
if ("Chrome" === i[1] && null != (t = e.match(/\b(OPR|Edge|UBrowser)\/(\d+)/))) return t.slice(1).join(" ").replace("OPR", "Opera").replace("UBrowser", "UC").toLowerCase();
if (i[1] && "fbav" === i[1].toLowerCase() && ((i[1] = "facebook"), i[2])) return "facebook " + i[2];
var n = i[2] ? [i[1], i[2]] : [navigator.appName, navigator.appVersion, "-?"];
return null != (t = e.match(/version\/(\d+)/i)) && n.splice(1, 1, t[1]), n.join(" ").toLowerCase();
}),
(s.getDeviceModel = function () {
return "unknown";
}),
(s.getDeviceManufacturer = function () {
return "unknown";
}),
(s.matchItem = function (t, e) {
var i,
n,
s,
r,
o = new u("unknown", "0.0.0"),
a = 0,
h = 0;
for (a = 0; a < e.length; a += 1)
if (new RegExp(e[a].value, "i").test(t)) {
if (((i = new RegExp(e[a].version + "[- /:;]([\\d._]+)", "i")), (r = ""), (n = t.match(i)) && n[1] && (s = n[1]), s)) {
var l = s.split(/[._]+/);
for (h = 0; h < Math.min(l.length, 3); h += 1) r += l[h] + (h < Math.min(l.length, 3) - 1 ? "." : "");
} else r = "0.0.0";
return (o.name = e[a].name), (o.version = r), o;
}
return o;
}),
(s.sdkWrapperVersion = "javascript 3.1.2"),
(s.osVersionPair = s.matchItem([navigator.platform, navigator.userAgent, navigator.appVersion, navigator.vendor].join(" "), [
new e("windows_phone", "Windows Phone", "OS"),
new e("windows", "Win", "NT"),
new e("ios", "iPhone", "OS"),
new e("ios", "iPad", "OS"),
new e("ios", "iPod", "OS"),
new e("android", "Android", "Android"),
new e("blackBerry", "BlackBerry", "/"),
new e("mac_osx", "Mac", "OS X"),
new e("tizen", "Tizen", "Tizen"),
new e("linux", "Linux", "rv"),
])),
(s.buildPlatform = s.runtimePlatformToString()),
(s.deviceModel = s.getDeviceModel()),
(s.deviceManufacturer = s.getDeviceManufacturer()),
(s.osVersion = s.getOSVersionString()),
(s.browserVersion = s.getBrowserVersionString()),
(s.maxSafeInteger = Math.pow(2, 53) - 1),
s
);
})();
t.GADevice = i;
})((A = St || (St = {})).device || (A.device = {})),
(M = St || (St = {})),
(C = M.threading || (M.threading = {})),
(O = (function () {
function e(t) {
(this.deadline = t), (this.ignore = !1), (this.async = !1), (this.running = !1), (this.id = ++e.idCounter);
}
return (e.idCounter = 0), e;
})()),
(C.TimedBlock = O),
(k = St || (St = {})),
(R = k.threading || (k.threading = {})),
(L = (function () {
function t(t) {
(this.comparer = t), (this._subQueues = {}), (this._sortedKeys = []);
}
return (
(t.prototype.enqueue = function (t, e) {
-1 === this._sortedKeys.indexOf(t) && this.addQueueOfPriority(t), this._subQueues[t].push(e);
}),
(t.prototype.addQueueOfPriority = function (t) {
var i = this;
this._sortedKeys.push(t),
this._sortedKeys.sort(function (t, e) {
return i.comparer.compare(t, e);
}),
(this._subQueues[t] = []);
}),
(t.prototype.peek = function () {
if (this.hasItems()) return this._subQueues[this._sortedKeys[0]][0];
throw new Error("The queue is empty");
}),
(t.prototype.hasItems = function () {
return 0 < this._sortedKeys.length;
}),
(t.prototype.dequeue = function () {
if (this.hasItems()) return this.dequeueFromHighPriorityQueue();
throw new Error("The queue is empty");
}),
(t.prototype.dequeueFromHighPriorityQueue = function () {
var t = this._sortedKeys[0],
e = this._subQueues[t].shift();
return 0 === this._subQueues[t].length && (this._sortedKeys.shift(), delete this._subQueues[t]), e;
}),
t
);
})()),
(R.PriorityQueue = L),
(function (t) {
var d,
e,
i,
n,
s = I.logging.GALogger;
((e = d = t.EGAStoreArgsOperator || (t.EGAStoreArgsOperator = {}))[(e.Equal = 0)] = "Equal"),
(e[(e.LessOrEqual = 1)] = "LessOrEqual"),
(e[(e.NotEqual = 2)] = "NotEqual"),
((n = i = t.EGAStore || (t.EGAStore = {}))[(n.Events = 0)] = "Events"),
(n[(n.Sessions = 1)] = "Sessions"),
(n[(n.Progression = 2)] = "Progression");
var r = (function () {
function c() {
(this.eventsStore = []), (this.sessionsStore = []), (this.progressionStore = []), (this.storeItems = {});
try {
c.storageAvailable = "object" == typeof localStorage && (localStorage.setItem("testingLocalStorage", "yes"), localStorage.removeItem("testingLocalStorage"), !0);
} catch (t) {}
}
return (
(c.isStorageAvailable = function () {
return c.storageAvailable;
}),
(c.isStoreTooLargeForEvents = function () {
return c.instance.eventsStore.length + c.instance.sessionsStore.length > c.MaxNumberOfEntries;
}),
(c.select = function (t, e, i, n) {
void 0 === e && (e = []), void 0 === i && (i = !1), void 0 === n && (n = 0);
var s = c.getStore(t);
if (!s) return null;
for (var r = [], o = 0; o < s.length; ++o) {
for (var a = s[o], h = !0, l = 0; l < e.length; ++l) {
var u = e[l];
if (a[u[0]])
switch (u[1]) {
case d.Equal:
h = a[u[0]] == u[2];
break;
case d.LessOrEqual:
h = a[u[0]] <= u[2];
break;
case d.NotEqual:
h = a[u[0]] != u[2];
break;
default:
h = !1;
}
else h = !1;
if (!h) break;
}
h && r.push(a);
}
return (
i &&
r.sort(function (t, e) {
return t.client_ts - e.client_ts;
}),
0 < n && r.length > n && (r = r.slice(0, n + 1)),
r
);
}),
(c.update = function (t, e, i) {
void 0 === i && (i = []);
var n = c.getStore(t);
if (!n) return !1;
for (var s = 0; s < n.length; ++s) {
for (var r = n[s], o = !0, a = 0; a < i.length; ++a) {
var h = i[a];
if (r[h[0]])
switch (h[1]) {
case d.Equal:
o = r[h[0]] == h[2];
break;
case d.LessOrEqual:
o = r[h[0]] <= h[2];
break;
case d.NotEqual:
o = r[h[0]] != h[2];
break;
default:
o = !1;
}
else o = !1;
if (!o) break;
}
if (o)
for (a = 0; a < e.length; ++a) {
var l = e[a];
r[l[0]] = l[1];
}
}
return !0;
}),
(c.delete = function (t, e) {
var i = c.getStore(t);
if (i)
for (var n = 0; n < i.length; ++n) {
for (var s = i[n], r = !0, o = 0; o < e.length; ++o) {
var a = e[o];
if (s[a[0]])
switch (a[1]) {
case d.Equal:
r = s[a[0]] == a[2];
break;
case d.LessOrEqual:
r = s[a[0]] <= a[2];
break;
case d.NotEqual:
r = s[a[0]] != a[2];
break;
default:
r = !1;
}
else r = !1;
if (!r) break;
}
r && (i.splice(n, 1), --n);
}
}),
(c.insert = function (t, e, i, n) {
void 0 === i && (i = !1), void 0 === n && (n = null);
var s = c.getStore(t);
if (s)
if (i) {
if (!n) return;
for (var r = !1, o = 0; o < s.length; ++o) {
var a = s[o];
if (a[n] == e[n]) {
for (var h in e) a[h] = e[h];
r = !0;
break;
}
}
r || s.push(e);
} else s.push(e);
}),
(c.save = function () {
c.isStorageAvailable()
? (localStorage.setItem(c.KeyPrefix + c.EventsStoreKey, JSON.stringify(c.instance.eventsStore)),
localStorage.setItem(c.KeyPrefix + c.SessionsStoreKey, JSON.stringify(c.instance.sessionsStore)),
localStorage.setItem(c.KeyPrefix + c.ProgressionStoreKey, JSON.stringify(c.instance.progressionStore)),
localStorage.setItem(c.KeyPrefix + c.ItemsStoreKey, JSON.stringify(c.instance.storeItems)))
: s.w("Storage is not available, cannot save.");
}),
(c.load = function () {
if (c.isStorageAvailable()) {
try {
(c.instance.eventsStore = JSON.parse(localStorage.getItem(c.KeyPrefix + c.EventsStoreKey))), c.instance.eventsStore || (c.instance.eventsStore = []);
} catch (t) {
s.w("Load failed for 'events' store. Using empty store."), (c.instance.eventsStore = []);
}
try {
(c.instance.sessionsStore = JSON.parse(localStorage.getItem(c.KeyPrefix + c.SessionsStoreKey))), c.instance.sessionsStore || (c.instance.sessionsStore = []);
} catch (t) {
s.w("Load failed for 'sessions' store. Using empty store."), (c.instance.sessionsStore = []);
}
try {
(c.instance.progressionStore = JSON.parse(localStorage.getItem(c.KeyPrefix + c.ProgressionStoreKey))), c.instance.progressionStore || (c.instance.progressionStore = []);
} catch (t) {
s.w("Load failed for 'progression' store. Using empty store."), (c.instance.progressionStore = []);
}
try {
(c.instance.storeItems = JSON.parse(localStorage.getItem(c.KeyPrefix + c.ItemsStoreKey))), c.instance.storeItems || (c.instance.storeItems = {});
} catch (t) {
s.w("Load failed for 'items' store. Using empty store."), (c.instance.progressionStore = []);
}
} else s.w("Storage is not available, cannot load.");
}),
(c.setItem = function (t, e) {
var i = c.KeyPrefix + t;
e ? (c.instance.storeItems[i] = e) : i in c.instance.storeItems && delete c.instance.storeItems[i];
}),
(c.getItem = function (t) {
var e = c.KeyPrefix + t;
return e in c.instance.storeItems ? c.instance.storeItems[e] : null;
}),
(c.getStore = function (t) {
switch (t) {
case i.Events:
return c.instance.eventsStore;
case i.Sessions:
return c.instance.sessionsStore;
case i.Progression:
return c.instance.progressionStore;
default:
return s.w("GAStore.getStore(): Cannot find store: " + t), null;
}
}),
(c.instance = new c()),
(c.MaxNumberOfEntries = 2e3),
(c.KeyPrefix = "GA::"),
(c.EventsStoreKey = "ga_event"),
(c.SessionsStoreKey = "ga_session"),
(c.ProgressionStoreKey = "ga_progression"),
(c.ItemsStoreKey = "ga_items"),
c
);
})();
t.GAStore = r;
})((I = St || (St = {})).store || (I.store = {})),
(D = St || (St = {})),
(F = D.state || (D.state = {})),
(B = D.validators.GAValidator),
(N = D.utilities.GAUtilities),
(U = D.logging.GALogger),
(Y = D.store.GAStore),
(z = D.device.GADevice),
(X = D.store.EGAStore),
(V = D.store.EGAStoreArgsOperator),
(G = (function () {
function u() {
(this.availableCustomDimensions01 = []),
(this.availableCustomDimensions02 = []),
(this.availableCustomDimensions03 = []),
(this.availableResourceCurrencies = []),
(this.availableResourceItemTypes = []),
(this.configurations = {}),
(this.commandCenterListeners = []),
(this.sdkConfigDefault = {}),
(this.sdkConfig = {}),
(this.progressionTries = {}),
(this._isEventSubmissionEnabled = !0);
}
return (
(u.setUserId = function (t) {
(u.instance.userId = t), u.cacheIdentifier();
}),
(u.getIdentifier = function () {
return u.instance.identifier;
}),
(u.isInitialized = function () {
return u.instance.initialized;
}),
(u.setInitialized = function (t) {
u.instance.initialized = t;
}),
(u.getSessionStart = function () {
return u.instance.sessionStart;
}),
(u.getSessionNum = function () {
return u.instance.sessionNum;
}),
(u.getTransactionNum = function () {
return u.instance.transactionNum;
}),
(u.getSessionId = function () {
return u.instance.sessionId;
}),
(u.getCurrentCustomDimension01 = function () {
return u.instance.currentCustomDimension01;
}),
(u.getCurrentCustomDimension02 = function () {
return u.instance.currentCustomDimension02;
}),
(u.getCurrentCustomDimension03 = function () {
return u.instance.currentCustomDimension03;
}),
(u.getGameKey = function () {
return u.instance.gameKey;
}),
(u.getGameSecret = function () {
return u.instance.gameSecret;
}),
(u.getAvailableCustomDimensions01 = function () {
return u.instance.availableCustomDimensions01;
}),
(u.setAvailableCustomDimensions01 = function (t) {
B.validateCustomDimensions(t) && ((u.instance.availableCustomDimensions01 = t), u.validateAndFixCurrentDimensions(), U.i("Set available custom01 dimension values: (" + N.joinStringArray(t, ", ") + ")"));
}),
(u.getAvailableCustomDimensions02 = function () {
return u.instance.availableCustomDimensions02;
}),
(u.setAvailableCustomDimensions02 = function (t) {
B.validateCustomDimensions(t) && ((u.instance.availableCustomDimensions02 = t), u.validateAndFixCurrentDimensions(), U.i("Set available custom02 dimension values: (" + N.joinStringArray(t, ", ") + ")"));
}),
(u.getAvailableCustomDimensions03 = function () {
return u.instance.availableCustomDimensions03;
}),
(u.setAvailableCustomDimensions03 = function (t) {
B.validateCustomDimensions(t) && ((u.instance.availableCustomDimensions03 = t), u.validateAndFixCurrentDimensions(), U.i("Set available custom03 dimension values: (" + N.joinStringArray(t, ", ") + ")"));
}),
(u.getAvailableResourceCurrencies = function () {
return u.instance.availableResourceCurrencies;
}),
(u.setAvailableResourceCurrencies = function (t) {
B.validateResourceCurrencies(t) && ((u.instance.availableResourceCurrencies = t), U.i("Set available resource currencies: (" + N.joinStringArray(t, ", ") + ")"));
}),
(u.getAvailableResourceItemTypes = function () {
return u.instance.availableResourceItemTypes;
}),
(u.setAvailableResourceItemTypes = function (t) {
B.validateResourceItemTypes(t) && ((u.instance.availableResourceItemTypes = t), U.i("Set available resource item types: (" + N.joinStringArray(t, ", ") + ")"));
}),
(u.getBuild = function () {
return u.instance.build;
}),
(u.setBuild = function (t) {
(u.instance.build = t), U.i("Set build version: " + t);
}),
(u.getUseManualSessionHandling = function () {
return u.instance.useManualSessionHandling;
}),
(u.isEventSubmissionEnabled = function () {
return u.instance._isEventSubmissionEnabled;
}),
(u.prototype.setDefaultId = function (t) {
(this.defaultUserId = t || ""), u.cacheIdentifier();
}),
(u.getDefaultId = function () {
return u.instance.defaultUserId;
}),
(u.getSdkConfig = function () {
var t,
e = 0;
for (var i in u.instance.sdkConfig) 0 === e && (t = i), ++e;
if (t && 0 < e) return u.instance.sdkConfig;
for (var i in ((e = 0), u.instance.sdkConfigCached)) 0 === e && (t = i), ++e;
return t && 0 < e ? u.instance.sdkConfigCached : u.instance.sdkConfigDefault;
}),
(u.isEnabled = function () {
var t = u.getSdkConfig();
return !((t.enabled && "false" == t.enabled) || !u.instance.initAuthorized);
}),
(u.setCustomDimension01 = function (t) {
(u.instance.currentCustomDimension01 = t), Y.setItem(u.Dimension01Key, t), U.i("Set custom01 dimension value: " + t);
}),
(u.setCustomDimension02 = function (t) {
(u.instance.currentCustomDimension02 = t), Y.setItem(u.Dimension02Key, t), U.i("Set custom02 dimension value: " + t);
}),
(u.setCustomDimension03 = function (t) {
(u.instance.currentCustomDimension03 = t), Y.setItem(u.Dimension03Key, t), U.i("Set custom03 dimension value: " + t);
}),
(u.setFacebookId = function (t) {
(u.instance.facebookId = t), Y.setItem(u.FacebookIdKey, t), U.i("Set facebook id: " + t);
}),
(u.setGender = function (t) {
(u.instance.gender = isNaN(Number(D.EGAGender[t])) ? D.EGAGender[t].toString().toLowerCase() : D.EGAGender[D.EGAGender[t]].toString().toLowerCase()),
Y.setItem(u.GenderKey, u.instance.gender),
U.i("Set gender: " + u.instance.gender);
}),
(u.setBirthYear = function (t) {
(u.instance.birthYear = t), Y.setItem(u.BirthYearKey, t.toString()), U.i("Set birth year: " + t);
}),
(u.incrementSessionNum = function () {
var t = u.getSessionNum() + 1;
u.instance.sessionNum = t;
}),
(u.incrementTransactionNum = function () {
var t = u.getTransactionNum() + 1;
u.instance.transactionNum = t;
}),
(u.incrementProgressionTries = function (t) {
var e = u.getProgressionTries(t) + 1;
u.instance.progressionTries[t] = e;
var i = {};
(i.progression = t), (i.tries = e), Y.insert(X.Progression, i, !0, "progression");
}),
(u.getProgressionTries = function (t) {
return t in u.instance.progressionTries ? u.instance.progressionTries[t] : 0;
}),
(u.clearProgressionTries = function (t) {
t in u.instance.progressionTries && delete u.instance.progressionTries[t];
var e = [];
e.push(["progression", V.Equal, t]), Y.delete(X.Progression, e);
}),
(u.setKeys = function (t, e) {
(u.instance.gameKey = t), (u.instance.gameSecret = e);
}),
(u.setManualSessionHandling = function (t) {
(u.instance.useManualSessionHandling = t), U.i("Use manual session handling: " + t);
}),
(u.setEnabledEventSubmission = function (t) {
u.instance._isEventSubmissionEnabled = t;
}),
(u.getEventAnnotations = function () {
var t = { v: 2 };
(t.user_id = u.instance.identifier),
(t.client_ts = u.getClientTsAdjusted()),
(t.sdk_version = z.getRelevantSdkVersion()),
(t.os_version = z.osVersion),
(t.manufacturer = z.deviceManufacturer),
(t.device = z.deviceModel),
(t.browser_version = z.browserVersion),
(t.platform = z.buildPlatform),
(t.session_id = u.instance.sessionId),
(t[u.SessionNumKey] = u.instance.sessionNum);
var e = z.getConnectionType();
return (
B.validateConnectionType(e) && (t.connection_type = e),
z.gameEngineVersion && (t.engine_version = z.gameEngineVersion),
u.instance.build && (t.build = u.instance.build),
u.instance.facebookId && (t[u.FacebookIdKey] = u.instance.facebookId),
u.instance.gender && (t[u.GenderKey] = u.instance.gender),
0 != u.instance.birthYear && (t[u.BirthYearKey] = u.instance.birthYear),
t
);
}),
(u.getSdkErrorEventAnnotations = function () {
var t = { v: 2 };
(t.category = u.CategorySdkError), (t.sdk_version = z.getRelevantSdkVersion()), (t.os_version = z.osVersion), (t.manufacturer = z.deviceManufacturer), (t.device = z.deviceModel), (t.platform = z.buildPlatform);
var e = z.getConnectionType();
return B.validateConnectionType(e) && (t.connection_type = e), z.gameEngineVersion && (t.engine_version = z.gameEngineVersion), t;
}),
(u.getInitAnnotations = function () {
var t = {};
return (t.user_id = u.getIdentifier()), (t.sdk_version = z.getRelevantSdkVersion()), (t.os_version = z.osVersion), (t.platform = z.buildPlatform), t;
}),
(u.getClientTsAdjusted = function () {
var t = N.timeIntervalSince1970(),
e = t + u.instance.clientServerTimeOffset;
return B.validateClientTs(e) ? e : t;
}),
(u.sessionIsStarted = function () {
return 0 != u.instance.sessionStart;
}),
(u.cacheIdentifier = function () {
u.instance.userId ? (u.instance.identifier = u.instance.userId) : u.instance.defaultUserId && (u.instance.identifier = u.instance.defaultUserId);
}),
(u.ensurePersistedStates = function () {
Y.isStorageAvailable() && Y.load();
var t = u.instance;
t.setDefaultId(null != Y.getItem(u.DefaultUserIdKey) ? Y.getItem(u.DefaultUserIdKey) : N.createGuid()),
(t.sessionNum = null != Y.getItem(u.SessionNumKey) ? Number(Y.getItem(u.SessionNumKey)) : 0),
(t.transactionNum = null != Y.getItem(u.TransactionNumKey) ? Number(Y.getItem(u.TransactionNumKey)) : 0),
t.facebookId ? Y.setItem(u.FacebookIdKey, t.facebookId) : ((t.facebookId = null != Y.getItem(u.FacebookIdKey) ? Y.getItem(u.FacebookIdKey) : ""), t.facebookId),
t.gender ? Y.setItem(u.GenderKey, t.gender) : ((t.gender = null != Y.getItem(u.GenderKey) ? Y.getItem(u.GenderKey) : ""), t.gender),
t.birthYear && 0 != t.birthYear ? Y.setItem(u.BirthYearKey, t.birthYear.toString()) : ((t.birthYear = null != Y.getItem(u.BirthYearKey) ? Number(Y.getItem(u.BirthYearKey)) : 0), t.birthYear),
t.currentCustomDimension01
? Y.setItem(u.Dimension01Key, t.currentCustomDimension01)
: ((t.currentCustomDimension01 = null != Y.getItem(u.Dimension01Key) ? Y.getItem(u.Dimension01Key) : ""), t.currentCustomDimension01),
t.currentCustomDimension02
? Y.setItem(u.Dimension02Key, t.currentCustomDimension02)
: ((t.currentCustomDimension02 = null != Y.getItem(u.Dimension02Key) ? Y.getItem(u.Dimension02Key) : ""), t.currentCustomDimension02),
t.currentCustomDimension03
? Y.setItem(u.Dimension03Key, t.currentCustomDimension03)
: ((t.currentCustomDimension03 = null != Y.getItem(u.Dimension03Key) ? Y.getItem(u.Dimension03Key) : ""), t.currentCustomDimension03);
var e = null != Y.getItem(u.SdkConfigCachedKey) ? Y.getItem(u.SdkConfigCachedKey) : "";
if (e) {
var i = JSON.parse(N.decode64(e));
i && (t.sdkConfigCached = i);
}
var n = Y.select(X.Progression);
if (n)
for (var s = 0; s < n.length; ++s) {
var r = n[s];
r && (t.progressionTries[r.progression] = r.tries);
}
}),
(u.calculateServerTimeOffset = function (t) {
return t - N.timeIntervalSince1970();
}),
(u.validateAndCleanCustomFields = function (t) {
var e = {};
if (t) {
var i = 0;
for (var n in t) {
var s = t[n];
if (n && s)
if (i < u.MAX_CUSTOM_FIELDS_COUNT) {
var r = new RegExp("^[a-zA-Z0-9_]{1," + u.MAX_CUSTOM_FIELDS_KEY_LENGTH + "}$");
if (N.stringMatch(n, r)) {
var o = typeof s;
if ("string" === o || s instanceof String) {
var a = s;
a.length <= u.MAX_CUSTOM_FIELDS_VALUE_STRING_LENGTH && 0 < a.length
? ((e[n] = a), ++i)
: U.w(
"validateAndCleanCustomFields: entry with key=" +
n +
", value=" +
s +
" has been omitted because its value is an empty string or exceeds the max number of characters (" +
u.MAX_CUSTOM_FIELDS_VALUE_STRING_LENGTH +
")"
);
} else if ("number" === o || s instanceof Number) {
var h = s;
(e[n] = h), ++i;
} else U.w("validateAndCleanCustomFields: entry with key=" + n + ", value=" + s + " has been omitted because its value is not a string or number");
} else
U.w(
"validateAndCleanCustomFields: entry with key=" +
n +
", value=" +
s +
" has been omitted because its key contains illegal character, is empty or exceeds the max number of characters (" +
u.MAX_CUSTOM_FIELDS_KEY_LENGTH +
")"
);
} else U.w("validateAndCleanCustomFields: entry with key=" + n + ", value=" + s + " has been omitted because it exceeds the max number of custom fields (" + u.MAX_CUSTOM_FIELDS_COUNT + ")");
else U.w("validateAndCleanCustomFields: entry with key=" + n + ", value=" + s + " has been omitted because its key or value is null");
}
}
return e;
}),
(u.validateAndFixCurrentDimensions = function () {
B.validateDimension01(u.getCurrentCustomDimension01(), u.getAvailableCustomDimensions01()) || u.setCustomDimension01(""),
B.validateDimension02(u.getCurrentCustomDimension02(), u.getAvailableCustomDimensions02()) || u.setCustomDimension02(""),
B.validateDimension03(u.getCurrentCustomDimension03(), u.getAvailableCustomDimensions03()) || u.setCustomDimension03("");
}),
(u.getConfigurationStringValue = function (t, e) {
return u.instance.configurations[t] ? u.instance.configurations[t].toString() : e;
}),
(u.isCommandCenterReady = function () {
return u.instance.commandCenterIsReady;
}),
(u.addCommandCenterListener = function (t) {
u.instance.commandCenterListeners.indexOf(t) < 0 && u.instance.commandCenterListeners.push(t);
}),
(u.removeCommandCenterListener = function (t) {
var e = u.instance.commandCenterListeners.indexOf(t);
-1 < e && u.instance.commandCenterListeners.splice(e, 1);
}),
(u.getConfigurationsContentAsString = function () {
return JSON.stringify(u.instance.configurations);
}),
(u.populateConfigurations = function (t) {
var e = t.configurations;
if (e)
for (var i = 0; i < e.length; ++i) {
var n = e[i];
if (n) {
var s = n.key,
r = n.value,
o = n.start ? n.start : Number.MIN_VALUE,
a = n.end ? n.end : Number.MAX_VALUE,
h = u.getClientTsAdjusted();
s && r && o < h && h < a && (u.instance.configurations[s] = r);
}
}
u.instance.commandCenterIsReady = !0;
var l = u.instance.commandCenterListeners;
for (i = 0; i < l.length; ++i) l[i] && l[i].onCommandCenterUpdated();
}),
(u.CategorySdkError = "sdk_error"),
(u.MAX_CUSTOM_FIELDS_COUNT = 50),
(u.MAX_CUSTOM_FIELDS_KEY_LENGTH = 64),
(u.MAX_CUSTOM_FIELDS_VALUE_STRING_LENGTH = 256),
(u.instance = new u()),
(u.DefaultUserIdKey = "default_user_id"),
(u.SessionNumKey = "session_num"),
(u.TransactionNumKey = "transaction_num"),
(u.FacebookIdKey = "facebook_id"),
(u.GenderKey = "gender"),
(u.BirthYearKey = "birth_year"),
(u.Dimension01Key = "dimension01"),
(u.Dimension02Key = "dimension02"),
(u.Dimension03Key = "dimension03"),
(u.SdkConfigCachedKey = "sdk_config_cached"),
u
);
})()),
(F.GAState = G),
(j = St || (St = {})),
(H = j.tasks || (j.tasks = {})),
(W = j.utilities.GAUtilities),
(K = j.logging.GALogger),
(q = (function () {
function o() {}
return (
(o.execute = function (t, e, i, n) {
if ((o.countMap[e] || (o.countMap[e] = 0), !(o.countMap[e] >= o.MaxCount))) {
var s = W.getHmac(n, i),
r = new XMLHttpRequest();
(r.onreadystatechange = function () {
if (4 === r.readyState) {
if (!r.responseText) return;
if (200 != r.status) return void K.w("sdk error failed. response code not 200. status code: " + r.status + ", description: " + r.statusText + ", body: " + r.responseText);
o.countMap[e] = o.countMap[e] + 1;
}
}),
r.open("POST", t, !0),
r.setRequestHeader("Content-Type", "application/json"),
r.setRequestHeader("Authorization", s);
try {
r.send(i);
} catch (t) {}
}
}),
(o.MaxCount = 10),
(o.countMap = {}),
o
);
})()),
(H.SdkErrorTask = q),
(Z = St || (St = {})),
(J = Z.http || (Z.http = {})),
(Q = Z.state.GAState),
($ = Z.logging.GALogger),
(tt = Z.utilities.GAUtilities),
(et = Z.validators.GAValidator),
(it = Z.tasks.SdkErrorTask),
(nt = (function () {
function u() {
(this.protocol = "https"),
(this.hostName = "api.gameanalytics.com"),
(this.version = "v2"),
(this.baseUrl = this.protocol + "://" + this.hostName + "/" + this.version),
(this.initializeUrlPath = "init"),
(this.eventsUrlPath = "events"),
(this.useGzip = !1);
}
return (
(u.prototype.requestInit = function (t) {
var e = Q.getGameKey(),
i = (this.baseUrl, this.initializeUrlPath);
i = "https://rubick.gameanalytics.com/v2/command_center?game_key=" + e + "&interval_seconds=1000000";
var n = Q.getInitAnnotations(),
s = JSON.stringify(n);
if (s) {
var r = this.createPayloadData(s, this.useGzip),
o = [];
o.push(s), u.sendRequest(i, r, o, this.useGzip, u.initRequestCallback, t);
} else t(J.EGAHTTPApiResponse.JsonEncodeFailed, null);
}),
(u.prototype.sendEventsInArray = function (t, e, i) {
if (0 != t.length) {
var n = Q.getGameKey(),
s = this.baseUrl + "/" + n + "/" + this.eventsUrlPath,
r = JSON.stringify(t);
if (r) {
var o = this.createPayloadData(r, this.useGzip),
a = [];
a.push(r), a.push(e), a.push(t.length.toString()), u.sendRequest(s, o, a, this.useGzip, u.sendEventInArrayRequestCallback, i);
} else i(J.EGAHTTPApiResponse.JsonEncodeFailed, null, e, t.length);
}
}),
(u.prototype.sendSdkErrorEvent = function (t) {
if (Q.isEventSubmissionEnabled()) {
var e = Q.getGameKey(),
i = Q.getGameSecret();
if (et.validateSdkErrorEvent(e, i, t)) {
var n,
s = this.baseUrl + "/" + e + "/" + this.eventsUrlPath,
r = Q.getSdkErrorEventAnnotations(),
o = u.sdkErrorTypeToString(t);
r.type = o;
var a = [];
a.push(r), (n = JSON.stringify(a)) ? it.execute(s, t, n, i) : $.w("sendSdkErrorEvent: JSON encoding failed.");
}
}
}),
(u.sendEventInArrayRequestCallback = function (t, e, i, n) {
void 0 === n && (n = null), n[0], n[1];
var s,
r,
o = n[2],
a = parseInt(n[3]);
(s = t.responseText), (r = t.status);
var h = u.instance.processRequestResponse(r, t.statusText, s, "Events");
if (h == J.EGAHTTPApiResponse.Ok || h == J.EGAHTTPApiResponse.BadRequest) {
var l = s ? JSON.parse(s) : {};
null != l ? (J.EGAHTTPApiResponse.BadRequest, i(h, l, o, a)) : i(J.EGAHTTPApiResponse.JsonDecodeFailed, null, o, a);
} else i(h, null, o, a);
}),
(u.sendRequest = function (t, e, i, n, s, r) {
var o = new XMLHttpRequest(),
a = Q.getGameSecret(),
h = tt.getHmac(a, e),
l = [];
for (var u in (l.push(h), i)) l.push(i[u]);
if (
((o.onreadystatechange = function () {
4 === o.readyState && s(o, t, r, l);
}),
o.open("POST", t, !0),
o.setRequestHeader("Content-Type", "text/plain"),
o.setRequestHeader("Authorization", h),
n)
)
throw new Error("gzip not supported");
try {
o.send(e);
} catch (t) {}
}),
(u.initRequestCallback = function (t, e, i, n) {
var s, r;
void 0 === n && (n = null), n[0], n[1], (s = t.responseText), (r = t.status);
var o = s ? JSON.parse(s) : {},
a = u.instance.processRequestResponse(r, t.statusText, s, "Init");
if (a == J.EGAHTTPApiResponse.Ok || a == J.EGAHTTPApiResponse.BadRequest)
if (null != o)
if (a !== J.EGAHTTPApiResponse.BadRequest) {
var h = et.validateAndCleanInitRequestResponse(o);
h ? i(J.EGAHTTPApiResponse.Ok, h, "", 0) : i(J.EGAHTTPApiResponse.BadResponse, null, "", 0);
} else i(a, null, "", 0);
else i(J.EGAHTTPApiResponse.JsonDecodeFailed, null, "", 0);
else i(a, null, "", 0);
}),
(u.prototype.createPayloadData = function (t, e) {
if (e) throw new Error("gzip not supported");
return t;
}),
(u.prototype.processRequestResponse = function (t, e, i, n) {
return i
? 200 === t
? J.EGAHTTPApiResponse.Ok
: 0 === t || 401 === t
? J.EGAHTTPApiResponse.Unauthorized
: 400 === t
? J.EGAHTTPApiResponse.BadRequest
: 500 === t
? J.EGAHTTPApiResponse.InternalServerError
: J.EGAHTTPApiResponse.UnknownResponseCode
: J.EGAHTTPApiResponse.NoResponse;
}),
(u.sdkErrorTypeToString = function (t) {
switch (t) {
case J.EGASdkErrorType.Rejected:
return "rejected";
default:
return "";
}
}),
(u.instance = new u()),
u
);
})()),
(J.GAHTTPApi = nt),
(st = St || (St = {})),
(rt = st.events || (st.events = {})),
(ot = st.store.GAStore),
(at = st.store.EGAStore),
(ht = st.store.EGAStoreArgsOperator),
(lt = st.state.GAState),
(ut = st.logging.GALogger),
(ct = st.utilities.GAUtilities),
(dt = st.http.EGAHTTPApiResponse),
(ft = st.http.GAHTTPApi),
(pt = st.validators.GAValidator),
(gt = st.http.EGASdkErrorType),
(vt = (function () {
function d() {}
return (
(d.addSessionStartEvent = function () {
if (lt.isEventSubmissionEnabled()) {
var t = {};
(t.category = d.CategorySessionStart),
lt.incrementSessionNum(),
ot.setItem(lt.SessionNumKey, lt.getSessionNum().toString()),
d.addDimensionsToEvent(t),
d.addEventToStore(t),
ut.i("Add SESSION START event"),
d.processEvents(d.CategorySessionStart, !1);
}
}),
(d.addSessionEndEvent = function () {
if (lt.isEventSubmissionEnabled()) {
var t = lt.getSessionStart(),
e = lt.getClientTsAdjusted() - t;
e < 0 && (ut.w("Session length was calculated to be less then 0. Should not be possible. Resetting to 0."), (e = 0));
var i = {};
(i.category = d.CategorySessionEnd), (i.length = e), d.addDimensionsToEvent(i), d.addEventToStore(i), ut.i("Add SESSION END event."), d.processEvents("", !1);
}
}),
(d.addBusinessEvent = function (t, e, i, n, s, r) {
if ((void 0 === s && (s = null), lt.isEventSubmissionEnabled()))
if (pt.validateBusinessEvent(t, e, s, i, n)) {
var o = {};
lt.incrementTransactionNum(),
ot.setItem(lt.TransactionNumKey, lt.getTransactionNum().toString()),
(o.event_id = i + ":" + n),
(o.category = d.CategoryBusiness),
(o.currency = t),
(o.amount = e),
(o[lt.TransactionNumKey] = lt.getTransactionNum()),
s && (o.cart_type = s),
d.addDimensionsToEvent(o),
d.addFieldsToEvent(o, lt.validateAndCleanCustomFields(r)),
ut.i("Add BUSINESS event: {currency:" + t + ", amount:" + e + ", itemType:" + i + ", itemId:" + n + ", cartType:" + s + "}"),
d.addEventToStore(o);
} else ft.instance.sendSdkErrorEvent(gt.Rejected);
}),
(d.addResourceEvent = function (t, e, i, n, s, r) {
if (lt.isEventSubmissionEnabled())
if (pt.validateResourceEvent(t, e, i, n, s, lt.getAvailableResourceCurrencies(), lt.getAvailableResourceItemTypes())) {
t === st.EGAResourceFlowType.Sink && (i *= -1);
var o = {},
a = d.resourceFlowTypeToString(t);
(o.event_id = a + ":" + e + ":" + n + ":" + s),
(o.category = d.CategoryResource),
(o.amount = i),
d.addDimensionsToEvent(o),
d.addFieldsToEvent(o, lt.validateAndCleanCustomFields(r)),
ut.i("Add RESOURCE event: {currency:" + e + ", amount:" + i + ", itemType:" + n + ", itemId:" + s + "}"),
d.addEventToStore(o);
} else ft.instance.sendSdkErrorEvent(gt.Rejected);
}),
(d.addProgressionEvent = function (t, e, i, n, s, r, o) {
if (lt.isEventSubmissionEnabled()) {
var a = d.progressionStatusToString(t);
if (pt.validateProgressionEvent(t, e, i, n)) {
var h,
l = {};
(h = i ? (n ? e + ":" + i + ":" + n : e + ":" + i) : e), (l.category = d.CategoryProgression), (l.event_id = a + ":" + h);
var u = 0;
r && t != st.EGAProgressionStatus.Start && (l.score = s),
t === st.EGAProgressionStatus.Fail && lt.incrementProgressionTries(h),
t === st.EGAProgressionStatus.Complete && (lt.incrementProgressionTries(h), (u = lt.getProgressionTries(h)), (l.attempt_num = u), lt.clearProgressionTries(h)),
d.addDimensionsToEvent(l),
d.addFieldsToEvent(l, lt.validateAndCleanCustomFields(o)),
ut.i("Add PROGRESSION event: {status:" + a + ", progression01:" + e + ", progression02:" + i + ", progression03:" + n + ", score:" + s + ", attempt:" + u + "}"),
d.addEventToStore(l);
} else ft.instance.sendSdkErrorEvent(gt.Rejected);
}
}),
(d.addDesignEvent = function (t, e, i, n) {
if (lt.isEventSubmissionEnabled())
if (pt.validateDesignEvent(t, e)) {
var s = {};
(s.category = d.CategoryDesign),
(s.event_id = t),
i && (s.value = e),
d.addDimensionsToEvent(s),
d.addFieldsToEvent(s, lt.validateAndCleanCustomFields(n)),
ut.i("Add DESIGN event: {eventId:" + t + ", value:" + e + "}"),
d.addEventToStore(s);
} else ft.instance.sendSdkErrorEvent(gt.Rejected);
}),
(d.addErrorEvent = function (t, e, i) {
if (lt.isEventSubmissionEnabled()) {
var n = d.errorSeverityToString(t);
if (pt.validateErrorEvent(t, e)) {
var s = {};
(s.category = d.CategoryError),
(s.severity = n),
(s.message = e),
d.addDimensionsToEvent(s),
d.addFieldsToEvent(s, lt.validateAndCleanCustomFields(i)),
ut.i("Add ERROR event: {severity:" + n + ", message:" + e + "}"),
d.addEventToStore(s);
} else ft.instance.sendSdkErrorEvent(gt.Rejected);
}
}),
(d.processEvents = function (t, e) {
if (lt.isEventSubmissionEnabled())
try {
var i = ct.createGuid();
e && (d.cleanupEvents(), d.fixMissingSessionEndEvents());
var n = [];
n.push(["status", ht.Equal, "new"]);
var s = [];
s.push(["status", ht.Equal, "new"]), t && (n.push(["category", ht.Equal, t]), s.push(["category", ht.Equal, t]));
var r = [];
r.push(["status", i]);
var o = ot.select(at.Events, n);
if (!o || 0 == o.length) return ut.i("Event queue: No events to send"), void d.updateSessionStore();
if (o.length > d.MaxEventCount) {
if (!(o = ot.select(at.Events, n, !0, d.MaxEventCount))) return;
var a = o[o.length - 1].client_ts;
if ((n.push(["client_ts", ht.LessOrEqual, a]), !(o = ot.select(at.Events, n)))) return;
s.push(["client_ts", ht.LessOrEqual, a]);
}
if ((ut.i("Event queue: Sending " + o.length + " events."), !ot.update(at.Events, r, s))) return;
for (var h = [], l = 0; l < o.length; ++l) {
var u = o[l],
c = JSON.parse(ct.decode64(u.event));
0 != c.length && h.push(c);
}
ft.instance.sendEventsInArray(h, i, d.processEventsCallback);
} catch (t) {
ut.e("Error during ProcessEvents(): " + t.stack);
}
}),
(d.processEventsCallback = function (t, e, i, n) {
var s = [];
if ((s.push(["status", ht.Equal, i]), t === dt.Ok)) ot.delete(at.Events, s), ut.i("Event queue: " + n + " events sent.");
else if (t === dt.NoResponse) {
var r = [];
r.push(["status", "new"]), ut.w("Event queue: Failed to send events to collector - Retrying next time"), ot.update(at.Events, r, s);
} else {
if (e) {
var o,
a = 0;
for (var h in e) 0 == a && (o = e[h]), ++a;
t === dt.BadRequest && o.constructor === Array ? ut.w("Event queue: " + n + " events sent. " + a + " events failed GA server validation.") : ut.w("Event queue: Failed to send events.");
} else ut.w("Event queue: Failed to send events.");
ot.delete(at.Events, s);
}
}),
(d.cleanupEvents = function () {
ot.update(at.Events, [["status", "new"]]);
}),
(d.fixMissingSessionEndEvents = function () {
if (lt.isEventSubmissionEnabled()) {
var t = [];
t.push(["session_id", ht.NotEqual, lt.getSessionId()]);
var e = ot.select(at.Sessions, t);
if (e && 0 != e.length) {
ut.i(e.length + " session(s) located with missing session_end event.");
for (var i = 0; i < e.length; ++i) {
var n = JSON.parse(ct.decode64(e[i].event)),
s = n.client_ts - e[i].timestamp;
(s = Math.max(0, s)), (n.category = d.CategorySessionEnd), (n.length = s), d.addEventToStore(n);
}
}
}
}),
(d.addEventToStore = function (t) {
if (lt.isEventSubmissionEnabled())
if (lt.isInitialized())
try {
if (ot.isStoreTooLargeForEvents() && !ct.stringMatch(t.category, /^(user|session_end|business)$/)) return void ut.w("Database too large. Event has been blocked.");
var e = lt.getEventAnnotations(),
i = ct.encode64(JSON.stringify(e));
for (var n in t) e[n] = t[n];
var s = JSON.stringify(e);
ut.ii("Event added to queue: " + s);
var r = { status: "new" };
(r.category = e.category),
(r.session_id = e.session_id),
(r.client_ts = e.client_ts),
(r.event = ct.encode64(JSON.stringify(e))),
ot.insert(at.Events, r),
t.category == d.CategorySessionEnd
? ot.delete(at.Sessions, [["session_id", ht.Equal, e.session_id]])
: (((r = {}).session_id = e.session_id), (r.timestamp = lt.getSessionStart()), (r.event = i), ot.insert(at.Sessions, r, !0, "session_id")),
ot.isStorageAvailable() && ot.save();
} catch (n) {
ut.e("addEventToStore: error"), ut.e(n.stack);
}
else ut.w("Could not add event: SDK is not initialized");
}),
(d.updateSessionStore = function () {
if (lt.sessionIsStarted()) {
var t = {};
(t.session_id = lt.instance.sessionId),
(t.timestamp = lt.getSessionStart()),
(t.event = ct.encode64(JSON.stringify(lt.getEventAnnotations()))),
ot.insert(at.Sessions, t, !0, "session_id"),
ot.isStorageAvailable() && ot.save();
}
}),
(d.addDimensionsToEvent = function (t) {
t &&
(lt.getCurrentCustomDimension01() && (t.custom_01 = lt.getCurrentCustomDimension01()),
lt.getCurrentCustomDimension02() && (t.custom_02 = lt.getCurrentCustomDimension02()),
lt.getCurrentCustomDimension03() && (t.custom_03 = lt.getCurrentCustomDimension03()));
}),
(d.addFieldsToEvent = function (t, e) {
t && e && 0 < Object.keys(e).length && (t.custom_fields = e);
}),
(d.resourceFlowTypeToString = function (t) {
return t == st.EGAResourceFlowType.Source || t == st.EGAResourceFlowType[st.EGAResourceFlowType.Source]
? "Source"
: t == st.EGAResourceFlowType.Sink || t == st.EGAResourceFlowType[st.EGAResourceFlowType.Sink]
? "Sink"
: "";
}),
(d.progressionStatusToString = function (t) {
return t == st.EGAProgressionStatus.Start || t == st.EGAProgressionStatus[st.EGAProgressionStatus.Start]
? "Start"
: t == st.EGAProgressionStatus.Complete || t == st.EGAProgressionStatus[st.EGAProgressionStatus.Complete]
? "Complete"
: t == st.EGAProgressionStatus.Fail || t == st.EGAProgressionStatus[st.EGAProgressionStatus.Fail]
? "Fail"
: "";
}),
(d.errorSeverityToString = function (t) {
return t == st.EGAErrorSeverity.Debug || t == st.EGAErrorSeverity[st.EGAErrorSeverity.Debug]
? "debug"
: t == st.EGAErrorSeverity.Info || t == st.EGAErrorSeverity[st.EGAErrorSeverity.Info]
? "info"
: t == st.EGAErrorSeverity.Warning || t == st.EGAErrorSeverity[st.EGAErrorSeverity.Warning]
? "warning"
: t == st.EGAErrorSeverity.Error || t == st.EGAErrorSeverity[st.EGAErrorSeverity.Error]
? "error"
: t == st.EGAErrorSeverity.Critical || t == st.EGAErrorSeverity[st.EGAErrorSeverity.Critical]
? "critical"
: "";
}),
(d.instance = new d()),
(d.CategorySessionStart = "user"),
(d.CategorySessionEnd = "session_end"),
(d.CategoryDesign = "design"),
(d.CategoryBusiness = "business"),
(d.CategoryProgression = "progression"),
(d.CategoryResource = "resource"),
(d.CategoryError = "error"),
(d.MaxEventCount = 500),
d
);
})()),
(rt.GAEvents = vt),
(yt = St || (St = {})),
(mt = yt.threading || (yt.threading = {})),
(xt = yt.logging.GALogger),
(bt = yt.state.GAState),
(wt = yt.events.GAEvents),
(Tt = (function () {
function s() {
(this.blocks = new mt.PriorityQueue({
compare: function (t, e) {
return t - e;
},
})),
(this.id2TimedBlockMap = {}),
s.startThread();
}
return (
(s.createTimedBlock = function (t) {
void 0 === t && (t = 0);
var e = new Date();
return e.setSeconds(e.getSeconds() + t), new mt.TimedBlock(e);
}),
(s.performTaskOnGAThread = function (t, e) {
void 0 === e && (e = 0);
var i = new Date();
i.setSeconds(i.getSeconds() + e);
var n = new mt.TimedBlock(i);
(n.block = t), (s.instance.id2TimedBlockMap[n.id] = n), s.instance.addTimedBlock(n);
}),
(s.performTimedBlockOnGAThread = function (t) {
(s.instance.id2TimedBlockMap[t.id] = t), s.instance.addTimedBlock(t);
}),
(s.scheduleTimer = function (t, e) {
var i = new Date();
i.setSeconds(i.getSeconds() + t);
var n = new mt.TimedBlock(i);
return (n.block = e), (s.instance.id2TimedBlockMap[n.id] = n), s.instance.addTimedBlock(n), n.id;
}),
(s.getTimedBlockById = function (t) {
return t in s.instance.id2TimedBlockMap ? s.instance.id2TimedBlockMap[t] : null;
}),
(s.ensureEventQueueIsRunning = function () {
(s.instance.keepRunning = !0), s.instance.isRunning || ((s.instance.isRunning = !0), s.scheduleTimer(s.ProcessEventsIntervalInSeconds, s.processEventQueue));
}),
(s.endSessionAndStopQueue = function () {
bt.isInitialized() && (xt.i("Ending session."), s.stopEventQueue(), bt.isEnabled() && bt.sessionIsStarted() && (wt.addSessionEndEvent(), (bt.instance.sessionStart = 0)));
}),
(s.stopEventQueue = function () {
s.instance.keepRunning = !1;
}),
(s.ignoreTimer = function (t) {
t in s.instance.id2TimedBlockMap && (s.instance.id2TimedBlockMap[t].ignore = !0);
}),
(s.setEventProcessInterval = function (t) {
0 < t && (s.ProcessEventsIntervalInSeconds = t);
}),
(s.prototype.addTimedBlock = function (t) {
this.blocks.enqueue(t.deadline.getTime(), t);
}),
(s.run = function () {
clearTimeout(s.runTimeoutId);
try {
for (var t; (t = s.getNextBlock()); )
if (!t.ignore)
if (t.async) {
if (!t.running) {
(t.running = !0), t.block();
break;
}
} else t.block();
return void (s.runTimeoutId = setTimeout(s.run, s.ThreadWaitTimeInMs));
} catch (t) {
xt.e("Error on GA thread"), xt.e(t.stack);
}
}),
(s.startThread = function () {
s.runTimeoutId = setTimeout(s.run, 0);
}),
(s.getNextBlock = function () {
var t = new Date();
return s.instance.blocks.hasItems() && s.instance.blocks.peek().deadline.getTime() <= t.getTime()
? s.instance.blocks.peek().async && s.instance.blocks.peek().running
? s.instance.blocks.peek()
: s.instance.blocks.dequeue()
: null;
}),
(s.processEventQueue = function () {
wt.processEvents("", !0), s.instance.keepRunning ? s.scheduleTimer(s.ProcessEventsIntervalInSeconds, s.processEventQueue) : (s.instance.isRunning = !1);
}),
(s.instance = new s()),
(s.ThreadWaitTimeInMs = 1e3),
(s.ProcessEventsIntervalInSeconds = 8),
s
);
})()),
(mt.GAThreading = Tt),
(_t = St || (St = {})),
(Et = _t.threading.GAThreading),
(Pt = _t.logging.GALogger),
(At = _t.store.GAStore),
(Mt = _t.state.GAState),
(Ct = _t.http.GAHTTPApi),
(Ot = _t.device.GADevice),
(kt = _t.validators.GAValidator),
(Rt = _t.http.EGAHTTPApiResponse),
(Lt = _t.utilities.GAUtilities),
(It = _t.events.GAEvents),
(Dt = (function () {
function o() {}
return (
(o.init = function () {
if (
(Ot.touch(),
(o.methodMap.configureAvailableCustomDimensions01 = o.configureAvailableCustomDimensions01),
(o.methodMap.configureAvailableCustomDimensions02 = o.configureAvailableCustomDimensions02),
(o.methodMap.configureAvailableCustomDimensions03 = o.configureAvailableCustomDimensions03),
(o.methodMap.configureAvailableResourceCurrencies = o.configureAvailableResourceCurrencies),
(o.methodMap.configureAvailableResourceItemTypes = o.configureAvailableResourceItemTypes),
(o.methodMap.configureBuild = o.configureBuild),
(o.methodMap.configureSdkGameEngineVersion = o.configureSdkGameEngineVersion),
(o.methodMap.configureGameEngineVersion = o.configureGameEngineVersion),
(o.methodMap.configureUserId = o.configureUserId),
(o.methodMap.initialize = o.initialize),
(o.methodMap.addBusinessEvent = o.addBusinessEvent),
(o.methodMap.addResourceEvent = o.addResourceEvent),
(o.methodMap.addProgressionEvent = o.addProgressionEvent),
(o.methodMap.addDesignEvent = o.addDesignEvent),
(o.methodMap.addErrorEvent = o.addErrorEvent),
(o.methodMap.addErrorEvent = o.addErrorEvent),
(o.methodMap.setEnabledInfoLog = o.setEnabledInfoLog),
(o.methodMap.setEnabledVerboseLog = o.setEnabledVerboseLog),
(o.methodMap.setEnabledManualSessionHandling = o.setEnabledManualSessionHandling),
(o.methodMap.setEnabledEventSubmission = o.setEnabledEventSubmission),
(o.methodMap.setCustomDimension01 = o.setCustomDimension01),
(o.methodMap.setCustomDimension02 = o.setCustomDimension02),
(o.methodMap.setCustomDimension03 = o.setCustomDimension03),
(o.methodMap.setFacebookId = o.setFacebookId),
(o.methodMap.setGender = o.setGender),
(o.methodMap.setBirthYear = o.setBirthYear),
(o.methodMap.setEventProcessInterval = o.setEventProcessInterval),
(o.methodMap.startSession = o.startSession),
(o.methodMap.endSession = o.endSession),
(o.methodMap.onStop = o.onStop),
(o.methodMap.onResume = o.onResume),
(o.methodMap.addCommandCenterListener = o.addCommandCenterListener),
(o.methodMap.removeCommandCenterListener = o.removeCommandCenterListener),
(o.methodMap.getCommandCenterValueAsString = o.getCommandCenterValueAsString),
(o.methodMap.isCommandCenterReady = o.isCommandCenterReady),
(o.methodMap.getConfigurationsContentAsString = o.getConfigurationsContentAsString),
"undefined" != typeof window && void 0 !== window.GameAnalytics && void 0 !== window.GameAnalytics.q)
) {
var t = window.GameAnalytics.q;
for (var e in t) o.gaCommand.apply(null, t[e]);
}
}),
(o.gaCommand = function () {
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
0 < t.length && t[0] in _t.GameAnalytics.methodMap && (1 < t.length ? _t.GameAnalytics.methodMap[t[0]].apply(null, Array.prototype.slice.call(t, 1)) : _t.GameAnalytics.methodMap[t[0]]());
}),
(o.configureAvailableCustomDimensions01 = function (t) {
void 0 === t && (t = []),
Et.performTaskOnGAThread(function () {
o.isSdkReady(!0, !1) ? Pt.w("Available custom dimensions must be set before SDK is initialized") : Mt.setAvailableCustomDimensions01(t);
});
}),
(o.configureAvailableCustomDimensions02 = function (t) {
void 0 === t && (t = []),
Et.performTaskOnGAThread(function () {
o.isSdkReady(!0, !1) ? Pt.w("Available custom dimensions must be set before SDK is initialized") : Mt.setAvailableCustomDimensions02(t);
});
}),
(o.configureAvailableCustomDimensions03 = function (t) {
void 0 === t && (t = []),
Et.performTaskOnGAThread(function () {
o.isSdkReady(!0, !1) ? Pt.w("Available custom dimensions must be set before SDK is initialized") : Mt.setAvailableCustomDimensions03(t);
});
}),
(o.configureAvailableResourceCurrencies = function (t) {
void 0 === t && (t = []),
Et.performTaskOnGAThread(function () {
o.isSdkReady(!0, !1) ? Pt.w("Available resource currencies must be set before SDK is initialized") : Mt.setAvailableResourceCurrencies(t);
});
}),
(o.configureAvailableResourceItemTypes = function (t) {
void 0 === t && (t = []),
Et.performTaskOnGAThread(function () {
o.isSdkReady(!0, !1) ? Pt.w("Available resource item types must be set before SDK is initialized") : Mt.setAvailableResourceItemTypes(t);
});
}),
(o.configureBuild = function (t) {
void 0 === t && (t = ""),
Et.performTaskOnGAThread(function () {
o.isSdkReady(!0, !1)
? Pt.w("Build version must be set before SDK is initialized.")
: kt.validateBuild(t)
? Mt.setBuild(t)
: Pt.i("Validation fail - configure build: Cannot be null, empty or above 32 length. String: " + t);
});
}),
(o.configureSdkGameEngineVersion = function (t) {
void 0 === t && (t = ""),
Et.performTaskOnGAThread(function () {
o.isSdkReady(!0, !1) || (kt.validateSdkWrapperVersion(t) ? (Ot.sdkGameEngineVersion = t) : Pt.i("Validation fail - configure sdk version: Sdk version not supported. String: " + t));
});
}),
(o.configureGameEngineVersion = function (t) {
void 0 === t && (t = ""),
Et.performTaskOnGAThread(function () {
o.isSdkReady(!0, !1) || (kt.validateEngineVersion(t) ? (Ot.gameEngineVersion = t) : Pt.i("Validation fail - configure game engine version: Game engine version not supported. String: " + t));
});
}),
(o.configureUserId = function (t) {
void 0 === t && (t = ""),
Et.performTaskOnGAThread(function () {
o.isSdkReady(!0, !1)
? Pt.w("A custom user id must be set before SDK is initialized.")
: kt.validateUserId(t)
? Mt.setUserId(t)
: Pt.i("Validation fail - configure user_id: Cannot be null, empty or above 64 length. Will use default user_id method. Used string: " + t);
});
}),
(o.initialize = function (t, e) {
void 0 === t && (t = ""), void 0 === e && (e = ""), Ot.updateConnectionType();
var i = Et.createTimedBlock();
(i.async = !0),
(o.initTimedBlockId = i.id),
(i.block = function () {
o.isSdkReady(!0, !1)
? Pt.w("SDK already initialized. Can only be called once.")
: kt.validateKeys(t, e)
? (Mt.setKeys(t, e), o.internalInitialize())
: Pt.w("SDK failed initialize. Game key or secret key is invalid. Can only contain characters A-z 0-9, gameKey is 32 length, gameSecret is 40 length. Failed keys - gameKey: " + t + ", secretKey: " + e);
}),
Et.performTimedBlockOnGAThread(i);
}),
(o.addBusinessEvent = function (t, e, i, n, s) {
void 0 === t && (t = ""),
void 0 === e && (e = 0),
void 0 === i && (i = ""),
void 0 === n && (n = ""),
void 0 === s && (s = ""),
Ot.updateConnectionType(),
Et.performTaskOnGAThread(function () {
o.isSdkReady(!0, !0, "Could not add business event") && It.addBusinessEvent(t, e, i, n, s, {});
});
}),
(o.addResourceEvent = function (t, e, i, n, s) {
void 0 === t && (t = _t.EGAResourceFlowType.Undefined),
void 0 === e && (e = ""),
void 0 === i && (i = 0),
void 0 === n && (n = ""),
void 0 === s && (s = ""),
Ot.updateConnectionType(),
Et.performTaskOnGAThread(function () {
o.isSdkReady(!0, !0, "Could not add resource event") && It.addResourceEvent(t, e, i, n, s, {});
});
}),
(o.addProgressionEvent = function (e, i, n, s, r) {
void 0 === e && (e = _t.EGAProgressionStatus.Undefined),
void 0 === i && (i = ""),
void 0 === n && (n = ""),
void 0 === s && (s = ""),
Ot.updateConnectionType(),
Et.performTaskOnGAThread(function () {
if (o.isSdkReady(!0, !0, "Could not add progression event")) {
var t = "number" == typeof r;
It.addProgressionEvent(e, i, n, s, t ? r : 0, t, {});
}
});
}),
(o.addDesignEvent = function (e, i) {
Ot.updateConnectionType(),
Et.performTaskOnGAThread(function () {
if (o.isSdkReady(!0, !0, "Could not add design event")) {
var t = "number" == typeof i;
It.addDesignEvent(e, t ? i : 0, t, {});
}
});
}),
(o.addErrorEvent = function (t, e) {
void 0 === t && (t = _t.EGAErrorSeverity.Undefined),
void 0 === e && (e = ""),
Ot.updateConnectionType(),
Et.performTaskOnGAThread(function () {
o.isSdkReady(!0, !0, "Could not add error event") && It.addErrorEvent(t, e, {});
});
}),
(o.setEnabledInfoLog = function (t) {
void 0 === t && (t = !1),
Et.performTaskOnGAThread(function () {
t ? (Pt.setInfoLog(t), Pt.i("Info logging enabled")) : (Pt.i("Info logging disabled"), Pt.setInfoLog(t));
});
}),
(o.setEnabledVerboseLog = function (t) {
void 0 === t && (t = !1),
Et.performTaskOnGAThread(function () {
t ? (Pt.setVerboseLog(t), Pt.i("Verbose logging enabled")) : (Pt.i("Verbose logging disabled"), Pt.setVerboseLog(t));
});
}),
(o.setEnabledManualSessionHandling = function (t) {
void 0 === t && (t = !1),
Et.performTaskOnGAThread(function () {
Mt.setManualSessionHandling(t);
});
}),
(o.setEnabledEventSubmission = function (t) {
void 0 === t && (t = !1),
Et.performTaskOnGAThread(function () {
t ? (Mt.setEnabledEventSubmission(t), Pt.i("Event submission enabled")) : (Pt.i("Event submission disabled"), Mt.setEnabledEventSubmission(t));
});
}),
(o.setCustomDimension01 = function (t) {
void 0 === t && (t = ""),
Et.performTaskOnGAThread(function () {
kt.validateDimension01(t, Mt.getAvailableCustomDimensions01())
? Mt.setCustomDimension01(t)
: Pt.w("Could not set custom01 dimension value to '" + t + "'. Value not found in available custom01 dimension values");
});
}),
(o.setCustomDimension02 = function (t) {
void 0 === t && (t = ""),
Et.performTaskOnGAThread(function () {
kt.validateDimension02(t, Mt.getAvailableCustomDimensions02())
? Mt.setCustomDimension02(t)
: Pt.w("Could not set custom02 dimension value to '" + t + "'. Value not found in available custom02 dimension values");
});
}),
(o.setCustomDimension03 = function (t) {
void 0 === t && (t = ""),
Et.performTaskOnGAThread(function () {
kt.validateDimension03(t, Mt.getAvailableCustomDimensions03())
? Mt.setCustomDimension03(t)
: Pt.w("Could not set custom03 dimension value to '" + t + "'. Value not found in available custom03 dimension values");
});
}),
(o.setFacebookId = function (t) {
void 0 === t && (t = ""),
Et.performTaskOnGAThread(function () {
kt.validateFacebookId(t) && Mt.setFacebookId(t);
});
}),
(o.setGender = function (t) {
void 0 === t && (t = _t.EGAGender.Undefined),
Et.performTaskOnGAThread(function () {
kt.validateGender(t) && Mt.setGender(t);
});
}),
(o.setBirthYear = function (t) {
void 0 === t && (t = 0),
Et.performTaskOnGAThread(function () {
kt.validateBirthyear(t) && Mt.setBirthYear(t);
});
}),
(o.setEventProcessInterval = function (t) {
Et.performTaskOnGAThread(function () {
Et.setEventProcessInterval(t);
});
}),
(o.startSession = function () {
if (Mt.isInitialized()) {
var t = Et.createTimedBlock();
(t.async = !0),
(o.initTimedBlockId = t.id),
(t.block = function () {
Mt.isEnabled() && Mt.sessionIsStarted() && Et.endSessionAndStopQueue(), o.resumeSessionAndStartQueue();
}),
Et.performTimedBlockOnGAThread(t);
}
}),
(o.endSession = function () {
o.onStop();
}),
(o.onStop = function () {
Et.performTaskOnGAThread(function () {
try {
Et.endSessionAndStopQueue();
} catch (t) {}
});
}),
(o.onResume = function () {
var t = Et.createTimedBlock();
(t.async = !0),
(o.initTimedBlockId = t.id),
(t.block = function () {
o.resumeSessionAndStartQueue();
}),
Et.performTimedBlockOnGAThread(t);
}),
(o.getCommandCenterValueAsString = function (t, e) {
return void 0 === e && (e = null), Mt.getConfigurationStringValue(t, e);
}),
(o.isCommandCenterReady = function () {
return Mt.isCommandCenterReady();
}),
(o.addCommandCenterListener = function (t) {
Mt.addCommandCenterListener(t);
}),
(o.removeCommandCenterListener = function (t) {
Mt.removeCommandCenterListener(t);
}),
(o.getConfigurationsContentAsString = function () {
return Mt.getConfigurationsContentAsString();
}),
(o.internalInitialize = function () {
Mt.ensurePersistedStates(), At.setItem(Mt.DefaultUserIdKey, Mt.getDefaultId()), Mt.setInitialized(!0), o.newSession(), Mt.isEnabled() && Et.ensureEventQueueIsRunning();
}),
(o.newSession = function () {
Pt.i("Starting a new session."), Mt.validateAndFixCurrentDimensions(), Ct.instance.requestInit(o.startNewSessionCallback);
}),
(o.startNewSessionCallback = function (t, e) {
if (t === Rt.Ok && e) {
var i = 0;
if (e.server_ts) {
var n = e.server_ts;
i = Mt.calculateServerTimeOffset(n);
}
(e.time_offset = i), At.setItem(Mt.SdkConfigCachedKey, Lt.encode64(JSON.stringify(e))), (Mt.instance.sdkConfigCached = e), (Mt.instance.sdkConfig = e), (Mt.instance.initAuthorized = !0);
} else
t == Rt.Unauthorized
? (Pt.w("Initialize SDK failed - Unauthorized"), (Mt.instance.initAuthorized = !1))
: (t === Rt.NoResponse || t === Rt.RequestTimeout
? Pt.i("Init call (session start) failed - no response. Could be offline or timeout.")
: t === Rt.BadResponse || t === Rt.JsonEncodeFailed || t === Rt.JsonDecodeFailed
? Pt.i("Init call (session start) failed - bad response. Could be bad response from proxy or GA servers.")
: (t !== Rt.BadRequest && t !== Rt.UnknownResponseCode) || Pt.i("Init call (session start) failed - bad request or unknown response."),
null == Mt.instance.sdkConfig
? null != Mt.instance.sdkConfigCached
? (Pt.i("Init call (session start) failed - using cached init values."), (Mt.instance.sdkConfig = Mt.instance.sdkConfigCached))
: (Pt.i("Init call (session start) failed - using default init values."), (Mt.instance.sdkConfig = Mt.instance.sdkConfigDefault))
: Pt.i("Init call (session start) failed - using cached init values."),
(Mt.instance.initAuthorized = !0));
if (((Mt.instance.clientServerTimeOffset = Mt.getSdkConfig().time_offset ? Mt.getSdkConfig().time_offset : 0), Mt.populateConfigurations(Mt.getSdkConfig()), !Mt.isEnabled()))
return Pt.w("Could not start session: SDK is disabled."), void Et.stopEventQueue();
Et.ensureEventQueueIsRunning();
var s = Lt.createGuid();
(Mt.instance.sessionId = s), (Mt.instance.sessionStart = Mt.getClientTsAdjusted()), It.addSessionStartEvent();
var r = Et.getTimedBlockById(o.initTimedBlockId);
null != r && (r.running = !1), (o.initTimedBlockId = -1);
}),
(o.resumeSessionAndStartQueue = function () {
Mt.isInitialized() && (Pt.i("Resuming session."), Mt.sessionIsStarted() || o.newSession());
}),
(o.isSdkReady = function (t, e, i) {
return (
void 0 === e && (e = !0),
void 0 === i && (i = ""),
i && (i += ": "),
t && !Mt.isInitialized()
? (e && Pt.w(i + "SDK is not initialized"), !1)
: t && !Mt.isEnabled()
? (e && Pt.w(i + "SDK is disabled"), !1)
: !(t && !Mt.sessionIsStarted()) || (e && Pt.w(i + "Session has not started yet"), !1)
);
}),
(o.initTimedBlockId = -1),
(o.methodMap = {}),
o
);
})()),
(_t.GameAnalytics = Dt),
St.GameAnalytics.init();
St.GameAnalytics.gaCommand;
var Ft = St,
Bt = (function () {
function t() {}
return (
(t.prototype.loadScript = function (t) {}),
(t.prototype.create = function (t) {
var e = t.gameKey,
i = t.gameSecret,
n = t.version;
Ft.GameAnalytics.initialize(e, i),
Ft.GameAnalytics.configureBuild(n),
Ft.GameAnalytics.startSession(),
window.addEventListener("beforeunload", function () {
Ft.GameAnalytics.endSession();
});
}),
(t.prototype.sendScreenView = function (t) {}),
(t.prototype.sendGenericEvent = function (t, e, i) {}),
(t.prototype.sendEvent = function (t, e) {}),
(t.prototype.sendCustomEvent = function (t, e) {}),
(t.prototype.addProgressionEvent = function (t, e, i, n, s) {
Ft.GameAnalytics.addProgressionEvent(t, e, i, n, s);
}),
(t.prototype.addDesignEvent = function (t, e) {
Ft.GameAnalytics.addDesignEvent(t, e);
}),
t
);
})(),
Nt = (function () {
function t() {}
return (
(t.getReferrer = function (t) {
return -1 !== t.indexOf("?ref=") ? t.substr(t.indexOf("?ref=") + 5) : t;
}),
t
);
})(),
Ut = (function () {
function t() {
(this.fbrqId = "UA-60359297-50"), (this.googleID = "none");
}
return (
(t.prototype.loadScript = function (t) {
var e = document.createElement("script"),
i = "https://www.googletagmanager.com/gtag/js?id=".concat(t);
e.setAttribute("src", i),
(e.async = !0),
(e.onload = function () {
window.hasOwnProperty("dataLayer") && (window.dataLayer = window.dataLayer || []),
(gtag = function () {
window.hasOwnProperty("dataLayer") && window.dataLayer.push(arguments);
});
}),
document.head.appendChild(e);
}),
(t.prototype.create = function (t) {
var e = t.gameTitle,
i = t.googleID,
n = t.version;
this.googleID = i;
var s = 100;
if ((t.sampleRate && (s = t.sampleRate), "undefined" != typeof gtag || "function" == typeof gtag)) {
var r = Nt.getReferrer(decodeURIComponent(document.referrer));
gtag("js", new Date()), gtag("set", "user_properties", { app_name: e, app_version: n, referrer: r }), gtag("config", this.googleID, { sample_rate: s });
}
}),
(t.prototype.sendScreenView = function (t) {
("undefined" == typeof gtag && "function" != typeof gtag) || (gtag("event", "screen_view", { screen_name: t }), gtag("event", "screen_view", { send_to: this.googleID, screen_name: t }));
}),
(t.prototype.sendGenericEvent = function (t, e, i, n) {
("undefined" == typeof gtag && "function" != typeof gtag) || gtag("event", e, { send_to: this.googleID, event_category: t, event_label: i, event_value: n });
}),
(t.prototype.sendEvent = function (t, e) {
if ("undefined" != typeof gtag || "function" == typeof gtag) {
var i = Object.assign(e, { send_to: this.googleID });
gtag("event", t, i);
}
}),
(t.prototype.sendCustomEvent = function (t, e) {}),
(t.prototype.addProgressionEvent = function (t, e, i, n, s) {}),
(t.prototype.addDesignEvent = function (t, e) {}),
(t.GAMeasurementId = "none"),
t
);
})(),
Yt = (function (e) {
function t() {
var t = e.call(this) || this;
return t.providers.push(new Ut()), t.providers.push(new Bt()), t;
}
return (
(function (t, e) {
function i() {
this.constructor = t;
}
n(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
})(t, e),
t
);
})(p);
(t.CompleteAnalyticsProvider = Yt), Object.defineProperty(t, "__esModule", { value: !0 });
}),
(function () {
function n(t, e, i) {
return t.call.apply(t.bind, arguments);
}
function s(e, i, t) {
if (!e) throw Error();
if (2 < arguments.length) {
var n = Array.prototype.slice.call(arguments, 2);
return function () {
var t = Array.prototype.slice.call(arguments);
return Array.prototype.unshift.apply(t, n), e.apply(i, t);
};
}
return function () {
return e.apply(i, arguments);
};
}
function p(t, e, i) {
return (p = Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("native code") ? n : s).apply(null, arguments);
}
var a =
Date.now ||
function () {
return +new Date();
};
function e(t, e) {
(this.a = t), (this.o = e || t), (this.c = this.o.document);
}
var h = !!window.FontFace;
function l(t, e, i, n) {
if (((e = t.c.createElement(e)), i)) for (var s in i) i.hasOwnProperty(s) && ("style" == s ? (e.style.cssText = i[s]) : e.setAttribute(s, i[s]));
return n && e.appendChild(t.c.createTextNode(n)), e;
}
function u(t, e, i) {
(t = t.c.getElementsByTagName(e)[0]) || (t = document.documentElement), t.insertBefore(i, t.lastChild);
}
function i(t) {
t.parentNode && t.parentNode.removeChild(t);
}
function g(t, e, i) {
(e = e || []), (i = i || []);
for (var n = t.className.split(/\s+/), s = 0; s < e.length; s += 1) {
for (var r = !1, o = 0; o < n.length; o += 1)
if (e[s] === n[o]) {
r = !0;
break;
}
r || n.push(e[s]);
}
for (e = [], s = 0; s < n.length; s += 1) {
for (r = !1, o = 0; o < i.length; o += 1)
if (n[s] === i[o]) {
r = !0;
break;
}
r || e.push(n[s]);
}
t.className = e
.join(" ")
.replace(/\s+/g, " ")
.replace(/^\s+|\s+$/, "");
}
function r(t, e) {
for (var i = t.className.split(/\s+/), n = 0, s = i.length; n < s; n++) if (i[n] == e) return !0;
return !1;
}
function c(t, e, i) {
function n() {
o && s && (o(r), (o = null));
}
e = l(t, "link", { rel: "stylesheet", href: e, media: "all" });
var s = !1,
r = null,
o = i || null;
h
? ((e.onload = function () {
(s = !0), n();
}),
(e.onerror = function () {
(s = !0), (r = Error("Stylesheet failed to load")), n();
}))
: setTimeout(function () {
(s = !0), n();
}, 0),
u(t, "head", e);
}
function d(t, e, i, n) {
var s = t.c.getElementsByTagName("head")[0];
if (s) {
var r = l(t, "script", { src: e }),
o = !1;
return (
(r.onload = r.onreadystatechange = function () {
o || (this.readyState && "loaded" != this.readyState && "complete" != this.readyState) || ((o = !0), i && i(null), (r.onload = r.onreadystatechange = null), "HEAD" == r.parentNode.tagName && s.removeChild(r));
}),
s.appendChild(r),
setTimeout(function () {
o || ((o = !0), i && i(Error("Script load timeout")));
}, n || 5e3),
r
);
}
return null;
}
function f() {
(this.a = 0), (this.c = null);
}
function v(t) {
return (
t.a++,
function () {
t.a--, o(t);
}
);
}
function y(t, e) {
(t.c = e), o(t);
}
function o(t) {
0 == t.a && t.c && (t.c(), (t.c = null));
}
function m(t) {
this.a = t || "-";
}
function x(t, e) {
(this.c = t), (this.f = 4), (this.a = "n");
var i = (e || "n4").match(/^([nio])([1-9])$/i);
i && ((this.a = i[1]), (this.f = parseInt(i[2], 10)));
}
function b(t) {
var e = [];
t = t.split(/,\s*/);
for (var i = 0; i < t.length; i++) {
var n = t[i].replace(/['"]/g, "");
-1 != n.indexOf(" ") || /^\d/.test(n) ? e.push("'" + n + "'") : e.push(n);
}
return e.join(",");
}
function w(t) {
return t.a + t.f;
}
function T(t) {
var e = "normal";
return "o" === t.a ? (e = "oblique") : "i" === t.a && (e = "italic"), e;
}
function S(t, e) {
(this.c = t), (this.f = t.o.document.documentElement), (this.h = e), (this.a = new m("-")), (this.j = !1 !== e.events), (this.g = !1 !== e.classes);
}
function _(t) {
if (t.g) {
var e = r(t.f, t.a.c("wf", "active")),
i = [],
n = [t.a.c("wf", "loading")];
e || i.push(t.a.c("wf", "inactive")), g(t.f, i, n);
}
E(t, "inactive");
}
function E(t, e, i) {
t.j && t.h[e] && (i ? t.h[e](i.c, w(i)) : t.h[e]());
}
function P() {
this.c = {};
}
function A(t, e) {
(this.c = t), (this.f = e), (this.a = l(this.c, "span", { "aria-hidden": "true" }, this.f));
}
function M(t) {
u(t.c, "body", t.a);
}
function C(t) {
return (
"display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:" +
b(t.c) +
";font-style:" +
T(t) +
";font-weight:" +
t.f +
"00;"
);
}
function O(t, e, i, n, s, r) {
(this.g = t), (this.j = e), (this.a = n), (this.c = i), (this.f = s || 3e3), (this.h = r || void 0);
}
function k(t, e, i, n, s, r, o) {
(this.v = t),
(this.B = e),
(this.c = i),
(this.a = n),
(this.s = o || "BESbswy"),
(this.f = {}),
(this.w = s || 3e3),
(this.u = r || null),
(this.m = this.j = this.h = this.g = null),
(this.g = new A(this.c, this.s)),
(this.h = new A(this.c, this.s)),
(this.j = new A(this.c, this.s)),
(this.m = new A(this.c, this.s)),
(t = C((t = new x(this.a.c + ",serif", w(this.a))))),
(this.g.a.style.cssText = t),
(t = C((t = new x(this.a.c + ",sans-serif", w(this.a))))),
(this.h.a.style.cssText = t),
(t = C((t = new x("serif", w(this.a))))),
(this.j.a.style.cssText = t),
(t = C((t = new x("sans-serif", w(this.a))))),
(this.m.a.style.cssText = t),
M(this.g),
M(this.h),
M(this.j),
M(this.m);
}
(m.prototype.c = function (t) {
for (var e = [], i = 0; i < arguments.length; i++) e.push(arguments[i].replace(/[\W_]+/g, "").toLowerCase());
return e.join(this.a);
}),
(O.prototype.start = function () {
var s = this.c.o.document,
r = this,
o = a(),
t = new Promise(function (i, n) {
!(function e() {
var t;
a() - o >= r.f
? n()
: s.fonts.load(((t = r.a), T(t) + " " + t.f + "00 300px " + b(t.c)), r.h).then(
function (t) {
1 <= t.length ? i() : setTimeout(e, 25);
},
function () {
n();
}
);
})();
}),
i = null,
e = new Promise(function (t, e) {
i = setTimeout(e, r.f);
});
Promise.race([e, t]).then(
function () {
i && (clearTimeout(i), (i = null)), r.g(r.a);
},
function () {
r.j(r.a);
}
);
});
var R = { D: "serif", C: "sans-serif" },
L = null;
function I() {
if (null === L) {
var t = /AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);
L = !!t && (parseInt(t[1], 10) < 536 || (536 === parseInt(t[1], 10) && parseInt(t[2], 10) <= 11));
}
return L;
}
function D(t, e, i) {
for (var n in R) if (R.hasOwnProperty(n) && e === t.f[R[n]] && i === t.f[R[n]]) return !0;
return !1;
}
function F(t) {
var e,
i = t.g.a.offsetWidth,
n = t.h.a.offsetWidth;
(e = i === t.f.serif && n === t.f["sans-serif"]) || (e = I() && D(t, i, n)),
e
? a() - t.A >= t.w
? I() && D(t, i, n) && (null === t.u || t.u.hasOwnProperty(t.a.c))
? B(t, t.v)
: B(t, t.B)
: setTimeout(
p(function () {
F(this);
}, t),
50
)
: B(t, t.v);
}
function B(t, e) {
setTimeout(
p(function () {
i(this.g.a), i(this.h.a), i(this.j.a), i(this.m.a), e(this.a);
}, t),
0
);
}
function N(t, e, i) {
(this.c = t), (this.a = e), (this.f = 0), (this.m = this.j = !1), (this.s = i);
}
k.prototype.start = function () {
(this.f.serif = this.j.a.offsetWidth), (this.f["sans-serif"] = this.m.a.offsetWidth), (this.A = a()), F(this);
};
var U = null;
function Y(t) {
0 == --t.f && t.j && (t.m ? ((t = t.a).g && g(t.f, [t.a.c("wf", "active")], [t.a.c("wf", "loading"), t.a.c("wf", "inactive")]), E(t, "active")) : _(t.a));
}
function t(t) {
(this.j = t), (this.a = new P()), (this.h = 0), (this.f = this.g = !0);
}
function z(t, e) {
(this.c = t), (this.a = e);
}
function X(t, e) {
(this.c = t), (this.a = e);
}
function V(t, e) {
(this.c = t || "https://fonts.googleapis.com/css"), (this.a = []), (this.f = []), (this.g = e || "");
}
(N.prototype.g = function (t) {
var e = this.a;
e.g && g(e.f, [e.a.c("wf", t.c, w(t).toString(), "active")], [e.a.c("wf", t.c, w(t).toString(), "loading"), e.a.c("wf", t.c, w(t).toString(), "inactive")]), E(e, "fontactive", t), (this.m = !0), Y(this);
}),
(N.prototype.h = function (t) {
var e = this.a;
if (e.g) {
var i = r(e.f, e.a.c("wf", t.c, w(t).toString(), "active")),
n = [],
s = [e.a.c("wf", t.c, w(t).toString(), "loading")];
i || n.push(e.a.c("wf", t.c, w(t).toString(), "inactive")), g(e.f, n, s);
}
E(e, "fontinactive", t), Y(this);
}),
(t.prototype.load = function (t) {
(this.c = new e(this.j, t.context || this.j)),
(this.g = !1 !== t.events),
(this.f = !1 !== t.classes),
(function (s, t, e) {
var i = [],
n = e.timeout;
(r = t), r.g && g(r.f, [r.a.c("wf", "loading")]), E(r, "loading");
var r;
var i = (function (t, e, i) {
var n,
s = [];
for (n in e)
if (e.hasOwnProperty(n)) {
var r = t.c[n];
r && s.push(r(e[n], i));
}
return s;
})(s.a, e, s.c),
o = new N(s.c, t, n);
for (s.h = i.length, t = 0, e = i.length; t < e; t++)
i[t].load(function (t, e, i) {
var n, l, u, c, d, f;
(l = o),
(u = t),
(c = e),
(d = i),
(f = 0 == --(n = s).h),
(n.f || n.g) &&
setTimeout(function () {
var t = d || null,
e = c || {};
if (0 === u.length && f) _(l.a);
else {
(l.f += u.length), f && (l.j = f);
var i,
n = [];
for (i = 0; i < u.length; i++) {
var s = u[i],
r = e[s.c],
o = l.a,
a = s;
if ((o.g && g(o.f, [o.a.c("wf", a.c, w(a).toString(), "loading")]), E(o, "fontloading", a), (o = null) === U))
if (window.FontFace) {
var a = /Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent),
h = /OS X.*Version\/10\..*Safari/.exec(window.navigator.userAgent) && /Apple/.exec(window.navigator.vendor);
U = a ? 42 < parseInt(a[1], 10) : !h;
} else U = !1;
(o = U ? new O(p(l.g, l), p(l.h, l), l.c, s, l.s, r) : new k(p(l.g, l), p(l.h, l), l.c, s, l.s, t, r)), n.push(o);
}
for (i = 0; i < n.length; i++) n[i].start();
}
}, 0);
});
})(this, new S(this.c, t), t);
}),
(z.prototype.load = function (o) {
var e = this,
a = e.a.projectId,
t = e.a.version;
if (a) {
var h = e.c.o;
d(this.c, (e.a.api || "https://fast.fonts.net/jsapi") + "/" + a + ".js" + (t ? "?v=" + t : ""), function (t) {
t
? o([])
: ((h["__MonotypeConfiguration__" + a] = function () {
return e.a;
}),
(function t() {
if (h["__mti_fntLst" + a]) {
var e,
i = h["__mti_fntLst" + a](),
n = [];
if (i)
for (var s = 0; s < i.length; s++) {
var r = i[s].fontfamily;
null != i[s].fontStyle && null != i[s].fontWeight ? ((e = i[s].fontStyle + i[s].fontWeight), n.push(new x(r, e))) : n.push(new x(r));
}
o(n);
} else
setTimeout(function () {
t();
}, 50);
})());
}).id = "__MonotypeAPIScript__" + a;
} else o([]);
}),
(X.prototype.load = function (t) {
var e,
i,
n = this.a.urls || [],
s = this.a.families || [],
r = this.a.testStrings || {},
o = new f();
for (e = 0, i = n.length; e < i; e++) c(this.c, n[e], v(o));
var a = [];
for (e = 0, i = s.length; e < i; e++)
if ((n = s[e].split(":"))[1]) for (var h = n[1].split(","), l = 0; l < h.length; l += 1) a.push(new x(n[0], h[l]));
else a.push(new x(n[0]));
y(o, function () {
t(a, r);
});
});
function G(t) {
(this.f = t), (this.a = []), (this.c = {});
}
var j = { latin: "BESbswy", "latin-ext": "çöüğş", cyrillic: "йÑЖ", greek: "αβΣ", khmer: "កážáž‚", Hanuman: "កážáž‚" },
H = {
thin: "1",
extralight: "2",
"extra-light": "2",
ultralight: "2",
"ultra-light": "2",
light: "3",
regular: "4",
book: "4",
medium: "5",
"semi-bold": "6",
semibold: "6",
"demi-bold": "6",
demibold: "6",
bold: "7",
"extra-bold": "8",
extrabold: "8",
"ultra-bold": "8",
ultrabold: "8",
black: "9",
heavy: "9",
l: "3",
r: "4",
b: "7",
},
W = { i: "i", italic: "i", n: "n", normal: "n" },
K = /^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/;
function q(t, e) {
(this.c = t), (this.a = e);
}
var Z = { Arimo: !0, Cousine: !0, Tinos: !0 };
function J(t, e) {
(this.c = t), (this.a = e);
}
function Q(t, e) {
(this.c = t), (this.f = e), (this.a = []);
}
(q.prototype.load = function (t) {
var e = new f(),
i = this.c,
n = new V(this.a.api, this.a.text),
s = this.a.families;
!(function (t, e) {
for (var i = e.length, n = 0; n < i; n++) {
var s = e[n].split(":");
3 == s.length && t.f.push(s.pop());
var r = "";
2 == s.length && "" != s[1] && (r = ":"), t.a.push(s.join(r));
}
})(n, s);
var r = new G(s);
!(function (t) {
for (var e = t.f.length, i = 0; i < e; i++) {
var n = t.f[i].split(":"),
s = n[0].replace(/\+/g, " "),
r = ["n4"];
if (2 <= n.length) {
var o;
if (((o = []), (a = n[1])))
for (var a, h = (a = a.split(",")).length, l = 0; l < h; l++) {
var u;
if ((u = a[l]).match(/^[\w-]+$/))
if (null == (d = K.exec(u.toLowerCase()))) u = "";
else {
if (((u = null == (u = d[2]) || "" == u ? "n" : W[u]), null == (d = d[1]) || "" == d)) d = "4";
else
var c = H[d],
d = c || (isNaN(d) ? "4" : d.substr(0, 1));
u = [u, d].join("");
}
else u = "";
u && o.push(u);
}
0 < o.length && (r = o), 3 == n.length && ((o = []), 0 < (n = (n = n[2]) ? n.split(",") : o).length && (n = j[n[0]]) && (t.c[s] = n));
}
for (t.c[s] || ((n = j[s]) && (t.c[s] = n)), n = 0; n < r.length; n += 1) t.a.push(new x(s, r[n]));
}
})(r),
c(
i,
(function (t) {
if (0 == t.a.length) throw Error("No fonts to load!");
if (-1 != t.c.indexOf("kit=")) return t.c;
for (var e = t.a.length, i = [], n = 0; n < e; n++) i.push(t.a[n].replace(/ /g, "+"));
return (e = t.c + "?family=" + i.join("%7C")), 0 < t.f.length && (e += "&subset=" + t.f.join(",")), 0 < t.g.length && (e += "&text=" + encodeURIComponent(t.g)), e;
})(n),
v(e)
),
y(e, function () {
t(r.a, r.c, Z);
});
}),
(J.prototype.load = function (o) {
var t = this.a.id,
a = this.c.o;
t
? d(
this.c,
(this.a.api || "https://use.typekit.net") + "/" + t + ".js",
function (t) {
if (t) o([]);
else if (a.Typekit && a.Typekit.config && a.Typekit.config.fn) {
t = a.Typekit.config.fn;
for (var e = [], i = 0; i < t.length; i += 2) for (var n = t[i], s = t[i + 1], r = 0; r < s.length; r++) e.push(new x(n, s[r]));
try {
a.Typekit.load({ events: !1, classes: !1, async: !0 });
} catch (t) {}
o(e);
}
},
2e3
)
: o([]);
}),
(Q.prototype.load = function (l) {
var t,
e = this.f.id,
i = this.c.o,
u = this;
e
? (i.__webfontfontdeckmodule__ || (i.__webfontfontdeckmodule__ = {}),
(i.__webfontfontdeckmodule__[e] = function (t, e) {
for (var i = 0, n = e.fonts.length; i < n; ++i) {
var s = e.fonts[i];
u.a.push(
new x(
s.name,
((r = "font-weight:" + s.weight + ";font-style:" + s.style),
(h = a = o = void 0),
(o = 4),
(a = "n"),
(h = null),
r &&
((h = r.match(/(normal|oblique|italic)/i)) && h[1] && (a = h[1].substr(0, 1).toLowerCase()),
(h = r.match(/([1-9]00|normal|bold)/i)) && h[1] && (/bold/i.test(h[1]) ? (o = 7) : /[1-9]00/.test(h[1]) && (o = parseInt(h[1].substr(0, 1), 10)))),
a + o)
)
);
}
var r, o, a, h;
l(u.a);
}),
d(this.c, (this.f.api || "https://f.fontdeck.com/s/css/js/") + ((t = this.c).o.location.hostname || t.a.location.hostname) + "/" + e + ".js", function (t) {
t && l([]);
}))
: l([]);
});
var $ = new t(window);
($.a.c.custom = function (t, e) {
return new X(e, t);
}),
($.a.c.fontdeck = function (t, e) {
return new Q(e, t);
}),
($.a.c.monotype = function (t, e) {
return new z(e, t);
}),
($.a.c.typekit = function (t, e) {
return new J(e, t);
}),
($.a.c.google = function (t, e) {
return new q(e, t);
});
var tt = { load: p($.load, $) };
"function" == typeof define && define.amd
? define(function () {
return tt;
})
: "undefined" != typeof module && module.exports
? (module.exports = tt)
: ((window.WebFont = tt), window.WebFontConfig && $.load(window.WebFontConfig));
})(),
(function (i) {
var n = {};
function s(t) {
if (n[t]) return n[t].exports;
var e = (n[t] = { i: t, l: !1, exports: {} });
return i[t].call(e.exports, e, e.exports, s), (e.l = !0), e.exports;
}
(s.m = i),
(s.c = n),
(s.d = function (t, e, i) {
s.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: i });
}),
(s.r = function (t) {
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 });
}),
(s.t = function (e, t) {
if ((1 & t && (e = s(e)), 8 & t)) return e;
if (4 & t && "object" == typeof e && e && e.__esModule) return e;
var i = Object.create(null);
if ((s.r(i), Object.defineProperty(i, "default", { enumerable: !0, value: e }), 2 & t && "string" != typeof e))
for (var n in e)
s.d(
i,
n,
function (t) {
return e[t];
}.bind(null, n)
);
return i;
}),
(s.n = function (t) {
var e =
t && t.__esModule
? function () {
return t.default;
}
: function () {
return t;
};
return s.d(e, "a", e), e;
}),
(s.o = function (t, e) {
return Object.prototype.hasOwnProperty.call(t, e);
}),
(s.p = ""),
s((s.s = 60));
})([
function (t, e, i) {
var n,
s,
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(62), i(63), i(64), i(65), i(66)]),
void 0 ===
(s = function (t, e, i, n, s, r, o) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }),
(e.Fonts = e.Sounds = e.Atlases = e.Constants = e.Images = void 0),
Object.defineProperty(e, "Images", {
enumerable: !0,
get: function () {
return a(i).default;
},
}),
Object.defineProperty(e, "Constants", {
enumerable: !0,
get: function () {
return a(n).default;
},
}),
Object.defineProperty(e, "Atlases", {
enumerable: !0,
get: function () {
return a(s).default;
},
}),
Object.defineProperty(e, "Sounds", {
enumerable: !0,
get: function () {
return a(r).default;
},
}),
Object.defineProperty(e, "Fonts", {
enumerable: !0,
get: function () {
return a(o).default;
},
});
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
d =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(73), i(37), i(74), i(75), i(49), i(79), i(50), i(80), i(81), i(82)]),
void 0 ===
(s = function (t, e, i, n, s, r, o, a, h, l, u, c) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }),
(e.JDMaskParent = e.JDSpineGameObject = e.JDTextTranslated = e.JDText = e.JDImageSkew = e.JDImagePivot = e.JDBmpdText = e.JDImageAnim = e.JDImage = e.JDSprite = void 0),
Object.defineProperty(e, "JDSprite", {
enumerable: !0,
get: function () {
return d(i).default;
},
}),
Object.defineProperty(e, "JDImage", {
enumerable: !0,
get: function () {
return d(n).default;
},
}),
Object.defineProperty(e, "JDImageAnim", {
enumerable: !0,
get: function () {
return d(s).default;
},
}),
Object.defineProperty(e, "JDBmpdText", {
enumerable: !0,
get: function () {
return d(r).default;
},
}),
Object.defineProperty(e, "JDImagePivot", {
enumerable: !0,
get: function () {
return d(o).default;
},
}),
Object.defineProperty(e, "JDImageSkew", {
enumerable: !0,
get: function () {
return d(a).default;
},
}),
Object.defineProperty(e, "JDText", {
enumerable: !0,
get: function () {
return d(h).default;
},
}),
Object.defineProperty(e, "JDTextTranslated", {
enumerable: !0,
get: function () {
return d(l).default;
},
}),
Object.defineProperty(e, "JDSpineGameObject", {
enumerable: !0,
get: function () {
return d(u).default;
},
}),
Object.defineProperty(e, "JDMaskParent", {
enumerable: !0,
get: function () {
return c.JDMaskParent;
},
});
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(3)]),
void 0 ===
(s = function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t) || this;
return (i.scalable = !0), (i.hangable = !0), (i.layer = e), i;
}
return (
o(t, n),
(t.prototype.update = function () {
this.landed && this.specificLand();
}),
(t.prototype.specificLand = function () {}),
(t.prototype.levelStart = function () {}),
(t.prototype.destroy = function () {
(this.topBound = null),
(this.topBoundPolygon = null),
(this.bottomBound = null),
(this.bottomBoundPolygon = null),
(this.leftBound = null),
(this.leftBoundPolygon = null),
(this.rightBound = null),
(this.rightBoundPolygon = null),
(this.lhBound = null),
(this.lhBoundPolygon = null),
(this.rhBound = null),
(this.rhBoundPolygon = null),
(this.totalBound = null),
(this.totalBoundPolygon = null),
(this.layer = null),
(this.landed = null),
n.prototype.destroy.call(this);
}),
(t.prototype.resetLevel = function () {
this.landed = null;
}),
(t.prototype.reset = function () {
this.landed = null;
}),
(t.prototype.init = function (t, e, i, n) {
(this.xPos = t),
(this.yPos = e),
(this.prevX = t),
(this.prevY = e),
(this.startX = t),
(this.startY = e),
(this.width = i),
(this.height = n),
(this.xVelocity = 0),
(this.yVelocity = 0),
(this.landed = null),
(this.alive = !0),
(this.halfWidth = 0.5 * this.width),
(this.halfHeight = 0.5 * this.height),
this.initEdges(),
this.initBounds(),
this.initBoundsToPolygon(),
this.initOffsets();
}),
(t.prototype.initEdges = function () {
(this.leftEdge = this.xPos - this.halfWidth), (this.rightEdge = this.xPos + this.halfWidth), (this.topEdge = this.yPos - this.halfHeight), (this.bottomEdge = this.yPos + this.halfHeight);
}),
(t.prototype.initBounds = function () {
(this.totalBound = new SAT.Box(new SAT.Vector(this.xPos, this.yPos), this.width, this.height)),
(this.topBound = new SAT.Box(new SAT.Vector(this.xPos, this.yPos), this.width, t.TOP_BOUND_HEIGHT)),
(this.lhBound = new SAT.Box(new SAT.Vector(this.xPos, this.yPos), this.halfWidth, t.TOP_BOUND_HEIGHT)),
(this.rhBound = new SAT.Box(new SAT.Vector(this.xPos, this.yPos), this.halfWidth, t.TOP_BOUND_HEIGHT)),
(this.leftBound = new SAT.Box(new SAT.Vector(this.xPos, this.yPos), this.halfWidth, this.height)),
(this.rightBound = new SAT.Box(new SAT.Vector(this.xPos, this.yPos), this.halfWidth, this.height)),
(this.bottomBound = new SAT.Box(new SAT.Vector(this.xPos, this.yPos), this.width, t.TOP_BOUND_HEIGHT));
}),
(t.prototype.initBoundsToPolygon = function () {
(this.totalBoundPolygon = this.totalBound.toPolygon()),
(this.topBoundPolygon = this.topBound.toPolygon()),
(this.lhBoundPolygon = this.lhBound.toPolygon()),
(this.rhBoundPolygon = this.rhBound.toPolygon()),
(this.leftBoundPolygon = this.leftBound.toPolygon()),
(this.rightBoundPolygon = this.rightBound.toPolygon()),
(this.bottomBoundPolygon = this.bottomBound.toPolygon());
}),
(t.prototype.initOffsets = function () {
this.totalBoundPolygon.setOffset(new SAT.Vector(-this.halfWidth, -this.halfHeight)),
this.topBoundPolygon.setOffset(new SAT.Vector(-this.halfWidth, -this.halfHeight)),
this.lhBoundPolygon.setOffset(new SAT.Vector(-this.halfWidth, -this.halfHeight)),
this.rhBoundPolygon.setOffset(new SAT.Vector(0, -this.halfHeight)),
this.leftBoundPolygon.setOffset(new SAT.Vector(-this.halfWidth, -this.halfHeight)),
this.rightBoundPolygon.setOffset(new SAT.Vector(0, -this.halfHeight)),
this.bottomBoundPolygon.setOffset(new SAT.Vector(-this.halfWidth, this.halfHeight - t.TOP_BOUND_HEIGHT));
}),
(t.prototype.updatePosition = function () {
this.initEdges(),
(this.totalBoundPolygon.pos.x = this.xPos),
(this.totalBoundPolygon.pos.y = this.yPos),
(this.topBoundPolygon.pos.x = this.xPos),
(this.topBoundPolygon.pos.y = this.yPos),
(this.lhBoundPolygon.pos.x = this.xPos),
(this.lhBoundPolygon.pos.y = this.yPos),
(this.rhBoundPolygon.pos.x = this.xPos),
(this.rhBoundPolygon.pos.y = this.yPos),
(this.leftBoundPolygon.pos.x = this.xPos),
(this.leftBoundPolygon.pos.y = this.yPos),
(this.rightBoundPolygon.pos.x = this.xPos),
(this.rightBoundPolygon.pos.y = this.yPos),
(this.bottomBoundPolygon.pos.x = this.xPos),
(this.bottomBoundPolygon.pos.y = this.yPos),
this.updateGraphicPosition();
}),
(t.prototype.updateGraphicPosition = function () {}),
(t.TOP_BOUND_HEIGHT = 12),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n;
void 0 ===
(n = function (t, e) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function () {
function t(t) {
this.main = t;
}
return (
(t.prototype.destroy = function () {
this.main = null;
}),
(t.prototype.reset = function () {}),
(t.prototype.resetLevel = function () {
(this.xPos = this.startX), (this.yPos = this.startY);
}),
t
);
})();
e.default = i;
}.apply(e, [i, e])) || (t.exports = n);
},
function (t, e, i) {
var n,
s,
a =
(this && this.__awaiter) ||
function (t, o, a, h) {
return new (a || (a = Promise))(function (i, e) {
function n(t) {
try {
r(h.next(t));
} catch (t) {
e(t);
}
}
function s(t) {
try {
r(h.throw(t));
} catch (t) {
e(t);
}
}
function r(t) {
var e;
t.done
? i(t.value)
: ((e = t.value),
e instanceof a
? e
: new a(function (t) {
t(e);
})).then(n, s);
}
r((h = h.apply(t, o || [])).next());
});
},
h =
(this && this.__generator) ||
function (i, n) {
var s,
r,
o,
t,
a = {
label: 0,
sent: function () {
if (1 & o[0]) throw o[1];
return o[1];
},
trys: [],
ops: [],
};
return (
(t = { next: e(0), throw: e(1), return: e(2) }),
"function" == typeof Symbol &&
(t[Symbol.iterator] = function () {
return this;
}),
t
);
function e(e) {
return function (t) {
return (function (e) {
if (s) throw new TypeError("Generator is already executing.");
for (; a; )
try {
if (((s = 1), r && (o = 2 & e[0] ? r.return : e[0] ? r.throw || ((o = r.return) && o.call(r), 0) : r.next) && !(o = o.call(r, e[1])).done)) return o;
switch (((r = 0), o && (e = [2 & e[0], o.value]), e[0])) {
case 0:
case 1:
o = e;
break;
case 4:
return a.label++, { value: e[1], done: !1 };
case 5:
a.label++, (r = e[1]), (e = [0]);
continue;
case 7:
(e = a.ops.pop()), a.trys.pop();
continue;
default:
if (!((o = 0 < (o = a.trys).length && o[o.length - 1]) || (6 !== e[0] && 2 !== e[0]))) {
a = 0;
continue;
}
if (3 === e[0] && (!o || (e[1] > o[0] && e[1] < o[3]))) {
a.label = e[1];
break;
}
if (6 === e[0] && a.label < o[1]) {
(a.label = o[1]), (o = e);
break;
}
if (o && a.label < o[2]) {
(a.label = o[2]), a.ops.push(e);
break;
}
o[2] && a.ops.pop(), a.trys.pop();
continue;
}
e = n.call(i, a);
} catch (t) {
(e = [6, t]), (r = 0);
} finally {
s = o = 0;
}
if (5 & e[0]) throw e[1];
return { value: e[0] ? e[1] : void 0, done: !0 };
})([e, t]);
};
}
},
l =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(11), i(59), i(67), i(0)]),
void 0 ===
(s = function (t, e, n, s, r, o) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (e.Localization = void 0), (n = l(n)), (s = l(s)), (r = l(r));
var i = (function () {
function i() {}
return (
(i.init = function (e) {
return a(this, void 0, Promise, function () {
return h(this, function (t) {
switch (t.label) {
case 0:
return (this.cache = e), [4, i.createBrowserDetector()];
case 1:
return t.sent(), [4, i.initIl8n()];
case 2:
return t.sent(), [2];
}
});
});
}),
(i.createBrowserDetector = function () {
this.languageDetector = new i18nextBrowserLanguageDetector(null, {
order: ["querystring", "cookie", "localStorage", "sessionStorage", "navigator", "htmlTag"],
lookupQuerystring: "lng",
lookupCookie: "i18next",
lookupLocalStorage: "i18nextLng",
lookupSessionStorage: "i18nextLng",
caches: ["localStorage"],
excludeCacheFor: ["cimode"],
});
}),
(i.initIl8n = function () {
var t = this;
s.default
.use(r.default)
.init(
{
debug: !1,
resources: {
en: { translation: this.cache.json.get("en") },
ru: { translation: this.cache.json.get("ru") },
fr: { translation: this.cache.json.get("fr") },
pt: { translation: this.cache.json.get("pt") },
de: { translation: this.cache.json.get("de") },
it: { translation: this.cache.json.get("it") },
es: { translation: this.cache.json.get("es") },
nl: { translation: this.cache.json.get("nl") },
no: { translation: this.cache.json.get("no") },
},
},
function () {
s.default.changeLanguage(t.getDefaultLanguage()).catch(function (t) {}), t.setLng(s.default.language);
}
)
.catch(function (t) {});
}),
(i.getFontSize = function (t) {
var e = this.cache.json.get("fontStyling")[t];
return (e && e[this.language].fontSize) || null;
}),
(i.getDefaultLanguage = function () {
if ("none" !== h5branding.Utils.LANGUAGE) return h5branding.Utils.LANGUAGE;
var t = s.default.language;
return -1 !== t.indexOf("-") && (t = t.split("-")[0]), -1 === o.Constants.AVAILABLE_LANGUAGES.indexOf(t) ? i.FALLBACK_LNG : t;
}),
(i.getLang = function () {
return this.language;
}),
(i.add = function (t, e) {
this.data[t] = e;
}),
(i.prototype.getValue = function (t) {
return s.default.t(t);
}),
(i.prototype.getInterpolatedValue = function (t, e) {
return s.default.t(t, { number: e });
}),
(i.setLng = function (t, e) {
void 0 === e && (e = !0), (this.language = t), !0 === e && n.default.getInstance().saveProgress();
}),
(i.getText = function (t) {
var e = s.default.t(t);
return e || "" === t ? e : t;
}),
(i.EVENT_CHANGE_LANG = "event_change_lang"),
(i.FALLBACK_LNG = "en"),
(i.data = {}),
i
);
})();
e.Localization = i;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(53), i(54), i(161), i(42), i(162)]),
void 0 ===
(s = function (t, e, i, n, s, r, o) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }),
(e.BtnImgScale = e.ButtonScale = e.ButtonText = e.ButtonImage = e.Button = void 0),
Object.defineProperty(e, "Button", {
enumerable: !0,
get: function () {
return a(i).default;
},
}),
Object.defineProperty(e, "ButtonImage", {
enumerable: !0,
get: function () {
return a(n).default;
},
}),
Object.defineProperty(e, "ButtonText", {
enumerable: !0,
get: function () {
return a(s).default;
},
}),
Object.defineProperty(e, "ButtonScale", {
enumerable: !0,
get: function () {
return a(r).default;
},
}),
Object.defineProperty(e, "BtnImgScale", {
enumerable: !0,
get: function () {
return a(o).default;
},
});
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
h =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(7), i(11)]),
void 0 ===
(s = function (t, e, r, i, o) {
"use strict";
var n, s;
Object.defineProperty(e, "__esModule", { value: !0 }), (e.SoundType = void 0), (i = h(i)), (o = h(o)), ((s = n = e.SoundType || (e.SoundType = {})).Music = "mus"), (s.SFX = "sfx");
var a = (function () {
function t() {}
return (
(t.init = function (t) {
(this.soundManager = t.sound), !0 === this.soundManager.locked && this.soundManager.context && this.soundManager.context.suspend();
}),
(t.getSound = function (t) {
return void 0 === this.sfxInstances[t] && (this.sfxInstances[t] = this.soundManager.add(t)), this.sfxInstances[t];
}),
(t.getSfxLoop = function (t) {
return void 0 === this.sfxLoopInstances[t] && (this.sfxLoopInstances[t] = this.soundManager.add(t)), this.sfxLoopInstances[t];
}),
(t.getSoundCheck = function (t, e) {
return !1 === e ? this.getSound(t) : this.getSfxLoop(t);
}),
(t.isPlaying = function (t, e) {
return this.getSoundCheck(t, e).isPlaying;
}),
(t.isPaused = function (t, e) {
return this.getSoundCheck(t, e).isPaused;
}),
(t.pause = function (t, e) {
this.getSoundCheck(t, e).pause();
}),
(t.resume = function (t, e) {
this.getSoundCheck(t, e).resume();
}),
(t.playMusic = function (t) {
var e = r.Constants.volumeMusic;
this.music
? !1 === r.Constants.mutedMusic
? this.music.key === t
? !1 === this.music.isPlaying && this.music.play(void 0, { volume: e, loop: !0 })
: (this.music.stop(), (this.music = this.getSound(t)), this.music.play(void 0, { volume: e, loop: !0 }))
: (this.music.volume = e)
: ((this.music = this.getSound(t)), !1 === r.Constants.mutedMusic && this.music.play(void 0, { volume: e, loop: !0 }));
}),
(t.stopMusic = function () {
this.music && this.music.stop();
}),
(t.playSFX = function (t, e, i) {
void 0 === e && (e = 1),
void 0 === i && (i = !1),
!0 !== r.Constants.mutedSfx
? !0 === i
? this.getSfxLoop(t).play(void 0, { volume: e * r.Constants.volumeSfx, loop: !0 })
: this.getSound(t).play(void 0, { volume: e * r.Constants.volumeSfx })
: !0 === i && this.getSfxLoop(t);
}),
(t.stopSFX = function (t) {
void 0 !== this.sfxInstances[t] && this.sfxInstances[t].stop();
}),
(t.stopSFXLoop = function (t) {
void 0 !== this.sfxLoopInstances[t] && this.sfxLoopInstances[t].stop();
}),
(t.stopAllSFXLoop = function () {
for (var t = 0, e = Object.keys(this.sfxLoopInstances); t < e.length; t++) {
var i = e[t];
this.sfxLoopInstances[i].stop();
}
}),
(t.changeEnabledMusic = function () {
!1 === r.Constants.mutedMusic
? null !== this.music && this.music.pause()
: null !== this.music && (!0 === this.music.isPaused ? this.music.resume() : this.music.play(void 0, { volume: r.Constants.volumeMusic, loop: !0 })),
(r.Constants.mutedMusic = !r.Constants.mutedMusic),
o.default.getInstance().saveProgress();
}),
(t.changeEnabledSFX = function () {
if (!1 === r.Constants.mutedSfx)
for (var t = 0, e = Object.keys(this.sfxLoopInstances); t < e.length; t++) {
var i = e[t];
!0 === this.sfxLoopInstances[i].isPlaying && this.sfxLoopInstances[i].pause();
}
else for (var n = 0, s = Object.keys(this.sfxLoopInstances); n < s.length; n++) (i = s[n]), !0 === this.sfxLoopInstances[i].isPaused && this.sfxLoopInstances[i].resume();
(r.Constants.mutedSfx = !r.Constants.mutedSfx), o.default.getInstance().saveProgress();
}),
(t.setEnabled = function (t) {
t === n.Music ? this.changeEnabledMusic() : this.changeEnabledSFX();
}),
(t.playMenuSong = function () {
this.playMusic("menuSong");
}),
(t.playMusicNormal = function () {
this.playMusic("vexSong" + (1 + this.nextMusicNormalIndex)), (this.nextMusicNormalIndex += 1), 7 <= this.nextMusicNormalIndex && (this.nextMusicNormalIndex = 0);
}),
(t.playMusicHard = function () {
this.playMusic("vexSong" + (8 + this.nextMusicHardIndex)), (this.nextMusicHardIndex += 1), 7 <= this.nextMusicHardIndex && (this.nextMusicHardIndex = 0);
}),
(t.playRandomMusic = function () {
this.playMusic("vexSong" + i.default.random(1, 14));
}),
(t.playBonusStageMusic = function () {
this.playRandomMusic();
}),
(t.music = null),
(t.sfxLoopInstances = {}),
(t.sfxInstances = {}),
(t.nextMusicNormalIndex = 0),
(t.nextMusicHardIndex = 0),
t
);
})();
e.default = a;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n;
void 0 ===
(n = function (t, e) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function () {
function n() {}
return (
(n.random = function (t, e) {
return Math.floor(Math.random() * (e - t + 1)) + t;
}),
(n.randomNum = function (t, e) {
return Math.random() * (e - t) + t;
}),
(n.simpleRandom = function () {
return 100 * Math.random();
}),
(n.randomOne = function (t) {
return void 0 === t && (t = 0.5), Math.random() < t ? 1 : -1;
}),
(n.randomBool = function (t) {
return void 0 === t && (t = 0.5), Math.random() < t;
}),
(n.getDir = function (t) {
return t < 0 ? -1 : 0 < t ? 1 : 0;
}),
(n.roundDec = function (t, e) {
void 0 === e && (e = 0);
var i = Math.pow(10, e);
return Math.round(t * i) / i;
}),
(n.clamp = function (t, e, i) {
return Math.max(e, Math.min(i, t));
}),
(n.lerp = function (t, e, i) {
return t + (e - t) * n.clamp(i, 0, 1);
}),
(n.lerpUnity = function (t, e, i) {
return t + (e - t) * n.clamp01Unity(i);
}),
(n.clamp01Unity = function (t) {
return t < 0 ? 0 : 1 < t ? 1 : t;
}),
(n.magnitudeUnity = function (t, e) {
return Math.sqrt(t * t + e * e);
}),
(n.sqrtMagnitudeUnity = function (t, e) {
return t * t + e * e;
}),
(n.toDeg = function (t) {
return t * this.radToDeg;
}),
(n.toRad = function (t) {
return t * this.degToRad;
}),
(n.rotatePointByAngle = function (t, e, i, n, s) {
var r = Math.cos(s),
o = Math.sin(s);
return { x: t + (i - t) * r - (n - e) * o, y: e + (i - t) * o + (n - e) * r };
}),
(n.distance = function (t, e, i, n) {
return Math.sqrt((i - t) * (i - t) + (n - e) * (n - e));
}),
(n.angleOfPoints = function (t, e, i, n, s, r) {
return void 0 === s && (s = -1), void 0 === r && (r = -1), Math.atan2((n - e) * s, (i - t) * r);
}),
(n.getObjectRandomProperty = function (t) {
var e = Object.keys(t);
return t[e[(e.length * Math.random()) << 0]];
}),
(n.abs = function (t) {
return t < 0 && (t = -t), t;
}),
(n.getSlideSide = function (t, e, i, n) {
var s = this.toDeg(this.angleOfPoints(t, e, i, n));
return s < -45 && -135 < s ? "down" : (135 < s && s <= 180) || (-180 <= s && s < -135) ? "right" : 45 < s && s < 135 ? "up" : -45 < s && s < 45 ? "left" : void 0;
}),
(n.toPercent = function (t, e) {
return (t / e) * 100;
}),
(n.fromPercent = function (t, e) {
return (t * e) / 100;
}),
(n.damping = function (t, e, i) {
return void 0 === e && (e = 0.05), void 0 === i && (i = 0.95), 0 !== t && n.abs((t *= i)) < e && (t = 0), t;
}),
(n.intersectsRectangles = function (t, e, i, n, s, r, o, a) {
return !(t + i < s || e + n < r || s + o < t || r + a < e);
}),
(n.intersectCircleRectange = function (t, e, i, n, s, r, o) {
var a = r / 2,
h = o / 2,
l = Math.abs(t - n - a),
u = Math.abs(e - s - h);
if (a + i < l) return !1;
if (h + i < u) return !1;
if (l <= a) return !0;
if (u <= h) return !0;
var c = l - a,
d = u - h;
return c * c + d * d <= i * i;
}),
(n.containsRectPoint = function (t, e, i, n, s, r) {
return t <= s && s < t + i && e <= r && r < e + n;
}),
(n.angleDifference = function (t, e) {
var i = e < t ? t - e : e - t;
return i < 180 ? i : 360 - i;
}),
(n.vec2Length = function (t, e) {
return Math.sqrt(t * t + e * e);
}),
(n.getRandomCellID = function (t) {
return Math.floor(Math.random() * t);
}),
(n.getAndDelRandomCell = function (t) {
var e = n.getRandomCellID(t.length),
i = t[e];
return t.splice(e, 1), i;
}),
(n.getRandomCell = function (t) {
return t[n.getRandomCellID(t.length)];
}),
(n.shuffle = function (t) {
for (var e = t.length; 1 < e; ) {
e--;
var i = Math.floor(Math.random() * (e + 1)),
n = t[i];
(t[i] = t[e]), (t[e] = n);
}
}),
(n.getFrom1Dto2DIndex = function (t, e) {
return { x: t % e, y: Math.floor(t / e) };
}),
(n.containsPointInPoly = function (t, e, i) {
for (var n = !1, s = t.length - 1, r = 0; r < t.length; s = r++) {
var o = t[r].x,
a = t[r].y,
h = t[s].x,
l = t[s].y;
!0 == (i < a != i < l && e < ((h - o) * (i - a)) / (l - a) + o) && (n = !n);
}
return n;
}),
(n.interpolateColor = function (t, e, i, n) {
return this.getHexColorFromRBG255(this.interpolateColorRGB(this.getRGB255(t), this.getRGB255(e), i, n));
}),
(n.interpolateColorRGB = function (t, e, i, n) {
return { r: ((e.r - t.r) * i) / n + t.r, g: ((e.g - t.g) * i) / n + t.g, b: ((e.b - t.b) * i) / n + t.b };
}),
(n.getRGB = function (t) {
return { r: ((t >> 16) & 255) / 255, g: ((t >> 8) & 255) / 255, b: (255 & t) / 255 };
}),
(n.getRGBFromString = function (t) {
var e = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
return e ? { r: parseInt(e[1], 16) / 255, g: parseInt(e[2], 16) / 255, b: parseInt(e[3], 16) / 255 } : null;
}),
(n.getRGB255 = function (t) {
return { r: (t >> 16) & 255, g: (t >> 8) & 255, b: 255 & t };
}),
(n.getHexColorFromRBG255 = function (t) {
return this.getHexColorFrom255(t.r, t.g, t.b);
}),
(n.getHexColorFrom255 = function (t, e, i) {
return (t << 16) | (e << 8) | i;
}),
(n.formatNumber = function (t) {
return t.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,");
}),
(n.sortArrayObectsByKey = function (t, s, e) {
void 0 === e && (e = !0);
var r = -1,
o = 1;
!1 === e && (o = -(r = 1)),
t.sort(function (t, e) {
var i = t[s],
n = e[s];
return i < n ? r : n < i ? o : 0;
});
}),
(n.checkSkewValue = function (t) {
return t > Math.PI ? (t = -(Math.PI - (t - Math.PI))) : t < -Math.PI && (t = Math.PI + (t + Math.PI)), t;
}),
(n.smartRotation = function (t) {
return (t %= n.PI2) > Math.PI ? (t -= n.PI2) : t < -Math.PI && (t += n.PI2), t;
}),
(n.convertNumToStr = function (t, e) {
void 0 === e && (e = 2);
var i = String(Math.floor(t));
for ("NaN" === i && (i = "0"); i.length < e; ) i = "0" + i;
return i;
}),
(n.formatNum = function (t, e, i) {
void 0 === i && (i = -1);
var n = t < 0;
t = Math.abs(t);
for (var s = "" + Math.floor(t); s.length < e; ) s = "0" + s;
if (0 <= i) {
var r = "" + t,
o = r.indexOf(".");
for (-1 === o && (o = r.length - 1), r = r.substr(o + 1, i); r.length < i; ) r += "0";
s += "." + r;
}
return !0 === n && (s = "-" + s), s;
}),
(n.getVolumeFromVelocity = function (t, e, i) {
return void 0 === e && (e = 10), void 0 === i && (i = 1), i < t / e ? i : t / e;
}),
(n.calcCurrentTime = function (t) {
var e = new Date(Date.now()),
i = new Date(t);
return i.setTime(i.getTime()), e - i;
}),
(n.isAnHour = function (t) {
return 1 <= Math.floor(t / 1e3 / 60 / 60);
}),
(n.PI2 = 2 * Math.PI),
(n.PI05 = Math.PI / 2),
(n.PI025 = Math.PI / 4),
(n.degToRad = Math.PI / 180),
(n.radToDeg = 180 / Math.PI),
n
);
})();
e.default = i;
}.apply(e, [i, e])) || (t.exports = n);
},
function (t, e, i) {
var n, s;
(n = [i, e, i(45), i(15)]),
void 0 ===
(s = function (t, e, r, o) {
"use strict";
var a, i;
Object.defineProperty(e, "__esModule", { value: !0 }), (e.AdHandler = void 0), ((i = a || (a = {})).PAUSED = "Paused"), (i.RESUMED = "Resumed");
var n = (function () {
function e(t) {
(this.contentStatus = a.RESUMED), (this.game = t);
}
return (
(e.getInstance = function (t) {
return e.instance || (e.instance = new e(t)), e.instance;
}),
(e.prototype.initAdProvider = function () {
var t = new YandexAdProvider("");
h5ads.adWrapper.setAdProvider(t), h5ads.adWrapper.preloadAd(h5ads.AdType.rewarded);
}),
(e.prototype.showAd = function (t, e, i, n) {
var s = this;
r.LoaderHelper.show(),
h5ads.adWrapper.once(h5ads.AdEvents.CONTENT_PAUSED, function () {
r.LoaderHelper.hide(), o.AnalyticsHandler.getInstance().sendScreenView("advertisement_" + t), i && i.call(s), (s.contentStatus = a.PAUSED), s.game.events.emit(Phaser.Core.Events.PAUSE);
}),
h5ads.adWrapper.once(h5ads.AdEvents.CONTENT_RESUMED, function () {
r.LoaderHelper.hide(),
e && e.call(s),
h5ads.adWrapper.removeAllListeners(h5ads.AdEvents.CONTENT_PAUSED),
h5ads.adWrapper.removeAllListeners(h5ads.AdEvents.CONTENT_RESUMED),
(s.contentStatus = a.RESUMED),
s.game.events.emit(Phaser.Core.Events.RESUME);
}),
h5ads.adWrapper.showAd(h5ads.AdType.interstitial);
}),
(e.prototype.showRewarded = function (t, e) {
var i = this,
n = !1;
h5ads.adWrapper.once(h5ads.AdEvents.CONTENT_PAUSED, function () {
r.LoaderHelper.hide(), (i.contentStatus = a.PAUSED), i.game.events.emit(Phaser.Core.Events.PAUSE), e && e();
}),
h5ads.adWrapper.once(h5ads.AdEvents.CONTENT_RESUMED, function () {
i.game.events.emit(Phaser.Core.Events.RESUME), h5ads.adWrapper.preloadAd(h5ads.AdType.rewarded), (i.contentStatus = a.RESUMED), t && t(n);
}),
h5ads.adWrapper.addListener(h5ads.AdEvents.AD_REWARDED, function () {
n = !0;
}),
h5ads.adWrapper.showAd(h5ads.AdType.rewarded);
}),
(e.prototype.isAdPlaying = function () {
return this.contentStatus === a.PAUSED;
}),
e
);
})();
e.AdHandler = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(3)]),
void 0 ===
(s = function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t) || this;
return (i.layer = e), (i.alive = !1), i;
}
return (
o(t, n),
(t.prototype.destroy = function () {
n.prototype.destroy.call(this), (this.layer = null);
}),
(t.prototype.levelStart = function () {}),
(t.prototype.update = function () {}),
(t.prototype.updatePosition = function () {}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(7), i(4)]),
void 0 ===
(s = function (t, e, i, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (i = r(i));
var s = (function () {
function t() {}
return (
(t.timeDecorator = function (t) {
var e = Math.floor((t / 100) % 10),
i = e.toString();
e < 10 && (i = "0" + e);
var n = Math.floor((t / 1e3) % 60),
s = n.toString();
n < 10 && (s = "0" + s);
var r = Math.floor((t / 1e3 / 60) % 60),
o = r.toString();
return r < 10 && (o = "0" + o), "".concat(o, ":").concat(s, ":").concat(i);
}),
(t.timeDecoratorHub = function (t) {
var e = Math.floor((t / 1e3) % 60),
i = e.toString();
e < 10 && (i = "0" + i);
var n = Math.floor((t / 1e3 / 60) % 60),
s = n.toString();
n < 10 && (s = "0" + s);
var r = Math.floor((t / 1e3 / 60 / 60) | 0),
o = r.toString();
return r < 10 && (o = "0" + o), "".concat(o, ":").concat(s, ":").concat(i);
}),
(t.timeDecoratorActBlock = function (t) {
var e = Math.floor((t / 1e3) % 60),
i = e.toString();
e < 10 && (i = "0" + i);
var n = Math.floor((t / 1e3 / 60) % 60),
s = n.toString();
return n < 10 && (s = "0" + s), "".concat(s, ":").concat(i);
}),
(t.moneyDecorator = function (t) {
return t < 1e3 ? "" + t : t.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ".");
}),
(t.getDeathText = function (t) {
var e = 1;
return (
0 === t || 1 === t || 10 === t || 15 === t
? (e = 2)
: 2 === t || 3 === t || 4 === t || 5 === t || 7 === t || 9 === t || 11 === t || 12 === t || 13 === t || 14 === t
? (e = 3)
: 6 === t
? (e = 1)
: 8 === t && (e = 4),
"death" + t + "_" + i.default.random(1, e)
);
}),
(t.formatNumberZeroLess10 = function (t) {
return t < 10 ? "0" + t : "" + t;
}),
(t.getLevelTargetText = function (t, e) {
return 1 === t
? n.Localization.getText("lvlTarget1")
: 2 === t
? n.Localization.getText("lvlTarget2").replace("", "" + e)
: 3 === t
? e <= 1
? n.Localization.getText("lvlTarget3")
: n.Localization.getText("lvlTarget3less").replace("", "" + e)
: void 0;
}),
(t.parseTextFadeWordsColor = function (t) {
for (var e = 0, i = "", n = !0; e < t.length; ) {
var s = t.indexOf("[", e);
if (-1 === s) {
i += t.substring(e);
break;
}
var r = s + "[".length,
o = t[r],
a = 0;
"]" !== t[r + 1] && ((o += t[r + 1]), (a = 1)), (i += !0 === n ? t.substring(e, s) + "[color=" + this.fadeTextColors[o] + "]" : t.substring(e, s) + "[/color]"), (n = !n), (e = s + "[".length + 2 + a);
}
return i;
}),
(t.getTextFadeMainColor = function (t) {
return 1 === t || 2 === t || 8 === t || 18 === t || 20 === t || 23 === t || 24 === t || 31 === t || 38 === t || 40 === t || 43 === t || 45 === t ? "#313131" : 30 === t ? "#0051B6" : "#ffffff";
}),
(t.showAd = function (t, e) {
t.apply(e);
}),
(t.fadeTextColors = [
"#5C98FD",
"#970000",
"#FD5B66",
"#8ABAFD",
"#9696C9",
"#8EBAFD",
"#FD9700",
"#FB9500",
"#FD6400",
"#CCB17C",
"#FDCA00",
"#CA0000",
"#5399FD",
"#6497CA",
"#97CAFD",
"#4FD38F",
"#96FC31",
"#974C32",
"#64CA00",
"#7A3B29",
"#00CACA",
"#CA9764",
"#0064FD",
"#FDCA31",
"#A2C3A4",
"#7C7FBC",
"#FDFDCA",
"#FCFC63",
"#64CAFD",
"#488CE8",
"#FCB3FD",
"#929292",
"#FD3131",
"#FD97FD",
"#FD9900",
"#B80808",
]),
t
);
})();
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n, s;
(n = [i, e, i(4), i(0)]),
void 0 ===
(s = function (t, e, i, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var s = (function () {
function t() {
var t = localStorage.getItem(n.Constants.STORAGE_KEY);
t
? ((t = JSON.parse(t)),
(this.checkPoint = t.checkPoint),
(n.Constants.levelsCompleted = t.levelsCompleted),
this.setOptions(t.options),
this.setStats(t.stats),
(this.levels = t.levels),
(this.achievements = t.achievements),
(this.daily = t.daily),
(this.skins = t.skins))
: this.clearAll();
}
return (
(t.getInstance = function () {
return t.instance || (t.instance = new t()), t.instance;
}),
(t.prototype.getAllValues = function () {
return {
checkPoint: this.checkPoint,
levelsCompleted: n.Constants.levelsCompleted,
options: this.getOptions(),
stats: this.getStats(),
levels: this.getAllLevels(),
achievements: this.getAchievements(),
daily: this.getDaily(),
skins: this.getSkins(),
};
}),
(t.prototype.getOptions = function () {
return { ar: n.Constants.autoReset, mts: n.Constants.mutedSfx, mtm: n.Constants.mutedMusic, lng: i.Localization.getLang() };
}),
(t.prototype.setOptions = function (t) {
(n.Constants.autoReset = t.ar), (n.Constants.mutedSfx = t.mts), (n.Constants.mutedMusic = t.mtm), i.Localization.setLng(t.lng, !1);
}),
(t.prototype.getStats = function () {
return { td: n.Constants.totalDeaths, tp: n.Constants.timePlayed, tm: n.Constants.totalMoney, cs: n.Constants.currSkin };
}),
(t.prototype.setStats = function (t) {
(n.Constants.totalDeaths = t.td), (n.Constants.timePlayed = t.tp), (n.Constants.totalMoney = t.tm), (n.Constants.currSkin = t.cs);
}),
(t.prototype.getCheckPoint = function () {
return this.checkPoint;
}),
(t.prototype.saveCheckPoint = function (t, e) {
(this.checkPoint = { x: t, y: e }), this.saveProgress();
}),
(t.prototype.removeCheckPoint = function () {
(this.checkPoint = null), this.saveProgress();
}),
(t.prototype.getAllLevels = function () {
return this.levels;
}),
(t.prototype.getLevel = function (t) {
return this.levels[t];
}),
(t.prototype.saveLevel = function (t, e) {
(this.levels[t] = e), (n.Constants.levelsCompleted = Number(t)), this.saveProgress();
}),
(t.prototype.getAchievements = function () {
return this.achievements;
}),
(t.prototype.saveAchievements = function (t) {
(this.achievements = t), this.saveProgress();
}),
(t.prototype.getDaily = function () {
return this.daily;
}),
(t.prototype.saveDaily = function (t) {
(this.daily = t), this.saveProgress();
}),
(t.prototype.getSkins = function () {
return this.skins;
}),
(t.prototype.saveSkins = function (t) {
(this.skins = t), this.saveProgress();
}),
(t.prototype.saveProgress = function () {
localStorage.setItem(n.Constants.STORAGE_KEY, JSON.stringify(this.getAllValues()));
}),
(t.prototype.clearAll = function () {
(this.checkPoint = null),
(n.Constants.volumeMusic = 0.4),
(n.Constants.volumeSfx = 1),
(n.Constants.autoReset = !1),
(n.Constants.particleLimit = 30),
(n.Constants.blend = !0),
(n.Constants.parallax = !0),
(n.Constants.mutedSfx = !1),
(n.Constants.mutedMusic = !1),
(n.Constants.totalDeaths = 0),
(n.Constants.timePlayed = 0),
(n.Constants.totalMoney = 0),
(n.Constants.currSkin = 0),
(this.levels = {}),
(this.achievements = { a: [0], ah: [0] });
for (var t = n.Constants.actsStarts; t <= n.Constants.totalActs; t++) (this.levels[t] = this.getNewLevelData()), (this.achievements.a[t] = 0), (this.achievements.ah[t] = 0);
(n.Constants.levelsCompleted = 0), this.saveProgress();
}),
(t.prototype.getNewLevelData = function () {
return { tt: -1, tth: -1, cc: 0, nd: 0, cch: 0, ndh: 0 };
}),
t
);
})();
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
x =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
b =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(29), i(52), i(28), i(159), i(201), i(202), i(21), i(22), i(23), i(1), i(27), i(19), i(17)]),
void 0 ===
(s = function (t, e, i, n, s, r, o, a, h, l, u, c, d, f, p, g) {
"use strict";
var v, y;
Object.defineProperty(e, "__esModule", { value: !0 }),
(e.SubSceneList = void 0),
(n = b(n)),
(r = b(r)),
(a = b(a)),
(h = b(h)),
(p = b(p)),
(g = b(g)),
((y = v = e.SubSceneList || (e.SubSceneList = {}))[(y.Menu = 0)] = "Menu"),
(y[(y.Hub = 1)] = "Hub"),
(y[(y.Act = 2)] = "Act"),
(y[(y.BonusStage = 3)] = "BonusStage"),
(y[(y.Vex = 4)] = "Vex"),
(y[(y.SkinsRarity = 5)] = "SkinsRarity"),
(y[(y.SkinsSelect = 6)] = "SkinsSelect");
var m = (function (e) {
function t() {
var t = (null !== e && e.apply(this, arguments)) || this;
return (t.ZOOM_UI_SCALE = 1), (t._zoom = 1), t;
}
return (
x(t, e),
(t.prototype.initConfig = function () {
var t = this.game.cache.json.get("configuration");
p.default.init(this, t.dailyRewardCoins, t.dailyTaskCollectCoins), g.default.init(t.skinsPrice, t.skinRareIDs, t.skinIDs);
}),
(t.prototype.playerDie = function () {
!0 === this.canShowPanel && ((this.countDeath += 1), 5 === this.countDeath && ((this.countDeath = 0), this.showPanelAreYouOK()));
}),
(t.prototype.setCanShowPanelAreYouOK = function () {
this.canShowPanel = !0;
}),
(t.prototype.showPanelAreYouOK = function () {
var t = this;
this.panelManager.show(l.PanelList.PanelAreYouOk),
(this.canShowPanel = !1),
setTimeout(function () {
return t.setCanShowPanelAreYouOK();
}, 6e4);
}),
(t.prototype.init = function () {
this.initConfig(),
(this.canShowPanel = !0),
(this.countDeath = 0),
a.default.create(this),
this.input.addPointer(2),
this.cameras.main.setBackgroundColor(16777215),
this.setCameraBounds(-1e4, -1e4, 2e4, 2e4),
(this.background = new Phaser.GameObjects.Image(this, 0, 0, "background")),
this.background.setOrigin(0, 0),
this.background.setPipeline(u.PipelineManager.getPipeline(c.PipelineList.ColorMatrix)),
u.PLColorMatrix.reset(this.background),
(this.resizeGroup = this.add.container()),
this.resizeGroup.add(this.background),
(this.underPoolLayer = new Phaser.GameObjects.Container(this)),
this.resizeGroup.add(this.underPoolLayer),
(this.playerUnderLayer = new Phaser.GameObjects.Container(this)),
this.resizeGroup.add(this.playerUnderLayer),
(this.poolLayer = new Phaser.GameObjects.Container(this)),
this.resizeGroup.add(this.poolLayer),
(this.obstacleLayer = new Phaser.GameObjects.Container(this)),
this.resizeGroup.add(this.obstacleLayer),
(this.levelLayer = new Phaser.GameObjects.Container(this)),
this.resizeGroup.add(this.levelLayer),
(this.topObstacleLayer = new Phaser.GameObjects.Container(this)),
this.resizeGroup.add(this.topObstacleLayer),
(this.particleLayer = new Phaser.GameObjects.Container(this)),
this.resizeGroup.add(this.particleLayer),
(this.topPoolLayer = new Phaser.GameObjects.Container(this)),
this.resizeGroup.add(this.topPoolLayer),
(this.textLayer = new Phaser.GameObjects.Container(this)),
this.resizeGroup.add(this.textLayer),
(this.playerLayer = new Phaser.GameObjects.Container(this)),
this.resizeGroup.add(this.playerLayer),
this.createOverlays(),
(this.guiLayer = this.add.container()),
(this.keys = new h.default(this, this.guiLayer)),
this.keys.hide(),
(this.panelManager = new l.PanelManager(this)),
this.guiLayer.add(this.panelManager),
(this.achievements = new f.PAchievement(this)),
this.guiLayer.add(this.achievements),
(this.transition = new s.Transition(this)),
this.guiLayer.add(this.transition),
this.initResize();
}),
(t.prototype.setCameraBounds = function (t, e, i, n) {
this.cameras.main.setBounds(t, e, i, n);
}),
(t.prototype.showAchievement = function () {}),
(t.prototype.createOverlays = function () {
(this.overlayLayer = new Phaser.GameObjects.Container(this)),
this.resizeGroup.add(this.overlayLayer),
(this.darkOverlay = new d.JDSprite(this, 0, 0, "darkOverlay")),
this.overlayLayer.add(this.darkOverlay),
(this.darkOverlay.visible = !1),
(this.darkGraphics = new Phaser.GameObjects.Graphics(this)),
this.overlayLayer.add(this.darkGraphics),
(this.darkGraphics.visible = !1);
var t = n.default.MaxCanvasW,
e = n.default.MaxCanvasH;
this.darkGraphics.clear(),
this.darkGraphics.fillStyle(0),
this.darkGraphics.fillRect(-t, -e - 259, 2 * t, e),
this.darkGraphics.fillRect(-t, 259, 2 * t, e),
this.darkGraphics.fillRect(-t, -e, t - 259, 2 * e),
this.darkGraphics.fillRect(259, -e, t - 259, 2 * e),
(this.flashOverlay = new Phaser.GameObjects.Graphics(this)),
this.overlayLayer.add(this.flashOverlay),
this.flashOverlay.fillStyle(16777215),
this.flashOverlay.fillRect(0, 0, i.Constants.UI_WIDTH, i.Constants.UI_HEIGHT),
this.flashOverlay.setScrollFactor(0, 0),
(this.flashOverlay.visible = !1);
}),
(t.prototype.showSubScene = function (t, e) {
p.default.stopTimer(),
this.panelManager.reset(),
(this.currSubScene = t),
this.subScene && (this.subScene.destroy(), (this.subScene = null)),
t === v.Menu
? (this.subScene = new o.SubMenu(this))
: t === v.Hub
? (this.subScene = new o.SubHub(this))
: t === v.Act
? (this.subScene = new o.SubAct(this))
: t === v.Vex
? (this.subScene = new o.SubVex(this))
: t === v.BonusStage
? (this.subScene = new o.SubBonusStage(this))
: t === v.SkinsRarity
? (this.subScene = new o.SubSkinsRarity(this))
: t === v.SkinsSelect && (this.subScene = new o.SubSkinsSelect(this)),
this.subScene.init(e),
this.guiLayer.addAt(this.subScene, 0),
this.subScene.resize();
}),
(t.prototype.resize = function () {
this.updateGUILayer(this._zoom),
this.subScene && this.subScene.resize(),
this.panelManager.resize(),
this.transition.resize(),
this.achievements.resize(),
this.keys.resize(),
n.default.scaleFitScreen(this.flashOverlay);
}),
(t.prototype.updateGUILayer = function (t) {
var e = 1 / t - 1;
(this.ZOOM_UI_SCALE = i.Constants.UI_SCALE / t),
(this.guiLayer.scale = this.ZOOM_UI_SCALE),
(this.guiX = i.Constants.UI_SHIFT_X * this.guiLayer.scaleX - this.getGameHalfWidth() * e),
(this.guiY = i.Constants.UI_SHIFT_Y * this.guiLayer.scaleY - this.getGameHalfHeight() * e),
this.updateGuiX(),
this.updateGuiY();
}),
Object.defineProperty(t.prototype, "zoom", {
get: function () {
return this._zoom;
},
set: function (t) {
this._zoom !== t && ((this._zoom = t), (this.cameras.main.zoom = t), this.resize());
},
enumerable: !1,
configurable: !0,
}),
(t.prototype.updateGuiX = function () {
this.guiLayer.x = this.guiX + this.cameraX;
}),
(t.prototype.updateGuiY = function () {
this.guiLayer.y = this.guiY + this.cameraY;
}),
(t.prototype.update = function () {
this.subScene && this.subScene.update(), this.panelManager.update(), this.transition.update(), this.keys.update(), !1 === this.transition.visible && this.achievements.update();
}),
Object.defineProperty(t.prototype, "cameraX", {
get: function () {
return this.cameras.main.scrollX;
},
set: function (t) {
(this.cameras.main.scrollX = Math.round(t)), this.updateGuiX();
},
enumerable: !1,
configurable: !0,
}),
Object.defineProperty(t.prototype, "cameraY", {
get: function () {
return this.cameras.main.scrollY;
},
set: function (t) {
(this.cameras.main.scrollY = Math.round(t)), this.updateGuiY();
},
enumerable: !1,
configurable: !0,
}),
(t.prototype.getGameWidth = function () {
return n.default.CanvasW;
}),
(t.prototype.getGameHeight = function () {
return n.default.CanvasH;
}),
(t.prototype.getGameHalfWidth = function () {
return n.default.CanvasHalfW;
}),
(t.prototype.getGameHalfHeight = function () {
return n.default.CanvasHalfH;
}),
t
);
})(r.default);
e.default = m;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
"use strict";
function n(t, e) {
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
}
i.d(e, "a", function () {
return n;
});
},
function (t, e, i) {
"use strict";
function n(t, e) {
for (var i = 0; i < e.length; i++) {
var n = e[i];
(n.enumerable = n.enumerable || !1), (n.configurable = !0), "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n);
}
}
function s(t, e, i) {
return e && n(t.prototype, e), i && n(t, i), Object.defineProperty(t, "prototype", { writable: !1 }), t;
}
i.d(e, "a", function () {
return s;
});
},
function (t, e, i) {
var n;
void 0 ===
(n = function (t, e) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (e.AnalyticsHandler = void 0);
var i = (function () {
function t() {}
return (
(t.getInstance = function () {
return t.instance || (t.instance = new t()), t.instance;
}),
(t.prototype.load = function (t) {
(this.analyticsProvider = new h5SansAnalytics.DummyAnalyticsProvider()), this.analyticsProvider.loadScript(t);
}),
(t.prototype.create = function (t) {
this.analyticsProvider.create(t);
}),
(t.prototype.addDesignEvent = function (t, e) {
this.analyticsProvider.addDesignEvent(t, e);
}),
(t.prototype.addProgressionEvent = function (t, e, i, n, s) {
this.analyticsProvider.addProgressionEvent(t, e, n, s);
}),
(t.prototype.sendScreenView = function (t) {
this.analyticsProvider.sendScreenView(t);
}),
(t.prototype.sendCustomEvent = function (t, e) {
this.analyticsProvider.sendCustomEvent(t, e);
}),
t
);
})();
e.AnalyticsHandler = i;
}.apply(e, [i, e])) || (t.exports = n);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
});
(n = [i, e, i(0)]),
void 0 ===
(s = function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (e) {
function t(t) {
return e.call(this, t, i.Constants.GHW, i.Constants.GHH) || this;
}
return (
o(t, e),
(t.prototype.init = function (t) {}),
(t.prototype.clikcOnBlack = function () {
this.scene.panelManager.hideCurrent();
}),
(t.prototype.show = function () {
this.visible = !0;
}),
(t.prototype.hide = function () {
this.visible = !1;
}),
(t.prototype.resize = function () {}),
(t.prototype.update = function () {}),
(t.prototype.custom = function (t) {}),
(t.prototype.destroy = function () {
e.prototype.destroy.call(this);
}),
t
);
})(Phaser.GameObjects.Container);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(10), i(11)]),
void 0 ===
(s = function (t, e, i, n, o) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (n = r(n)), (o = r(o));
var s = (function () {
function t() {}
return (
(t.init = function (t, e, i) {
if (((this.skinsPrice = t), (this.skinRareIDs = e), (this.skinIDs = i), (this.totalSkins = 0), (this.data = o.default.getInstance().getSkins()), this.data)) {
for (n = 0; n < this.skinsRarity; n++) if (((s = this.skinIDs[n].length), (this.totalSkins += s), this.data[n].length < s)) for (r = 0; r < s; r++) this.data[n].push(0);
} else {
this.data = new Array(this.skinsRarity + 1);
for (var n = 0; n < this.skinsRarity; n++) {
var s = this.skinIDs[n].length;
(this.totalSkins += s), (this.data[n] = new Array(s));
for (var r = 0; r < s; r++) this.data[n][r] = 0;
}
(this.data[this.skinsRarity] = [0, 0, 0, 0, 0]), (this.data[0][0] = 2);
}
for (this.save(), this.totalSkinsOpened = 0, this.skinsOpened = new Array(this.skinsRarity), n = 0; n < this.skinsRarity; n++)
for (r = this.skinsOpened[n] = 0; r < this.data[n].length; r++) 0 !== this.data[n][r] && ((this.skinsOpened[n] += 1), (this.totalSkinsOpened += 1));
}),
(t.getSkinFrameName = function (t) {
return n.default.formatNumberZeroLess10(t) + " instance 10000";
}),
(t.getSkinIndex = function (t, e) {
return this.skinIDs[t].indexOf(e);
}),
(t.getSkinCell = function (t, e) {
return this.skinIDs[t][e];
}),
(t.getRaritySkinsAmount = function (t) {
return this.data[t].length;
}),
(t.getSlotStatus = function (t, e) {
return this.data[t][e];
}),
(t.hasUnusedSkin = function (t) {
for (var e = 0; e < this.data[t].length; e++) if (1 === this.data[t][e]) return !0;
return !1;
}),
(t.canShowI = function () {
for (var t = 0; t < this.skinsRarity; t++) if (!0 === this.canShowIRarity(t)) return !0;
return !1;
}),
(t.canShowIRarity = function (t) {
for (var e = 0; e < this.data[t].length; e++) if (1 === this.data[t][e]) return !0;
return !1;
}),
(t.enouthMoney = function (t) {
return i.Constants.totalMoney >= this.skinsPrice[t];
}),
(t.hasSpinTokens = function (t) {
return 0 !== this.data[this.skinsRarity][t];
}),
(t.getSpinTokensAmount = function (t) {
return this.data[this.skinsRarity][t];
}),
(t.getPrice = function (t) {
return this.skinsPrice[t];
}),
(t.getSkinOpened = function (t) {
return this.skinsOpened[t];
}),
(t.openSkin = function (t, e) {
(this.skinsOpened[t] += 1), (this.totalSkinsOpened += 1), (this.data[t][e] = 1), this.save();
}),
(t.setSkinStatus2 = function (t, e) {
(this.data[t][e] = 2), this.save();
}),
(t.addSpinToken = function (t, e) {
void 0 === e && (e = 1), (this.data[this.skinsRarity][t] += e), this.save();
}),
(t.save = function () {
o.default.getInstance().saveSkins(this.data);
}),
(t.skinsRarity = 5),
t
);
})();
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(9)]),
void 0 ===
(s = function (t, e, i, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var s = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (i.obstacleType = "spike"), i.init(), i;
}
return (
o(t, n),
(t.prototype.init = function () {
(this.sprite = new Phaser.GameObjects.Image(this.main, 0, 0, i.Atlases.gameplay, "spike instance 10000")), this.layer.add(this.sprite), (this.width = 9), (this.height = 18), (this.spikeNum = 1);
}),
(t.prototype.levelStart = function () {
for (var t = 0, e = this.main.pools; t < e.length; t++) {
var i = e[t];
SAT.testPolygonPolygon(this.deathBoxPolygon, i.totalPolygon) && (this.layer.remove(this.sprite), this.main.underPoolLayer.add(this.sprite));
}
}),
(t.prototype.spawn = function (t, e, i) {
(this.xPos = t), (this.yPos = e), (this.sprite.x = t), (this.sprite.y = e), (this.alive = !0), (this.sprite.visible = !0);
var n = 0.5 * this.width,
s = 0.5 * this.height;
(this.rad = (i * Math.PI) / 180), (this.sprite.rotation = this.rad);
var r = new Phaser.Geom.Point(-n * Math.cos(this.rad) - -s * Math.sin(this.rad), -n * Math.sin(this.rad) + -s * Math.cos(this.rad)),
o = new Phaser.Geom.Point(n * Math.cos(this.rad) - -s * Math.sin(this.rad), n * Math.sin(this.rad) + -s * Math.cos(this.rad)),
a = new Phaser.Geom.Point(-n * Math.cos(this.rad) - s * Math.sin(this.rad), -n * Math.sin(this.rad) + s * Math.cos(this.rad)),
h = new Phaser.Geom.Point(n * Math.cos(this.rad) - s * Math.sin(this.rad), n * Math.sin(this.rad) + s * Math.cos(this.rad));
this.deathBoxPolygon = new SAT.Polygon(new SAT.Vector(t, e), [new SAT.Vector(r.x, r.y), new SAT.Vector(o.x, o.y), new SAT.Vector(h.x, h.y), new SAT.Vector(a.x, a.y)]);
}),
(t.prototype.update = function () {}),
(t.prototype.movePosition = function (t, e) {
(this.xPos = t), (this.yPos = e), (this.sprite.x = t), (this.sprite.y = e), (this.deathBoxPolygon.pos.x = t), (this.deathBoxPolygon.pos.y = e);
}),
(t.prototype.updatePosition = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos);
var t = 0.5 * this.width,
e = 0.5 * this.height,
i = new Phaser.Geom.Point(-t * Math.cos(this.rad) - -e * Math.sin(this.rad), -t * Math.sin(this.rad) + -e * Math.cos(this.rad)),
n = new Phaser.Geom.Point(t * Math.cos(this.rad) - -e * Math.sin(this.rad), t * Math.sin(this.rad) + -e * Math.cos(this.rad)),
s = new Phaser.Geom.Point(-t * Math.cos(this.rad) - e * Math.sin(this.rad), -t * Math.sin(this.rad) + e * Math.cos(this.rad)),
r = new Phaser.Geom.Point(t * Math.cos(this.rad) - e * Math.sin(this.rad), t * Math.sin(this.rad) + e * Math.cos(this.rad));
this.deathBoxPolygon = new SAT.Polygon(new SAT.Vector(this.xPos, this.yPos), [new SAT.Vector(i.x, i.y), new SAT.Vector(n.x, n.y), new SAT.Vector(r.x, r.y), new SAT.Vector(s.x, s.y)]);
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), (this.deathBoxPolygon = null);
}),
t
);
})((n = a(n)).default);
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
u =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(7), i(10), i(4), i(11)]),
void 0 ===
(s = function (t, e, n, s, r, i, o) {
"use strict";
var a, h;
Object.defineProperty(e, "__esModule", { value: !0 }),
(e.TaskID = void 0),
(s = u(s)),
(r = u(r)),
(o = u(o)),
((h = a = e.TaskID || (e.TaskID = {}))[(h.collectCoins = 0)] = "collectCoins"),
(h[(h.completeLevel = 1)] = "completeLevel"),
(h[(h.playBonusStage = 2)] = "playBonusStage"),
(h[(h.completeAny3Levels = 3)] = "completeAny3Levels");
var l = (function () {
function t() {}
return (
(t.init = function (t, e, i) {
(this.scene = t),
(this.rewardCoins = e),
(this.taskCollectCoins = i),
(this.timeToReset = 864e5),
(this.data = o.default.getInstance().getDaily()),
this.data || this.reset(this.timeToReset),
this.resetTxt(),
this.startTimer();
}),
(t.tickTimer = function () {
var t = Date.now();
if (this.data.rTime < t) {
var e = (t - this.data.rTime) % this.timeToReset;
this.reset(this.timeToReset - e), this.resetTxt(), this.scene.events.emit(this.EVENT_TIMER_RESET);
}
var i = this.data.rTime - t;
this.scene.events.emit(this.EVENT_TIMER_TICK, r.default.timeDecoratorHub(i));
}),
(t.startTimer = function () {
var t = this;
this.tickTimer(),
-1 === this.intervalID &&
(this.intervalID = setInterval(function () {
return t.tickTimer();
}, 1e3));
}),
(t.stopTimer = function () {
-1 !== this.intervalID && (clearInterval(this.intervalID), (this.intervalID = -1));
}),
(t.getRewardCoins = function () {
return this.rewardCoins;
}),
(t.reward = function (t) {
(n.Constants.totalMoney += this.rewardCoins), (this.data.tasks[t].r = 2), this.save(), this.scene.events.emit(this.EVENT_REWARDED);
}),
(t.getData = function (t) {
return { curr: this.data.tasks[t].c, target: this.data.tasks[t].t, rewarded: this.data.tasks[t].r, des: this.dataTxt[t] };
}),
(t.saveData = function (t, e) {
if (0 === this.data.tasks[t].r) {
if (t === a.completeLevel && e !== this.data.tasks[t].l) return;
(this.data.tasks[t].c += 1), this.data.tasks[t].c >= this.data.tasks[t].t && (this.data.tasks[t].r = 1);
}
this.save();
}),
(t.canShowTaskI = function () {
for (var t = 0; t < this.data.tasks.length; t++) if (1 === this.data.tasks[t].r) return !0;
return !1;
}),
(t.canShowBonusStageI = function () {
return 0 === this.data.tasks[a.playBonusStage].r;
}),
(t.bonusStageExit = function () {
this.data.tasks[a.playBonusStage].r = -1;
}),
(t.reset = function (t) {
var e = new Array(4);
e[a.collectCoins] = { c: 0, t: s.default.getRandomCell(this.taskCollectCoins), r: 0 };
var i = n.Constants.levelsCompleted + 1;
i > n.Constants.totalActs && (i = n.Constants.totalActs),
(e[a.completeLevel] = { c: 0, t: 1, r: 0, l: s.default.random(1, i) }),
(e[a.playBonusStage] = { c: 0, t: 1, r: 0 }),
(e[a.completeAny3Levels] = { c: 0, t: 3, r: 0 }),
(this.data = { rTime: Date.now() + t, tasks: e }),
this.save();
}),
(t.resetTxt = function () {
this.dataTxt = [
i.Localization.getText("dailyTaskDes0").replace("", "" + this.data.tasks[a.collectCoins].t),
i.Localization.getText("dailyTaskDes1") + " " + this.data.tasks[a.completeLevel].l,
i.Localization.getText("dailyTaskDes2"),
i.Localization.getText("dailyTaskDes3"),
];
}),
(t.save = function () {
o.default.getInstance().saveDaily(this.data);
}),
(t.EVENT_REWARDED = "event_daily_rewarded"),
(t.EVENT_TIMER_TICK = "event_daily_timer_tick"),
(t.EVENT_TIMER_RESET = "event_daily_timer_reset"),
(t.taskCollectCoins = []),
(t.intervalID = -1),
t
);
})();
e.default = l;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
C =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(87), i(88), i(25), i(89), i(90), i(91), i(92), i(93), i(94), i(95), i(9), i(96), i(97), i(98), i(99), i(100), i(101), i(18), i(102), i(103), i(104), i(105), i(106), i(107), i(108), i(109), i(110)]),
void 0 ===
(s = function (t, e, i, n, s, r, o, a, h, l, u, c, d, f, p, g, v, y, m, x, b, w, T, S, _, E, P, A, M) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }),
(e.WireTrail = e.SpikeActBlockHard = e.Spike30x = e.Spike25x = e.Spike20x = e.Spike15x = e.Spike10xHigh = e.Spike10x = e.Spike5x = e.Spike = e.Spark = e.ShurikanSpawner = e.ShurikanHorizontal = e.ShurikanDispenser = e.Reaper = e.Quadrant = e.Obstacle = e.LaserPoint = e.FallingSpike = e.EnlargingBuzzsaw = e.ClassicLaser = e.BuzzsawVertical = e.BuzzsawOnStick = e.BuzzsawHorizontal = e.Buzzsaw = e.Bullet = e.BouncingBuzzsaw = void 0),
Object.defineProperty(e, "BouncingBuzzsaw", {
enumerable: !0,
get: function () {
return C(i).default;
},
}),
Object.defineProperty(e, "Bullet", {
enumerable: !0,
get: function () {
return C(n).default;
},
}),
Object.defineProperty(e, "Buzzsaw", {
enumerable: !0,
get: function () {
return C(s).default;
},
}),
Object.defineProperty(e, "BuzzsawHorizontal", {
enumerable: !0,
get: function () {
return C(r).default;
},
}),
Object.defineProperty(e, "BuzzsawOnStick", {
enumerable: !0,
get: function () {
return C(o).default;
},
}),
Object.defineProperty(e, "BuzzsawVertical", {
enumerable: !0,
get: function () {
return C(a).default;
},
}),
Object.defineProperty(e, "ClassicLaser", {
enumerable: !0,
get: function () {
return C(h).default;
},
}),
Object.defineProperty(e, "EnlargingBuzzsaw", {
enumerable: !0,
get: function () {
return C(l).default;
},
}),
Object.defineProperty(e, "FallingSpike", {
enumerable: !0,
get: function () {
return C(u).default;
},
}),
Object.defineProperty(e, "LaserPoint", {
enumerable: !0,
get: function () {
return C(c).default;
},
}),
Object.defineProperty(e, "Obstacle", {
enumerable: !0,
get: function () {
return C(d).default;
},
}),
Object.defineProperty(e, "Quadrant", {
enumerable: !0,
get: function () {
return C(f).default;
},
}),
Object.defineProperty(e, "Reaper", {
enumerable: !0,
get: function () {
return C(p).default;
},
}),
Object.defineProperty(e, "ShurikanDispenser", {
enumerable: !0,
get: function () {
return C(g).default;
},
}),
Object.defineProperty(e, "ShurikanHorizontal", {
enumerable: !0,
get: function () {
return C(v).default;
},
}),
Object.defineProperty(e, "ShurikanSpawner", {
enumerable: !0,
get: function () {
return C(y).default;
},
}),
Object.defineProperty(e, "Spark", {
enumerable: !0,
get: function () {
return C(m).default;
},
}),
Object.defineProperty(e, "Spike", {
enumerable: !0,
get: function () {
return C(x).default;
},
}),
Object.defineProperty(e, "Spike5x", {
enumerable: !0,
get: function () {
return C(b).default;
},
}),
Object.defineProperty(e, "Spike10x", {
enumerable: !0,
get: function () {
return C(w).default;
},
}),
Object.defineProperty(e, "Spike10xHigh", {
enumerable: !0,
get: function () {
return C(T).default;
},
}),
Object.defineProperty(e, "Spike15x", {
enumerable: !0,
get: function () {
return C(S).default;
},
}),
Object.defineProperty(e, "Spike20x", {
enumerable: !0,
get: function () {
return C(_).default;
},
}),
Object.defineProperty(e, "Spike25x", {
enumerable: !0,
get: function () {
return C(E).default;
},
}),
Object.defineProperty(e, "Spike30x", {
enumerable: !0,
get: function () {
return C(P).default;
},
}),
Object.defineProperty(e, "SpikeActBlockHard", {
enumerable: !0,
get: function () {
return C(A).default;
},
}),
Object.defineProperty(e, "WireTrail", {
enumerable: !0,
get: function () {
return C(M).default;
},
});
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
h =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
l =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(29), i(163)]),
void 0 ===
(s = function (t, e, n, s, r) {
"use strict";
var o, i;
Object.defineProperty(e, "__esModule", { value: !0 }),
(e.PanelManager = e.PanelList = void 0),
(s = l(s)),
((i = o = e.PanelList || (e.PanelList = {}))[(i.NoOne = 0)] = "NoOne"),
(i[(i.PanelOptionsMenu = 1)] = "PanelOptionsMenu"),
(i[(i.PanelOptionsHub = 2)] = "PanelOptionsHub"),
(i[(i.PanelTrophies = 3)] = "PanelTrophies"),
(i[(i.PanelPause = 4)] = "PanelPause"),
(i[(i.PanelActSelect = 5)] = "PanelActSelect"),
(i[(i.PanelLevelComplete = 6)] = "PanelLevelComplete"),
(i[(i.PanelLevelObjectives = 7)] = "PanelLevelObjectives"),
(i[(i.PanelDailyTasks = 8)] = "PanelDailyTasks"),
(i[(i.PanelBonusStageComplete = 9)] = "PanelBonusStageComplete"),
(i[(i.PanelAreYouOk = 10)] = "PanelAreYouOk");
var a = (function (i) {
function t(t) {
var e = i.call(this, t) || this;
return (
(e.notHideBlackAfterReset = !1),
(e.stock = {}),
(e.currentPanel = o.NoOne),
(e.prevPanel = o.NoOne),
(e.black = new Phaser.GameObjects.Rectangle(t, n.Constants.GHW, n.Constants.GHH, n.Constants.UI_WIDTH, n.Constants.UI_HEIGHT, 0, 0.6)),
e.black.setInteractive(),
e.black.on(Phaser.Input.Events.POINTER_DOWN, e.clickOnBlack, e),
e.add(e.black),
e.hideThis(),
e
);
}
return (
h(t, i),
(t.prototype.getPanel = function (t) {
return t === o.PanelOptionsMenu
? new r.PanelOptionsMenu(this.scene)
: t === o.PanelOptionsHub
? new r.PanelOptionsHub(this.scene)
: t === o.PanelTrophies
? new r.PanelTrophies(this.scene)
: t === o.PanelPause
? new r.PanelPause(this.scene)
: t === o.PanelActSelect
? new r.PanelActSelect(this.scene)
: t === o.PanelLevelComplete
? new r.PanelLevelComplete(this.scene)
: t === o.PanelLevelObjectives
? new r.PanelLevelObjectives(this.scene)
: t === o.PanelDailyTasks
? new r.PanelDailyTasks(this.scene)
: t === o.PanelBonusStageComplete
? new r.PanelBonusStageComplete(this.scene)
: t === o.PanelAreYouOk
? new r.PanelAreYouOk(this.scene)
: null;
}),
(t.prototype.show = function (t, e) {
if (!this.stock[t]) {
var i = this.getPanel(t);
i.init(e), i.resize(), this.add(i), (this.stock[t] = i), (i = null);
}
var n = this.currentPanel;
this.currentPanel !== o.NoOne && this.hide(this.currentPanel), (this.prevPanel = n), (this.currentPanel = t), this.stock[t].show(), (this.visible = !0);
}),
(t.prototype.custom = function (t, e) {
this.stock[t] && this.stock[t].custom(e);
}),
(t.prototype.hide = function (t) {
this.stock[t] && ((this.currentPanel = o.NoOne), this.stock[t].hide(), this.hideThis(), this.prevPanel !== o.NoOne && (this.show(this.prevPanel), (this.prevPanel = o.NoOne)));
}),
(t.prototype.hideThis = function () {
this.visible = !1;
}),
(t.prototype.hideCurrent = function () {
this.hide(this.currentPanel);
}),
(t.prototype.clickOnBlack = function () {
this.stock[this.currentPanel].clikcOnBlack();
}),
(t.prototype.hideAll = function () {
for (var t = 0, e = Object.keys(this.stock); t < e.length; t++) {
var i = e[t];
this.stock[i].hide();
}
this.hideThis(), (this.currentPanel = o.NoOne), (this.prevPanel = o.NoOne);
}),
(t.prototype.update = function () {
if (!1 !== this.visible)
for (var t = 0, e = Object.keys(this.stock); t < e.length; t++) {
var i = e[t];
this.stock[i].update();
}
}),
(t.prototype.resize = function () {
for (var t = 0, e = Object.keys(this.stock); t < e.length; t++) {
var i = e[t];
this.stock[i].resize();
}
s.default.scaleFitScreen(this.black);
}),
(t.prototype.removePanel = function (t) {
this.stock[t].destroy(), this.remove(this.stock[t]), delete this.stock[t];
}),
(t.prototype.reset = function () {
for (var t = 0, e = Object.keys(this.stock); t < e.length; t++) {
var i = e[t];
this.removePanel(i);
}
!(this.stock = {}) === this.notHideBlackAfterReset && this.hideThis(), (this.notHideBlackAfterReset = !1), (this.currentPanel = o.NoOne), (this.prevPanel = o.NoOne);
}),
(t.prototype.destroy = function () {
i.prototype.destroy.call(this), (this.stock = null), (this.black = null), (this.prevPanel = null), (this.currentPanel = null);
}),
t
);
})(Phaser.GameObjects.Container);
e.PanelManager = a;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
h =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(47), i(23), i(76), i(48), i(77), i(78)]),
void 0 ===
(s = function (t, e, i, n, s, r, o, a) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }),
(e.PLMIXBlurColorMatrix = e.PLColorMatrix = e.PLPivotSkew = e.PLBlur = e.PipelineManager = e.JDRender = void 0),
Object.defineProperty(e, "JDRender", {
enumerable: !0,
get: function () {
return h(i).default;
},
}),
Object.defineProperty(e, "PipelineManager", {
enumerable: !0,
get: function () {
return h(n).default;
},
}),
Object.defineProperty(e, "PLBlur", {
enumerable: !0,
get: function () {
return h(s).default;
},
}),
Object.defineProperty(e, "PLPivotSkew", {
enumerable: !0,
get: function () {
return h(r).default;
},
}),
Object.defineProperty(e, "PLColorMatrix", {
enumerable: !0,
get: function () {
return h(o).default;
},
}),
Object.defineProperty(e, "PLMIXBlurColorMatrix", {
enumerable: !0,
get: function () {
return h(a).default;
},
});
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n, s;
(n = [i, e, i(22)]),
void 0 ===
(s = function (t, e, s) {
"use strict";
var r, i;
Object.defineProperty(e, "__esModule", { value: !0 }),
(e.PipelineList = void 0),
((i = r = e.PipelineList || (e.PipelineList = {})).PivotSkew = "PivotSkew"),
(i.Blur = "Blur"),
(i.ColorMatrix = "ColorMatrix"),
(i.MIXBlurColorMatrix = "MIXBlurColorMatrix");
var n = (function () {
function t() {}
return (
(t.init = function (t) {
(this.game = t), (this.pipelines = {});
}),
(t.getPipeline = function (t, e) {
void 0 === e && (e = "");
var i = t + e,
n = this.pipelines[i];
return (
n ||
(t === r.PivotSkew
? (n = new s.PLPivotSkew(this.game))
: t === r.Blur
? (n = new s.PLBlur(this.game))
: t === r.ColorMatrix
? (n = new s.PLColorMatrix(this.game))
: t === r.MIXBlurColorMatrix && (n = new s.PLMIXBlurColorMatrix(this.game)),
this.game.renderer.pipelines.add(i, n),
(this.pipelines[i] = n)),
t
);
}),
t
);
})();
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(11)]),
void 0 ===
(s = function (t, e, i, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (n = r(n));
var s = (function () {
function t() {}
return (
(t.init = function (t) {
(this.main = t), (this.achievements = n.default.getInstance().getAchievements());
for (var e = i.Constants.actsStarts; e <= i.Constants.totalActs; e++) (this.actCompletes += this.achievements.a[e]), (this.actHardCompletes += this.achievements.ah[e]);
(this.totalComplete = this.actCompletes + this.actHardCompletes), (this.totalAchives = 2 * i.Constants.totalActs - 1);
}),
(t.isCompletedAct = function (t, e) {
return !1 === e ? 1 === this.achievements.a[t] : 1 === this.achievements.ah[t];
}),
(t.completeAct = function (t, e) {
if (!1 === e) {
if (0 !== this.achievements.a[t]) return;
(this.achievements.a[t] = 1), (this.actCompletes += 1), this.main.events.emit(this.EVENT_ACHIEVEMENT_COMPLETE, "Act", t);
} else {
if (0 !== this.achievements.ah[t]) return;
(this.achievements.ah[t] = 1), (this.actHardCompletes += 1), this.main.events.emit(this.EVENT_ACHIEVEMENT_COMPLETE, "ActHard", t);
}
this.saveAchievement();
}),
(t.saveAchievement = function () {
(this.totalComplete += 1), n.default.getInstance().saveAchievements(this.achievements);
}),
(t.getStandardActsProgress = function () {
return this.actCompletes / i.Constants.totalActs;
}),
(t.getHardcoreProgress = function () {
return this.actHardCompletes / (i.Constants.totalActs - 1);
}),
(t.getTotalProgress = function () {
return this.totalComplete / this.totalAchives;
}),
(t.EVENT_ACHIEVEMENT_COMPLETE = "event_achievement_complete"),
(t.actCompletes = 0),
(t.actHardCompletes = 0),
(t.totalAchives = 0),
(t.totalComplete = 0),
t
);
})();
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(7), i(9)]),
void 0 ===
(s = function (t, e, s, r, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (r = a(r));
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (
(i.checkUnderPool = !0),
(i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "buzzsaw instance 10000")),
e.add(i.sprite),
(i.sprite.visible = !1),
(i.deathCircle = new SAT.Circle(new SAT.Vector(0, 0), 44)),
(i.obstacleType = "buzzsaw"),
(i.killValue = 2),
(i.speedRot = r.default.toRad(2)),
i
);
}
return (
o(t, n),
(t.prototype.levelStart = function () {
if (!1 !== this.checkUnderPool)
for (var t = 0, e = this.main.pools; t < e.length; t++) {
var i = e[t];
!0 === SAT.testCirclePolygon(this.deathCircle, i.totalPolygon) && (this.layer.remove(this.sprite), this.main.underPoolLayer.add(this.sprite));
}
}),
(t.prototype.spawn = function (t, e, i) {
void 0 === i && (i = 1),
(this.xPos = t),
(this.yPos = e),
(this.startX = t),
(this.startY = e),
(this.sprite.x = t),
(this.sprite.y = e),
(this.sprite.visible = !0),
(this.deathCircle.pos.x = t),
(this.deathCircle.pos.y = e),
(this.alive = !0),
1 !== i && (this.sprite.setScale(i, i), (this.deathCircle.r = 44 * i));
}),
(t.prototype.update = function () {
this.sprite.rotation += this.speedRot;
}),
(t.prototype.updatePosition = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos), (this.deathCircle.pos.x = this.xPos), (this.deathCircle.pos.y = this.yPos);
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.deathCircle = null), n.prototype.destroy.call(this);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(33)]),
void 0 ===
(s = function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
o(e, t),
(e.prototype.init = function () {}),
(e.prototype.updateDeaths = function (t) {}),
(e.prototype.resetLevel = function () {}),
(e.prototype.updateTime = function () {}),
(e.prototype.showInfoLevel = function (t, e) {}),
(e.prototype.hideInfoLevel = function () {}),
(e.prototype.enterLevel = function (t) {}),
(e.prototype.exitLevel = function () {}),
(e.prototype.updateProgress = function (t) {}),
(e.prototype.resize = function () {}),
(e.prototype.getRank = function () {
return -1;
}),
(e.prototype.getTime = function () {
return "-1";
}),
e
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
l =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(184), i(185), i(186), i(187), i(188), i(189), i(190)]),
void 0 ===
(s = function (t, e, i, n, s, r, o, a, h) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }),
(e.PTNT = e.PAchievement = e.PLevelBonus = e.PLevel = e.PTimeHub = e.PTimeAct = e.PLevelInfo = void 0),
Object.defineProperty(e, "PLevelInfo", {
enumerable: !0,
get: function () {
return l(i).default;
},
}),
Object.defineProperty(e, "PTimeAct", {
enumerable: !0,
get: function () {
return l(n).default;
},
}),
Object.defineProperty(e, "PTimeHub", {
enumerable: !0,
get: function () {
return l(s).default;
},
}),
Object.defineProperty(e, "PLevel", {
enumerable: !0,
get: function () {
return l(r).default;
},
}),
Object.defineProperty(e, "PLevelBonus", {
enumerable: !0,
get: function () {
return l(o).default;
},
}),
Object.defineProperty(e, "PAchievement", {
enumerable: !0,
get: function () {
return l(a).default;
},
}),
Object.defineProperty(e, "PTNT", {
enumerable: !0,
get: function () {
return l(h).default;
},
});
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r =
(this && this.__extends) ||
((s = function (t, e) {
return (s =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
s(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
});
void 0 ===
(n = function (t, e) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
r(e, t),
(e.prototype.init = function () {
this.events.once(Phaser.Scenes.Events.SHUTDOWN, this.destroy, this);
}),
(e.prototype.initResize = function () {
this.scale.on(Phaser.Scale.Events.RESIZE, this.resize, this), this.resize();
}),
(e.prototype.resize = function () {}),
(e.prototype.destroy = function () {
this.scale.off(Phaser.Scale.Events.RESIZE, this.resize, this);
}),
e
);
})(Phaser.Scene);
e.default = i;
}.apply(e, [i, e])) || (t.exports = n);
},
function (t, e, i) {
var n, s;
(n = [i, e, i(0)]),
void 0 ===
(s = function (t, e, c) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function () {
function n() {}
return (
(n.init = function () {
(this.userRatio = 1) < (window.devicePixelRatio || 1) && (this.userRatio = 0.85),
(n.orientationDiv = document.getElementById(c.Constants.DIV_ID_ORIENTATION)),
(Phaser.Scale.ScaleManager.prototype.boot = function () {
(this.canvas = this.game.canvas),
(this.fullscreen = this.game.device.fullscreen),
this.game.events.on(Phaser.Core.Events.PRE_STEP, this.step, this),
this.game.events.once(Phaser.Core.Events.DESTROY, this.destroy, this),
this.startListeners();
}),
(Phaser.Scale.ScaleManager.prototype.getParentBounds = function () {
if (!this.parent) return !1;
var t = this.parentSize,
e = window.innerWidth,
i = window.innerHeight;
return (t.width !== e || t.height !== i) && (t.setSize(e, i), !0);
}),
(Phaser.Scale.ScaleManager.prototype.step = function (t, e) {
this.parent &&
((this._lastCheck += e),
(this.dirty || this._lastCheck > this.resizeInterval) &&
(this.getParentBounds() && n.resize(this.game, this.parentSize.width, this.parentSize.height), (this.dirty = !1), (this._lastCheck = 0)));
}),
(Phaser.Scale.ScaleManager.prototype.updateScale = function () {
var t = this.parentSize.width;
this.gameSize.width === n.MaxCanvasW && (t = n.MaxCanvasW / n.scaleFactor);
var e = this.parentSize.height;
this.gameSize.height === n.MaxCanvasH && (e = n.MaxCanvasH / n.scaleFactor), this.displaySize.resize(t, e);
var i = this.canvas.style;
(i.width = this.displaySize.width + "px"), (i.height = this.displaySize.height + "px"), this.getParentBounds(), this.updateCenter();
});
}),
(n.setGameSize = function (t, e) {
(c.Constants.GW = t), (c.Constants.GH = e), (c.Constants.GHW = Math.floor(c.Constants.GW / 2)), (c.Constants.GHH = Math.floor(c.Constants.GH / 2));
}),
(n.setMaxCanvasSize = function (t, e) {
(this.MaxCanvasW = t), (this.MaxCanvasH = e), (this.OW = (this.MaxCanvasW - c.Constants.GW) / 2), (this.OH = (this.MaxCanvasH - c.Constants.GH) / 2);
}),
(n.refresh = function (t) {
this.resize(t, window.innerWidth, window.innerHeight);
}),
(n.resize = function (t, e, i) {
var n = c.Constants.GW,
s = c.Constants.GH;
(this.scaleFactor = this.userRatio),
(this.scaleFactor /= i < e ? i / s : i / n),
(c.Constants.userRatio = this.scaleFactor),
(this.CanvasW = Math.ceil(e * this.scaleFactor)),
(this.CanvasH = Math.ceil(i * this.scaleFactor)),
this.CanvasW > this.MaxCanvasW && (this.CanvasW = this.MaxCanvasW),
this.CanvasH > this.MaxCanvasH && (this.CanvasH = this.MaxCanvasH),
(this.CanvasHalfW = this.CanvasW / 2),
(this.CanvasHalfH = this.CanvasH / 2),
this.resizeUI(this.CanvasW, this.CanvasH, c.Constants.UI_WIDTH, c.Constants.UI_HEIGHT),
this.nativeResize(t.scale, this.CanvasW, this.CanvasH),
!0 === c.Constants.IS_MOBILE && (this.checkOrientation(e, i), window.scroll(0, 0));
}),
(n.nativeResize = function (t, e, i) {
var n = t.width,
s = t.height;
t.gameSize.resize(e, i), t.baseSize.resize(e, i), (t.canvas.width = t.baseSize.width), (t.canvas.height = t.baseSize.height);
var r = t.canvas.style;
(r.width = e + "px"), (r.height = i + "px"), t.refresh(n, s);
}),
(n.checkOrientation = function (t, e) {
e < t === c.Constants.ORIENTATION_LANDSCAPE
? ((this.orientationDiv.style.display = "none"), (c.Constants.incorrectOrientation = !1))
: ((this.orientationDiv.style.display = "block"), (c.Constants.incorrectOrientation = !0));
}),
(n.resizeUI = function (t, e, i, n) {
var s = i < t ? 1 : t / i,
r = n < e ? 1 : e / n,
o = (s < r ? s : r) * c.Constants.UI_ADDITIONAL_SCALE,
a = (i - c.Constants.GW) / 2,
h = (n - c.Constants.GH) / 2,
l = Math.round(t / 2 - (i * o) / 2) + a * o,
u = Math.round(e / 2 - (n * o) / 2) + h * o;
(c.Constants.UI_SCALE_FIT_X = (t / i / o) * 1.01),
(c.Constants.UI_SCALE_FIT_Y = (e / n / o) * 1.01),
(c.Constants.UI_SCALE = o),
(c.Constants.UI_SHIFT_X = Math.round(l / o)),
(c.Constants.UI_SHIFT_Y = Math.round(u / o));
}),
(n.resizeCamera = function (t) {
t.setOrigin(0, 0), (t.zoom = c.Constants.UI_SCALE), t.setScroll(-c.Constants.UI_SHIFT_X, -c.Constants.UI_SHIFT_Y);
}),
(n.resizeContainer = function (t) {
(t.scale = c.Constants.UI_SCALE), (t.x = c.Constants.UI_SHIFT_X * c.Constants.UI_SCALE), (t.y = c.Constants.UI_SHIFT_Y * c.Constants.UI_SCALE);
}),
(n.scaleFitScreen = function (t) {
(t.scaleX = c.Constants.UI_SCALE_FIT_X), (t.scaleY = c.Constants.UI_SCALE_FIT_Y);
}),
(n.scaleFactor = 1),
n
);
})();
e.default = i;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
y =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
o =
(this && this.__createBinding) ||
(Object.create
? function (t, e, i, n) {
void 0 === n && (n = i),
Object.defineProperty(t, n, {
enumerable: !0,
get: function () {
return e[i];
},
});
}
: function (t, e, i, n) {
void 0 === n && (n = i), (t[n] = e[i]);
}),
a =
(this && this.__setModuleDefault) ||
(Object.create
? function (t, e) {
Object.defineProperty(t, "default", { enumerable: !0, value: e });
}
: function (t, e) {
t.default = e;
}),
m =
(this && this.__importStar) ||
function (t) {
if (t && t.__esModule) return t;
var e = {};
if (null != t) for (var i in t) "default" !== i && Object.prototype.hasOwnProperty.call(t, i) && o(e, t, i);
return a(e, t), e;
},
b =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(71), i(0), i(11), i(12), i(21), i(22), i(6), i(24), i(19), i(7), i(17), i(8)]),
void 0 ===
(s = function (t, e, i, x, o, a, n, s, h, r, l, u, c, d) {
"use strict";
var p, f, g;
Object.defineProperty(e, "__esModule", { value: !0 }),
(e.Bool3 = e.GameStates = void 0),
(i = b(i)),
(o = b(o)),
(h = b(h)),
(r = b(r)),
(l = m(l)),
(u = b(u)),
(c = b(c)),
((g = p = e.GameStates || (e.GameStates = {}))[(g.Loading = 0)] = "Loading"),
(g[(g.Playing = 1)] = "Playing"),
(g[(g.MainMenu = 2)] = "MainMenu"),
(g[(g.Skins = 3)] = "Skins"),
(g[(g.Pause = 4)] = "Pause"),
((f = e.Bool3 || (e.Bool3 = {}))[(f.true = 0)] = "true"),
(f[(f.false = 1)] = "false"),
(f[(f.none = 2)] = "none");
var v = (function (e) {
function t() {
var t = (null !== e && e.apply(this, arguments)) || this;
return (t.skipMenu = !1), t;
}
return (
y(t, e),
(t.prototype.init = function () {
r.default.init(this), e.prototype.init.call(this);
}),
(t.prototype.create = function () {
e.prototype.create.call(this),
(this.firstSpawn = !1),
(this.currentLevelID = x.Constants.mainmenuID),
(this.state = p.MainMenu),
!0 === this.skipMenu ? this.showSubSceneTransition(a.SubSceneList.Hub) : this.showSubMenu(),
this.input.on(Phaser.Input.Events.POINTER_MOVE, this.onPointerMove, this),
this.game.events.on(Phaser.Core.Events.BLUR, this.onFocusLost, this),
this.game.events.on(Phaser.Core.Events.FOCUS, this.onFocusFound, this);
}),
(t.prototype.onFocusLost = function () {
d.AdHandler.getInstance().isAdPlaying() ||
(this.state === p.Playing && (this.currSubScene === a.SubSceneList.Hub ? this.panelManager.show(n.PanelList.PanelOptionsHub) : this.panelManager.show(n.PanelList.PanelPause)), this.pauseState());
}),
(t.prototype.onFocusFound = function () {
d.AdHandler.getInstance().isAdPlaying() || this.resumeMenu();
}),
(t.prototype.showPanelTrophies = function () {
this.pauseState(), this.panelManager.show(n.PanelList.PanelTrophies);
}),
(t.prototype.showPanelDailyTask = function () {
this.pauseState(), this.panelManager.show(n.PanelList.PanelDailyTasks);
}),
(t.prototype.showSubSceneTransition = function (t, e, i) {
if ((void 0 === e && (e = -1), void 0 === i && (i = !1), !0 !== this.transition.visible)) {
if (t === a.SubSceneList.Menu) this.transition.beginTransition(this.showSubMenu, this);
else if (t === a.SubSceneList.Hub) this.preparePlayingScene(), this.transition.beginTransition(this.showSubHub, this);
else if (t === a.SubSceneList.Act) this.preparePlayingScene(), this.transition.beginTransition(this.showSubAct, this, e, i);
else if (t === a.SubSceneList.BonusStage) {
if (-1 === e && !1 === l.default.canShowBonusStageI()) return;
this.preparePlayingScene(), this.transition.beginTransition(this.showSubBonusStage, this, e);
} else
t === a.SubSceneList.Vex
? (this.preparePlayingScene(), this.transition.beginTransition(this.showSubVex, this, e, i))
: t === a.SubSceneList.SkinsRarity && this.transition.beginTransition(this.showSubSkinRarity, this, e);
this.state = p.Loading;
}
}),
(t.prototype.backFromSubSkin = function () {
this.prevLevel === x.Constants.mainmenuID
? this.showSubSceneTransition(a.SubSceneList.Menu)
: this.prevLevel === x.Constants.hubID
? this.showSubSceneTransition(a.SubSceneList.Hub)
: this.showSubSceneTransition(a.SubSceneList.Act, Number(this.prevLevel), this.isCurrLevelHard);
}),
(t.prototype.showSubSkinRarity = function (t) {
this.resetSubScene(), (this.currentLevelID = "skin" + t), (this.state = p.Skins), this.showSubScene(a.SubSceneList.SkinsRarity);
}),
(t.prototype.showSubMenu = function () {
(this.prevMenu = !0), this.resetSubScene(), (this.state = p.MainMenu), this.showSubScene(a.SubSceneList.Menu);
}),
(t.prototype.resetSubScene = function () {
(this.prevLevel = this.currentLevelID),
this.destroyLevel(),
(this.timerLive = !1),
this.keys.hide(),
(this.currentLevelID = x.Constants.mainmenuID),
(this.cameraX = 0),
(this.cameraY = 0),
(this.zoom = 1),
this.backgroundStaticPos();
}),
(t.prototype.preparePlayingScene = function () {
(this.lookingAround = !1),
x.Constants.levelMapStartTime || (x.Constants.levelMapStartTime = Date.now()),
o.default.getInstance().saveProgress(),
this.state === p.MainMenu
? (this.prevLevel = x.Constants.mainmenuID)
: ((this.prevLevel = this.currentLevelID), (this.currSubScene !== a.SubSceneList.Hub && this.prevLevel === x.Constants.mainmenuID) || (this.prevLevel = this.currentLevelID));
}),
(t.prototype.beforeStartPlayingScene = function (t, e) {
this.currentLevelID !== x.Constants.mainmenuID && this.prevLevel === x.Constants.hubID && o.default.getInstance().removeCheckPoint(),
this.prevLevel !== x.Constants.mainmenuID && (this.prevLevel = this.currentLevelID),
(this.isCurrLevelHard = e),
(this.currentLevelID = "" + t),
(this.currentLevel = this.levels.levels[this.currentLevelID]),
(this.flashOverlay.visible = !1),
this.destroyLevel();
}),
(t.prototype.startPlayingScene = function (t) {
this.createLevel(!1 === t ? this.currentLevel.data : this.currentLevel.dataHard), this.startPlayingSceneNoCreateLevel();
}),
(t.prototype.startPlayingSceneNoCreateLevel = function () {
(this.firstSpawn = !0),
(this.timerLive = !1),
(this.currentTime = null),
(this.currentDeaths = 0),
(this.currentMoney = 0),
(this.state = p.Playing),
this.keys.show(),
0 === x.Constants.levelsCompleted ? this.keys.setAlpha(0.5) : 1 === x.Constants.levelsCompleted ? this.keys.setAlpha(0.2) : this.keys.setAlpha(0.15),
this.setCameraOnPlayer();
}),
(t.prototype.startPlayingScene2 = function () {
(x.Constants.actStartTime = Date.now()),
this.subScene.enterLevel(!1),
!0 === x.Constants.blend ? s.PLColorMatrix.hue(this.background, this.currentLevel.hue) : s.PLColorMatrix.reset(this.background),
this.checkParallax();
}),
(t.prototype.showSubHub = function () {
(this.prevMenu = !1),
this.beforeStartPlayingScene(x.Constants.hubID, this.isCurrLevelHard),
this.showSubScene(a.SubSceneList.Hub),
this.startPlayingScene(!1),
h.default.playMenuSong(),
s.PLColorMatrix.reset(this.background),
this.subScene.updateDeaths(x.Constants.totalDeaths),
this.subScene.updateProgress(r.default.getTotalProgress());
}),
(t.prototype.showSubAct = function (t, e) {
this.beforeStartPlayingScene(t, e), this.showSubScene(a.SubSceneList.Act), !0 === e ? h.default.playMusicHard() : h.default.playMusicNormal(), this.startPlayingScene(e), this.startPlayingScene2();
}),
(t.prototype.showSubBonusStage = function (t) {
(this.currentRooms = 0),
this.beforeStartPlayingScene(x.Constants.bonusStageID, !1),
this.showSubScene(a.SubSceneList.BonusStage),
h.default.playBonusStageMusic(),
t < 0 && (t = 0),
this.createLevel(this.currentLevel.data[t]),
this.startPlayingSceneNoCreateLevel(),
this.startPlayingScene2();
}),
(t.prototype.showSubVex = function () {
this.beforeStartPlayingScene(x.Constants.vexID, !1), this.showSubScene(a.SubSceneList.Vex), h.default.playMusicHard(), this.startPlayingScene(!1), this.startPlayingScene2();
}),
(t.prototype.openRandomBonusStage = function () {
(this.currentRooms += 1), (this.firstSpawn = !0), this.destroyLevel(), this.createLevel(this.currentLevel.data[u.default.random(1, this.currentLevel.data.length - 1)]), this.setCameraOnPlayer();
}),
(t.prototype.finishBonusStage = function () {
l.default.saveData(l.TaskID.playBonusStage), this.player.hide(), this.player.pause(), this.panelManager.show(n.PanelList.PanelBonusStageComplete);
}),
(t.prototype.restartBonusStage = function () {
(this.firstSpawn = !0), (this.zoom = 1.5), this.resetLevel(), this.setCameraOnPlayer();
}),
(t.prototype.finishLevel = function () {
if (!0 !== this.finished) {
this.finished = !0;
var t = Number(this.currentLevelID);
t > x.Constants.levelsCompleted && (x.Constants.levelsCompleted = t),
l.default.saveData(l.TaskID.completeLevel, t),
l.default.saveData(l.TaskID.completeAny3Levels),
this.showCompletedLevel(),
this.currentLevel.complete(x.Constants.actFinishTime, this.currentDeaths, this.isCurrLevelHard);
}
}),
(t.prototype.showCompletedLevel = function () {
r.default.completeAct(Number(this.currentLevelID), this.isCurrLevelHard), this.panelManager.show(n.PanelList.PanelLevelComplete);
}),
(t.prototype.updateProgressTnt = function (t) {
this.subScene.updateProgressTnt(t);
}),
(t.prototype.stopTimer = function () {
this.timerLive = !1;
}),
(t.prototype.resumeOnFinish = function () {
this.showSubSceneTransition(a.SubSceneList.Hub, this.currentTime), this.keys.show(), this.player.resume(), (this.finished = !1);
}),
(t.prototype.createSceneMainMenu = function () {
this.resetVars(), (this.spawnX = this.spawnY = 0), (this.state = p.MainMenu), h.default.playMenuSong();
}),
(t.prototype.teleportPortal = function (t) {
var e = t.getTeleportPoint();
e && (t.portalAttach.disablePortal(), t.disablePortal(), this.player.setPosition(e.x, e.y + 20));
}),
(t.prototype.goDark = function () {
var t = this;
if (!0 !== this.dark) {
(this.dark = !0),
(this.darkOverlay.visible = !0),
setTimeout(function () {
return t.darkOverlay.anims.play({ key: "dark", frameRate: 30 });
}, 100),
(this.darkGraphics.visible = !0),
(this.flashOverlay.visible = !1);
for (var e = 0, i = this.solarBlocks; e < i.length; e++) i[e].goDark();
}
}),
(t.prototype.goLight = function () {
!0 === this.dark && ((this.flashOverlay.visible = !0), (this.flashOverlay.alpha = 1)), (this.dark = !1), (this.darkOverlay.visible = !1), this.darkOverlay.anims.stop(), (this.darkGraphics.visible = !1);
for (var t = 0, e = this.solarBlocks; t < e.length; t++) e[t].goLight();
}),
(t.prototype.explodeVex = function () {
this.explode(this.showHub, this);
}),
(t.prototype.showHub = function () {
this.showSubSceneTransition(a.SubSceneList.Hub);
}),
(t.prototype.explode = function (t, e) {
!0 !== this.exploding && ((this.exploding = !0), (this.flashOverlay.visible = !0), (this.flashOverlay.alpha = 0), (this.explodeCallback = t), (this.explodeContext = e));
}),
(t.prototype.checkpointTriggered = function (t) {
for (var e = 0, i = this.checkpoints; e < i.length; e++) {
var n = i[e];
n !== t && 1 === n.state && (this.currSubScene === a.SubSceneList.Hub ? n.resetLevel() : n.gray());
}
}),
(t.prototype.portToActBlock = function (t) {
(this.lookingAround = !1),
(this.player.currentPole = null),
(this.player.xPos = this.actBlocks[t + "false"].xPos),
(this.player.yPos = this.actBlocks[t + "false"].topEdge),
(this.player.yVelocity = 0),
(this.player.xVelocity = 0),
(this.player.forcedXVelocity = 0),
this.player.setIdle(),
this.player.updateHitBoxesPos(),
this.player.updatePositions(),
this.setCameraOnPlayer(),
this.startGamePlay();
}),
(t.prototype.setCameraOnPlayer = function () {
(this.cameraX = this.player.xPos - this.getGameHalfWidth()), (this.cameraY = this.player.yPos - this.getGameHalfHeight());
}),
(t.prototype.collectCoin = function (t) {
(this.currentMoney += t), (x.Constants.totalMoney += t), l.default.saveData(l.TaskID.collectCoins), this.subScene.updateMoney(this.currentMoney);
}),
(t.prototype.playerDeath = function (t, e, i, n, s) {
if (this.currSubScene !== a.SubSceneList.Menu) {
(this.currentDeaths += 1),
(x.Constants.totalDeaths += 1),
this.currSubScene === a.SubSceneList.Hub ? this.subScene.updateDeaths(x.Constants.totalDeaths) : this.subScene.updateDeaths(this.currentDeaths),
o.default.getInstance().saveProgress(),
!1 === e ? h.default.playSFX("death" + (Math.random() < 0.5 ? 1 : 2)) : h.default.playSFX("electricity");
for (var r = 0; r < 5; r++) this.createColorParticle(i + 10 * Math.random() - 5, n - s * Math.random(), 10 * Math.random() - 5, -10 * Math.random(), 16711680);
this.createPlayerGib(i + 10 * Math.random() - 5, n - s * Math.random(), 10 * Math.random() - 5, -10 * Math.random(), "player-head instance 10000"),
this.createPlayerGib(
i + 10 * Math.random() - 5,
n - s * Math.random(),
10 * Math.random() - 5,
-10 * Math.random(),
"player-body instance 10000",
2 * Math.random() * Math.PI,
8 * Math.random() - 4
),
this.createPlayerGib(
i + 10 * Math.random() - 5,
n - s * Math.random(),
10 * Math.random() - 5,
-10 * Math.random(),
"player-arm instance 10000",
2 * Math.random() * Math.PI,
8 * Math.random() - 4
),
this.createPlayerGib(
i + 10 * Math.random() - 5,
n - s * Math.random(),
10 * Math.random() - 5,
-10 * Math.random(),
"player-arm instance 10000",
2 * Math.random() * Math.PI,
8 * Math.random() - 4
),
this.createPlayerGib(
i + 10 * Math.random() - 5,
n - s * Math.random(),
10 * Math.random() - 5,
-10 * Math.random(),
"player-leg instance 10000",
2 * Math.random() * Math.PI,
8 * Math.random() - 4
),
this.createPlayerGib(
i + 10 * Math.random() - 5,
n - s * Math.random(),
10 * Math.random() - 5,
-10 * Math.random(),
"player-leg instance 10000",
2 * Math.random() * Math.PI,
8 * Math.random() - 4
);
}
}),
(t.prototype.update = function () {
this.state === p.Playing
? (this.updateBefore(), this.cameraLogic(), this.updateAfter(), this.checkParallax())
: this.state === p.MainMenu
? (this.updateBefore(), this.updateAfter())
: this.state === p.Pause && !0 === this.subScene.followCameraInPause && this.setCameraOnPlayer(),
e.prototype.update.call(this);
}),
(t.prototype.updateAfter = function () {
e.prototype.updateAfter.call(this),
!0 === this.exploding
? ((this.flashOverlay.alpha += 0.1), 1 <= this.flashOverlay.alpha && ((this.exploding = !1), this.explodeCallback && this.explodeCallback.apply(this.explodeContext)))
: (!0 === this.dark && ((this.darkGraphics.x = this.player.xPos), (this.darkGraphics.y = this.player.yPos), (this.darkOverlay.x = this.player.xPos), (this.darkOverlay.y = this.player.yPos)),
!0 === this.flashOverlay.visible && ((this.flashOverlay.alpha -= 0.03), this.flashOverlay.alpha <= 0 && (this.flashOverlay.visible = !1))),
(x.Constants.timePlayed += 1),
this.currSubScene === a.SubSceneList.Hub
? this.subScene.updateTime()
: this.currSubScene !== a.SubSceneList.Menu &&
(!0 === this.timerLive && ((this.currentTime = x.Constants.actStartTime), this.subScene.updateTime()),
!0 === this.keys.isReset() && this.resetLevel(),
!0 === x.Constants.autoReset &&
!0 === this.currentLevel.isTargetLevelComplete(this.isCurrLevelHard) &&
Math.round(Date.now() - x.Constants.actStartTime) > this.currentLevel.getTopTime(this.isCurrLevelHard) &&
this.resetLevel(!0));
}),
(t.prototype.resetDeath = function () {
this.resumeOnReset();
}),
(t.prototype.resumeOnReset = function () {
var t = Date.now();
this.currentTime = t;
for (var e = 0, i = this.blocks; e < i.length; e++) (f = i[e]).reset();
for (var n = 0, s = this.obstacles; n < s.length; n++) s[n].reset();
for (var r = 0, o = this.keyObjs; r < o.length; r++) o[r].reset();
for (var a = 0, h = this.torchObjs; a < h.length; a++) h[a].reset();
for (var l = 0, u = this.kites; l < u.length; l++) u[l].reset();
this.goLight(), this.state !== p.MainMenu && this.keys.show();
for (var c = 0, d = this.blocks; c < d.length; c++) {
var f;
"bounce" === (f = d[c]).blockType && (f.landed = null);
}
}),
(t.prototype.resetLevel = function (t) {
void 0 === t && (t = !0), (this.finished = !1), this.dark && this.goLight();
for (var e = 0, i = this.obstacles; e < i.length; e++) i[e].resetLevel();
for (var n = 0, s = this.checkpoints; n < s.length; n++) s[n].resetLevel();
for (var r = 0, o = this.elevatorGenerator; r < o.length; r++) o[r].resetLevel();
for (var a = 0, h = this.elevatorEliminator; a < h.length; a++) h[a].resetLevel();
for (var l = 0, u = this.blocks; l < u.length; l++) u[l].resetLevel();
for (var c = 0, d = this.keyObjs; c < d.length; c++) d[c].resetLevel();
for (var f = 0, p = this.torchObjs; f < p.length; f++) p[f].resetLevel();
for (var g = 0, v = this.kites; g < v.length; g++) v[g].resetLevel();
for (var y = 0, m = this.coins; y < m.length; y++) m[y].resetLevel();
this.wireTrail && this.wireTrail.resetLevel(),
this.player.spawn(this.spawnX, this.spawnY),
this.subScene.resetLevel(),
(this.currentTime = null),
(this.currentDeaths = 0),
this.subScene.updateDeaths(this.currentDeaths),
!0 === t && (x.Constants.actStartTime = Date.now()),
(this.flashOverlay.visible = !1);
}),
(t.prototype.resize = function () {
e.prototype.resize.call(this), this.checkResizePauseResume(), this.state === p.Playing && this.player ? this.setCameraOnPlayer() : this.backgroundStaticPos();
}),
(t.prototype.backgroundStaticPos = function () {
(this.background.x = this.cameraX), (this.background.y = this.cameraY);
}),
(t.prototype.checkResizePauseResume = function () {
!0 === x.Constants.incorrectOrientation ? (this.state === p.Playing && this.panelManager.show(n.PanelList.PanelPause), this.pauseState()) : this.resumeMenu();
}),
(t.prototype.pauseWorld = function () {
(x.Constants.pausedMapTime = Date.now()), null !== x.Constants.actStartTime && (x.Constants.pausedActTime = Date.now()), this.player.pause(), this.keys.hide(), this.pauseState();
}),
(t.prototype.pauseState = function () {
this.state = p.Pause;
}),
(t.prototype.resumeWorld = function () {
var t = Date.now() - x.Constants.pausedMapTime;
if (((x.Constants.levelMapStartTime += t), null !== x.Constants.actStartTime)) {
var e = Date.now() - x.Constants.pausedActTime;
x.Constants.actStartTime += e;
}
(this.state = p.Playing), this.player.resume(), this.keys.show();
}),
(t.prototype.resumeMenu = function () {
this.state === p.Pause && this.currSubScene === a.SubSceneList.Menu && ((this.state = p.MainMenu), this.player.resume());
}),
(t.prototype.onPointerMove = function () {
!0 !== this.keys.isScreenButtonDown() && (this.lookingAround = this.player.canCameraLookAround());
}),
(t.prototype.startGamePlay = function () {
!0 === this.firstSpawn && ((this.firstSpawn = !1), (this.timerLive = !0), 1 !== this.zoom && this.add.tween({ targets: this, zoom: 1.2, duration: 600, ease: Phaser.Math.Easing.Sine.Out }));
}),
(t.prototype.cameraLogic = function () {
var t = this.getGameHalfWidth(),
e = this.getGameHalfHeight(),
i = this.player.xPos,
n = this.player.yPos;
if (!1 === this.lookingAround) {
var s = 0;
10 < this.player.yVelocity && (s = Math.random() * this.player.yVelocity * 2);
var r = i - t + s,
o = n - e + s,
a = Math.sqrt(Math.pow(this.cameraY - o, 2) + Math.pow(this.cameraX - r, 2)),
h = r - this.cameraX,
l = o - this.cameraY;
a < 0.5 ? ((this.cameraX = r), (this.cameraY = o)) : ((this.cameraX += h / 8), (this.cameraY += l / 8));
} else
!1 === this.player.canCameraLookAround() || !0 === this.keys.isScreenButtonDown()
? (this.lookingAround = !1)
: ((r = ((this.input.activePointer.x - t) / t) * 200 + i),
(o = ((this.input.activePointer.y - e) / e) * 200 + n),
(h = r - this.cameraX - t),
(l = o - this.cameraY - e),
(a = Math.sqrt(Math.pow(this.cameraY - o, 2) + Math.pow(this.cameraX - r, 2))) < 0.5 ? ((this.cameraX = r), (this.cameraY = o)) : ((this.cameraX += h / 30), (this.cameraY += l / 30)));
}),
(t.prototype.checkParallax = function () {
var t = this.cameraX - 100,
e = this.cameraY - 400;
!0 === x.Constants.parallax ? ((this.background.x = t + ((t / 10) % 128)), (this.background.y = e + ((e / 10) % 128))) : ((this.background.x = t), (this.background.y = e));
}),
(t.prototype.collectSkinSpin = function (t) {
c.default.addSpinToken(t), this.currSubScene !== a.SubSceneList.BonusStage && this.currentLevel.collectSkinSpin(this.isCurrLevelHard);
}),
(t.prototype.isTargetLevelComplete = function () {
return Number(this.currentLevel.isTargetLevelComplete(this.isCurrLevelHard));
}),
(t.prototype.isTargetCoinsComplete = function () {
return this.currentLevel.isTargetCoinsComplete(this.isCurrLevelHard);
}),
(t.prototype.isTargetDeathComplete = function () {
return this.currentLevel.isTargetDeathComplete(this.isCurrLevelHard);
}),
(t.prototype.completeTargetCoins = function () {
this.currentLevel.completeTargetCoins(this.isCurrLevelHard);
}),
(t.prototype.completeTargetDeath = function () {
this.currentLevel.completeTargetDeath(this.isCurrLevelHard);
}),
(t.prototype.getTargetCoins = function () {
return this.currentLevel.getTargetCoins(this.isCurrLevelHard);
}),
(t.prototype.getTargetDeath = function () {
return this.currentLevel.getTargetDeath(this.isCurrLevelHard);
}),
(t.Name = "world"),
t
);
})(i.default);
e.default = v;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
L =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [
i,
e,
i(72),
i(83),
i(84),
i(2),
i(85),
i(86),
i(111),
i(112),
i(113),
i(114),
i(134),
i(135),
i(136),
i(137),
i(138),
i(39),
i(139),
i(140),
i(141),
i(142),
i(143),
i(144),
i(145),
i(146),
i(147),
i(148),
i(149),
i(150),
i(151),
i(152),
i(153),
]),
void 0 ===
(s = function (t, e, i, n, s, r, o, a, h, l, u, c, d, f, p, g, v, y, m, x, b, w, T, S, _, E, P, A, M, C, O, k, R) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }),
(e.VexTNT = e.BonusStageDoor = e.SkinsBlock = e.VerticalUpBlock = e.VerticalDownBlock = e.SwimmingPool = e.SpeedBlock = e.SparkBlock = e.SolarBlock = e.PushBlock = e.Portal = e.Slope = e.LB = e.InvisBlockUp = e.InvisBlockDown = e.InvisBlock = e.IceBlock = e.HorizontalBlock = e.GlassBlock = e.FallingBlock = e.ExplosiveBlock = e.ElevatorGenerator = e.ElevatorEliminator = e.Elevator = e.BounceBlock = e.BlockSpike = e.BlockedWall = e.Block = e.BasicBlock = e.AppearingBlock = e.ActBlock = void 0),
Object.defineProperty(e, "ActBlock", {
enumerable: !0,
get: function () {
return L(i).default;
},
}),
Object.defineProperty(e, "AppearingBlock", {
enumerable: !0,
get: function () {
return L(n).default;
},
}),
Object.defineProperty(e, "BasicBlock", {
enumerable: !0,
get: function () {
return L(s).default;
},
}),
Object.defineProperty(e, "Block", {
enumerable: !0,
get: function () {
return L(r).default;
},
}),
Object.defineProperty(e, "BlockedWall", {
enumerable: !0,
get: function () {
return L(o).default;
},
}),
Object.defineProperty(e, "BlockSpike", {
enumerable: !0,
get: function () {
return L(a).default;
},
}),
Object.defineProperty(e, "BounceBlock", {
enumerable: !0,
get: function () {
return L(h).default;
},
}),
Object.defineProperty(e, "Elevator", {
enumerable: !0,
get: function () {
return L(l).default;
},
}),
Object.defineProperty(e, "ElevatorEliminator", {
enumerable: !0,
get: function () {
return L(u).default;
},
}),
Object.defineProperty(e, "ElevatorGenerator", {
enumerable: !0,
get: function () {
return L(c).default;
},
}),
Object.defineProperty(e, "ExplosiveBlock", {
enumerable: !0,
get: function () {
return L(d).default;
},
}),
Object.defineProperty(e, "FallingBlock", {
enumerable: !0,
get: function () {
return L(f).default;
},
}),
Object.defineProperty(e, "GlassBlock", {
enumerable: !0,
get: function () {
return L(p).default;
},
}),
Object.defineProperty(e, "HorizontalBlock", {
enumerable: !0,
get: function () {
return L(g).default;
},
}),
Object.defineProperty(e, "IceBlock", {
enumerable: !0,
get: function () {
return L(v).default;
},
}),
Object.defineProperty(e, "InvisBlock", {
enumerable: !0,
get: function () {
return L(y).default;
},
}),
Object.defineProperty(e, "InvisBlockDown", {
enumerable: !0,
get: function () {
return L(m).default;
},
}),
Object.defineProperty(e, "InvisBlockUp", {
enumerable: !0,
get: function () {
return L(x).default;
},
}),
Object.defineProperty(e, "LB", {
enumerable: !0,
get: function () {
return L(b).default;
},
}),
Object.defineProperty(e, "Slope", {
enumerable: !0,
get: function () {
return L(w).default;
},
}),
Object.defineProperty(e, "Portal", {
enumerable: !0,
get: function () {
return L(T).default;
},
}),
Object.defineProperty(e, "PushBlock", {
enumerable: !0,
get: function () {
return L(S).default;
},
}),
Object.defineProperty(e, "SolarBlock", {
enumerable: !0,
get: function () {
return L(_).default;
},
}),
Object.defineProperty(e, "SparkBlock", {
enumerable: !0,
get: function () {
return L(E).default;
},
}),
Object.defineProperty(e, "SpeedBlock", {
enumerable: !0,
get: function () {
return L(P).default;
},
}),
Object.defineProperty(e, "SwimmingPool", {
enumerable: !0,
get: function () {
return L(A).default;
},
}),
Object.defineProperty(e, "VerticalDownBlock", {
enumerable: !0,
get: function () {
return L(M).default;
},
}),
Object.defineProperty(e, "VerticalUpBlock", {
enumerable: !0,
get: function () {
return L(C).default;
},
}),
Object.defineProperty(e, "SkinsBlock", {
enumerable: !0,
get: function () {
return L(O).default;
},
}),
Object.defineProperty(e, "BonusStageDoor", {
enumerable: !0,
get: function () {
return L(k).default;
},
}),
Object.defineProperty(e, "VexTNT", {
enumerable: !0,
get: function () {
return L(R).default;
},
});
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
S =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(115), i(116), i(117), i(118), i(119), i(120), i(121), i(38), i(122), i(123), i(124), i(125), i(126), i(127), i(128), i(129), i(130), i(131), i(132), i(51), i(133)]),
void 0 ===
(s = function (t, e, i, n, s, r, o, a, h, l, u, c, d, f, p, g, v, y, m, x, b, w, T) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }),
(e.SkinSpin = e.Coin = e.Kite = e.Torch = e.ZiplinePole = e.Zipline = e.Wire = e.WindBlaster = e.TimedKey = e.Rope = e.PressDown = e.Pole = e.LightSwitch = e.Key = e.HazardStrips = e.FinishPortal = e.CircularCannon = e.CheckPointText = e.Checkpoint = e.Cable = e.BreatheBlaster = void 0),
Object.defineProperty(e, "BreatheBlaster", {
enumerable: !0,
get: function () {
return S(i).default;
},
}),
Object.defineProperty(e, "Cable", {
enumerable: !0,
get: function () {
return S(n).default;
},
}),
Object.defineProperty(e, "Checkpoint", {
enumerable: !0,
get: function () {
return S(s).default;
},
}),
Object.defineProperty(e, "CheckPointText", {
enumerable: !0,
get: function () {
return S(r).default;
},
}),
Object.defineProperty(e, "CircularCannon", {
enumerable: !0,
get: function () {
return S(o).default;
},
}),
Object.defineProperty(e, "FinishPortal", {
enumerable: !0,
get: function () {
return S(a).default;
},
}),
Object.defineProperty(e, "HazardStrips", {
enumerable: !0,
get: function () {
return S(h).default;
},
}),
Object.defineProperty(e, "Key", {
enumerable: !0,
get: function () {
return S(l).default;
},
}),
Object.defineProperty(e, "LightSwitch", {
enumerable: !0,
get: function () {
return S(u).default;
},
}),
Object.defineProperty(e, "Pole", {
enumerable: !0,
get: function () {
return S(c).default;
},
}),
Object.defineProperty(e, "PressDown", {
enumerable: !0,
get: function () {
return S(d).default;
},
}),
Object.defineProperty(e, "Rope", {
enumerable: !0,
get: function () {
return S(f).default;
},
}),
Object.defineProperty(e, "TimedKey", {
enumerable: !0,
get: function () {
return S(p).default;
},
}),
Object.defineProperty(e, "WindBlaster", {
enumerable: !0,
get: function () {
return S(g).default;
},
}),
Object.defineProperty(e, "Wire", {
enumerable: !0,
get: function () {
return S(v).default;
},
}),
Object.defineProperty(e, "Zipline", {
enumerable: !0,
get: function () {
return S(y).default;
},
}),
Object.defineProperty(e, "ZiplinePole", {
enumerable: !0,
get: function () {
return S(m).default;
},
}),
Object.defineProperty(e, "Torch", {
enumerable: !0,
get: function () {
return S(x).default;
},
}),
Object.defineProperty(e, "Kite", {
enumerable: !0,
get: function () {
return S(b).default;
},
}),
Object.defineProperty(e, "Coin", {
enumerable: !0,
get: function () {
return S(w).default;
},
}),
Object.defineProperty(e, "SkinSpin", {
enumerable: !0,
get: function () {
return S(T).default;
},
});
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r =
(this && this.__extends) ||
((s = function (t, e) {
return (s =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
s(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
});
void 0 ===
(n = function (t, e) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function (e) {
function t() {
var t = (null !== e && e.apply(this, arguments)) || this;
return (t.followCameraInPause = !0), t;
}
return (
r(t, e),
(t.prototype.init = function (t) {}),
(t.prototype.resize = function () {}),
(t.prototype.update = function () {}),
(t.prototype.updateMoney = function (t) {}),
(t.prototype.destroy = function () {
e.prototype.destroy.call(this), (this.scene = null);
}),
t
);
})(Phaser.GameObjects.Container);
e.default = i;
}.apply(e, [i, e])) || (t.exports = n);
},
function (t, e, i) {
var n,
s,
h =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(168), i(169), i(55), i(170), i(171), i(172)]),
void 0 ===
(s = function (t, e, i, n, s, r, o, a) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }),
(e.DailyTaskPause = e.DailyTaskPanel = e.ButtonMainMenuDaily = e.ButtonMainMenu = e.ControllerStick = e.ControllerButton = void 0),
Object.defineProperty(e, "ControllerButton", {
enumerable: !0,
get: function () {
return h(i).default;
},
}),
Object.defineProperty(e, "ControllerStick", {
enumerable: !0,
get: function () {
return h(n).default;
},
}),
Object.defineProperty(e, "ButtonMainMenu", {
enumerable: !0,
get: function () {
return h(s).default;
},
}),
Object.defineProperty(e, "ButtonMainMenuDaily", {
enumerable: !0,
get: function () {
return h(r).default;
},
}),
Object.defineProperty(e, "DailyTaskPanel", {
enumerable: !0,
get: function () {
return h(o).default;
},
}),
Object.defineProperty(e, "DailyTaskPause", {
enumerable: !0,
get: function () {
return h(a).default;
},
});
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
o =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(28), i(61), i(70), i(30)]),
void 0 ===
(s = function (t, e, i, n, s, r) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }),
(e.World = e.Preloader = e.Boot = e.BasicScene = void 0),
Object.defineProperty(e, "BasicScene", {
enumerable: !0,
get: function () {
return o(i).default;
},
}),
Object.defineProperty(e, "Boot", {
enumerable: !0,
get: function () {
return o(n).default;
},
}),
Object.defineProperty(e, "Preloader", {
enumerable: !0,
get: function () {
return o(s).default;
},
}),
Object.defineProperty(e, "World", {
enumerable: !0,
get: function () {
return o(r).default;
},
});
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
w =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
T =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(11), i(31), i(32), i(3), i(7), i(1), i(46), i(12), i(6), i(10)]),
void 0 ===
(s = function (t, e, c, i, s, r, n, d, o, a, h, f, l) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (e.FacingDir = e.PlayerState = void 0), (i = T(i)), (n = T(n)), (d = T(d)), (f = T(f)), (l = T(l));
var p,
u,
g,
v,
y,
m,
x = function (t, e, i, n) {
(this.xOff = t), (this.yOff = e), (this.width = i), (this.height = n);
};
((m = p = e.PlayerState || (e.PlayerState = {}))[(m.Idle = 0)] = "Idle"),
(m[(m.Running = 1)] = "Running"),
(m[(m.Jumping = 2)] = "Jumping"),
(m[(m.Falling = 3)] = "Falling"),
(m[(m.Sliding = 4)] = "Sliding"),
(m[(m.Crouching = 5)] = "Crouching"),
(m[(m.Scaling = 6)] = "Scaling"),
(m[(m.Hanging = 7)] = "Hanging"),
(m[(m.Zipping = 8)] = "Zipping"),
(m[(m.Swinging = 9)] = "Swinging"),
(m[(m.Pushing = 10)] = "Pushing"),
(m[(m.Kicking = 11)] = "Kicking"),
(m[(m.Spawning = 12)] = "Spawning"),
(m[(m.Swimming = 13)] = "Swimming"),
(m[(m.JumpDown = 14)] = "JumpDown"),
(m[(m.JumpFrontFlip = 15)] = "JumpFrontFlip"),
(m[(m.JumpBackFlip = 16)] = "JumpBackFlip"),
(m[(m.Land = 17)] = "Land"),
(m[(m.SwimmingStand = 18)] = "SwimmingStand"),
(m[(m.Climb = 19)] = "Climb"),
(m[(m.Kite = 20)] = "Kite"),
((y = u || (u = {}))[(y.Head = 0)] = "Head"),
(y[(y.Body = 1)] = "Body"),
(y[(y.Hands = 2)] = "Hands"),
(y[(y.Feet = 3)] = "Feet"),
((v = g = e.FacingDir || (e.FacingDir = {}))[(v.Left = 0)] = "Left"),
(v[(v.Right = 1)] = "Right");
var b = (function (n) {
function t(t) {
var e = n.call(this, t) || this;
(e.timeScale_crouch = 1.5),
(e.timeScale_slide = 1.3),
(e.timeScale_jumpFrontBackFlip = 1.3),
(e.timeScale_kick = 1.6),
(e.offX_climb_left = 15),
(e.offX_climb = 8),
(e.offX_scale = 3),
(e.offX_swing = 5),
(e.offY_swing = 7),
(e.distToCollisionCannon = 7225),
(e.maxVelocity = 3.5),
(e.maxVelocityPush = 2.5),
(e.acc = 0.5),
(e.fallingMax = 16),
(e.fallingMaxKite = 1.5),
(e.fallingMaxKiteFast = 5),
(e.maxScaleTime = 90),
(e.maxHangCoolDown = 20),
(e.maxBreathe = 600),
(e.scoreUpdated = !1),
(e.god = !1),
(e.portalUsed = null),
(e.poleRedSection = new Phaser.GameObjects.Image(t, 0, 0, c.Atlases.gameplay, "poleRedSection instance 10000")),
e.poleRedSection.setOrigin(0, 0.5),
(e.poleRedSection.alpha = 0),
t.topObstacleLayer.add(e.poleRedSection),
(e.container = new Phaser.GameObjects.Container(t)),
(e.container.visible = !1),
(e.spine = new o.JDSpineGameObject(e.main, 0, 0, "player")),
e.setSkin(c.Constants.currSkin);
var i = e.spine.getView();
return (
i.on(o.JDSpineGameObject.EVENT_COMPLETE, e.onAnimationComplete, e),
e.container.add(i),
(e.spineHeight = i.height),
e.createStateInfos(),
(e.head = new SAT.Box(new SAT.Vector(0, 0), 13, 9.75)),
(e.headInfo = new x(-3.75, -32.75, 7.55, 9.5)),
(e.body = new SAT.Box(new SAT.Vector(0, 0), 13, 9.75)),
(e.bodyInfo = new x(-5.75, -23.5, 11.5, 17.3)),
(e.hands = new SAT.Box(new SAT.Vector(0, 0), 13, 9.75)),
(e.handsInfo = new x(-0.75, -19.5, 7.55, 9.5)),
(e.feetInfo = new x(-20.2, -6.25, 30.05, 10.75)),
(e.feet = new SAT.Box(new SAT.Vector(0, 0), 13, 9.75)),
(e.pressDown = new r.PressDown(t, e.container)),
(e.breatheGroup = new a.PlayerBreatheBar(t)),
e.container.add(e.breatheGroup),
(e.keys = t.keys),
(e.alive = !1),
(e.deaths = 0),
e
);
}
return (
w(t, n),
(t.prototype.setSkin = function (t) {
this.spine.setSkin(l.default.formatNumberZeroLess10(t));
}),
(t.prototype.canCameraLookAround = function () {
return !1 !== this.container.visible && (this.state === p.Idle || this.state === p.Swimming || this.state === p.Hanging || this.state === p.Climb);
}),
(t.prototype.createStateInfos = function () {
this.stateInfos = {};
var t = {};
(t[u.Head] = new x(-3.75, -32.75, 7.55, 9.5)),
(t[u.Body] = new x(-5.75, -23.5, 11.5, 17.3)),
(t[u.Hands] = new x(1.4, -19.5, 7.55, 9.5)),
(t[u.Feet] = new x(-6.5, -6.25, 13, 9.75)),
this.makeTotalBounds(t),
(this.stateInfos[p.Idle] = t),
((t = {})[u.Head] = new x(-3.85, -33, 7.55, 18.1)),
(t[u.Body] = new x(-12.55, -30, 24.1, 26.95)),
(t[u.Hands] = new x(1.4, -19.5, 7.55, 9.5)),
(t[u.Feet] = new x(-6.5, -6.25, 13, 9.75)),
this.makeTotalBounds(t),
(this.stateInfos[p.Running] = t),
((t = {})[u.Head] = new x(-3.85, -32.45, 7.55, 16.9)),
(t[u.Body] = new x(-5.05, -23, 12, 17.3)),
(t[u.Hands] = new x(1.05, -34.5, 7.55, 9.5)),
(t[u.Feet] = new x(-5.75, -6.25, 8, 9)),
this.makeTotalBounds(t),
(this.stateInfos[p.Jumping] = t),
(this.stateInfos[p.JumpDown] = t),
((t = {})[u.Head] = new x(-16.25, -10.35, 7.55, 7.2)),
(t[u.Body] = new x(-13, -11.5, 18.25, 9.75)),
(t[u.Hands] = new x(0.45, -11.5, 7.55, 9.5)),
(t[u.Feet] = new x(-6.5, -6.25, 13, 10.5)),
this.makeTotalBounds(t),
(this.stateInfos[p.Sliding] = t),
((t = {})[u.Head] = new x(-3.85, -19, 7.55, 9.5)),
(t[u.Body] = new x(-4.75, -11.25, 11.5, 9.75)),
(t[u.Hands] = new x(0.45, -14.5, 7.55, 9.5)),
(t[u.Feet] = new x(-6.5, -6.25, 13, 9.75)),
this.makeTotalBounds(t),
(this.stateInfos[p.Crouching] = t),
((t = {})[u.Head] = new x(-3.85, -33.25, 7.55, 9.5)),
(t[u.Body] = new x(-6.1, -23.85, 15, 17.3)),
(t[u.Hands] = new x(3.95, -36.65, 7.55, 14.45)),
(t[u.Feet] = new x(-5.6, -6.6, 7, 6.25)),
this.makeTotalBounds(t),
(this.stateInfos[p.Scaling] = t),
((t = {})[u.Head] = new x(-3.85, -32.75, 7.55, 9.5)),
(t[u.Body] = new x(-6.25, -23.5, 11.5, 17.3)),
(t[u.Hands] = new x(0.35, -40.15, 9.75, 15.65)),
(t[u.Feet] = new x(-9.2, -6.25, 13, 5.25)),
this.makeTotalBounds(t),
(this.stateInfos[p.Hanging] = t),
((t = {})[u.Head] = new x(-3.85, -32.45, 7.55, 9.5)),
(t[u.Body] = new x(-4.8, -23, 11.5, 17.3)),
(t[u.Hands] = new x(-1.2, -35.5, 7.55, 9.5)),
(t[u.Feet] = new x(-6.5, -6.25, 13, 9)),
this.makeTotalBounds(t),
(this.stateInfos[p.Zipping] = t),
((t = {})[u.Head] = new x(-3.85, -32.45, 7.55, 16.9)),
(t[u.Body] = new x(-4.8, -23, 11.5, 17.3)),
(t[u.Hands] = new x(-1.2, -35.5, 7.55, 9.5)),
(t[u.Feet] = new x(-6.5, -6.25, 13, 9)),
this.makeTotalBounds(t),
(this.stateInfos[p.Swinging] = t),
((t = {})[u.Head] = new x(-3.85, -32.45, 7.55, 16.9)),
(t[u.Body] = new x(-4.8, -23, 11.5, 17.3)),
(t[u.Hands] = new x(-1.8, -25.5, 7.55, 9.5)),
(t[u.Feet] = new x(-6.5, -6.25, 13, 9)),
this.makeTotalBounds(t),
(this.stateInfos[p.Pushing] = t),
((t = {})[u.Head] = new x(-3.75, -17.75, 7.55, 9.5)),
(t[u.Body] = new x(-5.75, -8.5, 11.5, 17.3)),
(t[u.Hands] = new x(1.4, -4.5, 7.55, 9.5)),
(t[u.Feet] = new x(-6.5, 8.75, 13, 9.75)),
this.makeTotalBounds(t),
(this.stateInfos[p.Swimming] = t),
(this.stateInfos[p.SwimmingStand] = this.stateInfos[p.Swimming]),
(this.stateInfos[p.Falling] = this.stateInfos[p.Jumping]),
(this.stateInfos[p.Kite] = this.stateInfos[p.Jumping]),
(this.stateInfos[p.Spawning] = this.stateInfos[p.Idle]),
(this.stateInfos[p.Kicking] = this.stateInfos[p.Idle]),
(this.stateInfos[p.Land] = this.stateInfos[p.Idle]),
(this.stateInfos[p.Climb] = this.stateInfos[p.Jumping]);
}),
(t.prototype.setStateInfos = function () {
(this.headInfo = this.stateInfos[this.state][u.Head]),
(this.bodyInfo = this.stateInfos[this.state][u.Body]),
(this.handsInfo = this.stateInfos[this.state][u.Hands]),
(this.feetInfo = this.stateInfos[this.state][u.Feet]);
}),
(t.prototype.makeTotalBounds = function (t) {
(t.leftEdgeOff = Math.min(t[u.Hands].xOff, Math.min(t[u.Feet].xOff, Math.min(t[u.Head].xOff, t[u.Body].xOff)))),
(t.topEdgeOff = Math.min(t[u.Hands].yOff, Math.min(t[u.Feet].yOff, Math.min(t[u.Head].yOff, t[u.Body].yOff)))),
(t.rightEdgeOff = Math.max(t[u.Hands].xOff + t[u.Hands].width, Math.max(t[u.Feet].xOff + t[u.Feet].width, Math.max(t[u.Head].xOff + t[u.Head].width, t[u.Body].xOff + t[u.Body].width)))),
(t.bottomEdgeOff = Math.max(t[u.Hands].yOff + t[u.Hands].height, Math.max(t[u.Feet].yOff + t[u.Feet].height, Math.max(t[u.Head].yOff + t[u.Head].height, t[u.Body].yOff + t[u.Body].height))));
}),
(t.prototype.setPosition = function (t, e) {
(this.xVelocity = 0), (this.yVelocity = 0), (this.forcedXVelocity = 0), (this.xPos = t), (this.yPos = e), (this.rPos = 0), (this.rPosDest = 0);
}),
(t.prototype.addToNewLayer = function (t) {
this.container.parentContainer !== t && (this.container.parentContainer && this.container.parentContainer.remove(this.container), t.add(this.container));
}),
(t.prototype.spawn = function (t, e) {
this.addToNewLayer(this.main.playerLayer),
(this.xVelocity = 0),
(this.yVelocity = 0),
(this.forcedXVelocity = 0),
(this.xPos = t),
(this.yPos = e),
(this.rPos = 0),
(this.rPosDest = 0),
(this.checkpoint = new Phaser.Geom.Point(t, e)),
(this.resetpoint = new Phaser.Geom.Point(t, e)),
(this.spine.scaleX = this.spine.scaleY = 1),
(this.container.visible = !0),
(this.falling = !1),
(this.crouching = !1),
(this.scaling = !1),
(this.kicking = !1),
(this.hanging = !1),
(this.pushing = !1),
(this.swimming = !1),
(this.climb = !1),
(this.initClimbDir = !1),
(this.bouncing = !1),
(this.currentHang = null),
(this.hangTime = 10),
(this.scaleHistory = 4e3),
(this.scaleTime = 0),
(this.currentZipline = null),
(this.lastZipline = null),
(this.lastPool = null),
(this.currentPole = null),
(this.currentTorch = null),
(this.currentKite = null),
(this.poleTimer = 0),
(this.currentCannon = null),
(this.onIce = !1),
(this.onSpeedBlock = !1),
(this.porting = !1),
(this.breathe = this.maxBreathe),
(this.poolCoolDown = 0),
(this.poleRedSection.alpha = 0),
(this.pressDown.showPressDown = !1),
(this.keysObtained = 0),
(this.heldKeys = []),
(this.alive = !0),
this.setSpawn(),
this.faceRight(),
this.updatePositions(),
this.resetHitBoxes(),
(this.scoreUpdated = !1);
}),
(t.prototype.resetHitBoxes = function () {
var t, e, i, n;
(n =
this.facing === g.Right
? ((t = this.headInfo.xOff), (e = this.handsInfo.xOff), (i = this.bodyInfo.xOff), this.feetInfo.xOff)
: ((t = -this.headInfo.xOff - this.headInfo.width), (e = -this.handsInfo.xOff - this.handsInfo.width), (i = -this.bodyInfo.xOff - this.bodyInfo.width), -this.feetInfo.xOff - this.feetInfo.width)),
(this.head.pos.x = this.xPos),
(this.head.pos.y = this.yPos);
var s = this.currentSlope ? this.hitBoxForSlope : this.rPos;
(this.head.w = this.headInfo.width),
(this.head.h = this.headInfo.height),
(this.headPolygon = this.head.toPolygon()),
this.headPolygon.setOffset(new SAT.Vector(t, this.headInfo.yOff)),
this.headPolygon.setAngle(s),
(this.hands.pos.x = this.xPos),
(this.hands.pos.y = this.yPos),
(this.hands.w = this.handsInfo.width),
(this.hands.h = this.handsInfo.height),
(this.handsPolygon = this.hands.toPolygon()),
this.handsPolygon.setOffset(new SAT.Vector(e, this.handsInfo.yOff)),
this.handsPolygon.setAngle(s),
(this.body.pos.x = this.xPos),
(this.body.pos.y = this.yPos),
(this.body.w = this.bodyInfo.width),
(this.body.h = this.bodyInfo.height),
(this.bodyPolygon = this.body.toPolygon()),
this.bodyPolygon.setOffset(new SAT.Vector(i, this.bodyInfo.yOff)),
this.bodyPolygon.setAngle(s),
(this.feet.pos.x = this.xPos),
(this.feet.pos.y = this.yPos),
(this.feet.w = this.feetInfo.width),
(this.feet.h = this.feetInfo.height),
(this.feetPolygon = this.feet.toPolygon()),
this.feetPolygon.setOffset(new SAT.Vector(n, this.feetInfo.yOff)),
this.feetPolygon.setAngle(s),
(this.width = this.stateInfos[this.state].rightEdgeOff - this.stateInfos[this.state].leftEdgeOff),
(this.height = this.stateInfos[this.state].bottomEdgeOff - this.stateInfos[this.state].topEdgeOff),
(this.halfWidth = this.width / 2),
(this.halfHeight = this.height / 2);
var r = new SAT.Box(new SAT.Vector(this.xPos, this.yPos), this.width, this.height);
(this.totalPolygon = r.toPolygon()), this.totalPolygon.setOffset(new SAT.Vector(this.stateInfos[this.state].leftEdgeOff, this.stateInfos[this.state].topEdgeOff));
}),
(t.prototype.updateHitBoxesPos = function () {
(this.head.pos.y = this.yPos),
(this.feet.pos.y = this.yPos),
(this.hands.pos.y = this.yPos),
(this.body.pos.y = this.yPos),
(this.headPolygon.pos.x = this.xPos),
(this.headPolygon.pos.y = this.yPos),
(this.bodyPolygon.pos.x = this.xPos),
(this.bodyPolygon.pos.y = this.yPos),
(this.handsPolygon.pos.x = this.xPos),
(this.handsPolygon.pos.y = this.yPos),
(this.feetPolygon.pos.x = this.xPos),
(this.feetPolygon.pos.y = this.yPos),
(this.totalPolygon.pos.x = this.xPos),
(this.totalPolygon.pos.y = this.yPos);
var t = this.currentSlope ? this.hitBoxForSlope : this.rPos;
this.headPolygon.setAngle(t), this.bodyPolygon.setAngle(t), this.handsPolygon.setAngle(t), this.feetPolygon.setAngle(t), this.totalPolygon.setAngle(t);
}),
(t.prototype.setSpineOffX = function (t) {
this.spine.x = t;
}),
(t.prototype.setSpineOffY = function (t) {
this.spine.y = t;
}),
(t.prototype.hideSprite = function (t) {
void 0 === t && (t = !0),
(this.prevAnimProgress = 0),
this.setSpineOffX(0),
this.setSpineOffY(0),
!0 === t && this.currentKite && (f.default.stopSFXLoop("kite"), this.currentKite.reset(), (this.currentKite = null)),
(this.canPlaySFXFall = !0);
}),
(t.prototype.setState = function (t, e) {
void 0 === e && (e = !0), this.hideSprite(e), (this.state = t), (this.animationFinished = !1);
}),
(t.prototype.onAnimationComplete = function () {
this.animationFinished = !0;
var t = this.spine.getCurrentAnimationName();
"player-fall-floor" === t ? this.setIdle() : "player-spawn" === t && (this.setIdle(), (this.alive = !0), this.main.startGamePlay());
}),
(t.prototype.isSpriteAnimFinished = function () {
return this.animationFinished;
}),
(t.prototype.setIdle = function () {
this.state === p.Jumping || this.state === p.Kite
? (this.setState(p.Land), this.spine.play("player-fall-floor"))
: (this.setState(p.Idle), this.spine.play("player-stand"), this.setStateInfos(), this.resetHitBoxes());
}),
(t.prototype.setRun = function () {
this.setState(p.Running), this.spine.play("player-run", !0), this.setStateInfos(), this.resetHitBoxes();
}),
(t.prototype.setJump = function (t, e) {
if ((void 0 === t && (t = !0), void 0 === e && (e = null), this.state !== p.Jumping || e)) {
if (((this.state = p.Jumping), !0 === t)) {
this.hideSprite();
var i = "player-jump",
n = 1;
e
? (this.jumpState = e) === p.JumpDown
? (i = "player-jump_down")
: e === p.JumpFrontFlip
? ((i = "player_jump-front-flip"), (n = this.timeScale_jumpFrontBackFlip))
: e === p.JumpBackFlip && ((i = "player_jump-back-flip"), (n = this.timeScale_jumpFrontBackFlip))
: (this.jumpState = p.Jumping),
this.spine.play(i, !1, n);
}
this.setStateInfos(), (this.height = this.stateInfos[this.state].height), (this.halfHeight = this.height / 2), this.resetHitBoxes();
}
}),
(t.prototype.setSlide = function () {
this.state !== p.Sliding && (this.setState(p.Sliding), this.spine.play("player-slide-down", !1, this.timeScale_slide), this.setStateInfos(), this.resetHitBoxes());
}),
(t.prototype.setCrouch = function () {
this.setState(p.Crouching), this.spine.play("player-crouch", !1, this.timeScale_crouch), this.setStateInfos(), this.resetHitBoxes();
}),
(t.prototype.setClimb = function () {
this.state !== p.Climb && (this.setState(p.Climb), this.spine.play("player_rope_down"), this.setSpineOffX(-this.offX_climb * this.spine.scaleX), this.setStateInfos(), this.resetHitBoxes());
}),
(t.prototype.setScale = function () {
this.state !== p.Scaling && (this.setState(p.Scaling), this.spine.play("player_hang"), this.setSpineOffX(-this.offX_scale * this.spine.scaleX), this.setStateInfos(), this.resetHitBoxes());
}),
(t.prototype.setHang = function () {
this.setState(p.Hanging), this.spine.play("player_hang"), this.setStateInfos(), this.resetHitBoxes();
}),
(t.prototype.setZip = function () {
this.setState(p.Zipping), this.spine.play("player-pulley"), this.setStateInfos(), this.resetHitBoxes();
}),
(t.prototype.setSwing = function () {
this.setState(p.Swinging), this.spine.play("player-swing", !0), this.setSpineOffY(this.offY_swing), this.setStateInfos(), this.resetHitBoxes();
}),
(t.prototype.setPush = function () {
this.setState(p.Pushing), this.spine.play("player-push", !0), this.setStateInfos(), this.resetHitBoxes();
}),
(t.prototype.setKick = function () {
this.setState(p.Kicking), this.spine.play("player-kick", !1, this.timeScale_kick), this.setStateInfos(), this.resetHitBoxes();
}),
(t.prototype.setFall = function () {
this.setState(p.Falling), this.spine.play("player-fall"), this.setStateInfos(), this.resetHitBoxes();
}),
(t.prototype.setSwim = function () {
this.setState(p.Swimming), this.playSwimAnim("player-swim"), (this.isSwimingStop = !1), this.setStateInfos(), this.resetHitBoxes();
}),
(t.prototype.playSwimAnim = function (t) {
this.spine.play(t, !0), this.setSpineOffY(this.spineHeight / 4);
}),
(t.prototype.setSpawn = function () {
this.setState(p.Spawning), this.spine.play("player-spawn"), this.setStateInfos(), this.resetHitBoxes();
}),
(t.prototype.setKite = function () {
this.setState(p.Kite, !1), this.spine.playFromProgress("player-jump", 1), this.setStateInfos(), this.resetHitBoxes(), (this.falling = !0), (this.scaling = !1);
}),
(t.prototype.faceLeft = function () {
this.facing !== g.Left && ((this.facing = g.Left), 0 < this.spine.scaleX && (this.spine.scaleX *= -1), this.resetHitBoxes());
}),
(t.prototype.faceRight = function () {
this.facing !== g.Right && ((this.facing = g.Right), this.spine.scaleX < 0 && (this.spine.scaleX *= -1), this.resetHitBoxes());
}),
(t.prototype.enterActBlock = function () {
if (!1 === this.enterActBlockDone && this.actBlock && !0 === this.crouching) {
if (((this.enterActBlockDone = !0), "dailyTask" === this.actBlock.blockType)) return void this.main.showPanelDailyTask();
if ("dailyStage" === this.actBlock.blockType) return void this.main.showSubSceneTransition(h.SubSceneList.BonusStage);
if ("play" === this.actBlock.blockType) return void this.main.showSubSceneTransition(h.SubSceneList.Hub);
if ("skins" === this.actBlock.blockType)
return void (this.actBlock instanceof s.SkinsBlock ? this.main.showSubSceneTransition(h.SubSceneList.SkinsRarity, this.actBlock.id) : this.main.showSubSceneTransition(h.SubSceneList.SkinsRarity));
if ("throphie" === this.actBlock.blockType) return void this.main.showPanelTrophies();
if ("BonusStageDoor" === this.actBlock.blockType) return void this.main.explode(this.main.openRandomBonusStage, this.main);
if (!1 === this.actBlock.checkEnableMode()) return;
this.actBlock.levelNum === Number(c.Constants.vexID)
? this.main.showSubSceneTransition(h.SubSceneList.Vex, this.actBlock.levelNum, this.actBlock.isHard)
: this.main.showSubSceneTransition(h.SubSceneList.Act, this.actBlock.levelNum, this.actBlock.isHard),
(this.actBlock = null);
}
}),
(t.prototype.jump = function (t, e, i) {
void 0 === e && (e = !0),
void 0 === i && (i = null),
(this.yVelocity = t / 1.3),
(this.falling = !0),
(this.scaling = !1),
(this.swimming = !1),
(this.actBlock = null),
this.hanging && ((this.hanging = !1), (this.hangTime = 0), (this.currentHang = null)),
this.currentPole &&
(0 <= this.currAnimProgress && this.currAnimProgress <= 0.45
? ((this.poleTimer = 0),
(this.currentPole = null),
this.setJump(!0, p.JumpBackFlip),
this.facing === g.Right ? ((this.xVelocity = 2.5), (this.xPos += 10)) : ((this.xVelocity = -2.5), (this.xPos -= 10)),
0.12 <= this.currAnimProgress && this.currAnimProgress <= 0.3 && (this.facing === g.Right ? (this.xVelocity = 4.5) : (this.xVelocity = -4.5)),
f.default.playSFX("poleSwing"),
(this.yVelocity -= 0.2),
this.updatePositions())
: ((this.poleTimer = 0), (this.currentPole = null), (this.yVelocity = 0))),
(this.currentZipline = null),
this.setJump(e, i),
this.updateHitBoxesPos();
}),
(t.prototype.land = function (t) {
if (
((this.yVelocity = 0),
(this.forcedXVelocity *= 0.8),
(this.yPos = t.yPos - 0.5 * t.height + t.yVelocity),
(this.onIce = !1),
(this.onSpeedBlock = !1),
"ice" === t.blockType ? (this.onIce = !0) : "speed" === t.blockType && (this.onSpeedBlock = !0),
(this.rPosDest = 0),
(this.state !== p.Jumping && this.state !== p.Scaling && this.state !== p.Hanging && this.state !== p.Kite) ||
(f.default.playSFX("land"), !0 === this.keys.isLeft() || !0 === this.keys.isRight() ? this.setRun() : this.setIdle()),
(this.falling = !1),
(this.scaling = !1),
(this.hanging = !1),
(this.scaleHistory = 4e3),
(this.currentHang = null),
(this.lastPool = null),
(this.actBlock = null),
(t.landed = new Phaser.Geom.Point(this.xPos - t.xPos, this.yPos - t.xPos)),
"push" === t.blockType && !0 === this.crouching && !1 === this.kicking)
) {
if ("not trapped" === t.checkTrapped()) return;
(this.kicking = !0),
(this.kickBlock = t),
(this.xVelocity = this.forcedXVelocity = 0),
this.setKick(),
this.spine.pause(),
(this.stateTime = 10),
t.stuckRight ? (this.faceLeft(), (this.tarKickX = t.rightEdge - this.halfWidth)) : ((this.tarKickX = t.leftEdge + this.halfWidth), this.faceRight());
} else
("act" !== t.blockType &&
"dailyTask" !== t.blockType &&
"dailyStage" !== t.blockType &&
"play" !== t.blockType &&
"skins" !== t.blockType &&
"BonusStageDoor" !== t.blockType &&
"throphie" !== t.blockType) ||
(this.landBlock(t), (this.pressDown.showPressDown = !0));
}),
(t.prototype.landBlock = function (t) {
(this.actBlock = t), this.enterActBlock();
}),
(t.prototype.scale = function (t, e) {
void 0 === e && (e = !0),
this.state !== p.Kite &&
(!0 === this.scaling
? ((this.lastPool = null),
1 < this.yVelocity && (this.yVelocity *= 0.8),
(this.scaleTime += 1),
this.scaleTime > this.maxScaleTime && ((this.scaling = !1), (this.falling = !0), this.setJump()),
(this.xVelocity = this.forcedXVelocity = 0))
: ((e && this.scaleHistory !== t.rightEdge) || (!e && this.scaleHistory !== t.leftEdge)) &&
((this.scaleTime = 0),
(this.scaling = !0),
(this.falling = !1),
(this.diving = !1),
(this.rPos = 0),
(this.rPosDest = 0),
5 < this.yVelocity ? f.default.playSFX("wallSlide") : f.default.playSFX("connect"),
this.yVelocity < 0 && (this.yVelocity = 0),
(this.scaleHistory = e ? t.rightEdge : t.leftEdge),
this.setScale(),
(this.xVelocity = this.forcedXVelocity = 0)));
}),
(t.prototype.hang = function (t, e) {
void 0 === e && (e = !0),
this.state !== p.Hanging && this.setHang(),
(this.yVelocity = 0),
(this.yPos = t.topEdge - this.handsInfo.yOff - 4),
(this.xPos = e ? t.leftEdge - this.handsInfo.xOff - this.handsInfo.width + 4 : t.rightEdge - this.handsInfo.xOff + this.handsInfo.width - 4),
this.hanging || (f.default.playSFX("connectHang"), (this.rPos = 0), (this.rPosDest = 0)),
(this.hanging = !0),
(this.falling = !1),
(this.currentHang = t),
(this.lastPool = null),
(this.scaleHistory = 4e3),
(this.lastZipline = null);
}),
(t.prototype.unhang = function () {
(this.hanging = !1), (this.falling = !0), (this.hangTime = 0), (this.currentHang = null);
}),
(t.prototype.checkForBlock = function (t, e) {
for (var i = 0; i < this.main.blocks.length; i++) {
var n = this.main.blocks[i];
if (n.alive && SAT.pointInPolygon(new SAT.Vector(t, e), n.totalBoundPolygon)) return !0;
}
return !1;
}),
(t.prototype.checkBlocks = function () {
if (!0 !== this.bouncing) {
var t = !1,
e = !1,
i = !1,
n = !1,
s = !1;
this.pressDown.showPressDown = !1;
for (var r = 0; r < this.main.blocks.length; r++) {
var o = this.main.blocks[r];
if (o.alive) {
if (void 0 !== o.isIgnore && o.isIgnore) {
if (SAT.testPolygonPolygon(this.totalPolygon, o.totalBoundPolygon)) continue;
o.isIgnore = !1;
}
if (o.rightEdge < this.xPos - 40 || o.leftEdge > this.xPos + 40 || o.topEdge > this.yPos + 80 || o.bottomEdge < this.yPos - 80) o.landed = null;
else {
if (this.yVelocity > this.fallingMax && SAT.testPolygonPolygon(this.totalPolygon, o.topBoundPolygon)) {
if ("bounce" !== o.blockType) return void this.kill(1);
this.land(o);
continue;
}
if (0 < this.keysObtained && "lock" === o.blockType) {
var a = o;
if (!1 === a.unlocked && SAT.testPolygonPolygon(this.totalPolygon, o.totalBoundPolygon)) {
a.unlock(), this.heldKeys.pop().useKey(), this.keysObtained--;
continue;
}
}
if (this.currentTorch && "explosive" === o.blockType) {
var h = o;
if (!1 === h.used && SAT.testPolygonPolygon(this.totalPolygon, o.totalBoundPolygon)) {
h.explode(), this.currentTorch.useKey(), (this.currentTorch = null);
continue;
}
}
if ((0 <= this.yVelocity || o.yVelocity < 0) && -2 <= this.yVelocity - o.yVelocity && SAT.testPolygonPolygon(this.feetPolygon, o.topBoundPolygon)) {
if (this.falling && !0 === this.keys.isDown() && "glass" === o.blockType) {
o.smash(), this.yVelocity >= this.fallingMax / 2 && (this.yVelocity = this.fallingMax / 2);
continue;
}
this.xPos > o.xPos - o.halfWidth && this.xPos < o.xPos + o.halfWidth && this.land(o), (t = e = !0);
} else {
if (((o.landed = null), SAT.testPolygonPolygon(this.headPolygon, o.bottomBoundPolygon))) {
if (this.xPos < o.leftEdge) continue;
if (this.xPos > o.rightEdge) continue;
if (!0 === this.hanging || this.yVelocity - o.yVelocity <= 0.5) {
this.scaling || this.hanging
? (this.setJump(),
(this.scaling = !1),
(this.scaleTime = 0),
(this.hanging = !1),
(this.hangTime = 0),
(this.currentHang = null),
(this.yVelocity = 1),
(this.falling = !0),
(this.scaleHistory = 4e3),
(this.lastZipline = null))
: (this.yVelocity *= -0.5),
"ice" === o.blockType ? (this.yPos = o.yPos + o.halfHeight + o.yVelocity + this.height + 2) : (this.yPos = o.yPos + o.halfHeight + 4 * o.yVelocity + this.height + 1),
0 !== o.yVelocity && ((this.yPos += 20), (this.yVelocity = 0)),
this.updateHitBoxesPos(),
(i = !0);
continue;
}
}
if (!this.currentHang && this.poolCoolDown <= 0 && !this.swimming) {
if (o.hangable && this.falling && this.hangTime >= this.maxHangCoolDown && (0 <= this.yVelocity || o.yVelocity < 0)) {
if (SAT.testPolygonPolygon(this.handsPolygon, o.lhBoundPolygon) && !this.checkForBlock(o.leftEdge + 3, o.topEdge - 5) && !this.checkForBlock(o.leftEdge - 3, o.topEdge - 5)) {
this.hang(o), (s = t = !0);
continue;
}
if (
SAT.testPolygonPolygon(this.handsPolygon, o.rhBoundPolygon) &&
!this.checkForBlock(o.rightEdge + 3, o.topEdge - 5) &&
!this.checkForBlock(o.rightEdge + -3, o.topEdge - 5)
) {
this.hang(o, !1), (n = t = !0);
continue;
}
}
} else {
if (null !== this.currentHang && !this.currentHang.alive) {
this.unhang(), this.setRun(), (this.xVelocity = 0);
continue;
}
if (this.facing === g.Right && this.currentHang === o) {
this.hang(this.currentHang), (s = !0);
continue;
}
if (this.facing === g.Left && this.currentHang === o) {
this.hang(this.currentHang, !1), (n = !0);
continue;
}
t = !0;
}
if (this.xPos > o.rightEdge || this.xPos < o.leftEdge)
if (this.facing === g.Right) {
if (o.scalable && (this.falling || this.scaling) && -3 <= this.yVelocity && SAT.testPolygonPolygon(this.handsPolygon, o.leftBoundPolygon)) {
this.scale(o, !1), (this.xPos = o.xPos - o.halfWidth + this.handsInfo.xOff - this.handsInfo.width + 1), (s = t = !0);
continue;
}
} else if (o.scalable && (this.falling || this.scaling) && -3 <= this.yVelocity && SAT.testPolygonPolygon(this.handsPolygon, o.rightBoundPolygon)) {
this.scale(o, !0), (this.xPos = o.xPos + o.halfWidth + this.handsInfo.xOff - 1), (n = t = !0);
continue;
}
if (!1 === this.scaling && (0 <= this.xVelocity + this.forcedXVelocity || this.currentHang) && SAT.testPolygonPolygon(this.bodyPolygon, o.leftBoundPolygon)) {
if ((this.hanging && this.facing === g.Right && this.unhang(), "push" !== o.blockType || this.falling || this.crouching || this.facing !== g.Right)) {
(this.xVelocity = this.forcedXVelocity = 0),
this.falling ? (this.xPos = o.leftEdge - 4) : (this.xPos = o.xPos - o.halfWidth - this.bodyInfo.xOff - this.bodyInfo.width + 2),
(s = !0);
continue;
}
o.xVelocity < this.xVelocity && (o.xVelocity = this.xVelocity);
var l = o;
(this.xPos = o.leftEdge - this.halfWidth + this.xVelocity), (l.pushingRight = !0), (l.pushed = !0), this.state !== p.Pushing && this.setPush();
} else if (((!1 === this.scaling && this.xVelocity + this.forcedXVelocity <= 0) || this.currentHang) && SAT.testPolygonPolygon(this.bodyPolygon, o.rightBoundPolygon)) {
if ((this.hanging && this.facing === g.Left && this.unhang(), "push" !== o.blockType || this.crouching || this.falling || this.facing !== g.Left)) {
(this.xVelocity = this.forcedXVelocity = 0),
this.falling ? (this.xPos = o.rightEdge + 4) : (this.xPos = o.xPos + o.halfWidth - this.bodyInfo.xOff - 2),
this.updatePositions(),
(n = !0);
continue;
}
o.xVelocity > this.xVelocity && (o.xVelocity = this.xVelocity),
(l = o),
(this.xPos = o.rightEdge + this.halfWidth + this.xVelocity),
(l.pushingLeft = !0),
(l.pushed = !0),
this.state !== p.Pushing && this.setPush();
}
}
}
} else void 0 !== o.isIgnore && (o.isIgnore = !0);
}
(n && s) || (e && i)
? this.kill(3)
: t ||
(e && this.state !== p.Pushing) ||
this.currentSlope ||
this.currentHang ||
((this.falling = !0),
!this.diving && this.yVelocity <= this.fallingMax && (this.rPosDest = 0),
this.state === p.Running || this.state === p.Idle || this.state === p.Pushing
? this.setJump()
: this.crouching
? (this.setJump(), (this.crouching = !1))
: (this.scaling || this.hanging) && (this.setJump(), (this.scaling = !1), (this.scaleTime = 0), (this.hanging = !1), (this.hangTime = 0)));
}
}),
(t.prototype.checkSlopeCollisions = function () {
this.currentSlope = null;
for (var t = 0, e = this.main.slopes; t < e.length; t++) {
var i = e[t];
if (!1 !== i.alive) {
if (this.facing === g.Left && -1 === i.side) {
if ((this.falling || this.scaling) && this.yPos - this.halfHeight < i.bottomEdge && 0 < this.yVelocity && SAT.testPolygonPolygon(this.handsPolygon, i.wallPoly)) {
(this.currentSlope = i), (this.xPos = i.rightEdge + this.halfWidth + 1);
continue;
}
} else if (
this.facing === g.Right &&
1 === i.side &&
(this.falling || this.scaling) &&
this.yPos - this.halfHeight < i.bottomEdge &&
0 < this.yVelocity &&
SAT.testPolygonPolygon(this.handsPolygon, i.wallPoly)
) {
(this.currentSlope = i), (this.xPos = i.leftEdge - this.halfWidth - 1);
continue;
}
if (!1 === this.hanging && !1 === this.scaling)
if (-1 === i.side && this.xVelocity < 0) {
if (SAT.testPolygonPolygon(this.bodyPolygon, i.wallPoly)) {
(this.xPos = i.rightEdge + this.halfWidth + 7), (this.xVelocity = this.forcedXVelocity = 0);
continue;
}
} else if (1 === i.side && 0 < this.xVelocity && SAT.testPolygonPolygon(this.bodyPolygon, i.wallPoly)) {
(this.xPos = i.leftEdge - this.halfWidth - 7), (this.xVelocity = this.forcedXVelocity = 0);
continue;
}
if (
(this.xPos > i.leftEdge &&
this.xPos < i.rightEdge &&
SAT.testPolygonPolygon(this.headPolygon, i.bottomPoly) &&
this.yPos >= i.bottomEdge + this.halfHeight &&
this.yVelocity < 0 &&
((this.yPos = i.bottomEdge + this.height), (this.yVelocity *= -0.5), (this.yPos += this.yVelocity), this.updatePositions(), (this.scaleHistory = 4e3), (this.currentZipline = null)),
this.xPos > i.leftEdge && this.xPos < i.rightEdge && this.yPos > i.topEdge && this.yPos < i.bottomEdge)
) {
var n = void 0,
s = void 0;
if (
((s = -1 === i.side ? ((n = (this.xPos - i.leftEdge) / i.width), -d.default.PI025) : ((n = 1 - (this.xPos - i.leftEdge) / i.width), d.default.PI025)),
this.yPos >= i.bottomEdge - i.height * n)
) {
var r = i.height / i.width;
if (this.yVelocity > -2.5 - r) {
if (10 <= this.yVelocity) return void this.kill(3);
this.state !== p.Crouching && (0.5 < Math.abs(this.xVelocity) ? this.state !== p.Running && this.setRun() : this.setIdle()),
(this.yVelocity = 0),
(this.hitBoxForSlope = s * r),
(this.yPos = i.bottomEdge - i.height * n + 2),
1 === i.side && this.yPos < i.height && (this.yPos = i.height),
(this.currentSlope = i),
(this.scaleHistory = 4e3),
(this.currentZipline = null),
(this.falling = !1),
(this.scaling = !1),
(this.hanging = !1);
}
}
}
}
}
}),
(t.prototype.checkCheckpoint = function () {
for (var t = 0; t < this.main.checkpoints.length; t++) {
var e = this.main.checkpoints[t];
if (SAT.testPolygonPolygon(this.bodyPolygon, e.boxPolygon) && 0 === e.state)
return e.trigger(), this.checkpoint.setTo(e.xPos, e.yPos), void (this.main.currentLevelID === c.Constants.hubID && i.default.getInstance().saveCheckPoint(e.xPos, e.yPos));
}
}),
(t.prototype.checkKeyObj = function () {
for (var t = 0, e = this.main.keyObjs; t < e.length; t++) {
var i = e[t];
!1 !== i.alive && !1 === i.following && SAT.testPolygonPolygon(this.bodyPolygon, i.hitBoxPolygon) && (this.heldKeys.push(i), (this.keysObtained += 1), i.follow());
}
}),
(t.prototype.checkTorchObj = function () {
if (!this.currentTorch)
for (var t = 0, e = this.main.torchObjs; t < e.length; t++) {
var i = e[t];
!1 !== i.alive && !1 === i.following && SAT.testPolygonPolygon(this.bodyPolygon, i.hitBoxPolygon) && (this.currentTorch = i).follow();
}
}),
(t.prototype.checkKite = function () {
if (this.currentKite) this.currentKite.update(this.xPos, this.yPos, this.spine.scaleX);
else
for (var t = 0, e = this.main.kites; t < e.length; t++) {
var i = e[t];
!1 !== i.alive && SAT.testPolygonPolygon(this.bodyPolygon, i.hitBoxPolygon) && ((this.currentKite = i), this.setKite(), f.default.playSFX("kite", 0.7, !0));
}
}),
(t.prototype.checkKeyboard = function () {
this.bouncing ||
(this.currentZipline ||
this.crouching ||
this.scaling ||
this.hanging ||
(!0 === this.keys.isLeft()
? (this.xVelocity > -this.maxVelocity
? ((this.xVelocity -= this.acc), 0 < this.xVelocity && (this.xVelocity *= 0.5))
: this.onIce
? (this.xVelocity += 0.025 * this.acc)
: (this.xVelocity += 0.2 * this.acc),
this.state === p.Pushing && this.xVelocity < -this.maxVelocityPush && (this.xVelocity = -this.maxVelocityPush),
this.facing === g.Right && (this.state === p.Pushing && this.setRun(), this.faceLeft()),
(this.state !== p.Idle && this.state !== p.Land) || this.setRun())
: !0 === this.keys.isRight()
? (this.xVelocity < this.maxVelocity &&
((this.xVelocity += this.acc), this.xVelocity < 0 ? (this.xVelocity *= 0.5) : this.onIce ? (this.xVelocity -= 0.025 * this.acc) : (this.xVelocity -= 0.2 * this.acc)),
this.state === p.Pushing && this.xVelocity > this.maxVelocityPush && (this.xVelocity = this.maxVelocityPush),
this.facing === g.Left && (this.state === p.Pushing && this.setRun(), this.faceRight()),
(this.state !== p.Idle && this.state !== p.Land) || this.setRun())
: ((this.state !== p.Running && this.state !== p.Pushing) || this.setIdle(),
this.falling
? (this.xVelocity *= 0.75)
: this.onIce
? (this.xVelocity *= 0.9)
: 0 < this.xVelocity
? ((this.xVelocity -= 2 * this.acc), this.xVelocity < 1 && (this.xVelocity = this.forcedXVelocity = 0))
: this.xVelocity < 0 && ((this.xVelocity += 2 * this.acc), -1 < this.xVelocity && (this.xVelocity = this.forcedXVelocity = 0)))),
(this.forcedXVelocity *= 0.98),
!0 === this.keys.isUpPressed() && !1 === this.crouching && !1 === this.falling
? this.jump(-8)
: !0 === this.keys.isUpPressed() && !0 === this.falling && !1 === this.crouching && (this.state === p.Kite ? this.jump(-5) : this.jumpState === p.Jumping && this.setJump(!0, p.JumpFrontFlip)));
}),
(t.prototype.checkCrouch = function () {
if (!0 !== this.bouncing) {
var t = this.keys.isDownPressed(),
e = this.keys.isDown();
if (this.state !== p.Kite) {
if (
(!0 !== t ||
!0 !== this.falling ||
this.lastPool ||
!1 !== this.diving ||
this.currentPole ||
(this.state !== p.Falling && (this.setJump(!0, p.JumpDown), this.yVelocity < 0 && (this.yVelocity *= 0.5), (this.yPos += 0.75 * this.yVelocity))),
!1 === e && !0 === this.falling && this.state === p.Jumping && this.jumpState === p.JumpDown && this.setJump(!0, p.Jumping),
!1 === this.swimming && !1 === this.falling && !1 === this.scaling && !1 === this.hanging && !1 === this.kicking)
)
if (!0 === e) {
if (this.currentZipline) return (this.falling = !0), this.setJump(), (this.lastZipline = this.currentZipline), void (this.currentZipline = null);
if (this.currentPole) return this.setJump(), (this.currentPole = null), void (this.poleTimer = 0);
!1 === this.crouching
? this.xVelocity < 0.5 && -0.5 < this.xVelocity
? (this.setCrouch(), (this.crouching = !0), (this.enterActBlockDone = !1), (this.xVelocity = this.forcedXVelocity = 0))
: (this.currentSlope ? (this.setCrouch(), (this.xVelocity = this.forcedXVelocity = 0)) : this.state !== p.Sliding && (f.default.playSFX("slide"), this.setSlide()),
(this.crouching = !0),
(this.enterActBlockDone = !1))
: this.xVelocity < 0.5 && -0.5 < this.xVelocity
? (this.state === p.Sliding &&
("player-slide-down" === this.spine.getCurrentAnimationName()
? (this.spine.play("player-slide-up"), (this.animationFinished = !1))
: !0 === this.isSpriteAnimFinished() && this.setCrouch()),
(this.crouching = !0),
(this.enterActBlockDone = !1),
(this.xVelocity = this.forcedXVelocity = 0))
: this.onSpeedBlock && !1 === this.keys.isLeft() && !1 === this.keys.isRight()
? (this.state !== p.Crouching && this.setCrouch(), (this.crouching = !0), (this.enterActBlockDone = !1), (this.xVelocity = this.forcedXVelocity = 0))
: this.onIce
? (this.xVelocity *= 0.993)
: (this.xVelocity *= 0.982);
} else if ((this.state === p.Sliding || this.state === p.Crouching) && !0 === this.isSpriteAnimFinished()) {
var i = this.spine.getCurrentAnimationName();
if ("player-crouch" === i) return this.spine.play("player-crouch-up", !1, this.timeScale_crouch), void (this.animationFinished = !1);
if ("player-slide-down" === i) return this.spine.play("player-slide-up", !1, this.timeScale_slide), void (this.animationFinished = !1);
this.setIdle(), (this.crouching = !1), this.updateHitBoxesPos();
for (var n = 0, s = this.main.blocks; n < s.length; n++) {
var r = s[n];
!1 !== r.alive &&
(SAT.testPolygonPolygon(this.bodyPolygon, r.rightBoundPolygon)
? (this.xPos = r.rightEdge + 7)
: SAT.testPolygonPolygon(this.bodyPolygon, r.leftBoundPolygon) && (this.xPos = r.leftEdge - 7));
}
}
(this.scaling || this.hanging) && !0 === e && ((this.scaling = !1), this.unhang(), this.setJump());
} else
!1 === e && this.yVelocity > this.fallingMaxKite ? (this.yVelocity -= 2 * this.main.gravity) : !0 === e && this.yVelocity > this.fallingMaxKiteFast && (this.yVelocity = this.fallingMaxKiteFast);
}
}),
(t.prototype.checkKeyboardClimb = function () {
return (
!0 === this.keys.isLeft() && this.climbDir === g.Right
? ((this.xPos = this.currentRope.xPos), (this.climbDir = g.Left), this.faceRight(), this.setSpineOffX(-this.offX_climb_left))
: !0 === this.keys.isRight() && this.climbDir === g.Left && ((this.xPos = this.currentRope.xPos), (this.climbDir = g.Right), this.faceLeft(), this.setSpineOffX(this.offX_climb + 2)),
!1 === this.keys.isUp() && (this.initClimbDir = !1),
!0 !== this.keys.isLeft() || !0 !== this.keys.isUp() || this.initClimbDir
? !0 !== this.keys.isRight() || !0 !== this.keys.isUp() || this.initClimbDir
? void (!0 === this.keys.isUp()
? (("player_rope" !== this.spine.currAnimationName || (!1 === this.spine.isPlaying && "player_rope" === this.spine.currAnimationName)) && this.spine.play("player_rope", !0),
this.currentRope.yPos - this.yPos < this.currentRope.halfHeight - 40 && ((this.yPos -= c.Constants.ropeUpVelY), this.checkSwimBlockCollisions()))
: !0 === this.keys.isDown()
? (this.spine.play("player_rope_down"), (this.yPos += c.Constants.ropeDownVelY), this.checkSwimBlockCollisions())
: this.spine.stop())
: ((this.climb = !1), (this.currentRope = null), (this.xPos += 7), (this.xVelocity += 4.5), (this.yVelocity -= 4), this.setJump(), void (this.falling = !0))
: ((this.climb = !1), (this.currentRope = null), (this.xPos -= 7), (this.xVelocity -= 4.5), (this.yVelocity -= 4), this.setJump(), void (this.falling = !0))
);
}),
(t.prototype.checkZipline = function () {
this.currentZipline = null;
for (var t = 0; t < this.main.ziplines.length; t++) {
var e = this.main.ziplines[t];
if (
e !== this.lastZipline &&
!(this.xPos - 40 > e.rightEdge || this.xPos + 40 < e.leftEdge || this.yPos - 80 > e.bottomEdge || this.yPos + 80 < e.topEdge) &&
SAT.testPolygonPolygon(this.handsPolygon, e.hitPolygon)
)
if (e.direction === g.Left) {
var i = (e.startPos.x - this.xPos) * e.scope + e.startPos.y + 25;
this.currentZipline || (this.yVelocity = 0),
this.xVelocity,
(this.yVelocity += 0.5),
(this.xVelocity -= 0.4 * e.scope),
this.xVelocity < 0 && this.facing === g.Right && this.faceLeft(),
this.state !== p.Zipping && (this.setZip(), f.default.playSFX("ziplineFull", 3, !0)),
(this.yPos = i + 5),
(this.currentZipline = e),
(this.scaleHistory = 4e3),
(this.lastZipline = null),
(this.falling = !1);
} else
(i = (this.xPos - e.startPos.x) * e.scope + e.startPos.y + this.height),
this.currentZipline || (this.yVelocity = 0),
this.xVelocity < 4 && ((this.yVelocity += 0.5), (this.xVelocity += 0.4 * e.scope)),
0 < this.xVelocity && this.facing === g.Left && this.faceRight(),
this.state !== p.Zipping && (this.setZip(), f.default.playSFX("ziplineFull", 3, !0)),
(this.yPos = i - 4),
(this.currentZipline = e),
(this.scaleHistory = 4e3),
(this.lastZipline = null),
(this.falling = !1);
}
}),
(t.prototype.checkPoleCollisions = function () {
if (((this.poleTimer += 1), 20 <= this.poleTimer))
for (var t = 0; t < this.main.poles.length; t++) {
var e = this.main.poles[t];
SAT.testPolygonPolygon(this.handsPolygon, e.hitBoxPolygon)
? this.currentPole ||
((this.xVelocity = this.forcedXVelocity = 0),
(this.yVelocity = 0),
(this.currentPole = e),
(this.falling = !1),
(this.rPos = 0),
(this.xPos = this.currentPole.xPos - 2),
(this.yPos = this.currentPole.yPos + 30))
: SAT.testPolygonPolygon(this.bodyPolygon, e.hitBoxPolygon) &&
(0 < this.xVelocity
? ((this.xVelocity = this.forcedXVelocity = 0), (this.xPos = e.xPos - 5))
: this.xVelocity < 0 && ((this.xVelocity = this.forcedXVelocity = 0), (this.xPos = e.xPos + 5)));
}
}),
(t.prototype.performSwing = function () {
(this.xPos = this.currentPole.xPos),
(this.yPos = this.currentPole.yPos + 30),
(this.xVelocity = this.forcedXVelocity = 0),
(this.yVelocity = 0),
(this.rPosDest = 0),
(this.falling = !1),
this.state !== p.Swinging && (this.setSwing(), (this.poleRedSection.x = this.currentPole.xPos), (this.poleRedSection.y = this.currentPole.yPos)),
(this.poleRedSection.alpha -= 0.5 * (this.poleRedSection.alpha - 1)),
this.facing === g.Right
? ((this.poleRedSection.rotation = d.default.toRad(30)), this.setSpineOffX(-this.offX_swing))
: ((this.poleRedSection.rotation = d.default.toRad(150)), this.setSpineOffX(this.offX_swing)),
(this.scaleHistory = 4e3),
(this.lastZipline = null);
}),
(t.prototype.checkDeath = function () {
this.updateHitBoxesPos();
for (var t = 0; t < this.main.obstacles.length; t++) {
var e = this.main.obstacles[t];
if (!1 !== e.alive)
if ("spike" === e.obstacleType) {
var i = e;
if (SAT.testPolygonPolygon(this.bodyPolygon, i.deathBoxPolygon) || SAT.testPolygonPolygon(this.headPolygon, i.deathBoxPolygon)) return void this.kill();
} else if ("buzzsaw" === e.obstacleType) {
var n = e;
if (SAT.testCirclePolygon(n.deathCircle, this.bodyPolygon) || SAT.testCirclePolygon(n.deathCircle, this.headPolygon)) return void this.kill(n.killValue);
} else if ("shurikan" === e.obstacleType) {
var s = e;
if (SAT.testPolygonPolygon(this.bodyPolygon, s.hitBoxPoly) || SAT.testPolygonPolygon(this.headPolygon, s.hitBoxPoly)) return void this.kill(9);
} else if ("quadrant" === e.obstacleType)
for (var r = 0, o = e.deathHitBoxPolygons; r < o.length; r++) {
var a = o[r];
if (SAT.testPolygonPolygon(this.bodyPolygon, a) || SAT.testPolygonPolygon(this.headPolygon, a)) return void this.kill(10);
}
else if ("laser" === e.obstacleType) {
var h = e;
if (SAT.testPolygonPolygon(this.bodyPolygon, h.deathHitBoxPolygon) || SAT.testPolygonPolygon(this.headPolygon, h.deathHitBoxPolygon)) return void this.kill(14);
} else if ("reaper" === e.obstacleType)
for (var l = 0, u = e.deathHitBoxes; l < u.length; l++) {
var c = u[l];
if (SAT.testPolygonPolygon(this.bodyPolygon, c) || SAT.testPolygonPolygon(this.headPolygon, c)) return void this.kill(8);
}
else if ("spark" === e.obstacleType) {
var d = e;
if (SAT.testPolygonPolygon(this.totalPolygon, d.deathBoxPolygon) || SAT.testPolygonPolygon(this.headPolygon, d.deathBoxPolygon)) return void this.kill(11, !0);
}
}
}),
(t.prototype.performKick = function () {
this.kickBlock.stuckRight ? ((this.kickBlock.xVelocity = -15), (this.xPos -= 10)) : ((this.kickBlock.xVelocity = 15), (this.xPos += 10)),
(this.kickBlock.stuckLeft = this.kickBlock.stuckRight = !1),
(this.kickBlock.xPos += this.kickBlock.xVelocity),
(this.kicking = !1),
(this.kickBlock = null),
(this.tarKickX = 0),
(this.crouching = !1),
f.default.playSFX("kickBlock"),
this.jump(-5, !1);
}),
(t.prototype.updateGravity = function () {
if (((this.yVelocity += this.main.gravity), this.yVelocity > this.fallingMax)) {
this.state !== p.Falling && (this.setFall(), (this.diving = !1)), (this.rPosDest += d.default.toRad(-this.spine.scaleX * this.yVelocity * 0.25));
var t = Math.abs(this.rPos);
t > d.default.PI05 && !0 === this.canPlaySFXFall ? (f.default.playSFX("fall"), (this.canPlaySFXFall = !1)) : t > Math.PI && this.kill(5);
}
this.state !== p.Zipping || this.currentZipline || (this.setJump(), (this.falling = !0));
}),
(t.prototype.checkPoolCollisions = function () {
for (var t = !1, e = 0; e < this.main.pools.length; e++) {
var i = this.main.pools[e];
if (SAT.testPolygonPolygon(this.bodyPolygon, i.totalPolygon)) {
if ((this.currentTorch && (this.currentTorch.reset(), (this.currentTorch = null)), (t = !0), i.prevElec)) return void this.kill(12, !0);
this.state !== p.Swimming &&
0 <= this.yVelocity &&
(f.default.playSFX("splash1"),
(this.swimming = !0),
(this.swimminBack = !0),
(this.lastSwimmingBack = !1),
(this.scaling = !1),
(this.hanging = !1),
(this.falling = !1),
(this.crouching = !1),
(this.diving = !1),
this.faceRight(),
this.setSwim(),
this.addToNewLayer(this.main.playerUnderLayer),
(this.rPos = 0),
(this.scaleHistory = 4e3),
(this.lastZipline = null),
(this.rPosDest = 0));
}
this.yVelocity < 0 &&
SAT.testPolygonPolygon(this.feetPolygon, i.topPolygon) &&
(f.default.playSFX("splash1"), (this.lastPool = i), this.state === p.Swimming && (this.jump(-6.5), (this.poolCoolDown = 30), this.addToNewLayer(this.main.playerLayer)), (this.rPos = 0));
}
!1 === t && ((this.swimming = !1), this.state === p.Swimming && (this.setJump(), (this.falling = !0)), 0 < this.poolCoolDown && (this.poolCoolDown -= 1));
}),
(t.prototype.getSwim = function () {
if (this.state === p.Swimming) {
if (
(!1 === this.keys.isUp() &&
!1 === this.keys.isDown() &&
((this.xVelocity *= 0.88),
(this.yVelocity *= 0.88),
this.xVelocity < 0.5 && -0.5 < this.xVelocity && (this.xVelocity = this.forcedXVelocity = 0),
this.yVelocity < 0.5 && -0.5 < this.yVelocity && (this.yVelocity = 0)),
!this.currentCannon)
) {
!0 === this.keys.isLeft()
? ((this.rPos = (this.rPos - d.default.toRad(3.5)) % d.default.PI2), this.resetHitBoxes())
: !0 === this.keys.isRight() && ((this.rPos = (this.rPos + d.default.toRad(3.5)) % d.default.PI2), this.resetHitBoxes());
var t = this.rPos;
if (
(this.facing === g.Left && ((0 < t && t < Math.PI) || (t > -d.default.PI2 && t < -Math.PI))
? this.faceRight()
: this.facing === g.Right && ((t < 0 && t > -Math.PI) || (t > Math.PI && t < d.default.PI2)) && this.faceLeft(),
!0 === this.keys.isUp())
) {
this.swimminBack = !1;
var e = this.rPos - d.default.PI05,
i = Math.cos(e) / 2,
n = Math.sin(e) / 2,
s = 3;
(this.xVelocity += i),
(this.yVelocity += n),
((0 < i && this.xVelocity > i * s) || (i < 0 && this.xVelocity < i * s)) && (this.xVelocity = i * s),
((0 < n && this.yVelocity > n * s) || (n < 0 && this.yVelocity < n * s)) && (this.yVelocity = n * s),
Math.random() < 0.1 &&
this.main.createColorParticle(
this.xPos + 10 * Math.random() - 5,
this.yPos - 0.5 * this.height + 10 * Math.random() - 5,
-this.xVelocity / 2 + Math.random(),
-this.yVelocity / 2 + Math.random(),
56814,
4,
!0,
!0
);
} else
!0 === this.keys.isDown() &&
((this.swimminBack = !0),
(e = this.rPos - d.default.PI05),
(i = -Math.cos(e) / 2),
(n = -Math.sin(e) / 2),
(s = 2),
(this.xVelocity += i),
(this.yVelocity += n),
((0 < i && this.xVelocity > i * s) || (i < 0 && this.xVelocity < i * s)) && (this.xVelocity = i * s),
((0 < n && this.yVelocity > n * s) || (n < 0 && this.yVelocity < n * s)) && (this.yVelocity = n * s));
}
(this.xPos += this.xVelocity), (this.yPos += this.yVelocity);
}
}),
(t.prototype.checkSwimBlockCollisions = function () {
for (var t = 0; t < this.main.blocks.length; t++) {
var e = this.main.blocks[t];
if (e.alive && !(e.rightEdge < this.xPos - 40 || e.leftEdge > this.xPos + 40 || e.topEdge > this.yPos + 80 || e.bottomEdge < this.yPos - 80)) {
if (0 < this.keysObtained && "lock" === e.blockType) {
var i = e;
if (!i.unlocked && SAT.testPolygonPolygon(this.totalPolygon, e.totalBoundPolygon)) {
i.unlock(), this.heldKeys.pop().useKey(), (this.keysObtained -= 1);
continue;
}
}
SAT.testPolygonPolygon(this.totalPolygon, e.topBoundPolygon)
? ((this.yPos = e.topEdge - 20), (this.yVelocity *= -1))
: SAT.testPolygonPolygon(this.totalPolygon, e.bottomBoundPolygon)
? ((this.yVelocity *= -1), (this.yPos = e.bottomEdge + 20))
: SAT.testPolygonPolygon(this.totalPolygon, e.leftBoundPolygon)
? ((this.xVelocity *= -1), (this.xPos = e.leftEdge - 20))
: SAT.testPolygonPolygon(this.totalPolygon, e.rightBoundPolygon) && ((this.xVelocity *= -1), (this.xPos = e.rightEdge + 20));
}
}
}),
(t.prototype.cannonLogic = function () {
(this.rPos = this.currentCannon.rad + d.default.PI05),
(this.rPosDest = this.rPos),
this.rPos > d.default.PI2 && ((this.rPos -= d.default.PI2), (this.rPosDest -= d.default.PI2)),
(this.falling = !1),
(this.yVelocity = this.xVelocity = this.forcedXVelocity = 0),
(this.xPos = this.currentCannon.xPos + 50 * Math.cos(this.currentCannon.rad)),
(this.yPos = this.currentCannon.yPos + 50 * Math.sin(this.currentCannon.rad)),
!1 === this.swimming && this.setIdle(),
this.keys.isUpPressed() && (this.currentCannon.firing = !0);
}),
(t.prototype.checkCannonCollisions = function () {
for (var t = 0, e = this.main.cannons; t < e.length; t++) {
var i = e[t];
if (!i.alive) return;
if (Math.pow(i.xPos - this.xPos, 2) + Math.pow(i.yPos - this.yPos, 2) < this.distToCollisionCannon) {
this.currentCannon || this.addToNewLayer(this.main.playerUnderLayer), f.default.playSFX("cannonEnter"), (this.currentCannon = i);
break;
}
}
}),
(t.prototype.checkRopeCollisions = function () {
for (var t = !1, e = 0; e < this.main.ropes.length; e++) {
var i = this.main.ropes[e];
if (SAT.testPolygonPolygon(this.totalPolygon, i.totalBoundPolygon)) {
if (i.yPos - this.yPos > i.height / 2 - 40) return;
(t = !0),
this.currentRope !== i &&
((this.rPosDest = 0),
(this.rPos = 0),
this.xPos < i.xPos ? ((this.xPos = i.xPos - 8), (this.climbDir = g.Left), this.faceRight()) : ((this.xPos = i.xPos + 4), (this.climbDir = g.Right), this.faceLeft()),
this.state !== p.Climb && this.setClimb(),
(this.currentRope = i),
(this.initClimbDir = !0),
(this.climb = !0),
(this.falling = !1),
(this.yVelocity = 0),
(this.xVelocity = 0));
}
}
!1 === t && (this.climb && this.setRun(), (this.climb = !1), (this.currentRope = null));
}),
(t.prototype.respawn = function () {
f.default.stopSFXLoop("kite"),
this.main.resetDeath(),
this.resume(),
(this.container.visible = !1),
(this.keysObtained = 0),
(this.heldKeys = []),
(this.currentTorch = null),
(this.currentKite = null),
(this.xVelocity = this.forcedXVelocity = 0),
(this.yVelocity = 0),
(this.xPos = this.checkpoint.x),
(this.yPos = this.checkpoint.y),
(this.spine.scaleX = this.spine.scaleY = 1),
(this.rPos = 0),
(this.rPosDest = 0),
(this.falling = !0),
(this.hanging = !1),
(this.scaling = !1),
(this.crouching = !1),
(this.bouncing = !1),
(this.swimming = !1),
(this.kicking = !1),
(this.diving = !1),
(this.currentHang = null),
(this.lastPool = null),
(this.currentPole = null),
(this.poleTimer = 0),
(this.currentCannon = null),
(this.currentZipline = null),
(this.scaleHistory = 4e3),
(this.lastZipline = null),
(this.breathe = this.maxBreathe),
(this.poleRedSection.alpha = 0),
this.faceRight(),
this.setSpawn(),
(this.alive = !1),
this.addToNewLayer(this.main.playerLayer),
this.updatePositions();
}),
(t.prototype.kill = function (t, e) {
void 0 === t && (t = 0),
void 0 === e && (e = !1),
!0 !== this.god &&
!1 !== this.alive &&
(this.main.currentLevelID !== c.Constants.bonusStageID
? (this.main.playerDeath(t, e, this.xPos, this.yPos, this.height), this.respawn(), this.main.deathText.show(this.xPos, this.yPos, l.default.getDeathText(t)), this.main.playerDie())
: this.main.finishBonusStage());
}),
(t.prototype.checkCoins = function () {
for (var t = 0; t < this.main.coins.length; t++) {
var e = this.main.coins[t];
if (!1 !== e.alive && SAT.testPolygonPolygon(this.totalPolygon, e.hitBoxPolygon)) {
e.collect();
for (var i = 0; i < 15; i++) this.main.createColorParticle(e.xPos, e.yPos, 10 * Math.random() - 5, -10 * Math.random(), 16763904);
}
}
}),
(t.prototype.animationTick = function () {
if (((this.currAnimProgress = this.spine.getAnimationProgress()), this.state === p.Running))
((0.3 <= this.currAnimProgress && this.prevAnimProgress < 0.3) || (0.8 <= this.currAnimProgress && this.prevAnimProgress < 0.8)) && f.default.playSFX("footstep" + d.default.random(1, 6), 2);
else if (this.state === p.Spawning) this.container.visible = !0;
else if (this.state === p.Kicking)
if (this.stateTime <= 0) this.performKick(), this.spine.resume();
else {
var t = this.tarKickX - this.xPos;
(this.xPos += t / 5), Math.abs(t) < 0.5 && (this.xPos = this.tarKickX), (this.stateTime -= 1);
}
else if (this.state === p.Swinging) 0.12 <= this.currAnimProgress && this.prevAnimProgress < 0.12 && f.default.playSFX("poleWoosh");
else if (this.state === p.Swimming) {
var e = 0 === this.xVelocity && 0 === this.yVelocity;
!this.isSwimingStop && e
? ((this.isSwimingStop = !0), this.hideSprite(), this.playSwimAnim("player-stop-swim"))
: this.isSwimingStop && !e
? ((this.isSwimingStop = !1), this.hideSprite(), !0 === this.swimminBack ? this.playSwimAnim("player-down-swim") : this.playSwimAnim("player-swim"))
: this.isSwimingStop ||
e ||
(this.lastSwimmingBack !== this.swimminBack && ((this.lastSwimmingBack = this.swimminBack), !0 === this.swimminBack ? this.playSwimAnim("player-down-swim") : this.playSwimAnim("player-swim")));
}
this.prevAnimProgress = this.currAnimProgress;
}),
(t.prototype.getRotation = function () {
var t = d.default.toRad(5 + Math.abs(this.xVelocity));
(this.rPosDest = this.rPosDest % d.default.PI2),
(this.rPos = this.rPos % d.default.PI2),
Math.abs(this.rPosDest - this.rPos) <= t && (this.rPos = this.rPosDest),
Math.abs(this.rPosDest - this.rPos) > Math.PI && (this.rPosDest < this.rPos ? (this.rPosDest += d.default.PI2) : (this.rPosDest -= d.default.PI2)),
this.rPosDest > this.rPos ? (this.rPos += t + (this.rPosDest - this.rPos) / 6) : this.rPosDest < this.rPos && (this.rPos -= t - (this.rPosDest - this.rPos) / 6);
}),
(t.prototype.incVelocities = function () {
this.currentCannon ||
((this.xPos += this.xVelocity + this.forcedXVelocity),
(this.yPos += this.yVelocity),
this.currentSlope && (-1 === this.currentSlope.side ? (this.yPos -= this.xVelocity + 0.5) : (this.yPos += this.xVelocity + 0.5)));
}),
(t.prototype.loseKey = function (t) {
var e = this.heldKeys.indexOf(t);
this.heldKeys.splice(e, 1), (this.keysObtained -= 1);
}),
(t.prototype.update = function () {
if ((this.animationTick(), !0 === this.alive)) {
if (!0 === this.porting) {
var t = this.main.finishPortal.xPos - this.xPos,
e = this.main.finishPortal.yPos - this.yPos;
(this.xPos += t / 20),
(this.yPos += e / 20),
(this.container.rotation += d.default.toRad(4) - this.spine.scaleX),
(this.spine.scaleX *= 0.97),
(this.spine.scaleY = this.spine.scaleX),
Math.abs(this.spine.scaleX) < 0.3 && this.main.finishLevel(),
this.updatePositions();
} else if (this.main.finishPortal && SAT.testPolygonPolygon(this.totalPolygon, this.main.finishPortal.hitBoxPolygon))
(this.porting = !0), this.main.stopTimer(), this.setFall(), !1 === this.scoreUpdated && ((c.Constants.actFinishTime = Date.now() - c.Constants.actStartTime), (this.scoreUpdated = !0));
else if (this.state === p.Spawning);
else {
!1 !== this.swimming || !1 !== this.kicking || this.currentCannon || !1 !== this.climb || this.checkKeyboard(),
this.checkRopeCollisions(),
!1 === this.climb ? this.checkCrouch() : this.checkKeyboardClimb(),
!1 !== this.swimming || this.currentCannon || !1 !== this.climb || this.updateGravity(),
this.incVelocities(),
this.hangTime < this.maxHangCoolDown && (this.hangTime += 1),
this.checkPoolCollisions(),
!0 === this.swimming
? (this.getSwim(), this.checkSwimBlockCollisions(), (this.breathe -= 1), this.breathe <= 0 && this.kill(4))
: (this.currentCannon ||
!1 !== this.climb ||
(this.checkBlocks(),
this.checkSlopeCollisions(),
this.currentPole ? this.performSwing() : (this.checkPoleCollisions(), 0 < this.poleRedSection.alpha && (this.poleRedSection.alpha -= 0.25 * this.poleRedSection.alpha))),
(this.falling || this.currentZipline) && 0 < this.yVelocity && this.checkZipline(),
this.breathe < this.maxBreathe ? (this.breathe += 2) : (this.breathe = this.maxBreathe)),
this.currentCannon ? this.cannonLogic() : this.checkCannonCollisions(),
this.checkKeyObj(),
this.checkTorchObj(),
this.checkKite(),
this.checkCheckpoint(),
this.checkDeath(),
this.checkCoins();
for (var i = 0, n = this.main.lightSwitches; i < n.length; i++) {
var s = n[i];
SAT.testPolygonPolygon(this.totalPolygon, s.hitBoxPolygon) && this.main.goDark();
}
if (this.portalUsed) SAT.testPolygonPolygon(this.totalPolygon, this.portalUsed.hitBoxPolygon) || (this.portalUsed = null);
else
for (var r = 0, o = this.main.portals; r < o.length; r++) {
var a = o[r];
if (SAT.testPolygonPolygon(this.totalPolygon, a.hitBoxPolygon)) {
a.enabled ? ((this.portalUsed = a.getAttachPortal()), this.main.teleportPortal(a)) : (this.portalUsed = a);
break;
}
}
!1 === this.swimming && this.getRotation(), this.updatePositions(), this.currentZipline || !0 !== f.default.isPlaying("ziplineFull", !0) || f.default.stopSFXLoop("ziplineFull");
}
for (var h = 0, l = this.main.breatheBlasters; h < l.length; h++) {
var u = l[h];
SAT.testPolygonPolygon(this.totalPolygon, u.hitPoly) && ((this.breathe += 2.5), this.breathe > this.maxBreathe && (this.breathe = this.maxBreathe));
}
this.breatheBar(), !1 === c.Constants.IS_MOBILE && this.pressDown.blink();
}
}),
(t.prototype.breatheBar = function () {
!0 === this.swimming ? this.breatheGroup.show(this.container.rotation, this.breathe) : this.breatheGroup.hide();
}),
(t.prototype.pause = function () {
this.spine.pause(), !0 === f.default.isPlaying("ziplineFull", !0) && f.default.pause("ziplineFull", !0), !0 === f.default.isPlaying("kite", !0) && f.default.pause("kite", !0);
}),
(t.prototype.resume = function () {
!0 === f.default.isPaused("ziplineFull", !0) && f.default.resume("ziplineFull", !0), !0 === f.default.isPaused("kite", !0) && f.default.resume("kite", !0), this.spine.resume(), this.keys.resetKeys();
}),
(t.prototype.hide = function () {
this.hideSprite(), (this.container.visible = !1), (this.alive = !1);
}),
(t.prototype.updatePositions = function () {
(this.container.x = this.xPos), (this.container.y = this.yPos), (this.container.rotation = this.rPos), this.updateHitBoxesPos();
}),
t
);
})(n.default);
e.default = b;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r =
(this && this.__extends) ||
((s = function (t, e) {
return (s =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
s(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
});
void 0 ===
(n = function (t, e) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function (n) {
function t() {
var t = (null !== n && n.apply(this, arguments)) || this;
return (t.refreshDrawTint = !1), t;
}
return (
r(t, n),
(t.prototype.setTexture = function (t, e) {
return n.prototype.setTexture.call(this, t, e), (this.refreshDrawTint = !0), this;
}),
(t.prototype.setFrame = function (t, e, i) {
return n.prototype.setFrame.call(this, t, e, i), (this.refreshDrawTint = !0), this;
}),
(t.prototype.destroy = function () {
Phaser.GameObjects.GameObject.prototype.destroy.call(this);
}),
t
);
})(Phaser.GameObjects.Image);
e.default = i;
}.apply(e, [i, e])) || (t.exports = n);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(3), i(36)]),
void 0 ===
(s = function (t, e, i, n, r) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var s = (function (n) {
function t(t, e) {
var i = n.call(this, t) || this;
return (i.layer = e), (i.lineColor = 16763904), i.init(), (i.hitBoxPolygon = new SAT.Box(new SAT.Vector(0, 0), 20, 40).toPolygon()), i.hitBoxPolygon.setOffset(new SAT.Vector(-10, -20)), (i.alive = !1), i;
}
return (
o(t, n),
(t.prototype.init = function () {
(this.sprite = new Phaser.GameObjects.Image(this.main, 0, 0, i.Atlases.gameplay, "key instance 10000")),
this.layer.add(this.sprite),
(this.lineGraphic = new Phaser.GameObjects.Graphics(this.main)),
this.layer.add(this.lineGraphic);
}),
(t.prototype.spawn = function (t, e) {
(this.xPos = t),
(this.yPos = e),
(this.startX = t),
(this.startY = e),
(this.xVelocity = 0),
(this.yVelocity = 0),
(this.sprite.x = t),
(this.sprite.y = e),
(this.hitBoxPolygon.pos.x = t),
(this.hitBoxPolygon.pos.y = e),
(this.alive = !0),
(this.used = !1),
(this.keyNum = 0),
(this.saveUse = !1),
(this.following = !1),
(this.rad = 0);
}),
(t.prototype.useKey = function () {
(this.used = !0), this.lineGraphic.clear(), (this.sprite.visible = !1), (this.alive = !1);
}),
(t.prototype.followPlayer = function () {
var t,
e,
i = 10 * (this.keyNum - 1);
(this.rad = (-4 * this.player.xVelocity * Math.PI) / 180),
this.yVelocity < 0 && (this.yVelocity += 0.5),
(this.yPos += this.yVelocity),
(e = this.player.swimming
? ((t = this.player.xPos), this.player.yPos - i)
: ((t = this.player.facing === r.FacingDir.Right ? this.player.xPos - 30 : this.player.xPos + 30), this.player.yPos - 6 - i));
var n = t - this.xPos,
s = e - this.yPos;
(this.xPos += n / 5), (this.yPos += s / 5), Math.abs(n) < 1 && (this.xPos = t), Math.abs(s) < 1 && (this.yPos = e), (this.hitBoxPolygon.pos.x = this.xPos), (this.hitBoxPolygon.pos.y = this.yPos);
}),
(t.prototype.runCollisions = function () {
for (var t = 0, e = this.main.blocks; t < e.length; t++) {
var i = e[t];
if (i.alive) {
if (SAT.testPolygonPolygon(i.topBoundPolygon, this.hitBoxPolygon)) {
this.player.xVelocity < 5 ? (this.yVelocity = this.player.xVelocity * this.player.xVelocity * -0.2) : (this.yVelocity = -5),
(this.yPos = i.topEdge - 20),
(this.hitBoxPolygon.pos.y = this.yPos);
continue;
}
if (SAT.testPolygonPolygon(i.rightBoundPolygon, this.hitBoxPolygon)) {
this.xPos = i.rightEdge + 11;
continue;
}
if (SAT.testPolygonPolygon(i.leftBoundPolygon, this.hitBoxPolygon)) {
this.xPos = i.leftEdge - 11;
continue;
}
SAT.testPolygonPolygon(i.bottomBoundPolygon, this.hitBoxPolygon) && ((this.yVelocity *= -1), (this.yPos = i.bottomEdge + 21));
}
}
}),
(t.prototype.drawLineToPlayer = function () {
this.lineGraphic.clear(),
this.lineGraphic.lineStyle(2, this.lineColor),
this.lineGraphic.beginPath(),
this.lineGraphic.moveTo(this.xPos, this.yPos),
this.player.currentPole
? this.lineGraphic.lineTo(this.player.xPos, this.player.yPos - 31)
: this.player.crouching
? this.lineGraphic.lineTo(this.player.xPos, this.player.yPos - 6)
: this.lineGraphic.lineTo(this.player.xPos, this.player.yPos - 16),
this.lineGraphic.strokePath();
}),
(t.prototype.follow = function () {
this.following = !0;
}),
(t.prototype.update = function () {
!1 !== this.alive &&
((this.player = this.main.player),
this.used
? 0.1 < this.sprite.scaleX
? ((this.sprite.scaleX -= 0.1), (this.sprite.scaleY = this.sprite.scaleX), (this.rad -= (5 * Math.PI) / 180), (this.sprite.rotation = this.rad))
: ((this.alive = !1), (this.sprite.visible = !1))
: !0 === this.following && (this.followPlayer(), this.runCollisions(), this.drawLineToPlayer(), this.updatePositions()));
}),
(t.prototype.die = function () {
(this.alive = !1), (this.sprite.visible = !1);
}),
(t.prototype.reset = function () {
this.used || ((this.xPos = this.startX), (this.yPos = this.startY), this.updatePositions(), this.following && ((this.following = !1), this.lineGraphic.clear()));
}),
(t.prototype.resetLevel = function () {
(this.xPos = this.startX), (this.yPos = this.startY), this.updatePositions(), this.sprite.setScale(1, 1), (this.used = !1), (this.alive = !0), (this.sprite.visible = !0), (this.following = !1);
}),
(t.prototype.updatePositions = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos), (this.hitBoxPolygon.pos.x = this.xPos), (this.hitBoxPolygon.pos.y = this.yPos);
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), (this.hitBoxPolygon = null), this.lineGraphic.destroy(), (this.lineGraphic = null), (this.player = null), (this.layer = null), n.prototype.destroy.call(this);
}),
t
);
})((n = a(n)).default);
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(2)]),
void 0 ===
(s = function (t, e, i, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var s = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (i.RANGE = 200), (i.HALF_RANGE = 100), (i.container = new Phaser.GameObjects.Container(t)), e.add(i.container), i.initGraphics(), (i.hangable = !0), (i.scalable = !0), i;
}
return (
o(t, n),
(t.prototype.initGraphics = function () {
(this.sprite = new Phaser.GameObjects.Image(this.main, 0, 0, i.Atlases.gameplay, "invisBlock instance 10000")), this.container.add(this.sprite), (this.alive = !1);
}),
(t.prototype.spawn = function (t, e, i, n) {
this.init(t, e, i, n), (this.container.x = t), (this.container.y = e), this.container.setScale(i / 100, n / 100);
}),
(t.prototype.updateGraphicPosition = function () {
(this.container.x = this.xPos), (this.container.y = this.yPos);
}),
(t.prototype.update = function () {
if (this.alive) {
var t = this.main.player,
e = Math.sqrt(Math.pow(t.xPos - this.xPos, 2) + Math.pow(t.yPos - this.yPos, 2));
e > this.RANGE ? (this.container.alpha = 1) : e < this.HALF_RANGE ? (this.container.alpha = 0) : (this.container.alpha = ((e - this.HALF_RANGE) / this.HALF_RANGE) * 1),
(this.xPos === this.prevX && this.yPos === this.prevY) || this.updatePosition(),
(this.prevX = this.xPos),
(this.prevY = this.yPos);
}
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), this.container.destroy(), (this.container = null), n.prototype.destroy.call(this);
}),
(t.prototype.reset = function () {}),
t
);
})((n = a(n)).default);
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
a =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
o =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(3)]),
void 0 ===
(s = function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (o) {
function t(t, e, i, n, s) {
var r = o.call(this, t) || this;
return (r.fadeAfter = 150), (r.size = e), (r.hitBox = new SAT.Box(new SAT.Vector(0, 0), e, e)), (r.collide = i), (r.alive = !1), (r.fadeAfter = s), (r.liquid = n), r;
}
return (
a(t, o),
(t.prototype.spawnBase = function (t, e, i, n) {
(this.xPos = t),
(this.yPos = e),
(this.xVelocity = i),
(this.yVelocity = n),
(this.hitBox.pos.x = t - 0.5 * this.size),
(this.hitBox.pos.y = e - 0.5 * this.size),
(this.hitBoxPolygon = this.hitBox.toPolygon()),
(this.fadeTime = 0),
(this.alive = !0),
(this.water = !1),
(this.onIce = !1);
}),
(t.prototype.destroy = function (t) {
void 0 === t && (t = !1), (this.hitBoxPolygon = null), (this.hitBox = null), t ? (this.main.particleUINum -= 1) : (this.main.particleNum -= 1), (this.alive = !1), o.prototype.destroy.call(this);
}),
(t.prototype.multAlpha = function (t) {}),
(t.prototype.update = function () {
this.alive &&
(this.getWater(),
this.water
? ((this.xPos += 0.1 * this.xVelocity), (this.yPos += 0.5 * this.yVelocity), this.liquid && ((this.yPos += 0.5 * this.yVelocity), -1 < this.yVelocity && (this.yVelocity -= 0.05)))
: ((this.xPos += this.xVelocity), (this.yPos += this.yVelocity)),
this.collide && this.yVelocity < 12 && (this.water ? this.liquid || (this.yVelocity += 0.25 * this.main.gravity) : (this.yVelocity += this.main.gravity)),
this.water || this.onIce ? (this.xVelocity *= 0.99) : (this.xVelocity *= 0.95),
Math.abs(this.xVelocity) < 0.1 && (this.xVelocity = 0),
this.collide && this.runCollisions());
}),
(t.prototype.runCollisions = function () {
for (var t = 0; t < this.main.blocks.length; t++) {
var e = this.main.blocks[t];
if (e.alive)
if (!0 !== SAT.testPolygonPolygon(this.hitBoxPolygon, e.topBoundPolygon))
if (!0 === SAT.testPolygonPolygon(this.hitBoxPolygon, e.bottomBoundPolygon) && this.yVelocity < 0)
(this.yVelocity *= -0.5), (this.yPos = e.bottomEdge), 0 < this.xVelocity ? (this.xVelocity -= 0.1) : this.xVelocity < 0 && (this.xVelocity += 0.1), (this.yPos += this.yVelocity);
else if (!0 !== SAT.testPolygonPolygon(this.hitBoxPolygon, e.leftBoundPolygon))
if (!0 !== SAT.testPolygonPolygon(this.hitBoxPolygon, e.rightBoundPolygon)) {
for (var i = 0, n = this.main.pools; i < n.length; i++) {
var s = n[i];
if (SAT.testPolygonPolygon(this.hitBoxPolygon, s.totalPolygon)) {
if (this.liquid && !this.water) return void this.destroy(this.isUI);
this.water || (this.yVelocity = 0), (this.water = !0);
}
}
if (this.liquid && !this.water) return void this.destroy(this.isUI);
} else (this.xVelocity *= -0.5), (this.xPos = e.rightEdge + 0.5 * this.size), (this.xPos += this.xVelocity);
else (this.xVelocity *= -0.5), (this.xPos = e.leftEdge - 0.5 * this.size), (this.xPos += this.xVelocity);
else
4 <= this.yVelocity ? (this.yVelocity *= -0.25) : 1 <= this.yVelocity && (this.yVelocity = 0),
(this.yPos = e.topEdge - 0.5 * this.size),
(this.xPos += e.xVelocity),
"speed" === e.blockType && (this.xVelocity += e.speedInc),
"ice" === e.blockType && (this.onIce = !0);
}
}),
(t.prototype.getWater = function () {
this.water = !1;
for (var t = 0, e = this.main.pools; t < e.length; t++) {
var i = e[t];
if (SAT.testPolygonPolygon(this.hitBoxPolygon, i.totalPolygon)) {
this.water = !0;
break;
}
}
}),
t
);
})((i = o(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(7)]),
void 0 ===
(s = function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (i = r(i));
var n = (function () {
function t(t) {
(this.appearDistSq = 150), (this.disappearDistSq = 170), (this.reappearTime = 30), (this.width = 0), (this.height = 0), (this.main = t);
}
return (
(t.prototype.setID = function (t) {
this.id = t;
}),
(t.prototype.spawn = function (t, e, i) {
(this.xPos = t),
(this.yPos = e),
(this.sprite.x = t),
(this.sprite.y = e),
(this.sprite.rotation = (i * Math.PI) / 180),
(this.sprite.scale = 0.5),
(this.sprite.visible = !0),
(this.sprite.alpha = 0),
(this.reappear = 0),
(this.canAppear = !1),
(this.canDisappear = !1);
}),
(t.prototype.update = function () {
var t = i.default.distance(this.main.player.xPos, this.main.player.yPos, this.xPos, this.yPos);
t < this.appearDistSq ? ((this.canAppear = !0), (this.canDisappear = !1)) : t > this.disappearDistSq && (this.canDisappear = !0),
!0 === this.canAppear
? ((this.sprite.alpha -= 0.25 * (this.sprite.alpha - 1)),
(this.sprite.scaleX -= 0.25 * (this.sprite.scaleX - 1)),
(this.sprite.scaleY = this.sprite.scaleX),
0.99 <= this.sprite.scaleX && ((this.canAppear = !1), (this.reappear = 0)))
: !0 === this.canDisappear &&
(this.reappear >= this.reappearTime
? ((this.sprite.alpha -= 0.25 * this.sprite.alpha),
(this.sprite.scaleX -= 0.25 * this.sprite.scaleX),
(this.sprite.scaleY = this.sprite.scaleX),
this.sprite.scaleX <= 0 && (this.canDisappear = !1))
: (this.reappear += 1));
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), (this.main = null);
}),
t
);
})();
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(54)]),
void 0 ===
(s = function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
o(e, t),
(e.prototype.downState = function () {
this.scale = 1.1;
}),
(e.prototype.upState = function () {
this.scale = 1;
}),
e
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
u =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
c =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(5), i(1), i(11), i(10), i(33), i(8)]),
void 0 ===
(s = function (t, e, i, n, s, r, o, a, h) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (r = c(r)), (o = c(o));
var l = (function (e) {
function t() {
return (null !== e && e.apply(this, arguments)) || this;
}
return (
u(t, e),
(t.prototype.init = function () {
var t = this;
e.prototype.init.call(this),
(this.followCameraInPause = !1),
(this.topBg = new Phaser.GameObjects.Image(this.scene, i.Constants.GHW, 0, i.Atlases.ui, "skinsTopBg instance 10000")),
this.topBg.setOrigin(0.5, 0),
(this.topBg.displayWidth = 4e3),
this.add(this.topBg),
(this.btnExit = new n.ButtonText(this.scene, 0, 0)),
this.btnExit.addImage(i.Atlases.ui, "btnYellow instance 10000", 0, 5, 0.85),
this.btnExit.addTxtTranslated("back", i.Fonts.Main, 30, "#001977"),
(this.btnExit.onUp = function () {
h.AdHandler.getInstance().showAd("exit_skins", function () {
t.back();
});
}),
this.add(this.btnExit),
(this.txtSkins = new s.JDTextTranslated(this.scene, i.Constants.GHW, 0, i.Fonts.Main, "skins", 50)),
this.txtSkins.setOrigin(0.5, 0.5),
this.add(this.txtSkins),
(this.coinIcon = new Phaser.GameObjects.Image(this.scene, 0, 0, i.Atlases.ui, "coin instance 10000")),
this.add(this.coinIcon),
(this.txtCoins = new s.JDText(this.scene, 0, 0, i.Fonts.Main, o.default.moneyDecorator(i.Constants.totalMoney), 50)),
this.txtCoins.setOrigin(0, 0.5),
this.add(this.txtCoins);
}),
(t.prototype.addMoney = function (t) {
(i.Constants.totalMoney += t), (this.txtCoins.text = o.default.moneyDecorator(i.Constants.totalMoney)), r.default.getInstance().saveProgress();
}),
(t.prototype.back = function () {
this.scene.backFromSubSkin();
}),
(t.prototype.resize = function () {
(this.topBg.y = -i.Constants.UI_SHIFT_Y),
(this.btnExit.x = 140 - i.Constants.UI_SHIFT_X),
(this.btnExit.y = 80 - i.Constants.UI_SHIFT_Y),
(this.txtSkins.y = 50 - i.Constants.UI_SHIFT_Y),
(this.coinIcon.x = i.Constants.GW - 250 + i.Constants.UI_SHIFT_X),
(this.coinIcon.y = this.txtSkins.y),
(this.txtCoins.x = this.coinIcon.x + 50),
(this.txtCoins.y = this.coinIcon.y - 5);
}),
(t.prototype.destroy = function () {
e.prototype.destroy.call(this), (this.topBg = null), (this.btnExit = null), (this.txtSkins = null), (this.coinIcon = null), (this.txtCoins = null);
}),
t
);
})((a = c(a)).default);
e.default = l;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(1), i(17)]),
void 0 ===
(s = function (t, e, u, c, d) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (d = r(d));
var i = (function () {
function t(t, e) {
(this.subscene = t), (this.rarity = e);
}
return (
(t.prototype.create = function (t, e, i, n, s, r, o) {
var a = this.subscene.scene.add.nineslice(t, e, 512, 512, { key: u.Atlases.ui, frame: "menu_box instance 10000" }, u.Constants.pBgOffset, u.Constants.pBgsafeArea);
a.setOrigin(0.5, 0.5),
a.resize(300, n),
this.subscene.add(a),
(a = this.subscene.scene.add.nineslice(t, i - 70, 512, 512, { key: u.Atlases.ui, frame: "menu_box_inside instance 10000" }, 100, 25)).setOrigin(0.5, 0.5),
a.resize(244, 390),
this.subscene.add(a),
(a = null),
(this.imgSkin = new Phaser.GameObjects.Image(this.subscene.scene, t + 5, i - 70, u.Atlases.skinsThumbnails, d.default.getSkinFrameName(s))),
this.subscene.add(this.imgSkin);
var h = new Phaser.GameObjects.Graphics(this.subscene.scene, { x: t - 163, y: i - 390 });
this.subscene.add(h), h.fillStyle(217552, 1), h.beginPath(), h.moveTo(0, 0), h.lineTo(322, 16), h.lineTo(322, 90), h.lineTo(4, 110), h.closePath(), h.fillPath(), (h = null);
var l = new c.JDTextTranslated(this.subscene.scene, t, i - 338, u.Fonts.Main, r, 38, o);
l.setMaxSize(290), l.setOrigin(0.5, 0.5), l.setStroke("#001977", 8), this.subscene.add(l), (l = null);
}),
(t.prototype.spin = function (t) {}),
(t.prototype.resize = function () {}),
(t.prototype.destroy = function () {
(this.subscene = null), (this.imgSkin = null);
}),
t
);
})();
e.default = i;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n;
void 0 ===
(n = function (t, e) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (e.LoaderHelper = void 0);
var i = (function () {
function t() {}
return (
(t.show = function () {
var t = document.getElementById("loader");
t && (t.style.display = "block");
}),
(t.hide = function () {
var t = document.getElementById("loader");
t && (t.style.display = "none");
}),
t
);
})();
e.LoaderHelper = i;
}.apply(e, [i, e])) || (t.exports = n);
},
function (t, e, i) {
var n,
s,
o =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(3), i(36), i(203), i(204)]),
void 0 ===
(s = function (t, e, i, n, s, r) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }),
(e.PlayerGib = e.PlayerBreatheBar = e.Player = e.Entity = void 0),
Object.defineProperty(e, "Entity", {
enumerable: !0,
get: function () {
return o(i).default;
},
}),
Object.defineProperty(e, "Player", {
enumerable: !0,
get: function () {
return o(n).default;
},
}),
Object.defineProperty(e, "PlayerBreatheBar", {
enumerable: !0,
get: function () {
return o(s).default;
},
}),
Object.defineProperty(e, "PlayerGib", {
enumerable: !0,
get: function () {
return o(r).default;
},
});
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(23), i(48)]),
void 0 ===
(s = function (t, e, i, P) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (i = r(i)), (P = r(P));
var n = (function () {
function G() {}
return (
(G.init = function (t) {
i.default.init(t),
t.renderer.type === Phaser.CANVAS &&
(this.canvasGameObjectDestroy(), this.canvasRenderImages(), (this.canvas = document.createElement("canvas")), (Phaser.GameObjects.BitmapText.prototype.renderCanvas = this.canvasRenderBitmapText));
}),
(G.canvasGameObjectDestroy = function () {
Phaser.GameObjects.GameObject.prototype.destroy = function () {
this.scene &&
!this.ignoreDestroy &&
(this.cachedTintedTexture && (Phaser.Display.Canvas.CanvasPool.remove(this), (this.cachedTintedTexture = void 0)),
this.preDestroy && this.preDestroy.call(this),
this.emit(Phaser.Core.Events.DESTROY, this),
this.removeAllListeners(),
this.postPipelines && this.resetPostPipeline(!0),
this.displayList && (this.displayList.queueDepthSort(), this.displayList.remove(this)),
this.input && (this.scene.sys.input.clear(this), (this.input = void 0)),
this.data && (this.data.destroy(), (this.data = void 0)),
this.body && (this.body.destroy(), (this.body = void 0)),
(this.active = !1),
(this.visible = !1),
(this.scene = void 0),
(this.displayList = void 0),
(this.parentContainer = void 0));
};
}),
(G.canvasRenderImages = function () {
Phaser.Renderer.Canvas.CanvasRenderer.prototype.batchSprite = function (t, e, i, n) {
var s = i.alpha * t.alpha;
if (0 !== s) {
var r = this.currentContext,
o = this._tempMatrix1,
a = this._tempMatrix2,
h = this._tempMatrix3,
l = e.canvasData,
u = l.x,
c = l.y,
d = e.cutWidth,
f = e.cutHeight,
p = e.customPivot,
g = e.source.resolution,
v = t.displayOriginX,
y = t.displayOriginY,
m = -v + e.x,
x = -y + e.y;
if (t.isCropped) {
var b = t._crop;
(b.flipX === t.flipX && b.flipY === t.flipY) || e.updateCropUVs(b, t.flipX, t.flipY),
(d = b.cw),
(f = b.ch),
(u = b.cx),
(c = b.cy),
(m = -v + b.x),
(x = -y + b.y),
t.flipX && (0 <= m ? (m = -(m + d)) : m < 0 && (m = Math.abs(m) - d)),
t.flipY && (0 <= x ? (x = -(x + f)) : x < 0 && (x = Math.abs(x) - f));
}
var w = 1,
T = 1;
t.flipX && (p || (m += -e.realWidth + 2 * v), (w = -1)),
t.flipY && (p || (x += -e.realHeight + 2 * y), (T = -1)),
P.default.calculateMatrix(t, w, T, o, a, h, i, n),
r.save(),
h.setToContext(r),
(r.globalAlpha = s),
(r.imageSmoothingEnabled = !(!this.antialias || e.source.scaleMode)),
(r.globalCompositeOperation = this.blendModes[t.blendMode]);
var S = t.tintTopLeft;
if (16777215 !== S) {
var _ = G.getGameObjectTintCanvas(t);
if (t.cachedTint !== S || !0 === t.refreshDrawTint) {
var E = _.getContext("2d");
(_.width === d && _.height === f) || ((_.width = d), (_.height = f)),
E.clearRect(0, 0, d, f),
(E.fillStyle = "#" + ("00000" + (0 | S).toString(16)).substr(-6)),
E.fillRect(0, 0, d, f),
(E.globalCompositeOperation = "multiply"),
E.drawImage(e.source.image, u, c, d, f, 0, 0, d, f),
(E.globalCompositeOperation = "destination-atop"),
E.drawImage(e.source.image, u, c, d, f, 0, 0, d, f),
(t.cachedTint = S),
(t.refreshDrawTint = !1);
}
r.drawImage(_, 0, 0, d, f, m, x, d / g, f / g);
} else r.drawImage(e.source.image, u, c, d, f, m, x, d / g, f / g);
r.restore();
}
};
}),
(G.canvasRenderBitmapText = function (t, e, i, n) {
var s = e._text,
r = s.length,
o = t.currentContext;
if (0 !== r && Phaser.Renderer.Canvas.SetTransform(t, o, e, i, n)) {
i.addToRenderList(e);
var a = e.texture.frames.__BASE,
h = e.fontData.chars,
l = e.fontData.lineHeight,
u = e._letterSpacing,
c = 0,
d = 0,
f = 0,
p = null,
g = 0,
v = 0,
y = 0,
m = 0,
x = 0,
b = 0,
w = null,
T = 0,
S = a.source.image,
_ = a.cutX,
E = a.cutY,
P = e._fontSize / e.fontData.size,
A = e._align,
M = 0,
C = 0,
O = e.getTextBounds(!1),
k = O.local.width,
R = O.local.height;
0 < e.maxWidth && (r = (s = O.wrappedText).length);
var L = e._bounds.lines;
1 === A ? (C = (L.longest - L.lengths[0]) / 2) : 2 === A && (C = L.longest - L.lengths[0]), o.translate(-e.displayOriginX, -e.displayOriginY);
var I = i.roundPixels;
e.cachedTint || (e.cachedTint = 16777215);
var D,
F = e.tintTopLeft,
B = 16777215 !== F,
N = e.cachedTint !== F,
U = o;
!0 === B && (((D = G.canvas).width === k && D.height === R) || ((D.width = k), (D.height = R)), (U = D.getContext("2d")).clearRect(0, 0, k, R));
for (var Y = 0; Y < r; Y++)
if (10 !== (f = s.charCodeAt(Y))) {
if ((p = h[f])) {
if (((g = _ + p.x), (v = E + p.y), (y = p.width), (m = p.height), (x = p.xOffset + c), (b = p.yOffset + d), null !== w)) {
var z = p.kerning[T];
x += void 0 !== z ? z : 0;
}
(x *= P),
(b *= P),
(x += C),
(c += p.xAdvance + u),
(w = p),
(T = f),
0 !== y && 0 !== m && 32 !== f && (I && ((x = Math.round(x)), (b = Math.round(b))), U.save(), U.translate(x, b), U.scale(P, P), U.drawImage(S, g, v, y, m, 0, 0, y, m), U.restore());
}
} else M++, 1 === A ? (C = (L.longest - L.lengths[M]) / 2) : 2 === A && (C = L.longest - L.lengths[M]), (c = 0), (d += l), (w = null);
if (!0 === B) {
var X = G.getGameObjectTintCanvas(e);
if (!0 === N || !0 === e.refreshDrawTint) {
var V = X.getContext("2d");
(X.width === k && X.height === R) || ((X.width = k), (X.height = R)),
V.clearRect(0, 0, k, R),
(V.fillStyle = "#" + ("00000" + (0 | F).toString(16)).substr(-6)),
V.fillRect(0, 0, k, R),
(V.globalCompositeOperation = "multiply"),
V.drawImage(D, 0, 0, k, R),
(V.globalCompositeOperation = "destination-atop"),
V.drawImage(D, 0, 0, k, R),
(e.cachedTint = F),
(e.refreshDrawTint = !1);
}
o.drawImage(X, 0, 0, k, R);
}
o.restore();
}
}),
(G.getGameObjectTintCanvas = function (t) {
var e = t.cachedTintedTexture;
return e || ((e = t.cachedTintedTexture = Phaser.Display.Canvas.CanvasPool.create(t)), (t.cachedTint = 16777215)), e;
}),
G
);
})();
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r =
(this && this.__extends) ||
((s = function (t, e) {
return (s =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
s(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
});
void 0 ===
(n = function (t, e) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function (e) {
function X(t) {
return e.call(this, { game: t }) || this;
}
return (
r(X, e),
(X.prototype.batchSprite = function (t, e, i) {
this.manager.set(this, t);
var n = this._tempMatrix1,
s = this._tempMatrix2,
r = this._tempMatrix3,
o = t.frame,
a = o.glTexture,
h = o.u0,
l = o.v0,
u = o.u1,
c = o.v1,
d = o.x,
f = o.y,
p = o.cutWidth,
g = o.cutHeight,
v = o.customPivot,
y = t.displayOriginX,
m = t.displayOriginY,
x = -y + d,
b = -m + f;
if (t.isCropped) {
var w = t._crop;
(w.flipX === t.flipX && w.flipY === t.flipY) || o.updateCropUVs(w, t.flipX, t.flipY),
(h = w.u0),
(l = w.v0),
(u = w.u1),
(c = w.v1),
(p = w.width),
(g = w.height),
(x = -y + (d = w.x)),
(b = -m + (f = w.y));
}
var T = 1,
S = 1;
t.flipX && (v || (x += -o.realWidth + 2 * y), (T = -1)), (t.flipY || (o.source.isGLTexture && !a.flipY)) && (v || (b += -o.realHeight + 2 * m), (S = -1)), X.calculateMatrix(t, T, S, n, s, r, e, i);
var _ = x + p,
E = b + g,
P = e.roundPixels,
A = r.getXRound(x, b, P),
M = r.getYRound(x, b, P),
C = r.getXRound(x, E, P),
O = r.getYRound(x, E, P),
k = r.getXRound(_, E, P),
R = r.getYRound(_, E, P),
L = r.getXRound(_, b, P),
I = r.getYRound(_, b, P),
D = Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha,
F = e.alpha,
B = D(t.tintTopLeft, F * t._alphaTL),
N = D(t.tintTopRight, F * t._alphaTR),
U = D(t.tintBottomLeft, F * t._alphaBL),
Y = D(t.tintBottomRight, F * t._alphaBR);
this.shouldFlush(6) && this.flush();
var z = this.setGameObject(t, o);
this.manager.preBatch(t), this.batchQuad(t, A, M, C, O, k, R, L, I, h, l, u, c, B, N, U, Y, t.tintFill, a, z), this.manager.postBatch(t);
}),
(X.calculateMatrix = function (i, t, e, n, s, r, o, a) {
var h,
l,
u,
c,
d = i.scaleX * t,
f = i.scaleY * e,
p = i.x,
g = i.y;
function v() {
if (0 !== i.rotation) {
var t = Math.cos(i.rotation),
e = Math.sin(i.rotation);
(h = t * d), (l = e * d), (u = -e * f), (c = t * f);
} else (h = d), (u = l = 0), (c = f);
}
if (i.skewX || i.skewY) {
var y = i.rotation + i.skewX,
m = i.rotation + i.skewY;
m % X.PI2 || y % X.PI2
? ((y === i._cachedRotX && m === i._cachedRotY) || ((i._cachedRotX = y), (i._cachedRotY = m), (i._crA = Math.cos(m)), (i._srB = Math.sin(m)), (i._srC = Math.sin(-y)), (i._crD = Math.cos(y))),
(h = i._crA * d),
(l = i._srB * d),
(u = i._srC * f),
(c = i._crD * f))
: v();
} else v();
(i.pivotX || i.pivotY) && ((p += i.pivotX * h + i.pivotY * u), (g += i.pivotX * l + i.pivotY * c)),
n.copyFrom(o.matrix),
a ? n.multiplyWithOffset(a, -o.scrollX * i.scrollFactorX, -o.scrollY * i.scrollFactorY) : ((p -= o.scrollX * i.scrollFactorX), (g -= o.scrollY * i.scrollFactorY)),
s.setTransform(h, l, u, c, p, g),
n.multiply(s, r);
}),
(X.PI2 = 2 * Math.PI),
X
);
})(Phaser.Renderer.WebGL.Pipelines.MultiPipeline);
e.default = i;
}.apply(e, [i, e])) || (t.exports = n);
},
function (t, e, i) {
var n,
s,
r,
h =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
o =
(this && this.__createBinding) ||
(Object.create
? function (t, e, i, n) {
void 0 === n && (n = i),
Object.defineProperty(t, n, {
enumerable: !0,
get: function () {
return e[i];
},
});
}
: function (t, e, i, n) {
void 0 === n && (n = i), (t[n] = e[i]);
}),
a =
(this && this.__setModuleDefault) ||
(Object.create
? function (t, e) {
Object.defineProperty(t, "default", { enumerable: !0, value: e });
}
: function (t, e) {
t.default = e;
}),
l =
(this && this.__importStar) ||
function (t) {
if (t && t.__esModule) return t;
var e = {};
if (null != t) for (var i in t) "default" !== i && Object.prototype.hasOwnProperty.call(t, i) && o(e, t, i);
return a(e, t), e;
},
u =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(23), i(37)]),
void 0 ===
(s = function (t, e, a, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (a = l(a));
var n = (function (o) {
function t(t, e, i, n, s) {
var r = o.call(this, t, e, i, n, s) || this;
return (r.pivotX = 0), (r.pivotY = 0), r.setPipeline(a.default.getPipeline(a.PipelineList.PivotSkew)), r;
}
return (
h(t, o),
(t.prototype.setPivot = function (t, e) {
(this.pivotX = t), (this.pivotY = e);
}),
t
);
})((i = u(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r =
(this && this.__extends) ||
((s = function (t, e) {
return (s =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
s(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
});
void 0 ===
(n = function (t, e) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function (l) {
function t(t, e, i, n, s, r, o, a) {
void 0 === o && (o = "#ffffff"), void 0 === a && (a = "center");
var h = l.call(this, t, e, i, s, { fontFamily: n, fontSize: r + "px", color: o, align: a }) || this;
return (h.worldWrap = !1), Phaser.GameObjects.Text.prototype.updateText.call(h), h;
}
return (
r(t, l),
(t.prototype.setText = function (t) {
return l.prototype.setText.call(this, t), (this.maxWidth || this.maxHeight) && this.makeFontFit(), this;
}),
(t.prototype.setMaxSize = function (t, e, i) {
void 0 === e && (e = !1), void 0 === i && (i = 0), (this.maxWidth = t), (this.maxHeight = i), (this.worldWrap = e), this.makeFontFit();
}),
(t.prototype.makeFontFit = function () {
var t = this.getTextMetrics();
this.fontSize || (this.fontSize = t.fontSize);
var e = this.fontSize;
this.style.setFontSize(e);
var i = this.text;
for (!0 === this.worldWrap && l.prototype.setText.call(this, this.customBasicWordWrap(i, this.context, this.maxWidth)); this.width > this.maxWidth || (0 < this.maxHeight && this.height > this.maxHeight); )
(e -= 1), this.style.setFontSize(e);
}),
(t.prototype.customBasicWordWrap = function (t, e, i) {
for (var n = "", s = t.split(this.splitRegExp), r = s.length - 1, o = e.measureText(" ").width, a = 0; a <= r; a++) {
for (var h = i, l = s[a].split(" "), u = l.length - 1, c = 0; c <= u; c++) {
var d = l[c],
f = e.measureText(d).width,
p = f;
c < u && (p += o), h < p && 0 < c && ((n = n.slice(0, -1)), (n += "\n"), (h = i)), (n += d), c < u ? ((n += " "), (h -= p)) : (h -= f);
}
a < r && (n += "\n");
}
return n;
}),
t
);
})(Phaser.GameObjects.Text);
e.default = i;
}.apply(e, [i, e])) || (t.exports = n);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(6), i(3)]),
void 0 ===
(s = function (t, e, n, i, s) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (i = a(i));
var r = (function (s) {
function t(t, e, i) {
var n = s.call(this, t) || this;
return n.init(t, e, i), (n.hitBoxPolygon = new SAT.Box(new SAT.Vector(0, 0), 40, 40).toPolygon()), n.hitBoxPolygon.setOffset(new SAT.Vector(-20, -20)), (n.alive = !1), n;
}
return (
o(t, s),
(t.prototype.init = function (t, e, i) {
(this.sprite = new Phaser.GameObjects.Image(t, 0, 0, n.Atlases.gameplay, "coin instance 10000")), e.add(this.sprite), (this.sprite.visible = !1);
}),
(t.prototype.spawn = function (t, e) {
(this.xPos = t), (this.yPos = e), (this.sprite.visible = !0), (this.sprite.x = t), (this.sprite.y = e), (this.hitBoxPolygon.pos.x = t), (this.hitBoxPolygon.pos.y = e), (this.alive = !0);
}),
(t.prototype.collect = function () {
this.main.collectCoin(1), i.default.playSFX("starPickup"), this.die();
}),
(t.prototype.die = function () {
(this.alive = !1), (this.sprite.visible = !1);
}),
(t.prototype.reset = function () {}),
(t.prototype.resetLevel = function () {
(this.alive = !0), (this.sprite.visible = !0);
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), (this.hitBoxPolygon = null), s.prototype.destroy.call(this);
}),
t
);
})((s = a(s)).default);
e.default = r;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
l =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(154), i(155), i(40), i(156), i(41), i(157), i(158)]),
void 0 ===
(s = function (t, e, i, n, s, r, o, a, h) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }),
(e.FadeArrow = e.FadeText = e.BasicFade = e.ColorParticle = e.Particle = e.DeathText = e.Transition = void 0),
Object.defineProperty(e, "Transition", {
enumerable: !0,
get: function () {
return l(i).default;
},
}),
Object.defineProperty(e, "DeathText", {
enumerable: !0,
get: function () {
return l(n).default;
},
}),
Object.defineProperty(e, "Particle", {
enumerable: !0,
get: function () {
return l(s).default;
},
}),
Object.defineProperty(e, "ColorParticle", {
enumerable: !0,
get: function () {
return l(r).default;
},
}),
Object.defineProperty(e, "BasicFade", {
enumerable: !0,
get: function () {
return l(o).default;
},
}),
Object.defineProperty(e, "FadeText", {
enumerable: !0,
get: function () {
return l(a).default;
},
}),
Object.defineProperty(e, "FadeArrow", {
enumerable: !0,
get: function () {
return l(h).default;
},
});
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r =
(this && this.__extends) ||
((s = function (t, e) {
return (s =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
s(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
});
void 0 ===
(n = function (t, e) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function (s) {
function t(t, e, i) {
var n = s.call(this, t, e, i) || this;
return (n.isOver = !1), (n.currPointerID = -1), (n.soundDown = "button_click"), (n.soundUp = null), n;
}
return (
r(t, s),
(t.prototype.initEvents = function (t) {
t.setInteractive(),
(t.input.cursor = "pointer"),
t.on(Phaser.Input.Events.POINTER_DOWN, this.inputDown, this),
this.scene.input.on(Phaser.Input.Events.POINTER_UP, this.inputUp, this),
t.on(Phaser.Input.Events.POINTER_OUT, this.inputOut, this),
t.on(Phaser.Input.Events.POINTER_OVER, this.inputOver, this);
}),
(t.prototype.inputOut = function () {
this.isOver = !1;
}),
(t.prototype.inputOver = function () {
this.isOver = !0;
}),
(t.prototype.inputDown = function (t) {
(this.currPointerID = t.id), this.downState(), this.downComplete();
}),
(t.prototype.downState = function () {}),
(t.prototype.upState = function () {}),
(t.prototype.inputUp = function (t) {
0 <= this.currPointerID && this.upState(), !1 !== this.isOver && this.currPointerID === t.id ? ((this.currPointerID = -1), this.upComplete()) : (this.currPointerID = -1);
}),
(t.prototype.downComplete = function () {
this.onDown && this.onDown(), this.soundDown;
}),
(t.prototype.upComplete = function () {
this.onUp && this.onUp(), this.soundUp;
}),
(t.prototype.destroy = function () {
s.prototype.destroy.call(this), (this.onDown = null), (this.onUp = null);
}),
t
);
})(Phaser.GameObjects.Container);
e.default = i;
}.apply(e, [i, e])) || (t.exports = n);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(53)]),
void 0 ===
(s = function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
o(e, t),
(e.prototype.addImage = function (t, e, i, n, s, r) {
void 0 === i && (i = 0),
void 0 === n && (n = 0),
void 0 === s && (s = 1),
void 0 === r && (r = 1),
(this.image = new Phaser.GameObjects.Image(this.scene, i, n, t, e)),
(this.image.scaleX = s),
(this.image.scaleY = r),
this.add(this.image),
this.initEvents(this.image);
}),
(e.prototype.addImageNoEvents = function (t, e, i, n, s, r) {
void 0 === i && (i = 0),
void 0 === n && (n = 0),
void 0 === s && (s = 1),
void 0 === r && (r = 1),
(this.image2 = new Phaser.GameObjects.Image(this.scene, i, n, t, e)),
(this.image2.scaleX = s),
(this.image2.scaleY = r),
this.add(this.image2);
}),
(e.prototype.destroy = function () {
t.prototype.destroy.call(this), (this.image = null), (this.image2 = null);
}),
e
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
h =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(1), i(42)]),
void 0 ===
(s = function (t, e, a, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
o(e, t),
(e.prototype.addTxtTittle = function (t, e, i, n, s, r, o) {
void 0 === n && (n = "#ffffff"),
void 0 === s && (s = "center"),
void 0 === r && (r = 0),
void 0 === o && (o = 0),
(this.txtTittle = new a.JDTextTranslated(this.scene, r, o, e, t, i, n, s)),
this.txtTittle.setOrigin(0.5, 0.5),
this.add(this.txtTittle);
}),
(e.prototype.addTxtDop = function (t, e, i, n, s, r, o) {
void 0 === n && (n = "#ffffff"),
void 0 === s && (s = "center"),
void 0 === r && (r = 0),
void 0 === o && (o = 0),
(this.txtDop = new a.JDText(this.scene, r, o, e, t, i, n, s)),
this.txtDop.setOrigin(0.5, 0.5),
this.add(this.txtDop);
}),
(e.prototype.destroy = function () {
t.prototype.destroy.call(this), (this.txtTittle = null), (this.txtDop = null);
}),
e
);
})((i = h(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(5), i(1), i(19)]),
void 0 ===
(s = function (t, e, h, o, l, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (i = r(i));
var n = (function () {
function t(t, e, i, n, s, r) {
(this.rewardLocalize = "reward"), (this.parent = t), (this.id = e);
var o = t.scene.add.nineslice(i, n, 512, 512, { key: h.Atlases.ui, frame: "menu_box_inside instance 10000" }, 100, 30);
o.setOrigin(0.5, 0.5), o.resize(s, r), t.add(o);
}
return (
(t.prototype.createBtnReward = function (t, e, i, n, s) {
var r = this;
(this.btnReward = new o.ButtonText(this.parent.scene, t, e)),
this.btnReward.addImage(h.Atlases.ui, "btnGreen instance 10000", 0, 5, i, n),
this.btnReward.addTxtTranslated(this.rewardLocalize, h.Fonts.Main, 30, "#001977"),
(this.btnReward.onUp = function () {
return r.reward();
}),
this.btnReward.txt.setMaxSize(200),
this.parent.add(this.btnReward),
s <= 0 ? this.disableRewardBtn() : 2 === s && this.rewarded();
}),
(t.prototype.createTittleDes = function (t, e, i, n, s, r, o, a) {
(this.txtTitle = new l.JDTextTranslated(this.parent.scene, t, e, h.Fonts.Main, "dailyTaskTitle" + this.id, s)),
this.txtTitle.setOrigin(0, 0),
this.parent.add(this.txtTitle),
(this.txtDes = new l.JDText(this.parent.scene, i, n, h.Fonts.Main, o, r, "#ffffff", "left")),
this.txtDes.setOrigin(0, 0),
this.txtDes.setWordWrapWidth(a),
this.parent.add(this.txtDes);
}),
(t.prototype.createProgress = function (t, e, i, n, s) {
var r = new Phaser.GameObjects.Image(this.parent.scene, t, e - 20, h.Atlases.ui, "progressBg3 instance 10000");
(r.scaleX = i),
this.parent.add(r),
((r = new Phaser.GameObjects.Image(this.parent.scene, t, e - 20, h.Atlases.ui, "progress3 instance 10000")).scaleX = i),
this.parent.add(r),
(this.mask = new Phaser.GameObjects.Graphics(this.parent.scene)),
this.mask.fillStyle(16711680, 1),
this.mask.fillRect(0, -r.displayHeight / 2, r.displayWidth, r.displayHeight),
this.mask.setScrollFactor(0, 0),
(this.maskX = r.x - r.displayWidth / 2),
(this.maskY = r.y),
(this.maskScX = n / s),
(this.mask.scaleX = this.maskScX),
(r.mask = this.mask.createGeometryMask()),
(this.txtProgress = new l.JDText(this.parent.scene, t, e - 20, h.Fonts.Main, n + "/" + s, 18)),
this.txtProgress.setOrigin(0.5, 0.5),
this.parent.add(this.txtProgress);
}),
(t.prototype.reset = function () {
var t = i.default.getData(this.id);
(this.txtDes.text = t.des),
(this.txtProgress.text = t.curr + "/" + t.target),
(this.maskScX = 0),
(this.mask.scaleX = this.maskScX),
this.disableRewardBtn(),
(this.rewardLocalize = "reward"),
(this.btnReward.txt.text = this.rewardLocalize),
this.btnReward.image.setFrame("btnGreen instance 10000"),
(t = null);
}),
(t.prototype.reward = function () {
i.default.reward(this.id), this.rewarded();
}),
(t.prototype.rewarded = function () {
(this.rewardLocalize = "rewarded"), (this.btnReward.txt.text = this.rewardLocalize), this.btnReward.image.setFrame("btnOrange instance 10000"), this.disableRewardBtn(0.7);
}),
(t.prototype.enableRewardBtn = function () {
(this.btnReward.alpha = 1), (this.btnReward.image.input.enabled = !0);
}),
(t.prototype.disableRewardBtn = function (t) {
void 0 === t && (t = 0.5), (this.btnReward.alpha = t), (this.btnReward.image.input.enabled = !1);
}),
(t.prototype.resize = function () {
var t = this.parent.scene,
e = t.ZOOM_UI_SCALE;
(this.mask.scaleX = this.maskScX * e), (this.mask.scaleY = e), (this.mask.x = t.guiX + (this.parent.x + this.maskX) * e), (this.mask.y = t.guiY + (this.parent.y + this.maskY) * e);
}),
(t.prototype.destroy = function () {
this.mask.destroy(), (this.mask = null), (this.btnReward = null), (this.parent = null), (this.txtProgress = null), (this.txtTitle = null), (this.txtDes = null);
}),
t
);
})();
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(195), i(196), i(197), i(198), i(199)]),
void 0 ===
(s = function (t, e, i, n, s, r, o) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }),
(e.EffectStars = e.SkinSlot = e.SkinRarityEquip = e.SkinRaritySpin = e.SkinRarity = void 0),
Object.defineProperty(e, "SkinRarity", {
enumerable: !0,
get: function () {
return a(i).default;
},
}),
Object.defineProperty(e, "SkinRaritySpin", {
enumerable: !0,
get: function () {
return a(n).default;
},
}),
Object.defineProperty(e, "SkinRarityEquip", {
enumerable: !0,
get: function () {
return a(s).default;
},
}),
Object.defineProperty(e, "SkinSlot", {
enumerable: !0,
get: function () {
return a(r).default;
},
}),
Object.defineProperty(e, "EffectStars", {
enumerable: !0,
get: function () {
return a(o).default;
},
});
}.apply(e, n)) || (t.exports = s);
},
function (e, t, i) {
(function (t) {
e.exports = t.Phaser = i(209);
}.call(this, i(208)));
},
function (t, e, i) {
"use strict";
function N(t) {
return (N =
"function" == typeof Symbol && "symbol" == typeof Symbol.iterator
? function (t) {
return typeof t;
}
: function (t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
})(t);
}
i.r(e),
i.d(e, "changeLanguage", function () {
return ut;
}),
i.d(e, "createInstance", function () {
return rt;
}),
i.d(e, "exists", function () {
return ft;
}),
i.d(e, "getFixedT", function () {
return ct;
}),
i.d(e, "hasLoadedNamespace", function () {
return gt;
}),
i.d(e, "init", function () {
return ot;
}),
i.d(e, "loadLanguages", function () {
return yt;
}),
i.d(e, "loadNamespaces", function () {
return vt;
}),
i.d(e, "loadResources", function () {
return at;
}),
i.d(e, "reloadResources", function () {
return ht;
}),
i.d(e, "setDefaultNamespace", function () {
return pt;
}),
i.d(e, "t", function () {
return dt;
}),
i.d(e, "use", function () {
return lt;
});
var a = i(13),
h = i(14);
function l(t) {
if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return t;
}
function n(t, e) {
return (n =
Object.setPrototypeOf ||
function (t, e) {
return (t.__proto__ = e), t;
})(t, e);
}
function u(t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
(t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } })), Object.defineProperty(t, "prototype", { writable: !1 }), e && n(t, e);
}
function c(t, e) {
if (e && ("object" === N(e) || "function" == typeof e)) return e;
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
return l(t);
}
function d(t) {
return (d = Object.setPrototypeOf
? Object.getPrototypeOf
: function (t) {
return t.__proto__ || Object.getPrototypeOf(t);
})(t);
}
function s(t, e, i) {
return e in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : (t[e] = i), t;
}
function f(t, e) {
(null == e || e > t.length) && (e = t.length);
for (var i = 0, n = new Array(e); i < e; i++) n[i] = t[i];
return n;
}
function r(e, t) {
var i = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var n = Object.getOwnPropertySymbols(e);
t &&
(n = n.filter(function (t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable;
})),
i.push.apply(i, n);
}
return i;
}
function o(e) {
for (var t = 1; t < arguments.length; t++) {
var i = null != arguments[t] ? arguments[t] : {};
t % 2
? r(Object(i), !0).forEach(function (t) {
s(e, t, i[t]);
})
: Object.getOwnPropertyDescriptors
? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i))
: r(Object(i)).forEach(function (t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(i, t));
});
}
return e;
}
var p = {
type: "logger",
log: function (t) {
this.output("log", t);
},
warn: function (t) {
this.output("warn", t);
},
error: function (t) {
this.output("error", t);
},
output: function (t, e) {
console && console[t];
},
},
g = new ((function () {
function i(t) {
var e = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {};
Object(a.a)(this, i), this.init(t, e);
}
return (
Object(h.a)(i, [
{
key: "init",
value: function (t) {
var e = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {};
(this.prefix = e.prefix || "i18next:"), (this.logger = t || p), (this.options = e), (this.debug = e.debug);
},
},
{
key: "setDebug",
value: function (t) {
this.debug = t;
},
},
{
key: "log",
value: function () {
for (var t = arguments.length, e = new Array(t), i = 0; i < t; i++) e[i] = arguments[i];
return this.forward(e, "log", "", !0);
},
},
{
key: "warn",
value: function () {
for (var t = arguments.length, e = new Array(t), i = 0; i < t; i++) e[i] = arguments[i];
return this.forward(e, "warn", "", !0);
},
},
{
key: "error",
value: function () {
for (var t = arguments.length, e = new Array(t), i = 0; i < t; i++) e[i] = arguments[i];
return this.forward(e, "error", "");
},
},
{
key: "deprecate",
value: function () {
for (var t = arguments.length, e = new Array(t), i = 0; i < t; i++) e[i] = arguments[i];
return this.forward(e, "warn", "WARNING DEPRECATED: ", !0);
},
},
{
key: "forward",
value: function (t, e, i, n) {
return n && !this.debug ? null : ("string" == typeof t[0] && (t[0] = "".concat(i).concat(this.prefix, " ").concat(t[0])), this.logger[e](t));
},
},
{
key: "create",
value: function (t) {
return new i(this.logger, o(o({}, { prefix: "".concat(this.prefix, ":").concat(t, ":") }), this.options));
},
},
]),
i
);
})())(),
v = (function () {
function t() {
Object(a.a)(this, t), (this.observers = {});
}
return (
Object(h.a)(t, [
{
key: "on",
value: function (t, e) {
var i = this;
return (
t.split(" ").forEach(function (t) {
(i.observers[t] = i.observers[t] || []), i.observers[t].push(e);
}),
this
);
},
},
{
key: "off",
value: function (t, e) {
this.observers[t] &&
(e
? (this.observers[t] = this.observers[t].filter(function (t) {
return t !== e;
}))
: delete this.observers[t]);
},
},
{
key: "emit",
value: function (e) {
for (var t = arguments.length, i = new Array(1 < t ? t - 1 : 0), n = 1; n < t; n++) i[n - 1] = arguments[n];
this.observers[e] &&
[].concat(this.observers[e]).forEach(function (t) {
t.apply(void 0, i);
});
this.observers["*"] &&
[].concat(this.observers["*"]).forEach(function (t) {
t.apply(t, [e].concat(i));
});
},
},
]),
t
);
})();
function y() {
var i,
n,
t = new Promise(function (t, e) {
(i = t), (n = e);
});
return (t.resolve = i), (t.reject = n), t;
}
function m(t) {
return null == t ? "" : "" + t;
}
function x(t, e, i) {
function n(t) {
return t && -1 < t.indexOf("###") ? t.replace(/###/g, ".") : t;
}
function s() {
return !t || "string" == typeof t;
}
for (var r = "string" != typeof e ? [].concat(e) : e.split("."); 1 < r.length; ) {
if (s()) return {};
var o = n(r.shift());
!t[o] && i && (t[o] = new i()), (t = Object.prototype.hasOwnProperty.call(t, o) ? t[o] : {});
}
return s() ? {} : { obj: t, k: n(r.shift()) };
}
function b(t, e, i) {
var n = x(t, e, Object);
n.obj[n.k] = i;
}
function w(t, e) {
var i = x(t, e),
n = i.obj,
s = i.k;
if (n) return n[s];
}
function T(t, e, i) {
var n = w(t, i);
return void 0 !== n ? n : w(e, i);
}
function S(t) {
return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
}
var _ = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'", "/": "/" };
function E(t) {
return "string" == typeof t
? t.replace(/[&<>"'\/]/g, function (t) {
return _[t];
})
: t;
}
var P = "undefined" != typeof window && window.navigator && window.navigator.userAgent && -1 < window.navigator.userAgent.indexOf("MSIE"),
A = [" ", ",", "?", "!", ";"];
function M(e, t) {
var i = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var n = Object.getOwnPropertySymbols(e);
t &&
(n = n.filter(function (t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable;
})),
i.push.apply(i, n);
}
return i;
}
function C(e) {
for (var t = 1; t < arguments.length; t++) {
var i = null != arguments[t] ? arguments[t] : {};
t % 2
? M(Object(i), !0).forEach(function (t) {
s(e, t, i[t]);
})
: Object.getOwnPropertyDescriptors
? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i))
: M(Object(i)).forEach(function (t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(i, t));
});
}
return e;
}
var O = (function (t) {
u(o, v);
var n,
s,
r =
((n = o),
(s = (function () {
if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
if (Reflect.construct.sham) return !1;
if ("function" == typeof Proxy) return !0;
try {
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), !0;
} catch (t) {
return !1;
}
})()),
function () {
var t,
e = d(n);
if (s) {
var i = d(this).constructor;
t = Reflect.construct(e, arguments, i);
} else t = e.apply(this, arguments);
return c(this, t);
});
function o(t) {
var e,
i = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : { ns: ["translation"], defaultNS: "translation" };
return (
Object(a.a)(this, o),
(e = r.call(this)),
P && v.call(l(e)),
(e.data = t || {}),
(e.options = i),
void 0 === e.options.keySeparator && (e.options.keySeparator = "."),
void 0 === e.options.ignoreJSONStructure && (e.options.ignoreJSONStructure = !0),
e
);
}
return (
Object(h.a)(o, [
{
key: "addNamespaces",
value: function (t) {
this.options.ns.indexOf(t) < 0 && this.options.ns.push(t);
},
},
{
key: "removeNamespaces",
value: function (t) {
var e = this.options.ns.indexOf(t);
-1 < e && this.options.ns.splice(e, 1);
},
},
{
key: "getResource",
value: function (t, e, i) {
var n = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : {},
s = void 0 !== n.keySeparator ? n.keySeparator : this.options.keySeparator,
r = void 0 !== n.ignoreJSONStructure ? n.ignoreJSONStructure : this.options.ignoreJSONStructure,
o = [t, e];
i && "string" != typeof i && (o = o.concat(i)), i && "string" == typeof i && (o = o.concat(s ? i.split(s) : i)), -1 < t.indexOf(".") && (o = t.split("."));
var a = w(this.data, o);
return a || !r || "string" != typeof i
? a
: (function t(e, i) {
var n = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : ".";
if (e) {
if (e[i]) return e[i];
for (var s = i.split(n), r = e, o = 0; o < s.length; ++o) {
if (!r) return;
if ("string" == typeof r[s[o]] && o + 1 < s.length) return;
if (void 0 === r[s[o]]) {
for (var a = 2, h = s.slice(o, o + a).join(n), l = r[h]; void 0 === l && s.length > o + a; ) a++, (l = r[(h = s.slice(o, o + a).join(n))]);
if (void 0 === l) return;
if (i.endsWith(h)) {
if ("string" == typeof l) return l;
if (h && "string" == typeof l[h]) return l[h];
}
var u = s.slice(o + a).join(n);
return u ? t(l, u, n) : void 0;
}
r = r[s[o]];
}
return r;
}
})(this.data && this.data[t] && this.data[t][e], i, s);
},
},
{
key: "addResource",
value: function (t, e, i, n) {
var s = 4 < arguments.length && void 0 !== arguments[4] ? arguments[4] : { silent: !1 },
r = this.options.keySeparator;
void 0 === r && (r = ".");
var o = [t, e];
i && (o = o.concat(r ? i.split(r) : i)), -1 < t.indexOf(".") && ((n = e), (e = (o = t.split("."))[1])), this.addNamespaces(e), b(this.data, o, n), s.silent || this.emit("added", t, e, i, n);
},
},
{
key: "addResources",
value: function (t, e, i) {
var n = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : { silent: !1 };
for (var s in i) ("string" != typeof i[s] && "[object Array]" !== Object.prototype.toString.apply(i[s])) || this.addResource(t, e, s, i[s], { silent: !0 });
n.silent || this.emit("added", t, e, i);
},
},
{
key: "addResourceBundle",
value: function (t, e, i, n, s) {
var r = 5 < arguments.length && void 0 !== arguments[5] ? arguments[5] : { silent: !1 },
o = [t, e];
-1 < t.indexOf(".") && ((n = i), (i = e), (e = (o = t.split("."))[1])), this.addNamespaces(e);
var a = w(this.data, o) || {};
n
? (function t(e, i, n) {
for (var s in i)
"__proto__" !== s &&
"constructor" !== s &&
(s in e ? ("string" == typeof e[s] || e[s] instanceof String || "string" == typeof i[s] || i[s] instanceof String ? n && (e[s] = i[s]) : t(e[s], i[s], n)) : (e[s] = i[s]));
return e;
})(a, i, s)
: (a = C(C({}, a), i)),
b(this.data, o, a),
r.silent || this.emit("added", t, e, i);
},
},
{
key: "removeResourceBundle",
value: function (t, e) {
this.hasResourceBundle(t, e) && delete this.data[t][e], this.removeNamespaces(e), this.emit("removed", t, e);
},
},
{
key: "hasResourceBundle",
value: function (t, e) {
return void 0 !== this.getResource(t, e);
},
},
{
key: "getResourceBundle",
value: function (t, e) {
return e || (e = this.options.defaultNS), "v1" === this.options.compatibilityAPI ? C(C({}, {}), this.getResource(t, e)) : this.getResource(t, e);
},
},
{
key: "getDataByLanguage",
value: function (t) {
return this.data[t];
},
},
{
key: "hasLanguageSomeTranslations",
value: function (t) {
var e = this.getDataByLanguage(t);
return !!((e && Object.keys(e)) || []).find(function (t) {
return e[t] && 0 < Object.keys(e[t]).length;
});
},
},
{
key: "toJSON",
value: function () {
return this.data;
},
},
]),
o
);
})(),
k = {
processors: {},
addPostProcessor: function (t) {
this.processors[t.name] = t;
},
handle: function (t, e, i, n, s) {
var r = this;
return (
t.forEach(function (t) {
r.processors[t] && (e = r.processors[t].process(e, i, n, s));
}),
e
);
},
};
function R(e, t) {
var i = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var n = Object.getOwnPropertySymbols(e);
t &&
(n = n.filter(function (t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable;
})),
i.push.apply(i, n);
}
return i;
}
function U(e) {
for (var t = 1; t < arguments.length; t++) {
var i = null != arguments[t] ? arguments[t] : {};
t % 2
? R(Object(i), !0).forEach(function (t) {
s(e, t, i[t]);
})
: Object.getOwnPropertyDescriptors
? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i))
: R(Object(i)).forEach(function (t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(i, t));
});
}
return e;
}
var L = {},
I = (function (t) {
u(B, v);
var n,
s,
o =
((n = B),
(s = (function () {
if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
if (Reflect.construct.sham) return !1;
if ("function" == typeof Proxy) return !0;
try {
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), !0;
} catch (t) {
return !1;
}
})()),
function () {
var t,
e = d(n);
if (s) {
var i = d(this).constructor;
t = Reflect.construct(e, arguments, i);
} else t = e.apply(this, arguments);
return c(this, t);
});
function B(t) {
var e,
i,
n,
s,
r = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {};
return (
Object(a.a)(this, B),
(e = o.call(this)),
P && v.call(l(e)),
(i = ["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"]),
(n = t),
(s = l(e)),
i.forEach(function (t) {
n[t] && (s[t] = n[t]);
}),
(e.options = r),
void 0 === e.options.keySeparator && (e.options.keySeparator = "."),
(e.logger = g.create("translator")),
e
);
}
return (
Object(h.a)(
B,
[
{
key: "changeLanguage",
value: function (t) {
t && (this.language = t);
},
},
{
key: "exists",
value: function (t) {
var e = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : { interpolation: {} };
if (null == t) return !1;
var i = this.resolve(t, e);
return i && void 0 !== i.res;
},
},
{
key: "extractFromKey",
value: function (t, e) {
var i = void 0 !== e.nsSeparator ? e.nsSeparator : this.options.nsSeparator;
void 0 === i && (i = ":");
var n = void 0 !== e.keySeparator ? e.keySeparator : this.options.keySeparator,
s = e.ns || this.options.defaultNS || [],
r = i && -1 < t.indexOf(i),
o = !(
this.options.userDefinedKeySeparator ||
e.keySeparator ||
this.options.userDefinedNsSeparator ||
e.nsSeparator ||
(function (t, e, i) {
(e = e || ""), (i = i || "");
var n = A.filter(function (t) {
return e.indexOf(t) < 0 && i.indexOf(t) < 0;
});
if (0 === n.length) return !0;
var s = new RegExp(
"(".concat(
n
.map(function (t) {
return "?" === t ? "\\?" : t;
})
.join("|"),
")"
)
),
r = !s.test(t);
if (!r) {
var o = t.indexOf(i);
0 < o && !s.test(t.substring(0, o)) && (r = !0);
}
return r;
})(t, i, n)
);
if (r && !o) {
var a = t.match(this.interpolator.nestingRegexp);
if (a && 0 < a.length) return { key: t, namespaces: s };
var h = t.split(i);
(i !== n || (i === n && -1 < this.options.ns.indexOf(h[0]))) && (s = h.shift()), (t = h.join(n));
}
return "string" == typeof s && (s = [s]), { key: t, namespaces: s };
},
},
{
key: "translate",
value: function (t, s, e) {
var r = this;
if (("object" !== N(s) && this.options.overloadTranslationOptionHandler && (s = this.options.overloadTranslationOptionHandler(arguments)), s || (s = {}), null == t)) return "";
Array.isArray(t) || (t = [String(t)]);
var i = void 0 !== s.keySeparator ? s.keySeparator : this.options.keySeparator,
n = this.extractFromKey(t[t.length - 1], s),
o = n.key,
a = n.namespaces,
h = a[a.length - 1],
l = s.lng || this.language,
u = s.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
if (l && "cimode" === l.toLowerCase()) {
if (u) {
var c = s.nsSeparator || this.options.nsSeparator;
return h + c + o;
}
return o;
}
var d = this.resolve(t, s),
f = d && d.res,
p = (d && d.usedKey) || o,
g = (d && d.exactUsedKey) || o,
v = Object.prototype.toString.apply(f),
y = void 0 !== s.joinArrays ? s.joinArrays : this.options.joinArrays,
m = !this.i18nFormat || this.i18nFormat.handleAsObject;
if (
m &&
f &&
"string" != typeof f &&
"boolean" != typeof f &&
"number" != typeof f &&
["[object Number]", "[object Function]", "[object RegExp]"].indexOf(v) < 0 &&
("string" != typeof y || "[object Array]" !== v)
) {
if (!s.returnObjects && !this.options.returnObjects)
return (
this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!"),
this.options.returnedObjectHandler
? this.options.returnedObjectHandler(p, f, U(U({}, s), {}, { ns: a }))
: "key '".concat(o, " (").concat(this.language, ")' returned an object instead of string.")
);
if (i) {
var x = "[object Array]" === v,
b = x ? [] : {},
w = x ? g : p;
for (var T in f)
if (Object.prototype.hasOwnProperty.call(f, T)) {
var S = "".concat(w).concat(i).concat(T);
(b[T] = this.translate(S, U(U({}, s), { joinArrays: !1, ns: a }))), b[T] === S && (b[T] = f[T]);
}
f = b;
}
} else if (m && "string" == typeof y && "[object Array]" === v) (f = f.join(y)) && (f = this.extendTranslation(f, t, s, e));
else {
var _ = !1,
E = !1,
P = void 0 !== s.count && "string" != typeof s.count,
A = B.hasDefaultValue(s),
M = P ? this.pluralResolver.getSuffix(l, s.count, s) : "",
C = s["defaultValue".concat(M)] || s.defaultValue;
!this.isValidLookup(f) && A && ((_ = !0), (f = C)), this.isValidLookup(f) || ((E = !0), (f = o));
var O = (s.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && E ? void 0 : f,
k = A && C !== f && this.options.updateMissing;
if (E || _ || k) {
if ((this.logger.log(k ? "updateKey" : "missingKey", l, h, o, k ? C : f), i)) {
var R = this.resolve(o, U(U({}, s), {}, { keySeparator: !1 }));
R &&
R.res &&
this.logger.warn(
"Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format."
);
}
var L = [],
I = this.languageUtils.getFallbackCodes(this.options.fallbackLng, s.lng || this.language);
if ("fallback" === this.options.saveMissingTo && I && I[0]) for (var D = 0; D < I.length; D++) L.push(I[D]);
else "all" === this.options.saveMissingTo ? (L = this.languageUtils.toResolveHierarchy(s.lng || this.language)) : L.push(s.lng || this.language);
var F = function (t, e, i) {
var n = A && i !== f ? i : O;
r.options.missingKeyHandler ? r.options.missingKeyHandler(t, h, e, n, k, s) : r.backendConnector && r.backendConnector.saveMissing && r.backendConnector.saveMissing(t, h, e, n, k, s),
r.emit("missingKey", t, h, e, f);
};
this.options.saveMissing &&
(this.options.saveMissingPlurals && P
? L.forEach(function (e) {
r.pluralResolver.getSuffixes(e).forEach(function (t) {
F([e], o + t, s["defaultValue".concat(t)] || C);
});
})
: F(L, o, C));
}
(f = this.extendTranslation(f, t, s, d, e)),
E && f === o && this.options.appendNamespaceToMissingKey && (f = "".concat(h, ":").concat(o)),
(E || _) && this.options.parseMissingKeyHandler && (f = this.options.parseMissingKeyHandler(f));
}
return f;
},
},
{
key: "extendTranslation",
value: function (t, n, s, e, r) {
var o = this;
if (this.i18nFormat && this.i18nFormat.parse) t = this.i18nFormat.parse(t, s, e.usedLng, e.usedNS, e.usedKey, { resolved: e });
else if (!s.skipInterpolation) {
s.interpolation && this.interpolator.init(U(U({}, s), { interpolation: U(U({}, this.options.interpolation), s.interpolation) }));
var i,
a = "string" == typeof t && (s && s.interpolation && void 0 !== s.interpolation.skipOnVariables ? s.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
if (a) {
var h = t.match(this.interpolator.nestingRegexp);
i = h && h.length;
}
var l = s.replace && "string" != typeof s.replace ? s.replace : s;
if ((this.options.interpolation.defaultVariables && (l = U(U({}, this.options.interpolation.defaultVariables), l)), (t = this.interpolator.interpolate(t, l, s.lng || this.language, s)), a)) {
var u = t.match(this.interpolator.nestingRegexp);
i < (u && u.length) && (s.nest = !1);
}
!1 !== s.nest &&
(t = this.interpolator.nest(
t,
function () {
for (var t = arguments.length, e = new Array(t), i = 0; i < t; i++) e[i] = arguments[i];
return r && r[0] === e[0] && !s.context
? (o.logger.warn("It seems you are nesting recursively key: ".concat(e[0], " in key: ").concat(n[0])), null)
: o.translate.apply(o, e.concat([n]));
},
s
)),
s.interpolation && this.interpolator.reset();
}
var c = s.postProcess || this.options.postProcess,
d = "string" == typeof c ? [c] : c;
return null != t && d && d.length && !1 !== s.applyPostProcessor && (t = k.handle(d, t, n, this.options && this.options.postProcessPassResolved ? U({ i18nResolved: e }, s) : s, this)), t;
},
},
{
key: "resolve",
value: function (t) {
var u,
s,
c,
d,
f,
p = this,
g = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {};
return (
"string" == typeof t && (t = [t]),
t.forEach(function (t) {
if (!p.isValidLookup(u)) {
var e = p.extractFromKey(t, g),
o = e.key;
s = o;
var i = e.namespaces;
p.options.fallbackNS && (i = i.concat(p.options.fallbackNS));
var a = void 0 !== g.count && "string" != typeof g.count,
h = a && !g.ordinal && 0 === g.count && p.pluralResolver.shouldUseIntlApi(),
l = void 0 !== g.context && ("string" == typeof g.context || "number" == typeof g.context) && "" !== g.context,
n = g.lngs ? g.lngs : p.languageUtils.toResolveHierarchy(g.lng || p.language, g.fallbackLng);
i.forEach(function (r) {
p.isValidLookup(u) ||
((f = r),
!L["".concat(n[0], "-").concat(r)] &&
p.utils &&
p.utils.hasLoadedNamespace &&
!p.utils.hasLoadedNamespace(f) &&
((L["".concat(n[0], "-").concat(r)] = !0),
p.logger.warn(
'key "'.concat(s, '" for languages "').concat(n.join(", "), '" won\'t get resolved as namespace "').concat(f, '" was not yet loaded'),
"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"
)),
n.forEach(function (t) {
if (!p.isValidLookup(u)) {
d = t;
var e,
i,
n = [o];
if (p.i18nFormat && p.i18nFormat.addLookupKeys) p.i18nFormat.addLookupKeys(n, o, t, r, g);
else if ((a && (i = p.pluralResolver.getSuffix(t, g.count, g)), a && (n.push(o + i), h && n.push(o + "_zero")), l)) {
var s = "".concat(o).concat(p.options.contextSeparator).concat(g.context);
n.push(s), a && (n.push(s + i), h && n.push(s + "_zero"));
}
for (; (e = n.pop()); ) p.isValidLookup(u) || ((c = e), (u = p.getResource(t, r, e, g)));
}
}));
});
}
}),
{ res: u, usedKey: s, exactUsedKey: c, usedLng: d, usedNS: f }
);
},
},
{
key: "isValidLookup",
value: function (t) {
return !(void 0 === t || (!this.options.returnNull && null === t) || (!this.options.returnEmptyString && "" === t));
},
},
{
key: "getResource",
value: function (t, e, i) {
var n = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : {};
return this.i18nFormat && this.i18nFormat.getResource ? this.i18nFormat.getResource(t, e, i, n) : this.resourceStore.getResource(t, e, i, n);
},
},
],
[
{
key: "hasDefaultValue",
value: function (t) {
for (var e in t) if (Object.prototype.hasOwnProperty.call(t, e) && "defaultValue" === e.substring(0, "defaultValue".length) && void 0 !== t[e]) return !0;
return !1;
},
},
]
),
B
);
})();
function D(t) {
return t.charAt(0).toUpperCase() + t.slice(1);
}
var F = (function () {
function e(t) {
Object(a.a)(this, e), (this.options = t), (this.supportedLngs = this.options.supportedLngs || !1), (this.logger = g.create("languageUtils"));
}
return (
Object(h.a)(e, [
{
key: "getScriptPartFromCode",
value: function (t) {
if (!t || t.indexOf("-") < 0) return null;
var e = t.split("-");
return 2 === e.length ? null : (e.pop(), "x" === e[e.length - 1].toLowerCase() ? null : this.formatLanguageCode(e.join("-")));
},
},
{
key: "getLanguagePartFromCode",
value: function (t) {
if (!t || t.indexOf("-") < 0) return t;
var e = t.split("-");
return this.formatLanguageCode(e[0]);
},
},
{
key: "formatLanguageCode",
value: function (t) {
if ("string" == typeof t && -1 < t.indexOf("-")) {
var e = ["hans", "hant", "latn", "cyrl", "cans", "mong", "arab"],
i = t.split("-");
return (
this.options.lowerCaseLng
? (i = i.map(function (t) {
return t.toLowerCase();
}))
: 2 === i.length
? ((i[0] = i[0].toLowerCase()), (i[1] = i[1].toUpperCase()), -1 < e.indexOf(i[1].toLowerCase()) && (i[1] = D(i[1].toLowerCase())))
: 3 === i.length &&
((i[0] = i[0].toLowerCase()),
2 === i[1].length && (i[1] = i[1].toUpperCase()),
"sgn" !== i[0] && 2 === i[2].length && (i[2] = i[2].toUpperCase()),
-1 < e.indexOf(i[1].toLowerCase()) && (i[1] = D(i[1].toLowerCase())),
-1 < e.indexOf(i[2].toLowerCase()) && (i[2] = D(i[2].toLowerCase()))),
i.join("-")
);
}
return this.options.cleanCode || this.options.lowerCaseLng ? t.toLowerCase() : t;
},
},
{
key: "isSupportedCode",
value: function (t) {
return (
("languageOnly" === this.options.load || this.options.nonExplicitSupportedLngs) && (t = this.getLanguagePartFromCode(t)),
!this.supportedLngs || !this.supportedLngs.length || -1 < this.supportedLngs.indexOf(t)
);
},
},
{
key: "getBestMatchFromCodes",
value: function (t) {
var i,
n = this;
return t
? (t.forEach(function (t) {
if (!i) {
var e = n.formatLanguageCode(t);
(n.options.supportedLngs && !n.isSupportedCode(e)) || (i = e);
}
}),
!i &&
this.options.supportedLngs &&
t.forEach(function (t) {
if (!i) {
var e = n.getLanguagePartFromCode(t);
if (n.isSupportedCode(e)) return (i = e);
i = n.options.supportedLngs.find(function (t) {
if (0 === t.indexOf(e)) return t;
});
}
}),
i || (i = this.getFallbackCodes(this.options.fallbackLng)[0]),
i)
: null;
},
},
{
key: "getFallbackCodes",
value: function (t, e) {
if (!t) return [];
if (("function" == typeof t && (t = t(e)), "string" == typeof t && (t = [t]), "[object Array]" === Object.prototype.toString.apply(t))) return t;
if (!e) return t.default || [];
var i = t[e];
return i || (i = t[this.getScriptPartFromCode(e)]), i || (i = t[this.formatLanguageCode(e)]), i || (i = t[this.getLanguagePartFromCode(e)]), i || (i = t.default), i || [];
},
},
{
key: "toResolveHierarchy",
value: function (t, e) {
var i = this,
n = this.getFallbackCodes(e || this.options.fallbackLng || [], t),
s = [],
r = function (t) {
t && (i.isSupportedCode(t) ? s.push(t) : i.logger.warn("rejecting language code not found in supportedLngs: ".concat(t)));
};
return (
"string" == typeof t && -1 < t.indexOf("-")
? ("languageOnly" !== this.options.load && r(this.formatLanguageCode(t)),
"languageOnly" !== this.options.load && "currentOnly" !== this.options.load && r(this.getScriptPartFromCode(t)),
"currentOnly" !== this.options.load && r(this.getLanguagePartFromCode(t)))
: "string" == typeof t && r(this.formatLanguageCode(t)),
n.forEach(function (t) {
s.indexOf(t) < 0 && r(i.formatLanguageCode(t));
}),
s
);
},
},
]),
e
);
})(),
B = [
{ lngs: ["ach", "ak", "am", "arn", "br", "fil", "gun", "ln", "mfe", "mg", "mi", "oc", "pt", "pt-BR", "tg", "tl", "ti", "tr", "uz", "wa"], nr: [1, 2], fc: 1 },
{
lngs: [
"af",
"an",
"ast",
"az",
"bg",
"bn",
"ca",
"da",
"de",
"dev",
"el",
"en",
"eo",
"es",
"et",
"eu",
"fi",
"fo",
"fur",
"fy",
"gl",
"gu",
"ha",
"hi",
"hu",
"hy",
"ia",
"it",
"kk",
"kn",
"ku",
"lb",
"mai",
"ml",
"mn",
"mr",
"nah",
"nap",
"nb",
"ne",
"nl",
"nn",
"no",
"nso",
"pa",
"pap",
"pms",
"ps",
"pt-PT",
"rm",
"sco",
"se",
"si",
"so",
"son",
"sq",
"sv",
"sw",
"ta",
"te",
"tk",
"ur",
"yo",
],
nr: [1, 2],
fc: 2,
},
{ lngs: ["ay", "bo", "cgg", "fa", "ht", "id", "ja", "jbo", "ka", "km", "ko", "ky", "lo", "ms", "sah", "su", "th", "tt", "ug", "vi", "wo", "zh"], nr: [1], fc: 3 },
{ lngs: ["be", "bs", "cnr", "dz", "hr", "ru", "sr", "uk"], nr: [1, 2, 5], fc: 4 },
{ lngs: ["ar"], nr: [0, 1, 2, 3, 11, 100], fc: 5 },
{ lngs: ["cs", "sk"], nr: [1, 2, 5], fc: 6 },
{ lngs: ["csb", "pl"], nr: [1, 2, 5], fc: 7 },
{ lngs: ["cy"], nr: [1, 2, 3, 8], fc: 8 },
{ lngs: ["fr"], nr: [1, 2], fc: 9 },
{ lngs: ["ga"], nr: [1, 2, 3, 7, 11], fc: 10 },
{ lngs: ["gd"], nr: [1, 2, 3, 20], fc: 11 },
{ lngs: ["is"], nr: [1, 2], fc: 12 },
{ lngs: ["jv"], nr: [0, 1], fc: 13 },
{ lngs: ["kw"], nr: [1, 2, 3, 4], fc: 14 },
{ lngs: ["lt"], nr: [1, 2, 10], fc: 15 },
{ lngs: ["lv"], nr: [1, 2, 0], fc: 16 },
{ lngs: ["mk"], nr: [1, 2], fc: 17 },
{ lngs: ["mnk"], nr: [0, 1, 2], fc: 18 },
{ lngs: ["mt"], nr: [1, 2, 11, 20], fc: 19 },
{ lngs: ["or"], nr: [2, 1], fc: 2 },
{ lngs: ["ro"], nr: [1, 2, 20], fc: 20 },
{ lngs: ["sl"], nr: [5, 1, 2, 3], fc: 21 },
{ lngs: ["he", "iw"], nr: [1, 2, 20, 21], fc: 22 },
],
Y = {
1: function (t) {
return Number(1 < t);
},
2: function (t) {
return Number(1 != t);
},
3: function (t) {
return 0;
},
4: function (t) {
return Number(t % 10 == 1 && t % 100 != 11 ? 0 : 2 <= t % 10 && t % 10 <= 4 && (t % 100 < 10 || 20 <= t % 100) ? 1 : 2);
},
5: function (t) {
return Number(0 == t ? 0 : 1 == t ? 1 : 2 == t ? 2 : 3 <= t % 100 && t % 100 <= 10 ? 3 : 11 <= t % 100 ? 4 : 5);
},
6: function (t) {
return Number(1 == t ? 0 : 2 <= t && t <= 4 ? 1 : 2);
},
7: function (t) {
return Number(1 == t ? 0 : 2 <= t % 10 && t % 10 <= 4 && (t % 100 < 10 || 20 <= t % 100) ? 1 : 2);
},
8: function (t) {
return Number(1 == t ? 0 : 2 == t ? 1 : 8 != t && 11 != t ? 2 : 3);
},
9: function (t) {
return Number(2 <= t);
},
10: function (t) {
return Number(1 == t ? 0 : 2 == t ? 1 : t < 7 ? 2 : t < 11 ? 3 : 4);
},
11: function (t) {
return Number(1 == t || 11 == t ? 0 : 2 == t || 12 == t ? 1 : 2 < t && t < 20 ? 2 : 3);
},
12: function (t) {
return Number(t % 10 != 1 || t % 100 == 11);
},
13: function (t) {
return Number(0 !== t);
},
14: function (t) {
return Number(1 == t ? 0 : 2 == t ? 1 : 3 == t ? 2 : 3);
},
15: function (t) {
return Number(t % 10 == 1 && t % 100 != 11 ? 0 : 2 <= t % 10 && (t % 100 < 10 || 20 <= t % 100) ? 1 : 2);
},
16: function (t) {
return Number(t % 10 == 1 && t % 100 != 11 ? 0 : 0 !== t ? 1 : 2);
},
17: function (t) {
return Number(1 == t || (t % 10 == 1 && t % 100 != 11) ? 0 : 1);
},
18: function (t) {
return Number(0 == t ? 0 : 1 == t ? 1 : 2);
},
19: function (t) {
return Number(1 == t ? 0 : 0 == t || (1 < t % 100 && t % 100 < 11) ? 1 : 10 < t % 100 && t % 100 < 20 ? 2 : 3);
},
20: function (t) {
return Number(1 == t ? 0 : 0 == t || (0 < t % 100 && t % 100 < 20) ? 1 : 2);
},
21: function (t) {
return Number(t % 100 == 1 ? 1 : t % 100 == 2 ? 2 : t % 100 == 3 || t % 100 == 4 ? 3 : 0);
},
22: function (t) {
return Number(1 == t ? 0 : 2 == t ? 1 : (t < 0 || 10 < t) && t % 10 == 0 ? 2 : 3);
},
},
z = ["v1", "v2", "v3"],
X = { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 };
var V = (function () {
function n(t) {
var i,
e = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {};
Object(a.a)(this, n),
(this.languageUtils = t),
(this.options = e),
(this.logger = g.create("pluralResolver")),
(this.options.compatibilityJSON && "v4" !== this.options.compatibilityJSON) ||
("undefined" != typeof Intl && Intl.PluralRules) ||
((this.options.compatibilityJSON = "v3"), this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),
(this.rules =
((i = {}),
B.forEach(function (e) {
e.lngs.forEach(function (t) {
i[t] = { numbers: e.nr, plurals: Y[e.fc] };
});
}),
i));
}
return (
Object(h.a)(n, [
{
key: "addRule",
value: function (t, e) {
this.rules[t] = e;
},
},
{
key: "getRule",
value: function (t) {
var e = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {};
if (this.shouldUseIntlApi())
try {
return new Intl.PluralRules(t, { type: e.ordinal ? "ordinal" : "cardinal" });
} catch (t) {
return;
}
return this.rules[t] || this.rules[this.languageUtils.getLanguagePartFromCode(t)];
},
},
{
key: "needsPlural",
value: function (t) {
var e = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {},
i = this.getRule(t, e);
return this.shouldUseIntlApi() ? i && 1 < i.resolvedOptions().pluralCategories.length : i && 1 < i.numbers.length;
},
},
{
key: "getPluralFormsOfKey",
value: function (t, e) {
var i = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : {};
return this.getSuffixes(t, i).map(function (t) {
return "".concat(e).concat(t);
});
},
},
{
key: "getSuffixes",
value: function (e) {
var i = this,
n = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {},
t = this.getRule(e, n);
return t
? this.shouldUseIntlApi()
? t
.resolvedOptions()
.pluralCategories.sort(function (t, e) {
return X[t] - X[e];
})
.map(function (t) {
return "".concat(i.options.prepend).concat(t);
})
: t.numbers.map(function (t) {
return i.getSuffix(e, t, n);
})
: [];
},
},
{
key: "getSuffix",
value: function (t, e) {
var i = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : {},
n = this.getRule(t, i);
return n ? (this.shouldUseIntlApi() ? "".concat(this.options.prepend).concat(n.select(e)) : this.getSuffixRetroCompatible(n, e)) : (this.logger.warn("no plural rule found for: ".concat(t)), "");
},
},
{
key: "getSuffixRetroCompatible",
value: function (t, e) {
var i = this,
n = t.noAbs ? t.plurals(e) : t.plurals(Math.abs(e)),
s = t.numbers[n];
this.options.simplifyPluralSuffix && 2 === t.numbers.length && 1 === t.numbers[0] && (2 === s ? (s = "plural") : 1 === s && (s = ""));
var r = function () {
return i.options.prepend && s.toString() ? i.options.prepend + s.toString() : s.toString();
};
return "v1" === this.options.compatibilityJSON
? 1 === s
? ""
: "number" == typeof s
? "_plural_".concat(s.toString())
: r()
: "v2" === this.options.compatibilityJSON || (this.options.simplifyPluralSuffix && 2 === t.numbers.length && 1 === t.numbers[0])
? r()
: this.options.prepend && n.toString()
? this.options.prepend + n.toString()
: n.toString();
},
},
{
key: "shouldUseIntlApi",
value: function () {
return !z.includes(this.options.compatibilityJSON);
},
},
]),
n
);
})();
function G(e, t) {
var i = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var n = Object.getOwnPropertySymbols(e);
t &&
(n = n.filter(function (t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable;
})),
i.push.apply(i, n);
}
return i;
}
function j(e) {
for (var t = 1; t < arguments.length; t++) {
var i = null != arguments[t] ? arguments[t] : {};
t % 2
? G(Object(i), !0).forEach(function (t) {
s(e, t, i[t]);
})
: Object.getOwnPropertyDescriptors
? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i))
: G(Object(i)).forEach(function (t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(i, t));
});
}
return e;
}
var H = (function () {
function e() {
var t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {};
Object(a.a)(this, e),
(this.logger = g.create("interpolator")),
(this.options = t),
(this.format =
(t.interpolation && t.interpolation.format) ||
function (t) {
return t;
}),
this.init(t);
}
return (
Object(h.a)(e, [
{
key: "init",
value: function () {
var t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {};
t.interpolation || (t.interpolation = { escapeValue: !0 });
var e = t.interpolation;
(this.escape = void 0 !== e.escape ? e.escape : E),
(this.escapeValue = void 0 === e.escapeValue || e.escapeValue),
(this.useRawValueToEscape = void 0 !== e.useRawValueToEscape && e.useRawValueToEscape),
(this.prefix = e.prefix ? S(e.prefix) : e.prefixEscaped || "{{"),
(this.suffix = e.suffix ? S(e.suffix) : e.suffixEscaped || "}}"),
(this.formatSeparator = e.formatSeparator ? e.formatSeparator : e.formatSeparator || ","),
(this.unescapePrefix = e.unescapeSuffix ? "" : e.unescapePrefix || "-"),
(this.unescapeSuffix = this.unescapePrefix ? "" : e.unescapeSuffix || ""),
(this.nestingPrefix = e.nestingPrefix ? S(e.nestingPrefix) : e.nestingPrefixEscaped || S("$t(")),
(this.nestingSuffix = e.nestingSuffix ? S(e.nestingSuffix) : e.nestingSuffixEscaped || S(")")),
(this.nestingOptionsSeparator = e.nestingOptionsSeparator ? e.nestingOptionsSeparator : e.nestingOptionsSeparator || ","),
(this.maxReplaces = e.maxReplaces ? e.maxReplaces : 1e3),
(this.alwaysFormat = void 0 !== e.alwaysFormat && e.alwaysFormat),
this.resetRegExp();
},
},
{
key: "reset",
value: function () {
this.options && this.init(this.options);
},
},
{
key: "resetRegExp",
value: function () {
var t = "".concat(this.prefix, "(.+?)").concat(this.suffix);
this.regexp = new RegExp(t, "g");
var e = "".concat(this.prefix).concat(this.unescapePrefix, "(.+?)").concat(this.unescapeSuffix).concat(this.suffix);
this.regexpUnescape = new RegExp(e, "g");
var i = "".concat(this.nestingPrefix, "(.+?)").concat(this.nestingSuffix);
this.nestingRegexp = new RegExp(i, "g");
},
},
{
key: "interpolate",
value: function (s, r, o, a) {
var h,
l,
u,
c = this,
d = (this.options && this.options.interpolation && this.options.interpolation.defaultVariables) || {};
function e(t) {
return t.replace(/\$/g, "$$$$");
}
var f = function (t) {
if (t.indexOf(c.formatSeparator) < 0) {
var e = T(r, d, t);
return c.alwaysFormat ? c.format(e, void 0, o, j(j(j({}, a), r), {}, { interpolationkey: t })) : e;
}
var i = t.split(c.formatSeparator),
n = i.shift().trim(),
s = i.join(c.formatSeparator).trim();
return c.format(T(r, d, n), s, o, j(j(j({}, a), r), {}, { interpolationkey: n }));
};
this.resetRegExp();
var p = (a && a.missingInterpolationHandler) || this.options.missingInterpolationHandler,
g = a && a.interpolation && void 0 !== a.interpolation.skipOnVariables ? a.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
return (
[
{
regex: this.regexpUnescape,
safeValue: function (t) {
return e(t);
},
},
{
regex: this.regexp,
safeValue: function (t) {
return c.escapeValue ? e(c.escape(t)) : e(t);
},
},
].forEach(function (t) {
for (u = 0; (h = t.regex.exec(s)); ) {
var e = h[1].trim();
if (void 0 === (l = f(e)))
if ("function" == typeof p) {
var i = p(s, h, a);
l = "string" == typeof i ? i : "";
} else if (a && a.hasOwnProperty(e)) l = "";
else {
if (g) {
l = h[0];
continue;
}
c.logger.warn("missed to pass in variable ".concat(e, " for interpolating ").concat(s)), (l = "");
}
else "string" == typeof l || c.useRawValueToEscape || (l = m(l));
var n = t.safeValue(l);
if (((s = s.replace(h[0], n)), g ? ((t.regex.lastIndex += n.length), (t.regex.lastIndex -= h[0].length)) : (t.regex.lastIndex = 0), ++u >= c.maxReplaces)) break;
}
}),
s
);
},
},
{
key: "nest",
value: function (t, e) {
var i,
n,
s = this,
r = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : {},
o = j({}, r);
function a(t, e) {
var i = this.nestingOptionsSeparator;
if (t.indexOf(i) < 0) return t;
var n = t.split(new RegExp("".concat(i, "[ ]*{"))),
s = "{".concat(n[1]);
(t = n[0]), (s = (s = this.interpolate(s, o)).replace(/'/g, '"'));
try {
(o = JSON.parse(s)), e && (o = j(j({}, e), o));
} catch (e) {
return this.logger.warn("failed parsing options string in nesting for key ".concat(t), e), "".concat(t).concat(i).concat(s);
}
return delete o.defaultValue, t;
}
for (o.applyPostProcessor = !1, delete o.defaultValue; (i = this.nestingRegexp.exec(t)); ) {
var h = [],
l = !1;
if (-1 !== i[0].indexOf(this.formatSeparator) && !/{.*}/.test(i[1])) {
var u = i[1].split(this.formatSeparator).map(function (t) {
return t.trim();
});
(i[1] = u.shift()), (h = u), (l = !0);
}
if ((n = e(a.call(this, i[1].trim(), o), o)) && i[0] === t && "string" != typeof n) return n;
"string" != typeof n && (n = m(n)),
n || (this.logger.warn("missed to resolve ".concat(i[1], " for nesting ").concat(t)), (n = "")),
l &&
(n = h.reduce(function (t, e) {
return s.format(t, e, r.lng, j(j({}, r), {}, { interpolationkey: i[1].trim() }));
}, n.trim())),
(t = t.replace(i[0], n)),
(this.regexp.lastIndex = 0);
}
return t;
},
},
]),
e
);
})();
function W(e, t) {
var i = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var n = Object.getOwnPropertySymbols(e);
t &&
(n = n.filter(function (t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable;
})),
i.push.apply(i, n);
}
return i;
}
function K(e) {
for (var t = 1; t < arguments.length; t++) {
var i = null != arguments[t] ? arguments[t] : {};
t % 2
? W(Object(i), !0).forEach(function (t) {
s(e, t, i[t]);
})
: Object.getOwnPropertyDescriptors
? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i))
: W(Object(i)).forEach(function (t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(i, t));
});
}
return e;
}
var q = (function () {
function e() {
var t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {};
Object(a.a)(this, e),
(this.logger = g.create("formatter")),
(this.options = t),
(this.formats = {
number: function (t, e, i) {
return new Intl.NumberFormat(e, i).format(t);
},
currency: function (t, e, i) {
return new Intl.NumberFormat(e, K(K({}, i), {}, { style: "currency" })).format(t);
},
datetime: function (t, e, i) {
return new Intl.DateTimeFormat(e, K({}, i)).format(t);
},
relativetime: function (t, e, i) {
return new Intl.RelativeTimeFormat(e, K({}, i)).format(t, i.range || "day");
},
list: function (t, e, i) {
return new Intl.ListFormat(e, K({}, i)).format(t);
},
}),
this.init(t);
}
return (
Object(h.a)(e, [
{
key: "init",
value: function (t) {
var e = (1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : { interpolation: {} }).interpolation;
this.formatSeparator = e.formatSeparator ? e.formatSeparator : e.formatSeparator || ",";
},
},
{
key: "add",
value: function (t, e) {
this.formats[t.toLowerCase().trim()] = e;
},
},
{
key: "format",
value: function (t, e, h, l) {
var u = this;
return e.split(this.formatSeparator).reduce(function (t, e) {
var i = (function (t) {
var e = t.toLowerCase().trim(),
r = {};
if (-1 < t.indexOf("(")) {
var i = t.split("(");
e = i[0].toLowerCase().trim();
var n = i[1].substring(0, i[1].length - 1);
"currency" === e && n.indexOf(":") < 0
? r.currency || (r.currency = n.trim())
: "relativetime" === e && n.indexOf(":") < 0
? r.range || (r.range = n.trim())
: n.split(";").forEach(function (t) {
if (t) {
var e =
(function (t) {
if (Array.isArray(t)) return t;
})((s = t.split(":"))) ||
(function (t) {
if (("undefined" != typeof Symbol && null != t[Symbol.iterator]) || null != t["@@iterator"]) return Array.from(t);
})(s) ||
(function (t, e) {
if (t) {
if ("string" == typeof t) return f(t, void 0);
var i = Object.prototype.toString.call(t).slice(8, -1);
return (
"Object" === i && t.constructor && (i = t.constructor.name),
"Map" === i || "Set" === i ? Array.from(t) : "Arguments" === i || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i) ? f(t, void 0) : void 0
);
}
})(s) ||
(function () {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
})(),
i = e[0],
n = e.slice(1).join(":");
"false" === n.trim() && (r[i.trim()] = !1),
"true" === n.trim() && (r[i.trim()] = !0),
isNaN(n.trim()) || (r[i.trim()] = parseInt(n.trim(), 10)),
r[i.trim()] || (r[i.trim()] = n.trim());
}
var s;
});
}
return { formatName: e, formatOptions: r };
})(e),
n = i.formatName,
s = i.formatOptions;
if (u.formats[n]) {
var r = t;
try {
var o = (l && l.formatParams && l.formatParams[l.interpolationkey]) || {},
a = o.locale || o.lng || l.locale || l.lng || h;
r = u.formats[n](t, a, K(K(K({}, s), l), o));
} catch (t) {
u.logger.warn(t);
}
return r;
}
return u.logger.warn("there was no format function for ".concat(n)), t;
}, t);
},
},
]),
e
);
})();
function Z(e, t) {
var i = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var n = Object.getOwnPropertySymbols(e);
t &&
(n = n.filter(function (t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable;
})),
i.push.apply(i, n);
}
return i;
}
function J(e) {
for (var t = 1; t < arguments.length; t++) {
var i = null != arguments[t] ? arguments[t] : {};
t % 2
? Z(Object(i), !0).forEach(function (t) {
s(e, t, i[t]);
})
: Object.getOwnPropertyDescriptors
? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i))
: Z(Object(i)).forEach(function (t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(i, t));
});
}
return e;
}
var Q = (function (t) {
u(o, v);
var n,
s,
r =
((n = o),
(s = (function () {
if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
if (Reflect.construct.sham) return !1;
if ("function" == typeof Proxy) return !0;
try {
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), !0;
} catch (t) {
return !1;
}
})()),
function () {
var t,
e = d(n);
if (s) {
var i = d(this).constructor;
t = Reflect.construct(e, arguments, i);
} else t = e.apply(this, arguments);
return c(this, t);
});
function o(t, e, i) {
var n,
s = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : {};
return (
Object(a.a)(this, o),
(n = r.call(this)),
P && v.call(l(n)),
(n.backend = t),
(n.store = e),
(n.services = i),
(n.languageUtils = i.languageUtils),
(n.options = s),
(n.logger = g.create("backendConnector")),
(n.state = {}),
(n.queue = []),
n.backend && n.backend.init && n.backend.init(i, s.backend, s),
n
);
}
return (
Object(h.a)(o, [
{
key: "queueLoad",
value: function (t, e, s, i) {
var r = this,
o = [],
a = [],
h = [],
l = [];
return (
t.forEach(function (i) {
var n = !0;
e.forEach(function (t) {
var e = "".concat(i, "|").concat(t);
!s.reload && r.store.hasResourceBundle(i, t)
? (r.state[e] = 2)
: r.state[e] < 0 ||
(1 === r.state[e] ? a.indexOf(e) < 0 && a.push(e) : ((r.state[e] = 1), (n = !1), a.indexOf(e) < 0 && a.push(e), o.indexOf(e) < 0 && o.push(e), l.indexOf(t) < 0 && l.push(t)));
}),
n || h.push(i);
}),
(o.length || a.length) && this.queue.push({ pending: a, loaded: {}, errors: [], callback: i }),
{ toLoad: o, pending: a, toLoadLanguages: h, toLoadNamespaces: l }
);
},
},
{
key: "loaded",
value: function (o, a, t) {
var e = o.split("|"),
h = e[0],
l = e[1];
a && this.emit("failedLoading", h, l, a), t && this.store.addResourceBundle(h, l, t), (this.state[o] = a ? -1 : 2);
var u = {};
this.queue.forEach(function (t) {
var e, i, n, s, r;
(e = t.loaded),
(i = l),
((s = (n = x(e, [h], Object)).obj)[(r = n.k)] = s[r] || []),
s[r].push(i),
(function (t, e) {
for (var i = t.indexOf(e); -1 !== i; ) t.splice(i, 1), (i = t.indexOf(e));
})(t.pending, o),
a && t.errors.push(a),
0 !== t.pending.length ||
t.done ||
(Object.keys(t.loaded).forEach(function (e) {
u[e] || (u[e] = []),
t.loaded[e].length &&
t.loaded[e].forEach(function (t) {
u[e].indexOf(t) < 0 && u[e].push(t);
});
}),
(t.done = !0),
t.errors.length ? t.callback(t.errors) : t.callback());
}),
this.emit("loaded", u),
(this.queue = this.queue.filter(function (t) {
return !t.done;
}));
},
},
{
key: "read",
value: function (i, n, s) {
var r = this,
o = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : 0,
a = 4 < arguments.length && void 0 !== arguments[4] ? arguments[4] : 350,
h = 5 < arguments.length ? arguments[5] : void 0;
return i.length
? this.backend[s](i, n, function (t, e) {
t && e && o < 5
? setTimeout(function () {
r.read.call(r, i, n, s, o + 1, 2 * a, h);
}, a)
: h(t, e);
})
: h(null, {});
},
},
{
key: "prepareLoading",
value: function (t, e) {
var i = this,
n = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : {},
s = 3 < arguments.length ? arguments[3] : void 0;
if (!this.backend) return this.logger.warn("No backend was added via i18next.use. Will not load resources."), s && s();
"string" == typeof t && (t = this.languageUtils.toResolveHierarchy(t)), "string" == typeof e && (e = [e]);
var r = this.queueLoad(t, e, n, s);
if (!r.toLoad.length) return r.pending.length || s(), null;
r.toLoad.forEach(function (t) {
i.loadOne(t);
});
},
},
{
key: "load",
value: function (t, e, i) {
this.prepareLoading(t, e, {}, i);
},
},
{
key: "reload",
value: function (t, e, i) {
this.prepareLoading(t, e, { reload: !0 }, i);
},
},
{
key: "loadOne",
value: function (i) {
var n = this,
s = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : "",
t = i.split("|"),
r = t[0],
o = t[1];
this.read(r, o, "read", void 0, void 0, function (t, e) {
t && n.logger.warn("".concat(s, "loading namespace ").concat(o, " for language ").concat(r, " failed"), t),
!t && e && n.logger.log("".concat(s, "loaded namespace ").concat(o, " for language ").concat(r), e),
n.loaded(i, t, e);
});
},
},
{
key: "saveMissing",
value: function (t, e, i, n, s) {
var r = 5 < arguments.length && void 0 !== arguments[5] ? arguments[5] : {};
this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(e)
? this.logger.warn(
'did not save key "'.concat(i, '" as the namespace "').concat(e, '" was not yet loaded'),
"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"
)
: null != i && "" !== i && (this.backend && this.backend.create && this.backend.create(t, e, i, n, null, J(J({}, r), {}, { isUpdate: s })), t && t[0] && this.store.addResource(t[0], e, i, n));
},
},
]),
o
);
})();
function $(t) {
return (
"string" == typeof t.ns && (t.ns = [t.ns]),
"string" == typeof t.fallbackLng && (t.fallbackLng = [t.fallbackLng]),
"string" == typeof t.fallbackNS && (t.fallbackNS = [t.fallbackNS]),
t.supportedLngs && t.supportedLngs.indexOf("cimode") < 0 && (t.supportedLngs = t.supportedLngs.concat(["cimode"])),
t
);
}
function tt(e, t) {
var i = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var n = Object.getOwnPropertySymbols(e);
t &&
(n = n.filter(function (t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable;
})),
i.push.apply(i, n);
}
return i;
}
function et(e) {
for (var t = 1; t < arguments.length; t++) {
var i = null != arguments[t] ? arguments[t] : {};
t % 2
? tt(Object(i), !0).forEach(function (t) {
s(e, t, i[t]);
})
: Object.getOwnPropertyDescriptors
? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i))
: tt(Object(i)).forEach(function (t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(i, t));
});
}
return e;
}
function it() {}
var nt = (function (t) {
u(o, v);
var n,
s,
r =
((n = o),
(s = (function () {
if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
if (Reflect.construct.sham) return !1;
if ("function" == typeof Proxy) return !0;
try {
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), !0;
} catch (t) {
return !1;
}
})()),
function () {
var t,
e = d(n);
if (s) {
var i = d(this).constructor;
t = Reflect.construct(e, arguments, i);
} else t = e.apply(this, arguments);
return c(this, t);
});
function o() {
var t,
e,
i = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {},
n = 1 < arguments.length ? arguments[1] : void 0;
if (
(Object(a.a)(this, o),
(t = r.call(this)),
P && v.call(l(t)),
(t.options = $(i)),
(t.services = {}),
(t.logger = g),
(t.modules = { external: [] }),
(e = l(t)),
Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(function (t) {
"function" == typeof e[t] && (e[t] = e[t].bind(e));
}),
n && !t.isInitialized && !i.isClone)
) {
if (!t.options.initImmediate) return t.init(i, n), c(t, l(t));
setTimeout(function () {
t.init(i, n);
}, 0);
}
return t;
}
return (
Object(h.a)(o, [
{
key: "init",
value: function () {
var s = this,
t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {},
i = 1 < arguments.length ? arguments[1] : void 0;
"function" == typeof t && ((i = t), (t = {})), !t.defaultNS && t.ns && ("string" == typeof t.ns ? (t.defaultNS = t.ns) : t.ns.indexOf("translation") < 0 && (t.defaultNS = t.ns[0]));
var e = {
debug: !1,
initImmediate: !0,
ns: ["translation"],
defaultNS: ["translation"],
fallbackLng: ["dev"],
fallbackNS: !1,
supportedLngs: !1,
nonExplicitSupportedLngs: !1,
load: "all",
preload: !1,
simplifyPluralSuffix: !0,
keySeparator: ".",
nsSeparator: ":",
pluralSeparator: "_",
contextSeparator: "_",
partialBundledLanguages: !1,
saveMissing: !1,
updateMissing: !1,
saveMissingTo: "fallback",
saveMissingPlurals: !0,
missingKeyHandler: !1,
missingInterpolationHandler: !1,
postProcess: !1,
postProcessPassResolved: !1,
returnNull: !0,
returnEmptyString: !0,
returnObjects: !1,
joinArrays: !1,
returnedObjectHandler: !1,
parseMissingKeyHandler: !1,
appendNamespaceToMissingKey: !1,
appendNamespaceToCIMode: !1,
overloadTranslationOptionHandler: function (t) {
var e = {};
if (("object" === N(t[1]) && (e = t[1]), "string" == typeof t[1] && (e.defaultValue = t[1]), "string" == typeof t[2] && (e.tDescription = t[2]), "object" === N(t[2]) || "object" === N(t[3]))) {
var i = t[3] || t[2];
Object.keys(i).forEach(function (t) {
e[t] = i[t];
});
}
return e;
},
interpolation: {
escapeValue: !0,
format: function (t, e, i, n) {
return t;
},
prefix: "{{",
suffix: "}}",
formatSeparator: ",",
unescapePrefix: "-",
nestingPrefix: "$t(",
nestingSuffix: ")",
nestingOptionsSeparator: ",",
maxReplaces: 1e3,
skipOnVariables: !0,
},
};
function n(t) {
return t ? ("function" == typeof t ? new t() : t) : null;
}
if (
((this.options = et(et(et({}, e), this.options), $(t))),
"v1" !== this.options.compatibilityAPI && (this.options.interpolation = et(et({}, e.interpolation), this.options.interpolation)),
void 0 !== t.keySeparator && (this.options.userDefinedKeySeparator = t.keySeparator),
void 0 !== t.nsSeparator && (this.options.userDefinedNsSeparator = t.nsSeparator),
!this.options.isClone)
) {
var r;
this.modules.logger ? g.init(n(this.modules.logger), this.options) : g.init(null, this.options), this.modules.formatter ? (r = this.modules.formatter) : "undefined" != typeof Intl && (r = q);
var o = new F(this.options);
this.store = new O(this.options.resources, this.options);
var a = this.services;
(a.logger = g),
(a.resourceStore = this.store),
(a.languageUtils = o),
(a.pluralResolver = new V(o, { prepend: this.options.pluralSeparator, compatibilityJSON: this.options.compatibilityJSON, simplifyPluralSuffix: this.options.simplifyPluralSuffix })),
!r ||
(this.options.interpolation.format && this.options.interpolation.format !== e.interpolation.format) ||
((a.formatter = n(r)), a.formatter.init(a, this.options), (this.options.interpolation.format = a.formatter.format.bind(a.formatter))),
(a.interpolator = new H(this.options)),
(a.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }),
(a.backendConnector = new Q(n(this.modules.backend), a.resourceStore, a, this.options)),
a.backendConnector.on("*", function (t) {
for (var e = arguments.length, i = new Array(1 < e ? e - 1 : 0), n = 1; n < e; n++) i[n - 1] = arguments[n];
s.emit.apply(s, [t].concat(i));
}),
this.modules.languageDetector && ((a.languageDetector = n(this.modules.languageDetector)), a.languageDetector.init(a, this.options.detection, this.options)),
this.modules.i18nFormat && ((a.i18nFormat = n(this.modules.i18nFormat)), a.i18nFormat.init && a.i18nFormat.init(this)),
(this.translator = new I(this.services, this.options)),
this.translator.on("*", function (t) {
for (var e = arguments.length, i = new Array(1 < e ? e - 1 : 0), n = 1; n < e; n++) i[n - 1] = arguments[n];
s.emit.apply(s, [t].concat(i));
}),
this.modules.external.forEach(function (t) {
t.init && t.init(s);
});
}
if (((this.format = this.options.interpolation.format), i || (i = it), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng)) {
var h = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
0 < h.length && "dev" !== h[0] && (this.options.lng = h[0]);
}
this.services.languageDetector || this.options.lng || this.logger.warn("init: no languageDetector is used and no lng is defined");
["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach(function (e) {
s[e] = function () {
var t;
return (t = s.store)[e].apply(t, arguments);
};
});
["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach(function (e) {
s[e] = function () {
var t;
return (t = s.store)[e].apply(t, arguments), s;
};
});
var l = y(),
u = function () {
var t = function (t, e) {
s.isInitialized && !s.initializedStoreOnce && s.logger.warn("init: i18next is already initialized. You should call init just once!"),
(s.isInitialized = !0),
s.options.isClone || s.logger.log("initialized", s.options),
s.emit("initialized", s.options),
l.resolve(e),
i(t, e);
};
if (s.languages && "v1" !== s.options.compatibilityAPI && !s.isInitialized) return t(null, s.t.bind(s));
s.changeLanguage(s.options.lng, t);
};
return this.options.resources || !this.options.initImmediate ? u() : setTimeout(u, 0), l;
},
},
{
key: "loadResources",
value: function (t) {
var e = this,
i = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : it,
n = "string" == typeof t ? t : this.language;
if (("function" == typeof t && (i = t), !this.options.resources || this.options.partialBundledLanguages)) {
if (n && "cimode" === n.toLowerCase()) return i();
var s = [],
r = function (t) {
t &&
e.services.languageUtils.toResolveHierarchy(t).forEach(function (t) {
s.indexOf(t) < 0 && s.push(t);
});
};
if (n) r(n);
else
this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(function (t) {
return r(t);
});
this.options.preload &&
this.options.preload.forEach(function (t) {
return r(t);
}),
this.services.backendConnector.load(s, this.options.ns, i);
} else i(null);
},
},
{
key: "reloadResources",
value: function (t, e, i) {
var n = y();
return (
t || (t = this.languages),
e || (e = this.options.ns),
i || (i = it),
this.services.backendConnector.reload(t, e, function (t) {
n.resolve(), i(t);
}),
n
);
},
},
{
key: "use",
value: function (t) {
if (!t) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
if (!t.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
return (
"backend" === t.type && (this.modules.backend = t),
("logger" === t.type || (t.log && t.warn && t.error)) && (this.modules.logger = t),
"languageDetector" === t.type && (this.modules.languageDetector = t),
"i18nFormat" === t.type && (this.modules.i18nFormat = t),
"postProcessor" === t.type && k.addPostProcessor(t),
"formatter" === t.type && (this.modules.formatter = t),
"3rdParty" === t.type && this.modules.external.push(t),
this
);
},
},
{
key: "changeLanguage",
value: function (e, s) {
var r = this;
this.isLanguageChangingTo = e;
var o = y();
this.emit("languageChanging", e);
var a = function (t) {
if (((r.language = t), (r.languages = r.services.languageUtils.toResolveHierarchy(t)), (r.resolvedLanguage = void 0), !(-1 < ["cimode", "dev"].indexOf(t))))
for (var e = 0; e < r.languages.length; e++) {
var i = r.languages[e];
if (!(-1 < ["cimode", "dev"].indexOf(i)) && r.store.hasLanguageSomeTranslations(i)) {
r.resolvedLanguage = i;
break;
}
}
},
t = function (t) {
e || t || !r.services.languageDetector || (t = []);
var n = "string" == typeof t ? t : r.services.languageUtils.getBestMatchFromCodes(t);
n && (r.language || a(n), r.translator.language || r.translator.changeLanguage(n), r.services.languageDetector && r.services.languageDetector.cacheUserLanguage(n)),
r.loadResources(n, function (t) {
var e, i;
(e = t),
(i = n) ? (a(i), r.translator.changeLanguage(i), (r.isLanguageChangingTo = void 0), r.emit("languageChanged", i), r.logger.log("languageChanged", i)) : (r.isLanguageChangingTo = void 0),
o.resolve(function () {
return r.t.apply(r, arguments);
}),
s &&
s(e, function () {
return r.t.apply(r, arguments);
});
});
};
return (
e || !this.services.languageDetector || this.services.languageDetector.async
? !e && this.services.languageDetector && this.services.languageDetector.async
? this.services.languageDetector.detect(t)
: t(e)
: t(this.services.languageDetector.detect()),
o
);
},
},
{
key: "getFixedT",
value: function (t, e, l) {
var u = this,
i = function t(e, i) {
var n;
if ("object" !== N(i)) {
for (var s = arguments.length, r = new Array(2 < s ? s - 2 : 0), o = 2; o < s; o++) r[o - 2] = arguments[o];
n = u.options.overloadTranslationOptionHandler([e, i].concat(r));
} else n = et({}, i);
(n.lng = n.lng || t.lng), (n.lngs = n.lngs || t.lngs), (n.ns = n.ns || t.ns);
var a = u.options.keySeparator || ".",
h = l ? "".concat(l).concat(a).concat(e) : e;
return u.t(h, n);
};
return "string" == typeof t ? (i.lng = t) : (i.lngs = t), (i.ns = e), (i.keyPrefix = l), i;
},
},
{
key: "t",
value: function () {
var t;
return this.translator && (t = this.translator).translate.apply(t, arguments);
},
},
{
key: "exists",
value: function () {
var t;
return this.translator && (t = this.translator).exists.apply(t, arguments);
},
},
{
key: "setDefaultNamespace",
value: function (t) {
this.options.defaultNS = t;
},
},
{
key: "hasLoadedNamespace",
value: function (t) {
var n = this,
e = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {};
if (!this.isInitialized) return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
if (!this.languages || !this.languages.length) return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
var i = this.resolvedLanguage || this.languages[0],
s = !!this.options && this.options.fallbackLng,
r = this.languages[this.languages.length - 1];
if ("cimode" === i.toLowerCase()) return !0;
var o = function (t, e) {
var i = n.services.backendConnector.state["".concat(t, "|").concat(e)];
return -1 === i || 2 === i;
};
if (e.precheck) {
var a = e.precheck(this, o);
if (void 0 !== a) return a;
}
return !!this.hasResourceBundle(i, t) || !this.services.backendConnector.backend || !(!o(i, t) || (s && !o(r, t)));
},
},
{
key: "loadNamespaces",
value: function (t, e) {
var i = this,
n = y();
return this.options.ns
? ("string" == typeof t && (t = [t]),
t.forEach(function (t) {
i.options.ns.indexOf(t) < 0 && i.options.ns.push(t);
}),
this.loadResources(function (t) {
n.resolve(), e && e(t);
}),
n)
: (e && e(), Promise.resolve());
},
},
{
key: "loadLanguages",
value: function (t, e) {
var i = y();
"string" == typeof t && (t = [t]);
var n = this.options.preload || [],
s = t.filter(function (t) {
return n.indexOf(t) < 0;
});
return s.length
? ((this.options.preload = n.concat(s)),
this.loadResources(function (t) {
i.resolve(), e && e(t);
}),
i)
: (e && e(), Promise.resolve());
},
},
{
key: "dir",
value: function (t) {
return (
t || (t = this.resolvedLanguage || (this.languages && 0 < this.languages.length ? this.languages[0] : this.language)),
t
? -1 <
[
"ar",
"shu",
"sqr",
"ssh",
"xaa",
"yhd",
"yud",
"aao",
"abh",
"abv",
"acm",
"acq",
"acw",
"acx",
"acy",
"adf",
"ads",
"aeb",
"aec",
"afb",
"ajp",
"apc",
"apd",
"arb",
"arq",
"ars",
"ary",
"arz",
"auz",
"avl",
"ayh",
"ayl",
"ayn",
"ayp",
"bbz",
"pga",
"he",
"iw",
"ps",
"pbt",
"pbu",
"pst",
"prp",
"prd",
"ug",
"ur",
"ydd",
"yds",
"yih",
"ji",
"yi",
"hbo",
"men",
"xmn",
"fa",
"jpr",
"peo",
"pes",
"prs",
"dv",
"sam",
"ckb",
].indexOf(this.services.languageUtils.getLanguagePartFromCode(t)) || 1 < t.toLowerCase().indexOf("-arab")
? "rtl"
: "ltr"
: "rtl"
);
},
},
{
key: "cloneInstance",
value: function () {
var e = this,
t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {},
i = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : it,
n = et(et(et({}, this.options), t), { isClone: !0 }),
s = new o(n);
return (
["store", "services", "language"].forEach(function (t) {
s[t] = e[t];
}),
(s.services = et({}, this.services)),
(s.services.utils = { hasLoadedNamespace: s.hasLoadedNamespace.bind(s) }),
(s.translator = new I(s.services, s.options)),
s.translator.on("*", function (t) {
for (var e = arguments.length, i = new Array(1 < e ? e - 1 : 0), n = 1; n < e; n++) i[n - 1] = arguments[n];
s.emit.apply(s, [t].concat(i));
}),
s.init(n, i),
(s.translator.options = s.options),
(s.translator.backendConnector.services.utils = { hasLoadedNamespace: s.hasLoadedNamespace.bind(s) }),
s
);
},
},
{
key: "toJSON",
value: function () {
return { options: this.options, store: this.store, language: this.language, languages: this.languages, resolvedLanguage: this.resolvedLanguage };
},
},
]),
o
);
})();
s(nt, "createInstance", function () {
var t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {},
e = 1 < arguments.length ? arguments[1] : void 0;
return new nt(t, e);
});
var st = nt.createInstance();
st.createInstance = nt.createInstance;
var rt = st.createInstance,
ot = st.init,
at = st.loadResources,
ht = st.reloadResources,
lt = st.use,
ut = st.changeLanguage,
ct = st.getFixedT,
dt = st.t,
ft = st.exists,
pt = st.setDefaultNamespace,
gt = st.hasLoadedNamespace,
vt = st.loadNamespaces,
yt = st.loadLanguages;
e.default = st;
},
function (t, e, i) {
var n,
s,
r,
c =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
d =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(35), i(0), i(29), i(22), i(207), i(210), i(211), i(15), i(58)]),
void 0 ===
(s = function (t, e, n, s, r, o, a, h, l, u) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (e.Game = void 0), (r = d(r)), (h = d(h)), (l = d(l));
var i = (function (i) {
function t() {
var t = this;
return (
u.AnalyticsHandler.getInstance().load(s.Constants.GOOGLE_ID),
r.default.init(),
h.default.updateText(-5, 80),
(t =
i.call(this, {
parent: s.Constants.DIV_ID,
title: s.Constants.GAME_NAME,
disableContextMenu: !0,
type: Phaser.AUTO,
scale: { mode: Phaser.Scale.NONE, autoCenter: Phaser.Scale.CENTER_BOTH },
clearBeforeRender: !1,
plugins: { global: [a.Plugin.DefaultCfg, { key: "BBCodeTextPlugin", plugin: l.default, start: !0 }], scene: [{ key: "SpinePlugin", plugin: window.SpinePlugin, mapping: "spine" }] },
}) || this).events.off("hidden", t.onHidden, t, !1),
t.events.off("visible", t.onVisible, t, !1),
o.JDRender.init(t),
h.default.addDelay(t, 11),
!1 === t.device.os.desktop ? ((s.Constants.IS_MOBILE = !0), (s.Constants.GW = 1280), (s.Constants.GH = 720)) : (s.Constants.IS_MOBILE = !1),
r.default.setGameSize(s.Constants.GW, s.Constants.GH),
r.default.setMaxCanvasSize(1.5 * s.Constants.GW, 1.5 * s.Constants.GH),
r.default.refresh(t),
window.hasOwnProperty("fbrqSA") && !0 === window.fbrqSA && (h5branding.Utils.ASSET_LOCATION = "assets/"),
(h5branding.Branding.analyticsEnabled = !1),
(h5branding.Utils.LANGUAGE = "none"),
h5branding.SplashLoader.getInstance({ gameId: s.Constants.GAME_DISTRIBUTION_ID, gameName: s.Constants.GAME_TITLE, gameTitle: s.Constants.GAME_SPLASH_TITLE, libs: [], version: version })
.create()
.then(function () {
t.scene.add("preGame", { create: t.stateCreator.bind(t), preload: t.statePreloader.bind(t) }, !0);
}),
t
);
}
return (
c(t, i),
(t.prototype.statePreloader = function () {}),
(t.prototype.stateCreator = function () {
this.scene.add(n.Boot.Name, n.Boot), this.scene.add(n.World.Name, n.World), this.scene.start(n.Boot.Name), this.scene.remove("preGame");
}),
(t.prototype.step = function (t, e) {
i.prototype.step.call(this, t, e);
}),
t
);
})(Phaser.Game);
new (e.Game = i)();
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
g =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
o =
(this && this.__createBinding) ||
(Object.create
? function (t, e, i, n) {
void 0 === n && (n = i),
Object.defineProperty(t, n, {
enumerable: !0,
get: function () {
return e[i];
},
});
}
: function (t, e, i, n) {
void 0 === n && (n = i), (t[n] = e[i]);
}),
a =
(this && this.__setModuleDefault) ||
(Object.create
? function (t, e) {
Object.defineProperty(t, "default", { enumerable: !0, value: e });
}
: function (t, e) {
t.default = e;
}),
v =
(this && this.__importStar) ||
function (t) {
if (t && t.__esModule) return t;
var e = {};
if (null != t) for (var i in t) "default" !== i && Object.prototype.hasOwnProperty.call(t, i) && o(e, t, i);
return a(e, t), e;
},
y =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(28), i(0), i(4), i(68), i(11), i(35), i(6), i(15), i(8), i(69), i(45), i(59)]),
void 0 ===
(s = function (t, e, i, n, s, r, o, a, h, l, u, c, d, f) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (i = y(i)), (r = v(r)), (o = y(o)), (h = y(h)), (f = y(f));
var p = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
g(e, t),
(e.prototype.preload = function () {
var e = this;
this.load.on(Phaser.Loader.Events.PROGRESS, this.onLoadProgress, this),
u.AdHandler.getInstance(this.game).initAdProvider(),
c.PauseHandler.getInstance(this.game).init(),
this.input.keyboard.on("keydown", function (t) {
t.preventDefault();
}),
h5branding.SplashLoader.getInstance().setButtonCallback(function () {
h5branding.SplashLoader.getInstance().destroy(),
h5branding.Utils.inGDGameZone()
? (d.LoaderHelper.hide(), e.startGame())
: u.AdHandler.getInstance().showAd("splash", function () {
e.startGame();
});
}),
n.Constants.AVAILABLE_LANGUAGES.forEach(function (t) {
e.load.json(t, "assets/locales/locale_" + t + ".json");
}),
n.Images.preloadList.forEach(function (t) {
e.load.image(t, "assets/images/" + t + ".png");
}),
n.Atlases.preloadList.forEach(function (t) {
e.load.atlas(t, "assets/atlases/" + t + ".png", "assets/atlases/" + t + ".json");
}),
n.Sounds.preloadList.forEach(function (t) {
e.game.device.os.iOS ? e.load.audio(t, ["assets/sounds/" + t + ".m4a"]) : e.load.audio(t, ["assets/sounds/" + t + ".ogg", "assets/sounds/" + t + ".mp3"]);
}),
n.Atlases.list.forEach(function (t) {
e.load.atlas(t, "assets/atlases/" + t + ".png", "assets/atlases/" + t + ".json");
}),
n.Sounds.list.forEach(function (t) {
e.game.device.os.iOS ? e.load.audio(t, ["assets/sounds/" + t + ".m4a"]) : e.load.audio(t, ["assets/sounds/" + t + ".ogg", "assets/sounds/" + t + ".mp3"]);
}),
this.load.spine("player", "assets/spine/player.json", "assets/spine/player.atlas", !0),
this.load.spritesheet("basicBlockColors", "assets/spritesheet/basicBlockColors.png", { frameWidth: 100, frameHeight: 100, endFrame: 12, margin: 1, spacing: 2 }),
this.load.spritesheet("finishPortal", "assets/spritesheet/finish-portal.png", { frameWidth: 52, frameHeight: 60, endFrame: 60 }),
this.load.spritesheet("darkOverlay", "assets/spritesheet/dark-overlay.png", { frameWidth: 520, frameHeight: 520, endFrame: 30 }),
this.load.image("background", "assets/images/background.png"),
this.load.image("logo", "assets/images/logo.png"),
this.load.json("configuration", "assets/balance/configuration.json"),
this.load.json("levels", "assets/balance/levels.json"),
this.load.json("fontStyling", "assets/balance/fontStyling.json");
}),
(e.prototype.create = function () {
h5branding.SplashLoader.getInstance().setLoadProgress(100);
}),
(e.prototype.onLoadProgress = function (t) {
h5branding.SplashLoader.getInstance().setLoadProgress(t);
}),
(e.prototype.startGame = function () {
l.AnalyticsHandler.getInstance().create({ gameKey: n.Constants.GAME_KEY, gameSecret: n.Constants.SECRET_KEY, googleID: n.Constants.GOOGLE_ID, gameTitle: n.Constants.GOOGLE_APP_NAME, version: version }),
l.AnalyticsHandler.getInstance().sendScreenView("splash"),
o.default.getInstance();
var i = this;
s.Localization.init(this.cache)
.then(function () {
"ru" === f.default.language && ((n.Fonts.Main = "Molot"), (n.Fonts.TutDeath = "Molot"), (n.Fonts.list = [n.Fonts.Main]));
for (var t = new Array(n.Fonts.list.length), e = 0; e < n.Fonts.list.length; e++) t[e] = "assets/css/" + n.Fonts.list[e] + ".css";
r.load({
custom: { families: n.Fonts.list, urls: t },
active: function () {
return i.game.scene.start(a.World.Name);
},
}),
h.default.init(i.game),
!0 === n.Constants.IS_MOBILE && ((n.Constants.particleLimit = 0), (n.Constants.blend = !1), (n.Constants.parallax = !1));
})
.catch(function (t) {});
}),
(e.Name = "boot"),
e
);
})(i.default);
e.default = p;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n;
void 0 ===
(n = function (t, e) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function () {
function t() {}
return (t.preloadList = []), (t.list = []), t;
})();
e.default = i;
}.apply(e, [i, e])) || (t.exports = n);
},
function (t, e, i) {
var n;
void 0 ===
(n = function (t, e) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function () {
function t() {}
return (
(t.GOOGLE_ID = "G-JR2FBYS54P"),
(t.GOOGLE_APP_NAME = "Vex 6"),
(t.GAME_KEY = "229644bff57c8b7ff8a40a623289b281"),
(t.SECRET_KEY = "201b68ccab22fa8b499c7f2cabbd0149717e79c5"),
(t.GAME_TITLE = "vex-6"),
(t.GAME_SPLASH_TITLE = "Vex 6"),
(t.GAME_DISTRIBUTION_ID = "4925e12574364121a48c61c35f649c36"),
(t.DIV_ID = "content"),
(t.DIV_ID_ORIENTATION = "orientation"),
(t.GW = 1920),
(t.GH = 1080),
(t.ORIENTATION_LANDSCAPE = !0),
(t.userRatio = 1),
(t.UI_WIDTH = t.GW),
(t.UI_HEIGHT = t.GH),
(t.UI_SCALE_FIT_X = 1),
(t.UI_SCALE_FIT_Y = 1),
(t.UI_SCALE = 1),
(t.UI_SHIFT_X = 0),
(t.UI_SHIFT_Y = 0),
(t.UI_ADDITIONAL_SCALE = 1),
(t.AVAILABLE_LANGUAGES = ["en", "de", "pt", "fr", "ru", "it", "es", "nl", "no"]),
(t.GAME_NAME = "Vex 6"),
(t.STORAGE_KEY = "vex6_sg"),
(t.volumeMusic = 0.4),
(t.volumeSfx = 1),
(t.mutedSfx = !1),
(t.mutedMusic = !1),
(t.incorrectOrientation = !1),
(t.actsStarts = 1),
(t.totalActs = 10),
(t.mainmenuID = "mainmenu"),
(t.hubID = "hub"),
(t.bonusStageID = "bonusStage"),
(t.vexID = "" + t.totalActs),
(t.basicBlockColorFrames = 11),
(t.totalMoney = 0),
(t.totalDeaths = 0),
(t.timePlayed = 0),
(t.currSkin = 0),
(t.autoReset = !1),
(t.particleLimit = 30),
(t.blend = !0),
(t.parallax = !0),
(t.ropeUpVelY = 2),
(t.ropeDownVelY = 5),
(t.AppearingBlockApper = 5),
(t.AppearingBlockDisapper = 5),
(t.wireSparkSpeed = 0.15),
(t.spikeBlockVelocity = 0.1),
(t.spikeBlockUp = 0),
(t.spikeBlockDown = 0),
(t.levelsCompleted = 0),
(t.actFinishTime = -1),
(t.pausedActTime = null),
(t.pausedMapTime = null),
(t.pBgOffset = 60),
(t.pBgsafeArea = 30),
(t.adFree = !1),
t
);
})();
e.default = i;
}.apply(e, [i, e])) || (t.exports = n);
},
function (t, e, i) {
var n;
void 0 ===
(n = function (t, e) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function () {
function t() {}
return (
(t.gameplay = "gameplay"),
(t.ui = "ui"),
(t.skinsThumbnails = "skinsThumbnails"),
(t.localizationFlags = "localizationFlags"),
(t.preloadList = []),
(t.list = [t.gameplay, t.ui, t.skinsThumbnails, t.localizationFlags]),
t
);
})();
e.default = i;
}.apply(e, [i, e])) || (t.exports = n);
},
function (t, e, i) {
var n;
void 0 ===
(n = function (t, e) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function () {
function t() {}
return (
(t.preloadList = []),
(t.list = [
"slot_random",
"slot_unlock",
"achievementUnlocked",
"blockDestroy",
"bounce1",
"buttonClick",
"cannonEnter",
"cannonFire",
"connect",
"connectHang",
"death1",
"death2",
"ding",
"downgrade",
"electricity",
"fall",
"fallingBlock",
"footstep1",
"footstep2",
"footstep3",
"footstep4",
"footstep5",
"footstep6",
"glassSmash",
"kickBlock",
"land",
"laserFire",
"menuSong",
"poleSwing",
"poleWoosh",
"slide",
"splash1",
"starPickup",
"vexSong1",
"vexSong2",
"vexSong3",
"vexSong4",
"vexSong5",
"vexSong6",
"vexSong7",
"vexSong8",
"vexSong9",
"vexSong10",
"vexSong11",
"vexSong12",
"vexSong13",
"vexSong14",
"wallSlide",
"ziplineFull",
"torch",
"explosion",
"kite",
]),
t
);
})();
e.default = i;
}.apply(e, [i, e])) || (t.exports = n);
},
function (t, e, i) {
var n;
void 0 ===
(n = function (t, e) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function () {
function t() {}
return (t.Main = "theboldfont"), (t.TutDeath = "theboldfont"), (t.list = [t.Main]), t;
})();
e.default = i;
}.apply(e, [i, e])) || (t.exports = n);
},
function (t, e, i) {
"use strict";
i.r(e),
i.d(e, "default", function () {
return T;
});
var n = i(13),
s = i(14),
r = [],
o = r.forEach,
a = r.slice;
var h = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,
l = function (t, e, i, n) {
var s = 4 < arguments.length && void 0 !== arguments[4] ? arguments[4] : { path: "/", sameSite: "strict" };
i && ((s.expires = new Date()), s.expires.setTime(s.expires.getTime() + 60 * i * 1e3)),
n && (s.domain = n),
(document.cookie = (function (t, e, i) {
var n = i || {};
n.path = n.path || "/";
var s = t + "=" + encodeURIComponent(e);
if (0 < n.maxAge) {
var r = n.maxAge - 0;
if (isNaN(r)) throw new Error("maxAge should be a Number");
s += "; Max-Age=" + Math.floor(r);
}
if (n.domain) {
if (!h.test(n.domain)) throw new TypeError("option domain is invalid");
s += "; Domain=" + n.domain;
}
if (n.path) {
if (!h.test(n.path)) throw new TypeError("option path is invalid");
s += "; Path=" + n.path;
}
if (n.expires) {
if ("function" != typeof n.expires.toUTCString) throw new TypeError("option expires is invalid");
s += "; Expires=" + n.expires.toUTCString();
}
if ((n.httpOnly && (s += "; HttpOnly"), n.secure && (s += "; Secure"), n.sameSite))
switch ("string" == typeof n.sameSite ? n.sameSite.toLowerCase() : n.sameSite) {
case !0:
s += "; SameSite=Strict";
break;
case "lax":
s += "; SameSite=Lax";
break;
case "strict":
s += "; SameSite=Strict";
break;
case "none":
s += "; SameSite=None";
break;
default:
throw new TypeError("option sameSite is invalid");
}
return s;
})(t, encodeURIComponent(e), s));
},
u = {
name: "cookie",
lookup: function (t) {
var e;
if (t.lookupCookie && "undefined" != typeof document) {
var i = (function (t) {
for (var e = t + "=", i = document.cookie.split(";"), n = 0; n < i.length; n++) {
for (var s = i[n]; " " === s.charAt(0); ) s = s.substring(1, s.length);
if (0 === s.indexOf(e)) return s.substring(e.length, s.length);
}
return null;
})(t.lookupCookie);
i && (e = i);
}
return e;
},
cacheUserLanguage: function (t, e) {
e.lookupCookie && "undefined" != typeof document && l(e.lookupCookie, t, e.cookieMinutes, e.cookieDomain, e.cookieOptions);
},
},
c = {
name: "querystring",
lookup: function (t) {
var e;
if ("undefined" != typeof window)
for (var i = window.location.search.substring(1).split("&"), n = 0; n < i.length; n++) {
var s = i[n].indexOf("=");
0 < s && i[n].substring(0, s) === t.lookupQuerystring && (e = i[n].substring(s + 1));
}
return e;
},
},
d = null,
f = function () {
if (null !== d) return d;
try {
(d = "undefined" !== window && null !== window.localStorage), window.localStorage.setItem("i18next.translate.boo", "foo"), window.localStorage.removeItem("i18next.translate.boo");
} catch (t) {
d = !1;
}
return d;
},
p = {
name: "localStorage",
lookup: function (t) {
var e;
if (t.lookupLocalStorage && f()) {
var i = window.localStorage.getItem(t.lookupLocalStorage);
i && (e = i);
}
return e;
},
cacheUserLanguage: function (t, e) {
e.lookupLocalStorage && f() && window.localStorage.setItem(e.lookupLocalStorage, t);
},
},
g = null,
v = function () {
if (null !== g) return g;
try {
(g = "undefined" !== window && null !== window.sessionStorage), window.sessionStorage.setItem("i18next.translate.boo", "foo"), window.sessionStorage.removeItem("i18next.translate.boo");
} catch (t) {
g = !1;
}
return g;
},
y = {
name: "sessionStorage",
lookup: function (t) {
var e;
if (t.lookupSessionStorage && v()) {
var i = window.sessionStorage.getItem(t.lookupSessionStorage);
i && (e = i);
}
return e;
},
cacheUserLanguage: function (t, e) {
e.lookupSessionStorage && v() && window.sessionStorage.setItem(e.lookupSessionStorage, t);
},
},
m = {
name: "navigator",
lookup: function (t) {
var e = [];
if ("undefined" != typeof navigator) {
if (navigator.languages) for (var i = 0; i < navigator.languages.length; i++) e.push(navigator.languages[i]);
navigator.userLanguage && e.push(navigator.userLanguage), navigator.language && e.push(navigator.language);
}
return 0 < e.length ? e : void 0;
},
},
x = {
name: "htmlTag",
lookup: function (t) {
var e,
i = t.htmlTag || ("undefined" != typeof document ? document.documentElement : null);
return i && "function" == typeof i.getAttribute && (e = i.getAttribute("lang")), e;
},
},
b = {
name: "path",
lookup: function (t) {
var e;
if ("undefined" != typeof window) {
var i = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
if (i instanceof Array)
if ("number" == typeof t.lookupFromPathIndex) {
if ("string" != typeof i[t.lookupFromPathIndex]) return;
e = i[t.lookupFromPathIndex].replace("/", "");
} else e = i[0].replace("/", "");
}
return e;
},
},
w = {
name: "subdomain",
lookup: function (t) {
var e;
if ("undefined" != typeof window) {
var i = window.location.href.match(/(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/gi);
i instanceof Array &&
(e =
"number" == typeof t.lookupFromSubdomainIndex
? i[t.lookupFromSubdomainIndex].replace("http://", "").replace("https://", "").replace(".", "")
: i[0].replace("http://", "").replace("https://", "").replace(".", ""));
}
return e;
},
},
T = (function () {
function i(t) {
var e = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {};
Object(n.a)(this, i), (this.type = "languageDetector"), (this.detectors = {}), this.init(t, e);
}
return (
Object(s.a)(i, [
{
key: "init",
value: function (t) {
var e = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {},
i = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : {};
(this.services = t),
(this.options = (function (i) {
return (
o.call(a.call(arguments, 1), function (t) {
if (t) for (var e in t) void 0 === i[e] && (i[e] = t[e]);
}),
i
);
})(e, this.options || {}, {
order: ["querystring", "cookie", "localStorage", "sessionStorage", "navigator", "htmlTag"],
lookupQuerystring: "lng",
lookupCookie: "i18next",
lookupLocalStorage: "i18nextLng",
lookupSessionStorage: "i18nextLng",
caches: ["localStorage"],
excludeCacheFor: ["cimode"],
})),
this.options.lookupFromUrlIndex && (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex),
(this.i18nOptions = i),
this.addDetector(u),
this.addDetector(c),
this.addDetector(p),
this.addDetector(y),
this.addDetector(m),
this.addDetector(x),
this.addDetector(b),
this.addDetector(w);
},
},
{
key: "addDetector",
value: function (t) {
this.detectors[t.name] = t;
},
},
{
key: "detect",
value: function (t) {
var i = this;
t || (t = this.options.order);
var n = [];
return (
t.forEach(function (t) {
if (i.detectors[t]) {
var e = i.detectors[t].lookup(i.options);
e && "string" == typeof e && (e = [e]), e && (n = n.concat(e));
}
}),
this.services.languageUtils.getBestMatchFromCodes ? n : 0 < n.length ? n[0] : null
);
},
},
{
key: "cacheUserLanguage",
value: function (e, t) {
var i = this;
t || (t = this.options.caches),
t &&
((this.options.excludeCacheFor && -1 < this.options.excludeCacheFor.indexOf(e)) ||
t.forEach(function (t) {
i.detectors[t] && i.detectors[t].cacheUserLanguage(e, i.options);
}));
},
},
]),
i
);
})();
T.type = "languageDetector";
},
function (tt, et, it) {
var nt;
!(function () {
function n(t, e, i) {
return t.call.apply(t.bind, arguments);
}
function s(e, i, t) {
if (!e) throw Error();
if (2 < arguments.length) {
var n = Array.prototype.slice.call(arguments, 2);
return function () {
var t = Array.prototype.slice.call(arguments);
return Array.prototype.unshift.apply(t, n), e.apply(i, t);
};
}
return function () {
return e.apply(i, arguments);
};
}
function p(t, e, i) {
return (p = Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("native code") ? n : s).apply(null, arguments);
}
var a =
Date.now ||
function () {
return +new Date();
};
function e(t, e) {
(this.a = t), (this.o = e || t), (this.c = this.o.document);
}
var h = !!window.FontFace;
function l(t, e, i, n) {
if (((e = t.c.createElement(e)), i)) for (var s in i) i.hasOwnProperty(s) && ("style" == s ? (e.style.cssText = i[s]) : e.setAttribute(s, i[s]));
return n && e.appendChild(t.c.createTextNode(n)), e;
}
function u(t, e, i) {
(t = t.c.getElementsByTagName(e)[0]) || (t = document.documentElement), t.insertBefore(i, t.lastChild);
}
function i(t) {
t.parentNode && t.parentNode.removeChild(t);
}
function g(t, e, i) {
(e = e || []), (i = i || []);
for (var n = t.className.split(/\s+/), s = 0; s < e.length; s += 1) {
for (var r = !1, o = 0; o < n.length; o += 1)
if (e[s] === n[o]) {
r = !0;
break;
}
r || n.push(e[s]);
}
for (e = [], s = 0; s < n.length; s += 1) {
for (r = !1, o = 0; o < i.length; o += 1)
if (n[s] === i[o]) {
r = !0;
break;
}
r || e.push(n[s]);
}
t.className = e
.join(" ")
.replace(/\s+/g, " ")
.replace(/^\s+|\s+$/, "");
}
function r(t, e) {
for (var i = t.className.split(/\s+/), n = 0, s = i.length; n < s; n++) if (i[n] == e) return !0;
return !1;
}
function c(t, e, i) {
function n() {
o && s && (o(r), (o = null));
}
e = l(t, "link", { rel: "stylesheet", href: e, media: "all" });
var s = !1,
r = null,
o = i || null;
h
? ((e.onload = function () {
(s = !0), n();
}),
(e.onerror = function () {
(s = !0), (r = Error("Stylesheet failed to load")), n();
}))
: setTimeout(function () {
(s = !0), n();
}, 0),
u(t, "head", e);
}
function d(t, e, i, n) {
var s = t.c.getElementsByTagName("head")[0];
if (s) {
var r = l(t, "script", { src: e }),
o = !1;
return (
(r.onload = r.onreadystatechange = function () {
o ||
(this.readyState && "loaded" != this.readyState && "complete" != this.readyState) ||
((o = !0), i && i(null), (r.onload = r.onreadystatechange = null), "HEAD" == r.parentNode.tagName && s.removeChild(r));
}),
s.appendChild(r),
setTimeout(function () {
o || ((o = !0), i && i(Error("Script load timeout")));
}, n || 5e3),
r
);
}
return null;
}
function f() {
(this.a = 0), (this.c = null);
}
function v(t) {
return (
t.a++,
function () {
t.a--, o(t);
}
);
}
function y(t, e) {
(t.c = e), o(t);
}
function o(t) {
0 == t.a && t.c && (t.c(), (t.c = null));
}
function m(t) {
this.a = t || "-";
}
function x(t, e) {
(this.c = t), (this.f = 4), (this.a = "n");
var i = (e || "n4").match(/^([nio])([1-9])$/i);
i && ((this.a = i[1]), (this.f = parseInt(i[2], 10)));
}
function b(t) {
var e = [];
t = t.split(/,\s*/);
for (var i = 0; i < t.length; i++) {
var n = t[i].replace(/['"]/g, "");
-1 != n.indexOf(" ") || /^\d/.test(n) ? e.push("'" + n + "'") : e.push(n);
}
return e.join(",");
}
function w(t) {
return t.a + t.f;
}
function T(t) {
var e = "normal";
return "o" === t.a ? (e = "oblique") : "i" === t.a && (e = "italic"), e;
}
function S(t, e) {
(this.c = t), (this.f = t.o.document.documentElement), (this.h = e), (this.a = new m("-")), (this.j = !1 !== e.events), (this.g = !1 !== e.classes);
}
function _(t) {
if (t.g) {
var e = r(t.f, t.a.c("wf", "active")),
i = [],
n = [t.a.c("wf", "loading")];
e || i.push(t.a.c("wf", "inactive")), g(t.f, i, n);
}
E(t, "inactive");
}
function E(t, e, i) {
t.j && t.h[e] && (i ? t.h[e](i.c, w(i)) : t.h[e]());
}
function P() {
this.c = {};
}
function A(t, e) {
(this.c = t), (this.f = e), (this.a = l(this.c, "span", { "aria-hidden": "true" }, this.f));
}
function M(t) {
u(t.c, "body", t.a);
}
function C(t) {
return (
"display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:" +
b(t.c) +
";font-style:" +
T(t) +
";font-weight:" +
t.f +
"00;"
);
}
function O(t, e, i, n, s, r) {
(this.g = t), (this.j = e), (this.a = n), (this.c = i), (this.f = s || 3e3), (this.h = r || void 0);
}
function k(t, e, i, n, s, r, o) {
(this.v = t),
(this.B = e),
(this.c = i),
(this.a = n),
(this.s = o || "BESbswy"),
(this.f = {}),
(this.w = s || 3e3),
(this.u = r || null),
(this.m = this.j = this.h = this.g = null),
(this.g = new A(this.c, this.s)),
(this.h = new A(this.c, this.s)),
(this.j = new A(this.c, this.s)),
(this.m = new A(this.c, this.s)),
(t = C((t = new x(this.a.c + ",serif", w(this.a))))),
(this.g.a.style.cssText = t),
(t = C((t = new x(this.a.c + ",sans-serif", w(this.a))))),
(this.h.a.style.cssText = t),
(t = C((t = new x("serif", w(this.a))))),
(this.j.a.style.cssText = t),
(t = C((t = new x("sans-serif", w(this.a))))),
(this.m.a.style.cssText = t),
M(this.g),
M(this.h),
M(this.j),
M(this.m);
}
(m.prototype.c = function (t) {
for (var e = [], i = 0; i < arguments.length; i++) e.push(arguments[i].replace(/[\W_]+/g, "").toLowerCase());
return e.join(this.a);
}),
(O.prototype.start = function () {
var s = this.c.o.document,
r = this,
o = a(),
t = new Promise(function (i, n) {
!(function e() {
var t;
a() - o >= r.f
? n()
: s.fonts.load(((t = r.a), T(t) + " " + t.f + "00 300px " + b(t.c)), r.h).then(
function (t) {
1 <= t.length ? i() : setTimeout(e, 25);
},
function () {
n();
}
);
})();
}),
i = null,
e = new Promise(function (t, e) {
i = setTimeout(e, r.f);
});
Promise.race([e, t]).then(
function () {
i && (clearTimeout(i), (i = null)), r.g(r.a);
},
function () {
r.j(r.a);
}
);
});
var R = { D: "serif", C: "sans-serif" },
L = null;
function I() {
if (null === L) {
var t = /AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);
L = !!t && (parseInt(t[1], 10) < 536 || (536 === parseInt(t[1], 10) && parseInt(t[2], 10) <= 11));
}
return L;
}
function D(t, e, i) {
for (var n in R) if (R.hasOwnProperty(n) && e === t.f[R[n]] && i === t.f[R[n]]) return !0;
return !1;
}
function F(t, e) {
setTimeout(
p(function () {
i(this.g.a), i(this.h.a), i(this.j.a), i(this.m.a), e(this.a);
}, t),
0
);
}
function B(t, e, i) {
(this.c = t), (this.a = e), (this.f = 0), (this.m = this.j = !1), (this.s = i);
}
k.prototype.start = function () {
(this.f.serif = this.j.a.offsetWidth),
(this.f["sans-serif"] = this.m.a.offsetWidth),
(this.A = a()),
(function t(e) {
var i,
n = e.g.a.offsetWidth,
s = e.h.a.offsetWidth;
(i = n === e.f.serif && s === e.f["sans-serif"]) || (i = I() && D(e, n, s)),
i
? a() - e.A >= e.w
? I() && D(e, n, s) && (null === e.u || e.u.hasOwnProperty(e.a.c))
? F(e, e.v)
: F(e, e.B)
: setTimeout(
p(function () {
t(this);
}, e),
50
)
: F(e, e.v);
})(this);
};
var N = null;
function U(t) {
0 == --t.f && t.j && (t.m ? ((t = t.a).g && g(t.f, [t.a.c("wf", "active")], [t.a.c("wf", "loading"), t.a.c("wf", "inactive")]), E(t, "active")) : _(t.a));
}
function t(t) {
(this.j = t), (this.a = new P()), (this.h = 0), (this.f = this.g = !0);
}
function Y(t, e) {
(this.c = t), (this.a = e);
}
function z(t, e) {
(this.c = t), (this.a = e);
}
function X(t, e) {
(this.c = t || "https://fonts.googleapis.com/css"), (this.a = []), (this.f = []), (this.g = e || "");
}
(B.prototype.g = function (t) {
var e = this.a;
e.g && g(e.f, [e.a.c("wf", t.c, w(t).toString(), "active")], [e.a.c("wf", t.c, w(t).toString(), "loading"), e.a.c("wf", t.c, w(t).toString(), "inactive")]), E(e, "fontactive", t), (this.m = !0), U(this);
}),
(B.prototype.h = function (t) {
var e = this.a;
if (e.g) {
var i = r(e.f, e.a.c("wf", t.c, w(t).toString(), "active")),
n = [],
s = [e.a.c("wf", t.c, w(t).toString(), "loading")];
i || n.push(e.a.c("wf", t.c, w(t).toString(), "inactive")), g(e.f, n, s);
}
E(e, "fontinactive", t), U(this);
}),
(t.prototype.load = function (t) {
(this.c = new e(this.j, t.context || this.j)),
(this.g = !1 !== t.events),
(this.f = !1 !== t.classes),
(function (s, t, e) {
var i,
n = [],
r = e.timeout;
(i = t).g && g(i.f, [i.a.c("wf", "loading")]),
E(i, "loading"),
(n = (function (t, e, i) {
var n,
s = [];
for (n in e)
if (e.hasOwnProperty(n)) {
var r = t.c[n];
r && s.push(r(e[n], i));
}
return s;
})(s.a, e, s.c));
var o = new B(s.c, t, r);
for (s.h = n.length, t = 0, e = n.length; t < e; t++)
n[t].load(function (t, e, i) {
var n, l, u, c, d, f;
(l = o),
(u = t),
(c = e),
(d = i),
(f = 0 == --(n = s).h),
(n.f || n.g) &&
setTimeout(function () {
var t = d || null,
e = c || {};
if (0 === u.length && f) _(l.a);
else {
(l.f += u.length), f && (l.j = f);
var i,
n = [];
for (i = 0; i < u.length; i++) {
var s = u[i],
r = e[s.c],
o = l.a,
a = s;
if ((o.g && g(o.f, [o.a.c("wf", a.c, w(a).toString(), "loading")]), E(o, "fontloading", a), (o = null) === N))
if (window.FontFace) {
a = /Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent);
var h = /OS X.*Version\/10\..*Safari/.exec(window.navigator.userAgent) && /Apple/.exec(window.navigator.vendor);
N = a ? 42 < parseInt(a[1], 10) : !h;
} else N = !1;
(o = N ? new O(p(l.g, l), p(l.h, l), l.c, s, l.s, r) : new k(p(l.g, l), p(l.h, l), l.c, s, l.s, t, r)), n.push(o);
}
for (i = 0; i < n.length; i++) n[i].start();
}
}, 0);
});
})(this, new S(this.c, t), t);
}),
(Y.prototype.load = function (o) {
var e = this,
a = e.a.projectId,
t = e.a.version;
if (a) {
var h = e.c.o;
d(this.c, (e.a.api || "https://fast.fonts.net/jsapi") + "/" + a + ".js" + (t ? "?v=" + t : ""), function (t) {
t
? o([])
: ((h["__MonotypeConfiguration__" + a] = function () {
return e.a;
}),
(function t() {
if (h["__mti_fntLst" + a]) {
var e,
i = h["__mti_fntLst" + a](),
n = [];
if (i)
for (var s = 0; s < i.length; s++) {
var r = i[s].fontfamily;
null != i[s].fontStyle && null != i[s].fontWeight ? ((e = i[s].fontStyle + i[s].fontWeight), n.push(new x(r, e))) : n.push(new x(r));
}
o(n);
} else
setTimeout(function () {
t();
}, 50);
})());
}).id = "__MonotypeAPIScript__" + a;
} else o([]);
}),
(z.prototype.load = function (t) {
var e,
i,
n = this.a.urls || [],
s = this.a.families || [],
r = this.a.testStrings || {},
o = new f();
for (e = 0, i = n.length; e < i; e++) c(this.c, n[e], v(o));
var a = [];
for (e = 0, i = s.length; e < i; e++)
if ((n = s[e].split(":"))[1]) for (var h = n[1].split(","), l = 0; l < h.length; l += 1) a.push(new x(n[0], h[l]));
else a.push(new x(n[0]));
y(o, function () {
t(a, r);
});
});
function V(t) {
(this.f = t), (this.a = []), (this.c = {});
}
var G = { latin: "BESbswy", "latin-ext": "çöüğş", cyrillic: "йÑЖ", greek: "αβΣ", khmer: "កážáž‚", Hanuman: "កážáž‚" },
j = {
thin: "1",
extralight: "2",
"extra-light": "2",
ultralight: "2",
"ultra-light": "2",
light: "3",
regular: "4",
book: "4",
medium: "5",
"semi-bold": "6",
semibold: "6",
"demi-bold": "6",
demibold: "6",
bold: "7",
"extra-bold": "8",
extrabold: "8",
"ultra-bold": "8",
ultrabold: "8",
black: "9",
heavy: "9",
l: "3",
r: "4",
b: "7",
},
H = { i: "i", italic: "i", n: "n", normal: "n" },
W = /^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/;
function K(t, e) {
(this.c = t), (this.a = e);
}
var q = { Arimo: !0, Cousine: !0, Tinos: !0 };
function Z(t, e) {
(this.c = t), (this.a = e);
}
function J(t, e) {
(this.c = t), (this.f = e), (this.a = []);
}
(K.prototype.load = function (t) {
var e = new f(),
i = this.c,
n = new X(this.a.api, this.a.text),
s = this.a.families;
!(function (t, e) {
for (var i = e.length, n = 0; n < i; n++) {
var s = e[n].split(":");
3 == s.length && t.f.push(s.pop());
var r = "";
2 == s.length && "" != s[1] && (r = ":"), t.a.push(s.join(r));
}
})(n, s);
var r = new V(s);
!(function (t) {
for (var e = t.f.length, i = 0; i < e; i++) {
var n = t.f[i].split(":"),
s = n[0].replace(/\+/g, " "),
r = ["n4"];
if (2 <= n.length) {
var o;
if (((o = []), (a = n[1])))
for (var a, h = (a = a.split(",")).length, l = 0; l < h; l++) {
var u;
if ((u = a[l]).match(/^[\w-]+$/))
if (null == (c = W.exec(u.toLowerCase()))) u = "";
else {
if (((u = null == (u = c[2]) || "" == u ? "n" : H[u]), null == (c = c[1]) || "" == c)) c = "4";
else var c = j[c] || (isNaN(c) ? "4" : c.substr(0, 1));
u = [u, c].join("");
}
else u = "";
u && o.push(u);
}
0 < o.length && (r = o), 3 == n.length && ((o = []), 0 < (n = (n = n[2]) ? n.split(",") : o).length && (n = G[n[0]]) && (t.c[s] = n));
}
for (t.c[s] || ((n = G[s]) && (t.c[s] = n)), n = 0; n < r.length; n += 1) t.a.push(new x(s, r[n]));
}
})(r),
c(
i,
(function (t) {
if (0 == t.a.length) throw Error("No fonts to load!");
if (-1 != t.c.indexOf("kit=")) return t.c;
for (var e = t.a.length, i = [], n = 0; n < e; n++) i.push(t.a[n].replace(/ /g, "+"));
return (e = t.c + "?family=" + i.join("%7C")), 0 < t.f.length && (e += "&subset=" + t.f.join(",")), 0 < t.g.length && (e += "&text=" + encodeURIComponent(t.g)), e;
})(n),
v(e)
),
y(e, function () {
t(r.a, r.c, q);
});
}),
(Z.prototype.load = function (o) {
var t = this.a.id,
a = this.c.o;
t
? d(
this.c,
(this.a.api || "https://use.typekit.net") + "/" + t + ".js",
function (t) {
if (t) o([]);
else if (a.Typekit && a.Typekit.config && a.Typekit.config.fn) {
t = a.Typekit.config.fn;
for (var e = [], i = 0; i < t.length; i += 2) for (var n = t[i], s = t[i + 1], r = 0; r < s.length; r++) e.push(new x(n, s[r]));
try {
a.Typekit.load({ events: !1, classes: !1, async: !0 });
} catch (t) {}
o(e);
}
},
2e3
)
: o([]);
}),
(J.prototype.load = function (l) {
var t,
e = this.f.id,
i = this.c.o,
u = this;
e
? (i.__webfontfontdeckmodule__ || (i.__webfontfontdeckmodule__ = {}),
(i.__webfontfontdeckmodule__[e] = function (t, e) {
for (var i = 0, n = e.fonts.length; i < n; ++i) {
var s = e.fonts[i];
u.a.push(
new x(
s.name,
((r = "font-weight:" + s.weight + ";font-style:" + s.style),
(h = a = o = void 0),
(o = 4),
(a = "n"),
(h = null),
r &&
((h = r.match(/(normal|oblique|italic)/i)) && h[1] && (a = h[1].substr(0, 1).toLowerCase()),
(h = r.match(/([1-9]00|normal|bold)/i)) && h[1] && (/bold/i.test(h[1]) ? (o = 7) : /[1-9]00/.test(h[1]) && (o = parseInt(h[1].substr(0, 1), 10)))),
a + o)
)
);
}
var r, o, a, h;
l(u.a);
}),
d(this.c, (this.f.api || "https://f.fontdeck.com/s/css/js/") + ((t = this.c).o.location.hostname || t.a.location.hostname) + "/" + e + ".js", function (t) {
t && l([]);
}))
: l([]);
});
var Q = new t(window);
(Q.a.c.custom = function (t, e) {
return new z(e, t);
}),
(Q.a.c.fontdeck = function (t, e) {
return new J(e, t);
}),
(Q.a.c.monotype = function (t, e) {
return new Y(e, t);
}),
(Q.a.c.typekit = function (t, e) {
return new Z(e, t);
}),
(Q.a.c.google = function (t, e) {
return new K(e, t);
});
var $ = { load: p(Q.load, Q) };
void 0 ===
(nt = function () {
return $;
}.call(et, it, et, tt)) || (tt.exports = nt);
})();
},
function (t, e, i) {
var n, s;
(n = [i, e, i(8)]),
void 0 ===
(s = function (t, e, i) {
"use strict";
var n, s;
Object.defineProperty(e, "__esModule", { value: !0 }), (e.PauseHandler = void 0), ((s = n || (n = {})).BUTTON = "button"), (s.BLUR = "blur");
var r = (function () {
function e(t) {
(this.focused = !1), (this.game = t);
}
return (
(e.getInstance = function (t) {
return e.instance || (e.instance = new e(t)), e.instance;
}),
(e.prototype.init = function () {
var t = this;
this.game.device.os.desktop ||
(document.addEventListener("pause", function () {
return t.onPause();
}),
document.addEventListener("resume", function () {
return t.onResume();
})),
this.game.events.addListener(Phaser.Core.Events.FOCUS, this.onFocus, this),
this.game.events.addListener(Phaser.Core.Events.BLUR, this.onBlur, this),
this.game.events.addListener(Phaser.Core.Events.PAUSE, this.onPause, this),
this.game.events.addListener(Phaser.Core.Events.RESUME, this.onResume, this);
}),
(e.prototype.onBlur = function () {
(this.focused = !1), i.AdHandler.getInstance().isAdPlaying() || this.game.events.emit(Phaser.Core.Events.PAUSE);
}),
(e.prototype.onFocus = function () {
(this.focused = !0), i.AdHandler.getInstance().isAdPlaying() || this.game.events.emit(Phaser.Core.Events.RESUME);
}),
(e.prototype.onPause = function () {
this.game.sound.mute = !0;
}),
(e.prototype.onResume = function () {
this.game.sound.mute = !1;
}),
(e.prototype.pause = function () {
this.game.events.emit(Phaser.Core.Events.PAUSE);
}),
(e.prototype.resume = function () {
this.hasFocus && this.game.events.emit(Phaser.Core.Events.RESUME);
}),
Object.defineProperty(e.prototype, "hasFocus", {
get: function () {
return this.focused;
},
enumerable: !1,
configurable: !0,
}),
e
);
})();
e.PauseHandler = r;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
h =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
l =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(28), i(0), i(35), i(29), i(6)]),
void 0 ===
(s = function (t, e, i, n, s, r, o) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (i = l(i)), (r = l(r)), (o = l(o));
var a = (function (i) {
function t() {
return (null !== i && i.apply(this, arguments)) || this;
}
return (
h(t, i),
(t.prototype.init = function () {
i.prototype.init.call(this),
(this.background = new Phaser.GameObjects.Rectangle(this, n.Constants.GHW, n.Constants.GHH, n.Constants.UI_WIDTH, n.Constants.UI_HEIGHT, 1118481, 1)),
this.add.existing(this.background);
var t = n.Constants.GHW - 200,
e = n.Constants.GHH - 15 + 120;
(this.outline = this.add.graphics()),
this.outline.lineStyle(2, 16777215, 1),
this.outline.strokeRoundedRect(0, 0, 400, 30, 8),
(this.outline.x = t),
(this.outline.y = e),
(this.progress = this.add.graphics()),
this.progress.fillStyle(16763904),
this.progress.fillRoundedRect(0, 0, 394, 24, 6),
(this.progress.x = t + 3),
(this.progress.y = e + 3),
(this.progress.scaleX = 0),
this.load.on(Phaser.Loader.Events.PROGRESS, this.loadProgress, this),
this.initResize();
}),
(t.prototype.resize = function () {
r.default.resizeCamera(this.cameras.main), r.default.scaleFitScreen(this.background);
}),
(t.prototype.preload = function () {
var e = this;
n.Atlases.list.forEach(function (t) {
e.load.atlas(t, "assets/atlases/" + t + ".png", "assets/atlases/" + t + ".json");
}),
n.Sounds.list.forEach(function (t) {
e.game.device.os.iOS ? e.load.audio(t, ["assets/sounds/" + t + ".m4a"]) : e.load.audio(t, ["assets/sounds/" + t + ".ogg", "assets/sounds/" + t + ".mp3"]);
}),
this.preloadVex6();
}),
(t.prototype.preloadVex6 = function () {
this.load.spine("player", "assets/spine/player.json", "assets/spine/player.atlas", !0),
this.load.spritesheet("basicBlockColors", "assets/spritesheet/basicBlockColors.png", { frameWidth: 100, frameHeight: 100, endFrame: 12, margin: 1, spacing: 2 }),
this.load.spritesheet("finishPortal", "assets/spritesheet/finish-portal.png", { frameWidth: 52, frameHeight: 60, endFrame: 60 }),
this.load.spritesheet("darkOverlay", "assets/spritesheet/dark-overlay.png", { frameWidth: 520, frameHeight: 520, endFrame: 30 }),
this.load.image("background", "assets/images/background.png"),
this.load.image("logo", "assets/images/logo.png"),
this.load.json("configuration", "assets/balance/configuration.json"),
this.load.json("levels", "assets/balance/levels.json");
}),
(t.prototype.loadProgress = function (t) {
this.progress.scaleX = t;
}),
(t.prototype.create = function () {
(this.progress.visible = !1),
(this.outline.visible = !1),
o.default.init(this.game),
!0 === n.Constants.IS_MOBILE && ((n.Constants.particleLimit = 0), (n.Constants.blend = !1), (n.Constants.parallax = !1)),
this.scene.start(s.World.Name);
}),
(t.prototype.destroy = function () {
i.prototype.destroy.call(this), (this.outline = null), (this.progress = null), (this.background = null);
}),
(t.Name = "preloader"),
t
);
})(i.default);
e.default = a;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(11), i(46), i(31), i(52), i(32), i(205), i(20), i(30), i(12)]),
void 0 ===
(s = function (t, e, V, G, f, j, H, W, i, K, q, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (G = a(G)), (i = a(i));
var s = (function (e) {
function t() {
var t = (null !== e && e.apply(this, arguments)) || this;
return (t.colorPortalEnable = [0, 0, 1, 1, 2, 2, 3, 3]), (t.gravity = 0.25), (t.finished = !1), t;
}
return (
o(t, e),
(t.prototype.create = function () {
(this.deathText = new H.DeathText(this, this.overlayLayer)),
(this.player = new f.Player(this)),
(this.checkpointText = new W.CheckPointText(this, this.particleLayer)),
(this.levels = new i.default()),
this.loadLevels();
}),
(t.prototype.loadLevels = function () {
this.levels.loadLevels(this);
}),
(t.prototype.loadBalance = function (t) {
(j.ElevatorGenerator.TimeNewElevator = t.tne),
(j.ElevatorGenerator.SpeedElevator = t.se),
(j.Portal.TimeCooldown = t.ptc),
(V.Constants.ropeUpVelY = t.ruvy),
(V.Constants.ropeDownVelY = t.rdvy),
(V.Constants.AppearingBlockApper = t.aba),
(V.Constants.AppearingBlockDisapper = t.abd),
(V.Constants.spikeBlockVelocity = t.sbv),
(V.Constants.spikeBlockUp = t.sbu),
(V.Constants.spikeBlockDown = t.sbd),
(V.Constants.wireSparkSpeed = t.wss);
}),
(t.prototype.resetVars = function () {
(this.dark = !1),
(this.darkOverlay.visible = !1),
(this.darkGraphics.visible = !1),
(this.finished = !1),
(this.blocks = []),
(this.solarBlocks = []),
(this.slopes = []),
(this.obstacles = []),
(this.ziplines = []),
(this.ropes = []),
(this.checkpoints = []),
(this.poles = []),
(this.particles = []),
(this.particlesUI = []),
(this.fadesElements = []),
(this.pools = []),
(this.coins = []),
(this.fans = []),
(this.keyObjs = []),
(this.torchObjs = []),
(this.kites = []),
(this.wires = []),
(this.elevatorGenerator = []),
(this.elevatorEliminator = []),
(this.misc = []),
(this.cannons = []),
(this.lightSwitches = []),
(this.portals = []),
(this.breatheBlasters = []),
(this.actBlocks = {}),
(this.wireTrail = null),
(this.vexTNT = null),
(this.particleNum = 0),
(this.particleUINum = 0);
}),
(t.prototype.createLevel = function (t) {
var e = 0,
i = 0;
this.resetVars();
for (var n = null, s = null, r = null, o = 0, a = 0; a < t.length; a++) {
var h = t[a],
l = h.id;
if (this.currentLevelID !== V.Constants.hubID || !((h.delActNum && h.delActNum <= V.Constants.levelsCompleted) || (h.createActNum && h.createActNum > V.Constants.levelsCompleted)))
if ("spawnPoint" === l) (e = h.x), (i = h.y);
else if ("basicBlock" === l) (u = new j.BasicBlock(this, this.levelLayer)).spawn(h.x, h.y, h.width, h.height), this.blocks.push(u);
else if ("verticalUpBlock" === l) (u = new j.VerticalUpBlock(this, this.levelLayer)).spawn(h.x, h.y, h.width, h.height), this.blocks.push(u);
else if ("verticalDownBlock" === l) (u = new j.VerticalDownBlock(this, this.levelLayer)).spawn(h.x, h.y, h.width, h.height), this.blocks.push(u);
else if ("horizontalBlock" === l) (u = new j.HorizontalBlock(this, this.levelLayer)).spawn(h.x, h.y, h.width, h.height), this.blocks.push(u);
else if ("horizontalBlockFast" === l) (u = new j.HorizontalBlock(this, this.levelLayer)).spawn(h.x, h.y, h.width, h.height, -2.5), this.blocks.push(u);
else if ("fallingBlock" === l) (u = new j.FallingBlock(this, this.levelLayer)).spawn(h.x, h.y, h.width, h.height), this.blocks.push(u);
else if ("bounceBlock" === l) (u = new j.BounceBlock(this, this.levelLayer)).spawn(h.x, h.y, h.width, h.height), this.blocks.push(u);
else if ("pushBlock" === l) (u = new j.PushBlock(this, this.levelLayer)).spawn(h.x, h.y, h.width, h.height), this.blocks.push(u);
else if ("iceBlock" === l) (u = new j.IceBlock(this, this.levelLayer)).spawn(h.x, h.y, h.width, h.height), this.blocks.push(u);
else if ("glassBlock" === l) (u = new j.GlassBlock(this, this.levelLayer)).spawn(h.x, h.y, h.width, h.height), this.blocks.push(u);
else if ("speedBlock" === l) (u = new j.SpeedBlock(this, this.levelLayer)).spawn(h.x, h.y, h.width, h.height, 1), this.blocks.push(u);
else if ("speedBlockLeft" === l) (u = new j.SpeedBlock(this, this.levelLayer)).spawn(h.x, h.y, h.width, h.height, -1), this.blocks.push(u);
else if ("sparkBlock" === l) (u = new j.SparkBlock(this, this.levelLayer)).spawn(h.x, h.y, h.width, h.height), this.blocks.push(u);
else if ("solarBlock" === l) (u = new j.SolarBlock(this, this.levelLayer)).spawn(h.x, h.y, h.width, h.height), this.blocks.push(u), this.solarBlocks.push(u);
else if ("invisBlock" === l) (u = new j.InvisBlock(this, this.levelLayer)).spawn(h.x, h.y, h.width, h.height), this.blocks.push(u);
else if ("invisBlockUp" === l) (u = new j.InvisBlockUp(this, this.levelLayer)).spawn(h.x, h.y, h.width, h.height), this.blocks.push(u);
else if ("invisBlockDown" === l) (u = new j.InvisBlockDown(this, this.levelLayer)).spawn(h.x, h.y, h.width, h.height), this.blocks.push(u);
else if ("explosiveBlock" === l) {
if (this.currentLevelID === V.Constants.hubID && 1400 === h.x && 800 === h.y && (3 <= V.Constants.levelsCompleted || "3" === this.prevLevel)) continue;
(u = new j.ExplosiveBlock(this, this.levelLayer)).spawn(h.x, h.y, h.width, h.height), this.blocks.push(u);
} else if ("blockedWall" === l) (u = new j.BlockedWall(this, this.obstacleLayer)).spawn(h.x, h.y, h.width, h.height, h.rotation), this.blocks.push(u);
else if ("actBlock" === l) (u = new j.ActBlock(this, this.topObstacleLayer, h.actNum, this.getLevel(h.actNum), !1)).spawn(h.x, h.y), this.blocks.push(u), (this.actBlocks[h.actNum + "false"] = u);
else if ("actBlockHard" === l)
(u = new j.ActBlock(this, this.topObstacleLayer, h.actNum, this.getLevel(h.actNum), !0)).spawn(h.x, h.y),
this.blocks.push(u),
!1 === (this.actBlocks[h.actNum + "true"] = u).hardEnabled && ((I = new K.SpikeActBlockHard(this, this.topObstacleLayer)).spawn(h.x, h.y - 79, 0), this.obstacles.push(I));
else if ("skinsBlock" === l) (u = new j.SkinsBlock(this, this.topObstacleLayer, o)).spawn(h.x, h.y), this.blocks.push(u), (this.actBlocks["skin" + o + "false"] = u).levelStart(), (o += 1);
else if ("bonusDoor" === l) (u = new j.BonusStageDoor(this, this.levelLayer)).spawn(h.x, h.y), this.blocks.push(u), (this.actBlocks.bonusDoor = u).levelStart();
else if ("swimmingPool" === l) {
var u = void 0;
(u = new j.SwimmingPool(this, this.poolLayer)).spawn(h.x, h.y, h.width, h.height), this.pools.push(u);
} else if ("leftSlope" === l) (u = new j.Slope(this, this.levelLayer, -1)).spawn(h.x, h.y, h.width, h.height), this.slopes.push(u);
else if ("rightSlope" === l) (u = new j.Slope(this, this.levelLayer, 1)).spawn(h.x, h.y, h.width, h.height), this.slopes.push(u);
else if ("ziplinePole" === l) {
var c = new W.ZiplinePole(this, this.obstacleLayer);
c.spawn(h.x, h.y), (n = n ? (this.ziplines.push(n.attach(c)), null) : c), this.misc.push(c);
} else if ("pole" === l) {
var d = new W.Pole(this, this.topObstacleLayer);
d.spawn(h.x, h.y), this.poles.push(d);
} else if ("checkpoint" === l) (f = new W.Checkpoint(this, this.obstacleLayer, !1)).spawn(h.x, h.y), this.checkpoints.push(f);
else if ("checkpointSwimming" === l) {
var f;
(f = new W.Checkpoint(this, this.obstacleLayer, !0)).spawn(h.x, h.y), this.checkpoints.push(f);
} else if ("coin" === l) (p = new W.Coin(this, this.topObstacleLayer)).spawn(h.x, h.y), this.coins.push(p);
else if ("skinSpin" === l) {
if (!0 === this.currentLevel.isSkinSpinCollected(this.isCurrLevelHard)) continue;
var p;
(p = new W.SkinSpin(this, this.topObstacleLayer, h.rarity)).spawn(h.x, h.y), this.coins.push(p);
} else if ("windBlaster" === l) {
var g = new W.WindBlaster(this, this.obstacleLayer);
g.spawn(h.x, h.y, h.rotation), this.fans.push(g);
} else if ("finishPortal" === l) {
var v = new W.FinishPortal(this, this.obstacleLayer);
v.spawn(h.x, h.y), this.misc.push(v), (this.finishPortal = v);
} else if ("lockBlock" === l) {
if (
(this.currentLevelID === V.Constants.hubID && -1975 === h.x && 1200 === h.y && (6 <= V.Constants.levelsCompleted || ("6" === this.prevLevel && !0 === this.isCurrLevelHard))) ||
(1900 === h.x && 250 === h.y && (9 <= V.Constants.levelsCompleted || "9" === this.prevLevel))
)
continue;
(u = new j.LB(this, this.levelLayer)).spawn(h.x, h.y, h.width, h.height), this.blocks.push(u);
} else if ("key" === l) {
if (this.currentLevelID === V.Constants.hubID && -1350 === h.x && 1550 === h.y && (6 <= V.Constants.levelsCompleted || ("6" === this.prevLevel && !0 === this.isCurrLevelHard))) continue;
(y = new W.Key(this, this.obstacleLayer)).spawn(h.x, h.y), this.keyObjs.push(y);
} else if ("timedKey" === l) {
if (this.currentLevelID === V.Constants.hubID && 2675 === h.x && 125 === h.y && (9 <= V.Constants.levelsCompleted || "9" === this.prevLevel)) continue;
var y;
(y = new W.TimedKey(this, this.obstacleLayer)).spawn(h.x, h.y), this.keyObjs.push(y);
} else if ("torch" === l) {
if (this.currentLevelID === V.Constants.hubID && 1273 === h.x && 1423 === h.y && (3 <= V.Constants.levelsCompleted || "3" === this.prevLevel)) continue;
var m = new W.Torch(this, this.obstacleLayer);
m.spawn(h.x, h.y), this.torchObjs.push(m);
} else if ("circularCannon" === l) {
var x = new W.CircularCannon(this, this.topObstacleLayer);
x.spawn(h.x, h.y), this.cannons.push(x);
} else if ("lightSwitch" === l) {
var b = new W.LightSwitch(this, this.topObstacleLayer);
b.spawn(h.x, h.y), this.lightSwitches.push(b);
} else if ("wire" === l) {
var w = new W.Wire(this, this.topObstacleLayer);
w.spawn(h.x, h.y, h.rotation), this.wires.push(w);
} else if ("buzzsaw" === l) {
var T = new K.Buzzsaw(this, this.obstacleLayer);
h.width ? T.spawn(h.x, h.y, Math.round(h.width) / 100) : T.spawn(h.x, h.y), this.obstacles.push(T);
} else if ("buzzsawVerticalUp" === l) (T = new K.BuzzsawVertical(this, this.obstacleLayer)).spawn(h.x, h.y, -1), this.obstacles.push(T);
else if ("buzzsawVerticalDown" === l) (T = new K.BuzzsawVertical(this, this.obstacleLayer)).spawn(h.x, h.y, 1), this.obstacles.push(T);
else if ("buzzsawHorizontal" === l)
(T = new K.BuzzsawHorizontal(this, this.obstacleLayer)), h.width ? T.spawn(h.x, h.y, 1, Math.round(h.width) / 100) : T.spawn(h.x, h.y, 1), this.obstacles.push(T);
else if ("buzzsawHorizontalFast" === l) (T = new K.BuzzsawHorizontal(this, this.obstacleLayer)).spawn(h.x, h.y, 2.5), this.obstacles.push(T);
else if ("buzzsawVerticalCustom" === l) (T = new K.BuzzsawVertical(this, this.obstacleLayer)).spawn(h.x, h.y, h.speed, h.size / 100, h.moveDist), this.obstacles.push(T);
else if ("buzzsawHorizontalCustom" === l) (T = new K.BuzzsawHorizontal(this, this.obstacleLayer)).spawn(h.x, h.y, h.speed, h.size / 100, h.moveDist), this.obstacles.push(T);
else if ("bouncingBuzzsaw" === l) (T = new K.BouncingBuzzsaw(this, this.obstacleLayer)), h.width ? T.spawn(h.x, h.y, Math.round(h.width) / 100) : T.spawn(h.x, h.y), this.obstacles.push(T);
else if ("enlargingBuzzsaw" === l) (T = new K.EnlargingBuzzsaw(this, this.obstacleLayer)), h.width ? T.spawn(h.x, h.y, Math.round(h.width) / 100) : T.spawn(h.x, h.y), this.obstacles.push(T);
else if ("buzzsawOnStick" === l)
(T = void 0),
(T = this.currentLevelID === V.Constants.hubID ? new K.BuzzsawOnStick(this, this.obstacleLayer) : new K.BuzzsawOnStick(this, this.topObstacleLayer)).spawn(h.x, h.y, h.rotation),
this.obstacles.push(T);
else if ("spike" === l) (I = new K.Spike(this, this.obstacleLayer)).spawn(h.x, h.y, h.rotation), this.obstacles.push(I);
else if ("spike5x" === l) (I = new K.Spike5x(this, this.obstacleLayer)).spawn(h.x, h.y, h.rotation), this.obstacles.push(I);
else if ("spike10x" === l) (I = new K.Spike10x(this, this.obstacleLayer)).spawn(h.x, h.y, h.rotation), this.obstacles.push(I);
else if ("spike15x" === l) (I = new K.Spike15x(this, this.obstacleLayer)).spawn(h.x, h.y, h.rotation), this.obstacles.push(I);
else if ("spike20x" === l) (I = new K.Spike20x(this, this.obstacleLayer)).spawn(h.x, h.y, h.rotation), this.obstacles.push(I);
else if ("spike25x" === l) (I = new K.Spike25x(this, this.obstacleLayer)).spawn(h.x, h.y, h.rotation), this.obstacles.push(I);
else if ("spike30x" === l) (I = new K.Spike30x(this, this.obstacleLayer)).spawn(h.x, h.y, h.rotation), this.obstacles.push(I);
else if ("fallingSpike" === l) (I = new K.FallingSpike(this, this.obstacleLayer)).spawn(h.x, h.y, h.rotation), this.obstacles.push(I);
else if ("shurikanSpawner" === l) (I = new K.ShurikanSpawner(this, this.obstacleLayer)).spawn(h.x, h.y, h.rotation), this.obstacles.push(I);
else if ("classicLaser" === l) {
var S = new K.ClassicLaser(this, this.topObstacleLayer);
S.spawn(h.x, h.y), this.obstacles.push(S);
} else if ("quadrantRight" === l) {
var _ = new K.Quadrant(this, this.obstacleLayer);
h.width ? _.spawn(h.x, h.y, h.rotation, (2 * Math.PI) / 180, h.width / 180) : _.spawn(h.x, h.y, h.rotation, (2 * Math.PI) / 180), this.obstacles.push(_);
} else if ("quadrantLeft" === l)
(_ = new K.Quadrant(this, this.obstacleLayer)),
h.width ? _.spawn(h.x, h.y, h.rotation, (-2 * Math.PI) / 180, h.width / 180) : _.spawn(h.x, h.y, h.rotation, (-2 * Math.PI) / 180),
this.obstacles.push(_);
else if ("laserPoint" === l)
if (s) {
var E = new K.LaserPoint(this, this.obstacleLayer);
E.spawn(s.x, s.y, h.x, h.y), this.obstacles.push(E), (s = null);
} else s = new Phaser.Geom.Point(h.x, h.y);
else if ("reaper" === l) {
var P = new K.Reaper(this, this.obstacleLayer);
h.width ? P.spawn(h.x, h.y, h.rotation, Math.round(h.width) / 302) : P.spawn(h.x, h.y, h.rotation), this.obstacles.push(P);
} else if ("shurikanDispenser" === l) {
var A = new K.ShurikanDispenser(this, this.obstacleLayer);
A.spawn(h.x, h.y), this.obstacles.push(A);
} else if ("hazardStrips" === l) {
var M = new W.HazardStrips(this, this.topObstacleLayer);
M.spawn(h.x, h.y), this.misc.push(M);
} else if ("breatheBlaster" === l) {
var C = new W.BreatheBlaster(this, this.obstacleLayer);
C.spawn(h.x, h.y, h.rotation), this.breatheBlasters.push(C);
} else if ("textFade" === l) {
var O = new H.FadeText(this, this.textLayer);
O.spawn(h.x, h.y, h.rotation, h.width, h.height), O.setID(h.textNum), this.fadesElements.push(O);
} else if ("arrowFade" === l) {
var k = new H.FadeArrow(this, this.textLayer, h.textNum);
k.spawn(h.x, h.y, h.rotation), this.fadesElements.push(k);
} else if ("portal" === l) {
var R = new j.Portal(this, this.topObstacleLayer, this.colorPortalEnable[0]);
R.spawn(h.x, h.y), this.colorPortalEnable.splice(0, 1), (r = r ? (R.attachPortal(r), r.attachPortal(R), null) : R), this.portals.push(R);
} else if ("elevatorGeneratorUp" === l) {
var L = new j.ElevatorGenerator(this, this.topObstacleLayer, !1),
I = new K.Spike15x(this, this.obstacleLayer);
this.obstacles.push(I), L.addSpikes(I, !0), L.spawn(h.x, h.y), this.elevatorGenerator.push(L), this.blocks.push(L);
} else if ("elevatorGeneratorDown" === l)
(L = new j.ElevatorGenerator(this, this.topObstacleLayer, !0)),
(I = new K.Spike15x(this, this.obstacleLayer)),
this.obstacles.push(I),
L.addSpikes(I, !1),
L.spawn(h.x, h.y),
this.elevatorGenerator.push(L),
this.blocks.push(L);
else if ("elevatorEliminator" === l) (L = new j.ElevatorEliminator(this, this.topObstacleLayer)).spawn(h.x, h.y), this.elevatorEliminator.push(L), this.blocks.push(L);
else if ("elevatorEliminatorUp" === l)
(L = new j.ElevatorEliminator(this, this.topObstacleLayer)),
(I = new K.Spike15x(this, this.obstacleLayer)),
this.obstacles.push(I),
L.addSpikes(I, !1),
L.spawn(h.x, h.y),
this.elevatorEliminator.push(L),
this.blocks.push(L);
else if ("elevatorEliminatorDown" === l)
(L = new j.ElevatorEliminator(this, this.topObstacleLayer)),
(I = new K.Spike15x(this, this.obstacleLayer)),
this.obstacles.push(I),
L.addSpikes(I, !0),
L.spawn(h.x, h.y),
this.elevatorEliminator.push(L),
this.blocks.push(L);
else if ("appearingBlock" === l) (u = new j.AppearingBlock(this, this.topObstacleLayer)).spawn(h.x, h.y, h.width, h.height, h.initVisible, h.timeShow, h.timeHide), this.blocks.push(u);
else if ("rope" === l) (u = new W.Rope(this, this.underPoolLayer)).spawn(h.x, h.y, h.height), this.ropes.push(u);
else if ("blockSpike" === l)
(u = new j.BlockSpike(this, this.levelLayer)).spawn(h.x, h.y, h.spikeUp, h.upEnable, h.downEnable, h.leftEnable, h.rightEnable, h.timeUp, h.timeDown), this.blocks.push(u);
else if ("kite" === l) {
var D = new W.Kite(this, this.topObstacleLayer);
D.spawn(h.x, h.y), this.kites.push(D);
} else "vexTNT" === l && ((u = new j.VexTNT(this, this.levelLayer)).spawn(h.x, h.y, h.width, h.height), this.blocks.push(u), (this.vexTNT = u));
}
for (var F = 0, B = this.elevatorGenerator; F < B.length; F++) (L = B[F]).spawnCable();
for (var N = 0, U = this.blocks; N < U.length; N++) (u = U[N]).levelStart();
for (var Y = 0, z = this.obstacles; Y < z.length; Y++) z[Y].levelStart();
if (this.currentLevelID === V.Constants.hubID)
if (this.prevLevel && this.prevLevel !== V.Constants.mainmenuID && this.prevLevel !== V.Constants.bonusStageID)
this.player.spawn(this.actBlocks[this.prevLevel + "false"].xPos, this.actBlocks[this.prevLevel + "false"].topEdge);
else if (0 < V.Constants.levelsCompleted) {
var X = G.default.getInstance().getCheckPoint();
null === X ? this.player.spawn(this.actBlocks[V.Constants.levelsCompleted + "false"].xPos, this.actBlocks[V.Constants.levelsCompleted + "false"].topEdge) : this.player.spawn(X.x, X.y);
} else this.player.spawn(e, i);
else
this.currentLevelID === V.Constants.vexID && ((this.wireTrail = new K.WireTrail(this)), this.wireTrail.addWires(this.wires)),
-1 !== this.prevLevel.indexOf("skin") ? this.player.spawn(this.actBlocks[this.prevLevel + "false"].xPos, this.actBlocks[this.prevLevel + "false"].topEdge) : this.player.spawn(e, i);
(this.spawnX = e), (this.spawnY = i), (this.state = q.GameStates.Playing), (this.zoom = 1.5);
}),
(t.prototype.createColorParticle = function (t, e, i, n, s, r, o, a, h, l) {
if ((void 0 === s && (s = 0), void 0 === r && (r = 4), void 0 === o && (o = !0), void 0 === a && (a = !1), void 0 === h && (h = 140), void 0 === l && (l = !1), 0 !== V.Constants.particleLimit)) {
var u = new H.ColorParticle(this, this.particleLayer, s, r, o, a, 2 * h, l);
if ((u.spawn(t, e, i / 2, n / 2), this.particleNum++, this.particles.push(u), this.particleNum >= V.Constants.particleLimit))
for (var c = 0, d = this.particles; c < d.length; c++) {
var f = d[c];
if (f.alive) {
f.destroy();
break;
}
}
}
}),
(t.prototype.createColorParticleUI = function (t, e, i, n, s, r, o, a, h, l, u) {
if ((void 0 === r && (r = 0), void 0 === o && (o = 4), void 0 === a && (a = !0), void 0 === h && (h = !1), void 0 === l && (l = 140), void 0 === u && (u = !1), 0 !== V.Constants.particleLimit)) {
var c = new H.ColorParticle(this, i, r, o, a, h, 2 * l, u);
if ((c.spawn(t, e, n / 2, s / 2), (c.isUI = !0), this.particleUINum++, this.particlesUI.push(c), this.particleUINum >= V.Constants.particleLimit))
for (var d = 0, f = this.particlesUI; d < f.length; d++) {
var p = f[d];
if (p.alive) {
p.destroy(!0);
break;
}
}
}
}),
(t.prototype.createPlayerGib = function (t, e, i, n, s, r, o, a, h) {
if ((void 0 === r && (r = 0), void 0 === o && (o = 0), void 0 === a && (a = 4), void 0 === h && (h = !0), 0 !== V.Constants.particleLimit)) {
var l = new f.PlayerGib(this, this.particleLayer, s, a, h);
if ((l.spawn(t, e, i / 2, n / 2, r, o / 2), this.particleNum++, this.particles.push(l), this.particleNum >= V.Constants.particleLimit))
for (var u = 0, c = this.particles; u < c.length; u++) {
var d = c[u];
if (d.alive) {
d.destroy();
break;
}
}
}
}),
(t.prototype.updateBefore = function () {
for (var t = 0, e = this.cannons; t < e.length; t++) e[t].update();
for (var i = 0, n = this.portals; i < n.length; i++) n[i].update();
this.player.update();
}),
(t.prototype.updateAfter = function () {
for (var t = 0, e = this.blocks; t < e.length; t++) e[t].update();
this.wireTrail && this.wireTrail.update();
for (var i = 0, n = this.obstacles; i < n.length; i++) n[i].update();
for (var s = 0, r = this.pools; s < r.length; s++) r[s].update();
for (var o = 0; o < this.particles.length; o++) (a = this.particles[o]).alive ? a.update() : (this.particles.splice(o, 1), o--);
for (o = 0; o < this.particlesUI.length; o++) {
var a;
(a = this.particlesUI[o]).alive ? a.update() : (this.particlesUI.splice(o, 1), o--);
}
for (var h = 0, l = this.poles; h < l.length; h++) l[h].update();
for (var u = 0, c = this.checkpoints; u < c.length; u++) c[u].update();
for (var d = 0, f = this.fadesElements; d < f.length; d++) f[d].update();
for (var p = 0, g = this.fans; p < g.length; p++) g[p].update();
for (var v = 0, y = this.keyObjs; v < y.length; v++) y[v].update();
for (var m = 0, x = this.torchObjs; m < x.length; m++) x[m].update();
for (var b = 0, w = this.breatheBlasters; b < w.length; b++) w[b].update();
this.finishPortal && this.finishPortal.update(), this.deathText && this.deathText.update(), this.checkpointText && this.checkpointText.update();
}),
(t.prototype.getLevels = function () {
return this.levels;
}),
(t.prototype.getLevel = function (t) {
return this.levels.getLevel(t);
}),
(t.prototype.destroyLevel = function () {
if (this.blocks) {
for (var t = 0, e = this.blocks; t < e.length; t++) e[t].destroy();
this.blocks = null;
for (var i = 0, n = this.obstacles; i < n.length; i++) n[i].destroy();
this.obstacles = null;
for (var s = 0, r = this.ziplines; s < r.length; s++) r[s].destroy();
this.ziplines = null;
for (var o = 0, a = this.checkpoints; o < a.length; o++) a[o].destroy();
this.checkpoints = null;
for (var h = 0, l = this.fadesElements; h < l.length; h++) l[h].destroy();
this.fadesElements = null;
for (var u = 0, c = this.pools; u < c.length; u++) c[u].destroy();
this.pools = null;
for (var d = 0, f = this.poles; d < f.length; d++) f[d].destroy();
this.poles = null;
for (var p = 0, g = this.coins; p < g.length; p++) g[p].destroy();
this.coins = null;
for (var v = 0, y = this.fans; v < y.length; v++) y[v].destroy();
this.fans = null;
for (var m = 0, x = this.keyObjs; m < x.length; m++) x[m].destroy();
this.keyObjs = null;
for (var b = 0, w = this.torchObjs; b < w.length; b++) w[b].destroy();
this.torchObjs = null;
for (var T = 0, S = this.kites; T < S.length; T++) S[T].destroy();
this.kites = null;
for (var _ = 0, E = this.cannons; _ < E.length; _++) E[_].destroy();
this.cannons = null;
for (var P = 0, A = this.slopes; P < A.length; P++) A[P].destroy();
this.slopes = null;
for (var M = 0, C = this.breatheBlasters; M < C.length; M++) C[M].destroy();
this.breatheBlasters = null;
for (var O = 0, k = this.wires; O < k.length; O++) k[O].destroy();
this.wires = null;
for (var R = 0, L = this.lightSwitches; R < L.length; R++) L[R].destroy();
this.lightSwitches = null;
for (var I = 0, D = this.ropes; I < D.length; I++) D[I].destroy();
var F;
this.ropes = null;
for (var B = 0, N = this.portals; B < N.length; B++) {
var U = N[B];
U.destroy(), (F = U.colorIndex), this.colorPortalEnable.push(F);
}
(this.portals = null), (this.elevatorGenerator = null), (this.elevatorEliminator = null);
for (var Y = 0, z = this.misc; Y < z.length; Y++) z[Y].destroy();
this.misc = null;
for (var X = 0, V = this.particles; X < V.length; X++) V[X].destroy();
for (var G = 0, j = this.particlesUI; G < j.length; G++) j[G].destroy(!0);
this.wireTrail && this.wireTrail.destroy(), (this.wireTrail = null), (this.finishPortal = null), this.player.hide(), this.deathText.hide();
}
}),
t
);
})((n = a(n)).default);
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(1), i(2)]),
void 0 ===
(s = function (t, e, p, g, i) {
"use strict";
var n, s;
Object.defineProperty(e, "__esModule", { value: !0 }),
(e.ActState = void 0),
(i = a(i)),
((s = n = e.ActState || (e.ActState = {}))[(s.Locked = 0)] = "Locked"),
(s[(s.NotPlayed = 1)] = "NotPlayed"),
(s[(s.Played = 2)] = "Played"),
(s[(s.Challenge = 3)] = "Challenge");
var r = (function (f) {
function t(t, e, i, n, s) {
var r = f.call(this, t, e) || this;
(r.hardEnabled = !1), (r.level = n), (r.levelNum = i), (r.container = new Phaser.GameObjects.Container(t)), e.add(r.container), (r.container.name = "container" + i);
var o = r.levelNum - 1;
o < 0 && (o = 0);
var a = "actBlock instance ";
!0 === s && (a = "actBlockHard instance "), (r.sprite = new Phaser.GameObjects.Image(t, 0, 0, p.Atlases.gameplay, a + (1e4 + o))), r.container.add(r.sprite), (r.sprite.visible = !1), (r.isHard = s);
var h = r.level.getName();
!0 === r.isHard && (h += "\n" + r.level.getNameHard()),
(r.titleText = new g.JDText(t, 0, r.sprite.height / 2 + 3, p.Fonts.Main, h, 28)),
r.titleText.setOrigin(0.5, 0),
(r.titleText.visible = !1),
r.container.add(r.titleText),
(r.hardEnabled = r.checkEnableMode());
var l = r.levelNum - 1,
u = r.main.getLevel("" + l),
c = null;
if (((!0 === r.isHard && !1 === r.hardEnabled) || (u && !1 === u.isTargetLevelComplete(!1)) ? (c = "act-lock instance 10000") : !0 === n.isTargetLevelComplete(s) && (c = "act-check instance 10000"), c)) {
var d = new Phaser.GameObjects.Image(t, 45, 43, p.Atlases.gameplay, c);
r.container.add(d);
}
return (
(r.enterStage = new g.JDTextTranslated(t, 0, 0, p.Fonts.TutDeath, "pressDownEs", 16)),
r.enterStage.setOrigin(0.5, 0),
r.enterStage.setWordWrapWidth(130),
r.container.add(r.enterStage),
(r.downArrow = new Phaser.GameObjects.Image(t, 0, 0, p.Atlases.gameplay, "act-down-arrow instance 10000")),
r.container.add(r.downArrow),
(r.alive = !1),
(r.blockType = "act"),
(r.hangable = !0),
(r.scalable = !0),
r
);
}
return (
o(t, f),
(t.prototype.toggleTickBox = function () {}),
(t.prototype.spawn = function (t, e) {
this.init(t, e, 140, 140),
(this.container.x = t),
(this.container.y = e),
(this.sprite.visible = !0),
(this.titleText.visible = !0),
(this.enterStage.x = 0),
(this.enterStage.y = -60),
(this.enterStage.alpha = 0),
(this.downArrow.alpha = 0),
(this.downArrow.x = -7),
(this.downArrow.y = 14),
!0 === this.level.isTargetLevelComplete(!1) ? ((p.Constants.actFinishTime = -1), (this.state = n.Played)) : ((this.state = n.NotPlayed), (this.downArrow.visible = !0)),
(this.prevLand = !1);
}),
(t.prototype.updateGraphicPosition = function () {
(this.container.x = this.xPos), (this.container.y = this.yPos);
}),
(t.prototype.playerOffBlock = function () {
(!0 === this.isHard && !1 === this.hardEnabled) || (0 < this.enterStage.alpha && (this.enterStage.alpha -= 0.1), this.enterStage.alpha <= 0 && (this.downArrow.alpha = this.enterStage.alpha));
}),
(t.prototype.playerOnBlock = function () {
(!0 === this.isHard && !1 === this.hardEnabled) || (this.enterStage.alpha < 1 && (this.enterStage.alpha += 0.1), (this.downArrow.alpha = this.enterStage.alpha));
}),
(t.prototype.checkEnableMode = function () {
return !1 === this.isHard || this.level.act3Star();
}),
(t.prototype.update = function () {
this.landed ? (this.playerOnBlock(), this.prevLand || this.main.subScene.showInfoLevel(this.level, this.isHard)) : (this.playerOffBlock(), this.prevLand && this.main.subScene.hideInfoLevel()),
(this.prevLand = !!this.landed);
}),
(t.prototype.destroy = function () {
this.titleText.destroy(),
(this.titleText = null),
this.enterStage.destroy(),
(this.enterStage = null),
this.downArrow.destroy(),
(this.downArrow = null),
this.sprite.destroy(),
(this.sprite = null),
this.container.destroy(),
(this.container = null),
(this.level = null),
f.prototype.destroy.call(this);
}),
t
);
})(i.default);
e.default = r;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r =
(this && this.__extends) ||
((s = function (t, e) {
return (s =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
s(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
});
void 0 ===
(n = function (t, e) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function (o) {
function t(t, e, i, n, s) {
var r = o.call(this, t, e, i, n, s) || this;
return (r.refreshDrawTint = !1), r.addToUpdateList(), r;
}
return (
r(t, o),
(t.prototype.setFrameNumber = function (t) {
this.anims.setCurrentFrame(this.anims.currentAnim.frames[t]);
}),
(t.prototype.setTexture = function (t, e) {
return o.prototype.setTexture.call(this, t, e), (this.refreshDrawTint = !0), this;
}),
(t.prototype.setFrame = function (t, e, i) {
return o.prototype.setFrame.call(this, t, e, i), (this.refreshDrawTint = !0), this;
}),
(t.prototype.destroy = function () {
Phaser.GameObjects.GameObject.prototype.destroy.call(this);
}),
t
);
})(Phaser.GameObjects.Sprite);
e.default = i;
}.apply(e, [i, e])) || (t.exports = n);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(37)]),
void 0 ===
(s = function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (a) {
function t(t, e, i, n, s, r) {
void 0 === r && (r = 0);
var o = a.call(this, t, e, i, n) || this;
return (o.isPlaying = !1), (o.currFrame = -1), (o.loop = 0), o.setFrameName(s, r), o;
}
return (
o(t, a),
(t.prototype.setFrameName = function (t, e) {
void 0 === e && (e = 0), (this.currFrame = -1), (this.frameName = t), this.setAnimFrame(e);
}),
(t.prototype.stop = function () {
this.isPlaying = !1;
}),
(t.prototype.gotoAndPlay = function (t, e, i, n, s) {
void 0 === n && (n = 0), void 0 === s && (s = 0), this.playFrames(t, e, n, s), (this.counterAnim = i), this.setAnimFrame(this.counterAnim);
}),
(t.prototype.gotoAndStop = function (t) {
this.stop(), (this.counterAnim = t), this.setAnimFrame(this.counterAnim);
}),
(t.prototype.playFrames = function (t, e, i, n) {
void 0 === i && (i = 0),
void 0 === n && (n = 0.6),
(this.isPlaying = !0),
t < e ? (this.dir = n) : e < t ? (this.dir = -n) : t === e && (this.isPlaying = !1),
(this.startFrame = t),
(this.endFrame = e),
(this.loop = i),
(this.counterAnim = this.startFrame),
this.setAnimFrame(this.counterAnim);
}),
(t.prototype.reverse = function () {
if (((this.dir = -this.dir), (0 < this.dir && this.endFrame < this.startFrame) || (this.dir < 0 && this.endFrame > this.startFrame))) {
var t = this.startFrame;
(this.startFrame = this.endFrame), (this.endFrame = t);
}
!1 === this.isPlaying && this.playFrames(this.startFrame, this.endFrame, this.loop, Math.abs(this.dir));
}),
(t.prototype.setAnimFrame = function (t) {
var e = Math.floor(t);
this.currFrame !== e && ((this.currFrame = e), this.setFrame(this.frameName + (1e4 + this.currFrame)));
}),
(t.prototype.update = function () {
!0 === this.isPlaying &&
((this.counterAnim += this.dir),
((0 < this.dir && this.counterAnim > this.endFrame) || (this.dir < 0 && this.counterAnim < this.endFrame)) &&
(0 === this.loop
? ((this.isPlaying = !1), (this.counterAnim = this.endFrame))
: 0 < this.loop
? ((this.counterAnim = this.startFrame), (this.loop -= 1))
: this.loop < 0 && (this.counterAnim = this.startFrame),
this.emit(t.EVENT_COMPLETE, this)),
this.setAnimFrame(this.counterAnim));
}),
(t.EVENT_COMPLETE = "jdimageanimcomplete"),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(47)]),
void 0 ===
(s = function (t, e, l) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (l = a(l));
var i = (function (h) {
function t(t, e, i, n, s, r, o) {
void 0 === o && (o = 1);
var a = h.call(this, t, e, i, n, s, r, o) || this;
return (a.refreshDrawTint = !1), a.setOrigin(0.5, 0.5), t.game.renderer.type === Phaser.CANVAS && (a.renderCanvas = l.default.canvasRenderBitmapText), a;
}
return (
o(t, h),
(t.prototype.setText = function (t) {
return (this.refreshDrawTint = !0), h.prototype.setText.call(this, t), this;
}),
(t.prototype.destroy = function () {
Phaser.GameObjects.GameObject.prototype.destroy.call(this);
}),
t
);
})(Phaser.GameObjects.BitmapText);
e.default = i;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r =
(this && this.__extends) ||
((s = function (t, e) {
return (s =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
s(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
});
void 0 ===
(n = function (t, e) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function (i) {
function n(t) {
return (
i.call(this, {
game: t,
fragShader:
"precision mediump float;\n varying vec2 outTexCoord;\n varying vec4 vColor;\n uniform float blurX;\n uniform float blurY;\n uniform sampler2D uSampler;\n\n void main(void) {\n vec4 sum = vec4(0.0);\n\n sum += texture2D(uSampler, vec2(outTexCoord.x - 4.0*blurX, outTexCoord.y - 4.0*blurY)) * 0.05;\n sum += texture2D(uSampler, vec2(outTexCoord.x - 3.0*blurX, outTexCoord.y - 3.0*blurY)) * 0.09;\n sum += texture2D(uSampler, vec2(outTexCoord.x - 2.0*blurX, outTexCoord.y - 2.0*blurY)) * 0.12;\n sum += texture2D(uSampler, vec2(outTexCoord.x - blurX, outTexCoord.y - blurY)) * 0.15;\n\n sum += texture2D(uSampler, vec2(outTexCoord.x, outTexCoord.y)) * 0.16;\n\n sum += texture2D(uSampler, vec2(outTexCoord.x + blurX, outTexCoord.y + blurY)) * 0.15;\n sum += texture2D(uSampler, vec2(outTexCoord.x + 2.0*blurX, outTexCoord.y + 2.0*blurY)) * 0.12;\n sum += texture2D(uSampler, vec2(outTexCoord.x + 3.0*blurX, outTexCoord.y + 3.0*blurY)) * 0.09;\n sum += texture2D(uSampler, vec2(outTexCoord.x + 4.0*blurX, outTexCoord.y + 4.0*blurY)) * 0.05;\n\n gl_FragColor = sum;\n }",
uniforms: ["blurX", "blurY"],
}) || this
);
}
return (
r(n, i),
(n.prototype.onBind = function (t) {
i.prototype.onBind.call(this);
var e = t.pipelineData;
this.set1f("blurX", e.blurX), this.set1f("blurY", e.blurY);
}),
(n.prototype.onBatch = function (t) {
t && this.flush();
}),
(n.setBlur = function (t, e, i) {
(t.pipelineData.blurX = e * n.blurCoef), (t.pipelineData.blurY = i * n.blurCoef);
}),
(n.blurCoef = 1 / 7e3),
n
);
})(Phaser.Renderer.WebGL.Pipelines.SinglePipeline);
e.default = i;
}.apply(e, [i, e])) || (t.exports = n);
},
function (t, e, i) {
var n,
s,
o =
(this && this.__extends) ||
((s = function (t, e) {
return (s =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
s(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
});
void 0 ===
(n = function (t, e) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function (i) {
function r(t) {
return (
i.call(this, {
game: t,
vertShader:
"\n precision mediump float;\n uniform mat4 uProjectionMatrix;\n\n attribute vec2 inPosition;\n attribute vec2 inTexCoord;\n attribute vec4 inTint;\n\n varying vec2 outTexCoord;\n varying vec4 outTint;\n\n void main () {\n gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);\n\n outTexCoord = inTexCoord;\n outTint = inTint;\n }\n ",
fragShader:
"precision mediump float;\n varying vec2 outTexCoord;\n uniform float m[20];\n uniform sampler2D uSampler;\n\n varying vec4 outTint;\n\n void main(void){\n vec4 c = texture2D(uSampler, outTexCoord) * vec4(outTint.rgb * outTint.a, outTint.a);\n\n gl_FragColor.r = (m[0] * c.r);\n gl_FragColor.r += (m[1] * c.g);\n gl_FragColor.r += (m[2] * c.b);\n gl_FragColor.r += (m[3] * c.a);\n gl_FragColor.r += m[4];\n gl_FragColor.g = (m[5] * c.r);\n gl_FragColor.g += (m[6] * c.g);\n gl_FragColor.g += (m[7] * c.b);\n gl_FragColor.g += (m[8] * c.a);\n gl_FragColor.g += m[9];\n gl_FragColor.b = (m[10] * c.r);\n gl_FragColor.b += (m[11] * c.g);\n gl_FragColor.b += (m[12] * c.b);\n gl_FragColor.b += (m[13] * c.a);\n gl_FragColor.b += m[14];\n gl_FragColor.a = (m[15] * c.r);\n gl_FragColor.a += (m[16] * c.g);\n gl_FragColor.a += (m[17] * c.b);\n gl_FragColor.a += (m[18] * c.a);\n gl_FragColor.a += m[19];\n }",
uniforms: ["m"],
}) || this
);
}
return (
o(r, i),
(r.prototype.onBoot = function () {
this.set1fv("m", r.getDefaultColorMatrix());
}),
(r.prototype.onBind = function (t) {
i.prototype.onBind.call(this);
var e = t.pipelineData;
e && e.colorMatrix && this.set1fv("m", e.colorMatrix);
}),
(r.prototype.onBatch = function (t) {
t && this.flush();
}),
(r.brightness = function (t, e, i) {
var n = [e, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 1, 0];
this._loadMatrix(t, n, i);
}),
(r.greyscale = function (t, e, i) {
var n = [e, e, e, 0, 0, e, e, e, 0, 0, e, e, e, 0, 0, 0, 0, 0, 1, 0];
this._loadMatrix(t, n, i);
}),
(r.blackAndWhite = function (t, e) {
this._loadMatrix(t, [0.3, 0.6, 0.1, 0, 0, 0.3, 0.6, 0.1, 0, 0, 0.3, 0.6, 0.1, 0, 0, 0, 0, 0, 1, 0], e);
}),
(r.hue = function (t, e, i) {
e = ((e || 0) / 180) * Math.PI;
var n = Math.cos(e),
s = Math.sin(e),
r = [
0.213 + 0.787 * n + -0.213 * s,
0.715 + -0.715 * n + -0.715 * s,
0.072 + -0.072 * n + 0.928 * s,
0,
0,
0.213 + -0.213 * n + 0.143 * s,
0.715 + n * (1 - 0.715) + 0.14 * s,
0.072 + -0.072 * n + -0.283 * s,
0,
0,
0.213 + -0.213 * n + -0.787 * s,
0.715 + -0.715 * n + 0.715 * s,
0.072 + 0.928 * n + 0.072 * s,
0,
0,
0,
0,
0,
1,
0,
];
this._loadMatrix(t, r, i);
}),
(r.contrast = function (t, e, i) {
var n = (e || 0) + 1,
s = -128 * (n - 1),
r = [n, 0, 0, 0, s, 0, n, 0, 0, s, 0, 0, n, 0, s, 0, 0, 0, 1, 0];
this._loadMatrix(t, r, i);
}),
(r.saturate = function (t, e, i) {
var n = (2 * (e || 0)) / 3 + 1,
s = -0.5 * (n - 1),
r = [n, s, s, 0, 0, s, n, s, 0, 0, s, s, n, 0, 0, 0, 0, 0, 1, 0];
this._loadMatrix(t, r, i);
}),
(r.desaturate = function (t, e) {
this.saturate(t, -1, e);
}),
(r.negative = function (t, e) {
this._loadMatrix(t, [0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0], e);
}),
(r.sepia = function (t, e) {
this._loadMatrix(t, [0.393, 0.7689999, 0.18899999, 0, 0, 0.349, 0.6859999, 0.16799999, 0, 0, 0.272, 0.5339999, 0.13099999, 0, 0, 0, 0, 0, 1, 0], e);
}),
(r.technicolor = function (t, e) {
this._loadMatrix(
t,
[
1.9125277891456083,
-0.8545344976951645,
-0.09155508482755585,
0,
11.793603434377337,
-0.3087833385928097,
1.7658908555458428,
-0.10601743074722245,
0,
-70.35205161461398,
-0.231103377548616,
-0.7501899197440212,
1.847597816108189,
0,
30.950940869491138,
0,
0,
0,
1,
0,
],
e
);
}),
(r.polaroid = function (t, e) {
this._loadMatrix(t, [1.438, -0.062, -0.062, 0, 0, -0.122, 1.378, -0.122, 0, 0, -0.016, -0.016, 1.483, 0, 0, 0, 0, 0, 1, 0], e);
}),
(r.toBGR = function (t, e) {
this._loadMatrix(t, [0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0], e);
}),
(r.kodachrome = function (t, e) {
this._loadMatrix(
t,
[
1.1285582396593525,
-0.3967382283601348,
-0.03992559172921793,
0,
63.72958762196502,
-0.16404339962244616,
1.0835251566291304,
-0.05498805115633132,
0,
24.732407896706203,
-0.16786010706155763,
-0.5603416277695248,
1.6014850761964943,
0,
35.62982807460946,
0,
0,
0,
1,
0,
],
e
);
}),
(r.browni = function (t, e) {
this._loadMatrix(
t,
[
0.5997023498159715,
0.34553243048391263,
-0.2708298674538042,
0,
47.43192855600873,
-0.037703249837783157,
0.8609577587992641,
0.15059552388459913,
0,
-36.96841498319127,
0.24113635128153335,
-0.07441037908422492,
0.44972182064877153,
0,
-7.562075277591283,
0,
0,
0,
1,
0,
],
e
);
}),
(r.vintage = function (t, e) {
this._loadMatrix(
t,
[
0.6279345635605994,
0.3202183420819367,
-0.03965408211312453,
0,
9.651285835294123,
0.02578397704808868,
0.6441188644374771,
0.03259127616149294,
0,
7.462829176470591,
0.0466055556782719,
-0.0851232987247891,
0.5241648018700465,
0,
5.159190588235296,
0,
0,
0,
1,
0,
],
e
);
}),
(r.colorTone = function (t, e, i, n, s, r) {
var o = (((n = n || 16770432) >> 16) & 255) / 255,
a = ((n >> 8) & 255) / 255,
h = (255 & n) / 255,
l = (((s = s || 3375104) >> 16) & 255) / 255,
u = ((s >> 8) & 255) / 255,
c = (255 & s) / 255,
d = [0.3, 0.59, 0.11, 0, 0, o, a, h, (e = e || 0.2), 0, l, u, c, (i = i || 0.15), 0, o - l, a - u, h - c, 0, 0];
this._loadMatrix(t, d, r);
}),
(r.night = function (t, e, i) {
var n = [-2 * (e = e || 0.1), -e, 0, 0, 0, -e, 0, e, 0, 0, 0, e, 2 * e, 0, 0, 0, 0, 0, 1, 0];
this._loadMatrix(t, n, i);
}),
(r.predator = function (t, e, i) {
var n = [
11.224130630493164 * e,
-4.794486999511719 * e,
-2.8746118545532227 * e,
0 * e,
0.40342438220977783 * e,
-3.6330697536468506 * e,
9.193157196044922 * e,
-2.951810836791992 * e,
0 * e,
-1.316135048866272 * e,
-3.2184197902679443 * e,
-4.2375030517578125 * e,
7.476448059082031 * e,
0 * e,
0.8044459223747253 * e,
0,
0,
0,
1,
0,
];
this._loadMatrix(t, n, i);
}),
(r.lsd = function (t, e) {
this._loadMatrix(t, [2, -0.4, 0.5, 0, 0, -0.5, 2, -0.4, 0, 0, -0.4, -0.5, 3, 0, 0, 0, 0, 0, 1, 0], e);
}),
(r.reset = function (t) {
this._loadMatrix(t, this.getDefaultColorMatrix(), !1);
}),
(r.kill = function (t, e, i) {
t.resetPipeline(e, i);
}),
(r._loadMatrix = function (t, e, i) {
var n = e;
if ((i = !!i)) {
var s = t.pipelineData.colorMatrix;
s || (s = r.getDefaultColorMatrix()), this._multiply(n, s, e), (n = this._colorMatrix(n));
}
t.pipelineData.colorMatrix = n;
}),
(r._multiply = function (t, e, i) {
return (
(t[0] = e[0] * i[0] + e[1] * i[5] + e[2] * i[10] + e[3] * i[15]),
(t[1] = e[0] * i[1] + e[1] * i[6] + e[2] * i[11] + e[3] * i[16]),
(t[2] = e[0] * i[2] + e[1] * i[7] + e[2] * i[12] + e[3] * i[17]),
(t[3] = e[0] * i[3] + e[1] * i[8] + e[2] * i[13] + e[3] * i[18]),
(t[4] = e[0] * i[4] + e[1] * i[9] + e[2] * i[14] + e[3] * i[19]),
(t[5] = e[5] * i[0] + e[6] * i[5] + e[7] * i[10] + e[8] * i[15]),
(t[6] = e[5] * i[1] + e[6] * i[6] + e[7] * i[11] + e[8] * i[16]),
(t[7] = e[5] * i[2] + e[6] * i[7] + e[7] * i[12] + e[8] * i[17]),
(t[8] = e[5] * i[3] + e[6] * i[8] + e[7] * i[13] + e[8] * i[18]),
(t[9] = e[5] * i[4] + e[6] * i[9] + e[7] * i[14] + e[8] * i[19]),
(t[10] = e[10] * i[0] + e[11] * i[5] + e[12] * i[10] + e[13] * i[15]),
(t[11] = e[10] * i[1] + e[11] * i[6] + e[12] * i[11] + e[13] * i[16]),
(t[12] = e[10] * i[2] + e[11] * i[7] + e[12] * i[12] + e[13] * i[17]),
(t[13] = e[10] * i[3] + e[11] * i[8] + e[12] * i[13] + e[13] * i[18]),
(t[14] = e[10] * i[4] + e[11] * i[9] + e[12] * i[14] + e[13] * i[19]),
(t[15] = e[15] * i[0] + e[16] * i[5] + e[17] * i[10] + e[18] * i[15]),
(t[16] = e[15] * i[1] + e[16] * i[6] + e[17] * i[11] + e[18] * i[16]),
(t[17] = e[15] * i[2] + e[16] * i[7] + e[17] * i[12] + e[18] * i[17]),
(t[18] = e[15] * i[3] + e[16] * i[8] + e[17] * i[13] + e[18] * i[18]),
(t[19] = e[15] * i[4] + e[16] * i[9] + e[17] * i[14] + e[18] * i[19]),
t
);
}),
(r._colorMatrix = function (t) {
var e = new Float32Array(t);
return (e[4] /= 255), (e[9] /= 255), (e[14] /= 255), (e[19] /= 255), e;
}),
(r.getDefaultColorMatrix = function () {
return [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
}),
r
);
})(Phaser.Renderer.WebGL.Pipelines.SinglePipeline);
e.default = i;
}.apply(e, [i, e])) || (t.exports = n);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
});
(n = [i, e, i(22)]),
void 0 ===
(s = function (t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function (i) {
function t(t) {
return (
i.call(this, {
game: t,
vertShader:
"\n precision mediump float;\n uniform mat4 uProjectionMatrix;\n\n attribute vec2 inPosition;\n attribute vec2 inTexCoord;\n attribute vec4 inTint;\n\n varying vec2 outTexCoord;\n varying vec4 outTint;\n\n void main () {\n gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);\n\n outTexCoord = inTexCoord;\n outTint = inTint;\n }\n ",
fragShader:
"precision mediump float;\n varying vec2 outTexCoord;\n varying vec4 vColor;\n uniform float blurX;\n uniform float blurY;\n uniform sampler2D uSampler;\n\n uniform float m[20];\n varying vec4 outTint;\n\n void main(void) {\n //blur\n vec4 sum = vec4(0.0);\n sum += texture2D(uSampler, vec2(outTexCoord.x - 4.0*blurX, outTexCoord.y - 4.0*blurY)) * 0.05;\n sum += texture2D(uSampler, vec2(outTexCoord.x - 3.0*blurX, outTexCoord.y - 3.0*blurY)) * 0.09;\n sum += texture2D(uSampler, vec2(outTexCoord.x - 2.0*blurX, outTexCoord.y - 2.0*blurY)) * 0.12;\n sum += texture2D(uSampler, vec2(outTexCoord.x - blurX, outTexCoord.y - blurY)) * 0.15;\n\n sum += texture2D(uSampler, vec2(outTexCoord.x, outTexCoord.y)) * 0.16;\n\n sum += texture2D(uSampler, vec2(outTexCoord.x + blurX, outTexCoord.y + blurY)) * 0.15;\n sum += texture2D(uSampler, vec2(outTexCoord.x + 2.0*blurX, outTexCoord.y + 2.0*blurY)) * 0.12;\n sum += texture2D(uSampler, vec2(outTexCoord.x + 3.0*blurX, outTexCoord.y + 3.0*blurY)) * 0.09;\n sum += texture2D(uSampler, vec2(outTexCoord.x + 4.0*blurX, outTexCoord.y + 4.0*blurY)) * 0.05;\n\n //color matrix\n vec4 c = sum * vec4(outTint.rgb * outTint.a, outTint.a);\n\n gl_FragColor.r = (m[0] * c.r);\n gl_FragColor.r += (m[1] * c.g);\n gl_FragColor.r += (m[2] * c.b);\n gl_FragColor.r += (m[3] * c.a);\n gl_FragColor.r += m[4];\n gl_FragColor.g = (m[5] * c.r);\n gl_FragColor.g += (m[6] * c.g);\n gl_FragColor.g += (m[7] * c.b);\n gl_FragColor.g += (m[8] * c.a);\n gl_FragColor.g += m[9];\n gl_FragColor.b = (m[10] * c.r);\n gl_FragColor.b += (m[11] * c.g);\n gl_FragColor.b += (m[12] * c.b);\n gl_FragColor.b += (m[13] * c.a);\n gl_FragColor.b += m[14];\n gl_FragColor.a = (m[15] * c.r);\n gl_FragColor.a += (m[16] * c.g);\n gl_FragColor.a += (m[17] * c.b);\n gl_FragColor.a += (m[18] * c.a);\n gl_FragColor.a += m[19];\n }",
uniforms: ["blurX", "blurY", "m"],
}) || this
);
}
return (
o(t, i),
(t.prototype.onBoot = function () {
this.set1fv("m", n.PLColorMatrix.getDefaultColorMatrix());
}),
(t.prototype.onBind = function (t) {
i.prototype.onBind.call(this);
var e = t.pipelineData;
e.blurX && this.set1f("blurX", e.blurX), e.blurY && this.set1f("blurY", e.blurY), e.colorMatrix && this.set1fv("m", e.colorMatrix);
}),
(t.prototype.onBatch = function (t) {
t && this.flush();
}),
t
);
})(Phaser.Renderer.WebGL.Pipelines.SinglePipeline);
e.default = i;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
a =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
o =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(49)]),
void 0 ===
(s = function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (o) {
function t(t, e, i, n, s) {
var r = o.call(this, t, e, i, n, s) || this;
return (r._skewX = 0), (r._skewY = 0), (r._srB = 0), (r._srC = 0), (r._crA = 1), (r._crD = 1), (r._cachedRotX = 0), (r._cachedRotY = 0), r;
}
return (
a(t, o),
(t.prototype.setSkew = function (t, e) {
(this.skewX = t), (this.skewY = e);
}),
Object.defineProperty(t.prototype, "skewX", {
get: function () {
return this._skewX;
},
set: function (t) {
this._skewX = this.checkSkewValue(t);
},
enumerable: !1,
configurable: !0,
}),
Object.defineProperty(t.prototype, "skewY", {
get: function () {
return this._skewY;
},
set: function (t) {
this._skewY = this.checkSkewValue(t);
},
enumerable: !1,
configurable: !0,
}),
(t.prototype.checkSkewValue = function (t) {
return t > Math.PI ? (t = -(Math.PI - (t - Math.PI))) : t < -Math.PI && (t = Math.PI + (t + Math.PI)), t;
}),
t
);
})((i = o(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(50), i(4)]),
void 0 ===
(s = function (t, e, i, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var s = (function (i) {
function t() {
return (null !== i && i.apply(this, arguments)) || this;
}
return (
o(t, i),
(t.prototype.setText = function (t, e) {
return void 0 === e && (e = ""), i.prototype.setText.call(this, n.Localization.getText(t) + e), this;
}),
t
);
})((i = a(i)).default);
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n;
void 0 ===
(n = function (t, e) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function () {
function t(t, e, i, n, s, r) {
(this.currTimeScale = 1), (this.isPaused = !1), (this.isPlaying = !1), (this.scene = t), (this.spine = t.make.spine({ key: n, animationName: s, loop: r })), (this.x = e), (this.y = i);
}
return (
(t.prototype.pause = function () {
(this.isPaused = !0), (this.spine.timeScale = 0);
}),
(t.prototype.resume = function () {
(this.isPaused = !1), (this.spine.timeScale = this.currTimeScale);
}),
(t.prototype.stop = function () {
(this.spine.timeScale = 0), (this.isPlaying = !1);
}),
(t.prototype.getView = function () {
return this.spine;
}),
(t.prototype.setSkin = function (t) {
this.spine.setSkinByName(t);
}),
(t.prototype.play = function (t, e, i, n) {
void 0 === i && (i = 1), (this.currTimeScale = i), (this.spine.timeScale = this.currTimeScale), this.spine.play(t, e, n), (this.isPlaying = !0), (this.currAnimationName = t);
}),
(t.prototype.getCurrentAnimationName = function () {
return this.currAnimationName;
}),
(t.prototype.getAnimationProgress = function () {
var t = this.spine.getCurrentAnimation().duration;
return (this.spine.state.getCurrent(0).trackTime % t) / t;
}),
(t.prototype.playFromProgress = function (t, e) {
this.play(t), (this.spine.state.getCurrent(0).trackTime = this.spine.getCurrentAnimation().duration * e);
}),
Object.defineProperty(t.prototype, "x", {
get: function () {
return this.spine.x;
},
set: function (t) {
this.spine.x = t;
},
enumerable: !1,
configurable: !0,
}),
Object.defineProperty(t.prototype, "y", {
get: function () {
return this.spine.y;
},
set: function (t) {
this.spine.y = t;
},
enumerable: !1,
configurable: !0,
}),
Object.defineProperty(t.prototype, "rotation", {
get: function () {
return this.spine.rotation;
},
set: function (t) {
this.spine.rotation = t;
},
enumerable: !1,
configurable: !0,
}),
Object.defineProperty(t.prototype, "scaleX", {
get: function () {
return this.spine.scaleX;
},
set: function (t) {
this.spine.scaleX = t;
},
enumerable: !1,
configurable: !0,
}),
Object.defineProperty(t.prototype, "scaleY", {
get: function () {
return this.spine.scaleY;
},
set: function (t) {
this.spine.scaleY = t;
},
enumerable: !1,
configurable: !0,
}),
(t.prototype.destroy = function () {
(this.scene = null), (this.spine = null);
}),
(t.EVENT_COMPLETE = "complete"),
(t.EVENT_DISPOSE = "dispose"),
(t.EVENT_END = "end"),
(t.EVENT_EVENT = "event"),
(t.EVENT_INTERRUPTED = "interrupted"),
(t.EVENT_START = "start"),
t
);
})();
e.default = i;
}.apply(e, [i, e])) || (t.exports = n);
},
function (t, e, i) {
var n;
void 0 ===
(n = function (t, e) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (e.JDMaskParent = void 0);
var i = (function () {
function s(t, e, i, n) {
void 0 === i && (i = 0),
void 0 === n && (n = 0),
(this.x = 0),
(this.y = 0),
(this.scaleX = 1),
(this.scaleY = 1),
(this.rotation = 0),
(this.graphics = new Phaser.GameObjects.Graphics(t)),
(this.graphics.parentContainer = e),
s.tempMatrix || ((s.tempMatrix = new Phaser.GameObjects.Components.TransformMatrix()), (s.parentMatrix = new Phaser.GameObjects.Components.TransformMatrix())),
(this.x = i),
(this.y = n);
}
return (
(s.prototype.addUpdateTransformEvents = function () {
this.graphics.scene.events.on(Phaser.Scenes.Events.PRE_RENDER, this.updateParentTransform, this);
}),
(s.prototype.setXY = function (t, e) {
(this.x = t), (this.y = e);
}),
(s.prototype.updateParentTransform = function () {
this.graphics.parentContainer.getWorldTransformMatrix(s.tempMatrix, s.parentMatrix),
(this.graphics.x = s.tempMatrix.getX(this.x, this.y)),
(this.graphics.y = s.tempMatrix.getY(this.x, this.y)),
(this.graphics.scaleX = s.tempMatrix.scaleX * this.scaleX),
(this.graphics.scaleY = s.tempMatrix.scaleY * this.scaleY),
(this.graphics.rotation = s.tempMatrix.rotation + this.rotation);
}),
(s.prototype.updateParentScale = function () {
this.graphics.parentContainer.getWorldTransformMatrix(s.tempMatrix, s.parentMatrix), (this.graphics.scaleX = s.tempMatrix.scaleX * this.scaleX), (this.graphics.scaleY = s.tempMatrix.scaleY * this.scaleY);
}),
(s.prototype.destroy = function () {
this.graphics.scene.events.off(Phaser.Scenes.Events.POST_UPDATE, this.updateParentTransform, this), this.graphics.destroy(), (this.graphics = null);
}),
s
);
})();
e.JDMaskParent = i;
}.apply(e, [i, e])) || (t.exports = n);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(2)]),
void 0 ===
(s = function (t, e, s, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (
(i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "appearingBlock instance 10000")),
e.add(i.sprite),
(i.sprite.visible = !1),
(i.alive = !1),
(i.hangable = !0),
(i.scalable = !0),
(i.isIgnore = !1),
i
);
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i, n, s, r, o) {
this.init(t, e, i, n),
(this.actTime = 0),
(this.timeShow = o),
(this.timeHide = r),
(this.alive = s),
(this.initVisible = s),
(this.sprite.alpha = s ? 1 : 0),
(this.sprite.visible = !0),
(this.sprite.x = t),
(this.sprite.y = e),
this.sprite.setScale(i / this.sprite.width, n / this.sprite.height);
}),
(t.prototype.updateGraphicPosition = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos);
}),
(t.prototype.update = function () {
(this.xPos === this.prevX && this.yPos === this.prevY) || this.updatePosition(),
(this.actTime += 0.5),
this.alive && this.actTime >= this.timeHide ? this.hide() : !this.alive && this.actTime >= this.timeShow && this.show(),
this.alive && this.actTime >= this.timeHide * (1 - s.Constants.AppearingBlockDisapper)
? (this.sprite.tint = 30583)
: !this.alive && this.actTime >= this.timeShow * (1 - s.Constants.AppearingBlockApper) && ((this.sprite.alpha = 0.2), (this.sprite.tint = 16777215));
}),
(t.prototype.show = function () {
(this.actTime = 0), (this.alive = !0), (this.sprite.alpha = 1);
}),
(t.prototype.hide = function () {
(this.actTime = 0), (this.alive = !1), (this.sprite.alpha = 0);
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), n.prototype.destroy.call(this);
}),
(t.prototype.resetLevel = function () {
n.prototype.resetLevel.call(this), (this.actTime = 0), (this.alive = this.initVisible), (this.sprite.alpha = this.initVisible ? 1 : 0);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(2)]),
void 0 ===
(s = function (t, e, r, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (i.sprite = new Phaser.GameObjects.Image(t, 0, 0, "basicBlockColors")), i.layer.add(i.sprite), (i.sprite.visible = !1), (i.alive = !1), (i.hangable = !0), (i.scalable = !0), i;
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i, n) {
this.init(t, e, i, n), (this.sprite.x = t), (this.sprite.y = e), this.sprite.setScale(i / this.sprite.width, n / this.sprite.height);
var s = Number(this.main.currentLevelID);
(!s || s > r.Constants.basicBlockColorFrames) && (s = 0), this.sprite.setFrame(s), (this.sprite.visible = !0);
}),
(t.prototype.update = function () {
(this.xPos === this.prevX && this.yPos === this.prevY) || this.updatePosition();
}),
(t.prototype.updateGraphicPosition = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos);
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), n.prototype.destroy.call(this);
}),
(t.prototype.reset = function () {}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(2)]),
void 0 ===
(s = function (t, e, s, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (
(i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "blockedWall instance 10000")),
e.add(i.sprite),
(i.sprite.visible = !1),
(i.alive = !1),
(i.hangable = !1),
(i.scalable = !1),
(i.blockType = "wall"),
i
);
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i, n, s) {
90 === Math.abs(s) ? this.init(t, e, n, i) : this.init(t, e, i, n),
(this.sprite.angle = s),
(this.sprite.displayWidth = i),
(this.sprite.displayHeight = n),
(this.sprite.x = t),
(this.sprite.y = e),
(this.sprite.visible = !0);
}),
(t.prototype.updateGraphicPosition = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos);
}),
(t.prototype.update = function () {
(this.xPos === this.prevX && this.yPos === this.prevY) || this.updatePosition();
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), n.prototype.destroy.call(this);
}),
(t.prototype.reset = function () {}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(20), i(2)]),
void 0 ===
(s = function (t, e, c, i, n) {
"use strict";
var d, s;
Object.defineProperty(e, "__esModule", { value: !0 }),
(e.SpikeDirection = void 0),
(n = a(n)),
((s = d = e.SpikeDirection || (e.SpikeDirection = {}))[(s.up = 0)] = "up"),
(s[(s.down = 1)] = "down"),
(s[(s.left = 2)] = "left"),
(s[(s.right = 3)] = "right");
var r = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (
(i.sprite = new Phaser.GameObjects.Image(t, 0, 0, "basicBlockColors")),
e.add(i.sprite),
(i.sprite.visible = !1),
(i.alive = !1),
(i.hangable = !0),
(i.scalable = !0),
(i.spikesUp = null),
(i.spikesDown = null),
(i.spikesLeft = null),
(i.spikesRight = null),
i
);
}
return (
o(t, n),
Object.defineProperty(t.prototype, "upEnable", {
get: function () {
return this.spikesUp ? 1 : 0;
},
set: function (t) {
t ? this.enableSpike(d.up) : this.disableSpike(d.up);
},
enumerable: !1,
configurable: !0,
}),
Object.defineProperty(t.prototype, "downEnable", {
get: function () {
return this.spikesDown ? 1 : 0;
},
set: function (t) {
t ? this.enableSpike(d.down) : this.disableSpike(d.down);
},
enumerable: !1,
configurable: !0,
}),
Object.defineProperty(t.prototype, "leftEnable", {
get: function () {
return this.spikesLeft ? 1 : 0;
},
set: function (t) {
t ? this.enableSpike(d.left) : this.disableSpike(d.left);
},
enumerable: !1,
configurable: !0,
}),
Object.defineProperty(t.prototype, "rightEnable", {
get: function () {
return this.spikesRight ? 1 : 0;
},
set: function (t) {
t ? this.enableSpike(d.right) : this.disableSpike(d.right);
},
enumerable: !1,
configurable: !0,
}),
(t.prototype.spawn = function (t, e, i, n, s, r, o, a, h) {
this.init(t, e, 100, 100),
(this.spikeMove = 0),
(this.isSpikeUp = i),
(this.startSpikeUp = i),
(this.timeDown = h),
(this.timeUp = a),
(this.actTime = this.isSpikeUp ? this.timeDown : this.timeUp),
(this.isDelay = !0),
n && this.enableSpike(d.up),
s && this.enableSpike(d.down),
r && this.enableSpike(d.left),
o && this.enableSpike(d.right);
var l = this.isSpikeUp ? c.Constants.spikeBlockUp : c.Constants.spikeBlockDown;
this.spikesUp && this.spikesUp.spawn(this.xPos, this.yPos - (49.5 + this.spikesUp.height / 2) - l, 0),
this.spikesDown && this.spikesDown.spawn(this.xPos, this.yPos + (49.5 + this.spikesDown.height / 2) + l, 180),
this.spikesLeft && this.spikesLeft.spawn(this.xPos - (49.5 + this.spikesLeft.height / 2) - l, this.yPos, -90),
this.spikesRight && this.spikesRight.spawn(this.xPos + (49.5 + this.spikesRight.height / 2) + l, this.yPos, 90),
(this.sprite.x = t),
(this.sprite.y = e),
this.sprite.setScale(this.width / this.sprite.width, this.height / this.sprite.height);
var u = Number(this.main.currentLevelID);
(!u || u > c.Constants.basicBlockColorFrames) && (u = 0), this.sprite.setFrame(u), (this.sprite.visible = !0);
}),
(t.prototype.updateGraphicPosition = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos);
}),
(t.prototype.enableSpike = function (t) {
if (t === d.up) {
if (!this.spikesUp) {
var e = new i.Spike10xHigh(this.main, this.main.obstacleLayer);
this.main.obstacles.push(e), (this.spikesUp = e);
}
} else
t === d.down
? this.spikesDown || ((e = new i.Spike10xHigh(this.main, this.main.obstacleLayer)), this.main.obstacles.push(e), (this.spikesDown = e))
: t === d.left
? this.spikesLeft || ((e = new i.Spike10xHigh(this.main, this.main.obstacleLayer)), this.main.obstacles.push(e), (this.spikesLeft = e))
: t !== d.right || this.spikesRight || ((e = new i.Spike10xHigh(this.main, this.main.obstacleLayer)), this.main.obstacles.push(e), (this.spikesRight = e));
}),
(t.prototype.disableSpike = function (t) {
if (t === d.up) {
if (this.spikesUp) {
var e = this.main.obstacles.indexOf(this.spikesUp);
this.main.obstacles.splice(e, 1), this.spikesUp.destroy(), (this.spikesUp = null);
}
} else
t === d.down
? this.spikesDown && ((e = this.main.obstacles.indexOf(this.spikesDown)), this.main.obstacles.splice(e, 1), this.spikesDown.destroy(), (this.spikesDown = null))
: t === d.left
? this.spikesLeft && ((e = this.main.obstacles.indexOf(this.spikesLeft)), this.main.obstacles.splice(e, 1), this.spikesLeft.destroy(), (this.spikesLeft = null))
: t === d.right && this.spikesRight && ((e = this.main.obstacles.indexOf(this.spikesRight)), this.main.obstacles.splice(e, 1), this.spikesRight.destroy(), (this.spikesRight = null));
}),
(t.prototype.update = function () {
if (this.isDelay) return (this.actTime -= 0.5), void (this.actTime <= 0 && (this.isDelay = !1));
var t = c.Constants.spikeBlockVelocity;
this.spikeMove = this.spikeMove + t;
var e,
i,
n = Math.abs(c.Constants.spikeBlockDown - c.Constants.spikeBlockUp);
this.spikeMove >= n && ((t = n - (this.spikeMove - t)), (this.spikeMove = 0)),
this.isSpikeUp && (t *= -1),
this.spikesUp && ((e = this.spikesUp.yPos - t), this.spikesUp.movePosition(this.spikesUp.xPos, e)),
this.spikesDown && ((e = this.spikesDown.yPos + t), this.spikesDown.movePosition(this.spikesDown.xPos, e)),
this.spikesLeft && ((i = this.spikesLeft.xPos - t), this.spikesLeft.movePosition(i, this.spikesLeft.yPos)),
this.spikesRight && ((i = this.spikesRight.xPos + t), this.spikesRight.movePosition(i, this.spikesRight.yPos)),
0 === this.spikeMove && ((this.isSpikeUp = !this.isSpikeUp), (this.isDelay = !0), (this.actTime = this.isSpikeUp ? this.timeUp : this.timeDown)),
(this.xPos === this.prevX && this.yPos === this.prevY) || this.updatePosition();
}),
(t.prototype.destroy = function () {
(this.spikesUp = null), (this.spikesDown = null), (this.spikesLeft = null), (this.spikesRight = null), this.sprite.destroy(), (this.sprite = null), n.prototype.destroy.call(this);
}),
(t.prototype.resetLevel = function () {
(this.spikeMove = 0), (this.isSpikeUp = this.startSpikeUp);
var t = this.isSpikeUp ? c.Constants.spikeBlockUp : c.Constants.spikeBlockDown;
this.spikesUp && this.spikesUp.movePosition(this.xPos, this.yPos - (49.5 + this.spikesUp.height / 2) - t),
this.spikesDown && this.spikesDown.movePosition(this.xPos, this.yPos + (49.5 + this.spikesDown.height / 2) + t),
this.spikesLeft && this.spikesLeft.movePosition(this.xPos - (49.5 + this.spikesLeft.height / 2) - t, this.yPos),
this.spikesRight && this.spikesRight.movePosition(this.xPos + (49.5 + this.spikesRight.height / 2) + t, this.yPos);
}),
t
);
})(n.default);
e.default = r;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(25)]),
void 0 ===
(s = function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t() {
return (null !== n && n.apply(this, arguments)) || this;
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i) {
void 0 === i && (i = 1), n.prototype.spawn.call(this, t, e, i), (this.yVelocity = 0), (this.speedUp = -1), (this.checkPools = !0);
}),
(t.prototype.update = function () {
if ((this.alive && ((this.yVelocity += this.main.gravity), (this.yPos += this.yVelocity), this.updatePosition(), this.checkBlockCollisions()), !0 === this.checkPools))
for (var t = 0, e = this.main.pools; t < e.length; t++) {
var i = e[t];
SAT.testCirclePolygon(this.deathCircle, i.totalPolygon) && (this.layer.remove(this.sprite), this.main.underPoolLayer.add(this.sprite));
}
n.prototype.update.call(this);
}),
(t.prototype.checkBlockCollisions = function () {
for (var t = 0, e = this.main.blocks; t < e.length; t++) {
var i = e[t];
i.alive &&
SAT.testPolygonCircle(i.topBoundPolygon, this.deathCircle) &&
void 0 === i.falling &&
((this.checkPools = !1),
-1 === this.speedUp ? (this.speedUp = Math.abs(this.yVelocity)) : (this.yVelocity = this.speedUp),
(this.yVelocity *= -1),
(this.yPos = i.yPos - i.halfHeight - this.deathCircle.r));
}
}),
(t.prototype.reset = function () {
(this.yPos = this.startY), (this.yVelocity = 0), this.updatePosition();
}),
(t.prototype.resetLevel = function () {
this.reset(), n.prototype.resetLevel.call(this);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(9)]),
void 0 ===
(s = function (t, e, s, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (
(i.obstacleType = "bullet"),
(i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "classicLaserBullet instance 10000")),
e.add(i.sprite),
(i.sprite.visible = !1),
(i.deathBoxPolygon = new SAT.Box(new SAT.Vector(0, 0), 8, 8).toPolygon()),
i.deathBoxPolygon.setOffset(new SAT.Vector(-4, -4)),
(i.alive = !1),
i
);
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i, n, s) {
(this.xPos = t),
(this.yPos = e),
(this.xVelocity = i),
(this.yVelocity = n),
(this.rad = s),
(this.sprite.x = t),
(this.sprite.y = e),
(this.sprite.rotation = s),
(this.deathBoxPolygon.pos.x = t),
(this.deathBoxPolygon.pos.y = e),
this.deathBoxPolygon.setAngle(s),
(this.alive = !0),
(this.sprite.visible = !0);
}),
(t.prototype.update = function () {
if (this.alive) {
(this.xPos += this.xVelocity), (this.yPos += this.yVelocity), this.updatePositions();
for (var t = 0, e = this.main.blocks; t < e.length; t++) {
var i = e[t];
if (SAT.testPolygonPolygon(i.totalBoundPolygon, this.deathBoxPolygon)) {
for (var n = 0; n < 10; n++) this.main.createColorParticle(this.xPos, this.yPos, 16 * Math.random() - 8, 16 * Math.random() - 8, 16711680);
this.die();
}
}
SAT.testPolygonPolygon(this.deathBoxPolygon, this.main.player.totalPolygon) && (this.main.player.kill(14), this.die());
}
}),
(t.prototype.updatePositions = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos), (this.deathBoxPolygon.pos.x = this.xPos), (this.deathBoxPolygon.pos.y = this.yPos);
}),
(t.prototype.die = function () {
(this.alive = !1), (this.sprite.visible = !1);
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), (this.deathBoxPolygon = null);
}),
(t.prototype.resetLevel = function () {
this.die();
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(25)]),
void 0 ===
(s = function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (e) {
function t() {
var t = (null !== e && e.apply(this, arguments)) || this;
return (t.moveDist = 100), t;
}
return (
o(t, e),
(t.prototype.spawn = function (t, e, i, n, s) {
void 0 === i && (i = 1),
void 0 === n && (n = 1),
void 0 === s && (s = 100),
(this.xPos = t),
(this.yPos = e),
(this.sprite.x = t),
(this.sprite.y = e),
(this.sprite.visible = !0),
(this.xVelocity = i),
(this.startSpeed = i),
(this.moveDist = s),
(this.startX = t),
(this.startY = e),
(this.deathCircle.pos.x = t),
(this.deathCircle.pos.y = e),
(this.alive = !0),
1 !== n && ((this.sprite.scale = n), (this.deathCircle.r = 45 * n));
}),
(t.prototype.update = function () {
e.prototype.update.call(this);
var t = this.xPos;
0 < this.xVelocity ? this.xPos > this.startX + this.moveDist && (this.xVelocity = -this.xVelocity) : this.xPos < this.startX - this.moveDist && (this.xVelocity = -this.xVelocity),
(this.xPos += this.xVelocity),
this.xPos !== t && ((this.sprite.x = this.xPos), (this.deathCircle.pos.x = this.xPos));
}),
(t.prototype.reset = function () {
(this.xVelocity = this.startSpeed), (this.xPos = this.startX), (this.yPos = this.startY), this.updatePosition();
}),
(t.prototype.resetLevel = function () {
this.reset();
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
a =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
h =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(20), i(0), i(7), i(9)]),
void 0 ===
(s = function (t, e, s, r, i, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (i = h(i));
var o = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (
(i.sprite = new Phaser.GameObjects.Image(t, 0, 0, r.Atlases.gameplay, "buzzsawOnStick instance 10000")),
e.add(i.sprite),
i.sprite.setOrigin(0.1, 0.5),
(i.sprite.visible = !1),
(i.obstacleType = "misc"),
(i.buzzsaw = new s.Buzzsaw(i.main, e)),
(i.buzzsaw.checkUnderPool = !1),
i.main.obstacles.push(i.buzzsaw),
i
);
}
return (
a(t, n),
(t.prototype.spawn = function (t, e, i) {
(this.xPos = t), (this.yPos = e), (this.rotation = i), (this.startRotation = i), (this.sprite.x = t), (this.sprite.y = e);
var n = (this.rotation * Math.PI) / 180;
(this.sprite.rotation = n), (this.sprite.visible = !0), (this.alive = !0), this.buzzsaw.spawn(this.xPos + 130 * Math.cos(n), this.yPos + 130 * Math.sin(n), 0.5);
}),
(t.prototype.update = function () {
(this.rotation += 4), this.updatePosition();
}),
(t.prototype.updatePosition = function () {
var t = i.default.toRad(this.rotation);
(this.sprite.rotation = t), (this.buzzsaw.xPos = this.xPos + 130 * Math.cos(t)), (this.buzzsaw.yPos = this.yPos + 130 * Math.sin(t)), this.buzzsaw.updatePosition();
}),
(t.prototype.destroy = function () {
n.prototype.destroy.call(this), this.sprite.destroy(), (this.sprite = null), (this.buzzsaw = null);
}),
(t.prototype.resetLevel = function () {
(this.rotation = this.startRotation), this.updatePosition();
}),
t
);
})((n = h(n)).default);
e.default = o;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(25)]),
void 0 ===
(s = function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (i.moveDist = 100), (i.obstacleType = "buzzsaw"), (i.alive = !1), i;
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i, n, s) {
void 0 === i && (i = 1),
void 0 === n && (n = 1),
void 0 === s && (s = 100),
(this.xPos = t),
(this.yPos = e),
(this.sprite.x = t),
(this.sprite.y = e),
(this.sprite.visible = !0),
(this.moveDist = s),
(this.yVelocity = i),
(this.startSpeed = i),
(this.startX = t),
(this.startY = e),
(this.deathCircle.pos.x = t),
(this.deathCircle.pos.y = e),
(this.alive = !0),
1 !== n && ((this.sprite.scale = n), (this.deathCircle.r = 45 * n));
}),
(t.prototype.update = function () {
n.prototype.update.call(this);
var t = this.yPos;
this.yVelocity < 0 ? this.yPos < this.startY - this.moveDist && (this.yVelocity = -this.yVelocity) : this.yPos > this.startY + this.moveDist && (this.yVelocity = -this.yVelocity),
(this.yPos += this.yVelocity),
this.yPos !== t && this.updatePosition();
}),
(t.prototype.updatePosition = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos), (this.deathCircle.pos.y = this.yPos);
}),
(t.prototype.reset = function () {
(this.yVelocity = this.startSpeed), (this.xPos = this.startX), (this.yPos = this.startY), this.updatePosition();
}),
(t.prototype.resetLevel = function () {
this.reset();
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(20), i(0), i(7), i(6), i(9)]),
void 0 ===
(s = function (t, e, s, r, l, u, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (l = a(l)), (u = a(u));
var n = (function (n) {
function h(t, e) {
var i = n.call(this, t, e) || this;
return (
(i.sprite = new Phaser.GameObjects.Image(t, 0, 0, r.Atlases.gameplay, "classicLaser instance 10000")),
e.add(i.sprite),
(i.bullet = new s.Bullet(t, t.obstacleLayer)),
i.main.obstacles.push(i.bullet),
(i.alive = !1),
i
);
}
return (
o(h, n),
(h.prototype.spawn = function (t, e) {
(this.xPos = t),
(this.yPos = e),
(this.startX = t),
(this.startY = e),
(this.sprite.x = t),
(this.sprite.y = e),
(this.sprite.rotation = l.default.PI05),
(this.spinDest = l.default.PI05),
(this.shootTimer = 0);
}),
(h.prototype.levelStart = function () {
this.storeNearbyPlatforms();
}),
(h.prototype.storeNearbyPlatforms = function () {
this.platforms = [];
for (var t = new SAT.Circle(new SAT.Vector(this.xPos, this.yPos), 250), e = 0, i = this.main.blocks; e < i.length; e++) {
var n = i[e];
SAT.testCirclePolygon(t, n.totalBoundPolygon) && this.platforms.push(n);
}
}),
(h.prototype.update = function () {
var t = this.main.player;
if (t && t.alive) {
var e = !0;
if (Math.pow(this.xPos - t.xPos, 2) + Math.pow(this.yPos - t.yPos, 2) <= h.RANGE_SQ) {
for (
var i = new SAT.Polygon(new SAT.Vector(0, 0), [new SAT.Vector(this.xPos, this.yPos), new SAT.Vector(t.xPos, t.yPos)]),
n = new SAT.Polygon(new SAT.Vector(0, 0), [new SAT.Vector(this.xPos, this.yPos), new SAT.Vector(t.xPos, t.yPos - t.height)]),
s = 0,
r = this.platforms;
s < r.length;
s++
) {
var o = r[s];
if (SAT.testPolygonPolygon(i, o.totalBoundPolygon) && SAT.testPolygonPolygon(n, o.totalBoundPolygon)) {
e = !1;
break;
}
}
e &&
((this.spinDest = Math.atan2(t.yPos - this.yPos, t.xPos - this.xPos)),
(this.shootTimer += 1),
this.shootTimer >= h.FIRE_RATE &&
((this.shootTimer = 0),
this.bullet.spawn(this.xPos, this.yPos, 12.5 * Math.cos(this.sprite.rotation), 12.5 * Math.sin(this.sprite.rotation), this.sprite.rotation),
u.default.playSFX("laserFire")));
} else this.spinDest = l.default.PI05;
var a = this.sprite.rotation - this.spinDest;
Math.abs(a) < l.default.toRad(0.5) || a > l.default.toRad(200) ? (this.sprite.rotation = this.spinDest) : (this.sprite.rotation -= 0.125 * a);
}
}),
(h.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), n.prototype.destroy.call(this);
}),
(h.prototype.reset = function () {
this.shootTimer = 0;
}),
(h.prototype.resetLevel = function () {
this.reset(), (this.spinDest = l.default.PI05);
}),
(h.FIRE_RATE = 80),
(h.RANGE_SQ = 62500),
h
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(25)]),
void 0 ===
(s = function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (i.obstacleType = "buzzsaw"), (i.alive = !1), i;
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i) {
void 0 === i && (i = 1),
(this.xPos = t),
(this.yPos = e),
(this.sprite.x = t),
(this.sprite.y = e),
(this.sprite.visible = !0),
(this.enlarging = !0),
(this.deathCircle.pos.x = t),
(this.deathCircle.pos.y = e),
(this.scaleXStart = i),
(this.scale = i),
(this.alive = !0);
}),
(t.prototype.update = function () {
this.enlarging
? ((this.scale += 0.01 * this.scaleXStart), this.scale > 2.5 * this.scaleXStart && ((this.scale = 2.5 * this.scaleXStart), (this.enlarging = !1)))
: ((this.scale -= 0.01 * this.scaleXStart), this.scale < 0.5 * this.scaleXStart && ((this.scale = 0.5 * this.scaleXStart), (this.enlarging = !0))),
n.prototype.update.call(this),
this.updatePosition();
}),
(t.prototype.updatePosition = function () {
this.sprite.setScale(this.scale, this.scale), (this.sprite.x = this.xPos), (this.sprite.y = this.yPos), (this.deathCircle.pos.y = this.yPos), (this.deathCircle.r = 42 * this.scale);
}),
(t.prototype.resetLevel = function () {}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
h =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
o =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(7), i(9)]),
void 0 ===
(s = function (t, e, a, n, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (n = o(n));
var s = (function (o) {
function t(t, e, i) {
void 0 === i && (i = !1);
var n = o.call(this, t, e) || this;
(n.obstacleType = "spike"),
(n.sprite = new Phaser.GameObjects.Image(t, 0, 0, a.Atlases.gameplay, "fallingSpike instance 10000")),
e.add(n.sprite),
(n.sprite.visible = !1),
(n.alive = !1),
(n.dispenser = i),
(n.width = 7.5),
(n.height = 14.75),
(n.deathBoxPolygon = new SAT.Box(new SAT.Vector(0, 0), n.width, n.height).toPolygon());
var s = 0.5 * n.width,
r = 0.5 * n.height;
return n.deathBoxPolygon.setOffset(new SAT.Vector(-s, -r)), (n.gravity = 0.6 * t.gravity), n;
}
return (
h(t, o),
(t.prototype.spawn = function (t, e, i) {
(this.xPos = t),
(this.yPos = e),
(this.startX = t),
(this.startY = e),
(this.xVelocity = 0),
(this.yVelocity = 0),
(this.sprite.x = t),
(this.sprite.y = e),
(this.sprite.rotation = n.default.toRad(i)),
this.dispenser || (this.sprite.visible = !0),
(this.alive = !0),
(this.deathBoxPolygon.pos.x = t),
(this.deathBoxPolygon.pos.y = e),
(this.falling = !1),
(this.fallDist = 0),
(this.speed = 0);
}),
(t.prototype.levelStart = function () {
this.range = 350;
for (var t = this.sprite.rotation, e = 0, i = 10; i <= this.range; ) {
for (var n = new SAT.Polygon(new SAT.Vector(this.xPos, this.yPos), [new SAT.Vector(0, 0), new SAT.Vector(Math.cos(t) * i, Math.sin(t) * i)]), s = 0, r = this.main.blocks; s < r.length; s++) {
var o = r[s],
a = new SAT.Response();
SAT.testPolygonPolygon(n, o.totalBoundPolygon, a) && Math.abs(a.overlap) > e && (e = Math.abs(a.overlap));
}
if (0 < e) {
i -= e;
break;
}
if (i === this.range) break;
(i += 20) > this.range && (i = this.range);
}
(this.hitDist = i),
(this.searchHitBox = new SAT.Box(new SAT.Vector(this.xPos, this.yPos), this.hitDist, 16).toPolygon()),
(this.searchHitBox.offset = new SAT.Vector(0, -8)),
this.searchHitBox.setAngle(t);
}),
(t.prototype.update = function () {
if (!1 !== this.alive)
if (!0 === this.falling)
(this.xVelocity += Math.cos(this.sprite.rotation) * this.gravity),
(this.yVelocity += Math.sin(this.sprite.rotation) * this.gravity),
(this.speed += this.gravity),
(this.xPos += this.xVelocity),
(this.yPos += this.yVelocity),
(this.fallDist += this.speed),
this.updatePosition(),
this.fallDist > this.hitDist && this.reset();
else {
if (this.xPos !== this.startX || this.yPos !== this.startY) {
var t = this.startX - this.xPos,
e = this.startY - this.yPos;
Math.abs(t) < 1 ? (this.xPos = this.startX) : (this.xPos += t / 10), Math.abs(e) < 1 ? (this.yPos = this.startY) : (this.yPos += (this.startY - this.yPos) / 10), this.updatePosition();
}
var i = this.main.player;
SAT.testPolygonPolygon(this.searchHitBox, i.totalPolygon) && (this.falling = !0);
}
}),
(t.prototype.updatePosition = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos), (this.deathBoxPolygon.pos.x = this.xPos), (this.deathBoxPolygon.pos.y = this.yPos);
}),
(t.prototype.reset = function () {
!1 === this.dispenser
? ((this.falling = !1),
(this.xPos = this.startX - 15 * Math.cos(this.sprite.rotation)),
(this.yPos = this.startY - 15 * Math.sin(this.sprite.rotation)),
(this.xVelocity = 0),
(this.yVelocity = 0),
(this.sprite.x = this.xPos),
(this.sprite.y = this.yPos),
(this.deathBoxPolygon.pos.x = this.xPos),
(this.deathBoxPolygon.pos.y = this.yPos),
(this.fallDist = 0),
(this.speed = 0))
: this.die();
}),
(t.prototype.dispenserFire = function () {
(this.falling = !0),
(this.alive = !0),
(this.xPos = this.startX + 15 * Math.cos(this.sprite.rotation)),
(this.yPos = this.startY + 15 * Math.sin(this.sprite.rotation)),
(this.xVelocity = 0),
(this.yVelocity = 0),
(this.sprite.x = this.xPos),
(this.sprite.y = this.yPos),
(this.sprite.visible = !0),
(this.deathBoxPolygon.pos.x = this.xPos),
(this.deathBoxPolygon.pos.y = this.yPos),
(this.fallDist = 0),
(this.speed = 0);
}),
(t.prototype.die = function () {
(this.sprite.visible = !1), (this.alive = !1);
}),
(t.prototype.destroy = function () {
this.sprite && this.sprite.destroy(), (this.sprite = null), (this.searchHitBox = null), (this.deathBoxPolygon = null), o.prototype.destroy.call(this);
}),
(t.prototype.resetLevel = function () {
this.reset();
}),
t
);
})((i = o(i)).default);
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(9)]),
void 0 ===
(s = function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (i.laserGraphic = new Phaser.GameObjects.Graphics(t)), e.add(i.laserGraphic), (i.obstacleType = "laser"), i;
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i, n) {
(this.xPos = t),
(this.yPos = e),
(this.xLength = i - t),
(this.yLength = n - e),
(this.alive = !0),
(this.deathHitBoxPolygon = new SAT.Polygon(new SAT.Vector(this.xPos, this.yPos), [new SAT.Vector(0, 0), new SAT.Vector(i - t, n - e)])),
(this.laserGraphic.x = this.xPos),
(this.laserGraphic.y = this.yPos),
this.laserGraphic.lineStyle(2, 16724787),
this.laserGraphic.lineBetween(0, 0, i - t, n - e);
}),
(t.prototype.update = function () {
if (Math.random() < 0.05) {
var t = Math.random(),
e = this.xPos + this.xLength * t,
i = this.yPos + this.yLength * t;
this.main.createColorParticle(e, i, 10 * Math.random() - 5, -5 * Math.random(), 16711680, 4, !1, !1, 10, !0);
}
}),
(t.prototype.destroy = function () {
this.laserGraphic.destroy(), (this.laserGraphic = null), n.prototype.destroy.call(this);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(9)]),
void 0 ===
(s = function (t, e, s, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (
(i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "quadrant instance 10000")), e.add(i.sprite), (i.sprite.visible = !1), (i.obstacleType = "quadrant"), (i.deathHitBoxPolygons = []), i
);
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i, n, s) {
void 0 === s && (s = 1),
(this.xPos = t),
(this.yPos = e),
(this.startX = t),
(this.startY = e),
(this.rad = (i * Math.PI) / 180),
(this.startRad = this.rad),
(this.rotSpeed = n),
(this.sprite.x = t),
(this.sprite.y = e),
(this.sprite.visible = !0),
this.sprite.setScale(s, s),
(this.alive = !0),
(this.attachHitBoxPolygon = new SAT.Box(new SAT.Vector(t, e), 10, 10).toPolygon()),
this.attachHitBoxPolygon.setOffset(new SAT.Vector(-5, -5));
var r = new SAT.Box(new SAT.Vector(0, 0), 10 * s, 10 * s).toPolygon();
r.setOffset(new SAT.Vector(75 * s, 0)),
this.deathHitBoxPolygons.push(r),
(r = new SAT.Box(new SAT.Vector(0, 0), 10 * s, 10 * s).toPolygon()).setOffset(new SAT.Vector(0, 75 * s)),
this.deathHitBoxPolygons.push(r),
(r = new SAT.Box(new SAT.Vector(0, 0), 10 * s, 10 * s).toPolygon()).setOffset(new SAT.Vector(-75 * s, 0)),
this.deathHitBoxPolygons.push(r),
(r = new SAT.Box(new SAT.Vector(0, 0), 10 * s, 10 * s).toPolygon()).setOffset(new SAT.Vector(0, -75 * s)),
this.deathHitBoxPolygons.push(r);
}),
(t.prototype.update = function () {
(this.rad += this.rotSpeed), this.updatePosition();
}),
(t.prototype.updatePosition = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos), (this.sprite.rotation = this.rad);
for (var t = 0, e = this.deathHitBoxPolygons; t < e.length; t++) {
var i = e[t];
(i.pos.x = this.xPos), (i.pos.y = this.yPos), i.setAngle(this.rad);
}
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), (this.deathHitBoxPolygons = null), n.prototype.destroy.call(this);
}),
(t.prototype.resetLevel = function () {
(this.rad = this.startRad), this.updatePosition();
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(7), i(9)]),
void 0 ===
(s = function (t, e, s, r, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (r = a(r));
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (
(i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "reaper instance 10000")),
e.add(i.sprite),
(i.sprite.visible = !1),
(i.obstacleType = "reaper"),
(i.killValue = 2),
(i.deathHitBoxes = []),
i
);
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i, n) {
void 0 === n && (n = 1),
(this.xPos = t),
(this.yPos = e),
(this.startX = t),
(this.startY = e),
(this.rad = r.default.toRad(i)),
(this.startRad = this.rad),
(this.sprite.x = t),
(this.sprite.y = e),
this.sprite.setScale(n, n),
(this.sprite.visible = !0),
(this.alive = !0),
(this.deathHitBoxes = []);
var s = new SAT.Box(new SAT.Vector(t, e), 27 * n, 17 * n).toPolygon();
s.setOffset(new SAT.Vector(-27 * n, -150 * n)),
this.deathHitBoxes.push(s),
(s = new SAT.Box(new SAT.Vector(t, e), 13 * n, 13 * n).toPolygon()).setOffset(new SAT.Vector(-84 * n, -130 * n)),
this.deathHitBoxes.push(s),
(s = new SAT.Box(new SAT.Vector(t, e), 6 * n, 6 * n).toPolygon()).setOffset(new SAT.Vector(-118 * n, -92 * n)),
this.deathHitBoxes.push(s),
(s = new SAT.Box(new SAT.Vector(t, e), 3 * n, 3 * n).toPolygon()).setOffset(new SAT.Vector(-132 * n, -52 * n)),
this.deathHitBoxes.push(s),
(s = new SAT.Box(new SAT.Vector(t, e), 27 * n, 17 * n).toPolygon()).setOffset(new SAT.Vector(-27 * n, -150 * n)),
s.setAngle(Math.PI),
this.deathHitBoxes.push(s),
(s = new SAT.Box(new SAT.Vector(t, e), 13 * n, 13 * n).toPolygon()).setOffset(new SAT.Vector(-84 * n, -130 * n)),
s.setAngle(Math.PI),
this.deathHitBoxes.push(s),
(s = new SAT.Box(new SAT.Vector(t, e), 6 * n, 6 * n).toPolygon()).setOffset(new SAT.Vector(-118 * n, -92 * n)),
s.setAngle(Math.PI),
this.deathHitBoxes.push(s),
(s = new SAT.Box(new SAT.Vector(t, e), 3 * n, 3 * n).toPolygon()).setOffset(new SAT.Vector(-132 * n, -52 * n)),
s.setAngle(Math.PI),
this.deathHitBoxes.push(s);
}),
(t.prototype.update = function () {
(this.rad -= r.default.toRad(2.5)), this.updatePositions();
}),
(t.prototype.updatePositions = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos), (this.sprite.rotation = this.rad);
for (var t = 0; t < this.deathHitBoxes.length; t++) {
var e = this.deathHitBoxes[t];
t < 4 ? e.setAngle(this.rad) : e.setAngle(this.rad + Math.PI);
}
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), (this.deathHitBoxes = null), n.prototype.destroy.call(this);
}),
(t.prototype.resetLevel = function () {
this.rad = this.startRad;
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
u =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
o =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(20), i(0), i(1), i(9)]),
void 0 ===
(s = function (t, e, a, h, l, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (r) {
function o(t, e) {
var i = r.call(this, t, e) || this;
(i.sprite = new l.JDSprite(t, 0, 0, h.Atlases.gameplay, "shurikanDispenser instance 10024")),
e.add(i.sprite),
(i.sprite.visible = !1),
(i.obstacleType = "shurikan"),
(i.alive = !1),
(i.hitBoxPoly = new SAT.Box(new SAT.Vector(0, 0), 20, 20).toPolygon()),
i.hitBoxPoly.setOffset(new SAT.Vector(-10, -10)),
(i.spikes = []);
for (var n = 0; n < 4; n++) {
var s = new a.FallingSpike(t, e, !0);
(i.spikes[n] = s), i.main.obstacles.push(s);
}
return i;
}
return (
u(o, r),
(o.prototype.spawn = function (t, e) {
(this.xPos = t), (this.yPos = e), (this.sprite.x = t), (this.sprite.y = e), this.sprite.setScale(1, 1), (this.sprite.visible = !0), (this.alive = !0), (this.charge = o.CHARGE_TIME);
for (var i = 0; i < 4; i++) this.spikes[i].spawn(t, e, 90 * i);
(this.hitBoxPoly.pos.x = this.xPos), (this.hitBoxPoly.pos.y = this.yPos), (this.rad = 0);
}),
(o.prototype.levelStart = function () {
this.storeNearbyPlatforms();
}),
(o.prototype.storeNearbyPlatforms = function () {
this.platforms = [];
for (var t = new SAT.Circle(new SAT.Vector(this.xPos, this.yPos), 250), e = 0, i = this.main.blocks; e < i.length; e++) {
var n = i[e];
SAT.testCirclePolygon(t, n.totalBoundPolygon) && this.platforms.push(n);
}
}),
(o.prototype.fireSpikes = function () {
for (var t = 0; t < 4; t++) this.spikes[t].dispenserFire();
this.sprite.anims.play("shurikanDispenserSpawn");
}),
(o.prototype.update = function () {
var t = this.main.player,
e = !0;
if (t && t.alive) {
var i = new SAT.Polygon(new SAT.Vector(0, 0), [new SAT.Vector(this.xPos, this.yPos), new SAT.Vector(t.xPos, t.yPos - 15)]);
if (Math.pow(this.xPos - t.xPos - 15, 2) + Math.pow(this.yPos - t.yPos, 2) <= 62500) {
for (var n = 0, s = this.platforms; n < s.length; n++) {
var r = s[n];
if (SAT.testPolygonPolygon(i, r.totalBoundPolygon)) {
e = !1;
break;
}
}
e && this.charge >= o.CHARGE_TIME && (this.fireSpikes(), (this.charge = 0), (this.rad = 0));
}
}
this.charge < o.CHARGE_TIME && ((this.charge += 1), (this.rad += Math.PI / o.CHARGE_TIME)), (this.sprite.rotation = this.rad);
}),
(o.prototype.destroy = function () {
(this.spikes = null), this.sprite.destroy(), (this.sprite = null), (this.platforms = null), (this.hitBoxPoly = null);
}),
(o.prototype.resetLevel = function () {
this.charge = 0;
}),
(o.CHARGE_TIME = 70),
o
);
})((i = o(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(9)]),
void 0 ===
(s = function (t, e, r, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (s) {
function t(t, e, i) {
var n = s.call(this, t, e) || this;
return (
(n.spawner = i),
(n.sprite = new Phaser.GameObjects.Image(t, 0, 0, r.Atlases.gameplay, "shurikanHorizontal instance 10000")),
e.add(n.sprite),
(n.sprite.visible = !1),
(n.obstacleType = "shurikan"),
(n.alive = !1),
(n.hitBoxPoly = new SAT.Box(new SAT.Vector(-3001, 0), 20, 20).toPolygon()),
n.hitBoxPoly.setOffset(new SAT.Vector(-10, -10)),
n
);
}
return (
o(t, s),
(t.prototype.spawn = function (t, e, i, n, s) {
void 0 === s && (s = 0),
(this.xPos = t),
(this.yPos = e),
(this.xVelocity = i),
(this.yVelocity = n),
(this.speed = Math.sqrt(i * i + n * n)),
(this.dist = 0),
this.sprite.setScale(1, 1),
this.sprite.setFrame("shurikanHorizontal instance 1000" + s),
(this.sprite.visible = !0),
(this.alive = !0),
(this.rotation = 0),
this.updatePosition();
}),
(t.prototype.update = function () {
if (this.alive) {
if (((this.rotation += 7.5), 200 < this.dist)) {
if (((this.sprite.scaleX -= 0.05), (this.sprite.scaleY = this.sprite.scaleX), this.sprite.scaleX <= 0.1)) {
(this.alive = !1), (this.sprite.visible = !1);
var t = this.spawner.shurikanActivePool.indexOf(this);
this.spawner.shurikanActivePool.splice(t, 1), this.spawner.shurikanPool.push(this), (this.spawner.spawned -= 1);
}
} else (this.xPos += this.xVelocity), (this.yPos += this.yVelocity), (this.dist += this.speed);
this.updatePosition(), (this.sprite.rotation = (this.rotation * Math.PI) / 180);
}
}),
(t.prototype.updatePosition = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos), (this.hitBoxPoly.pos.x = this.xPos), (this.hitBoxPoly.pos.y = this.yPos);
}),
(t.prototype.resetLevel = function () {
this.sprite.visible = !1;
var t = this.spawner.shurikanActivePool.indexOf(this);
this.spawner.shurikanActivePool.splice(t, 1), this.spawner.shurikanPool.push(this);
}),
(t.prototype.destroy = function () {
(this.alive = !1), this.sprite.destroy(), (this.hitBoxPoly = null), s.prototype.destroy.call(this);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
h =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
l =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(20), i(0), i(9)]),
void 0 ===
(s = function (t, e, o, a, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (r) {
function t(t, e) {
var i = r.call(this, t, e) || this;
(i.fireTimer = 60),
(i.sprite = new Phaser.GameObjects.Image(t, 0, 0, a.Atlases.gameplay, "shurikanSpawner instance 10000")),
e.add(i.sprite),
(i.obstacleType = "spawner"),
(i.alive = !1),
(i.shurikanActivePool = []),
(i.shurikanPool = []);
for (var n = 0; n < 3; n++) {
var s = new o.ShurikanHorizontal(i.main, e, i);
i.shurikanPool.push(s), i.main.obstacles.push(s);
}
return i;
}
return (
h(t, r),
(t.prototype.spawn = function (t, e, i) {
for (
this.xPos = t, this.yPos = e, this.rotation = i, this.sprite.x = t, this.sprite.y = e, this.sprite.rotation = (i * Math.PI) / 180, this.cooldown = 0, this.spawned = 0, this.alive = !0;
0 < this.shurikanActivePool.length;
)
this.shurikanActivePool[0].resetLevel();
}),
(t.prototype.update = function () {
if (this.alive && this.spawned < 3 && ((this.cooldown += 1), this.cooldown > this.fireTimer)) {
this.cooldown = 0;
var t = this.shurikanPool.pop();
if (!t) return;
var e = 1.3 * Math.cos((this.rotation * Math.PI) / 180),
i = 1.3 * Math.sin((this.rotation * Math.PI) / 180),
n = 0;
90 === this.rotation || -90 === this.rotation ? (n = 1) : 0 !== this.rotation && -180 !== this.rotation && 180 !== this.rotation && (n = 2),
this.shurikanActivePool.push(t),
t.spawn(this.xPos, this.yPos, e / 2, i / 2, n),
(this.spawned += 1),
3 === this.spawned && (this.cooldown = -120);
}
}),
(t.prototype.resetLevel = function () {
(this.spawned = 0), (this.cooldown = 0);
}),
(t.prototype.destroy = function () {
for (; 0 < this.shurikanActivePool.length; ) this.shurikanActivePool[0].resetLevel();
this.sprite.destroy(), (this.sprite = null), (this.shurikanPool = null), (this.shurikanActivePool = null), r.prototype.destroy.call(this);
}),
t
);
})((i = l(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(9)]),
void 0 ===
(s = function (t, e, r, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (s) {
function t(t, e, i) {
var n = s.call(this, t, e) || this;
return (
(n.sparkBlock = i),
(n.obstacleType = "spark"),
(n.sprite = new Phaser.GameObjects.Image(t, 0, 0, r.Atlases.gameplay, "spark instance 10000")),
e.add(n.sprite),
(n.sprite.visible = !1),
(n.deathBoxPolygon = new SAT.Box(new SAT.Vector(0, 0), 16, 16).toPolygon()),
n.deathBoxPolygon.setOffset(new SAT.Vector(-8, -8)),
n
);
}
return (
o(t, s),
(t.prototype.spawn = function (t, e) {
this.sparkBlock && ((t = this.sparkBlock.leftEdge), (e = this.sparkBlock.topEdge), (this.direction = "right")), (this.alive = !0), (this.sprite.visible = !0), this.setXY(t, e);
}),
(t.prototype.hide = function () {
(this.sprite.visible = !1), (this.alive = !1);
}),
(t.prototype.update = function () {
if (!1 !== this.alive) {
this.sparkBlock &&
("right" === this.direction
? ((this.xPos += 2.5), this.xPos > this.sparkBlock.rightEdge && ((this.xPos = this.sparkBlock.rightEdge), (this.direction = "down")))
: "down" === this.direction
? ((this.yPos += 2.5), this.yPos > this.sparkBlock.bottomEdge && ((this.yPos = this.sparkBlock.bottomEdge), (this.direction = "left")))
: "left" === this.direction
? ((this.xPos -= 2.5), this.xPos < this.sparkBlock.leftEdge && ((this.xPos = this.sparkBlock.leftEdge), (this.direction = "up")))
: "up" === this.direction && ((this.yPos -= 2.5), this.yPos < this.sparkBlock.topEdge && ((this.yPos = this.sparkBlock.topEdge), (this.direction = "right")))),
Math.random() < 0.2 && this.main.createColorParticle(this.xPos, this.yPos, 10 * Math.random() - 5, 5 * Math.random() - 2.5, 16763904, 4, !1, !1, 10, !0),
this.updatePosition();
for (var t = 0, e = this.main.pools; t < e.length; t++) {
var i = e[t];
SAT.testPolygonPolygon(this.deathBoxPolygon, i.totalPolygon) && (i.electric = !0);
}
}
}),
(t.prototype.setXY = function (t, e) {
(this.xPos = t), (this.yPos = e), this.updatePosition();
}),
(t.prototype.updatePosition = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos), (this.deathBoxPolygon.pos.x = this.xPos), (this.deathBoxPolygon.pos.y = this.yPos);
}),
(t.prototype.resetLevel = function () {
if (this.sparkBlock) {
var t = this.sparkBlock.leftEdge,
e = this.sparkBlock.topEdge;
(this.direction = "right"), (this.xPos = t), (this.yPos = e);
}
this.updatePosition();
}),
(t.prototype.destroy = function () {
null !== this.sprite && (this.sprite.destroy(), (this.sprite = null), (this.deathBoxPolygon = null));
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(18)]),
void 0 ===
(s = function (t, e, i, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var s = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
o(e, t),
(e.prototype.init = function () {
(this.sprite = new Phaser.GameObjects.Image(this.main, 0, 0, i.Atlases.gameplay, "spike5x instance 10000")),
this.layer.add(this.sprite),
(this.sprite.visible = !1),
(this.width = 48),
(this.height = 18),
(this.spikeNum = 5);
}),
e
);
})((n = a(n)).default);
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(18)]),
void 0 ===
(s = function (t, e, i, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var s = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
o(e, t),
(e.prototype.init = function () {
(this.sprite = new Phaser.GameObjects.Image(this.main, 0, 0, i.Atlases.gameplay, "spike10x instance 10000")),
this.layer.add(this.sprite),
(this.sprite.visible = !1),
(this.width = 97),
(this.height = 18),
(this.spikeNum = 10);
}),
e
);
})((n = a(n)).default);
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(18)]),
void 0 ===
(s = function (t, e, i, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var s = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
o(e, t),
(e.prototype.init = function () {
(this.sprite = new Phaser.GameObjects.Image(this.main, 0, 0, i.Atlases.gameplay, "spike10xHigh instance 10000")),
this.layer.add(this.sprite),
(this.sprite.visible = !1),
(this.width = 83),
(this.height = 48);
}),
e
);
})((n = a(n)).default);
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(18)]),
void 0 ===
(s = function (t, e, i, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var s = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
o(e, t),
(e.prototype.init = function () {
(this.sprite = new Phaser.GameObjects.Image(this.main, 0, 0, i.Atlases.gameplay, "spike15x instance 10000")),
this.layer.add(this.sprite),
(this.sprite.visible = !1),
(this.width = 146),
(this.height = 18),
(this.spikeNum = 15);
}),
e
);
})((n = a(n)).default);
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(18)]),
void 0 ===
(s = function (t, e, i, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var s = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
o(e, t),
(e.prototype.init = function () {
(this.sprite = new Phaser.GameObjects.Image(this.main, 0, 0, i.Atlases.gameplay, "spike20x instance 10000")),
this.layer.add(this.sprite),
(this.sprite.visible = !1),
(this.width = 194),
(this.height = 18),
(this.spikeNum = 20);
}),
e
);
})((n = a(n)).default);
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(18)]),
void 0 ===
(s = function (t, e, i, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var s = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
o(e, t),
(e.prototype.init = function () {
(this.sprite = new Phaser.GameObjects.Image(this.main, 0, 0, i.Atlases.gameplay, "spike25x instance 10000")),
this.layer.add(this.sprite),
(this.sprite.visible = !1),
(this.width = 243),
(this.height = 18),
(this.spikeNum = 25);
}),
e
);
})((n = a(n)).default);
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(18)]),
void 0 ===
(s = function (t, e, i, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var s = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
o(e, t),
(e.prototype.init = function () {
(this.sprite = new Phaser.GameObjects.Image(this.main, 0, 0, i.Atlases.gameplay, "spike30x instance 10000")),
this.layer.add(this.sprite),
(this.sprite.visible = !1),
(this.width = 292),
(this.height = 18),
(this.spikeNum = 30);
}),
e
);
})((n = a(n)).default);
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(18)]),
void 0 ===
(s = function (t, e, i, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var s = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
o(e, t),
(e.prototype.init = function () {
(this.sprite = new Phaser.GameObjects.Image(this.main, 0, 0, i.Atlases.gameplay, "spikeActBlockHard instance 10000")),
this.layer.add(this.sprite),
(this.sprite.visible = !1),
(this.width = 126),
(this.height = 18),
(this.spikeNum = 13);
}),
e
);
})((n = a(n)).default);
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n, s;
(n = [i, e, i(20), i(0)]),
void 0 ===
(s = function (t, e, i, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var s = (function () {
function t(t) {
(this.sparkSpeed = n.Constants.wireSparkSpeed), (this.wireWidth = 50), (this.main = t), (this.spark = new i.Spark(t, t.topObstacleLayer, null)), this.main.obstacles.push(this.spark), (this.burning = !1);
}
return (
(t.prototype.addWires = function (t) {
(this.wires = t), this.start();
}),
(t.prototype.start = function () {
(this.burning = !0), (this.currentInd = this.wires.length), this.nextWire();
}),
(t.prototype.nextWire = function () {
if (0 === this.currentInd) return (this.burning = !1), this.main.vexTNT && (this.main.vexTNT.exploding = !0), void this.spark.hide();
(this.currentInd -= 1),
(this.currentWire = this.wires[this.currentInd]),
this.spark.spawn(this.currentWire.xPos + Math.cos(this.currentWire.sprite.rotation) * this.wireWidth, this.currentWire.yPos + Math.sin(this.currentWire.sprite.rotation) * this.wireWidth);
}),
(t.prototype.updateSpark = function () {
this.spark.setXY(
this.currentWire.xPos + Math.cos(this.currentWire.sprite.rotation) * this.currentWire.sprite.displayWidth,
this.currentWire.yPos + Math.sin(this.currentWire.sprite.rotation) * this.currentWire.sprite.displayWidth
);
}),
(t.prototype.update = function () {
!1 !== this.burning &&
((this.currentWire.sprite.scaleX -= this.sparkSpeed / 50),
this.currentWire.sprite.scaleX <= 0 && ((this.currentWire.sprite.scaleX = 0), this.nextWire()),
this.updateSpark(),
this.main.updateProgressTnt(this.getpercent()));
}),
(t.prototype.getpercent = function () {
for (var t = 0, e = this.wires.length, i = 0, n = this.wires; i < n.length; i++) t += n[i].sprite.scaleX;
return t / e;
}),
(t.prototype.destroy = function () {
(this.burning = !1), (this.main = null), (this.wires = null), (this.spark = null);
}),
(t.prototype.resetLevel = function () {
for (var t = 0, e = this.wires; t < e.length; t++) e[t].resetLevel();
this.start();
}),
t
);
})();
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
h =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
l =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(31), i(0), i(1), i(6), i(2)]),
void 0 ===
(s = function (t, e, i, s, r, o, a) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (o = l(o));
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (
(i.container = new Phaser.GameObjects.Container(t)),
e.add(i.container),
(i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "bounceBlock instance 10000")),
i.container.add(i.sprite),
(i.arrowAnimation = new r.JDSprite(t, 0, 0, s.Atlases.gameplay, "bounceBlockArrow instance 10000")),
i.container.add(i.arrowAnimation),
(i.alive = !1),
(i.hangable = !0),
(i.scalable = !0),
(i.blockType = "bounce"),
i
);
}
return (
h(t, n),
(t.prototype.spawn = function (t, e, i, n) {
this.init(t, e, i, n),
(this.offScale = 1),
(this.startScaleX = i / 100),
(this.startScaleY = n / 100),
(this.container.x = t),
(this.container.y = e),
this.container.setScale(this.startScaleX, this.startScaleY),
!0 === s.Constants.blend && this.arrowAnimation.play({ key: "bounceBlockArrow", repeat: -1 }),
(this.bouncing = !1);
}),
(t.prototype.initBounds = function () {
(this.totalBound = new SAT.Box(new SAT.Vector(this.leftEdge, this.topEdge), this.width, this.height)),
(this.topBound = new SAT.Box(new SAT.Vector(this.leftEdge, this.topEdge), this.width, a.default.TOP_BOUND_HEIGHT)),
(this.lhBound = new SAT.Box(new SAT.Vector(this.leftEdge, this.topEdge), this.halfWidth, a.default.TOP_BOUND_HEIGHT)),
(this.rhBound = new SAT.Box(new SAT.Vector(this.xPos, this.topEdge), this.halfWidth, a.default.TOP_BOUND_HEIGHT)),
(this.leftBound = new SAT.Box(new SAT.Vector(this.leftEdge, this.topEdge), this.halfWidth, this.height)),
(this.rightBound = new SAT.Box(new SAT.Vector(this.xPos, this.topEdge), this.halfWidth, this.height)),
(this.bottomBound = new SAT.Box(new SAT.Vector(this.leftEdge, this.yPos + this.halfHeight - a.default.TOP_BOUND_HEIGHT), this.width, a.default.TOP_BOUND_HEIGHT));
}),
(t.prototype.initOffsets = function () {}),
(t.prototype.updatePosition = function () {
this.initEdges(),
(this.totalBound.pos.x = this.leftEdge),
(this.totalBound.pos.y = this.topEdge),
(this.topBound.pos.x = this.leftEdge),
(this.topBound.pos.y = this.topEdge),
(this.lhBound.pos.x = this.leftEdge),
(this.lhBound.pos.y = this.topEdge),
(this.rhBound.pos.x = this.xPos),
(this.rhBound.pos.y = this.topEdge),
(this.leftBound.pos.x = this.leftEdge),
(this.leftBound.pos.y = this.topEdge),
(this.rightBound.pos.x = this.xPos),
(this.rightBound.pos.y = this.topEdge),
(this.bottomBound.pos.x = this.leftEdge),
(this.bottomBound.pos.y = this.yPos + this.height - i.BasicBlock.TOP_BOUND_HEIGHT),
this.updateGraphicPosition();
}),
(t.prototype.updateGraphicPosition = function () {
(this.container.x = this.xPos), (this.container.y = this.yPos);
}),
(t.prototype.update = function () {
this.landed
? this.specificLand()
: (1 === this.container.scaleX && 1 === this.container.scaleY) ||
((this.container.scaleY -= 0.075 * (this.container.scaleY - this.startScaleY)),
(this.container.scaleX -= 0.075 * (this.container.scaleX - this.startScaleX)),
(this.offScale = 1 - this.container.scaleY / this.startScaleY)),
(this.container.y = this.yPos + this.halfHeight * this.offScale);
}),
(t.prototype.specificLand = function () {
(this.container.scaleX += 0.02), (this.container.scaleY -= 0.02), (this.offScale = 1 - this.container.scaleY / this.startScaleY);
var t = this.main.player;
this.bouncing
? ((t.yVelocity = 0), (t.xPos = this.lockX), (t.yPos = this.yPos - this.halfHeight), t.setSpineOffY(this.height * this.offScale), t.updatePositions())
: ((this.lockX = t.xPos), t.setCrouch(), (t.bouncing = !0), (this.bouncing = !0)),
this.container.scaleY < 0.25 && (t.jump(-34 * this.height * 0.01), (t.bouncing = !1), t.setSpineOffY(0), (this.bouncing = !1), o.default.playSFX("bounce1")),
(t = null);
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), this.arrowAnimation.destroy(), (this.arrowAnimation = null), this.container.destroy(), (this.container = null), n.prototype.destroy.call(this);
}),
t
);
})((a = l(a)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(2)]),
void 0 ===
(s = function (t, e, s, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay)), e.add(i.sprite), (i.sprite.visible = !1), (i.alive = !1), (i.hangable = !0), (i.scalable = !0), i;
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i) {
var n = i < 0 ? "elevatorUp" : "elevatorDown";
this.sprite.setFrame(n + " instance 10000"), this.init(t, e, this.sprite.width, this.sprite.height - 6), (this.yVelocity = i), (this.sprite.x = t), (this.sprite.y = e), (this.sprite.visible = !0);
}),
(t.prototype.updateGraphicPosition = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos);
}),
(t.prototype.update = function () {
if (!1 !== this.alive) {
(this.yPos += this.yVelocity), this.updatePosition();
for (var t = 0, e = this.main.elevatorEliminator; t < e.length; t++) {
var i = e[t];
if ((0 < this.yVelocity && SAT.testPolygonPolygon(this.bottomBoundPolygon, i.bottomBoundPolygon)) || (this.yVelocity < 0 && SAT.testPolygonPolygon(this.topBoundPolygon, i.topBoundPolygon))) {
this.deactivate();
break;
}
}
}
}),
(t.prototype.activate = function (t, e) {
(this.sprite.x = this.xPos = t), (this.sprite.y = this.yPos = e), (this.sprite.visible = !0), (this.alive = !0);
}),
(t.prototype.deactivate = function () {
(this.sprite.visible = !1), (this.alive = !1);
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), n.prototype.destroy.call(this);
}),
(t.prototype.reset = function () {}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(2)]),
void 0 ===
(s = function (t, e, s, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (i.sprite = new Phaser.GameObjects.Image(t, 0, 0, "basicBlockColors")), e.add(i.sprite), (i.alive = !1), (i.hangable = !0), (i.scalable = !0), i;
}
return (
o(t, n),
(t.prototype.addSpikes = function (t, e) {
(this.spikes = t), (this.isSpikeUp = e);
}),
(t.prototype.spawSpikes = function () {
this.spikes && (this.isSpikeUp ? this.spikes.spawn(this.xPos, this.yPos - 34.5, 0) : this.spikes.spawn(this.xPos, this.yPos + 34.5, 180));
}),
(t.prototype.spawn = function (t, e) {
this.init(t, e, 150, 60), (this.sprite.x = t), (this.sprite.y = e), this.sprite.setScale(this.width / this.sprite.width, this.height / this.sprite.height);
var i = Number(this.main.currentLevelID);
(!i || i > s.Constants.basicBlockColorFrames) && (i = 0), this.sprite.setFrame(i), (this.sprite.visible = !0), this.spawSpikes();
}),
(t.prototype.destroy = function () {
(this.spikes = null), this.sprite.destroy(), (this.sprite = null), n.prototype.destroy.call(this);
}),
(t.prototype.updateGraphicPosition = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos);
}),
(t.prototype.update = function () {
(this.xPos === this.prevX && this.yPos === this.prevY) || this.updatePosition();
}),
(t.prototype.resetLevel = function () {
n.prototype.resetLevel.call(this);
}),
(t.prototype.reset = function () {
n.prototype.reset.call(this);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
h =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
l =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(31), i(0), i(32), i(2)]),
void 0 ===
(s = function (t, e, n, o, a, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var s = (function (s) {
function r(t, e, i) {
var n = s.call(this, t, e) || this;
return (
(n.sprite = new Phaser.GameObjects.Image(t, 0, 0, "basicBlockColors")),
e.add(n.sprite),
n.sprite.setScale(150 / n.sprite.width, 40 / n.sprite.height),
(n.isDown = i),
(n.alive = !1),
(n.hangable = !0),
(n.scalable = !0),
(n.timeNextPlatform = r.TimeNewElevator),
(n.delayNextPlatform = r.TimeNewElevator),
(n.elevators = []),
(n.cable = new a.Cable(n.main, n.main.obstacleLayer)),
n
);
}
return (
h(r, s),
(r.prototype.addSpikes = function (t, e) {
(this.spikes = t), (this.isSpikeUp = e);
}),
(r.prototype.spawSpikes = function () {
this.spikes && (this.isSpikeUp ? this.spikes.spawn(this.xPos, this.yPos - 35, 0) : this.spikes.spawn(this.xPos, this.yPos + 35, 180));
}),
(r.prototype.spawnCable = function () {
for (var t = 0, e = this.main.elevatorEliminator; t < e.length; t++) {
var i = e[t];
if (i.xPos + i.width / 2 >= this.xPos && i.xPos - i.width / 2 <= this.xPos) {
if (this.isDown && i.yPos >= this.yPos) {
var n = i.yPos - this.yPos;
this.cable.spawn(this.xPos, this.yPos, n);
break;
}
if (!this.isDown && i.yPos <= this.yPos) {
(n = i.yPos - this.yPos), this.cable.spawn(this.xPos, this.yPos, n);
break;
}
this.cable.spawn(this.xPos, this.yPos, 0);
} else this.cable.spawn(this.xPos, this.yPos, 0);
}
}),
(r.prototype.spawn = function (t, e) {
this.destroyAllPlatforms(), this.init(t, e, 150, 60), this.spawnCable(), (this.sprite.x = t), (this.sprite.y = e), this.sprite.setScale(this.width / this.sprite.width, this.height / this.sprite.height);
var i = Number(this.main.currentLevelID);
(!i || i > o.Constants.basicBlockColorFrames) && (i = 0), this.sprite.setFrame(i), (this.sprite.visible = !0), this.spawSpikes();
}),
(r.prototype.update = function () {
if (0 < this.elevators.length) for (var t = 0, e = this.elevators; t < e.length; t++) e[t].update();
(this.timeNextPlatform -= 1),
this.timeNextPlatform <= 0 && (this.createElevator(), (this.timeNextPlatform = this.delayNextPlatform)),
(this.xPos === this.prevX && this.yPos === this.prevY) || this.updatePosition();
}),
(r.prototype.updateGraphicPosition = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos);
}),
(r.prototype.createElevator = function () {
for (var t = 0; t < this.elevators.length; t++) if (!1 === this.elevators[t].alive) return void this.elevators[t].activate(this.xPos, this.yPos);
var e = new n.Elevator(this.main, this.main.obstacleLayer),
i = this.isDown ? r.SpeedElevator : -r.SpeedElevator;
e.spawn(this.xPos, this.yPos, i), this.main.blocks.push(e), this.elevators.push(e);
}),
(r.prototype.deletedElevator = function (t) {
var e;
(e = this.main.blocks.indexOf(t)), this.main.blocks.splice(e, 1), (e = this.elevators.indexOf(t)), this.elevators.splice(e, 1), t.destroy();
}),
(r.prototype.destroyAllPlatforms = function () {
for (; 0 < this.elevators.length; ) this.deletedElevator(this.elevators[0]);
}),
(r.prototype.resetLevel = function () {
s.prototype.resetLevel.call(this), this.destroyAllPlatforms();
}),
(r.prototype.destroy = function () {
this.destroyAllPlatforms(), this.cable.destroy(), this.sprite.destroy(), (this.sprite = null), (this.spikes = null), (this.elevators = null), (this.hitBoxPolygon = null), s.prototype.destroy.call(this);
}),
r
);
})((i = l(i)).default);
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(3)]),
void 0 ===
(s = function (t, e, s, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t) || this;
return (
(i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "breatheBlaster instance 10000")),
i.sprite.setOrigin(1, 0.5),
e.add(i.sprite),
(i.sprite.visible = !1),
i.sprite.setScale(1, 0.5),
(i.alive = !1),
(i.hitPoly = new SAT.Box(new SAT.Vector(0, 0), 100, 50).toPolygon()),
i
);
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i) {
(this.xPos = t),
(this.yPos = e),
(this.sprite.x = t),
(this.sprite.y = e),
(this.sprite.angle = i),
(this.sprite.visible = !0),
(this.alive = !0),
(this.rad = (i * Math.PI) / 180),
(this.hitPoly.pos.x = t),
(this.hitPoly.pos.y = e),
this.hitPoly.setAngle((i * Math.PI) / 180);
}),
(t.prototype.update = function () {
if (Math.random() < 0.15) {
var t = 4 * Math.random(),
e = this.rad - 2 + 4 * Math.random();
this.main.createColorParticle(this.xPos, this.yPos, Math.cos(e) * t, Math.sin(e) * t, 3394815, 4, !0, !0, 100);
}
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), n.prototype.destroy.call(this);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(3)]),
void 0 ===
(s = function (t, e, d, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t) || this;
return (i.imgHeight = 99), (i.layer = e), (i.cables = new Array()), (i.alive = !1), i;
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i) {
(this.xPos = t), (this.yPos = e), (this.alive = !0);
var n = 1,
s = 0;
i < 0 && ((n = -1), (s = 1), (i = Math.abs(i)));
var r,
o = i / this.imgHeight,
a = Math.ceil(o),
h = 1 - (a - o) / a,
l = a;
l < this.cables.length && (l = this.cables.length);
for (var u = 0; u < l; u++)
if (u < a) {
u < this.cables.length
? (r = this.cables[u])
: ((r = new Phaser.GameObjects.Image(this.main, 0, 0, d.Atlases.gameplay, "cable instance 10000")), this.layer.add(r), r.setOrigin(0.5, s), this.cables.push(r));
var c = e + this.imgHeight * h * u * n;
this.setCableParam(r, t, c, h);
} else this.cables[u].visible = !1;
r = null;
}),
(t.prototype.setCableParam = function (t, e, i, n) {
(t.x = e), (t.y = i), (t.scaleY = n), (t.visible = !0);
}),
(t.prototype.destroy = function () {
for (var t = 0; t < this.cables.length; t++) this.cables[t].destroy();
(this.cables = null), (this.layer = null), n.prototype.destroy.call(this);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(3), i(0), i(6)]),
void 0 ===
(s = function (t, e, i, r, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (i = a(i)), (n = a(n));
var s = (function (s) {
function t(t, e, i) {
var n = s.call(this, t) || this;
return (
!0 === (n.floating = i)
? (n.sprite = new Phaser.GameObjects.Image(t, 0, 0, r.Atlases.gameplay, "checkpointSwimming instance 10000"))
: ((n.sprite = new Phaser.GameObjects.Image(t, 0, 0, r.Atlases.gameplay, "checkpoint instance 10000")), n.sprite.setOrigin(8 / 21.15, 17 / 55)),
e.add(n.sprite),
n
);
}
return (
o(t, s),
(t.prototype.spawn = function (t, e) {
(this.xPos = t),
(this.yPos = e),
(this.startY = e),
(this.sprite.x = t),
(this.sprite.y = e),
(this.boxPolygon = new SAT.Box(new SAT.Vector(t - 60, e - 40), 120, 80).toPolygon()),
(this.state = 0),
(this.floatRad = 0);
}),
(t.prototype.trigger = function () {
this.setSpriteFrame(1), (this.state = 1);
for (var t = 0; t < 10; t++) this.main.createColorParticle(this.xPos, this.yPos, 10 * Math.random() - 5, -6 - 4 * Math.random(), 65280);
this.main.checkpointText.spawn(this.xPos, this.yPos - 30), !0 === this.main.dark && this.main.goLight(), n.default.playSFX("ding"), this.main.checkpointTriggered(this);
}),
(t.prototype.gray = function () {
this.setSpriteFrame(2), (this.state = 2);
}),
(t.prototype.resetLevel = function () {
this.setSpriteFrame(0), (this.state = 0);
}),
(t.prototype.setSpriteFrame = function (t) {
!0 === this.floating ? this.sprite.setFrame("checkpointSwimming instance 1000" + t) : this.sprite.setFrame("checkpoint instance 1000" + t);
}),
(t.prototype.update = function () {
!0 === this.floating &&
((this.floatRad += 0.1), (this.floatRad %= 8 * Math.PI), (this.sprite.y = this.startY + (25 + 10 * Math.sin(this.floatRad / 4))), (this.sprite.rotation = (Math.cos(this.floatRad / 4) * Math.PI) / 8));
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), (this.boxPolygon = null), s.prototype.destroy.call(this);
}),
t
);
})(i.default);
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(1), i(3)]),
void 0 ===
(s = function (t, e, s, r, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t) || this;
return (i.alive = !1), (i.sprite = new r.JDTextTranslated(t, 0, 0, s.Fonts.TutDeath, "checkpoint", 20, "#00DC4C")), i.sprite.setOrigin(0.5, 0.5), (i.sprite.visible = !1), e.add(i.sprite), i;
}
return (
o(t, n),
(t.prototype.spawn = function (t, e) {
(this.xPos = t), (this.yPos = e), (this.sprite.x = t), (this.sprite.y = e), (this.sprite.visible = !0), (this.alive = !0), (this.displayTime = 60), (this.moveDist = 0);
}),
(t.prototype.hide = function () {
(this.alive = !1), (this.sprite.visible = !1);
}),
(t.prototype.update = function () {
!1 !== this.alive && 0 < this.displayTime && (-30 < this.moveDist && (this.moveDist -= 2), (this.sprite.y = this.yPos + this.moveDist), (this.displayTime -= 1), this.displayTime <= 0 && this.hide());
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
a =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
h =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(7), i(6), i(3)]),
void 0 ===
(s = function (t, e, s, i, r, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (i = h(i)), (r = h(r));
var o = (function (n) {
function t(t, e) {
var i = n.call(this, t) || this;
return (
(i.container = new Phaser.GameObjects.Container(t)),
e.add(i.container),
(i.baseSprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "cannonBase instance 10000")),
i.container.add(i.baseSprite),
(i.tubeSprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "cannonTube instance 10000")),
i.container.add(i.tubeSprite),
i.tubeSprite.setOrigin(3 / 37, 0.5),
(i.alive = !1),
i
);
}
return (
a(t, n),
(t.prototype.spawn = function (t, e) {
(this.xPos = t), (this.yPos = e), (this.container.x = t), (this.container.y = e), (this.alive = !0), (this.rad = 0), (this.cannonSpeed = i.default.toRad(2)), (this.firing = !1), (this.power = 13);
}),
(t.prototype.fire = function () {
var t = this.main.player;
t.currentCannon = null;
var e = Math.cos(this.rad) * this.power,
i = Math.sin(this.rad) * this.power;
t.swimming ? (t.xVelocity = e) : (t.forcedXVelocity = e),
(t.yVelocity = i),
(t.xPos = this.xPos + 80 * Math.cos(this.rad)),
(t.yPos = this.yPos + 80 * Math.sin(this.rad)),
(t.rPosDest = 0),
r.default.playSFX("cannonFire");
for (var n = 0; n < 10; n++) this.main.createColorParticle(t.xPos, t.yPos, e * (Math.random() + 0.25), i * (Math.random() + 0.25), 16759552, 4);
t.swimming || ((t.falling = !0), t.setJump()), t.addToNewLayer(this.main.playerLayer), t.updateHitBoxesPos(), (this.firing = !1);
}),
(t.prototype.update = function () {
var t = this.main.player;
this.firing
? ((this.tubeSprite.scaleX -= 0.075 * (this.tubeSprite.scaleX - 0.75)), (this.tubeSprite.scaleY -= 0.075 * (this.tubeSprite.scaleY - 1.35)), this.tubeSprite.scaleX < 0.9 && this.fire())
: ((this.tubeSprite.scaleX -= 0.15 * (this.tubeSprite.scaleX - 1)),
(this.tubeSprite.scaleY -= 0.15 * (this.tubeSprite.scaleY - 1)),
t.currentCannon !== this ? (this.rad = Math.atan2(t.yPos - this.yPos, t.xPos - this.xPos)) : ((this.rad += this.cannonSpeed), (this.rad %= i.default.PI2)),
(this.tubeSprite.rotation = this.rad));
}),
(t.prototype.die = function () {
(this.alive = !1), (this.container.visible = !1);
}),
(t.prototype.destroy = function () {
this.baseSprite.destroy(), (this.baseSprite = null), this.tubeSprite.destroy(), (this.tubeSprite = null), this.container.destroy(), (this.container = null), n.prototype.destroy.call(this);
}),
t
);
})((n = h(n)).default);
e.default = o;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
h =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
l =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(1), i(22), i(23), i(3)]),
void 0 ===
(s = function (t, e, s, r, o, a, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t) || this;
return (
(i.particleSpawnRate = 3),
(i.sprite = new r.JDSprite(t, 0, 0, "finishPortal")),
i.sprite.anims.play({ key: "finishPortalAnim", frameRate: 15, repeat: -1 }),
e.add(i.sprite),
!0 === s.Constants.blend && (i.sprite.setPipeline(o.PipelineManager.getPipeline(a.PipelineList.Blur)), o.PLBlur.setBlur(i.sprite, 30, 30)),
(i.hitBoxPolygon = new SAT.Box(new SAT.Vector(0, 0), 60, 60).toPolygon()),
i.hitBoxPolygon.setOffset(new SAT.Vector(-30, -30)),
i
);
}
return (
h(t, n),
(t.prototype.spawn = function (t, e) {
(this.xPos = t), (this.yPos = e), (this.sprite.x = t), (this.sprite.y = e), (this.hitBoxPolygon.pos.x = t), (this.hitBoxPolygon.pos.y = e), (this.particleTimer = 0);
}),
(t.prototype.update = function () {
(this.particleTimer += 1),
this.particleTimer > this.particleSpawnRate &&
(this.main.createColorParticle(this.xPos - 80 + 160 * Math.random(), this.yPos - 80 + 160 * Math.random(), 0, 0, 4649252, 4, !1), (this.particleTimer = 0));
for (var t = 0, e = this.main.particles; t < e.length; t++) {
var i = e[t];
if (!1 === i.alive) return;
var n = Math.pow(i.xPos - this.xPos, 2) + Math.pow(i.yPos - this.yPos, 2);
n < 62500 &&
(n < 2500 && ((i.fadeTime = 150), i.multAlpha(0.5)),
i.yPos < this.yPos ? (i.yVelocity += 0.3) : i.yPos > this.yPos && (i.yVelocity -= 0.3),
i.xPos < this.xPos ? (i.xVelocity += 0.3) : i.xPos > this.xPos && (i.xVelocity -= 0.3));
}
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), (this.hitBoxPolygon = null), n.prototype.destroy.call(this);
}),
t
);
})((i = l(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(3)]),
void 0 ===
(s = function (t, e, s, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t) || this;
return (i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "hazardStrips instance 10000")), i.sprite.setOrigin(0, 0), e.add(i.sprite), (i.sprite.visible = !1), (i.alive = !1), i;
}
return (
o(t, n),
(t.prototype.spawn = function (t, e) {
(this.xPos = t), (this.yPos = e), (this.sprite.x = t), (this.sprite.y = e), (this.sprite.visible = !0), (this.alive = !0);
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), n.prototype.destroy.call(this);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(3)]),
void 0 ===
(s = function (t, e, s, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t) || this;
return (
(i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "lightSwitch instance 10000")),
e.add(i.sprite),
(i.hitBoxPolygon = new SAT.Box(new SAT.Vector(0, 0), 20, 20).toPolygon()),
i.hitBoxPolygon.setOffset(new SAT.Vector(-10, -10)),
i
);
}
return (
o(t, n),
(t.prototype.spawn = function (t, e) {
(this.xPos = t), (this.yPos = e), (this.sprite.x = t), (this.sprite.y = e), (this.hitBoxPolygon.pos.x = t), (this.hitBoxPolygon.pos.y = e);
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), n.prototype.destroy.call(this);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(3)]),
void 0 ===
(s = function (t, e, s, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t) || this;
return (
(i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "pole instance 10000")),
e.add(i.sprite),
(i.sprite.visible = !1),
(i.hitBoxPolygon = new SAT.Box(new SAT.Vector(0, 0), 10, 10).toPolygon()),
i.hitBoxPolygon.setOffset(new SAT.Vector(-5, -5)),
i
);
}
return (
o(t, n),
(t.prototype.spawn = function (t, e) {
(this.xPos = t), (this.yPos = e), (this.sprite.x = t), (this.sprite.y = e), (this.sprite.visible = !0), (this.hitBoxPolygon.pos.x = t), (this.hitBoxPolygon.pos.y = e);
}),
(t.prototype.update = function () {}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), (this.hitBoxPolygon = null), n.prototype.destroy.call(this);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n, s;
(n = [i, e, i(0), i(1), i(4)]),
void 0 ===
(s = function (t, e, i, n, s) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var r = (function () {
function t(t, e) {
(this.txt = new n.JDTextTranslated(t, 0, -70, i.Fonts.TutDeath, "pressDownEnter", 18, "#000000")),
this.txt.setOrigin(0.5, 0.5),
this.txt.setMaxSize(150, !0),
(this.txt.visible = !1),
e.add(this.txt),
(this.pressDownTimer = 60),
(this.showPressDown = !1),
t.events.on(s.Localization.EVENT_CHANGE_LANG, this.changeLang, this);
}
return (
(t.prototype.changeLang = function () {
this.txt.text = "pressDownEnter";
}),
(t.prototype.blink = function () {
this.showPressDown
? (this.pressDownTimer <= 0 ? ((this.txt.visible = !this.txt.visible), (this.pressDownTimer = 30)) : (this.pressDownTimer -= 1),
this.txt.parentContainer.scaleX < 0 ? (this.txt.scaleX = -1) : (this.txt.scaleX = 1))
: ((this.txt.visible = !1), (this.pressDownTimer = 60));
}),
t
);
})();
e.default = r;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(3)]),
void 0 ===
(s = function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t) || this;
return (
(i.width = 5), (i.sprite = new Phaser.GameObjects.Image(t, 0, 0, "basicBlockColors")), i.sprite.setOrigin(1, 0.5), e.add(i.sprite), (i.sprite.visible = !1), i.sprite.setScale(0.5, 0), (i.alive = !1), i
);
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i) {
(this.xPos = t),
(this.sprite.displayWidth = this.width),
(this.sprite.displayHeight = i),
(this.yPos = e),
(this.sprite.x = t),
(this.sprite.y = e),
(this.sprite.visible = !0),
(this.alive = !0),
(this.height = i),
(this.halfHeight = this.height / 2),
(this.totalBound = new SAT.Box(new SAT.Vector(t, e), this.width, i - 16)),
(this.totalBoundPolygon = this.totalBound.toPolygon()),
this.totalBoundPolygon.setOffset(new SAT.Vector(-0.5 * this.width, -(0.5 * i + 8)));
}),
(t.prototype.update = function () {}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), n.prototype.destroy.call(this), (this.totalBound = null), (this.totalBoundPolygon = null);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(38)]),
void 0 ===
(s = function (t, e, n, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var s = (function (i) {
function t() {
return (null !== i && i.apply(this, arguments)) || this;
}
return (
o(t, i),
(t.prototype.spawn = function (t, e) {
i.prototype.spawn.call(this, t, e), (this.timer = 0);
}),
(t.prototype.init = function () {
(this.sprite = new Phaser.GameObjects.Image(this.main, 0, 0, n.Atlases.gameplay, "timedKey instance 10000")),
this.layer.add(this.sprite),
(this.lineGraphic = new Phaser.GameObjects.Graphics(this.main)),
this.layer.add(this.lineGraphic),
(this.lineColor = 16711680);
}),
(t.prototype.follow = function () {
(this.following = !0), (this.timer = 0);
}),
(t.prototype.update = function () {
this.following && !this.used && (this.timer >= t.TIMER_MAX ? (this.main.player.loseKey(this), this.reset()) : (this.timer += 1)), i.prototype.update.call(this);
}),
(t.TIMER_MAX = 300),
t
);
})((i = a(i)).default);
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
u =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
o =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(1), i(7), i(3)]),
void 0 ===
(s = function (t, e, a, h, l, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (l = o(l));
var n = (function (o) {
function t(t, e) {
var i = o.call(this, t) || this;
(i.container = new Phaser.GameObjects.Container(t)), e.add(i.container), (i.windGraphics = []);
var n = t.make.graphics({ x: 0, y: 0, add: !1 });
n.fillStyle(2236962), n.fillRect(0, 0, 27, 2), n.generateTexture("ww", 27, 2), n.destroy();
for (var s = 0; s < 6; s++) {
var r = new Phaser.GameObjects.Image(t, 0, 0, "ww");
i.container.add(r), (r.visible = !1), i.windGraphics.push(r);
}
return (
(i.sprite = new Phaser.GameObjects.Image(t, 0, 0, a.Atlases.gameplay, "windBlaster instance 10000")),
i.container.add(i.sprite),
i.sprite.setOrigin(0, 0.5),
(i.fanSprite = new h.JDSprite(t, 6, -2, "windFan")),
i.fanSprite.setOrigin(0, 0.5),
i.fanSprite.anims.play({ key: "fan", repeat: -1 }),
i.container.add(i.fanSprite),
(i.fanMask = new SAT.Box(new SAT.Vector(0, 0), 180, 50).toPolygon()),
i.fanMask.setOffset(new SAT.Vector(0, -25)),
(i.alive = !1),
i
);
}
return (
u(t, o),
(t.prototype.spawn = function (t, e, i) {
(this.xPos = t),
(this.yPos = e),
(this.container.x = t),
(this.container.y = e),
(this.container.rotation = l.default.toRad(i)),
(this.fanMask.pos.x = t),
(this.fanMask.pos.y = e),
this.fanMask.setAngle(this.container.rotation),
(this.alive = !0);
for (var n = (this.inc = 0), s = this.windGraphics; n < s.length; n++) {
var r = s[n];
(r.x = 130 * Math.random()), (r.y = 46 * Math.random() - 23), (r.visible = !0);
}
}),
(t.prototype.update = function () {
var t = this.main.player;
if (t && t.alive)
if (SAT.testPolygonPolygon(this.fanMask, t.totalPolygon)) {
var e = 0.15 * Math.sin(this.container.rotation);
e < -0.12 && (this.inc = Math.max(2, this.inc)),
(t.yVelocity += 0.13 * Math.sin(this.container.rotation) * this.inc),
(t.xVelocity += 0.13 * Math.cos(this.container.rotation) * this.inc),
e < -0.12 && t.yPos > this.yPos - 5 && ((t.yPos = this.yPos - 5), (t.yVelocity = -2), t.updateHitBoxesPos(), (t.falling = !0)),
this.inc < 2.5 ? (this.inc += 0.25) : (this.inc = 2.5);
} else (this.inc -= 0.25), this.inc < 0 && (this.inc = 0);
for (var i = 0, n = this.windGraphics; i < n.length; i++) {
var s = n[i];
(s.x += 3), (s.alpha -= 0.03), 130 < s.x && ((s.x = 0), (s.y = 46 * Math.random() - 23), (s.alpha = 1));
}
}),
(t.prototype.die = function () {
(this.alive = !1), (this.container.visible = !1);
}),
(t.prototype.destroy = function () {
this.container.destroy(), (this.container = null), this.fanSprite.destroy(), (this.fanSprite = null);
for (var t = 0, e = this.windGraphics; t < e.length; t++) e[t].destroy();
o.prototype.destroy.call(this);
}),
t
);
})((i = o(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(7), i(3)]),
void 0 ===
(s = function (t, e, s, r, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (r = a(r));
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t) || this;
return (i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "wire instance 10000")), e.add(i.sprite), (i.sprite.visible = !1), i.sprite.setOrigin(0, 0.5), (i.alive = !1), i;
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i) {
(this.xPos = t), (this.yPos = e), (this.sprite.x = t), (this.sprite.y = e), (this.sprite.rotation = r.default.toRad(i)), (this.sprite.visible = !0), (this.alive = !0);
}),
(t.prototype.resetLevel = function () {
this.sprite.scaleX = 1;
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), n.prototype.destroy.call(this);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
a =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
h =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(3), i(36)]),
void 0 ===
(s = function (t, e, i, o) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (r) {
function t(t, e, i, n) {
var s = r.call(this, t) || this;
return (
i.y < n.y ? ((s.startPos = i), (s.endPos = n), (s.topEdge = i.y), (s.bottomEdge = n.y)) : ((s.startPos = n), (s.endPos = i), (s.topEdge = n.y), (s.bottomEdge = i.y)),
s.startPos.x < s.endPos.x
? ((s.direction = o.FacingDir.Right), (s.leftEdge = s.startPos.x), (s.rightEdge = s.endPos.x))
: ((s.direction = o.FacingDir.Left), (s.leftEdge = s.endPos.x), (s.rightEdge = s.startPos.x)),
(s.width = Math.abs(s.endPos.x - s.startPos.x)),
(s.height = Math.abs(s.endPos.y - s.startPos.y)),
(s.scope = s.height / s.width),
(s.wire = new Phaser.GameObjects.Graphics(t)),
e.add(s.wire),
s.wire.lineStyle(2, 16737792),
s.wire.lineBetween(s.startPos.x, s.startPos.y, s.endPos.x, s.endPos.y),
(s.hitPolygon = new SAT.Polygon(new SAT.Vector(s.startPos.x, s.startPos.y), [
new SAT.Vector(0, 5),
new SAT.Vector(s.endPos.x - s.startPos.x, s.endPos.y - s.startPos.y + 5),
new SAT.Vector(s.endPos.x - s.startPos.x, s.endPos.y - s.startPos.y - 5),
new SAT.Vector(0, -5),
])),
s
);
}
return (
a(t, r),
(t.prototype.destroy = function () {
this.wire && this.wire.destroy(), (this.wire = null), (this.hitPolygon = null), (this.startPos = null), (this.endPos = null), r.prototype.destroy.call(this);
}),
t
);
})((i = h(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(32), i(0), i(3)]),
void 0 ===
(s = function (t, e, i, s, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var r = (function (n) {
function t(t, e) {
var i = n.call(this, t) || this;
return (i.layer = e), (i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "ziplinePole instance 10000")), e.add(i.sprite), i.sprite.setOrigin(3 / 9.8, 29.2 / 64.25), i;
}
return (
o(t, n),
(t.prototype.spawn = function (t, e) {
(this.xPos = t), (this.yPos = e), (this.sprite.x = t), (this.sprite.y = e);
}),
(t.prototype.attach = function (t) {
return (this.zipline = new i.Zipline(this.main, this.layer, new Phaser.Geom.Point(this.xPos, this.yPos - 25), new Phaser.Geom.Point(t.xPos, t.yPos - 25))), (t.zipline = this.zipline), this.zipline;
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), this.zipline && this.zipline.destroy(), (this.zipline = null), (this.layer = null), n.prototype.destroy.call(this);
}),
t
);
})((n = a(n)).default);
e.default = r;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(6), i(38)]),
void 0 ===
(s = function (t, e, i, n, s) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (n = a(n));
var r = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
o(e, t),
(e.prototype.init = function () {
(this.lineGraphic = new Phaser.GameObjects.Graphics(this.main)),
this.layer.add(this.lineGraphic),
(this.sprite = new Phaser.GameObjects.Image(this.main, 0, 0, i.Atlases.gameplay, "torch instance 10000")),
this.layer.add(this.sprite),
(this.lineColor = 65280);
}),
(e.prototype.follow = function () {
t.prototype.follow.call(this), n.default.playSFX("torch");
}),
e
);
})((s = a(s)).default);
e.default = r;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(3)]),
void 0 ===
(s = function (t, e, s, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t) || this;
return (
(i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "kite instance 10000")),
e.add(i.sprite),
(i.hitBoxPolygon = new SAT.Box(new SAT.Vector(0, 0), 76, 16).toPolygon()),
i.hitBoxPolygon.setOffset(new SAT.Vector(-38, -8)),
(i.alive = !1),
i
);
}
return (
o(t, n),
(t.prototype.spawn = function (t, e) {
(this.xPos = t), (this.yPos = e), (this.startX = t), (this.startY = e), (this.sprite.x = t), (this.sprite.y = e), (this.hitBoxPolygon.pos.x = t), (this.hitBoxPolygon.pos.y = e), (this.alive = !0);
}),
(t.prototype.update = function (t, e, i) {
(this.xPos = t + 8 * i), (this.yPos = e - 30), (this.sprite.scaleX = i), this.updatePositions();
}),
(t.prototype.reset = function () {
this.sprite && ((this.xPos = this.startX), (this.yPos = this.startY), (this.sprite.scaleX = 1), this.updatePositions());
}),
(t.prototype.resetLevel = function () {
(this.xPos = this.startX), (this.yPos = this.startY), this.updatePositions(), this.sprite.setScale(1, 1), (this.alive = !0), (this.sprite.visible = !0);
}),
(t.prototype.updatePositions = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos);
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), (this.hitBoxPolygon = null), n.prototype.destroy.call(this);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(6), i(51)]),
void 0 ===
(s = function (t, e, n, i, s) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (i = a(i));
var r = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
o(e, t),
(e.prototype.init = function (t, e, i) {
(this.rarity = i), (this.sprite = new Phaser.GameObjects.Image(t, 0, 0, n.Atlases.gameplay, "skinSpin instance 1000" + i)), e.add(this.sprite), (this.sprite.visible = !1);
}),
(e.prototype.collect = function () {
this.main.collectSkinSpin(this.rarity), i.default.playSFX("starPickup"), this.die();
}),
(e.prototype.resetLevel = function () {}),
e
);
})((s = a(s)).default);
e.default = r;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(6), i(2)]),
void 0 ===
(s = function (t, e, s, i, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (i = a(i));
var r = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (
(i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "explosiveBlock instance 10000")),
i.layer.add(i.sprite),
(i.sprite.visible = !1),
(i.alive = !1),
(i.hangable = !0),
(i.scalable = !0),
(i.used = !1),
(i.blockType = "explosive"),
i
);
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i, n) {
this.init(t, e, i, n), (this.used = !1), (this.sprite.x = t), (this.sprite.y = e), this.sprite.setScale(i / 100, n / 100), (this.sprite.visible = !0);
}),
(t.prototype.updateGraphicPosition = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos);
}),
(t.prototype.update = function () {
!1 !== this.alive && ((this.xPos === this.prevX && this.yPos === this.prevY) || this.updatePosition());
}),
(t.prototype.explode = function () {
(this.used = !0), (this.alive = !1), (this.sprite.visible = !1), this.main.explode(), i.default.playSFX("explosion");
}),
(t.prototype.resetLevel = function () {
(this.used = !1), (this.alive = !0), (this.sprite.visible = !0);
}),
(t.prototype.reset = function () {}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), n.prototype.destroy.call(this);
}),
t
);
})((n = a(n)).default);
e.default = r;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
a =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
h =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(1), i(6), i(2)]),
void 0 ===
(s = function (t, e, s, r, i, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (i = h(i));
var o = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (
(i.container = new Phaser.GameObjects.Container(t)),
e.add(i.container),
(i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "fallingBlock instance 10000")),
i.container.add(i.sprite),
(i.arrowAnimation = new r.JDSprite(t, 0, 0, s.Atlases.gameplay, "fallingBlockArrow instance 10000")),
i.container.add(i.arrowAnimation),
(i.alive = !1),
(i.hangable = !0),
(i.scalable = !0),
(i.container.visible = !1),
i
);
}
return (
a(t, n),
(t.prototype.spawn = function (t, e, i, n) {
this.init(t, e, i, n),
(this.container.x = t),
(this.container.y = e),
this.container.setScale(i / 100, n / 100),
!0 === s.Constants.blend && this.arrowAnimation.anims.play({ key: "fallingBlockArrow", repeat: -1 }),
(this.container.visible = !0),
(this.falling = !1);
}),
(t.prototype.updateGraphicPosition = function () {
(this.container.x = this.xPos), (this.container.y = this.yPos);
}),
(t.prototype.update = function () {
if (!1 === this.alive) {
if (SAT.testPolygonPolygon(this.totalBoundPolygon, this.main.player.bodyPolygon)) return;
this.alive = !0;
}
(this.prevY = this.yPos),
!1 === this.falling
? this.landed
? ((this.falling = !0), (this.yVelocity = -1.5), i.default.playSFX("fallingBlock", 0.4))
: this.container.alpha < 1 && (this.container.alpha += 0.02)
: ((this.yVelocity += this.main.gravity),
(this.container.alpha -= 0.01),
15 <= this.yVelocity && (i.default.playSFX("blockDestroy"), (this.alive = !1), (this.container.alpha = 0), (this.yPos = this.startY), (this.yVelocity = 0), (this.falling = !1))),
(this.yPos += this.yVelocity),
(this.xPos === this.prevX && this.yPos === this.prevY) || this.updatePosition();
}),
(t.prototype.reset = function () {
(this.yPos = this.startY), (this.yVelocity = 0), (this.falling = !1), (this.alive = !0), (this.container.alpha = 1), this.updatePosition(), n.prototype.reset.call(this);
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), this.arrowAnimation.destroy(), (this.arrowAnimation = null), this.container.destroy(), (this.container = null), n.prototype.destroy.call(this);
}),
t
);
})((n = h(n)).default);
e.default = o;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(6), i(2)]),
void 0 ===
(s = function (t, e, s, r, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (r = a(r));
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (
(i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "glassBlock instance 10000")),
e.add(i.sprite),
(i.sprite.visible = !1),
(i.alive = !1),
(i.blockType = "glass"),
(i.hangable = !0),
(i.scalable = !0),
i
);
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i, n) {
this.init(t, e, i, n), (this.sprite.x = t), (this.sprite.y = e), this.sprite.setScale(i / 100, n / 100), (this.sprite.visible = !0);
}),
(t.prototype.updateGraphicPosition = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos);
}),
(t.prototype.smash = function () {
(this.sprite.visible = !1), r.default.playSFX("glassSmash");
for (var t = 0; t < 0.25 * this.width; t++) {
var e = this.xPos - this.width / 2 + Math.random() * this.width,
i = this.yPos - 0.5 * this.height + Math.random() * this.height;
this.main.createColorParticle(e, i, 5 * Math.random() - 2.5, this.main.player.yVelocity * Math.random(), 12185594, 8),
(this.alive = !1),
10 < this.main.player.yVelocity && (this.main.player.yVelocity = 10);
}
}),
(t.prototype.resetLevel = function () {
this.reset();
}),
(t.prototype.reset = function () {
(this.alive = !0), (this.sprite.visible = !0), n.prototype.reset.call(this);
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(2)]),
void 0 ===
(s = function (t, e, s, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (
(i.maxMoveDist = 100), (i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "horizontalBlock instance 10000")), e.add(i.sprite), (i.alive = !1), (i.hangable = !0), (i.scalable = !0), i
);
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i, n, s) {
void 0 === s && (s = -1),
this.init(t, e, i, n),
(this.sprite.x = t),
(this.sprite.y = e),
this.sprite.setScale(i / 100, n / 100),
(this.xVelocity = s),
(this.startXVelocity = s),
(this.attachmentOffsets = []),
(this.attachments = []);
}),
(t.prototype.levelStart = function () {
for (var t = new SAT.Box(new SAT.Vector(this.leftEdge, this.topEdge), this.width, this.height + 10).toPolygon(), e = 0; e < this.main.obstacles.length; e++) {
var i = this.main.obstacles[e];
if ("spike" === i.obstacleType) {
var n = i;
if (1 !== n.spikeNum) continue;
SAT.testPolygonPolygon(t, n.deathBoxPolygon) && (this.attachments.push(n), this.attachmentOffsets.push(new Phaser.Geom.Point(n.xPos - this.xPos, n.yPos - this.yPos)));
}
}
}),
(t.prototype.updatePosition = function () {
n.prototype.updatePosition.call(this);
for (var t = 0; t < this.attachments.length; t++) {
var e = this.attachments[t],
i = this.attachmentOffsets[t];
(e.xPos = this.xPos + i.x), (e.yPos = this.yPos + i.y), e.updatePosition();
}
}),
(t.prototype.updateGraphicPosition = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos);
}),
(t.prototype.update = function () {
var t = this.xPos;
if (
(0 < this.xVelocity ? this.xPos > this.startX + this.maxMoveDist && (this.xVelocity = -this.xVelocity) : this.xPos < this.startX - this.maxMoveDist && (this.xVelocity = -this.xVelocity),
(this.xPos += this.xVelocity),
this.xPos !== t && this.updatePosition(),
this.landed)
) {
var e = this.main.player.xPos - t - this.landed.x;
(this.landed.x += e), (this.main.player.xPos = this.xPos + this.landed.x), this.main.player.updatePositions();
}
}),
(t.prototype.reset = function () {
n.prototype.reset.call(this), (this.xPos = this.startX), (this.xVelocity = this.startXVelocity);
}),
(t.prototype.resetLevel = function () {
this.reset();
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), (this.attachments = null), (this.attachmentOffsets = null);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(2)]),
void 0 ===
(s = function (t, e, s, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (
(i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "iceBlock instance 10000")),
e.add(i.sprite),
(i.sprite.visible = !1),
(i.alive = !1),
(i.blockType = "ice"),
(i.hangable = !0),
(i.scalable = !0),
i
);
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i, n) {
this.init(t, e, i, n),
(this.startHeight = n),
(this.sprite.x = t),
(this.sprite.y = e),
(this.startXScale = i / 100),
(this.startYScale = n / 100),
this.sprite.setScale(this.startXScale, this.startYScale),
(this.sprite.visible = !0) === s.Constants.blend &&
(this.maskGraphic || (this.maskGraphic = new Phaser.GameObjects.Graphics(this.main)),
this.maskGraphic.clear(),
this.maskGraphic.fillStyle(0),
this.maskGraphic.fillRect(-this.halfWidth, -this.halfHeight, i, n),
(this.maskGraphic.x = t),
(this.maskGraphic.y = e),
(this.sprite.mask = this.maskGraphic.createGeometryMask())),
(this.depletionRate = 5e-4),
(this.meltScale = 1);
}),
(t.prototype.updatePosition = function () {
n.prototype.updatePosition.call(this), (this.sprite.x = this.xPos), (this.sprite.y = this.yPos), this.maskGraphic && ((this.maskGraphic.x = this.xPos), (this.maskGraphic.y = this.yPos));
}),
(t.prototype.update = function () {
if (this.alive) {
var t = this.main.cameras.main.worldView;
if (this.rightEdge < t.left || this.leftEdge > t.right || this.bottomEdge < t.top || this.topEdge > t.bottom) return;
(this.meltScale -= this.depletionRate),
this.maskGraphic
? ((this.maskGraphic.scaleY = this.meltScale), (this.maskGraphic.y -= (this.depletionRate * this.startHeight) / 2))
: ((this.sprite.scaleY = (this.height / 100) * this.meltScale), (this.sprite.y = this.yPos - this.halfHeight * (1 - this.meltScale))),
(this.totalBound = new SAT.Box(new SAT.Vector(this.xPos, this.yPos), this.width, this.height * this.meltScale)),
(this.totalBoundPolygon = this.totalBound.toPolygon()),
this.totalBoundPolygon.setOffset(new SAT.Vector(-this.halfWidth, -this.halfHeight)),
(this.leftBound = new SAT.Box(new SAT.Vector(this.xPos, this.yPos), this.halfWidth, this.height * this.meltScale)),
(this.leftBoundPolygon = this.leftBound.toPolygon()),
this.leftBoundPolygon.setOffset(new SAT.Vector(-this.halfWidth, -this.halfHeight)),
(this.rightBound = new SAT.Box(new SAT.Vector(this.xPos, this.yPos), this.halfWidth, this.height * this.meltScale)),
(this.rightBoundPolygon = this.rightBound.toPolygon()),
this.rightBoundPolygon.setOffset(new SAT.Vector(0, -this.halfHeight)),
this.bottomBoundPolygon.setOffset(new SAT.Vector(-this.halfWidth, this.meltScale * this.halfHeight - i.default.TOP_BOUND_HEIGHT)),
this.meltScale <= 0 && ((this.melted = !0), (this.alive = !1), (this.sprite.visible = !1));
}
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), this.maskGraphic && (this.maskGraphic.destroy(), (this.maskGraphic = null)), n.prototype.destroy.call(this);
}),
(t.prototype.resetLevel = function () {
this.reset();
}),
(t.prototype.reset = function () {
(this.meltScale = 1),
this.maskGraphic && ((this.maskGraphic.scaleY = 1), (this.maskGraphic.y = this.startY)),
this.sprite.setScale(this.startXScale, this.startYScale),
(this.sprite.visible = !0),
(this.alive = !0),
(this.melted = !1),
n.prototype.reset.call(this);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(1), i(39)]),
void 0 ===
(s = function (t, e, r, i, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var s = (function (s) {
function t() {
var t = (null !== s && s.apply(this, arguments)) || this;
return (t.maxMoveDist = 100), t;
}
return (
o(t, s),
(t.prototype.initGraphics = function () {
s.prototype.initGraphics.call(this), (this.arrowAnimation = new i.JDSprite(this.main, 0, 0, r.Atlases.gameplay, "invisBlockDownArrow instance 10000")), this.container.add(this.arrowAnimation);
}),
(t.prototype.levelStart = function () {
(this.attachments = []), (this.attachmentOffsets = []);
for (var t = new SAT.Box(new SAT.Vector(this.leftEdge, this.topEdge - 10), this.width, this.height + 20).toPolygon(), e = 0; e < this.main.obstacles.length; e++) {
var i = this.main.obstacles[e];
if ("spike" === i.obstacleType) {
var n = i;
SAT.testPolygonPolygon(t, n.deathBoxPolygon) && (this.attachments.push(n), this.attachmentOffsets.push(new Phaser.Geom.Point(n.xPos - this.xPos, n.yPos - this.yPos)));
} else if ("buzzsaw" === i.obstacleType) {
var s = i;
SAT.testCirclePolygon(s.deathCircle, t) && (this.attachments.push(s), this.attachmentOffsets.push(new Phaser.Geom.Point(s.xPos - this.xPos, s.yPos - this.yPos)));
}
}
}),
(t.prototype.spawn = function (t, e, i, n) {
s.prototype.spawn.call(this, t, e, i, n), !0 === r.Constants.blend && this.arrowAnimation.anims.play({ key: "invisBlockDownArrow", repeat: -1 }), (this.yVelocity = 1);
}),
(t.prototype.update = function () {
this.yVelocity < 0
? this.yPos < this.startY - this.maxMoveDist && ((this.yVelocity = -this.yVelocity), this.landed && (this.main.player.yPos += 2 * this.yVelocity), this.main.player.updatePositions())
: this.yPos > this.startY + this.maxMoveDist && ((this.yVelocity = -this.yVelocity), this.landed && (this.main.player.yPos += 2 * this.yVelocity), this.main.player.updatePositions()),
(this.yPos += this.yVelocity);
for (var t = 0; t < this.attachments.length; t++) {
var e = this.attachments[t],
i = this.attachmentOffsets[t];
(e.xPos = this.xPos + i.x), (e.yPos = this.yPos + i.y), e.updatePosition();
}
s.prototype.update.call(this);
}),
(t.prototype.destroy = function () {
(this.attachmentOffsets = null), (this.attachments = null), this.arrowAnimation.destroy(), (this.arrowAnimation = null), s.prototype.destroy.call(this);
}),
t
);
})((n = a(n)).default);
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(1), i(39)]),
void 0 ===
(s = function (t, e, r, i, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var s = (function (s) {
function t() {
var t = (null !== s && s.apply(this, arguments)) || this;
return (t.maxMoveDist = 100), t;
}
return (
o(t, s),
(t.prototype.initGraphics = function () {
s.prototype.initGraphics.call(this), (this.arrowAnimation = new i.JDSprite(this.main, 0, 0, r.Atlases.gameplay, "invisBlockUpArrow instance 10000")), this.container.add(this.arrowAnimation);
}),
(t.prototype.levelStart = function () {
(this.attachments = []), (this.attachmentOffsets = []);
for (var t = new SAT.Box(new SAT.Vector(this.leftEdge, this.topEdge - 10), this.width, this.height + 20).toPolygon(), e = 0; e < this.main.obstacles.length; e++) {
var i = this.main.obstacles[e];
if ("spike" === i.obstacleType) {
var n = i;
SAT.testPolygonPolygon(t, n.deathBoxPolygon) && (this.attachments.push(n), this.attachmentOffsets.push(new Phaser.Geom.Point(n.xPos - this.xPos, n.yPos - this.yPos)));
} else if ("buzzsaw" === i.obstacleType) {
var s = i;
SAT.testCirclePolygon(s.deathCircle, t) && (this.attachments.push(s), this.attachmentOffsets.push(new Phaser.Geom.Point(s.xPos - this.xPos, s.yPos - this.yPos)));
}
}
}),
(t.prototype.spawn = function (t, e, i, n) {
s.prototype.spawn.call(this, t, e, i, n), !0 === r.Constants.blend && this.arrowAnimation.anims.play({ key: "invisBlockDownArrow", repeat: -1 }), (this.yVelocity = -1);
}),
(t.prototype.update = function () {
this.yVelocity < 0
? this.yPos < this.startY - this.maxMoveDist && ((this.yVelocity = -this.yVelocity), this.landed && (this.main.player.yPos += 2 * this.yVelocity), this.main.player.updatePositions())
: this.yPos > this.startY + this.maxMoveDist && ((this.yVelocity = -this.yVelocity), this.landed && (this.main.player.yPos += 2 * this.yVelocity), this.main.player.updatePositions()),
(this.yPos += this.yVelocity);
for (var t = 0; t < this.attachments.length; t++) {
var e = this.attachments[t],
i = this.attachmentOffsets[t];
(e.xPos = this.xPos + i.x), (e.yPos = this.yPos + i.y), e.updatePosition();
}
s.prototype.update.call(this);
}),
(t.prototype.destroy = function () {
(this.attachmentOffsets = null), (this.attachments = null), this.arrowAnimation.destroy(), (this.arrowAnimation = null), s.prototype.destroy.call(this);
}),
t
);
})((n = a(n)).default);
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(2)]),
void 0 ===
(s = function (t, e, s, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (
(i.unlocked = !1),
(i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "lockBlock instance 10000")),
e.add(i.sprite),
(i.alive = !1),
(i.blockType = "lock"),
(i.hangable = !0),
(i.scalable = !0),
i
);
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i, n) {
this.init(t, e, i, n), (this.sprite.x = t), (this.sprite.y = e), this.sprite.setScale(i / 100, n / 100);
}),
(t.prototype.unlock = function () {
(this.unlocked = !0), (this.alive = !1), (this.sprite.visible = !1);
}),
(t.prototype.update = function () {}),
(t.prototype.updateGraphicPosition = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos);
}),
(t.prototype.reset = function () {}),
(t.prototype.resetLevel = function () {
(this.alive = !0), (this.unlocked = !1), (this.sprite.visible = !0);
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), n.prototype.destroy.call(this);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(3)]),
void 0 ===
(s = function (t, e, r, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (s) {
function t(t, e, i) {
var n = s.call(this, t) || this;
return (n.side = i), (n.sprite = new Phaser.GameObjects.Image(t, 0, 0, r.Atlases.gameplay, "leftSlopeColors instance 10000")), e.add(n.sprite), (n.alive = !1), n;
}
return (
o(t, s),
(t.prototype.spawn = function (t, e, i, n) {
(this.xPos = t),
(this.yPos = e),
(this.width = i),
(this.height = n),
(this.sprite.x = t),
(this.sprite.y = e),
this.sprite.setScale(i / 100, n / 100),
1 === this.side && (this.sprite.scaleX = -this.sprite.scaleX);
var s = Number(this.main.currentLevelID);
s < 8 && this.sprite.setFrame("leftSlopeColors instance " + (1e4 + s)), (this.alive = !0);
var r = i / 2,
o = n / 2;
(this.topEdge = e - o),
(this.bottomEdge = e + o),
(this.leftEdge = t - r),
(this.rightEdge = t + r),
(this.wallPoly = new SAT.Box(new SAT.Vector(t, e), 10, n - 20).toPolygon()),
(this.bottomPoly = new SAT.Box(new SAT.Vector(t, e), i, 10).toPolygon()),
1 === this.side ? this.wallPoly.setOffset(new SAT.Vector(-i / 2, -n / 2 + 20)) : this.wallPoly.setOffset(new SAT.Vector(i / 2, -n / 2 + 20)),
this.bottomPoly.setOffset(new SAT.Vector(i / 2, n / 2));
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), s.prototype.destroy.call(this);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
u =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
c =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(1), i(22), i(23), i(3)]),
void 0 ===
(s = function (t, e, o, a, h, l, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (s) {
function r(t, e, i) {
var n = s.call(this, t) || this;
return (
(n.colorIndex = i),
(n.sprite = new a.JDSprite(t, 0, 0, o.Atlases.gameplay)),
e.add(n.sprite),
n.sprite.anims.play({ key: "portal_blueAnim", repeat: -1 }),
!0 === o.Constants.blend && (n.sprite.setPipeline(h.PipelineManager.getPipeline(l.PipelineList.MIXBlurColorMatrix)), h.PLColorMatrix.hue(n.sprite, r.colors[i]), h.PLBlur.setBlur(n.sprite, 2, 2)),
(n.isEnable = !0),
(n.cooldown = 0),
(n.hitBoxPolygon = new SAT.Box(new SAT.Vector(0, 0), 10, 32).toPolygon()),
n.hitBoxPolygon.setOffset(new SAT.Vector(-5, -16)),
n
);
}
return (
u(r, s),
Object.defineProperty(r.prototype, "portalAttach", {
get: function () {
return this.portalAttached;
},
enumerable: !1,
configurable: !0,
}),
Object.defineProperty(r.prototype, "enabled", {
get: function () {
return this.isEnable;
},
enumerable: !1,
configurable: !0,
}),
(r.prototype.disablePortal = function () {
this.isEnable = !1;
var t = this.sprite.anims.currentFrame.index - 1;
this.sprite.anims.play({ key: "portal_blue_disabledAnim", repeat: -1 }), this.sprite.setFrameNumber(t), (this.cooldown = r.TimeCooldown), h.PLColorMatrix.blackAndWhite(this.sprite, !0);
}),
(r.prototype.attachPortal = function (t) {
this.portalAttached = t;
}),
(r.prototype.getAttachPortal = function () {
return this.portalAttached;
}),
(r.prototype.getTeleportPoint = function () {
if (!this.isEnable) return null;
var t = { x: 0, y: 0 };
return this.portalAttached ? ((t.x = this.portalAttached.xPos), (t.y = this.portalAttached.yPos), t) : null;
}),
(r.prototype.update = function () {
if (!this.isEnable && ((this.cooldown -= 1), this.cooldown <= 0)) {
this.isEnable = !0;
var t = this.sprite.anims.currentFrame.index - 1;
this.sprite.anims.play({ key: "portal_blueAnim", repeat: -1 }), this.sprite.setFrameNumber(t), h.PLColorMatrix.hue(this.sprite, r.colors[this.colorIndex]);
}
}),
(r.prototype.spawn = function (t, e) {
(this.xPos = t), (this.yPos = e), (this.sprite.x = t), (this.sprite.y = e), (this.hitBoxPolygon.pos.x = t), (this.hitBoxPolygon.pos.y = e);
}),
(r.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), (this.portalAttached = null), s.prototype.destroy.call(this);
}),
(r.colors = [0, 180, 80, 630]),
r
);
})((i = c(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(2)]),
void 0 ===
(s = function (t, e, s, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "pushBlock instance 10000")), e.add(i.sprite), (i.alive = !1), (i.blockType = "push"), (i.hangable = !0), (i.scalable = !0), i;
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i, n) {
this.init(t, e, i, n),
(this.sprite.x = t),
(this.sprite.y = e),
this.sprite.setScale(i / 100, n / 100),
(this.pushingRight = !1),
(this.pushingLeft = !1),
(this.pushed = !1),
(this.inWater = !1),
(this.onIce = !1),
(this.stuckLeft = !1),
(this.stuckRight = !1),
(this.land = !1);
}),
(t.prototype.checkBlockCollisions = function () {
(this.land = !1), (this.onIce = !1);
for (var t = 0; t < this.main.blocks.length; t++) {
var e = this.main.blocks[t];
if (e.alive)
if (!0 !== SAT.testPolygonPolygon(e.topBoundPolygon, this.bottomBoundPolygon))
(this.yVelocity < 0 || 0 < e.yVelocity) && SAT.testPolygonPolygon(this.topBoundPolygon, e.bottomBoundPolygon)
? (this.yVelocity < 0 && (this.yVelocity *= 0.5), (this.yPos = e.bottomEdge + this.halfHeight))
: this.xVelocity - e.xVelocity < 0 && SAT.testPolygonPolygon(this.leftBoundPolygon, e.rightBoundPolygon)
? ((this.xVelocity = 0), (this.xPos = e.rightEdge + this.halfWidth))
: 0 < this.xVelocity - e.xVelocity && SAT.testPolygonPolygon(this.rightBoundPolygon, e.leftBoundPolygon) && ((this.xVelocity = 0), (this.xPos = e.leftEdge - this.halfWidth));
else if (
("ice" === e.blockType && (this.onIce = !0),
(this.yVelocity = e.yVelocity),
this.inWater
? ((this.yVelocity *= -1), (this.yPos = e.topEdge - this.halfHeight))
: 0 < this.yVelocity
? (this.yPos = e.topEdge - this.halfHeight + this.yVelocity)
: (this.yPos = e.topEdge - this.halfHeight + 1),
(this.land = !0),
this.updatePosition(),
"speed" === e.blockType)
) {
var i = e;
this.xVelocity += 0.4 * i.speedInc;
} else if ("falling" === e.blockType) {
var n = e;
n.falling || ((n.falling = !0), (n.yVelocity = -2));
}
}
}),
(t.prototype.checkWaterCollisions = function () {
var t = this.inWater;
this.inWater = !1;
for (var e = 0; e < this.main.pools.length; e++) {
var i = this.main.pools[e];
SAT.testPolygonPolygon(this.totalBoundPolygon, i.totalPolygon) &&
(this.layer.remove(this.sprite),
this.main.underPoolLayer.add(this.sprite),
this.yPos > i.yPos - 0.5 * i.height && (!t && this.yVelocity, (this.yVelocity -= 1), this.yVelocity < -3 && (this.yVelocity = -3), (this.inWater = !0)));
}
}),
(t.prototype.checkTrapped = function () {
for (var t = new SAT.Vector(this.leftEdge - 5, this.topEdge + 10), e = new SAT.Vector(this.rightEdge + 5, this.topEdge + 10), i = 0; i < this.main.blocks.length; i++) {
var n = this.main.blocks[i];
if (n.alive) {
if (SAT.pointInPolygon(t, n.totalBoundPolygon)) return (this.stuckLeft = !0), "left";
if (SAT.pointInPolygon(e, n.totalBoundPolygon)) return (this.stuckRight = !0), "right";
}
}
return "not trapped";
}),
(t.prototype.update = function () {
this.land || (this.yVelocity += this.main.gravity),
(this.xPos += this.xVelocity),
(this.yPos += this.yVelocity),
this.landed && ((this.main.player.xPos += this.xVelocity), this.main.player.updatePositions()),
this.onIce ? (this.xVelocity -= 0.01 * this.xVelocity) : (this.xVelocity -= 0.25 * this.xVelocity),
this.checkBlockCollisions(),
this.checkWaterCollisions(),
this.updatePosition();
}),
(t.prototype.updateGraphicPosition = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos);
}),
(t.prototype.reset = function () {
this.layer.add(this.sprite),
(this.xPos = this.startX),
(this.yPos = this.startY),
(this.xVelocity = 0),
(this.yVelocity = 0),
(this.pushed = !1),
(this.pushingLeft = !1),
(this.pushingRight = !1),
this.updatePosition(),
n.prototype.reset.call(this);
}),
(t.prototype.resetLevel = function () {
this.reset();
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), n.prototype.destroy.call(this);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(2)]),
void 0 ===
(s = function (t, e, s, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "solarBlock instance 10000")), e.add(i.sprite), (i.alive = !1), (i.hangable = !0), (i.scalable = !0), i;
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i, n) {
this.init(t, e, i, n), (this.sprite.x = t), (this.sprite.y = e), this.sprite.setScale(i / 100, n / 100);
}),
(t.prototype.updateGraphicPosition = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos);
}),
(t.prototype.update = function () {
(this.xPos === this.prevX && this.yPos === this.prevY) || this.updatePosition();
}),
(t.prototype.goDark = function () {
(this.alive = !1), (this.sprite.visible = !1);
}),
(t.prototype.goLight = function () {
(this.alive = !0), (this.sprite.visible = !0);
}),
(t.prototype.reset = function () {}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), n.prototype.destroy.call(this);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(20), i(2)]),
void 0 ===
(s = function (t, e, s, r, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (
(i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "sparkBlock instance 10000")),
e.add(i.sprite),
(i.alive = !1),
(i.hangable = !0),
(i.scalable = !0),
(i.spark = new r.Spark(t, e, i)),
i.main.obstacles.push(i.spark),
i
);
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i, n) {
this.init(t, e, i, n), (this.sprite.x = t), (this.sprite.y = e), this.sprite.setScale(i / 100, n / 100), this.spark.spawn();
}),
(t.prototype.updateGraphicPosition = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos);
}),
(t.prototype.update = function () {
(this.xPos === this.prevX && this.yPos === this.prevY) || this.updatePosition();
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), (this.spark = null), n.prototype.destroy.call(this);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(1), i(2)]),
void 0 ===
(s = function (t, e, r, s, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (
(i.container = new Phaser.GameObjects.Container(t)),
e.add(i.container),
(i.sprite = new Phaser.GameObjects.Image(t, 0, 0, r.Atlases.gameplay, "speedBlock instance 10000")),
i.container.add(i.sprite),
(i.arrowAnimation = new s.JDSprite(t, 0, 0, r.Atlases.gameplay, "speedBlockArrow instance 10000")),
i.container.add(i.arrowAnimation),
(i.alive = !1),
(i.blockType = "speed"),
(i.hangable = !0),
(i.scalable = !0),
i
);
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i, n, s) {
this.init(t, e, i, n),
(this.speedInc = 1.25 * s),
(this.container.x = t),
(this.container.y = e),
this.container.setScale(i / 100, n / 100),
!0 === r.Constants.blend && this.arrowAnimation.play({ key: "speedBlockArrow", repeat: -1 }),
0 < this.speedInc ? ((this.sprite.scaleX = 1), (this.arrowAnimation.scaleX = 1)) : ((this.sprite.scaleX = -1), (this.arrowAnimation.scaleX = -1));
}),
(t.prototype.updateGraphicPosition = function () {
(this.container.x = this.xPos), (this.container.y = this.yPos);
}),
(t.prototype.update = function () {
this.landed && this.land(), (this.xPos === this.prevX && this.yPos === this.prevY) || this.updatePosition();
}),
(t.prototype.land = function () {
((0 < this.speedInc && this.main.player.xVelocity < 5 * this.speedInc) || (this.speedInc < 0 && this.main.player.xVelocity > 5 * this.speedInc)) &&
((this.main.player.xVelocity += this.speedInc), this.main.player.xVelocity === this.speedInc && (this.main.player.xVelocity += 0.75 * this.speedInc));
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), this.container.destroy(), (this.container = null), (this.arrowAnimation = null), n.prototype.destroy.call(this);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(3)]),
void 0 ===
(s = function (t, e, s, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t) || this;
return (
(i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "swimmingPool instance 10000")),
e.add(i.sprite),
(i.sprite.alpha = 0.6),
(i.topMask = new Phaser.GameObjects.Graphics(t)),
e.add(i.topMask),
i
);
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i, n) {
(this.xPos = t),
(this.yPos = e),
(this.width = i),
(this.height = n),
(this.sprite.x = t),
(this.sprite.y = e),
this.sprite.setScale(i / 250, n / 250),
(this.electric = !1),
(this.prevElec = !1),
(this.totalPolygon = new SAT.Box(new SAT.Vector(t - i / 2, e - n / 2), i, n).toPolygon()),
(this.topPolygon = new SAT.Box(new SAT.Vector(t - i / 2, e - n / 2), i, 12).toPolygon()),
this.topMask.fillStyle(16776960, 0.5),
this.topMask.fillRect(0, 0, i, n),
(this.topMask.x = t - this.width / 2),
(this.topMask.y = e - this.height / 2);
}),
(t.prototype.update = function () {
this.electric ? ((this.topMask.visible = !0), (this.prevElec = !0)) : ((this.topMask.visible = !1), (this.prevElec = !1)), (this.electric = !1);
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), this.topMask.destroy(), (this.topMask = null), (this.totalPolygon = null), (this.topPolygon = null), n.prototype.destroy.call(this);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(2)]),
void 0 ===
(s = function (t, e, s, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (
(i.maxMoveDist = 100), (i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "verticalDownBlock instance 10000")), e.add(i.sprite), (i.alive = !1), (i.hangable = !0), (i.scalable = !0), i
);
}
return (
o(t, n),
(t.prototype.levelStart = function () {
for (var t = new SAT.Box(new SAT.Vector(this.leftEdge, this.topEdge - 10), this.width, this.height + 20).toPolygon(), e = 0; e < this.main.obstacles.length; e++) {
var i = this.main.obstacles[e];
if ("spike" === i.obstacleType) {
var n = i;
SAT.testPolygonPolygon(t, n.deathBoxPolygon) && (this.attachments.push(n), this.attachmentOffsets.push(new Phaser.Geom.Point(n.xPos - this.xPos, n.yPos - this.yPos)));
} else if ("quadrant" === i.obstacleType) {
var s = i;
SAT.testPolygonPolygon(t, s.attachHitBoxPolygon) && (this.attachments.push(i), this.attachmentOffsets.push(new Phaser.Geom.Point(i.xPos - this.xPos, i.yPos - this.yPos)));
}
}
}),
(t.prototype.spawn = function (t, e, i, n) {
this.init(t, e, i, n), (this.sprite.x = t), (this.sprite.y = e), this.sprite.setScale(i / 100, n / 100), (this.yVelocity = 1), (this.attachmentOffsets = []), (this.attachments = []);
}),
(t.prototype.updatePosition = function () {
n.prototype.updatePosition.call(this);
for (var t = 0; t < this.attachments.length; t++) {
var e = this.attachments[t],
i = this.attachmentOffsets[t];
(e.xPos = this.xPos + i.x), (e.yPos = this.yPos + i.y), e.updatePosition();
}
}),
(t.prototype.updateGraphicPosition = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos);
}),
(t.prototype.update = function () {
(this.prevY = this.yPos),
0 < this.yVelocity ? this.yPos > this.startY + this.maxMoveDist && (this.yVelocity = -this.yVelocity) : this.yPos < this.startY - this.maxMoveDist && (this.yVelocity = -this.yVelocity),
(this.yPos += this.yVelocity),
(this.xPos === this.prevX && this.yPos === this.prevY) || this.updatePosition();
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), (this.attachments = null), (this.attachmentOffsets = null), n.prototype.destroy.call(this);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(2)]),
void 0 ===
(s = function (t, e, s, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (
(i.maxMoveDist = 100), (i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "verticalUpBlock instance 10000")), e.add(i.sprite), (i.alive = !1), (i.hangable = !0), (i.scalable = !0), i
);
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i, n) {
this.init(t, e, i, n), (this.sprite.x = t), (this.sprite.y = e), this.sprite.setScale(i / 100, n / 100), (this.yVelocity = -1), (this.attachmentOffsets = []), (this.attachments = []);
}),
(t.prototype.levelStart = function () {
for (var t = new SAT.Box(new SAT.Vector(this.leftEdge, this.topEdge - 10), this.width, this.height + 20).toPolygon(), e = 0; e < this.main.obstacles.length; e++) {
var i = this.main.obstacles[e];
if ("spike" === i.obstacleType) {
var n = i;
SAT.testPolygonPolygon(t, n.deathBoxPolygon) && (this.attachments.push(n), this.attachmentOffsets.push(new Phaser.Geom.Point(n.xPos - this.xPos, n.yPos - this.yPos)));
} else if ("quadrant" === i.obstacleType) {
var s = i;
SAT.testPolygonPolygon(t, s.attachHitBoxPolygon) && (this.attachments.push(i), this.attachmentOffsets.push(new Phaser.Geom.Point(i.xPos - this.xPos, i.yPos - this.yPos)));
}
}
}),
(t.prototype.updatePosition = function () {
n.prototype.updatePosition.call(this);
for (var t = 0; t < this.attachments.length; t++) {
var e = this.attachments[t],
i = this.attachmentOffsets[t];
(e.xPos = this.xPos + i.x), (e.yPos = this.yPos + i.y), e.updatePosition();
}
}),
(t.prototype.updateGraphicPosition = function () {
(this.sprite.x = this.xPos), (this.sprite.y = this.yPos);
}),
(t.prototype.update = function () {
(this.prevY = this.yPos),
this.yVelocity < 0
? this.yPos < this.startY - this.maxMoveDist && ((this.yVelocity = -this.yVelocity), this.landed && (this.main.player.yPos += 2 * this.yVelocity), this.main.player.updatePositions())
: this.yPos > this.startY + this.maxMoveDist && ((this.yVelocity = -this.yVelocity), this.landed && (this.main.player.yPos += 2 * this.yVelocity), this.main.player.updatePositions()),
(this.yPos += this.yVelocity),
(this.xPos === this.prevX && this.yPos === this.prevY) || this.updatePosition();
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), (this.attachments = null), (this.attachmentOffsets = null), n.prototype.destroy.call(this);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
a =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
h =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(1), i(2)]),
void 0 ===
(s = function (t, e, r, o, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (s) {
function t(t, e, i) {
void 0 === i && (i = 0);
var n = s.call(this, t, e) || this;
return (
(n.id = i),
(n.sprite = new Phaser.GameObjects.Image(t, 0, 0, r.Atlases.gameplay, "charactersBlock instance 10000")),
n.sprite.setOrigin(0.5, 1),
n.layer.add(n.sprite),
(n.txt = new o.JDTextTranslated(t, 0, 0, r.Fonts.Main, "actSkin", 28)),
n.txt.setOrigin(0.5, 0),
n.layer.add(n.txt),
(n.alive = !1),
(n.blockType = "skins"),
(n.hangable = !0),
(n.scalable = !0),
n
);
}
return (
a(t, s),
(t.prototype.toggleTickBox = function () {}),
(t.prototype.spawn = function (t, e) {
this.init(t, e, 120, 10), (this.sprite.visible = !0), (this.sprite.x = t), (this.sprite.y = e - 5), (this.txt.x = t), (this.txt.y = this.sprite.y + 7);
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), this.txt.destroy(), (this.txt = null), s.prototype.destroy.call(this);
}),
t
);
})((i = h(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(2)]),
void 0 ===
(s = function (t, e, s, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (
(i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "door instance 10000")),
i.sprite.setOrigin(0.5, 1),
e.add(i.sprite),
(i.sprite.visible = !1),
(i.alive = !1),
(i.blockType = "BonusStageDoor"),
(i.hangable = !1),
(i.scalable = !1),
i
);
}
return (
o(t, n),
(t.prototype.spawn = function (t, e) {
this.init(t, e, 60, 10), (this.sprite.visible = !0), (this.sprite.x = t + 3), (this.sprite.y = e);
}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), n.prototype.destroy.call(this);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(6), i(2)]),
void 0 ===
(s = function (t, e, s, i, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (i = a(i));
var r = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (
(i.container = new Phaser.GameObjects.Container(t)),
e.add(i.container),
(i.container.visible = !1),
(i.sprite = new Phaser.GameObjects.Image(t, 0, 0, s.Atlases.gameplay, "bigTNT instance 10000")),
i.container.add(i.sprite),
(i.alive = !1),
(i.explodingOverlay = new Phaser.GameObjects.Graphics(t)),
i.container.add(i.explodingOverlay),
(i.hangable = !0),
(i.scalable = !0),
(i.used = !1),
(i.blockType = "explosive"),
i
);
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i, n) {
this.init(t, e, i, n),
(this.used = !1),
(this.container.x = t),
(this.container.y = e),
this.container.setScale(i / 100, n / 100),
(this.container.visible = !0),
this.explodingOverlay.fillStyle(16777215, 1),
this.explodingOverlay.fillRect(0, 0, i, n),
(this.explodingOverlay.visible = !0),
(this.explodingOverlay.x = -this.width / 2),
(this.explodingOverlay.y = -this.height / 2),
(this.explodingOverlay.alpha = 0);
}),
(t.prototype.updateGraphicPosition = function () {
(this.container.x = this.xPos), (this.container.y = this.yPos);
}),
(t.prototype.update = function () {
!1 !== this.alive &&
(!0 === this.exploding &&
((this.container.scaleX -= 0.1 * (this.container.scaleX - 1.5)),
(this.container.scaleY = this.container.scaleX),
(this.explodingOverlay.alpha += 0.05),
1 <= this.explodingOverlay.alpha && ((this.exploding = !1), (this.alive = !1), this.main.explodeVex())),
(this.xPos === this.prevX && this.yPos === this.prevY) || this.updatePosition());
}),
(t.prototype.explode = function () {
(this.used = !0), (this.alive = !1), (this.container.visible = !1), this.main.explode(), i.default.playSFX("explosion");
}),
(t.prototype.resetLevel = function () {
(this.used = !1), (this.alive = !0), (this.exploding = !1), (this.explodingOverlay.alpha = 0), this.container.setScale(1, 1), (this.container.visible = !0);
}),
(t.prototype.reset = function () {}),
(t.prototype.destroy = function () {
this.sprite.destroy(), (this.sprite = null), this.explodingOverlay.destroy(), (this.explodingOverlay = null), this.container.destroy(), (this.container = null), n.prototype.destroy.call(this);
}),
t
);
})((n = a(n)).default);
e.default = r;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
c =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
o =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(7), i(30)]),
void 0 ===
(s = function (t, e, a, h, r) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (h = o(h));
var i = (function (o) {
function t(t) {
var e,
i = o.call(this, t, a.Constants.GHW, a.Constants.GHH) || this;
(i.elementsStart = [0, 1, 2, 3, 4, 5, 4, 1, 2, 3, 4, 5, 4, 3, 2, 3, 4, 5, 4, 3, 2, 3, 4, 5, 4, 3, 2, 1, 4, 5, 4, 3, 2, 1, 0]),
(i.countStep = 8),
(i.elements = new Array()),
(i.maxDur = Math.ceil(6 * i.countStep));
for (var n = -296, s = -444, r = 0; r < 35; r++) (e = new l(t, s, n, i.elementsStart[r], i.countStep)), i.add(e), i.elements.push(e), (r + 1) % 7 == 0 ? ((s = -444), (n += 148)) : (s += 148);
return (e = null), (i.logo = new u(t, i.countStep)), i.logo.on("animInComp", i.onInComplete, i), i.add(i.logo), (i.visible = !1), i;
}
return (
c(t, o),
(t.prototype.beginTransition = function (t, e) {
for (var i = [], n = 2; n < arguments.length; n++) i[n - 2] = arguments[n];
(this.callback = t), (this.context = e), (this.argums = i), (this.visible = !0), (this.counter = 0), (this.anim = "in"), this.logo.showIn();
}),
(t.prototype.onInComplete = function () {
(this.anim = "stand"), (this.counter = 0), this.callback && this.callback.apply(this.context, this.argums), this.endTransition();
}),
(t.prototype.endTransition = function () {
this.logo.showOut(), (this.anim = "out"), (this.counter = this.maxDur);
}),
(t.prototype.update = function () {
!1 !== this.visible &&
("in" === this.anim
? ((this.counter += 1), this.updateElements(), this.counter >= this.maxDur && (this.anim = "none"))
: "out" === this.anim && ((this.counter -= 1), this.updateElements(), 0 === this.counter && (this.visible = !1)),
this.logo.update());
}),
(t.prototype.updateElements = function () {
for (var t = 0; t < this.elements.length; t++) this.elements[t].update(this.counter);
}),
(t.prototype.resize = function () {
this.scale = 2 * (a.Constants.UI_SCALE_FIT_X > a.Constants.UI_SCALE_FIT_Y ? a.Constants.UI_SCALE_FIT_X : a.Constants.UI_SCALE_FIT_Y);
}),
t
);
})(Phaser.GameObjects.Container);
e.default = i;
var l = (function (o) {
function t(t, e, i, n, s) {
var r = o.call(this, t, e, i, a.Atlases.ui, "transition_romb instance 10000") || this;
return (r.rotation = h.default.PI025), (r.start = n * s), (r.duration = r.start + s), (r.scaleX = 0), r;
}
return (
c(t, o),
(t.prototype.update = function (t) {
t >= this.start && t <= this.duration && (this.scaleX = (t - this.start) / (this.duration - this.start));
}),
t
);
})(Phaser.GameObjects.Image),
u = (function (s) {
function t(t, e) {
var i = s.call(this, t, 0, 0, "logo") || this;
function n(t) {
return Math.ceil((t / 125) * e);
}
return (
(i.durationIn = new Array()),
i.durationIn.push({ d: n(700), sc: 0, a: -10 }),
i.durationIn.push({ d: n(850), sc: 0.6, a: 6 }),
i.durationIn.push({ d: n(975), sc: 0.45, a: -3 }),
i.durationIn.push({ d: n(1100), sc: 0.5, a: 0 }),
(i.durationOut = new Array()),
i.durationOut.push({ d: n(50), sc: 0.6 }),
i.durationOut.push({ d: n(175), sc: 0 }),
(i.visible = !1),
(i.updateAnim = r.Bool3.none),
i
);
}
return (
c(t, s),
(t.prototype.showIn = function () {
this.start(), (this.durationID = 0), (this.angle = -10), (this.scale = 0), (this.duration = this.durationIn[this.durationID].d), (this.updateAnim = r.Bool3.true);
}),
(t.prototype.showOut = function () {
this.start(), (this.duration = 1), (this.durationID = -1), (this.updateAnim = r.Bool3.false);
}),
(t.prototype.start = function () {
(this.counter = 0), (this.visible = !0), (this.stepScale = 0), (this.stepAngle = 0);
}),
(t.prototype.update = function () {
if (this.updateAnim === r.Bool3.true) {
if (((this.counter += 1), (this.scale += this.stepScale), (this.angle += this.stepAngle), this.counter === this.duration)) {
if (((this.durationID += 1), this.durationID === this.durationIn.length)) return (this.updateAnim = r.Bool3.none), void this.emit("animInComp");
var t = this.durationIn[this.durationID];
this.duration = t.d;
var e = this.duration - this.counter;
(this.stepScale = (t.sc - this.scale) / e), (this.stepAngle = (t.a - this.angle) / e);
}
} else if (this.updateAnim === r.Bool3.false && ((this.counter += 1), (this.scale += this.stepScale), this.counter === this.duration)) {
if (((this.durationID += 1), this.durationID === this.durationOut.length)) return void (this.updateAnim = r.Bool3.none);
(t = this.durationOut[this.durationID]), (this.duration = t.d), (e = this.duration - this.counter), (this.stepScale = (t.sc - this.scale) / e);
}
}),
t
);
})(Phaser.GameObjects.Image);
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
});
(n = [i, e, i(0), i(1), i(4)]),
void 0 ===
(s = function (t, e, s, i, r) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t, 0, 0, s.Fonts.TutDeath, "", 18, "#ff0000") || this;
return (i.visible = !1), i.setOrigin(0.5, 0.5), (i.alive = !1), e.add(i), i;
}
return (
o(t, n),
(t.prototype.show = function (t, e, i) {
(this.xPos = t), (this.yPos = e), (this.x = t), (this.y = e), (this.text = r.Localization.getText(i)), (this.visible = !0), (this.scale = this.scaleXY = 0.75), (this.alpha = 1), (this.alive = !0);
}),
(t.prototype.hide = function () {
(this.alive = !1), (this.visible = !1);
}),
(t.prototype.update = function () {
!1 !== this.alive &&
(this.scaleXY < 1.3
? ((this.scaleXY -= 0.03 * (this.scaleXY - 1.3)), 1.3 - this.scaleXY < 0.01 && (this.scaleXY = 1.3), (this.scale = this.scaleXY))
: ((this.alpha -= 0.075 * this.alpha), this.alpha <= 0.02 && this.hide()),
(this.yPos -= 0.5),
(this.y = this.yPos));
}),
t
);
})(i.JDText);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(40)]),
void 0 ===
(s = function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (l) {
function t(t, e, i, n, s, r, o, a) {
var h = l.call(this, t, n, s, r, o) || this;
return (
(h.scaleOut = a),
(h.size = n),
(h.graphics = new Phaser.GameObjects.Graphics(t)),
e.add(h.graphics),
h.graphics.fillStyle(i),
h.graphics.fillRect(-n / 2, -n / 2, n, n),
(h.fadeAfter = o),
(h.isUI = !1),
h
);
}
return (
o(t, l),
(t.prototype.spawn = function (t, e, i, n) {
l.prototype.spawnBase.call(this, t, e, i, n), (this.graphics.x = t), (this.graphics.y = e), (this.fadeTime = 0);
}),
(t.prototype.destroy = function (t) {
this.alive && (this.graphics.destroy(), (this.graphics = null), (this.alive = !1), l.prototype.destroy.call(this, t));
}),
(t.prototype.multAlpha = function (t) {
this.graphics.alpha *= t;
}),
(t.prototype.update = function () {
if (this.alive) {
if (this.fadeTime >= this.fadeAfter) {
if (((this.graphics.alpha -= 0.05), this.scaleOut && (this.graphics.scale *= 0.9), this.graphics.alpha <= 0)) return void this.destroy(this.isUI);
} else this.fadeTime++;
var t = this.xPos,
e = this.yPos;
l.prototype.update.call(this),
this.alive &&
((t === this.xPos && e === this.yPos) ||
((this.graphics.x = this.xPos), (this.graphics.y = this.yPos), (this.hitBoxPolygon.pos.x = this.xPos - 0.5 * this.size), (this.hitBoxPolygon.pos.y = this.yPos - 0.5 * this.size)));
}
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
a =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
h =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(4), i(10), i(41)]),
void 0 ===
(s = function (t, e, n, s, o, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (o = h(o));
var r = (function (r) {
function t(t, e) {
var i = r.call(this, t) || this;
return (
(i.sprite = t.add.rexBBCodeText(0, 0, "", { fontFamily: n.Fonts.TutDeath, fontSize: "20px", align: "center" })),
i.sprite.setOrigin(0.5, 0.5),
i.sprite.setWrapMode(1),
e.add(i.sprite),
(i.sprite.visible = !1),
i
);
}
return (
a(t, r),
(t.prototype.spawn = function (t, e, i, n, s) {
r.prototype.spawn.call(this, t, e, i), (this.width = n), (this.height = s);
}),
(t.prototype.setID = function (t) {
r.prototype.setID.call(this, t);
var e = "tf" + t;
!0 === n.Constants.IS_MOBILE && 13 === t && (e += "Mob"),
(this.sprite.text = o.default.parseTextFadeWordsColor(s.Localization.getText(e))),
this.sprite.setColor(o.default.getTextFadeMainColor(t)),
this.sprite.setWrapWidth(this.width);
var i = s.Localization.getFontSize(e) || 20;
if ((this.sprite.setFontSize(i), this.height)) for (; this.sprite.height > this.height; ) (i -= 1), this.sprite.setFontSize(i);
this.sprite.updateText();
}),
t
);
})((i = h(i)).default);
e.default = r;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(41)]),
void 0 ===
(s = function (t, e, r, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (s) {
function t(t, e, i) {
var n = s.call(this, t) || this;
return (n.sprite = new Phaser.GameObjects.Image(t, 0, 0, r.Atlases.gameplay)), e.add(n.sprite), (n.sprite.visible = !1), n.setID(i), n;
}
return (
o(t, s),
(t.prototype.setID = function (t) {
s.prototype.setID.call(this, t), this.sprite.setFrame("gamearrow" + t + " instance 10000");
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
d =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(33), i(160), i(26), i(183), i(191), i(192), i(193), i(43), i(194), i(200)]),
void 0 ===
(s = function (t, e, i, n, s, r, o, a, h, l, u, c) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }),
(e.SubSkinsSelect = e.SubSkinsRarity = e.BasicSubSkins = e.SubVex = e.SubBonusStage = e.SubAct = e.SubHub = e.BasicSubGamePlay = e.SubMenu = e.BasicSubScene = void 0),
Object.defineProperty(e, "BasicSubScene", {
enumerable: !0,
get: function () {
return d(i).default;
},
}),
Object.defineProperty(e, "SubMenu", {
enumerable: !0,
get: function () {
return d(n).default;
},
}),
Object.defineProperty(e, "BasicSubGamePlay", {
enumerable: !0,
get: function () {
return d(s).default;
},
}),
Object.defineProperty(e, "SubHub", {
enumerable: !0,
get: function () {
return d(r).default;
},
}),
Object.defineProperty(e, "SubAct", {
enumerable: !0,
get: function () {
return d(o).default;
},
}),
Object.defineProperty(e, "SubBonusStage", {
enumerable: !0,
get: function () {
return d(a).default;
},
}),
Object.defineProperty(e, "SubVex", {
enumerable: !0,
get: function () {
return d(h).default;
},
}),
Object.defineProperty(e, "BasicSubSkins", {
enumerable: !0,
get: function () {
return d(l).default;
},
}),
Object.defineProperty(e, "SubSkinsRarity", {
enumerable: !0,
get: function () {
return d(u).default;
},
}),
Object.defineProperty(e, "SubSkinsSelect", {
enumerable: !0,
get: function () {
return d(c).default;
},
});
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
y =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
m =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(33), i(5), i(21), i(34), i(179), i(12), i(24), i(19), i(17), i(182), i(4), i(15)]),
void 0 ===
(s = function (t, e, r, i, o, a, h, l, u, c, d, f, p, g, v) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (i = m(i)), (l = m(l)), (c = m(c)), (d = m(d)), (f = m(f)), (p = m(p));
var n = (function (s) {
function t() {
return (null !== s && s.apply(this, arguments)) || this;
}
return (
y(t, s),
(t.prototype.init = function () {
var t = this;
if (
(v.AnalyticsHandler.getInstance().sendScreenView("menu"),
s.prototype.init.call(this),
(this.followCameraInPause = !1),
this.scene.createSceneMainMenu(),
(this.logo = new Phaser.GameObjects.Image(this.scene, r.Constants.GHW, 0, "logo")),
this.logo.setOrigin(0.5, 0),
this.add(this.logo),
(this.btnDailyTask = new h.ButtonMainMenuDaily(this.scene, r.Constants.GHW - 500, 0)),
this.btnDailyTask.addImage(r.Atlases.ui, "btnMenu3 instance 10000"),
this.btnDailyTask.addTxtTittle("dailyTasks", r.Fonts.Main, g.Localization.getFontSize("btn_daily_tasks"), "#001977", "center", 0, 25),
this.btnDailyTask.txtTittle.setMaxSize(155, !0),
this.btnDailyTask.addTxtReset("resetsIn", r.Fonts.Main, g.Localization.getFontSize("resets_in2"), "#ffffff", "center", 0, -73),
this.btnDailyTask.txtReset.setMaxSize(150),
this.btnDailyTask.addTxtDop("04:23:11", r.Fonts.Main, g.Localization.getFontSize("resets_in2"), "#ffffff", "center", 0, -45),
(this.btnDailyTask.onUp = function () {
return t.scene.showPanelDailyTask();
}),
this.add(this.btnDailyTask),
!0 === d.default.canShowTaskI() &&
((this.Idaily = new Phaser.GameObjects.Image(this.scene, 85, -90, r.Atlases.ui, "cauntion instance 10000")),
this.btnDailyTask.add(this.Idaily),
this.scene.events.on(d.default.EVENT_REWARDED, this.checkDailyI, this)),
(this.btnDailyStage = new h.ButtonMainMenuDaily(this.scene, r.Constants.GHW - 265, 0)),
this.btnDailyStage.addImage(r.Atlases.ui, "btnMenu2 instance 10000"),
this.btnDailyStage.addTxtTittle("dailyStage", r.Fonts.Main, 35, "#001977", "center", 0, 32),
this.btnDailyStage.txtTittle.setMaxSize(180, !0),
this.btnDailyStage.addTxtReset("resetsIn", r.Fonts.Main, g.Localization.getFontSize("resets_in3"), "#ffffff", "center", 0, -83),
this.btnDailyStage.txtReset.setMaxSize(170),
this.btnDailyStage.addTxtDop("12:55:23", r.Fonts.Main, g.Localization.getFontSize("resets_in3"), "#ffffff", "center", 0, -47),
(this.btnDailyStage.onUp = function () {
return t.scene.showSubSceneTransition(u.SubSceneList.BonusStage);
}),
this.add(this.btnDailyStage),
(this.Ibonus = new Phaser.GameObjects.Image(this.scene, 95, -100, r.Atlases.ui, "cauntion instance 10000")),
this.btnDailyStage.add(this.Ibonus),
(this.Ibonus.visible = d.default.canShowBonusStageI()),
(this.btnPlay = new o.ButtonText(this.scene, r.Constants.GHW, 0)),
this.btnPlay.addImage(r.Atlases.ui, "btnMenu1 instance 10000"),
this.btnPlay.addTxtTranslated("play", r.Fonts.Main, 60, "#001977", "center", 0, -10),
(this.btnPlay.onUp = function () {
return t.scene.showSubSceneTransition(u.SubSceneList.Hub);
}),
this.add(this.btnPlay),
(this.btnSkins = new h.ButtonMainMenu(this.scene, r.Constants.GHW + 265, 0)),
this.btnSkins.addImage(r.Atlases.ui, "btnMenu2 instance 10000"),
this.btnSkins.addTxtTittle("skins", r.Fonts.Main, 40, "#001977", "center", 0, 25),
this.btnSkins.addTxtDop(f.default.totalSkinsOpened + "/" + f.default.totalSkins, r.Fonts.Main, 38, "#ffffff", "center", 0, -65),
(this.btnSkins.onUp = function () {
return t.scene.showSubSceneTransition(u.SubSceneList.SkinsRarity);
}),
this.add(this.btnSkins),
!0 === f.default.canShowI())
) {
var e = new Phaser.GameObjects.Image(this.scene, 95, -100, r.Atlases.ui, "cauntion instance 10000");
this.btnSkins.add(e);
}
(this.btnTrophies = new h.ButtonMainMenu(this.scene, r.Constants.GHW + 500, 0)),
this.btnTrophies.addImage(r.Atlases.ui, "btnMenu3 instance 10000"),
this.btnTrophies.addTxtTittle("trophies", r.Fonts.Main, 30, "#001977", "center", 0, 20),
this.btnTrophies.addTxtDop(c.default.totalComplete + "/" + c.default.totalAchives, r.Fonts.Main, 32, "#ffffff", "center", 0, -58),
(this.btnTrophies.onUp = function () {
return t.scene.showPanelTrophies();
}),
this.add(this.btnTrophies),
(this.btnSetting = new o.ButtonText(this.scene, -100, 180)),
this.btnSetting.addImage(r.Atlases.ui, "btnYellow instance 10000", 0, 5),
this.btnSetting.addImageNoEvents(r.Atlases.ui, "iconSetting instance 10000", -84),
this.btnSetting.addTxtTranslated("settings", r.Fonts.Main, g.Localization.getFontSize("btn_settings"), "#001977", "left", -47),
this.btnSetting.txt.setOrigin(0, 0.5),
(this.btnSetting.onUp = function () {
return t.scene.panelManager.show(a.PanelList.PanelOptionsMenu);
}),
this.add(this.btnSetting);
var i = this.btnPlay.image.width,
n = this.btnPlay.image.height - 6;
(this.blockDailyTask = new l.default(this.scene, "dailyTask", i, n)),
(this.blockDailyStage = new l.default(this.scene, "dailyStage", i, n)),
(this.blockPlay = new l.default(this.scene, "play", i, n)),
(this.blockSkins = new l.default(this.scene, "skins", i, n)),
(this.blockTrophie = new l.default(this.scene, "throphie", i, n)),
this.scene.events.on(d.default.EVENT_TIMER_TICK, this.tickTimer, this),
this.scene.events.on(d.default.EVENT_TIMER_RESET, this.timerReset, this),
d.default.startTimer(),
(this.langMenu = new p.default(this.scene, 0, 0, !1)),
(this.langMenu.visible = !1),
this.add(this.langMenu),
this.scene.events.on(g.Localization.EVENT_CHANGE_LANG, this.changeLang, this);
}),
(t.prototype.changeLang = function () {
d.default.resetTxt(),
(this.btnSetting.txt.text = "settings"),
(this.btnDailyTask.txtTittle.text = "dailyTasks"),
(this.btnDailyTask.txtReset.text = "resetsIn"),
(this.btnDailyStage.txtTittle.text = "dailyStage"),
(this.btnDailyStage.txtReset.text = "resetsIn"),
(this.btnPlay.txt.text = "play"),
(this.btnSkins.txtTittle.text = "skins"),
(this.btnTrophies.txtTittle.text = "trophies");
}),
(t.prototype.timerReset = function () {
this.Ibonus.visible = !0;
}),
(t.prototype.tickTimer = function (t) {
(this.btnDailyTask.txtDop.text = t), (this.btnDailyStage.txtDop.text = t);
}),
(t.prototype.checkDailyI = function () {
this.Idaily.visible = d.default.canShowTaskI();
}),
(t.prototype.resize = function () {
this.logo.y = 60 - r.Constants.UI_SHIFT_Y;
var t = r.Constants.GH + r.Constants.UI_SHIFT_Y;
(this.btnPlay.y = t - 210),
(this.btnDailyTask.y = this.btnPlay.y + 27),
(this.btnDailyStage.y = this.btnPlay.y + 14),
(this.btnSkins.y = this.btnPlay.y + 14),
(this.btnTrophies.y = this.btnPlay.y + 27),
(this.btnSetting.x = r.Constants.GW + r.Constants.UI_SHIFT_X - 145),
(this.btnSetting.y = 65 - r.Constants.UI_SHIFT_Y),
this.langMenu.resize(80 - r.Constants.UI_SHIFT_X, this.btnSetting.y),
this.resizeBlocks();
}),
(t.prototype.resizeBlocks = function () {
this.updateBlock(this.btnDailyTask, this.blockDailyTask),
this.updateBlock(this.btnDailyStage, this.blockDailyStage),
this.updateBlock(this.btnPlay, this.blockPlay),
this.updateBlock(this.btnSkins, this.blockSkins),
this.updateBlock(this.btnTrophies, this.blockTrophie);
var t = this.blockPlay.xPos,
e = this.blockPlay.yPos - this.blockPlay.height / 2;
(this.scene.spawnX === t && this.scene.spawnY === e) || ((this.scene.spawnX = t), (this.scene.spawnY = e), this.scene.player.spawn(t, e));
}),
(t.prototype.updateBlock = function (t, e) {
var i = (t.x + r.Constants.UI_SHIFT_X) * r.Constants.UI_SCALE,
n = (t.y + r.Constants.UI_SHIFT_Y) * r.Constants.UI_SCALE;
e.spawn(i, n, t.image.width * r.Constants.UI_SCALE, (t.image.height - 6) * r.Constants.UI_SCALE);
}),
(t.prototype.destroy = function () {
this.scene.events.off(d.default.EVENT_REWARDED, this.checkDailyI, this),
this.scene.events.off(d.default.EVENT_TIMER_TICK, this.tickTimer, this),
this.scene.events.off(d.default.EVENT_TIMER_RESET, this.timerReset, this),
this.scene.events.off(g.Localization.EVENT_CHANGE_LANG, this.changeLang, this),
s.prototype.destroy.call(this),
(this.logo = null),
(this.btnDailyTask = null),
(this.btnDailyStage = null),
(this.btnPlay = null),
(this.btnSkins = null),
(this.btnTrophies = null),
(this.btnSetting = null),
(this.Idaily = null),
(this.Ibonus = null),
this.blockDailyTask.destroy(),
(this.blockDailyTask = null),
this.blockDailyStage.destroy(),
(this.blockDailyStage = null),
this.blockPlay.destroy(),
(this.blockPlay = null),
this.blockSkins.destroy(),
(this.blockSkins = null),
this.blockTrophie.destroy(),
(this.blockTrophie = null),
(this.langMenu = null);
}),
t
);
})(i.default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
h =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(1), i(42)]),
void 0 ===
(s = function (t, e, a, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
o(e, t),
(e.prototype.addTxt = function (t, e, i, n, s, r, o) {
void 0 === n && (n = "#ffffff"),
void 0 === s && (s = "center"),
void 0 === r && (r = 0),
void 0 === o && (o = 0),
(this.txt = new a.JDText(this.scene, r, o, e, t, i, n, s)),
this.txt.setOrigin(0.5, 0.5),
this.add(this.txt);
}),
(e.prototype.addTxtTranslated = function (t, e, i, n, s, r, o) {
void 0 === n && (n = "#ffffff"),
void 0 === s && (s = "center"),
void 0 === r && (r = 0),
void 0 === o && (o = 0),
(this.txt = new a.JDTextTranslated(this.scene, r, o, e, t, i, n, s)),
this.txt.setOrigin(0.5, 0.5),
this.add(this.txt);
}),
(e.prototype.setTxtInteraction = function () {
this.initEvents(this.txt);
}),
(e.prototype.destroy = function () {
t.prototype.destroy.call(this), (this.txt = null);
}),
e
);
})((i = h(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r =
(this && this.__extends) ||
((s = function (t, e) {
return (s =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
s(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
});
void 0 ===
(n = function (t, e) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function (o) {
function t(t, e, i, n, s) {
var r = o.call(this, t, e, i, n, s) || this;
return (
(r.isOver = !1),
(r.currPointerID = -1),
(r.soundDown = "button_click"),
(r.soundUp = null),
r.setInteractive(),
(r.input.cursor = "pointer"),
r.on(Phaser.Input.Events.POINTER_DOWN, r.inputDown, r),
r.scene.input.on(Phaser.Input.Events.POINTER_UP, r.inputUp, r),
r.on(Phaser.Input.Events.POINTER_OUT, r.inputOut, r),
r.on(Phaser.Input.Events.POINTER_OVER, r.inputOver, r),
r
);
}
return (
r(t, o),
(t.prototype.inputOut = function () {
this.isOver = !1;
}),
(t.prototype.inputOver = function () {
this.isOver = !0;
}),
(t.prototype.inputDown = function (t) {
(this.currPointerID = t.id), this.downState(), this.downComplete();
}),
(t.prototype.downState = function () {
this.scale = 1.1;
}),
(t.prototype.upState = function () {
this.scale = 1;
}),
(t.prototype.inputUp = function (t) {
0 <= this.currPointerID && this.upState(), !1 !== this.isOver && this.currPointerID === t.id ? ((this.currPointerID = -1), this.upComplete()) : (this.currPointerID = -1);
}),
(t.prototype.downComplete = function () {
this.onDown && this.onDown(), this.soundDown;
}),
(t.prototype.upComplete = function () {
this.onUp && this.onUp(), this.soundUp;
}),
(t.prototype.destroy = function () {
o.prototype.destroy.call(this), (this.onDown = null), (this.onUp = null);
}),
t
);
})(Phaser.GameObjects.Image);
e.default = i;
}.apply(e, [i, e])) || (t.exports = n);
},
function (t, e, i) {
var n,
s,
d =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(164), i(165), i(166), i(167), i(173), i(174), i(175), i(176), i(177), i(178)]),
void 0 ===
(s = function (t, e, i, n, s, r, o, a, h, l, u, c) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }),
(e.PanelAreYouOk = e.PanelBonusStageComplete = e.PanelDailyTasks = e.PanelLevelObjectives = e.PanelLevelComplete = e.PanelActSelect = e.PanelPause = e.PanelTrophies = e.PanelOptionsHub = e.PanelOptionsMenu = void 0),
Object.defineProperty(e, "PanelOptionsMenu", {
enumerable: !0,
get: function () {
return d(i).default;
},
}),
Object.defineProperty(e, "PanelOptionsHub", {
enumerable: !0,
get: function () {
return d(n).default;
},
}),
Object.defineProperty(e, "PanelTrophies", {
enumerable: !0,
get: function () {
return d(s).default;
},
}),
Object.defineProperty(e, "PanelPause", {
enumerable: !0,
get: function () {
return d(r).default;
},
}),
Object.defineProperty(e, "PanelActSelect", {
enumerable: !0,
get: function () {
return d(o).default;
},
}),
Object.defineProperty(e, "PanelLevelComplete", {
enumerable: !0,
get: function () {
return d(a).default;
},
}),
Object.defineProperty(e, "PanelLevelObjectives", {
enumerable: !0,
get: function () {
return d(h).default;
},
}),
Object.defineProperty(e, "PanelDailyTasks", {
enumerable: !0,
get: function () {
return d(l).default;
},
}),
Object.defineProperty(e, "PanelBonusStageComplete", {
enumerable: !0,
get: function () {
return d(u).default;
},
}),
Object.defineProperty(e, "PanelAreYouOk", {
enumerable: !0,
get: function () {
return d(c).default;
},
});
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
d =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
o =
(this && this.__createBinding) ||
(Object.create
? function (t, e, i, n) {
void 0 === n && (n = i),
Object.defineProperty(t, n, {
enumerable: !0,
get: function () {
return e[i];
},
});
}
: function (t, e, i, n) {
void 0 === n && (n = i), (t[n] = e[i]);
}),
a =
(this && this.__setModuleDefault) ||
(Object.create
? function (t, e) {
Object.defineProperty(t, "default", { enumerable: !0, value: e });
}
: function (t, e) {
t.default = e;
}),
f =
(this && this.__importStar) ||
function (t) {
if (t && t.__esModule) return t;
var e = {};
if (null != t) for (var i in t) "default" !== i && Object.prototype.hasOwnProperty.call(t, i) && o(e, t, i);
return a(e, t), e;
},
p =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(5), i(1), i(4), i(11), i(6), i(16), i(15), i(8)]),
void 0 ===
(s = function (t, e, s, r, o, a, i, n, h, l, u) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (i = p(i)), (n = f(n));
var c = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
d(e, t),
(e.prototype.init = function () {
var t = this,
e = this.scene.add.nineslice(0, 0, 512, 512, { key: s.Atlases.ui, frame: "menu_box instance 10000" }, s.Constants.pBgOffset, s.Constants.pBgsafeArea);
e.setOrigin(0.5, 0.5),
e.resize(840, 600),
e.setInteractive(),
this.add(e),
(e = this.scene.add.nineslice(0, 40, 512, 512, { key: s.Atlases.ui, frame: "menu_box_inside instance 10000" }, 100, 30)).setOrigin(0.5, 0.5),
e.resize(764, 325),
this.add(e);
var i = new Phaser.GameObjects.Graphics(this.scene, { x: -452, y: -330 });
this.add(i),
i.fillStyle(217552, 1),
i.beginPath(),
i.moveTo(0, 0),
i.lineTo(890, 15),
i.lineTo(890, 90),
i.lineTo(13, 146),
i.closePath(),
i.fillPath(),
(i = null),
(this.btnSfx = new r.ButtonText(this.scene, -185, -45)),
this.btnSfx.addImage(s.Atlases.ui, "btnGreenWide instance 10000", 0, 5),
this.btnSfx.addImageNoEvents(s.Atlases.ui, "iconSFX instance 10000", -125),
this.btnSfx.addTxt("", s.Fonts.Main, a.Localization.getFontSize("btn_settings_sfx"), "#001977", "center", -75),
this.btnSfx.txt.setOrigin(0, 0.5),
(this.btnSfx.onUp = function () {
return t.switchSfx();
}),
this.add(this.btnSfx),
(this.btnMusic = new r.ButtonText(this.scene, 185, -45)),
this.btnMusic.addImage(s.Atlases.ui, "btnGreenWide instance 10000", 0, 5),
this.btnMusic.addImageNoEvents(s.Atlases.ui, "iconMusic instance 10000", -125),
this.btnMusic.addTxt("", s.Fonts.Main, a.Localization.getFontSize("btn_settings_music"), "#001977", "center", -75),
this.btnMusic.txt.setOrigin(0, 0.5),
(this.btnMusic.onUp = function () {
return t.switchMusic();
}),
this.add(this.btnMusic),
this.add(new Phaser.GameObjects.Image(this.scene, -380, -260, s.Atlases.ui, "hud_settings_icon instance 10000"));
var n = new r.BtnImgScale(this.scene, 385, -300, s.Atlases.ui, "btnX instance 10000");
(n.onUp = function () {
u.AdHandler.getInstance().showAd("close_settings_in_maimenu", function () {
t.scene.panelManager.hideCurrent();
});
}),
this.add(n),
(this.txtTitle = new o.JDTextTranslated(this.scene, -320, -260, s.Fonts.Main, "settings", 50)),
this.txtTitle.setOrigin(0, 0.5),
this.add(this.txtTitle),
(this.txtAutoReset = new o.JDTextTranslated(this.scene, -240, 155, s.Fonts.Main, "autoReset", a.Localization.getFontSize("btn_settings_autoreset"), "#ffffff", "left")),
this.txtAutoReset.setOrigin(0, 0.5),
this.txtAutoReset.setWordWrapWidth(600),
this.add(this.txtAutoReset),
(this.btnCheck = new r.ButtonScale(this.scene, -290, 150)),
this.btnCheck.addImage(s.Atlases.ui, "checkbox instance 10000"),
(this.btnCheck.onUp = function () {
return t.switchAutoReset();
}),
this.add(this.btnCheck),
(e = n = null),
this.scene.events.on(a.Localization.EVENT_CHANGE_LANG, this.changeLang, this);
}),
(e.prototype.changeLang = function () {
(this.txtTitle.text = "settings"), (this.txtAutoReset.text = "autoReset");
}),
(e.prototype.show = function () {
t.prototype.show.call(this), l.AnalyticsHandler.getInstance().sendScreenView("show_menu_from_settings"), this.setFrameSfx(), this.setFrameMusic(), this.setFrameAutoReset(), this.scene.pauseWorld();
}),
(e.prototype.hide = function () {
t.prototype.hide.call(this), l.AnalyticsHandler.getInstance().sendScreenView("exit_to_menu_from_settings"), this.scene.resumeMenu();
}),
(e.prototype.switchSfx = function () {
n.default.setEnabled(n.SoundType.SFX), this.setFrameSfx();
}),
(e.prototype.setFrameSfx = function () {
!0 === s.Constants.mutedSfx
? (this.btnSfx.image.setFrame("btnRedWide instance 10000"), this.btnSfx.image2.setFrame("iconSFX instance 10001"), (this.btnSfx.txt.text = a.Localization.getText("sfxOff")))
: (this.btnSfx.image.setFrame("btnGreenWide instance 10000"), this.btnSfx.image2.setFrame("iconSFX instance 10000"), (this.btnSfx.txt.text = a.Localization.getText("sfxOn")));
}),
(e.prototype.switchMusic = function () {
n.default.setEnabled(n.SoundType.Music), this.setFrameMusic();
}),
(e.prototype.setFrameMusic = function () {
!0 === s.Constants.mutedMusic
? (this.btnMusic.image.setFrame("btnRedWide instance 10000"), this.btnMusic.image2.setFrame("iconMusic instance 10001"), (this.btnMusic.txt.text = a.Localization.getText("musOff")))
: (this.btnMusic.image.setFrame("btnGreenWide instance 10000"), this.btnMusic.image2.setFrame("iconMusic instance 10000"), (this.btnMusic.txt.text = a.Localization.getText("musOn")));
}),
(e.prototype.switchAutoReset = function () {
(s.Constants.autoReset = !s.Constants.autoReset), this.setFrameAutoReset(), i.default.getInstance().saveProgress();
}),
(e.prototype.setFrameAutoReset = function () {
this.btnCheck.image.setFrame(!1 === s.Constants.autoReset ? "checkbox instance 10000" : "checkbox instance 10001");
}),
(e.prototype.destroy = function () {
this.scene.events.off(a.Localization.EVENT_CHANGE_LANG, this.changeLang, this),
t.prototype.destroy.call(this),
(this.btnCheck = null),
(this.btnMusic = null),
(this.btnSfx = null),
(this.txtTitle = null),
(this.txtAutoReset = null);
}),
e
);
})((h = p(h)).default);
e.default = c;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
f =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
o =
(this && this.__createBinding) ||
(Object.create
? function (t, e, i, n) {
void 0 === n && (n = i),
Object.defineProperty(t, n, {
enumerable: !0,
get: function () {
return e[i];
},
});
}
: function (t, e, i, n) {
void 0 === n && (n = i), (t[n] = e[i]);
}),
a =
(this && this.__setModuleDefault) ||
(Object.create
? function (t, e) {
Object.defineProperty(t, "default", { enumerable: !0, value: e });
}
: function (t, e) {
t.default = e;
}),
p =
(this && this.__importStar) ||
function (t) {
if (t && t.__esModule) return t;
var e = {};
if (null != t) for (var i in t) "default" !== i && Object.prototype.hasOwnProperty.call(t, i) && o(e, t, i);
return a(e, t), e;
},
g =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(5), i(1), i(4), i(11), i(6), i(12), i(16), i(21), i(8)]),
void 0 ===
(s = function (t, e, o, a, h, l, i, n, s, r, u, c) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (i = g(i)), (n = p(n));
var d = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
f(e, t),
(e.prototype.init = function () {
var t = this,
e = this.scene.add.nineslice(0, 0, 512, 512, { key: o.Atlases.ui, frame: "menu_box instance 10000" }, o.Constants.pBgOffset, o.Constants.pBgsafeArea);
e.setOrigin(0.5, 0.5),
e.resize(840, 840),
e.setInteractive(),
this.add(e),
(e = this.scene.add.nineslice(0, 40, 512, 512, { key: o.Atlases.ui, frame: "menu_box_inside instance 10000" }, 100, 30)).setOrigin(0.5, 0.5),
e.resize(764, 565),
this.add(e);
var i = new Phaser.GameObjects.Graphics(this.scene, { x: -452, y: -450 });
this.add(i), i.fillStyle(217552, 1), i.beginPath(), i.moveTo(0, 0), i.lineTo(890, 15), i.lineTo(890, 90), i.lineTo(13, 146), i.closePath(), i.fillPath(), (i = null);
var n = new a.ButtonText(this.scene, -185, -165);
n.addImage(o.Atlases.ui, "btnYellowWide instance 10000", 0, 5),
n.addImageNoEvents(o.Atlases.ui, "iconPlay instance 10000", -125),
n.addTxtTranslated("mainmenu", o.Fonts.Main, l.Localization.getFontSize("btn_mainmenu"), "#001977", "center", -75),
n.txt.setOrigin(0, 0.5),
(n.onUp = function () {
c.AdHandler.getInstance().showAd("mainmenu_from_hub_settings", function () {
t.goBack();
});
}),
this.add(n),
(n = new a.ButtonText(this.scene, -185, -45)).addImage(o.Atlases.ui, "btnYellowWide instance 10000", 0, 5),
n.addImageNoEvents(o.Atlases.ui, "iconTrophie instance 10000", -125),
n.addTxtTranslated("trophies", o.Fonts.Main, 30, "#001977", "center", -75),
n.txt.setOrigin(0, 0.5),
(n.onUp = function () {
return t.scene.panelManager.show(u.PanelList.PanelTrophies);
}),
this.add(n),
(this.btnSfx = new a.ButtonText(this.scene, 185, -105)),
this.btnSfx.addImage(o.Atlases.ui, "btnGreenWide instance 10000", 0, 5),
this.btnSfx.addImageNoEvents(o.Atlases.ui, "iconSFX instance 10000", -125),
this.btnSfx.addTxt("", o.Fonts.Main, l.Localization.getFontSize("btn_settings_sfx"), "#001977", "center", -75),
this.btnSfx.txt.setOrigin(0, 0.5),
(this.btnSfx.onUp = function () {
return t.switchSfx();
}),
this.add(this.btnSfx),
(n = new a.ButtonText(this.scene, -185, 75)).addImage(o.Atlases.ui, "btnYellowWide instance 10000", 0, 5),
n.addImageNoEvents(o.Atlases.ui, "iconAct instance 10000", -125),
n.addTxtTranslated("actSelect", o.Fonts.Main, l.Localization.getFontSize("btn_settings_actselect"), "#001977", "center", -75),
n.txt.setOrigin(0, 0.5),
(n.onUp = function () {
return t.scene.panelManager.show(u.PanelList.PanelActSelect);
}),
this.add(n),
(this.btnMusic = new a.ButtonText(this.scene, 185, 15)),
this.btnMusic.addImage(o.Atlases.ui, "btnGreenWide instance 10000", 0, 5),
this.btnMusic.addImageNoEvents(o.Atlases.ui, "iconMusic instance 10000", -125),
this.btnMusic.addTxt("", o.Fonts.Main, l.Localization.getFontSize("btn_settings_music"), "#001977", "center", -75),
this.btnMusic.txt.setOrigin(0, 0.5),
(this.btnMusic.onUp = function () {
return t.switchMusic();
}),
this.add(this.btnMusic),
this.add(new Phaser.GameObjects.Image(this.scene, -380, -380, o.Atlases.ui, "hud_settings_icon instance 10000"));
var s = new a.BtnImgScale(this.scene, 385, -420, o.Atlases.ui, "btnX instance 10000");
(s.onUp = function () {
c.AdHandler.getInstance().showAd("close_hub_settings", function () {
t.close();
});
}),
this.add(s);
var r = new h.JDTextTranslated(this.scene, -320, -380, o.Fonts.Main, "settings", 50);
r.setOrigin(0, 0.5),
this.add(r),
(r = new h.JDTextTranslated(this.scene, -240, 275, o.Fonts.Main, "autoReset", l.Localization.getFontSize("btn_settings_autoreset"), "#ffffff", "left")).setOrigin(0, 0.5),
r.setWordWrapWidth(600),
this.add(r),
(this.btnCheck = new a.ButtonScale(this.scene, -290, 270)),
this.btnCheck.addImage(o.Atlases.ui, "checkbox instance 10000"),
(this.btnCheck.onUp = function () {
return t.switchAutoReset();
}),
this.add(this.btnCheck),
(n = e = r = s = null);
}),
(e.prototype.show = function () {
t.prototype.show.call(this), this.setFrameSfx(), this.setFrameMusic(), this.setFrameAutoReset(), this.scene.pauseWorld();
}),
(e.prototype.goBack = function () {
this.close(), this.scene.showSubSceneTransition(s.SubSceneList.Menu);
}),
(e.prototype.resetlevel = function () {
this.close(), this.scene.resetLevel();
}),
(e.prototype.clikcOnBlack = function () {
this.close();
}),
(e.prototype.close = function () {
this.scene.panelManager.hideCurrent(), this.scene.resumeWorld();
}),
(e.prototype.switchSfx = function () {
n.default.setEnabled(n.SoundType.SFX), this.setFrameSfx();
}),
(e.prototype.setFrameSfx = function () {
!0 === o.Constants.mutedSfx
? (this.btnSfx.image.setFrame("btnRedWide instance 10000"), this.btnSfx.image2.setFrame("iconSFX instance 10001"), (this.btnSfx.txt.text = l.Localization.getText("sfxOff")))
: (this.btnSfx.image.setFrame("btnGreenWide instance 10000"), this.btnSfx.image2.setFrame("iconSFX instance 10000"), (this.btnSfx.txt.text = l.Localization.getText("sfxOn")));
}),
(e.prototype.switchMusic = function () {
n.default.setEnabled(n.SoundType.Music), this.setFrameMusic();
}),
(e.prototype.setFrameMusic = function () {
!0 === o.Constants.mutedMusic
? (this.btnMusic.image.setFrame("btnRedWide instance 10000"), this.btnMusic.image2.setFrame("iconMusic instance 10001"), (this.btnMusic.txt.text = l.Localization.getText("musOff")))
: (this.btnMusic.image.setFrame("btnGreenWide instance 10000"), this.btnMusic.image2.setFrame("iconMusic instance 10000"), (this.btnMusic.txt.text = l.Localization.getText("musOn")));
}),
(e.prototype.switchAutoReset = function () {
(o.Constants.autoReset = !o.Constants.autoReset), this.setFrameAutoReset(), i.default.getInstance().saveProgress();
}),
(e.prototype.setFrameAutoReset = function () {
this.btnCheck.image.setFrame(!1 === o.Constants.autoReset ? "checkbox instance 10000" : "checkbox instance 10001");
}),
(e.prototype.destroy = function () {
t.prototype.destroy.call(this), (this.btnCheck = null), (this.btnMusic = null), (this.btnSfx = null);
}),
e
);
})((r = g(r)).default);
e.default = d;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(5), i(1), i(16), i(24), i(4), i(15), i(8), i(12)]),
void 0 ===
(s = function (t, e, d, f, p, i, g, v, n, y, s) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (i = a(i)), (g = a(g));
var r = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
o(e, t),
(e.prototype.init = function () {
var t = this,
e = this.scene.add.nineslice(0, 30, 512, 512, { key: d.Atlases.ui, frame: "menu_box instance 10000" }, d.Constants.pBgOffset, d.Constants.pBgsafeArea);
e.setOrigin(0.5, 0.5),
e.resize(860, 860),
this.add(e),
e.setInteractive(),
(e = this.scene.add.nineslice(0, 70, 512, 512, { key: d.Atlases.ui, frame: "menu_box_inside instance 10000" }, 100, 25)).setOrigin(0.5, 0.5),
e.resize(800, 660),
this.add(e),
(e = null);
var i = new Phaser.GameObjects.Graphics(this.scene, { x: -465, y: -450 });
this.add(i),
i.fillStyle(217552, 1),
i.beginPath(),
i.moveTo(0, 0),
i.lineTo(915, 17),
i.lineTo(915, 90),
i.lineTo(19, 146),
i.closePath(),
i.fillPath(),
(i = null),
this.add(new Phaser.GameObjects.Image(this.scene, -400, -380, d.Atlases.ui, "hud_trophie_icon instance 10000"));
var n = new f.BtnImgScale(this.scene, 390, -420, d.Atlases.ui, "btnX instance 10000");
(n.onUp = function () {
y.AdHandler.getInstance().showAd("close_trophies", function () {
t.scene.panelManager.hideCurrent();
});
}),
this.add(n),
(n = null),
(this.txtTitle = new p.JDTextTranslated(this.scene, -340, -380, d.Fonts.Main, "trophies", 50)),
this.txtTitle.setOrigin(0, 0.5),
this.add(this.txtTitle);
var s = -110,
r = -260,
o = -260,
a = s + 320;
(this.txtTitleActs = new p.JDTextTranslated(this.scene, -370, s - 90, d.Fonts.Main, "trophieTitle1", v.Localization.getFontSize("btn_trophies_title1"))),
this.txtTitleActs.setOrigin(0, 0.5),
this.add(this.txtTitleActs),
(this.progressMaskSc1 = g.default.getStandardActsProgress());
var h = new p.JDText(this.scene, 30, this.txtTitleActs.y, d.Fonts.Main, Math.floor(100 * this.progressMaskSc1) + "%", 36);
h.setOrigin(1, 0.5), this.add(h);
var l = new Phaser.GameObjects.Image(this.scene, 210, h.y, d.Atlases.ui, "progressBg2 instance 10000");
this.add(l),
(l = new Phaser.GameObjects.Image(this.scene, l.x, l.y, d.Atlases.ui, "progress2 instance 10000")),
this.add(l),
(this.progressMaskX1 = l.x - l.width / 2),
(this.progressMaskY1 = l.y),
(this.progressMask1 = new Phaser.GameObjects.Graphics(this.scene)),
this.progressMask1.fillStyle(16711680, 1),
this.progressMask1.fillRect(0, -l.height / 2, l.width, l.height),
this.progressMask1.setScrollFactor(0, 0),
(l.mask = this.progressMask1.createGeometryMask()),
(this.txtTitleHardcore = new p.JDTextTranslated(this.scene, -370, a - 85, d.Fonts.Main, "trophieTitle2", 36)),
this.txtTitleHardcore.setOrigin(0, 0.5),
this.add(this.txtTitleHardcore),
(this.progressMaskSc2 = g.default.getHardcoreProgress()),
(h = new p.JDText(this.scene, 30, this.txtTitleHardcore.y, d.Fonts.Main, Math.floor(100 * this.progressMaskSc2) + "%", 36)).setOrigin(1, 0.5),
this.add(h),
(l = new Phaser.GameObjects.Image(this.scene, 210, h.y, d.Atlases.ui, "progressBg2 instance 10000")),
this.add(l),
(l = new Phaser.GameObjects.Image(this.scene, l.x, l.y, d.Atlases.ui, "progress2 instance 10000")),
this.add(l),
(this.progressMaskX2 = l.x - l.width / 2),
(this.progressMaskY2 = l.y),
(this.progressMask2 = new Phaser.GameObjects.Graphics(this.scene)),
this.progressMask2.fillStyle(16711680, 1),
this.progressMask2.fillRect(0, -l.height / 2, l.width, l.height),
this.progressMask2.setScrollFactor(0, 0),
(l.mask = this.progressMask2.createGeometryMask());
for (var u = 1; u <= d.Constants.totalActs; u++) {
var c = 0;
!0 === g.default.isCompletedAct(u, !1) && (c = u),
(l = new Phaser.GameObjects.Image(this.scene, r, s, d.Atlases.ui, "trophieAct instance " + (1e4 + c))),
this.add(l),
0 < c && ((h = new p.JDTextTranslated(this.scene, l.x, l.y - 5, d.Fonts.Main, "act" + u, 24)).setOrigin(0.5, 0.5), h.setStroke("#001977", 6), this.add(h)),
u !== d.Constants.totalActs &&
(!(c = 0) === g.default.isCompletedAct(u, !0) && (c = u),
(l = new Phaser.GameObjects.Image(this.scene, o, a, d.Atlases.ui, "trophieActHard instance " + (1e4 + c))),
this.add(l),
(r += 130),
(o += 130),
u % 5 == 0 && ((r = -260), (o = -195), (s += 115), (a += 100)));
}
(h = l = null), this.scene.events.on(v.Localization.EVENT_CHANGE_LANG, this.changeLang, this);
}),
(e.prototype.changeLang = function () {
(this.txtTitle.text = "trophies"), (this.txtTitleActs.text = "trophieTitle1"), (this.txtTitleHardcore.text = "trophieTitle2");
}),
(e.prototype.show = function () {
t.prototype.show.call(this), n.AnalyticsHandler.getInstance().sendScreenView("show_trophies");
}),
(e.prototype.hide = function () {
t.prototype.hide.call(this),
this.scene.currSubScene === s.SubSceneList.Menu
? n.AnalyticsHandler.getInstance().sendScreenView("exit_to_menu_from_trophies")
: n.AnalyticsHandler.getInstance().sendScreenView("exit_to_hub_from_trophies"),
this.scene.resumeMenu();
}),
(e.prototype.resize = function () {
var t = this.scene,
e = t.ZOOM_UI_SCALE;
(this.progressMask1.scaleX = this.progressMaskSc1 * e),
(this.progressMask1.scaleY = e),
(this.progressMask1.x = t.guiX + (this.x + this.progressMaskX1) * e),
(this.progressMask1.y = t.guiY + (this.y + this.progressMaskY1) * e),
(this.progressMask2.scaleX = this.progressMaskSc2 * e),
(this.progressMask2.scaleY = e),
(this.progressMask2.x = t.guiX + (this.x + this.progressMaskX2) * e),
(this.progressMask2.y = t.guiY + (this.y + this.progressMaskY2) * e);
}),
(e.prototype.destroy = function () {
this.scene.events.off(v.Localization.EVENT_CHANGE_LANG, this.changeLang, this),
t.prototype.destroy.call(this),
this.progressMask1.destroy(),
this.progressMask2.destroy(),
(this.progressMask1 = null),
(this.progressMask2 = null),
(this.txtTitle = null),
(this.txtTitleActs = null),
(this.txtTitleHardcore = null);
}),
e
);
})(i.default);
e.default = r;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
p =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
g =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(5), i(1), i(19), i(10), i(34), i(12), i(16), i(8), i(4), i(15)]),
void 0 ===
(s = function (t, e, o, a, h, l, u, c, i, n, d, f, s) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (l = g(l)), (u = g(u));
var r = (function (e) {
function t() {
return (null !== e && e.apply(this, arguments)) || this;
}
return (
p(t, e),
(t.prototype.init = function () {
var t = this;
if (((this.stars = new Array()), (this.x = 0), (this.y = 0), this.scene.currentLevelID !== o.Constants.bonusStageID)) {
var e = this.scene.add.nineslice(o.Constants.GHW, o.Constants.GHH, 512, 512, { key: o.Atlases.ui, frame: "menu_box instance 10000" }, o.Constants.pBgOffset, o.Constants.pBgsafeArea);
e.setOrigin(0.5, 0.5),
e.resize(695, 642),
e.setInteractive(),
this.add(e),
(e = this.scene.add.nineslice(o.Constants.GHW, o.Constants.GHH + 30, 512, 512, { key: o.Atlases.ui, frame: "menu_box_inside instance 10000" }, 100, 30)).setOrigin(0.5, 0.5),
e.resize(620, 444),
this.add(e);
var i = new Phaser.GameObjects.Graphics(this.scene, { x: o.Constants.GHW - 376, y: o.Constants.GHH - 380 });
this.add(i), i.fillStyle(217552, 1), i.beginPath(), i.moveTo(0, 0), i.lineTo(740, 18), i.lineTo(740, 110), i.lineTo(10, 146), i.closePath(), i.fillPath(), (i = null);
var n = new Phaser.GameObjects.Image(this.scene, o.Constants.GHW - 310, o.Constants.GHH - 310, o.Atlases.ui, "hud_act_icon instance 10000");
this.add(n);
var s = new h.JDTextTranslated(this.scene, n.x + 60, n.y, o.Fonts.Main, "lvlObj", 50);
s.setOrigin(0, 0.5), this.add(s);
var r = o.Constants.GHW - 230;
this.addTarget(r, o.Constants.GHH - 110, u.default.getLevelTargetText(1, 0)),
this.addTarget(r, o.Constants.GHH + 30, u.default.getLevelTargetText(2, this.scene.getTargetCoins())),
this.addTarget(r, o.Constants.GHH + 170, u.default.getLevelTargetText(3, this.scene.getTargetDeath())),
(e = s = n = null),
(this.btnRetry = new a.ButtonText(this.scene, o.Constants.GHW, 0)),
this.btnRetry.addImage(o.Atlases.ui, "btnYellow instance 10000", 0, 5, 0.85),
this.btnRetry.addTxtTranslated("retry", o.Fonts.Main, f.Localization.getFontSize("btn_gameplay_retry"), "#001977"),
(this.btnRetry.onUp = function () {
d.AdHandler.getInstance().showAd("click_retry_pause_popup", function () {
t.resetlevel();
});
}),
this.add(this.btnRetry);
}
(this.txtPaused = new h.JDTextTranslated(this.scene, o.Constants.GHW, 0, o.Fonts.Main, "paused", 110)),
this.txtPaused.setOrigin(0.5, 0.5),
this.add(this.txtPaused),
(this.coinBg = new Phaser.GameObjects.Image(this.scene, 0, 0, o.Atlases.ui, "hud_side_bottom instance 10000")),
this.coinBg.setOrigin(1, 0),
this.add(this.coinBg),
(this.coinIcon = new Phaser.GameObjects.Image(this.scene, 0, 0, o.Atlases.ui, "coin instance 10000")),
this.add(this.coinIcon),
(this.txtCoins = new h.JDText(this.scene, 0, 0, o.Fonts.Main, "10.000", 50)),
this.txtCoins.setOrigin(0, 0.5),
this.add(this.txtCoins),
(this.btnExit = new a.ButtonText(this.scene, o.Constants.GHW - 250, 0)),
this.btnExit.addImage(o.Atlases.ui, "btnRed instance 10000", 0, 5, 0.85),
this.btnExit.addTxtTranslated("exit", o.Fonts.Main, 30, "#001977"),
(this.btnExit.onUp = function () {
d.AdHandler.getInstance().showAd("click_exit_pause_popup", function () {
t.goBack();
});
}),
this.add(this.btnExit),
(this.btnContinue = new a.ButtonText(this.scene, o.Constants.GHW + 250, 0)),
this.btnContinue.addImage(o.Atlases.ui, "btnGreen instance 10000", 0, 5, 0.85),
this.btnContinue.addTxtTranslated("continue", o.Fonts.Main, f.Localization.getFontSize("btn_continue"), "#001977"),
(this.btnContinue.onUp = function () {
d.AdHandler.getInstance().showAd("click_continue_pause_popup", function () {
t.close();
});
}),
this.add(this.btnContinue),
(this.dailyContainer = new Phaser.GameObjects.Container(this.scene)),
this.add(this.dailyContainer),
(this.dailyBg = new Phaser.GameObjects.Image(this.scene, -20, o.Constants.GHH, o.Atlases.ui, "menu_box instance 10000")),
this.dailyBg.setOrigin(0, 0.5),
(this.dailyBg.scaleX = 1.03),
this.dailyBg.setInteractive(),
this.dailyContainer.add(this.dailyBg),
(this.dailyTasks = new Array(4)),
(this.dailyTasks[0] = new c.DailyTaskPause(this.dailyContainer, 0, 250, o.Constants.GHH - 396)),
(this.dailyTasks[1] = new c.DailyTaskPause(this.dailyContainer, 1, 250, o.Constants.GHH - 132)),
(this.dailyTasks[2] = new c.DailyTaskPause(this.dailyContainer, 2, 250, o.Constants.GHH + 132)),
(this.dailyTasks[3] = new c.DailyTaskPause(this.dailyContainer, 3, 250, o.Constants.GHH + 396)),
this.scene.events.on(l.default.EVENT_TIMER_RESET, this.reset, this),
this.scene.events.on(l.default.EVENT_REWARDED, this.updateCoins, this);
}),
(t.prototype.reset = function () {
for (var t = 0; t < this.dailyTasks.length; t++) this.dailyTasks[t].reset();
}),
(t.prototype.addTarget = function (t, e, i) {
var n = new Phaser.GameObjects.Image(this.scene, t, e, o.Atlases.ui, "boxStar instance 10000");
this.add(n), this.stars.push(n);
var s = new h.JDText(this.scene, n.x + 80, n.y + 5, o.Fonts.Main, i, 40, "#ffffff", "left");
s.setOrigin(0, 0.5), s.setWordWrapWidth(450), this.add(s), (s = n = null);
}),
(t.prototype.show = function () {
e.prototype.show.call(this),
l.default.startTimer(),
this.scene.pauseWorld(),
this.updateCoins(),
this.scene.currentLevelID !== o.Constants.bonusStageID &&
(1 === this.scene.isTargetLevelComplete() && this.stars[0].setFrame("boxStar instance 10001"),
1 === this.scene.isTargetCoinsComplete() && this.stars[1].setFrame("boxStar instance 10001"),
1 === this.scene.isTargetDeathComplete() && this.stars[2].setFrame("boxStar instance 10001"));
for (var t = 0; t < this.dailyTasks.length; t++) this.dailyTasks[t].updateProgress();
}),
(t.prototype.hide = function () {
e.prototype.hide.call(this), l.default.stopTimer();
}),
(t.prototype.updateCoins = function () {
this.txtCoins.text = u.default.moneyDecorator(o.Constants.totalMoney);
}),
(t.prototype.goBack = function () {
this.close(), this.scene.currSubScene === i.SubSceneList.BonusStage && l.default.bonusStageExit(), this.scene.showSubSceneTransition(!0 === this.scene.prevMenu ? i.SubSceneList.Menu : i.SubSceneList.Hub);
}),
(t.prototype.resetlevel = function () {
s.AnalyticsHandler.getInstance().sendCustomEvent("levelCompletion"), s.AnalyticsHandler.getInstance().sendCustomEvent("levelStart"), this.close(), this.scene.resetLevel();
}),
(t.prototype.clikcOnBlack = function () {
this.close();
}),
(t.prototype.close = function () {
s.AnalyticsHandler.getInstance().sendCustomEvent("levelCompletion"), this.scene.panelManager.hideCurrent(), this.scene.resumeWorld();
}),
(t.prototype.resize = function () {
(this.coinBg.x = o.Constants.GW + o.Constants.UI_SHIFT_X),
(this.coinBg.y = -o.Constants.UI_SHIFT_Y),
(this.coinIcon.x = this.coinBg.x - 235),
(this.coinIcon.y = this.coinBg.y + 65),
(this.txtCoins.x = this.coinIcon.x + 50),
(this.txtCoins.y = this.coinIcon.y - 5),
(this.btnExit.y = this.btnContinue.y = o.Constants.GH - 100 + o.Constants.UI_SHIFT_Y),
this.btnRetry && (this.btnRetry.y = this.btnExit.y),
(this.txtPaused.y = 90 - o.Constants.UI_SHIFT_Y),
(this.dailyContainer.x = -o.Constants.UI_SHIFT_X),
(this.dailyBg.scaleY = (250 + o.Constants.GH + 3 * o.Constants.UI_SHIFT_Y) / this.dailyBg.height);
for (var t = 0; t < this.dailyTasks.length; t++) this.dailyTasks[t].resize();
}),
(t.prototype.destroy = function () {
this.scene.events.off(l.default.EVENT_TIMER_RESET, this.reset, this),
this.scene.events.off(l.default.EVENT_REWARDED, this.updateCoins, this),
e.prototype.destroy.call(this),
(this.coinBg = null),
(this.coinIcon = null),
(this.txtCoins = null),
(this.btnRetry = null),
(this.btnExit = null),
(this.btnContinue = null),
(this.txtPaused = null),
(this.dailyContainer = null),
(this.dailyBg = null);
for (var t = 0; t < this.dailyTasks.length; t++) this.dailyTasks[t].destroy();
(this.dailyTasks = null), (this.stars = null);
}),
t
);
})((n = g(n)).default);
e.default = r;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n, s;
(n = [i, e, i(0)]),
void 0 ===
(s = function (t, e, h) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function () {
function t(t, e, i, n, s) {
(this.currPointerID = -1),
(this.sprite = new Phaser.GameObjects.Image(t, e, i, h.Atlases.ui, n)),
(this.sprite.alpha = 0.5),
(this.sprite.scale = 1.2),
s && (this.sprite.on(Phaser.Input.Events.POINTER_OUT, this.inputUp, this), this.sprite.on(Phaser.Input.Events.POINTER_OVER, this.inputDown, this)),
this.sprite.on(Phaser.Input.Events.POINTER_DOWN, this.inputDown, this),
t.input.on(Phaser.Input.Events.POINTER_UP, this.inputUp, this),
(this.isDown = !1);
var r = this.sprite.width / 2,
o = 1.3 * r,
a = 1.1 * r;
this.sprite.setInteractive(new Phaser.Geom.Circle(a, a, o), Phaser.Geom.Circle.Contains);
}
return (
(t.prototype.inputDown = function (t) {
(this.currPointerID = t.id), (this.isDown = !0);
}),
(t.prototype.inputUp = function (t) {
!1 !== this.isDown && this.currPointerID === t.id && ((this.currPointerID = -1), !0 === this.isDown && this.onUp && this.onUp(), (this.isDown = !1));
}),
(t.prototype.hide = function () {
this.sprite.visible = !1;
}),
(t.prototype.show = function () {
this.sprite.visible = !0;
}),
(t.prototype.buttonPressed = function () {
return this.isDown;
}),
t
);
})();
e.default = i;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n, s;
(n = [i, e, i(0)]),
void 0 ===
(s = function (t, e, r) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function () {
function t(t, e, i, n, s) {
(this.currPointerID = -1),
(this.scene = t),
(this.sprite = new Phaser.GameObjects.Image(t, e, i, r.Atlases.ui, n)),
(this.sprite.alpha = 0.5),
(this.sprite.scale = 2),
this.sprite.setInteractive(),
this.sprite.on(Phaser.Input.Events.POINTER_DOWN, this.inputDown, this),
this.scene.input.on(Phaser.Input.Events.POINTER_UP, this.inputUp, this),
this.setHitArea(),
(this.isDown = !1),
(this.upDd = !1),
(this.downDd = !1),
(this.leftDd = !1),
(this.oneStick = s);
}
return (
(t.prototype.setHitArea = function () {
var t = 1.2 * this.sprite.width,
e = 1.35 * this.sprite.height,
i = (this.sprite.width - t) / 2,
n = (this.sprite.height - e) / 2;
this.sprite.input.hitArea.setTo(i, n, t, e);
}),
(t.prototype.inputDown = function (t) {
(this.currPointerID = t.id), (this.pointer = t), (this.isDown = !0);
}),
(t.prototype.inputUp = function (t) {
!1 !== this.isDown &&
this.currPointerID === t.id &&
((this.currPointerID = -1), !0 === this.isDown && this.onRelease && this.onRelease(), (this.isDown = !1), (this.upDd = !1), (this.downDd = !1), (this.leftDd = !1), (this.rightDd = !1));
}),
(t.prototype.hide = function () {
this.sprite.visible = !1;
}),
(t.prototype.show = function () {
this.sprite.visible = !0;
}),
(t.prototype.upIsDown = function () {
return this.upDd;
}),
(t.prototype.downIsDown = function () {
return this.downDd;
}),
(t.prototype.leftIsDown = function () {
return this.leftDd;
}),
(t.prototype.rightIsDown = function () {
return this.rightDd;
}),
(t.prototype.setSpriteFrame = function (t) {
this.sprite.frame.name !== t && this.sprite.setFrame(t);
}),
(t.prototype.update = function () {
if (!0 === this.oneStick)
if (!0 === this.isDown) {
var t = (this.sprite.x + r.Constants.UI_SHIFT_X) * r.Constants.UI_SCALE;
this.pointer.x < t
? ((this.leftDd = !0), this.leftIsDown(), this.setSpriteFrame("btnLeftPressed instance 10000"), (this.rightDd = !1))
: ((this.rightDd = !0), this.rightIsDown(), this.setSpriteFrame("btnRightPressed instance 10000"), (this.leftDd = !1));
} else this.setSpriteFrame("btnNonePressed instance 10000");
else if (!0 === this.isDown) {
var e,
i = (this.sprite.x + r.Constants.UI_SHIFT_X) * r.Constants.UI_SCALE,
n = (this.sprite.y + r.Constants.UI_SHIFT_Y) * r.Constants.UI_SCALE;
if (Math.pow(this.pointer.position.x - i, 2) + Math.pow(this.pointer.position.y - n, 2) < 400) return (this.upDd = !1), (this.downDd = !1), (this.leftDd = !1), void (this.rightDd = !1);
this.pointer.position.x < i
? ((this.rightDd = !1),
1 < (e = (this.pointer.y - n) / (this.pointer.position.x - i))
? ((this.upDd = !0), (this.leftDd = !1), (this.downDd = !1))
: e < -1
? ((this.upDd = !1), (this.leftDd = !1), (this.downDd = !0))
: ((this.upDd = !1), (this.leftDd = !0), (this.downDd = !1)))
: ((this.leftDd = !1),
1 < (e = (this.pointer.y - n) / (this.pointer.position.x - i))
? ((this.upDd = !1), (this.rightDd = !1), (this.downDd = !0))
: (e < -1 ? ((this.upDd = !0), (this.rightDd = !1)) : ((this.upDd = !1), (this.rightDd = !0)), (this.downDd = !1)));
}
}),
t
);
})();
e.default = i;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
h =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(1), i(55)]),
void 0 ===
(s = function (t, e, a, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
o(e, t),
(e.prototype.addTxtReset = function (t, e, i, n, s, r, o) {
void 0 === n && (n = "#ffffff"),
void 0 === s && (s = "center"),
void 0 === r && (r = 0),
void 0 === o && (o = 0),
(this.txtReset = new a.JDTextTranslated(this.scene, r, o, e, t, i, n, s)),
this.txtReset.setOrigin(0.5, 0.5),
this.add(this.txtReset);
}),
(e.prototype.destroy = function () {
t.prototype.destroy.call(this), (this.txtReset = null);
}),
e
);
})((i = h(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(5), i(19), i(56), i(8), i(4)]),
void 0 ===
(s = function (t, e, l, u, c, i, d, f) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (c = a(c));
var n = (function (h) {
function t(t, e, i, n) {
var s,
r = h.call(this, t, e, i, n, 544, 290) || this;
r.x = i;
var o = c.default.getData(e);
(r.btnAD = new u.ButtonText(t.scene, i - 145, n + 80)),
r.btnAD.addImage(l.Atlases.ui, "btnYellow instance 10000", 13, 5, 1, 0.85),
r.btnAD.addImageNoEvents(l.Atlases.ui, "iconPlay2 instance 10000", -65, 0, 0.85, 0.85),
r.btnAD.addTxtTranslated("watchAD", l.Fonts.Main, f.Localization.getFontSize("btn_watch_add"), "#001977", "center", -30),
r.btnAD.txt.setOrigin(0, 0.5),
r.btnAD.txt.setWordWrapWidth(220),
(null === (s = window._azerionIntegration) || void 0 === s ? void 0 : s.af)
? (r.btnAD.visible = !1)
: ((r.btnAD.onUp = function () {
return d.AdHandler.getInstance().showRewarded(function (t) {
t ? r.completeAD() : (r.btnAD.txt.setText("unavailable"), (r.btnAD.txt.scale = 0.75), (r.btnAD.onUp = function () {}));
}, null);
}),
t.add(r.btnAD));
var a = 0;
return (
o.rewarded <= 0 ? (a = 135) : (r.btnAD.visible = !1),
r.createBtnReward(i + a, n + 80, 0.95, 0.85, o.rewarded),
r.createTittleDes(i - 260, n - 130, i - 260, n - 100, 32, 26, o.des, 500),
r.createProgress(i, n, 1.18, o.curr, o.target),
(o = null),
r
);
}
return (
o(t, h),
(t.prototype.changeLang = function () {
(this.btnAD.txt.text = "watchAD"), (this.btnReward.txt.text = this.rewardLocalize), (this.txtTitle.text = "dailyTaskTitle" + this.id), (this.txtDes.text = c.default.getData(this.id).des);
}),
(t.prototype.reset = function () {
h.prototype.reset.call(this), (this.btnAD.visible = !0), (this.btnReward.x = this.x + 135);
}),
(t.prototype.completeAD = function () {
this.reward(), (this.btnReward.x = this.x), (this.btnAD.visible = !1);
}),
(t.prototype.destroy = function () {
h.prototype.destroy.call(this), (this.btnAD = null);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
h =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
o =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(19), i(56)]),
void 0 ===
(s = function (t, e, a, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (a = o(a));
var n = (function (o) {
function t(t, e, i, n) {
var s = o.call(this, t, e, i, n, 458, 240) || this,
r = a.default.getData(e);
return s.createBtnReward(i, n + 60, 0.95, 0.85, r.rewarded), s.createTittleDes(i - 215, n - 95, i - 215, n - 65, 26, 22, r.des, 450), s.createProgress(i, n + 20, 1, r.curr, r.target), (r = null), s;
}
return (
h(t, o),
(t.prototype.updateProgress = function () {
var t = a.default.getData(this.id);
(this.txtProgress.text = t.curr + "/" + t.target), (this.maskScX = t.curr / t.target), 1 === t.rewarded && this.enableRewardBtn(), (t = null), this.resize();
}),
t
);
})((i = o(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(5), i(1), i(24), i(16), i(8)]),
void 0 ===
(s = function (t, e, c, d, f, p, i, g) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (p = a(p));
var n = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
o(e, t),
(e.prototype.init = function () {
var e = this,
t = this.scene.add.nineslice(0, -40, 512, 512, { key: c.Atlases.ui, frame: "menu_box instance 10000" }, c.Constants.pBgOffset, c.Constants.pBgsafeArea);
t.setOrigin(0.5, 0.5),
t.resize(1160, 480),
t.setInteractive(),
this.add(t),
(t = this.scene.add.nineslice(0, 0, 512, 512, { key: c.Atlases.ui, frame: "menu_box_inside instance 10000" }, 100, 25)).setOrigin(0.5, 0.5),
t.resize(1100, 280),
this.add(t),
(t = null);
var i = new Phaser.GameObjects.Graphics(this.scene, { x: -615, y: -330 });
this.add(i),
i.fillStyle(217552, 1),
i.beginPath(),
i.moveTo(0, 0),
i.lineTo(1215, 17),
i.lineTo(1215, 90),
i.lineTo(19, 146),
i.closePath(),
i.fillPath(),
(i = null),
this.add(new Phaser.GameObjects.Image(this.scene, -550, -260, c.Atlases.ui, "hud_act_icon instance 10000"));
var n = new d.BtnImgScale(this.scene, 540, -300, c.Atlases.ui, "btnX instance 10000");
(n.onUp = function () {
g.AdHandler.getInstance().showAd("close_act_select", function () {
e.scene.panelManager.hideCurrent();
});
}),
this.add(n),
(n = null);
var s = new f.JDTextTranslated(this.scene, -490, -260, c.Fonts.Main, "actSelect", 50);
s.setOrigin(0, 0.5), this.add(s);
for (
var r,
o = -480,
a = -58,
h = function (t) {
if (!1 === p.default.isCompletedAct(t, !1)) return "continue";
(r = new d.ButtonText(l.scene, o, a)).addImage(c.Atlases.ui, "trophieAct instance " + (1e4 + t)),
r.addTxtTranslated("act" + t, c.Fonts.Main, 24, "#ffffff", "center", 0, -5),
r.txt.setStroke("#001977", 6),
(r.onUp = function () {
return e.goToActSelect(t);
}),
l.add(r),
(o += 107),
t % 10 == 0 && ((o = -480), (a += 115));
},
l = this,
u = 1;
u <= c.Constants.totalActs;
u++
)
h(u);
s = r = null;
}),
(e.prototype.goToActSelect = function (t) {
this.scene.panelManager.hideAll(), this.scene.resumeWorld(), this.scene.portToActBlock(t);
}),
e
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
d =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
f =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(5), i(1), i(10), i(16), i(8), i(4), i(15)]),
void 0 ===
(s = function (t, e, o, a, h, l, i, u, c, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (l = f(l));
var s = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
d(e, t),
(e.prototype.init = function () {
var t = this;
(this.stars = new Array()), (this.checkMark = new Array());
var e = this.scene.add.nineslice(0, 0, 512, 512, { key: o.Atlases.ui, frame: "menu_box instance 10000" }, o.Constants.pBgOffset, o.Constants.pBgsafeArea);
e.setOrigin(0.5, 0.5),
e.resize(840, 860),
e.setInteractive(),
this.add(e),
(e = this.scene.add.nineslice(0, 10, 512, 512, { key: o.Atlases.ui, frame: "menu_box_inside instance 10000" }, 100, 30)).setOrigin(0.5, 0.5),
e.resize(764, 440),
this.add(e);
var i = new Phaser.GameObjects.Graphics(this.scene, { x: -452, y: -450 });
this.add(i),
i.fillStyle(217552, 1),
i.beginPath(),
i.moveTo(0, 0),
i.lineTo(890, 15),
i.lineTo(890, 90),
i.lineTo(13, 146),
i.closePath(),
i.fillPath(),
(i = null),
this.add(new Phaser.GameObjects.Image(this.scene, -380, -380, o.Atlases.ui, "hud_act_icon instance 10000"));
var n = new h.JDTextTranslated(this.scene, -320, -380, o.Fonts.Main, "lvlComplete", 50);
n.setOrigin(0, 0.5), this.add(n);
var s = new a.ButtonText(this.scene, -250, 310);
s.addImage(o.Atlases.ui, "btnYellow instance 10000", 0, 5),
s.addTxtTranslated("retry", o.Fonts.Main, c.Localization.getFontSize("btn_gameplay_retry"), "#001977"),
(s.onUp = function () {
u.AdHandler.getInstance().showAd("click_retry_level_complete", function () {
t.close(!0);
});
}),
this.add(s),
(s = new a.ButtonText(this.scene, 250, 310)).addImage(o.Atlases.ui, "btnGreen instance 10000", 0, 5),
s.addTxtTranslated("continue", o.Fonts.Main, c.Localization.getFontSize("btn_continue"), "#001977"),
(s.onUp = function () {
u.AdHandler.getInstance().showAd("click_continue_level_complete", function () {
t.close();
});
}),
this.add(s),
this.addTarget(-300, -130, l.default.getLevelTargetText(1, 0), 1),
this.addTarget(-300, 10, l.default.getLevelTargetText(2, this.scene.getTargetCoins())),
this.addTarget(-300, 150, l.default.getLevelTargetText(3, this.scene.getTargetDeath()));
var r = new Phaser.GameObjects.Image(this.scene, -210, -265, o.Atlases.ui, "hud_death_icon instance 10000");
this.add(r),
(this.txtCurrDeath = new h.JDText(this.scene, r.x + 60, r.y, o.Fonts.Main, "25", 50)),
this.txtCurrDeath.setOrigin(0, 0.5),
this.add(this.txtCurrDeath),
(r = new Phaser.GameObjects.Image(this.scene, 70, -265, o.Atlases.ui, "coin instance 10000")),
this.add(r),
(this.txtCurrCoins = new h.JDText(this.scene, r.x + 60, r.y, o.Fonts.Main, "207", 50)),
this.txtCurrCoins.setOrigin(0, 0.5),
this.add(this.txtCurrCoins),
(n = r = s = e = null);
}),
(e.prototype.addTarget = function (t, e, i, n) {
void 0 === n && (n = 0);
var s = new Phaser.GameObjects.Image(this.scene, t, e, o.Atlases.ui, "boxStar instance 1000" + n);
this.add(s), this.stars.push(s);
var r = new h.JDText(this.scene, s.x + 80, s.y + 5, o.Fonts.Main, i, 40, "#ffffff", "left");
r.setOrigin(0, 0.5),
r.setWordWrapWidth(450),
this.add(r),
(s = new Phaser.GameObjects.Image(this.scene, t + 600, e, o.Atlases.ui, "checkbox instance 10000")),
this.add(s),
this.checkMark.push(s),
(r = s = null);
}),
(e.prototype.show = function () {
t.prototype.show.call(this),
this.scene.pauseWorld(),
(this.txtCurrDeath.text = "" + this.scene.currentDeaths),
(this.txtCurrCoins.text = "" + this.scene.currentMoney),
this.checkMark[0].setFrame("checkbox instance 10001"),
1 === this.scene.isTargetCoinsComplete()
? (this.stars[1].setFrame("boxStar instance 10001"), this.checkMark[1].setFrame("checkbox instance 10001"))
: this.scene.currentMoney >= this.scene.getTargetCoins() &&
(this.scene.completeTargetCoins(), this.stars[1].setFrame("boxStar instance 10001"), this.checkMark[1].setFrame("checkbox instance 10001")),
1 === this.scene.isTargetDeathComplete()
? (this.stars[2].setFrame("boxStar instance 10001"), this.checkMark[2].setFrame("checkbox instance 10001"))
: (0 === this.scene.currentDeaths || this.scene.currentDeaths < this.scene.getTargetDeath()) &&
(this.scene.completeTargetDeath(), this.stars[2].setFrame("boxStar instance 10001"), this.checkMark[2].setFrame("checkbox instance 10001"));
}),
(e.prototype.clikcOnBlack = function () {
this.close();
}),
(e.prototype.close = function (t) {
void 0 === t && (t = !1),
this.scene.panelManager.hideCurrent(),
this.scene.resumeWorld(),
!0 === t
? (this.scene.player.respawn(),
(this.scene.firstSpawn = !0),
this.scene.resumeOnReset(),
this.scene.resetLevel(),
n.AnalyticsHandler.getInstance().sendCustomEvent("levelCompletion"),
n.AnalyticsHandler.getInstance().sendCustomEvent("levelStart"))
: this.scene.resumeOnFinish();
}),
(e.prototype.destroy = function () {
t.prototype.destroy.call(this), (this.stars = null), (this.checkMark = null), (this.txtCurrCoins = null), (this.txtCurrDeath = null);
}),
e
);
})((i = f(i)).default);
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
c =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
d =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(5), i(1), i(12), i(16), i(10), i(8)]),
void 0 ===
(s = function (t, e, o, a, h, i, n, l, u) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (n = d(n)), (l = d(l));
var s = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
c(e, t),
(e.prototype.init = function () {
var t = this,
e = this.scene.add.nineslice(0, 0, 512, 512, { key: o.Atlases.ui, frame: "menu_box instance 10000" }, o.Constants.pBgOffset, o.Constants.pBgsafeArea);
e.setOrigin(0.5, 0.5),
e.resize(695, 860),
e.setInteractive(),
this.add(e),
(e = this.scene.add.nineslice(0, 10, 512, 512, { key: o.Atlases.ui, frame: "menu_box_inside instance 10000" }, 100, 30)).setOrigin(0.5, 0.5),
e.resize(620, 440),
this.add(e);
var i = new Phaser.GameObjects.Graphics(this.scene, { x: -375, y: -450 });
this.add(i),
i.fillStyle(217552, 1),
i.beginPath(),
i.moveTo(0, 0),
i.lineTo(740, 18),
i.lineTo(740, 110),
i.lineTo(10, 146),
i.closePath(),
i.fillPath(),
(i = null),
this.add(new Phaser.GameObjects.Image(this.scene, -310, -380, o.Atlases.ui, "hud_act_icon instance 10000"));
var n = new h.JDTextTranslated(this.scene, -250, -380, o.Fonts.Main, "lvlObj", 50);
n.setOrigin(0, 0.5), this.add(n);
var s = new a.ButtonText(this.scene, 0, 310);
s.addImage(o.Atlases.ui, "btnGreen instance 10000", 0, 5),
s.addTxtTranslated("play", o.Fonts.Main, 40, "#001977"),
(s.onUp = function () {
return t.play();
}),
this.add(s),
this.addTarget(-230, -130, l.default.getLevelTargetText(1, 0), this.scene.isTargetLevelComplete()),
this.addTarget(-230, 10, l.default.getLevelTargetText(2, this.scene.getTargetCoins()), this.scene.isTargetCoinsComplete()),
this.addTarget(-230, 150, l.default.getLevelTargetText(3, this.scene.getTargetDeath()), this.scene.isTargetDeathComplete());
var r = new a.BtnImgScale(this.scene, 315, -420, o.Atlases.ui, "btnX instance 10000");
(r.onUp = function () {
u.AdHandler.getInstance().showAd("close_level_objectives", function () {
t.close();
});
}),
this.add(r),
(n = s = e = r = null),
!1 === o.Constants.IS_MOBILE && this.scene.input.keyboard.on("keydown", this.onKeyDown, this);
}),
(e.prototype.onKeyDown = function (t) {
if (!1 !== this.visible) {
var e = t.keyCode;
(e !== Phaser.Input.Keyboard.KeyCodes.A &&
e !== Phaser.Input.Keyboard.KeyCodes.LEFT &&
e !== Phaser.Input.Keyboard.KeyCodes.D &&
e !== Phaser.Input.Keyboard.KeyCodes.RIGHT &&
e !== Phaser.Input.Keyboard.KeyCodes.W &&
e !== Phaser.Input.Keyboard.KeyCodes.UP &&
e !== Phaser.Input.Keyboard.KeyCodes.S &&
e !== Phaser.Input.Keyboard.KeyCodes.DOWN &&
e !== Phaser.Input.Keyboard.KeyCodes.SPACE &&
e !== Phaser.Input.Keyboard.KeyCodes.ENTER) ||
this.play();
}
}),
(e.prototype.addTarget = function (t, e, i, n) {
var s = new Phaser.GameObjects.Image(this.scene, t, e, o.Atlases.ui, "boxStar instance 1000" + n);
this.add(s);
var r = new h.JDText(this.scene, s.x + 80, s.y + 5, o.Fonts.Main, i, 40, "#ffffff", "left");
r.setOrigin(0, 0.5), r.setWordWrapWidth(450), this.add(r), (r = s = null);
}),
(e.prototype.show = function () {
t.prototype.show.call(this), this.scene.pauseWorld();
}),
(e.prototype.play = function () {
this.scene.panelManager.hideCurrent(), this.scene.resumeWorld();
}),
(e.prototype.clikcOnBlack = function () {
this.close();
}),
(e.prototype.close = function () {
this.play(), this.scene.showSubSceneTransition(i.SubSceneList.Hub);
}),
(e.prototype.destroy = function () {
this.scene.input.keyboard.off("keydown", this.onKeyDown, this), t.prototype.destroy.call(this);
}),
e
);
})(n.default);
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
p =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
g =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(5), i(1), i(19), i(4), i(10), i(34), i(12), i(16), i(8), i(15)]),
void 0 ===
(s = function (t, e, r, o, a, h, l, u, c, i, n, d, s) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (h = g(h)), (u = g(u));
var f = (function (e) {
function t() {
return (null !== e && e.apply(this, arguments)) || this;
}
return (
p(t, e),
(t.prototype.init = function () {
var t = this,
e = this.scene.add.nineslice(0, 30, 512, 512, { key: r.Atlases.ui, frame: "menu_box instance 10000" }, r.Constants.pBgOffset, r.Constants.pBgsafeArea);
e.setOrigin(0.5, 0.5), e.resize(1200, 860), e.setInteractive(), this.add(e), (e = null);
var i = new Phaser.GameObjects.Graphics(this.scene, { x: -635, y: -450 });
this.add(i),
i.fillStyle(217552, 1),
i.beginPath(),
i.moveTo(0, 0),
i.lineTo(1250, 17),
i.lineTo(1250, 90),
i.lineTo(19, 146),
i.closePath(),
i.fillPath(),
(i = null),
this.add(new Phaser.GameObjects.Image(this.scene, -550, -380, r.Atlases.ui, "hud_dailytask_icon instance 10000"));
var n = new o.BtnImgScale(this.scene, 560, -420, r.Atlases.ui, "btnX instance 10000");
(n.onUp = function () {
d.AdHandler.getInstance().showAd("close_daily_tasks", function () {
t.scene.panelManager.hideCurrent();
});
}),
this.add(n),
(n = null),
(this.txtTitle = new a.JDTextTranslated(this.scene, -490, -380, r.Fonts.Main, "dailyTasks", 50)),
this.txtTitle.setOrigin(0, 0.5),
this.add(this.txtTitle),
(this.resetInLocale = l.Localization.getText("resetsIn")),
(this.txtResetIn = new a.JDText(this.scene, 0, -270, r.Fonts.Main, "", l.Localization.getFontSize("resets_in"))),
this.txtResetIn.setOrigin(0.5, 0.5),
this.add(this.txtResetIn);
var s = new Phaser.GameObjects.Image(this.scene, 350, this.txtResetIn.y, r.Atlases.ui, "coin instance 10000");
this.add(s),
(this.txtCoins = new a.JDText(this.scene, s.x + 50, this.txtResetIn.y, r.Fonts.Main, u.default.moneyDecorator(r.Constants.totalMoney), 50)),
this.txtCoins.setOrigin(0, 0.5),
this.add(this.txtCoins),
(s = null),
(this.dailyTasks = new Array(4)),
(this.dailyTasks[0] = new c.DailyTaskPanel(this, 0, -290, -70)),
(this.dailyTasks[1] = new c.DailyTaskPanel(this, 1, 290, -70)),
(this.dailyTasks[2] = new c.DailyTaskPanel(this, 2, -290, 250)),
(this.dailyTasks[3] = new c.DailyTaskPanel(this, 3, 290, 250)),
this.scene.events.on(h.default.EVENT_TIMER_RESET, this.reset, this),
this.scene.events.on(h.default.EVENT_TIMER_TICK, this.tickTimer, this),
this.scene.events.on(h.default.EVENT_REWARDED, this.rewardet, this),
h.default.startTimer(),
this.scene.events.on(l.Localization.EVENT_CHANGE_LANG, this.changeLang, this);
}),
(t.prototype.rewardet = function () {
this.txtCoins.text = u.default.moneyDecorator(r.Constants.totalMoney);
}),
(t.prototype.changeLang = function () {
(this.txtTitle.text = "dailyTasks"), (this.resetInLocale = l.Localization.getText("resetsIn")), (this.txtResetIn.text = this.resetInLocale + ": " + this.decoratedTime);
for (var t = 0; t < this.dailyTasks.length; t++) this.dailyTasks[t].changeLang();
}),
(t.prototype.reset = function () {
for (var t = 0; t < this.dailyTasks.length; t++) this.dailyTasks[t].reset();
}),
(t.prototype.tickTimer = function (t) {
(this.txtResetIn.text = this.resetInLocale + ": " + t), (this.decoratedTime = t);
}),
(t.prototype.show = function () {
e.prototype.show.call(this), s.AnalyticsHandler.getInstance().sendScreenView("show_daily_tasks"), this.scene.pauseWorld();
}),
(t.prototype.hide = function () {
e.prototype.hide.call(this),
this.scene.currSubScene === i.SubSceneList.Menu
? (s.AnalyticsHandler.getInstance().sendScreenView("exit_to_menu_from_daily"), this.scene.resumeMenu())
: (s.AnalyticsHandler.getInstance().sendScreenView("exit_to_hub_from_daily"), this.scene.resumeWorld());
}),
(t.prototype.resize = function () {
for (var t = 0; t < this.dailyTasks.length; t++) this.dailyTasks[t].resize();
}),
(t.prototype.destroy = function () {
this.scene.events.off(l.Localization.EVENT_CHANGE_LANG, this.changeLang, this),
this.scene.events.off(h.default.EVENT_TIMER_RESET, this.reset, this),
this.scene.events.off(h.default.EVENT_TIMER_TICK, this.tickTimer, this),
this.scene.events.off(h.default.EVENT_REWARDED, this.rewardet, this),
e.prototype.destroy.call(this);
for (var t = 0; t < this.dailyTasks.length; t++) this.dailyTasks[t].destroy();
(this.dailyTasks = null), (this.txtResetIn = null), (this.txtTitle = null), (this.txtCoins = null);
}),
t
);
})((n = g(n)).default);
e.default = f;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
d =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(5), i(1), i(12), i(16), i(8), i(4)]),
void 0 ===
(s = function (t, e, a, h, l, i, n, u, c) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var s = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
o(e, t),
(e.prototype.init = function () {
var t,
e = this,
i = this.scene.add.nineslice(0, 0, 512, 512, { key: a.Atlases.ui, frame: "menu_box instance 10000" }, a.Constants.pBgOffset, a.Constants.pBgsafeArea);
i.setOrigin(0.5, 0.5),
i.resize(840, 860),
i.setInteractive(),
this.add(i),
(i = this.scene.add.nineslice(0, -140, 512, 512, { key: a.Atlases.ui, frame: "menu_box_inside instance 10000" }, 100, 30)).setOrigin(0.5, 0.5),
i.resize(764, 230),
this.add(i),
(i = this.scene.add.nineslice(0, 120, 512, 512, { key: a.Atlases.ui, frame: "menu_box_inside instance 10000" }, 100, 30)).setOrigin(0.5, 0.5),
i.resize(764, 230),
this.add(i);
var n = new Phaser.GameObjects.Graphics(this.scene, { x: -452, y: -450 });
this.add(n),
n.fillStyle(217552, 1),
n.beginPath(),
n.moveTo(0, 0),
n.lineTo(890, 15),
n.lineTo(890, 110),
n.lineTo(13, 146),
n.closePath(),
n.fillPath(),
(n = null),
this.add(new Phaser.GameObjects.Image(this.scene, -380, -380, a.Atlases.ui, "hud_act_icon instance 10000"));
var s = new l.JDTextTranslated(this.scene, -320, -380, a.Fonts.Main, "bonusComplete", 50);
s.setOrigin(0, 0.5),
this.add(s),
(s = new l.JDTextTranslated(this.scene, 0, -190, a.Fonts.Main, "roomClear", 50)).setOrigin(0.5, 0.5),
this.add(s),
(this.txtRoomCompleted = new l.JDText(this.scene, 0, -90, a.Fonts.Main, "", 70)),
this.txtRoomCompleted.setOrigin(0.5, 0.5),
this.add(this.txtRoomCompleted),
(s = new l.JDTextTranslated(this.scene, 0, 70, a.Fonts.Main, "coinsCollect", 50)).setOrigin(0.5, 0.5),
this.add(s);
var r = new Phaser.GameObjects.Image(this.scene, -90, 170, a.Atlases.ui, "coin instance 10000");
this.add(r), (this.txtCurrCoins = new l.JDText(this.scene, r.x + 60, r.y, a.Fonts.Main, "207", 70)), this.txtCurrCoins.setOrigin(0, 0.5), this.add(this.txtCurrCoins);
var o = new h.ButtonText(this.scene, 250, 310);
o.addImage(a.Atlases.ui, "btnGreen instance 10000", 0, 5),
o.addTxtTranslated("continue", a.Fonts.Main, c.Localization.getFontSize("btn_continue"), "#001977"),
(o.onUp = function () {
return e.close();
}),
this.add(o),
(this.btnAD = new h.ButtonText(this.scene, -250, 310)),
this.btnAD.addImage(a.Atlases.ui, "btnYellow instance 10000", 13, 5),
this.btnAD.addImageNoEvents(a.Atlases.ui, "iconPlay2 instance 10000", -65, 0),
this.btnAD.addTxtTranslated("watchAD", a.Fonts.Main, c.Localization.getFontSize("btn_watch_add"), "#001977", "center", -30),
this.btnAD.txt.setOrigin(0, 0.5),
this.btnAD.txt.setWordWrapWidth(220),
(null === (t = window._azerionIntegration) || void 0 === t ? void 0 : t.af)
? (this.btnAD.visible = !1)
: ((this.btnAD.onUp = function () {
return u.AdHandler.getInstance().showRewarded(function (t) {
t ? e.completeAD() : (e.btnAD.txt.setText("unavailable"), (e.btnAD.txt.scale = 0.75), (e.btnAD.onUp = function () {}));
}, null);
}),
this.add(this.btnAD)),
(o = s = r = i = null);
}),
(e.prototype.completeAD = function () {
this.closeCurr(), this.scene.restartBonusStage();
}),
(e.prototype.show = function () {
t.prototype.show.call(this), (this.txtCurrCoins.text = "" + this.scene.currentMoney), (this.txtRoomCompleted.text = "" + this.scene.currentRooms);
}),
(e.prototype.clikcOnBlack = function () {
this.close();
}),
(e.prototype.close = function () {
this.closeCurr(), this.scene.showSubSceneTransition(!0 === this.scene.prevMenu ? i.SubSceneList.Menu : i.SubSceneList.Hub);
}),
(e.prototype.closeCurr = function () {
this.scene.panelManager.hideCurrent(), this.scene.resumeWorld();
}),
(e.prototype.destroy = function () {
t.prototype.destroy.call(this), (this.btnAD = null), (this.txtCurrCoins = null), (this.txtRoomCompleted = null);
}),
e
);
})((n = d(n)).default);
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
u =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
c =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(8), i(5), i(1), i(4), i(16), i(15)]),
void 0 ===
(s = function (t, e, r, o, a, h, l, i, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var s = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
u(e, t),
(e.prototype.init = function () {
var t = this,
e = this.scene.add.nineslice(0, -40, 512, 512, { key: r.Atlases.ui, frame: "menu_box instance 10000" }, r.Constants.pBgOffset, r.Constants.pBgsafeArea);
e.setOrigin(0.5, 0.5),
e.resize(860, 380),
e.setInteractive(),
this.add(e),
(e = this.scene.add.nineslice(0, 0, 512, 512, { key: r.Atlases.ui, frame: "menu_box_inside instance 10000" }, 100, 25)).setOrigin(0.5, 0.5),
e.resize(800, 180),
this.add(e),
(e = null);
var i = new Phaser.GameObjects.Graphics(this.scene, { x: -465, y: -280 });
this.add(i),
i.fillStyle(217552, 1),
i.beginPath(),
i.moveTo(0, 0),
i.lineTo(915, 17),
i.lineTo(915, 90),
i.lineTo(19, 146),
i.closePath(),
i.fillPath(),
(i = null),
this.add(new Phaser.GameObjects.Image(this.scene, -350, -210, r.Atlases.ui, "hud_death_icon instance 10000"));
var n = new h.JDTextTranslated(this.scene, -290, -210, r.Fonts.Main, "youOk", 50);
n.setOrigin(0, 0.5), this.add(n), (n = null);
var s = new a.ButtonText(this.scene, 250, 0);
s.addImage(r.Atlases.ui, "btnGreen instance 10000", 0, 5, 0.85),
s.addTxtTranslated("yes", r.Fonts.Main, 30, "#001977"),
(s.onUp = function () {
o.AdHandler.getInstance().showAd("click_yes_death_popup", function () {
t.close();
});
}),
this.add(s),
(s = new a.ButtonText(this.scene, -250, 0)).addImage(r.Atlases.ui, "btnRed instance 10000", 0, 5, 0.85),
s.addTxtTranslated("no", r.Fonts.Main, 30, "#001977"),
(s.onUp = function () {
o.AdHandler.getInstance().showAd("click_no_death_popup", function () {
t.close();
});
}),
this.add(s),
(s = new a.ButtonText(this.scene, 0, 0)).addImage(r.Atlases.ui, "btnYellow instance 10000", 0, 5, 0.85),
s.addTxtTranslated("retry", r.Fonts.Main, l.Localization.getFontSize("btn_gameplay_retry"), "#001977"),
(s.onUp = function () {
o.AdHandler.getInstance().showAd("click_retry_death_popup", function () {
t.resetlevel();
});
}),
this.add(s),
(s = null);
}),
(e.prototype.show = function () {
t.prototype.show.call(this), n.AnalyticsHandler.getInstance().sendScreenView("show_death_pop_up"), this.scene.pauseWorld();
}),
(e.prototype.close = function () {
n.AnalyticsHandler.getInstance().sendScreenView("gameplay"), this.scene.panelManager.hideCurrent(), this.scene.resumeWorld();
}),
(e.prototype.clikcOnBlack = function () {}),
(e.prototype.resetlevel = function () {
this.close(), this.scene.resetLevel();
}),
e
);
})((i = c(i)).default);
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
o =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(180), i(181)]),
void 0 ===
(s = function (t, e, s, r) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (s = o(s)), (r = o(r));
var i = (function () {
function t(t, e, i, n) {
(this.startWidth = i),
(this.startHeight = n),
(this.block = new s.default(t, t.levelLayer)),
(this.block.blockType = e),
t.blocks.push(this.block),
(this.block2 = new s.default(t, t.levelLayer)),
(this.block2.blockType = e),
t.blocks.push(this.block2),
(this.slopeL1 = new r.default(t, t.levelLayer, -1)),
(this.slopeL1.blockType = e),
t.slopes.push(this.slopeL1),
(this.slopeR1 = new r.default(t, t.levelLayer, 1)),
(this.slopeR1.blockType = e),
t.slopes.push(this.slopeR1);
}
return (
(t.prototype.spawn = function (t, e, i, n) {
(this.xPos = t), (this.yPos = e), (this.width = i), (this.height = n);
var s = i / this.startWidth,
r = n / this.startHeight;
this.block.spawn(t, e - 110 * r, 180 * s, 28 * r),
this.block2.spawn(t, e + 3 * r, 230 * s, 208 * r),
this.slopeL1.spawn(t - 102 * s, e - 111 * r, 26 * s, 26 * r),
this.slopeR1.spawn(t + 102 * s, e - 111 * r, 26 * s, 26 * r);
}),
(t.prototype.destroy = function () {
(this.block = null), (this.block2 = null), (this.slopeL1 = null), (this.slopeR1 = null);
}),
t
);
})();
e.default = i;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(2)]),
void 0 ===
(s = function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (n) {
function t(t, e) {
var i = n.call(this, t, e) || this;
return (i.alive = !1), (i.hangable = !0), (i.scalable = !0), i;
}
return (
o(t, n),
(t.prototype.spawn = function (t, e, i, n) {
this.init(t, e, i, n);
}),
(t.prototype.update = function () {
(this.xPos === this.prevX && this.yPos === this.prevY) || this.updatePosition();
}),
(t.prototype.updateGraphicPosition = function () {}),
(t.prototype.destroy = function () {
n.prototype.destroy.call(this);
}),
(t.prototype.reset = function () {}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(3)]),
void 0 ===
(s = function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (s) {
function t(t, e, i) {
var n = s.call(this, t) || this;
return (n.side = i), (n.alive = !1), n;
}
return (
o(t, s),
(t.prototype.spawn = function (t, e, i, n) {
(this.xPos = t), (this.yPos = e), (this.width = i), (this.height = n), (this.alive = !0);
var s = i / 2,
r = n / 2;
(this.topEdge = e - r),
(this.bottomEdge = e + r),
(this.leftEdge = t - s),
(this.rightEdge = t + s),
(this.wallPoly = new SAT.Box(new SAT.Vector(t, e), 10, n - 20).toPolygon()),
(this.bottomPoly = new SAT.Box(new SAT.Vector(t, e), i, 10).toPolygon()),
1 === this.side ? this.wallPoly.setOffset(new SAT.Vector(-i / 2, -n / 2 + 20)) : this.wallPoly.setOffset(new SAT.Vector(i / 2, -n / 2 + 20)),
this.bottomPoly.setOffset(new SAT.Vector(i / 2, n / 2));
}),
(t.prototype.destroy = function () {
s.prototype.destroy.call(this);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
});
(n = [i, e, i(0), i(5), i(4)]),
void 0 ===
(s = function (t, e, m, x, b) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function (y) {
function t(i, t, e, n) {
void 0 === n && (n = !0);
var s = y.call(this, i, t, e) || this;
(s.menuOpen = !1), (s.animatingMenu = !1), (s.selectedLanguage = b.Localization.getLang());
var r = 1;
!1 === n && (r = -1),
(s.foldMenu = new Phaser.GameObjects.Container(i)),
s.add(s.foldMenu),
(s.selectedLanguageBtn = new x.ButtonImage(i, 0, 0)),
s.selectedLanguageBtn.addImage(m.Atlases.localizationFlags, "flag_" + s.selectedLanguage + " instance 10000"),
(s.selectedLanguageBtn.onUp = function () {
return s.toggleMenu();
}),
s.add(s.selectedLanguageBtn),
s.scene.input.on(Phaser.Input.Events.POINTER_UP, s.hide, s);
var o = s.selectedLanguageBtn.image.width,
a = s.selectedLanguageBtn.image.height,
h = 0.9 * o,
l = 0.75 * a,
u = m.Constants.AVAILABLE_LANGUAGES.length - 1,
c = l * u + 15 * (u + 1);
(s.hideY = (a / 2 - 1) * r), (s.showY = (c + l / 2 + 15 - 5) * r);
var d = new Phaser.GameObjects.Graphics(i);
d.fillStyle(11984381, 0.7), 1 === r ? d.fillRoundedRect(-h / 2, 0, h, c + 5, 5) : d.fillRoundedRect(-h / 2, -(c + 5), h, c + 5, 5), s.foldMenu.add(d), (s.otherLanguages = []);
for (
var f = 0,
p = function (t) {
if (m.Constants.AVAILABLE_LANGUAGES[t] !== g.selectedLanguage) {
var e = new Phaser.GameObjects.Image(i, 0, (l / 2 + 15 + (l + 15) * f) * r, m.Atlases.localizationFlags, "flag_" + m.Constants.AVAILABLE_LANGUAGES[t] + " instance 10000");
(e.scale = 0.75),
e.setInteractive(),
(e.input.cursor = "pointer"),
e.on(
Phaser.Input.Events.POINTER_DOWN,
function () {
return s.onFlagClicked(e);
},
g
),
g.foldMenu.add(e),
g.otherLanguages.push(e),
(e.input.enabled = !1),
f++;
}
},
g = this,
v = 0;
v < m.Constants.AVAILABLE_LANGUAGES.length;
v++
)
p(v);
return (
(s.menuMask = new Phaser.GameObjects.Graphics(s.scene, { x: s.x, y: s.y })),
s.menuMask.fillRect(-o / 2, -s.showY, o, s.showY + s.hideY - 1),
s.setMask(s.menuMask.createGeometryMask()),
(s.foldMenu.y = -s.hideY),
(s.foldMenu.visible = !1),
s
);
}
return (
o(t, y),
(t.prototype.hide = function () {
this.foldMenu && !0 === this.menuOpen && this.toggleMenu();
}),
(t.prototype.toggleMenu = function () {
var t;
!0 !== this.animatingMenu &&
((this.foldMenu.visible = !0),
(t = (this.animatingMenu = !0) === this.menuOpen ? ((this.menuOpen = !1), this.setOtherFlagsClickable(!1), -this.hideY) : ((this.menuOpen = !0), -this.showY)),
this.scene.add.tween({ targets: this.foldMenu, y: t, duration: 300, ease: "Quadratic.Out", onComplete: this.onAnimationFinihed, onCompleteScope: this }));
}),
(t.prototype.onAnimationFinihed = function () {
!(this.animatingMenu = !1) === this.menuOpen ? this.setOtherFlagsClickable(!0) : (this.foldMenu.visible = !1);
}),
(t.prototype.onFlagClicked = function (t) {
var e = this.selectedLanguage;
(this.selectedLanguage = t.frame.name.slice(5, t.frame.name.indexOf(" "))),
this.selectedLanguageBtn.image.setFrame("flag_" + this.selectedLanguage + " instance 10000"),
b.Localization.setLng(this.selectedLanguage),
t.setFrame("flag_" + e + " instance 10000"),
this.toggleMenu(),
this.scene.events.emit(b.Localization.EVENT_CHANGE_LANG);
}),
(t.prototype.setOtherFlagsClickable = function (t) {
for (var e = 0; e < this.otherLanguages.length; e++) this.otherLanguages[e].input.enabled = t;
}),
(t.prototype.resize = function (t, e) {
(this.x = t),
(this.y = e),
(this.menuMask.scale = m.Constants.UI_SCALE),
(this.menuMask.x = (this.parentContainer.x + this.x + m.Constants.UI_SHIFT_X) * m.Constants.UI_SCALE),
(this.menuMask.y = (this.parentContainer.y + this.y + m.Constants.UI_SHIFT_Y) * m.Constants.UI_SCALE);
}),
(t.prototype.destroy = function () {
this.scene.input.off(Phaser.Input.Events.POINTER_UP, this.hide, this),
y.prototype.destroy.call(this),
(this.selectedLanguageBtn = null),
(this.foldMenu = null),
(this.otherLanguages = null),
this.menuMask.destroy(),
(this.menuMask = null);
}),
t
);
})(Phaser.GameObjects.Container);
e.default = i;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(27), i(26)]),
void 0 ===
(s = function (t, e, i, n, s) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var r = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
o(e, t),
(e.prototype.init = function () {
t.prototype.init.call(this),
(this.level = new n.PLevel(this.scene, this.scene.currentLevel.getName())),
this.add(this.level),
(this.time = new n.PTimeHub(this.scene)),
this.add(this.time),
(this.levelInfo = new n.PLevelInfo(this.scene)),
this.add(this.levelInfo),
this.levelInfo.hide();
}),
(e.prototype.updateDeaths = function (t) {
this.level.setDeath(t);
}),
(e.prototype.updateTime = function () {}),
(e.prototype.showInfoLevel = function (t, e) {
this.levelInfo.show(t, e);
}),
(e.prototype.hideInfoLevel = function () {
this.levelInfo.hide();
}),
(e.prototype.updateMoney = function (t) {
this.time.updateCoins();
}),
(e.prototype.updateProgress = function (t) {
this.time.setProgress(Math.floor(100 * t) + "%", t);
}),
(e.prototype.resize = function () {
t.prototype.resize.call(this),
(this.level.x = -i.Constants.UI_SHIFT_X),
(this.level.y = -i.Constants.UI_SHIFT_Y),
(this.time.x = i.Constants.GW + i.Constants.UI_SHIFT_X),
(this.time.y = -i.Constants.UI_SHIFT_Y),
this.time.resize(),
!1 === i.Constants.IS_MOBILE && (this.levelInfo.x = 143 - i.Constants.UI_SHIFT_X),
(this.levelInfo.y = i.Constants.GH - 70 + i.Constants.UI_SHIFT_Y);
}),
(e.prototype.destroy = function () {
t.prototype.destroy.call(this), (this.levelInfo = null), (this.level = null), (this.time = null);
}),
e
);
})((s = a(s)).default);
e.default = r;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
h =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
l =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(1), i(4), i(10)]),
void 0 ===
(s = function (t, e, s, r, o, a) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (a = l(a));
var i = (function (n) {
function t(t) {
var e = n.call(this, t, s.Constants.GHW) || this,
i = new Phaser.GameObjects.Image(e.scene, 0, -45, s.Atlases.ui, "menu_box instance 10000");
return (
(i.scaleX = 0.563),
(i.scaleY = 0.46),
e.add(i),
(i = null),
(e.txtTittle = new r.JDText(e.scene, 0, -126, s.Fonts.Main, "Act 1", 40, "#f8d53a")),
e.txtTittle.setOrigin(0.5, 0.5),
e.txtTittle.setMaxSize(270, !1, 70),
e.add(e.txtTittle),
(e.localizedYourTime = o.Localization.getText("yourTime")),
(e.txtMyTime = new r.JDText(e.scene, 0, -60, s.Fonts.Main, e.localizedYourTime, 33)),
e.txtMyTime.setOrigin(0.5, 0.5),
e.add(e.txtMyTime),
(e.star1 = new Phaser.GameObjects.Image(e.scene, -80, 13, s.Atlases.ui, "boxStar instance 10000")),
(e.star1.scale = 0.6),
e.add(e.star1),
(e.star2 = new Phaser.GameObjects.Image(e.scene, 0, 13, s.Atlases.ui, "boxStar instance 10000")),
(e.star2.scale = 0.6),
e.add(e.star2),
(e.star3 = new Phaser.GameObjects.Image(e.scene, 80, 13, s.Atlases.ui, "boxStar instance 10000")),
(e.star3.scale = 0.6),
e.add(e.star3),
e.hide(),
e
);
}
return (
h(t, n),
(t.prototype.show = function (t, e) {
(this.visible = !0), (this.txtTittle.text = t.getName()), !0 === e && (this.txtTittle.text += "\n" + t.getNameHard()), (this.txtMyTime.text = this.localizedYourTime);
var i = t.getTopTime(e);
(this.txtMyTime.text += -1 < i ? "\n" + a.default.timeDecoratorActBlock(i) : "\n" + a.default.timeDecoratorActBlock(0)),
this.star1.setFrame("boxStar instance 1000" + Number(t.isTargetLevelComplete(e))),
this.star2.setFrame("boxStar instance 1000" + t.isTargetCoinsComplete(e)),
this.star3.setFrame("boxStar instance 1000" + t.isTargetDeathComplete(e));
}),
(t.prototype.hide = function () {
this.visible = !1;
}),
(t.prototype.destroy = function () {
n.prototype.destroy.call(this), (this.txtTittle = null), (this.txtMyTime = null), (this.star1 = null), (this.star2 = null), (this.star3 = null);
}),
t
);
})(Phaser.GameObjects.Container);
e.default = i;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
l =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
});
(n = [i, e, i(0), i(5), i(1), i(21)]),
void 0 ===
(s = function (t, e, r, o, a, h) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function (s) {
function t(t) {
var e = s.call(this, t) || this,
i = new Phaser.GameObjects.Image(e.scene, 100, 0, r.Atlases.ui, "hud_side_top instance 10000");
i.setOrigin(1, 0),
e.add(i),
(e.txtTime = new a.JDText(e.scene, -120, 50, r.Fonts.Main, "00:00:00", 40)),
e.txtTime.setOrigin(0.5, 0.5),
e.add(e.txtTime),
(i = new Phaser.GameObjects.Image(e.scene, i.x - 533, 0, r.Atlases.ui, "hud_coins instance 10000")).setOrigin(0.5, 0),
e.add(i),
(i = new Phaser.GameObjects.Image(e.scene, i.x - 60, 50, r.Atlases.ui, "coin instance 10000")),
e.add(i),
(e.txtCoins = new a.JDText(e.scene, i.x + 45, 50, r.Fonts.Main, "0", 40)),
e.txtCoins.setOrigin(0, 0.5),
e.add(e.txtCoins);
var n = new o.ButtonText(e.scene, -140, 190);
return (
n.addImage(r.Atlases.ui, "btnYellow instance 10000", 0, 5),
n.addImageNoEvents(r.Atlases.ui, "iconPause instance 10000", -84),
n.addTxtTranslated("pause", r.Fonts.Main, 30, "#001977", "left", -47),
n.txt.setOrigin(0, 0.5),
(n.onUp = function () {
return t.panelManager.show(h.PanelList.PanelPause);
}),
e.add(n),
(i = n = null),
e
);
}
return (
l(t, s),
(t.prototype.getTime = function () {
return this.txtTime.text;
}),
(t.prototype.updateTime = function (t) {
this.txtTime.text = t;
}),
(t.prototype.setCoins = function (t) {
this.txtCoins.text = "" + t;
}),
(t.prototype.destroy = function () {
s.prototype.destroy.call(this), (this.txtTime = null), (this.txtCoins = null);
}),
t
);
})(Phaser.GameObjects.Container);
e.default = i;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
d =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
f =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(5), i(1), i(19), i(4), i(10), i(21), i(12)]),
void 0 ===
(s = function (t, e, r, o, a, h, l, i, u, c) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (h = f(h)), (i = f(i));
var n = (function (s) {
function t(t) {
var e = s.call(this, t) || this,
i = new Phaser.GameObjects.Image(e.scene, 77, 0, r.Atlases.ui, "hud_side_top instance 10000");
i.setOrigin(1, 0),
e.add(i),
(i = new Phaser.GameObjects.Image(e.scene, -460, 0, r.Atlases.ui, "hud_coins instance 10000")).setOrigin(0.5, 0),
e.add(i),
(i = new Phaser.GameObjects.Image(e.scene, i.x - 60, 50, r.Atlases.ui, "coin instance 10000")),
e.add(i),
(e.txtCoins = new a.JDText(e.scene, i.x + 45, 50, r.Fonts.Main, "10.000", 40)),
e.txtCoins.setOrigin(0, 0.5),
e.add(e.txtCoins),
(e.txtProgress = new a.JDTextTranslated(e.scene, -140, 35, r.Fonts.Main, "", 30)),
e.txtProgress.setOrigin(0.5, 0.5),
e.txtProgress.setText("complete", " 100%"),
e.add(e.txtProgress),
(i = new Phaser.GameObjects.Image(e.scene, -140, e.txtProgress.y + 35, r.Atlases.ui, "progressBg1 instance 10000")),
e.add(i),
(i = new Phaser.GameObjects.Image(e.scene, i.x, i.y, r.Atlases.ui, "progress1 instance 10000")),
e.add(i),
(e.progressMask = new Phaser.GameObjects.Graphics(e.scene)),
e.progressMask.fillStyle(16711680, 1),
e.progressMask.fillRect(0, -i.height / 2, i.width, i.height),
e.progressMask.setScrollFactor(0, 0),
(i.mask = e.progressMask.createGeometryMask());
var n = new o.ButtonText(e.scene, -140, 200);
return (
n.addImage(r.Atlases.ui, "btnYellow instance 10000", 0, 5),
n.addImageNoEvents(r.Atlases.ui, "iconSetting instance 10000", -84),
n.addTxtTranslated("settings", r.Fonts.Main, l.Localization.getFontSize("btn_settings"), "#001977", "left", -47),
n.txt.setOrigin(0, 0.5),
(n.onUp = function () {
return t.panelManager.show(u.PanelList.PanelOptionsHub);
}),
e.add(n),
(n = new o.ButtonText(e.scene, -140, 315)).addImage(r.Atlases.ui, "btnYellow instance 10000", 0, 5),
n.addTxtTranslated("dailyTasks", r.Fonts.Main, l.Localization.getFontSize("btn_daily_tasks"), "#001977", "center", 10),
n.txt.setMaxSize(250, !0),
(n.onUp = function () {
return t.panelManager.show(u.PanelList.PanelDailyTasks);
}),
e.add(n),
!0 === h.default.canShowTaskI() &&
((e.Idaily = new Phaser.GameObjects.Image(e.scene, 110, -40, r.Atlases.ui, "cauntion instance 10000")), n.add(e.Idaily), e.scene.events.on(h.default.EVENT_REWARDED, e.checkDailyI, e)),
(e.btnBonusStage = new o.ButtonText(e.scene, -140, 430)),
e.btnBonusStage.addImage(r.Atlases.ui, "btnYellow instance 10000", 0, 5),
e.btnBonusStage.addTxtTranslated("dailyStage", r.Fonts.Main, 30, "#001977", "center", 10),
e.btnBonusStage.txt.setMaxSize(250, !0, 80),
(e.btnBonusStage.onUp = function () {
return e.scene.showSubSceneTransition(c.SubSceneList.BonusStage);
}),
e.add(e.btnBonusStage),
(e.Ibonus = new Phaser.GameObjects.Image(e.scene, 110, -40, r.Atlases.ui, "cauntion instance 10000")),
e.btnBonusStage.add(e.Ibonus),
(e.btnBonusStage.visible = h.default.canShowBonusStageI()),
(n = i = null),
e.updateCoins(),
e.scene.events.on(h.default.EVENT_TIMER_RESET, e.timerReset, e),
e
);
}
return (
d(t, s),
(t.prototype.timerReset = function () {
this.btnBonusStage.visible = !0;
}),
(t.prototype.checkDailyI = function () {
(this.Idaily.visible = h.default.canShowTaskI()), this.updateCoins();
}),
(t.prototype.setProgress = function (t, e) {
this.txtProgress.setText("complete", " " + t), (this.progressMaskSc = e), (this.progressMask.scaleX = this.progressMaskSc * r.Constants.UI_SCALE);
}),
(t.prototype.updateCoins = function () {
this.txtCoins.text = i.default.moneyDecorator(r.Constants.totalMoney);
}),
(t.prototype.resize = function () {
var t = this.scene,
e = t.ZOOM_UI_SCALE;
(this.progressMask.scaleX = this.progressMaskSc * e), (this.progressMask.scaleY = e), (this.progressMask.x = t.guiX + (this.x - 257) * e), (this.progressMask.y = t.guiY + (this.y + 70) * e);
}),
(t.prototype.destroy = function () {
this.scene.events.off(h.default.EVENT_TIMER_RESET, this.timerReset, this),
this.scene.events.off(h.default.EVENT_REWARDED, this.checkDailyI, this),
s.prototype.destroy.call(this),
(this.scene = null),
(this.txtProgress = null),
this.progressMask.destroy(),
(this.progressMask = null),
(this.txtCoins = null),
(this.Idaily = null),
(this.btnBonusStage = null),
(this.Ibonus = null);
}),
t
);
})(Phaser.GameObjects.Container);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
h =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
});
(n = [i, e, i(0), i(1), i(4)]),
void 0 ===
(s = function (t, e, r, o, a) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function (s) {
function t(t, e) {
var i = s.call(this, t) || this,
n = new Phaser.GameObjects.Image(i.scene, -2, 0, r.Atlases.ui, "hud_side_top instance 10000");
return (
n.setOrigin(1, 0),
(n.scaleX = -1),
i.add(n),
(n = new Phaser.GameObjects.Image(i.scene, -2, 60, r.Atlases.ui, "hud_side_bottom instance 10000")).setOrigin(1, 0),
(n.scaleX = -1),
i.add(n),
(n = new Phaser.GameObjects.Image(i.scene, 50, 120, r.Atlases.ui, "hud_death_icon instance 10000")),
i.add(n),
(i.txtLevel = new o.JDText(i.scene, 170, 35, r.Fonts.Main, e, a.Localization.getFontSize("actname"))),
i.txtLevel.setOrigin(0.5, 0.5),
i.add(i.txtLevel),
(i.txtTotalDeath = new o.JDText(i.scene, 100, 120, r.Fonts.Main, "x0", 36)),
i.txtTotalDeath.setOrigin(0, 0.5),
i.add(i.txtTotalDeath),
i
);
}
return (
h(t, s),
(t.prototype.setDeath = function (t) {
this.txtTotalDeath.text = "x" + t;
}),
(t.prototype.destroy = function () {
s.prototype.destroy.call(this), (this.txtLevel = null), (this.txtTotalDeath = null);
}),
t
);
})(Phaser.GameObjects.Container);
e.default = i;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
a =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
});
(n = [i, e, i(0), i(1)]),
void 0 ===
(s = function (t, e, r, o) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function (s) {
function t(t, e) {
var i = s.call(this, t) || this,
n = new Phaser.GameObjects.Image(i.scene, -2, 0, r.Atlases.ui, "hud_side_top instance 10000");
return n.setOrigin(1, 0), (n.scaleX = -1), i.add(n), (i.txtLevel = new o.JDText(i.scene, 170, 50, r.Fonts.Main, e, 40)), i.txtLevel.setOrigin(0.5, 0.5), i.txtLevel.setWordWrapWidth(350), i.add(i.txtLevel), i;
}
return (
a(t, s),
(t.prototype.destroy = function () {
s.prototype.destroy.call(this), (this.txtLevel = null);
}),
t
);
})(Phaser.GameObjects.Container);
e.default = i;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
u =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
c =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(1), i(24), i(4), i(17), i(6), i(30)]),
void 0 ===
(s = function (t, e, s, r, o, a, i, h, l) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (o = c(o)), (i = c(i)), (h = c(h));
var n = (function (n) {
function t(t) {
var e = n.call(this, t, s.Constants.GHW - 50, 0) || this;
(e.durationWait = 240), (e.currTxtID = ""), (e.currTxtTitle = ""), (e.achiList = new Array());
var i = e.scene.add.nineslice(0, 0, 512, 512, { key: s.Atlases.ui, frame: "menu_box instance 10000" }, s.Constants.pBgOffset, s.Constants.pBgsafeArea);
return (
i.setOrigin(0.5, 0.5),
i.resize(900, 230),
(i.scale = 0.6),
e.add(i),
(e.txtNewAchive = new r.JDTextTranslated(e.scene, 47, -11, s.Fonts.Main, "newAchive", 30)),
e.txtNewAchive.setOrigin(0.5, 0.5),
e.txtNewAchive.setWordWrapWidth(420),
e.add(e.txtNewAchive),
(e.imgSkinBg = new Phaser.GameObjects.Image(e.scene, -210, -11, s.Atlases.skinsThumbnails, "box_round instance 10000")),
(e.imgSkinBg.scale = 0.7),
e.add(e.imgSkinBg),
(e.imgSkinBg.visible = !1),
(e.imgTrophy = new Phaser.GameObjects.Image(e.scene, -210, -11, s.Atlases.ui, "trophieAct instance 10000")),
e.add(e.imgTrophy),
(e.txtTrophy = new r.JDTextTranslated(e.scene, e.imgTrophy.x, e.imgTrophy.y - 5, s.Fonts.Main, "", a.Localization.getFontSize("achievement"))),
e.txtTrophy.setOrigin(0.5, 0.5),
e.txtTrophy.setStroke("#001977", 6),
e.add(e.txtTrophy),
e.hide(),
!0 === s.Constants.IS_MOBILE && (e.scale = 1.1),
e.scene.events.on(o.default.EVENT_ACHIEVEMENT_COMPLETE, e.showAchievement, e),
(i = null),
e.scene.events.on(a.Localization.EVENT_CHANGE_LANG, e.changeLang, e),
e
);
}
return (
u(t, n),
(t.prototype.changeLang = function () {
(this.txtNewAchive.text = this.currTxtTitle), (this.txtTrophy.text = this.currTxtID);
}),
(t.prototype.showAchievement = function (t, e) {
this.achiList.push({ type: t, id: e }), 1 === this.achiList.length && this.checkNext();
}),
(t.prototype.hide = function () {
(this.visible = !1), (this.show = l.Bool3.false);
}),
(t.prototype.update = function () {
if (!1 !== this.visible)
if (this.show === l.Bool3.true) {
var t = this.showY - this.y;
(this.y += t / 10), t < 1 && (this.show = l.Bool3.none);
} else
this.show === l.Bool3.none
? ((this.counterWait += 1), this.counterWait >= this.durationWait && (this.show = l.Bool3.false))
: this.show === l.Bool3.false && ((t = this.hideY - this.y), (this.y += t / 10), -1 < t && (this.achiList.shift(), 0 === this.achiList.length ? this.hide() : this.checkNext()));
}),
(t.prototype.checkNext = function () {
(this.counterWait = 0), (this.visible = !0), (this.show = l.Bool3.true);
var t = this.achiList[0];
"Act" === t.type
? (this.imgTrophy.setTexture(s.Atlases.ui, "trophie" + t.type + " instance " + (1e4 + t.id)),
(this.imgTrophy.scale = 1),
(this.txtTrophy.visible = !0),
(this.currTxtID = "act" + t.id),
(this.txtTrophy.text = this.currTxtID),
(this.imgSkinBg.visible = !1),
(this.currTxtTitle = "newAchive"))
: "ActHard" === t.type
? (this.imgTrophy.setTexture(s.Atlases.ui, "trophie" + t.type + " instance " + (1e4 + t.id)),
(this.imgTrophy.scale = 1),
(this.txtTrophy.visible = !1),
(this.imgSkinBg.visible = !1),
(this.currTxtTitle = "newAchive"))
: "Skin" === t.type &&
((this.txtTrophy.visible = !1),
(this.imgSkinBg.visible = !0),
this.imgTrophy.setTexture(s.Atlases.skinsThumbnails, i.default.getSkinFrameName(t.id)),
(this.imgTrophy.scale = 0.3),
(this.currTxtTitle = "newAchiveSkin")),
(this.txtNewAchive.text = this.currTxtTitle),
h.default.playSFX("achievementUnlocked");
}),
(t.prototype.resize = function () {
var t = 85 * this.scaleY;
(this.showY = -s.Constants.UI_SHIFT_Y + t), (this.hideY = -s.Constants.UI_SHIFT_Y - t), (this.y = this.hideY);
}),
t
);
})(Phaser.GameObjects.Container);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
a =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
});
(n = [i, e, i(0), i(1)]),
void 0 ===
(s = function (t, e, r, o) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function (s) {
function t(t) {
var e = s.call(this, t, r.Constants.GHW) || this,
i = new Phaser.GameObjects.Image(e.scene, 0, 0, r.Atlases.ui, "vexTntPanel instance 10000");
i.setOrigin(0.5, 0), e.add(i);
var n = new o.JDText(e.scene, 0, 35, r.Fonts.Main, "TNT", 50);
return (
n.setOrigin(0.5, 0.5),
e.add(n),
(e.txtTnt = new o.JDText(e.scene, 80, 100, r.Fonts.Main, "100%", 30)),
e.txtTnt.setOrigin(0.5, 0.5),
e.add(e.txtTnt),
(i = new Phaser.GameObjects.Image(e.scene, 37, 100, r.Atlases.ui, "tntBarBg instance 10000")).setOrigin(1, 0.5),
e.add(i),
(e.progressBar = new Phaser.GameObjects.Image(e.scene, 37, 100, r.Atlases.ui, "tntBarProgress instance 10000")),
e.progressBar.setOrigin(1, 0.5),
e.add(e.progressBar),
(e.sparkSprite = new Phaser.GameObjects.Image(t, e.progressBar.x - e.progressBar.displayWidth, e.progressBar.y, r.Atlases.ui, "spark instance 10000")),
e.add(e.sparkSprite),
(n = i = null),
e
);
}
return (
a(t, s),
(t.prototype.setTnt = function (t) {
this.txtTnt.setText(Math.floor(100 * t) + "%"),
(this.progressBar.scaleX = t),
(this.sparkSprite.x = this.progressBar.x - this.progressBar.displayWidth),
Math.random() < 0.2 && this.scene.createColorParticleUI(this.sparkSprite.x, this.sparkSprite.y, this, 5 * Math.random() - 2.5, 5 * Math.random() - 2.5, 16763904, 4, !1, !1, 20, !0);
}),
(t.prototype.destroy = function () {
s.prototype.destroy.call(this), (this.scene = null), (this.txtTnt = null), (this.sparkSprite = null), (this.progressBar = null);
}),
t
);
})(Phaser.GameObjects.Container);
e.default = i;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
l =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
u =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(10), i(21), i(27), i(26), i(15)]),
void 0 ===
(s = function (t, e, i, n, s, r, o, a) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (n = u(n));
var h = (function (e) {
function t() {
var t = (null !== e && e.apply(this, arguments)) || this;
return (t.levelName = ""), t;
}
return (
l(t, e),
(t.prototype.init = function () {
e.prototype.init.call(this);
var t = this.scene.currentLevel.getName();
!0 === this.scene.isCurrLevelHard && (t += " " + this.scene.currentLevel.getNameHard()),
(this.levelName = t),
(this.level = new r.PLevel(this.scene, t)),
this.add(this.level),
(this.time = new r.PTimeAct(this.scene)),
this.add(this.time);
}),
(t.prototype.enterLevel = function (t) {
this.resetLevel(),
!0 === t ? this.time.updateTime(n.default.timeDecorator(Date.now() - i.Constants.actStartTime)) : this.time.updateTime("00:00:00"),
this.updateDeaths(0),
a.AnalyticsHandler.getInstance().sendCustomEvent("levelStart"),
a.AnalyticsHandler.getInstance().sendScreenView("gameplay"),
a.AnalyticsHandler.getInstance().addProgressionEvent("Level:Start", this.levelName),
this.scene.panelManager.show(s.PanelList.PanelLevelObjectives);
}),
(t.prototype.exitLevel = function () {
a.AnalyticsHandler.getInstance().sendCustomEvent("levelCompletion"),
a.AnalyticsHandler.getInstance().addProgressionEvent("Level:Complete", this.levelName),
a.AnalyticsHandler.getInstance().sendScreenView("exit_to_hub_from_gameplay");
}),
(t.prototype.updateDeaths = function (t) {
this.level.setDeath(t);
}),
(t.prototype.updateTime = function () {
var t = Date.now() - i.Constants.actStartTime;
this.time.updateTime(n.default.timeDecorator(t));
}),
(t.prototype.updateMoney = function (t) {
this.time.setCoins(t);
}),
(t.prototype.getTime = function () {
return this.time.getTime();
}),
(t.prototype.resize = function () {
e.prototype.resize.call(this),
(this.level.x = -i.Constants.UI_SHIFT_X),
(this.level.y = -i.Constants.UI_SHIFT_Y),
(this.time.x = i.Constants.GW + i.Constants.UI_SHIFT_X),
(this.time.y = -i.Constants.UI_SHIFT_Y);
}),
(t.prototype.destroy = function () {
e.prototype.destroy.call(this), (this.level = null), (this.time = null);
}),
t
);
})((o = u(o)).default);
e.default = h;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
a =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
h =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(10), i(27), i(26)]),
void 0 ===
(s = function (t, e, i, n, s, r) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (n = h(n));
var o = (function (e) {
function t() {
return (null !== e && e.apply(this, arguments)) || this;
}
return (
a(t, e),
(t.prototype.init = function () {
e.prototype.init.call(this);
var t = this.scene.currentLevel.getName();
!0 === this.scene.isCurrLevelHard && (t += " " + this.scene.currentLevel.getNameHard()),
(this.level = new s.PLevelBonus(this.scene, t)),
this.add(this.level),
(this.time = new s.PTimeAct(this.scene)),
this.add(this.time);
}),
(t.prototype.enterLevel = function (t) {
this.resetLevel(), !0 === t ? this.time.updateTime(n.default.timeDecorator(Date.now() - i.Constants.actStartTime)) : this.time.updateTime("00:00:00"), this.updateDeaths(0);
}),
(t.prototype.updateTime = function () {
var t = Date.now() - i.Constants.actStartTime;
this.time.updateTime(n.default.timeDecorator(t));
}),
(t.prototype.updateMoney = function (t) {
this.time.setCoins(t);
}),
(t.prototype.getTime = function () {
return this.time.getTime();
}),
(t.prototype.resize = function () {
e.prototype.resize.call(this),
(this.level.x = -i.Constants.UI_SHIFT_X),
(this.level.y = -i.Constants.UI_SHIFT_Y),
(this.time.x = i.Constants.GW + i.Constants.UI_SHIFT_X),
(this.time.y = -i.Constants.UI_SHIFT_Y);
}),
(t.prototype.destroy = function () {
e.prototype.destroy.call(this), (this.level = null), (this.time = null);
}),
t
);
})((r = h(r)).default);
e.default = o;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
h =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
l =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(10), i(21), i(27), i(26)]),
void 0 ===
(s = function (t, e, i, n, s, r, o) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (n = l(n));
var a = (function (t) {
function e() {
return (null !== t && t.apply(this, arguments)) || this;
}
return (
h(e, t),
(e.prototype.init = function () {
t.prototype.init.call(this),
(this.level = new r.PLevel(this.scene, this.scene.currentLevel.getName())),
this.add(this.level),
(this.time = new r.PTimeAct(this.scene)),
this.add(this.time),
(this.tnt = new r.PTNT(this.scene)),
this.add(this.tnt);
}),
(e.prototype.enterLevel = function (t) {
this.resetLevel(),
!0 === t ? this.time.updateTime(n.default.timeDecorator(Date.now() - i.Constants.actStartTime)) : this.time.updateTime("00:00:00"),
this.updateDeaths(0),
this.scene.panelManager.show(s.PanelList.PanelLevelObjectives);
}),
(e.prototype.updateDeaths = function (t) {
this.level.setDeath(t);
}),
(e.prototype.updateTime = function () {
var t = Date.now() - i.Constants.actStartTime;
this.time.updateTime(n.default.timeDecorator(t));
}),
(e.prototype.updateMoney = function (t) {
this.time.setCoins(t);
}),
(e.prototype.getTime = function () {
return this.time.getTime();
}),
(e.prototype.updateProgressTnt = function (t) {
this.tnt.setTnt(t);
}),
(e.prototype.resize = function () {
t.prototype.resize.call(this),
(this.level.x = -i.Constants.UI_SHIFT_X),
(this.level.y = -i.Constants.UI_SHIFT_Y),
(this.time.x = i.Constants.GW + i.Constants.UI_SHIFT_X),
(this.time.y = -i.Constants.UI_SHIFT_Y),
(this.tnt.y = this.time.y);
}),
(e.prototype.destroy = function () {
t.prototype.destroy.call(this), (this.level = null), (this.time = null), (this.tnt = null);
}),
e
);
})((o = l(o)).default);
e.default = a;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(57), i(43)]),
void 0 ===
(s = function (t, e, i, n, s) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var r = (function (e) {
function t() {
return (null !== e && e.apply(this, arguments)) || this;
}
return (
o(t, e),
(t.prototype.init = function () {
e.prototype.init.call(this), (this.raritys = new Array(5));
var t = i.Constants.GHH + 30;
(this.raritys[0] = new n.SkinRarity(this, 0, i.Constants.GHW - 760, t, "btnYellow instance 10000", "#FFD800")),
(this.raritys[1] = new n.SkinRarity(this, 1, i.Constants.GHW - 380, t, "btnGreen instance 10000", "#0EE10B")),
(this.raritys[2] = new n.SkinRarity(this, 2, i.Constants.GHW, t, "btnBlue instance 10000", "#00F7F9")),
(this.raritys[3] = new n.SkinRarity(this, 3, i.Constants.GHW + 380, t, "btnPurple instance 10000", "#C566F7")),
(this.raritys[4] = new n.SkinRarity(this, 4, i.Constants.GHW + 760, t, "btnOrange instance 10000", "#F2BA00"));
}),
(t.prototype.resize = function () {
e.prototype.resize.call(this);
for (var t = 0; t < this.raritys.length; t++) this.raritys[t].resize();
}),
(t.prototype.destroy = function () {
for (var t = 0; t < this.raritys.length; t++) this.raritys[t].destroy();
(this.raritys = null), e.prototype.destroy.call(this);
}),
t
);
})((s = a(s)).default);
e.default = r;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(5), i(1), i(4), i(17), i(12), i(44)]),
void 0 ===
(s = function (t, e, f, p, g, v, y, m, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (y = a(y));
var n = (function (d) {
function t(t, e, i, n, s, r) {
var o = d.call(this, t, e) || this;
(o.spinFrame = s), (o.titleColor = r), o.create(i, n, n, 670, y.default.skinRareIDs[e], "skinRarity" + e, r);
var a = new p.ButtonText(o.subscene.scene, i, n + 230);
a.addImage(f.Atlases.ui, "btnYellow instance 10000", 0, 5),
a.addTxtTranslated("chooseSkin", f.Fonts.Main, v.Localization.getFontSize("btn_skin_chooseskin"), "#001977"),
(a.onUp = function () {
return o.subscene.scene.showSubScene(m.SubSceneList.SkinsSelect, { id: e, spinFrame: s, titleColor: r });
}),
o.subscene.add(a),
(a = null);
var h,
l = y.default.getRaritySkinsAmount(e);
if (((o.progressMaskSc = y.default.getSkinOpened(e) / l), 1 !== o.progressMaskSc)) {
(o.btnSpin = new p.ButtonText(o.subscene.scene, i, n + 420)),
o.btnSpin.addImage(f.Atlases.ui, s, 0, 5),
o.btnSpin.addTxtTranslated("spin", f.Fonts.Main, 30, "#001977", "right", -50),
o.btnSpin.txt.setMaxSize(120, !0),
o.subscene.add(o.btnSpin);
var u = o.btnSpin.txt.x + o.btnSpin.txt.width / 2;
!1 === y.default.hasSpinTokens(e)
? (!1 === y.default.enouthMoney(e) && ((o.btnSpin.alpha = 0.5), (o.btnSpin.image.input.enabled = !1)),
o.btnSpin.addImageNoEvents(f.Atlases.ui, "coinSmall instance 10000", 30),
o.btnSpin.addTxt("" + y.default.getPrice(e), f.Fonts.Main, 30, "#001977", "left", 75),
(o.btnSpin.onUp = function () {
return o.spin(!0);
}))
: (o.btnSpin.addImageNoEvents(f.Atlases.ui, "star instance 1000" + e, 0, -2),
o.btnSpin.addTxt("" + y.default.getSpinTokensAmount(e), f.Fonts.Main, 30, "#001977", "left", 75),
(o.btnSpin.onUp = function () {
return o.spin(!1);
})),
(o.btnSpin.image2.x = u + (o.btnSpin.txt.x - o.btnSpin.txt.width / 2 - u) / 2),
!0 === o.btnSpin.image.input.enabled && o.subscene.scene.add.tween({ targets: o.btnSpin, duration: 400, scale: 1.05, loop: -1, yoyo: !0 });
}
!0 === y.default.canShowIRarity(o.rarity) && ((h = new Phaser.GameObjects.Image(o.subscene.scene, i + 150, n - 375, f.Atlases.ui, "cauntion instance 10000")), o.subscene.add(h)),
((h = new Phaser.GameObjects.Image(o.subscene.scene, i, n + 160, f.Atlases.ui, "progressBg1 instance 10000")).scaleX = 1.1),
o.subscene.add(h),
((h = new Phaser.GameObjects.Image(o.subscene.scene, h.x, h.y, f.Atlases.ui, "progress1 instance 10000")).scaleX = 1.1),
o.subscene.add(h),
(o.progressMaskX = h.x - h.displayWidth / 2),
(o.progressMaskY = h.y),
(o.progressMask = new Phaser.GameObjects.Graphics(o.subscene.scene)),
o.progressMask.fillStyle(16711680, 1),
o.progressMask.fillRect(0, -h.displayHeight / 2, h.displayWidth, h.displayHeight),
o.progressMask.setScrollFactor(0, 0),
(h.mask = o.progressMask.createGeometryMask());
var c = new g.JDText(o.subscene.scene, h.x, h.y, f.Fonts.Main, y.default.getSkinOpened(e) + "/" + l, 20);
return c.setOrigin(0.5, 0.5), o.subscene.add(c), (c = h = null), o;
}
return (
o(t, d),
(t.prototype.spin = function (t) {
this.subscene.scene.showSubScene(m.SubSceneList.SkinsSelect, { id: this.rarity, spinFrame: this.spinFrame, tittleColor: this.titleColor, spin: t });
}),
(t.prototype.resize = function () {
d.prototype.resize.call(this),
this.btnSpin && (this.btnSpin.y = f.Constants.GH + f.Constants.UI_SHIFT_Y - 95),
(this.progressMask.scaleX = this.progressMaskSc * f.Constants.UI_SCALE),
(this.progressMask.scaleY = f.Constants.UI_SCALE),
(this.progressMask.x = (this.progressMaskX + f.Constants.UI_SHIFT_X) * f.Constants.UI_SCALE),
(this.progressMask.y = (this.progressMaskY + f.Constants.UI_SHIFT_Y) * f.Constants.UI_SCALE);
}),
(t.prototype.destroy = function () {
this.subscene.scene.tweens.killTweensOf(this.btnSpin), d.prototype.destroy.call(this), (this.btnSpin = null), this.progressMask.destroy(), (this.progressMask = null);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(5), i(1), i(17), i(44)]),
void 0 ===
(s = function (t, e, d, f, p, g, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (g = a(g));
var n = (function (c) {
function t(t, e, i, n, s, r, o) {
var a,
h = c.call(this, t, e) || this,
l = g.default.getRaritySkinsAmount(e);
if (((h.progressMaskSc = g.default.getSkinOpened(e) / l), 1 !== h.progressMaskSc)) {
h.create(n, s, s, 670, i, "skinRarity" + e, o),
(h.btnSpin = new f.ButtonText(h.subscene.scene, n, s + 230)),
h.btnSpin.addImage(d.Atlases.ui, r, 0, 5),
h.btnSpin.addTxtTranslated("spin", d.Fonts.Main, 30, "#001977", "right", -50),
h.btnSpin.txt.setMaxSize(120);
var u = h.btnSpin.txt.x + h.btnSpin.txt.width / 2;
!1 === g.default.hasSpinTokens(e)
? (!1 === g.default.enouthMoney(e) && h.enableBtnSpin(!1, 0.5),
h.btnSpin.addImageNoEvents(d.Atlases.ui, "coinSmall instance 10000", 30),
h.btnSpin.addTxt("" + g.default.getPrice(e), d.Fonts.Main, 30, "#001977", "left", 75),
(h.btnSpin.onUp = function () {
return h.spin(!0);
}),
(h.isSpinByMoney = !0))
: (h.btnSpin.addImageNoEvents(d.Atlases.ui, "star instance 1000" + e, 0, -2),
h.btnSpin.addTxt("" + g.default.getSpinTokensAmount(e), d.Fonts.Main, 30, "#001977", "left", 75),
(h.btnSpin.onUp = function () {
return h.spin(!1);
}),
(h.isSpinByMoney = !1)),
h.subscene.add(h.btnSpin),
(h.btnSpin.image2.x = u + (h.btnSpin.txt.x - h.btnSpin.txt.width / 2 - u) / 2);
} else h.create(n, s - 45, s, 550, i, "skinRarity" + e, o);
return (
((a = new Phaser.GameObjects.Image(h.subscene.scene, n, s + 160, d.Atlases.ui, "progressBg1 instance 10000")).scaleX = 1.1),
h.subscene.add(a),
((a = new Phaser.GameObjects.Image(h.subscene.scene, a.x, a.y, d.Atlases.ui, "progress1 instance 10000")).scaleX = 1.1),
h.subscene.add(a),
(h.progressMaskX = a.x - a.displayWidth / 2),
(h.progressMaskY = a.y),
(h.progressMask = new Phaser.GameObjects.Graphics(h.subscene.scene)),
h.progressMask.fillStyle(16711680, 1),
h.progressMask.fillRect(0, -a.displayHeight / 2, a.displayWidth, a.displayHeight),
h.progressMask.setScrollFactor(0, 0),
(a.mask = h.progressMask.createGeometryMask()),
(h.txtProgress = new p.JDText(h.subscene.scene, a.x, a.y, d.Fonts.Main, g.default.getSkinOpened(e) + "/" + l, 20)),
h.txtProgress.setOrigin(0.5, 0.5),
h.subscene.add(h.txtProgress),
(a = null),
h
);
}
return (
o(t, c),
(t.prototype.updateProgress = function () {
var t = g.default.getRaritySkinsAmount(this.rarity),
e = g.default.getSkinOpened(this.rarity);
(this.progressMaskSc = e / t), (this.txtProgress.text = e + "/" + t), (this.progressMask.scaleX = this.progressMaskSc * d.Constants.UI_SCALE);
}),
(t.prototype.checkSpinAgain = function () {
this.updateProgress(),
1 !== this.progressMaskSc &&
(!0 === this.isSpinByMoney
? d.Constants.totalMoney >= g.default.getPrice(this.rarity) &&
(this.enableBtnSpin(!0, 1), this.subscene.scene.add.tween({ targets: this.btnSpin, duration: 400, scale: 1.05, loop: -1, yoyo: !0 }))
: (this.enableBtnSpin(!0, 1), this.subscene.scene.add.tween({ targets: this.btnSpin, duration: 400, scale: 1.05, loop: -1, yoyo: !0 })));
}),
(t.prototype.spin = function (t) {
this.subscene.startChoosing(this.isSpinByMoney), this.updateSpinValues();
}),
(t.prototype.updateSpinValues = function () {
this.enableBtnSpin(!1, 0.5),
!1 === this.isSpinByMoney &&
(!1 === g.default.hasSpinTokens(this.rarity)
? ((this.isSpinByMoney = !0), this.btnSpin.image2.setFrame("coinSmall instance 10000"), (this.btnSpin.image2.y = 0), (this.btnSpin.txt.text = "" + g.default.getPrice(this.rarity)))
: (this.btnSpin.txt.text = "" + g.default.getSpinTokensAmount(this.rarity)));
}),
(t.prototype.select = function (t) {
this.imgSkin.setFrame(g.default.getSkinFrameName(t));
}),
(t.prototype.resize = function () {
c.prototype.resize.call(this),
(this.progressMask.scaleX = this.progressMaskSc * d.Constants.UI_SCALE),
(this.progressMask.scaleY = d.Constants.UI_SCALE),
(this.progressMask.x = (this.progressMaskX + d.Constants.UI_SHIFT_X) * d.Constants.UI_SCALE),
(this.progressMask.y = (this.progressMaskY + d.Constants.UI_SHIFT_Y) * d.Constants.UI_SCALE);
}),
(t.prototype.enableBtnSpin = function (t, e) {
this.btnSpin && (this.subscene.scene.tweens.killTweensOf(this.btnSpin), (this.btnSpin.alpha = e), (this.btnSpin.image.input.enabled = t), (this.btnSpin.scale = 1));
}),
(t.prototype.destroy = function () {
this.subscene.scene.tweens.killTweensOf(this.btnSpin), c.prototype.destroy.call(this), (this.btnSpin = null), this.progressMask.destroy(), (this.progressMask = null), (this.txtProgress = null);
}),
t
);
})((i = a(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(5), i(17), i(44)]),
void 0 ===
(s = function (t, e, h, l, i, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (i = a(i));
var s = (function (a) {
function t(t, e, i, n, s, r) {
var o = a.call(this, t, 0) || this;
return (
o.create(i, n, n, 670, h.Constants.currSkin, "preview", r),
(o.btnEquip = new l.ButtonText(o.subscene.scene, i, n + 230)),
o.btnEquip.addImage(h.Atlases.ui, s, 0, 5),
o.btnEquip.addTxtTranslated("equip", h.Fonts.Main, 30, "#001977"),
(o.btnEquip.onUp = function () {
return t.equip();
}),
o.subscene.add(o.btnEquip),
-1 === e && o.setActivityBtn(!1, 0.5),
o
);
}
return (
o(t, a),
(t.prototype.select = function (t) {
this.setActivityBtn(!0, 1), this.imgSkin.setFrame(i.default.getSkinFrameName(t));
}),
(t.prototype.setActivityBtn = function (t, e) {
(this.imgSkin.visible = t), (this.btnEquip.image.input.enabled = t), (this.btnEquip.alpha = e);
}),
(t.prototype.destroy = function () {
a.prototype.destroy.call(this), (this.btnEquip = null);
}),
t
);
})((n = a(n)).default);
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(17)]),
void 0 ===
(s = function (t, e, h, l) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (l = a(l));
var i = (function (a) {
function t(t, e, i, n, s, r) {
var o = a.call(this, t.scene, s, r) || this;
return (
(o.subscene = t),
(o.id = e),
(o.status = n),
(o.imgBg = new Phaser.GameObjects.Image(t.scene, 0, 0, h.Atlases.skinsThumbnails, "box_round instance 10000")),
o.add(o.imgBg),
(o.skinFrame = l.default.getSkinFrameName(i)),
0 === n
? ((o.imgSkin = new Phaser.GameObjects.Image(t.scene, 0, 0, h.Atlases.ui, "iconLock instance 10000")), (o.imgBg.alpha = o.imgSkin.alpha = 0.4))
: ((o.imgSkin = new Phaser.GameObjects.Image(t.scene, 0, 0, h.Atlases.skinsThumbnails, o.skinFrame)), (o.imgSkin.scale = 0.45), o.addInteraction()),
o.add(o.imgSkin),
1 === n && o.addImgCauntion(),
o
);
}
return (
o(t, a),
(t.prototype.addInteraction = function () {
this.imgBg.setInteractive(new Phaser.Geom.Circle(68, 68, 68), Phaser.Geom.Circle.Contains), (this.imgBg.input.cursor = "pointer"), this.imgBg.on(Phaser.Input.Events.POINTER_DOWN, this.onDown, this);
}),
(t.prototype.addImgCauntion = function () {
this.imgCaution || ((this.imgCaution = new Phaser.GameObjects.Image(this.subscene.scene, 60, -50, h.Atlases.ui, "cauntion instance 10000")), this.add(this.imgCaution));
}),
(t.prototype.onDown = function () {
this.subscene.select(this.id);
}),
(t.prototype.open = function () {
(this.status = 1),
(this.imgBg.alpha = this.imgSkin.alpha = 1),
this.imgSkin.setTexture(h.Atlases.skinsThumbnails, this.skinFrame),
(this.imgSkin.scale = 0.45),
this.addImgCauntion(),
this.addInteraction();
}),
(t.prototype.equiped = function () {
this.imgCaution && (this.imgCaution.visible = !1);
}),
(t.prototype.destroy = function () {
a.prototype.destroy.call(this), (this.subscene = null), (this.imgBg = null), (this.imgCaution = null), (this.imgSkin = null);
}),
t
);
})(Phaser.GameObjects.Container);
e.default = i;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
a =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(7)]),
void 0 ===
(s = function (t, e, n, s) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (e.Star = void 0), (s = a(s));
var i = (function () {
function t(t) {
this.stars = new Array(10);
for (var e = 0; e < this.stars.length; e++) this.stars[e] = new r(t);
}
return (
(t.prototype.show = function (t, e) {
for (var i = 0; i < this.stars.length; i++) this.stars[i].show(t, e, s.default.PI2 * Math.random());
}),
(t.prototype.update = function () {
for (var t = 0, e = this.stars; t < e.length; t++) e[t].update();
}),
(t.prototype.destroy = function () {
this.stars = null;
}),
t
);
})();
e.default = i;
var r = (function (i) {
function t(t) {
var e = i.call(this, t.scene, 0, 0, n.Atlases.ui, "star instance 10000") || this;
return (e.velA = 0.02), t.add(e), (e.visible = !1), e;
}
return (
o(t, i),
(t.prototype.show = function (t, e, i) {
(this.visible = !0), (this.alpha = 1);
var n = Math.cos(i),
s = Math.sin(i);
(this.x = t + 40 * n), (this.y = e + 40 * s), (this.velX = 5 * n), (this.velY = 5 * s), (this.velR = 0.2 * Math.random() - 0.1), (this.scale = 0.6 + 0.4 * Math.random());
}),
(t.prototype.update = function () {
!1 !== this.visible && ((this.x += this.velX), (this.y += this.velY), (this.rotation += this.velR), (this.alpha -= this.velA), this.alpha <= 0.3 && (this.visible = !1));
}),
t
);
})(Phaser.GameObjects.Image);
e.Star = r;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
h =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
l =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(7), i(24), i(17), i(6), i(57), i(12), i(43)]),
void 0 ===
(s = function (t, e, u, n, i, c, s, d, r, o) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (n = l(n)), (i = l(i)), (c = l(c)), (s = l(s));
var a = (function (l) {
function t() {
return (null !== l && l.apply(this, arguments)) || this;
}
return (
h(t, l),
(t.prototype.init = function (t) {
l.prototype.init.call(this), (this.currRarity = t.id), (this.currSelected = c.default.getSkinIndex(this.currRarity, u.Constants.currSkin));
var e = u.Constants.GHH + 150;
(this.panSpin = new d.SkinRaritySpin(this, this.currRarity, u.Constants.currSkin, u.Constants.GHW - 800, e, t.spinFrame, t.titleColor)),
(this.panEquip = new d.SkinRarityEquip(this, this.currSelected, u.Constants.GHW + 800, e, "btnGreen instance 10000", t.titleColor));
var i = this.scene.add.nineslice(u.Constants.GHW, u.Constants.GHH + 60, 512, 512, { key: u.Atlases.ui, frame: "menu_box instance 10000" }, u.Constants.pBgOffset, u.Constants.pBgsafeArea);
i.setOrigin(0.5, 0.5),
i.resize(1134, 850),
this.add(i),
(i = this.scene.add.nineslice(i.x, i.y - 30, 512, 512, { key: u.Atlases.ui, frame: "menu_box_inside instance 10000" }, 100, 25)).setOrigin(0.5, 0.5),
i.resize(1078, 742),
this.add(i),
(i = null),
(this.stars = new d.EffectStars(this)),
(this.imgSelected = new Phaser.GameObjects.Image(this.scene, 0, 0, u.Atlases.skinsThumbnails, "skinSelecte instance 10000")),
this.add(this.imgSelected),
(this.slots = new Array());
for (var n, s = u.Constants.GHW - 430, r = s, o = u.Constants.GHH - 220, a = 0; a < c.default.skinIDs[this.currRarity].length; a++) {
var h = c.default.getSlotStatus(this.currRarity, a);
(n = new d.SkinSlot(this, a, c.default.skinIDs[this.currRarity][a], h, r, o)), this.add(n), this.slots.push(n), (r += 170), (a + 1) % 6 == 0 && ((r = s), (o += 170));
}
(n = null),
-1 === this.currSelected ? (this.imgSelected.visible = !1) : this.select(this.currSelected, !1),
void 0 !== t.spin ? (this.startChoosing(t.spin), this.panSpin.updateSpinValues()) : this.panSpin.checkSpinAgain();
}),
(t.prototype.select = function (t, e) {
void 0 === e && (e = !0),
(this.currSelected = t),
this.scene.tweens.killTweensOf(this.imgSelected),
(this.imgSelected.visible = !0),
(this.imgSelected.scale = 1),
(this.imgSelected.x = this.slots[this.currSelected].x),
(this.imgSelected.y = this.slots[this.currSelected].y),
!0 === e && this.panEquip.select(c.default.skinIDs[this.currRarity][this.currSelected]);
}),
(t.prototype.equip = function () {
(u.Constants.currSkin = c.default.skinIDs[this.currRarity][this.currSelected]),
this.panSpin.select(u.Constants.currSkin),
this.scene.player.setSkin(u.Constants.currSkin),
this.slots[this.currSelected].equiped(),
c.default.setSkinStatus2(this.currRarity, this.currSelected);
}),
(t.prototype.back = function () {
this.scene.showSubScene(r.SubSceneList.SkinsRarity);
}),
(t.prototype.resize = function () {
l.prototype.resize.call(this), this.panSpin.resize();
}),
(t.prototype.update = function () {
l.prototype.update.call(this), this.stars.update();
}),
(t.prototype.destroy = function () {
this.panSpin.destroy(), this.panEquip.destroy(), (this.slots = null), (this.imgSelected = null), (this.openArray = null), this.stars.destroy(), (this.stars = null), l.prototype.destroy.call(this);
}),
(t.prototype.startChoosing = function (t) {
!0 === t ? this.addMoney(-c.default.getPrice(this.currRarity)) : c.default.addSpinToken(this.currRarity, -1), (this.openArray = new Array());
for (var e = 0; e < this.slots.length; e++) 0 === this.slots[e].status && this.openArray.push(e);
if (((this.currChoosingID = 0), 1 === this.openArray.length)) c.default.openSkin(this.currRarity, this.openArray[this.currChoosingID]), this.applyPrize();
else {
n.default.shuffle(this.openArray), (this.step = n.default.random(12, 15));
for (var i = 0; i < this.step - 1; i++) (this.currChoosingID += 1), this.currChoosingID === this.openArray.length && (this.currChoosingID = 0);
c.default.openSkin(this.currRarity, this.openArray[this.currChoosingID]),
(this.currChoosingID = 0),
this.setNextPrizeID(),
(this.scene.input.enabled = !1),
(this.scene.game.canvas.style.cursor = "default");
}
}),
(t.prototype.setNextPrizeID = function () {
var t = this.openArray[this.currChoosingID];
this.unselectItem(t),
(this.currChoosingID += 1),
this.currChoosingID === this.openArray.length && (this.currChoosingID = 0),
(t = this.openArray[this.currChoosingID]),
this.selectItem(t),
s.default.playSFX("slot_random");
}),
(t.prototype.applyPrize = function () {
this.scene.input.enabled = !0;
var t = this.openArray[this.currChoosingID];
this.select(t),
this.scene.add.tween({ targets: this.imgSelected, scale: 1.2, duration: 250, yoyo: !0, loop: 2 }),
this.scene.add.tween({ targets: this.slots[t], scale: 1.2, duration: 250, yoyo: !0, loop: 2 }),
s.default.playSFX("slot_unlock"),
this.slots[t].open(),
this.panSpin.checkSpinAgain(),
this.stars.show(this.imgSelected.x, this.imgSelected.y),
this.scene.events.emit(i.default.EVENT_ACHIEVEMENT_COMPLETE, "Skin", c.default.getSkinCell(this.currRarity, t));
}),
(t.prototype.unselectItem = function (t) {
1 !== this.slots[t].scaleX && this.scene.add.tween({ targets: this.slots[t], scale: 1, duration: 150 });
}),
(t.prototype.selectItem = function (t) {
(this.step -= 1),
1 !== this.step
? (this.select(t, !1),
this.scene.add.tween({ targets: this.imgSelected, scale: 1.2, duration: 150 }),
this.scene.add.tween({ targets: this.slots[t], scale: 1.2, duration: 150, onComplete: this.setNextPrizeID, onCompleteScope: this }))
: this.applyPrize();
}),
t
);
})((o = l(o)).default);
e.default = a;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n, s;
(n = [i, e, i(0)]),
void 0 ===
(s = function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function () {
function t() {}
return (
(t.create = function (t) {
this.createByNumbers(t, "dark", "darkOverlay", 0, 29),
this.createByNames(t, "fan", i.Atlases.gameplay, "wind-fan instance 1", 0, 5, "", 4),
this.createByNumbers(t, "finishPortalAnim", "finishPortal", 0, 59),
this.createByNames(t, "shurikanDispenserSpawn", i.Atlases.gameplay, "shurikanDispenser instance 1", 0, 24, "", 4),
this.createByNames(t, "portal_blueAnim", i.Atlases.gameplay, "portal_blueAnim instance 1", 0, 13, "", 4),
this.createByNames(t, "portal_blue_disabledAnim", i.Atlases.gameplay, "portal_blue_disabledAnim instance 1", 0, 13, "", 4),
this.createByNames(t, "bounceBlockArrow", i.Atlases.gameplay, "bounceBlockArrow instance 1", 0, 23, "", 4),
this.createByNames(t, "fallingBlockArrow", i.Atlases.gameplay, "fallingBlockArrow instance 1", 0, 23, "", 4),
this.createByNames(t, "speedBlockArrow", i.Atlases.gameplay, "speedBlockArrow instance 1", 0, 23, "", 4),
this.createByNames(t, "invisBlockDownArrow", i.Atlases.gameplay, "invisBlockDownArrow instance 1", 0, 23, "", 4),
this.createByNames(t, "invisBlockUpArrow", i.Atlases.gameplay, "invisBlockUpArrow instance 1", 0, 23, "", 4);
}),
(t.createByNames = function (t, e, i, n, s, r, o, a, h, l) {
void 0 === l && (l = 30), t.anims.create({ key: e, frames: t.anims.generateFrameNames(i, { prefix: n, start: s, end: r, suffix: o, zeroPad: a }), repeat: h, frameRate: l });
}),
(t.createByNumbers = function (t, e, i, n, s, r, o) {
void 0 === r && (r = 0), void 0 === o && (o = 30), t.anims.create({ key: e, frames: t.anims.generateFrameNumbers(i, { start: n, end: s }), repeat: r, frameRate: o });
}),
t
);
})();
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n, s;
(n = [i, e, i(0), i(34)]),
void 0 ===
(s = function (t, e, i, n) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var s = (function () {
function t(t, e) {
(this.keyLeft = "l"),
(this.keyRight = "r"),
(this.keyUp = "u"),
(this.keyDown = "d"),
(this.keyReset = "res"),
(this.isPressed = {}),
(this.isPressed[this.keyLeft] = { on: !1, prev: !1 }),
(this.isPressed[this.keyRight] = { on: !1, prev: !1 }),
(this.isPressed[this.keyDown] = { on: !1, prev: !1 }),
(this.isPressed[this.keyUp] = { on: !1, prev: !1 }),
(this.isPressed[this.keyReset] = { on: !1, prev: !1 }),
!0 === i.Constants.IS_MOBILE
? ((this.circleMovement = new n.ControllerStick(t, 0, 300, "btnNonePressed instance 10000", !0)),
e.add(this.circleMovement.sprite),
(this.buttonJump = new n.ControllerButton(t, 0, 300, "jumpButton instance 10000", !1)),
e.add(this.buttonJump.sprite),
(this.buttonCrouch = new n.ControllerButton(t, 0, 380, "crouchButton instance 10000", !1)),
e.add(this.buttonCrouch.sprite),
(this.buttonCrouch.onUp = function () {
return t.player.enterActBlock();
}))
: (t.input.keyboard.on("keydown", this.onKeyDown, this), t.input.keyboard.on("keyup", this.onKeyUp, this));
}
return (
(t.prototype.isDown = function () {
return this.isPressed[this.keyDown].on;
}),
(t.prototype.isDownPressed = function () {
return this.isPressed[this.keyDown].on && !this.isPressed[this.keyDown].prev;
}),
(t.prototype.isUp = function () {
return this.isPressed[this.keyUp].on;
}),
(t.prototype.isUpPressed = function () {
return this.isPressed[this.keyUp].on && !this.isPressed[this.keyUp].prev;
}),
(t.prototype.isLeft = function () {
return this.isPressed[this.keyLeft].on;
}),
(t.prototype.isLeftPressed = function () {
return this.isPressed[this.keyLeft].on && !this.isPressed[this.keyLeft].prev;
}),
(t.prototype.isRight = function () {
return this.isPressed[this.keyRight].on;
}),
(t.prototype.isRightPressed = function () {
return this.isPressed[this.keyRight].on && !this.isPressed[this.keyRight].prev;
}),
(t.prototype.isReset = function () {
return this.isPressed[this.keyReset].on;
}),
(t.prototype.isResetPressed = function () {
return this.isPressed[this.keyReset].on && !this.isPressed[this.keyReset].prev;
}),
(t.prototype.setPressed = function (t, e) {
this.isPressed[t].on = e;
}),
(t.prototype.checkPrev = function (t) {
this.isPressed[t].prev = this.isPressed[t].on;
}),
(t.prototype.onKeyDown = function (t) {
var e = t.keyCode;
e === Phaser.Input.Keyboard.KeyCodes.A || e === Phaser.Input.Keyboard.KeyCodes.LEFT
? this.setPressed(this.keyLeft, !0)
: e === Phaser.Input.Keyboard.KeyCodes.D || e === Phaser.Input.Keyboard.KeyCodes.RIGHT
? this.setPressed(this.keyRight, !0)
: e === Phaser.Input.Keyboard.KeyCodes.W || e === Phaser.Input.Keyboard.KeyCodes.UP
? this.setPressed(this.keyUp, !0)
: e === Phaser.Input.Keyboard.KeyCodes.S || e === Phaser.Input.Keyboard.KeyCodes.DOWN
? this.setPressed(this.keyDown, !0)
: e === Phaser.Input.Keyboard.KeyCodes.R && this.setPressed(this.keyReset, !0);
}),
(t.prototype.onKeyUp = function (t) {
var e = t.keyCode;
e === Phaser.Input.Keyboard.KeyCodes.A || e === Phaser.Input.Keyboard.KeyCodes.LEFT
? this.setPressed(this.keyLeft, !1)
: e === Phaser.Input.Keyboard.KeyCodes.D || e === Phaser.Input.Keyboard.KeyCodes.RIGHT
? this.setPressed(this.keyRight, !1)
: e === Phaser.Input.Keyboard.KeyCodes.W || e === Phaser.Input.Keyboard.KeyCodes.UP
? this.setPressed(this.keyUp, !1)
: e === Phaser.Input.Keyboard.KeyCodes.S || e === Phaser.Input.Keyboard.KeyCodes.DOWN
? this.setPressed(this.keyDown, !1)
: e === Phaser.Input.Keyboard.KeyCodes.R && this.setPressed(this.keyReset, !1);
}),
(t.prototype.show = function () {
!0 === i.Constants.IS_MOBILE && (this.circleMovement.show(), this.buttonJump.show(), this.buttonCrouch.show());
}),
(t.prototype.hide = function () {
!0 === i.Constants.IS_MOBILE && (this.circleMovement.hide(), this.buttonJump.hide(), this.buttonCrouch.hide());
}),
(t.prototype.isScreenButtonDown = function () {
if (!0 === i.Constants.IS_MOBILE) {
if (this.circleMovement.isDown) return !0;
if (this.buttonJump.isDown) return !0;
if (this.buttonCrouch.isDown) return !0;
}
return !1;
}),
(t.prototype.setAlpha = function (t) {
!0 === i.Constants.IS_MOBILE && ((this.circleMovement.sprite.alpha = t), (this.buttonJump.sprite.alpha = t), (this.buttonCrouch.sprite.alpha = t));
}),
(t.prototype.resetKeys = function () {
this.setPressed(this.keyLeft, !1), this.setPressed(this.keyRight, !1), this.setPressed(this.keyUp, !1), this.setPressed(this.keyDown, !1), this.setPressed(this.keyReset, !1);
}),
(t.prototype.update = function () {
this.checkPrev(this.keyLeft),
this.checkPrev(this.keyRight),
this.checkPrev(this.keyUp),
this.checkPrev(this.keyDown),
this.checkPrev(this.keyReset),
!0 === i.Constants.IS_MOBILE &&
(this.circleMovement.update(),
this.setPressed(this.keyLeft, this.circleMovement.leftIsDown()),
this.setPressed(this.keyRight, this.circleMovement.rightIsDown()),
this.setPressed(this.keyUp, this.buttonJump.buttonPressed()),
this.setPressed(this.keyDown, this.buttonCrouch.buttonPressed()));
}),
(t.prototype.resize = function () {
!0 === i.Constants.IS_MOBILE &&
((this.circleMovement.sprite.x = 270 - i.Constants.UI_SHIFT_X),
(this.circleMovement.sprite.y = 450 + i.Constants.UI_SHIFT_Y),
(this.buttonJump.sprite.x = i.Constants.GW - 200 + i.Constants.UI_SHIFT_X),
(this.buttonJump.sprite.y = this.circleMovement.sprite.y - 60),
(this.buttonCrouch.sprite.x = this.buttonJump.sprite.x - 280),
(this.buttonCrouch.sprite.y = this.buttonJump.sprite.y + 80));
}),
t
);
})();
e.default = s;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
o =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
});
(n = [i, e, i(0)]),
void 0 ===
(s = function (t, e, r) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function (s) {
function t(t) {
var e = s.call(this, t) || this;
e.breatheBlocks = [];
for (var i = 0; i < 10; i++) {
var n = new Phaser.GameObjects.Image(t, 10 * (i - 5), -65, r.Atlases.gameplay, "breatheBlock instance 10000");
e.add(n), e.breatheBlocks.push(n);
}
return e;
}
return (
o(t, s),
(t.prototype.show = function (t, e) {
(this.visible = !0), (this.rotation = -t), this.scaleX < 1 && ((this.scaleX -= 0.05), 1 < this.scaleX && (this.scaleX = 1), (this.scaleY = this.scaleX), (this.alpha = this.scaleX));
for (var i = Math.floor(e / 60), n = 0; n < 10; n++) {
var s = this.breatheBlocks[n];
i < n ? 0 < s.alpha && ((s.alpha -= 0.1), (s.y -= 0.5), s.alpha < 0 && ((s.alpha = 0), (s.y = -85))) : s.alpha < 1 && ((s.alpha += 0.1), (s.y = -65), 1 < s.alpha && ((s.alpha = 1), (s.y = -65)));
}
}),
(t.prototype.hide = function () {
this.visible = !1;
}),
t
);
})(Phaser.GameObjects.Container);
e.default = i;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r,
h =
(this && this.__extends) ||
((r = function (t, e) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (t, e) {
t.__proto__ = e;
}) ||
function (t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}),
function (t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
function i() {
this.constructor = t;
}
r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i()));
}),
o =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(40)]),
void 0 ===
(s = function (t, e, a, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var n = (function (o) {
function t(t, e, i, n, s) {
var r = o.call(this, t, n, s, !1, 150) || this;
return (r.sprite = new Phaser.GameObjects.Image(t, 0, 0, a.Atlases.gameplay, i)), e.add(r.sprite), r;
}
return (
h(t, o),
(t.prototype.spawn = function (t, e, i, n, s, r) {
o.prototype.spawnBase.call(this, t, e, i, n), (this.rotation = s), (this.rotSpeed = r), (this.sprite.x = t), (this.sprite.y = e), (this.sprite.rotation = s);
}),
(t.prototype.update = function () {
if (this.alive) {
if (this.fadeTime >= this.fadeAfter) {
if (((this.sprite.alpha -= 0.1), this.sprite.alpha <= 0)) return void this.destroy();
} else this.fadeTime++;
var t = this.xPos,
e = this.yPos;
o.prototype.update.call(this),
this.alive &&
((this.rotation += this.rotSpeed),
0 < this.rotSpeed ? (this.rotSpeed -= 0.5) : this.rotSpeed < 0 && (this.rotSpeed += 0.5),
Math.abs(this.rotSpeed) < 0.6 && (this.rotSpeed = 0),
(t === this.xPos && e === this.yPos) ||
((this.sprite.x = this.xPos),
(this.sprite.y = this.yPos),
(this.sprite.rotation = this.rotation),
(this.hitBox.pos.x = this.xPos - 0.5 * this.size),
(this.hitBox.pos.y = this.yPos - 0.5 * this.size),
(this.hitBoxPolygon = this.hitBox.toPolygon())));
}
}),
(t.prototype.destroy = function () {
this.alive && (this.sprite && (this.sprite.destroy(), (this.sprite = null)), o.prototype.destroy.call(this));
}),
t
);
})((i = o(i)).default);
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
r =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(206)]),
void 0 ===
(s = function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (i = r(i));
var n = (function () {
function t() {
this.levels = {};
}
return (
(t.prototype.loadLevels = function (t) {
for (var e = t.game.cache.json.get("levels"), i = 0, n = Object.keys(e); i < n.length; i++) {
var s = n[i];
"config" !== s ? this.loadLevel(s, e[s]) : t.loadBalance(e[s]);
}
}),
(t.prototype.loadLevelEdit = function () {
this.loadLevel("edit", { data: [], gt: -1, st: -1, bt: -1, hue: 100, tc: 0, td: 0, htc: 0, htd: 0 });
}),
(t.prototype.loadLevel = function (t, e) {
this.levels[t] = new i.default(t, e);
}),
(t.prototype.getLevel = function (t) {
var e = this.levels[t];
return e || "0" === t ? e : new i.default(t, { data: [], gt: -1, st: -1, bt: -1, hue: 100, tc: 0, td: 0, htc: 0, htd: 0 });
}),
t
);
})();
e.default = n;
}.apply(e, n)) || (t.exports = s);
},
function (t, e, i) {
var n,
s,
o =
(this && this.__importDefault) ||
function (t) {
return t && t.__esModule ? t : { default: t };
};
(n = [i, e, i(0), i(4), i(11)]),
void 0 ===
(s = function (t, e, i, n, s) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 }), (s = o(s));
var r = (function () {
function t(t, e) {
(this.id = t),
this.id === i.Constants.bonusStageID ? ((this.data = e), (this.hue = 0)) : ((this.data = e.data), (this.hue = e.hue), (this.dataHard = e.dataHard)),
(this.targetCoins = e.tc),
(this.targetDeath = e.td),
(this.targetHardCoins = e.htc),
(this.targetHardDeath = e.htd),
this.targetCoins || (this.targetCoins = this.targetDeath = this.targetHardCoins = this.targetHardDeath = 0),
this.id !== i.Constants.hubID && "edit" !== this.id && (this.saveData = s.default.getInstance().getLevel(this.id));
}
return (
(t.prototype.complete = function (t, e, i) {
this.saveData && (!1 === i ? (-1 === this.saveData.tt || t < this.saveData.tt) && (this.saveData.tt = t) : (-1 === this.saveData.tth || t < this.saveData.tth) && (this.saveData.tth = t), this.save());
}),
(t.prototype.collectSkinSpin = function (t) {
this.saveData;
}),
(t.prototype.isSkinSpinCollected = function (t) {
return this.saveData, !1;
}),
(t.prototype.save = function () {
s.default.getInstance().saveLevel(this.id, this.saveData);
}),
(t.prototype.getName = function () {
return "edit" === this.id ? this.id : n.Localization.getText("act" + this.id);
}),
(t.prototype.getNameHard = function () {
return n.Localization.getText("actHard");
}),
(t.prototype.act3Star = function () {
return -1 !== this.saveData.tt && 1 === this.saveData.cc && 1 === this.saveData.nd;
}),
(t.prototype.getTopTime = function (t) {
return !1 === t ? this.saveData.tt : this.saveData.tth;
}),
(t.prototype.isTargetLevelComplete = function (t) {
return !!this.saveData && (!1 === t ? -1 !== this.saveData.tt : -1 !== this.saveData.tth);
}),
(t.prototype.isTargetCoinsComplete = function (t) {
return this.saveData ? (!1 === t ? this.saveData.cc : this.saveData.cch) : 0;
}),
(t.prototype.isTargetDeathComplete = function (t) {
return this.saveData ? (!1 === t ? this.saveData.nd : this.saveData.ndh) : 0;
}),
(t.prototype.completeTargetCoins = function (t) {
this.saveData && (!1 === t ? (this.saveData.cc = 1) : (this.saveData.cch = 1));
}),
(t.prototype.completeTargetDeath = function (t) {
this.saveData && (!1 === t ? (this.saveData.nd = 1) : (this.saveData.ndh = 1));
}),
(t.prototype.getTargetCoins = function (t) {
return !1 === t ? this.targetCoins : this.targetHardCoins;
}),
(t.prototype.getTargetDeath = function (t) {
return !1 === t ? this.targetDeath : this.targetHardDeath;
}),
t
);
})();
e.default = r;
}.apply(e, n)) || (t.exports = s);
},
function (module, exports, __webpack_require__) {
var factory;
window,
(factory = function (__WEBPACK_EXTERNAL_MODULE_phaser__) {
return (function (i) {
var n = {};
function s(t) {
if (n[t]) return n[t].exports;
var e = (n[t] = { i: t, l: !1, exports: {} });
return i[t].call(e.exports, e, e.exports, s), (e.l = !0), e.exports;
}
return (
(s.m = i),
(s.c = n),
(s.d = function (t, e, i) {
s.o(t, e) || Object.defineProperty(t, e, { configurable: !1, enumerable: !0, get: i });
}),
(s.r = function (t) {
Object.defineProperty(t, "__esModule", { value: !0 });
}),
(s.n = function (t) {
var e =
t && t.__esModule
? function () {
return t.default;
}
: function () {
return t;
};
return s.d(e, "a", e), e;
}),
(s.o = function (t, e) {
return Object.prototype.hasOwnProperty.call(t, e);
}),
(s.p = ""),
s((s.s = 0))
);
})({
"./src/NineSlice.js": function (module, exports, __webpack_require__) {
"use strict";
eval(
"\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.EVENTS = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _phaser = __webpack_require__(/*! phaser */ \"phaser\");\n\nvar _phaser2 = _interopRequireDefault(_phaser);\n\nvar _murmur = __webpack_require__(/*! ./murmur */ \"./src/murmur.js\");\n\nvar _murmur2 = _interopRequireDefault(_murmur);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar defaultSliceConfig = function defaultSliceConfig(sc) {\n var defaulted = sc;\n if (typeof defaulted.sourceLayout.width === 'number') {\n // this means sourceLayout is a cornerconfig and should be used for all\n // four corners\n var _defaulted$sourceLayo = defaulted.sourceLayout,\n width = _defaulted$sourceLayo.width,\n height = _defaulted$sourceLayo.height;\n // we only need to assign one fallback will handle the rest\n\n defaulted.sourceLayout = { topLeft: { width: width, height: height } };\n }\n var sl = defaulted.sourceLayout;\n\n sl.topRight = sl.topRight || sl.topLeft;\n sl.bottomRight = sl.bottomRight || sl.topLeft;\n sl.bottomLeft = sl.bottomLeft || sl.topLeft;\n\n var maxTopHeight = Math.max(sl.topLeft.height, sl.topRight.height);\n var maxRightWidth = Math.max(sl.topRight.width, sl.bottomRight.width);\n var maxBottomHeight = Math.max(sl.bottomLeft.height, sl.bottomRight.height);\n var maxLeftWidth = Math.max(sl.topLeft.width, sl.bottomLeft.width);\n\n if (!defaulted.safeOffsets) {\n defaulted.safeOffsets = {\n top: maxTopHeight,\n right: maxRightWidth,\n bottom: maxBottomHeight,\n left: maxLeftWidth\n };\n }\n\n if (typeof defaulted.minSizing === 'undefined' || defaulted.minSizing !== false) {\n var offsets = defaulted.safeOffsets;\n defaulted.minSizing = {\n width: offsets ? Math.max(offsets.left + offsets.right, maxLeftWidth + maxRightWidth) : maxLeftWidth + maxRightWidth,\n height: offsets ? Math.max(offsets.top + offsets.bottom, maxTopHeight + maxBottomHeight) : maxTopHeight + maxBottomHeight\n };\n } else {\n defaulted.minSizing = false;\n }\n\n return defaulted;\n};\n\nvar shortSliceLayout = function shortSliceLayout(sc) {\n return {\n tl: { x: sc.topLeft.width, y: sc.topLeft.height },\n tr: { x: sc.topRight.width, y: sc.topRight.height },\n bl: { x: sc.bottomLeft.width, y: sc.bottomLeft.height },\n br: { x: sc.bottomRight.width, y: sc.bottomRight.height }\n };\n};\n\nvar BASE = '__BASE';\nvar MISSING = '__MISSING';\n\nvar EVENTS = exports.EVENTS = {\n UPDATE_SAFE_BOUNDS: 'updatesafebounds'\n};\n\nvar NineSlice = function (_Phaser$GameObjects$R) {\n _inherits(NineSlice, _Phaser$GameObjects$R);\n\n /**\r\n * @param {Phaser.Scene} scene the parent scene for this NineSlice\r\n * @param {SliceConfig} _sliceConfig specifies details of where we source\r\n * texture data and how the slice is laied out based on that texture.\r\n * @param {PositionConfig} positionConfig describes positioning of the slice\r\n * in the scene. If unspecified x and y position will be 0 and the width\r\n * and height will be computed from the source texture.\r\n */\n function NineSlice(scene, _sliceConfig) {\n var positionConfig = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n _classCallCheck(this, NineSlice);\n\n var _this = _possibleConstructorReturn(this, (NineSlice.__proto__ || Object.getPrototypeOf(NineSlice)).call(this, scene, 0, 0, 32, 32));\n\n _this.initFrames = _this.initFrames.bind(_this);\n _this.getUsableBounds = _this.getUsableBounds.bind(_this);\n _this.drawFrames = _this.drawFrames.bind(_this);\n _this.resize = _this.resize.bind(_this);\n _this.updateSafeBounds = _this.updateSafeBounds.bind(_this);\n _this.enableDebugDraw = _this.enableDebugDraw.bind(_this);\n\n _this.events = new _phaser2.default.Events.EventEmitter();\n _this.sliceConfig = defaultSliceConfig(_sliceConfig);\n _this._safeBounds = new _phaser2.default.Geom.Rectangle();\n\n var _this$sliceConfig = _this.sliceConfig,\n sourceKey = _this$sliceConfig.sourceKey,\n sourceFrame = _this$sliceConfig.sourceFrame;\n\n _this.sourceTex = scene.sys.textures.get(_this.sliceConfig.sourceKey);\n if (!sourceKey) {\n throw new Error('NineSlice requires a texture sourceKey to be specified.');\n }\n if (!_this.sourceTex || _this.sourceTex.key === MISSING) {\n throw new Error('Expected source image ' + sourceKey + ' not found.');\n }\n\n // use this to reduce chance we'll overwrite an existing frame\n _this._framePrefix = '' + (0, _murmur2.default)(JSON.stringify({ sourceKey: sourceKey, sourceFrame: sourceFrame }, 404));\n // this constructs a namespaced frame name\n _this.mkFrameName = function (n) {\n return _this._framePrefix + '-' + n;\n };\n // store constructed frames so we have direct access to the frame for the\n // specific corners\n _this._frameCache = {};\n\n var frameName = typeof sourceFrame === 'string' || typeof sourceFrame === 'number' ? sourceFrame : BASE;\n _this.sourceFrame = _this.sourceTex.get(frameName);\n\n // construct 9 frames for mortal men, doomed to die\n _this.initFrames();\n\n // We've gotten everything setup that is necessary for normal operation so\n // we can unblock a bunch of the NineSlice specific stuff.\n _this._initalized = true;\n\n var x = positionConfig.x,\n y = positionConfig.y,\n width = positionConfig.width,\n height = positionConfig.height;\n\n _this.setPosition(x || 0, y || 0);\n _this.resize(width || _this.sourceFrame.width, height || _this.sourceFrame.height);\n _this.updateSafeBounds();\n return _this;\n }\n\n _createClass(NineSlice, [{\n key: 'updateSafeBounds',\n value: function updateSafeBounds() {\n if (!this._initalized) {\n return;\n }\n\n var _sliceConfig$safeOffs = this.sliceConfig.safeOffsets,\n top = _sliceConfig$safeOffs.top,\n right = _sliceConfig$safeOffs.right,\n bottom = _sliceConfig$safeOffs.bottom,\n left = _sliceConfig$safeOffs.left;\n\n var newX = this.x + left;\n var newY = this.y + top;\n var newW = this.width - (left + right);\n var newH = this.height - (top + bottom);\n\n var _safeBounds = this._safeBounds,\n x = _safeBounds.x,\n y = _safeBounds.y,\n width = _safeBounds.width,\n height = _safeBounds.height;\n\n if (newX !== x || newY !== y || newW !== width || newH !== height) {\n this._safeBounds.setTo(this.x + left, this.y + top, this.width - (left + right), this.height - (top + bottom));\n this.events.emit(EVENTS.UPDATE_SAFE_BOUNDS, this, this._safeBounds);\n }\n if (this._g) {\n this._g.lineStyle(1, 0x00ff00);\n this._g.strokeRectShape(this._safeBounds);\n }\n }\n }, {\n key: 'resize',\n value: function resize(_w, _h) {\n var _ref = this.sliceConfig || {},\n minSizing = _ref.minSizing;\n\n var h = minSizing ? Math.max(minSizing.height, _h) : _h;\n var w = minSizing ? Math.max(minSizing.width, _w) : _w;\n\n if (h > _h || w > _w) {\n var err = 'Attempted to set NineSlice size less than minimum (' + _w + 'x' + _h + ').';\n // eslint-disable-next-line no-console\n console.error(err);\n }\n\n _get(NineSlice.prototype.__proto__ || Object.getPrototypeOf(NineSlice.prototype), 'resize', this).call(this, w, h);\n if (!this._initalized) {\n return;\n }\n\n if (this._g) {\n this._g.clear();\n }\n this.drawFrames();\n this.updateSafeBounds();\n }\n }, {\n key: 'initFrames',\n value: function initFrames() {\n var _this2 = this;\n\n var tex = this.sourceTex;\n var texW = this.sourceFrame.width;\n var texH = this.sourceFrame.height;\n var texX = this.sourceFrame.cutX;\n var texY = this.sourceFrame.cutY;\n\n var addFrame = function addFrame(_name, x, y, w, h) {\n var name = _this2.mkFrameName(_name);\n if (!tex.has(name)) {\n _this2._frameCache[_name] = tex.add(name, 0, texX + x, texY + y, w, h);\n } else {\n _this2._frameCache[_name] = tex.frames[name];\n }\n };\n\n var sl = shortSliceLayout(this.sliceConfig.sourceLayout);\n\n addFrame('topLeft', 0, 0, sl.tl.x, sl.tl.y);\n addFrame('topRight', texW - sl.tr.x, 0, sl.tr.x, sl.tr.y);\n addFrame('bottomRight', texW - sl.br.x, texH - sl.br.y, sl.br.x, sl.br.y);\n addFrame('bottomLeft', 0, texH - sl.bl.y, sl.bl.x, sl.bl.y);\n\n addFrame('topMiddle', sl.tl.x, 0, texW - (sl.tl.x + sl.tr.x), Math.max(sl.tl.y, sl.tr.y));\n\n addFrame('bottomMiddle', sl.bl.x, texH - Math.max(sl.bl.y, sl.br.y), texW - (sl.bl.x + sl.br.x), Math.max(sl.bl.y, sl.br.y));\n\n addFrame('leftMiddle', 0, sl.tl.y, Math.max(sl.tl.x, sl.bl.x), texH - (sl.tl.y + sl.bl.y));\n\n addFrame('rightMiddle', texW - Math.max(sl.tr.x, sl.br.x), sl.tr.y, Math.max(sl.tr.x, sl.br.x), texH - sl.tr.y - sl.br.y);\n\n var cLeftX = Math.min(sl.tl.x, sl.bl.x);\n var cTopY = Math.min(sl.tl.y, sl.tr.y);\n addFrame('center', cLeftX, cTopY, texW - cLeftX - Math.min(sl.tr.x, sl.br.x), texH - cTopY - Math.min(sl.br.y, sl.bl.y));\n }\n }, {\n key: 'getUsableBounds',\n value: function getUsableBounds() {\n if (!this._initalized) {\n return null;\n }\n\n return this._safeBounds;\n }\n }, {\n key: 'drawFrames',\n value: function drawFrames() {\n var _this3 = this;\n\n if (!this._initalized) {\n return;\n }\n\n if (this._g) {\n this._g.lineStyle(1, 0xff0000);\n }\n\n var sl = shortSliceLayout(this.sliceConfig.sourceLayout);\n var frame = this._frameCache;\n\n var draw = function draw(curFrame, x, y, wantWidth, wantHeight) {\n if (wantWidth > 0 && wantHeight > 0) {\n if (_this3._g) {\n _this3._g.strokeRect(_this3.x + x, _this3.y + y, wantWidth, wantHeight);\n }\n\n var frameImage = _this3.scene.make.image({\n key: _this3.sourceTex.key,\n frame: curFrame.name,\n x: 0,\n y: 0\n });\n\n var scaleX = wantWidth / curFrame.width;\n var scaleY = wantHeight / curFrame.height;\n\n frameImage.setOrigin(0).setScale(scaleX, scaleY);\n\n _this3.draw(frameImage, x, y);\n frameImage.destroy();\n }\n };\n\n var minLeftX = Math.min(sl.tl.x, sl.bl.x);\n var minRightX = Math.min(sl.tr.x, sl.br.x);\n\n var minTopY = Math.min(sl.tl.y, sl.tr.y);\n var minBottomY = Math.min(sl.bl.y, sl.br.y);\n\n this.clear();\n\n // first draw everything that needs to be scaled; this is more complicated\n // than necessary because some fool (me) thought it was a good idea to\n // support unique offsets per corner. 🤦\n draw(frame.center, minLeftX, minTopY, this.width - minLeftX - minRightX, this.height - minTopY - minBottomY);\n draw(frame.topMiddle, sl.tl.x, 0, this.width - sl.tl.x - sl.tr.x, frame.topMiddle.height);\n draw(frame.bottomMiddle, sl.bl.x, this.height - frame.bottomMiddle.height, this.width - sl.bl.x - sl.br.x, frame.bottomMiddle.height);\n draw(frame.leftMiddle, 0, sl.tl.y, frame.leftMiddle.width, this.height - sl.tl.y - sl.bl.y);\n draw(frame.rightMiddle, this.width - sl.tr.x, sl.tr.y, frame.rightMiddle.width, this.height - sl.tr.y - sl.br.y);\n\n // everything else since it's important that they draw atop other edges\n draw(frame.topLeft, 0, 0, sl.tl.x, sl.tl.y);\n draw(frame.topRight, this.width - sl.tr.x, 0, sl.tr.x, sl.tr.y);\n draw(frame.bottomRight, this.width - sl.br.x, this.height - sl.br.y, sl.br.x, sl.br.y);\n draw(frame.bottomLeft, 0, this.height - sl.bl.y, sl.bl.x, sl.bl.y);\n }\n }, {\n key: 'enableDebugDraw',\n value: function enableDebugDraw() {\n var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\n if (this._g) {\n this._g.clear();\n }\n\n if (enabled) {\n this._g = this.scene.add.graphics(this.x, this.y);\n } else {\n this._g = null;\n }\n this.drawFrames();\n this.updateSafeBounds();\n }\n }, {\n key: 'y',\n get: function get() {\n return this._y;\n },\n set: function set(y) {\n if (this._y !== y) {\n if (this._g) {\n this._g.clear();\n this.drawFrames();\n }\n this._y = y;\n this.updateSafeBounds();\n }\n }\n }, {\n key: 'x',\n get: function get() {\n return this._x;\n },\n set: function set(x) {\n if (this._x !== x) {\n if (this._g) {\n this._g.clear();\n this.drawFrames();\n }\n this._x = x;\n this.updateSafeBounds();\n }\n }\n }]);\n\n return NineSlice;\n}(_phaser2.default.GameObjects.RenderTexture);\n\nexports.default = NineSlice;\n\n//# sourceURL=webpack://NineSlice/./src/NineSlice.js?"
);
},
"./src/Plugin.js": function (module, exports, __webpack_require__) {
"use strict";
eval(
'\n\nObject.defineProperty(exports, "__esModule", {\n value: true\n});\n\nvar _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _phaser = __webpack_require__(/*! phaser */ "phaser");\n\nvar _phaser2 = _interopRequireDefault(_phaser);\n\nvar _NineSlice = __webpack_require__(/*! ./NineSlice */ "./src/NineSlice.js");\n\nvar _NineSlice2 = _interopRequireDefault(_NineSlice);\n\nvar _processOffsetsArray5 = __webpack_require__(/*! ./processOffsetsArray */ "./src/processOffsetsArray.js");\n\nvar _processOffsetsArray6 = _interopRequireDefault(_processOffsetsArray5);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Plugin = function (_Phaser$Plugins$BaseP) {\n _inherits(Plugin, _Phaser$Plugins$BaseP);\n\n function Plugin(mgr) {\n _classCallCheck(this, Plugin);\n\n var _this = _possibleConstructorReturn(this, (Plugin.__proto__ || Object.getPrototypeOf(Plugin)).call(this, mgr));\n\n mgr.registerGameObject(\'nineslice\', _this.addNineSlice, _this.makeNineSlice);\n return _this;\n }\n\n _createClass(Plugin, [{\n key: \'addNineSlice\',\n value: function addNineSlice() {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var slice = mkNineSlice(this.scene, args);\n this.displayList.add(slice);\n return slice;\n }\n }, {\n key: \'makeNineSlice\',\n value: function makeNineSlice() {\n for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return mkNineSlice(this.scene, args);\n }\n }]);\n\n return Plugin;\n}(_phaser2.default.Plugins.BasePlugin);\n\nexports.default = Plugin;\n\n\nvar mkNineSlice = function mkNineSlice(scene, args) {\n if (args.length === 2) {\n return new _NineSlice2.default(scene, args[0], args[1]);\n }\n\n if (args.length < 6) {\n throw new Error(\'Expected at least 6 arguments to NineSlice creator, received \' + args.length + \'.\');\n }\n if (args.length > 7) {\n // eslint-disable-next-line no-console\n console.error(\'Expected less than 7 arguments for NineSlice creation, received \' + args.length + \'.\');\n }\n\n var _args = _slicedToArray(args, 6),\n x = _args[0],\n y = _args[1],\n width = _args[2],\n height = _args[3],\n keyCfg = _args[4],\n offsetCfg = _args[5];\n\n var sliceConfig = {};\n var placement = { x: x, y: y, width: width, height: height\n\n // extract the key and (optional) frame for the texture source\n };if (typeof keyCfg === \'string\') {\n sliceConfig.sourceKey = keyCfg;\n } else {\n var key = keyCfg.key,\n frame = keyCfg.frame;\n\n sliceConfig.sourceKey = key;\n if (typeof frame === \'string\' || typeof frame === \'number\') {\n sliceConfig.sourceFrame = keyCfg.frame;\n }\n }\n\n // extract the layout config\n if (typeof offsetCfg === \'number\') {\n // it\'s a uniform offset for all corners\n sliceConfig.sourceLayout = { width: offsetCfg, height: offsetCfg };\n } else if (Array.isArray(offsetCfg)) {\n var _processOffsetsArray = (0, _processOffsetsArray6.default)(offsetCfg),\n _processOffsetsArray2 = _slicedToArray(_processOffsetsArray, 4),\n top = _processOffsetsArray2[0],\n right = _processOffsetsArray2[1],\n bottom = _processOffsetsArray2[2],\n left = _processOffsetsArray2[3];\n\n sliceConfig.sourceLayout = {\n topLeft: { width: left, height: top },\n topRight: { width: right, height: top },\n bottomRight: { width: right, height: bottom },\n bottomLeft: { width: left, height: bottom }\n };\n } else {\n // assume that we\'re dealing with { width, height }\n sliceConfig.sourceLayout = offsetCfg;\n }\n\n if (args.length > 6) {\n if (typeof args[6] === \'number\') {\n var n = args[6];\n sliceConfig.safeOffsets = { top: n, right: n, bottom: n, left: n };\n } else if (Array.isArray(args[6])) {\n var _processOffsetsArray3 = (0, _processOffsetsArray6.default)(args[6]),\n _processOffsetsArray4 = _slicedToArray(_processOffsetsArray3, 4),\n _top = _processOffsetsArray4[0],\n _right = _processOffsetsArray4[1],\n _bottom = _processOffsetsArray4[2],\n _left = _processOffsetsArray4[3];\n\n sliceConfig.safeOffsets = { top: _top, right: _right, bottom: _bottom, left: _left };\n } else {\n throw new Error(\'Expected argument number or array for argument 7, got \' + _typeof(args[6]) + \'.\');\n }\n }\n\n return new _NineSlice2.default(scene, sliceConfig, placement);\n};\n\nvar DefaultCfg = {\n key: \'NineSlice\',\n plugin: Plugin,\n start: true\n};\n\nPlugin.DefaultCfg = DefaultCfg;\n\n//# sourceURL=webpack://NineSlice/./src/Plugin.js?'
);
},
"./src/index.js": function (module, exports, __webpack_require__) {
"use strict";
eval(
"\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _NineSlice = __webpack_require__(/*! ./NineSlice */ \"./src/NineSlice.js\");\n\nObject.defineProperty(exports, 'NineSlice', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_NineSlice).default;\n }\n});\nObject.defineProperty(exports, 'EVENTS', {\n enumerable: true,\n get: function get() {\n return _NineSlice.EVENTS;\n }\n});\n\nvar _Plugin = __webpack_require__(/*! ./Plugin */ \"./src/Plugin.js\");\n\nObject.defineProperty(exports, 'Plugin', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Plugin).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n//# sourceURL=webpack://NineSlice/./src/index.js?"
);
},
"./src/murmur.js": function (module, exports, __webpack_require__) {
"use strict";
eval(
'\n\nObject.defineProperty(exports, "__esModule", {\n value: true\n});\n/**\r\n * JS Implementation of MurmurHash3 (r136) (as of May 20, 2011)\r\n *\r\n * @author Gary Court\r\n * @see http://github.com/garycourt/murmurhash-js\r\n * @author Austin Appleby\r\n * @see http://sites.google.com/site/murmurhash/\r\n *\r\n * @param {string} key ASCII only\r\n * @param {number} seed Positive integer only\r\n * @return {number} 32-bit positive integer hash\r\n */\n\nvar murmurhash3_32_gc = function murmurhash3_32_gc(key, seed) {\n var remainder, bytes, h1, h1b, c1, c2, k1, i;\n\n remainder = key.length & 3; // key.length % 4\n bytes = key.length - remainder;\n h1 = seed;\n c1 = 0xcc9e2d51;\n c2 = 0x1b873593;\n i = 0;\n\n while (i < bytes) {\n k1 = key.charCodeAt(i) & 0xff | (key.charCodeAt(++i) & 0xff) << 8 | (key.charCodeAt(++i) & 0xff) << 16 | (key.charCodeAt(++i) & 0xff) << 24;\n ++i;\n\n k1 = (k1 & 0xffff) * c1 + (((k1 >>> 16) * c1 & 0xffff) << 16) & 0xffffffff;\n k1 = k1 << 15 | k1 >>> 17;\n k1 = (k1 & 0xffff) * c2 + (((k1 >>> 16) * c2 & 0xffff) << 16) & 0xffffffff;\n\n h1 ^= k1;\n h1 = h1 << 13 | h1 >>> 19;\n h1b = (h1 & 0xffff) * 5 + (((h1 >>> 16) * 5 & 0xffff) << 16) & 0xffffffff;\n h1 = (h1b & 0xffff) + 0x6b64 + (((h1b >>> 16) + 0xe654 & 0xffff) << 16);\n }\n\n k1 = 0;\n\n /* eslint-disable no-fallthrough */\n switch (remainder) {\n case 3:\n k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16;\n case 2:\n k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8;\n case 1:\n k1 ^= key.charCodeAt(i) & 0xff;\n k1 = (k1 & 0xffff) * c1 + (((k1 >>> 16) * c1 & 0xffff) << 16) & 0xffffffff;\n k1 = k1 << 15 | k1 >>> 17;\n k1 = (k1 & 0xffff) * c2 + (((k1 >>> 16) * c2 & 0xffff) << 16) & 0xffffffff;\n h1 ^= k1;\n }\n /* eslint-enable no-fallthrough */\n\n h1 ^= key.length;\n\n h1 ^= h1 >>> 16;\n h1 = (h1 & 0xffff) * 0x85ebca6b + (((h1 >>> 16) * 0x85ebca6b & 0xffff) << 16) & 0xffffffff;\n h1 ^= h1 >>> 13;\n h1 = (h1 & 0xffff) * 0xc2b2ae35 + (((h1 >>> 16) * 0xc2b2ae35 & 0xffff) << 16) & 0xffffffff;\n h1 ^= h1 >>> 16;\n\n return h1 >>> 0;\n};\n\nexports.default = murmurhash3_32_gc;\n\n//# sourceURL=webpack://NineSlice/./src/murmur.js?'
);
},
"./src/processOffsetsArray.js": function (module, exports, __webpack_require__) {
"use strict";
eval(
"\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar processsOffsetArray = function processsOffsetArray(arr) {\n switch (arr.length) {\n case 1:\n // topRightBottomLeft\n return [arr[0], arr[0], arr[0], arr[0]];\n case 2:\n // topBottom rightLeft\n return [arr[0], arr[1], arr[0], arr[1]];\n case 3:\n // top rightLeft bottom\n return [arr[0], arr[1], arr[2], arr[1]];\n case 4:\n // top right bottom left\n return arr;\n }\n throw new Error('Received ${arr.length} offset values, expected 1 to 4.');\n};\n\nexports.default = processsOffsetArray;\n\n//# sourceURL=webpack://NineSlice/./src/processOffsetsArray.js?"
);
},
0: function (module, exports, __webpack_require__) {
eval('module.exports = __webpack_require__(/*! ./src/index.js */"./src/index.js");\n\n\n//# sourceURL=webpack://NineSlice/multi_./src/index.js?');
},
phaser: function (module, exports) {
eval(
"module.exports = __WEBPACK_EXTERNAL_MODULE_phaser__;\n\n//# sourceURL=webpack://NineSlice/external_%7B%22umd%22:%22phaser%22,%22commonjs2%22:%22phaser%22,%22commonjs%22:%22phaser%22,%22amd%22:%22phaser%22,%22root%22:%22Phaser%22%7D?"
);
},
});
}),
(module.exports = factory(__webpack_require__(58)));
},
function (t, e) {
var i;
i = (function () {
return this;
})();
try {
i = i || new Function("return this")();
} catch (t) {
"object" == typeof window && (i = window);
}
t.exports = i;
},
function (t, e, i) {
t.exports = (function () {
return (
(n = {}),
(s.m = i = [
function (t, e) {
function r(t, e, i, n) {
for (var s in e)
if (e.hasOwnProperty(s)) {
var r =
((l = e),
(u = s),
(f = d = void 0),
(f = (c = i) ? l[u] : Object.getOwnPropertyDescriptor(l, u)),
!c && f.value && "object" == typeof f.value && (f = f.value),
!(!f || !(((d = f).get && "function" == typeof d.get) || (d.set && "function" == typeof d.set))) &&
(void 0 === f.enumerable && (f.enumerable = !0), void 0 === f.configurable && (f.configurable = !0), f));
if (!1 !== r) {
if (((o = (n || t).prototype), (a = s), (h = void 0), (h = Object.getOwnPropertyDescriptor(o, a)) && (h.value && "object" == typeof h.value && (h = h.value), !1 === h.configurable))) {
if (p.ignoreFinals) continue;
throw new Error("cannot override final property '" + s + "', set Class.ignoreFinals = true to skip");
}
Object.defineProperty(t.prototype, s, r);
} else t.prototype[s] = e[s];
}
var o, a, h, l, u, c, d, f;
}
function o(t, e) {
if (e) {
Array.isArray(e) || (e = [e]);
for (var i = 0; i < e.length; i++) r(t, e[i].prototype || e[i]);
}
}
function p(t) {
var e, i, n;
if ((t = t || {}).initialize) {
if ("function" != typeof t.initialize) throw new Error("initialize must be a function");
(n = t.initialize), delete t.initialize;
} else
n = t.Extends
? ((i = t.Extends),
function () {
i.apply(this, arguments);
})
: function () {};
t.Extends ? ((n.prototype = Object.create(t.Extends.prototype)), (n.prototype.constructor = n), (e = t.Extends), delete t.Extends) : (n.prototype.constructor = n);
var s = null;
return t.Mixins && ((s = t.Mixins), delete t.Mixins), o(n, s), r(n, t, !0, e), n;
}
(p.extend = r), (p.mixin = o), (p.ignoreFinals = !1), (t.exports = p);
},
function (t, e) {
t.exports = function () {};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = typeof t;
return t && "number" != n && "string" != n && t.hasOwnProperty(e) && void 0 !== t[e] ? t[e] : i;
};
},
function (t, e, i) {
var n = i(0),
s = i(124),
r = new n({
initialize: function (t, e) {
(this.x = 0), (this.y = 0), "object" == typeof t ? ((this.x = t.x || 0), (this.y = t.y || 0)) : (void 0 === e && (e = t), (this.x = t || 0), (this.y = e || 0));
},
clone: function () {
return new r(this.x, this.y);
},
copy: function (t) {
return (this.x = t.x || 0), (this.y = t.y || 0), this;
},
setFromObject: function (t) {
return (this.x = t.x || 0), (this.y = t.y || 0), this;
},
set: function (t, e) {
return void 0 === e && (e = t), (this.x = t), (this.y = e), this;
},
setTo: function (t, e) {
return this.set(t, e);
},
setToPolar: function (t, e) {
return null == e && (e = 1), (this.x = Math.cos(t) * e), (this.y = Math.sin(t) * e), this;
},
equals: function (t) {
return this.x === t.x && this.y === t.y;
},
fuzzyEquals: function (t, e) {
return s(this.x, t.x, e) && s(this.y, t.y, e);
},
angle: function () {
var t = Math.atan2(this.y, this.x);
return t < 0 && (t += 2 * Math.PI), t;
},
setAngle: function (t) {
return this.setToPolar(t, this.length());
},
add: function (t) {
return (this.x += t.x), (this.y += t.y), this;
},
subtract: function (t) {
return (this.x -= t.x), (this.y -= t.y), this;
},
multiply: function (t) {
return (this.x *= t.x), (this.y *= t.y), this;
},
scale: function (t) {
return isFinite(t) ? ((this.x *= t), (this.y *= t)) : ((this.x = 0), (this.y = 0)), this;
},
divide: function (t) {
return (this.x /= t.x), (this.y /= t.y), this;
},
negate: function () {
return (this.x = -this.x), (this.y = -this.y), this;
},
distance: function (t) {
var e = t.x - this.x,
i = t.y - this.y;
return Math.sqrt(e * e + i * i);
},
distanceSq: function (t) {
var e = t.x - this.x,
i = t.y - this.y;
return e * e + i * i;
},
length: function () {
var t = this.x,
e = this.y;
return Math.sqrt(t * t + e * e);
},
setLength: function (t) {
return this.normalize().scale(t);
},
lengthSq: function () {
var t = this.x,
e = this.y;
return t * t + e * e;
},
normalize: function () {
var t = this.x,
e = this.y,
i = t * t + e * e;
return 0 < i && ((i = 1 / Math.sqrt(i)), (this.x = t * i), (this.y = e * i)), this;
},
normalizeRightHand: function () {
var t = this.x;
return (this.x = -1 * this.y), (this.y = t), this;
},
normalizeLeftHand: function () {
var t = this.x;
return (this.x = this.y), (this.y = -1 * t), this;
},
dot: function (t) {
return this.x * t.x + this.y * t.y;
},
cross: function (t) {
return this.x * t.y - this.y * t.x;
},
lerp: function (t, e) {
void 0 === e && (e = 0);
var i = this.x,
n = this.y;
return (this.x = i + e * (t.x - i)), (this.y = n + e * (t.y - n)), this;
},
transformMat3: function (t) {
var e = this.x,
i = this.y,
n = t.val;
return (this.x = n[0] * e + n[3] * i + n[6]), (this.y = n[1] * e + n[4] * i + n[7]), this;
},
transformMat4: function (t) {
var e = this.x,
i = this.y,
n = t.val;
return (this.x = n[0] * e + n[4] * i + n[12]), (this.y = n[1] * e + n[5] * i + n[13]), this;
},
reset: function () {
return (this.x = 0), (this.y = 0), this;
},
limit: function (t) {
var e = this.length();
return e && t < e && this.scale(t / e), this;
},
reflect: function (t) {
return (t = t.clone().normalize()), this.subtract(t.scale(2 * this.dot(t)));
},
mirror: function (t) {
return this.reflect(t).negate();
},
rotate: function (t) {
var e = Math.cos(t),
i = Math.sin(t);
return this.set(e * this.x - i * this.y, i * this.x + e * this.y);
},
});
(r.ZERO = new r()), (r.RIGHT = new r(1, 0)), (r.LEFT = new r(-1, 0)), (r.UP = new r(0, -1)), (r.DOWN = new r(0, 1)), (r.ONE = new r(1, 1)), (t.exports = r);
},
function (t, e, i) {
var n = i(0),
s = i(56),
r = new n({
initialize: function (t, e) {
void 0 === t && (t = 0), void 0 === e && (e = t), (this.type = s.POINT), (this.x = t), (this.y = e);
},
setTo: function (t, e) {
return void 0 === t && (t = 0), void 0 === e && (e = t), (this.x = t), (this.y = e), this;
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(0),
s = i(24),
r = i(20),
o = new n({
initialize: function (t) {
(this.scene = t), (this.systems = t.sys), (this.events = t.sys.events), this.displayList, this.updateList, this.events.once(r.BOOT, this.boot, this), this.events.on(r.START, this.start, this);
},
boot: function () {
(this.displayList = this.systems.displayList), (this.updateList = this.systems.updateList), this.events.once(r.DESTROY, this.destroy, this);
},
start: function () {
this.events.once(r.SHUTDOWN, this.shutdown, this);
},
existing: function (t) {
return (t.renderCanvas || t.renderWebGL) && this.displayList.add(t), t.preUpdate && this.updateList.add(t), t;
},
shutdown: function () {
this.events.off(r.SHUTDOWN, this.shutdown, this);
},
destroy: function () {
this.shutdown(), this.events.off(r.START, this.start, this), (this.scene = null), (this.systems = null), (this.events = null), (this.displayList = null), (this.updateList = null);
},
});
(o.register = function (t, e) {
o.prototype.hasOwnProperty(t) || (o.prototype[t] = e);
}),
(o.remove = function (t) {
o.prototype.hasOwnProperty(t) && delete o.prototype[t];
}),
s.register("GameObjectFactory", o, "add"),
(t.exports = o);
},
function (t, e) {
t.exports = function (t, e, i) {
if (t && "number" != typeof t) {
if (t.hasOwnProperty(e)) return t[e];
if (-1 === e.indexOf(".")) return i;
for (var n = e.split("."), s = t, r = i, o = 0; o < n.length; o++) {
if (!s.hasOwnProperty(n[o])) {
r = i;
break;
}
(r = s[n[o]]), (s = s[n[o]]);
}
return r;
}
return i;
};
},
function (t, e) {
t.exports = function (t) {
if ("object" != typeof t || t.nodeType || t === t.window) return !1;
try {
if (t.constructor && !{}.hasOwnProperty.call(t.constructor.prototype, "isPrototypeOf")) return !1;
} catch (t) {
return !1;
}
return !0;
};
},
function (t, e) {
var i = {},
n = {
install: function (t) {
for (var e in i) t[e] = i[e];
},
register: function (t, e) {
i[t] = e;
},
destroy: function () {
i = {};
},
};
t.exports = n;
},
function (t, e, i) {
"use strict";
var n = Object.prototype.hasOwnProperty,
f = "~";
function s() {}
function a(t, e, i) {
(this.fn = t), (this.context = e), (this.once = i || !1);
}
function r(t, e, i, n, s) {
if ("function" != typeof i) throw new TypeError("The listener must be a function");
var r = new a(i, n || t, s),
o = f ? f + e : e;
return t._events[o] ? (t._events[o].fn ? (t._events[o] = [t._events[o], r]) : t._events[o].push(r)) : ((t._events[o] = r), t._eventsCount++), t;
}
function l(t, e) {
0 == --t._eventsCount ? (t._events = new s()) : delete t._events[e];
}
function o() {
(this._events = new s()), (this._eventsCount = 0);
}
Object.create && ((s.prototype = Object.create(null)), new s().__proto__ || (f = !1)),
(o.prototype.eventNames = function () {
var t,
e,
i = [];
if (0 === this._eventsCount) return i;
for (e in (t = this._events)) n.call(t, e) && i.push(f ? e.slice(1) : e);
return Object.getOwnPropertySymbols ? i.concat(Object.getOwnPropertySymbols(t)) : i;
}),
(o.prototype.listeners = function (t) {
var e = f ? f + t : t,
i = this._events[e];
if (!i) return [];
if (i.fn) return [i.fn];
for (var n = 0, s = i.length, r = new Array(s); n < s; n++) r[n] = i[n].fn;
return r;
}),
(o.prototype.listenerCount = function (t) {
var e = f ? f + t : t,
i = this._events[e];
return i ? (i.fn ? 1 : i.length) : 0;
}),
(o.prototype.emit = function (t, e, i, n, s, r) {
var o = f ? f + t : t;
if (!this._events[o]) return !1;
var a,
h = this._events[o],
l = arguments.length;
if (h.fn) {
switch ((h.once && this.removeListener(t, h.fn, void 0, !0), l)) {
case 1:
return h.fn.call(h.context), !0;
case 2:
return h.fn.call(h.context, e), !0;
case 3:
return h.fn.call(h.context, e, i), !0;
case 4:
return h.fn.call(h.context, e, i, n), !0;
case 5:
return h.fn.call(h.context, e, i, n, s), !0;
case 6:
return h.fn.call(h.context, e, i, n, s, r), !0;
}
for (d = 1, a = new Array(l - 1); d < l; d++) a[d - 1] = arguments[d];
h.fn.apply(h.context, a);
} else
for (var u, c = h.length, d = 0; d < c; d++)
switch ((h[d].once && this.removeListener(t, h[d].fn, void 0, !0), l)) {
case 1:
h[d].fn.call(h[d].context);
break;
case 2:
h[d].fn.call(h[d].context, e);
break;
case 3:
h[d].fn.call(h[d].context, e, i);
break;
case 4:
h[d].fn.call(h[d].context, e, i, n);
break;
default:
if (!a) for (u = 1, a = new Array(l - 1); u < l; u++) a[u - 1] = arguments[u];
h[d].fn.apply(h[d].context, a);
}
return !0;
}),
(o.prototype.on = function (t, e, i) {
return r(this, t, e, i, !1);
}),
(o.prototype.once = function (t, e, i) {
return r(this, t, e, i, !0);
}),
(o.prototype.removeListener = function (t, e, i, n) {
var s = f ? f + t : t;
if (!this._events[s]) return this;
if (!e) return l(this, s), this;
var r = this._events[s];
if (r.fn) r.fn !== e || (n && !r.once) || (i && r.context !== i) || l(this, s);
else {
for (var o = 0, a = [], h = r.length; o < h; o++) (r[o].fn !== e || (n && !r[o].once) || (i && r[o].context !== i)) && a.push(r[o]);
a.length ? (this._events[s] = 1 === a.length ? a[0] : a) : l(this, s);
}
return this;
}),
(o.prototype.removeAllListeners = function (t) {
var e;
return t ? ((e = f ? f + t : t), this._events[e] && l(this, e)) : ((this._events = new s()), (this._eventsCount = 0)), this;
}),
(o.prototype.off = o.prototype.removeListener),
(o.prototype.addListener = o.prototype.on),
(o.prefixed = f),
(o.EventEmitter = o),
(t.exports = o);
},
function (t, e, i) {
var n = i(0),
s = i(57),
r = i(171),
o = i(306),
a = i(56),
h = i(47),
l = i(174),
u = new n({
initialize: function (t, e, i, n) {
void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === n && (n = 0), (this.type = a.RECTANGLE), (this.x = t), (this.y = e), (this.width = i), (this.height = n);
},
contains: function (t, e) {
return s(this, t, e);
},
getPoint: function (t, e) {
return r(this, t, e);
},
getPoints: function (t, e, i) {
return o(this, t, e, i);
},
getRandomPoint: function (t) {
return l(this, t);
},
setTo: function (t, e, i, n) {
return (this.x = t), (this.y = e), (this.width = i), (this.height = n), this;
},
setEmpty: function () {
return this.setTo(0, 0, 0, 0);
},
setPosition: function (t, e) {
return void 0 === e && (e = t), (this.x = t), (this.y = e), this;
},
setSize: function (t, e) {
return void 0 === e && (e = t), (this.width = t), (this.height = e), this;
},
isEmpty: function () {
return this.width <= 0 || this.height <= 0;
},
getLineA: function (t) {
return void 0 === t && (t = new h()), t.setTo(this.x, this.y, this.right, this.y), t;
},
getLineB: function (t) {
return void 0 === t && (t = new h()), t.setTo(this.right, this.y, this.right, this.bottom), t;
},
getLineC: function (t) {
return void 0 === t && (t = new h()), t.setTo(this.right, this.bottom, this.x, this.bottom), t;
},
getLineD: function (t) {
return void 0 === t && (t = new h()), t.setTo(this.x, this.bottom, this.x, this.y), t;
},
left: {
get: function () {
return this.x;
},
set: function (t) {
t >= this.right ? (this.width = 0) : (this.width = this.right - t), (this.x = t);
},
},
right: {
get: function () {
return this.x + this.width;
},
set: function (t) {
t <= this.x ? (this.width = 0) : (this.width = t - this.x);
},
},
top: {
get: function () {
return this.y;
},
set: function (t) {
t >= this.bottom ? (this.height = 0) : (this.height = this.bottom - t), (this.y = t);
},
},
bottom: {
get: function () {
return this.y + this.height;
},
set: function (t) {
t <= this.y ? (this.height = 0) : (this.height = t - this.y);
},
},
centerX: {
get: function () {
return this.x + this.width / 2;
},
set: function (t) {
this.x = t - this.width / 2;
},
},
centerY: {
get: function () {
return this.y + this.height / 2;
},
set: function (t) {
this.y = t - this.height / 2;
},
},
});
t.exports = u;
},
function (t, e, i) {
t.exports = {
Alpha: i(607),
AlphaSingle: i(303),
BlendMode: i(304),
ComputedSize: i(608),
Crop: i(609),
Depth: i(305),
Flip: i(610),
GetBounds: i(611),
Mask: i(309),
Origin: i(632),
PathFollower: i(633),
Pipeline: i(167),
ScrollFactor: i(312),
Size: i(634),
Texture: i(635),
TextureCrop: i(636),
Tint: i(637),
ToJSON: i(176),
Transform: i(313),
TransformMatrix: i(25),
Visible: i(314),
};
},
function (t, e) {
t.exports = {
getTintFromFloats: function (t, e, i, n) {
return (((255 & ((255 * n) | 0)) << 24) | ((255 & ((255 * t) | 0)) << 16) | ((255 & ((255 * e) | 0)) << 8) | (255 & ((255 * i) | 0))) >>> 0;
},
getTintAppendFloatAlpha: function (t, e) {
return (((255 & ((255 * e) | 0)) << 24) | t) >>> 0;
},
getTintAppendFloatAlphaAndSwap: function (t, e) {
return (((255 & ((255 * e) | 0)) << 24) | ((255 & (0 | t)) << 16) | ((255 & ((t >> 8) | 0)) << 8) | (255 & ((t >> 16) | 0))) >>> 0;
},
getFloatsFromUintRGB: function (t) {
return [(255 & ((t >> 16) | 0)) / 255, (255 & ((t >> 8) | 0)) / 255, (255 & (0 | t)) / 255];
},
checkShaderMax: function (t, e) {
(e && -1 !== e) || (e = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS));
for (var i = t.createShader(t.FRAGMENT_SHADER), n = ["precision mediump float;", "void main(void){", "float test = 0.1;", "%forloop%", "gl_FragColor = vec4(0.0);", "}"].join("\n"); ; ) {
var s = n.replace(
/%forloop%/gi,
(function (t) {
for (var e = "", i = 0; i < t; ++i) 0 < i && (e += "\nelse "), i < t - 1 && (e += "if(test == " + i + ".0){}");
return e;
})(e)
);
if ((t.shaderSource(i, s), t.compileShader(i), t.getShaderParameter(i, t.COMPILE_STATUS))) break;
e = (e / 2) | 0;
}
return e;
},
parseFragmentShaderMaxTextures: function (t, e) {
if (!t) return "";
for (var i = "", n = 0; n < e; n++)
0 < n && (i += "\n\telse "), n < e - 1 && (i += "if (outTexId < " + n + ".5)"), (i += "\n\t{"), (i += "\n\t\ttexture = texture2D(uMainSampler[" + n + "], outTexCoord);"), (i += "\n\t}");
return (t = t.replace(/%count%/gi, e.toString())).replace(/%forloop%/gi, i);
},
};
},
function (t, e, i) {
var s = i(193),
r = i(6);
t.exports = function (t, e, i) {
var n = r(t, e, null);
if (null === n) return i;
if (Array.isArray(n)) return s.RND.pick(n);
if ("object" == typeof n) {
if (n.hasOwnProperty("randInt")) return s.RND.integerInRange(n.randInt[0], n.randInt[1]);
if (n.hasOwnProperty("randFloat")) return s.RND.realInRange(n.randFloat[0], n.randFloat[1]);
} else if ("function" == typeof n) return n(e);
return n;
};
},
function (t, e) {
var i = {
PI2: 2 * Math.PI,
TAU: 0.5 * Math.PI,
EPSILON: 1e-6,
DEG_TO_RAD: Math.PI / 180,
RAD_TO_DEG: 180 / Math.PI,
RND: null,
MIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER || -9007199254740991,
MAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER || 9007199254740991,
};
t.exports = i;
},
function (t, e, i) {
var n = i(0),
s = i(176),
r = i(101),
o = i(9),
a = i(75),
h = i(20),
l = new n({
Extends: o,
initialize: function (t, e) {
o.call(this),
(this.scene = t),
(this.displayList = null),
(this.type = e),
(this.state = 0),
(this.parentContainer = null),
(this.name = ""),
(this.active = !0),
(this.tabIndex = -1),
(this.data = null),
(this.renderFlags = 15),
(this.cameraFilter = 0),
(this.input = null),
(this.body = null),
(this.ignoreDestroy = !1),
this.on(a.ADDED_TO_SCENE, this.addedToScene, this),
this.on(a.REMOVED_FROM_SCENE, this.removedFromScene, this),
t.sys.queueDepthSort();
},
setActive: function (t) {
return (this.active = t), this;
},
setName: function (t) {
return (this.name = t), this;
},
setState: function (t) {
return (this.state = t), this;
},
setDataEnabled: function () {
return this.data || (this.data = new r(this)), this;
},
setData: function (t, e) {
return this.data || (this.data = new r(this)), this.data.set(t, e), this;
},
incData: function (t, e) {
return this.data || (this.data = new r(this)), this.data.inc(t, e), this;
},
toggleData: function (t) {
return this.data || (this.data = new r(this)), this.data.toggle(t), this;
},
getData: function (t) {
return this.data || (this.data = new r(this)), this.data.get(t);
},
setInteractive: function (t, e, i) {
return this.scene.sys.input.enable(this, t, e, i), this;
},
disableInteractive: function () {
return this.input && (this.input.enabled = !1), this;
},
removeInteractive: function () {
return this.scene.sys.input.clear(this), (this.input = void 0), this;
},
addedToScene: function () {},
removedFromScene: function () {},
update: function () {},
toJSON: function () {
return s(this);
},
willRender: function (t) {
return !(l.RENDER_MASK !== this.renderFlags || (0 !== this.cameraFilter && this.cameraFilter & t.id));
},
getIndexList: function () {
for (var t = this, e = this.parentContainer, i = []; e && (i.unshift(e.getIndex(t)), (t = e).parentContainer); ) e = e.parentContainer;
return this.displayList ? i.unshift(this.displayList.getIndex(t)) : i.unshift(this.scene.sys.displayList.getIndex(t)), i;
},
addToDisplayList: function (t) {
return (
void 0 === t && (t = this.scene.sys.displayList),
this.displayList && this.displayList !== t && this.removeFromDisplayList(),
t.exists(this) || ((this.displayList = t).add(this, !0), t.queueDepthSort(), this.emit(a.ADDED_TO_SCENE, this, this.scene), t.events.emit(h.ADDED_TO_SCENE, this, this.scene)),
this
);
},
addToUpdateList: function () {
return this.scene && this.preUpdate && this.scene.sys.updateList.add(this), this;
},
removeFromDisplayList: function () {
var t = this.displayList || this.scene.sys.displayList;
return (
t.exists(this) && (t.remove(this, !0), t.queueDepthSort(), (this.displayList = null), this.emit(a.REMOVED_FROM_SCENE, this, this.scene), t.events.emit(h.REMOVED_FROM_SCENE, this, this.scene)),
this
);
},
removeFromUpdateList: function () {
return this.scene && this.preUpdate && this.scene.sys.updateList.remove(this), this;
},
destroy: function (t) {
this.scene &&
!this.ignoreDestroy &&
(void 0 === t && (t = !1),
this.preDestroy && this.preDestroy.call(this),
this.emit(a.DESTROY, this, t),
this.removeAllListeners(),
this.postPipelines && this.resetPostPipeline(!0),
this.removeFromDisplayList(),
this.removeFromUpdateList(),
this.input && (this.scene.sys.input.clear(this), (this.input = void 0)),
this.data && (this.data.destroy(), (this.data = void 0)),
this.body && (this.body.destroy(), (this.body = void 0)),
(this.active = !1),
(this.visible = !1),
(this.scene = void 0),
(this.parentContainer = void 0));
},
});
(l.RENDER_MASK = 15), (t.exports = l);
},
function (t, e, i) {
var n = i(0),
s = i(24),
r = i(20),
o = new n({
initialize: function (t) {
(this.scene = t), (this.systems = t.sys), (this.events = t.sys.events), this.displayList, this.updateList, this.events.once(r.BOOT, this.boot, this), this.events.on(r.START, this.start, this);
},
boot: function () {
(this.displayList = this.systems.displayList), (this.updateList = this.systems.updateList), this.events.once(r.DESTROY, this.destroy, this);
},
start: function () {
this.events.once(r.SHUTDOWN, this.shutdown, this);
},
shutdown: function () {
this.events.off(r.SHUTDOWN, this.shutdown, this);
},
destroy: function () {
this.shutdown(), this.events.off(r.START, this.start, this), (this.scene = null), (this.systems = null), (this.events = null), (this.displayList = null), (this.updateList = null);
},
});
(o.register = function (t, e) {
o.prototype.hasOwnProperty(t) || (o.prototype[t] = e);
}),
(o.remove = function (t) {
o.prototype.hasOwnProperty(t) && delete o.prototype[t];
}),
s.register("GameObjectCreator", o, "make"),
(t.exports = o);
},
function (t, e, i) {
var u = i(7),
c = function () {
var t,
e,
i,
n,
s,
r,
o = arguments[0] || {},
a = 1,
h = arguments.length,
l = !1;
for ("boolean" == typeof o && ((l = o), (o = arguments[1] || {}), (a = 2)), h === a && ((o = this), --a); a < h; a++)
if (null != (t = arguments[a]))
for (e in t)
(i = o[e]),
o !== (n = t[e]) &&
(l && n && (u(n) || (s = Array.isArray(n))) ? ((r = s ? ((s = !1), i && Array.isArray(i) ? i : []) : i && u(i) ? i : {}), (o[e] = c(l, r, n))) : void 0 !== n && (o[e] = n));
return o;
};
t.exports = c;
},
function (t, e) {
t.exports = function (t, e, i) {
return Math.max(e, Math.min(i, t));
};
},
function (t, e, i) {
var n = i(25),
o = new n(),
a = new n(),
h = new n(),
l = { camera: o, sprite: a, calc: h };
t.exports = function (t, e, i) {
var n = o,
s = a,
r = h;
return (
s.applyITRS(t.x, t.y, t.rotation, t.scaleX, t.scaleY),
n.copyFrom(e.matrix),
i ? (n.multiplyWithOffset(i, -e.scrollX * t.scrollFactorX, -e.scrollY * t.scrollFactorY), (s.e = t.x), (s.f = t.y)) : ((s.e -= e.scrollX * t.scrollFactorX), (s.f -= e.scrollY * t.scrollFactorY)),
n.multiply(s, r),
l
);
};
},
function (t, e, i) {
t.exports = {
ADDED_TO_SCENE: i(656),
BOOT: i(657),
CREATE: i(658),
DESTROY: i(659),
PAUSE: i(660),
POST_UPDATE: i(661),
PRE_RENDER: i(662),
PRE_UPDATE: i(663),
READY: i(664),
REMOVED_FROM_SCENE: i(665),
RENDER: i(666),
RESUME: i(667),
SHUTDOWN: i(668),
SLEEP: i(669),
START: i(670),
TRANSITION_COMPLETE: i(671),
TRANSITION_INIT: i(672),
TRANSITION_OUT: i(673),
TRANSITION_START: i(674),
TRANSITION_WAKE: i(675),
UPDATE: i(676),
WAKE: i(677),
};
},
function (t, e) {
t.exports = {
LOADER_IDLE: 0,
LOADER_LOADING: 1,
LOADER_PROCESSING: 2,
LOADER_COMPLETE: 3,
LOADER_SHUTDOWN: 4,
LOADER_DESTROYED: 5,
FILE_PENDING: 10,
FILE_LOADING: 11,
FILE_LOADED: 12,
FILE_FAILED: 13,
FILE_PROCESSING: 14,
FILE_ERRORED: 16,
FILE_COMPLETE: 17,
FILE_DESTROYED: 18,
FILE_POPULATED: 19,
};
},
function (t, e, i) {
t.exports = {
BLUR: i(612),
BOOT: i(613),
CONTEXT_LOST: i(614),
CONTEXT_RESTORED: i(615),
DESTROY: i(616),
FOCUS: i(617),
HIDDEN: i(618),
PAUSE: i(619),
POST_RENDER: i(620),
POST_STEP: i(621),
PRE_RENDER: i(622),
PRE_STEP: i(623),
READY: i(624),
RESUME: i(625),
STEP: i(626),
VISIBLE: i(627),
};
},
function (t, e, i) {
var n = i(0),
s = i(21),
r = i(95),
o = i(2),
a = i(155),
h = i(240),
l = i(517),
u = i(156),
c = new n({
initialize: function (t, e) {
(this.loader = t), (this.cache = o(e, "cache", !1)), (this.type = o(e, "type", !1)), (this.key = o(e, "key", !1));
var i = this.key;
if ((t.prefix && "" !== t.prefix && (this.key = t.prefix + i), !this.type || !this.key)) throw new Error("Invalid Loader." + this.type + " key");
var n = o(e, "url");
void 0 === n ? (n = t.path + i + "." + o(e, "extension", "")) : "string" != typeof n || n.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/) || (n = t.path + n),
(this.url = n),
(this.src = ""),
(this.xhrSettings = u(o(e, "responseType", void 0))),
o(e, "xhrSettings", !1) && (this.xhrSettings = h(this.xhrSettings, o(e, "xhrSettings", {}))),
(this.xhrLoader = null),
(this.state = "function" == typeof this.url ? s.FILE_POPULATED : s.FILE_PENDING),
(this.bytesTotal = 0),
(this.bytesLoaded = -1),
(this.percentComplete = -1),
(this.crossOrigin = void 0),
(this.data = void 0),
(this.config = o(e, "config", {})),
this.multiFile,
this.linkFile;
},
setLink: function (t) {
(this.linkFile = t).linkFile = this;
},
resetXHR: function () {
this.xhrLoader && ((this.xhrLoader.onload = void 0), (this.xhrLoader.onerror = void 0), (this.xhrLoader.onprogress = void 0));
},
load: function () {
this.state === s.FILE_POPULATED
? this.loader.nextFile(this, !0)
: ((this.state = s.FILE_LOADING), (this.src = a(this, this.loader.baseURL)), 0 === this.src.indexOf("data:") || (this.xhrLoader = l(this, this.loader.xhr)));
},
onLoad: function (t, e) {
var i = t.responseURL && (0 === t.responseURL.indexOf("file://") || 0 === t.responseURL.indexOf("capacitor://")) && 0 === e.target.status,
n = !(e.target && 200 !== e.target.status) || i;
4 === t.readyState && 400 <= t.status && t.status <= 599 && (n = !1), (this.state = s.FILE_LOADED), this.resetXHR(), this.loader.nextFile(this, n);
},
onError: function () {
this.resetXHR(), this.loader.nextFile(this, !1);
},
onProgress: function (t) {
t.lengthComputable &&
((this.bytesLoaded = t.loaded),
(this.bytesTotal = t.total),
(this.percentComplete = Math.min(this.bytesLoaded / this.bytesTotal, 1)),
this.loader.emit(r.FILE_PROGRESS, this, this.percentComplete));
},
onProcess: function () {
(this.state = s.FILE_PROCESSING), this.onProcessComplete();
},
onProcessComplete: function () {
(this.state = s.FILE_COMPLETE), this.multiFile && this.multiFile.onFileComplete(this), this.loader.fileProcessComplete(this);
},
onProcessError: function () {
(this.state = s.FILE_ERRORED), this.multiFile && this.multiFile.onFileFailed(this), this.loader.fileProcessComplete(this);
},
hasCacheConflict: function () {
return this.cache && this.cache.exists(this.key);
},
addToCache: function () {
this.cache && this.cache.add(this.key, this.data), this.pendingDestroy();
},
pendingDestroy: function (t) {
void 0 === t && (t = this.data);
var e = this.key,
i = this.type;
this.loader.emit(r.FILE_COMPLETE, e, i, t), this.loader.emit(r.FILE_KEY_COMPLETE + i + "-" + e, e, i, t), this.loader.flagForRemoval(this);
},
destroy: function () {
(this.loader = null), (this.cache = null), (this.xhrSettings = null), (this.multiFile = null), (this.linkFile = null), (this.data = null);
},
});
(c.createObjectURL = function (t, e, i) {
var n;
"function" == typeof URL
? (t.src = URL.createObjectURL(e))
: (((n = new FileReader()).onload = function () {
t.removeAttribute("crossOrigin"), (t.src = "data:" + (e.type || i) + ";base64," + n.result.split(",")[1]);
}),
(n.onerror = t.onerror),
n.readAsDataURL(e));
}),
(c.revokeObjectURL = function (t) {
"function" == typeof URL && URL.revokeObjectURL(t.src);
}),
(t.exports = c);
},
function (t, e) {
var s = {},
r = {},
i = {
register: function (t, e, i, n) {
void 0 === n && (n = !1), (s[t] = { plugin: e, mapping: i, custom: n });
},
registerCustom: function (t, e, i, n) {
r[t] = { plugin: e, mapping: i, data: n };
},
hasCore: function (t) {
return s.hasOwnProperty(t);
},
hasCustom: function (t) {
return r.hasOwnProperty(t);
},
getCore: function (t) {
return s[t];
},
getCustom: function (t) {
return r[t];
},
getCustomClass: function (t) {
return r.hasOwnProperty(t) ? r[t].plugin : null;
},
remove: function (t) {
s.hasOwnProperty(t) && delete s[t];
},
removeCustom: function (t) {
r.hasOwnProperty(t) && delete r[t];
},
destroyCorePlugins: function () {
for (var t in s) s.hasOwnProperty(t) && delete s[t];
},
destroyCustomPlugins: function () {
for (var t in r) r.hasOwnProperty(t) && delete r[t];
},
};
t.exports = i;
},
function (t, e, i) {
var n = i(0),
r = i(14),
c = i(3),
s = new n({
initialize: function (t, e, i, n, s, r) {
void 0 === t && (t = 1),
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 1),
void 0 === s && (s = 0),
void 0 === r && (r = 0),
(this.matrix = new Float32Array([t, e, i, n, s, r, 0, 0, 1])),
(this.decomposedMatrix = { translateX: 0, translateY: 0, scaleX: 1, scaleY: 1, rotation: 0 });
},
a: {
get: function () {
return this.matrix[0];
},
set: function (t) {
this.matrix[0] = t;
},
},
b: {
get: function () {
return this.matrix[1];
},
set: function (t) {
this.matrix[1] = t;
},
},
c: {
get: function () {
return this.matrix[2];
},
set: function (t) {
this.matrix[2] = t;
},
},
d: {
get: function () {
return this.matrix[3];
},
set: function (t) {
this.matrix[3] = t;
},
},
e: {
get: function () {
return this.matrix[4];
},
set: function (t) {
this.matrix[4] = t;
},
},
f: {
get: function () {
return this.matrix[5];
},
set: function (t) {
this.matrix[5] = t;
},
},
tx: {
get: function () {
return this.matrix[4];
},
set: function (t) {
this.matrix[4] = t;
},
},
ty: {
get: function () {
return this.matrix[5];
},
set: function (t) {
this.matrix[5] = t;
},
},
rotation: {
get: function () {
return Math.acos(this.a / this.scaleX) * (Math.atan(-this.c / this.a) < 0 ? -1 : 1);
},
},
rotationNormalized: {
get: function () {
var t = this.matrix,
e = t[0],
i = t[1],
n = t[2],
s = t[3];
return e || i ? (0 < i ? Math.acos(e / this.scaleX) : -Math.acos(e / this.scaleX)) : n || s ? r.TAU - (0 < s ? Math.acos(-n / this.scaleY) : -Math.acos(n / this.scaleY)) : 0;
},
},
scaleX: {
get: function () {
return Math.sqrt(this.a * this.a + this.b * this.b);
},
},
scaleY: {
get: function () {
return Math.sqrt(this.c * this.c + this.d * this.d);
},
},
loadIdentity: function () {
var t = this.matrix;
return (t[0] = 1), (t[1] = 0), (t[2] = 0), (t[3] = 1), (t[4] = 0), (t[5] = 0), this;
},
translate: function (t, e) {
var i = this.matrix;
return (i[4] = i[0] * t + i[2] * e + i[4]), (i[5] = i[1] * t + i[3] * e + i[5]), this;
},
scale: function (t, e) {
var i = this.matrix;
return (i[0] *= t), (i[1] *= t), (i[2] *= e), (i[3] *= e), this;
},
rotate: function (t) {
var e = Math.sin(t),
i = Math.cos(t),
n = this.matrix,
s = n[0],
r = n[1],
o = n[2],
a = n[3];
return (n[0] = s * i + o * e), (n[1] = r * i + a * e), (n[2] = s * -e + o * i), (n[3] = r * -e + a * i), this;
},
multiply: function (t, e) {
var i = this.matrix,
n = t.matrix,
s = i[0],
r = i[1],
o = i[2],
a = i[3],
h = i[4],
l = i[5],
u = n[0],
c = n[1],
d = n[2],
f = n[3],
p = n[4],
g = n[5],
v = void 0 === e ? this : e;
return (v.a = u * s + c * o), (v.b = u * r + c * a), (v.c = d * s + f * o), (v.d = d * r + f * a), (v.e = p * s + g * o + h), (v.f = p * r + g * a + l), v;
},
multiplyWithOffset: function (t, e, i) {
var n = this.matrix,
s = t.matrix,
r = n[0],
o = n[1],
a = n[2],
h = n[3],
l = e * r + i * a + n[4],
u = e * o + i * h + n[5],
c = s[0],
d = s[1],
f = s[2],
p = s[3],
g = s[4],
v = s[5];
return (n[0] = c * r + d * a), (n[1] = c * o + d * h), (n[2] = f * r + p * a), (n[3] = f * o + p * h), (n[4] = g * r + v * a + l), (n[5] = g * o + v * h + u), this;
},
transform: function (t, e, i, n, s, r) {
var o = this.matrix,
a = o[0],
h = o[1],
l = o[2],
u = o[3],
c = o[4],
d = o[5];
return (o[0] = t * a + e * l), (o[1] = t * h + e * u), (o[2] = i * a + n * l), (o[3] = i * h + n * u), (o[4] = s * a + r * l + c), (o[5] = s * h + r * u + d), this;
},
transformPoint: function (t, e, i) {
void 0 === i && (i = { x: 0, y: 0 });
var n = this.matrix,
s = n[0],
r = n[1],
o = n[2],
a = n[3],
h = n[4],
l = n[5];
return (i.x = t * s + e * o + h), (i.y = t * r + e * a + l), i;
},
invert: function () {
var t = this.matrix,
e = t[0],
i = t[1],
n = t[2],
s = t[3],
r = t[4],
o = t[5],
a = e * s - i * n;
return (t[0] = s / a), (t[1] = -i / a), (t[2] = -n / a), (t[3] = e / a), (t[4] = (n * o - s * r) / a), (t[5] = -(e * o - i * r) / a), this;
},
copyFrom: function (t) {
var e = this.matrix;
return (e[0] = t.a), (e[1] = t.b), (e[2] = t.c), (e[3] = t.d), (e[4] = t.e), (e[5] = t.f), this;
},
copyFromArray: function (t) {
var e = this.matrix;
return (e[0] = t[0]), (e[1] = t[1]), (e[2] = t[2]), (e[3] = t[3]), (e[4] = t[4]), (e[5] = t[5]), this;
},
copyToContext: function (t) {
var e = this.matrix;
return t.transform(e[0], e[1], e[2], e[3], e[4], e[5]), t;
},
setToContext: function (t) {
var e = this.matrix;
return t.setTransform(e[0], e[1], e[2], e[3], e[4], e[5]), t;
},
copyToArray: function (t) {
var e = this.matrix;
return void 0 === t ? (t = [e[0], e[1], e[2], e[3], e[4], e[5]]) : ((t[0] = e[0]), (t[1] = e[1]), (t[2] = e[2]), (t[3] = e[3]), (t[4] = e[4]), (t[5] = e[5])), t;
},
setTransform: function (t, e, i, n, s, r) {
var o = this.matrix;
return (o[0] = t), (o[1] = e), (o[2] = i), (o[3] = n), (o[4] = s), (o[5] = r), this;
},
decomposeMatrix: function () {
var t,
e,
i = this.decomposedMatrix,
n = this.matrix,
s = n[0],
r = n[1],
o = n[2],
a = n[3],
h = s * a - r * o;
return (
(i.translateX = n[4]),
(i.translateY = n[5]),
s || r
? ((t = Math.sqrt(s * s + r * r)), (i.rotation = 0 < r ? Math.acos(s / t) : -Math.acos(s / t)), (i.scaleX = t), (i.scaleY = h / t))
: o || a
? ((e = Math.sqrt(o * o + a * a)), (i.rotation = 0.5 * Math.PI - (0 < a ? Math.acos(-o / e) : -Math.acos(o / e))), (i.scaleX = h / e), (i.scaleY = e))
: ((i.rotation = 0), (i.scaleX = 0), (i.scaleY = 0)),
i
);
},
applyITRS: function (t, e, i, n, s) {
var r = this.matrix,
o = Math.sin(i),
a = Math.cos(i);
return (r[4] = t), (r[5] = e), (r[0] = a * n), (r[1] = o * n), (r[2] = -o * s), (r[3] = a * s), this;
},
applyInverse: function (t, e, i) {
void 0 === i && (i = new c());
var n = this.matrix,
s = n[0],
r = n[1],
o = n[2],
a = n[3],
h = n[4],
l = n[5],
u = 1 / (s * a + o * -r);
return (i.x = a * u * t + -o * u * e + (l * o - h * a) * u), (i.y = s * u * e + -r * u * t + (-l * s + h * r) * u), i;
},
getX: function (t, e) {
return t * this.a + e * this.c + this.e;
},
getY: function (t, e) {
return t * this.b + e * this.d + this.f;
},
getXRound: function (t, e, i) {
var n = this.getX(t, e);
return i && (n = Math.round(n)), n;
},
getYRound: function (t, e, i) {
var n = this.getY(t, e);
return i && (n = Math.round(n)), n;
},
getCSSMatrix: function () {
var t = this.matrix;
return "matrix(" + t[0] + "," + t[1] + "," + t[2] + "," + t[3] + "," + t[4] + "," + t[5] + ")";
},
destroy: function () {
(this.matrix = null), (this.decomposedMatrix = null);
},
});
t.exports = s;
},
function (t, e, i) {
var f = i(2);
t.exports = function (t, e, i, n, s, r) {
void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = r.width), void 0 === n && (n = r.height);
var o = f((s = s || {}), "isNotEmpty", !1),
a = f(s, "isColliding", !1),
h = f(s, "hasInterestingFace", !1);
t < 0 && ((i += t), (t = 0)), e < 0 && ((n += e), (e = 0)), t + i > r.width && (i = Math.max(r.width - t, 0)), e + n > r.height && (n = Math.max(r.height - e, 0));
for (var l = [], u = e; u < e + n; u++)
for (var c = t; c < t + i; c++) {
var d = r.data[u][c];
if (null !== d) {
if (o && -1 === d.index) continue;
if (a && !d.collides) continue;
if (h && !d.hasInterestingFace) continue;
l.push(d);
}
}
return l;
};
},
function (t, e) {
t.exports = function (t, e, i, n, s, r) {
var o;
void 0 === n && (n = 0), void 0 === s && (s = 0), void 0 === r && (r = 1);
var a = 0,
h = t.length;
if (1 === r) for (o = s; o < h; o++) (t[o][e] = i + a * n), a++;
else for (o = s; 0 <= o; o--) (t[o][e] = i + a * n), a++;
return t;
};
},
function (t, e, i) {
var l = i(35),
u = i(13);
t.exports = function (t, e, i) {
(e.x = u(i, "x", 0)), (e.y = u(i, "y", 0)), (e.depth = u(i, "depth", 0)), (e.flipX = u(i, "flipX", !1)), (e.flipY = u(i, "flipY", !1));
var n = u(i, "scale", null);
"number" == typeof n ? e.setScale(n) : null !== n && ((e.scaleX = u(n, "x", 1)), (e.scaleY = u(n, "y", 1)));
var s = u(i, "scrollFactor", null);
"number" == typeof s ? e.setScrollFactor(s) : null !== s && ((e.scrollFactorX = u(s, "x", 1)), (e.scrollFactorY = u(s, "y", 1))), (e.rotation = u(i, "rotation", 0));
var r = u(i, "angle", null);
null !== r && (e.angle = r), (e.alpha = u(i, "alpha", 1));
var o,
a,
h = u(i, "origin", null);
return (
"number" == typeof h ? e.setOrigin(h) : null !== h && ((o = u(h, "x", 0.5)), (a = u(h, "y", 0.5)), e.setOrigin(o, a)),
(e.blendMode = u(i, "blendMode", l.NORMAL)),
(e.visible = u(i, "visible", !0)),
u(i, "add", !0) && t.sys.displayList.add(e),
e.preUpdate && t.sys.updateList.add(e),
e
);
};
},
function (t, e) {
t.exports = { ORTHOGONAL: 0, ISOMETRIC: 1, STAGGERED: 2, HEXAGONAL: 3 };
},
function (t, e, i) {
var a = i(19);
t.exports = function (t, e, i, n, s) {
var r = n.alpha * i.alpha;
if (r <= 0) return !1;
var o = a(i, n, s).calc;
return (e.globalCompositeOperation = t.blendModes[i.blendMode]), (e.globalAlpha = r), e.save(), o.setToContext(e), (e.imageSmoothingEnabled = !(!t.antialias || (i.frame && i.frame.source.scaleMode))), !0;
};
},
function (t, e, i) {
var a,
h = i(33),
l = i(192),
u = [],
c = !1;
function n(t, e, i, n, s) {
void 0 === e && (e = 1), void 0 === i && (i = 1), void 0 === n && (n = h.CANVAS), void 0 === s && (s = !1);
var r = a(n),
o = (null === r ? ((r = { parent: t, canvas: document.createElement("canvas"), type: n }), n === h.CANVAS && u.push(r)) : (r.parent = t), r.canvas);
return s && (r.parent = o), (o.width = e), (o.height = i), c && n === h.CANVAS && l.disable(o.getContext("2d")), o;
}
function s() {
var e = 0;
return (
u.forEach(function (t) {
t.parent && e++;
}),
e
);
}
t.exports = {
create2D: function (t, e, i) {
return n(t, e, i, h.CANVAS);
},
create: n,
createWebGL: function (t, e, i) {
return n(t, e, i, h.WEBGL);
},
disableSmoothing: function () {
c = !0;
},
enableSmoothing: function () {
c = !1;
},
first: (a = function (t) {
if ((void 0 === t && (t = h.CANVAS), t === h.WEBGL)) return null;
for (var e = 0; e < u.length; e++) {
var i = u[e];
if (!i.parent && i.type === t) return i;
}
return null;
}),
free: function () {
return u.length - s();
},
pool: u,
remove: function (e) {
var i = e instanceof HTMLCanvasElement;
u.forEach(function (t) {
((i && t.canvas === e) || (!i && t.parent === e)) && ((t.parent = null), (t.canvas.width = 1), (t.canvas.height = 1));
});
},
total: s,
};
},
function (t, e) {
var h = {};
(t.exports = h),
(function () {
(h._nextId = 0),
(h._seed = 0),
(h._nowStartTime = +new Date()),
(h.extend = function (t, e) {
for (var i, n = "boolean" == typeof e ? ((i = 2), e) : ((i = 1), !0), s = i; s < arguments.length; s++) {
var r = arguments[s];
if (r) for (var o in r) !n || !r[o] || r[o].constructor !== Object || (t[o] && t[o].constructor !== Object) ? (t[o] = r[o]) : ((t[o] = t[o] || {}), h.extend(t[o], n, r[o]));
}
return t;
}),
(h.clone = function (t, e) {
return h.extend({}, e, t);
}),
(h.keys = function (t) {
if (Object.keys) return Object.keys(t);
var e = [];
for (var i in t) e.push(i);
return e;
}),
(h.values = function (t) {
var e = [];
if (Object.keys) {
for (var i = Object.keys(t), n = 0; n < i.length; n++) e.push(t[i[n]]);
return e;
}
for (var s in t) e.push(t[s]);
return e;
}),
(h.get = function (t, e, i, n) {
e = e.split(".").slice(i, n);
for (var s = 0; s < e.length; s += 1) t = t[e[s]];
return t;
}),
(h.set = function (t, e, i, n, s) {
var r = e.split(".").slice(n, s);
return (h.get(t, e, 0, -1)[r[r.length - 1]] = i);
}),
(h.shuffle = function (t) {
for (var e = t.length - 1; 0 < e; e--) {
var i = Math.floor(h.random() * (e + 1)),
n = t[e];
(t[e] = t[i]), (t[i] = n);
}
return t;
}),
(h.choose = function (t) {
return t[Math.floor(h.random() * t.length)];
}),
(h.isElement = function (t) {
return "undefined" != typeof HTMLElement ? t instanceof HTMLElement : !!(t && t.nodeType && t.nodeName);
}),
(h.isArray = function (t) {
return "[object Array]" === Object.prototype.toString.call(t);
}),
(h.isFunction = function (t) {
return "function" == typeof t;
}),
(h.isPlainObject = function (t) {
return "object" == typeof t && t.constructor === Object;
}),
(h.isString = function (t) {
return "[object String]" === Object.prototype.toString.call(t);
}),
(h.clamp = function (t, e, i) {
return t < e ? e : i < t ? i : t;
}),
(h.sign = function (t) {
return t < 0 ? -1 : 1;
}),
(h.now = function () {
if ("undefined" != typeof window && window.performance) {
if (window.performance.now) return window.performance.now();
if (window.performance.webkitNow) return window.performance.webkitNow();
}
return new Date() - h._nowStartTime;
}),
(h.random = function (t, e) {
return (e = void 0 !== e ? e : 1), (t = void 0 !== t ? t : 0) + i() * (e - t);
});
var i = function () {
return (h._seed = (9301 * h._seed + 49297) % 233280), h._seed / 233280;
};
(h.colorToNumber = function (t) {
return 3 == (t = t.replace("#", "")).length && (t = t.charAt(0) + t.charAt(0) + t.charAt(1) + t.charAt(1) + t.charAt(2) + t.charAt(2)), parseInt(t, 16);
}),
(h.logLevel = 1),
(h.log = function () {
console && 0 < h.logLevel && h.logLevel;
}),
(h.info = function () {
console && 0 < h.logLevel && h.logLevel;
}),
(h.warn = function () {
console && 0 < h.logLevel && h.logLevel;
}),
(h.nextId = function () {
return h._nextId++;
}),
(h.indexOf = function (t, e) {
if (t.indexOf) return t.indexOf(e);
for (var i = 0; i < t.length; i++) if (t[i] === e) return i;
return -1;
}),
(h.map = function (t, e) {
if (t.map) return t.map(e);
for (var i = [], n = 0; n < t.length; n += 1) i.push(e(t[n]));
return i;
}),
(h.topologicalSort = function (t) {
var e = [],
i = [],
n = [];
for (var s in t) i[s] || n[s] || h._topologicalSort(s, i, n, t, e);
return e;
}),
(h._topologicalSort = function (t, e, i, n, s) {
var r = n[t] || [];
i[t] = !0;
for (var o = 0; o < r.length; o += 1) {
var a = r[o];
i[a] || e[a] || h._topologicalSort(a, e, i, n, s);
}
(i[t] = !1), (e[t] = !0), s.push(t);
}),
(h.chain = function () {
for (var r = [], t = 0; t < arguments.length; t += 1) {
var e = arguments[t];
e._chained ? r.push.apply(r, e._chained) : r.push(e);
}
function i() {
for (var t, e = new Array(arguments.length), i = 0, n = arguments.length; i < n; i++) e[i] = arguments[i];
for (i = 0; i < r.length; i += 1) {
var s = r[i].apply(t, e);
void 0 !== s && (t = s);
}
return t;
}
return (i._chained = r), i;
}),
(h.chainPathBefore = function (t, e, i) {
return h.set(t, e, h.chain(i, h.get(t, e)));
}),
(h.chainPathAfter = function (t, e, i) {
return h.set(t, e, h.chain(h.get(t, e), i));
});
})();
},
function (t, e, i) {
var n = { VERSION: "3.55.2", BlendModes: i(35), ScaleModes: i(168), AUTO: 0, CANVAS: 1, WEBGL: 2, HEADLESS: 3, FOREVER: -1, NONE: 4, UP: 5, DOWN: 6, LEFT: 7, RIGHT: 8 };
t.exports = n;
},
function (t, e, i) {
var n = i(0),
s = i(11),
r = i(15),
o = i(47),
a = new n({
Extends: r,
Mixins: [s.AlphaSingle, s.BlendMode, s.Depth, s.GetBounds, s.Mask, s.Origin, s.Pipeline, s.ScrollFactor, s.Transform, s.Visible],
initialize: function (t, e, i) {
void 0 === e && (e = "Shape"),
r.call(this, t, e),
(this.geom = i),
(this.pathData = []),
(this.pathIndexes = []),
(this.fillColor = 16777215),
(this.fillAlpha = 1),
(this.strokeColor = 16777215),
(this.strokeAlpha = 1),
(this.lineWidth = 1),
(this.isFilled = !1),
(this.isStroked = !1),
(this.closePath = !0),
(this._tempLine = new o()),
(this.width = 0),
(this.height = 0),
this.initPipeline();
},
setFillStyle: function (t, e) {
return void 0 === e && (e = 1), void 0 === t ? (this.isFilled = !1) : ((this.fillColor = t), (this.fillAlpha = e), (this.isFilled = !0)), this;
},
setStrokeStyle: function (t, e, i) {
return void 0 === i && (i = 1), void 0 === t ? (this.isStroked = !1) : ((this.lineWidth = t), (this.strokeColor = e), (this.strokeAlpha = i), (this.isStroked = !0)), this;
},
setClosePath: function (t) {
return (this.closePath = t), this;
},
setSize: function (t, e) {
return (this.width = t), (this.height = e), this;
},
setDisplaySize: function (t, e) {
return (this.displayWidth = t), (this.displayHeight = e), this;
},
preDestroy: function () {
(this.geom = null), (this._tempLine = null), (this.pathData = []), (this.pathIndexes = []);
},
displayWidth: {
get: function () {
return this.scaleX * this.width;
},
set: function (t) {
this.scaleX = t / this.width;
},
},
displayHeight: {
get: function () {
return this.scaleY * this.height;
},
set: function (t) {
this.scaleY = t / this.height;
},
},
});
t.exports = a;
},
function (t, e) {
t.exports = {
SKIP_CHECK: -1,
NORMAL: 0,
ADD: 1,
MULTIPLY: 2,
SCREEN: 3,
OVERLAY: 4,
DARKEN: 5,
LIGHTEN: 6,
COLOR_DODGE: 7,
COLOR_BURN: 8,
HARD_LIGHT: 9,
SOFT_LIGHT: 10,
DIFFERENCE: 11,
EXCLUSION: 12,
HUE: 13,
SATURATION: 14,
COLOR: 15,
LUMINOSITY: 16,
ERASE: 17,
SOURCE_IN: 18,
SOURCE_OUT: 19,
SOURCE_ATOP: 20,
DESTINATION_OVER: 21,
DESTINATION_IN: 22,
DESTINATION_OUT: 23,
DESTINATION_ATOP: 24,
LIGHTER: 25,
COPY: 26,
XOR: 27,
};
},
function (t, e, i) {
var n = i(14);
t.exports = function (t) {
return t * n.DEG_TO_RAD;
};
},
function (t, e, i) {
t.exports = {
DESTROY: i(743),
FADE_IN_COMPLETE: i(744),
FADE_IN_START: i(745),
FADE_OUT_COMPLETE: i(746),
FADE_OUT_START: i(747),
FLASH_COMPLETE: i(748),
FLASH_START: i(749),
FOLLOW_UPDATE: i(750),
PAN_COMPLETE: i(751),
PAN_START: i(752),
POST_RENDER: i(753),
PRE_RENDER: i(754),
ROTATE_COMPLETE: i(755),
ROTATE_START: i(756),
SHAKE_COMPLETE: i(757),
SHAKE_START: i(758),
ZOOM_COMPLETE: i(759),
ZOOM_START: i(760),
};
},
function (t, e, i) {
var n = i(0),
r = i(103),
o = i(328),
s = i(188),
a = i(329),
h = new n({
initialize: function (t, e, i, n) {
void 0 === t && (t = 0),
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 255),
(this.r = 0),
(this.g = 0),
(this.b = 0),
(this.a = 255),
(this._h = 0),
(this._s = 0),
(this._v = 0),
(this._locked = !1),
(this.gl = [0, 0, 0, 1]),
(this._color = 0),
(this._color32 = 0),
(this._rgba = ""),
this.setTo(t, e, i, n);
},
transparent: function () {
return (this._locked = !0), (this.red = 0), (this.green = 0), (this.blue = 0), (this.alpha = 0), (this._locked = !1), this.update(!0);
},
setTo: function (t, e, i, n, s) {
return void 0 === n && (n = 255), void 0 === s && (s = !0), (this._locked = !0), (this.red = t), (this.green = e), (this.blue = i), (this.alpha = n), (this._locked = !1), this.update(s);
},
setGLTo: function (t, e, i, n) {
return void 0 === n && (n = 1), (this._locked = !0), (this.redGL = t), (this.greenGL = e), (this.blueGL = i), (this.alphaGL = n), (this._locked = !1), this.update(!0);
},
setFromRGB: function (t) {
return (this._locked = !0), (this.red = t.r), (this.green = t.g), (this.blue = t.b), t.hasOwnProperty("a") && (this.alpha = t.a), (this._locked = !1), this.update(!0);
},
setFromHSV: function (t, e, i) {
return s(t, e, i, this);
},
update: function (t) {
if ((void 0 === t && (t = !1), this._locked)) return this;
var e = this.r,
i = this.g,
n = this.b,
s = this.a;
return (this._color = r(e, i, n)), (this._color32 = o(e, i, n, s)), (this._rgba = "rgba(" + e + "," + i + "," + n + "," + s / 255 + ")"), t && a(e, i, n, this), this;
},
updateHSV: function () {
var t = this.r,
e = this.g,
i = this.b;
return a(t, e, i, this), this;
},
clone: function () {
return new h(this.r, this.g, this.b, this.a);
},
gray: function (t) {
return this.setTo(t, t, t);
},
random: function (t, e) {
void 0 === t && (t = 0), void 0 === e && (e = 255);
var i = Math.floor(t + Math.random() * (e - t)),
n = Math.floor(t + Math.random() * (e - t)),
s = Math.floor(t + Math.random() * (e - t));
return this.setTo(i, n, s);
},
randomGray: function (t, e) {
void 0 === t && (t = 0), void 0 === e && (e = 255);
var i = Math.floor(t + Math.random() * (e - t));
return this.setTo(i, i, i);
},
saturate: function (t) {
return (this.s += t / 100), this;
},
desaturate: function (t) {
return (this.s -= t / 100), this;
},
lighten: function (t) {
return (this.v += t / 100), this;
},
darken: function (t) {
return (this.v -= t / 100), this;
},
brighten: function (t) {
var e = this.r,
i = this.g,
n = this.b;
return (
(e = Math.max(0, Math.min(255, e - Math.round((-t / 100) * 255)))),
(i = Math.max(0, Math.min(255, i - Math.round((-t / 100) * 255)))),
(n = Math.max(0, Math.min(255, n - Math.round((-t / 100) * 255)))),
this.setTo(e, i, n)
);
},
color: {
get: function () {
return this._color;
},
},
color32: {
get: function () {
return this._color32;
},
},
rgba: {
get: function () {
return this._rgba;
},
},
redGL: {
get: function () {
return this.gl[0];
},
set: function (t) {
(this.gl[0] = Math.min(Math.abs(t), 1)), (this.r = Math.floor(255 * this.gl[0])), this.update(!0);
},
},
greenGL: {
get: function () {
return this.gl[1];
},
set: function (t) {
(this.gl[1] = Math.min(Math.abs(t), 1)), (this.g = Math.floor(255 * this.gl[1])), this.update(!0);
},
},
blueGL: {
get: function () {
return this.gl[2];
},
set: function (t) {
(this.gl[2] = Math.min(Math.abs(t), 1)), (this.b = Math.floor(255 * this.gl[2])), this.update(!0);
},
},
alphaGL: {
get: function () {
return this.gl[3];
},
set: function (t) {
(this.gl[3] = Math.min(Math.abs(t), 1)), (this.a = Math.floor(255 * this.gl[3])), this.update();
},
},
red: {
get: function () {
return this.r;
},
set: function (t) {
(t = Math.floor(Math.abs(t))), (this.r = Math.min(t, 255)), (this.gl[0] = t / 255), this.update(!0);
},
},
green: {
get: function () {
return this.g;
},
set: function (t) {
(t = Math.floor(Math.abs(t))), (this.g = Math.min(t, 255)), (this.gl[1] = t / 255), this.update(!0);
},
},
blue: {
get: function () {
return this.b;
},
set: function (t) {
(t = Math.floor(Math.abs(t))), (this.b = Math.min(t, 255)), (this.gl[2] = t / 255), this.update(!0);
},
},
alpha: {
get: function () {
return this.a;
},
set: function (t) {
(t = Math.floor(Math.abs(t))), (this.a = Math.min(t, 255)), (this.gl[3] = t / 255), this.update();
},
},
h: {
get: function () {
return this._h;
},
set: function (t) {
(this._h = t), s(t, this._s, this._v, this);
},
},
s: {
get: function () {
return this._s;
},
set: function (t) {
(this._s = t), s(this._h, t, this._v, this);
},
},
v: {
get: function () {
return this._v;
},
set: function (t) {
(this._v = t), s(this._h, this._s, t, this);
},
},
});
t.exports = h;
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e, i) {
(this.x = 0), (this.y = 0), (this.z = 0), "object" == typeof t ? ((this.x = t.x || 0), (this.y = t.y || 0), (this.z = t.z || 0)) : ((this.x = t || 0), (this.y = e || 0), (this.z = i || 0));
},
up: function () {
return (this.x = 0), (this.y = 1), (this.z = 0), this;
},
min: function (t) {
return (this.x = Math.min(this.x, t.x)), (this.y = Math.min(this.y, t.y)), (this.z = Math.min(this.z, t.z)), this;
},
max: function (t) {
return (this.x = Math.max(this.x, t.x)), (this.y = Math.max(this.y, t.y)), (this.z = Math.max(this.z, t.z)), this;
},
clone: function () {
return new n(this.x, this.y, this.z);
},
addVectors: function (t, e) {
return (this.x = t.x + e.x), (this.y = t.y + e.y), (this.z = t.z + e.z), this;
},
crossVectors: function (t, e) {
var i = t.x,
n = t.y,
s = t.z,
r = e.x,
o = e.y,
a = e.z;
return (this.x = n * a - s * o), (this.y = s * r - i * a), (this.z = i * o - n * r), this;
},
equals: function (t) {
return this.x === t.x && this.y === t.y && this.z === t.z;
},
copy: function (t) {
return (this.x = t.x), (this.y = t.y), (this.z = t.z || 0), this;
},
set: function (t, e, i) {
return "object" == typeof t ? ((this.x = t.x || 0), (this.y = t.y || 0), (this.z = t.z || 0)) : ((this.x = t || 0), (this.y = e || 0), (this.z = i || 0)), this;
},
setFromMatrixPosition: function (t) {
return this.fromArray(t.val, 12);
},
setFromMatrixColumn: function (t, e) {
return this.fromArray(t.val, 4 * e);
},
fromArray: function (t, e) {
return void 0 === e && (e = 0), (this.x = t[e]), (this.y = t[e + 1]), (this.z = t[e + 2]), this;
},
add: function (t) {
return (this.x += t.x), (this.y += t.y), (this.z += t.z || 0), this;
},
addScalar: function (t) {
return (this.x += t), (this.y += t), (this.z += t), this;
},
addScale: function (t, e) {
return (this.x += t.x * e), (this.y += t.y * e), (this.z += t.z * e || 0), this;
},
subtract: function (t) {
return (this.x -= t.x), (this.y -= t.y), (this.z -= t.z || 0), this;
},
multiply: function (t) {
return (this.x *= t.x), (this.y *= t.y), (this.z *= t.z || 1), this;
},
scale: function (t) {
return isFinite(t) ? ((this.x *= t), (this.y *= t), (this.z *= t)) : ((this.x = 0), (this.y = 0), (this.z = 0)), this;
},
divide: function (t) {
return (this.x /= t.x), (this.y /= t.y), (this.z /= t.z || 1), this;
},
negate: function () {
return (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), this;
},
distance: function (t) {
var e = t.x - this.x,
i = t.y - this.y,
n = t.z - this.z || 0;
return Math.sqrt(e * e + i * i + n * n);
},
distanceSq: function (t) {
var e = t.x - this.x,
i = t.y - this.y,
n = t.z - this.z || 0;
return e * e + i * i + n * n;
},
length: function () {
var t = this.x,
e = this.y,
i = this.z;
return Math.sqrt(t * t + e * e + i * i);
},
lengthSq: function () {
var t = this.x,
e = this.y,
i = this.z;
return t * t + e * e + i * i;
},
normalize: function () {
var t = this.x,
e = this.y,
i = this.z,
n = t * t + e * e + i * i;
return 0 < n && ((n = 1 / Math.sqrt(n)), (this.x = t * n), (this.y = e * n), (this.z = i * n)), this;
},
dot: function (t) {
return this.x * t.x + this.y * t.y + this.z * t.z;
},
cross: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.x,
r = t.y,
o = t.z;
return (this.x = i * o - n * r), (this.y = n * s - e * o), (this.z = e * r - i * s), this;
},
lerp: function (t, e) {
void 0 === e && (e = 0);
var i = this.x,
n = this.y,
s = this.z;
return (this.x = i + e * (t.x - i)), (this.y = n + e * (t.y - n)), (this.z = s + e * (t.z - s)), this;
},
applyMatrix3: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.val;
return (this.x = s[0] * e + s[3] * i + s[6] * n), (this.y = s[1] * e + s[4] * i + s[7] * n), (this.z = s[2] * e + s[5] * i + s[8] * n), this;
},
applyMatrix4: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.val,
r = 1 / (s[3] * e + s[7] * i + s[11] * n + s[15]);
return (this.x = (s[0] * e + s[4] * i + s[8] * n + s[12]) * r), (this.y = (s[1] * e + s[5] * i + s[9] * n + s[13]) * r), (this.z = (s[2] * e + s[6] * i + s[10] * n + s[14]) * r), this;
},
transformMat3: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.val;
return (this.x = e * s[0] + i * s[3] + n * s[6]), (this.y = e * s[1] + i * s[4] + n * s[7]), (this.z = e * s[2] + i * s[5] + n * s[8]), this;
},
transformMat4: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.val;
return (this.x = s[0] * e + s[4] * i + s[8] * n + s[12]), (this.y = s[1] * e + s[5] * i + s[9] * n + s[13]), (this.z = s[2] * e + s[6] * i + s[10] * n + s[14]), this;
},
transformCoordinates: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.val,
r = e * s[0] + i * s[4] + n * s[8] + s[12],
o = e * s[1] + i * s[5] + n * s[9] + s[13],
a = e * s[2] + i * s[6] + n * s[10] + s[14],
h = e * s[3] + i * s[7] + n * s[11] + s[15];
return (this.x = r / h), (this.y = o / h), (this.z = a / h), this;
},
transformQuat: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.x,
r = t.y,
o = t.z,
a = t.w,
h = a * e + r * n - o * i,
l = a * i + o * e - s * n,
u = a * n + s * i - r * e,
c = -s * e - r * i - o * n;
return (this.x = h * a + c * -s + l * -o - u * -r), (this.y = l * a + c * -r + u * -s - h * -o), (this.z = u * a + c * -o + h * -r - l * -s), this;
},
project: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.val,
r = s[0],
o = s[1],
a = s[2],
h = s[3],
l = s[4],
u = s[5],
c = s[6],
d = s[7],
f = s[8],
p = s[9],
g = s[10],
v = s[11],
y = s[12],
m = s[13],
x = s[14],
b = 1 / (e * h + i * d + n * v + s[15]);
return (this.x = (e * r + i * l + n * f + y) * b), (this.y = (e * o + i * u + n * p + m) * b), (this.z = (e * a + i * c + n * g + x) * b), this;
},
projectViewMatrix: function (t, e) {
return this.applyMatrix4(t).applyMatrix4(e);
},
unprojectViewMatrix: function (t, e) {
return this.applyMatrix4(t).applyMatrix4(e);
},
unproject: function (t, e) {
var i = t.x,
n = t.y,
s = t.z,
r = t.w,
o = this.x - i,
a = r - this.y - 1 - n,
h = this.z;
return (this.x = (2 * o) / s - 1), (this.y = (2 * a) / r - 1), (this.z = 2 * h - 1), this.project(e);
},
reset: function () {
return (this.x = 0), (this.y = 0), (this.z = 0), this;
},
});
(n.ZERO = new n()),
(n.RIGHT = new n(1, 0, 0)),
(n.LEFT = new n(-1, 0, 0)),
(n.UP = new n(0, -1, 0)),
(n.DOWN = new n(0, 1, 0)),
(n.FORWARD = new n(0, 0, 1)),
(n.BACK = new n(0, 0, -1)),
(n.ONE = new n(1, 1, 1)),
(t.exports = n);
},
function (t, e) {
t.exports = { CSV: 0, TILED_JSON: 1, ARRAY_2D: 2, WELTMEISTER: 3 };
},
function (t, e, i) {
var p = {};
t.exports = p;
var g = i(64),
u = i(83),
s = i(165),
r = i(32),
v = i(84),
c = i(271);
!(function () {
(p._inertiaScale = 4),
(p._nextCollidingGroupId = 1),
(p._nextNonCollidingGroupId = -1),
(p._nextCategory = 1),
(p.create = function (t) {
var e = {
id: r.nextId(),
type: "body",
label: "Body",
parts: [],
plugin: {},
angle: 0,
vertices: null,
position: { x: 0, y: 0 },
force: { x: 0, y: 0 },
torque: 0,
positionImpulse: { x: 0, y: 0 },
previousPositionImpulse: { x: 0, y: 0 },
constraintImpulse: { x: 0, y: 0, angle: 0 },
totalContacts: 0,
speed: 0,
angularSpeed: 0,
velocity: { x: 0, y: 0 },
angularVelocity: 0,
isSensor: !1,
isStatic: !1,
isSleeping: !1,
motion: 0,
sleepThreshold: 60,
density: 0.001,
restitution: 0,
friction: 0.1,
frictionStatic: 0.5,
frictionAir: 0.01,
collisionFilter: { category: 1, mask: 4294967295, group: 0 },
slop: 0.05,
timeScale: 1,
events: null,
bounds: null,
chamfer: null,
circleRadius: 0,
positionPrev: null,
anglePrev: 0,
parent: null,
axes: null,
area: 0,
mass: 0,
inverseMass: 0,
inertia: 0,
inverseInertia: 0,
_original: null,
render: { visible: !0, opacity: 1, sprite: { xOffset: 0, yOffset: 0 }, fillColor: null, fillOpacity: null, lineColor: null, lineOpacity: null, lineThickness: null },
gameObject: null,
scale: { x: 1, y: 1 },
centerOfMass: { x: 0, y: 0 },
centerOffset: { x: 0, y: 0 },
gravityScale: { x: 1, y: 1 },
ignoreGravity: !1,
ignorePointer: !1,
onCollideCallback: null,
onCollideEndCallback: null,
onCollideActiveCallback: null,
onCollideWith: {},
};
!t.hasOwnProperty("position") && t.hasOwnProperty("vertices") ? (t.position = g.centre(t.vertices)) : t.hasOwnProperty("vertices") || (e.vertices = g.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"));
var i = r.extend(e, t);
return (
n(i, t),
(i.setOnCollideWith = function (t, e) {
return e ? (this.onCollideWith[t.id] = e) : delete this.onCollideWith[t.id], this;
}),
i
);
}),
(p.nextGroup = function (t) {
return t ? p._nextNonCollidingGroupId-- : p._nextCollidingGroupId++;
}),
(p.nextCategory = function () {
return (p._nextCategory = p._nextCategory << 1), p._nextCategory;
});
var n = function (t, e) {
(e = e || {}),
p.set(t, {
bounds: t.bounds || v.create(t.vertices),
positionPrev: t.positionPrev || u.clone(t.position),
anglePrev: t.anglePrev || t.angle,
vertices: t.vertices,
parts: t.parts || [t],
isStatic: t.isStatic,
isSleeping: t.isSleeping,
parent: t.parent || t,
});
var i,
n,
s,
r,
o = t.bounds;
g.rotate(t.vertices, t.angle, t.position),
c.rotate(t.axes, t.angle),
v.update(o, t.vertices, t.velocity),
p.set(t, { axes: e.axes || t.axes, area: e.area || t.area, mass: e.mass || t.mass, inertia: e.inertia || t.inertia }),
1 === t.parts.length &&
((i = t.centerOfMass),
(n = t.centerOffset),
(s = o.max.x - o.min.x),
(r = o.max.y - o.min.y),
(i.x = -(o.min.x - t.position.x) / s),
(i.y = -(o.min.y - t.position.y) / r),
(n.x = s * i.x),
(n.y = r * i.y));
};
(p.set = function (t, e, i) {
var n;
for (n in ("string" == typeof e && ((n = e), ((e = {})[n] = i)), e))
if (Object.prototype.hasOwnProperty.call(e, n))
switch (((i = e[n]), n)) {
case "isStatic":
p.setStatic(t, i);
break;
case "isSleeping":
s.set(t, i);
break;
case "mass":
p.setMass(t, i);
break;
case "density":
p.setDensity(t, i);
break;
case "inertia":
p.setInertia(t, i);
break;
case "vertices":
p.setVertices(t, i);
break;
case "position":
p.setPosition(t, i);
break;
case "angle":
p.setAngle(t, i);
break;
case "velocity":
p.setVelocity(t, i);
break;
case "angularVelocity":
p.setAngularVelocity(t, i);
break;
case "parts":
p.setParts(t, i);
break;
case "centre":
p.setCentre(t, i);
break;
default:
t[n] = i;
}
}),
(p.setStatic = function (t, e) {
for (var i = 0; i < t.parts.length; i++) {
var n = t.parts[i];
(n.isStatic = e)
? ((n._original = { restitution: n.restitution, friction: n.friction, mass: n.mass, inertia: n.inertia, density: n.density, inverseMass: n.inverseMass, inverseInertia: n.inverseInertia }),
(n.restitution = 0),
(n.friction = 1),
(n.mass = n.inertia = n.density = 1 / 0),
(n.inverseMass = n.inverseInertia = 0),
(n.positionPrev.x = n.position.x),
(n.positionPrev.y = n.position.y),
(n.anglePrev = n.angle),
(n.angularVelocity = 0),
(n.speed = 0),
(n.angularSpeed = 0),
(n.motion = 0))
: n._original &&
((n.restitution = n._original.restitution),
(n.friction = n._original.friction),
(n.mass = n._original.mass),
(n.inertia = n._original.inertia),
(n.density = n._original.density),
(n.inverseMass = n._original.inverseMass),
(n.inverseInertia = n._original.inverseInertia),
(n._original = null));
}
}),
(p.setMass = function (t, e) {
var i = t.inertia / (t.mass / 6);
(t.inertia = (e / 6) * i), (t.inverseInertia = 1 / t.inertia), (t.mass = e), (t.inverseMass = 1 / t.mass), (t.density = t.mass / t.area);
}),
(p.setDensity = function (t, e) {
p.setMass(t, e * t.area), (t.density = e);
}),
(p.setInertia = function (t, e) {
(t.inertia = e), (t.inverseInertia = 1 / t.inertia);
}),
(p.setVertices = function (t, e) {
e[0].body === t ? (t.vertices = e) : (t.vertices = g.create(e, t)), (t.axes = c.fromVertices(t.vertices)), (t.area = g.area(t.vertices)), p.setMass(t, t.density * t.area);
var i = g.centre(t.vertices);
g.translate(t.vertices, i, -1), p.setInertia(t, p._inertiaScale * g.inertia(t.vertices, t.mass)), g.translate(t.vertices, t.position), v.update(t.bounds, t.vertices, t.velocity);
}),
(p.setParts = function (t, e, i) {
for (e = e.slice(0), t.parts.length = 0, t.parts.push(t), t.parent = t, r = 0; r < e.length; r++) {
var n = e[r];
n !== t && (n.parent = t).parts.push(n);
}
if (1 !== t.parts.length) {
if ((i = void 0 === i || i)) {
for (var s = [], r = 0; r < e.length; r++) s = s.concat(e[r].vertices);
g.clockwiseSort(s);
var o = g.hull(s),
a = g.centre(o);
p.setVertices(t, o), g.translate(t.vertices, a);
}
var h = p._totalProperties(t),
l = h.centre.x,
u = h.centre.y,
c = t.bounds,
d = t.centerOfMass,
f = t.centerOffset;
v.update(c, t.vertices, t.velocity),
(d.x = -(c.min.x - l) / (c.max.x - c.min.x)),
(d.y = -(c.min.y - u) / (c.max.y - c.min.y)),
(f.x = l),
(f.y = u),
(t.area = h.area),
((t.parent = t).position.x = l),
(t.position.y = u),
(t.positionPrev.x = l),
(t.positionPrev.y = u),
p.setMass(t, h.mass),
p.setInertia(t, h.inertia),
p.setPosition(t, h.centre);
}
}),
(p.setCentre = function (t, e, i) {
i
? ((t.positionPrev.x += e.x), (t.positionPrev.y += e.y), (t.position.x += e.x), (t.position.y += e.y))
: ((t.positionPrev.x = e.x - (t.position.x - t.positionPrev.x)), (t.positionPrev.y = e.y - (t.position.y - t.positionPrev.y)), (t.position.x = e.x), (t.position.y = e.y));
}),
(p.setPosition = function (t, e) {
var i = u.sub(e, t.position);
(t.positionPrev.x += i.x), (t.positionPrev.y += i.y);
for (var n = 0; n < t.parts.length; n++) {
var s = t.parts[n];
(s.position.x += i.x), (s.position.y += i.y), g.translate(s.vertices, i), v.update(s.bounds, s.vertices, t.velocity);
}
}),
(p.setAngle = function (t, e) {
var i = e - t.angle;
t.anglePrev += i;
for (var n = 0; n < t.parts.length; n++) {
var s = t.parts[n];
(s.angle += i), g.rotate(s.vertices, i, t.position), c.rotate(s.axes, i), v.update(s.bounds, s.vertices, t.velocity), 0 < n && u.rotateAbout(s.position, i, t.position, s.position);
}
}),
(p.setVelocity = function (t, e) {
(t.positionPrev.x = t.position.x - e.x), (t.positionPrev.y = t.position.y - e.y), (t.velocity.x = e.x), (t.velocity.y = e.y), (t.speed = u.magnitude(t.velocity));
}),
(p.setAngularVelocity = function (t, e) {
(t.anglePrev = t.angle - e), (t.angularVelocity = e), (t.angularSpeed = Math.abs(t.angularVelocity));
}),
(p.translate = function (t, e) {
p.setPosition(t, u.add(t.position, e));
}),
(p.rotate = function (t, e, i) {
var n, s, r, o;
i && ((n = Math.cos(e)), (s = Math.sin(e)), (r = t.position.x - i.x), (o = t.position.y - i.y), p.setPosition(t, { x: i.x + (r * n - o * s), y: i.y + (r * s + o * n) })), p.setAngle(t, t.angle + e);
}),
(p.scale = function (t, e, i, n) {
var s = 0,
r = 0;
n = n || t.position;
for (var o = 0; o < t.parts.length; o++) {
var a = t.parts[o];
(a.scale.x = e),
(a.scale.y = i),
g.scale(a.vertices, e, i, n),
(a.axes = c.fromVertices(a.vertices)),
(a.area = g.area(a.vertices)),
p.setMass(a, t.density * a.area),
g.translate(a.vertices, { x: -a.position.x, y: -a.position.y }),
p.setInertia(a, p._inertiaScale * g.inertia(a.vertices, a.mass)),
g.translate(a.vertices, { x: a.position.x, y: a.position.y }),
0 < o && ((s += a.area), (r += a.inertia)),
(a.position.x = n.x + (a.position.x - n.x) * e),
(a.position.y = n.y + (a.position.y - n.y) * i),
v.update(a.bounds, a.vertices, t.velocity);
}
1 < t.parts.length && ((t.area = s), t.isStatic || (p.setMass(t, t.density * s), p.setInertia(t, r))), t.circleRadius && (e === i ? (t.circleRadius *= e) : (t.circleRadius = null));
}),
(p.update = function (t, e, i, n) {
var s = Math.pow(e * i * t.timeScale, 2),
r = 1 - t.frictionAir * i * t.timeScale,
o = t.position.x - t.positionPrev.x,
a = t.position.y - t.positionPrev.y;
(t.velocity.x = o * r * n + (t.force.x / t.mass) * s),
(t.velocity.y = a * r * n + (t.force.y / t.mass) * s),
(t.positionPrev.x = t.position.x),
(t.positionPrev.y = t.position.y),
(t.position.x += t.velocity.x),
(t.position.y += t.velocity.y),
(t.angularVelocity = (t.angle - t.anglePrev) * r * n + (t.torque / t.inertia) * s),
(t.anglePrev = t.angle),
(t.angle += t.angularVelocity),
(t.speed = u.magnitude(t.velocity)),
(t.angularSpeed = Math.abs(t.angularVelocity));
for (var h = 0; h < t.parts.length; h++) {
var l = t.parts[h];
g.translate(l.vertices, t.velocity),
0 < h && ((l.position.x += t.velocity.x), (l.position.y += t.velocity.y)),
0 !== t.angularVelocity &&
(g.rotate(l.vertices, t.angularVelocity, t.position), c.rotate(l.axes, t.angularVelocity), 0 < h && u.rotateAbout(l.position, t.angularVelocity, t.position, l.position)),
v.update(l.bounds, l.vertices, t.velocity);
}
}),
(p.applyForce = function (t, e, i) {
(t.force.x += i.x), (t.force.y += i.y);
var n = e.x - t.position.x,
s = e.y - t.position.y;
t.torque += n * i.y - s * i.x;
}),
(p._totalProperties = function (t) {
for (var e = { mass: 0, area: 0, inertia: 0, centre: { x: 0, y: 0 } }, i = 1 === t.parts.length ? 0 : 1; i < t.parts.length; i++) {
var n = t.parts[i],
s = n.mass !== 1 / 0 ? n.mass : 1;
(e.mass += s), (e.area += n.area), (e.inertia += n.inertia), (e.centre = u.add(e.centre, u.mult(n.position, s)));
}
return (e.centre = u.div(e.centre, e.mass)), e;
});
})();
},
function (t, e) {
t.exports = function (t) {
return t.y + t.height - t.height * t.originY;
};
},
function (t, e) {
t.exports = function (t) {
return t.x - t.width * t.originX;
};
},
function (t, e) {
t.exports = function (t) {
return t.x + t.width - t.width * t.originX;
};
},
function (t, e) {
t.exports = function (t) {
return t.y - t.height * t.originY;
};
},
function (t, e) {
t.exports = function (t, e, i, n, s, r) {
var o;
void 0 === n && (n = 0), void 0 === s && (s = 0), void 0 === r && (r = 1);
var a = 0,
h = t.length;
if (1 === r) for (o = s; o < h; o++) (t[o][e] += i + a * n), a++;
else for (o = s; 0 <= o; o--) (t[o][e] += i + a * n), a++;
return t;
};
},
function (t, e, i) {
var n = i(0),
s = i(307),
r = i(172),
o = i(56),
a = i(173),
h = i(3),
l = new n({
initialize: function (t, e, i, n) {
void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === n && (n = 0), (this.type = o.LINE), (this.x1 = t), (this.y1 = e), (this.x2 = i), (this.y2 = n);
},
getPoint: function (t, e) {
return s(this, t, e);
},
getPoints: function (t, e, i) {
return r(this, t, e, i);
},
getRandomPoint: function (t) {
return a(this, t);
},
setTo: function (t, e, i, n) {
return void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === n && (n = 0), (this.x1 = t), (this.y1 = e), (this.x2 = i), (this.y2 = n), this;
},
getPointA: function (t) {
return void 0 === t && (t = new h()), t.set(this.x1, this.y1), t;
},
getPointB: function (t) {
return void 0 === t && (t = new h()), t.set(this.x2, this.y2), t;
},
left: {
get: function () {
return Math.min(this.x1, this.x2);
},
set: function (t) {
this.x1 <= this.x2 ? (this.x1 = t) : (this.x2 = t);
},
},
right: {
get: function () {
return Math.max(this.x1, this.x2);
},
set: function (t) {
this.x1 > this.x2 ? (this.x1 = t) : (this.x2 = t);
},
},
top: {
get: function () {
return Math.min(this.y1, this.y2);
},
set: function (t) {
this.y1 <= this.y2 ? (this.y1 = t) : (this.y2 = t);
},
},
bottom: {
get: function () {
return Math.max(this.y1, this.y2);
},
set: function (t) {
this.y1 > this.y2 ? (this.y1 = t) : (this.y2 = t);
},
},
});
t.exports = l;
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = i || e.fillColor,
r = n || e.fillAlpha,
o = (16711680 & s) >>> 16,
a = (65280 & s) >>> 8,
h = 255 & s;
t.fillStyle = "rgba(" + o + "," + a + "," + h + "," + r + ")";
};
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e, i, n) {
var s = [];
n.forEach(function (t) {
t && s.push(t);
}),
(this.loader = t),
(this.type = e),
(this.key = i),
(this.multiKeyIndex = t.multiKeyIndex++),
(this.files = s),
(this.complete = !1),
(this.pending = s.length),
(this.failed = 0),
(this.config = {}),
(this.baseURL = t.baseURL),
(this.path = t.path),
(this.prefix = t.prefix);
for (var r = 0; r < s.length; r++) s[r].multiFile = this;
},
isReadyToProcess: function () {
return 0 === this.pending && 0 === this.failed && !this.complete;
},
addToMultiFile: function (t) {
return this.files.push(t), (t.multiFile = this).pending++, (this.complete = !1), this;
},
onFileComplete: function (t) {
-1 !== this.files.indexOf(t) && this.pending--;
},
onFileFailed: function (t) {
-1 !== this.files.indexOf(t) && this.failed++;
},
});
t.exports = n;
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = t - i,
r = e - n;
return Math.sqrt(s * s + r * r);
};
},
function (t, e, i) {
t.exports = {
BOOT: i(922),
DESTROY: i(923),
DRAG_END: i(924),
DRAG_ENTER: i(925),
DRAG: i(926),
DRAG_LEAVE: i(927),
DRAG_OVER: i(928),
DRAG_START: i(929),
DROP: i(930),
GAME_OUT: i(931),
GAME_OVER: i(932),
GAMEOBJECT_DOWN: i(933),
GAMEOBJECT_DRAG_END: i(934),
GAMEOBJECT_DRAG_ENTER: i(935),
GAMEOBJECT_DRAG: i(936),
GAMEOBJECT_DRAG_LEAVE: i(937),
GAMEOBJECT_DRAG_OVER: i(938),
GAMEOBJECT_DRAG_START: i(939),
GAMEOBJECT_DROP: i(940),
GAMEOBJECT_MOVE: i(941),
GAMEOBJECT_OUT: i(942),
GAMEOBJECT_OVER: i(943),
GAMEOBJECT_POINTER_DOWN: i(944),
GAMEOBJECT_POINTER_MOVE: i(945),
GAMEOBJECT_POINTER_OUT: i(946),
GAMEOBJECT_POINTER_OVER: i(947),
GAMEOBJECT_POINTER_UP: i(948),
GAMEOBJECT_POINTER_WHEEL: i(949),
GAMEOBJECT_UP: i(950),
GAMEOBJECT_WHEEL: i(951),
MANAGER_BOOT: i(952),
MANAGER_PROCESS: i(953),
MANAGER_UPDATE: i(954),
POINTER_DOWN: i(955),
POINTER_DOWN_OUTSIDE: i(956),
POINTER_MOVE: i(957),
POINTER_OUT: i(958),
POINTER_OVER: i(959),
POINTER_UP: i(960),
POINTER_UP_OUTSIDE: i(961),
POINTER_WHEEL: i(962),
POINTERLOCK_CHANGE: i(963),
PRE_UPDATE: i(964),
SHUTDOWN: i(965),
START: i(966),
UPDATE: i(967),
};
},
function (t, e) {
t.exports = function (t, e) {
return (t.y = e + t.height * t.originY), t;
};
},
function (t, e) {
t.exports = function (t, e) {
return (t.x = e + t.width * t.originX), t;
};
},
function (t, e) {
t.exports = function (t, e) {
return (t.x = e - t.width + t.width * t.originX), t;
};
},
function (t, e) {
t.exports = function (t, e) {
return (t.y = e - t.height + t.height * t.originY), t;
};
},
function (t, e) {
t.exports = { CIRCLE: 0, ELLIPSE: 1, LINE: 2, POINT: 3, POLYGON: 4, RECTANGLE: 5, TRIANGLE: 6 };
},
function (t, e) {
t.exports = function (t, e, i) {
return !(t.width <= 0 || t.height <= 0) && t.x <= e && t.x + t.width >= e && t.y <= i && t.y + t.height >= i;
};
},
function (t, e, i) {
var n = i(0),
m = i(175),
s = i(9),
v = i(374),
x = i(2),
y = i(69),
b = i(91),
w = i(141),
T = i(12),
S = i(375),
r = new n({
Extends: s,
initialize: function (t) {
s.call(this);
var e = t.game,
i = e.renderer,
n = i.gl;
(this.name = x(t, "name", "WebGLPipeline")),
(this.game = e),
(this.renderer = i),
this.manager,
(this.gl = n),
(this.view = e.canvas),
(this.width = 0),
(this.height = 0),
(this.vertexCount = 0),
(this.vertexCapacity = 0),
this.vertexData,
this.vertexBuffer,
(this.topology = x(t, "topology", n.TRIANGLES)),
this.bytes,
this.vertexViewF32,
this.vertexViewU32,
(this.active = !0),
(this.currentUnit = 0),
(this.forceZero = x(t, "forceZero", !1)),
(this.hasBooted = !1),
(this.isPostFX = !1),
(this.renderTargets = []),
this.currentRenderTarget,
(this.shaders = []),
this.currentShader,
this.projectionMatrix,
(this.projectionWidth = 0),
(this.projectionHeight = 0),
(this.config = t),
(this.glReset = !1);
},
boot: function () {
var t = this.gl,
e = this.config,
i = this.renderer;
this.isPostFX || (this.projectionMatrix = new y().identity());
var n = this.renderTargets,
s = x(e, "renderTarget", !1);
"boolean" == typeof s && s && (s = 1);
var r = i.width,
o = i.height;
if ("number" == typeof s) for (d = 0; d < s; d++) n.push(new w(i, r, o, 1, 0, !0));
else if (Array.isArray(s))
for (d = 0; d < s.length; d++) {
var a = x(s[d], "scale", 1),
h = x(s[d], "minFilter", 0),
l = x(s[d], "autoClear", 1);
n.push(new w(i, r, o, a, h, l));
}
n.length && (this.currentRenderTarget = n[0]), this.setShadersFromConfig(e);
for (var u = this.shaders, c = 0, d = 0; d < u.length; d++) u[d].vertexSize > c && (c = u[d].vertexSize);
var f = x(e, "batchSize", i.config.batchSize);
this.vertexCapacity = 6 * f;
var p = new ArrayBuffer(this.vertexCapacity * c);
(this.vertexData = p), (this.bytes = new Uint8Array(p)), (this.vertexViewF32 = new Float32Array(p)), (this.vertexViewU32 = new Uint32Array(p));
var g = x(e, "vertices", null);
for (
g ? (this.vertexViewF32.set(g), (this.vertexBuffer = i.createVertexBuffer(p, t.STATIC_DRAW))) : (this.vertexBuffer = i.createVertexBuffer(p.byteLength, t.DYNAMIC_DRAW)),
this.setVertexBuffer(),
d = u.length - 1;
0 <= d;
d--
)
u[d].rebind();
(this.hasBooted = !0),
i.on(b.RESIZE, this.resize, this),
i.on(b.PRE_RENDER, this.onPreRender, this),
i.on(b.RENDER, this.onRender, this),
i.on(b.POST_RENDER, this.onPostRender, this),
this.emit(v.BOOT, this),
this.onBoot();
},
onBoot: function () {},
onResize: function () {},
setShader: function (t, e) {
var i = this.renderer;
return (
(t === this.currentShader && i.currentProgram === this.currentShader.program) ||
(this.flush(), i.resetTextures(), this.setVertexBuffer() && !e && (e = !0), t.bind(e, !1), (this.currentShader = t)),
this
);
},
getShaderByName: function (t) {
for (var e = this.shaders, i = 0; i < e.length; i++) if (e[i].name === t) return e[i];
},
setShadersFromConfig: function (t) {
var e = this.shaders,
i = this.renderer;
for (d = 0; d < e.length; d++) e[d].destroy();
var n = "vertShader",
s = "fragShader",
r = "attributes",
o = x(t, n, null),
a = T.parseFragmentShaderMaxTextures(x(t, s, null), i.maxTextures),
h = x(t, r, null),
l = x(t, "shaders", []),
u = l.length;
if (0 === u) o && a && (this.shaders = [new S(this, "default", o, a, m(h))]);
else {
for (var c = [], d = 0; d < u; d++) {
var f = l[d],
p = x(f, "name", "default"),
g = x(f, n, o),
v = T.parseFragmentShaderMaxTextures(x(f, s, a), i.maxTextures),
y = x(f, r, h);
g && v && c.push(new S(this, p, g, v, m(y)));
}
this.shaders = c;
}
return 0 === this.shaders.length || (this.currentShader = this.shaders[0]), this;
},
setGameObject: function (t, e) {
return void 0 === e && (e = t.frame), (this.currentUnit = this.renderer.setTextureSource(e.source)), this.currentUnit;
},
shouldFlush: function (t) {
return void 0 === t && (t = 0), this.vertexCount + t > this.vertexCapacity;
},
resize: function (t, e) {
(t === this.width && e === this.height) || this.flush(), (this.width = t), (this.height = e);
for (var i = this.renderTargets, n = 0; n < i.length; n++) i[n].resize(t, e);
return this.setProjectionMatrix(t, e), this.emit(v.RESIZE, t, e, this), this.onResize(t, e), this;
},
setProjectionMatrix: function (t, e) {
var i = this.projectionMatrix;
if (!i) return this;
(this.projectionWidth = t), (this.projectionHeight = e), i.ortho(0, t, e, 0, -1e3, 1e3);
for (var n = this.shaders, s = "uProjectionMatrix", r = 0; r < n.length; r++) {
var o = n[r];
o.hasUniform(s) && (o.resetUniform(s), o.setMatrix4fv(s, !1, i.val, o));
}
return this;
},
updateProjectionMatrix: function () {
var t, e;
this.projectionMatrix && ((t = this.renderer.projectionWidth), (e = this.renderer.projectionHeight), (this.projectionWidth === t && this.projectionHeight === e) || this.setProjectionMatrix(t, e));
},
bind: function (t) {
if ((void 0 === t && (t = this.currentShader), this.glReset)) return this.rebind(t);
var e = this.setVertexBuffer();
return t.bind(e), (this.currentShader = t), this.emit(v.BIND, this, t), this.onActive(t), this;
},
rebind: function (t) {
this.setVertexBuffer();
for (var e = this.shaders, i = e.length - 1; 0 <= i; i--) {
var n = e[i].rebind();
(t && n !== t) || (this.currentShader = n);
}
return this.emit(v.REBIND, this.currentShader), this.onActive(this.currentShader), this.onRebind(), (this.glReset = !1), this;
},
setVertexBuffer: function () {
var t = this.gl,
e = this.vertexBuffer;
return t.getParameter(t.ARRAY_BUFFER_BINDING) !== e && (t.bindBuffer(t.ARRAY_BUFFER, e), !0);
},
preBatch: function (t) {
return this.currentRenderTarget && this.currentRenderTarget.bind(), this.onPreBatch(t), this;
},
postBatch: function (t) {
return this.onDraw(this.currentRenderTarget), this.onPostBatch(t), this;
},
onDraw: function () {},
unbind: function () {
this.currentRenderTarget && this.currentRenderTarget.unbind();
},
flush: function (t) {
var e, i, n;
return (
void 0 === t && (t = !1),
0 < this.vertexCount &&
(this.emit(v.BEFORE_FLUSH, this, t),
this.onBeforeFlush(t),
(e = this.gl),
(i = this.vertexCount),
(n = this.currentShader.vertexSize),
this.active &&
(this.setVertexBuffer(),
i === this.vertexCapacity ? e.bufferData(e.ARRAY_BUFFER, this.vertexData, e.DYNAMIC_DRAW) : e.bufferSubData(e.ARRAY_BUFFER, 0, this.bytes.subarray(0, i * n)),
e.drawArrays(this.topology, 0, i)),
(this.vertexCount = 0),
this.emit(v.AFTER_FLUSH, this, t),
this.onAfterFlush(t)),
this
);
},
onActive: function () {},
onBind: function () {},
onRebind: function () {},
onBatch: function () {},
onPreBatch: function () {},
onPostBatch: function () {},
onPreRender: function () {},
onRender: function () {},
onPostRender: function () {},
onBeforeFlush: function () {},
onAfterFlush: function () {},
batchVert: function (t, e, i, n, s, r, o) {
var a = this.vertexViewF32,
h = this.vertexViewU32,
l = this.vertexCount * this.currentShader.vertexComponentCount - 1;
(a[++l] = t), (a[++l] = e), (a[++l] = i), (a[++l] = n), (a[++l] = s), (a[++l] = r), (h[++l] = o), this.vertexCount++;
},
batchQuad: function (t, e, i, n, s, r, o, a, h, l, u, c, d, f, p, g, v, y, m, x) {
void 0 === x && (x = this.currentUnit);
var b = !1;
return (
this.shouldFlush(6) && (this.flush(), (b = !0), (x = this.setTexture2D(m))),
this.batchVert(e, i, l, u, x, y, f),
this.batchVert(n, s, l, d, x, y, g),
this.batchVert(r, o, c, d, x, y, v),
this.batchVert(e, i, l, u, x, y, f),
this.batchVert(r, o, c, d, x, y, v),
this.batchVert(a, h, c, u, x, y, p),
this.onBatch(t),
b
);
},
batchTri: function (t, e, i, n, s, r, o, a, h, l, u, c, d, f, p, g, v) {
void 0 === v && (v = this.currentUnit);
var y = !1;
return (
this.shouldFlush(3) && (this.flush(), (y = !0), (v = this.setTexture2D(g))),
this.batchVert(e, i, a, h, v, p, c),
this.batchVert(n, s, a, u, v, p, d),
this.batchVert(r, o, l, u, v, p, f),
this.onBatch(t),
y
);
},
drawFillRect: function (t, e, i, n, s, r, o, a) {
void 0 === o && (o = this.renderer.whiteTexture.glTexture), void 0 === a && (a = !0), (t = Math.floor(t)), (e = Math.floor(e));
var h = Math.floor(t + i),
l = Math.floor(e + n),
u = this.setTexture2D(o),
c = T.getTintAppendFloatAlphaAndSwap(s, r),
d = 0,
f = 1;
a && ((d = 1), (f = 0)), this.batchQuad(null, t, e, t, l, h, l, h, e, 0, d, 1, f, c, c, c, c, 0, o, u);
},
setTexture2D: function (t) {
return void 0 === t && (t = this.renderer.whiteTexture.glTexture), (this.currentUnit = this.renderer.setTexture2D(t)), this.currentUnit;
},
bindTexture: function (t, e) {
void 0 === e && (e = 0);
var i = this.gl;
return i.activeTexture(i.TEXTURE0 + e), i.bindTexture(i.TEXTURE_2D, t), this;
},
bindRenderTarget: function (t, e) {
return this.bindTexture(t.texture, e);
},
setTime: function (t) {
return this.set1f(t, this.game.loop.getDuration()), this;
},
set1f: function (t, e, i) {
return void 0 === i && (i = this.currentShader), i.set1f(t, e), this;
},
set2f: function (t, e, i, n) {
return void 0 === n && (n = this.currentShader), n.set2f(t, e, i), this;
},
set3f: function (t, e, i, n, s) {
return void 0 === s && (s = this.currentShader), s.set3f(t, e, i, n), this;
},
set4f: function (t, e, i, n, s, r) {
return void 0 === r && (r = this.currentShader), r.set4f(t, e, i, n, s), this;
},
set1fv: function (t, e, i) {
return void 0 === i && (i = this.currentShader), i.set1fv(t, e), this;
},
set2fv: function (t, e, i) {
return void 0 === i && (i = this.currentShader), i.set2fv(t, e), this;
},
set3fv: function (t, e, i) {
return void 0 === i && (i = this.currentShader), i.set3fv(t, e), this;
},
set4fv: function (t, e, i) {
return void 0 === i && (i = this.currentShader), i.set4fv(t, e), this;
},
set1iv: function (t, e, i) {
return void 0 === i && (i = this.currentShader), i.set1iv(t, e), this;
},
set2iv: function (t, e, i) {
return void 0 === i && (i = this.currentShader), i.set2iv(t, e), this;
},
set3iv: function (t, e, i) {
return void 0 === i && (i = this.currentShader), i.set3iv(t, e), this;
},
set4iv: function (t, e, i) {
return void 0 === i && (i = this.currentShader), i.set4iv(t, e), this;
},
set1i: function (t, e, i) {
return void 0 === i && (i = this.currentShader), i.set1i(t, e), this;
},
set2i: function (t, e, i, n) {
return void 0 === n && (n = this.currentShader), n.set2i(t, e, i), this;
},
set3i: function (t, e, i, n, s) {
return void 0 === s && (s = this.currentShader), s.set3i(t, e, i, n), this;
},
set4i: function (t, e, i, n, s, r) {
return void 0 === r && (r = this.currentShader), r.set4i(t, e, i, n, s), this;
},
setMatrix2fv: function (t, e, i, n) {
return void 0 === n && (n = this.currentShader), n.setMatrix2fv(t, e, i), this;
},
setMatrix3fv: function (t, e, i, n) {
return void 0 === n && (n = this.currentShader), n.setMatrix3fv(t, e, i), this;
},
setMatrix4fv: function (t, e, i, n) {
return void 0 === n && (n = this.currentShader), n.setMatrix4fv(t, e, i), this;
},
destroy: function () {
this.emit(v.DESTROY, this);
for (var t = this.shaders, e = 0; e < t.length; e++) t[e].destroy();
var i = this.renderTargets;
for (e = 0; e < i.length; e++) i[e].destroy();
this.gl.deleteBuffer(this.vertexBuffer);
var n = this.renderer;
return (
n.off(b.RESIZE, this.resize, this),
n.off(b.PRE_RENDER, this.onPreRender, this),
n.off(b.RENDER, this.onRender, this),
n.off(b.POST_RENDER, this.onPostRender, this),
this.removeAllListeners(),
(this.game = null),
(this.renderer = null),
(this.manager = null),
(this.gl = null),
(this.view = null),
(this.shaders = null),
(this.renderTargets = null),
(this.bytes = null),
(this.vertexViewF32 = null),
(this.vertexViewU32 = null),
(this.vertexData = null),
(this.vertexBuffer = null),
(this.currentShader = null),
(this.currentRenderTarget = null),
this
);
},
});
t.exports = r;
},
function (t, e, i) {
"use strict";
function n(t, e, i) {
i = i || 2;
var n,
s,
r,
o,
a,
h,
l,
u = e && e.length,
c = u ? e[0] * i : t.length,
d = g(t, 0, c, i, !0),
f = [];
if (!d || d.next === d.prev) return f;
if (
(u &&
(d = (function (t, e, i, n) {
var s,
r,
o,
a,
h,
l,
u = [];
for (s = 0, r = e.length; s < r; s++)
(o = g(t, e[s] * n, s < r - 1 ? e[s + 1] * n : t.length, n, !1)) === o.next && (o.steiner = !0),
u.push(
(function (t) {
for (var e = t, i = t; (e.x < i.x || (e.x === i.x && e.y < i.y)) && (i = e), (e = e.next) !== t; );
return i;
})(o)
);
for (u.sort(y), s = 0; s < u.length; s++)
(a = u[s]),
(l = void 0),
(h = (function (t, e) {
var i,
n = e,
s = t.x,
r = t.y,
o = -1 / 0;
do {
if (r <= n.y && r >= n.next.y && n.next.y !== n.y) {
var a = n.x + ((r - n.y) * (n.next.x - n.x)) / (n.next.y - n.y);
if (a <= s && o < a) {
if ((o = a) === s) {
if (r === n.y) return n;
if (r === n.next.y) return n.next;
}
i = n.x < n.next.x ? n : n.next;
}
}
n = n.next;
} while (n !== e);
if (!i) return null;
if (s === o) return i;
var h,
l,
u,
c = i,
d = i.x,
f = i.y,
p = 1 / 0;
for (
n = i;
s >= n.x &&
n.x >= d &&
s !== n.x &&
x(r < f ? s : o, r, d, f, r < f ? o : s, r, n.x, n.y) &&
((h = Math.abs(r - n.y) / (s - n.x)),
S(n, t) && (h < p || (h === p && (n.x > i.x || (n.x === i.x && ((u = n), b((l = i).prev, l, u.prev) < 0 && b(u.next, l, l.next) < 0))))) && ((i = n), (p = h))),
(n = n.next) !== c;
);
return i;
})(a, (h = i))) && ((l = _(h, a)), v(h, h.next), v(l, l.next)),
(i = v(i, i.next));
return i;
})(t, e, d, i)),
t.length > 80 * i)
) {
(n = r = t[0]), (s = o = t[1]);
for (var p = i; p < c; p += i) (a = t[p]) < n && (n = a), (h = t[p + 1]) < s && (s = h), r < a && (r = a), o < h && (o = h);
l = 0 !== (l = Math.max(r - n, o - s)) ? 1 / l : 0;
}
return (
(function c(t, e, i, n, s, r, o) {
if (t) {
!o &&
r &&
(function (t, e, i, n) {
for (var s = t; null === s.z && (s.z = m(s.x, s.y, e, i, n)), (s.prevZ = s.prev), (s.nextZ = s.next), (s = s.next) !== t; );
(s.prevZ.nextZ = null),
(s.prevZ = null),
(function (t) {
var e,
i,
n,
s,
r,
o,
a,
h,
l = 1;
do {
for (i = t, r = t = null, o = 0; i; ) {
for (o++, n = i, e = a = 0; e < l && (a++, (n = n.nextZ)); e++);
for (h = l; 0 < a || (0 < h && n); )
0 !== a && (0 === h || !n || i.z <= n.z) ? ((i = (s = i).nextZ), a--) : ((n = (s = n).nextZ), h--), r ? (r.nextZ = s) : (t = s), (s.prevZ = r), (r = s);
i = n;
}
(r.nextZ = null), (l *= 2);
} while (1 < o);
})(s);
})(t, n, s, r);
for (var a, h, l = t; t.prev !== t.next; )
if (
((a = t.prev),
(h = t.next),
r
? (function (t, e, i, n) {
var s = t.prev,
r = t,
o = t.next;
if (0 <= b(s, r, o)) return !1;
for (
var a = s.x < r.x ? (s.x < o.x ? s.x : o.x) : r.x < o.x ? r.x : o.x,
h = s.y < r.y ? (s.y < o.y ? s.y : o.y) : r.y < o.y ? r.y : o.y,
l = s.x > r.x ? (s.x > o.x ? s.x : o.x) : r.x > o.x ? r.x : o.x,
u = s.y > r.y ? (s.y > o.y ? s.y : o.y) : r.y > o.y ? r.y : o.y,
c = m(a, h, e, i, n),
d = m(l, u, e, i, n),
f = t.prevZ,
p = t.nextZ;
f && f.z >= c && p && p.z <= d;
) {
if (f !== t.prev && f !== t.next && x(s.x, s.y, r.x, r.y, o.x, o.y, f.x, f.y) && 0 <= b(f.prev, f, f.next)) return !1;
if (((f = f.prevZ), p !== t.prev && p !== t.next && x(s.x, s.y, r.x, r.y, o.x, o.y, p.x, p.y) && 0 <= b(p.prev, p, p.next))) return !1;
p = p.nextZ;
}
for (; f && f.z >= c; ) {
if (f !== t.prev && f !== t.next && x(s.x, s.y, r.x, r.y, o.x, o.y, f.x, f.y) && 0 <= b(f.prev, f, f.next)) return !1;
f = f.prevZ;
}
for (; p && p.z <= d; ) {
if (p !== t.prev && p !== t.next && x(s.x, s.y, r.x, r.y, o.x, o.y, p.x, p.y) && 0 <= b(p.prev, p, p.next)) return !1;
p = p.nextZ;
}
return !0;
})(t, n, s, r)
: (function (t) {
var e = t.prev,
i = t,
n = t.next;
if (0 <= b(e, i, n)) return !1;
for (var s = t.next.next; s !== t.prev; ) {
if (x(e.x, e.y, i.x, i.y, n.x, n.y, s.x, s.y) && 0 <= b(s.prev, s, s.next)) return !1;
s = s.next;
}
return !0;
})(t))
)
e.push(a.i / i), e.push(t.i / i), e.push(h.i / i), E(t), (t = h.next), (l = h.next);
else if ((t = h) === l) {
o
? 1 === o
? c(
(t = (function (t, e, i) {
var n = t;
do {
var s = n.prev,
r = n.next.next;
!w(s, r) && T(s, n, n.next, r) && S(s, r) && S(r, s) && (e.push(s.i / i), e.push(n.i / i), e.push(r.i / i), E(n), E(n.next), (n = t = r)), (n = n.next);
} while (n !== t);
return v(n);
})(v(t), e, i)),
e,
i,
n,
s,
r,
2
)
: 2 === o &&
(function (t, e, i, n, s, r) {
var o,
a,
h = t;
do {
for (var l = h.next.next; l !== h.prev; ) {
if (
h.i !== l.i &&
((a = l),
(o = h).next.i !== a.i &&
o.prev.i !== a.i &&
!(function (t, e) {
var i = t;
do {
if (i.i !== t.i && i.next.i !== t.i && i.i !== e.i && i.next.i !== e.i && T(i, i.next, t, e)) return !0;
i = i.next;
} while (i !== t);
return !1;
})(o, a) &&
((S(o, a) &&
S(a, o) &&
(function (t, e) {
for (
var i = t, n = !1, s = (t.x + e.x) / 2, r = (t.y + e.y) / 2;
i.y > r != i.next.y > r && i.next.y !== i.y && s < ((i.next.x - i.x) * (r - i.y)) / (i.next.y - i.y) + i.x && (n = !n), (i = i.next) !== t;
);
return n;
})(o, a) &&
(b(o.prev, o, a.prev) || b(o, a.prev, a))) ||
(w(o, a) && 0 < b(o.prev, o, o.next) && 0 < b(a.prev, a, a.next))))
) {
var u = _(h, l);
return (h = v(h, h.next)), (u = v(u, u.next)), c(h, e, i, n, s, r), c(u, e, i, n, s, r);
}
l = l.next;
}
h = h.next;
} while (h !== t);
})(t, e, i, n, s, r)
: c(v(t), e, i, n, s, r, 1);
break;
}
}
})(d, f, i, n, s, l),
f
);
}
function g(t, e, i, n, s) {
var r, o;
if (s === 0 < P(t, e, i, n)) for (r = e; r < i; r += n) o = a(r, t[r], t[r + 1], o);
else for (r = i - n; e <= r; r -= n) o = a(r, t[r], t[r + 1], o);
return o && w(o, o.next) && (E(o), (o = o.next)), o;
}
function v(t, e) {
if (!t) return t;
e = e || t;
var i,
n = t;
do {
if (((i = !1), n.steiner || (!w(n, n.next) && 0 !== b(n.prev, n, n.next)))) n = n.next;
else {
if ((E(n), (n = e = n.prev) === n.next)) break;
i = !0;
}
} while (i || n !== e);
return e;
}
function y(t, e) {
return t.x - e.x;
}
function m(t, e, i, n, s) {
return (
(t = 1431655765 & ((t = 858993459 & ((t = 252645135 & ((t = 16711935 & ((t = 32767 * (t - i) * s) | (t << 8))) | (t << 4))) | (t << 2))) | (t << 1))) |
((e = 1431655765 & ((e = 858993459 & ((e = 252645135 & ((e = 16711935 & ((e = 32767 * (e - n) * s) | (e << 8))) | (e << 4))) | (e << 2))) | (e << 1))) << 1)
);
}
function x(t, e, i, n, s, r, o, a) {
return 0 <= (s - o) * (e - a) - (t - o) * (r - a) && 0 <= (t - o) * (n - a) - (i - o) * (e - a) && 0 <= (i - o) * (r - a) - (s - o) * (n - a);
}
function b(t, e, i) {
return (e.y - t.y) * (i.x - e.x) - (e.x - t.x) * (i.y - e.y);
}
function w(t, e) {
return t.x === e.x && t.y === e.y;
}
function T(t, e, i, n) {
var s = l(b(t, e, i)),
r = l(b(t, e, n)),
o = l(b(i, n, t)),
a = l(b(i, n, e));
return (s !== r && o !== a) || (0 === s && h(t, i, e)) || (0 === r && h(t, n, e)) || (0 === o && h(i, t, n)) || !(0 !== a || !h(i, e, n));
}
function h(t, e, i) {
return e.x <= Math.max(t.x, i.x) && e.x >= Math.min(t.x, i.x) && e.y <= Math.max(t.y, i.y) && e.y >= Math.min(t.y, i.y);
}
function l(t) {
return 0 < t ? 1 : t < 0 ? -1 : 0;
}
function S(t, e) {
return b(t.prev, t, t.next) < 0 ? 0 <= b(t, e, t.next) && 0 <= b(t, t.prev, e) : b(t, e, t.prev) < 0 || b(t, t.next, e) < 0;
}
function _(t, e) {
var i = new o(t.i, t.x, t.y),
n = new o(e.i, e.x, e.y),
s = t.next,
r = e.prev;
return ((t.next = e).prev = t), ((i.next = s).prev = i), ((n.next = i).prev = n), ((r.next = n).prev = r), n;
}
function a(t, e, i, n) {
var s = new o(t, e, i);
return n ? ((s.next = n.next), ((s.prev = n).next.prev = s), (n.next = s)) : ((s.prev = s).next = s), s;
}
function E(t) {
(t.next.prev = t.prev), (t.prev.next = t.next), t.prevZ && (t.prevZ.nextZ = t.nextZ), t.nextZ && (t.nextZ.prevZ = t.prevZ);
}
function o(t, e, i) {
(this.i = t), (this.x = e), (this.y = i), (this.prev = null), (this.next = null), (this.z = null), (this.prevZ = null), (this.nextZ = null), (this.steiner = !1);
}
function P(t, e, i, n) {
for (var s = 0, r = e, o = i - n; r < i; r += n) (s += (t[o] - t[r]) * (t[r + 1] + t[o + 1])), (o = r);
return s;
}
(n.deviation = function (t, e, i, n) {
var s = e && e.length,
r = s ? e[0] * i : t.length,
o = Math.abs(P(t, 0, r, i));
if (s)
for (var a = 0, h = e.length; a < h; a++) {
var l = e[a] * i,
u = a < h - 1 ? e[a + 1] * i : t.length;
o -= Math.abs(P(t, l, u, i));
}
var c = 0;
for (a = 0; a < n.length; a += 3) {
var d = n[a] * i,
f = n[a + 1] * i,
p = n[a + 2] * i;
c += Math.abs((t[d] - t[p]) * (t[1 + f] - t[1 + d]) - (t[d] - t[f]) * (t[1 + p] - t[1 + d]));
}
return 0 === o && 0 === c ? 0 : Math.abs((c - o) / o);
}),
(n.flatten = function (t) {
for (var e = t[0][0].length, i = { vertices: [], holes: [], dimensions: e }, n = 0, s = 0; s < t.length; s++) {
for (var r = 0; r < t[s].length; r++) for (var o = 0; o < e; o++) i.vertices.push(t[s][r][o]);
0 < s && ((n += t[s - 1].length), i.holes.push(n));
}
return i;
}),
(t.exports = n);
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = i || e.strokeColor,
r = n || e.strokeAlpha,
o = (16711680 & s) >>> 16,
a = (65280 & s) >>> 8,
h = 255 & s;
(t.strokeStyle = "rgba(" + o + "," + a + "," + h + "," + r + ")"), (t.lineWidth = e.lineWidth);
};
},
function (t, e, i) {
var n = i(0),
h = i(21),
l = i(23),
s = i(8),
u = i(2),
c = i(6),
d = i(7),
r = new n({
Extends: l,
initialize: function (t, e, i, n, s) {
var r,
o = "json";
d(e) && ((e = u((r = e), "key")), (i = u(r, "url")), (n = u(r, "xhrSettings")), (o = u(r, "extension", o)), (s = u(r, "dataKey", s)));
var a = { type: "json", cache: t.cacheManager.json, extension: o, responseType: "text", key: e, url: i, xhrSettings: n, config: s };
l.call(this, t, a), d(i) && ((this.data = s ? c(i, s) : i), (this.state = h.FILE_POPULATED));
},
onProcess: function () {
if (this.state !== h.FILE_POPULATED) {
this.state = h.FILE_PROCESSING;
try {
var t = JSON.parse(this.xhrLoader.responseText);
} catch (t) {
throw (this.onProcessError(), t);
}
var e = this.config;
this.data = "string" == typeof e ? c(t, e, t) : t;
}
this.onProcessComplete();
},
});
s.register("json", function (t, e, i, n) {
if (Array.isArray(t)) for (var s = 0; s < t.length; s++) this.addFile(new r(this, t[s]));
else this.addFile(new r(this, t, e, n, i));
return this;
}),
(t.exports = r);
},
function (t, e) {
t.exports = { DYNAMIC_BODY: 0, STATIC_BODY: 1, GROUP: 2, TILEMAPLAYER: 3, FACING_NONE: 10, FACING_UP: 11, FACING_DOWN: 12, FACING_LEFT: 13, FACING_RIGHT: 14 };
},
function (t, e, i) {
var d = i(158),
f = i(26);
t.exports = function (t, e, i, n, s) {
for (var r, o, a, h, l = f(t, e, i, n, null, s), u = 0; u < l.length; u++) {
var c = l[u];
c &&
(c.collides
? ((r = d(c.x, c.y - 1, !0, s)),
(o = d(c.x, c.y + 1, !0, s)),
(a = d(c.x - 1, c.y, !0, s)),
(h = d(c.x + 1, c.y, !0, s)),
(c.faceTop = !r || !r.collides),
(c.faceBottom = !o || !o.collides),
(c.faceLeft = !a || !a.collides),
(c.faceRight = !h || !h.collides))
: c.resetFaces());
}
};
},
function (t, e, i) {
var a = {};
t.exports = a;
var b = i(83),
w = i(32);
(a.create = function (t, e) {
for (var i = [], n = 0; n < t.length; n++) {
var s = t[n],
r = { x: s.x, y: s.y, index: n, body: e, isInternal: !1, contact: null, offset: null };
(r.contact = { vertex: r, normalImpulse: 0, tangentImpulse: 0 }), i.push(r);
}
return i;
}),
(a.fromPath = function (t, e) {
var n = [];
return (
t.replace(/L?\s*([-\d.e]+)[\s,]*([-\d.e]+)*/gi, function (t, e, i) {
n.push({ x: parseFloat(e), y: parseFloat(i) });
}),
a.create(n, e)
);
}),
(a.centre = function (t) {
for (var e, i, n, s = a.area(t, !0), r = { x: 0, y: 0 }, o = 0; o < t.length; o++) (n = (o + 1) % t.length), (e = b.cross(t[o], t[n])), (i = b.mult(b.add(t[o], t[n]), e)), (r = b.add(r, i));
return b.div(r, 6 * s);
}),
(a.mean = function (t) {
for (var e = { x: 0, y: 0 }, i = 0; i < t.length; i++) (e.x += t[i].x), (e.y += t[i].y);
return b.div(e, t.length);
}),
(a.area = function (t, e) {
for (var i = 0, n = t.length - 1, s = 0; s < t.length; s++) (i += (t[n].x - t[s].x) * (t[n].y + t[s].y)), (n = s);
return e ? i / 2 : Math.abs(i) / 2;
}),
(a.inertia = function (t, e) {
for (var i, n, s = 0, r = 0, o = t, a = 0; a < o.length; a++) (n = (a + 1) % o.length), (s += (i = Math.abs(b.cross(o[n], o[a]))) * (b.dot(o[n], o[n]) + b.dot(o[n], o[a]) + b.dot(o[a], o[a]))), (r += i);
return (e / 6) * (s / r);
}),
(a.translate = function (t, e, i) {
var n;
if (i) for (n = 0; n < t.length; n++) (t[n].x += e.x * i), (t[n].y += e.y * i);
else for (n = 0; n < t.length; n++) (t[n].x += e.x), (t[n].y += e.y);
return t;
}),
(a.rotate = function (t, e, i) {
if (0 !== e) {
for (var n = Math.cos(e), s = Math.sin(e), r = 0; r < t.length; r++) {
var o = t[r],
a = o.x - i.x,
h = o.y - i.y;
(o.x = i.x + (a * n - h * s)), (o.y = i.y + (a * s + h * n));
}
return t;
}
}),
(a.contains = function (t, e) {
for (var i = 0; i < t.length; i++) {
var n = t[i],
s = t[(i + 1) % t.length];
if (0 < (e.x - n.x) * (s.y - n.y) + (e.y - n.y) * (n.x - s.x)) return !1;
}
return !0;
}),
(a.scale = function (t, e, i, n) {
if (1 === e && 1 === i) return t;
var s, r;
n = n || a.centre(t);
for (var o = 0; o < t.length; o++) (s = t[o]), (r = b.sub(s, n)), (t[o].x = n.x + r.x * e), (t[o].y = n.y + r.y * i);
return t;
}),
(a.chamfer = function (t, e, i, n, s) {
(e = "number" == typeof e ? [e] : e || [8]), (i = void 0 !== i ? i : -1), (n = n || 2), (s = s || 14);
for (var r = [], o = 0; o < t.length; o++) {
var a = t[0 <= o - 1 ? o - 1 : t.length - 1],
h = t[o],
l = t[(o + 1) % t.length],
u = e[o < e.length ? o : e.length - 1];
if (0 !== u) {
var c = b.normalise({ x: h.y - a.y, y: a.x - h.x }),
d = b.normalise({ x: l.y - h.y, y: h.x - l.x }),
f = Math.sqrt(2 * Math.pow(u, 2)),
p = b.mult(w.clone(c), u),
g = b.normalise(b.mult(b.add(c, d), 0.5)),
v = b.sub(h, b.mult(g, f)),
y = i;
-1 === i && (y = 1.75 * Math.pow(u, 0.32)), (y = w.clamp(y, n, s)) % 2 == 1 && (y += 1);
for (var m = Math.acos(b.dot(c, d)) / y, x = 0; x < y; x++) r.push(b.add(b.rotate(p, m * x), v));
} else r.push(h);
}
return r;
}),
(a.clockwiseSort = function (t) {
var i = a.mean(t);
return (
t.sort(function (t, e) {
return b.angle(i, t) - b.angle(i, e);
}),
t
);
}),
(a.isConvex = function (t) {
var e,
i,
n,
s,
r = 0,
o = t.length;
if (o < 3) return null;
for (e = 0; e < o; e++)
if (((n = (e + 2) % o), (s = (t[(i = (e + 1) % o)].x - t[e].x) * (t[n].y - t[i].y)), (s -= (t[i].y - t[e].y) * (t[n].x - t[i].x)) < 0 ? (r |= 1) : 0 < s && (r |= 2), 3 === r)) return !1;
return 0 !== r || null;
}),
(a.hull = function (t) {
var e,
i,
n = [],
s = [];
for (
(t = t.slice(0)).sort(function (t, e) {
var i = t.x - e.x;
return 0 != i ? i : t.y - e.y;
}),
i = 0;
i < t.length;
i += 1
) {
for (e = t[i]; 2 <= s.length && b.cross3(s[s.length - 2], s[s.length - 1], e) <= 0; ) s.pop();
s.push(e);
}
for (i = t.length - 1; 0 <= i; --i) {
for (e = t[i]; 2 <= n.length && b.cross3(n[n.length - 2], n[n.length - 1], e) <= 0; ) n.pop();
n.push(e);
}
return n.pop(), s.pop(), n.concat(s);
});
},
function (t, e, i) {
var n = i(0),
s = i(66),
r = i(300),
o = i(301),
a = i(56),
h = i(170),
l = new n({
initialize: function (t, e, i) {
void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 0), (this.type = a.CIRCLE), (this.x = t), (this.y = e), (this._radius = i), (this._diameter = 2 * i);
},
contains: function (t, e) {
return s(this, t, e);
},
getPoint: function (t, e) {
return r(this, t, e);
},
getPoints: function (t, e, i) {
return o(this, t, e, i);
},
getRandomPoint: function (t) {
return h(this, t);
},
setTo: function (t, e, i) {
return (this.x = t), (this.y = e), (this._radius = i), (this._diameter = 2 * i), this;
},
setEmpty: function () {
return (this._radius = 0), (this._diameter = 0), this;
},
setPosition: function (t, e) {
return void 0 === e && (e = t), (this.x = t), (this.y = e), this;
},
isEmpty: function () {
return this._radius <= 0;
},
radius: {
get: function () {
return this._radius;
},
set: function (t) {
(this._radius = t), (this._diameter = 2 * t);
},
},
diameter: {
get: function () {
return this._diameter;
},
set: function (t) {
(this._diameter = t), (this._radius = 0.5 * t);
},
},
left: {
get: function () {
return this.x - this._radius;
},
set: function (t) {
this.x = t + this._radius;
},
},
right: {
get: function () {
return this.x + this._radius;
},
set: function (t) {
this.x = t - this._radius;
},
},
top: {
get: function () {
return this.y - this._radius;
},
set: function (t) {
this.y = t + this._radius;
},
},
bottom: {
get: function () {
return this.y + this._radius;
},
set: function (t) {
this.y = t - this._radius;
},
},
});
t.exports = l;
},
function (t, e) {
t.exports = function (t, e, i) {
return 0 < t.radius && e >= t.left && e <= t.right && i >= t.top && i <= t.bottom && (t.x - e) * (t.x - e) + (t.y - i) * (t.y - i) <= t.radius * t.radius;
};
},
function (t, e) {
t.exports = function (t) {
return Math.sqrt((t.x2 - t.x1) * (t.x2 - t.x1) + (t.y2 - t.y1) * (t.y2 - t.y1));
};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = i - e;
return e + ((((t - e) % n) + n) % n);
};
},
function (t, e, i) {
var n = i(0),
s = i(39),
r = new n({
initialize: function (t) {
(this.val = new Float32Array(16)), t ? this.copy(t) : this.identity();
},
clone: function () {
return new r(this);
},
set: function (t) {
return this.copy(t);
},
setValues: function (t, e, i, n, s, r, o, a, h, l, u, c, d, f, p, g) {
var v = this.val;
return (
(v[0] = t),
(v[1] = e),
(v[2] = i),
(v[3] = n),
(v[4] = s),
(v[5] = r),
(v[6] = o),
(v[7] = a),
(v[8] = h),
(v[9] = l),
(v[10] = u),
(v[11] = c),
(v[12] = d),
(v[13] = f),
(v[14] = p),
(v[15] = g),
this
);
},
copy: function (t) {
var e = t.val;
return this.setValues(e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8], e[9], e[10], e[11], e[12], e[13], e[14], e[15]);
},
fromArray: function (t) {
return this.setValues(t[0], t[1], t[2], t[3], t[4], t[5], t[6], t[7], t[8], t[9], t[10], t[11], t[12], t[13], t[14], t[15]);
},
zero: function () {
return this.setValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
},
transform: function (t, e, i) {
var n = h.fromQuat(i).val,
s = e.x,
r = e.y,
o = e.z;
return this.setValues(n[0] * s, n[1] * s, n[2] * s, 0, n[4] * r, n[5] * r, n[6] * r, 0, n[8] * o, n[9] * o, n[10] * o, 0, t.x, t.y, t.z, 1);
},
xyz: function (t, e, i) {
this.identity();
var n = this.val;
return (n[12] = t), (n[13] = e), (n[14] = i), this;
},
scaling: function (t, e, i) {
this.zero();
var n = this.val;
return (n[0] = t), (n[5] = e), (n[10] = i), (n[15] = 1), this;
},
identity: function () {
return this.setValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
},
transpose: function () {
var t = this.val,
e = t[1],
i = t[2],
n = t[3],
s = t[6],
r = t[7],
o = t[11];
return (t[1] = t[4]), (t[2] = t[8]), (t[3] = t[12]), (t[4] = e), (t[6] = t[9]), (t[7] = t[13]), (t[8] = i), (t[9] = s), (t[11] = t[14]), (t[12] = n), (t[13] = r), (t[14] = o), this;
},
getInverse: function (t) {
return this.copy(t), this.invert();
},
invert: function () {
var t = this.val,
e = t[0],
i = t[1],
n = t[2],
s = t[3],
r = t[4],
o = t[5],
a = t[6],
h = t[7],
l = t[8],
u = t[9],
c = t[10],
d = t[11],
f = t[12],
p = t[13],
g = t[14],
v = t[15],
y = e * o - i * r,
m = e * a - n * r,
x = e * h - s * r,
b = i * a - n * o,
w = i * h - s * o,
T = n * h - s * a,
S = l * p - u * f,
_ = l * g - c * f,
E = l * v - d * f,
P = u * g - c * p,
A = u * v - d * p,
M = c * v - d * g,
C = y * M - m * A + x * P + b * E - w * _ + T * S;
return C
? ((C = 1 / C),
this.setValues(
(o * M - a * A + h * P) * C,
(n * A - i * M - s * P) * C,
(p * T - g * w + v * b) * C,
(c * w - u * T - d * b) * C,
(a * E - r * M - h * _) * C,
(e * M - n * E + s * _) * C,
(g * x - f * T - v * m) * C,
(l * T - c * x + d * m) * C,
(r * A - o * E + h * S) * C,
(i * E - e * A - s * S) * C,
(f * w - p * x + v * y) * C,
(u * x - l * w - d * y) * C,
(o * _ - r * P - a * S) * C,
(e * P - i * _ + n * S) * C,
(p * m - f * b - g * y) * C,
(l * b - u * m + c * y) * C
))
: this;
},
adjoint: function () {
var t = this.val,
e = t[0],
i = t[1],
n = t[2],
s = t[3],
r = t[4],
o = t[5],
a = t[6],
h = t[7],
l = t[8],
u = t[9],
c = t[10],
d = t[11],
f = t[12],
p = t[13],
g = t[14],
v = t[15];
return this.setValues(
o * (c * v - d * g) - u * (a * v - h * g) + p * (a * d - h * c),
-(i * (c * v - d * g) - u * (n * v - s * g) + p * (n * d - s * c)),
i * (a * v - h * g) - o * (n * v - s * g) + p * (n * h - s * a),
-(i * (a * d - h * c) - o * (n * d - s * c) + u * (n * h - s * a)),
-(r * (c * v - d * g) - l * (a * v - h * g) + f * (a * d - h * c)),
e * (c * v - d * g) - l * (n * v - s * g) + f * (n * d - s * c),
-(e * (a * v - h * g) - r * (n * v - s * g) + f * (n * h - s * a)),
e * (a * d - h * c) - r * (n * d - s * c) + l * (n * h - s * a),
r * (u * v - d * p) - l * (o * v - h * p) + f * (o * d - h * u),
-(e * (u * v - d * p) - l * (i * v - s * p) + f * (i * d - s * u)),
e * (o * v - h * p) - r * (i * v - s * p) + f * (i * h - s * o),
-(e * (o * d - h * u) - r * (i * d - s * u) + l * (i * h - s * o)),
-(r * (u * g - c * p) - l * (o * g - a * p) + f * (o * c - a * u)),
e * (u * g - c * p) - l * (i * g - n * p) + f * (i * c - n * u),
-(e * (o * g - a * p) - r * (i * g - n * p) + f * (i * a - n * o)),
e * (o * c - a * u) - r * (i * c - n * u) + l * (i * a - n * o)
);
},
determinant: function () {
var t = this.val,
e = t[0],
i = t[1],
n = t[2],
s = t[3],
r = t[4],
o = t[5],
a = t[6],
h = t[7],
l = t[8],
u = t[9],
c = t[10],
d = t[11],
f = t[12],
p = t[13],
g = t[14],
v = t[15];
return (
(e * o - i * r) * (c * v - d * g) -
(e * a - n * r) * (u * v - d * p) +
(e * h - s * r) * (u * g - c * p) +
(i * a - n * o) * (l * v - d * f) -
(i * h - s * o) * (l * g - c * f) +
(n * h - s * a) * (l * p - u * f)
);
},
multiply: function (t) {
var e = this.val,
i = e[0],
n = e[1],
s = e[2],
r = e[3],
o = e[4],
a = e[5],
h = e[6],
l = e[7],
u = e[8],
c = e[9],
d = e[10],
f = e[11],
p = e[12],
g = e[13],
v = e[14],
y = e[15],
m = t.val,
x = m[0],
b = m[1],
w = m[2],
T = m[3];
return (
(e[0] = x * i + b * o + w * u + T * p),
(e[1] = x * n + b * a + w * c + T * g),
(e[2] = x * s + b * h + w * d + T * v),
(e[3] = x * r + b * l + w * f + T * y),
(x = m[4]),
(b = m[5]),
(w = m[6]),
(T = m[7]),
(e[4] = x * i + b * o + w * u + T * p),
(e[5] = x * n + b * a + w * c + T * g),
(e[6] = x * s + b * h + w * d + T * v),
(e[7] = x * r + b * l + w * f + T * y),
(x = m[8]),
(b = m[9]),
(w = m[10]),
(T = m[11]),
(e[8] = x * i + b * o + w * u + T * p),
(e[9] = x * n + b * a + w * c + T * g),
(e[10] = x * s + b * h + w * d + T * v),
(e[11] = x * r + b * l + w * f + T * y),
(x = m[12]),
(b = m[13]),
(w = m[14]),
(T = m[15]),
(e[12] = x * i + b * o + w * u + T * p),
(e[13] = x * n + b * a + w * c + T * g),
(e[14] = x * s + b * h + w * d + T * v),
(e[15] = x * r + b * l + w * f + T * y),
this
);
},
multiplyLocal: function (t) {
var e = this.val,
i = t.val;
return this.setValues(
e[0] * i[0] + e[1] * i[4] + e[2] * i[8] + e[3] * i[12],
e[0] * i[1] + e[1] * i[5] + e[2] * i[9] + e[3] * i[13],
e[0] * i[2] + e[1] * i[6] + e[2] * i[10] + e[3] * i[14],
e[0] * i[3] + e[1] * i[7] + e[2] * i[11] + e[3] * i[15],
e[4] * i[0] + e[5] * i[4] + e[6] * i[8] + e[7] * i[12],
e[4] * i[1] + e[5] * i[5] + e[6] * i[9] + e[7] * i[13],
e[4] * i[2] + e[5] * i[6] + e[6] * i[10] + e[7] * i[14],
e[4] * i[3] + e[5] * i[7] + e[6] * i[11] + e[7] * i[15],
e[8] * i[0] + e[9] * i[4] + e[10] * i[8] + e[11] * i[12],
e[8] * i[1] + e[9] * i[5] + e[10] * i[9] + e[11] * i[13],
e[8] * i[2] + e[9] * i[6] + e[10] * i[10] + e[11] * i[14],
e[8] * i[3] + e[9] * i[7] + e[10] * i[11] + e[11] * i[15],
e[12] * i[0] + e[13] * i[4] + e[14] * i[8] + e[15] * i[12],
e[12] * i[1] + e[13] * i[5] + e[14] * i[9] + e[15] * i[13],
e[12] * i[2] + e[13] * i[6] + e[14] * i[10] + e[15] * i[14],
e[12] * i[3] + e[13] * i[7] + e[14] * i[11] + e[15] * i[15]
);
},
premultiply: function (t) {
return this.multiplyMatrices(t, this);
},
multiplyMatrices: function (t, e) {
var i = t.val,
n = e.val,
s = i[0],
r = i[4],
o = i[8],
a = i[12],
h = i[1],
l = i[5],
u = i[9],
c = i[13],
d = i[2],
f = i[6],
p = i[10],
g = i[14],
v = i[3],
y = i[7],
m = i[11],
x = i[15],
b = n[0],
w = n[4],
T = n[8],
S = n[12],
_ = n[1],
E = n[5],
P = n[9],
A = n[13],
M = n[2],
C = n[6],
O = n[10],
k = n[14],
R = n[3],
L = n[7],
I = n[11],
D = n[15];
return this.setValues(
s * b + r * _ + o * M + a * R,
h * b + l * _ + u * M + c * R,
d * b + f * _ + p * M + g * R,
v * b + y * _ + m * M + x * R,
s * w + r * E + o * C + a * L,
h * w + l * E + u * C + c * L,
d * w + f * E + p * C + g * L,
v * w + y * E + m * C + x * L,
s * T + r * P + o * O + a * I,
h * T + l * P + u * O + c * I,
d * T + f * P + p * O + g * I,
v * T + y * P + m * O + x * I,
s * S + r * A + o * k + a * D,
h * S + l * A + u * k + c * D,
d * S + f * A + p * k + g * D,
v * S + y * A + m * k + x * D
);
},
translate: function (t) {
return this.translateXYZ(t.x, t.y, t.z);
},
translateXYZ: function (t, e, i) {
var n = this.val;
return (
(n[12] = n[0] * t + n[4] * e + n[8] * i + n[12]),
(n[13] = n[1] * t + n[5] * e + n[9] * i + n[13]),
(n[14] = n[2] * t + n[6] * e + n[10] * i + n[14]),
(n[15] = n[3] * t + n[7] * e + n[11] * i + n[15]),
this
);
},
scale: function (t) {
return this.scaleXYZ(t.x, t.y, t.z);
},
scaleXYZ: function (t, e, i) {
var n = this.val;
return (
(n[0] = n[0] * t),
(n[1] = n[1] * t),
(n[2] = n[2] * t),
(n[3] = n[3] * t),
(n[4] = n[4] * e),
(n[5] = n[5] * e),
(n[6] = n[6] * e),
(n[7] = n[7] * e),
(n[8] = n[8] * i),
(n[9] = n[9] * i),
(n[10] = n[10] * i),
(n[11] = n[11] * i),
this
);
},
makeRotationAxis: function (t, e) {
var i = Math.cos(e),
n = Math.sin(e),
s = 1 - i,
r = t.x,
o = t.y,
a = t.z,
h = s * r,
l = s * o;
return this.setValues(h * r + i, h * o - n * a, h * a + n * o, 0, h * o + n * a, l * o + i, l * a - n * r, 0, h * a - n * o, l * a + n * r, s * a * a + i, 0, 0, 0, 0, 1);
},
rotate: function (t, e) {
var i = this.val,
n = e.x,
s = e.y,
r = e.z,
o = Math.sqrt(n * n + s * s + r * r);
if (Math.abs(o) < 1e-6) return this;
(n *= o = 1 / o), (s *= o), (r *= o);
var a = Math.sin(t),
h = Math.cos(t),
l = 1 - h,
u = i[0],
c = i[1],
d = i[2],
f = i[3],
p = i[4],
g = i[5],
v = i[6],
y = i[7],
m = i[8],
x = i[9],
b = i[10],
w = i[11],
T = i[12],
S = i[13],
_ = i[14],
E = i[15],
P = n * n * l + h,
A = s * n * l + r * a,
M = r * n * l - s * a,
C = n * s * l - r * a,
O = s * s * l + h,
k = r * s * l + n * a,
R = n * r * l + s * a,
L = s * r * l - n * a,
I = r * r * l + h;
return this.setValues(
u * P + p * A + m * M,
c * P + g * A + x * M,
d * P + v * A + b * M,
f * P + y * A + w * M,
u * C + p * O + m * k,
c * C + g * O + x * k,
d * C + v * O + b * k,
f * C + y * O + w * k,
u * R + p * L + m * I,
c * R + g * L + x * I,
d * R + v * L + b * I,
f * R + y * L + w * I,
T,
S,
_,
E
);
},
rotateX: function (t) {
var e = this.val,
i = Math.sin(t),
n = Math.cos(t),
s = e[4],
r = e[5],
o = e[6],
a = e[7],
h = e[8],
l = e[9],
u = e[10],
c = e[11];
return (
(e[4] = s * n + h * i),
(e[5] = r * n + l * i),
(e[6] = o * n + u * i),
(e[7] = a * n + c * i),
(e[8] = h * n - s * i),
(e[9] = l * n - r * i),
(e[10] = u * n - o * i),
(e[11] = c * n - a * i),
this
);
},
rotateY: function (t) {
var e = this.val,
i = Math.sin(t),
n = Math.cos(t),
s = e[0],
r = e[1],
o = e[2],
a = e[3],
h = e[8],
l = e[9],
u = e[10],
c = e[11];
return (
(e[0] = s * n - h * i),
(e[1] = r * n - l * i),
(e[2] = o * n - u * i),
(e[3] = a * n - c * i),
(e[8] = s * i + h * n),
(e[9] = r * i + l * n),
(e[10] = o * i + u * n),
(e[11] = a * i + c * n),
this
);
},
rotateZ: function (t) {
var e = this.val,
i = Math.sin(t),
n = Math.cos(t),
s = e[0],
r = e[1],
o = e[2],
a = e[3],
h = e[4],
l = e[5],
u = e[6],
c = e[7];
return (
(e[0] = s * n + h * i), (e[1] = r * n + l * i), (e[2] = o * n + u * i), (e[3] = a * n + c * i), (e[4] = h * n - s * i), (e[5] = l * n - r * i), (e[6] = u * n - o * i), (e[7] = c * n - a * i), this
);
},
fromRotationTranslation: function (t, e) {
var i = t.x,
n = t.y,
s = t.z,
r = t.w,
o = i + i,
a = n + n,
h = s + s,
l = i * o,
u = i * a,
c = i * h,
d = n * a,
f = n * h,
p = s * h,
g = r * o,
v = r * a,
y = r * h;
return this.setValues(1 - (d + p), u + y, c - v, 0, u - y, 1 - (l + p), f + g, 0, c + v, f - g, 1 - (l + d), 0, e.x, e.y, e.z, 1);
},
fromQuat: function (t) {
var e = t.x,
i = t.y,
n = t.z,
s = t.w,
r = e + e,
o = i + i,
a = n + n,
h = e * r,
l = e * o,
u = e * a,
c = i * o,
d = i * a,
f = n * a,
p = s * r,
g = s * o,
v = s * a;
return this.setValues(1 - (c + f), l + v, u - g, 0, l - v, 1 - (h + f), d + p, 0, u + g, d - p, 1 - (h + c), 0, 0, 0, 0, 1);
},
frustum: function (t, e, i, n, s, r) {
var o = 1 / (e - t),
a = 1 / (n - i),
h = 1 / (s - r);
return this.setValues(2 * s * o, 0, 0, 0, 0, 2 * s * a, 0, 0, (e + t) * o, (n + i) * a, (r + s) * h, -1, 0, 0, r * s * 2 * h, 0);
},
perspective: function (t, e, i, n) {
var s = 1 / Math.tan(t / 2),
r = 1 / (i - n);
return this.setValues(s / e, 0, 0, 0, 0, s, 0, 0, 0, 0, (n + i) * r, -1, 0, 0, 2 * n * i * r, 0);
},
perspectiveLH: function (t, e, i, n) {
return this.setValues((2 * i) / t, 0, 0, 0, 0, (2 * i) / e, 0, 0, 0, 0, -n / (i - n), 1, 0, 0, (i * n) / (i - n), 0);
},
ortho: function (t, e, i, n, s, r) {
var o = 0 == (o = t - e) ? o : 1 / o,
a = 0 == (a = i - n) ? a : 1 / a,
h = 0 == (h = s - r) ? h : 1 / h;
return this.setValues(-2 * o, 0, 0, 0, 0, -2 * a, 0, 0, 0, 0, 2 * h, 0, (t + e) * o, (n + i) * a, (r + s) * h, 1);
},
lookAtRH: function (t, e, i) {
var n = this.val;
return (
u.subVectors(t, e),
0 === u.getLengthSquared() && (u.z = 1),
u.normalize(),
o.crossVectors(i, u),
0 === o.getLengthSquared() && (1 === Math.abs(i.z) ? (u.x += 1e-4) : (u.z += 1e-4), u.normalize(), o.crossVectors(i, u)),
o.normalize(),
a.crossVectors(u, o),
(n[0] = o.x),
(n[1] = o.y),
(n[2] = o.z),
(n[4] = a.x),
(n[5] = a.y),
(n[6] = a.z),
(n[8] = u.x),
(n[9] = u.y),
(n[10] = u.z),
this
);
},
lookAt: function (t, e, i) {
var n = t.x,
s = t.y,
r = t.z,
o = i.x,
a = i.y,
h = i.z,
l = e.x,
u = e.y,
c = e.z;
if (Math.abs(n - l) < 1e-6 && Math.abs(s - u) < 1e-6 && Math.abs(r - c) < 1e-6) return this.identity();
var d = n - l,
f = s - u,
p = r - c,
g = 1 / Math.sqrt(d * d + f * f + p * p),
v = a * (p *= g) - h * (f *= g),
y = h * (d *= g) - o * p,
m = o * f - a * d;
(g = Math.sqrt(v * v + y * y + m * m)) ? ((v *= g = 1 / g), (y *= g), (m *= g)) : (m = y = v = 0);
var x = f * m - p * y,
b = p * v - d * m,
w = d * y - f * v;
return (
(g = Math.sqrt(x * x + b * b + w * w)) ? ((x *= g = 1 / g), (b *= g), (w *= g)) : (w = b = x = 0),
this.setValues(v, x, d, 0, y, b, f, 0, m, w, p, 0, -(v * n + y * s + m * r), -(x * n + b * s + w * r), -(d * n + f * s + p * r), 1)
);
},
yawPitchRoll: function (t, e, i) {
this.zero(), h.zero(), l.zero();
var n = this.val,
s = h.val,
r = l.val,
o = Math.sin(i),
a = Math.cos(i);
return (
(n[10] = 1),
(n[15] = 1),
(n[0] = a),
(n[1] = o),
(n[4] = -o),
(n[5] = a),
(o = Math.sin(e)),
(a = Math.cos(e)),
(s[0] = 1),
(s[15] = 1),
(s[5] = a),
(s[10] = a),
(s[9] = -o),
(s[6] = o),
(o = Math.sin(t)),
(a = Math.cos(t)),
(r[5] = 1),
(r[15] = 1),
(r[0] = a),
(r[2] = -o),
(r[8] = o),
(r[10] = a),
this.multiplyLocal(h),
this.multiplyLocal(l),
this
);
},
setWorldMatrix: function (t, e, i, n, s) {
return this.yawPitchRoll(t.y, t.x, t.z), h.scaling(i.x, i.y, i.z), l.xyz(e.x, e.y, e.z), this.multiplyLocal(h), this.multiplyLocal(l), n && this.multiplyLocal(n), s && this.multiplyLocal(s), this;
},
multiplyToMat4: function (t, e) {
var i = this.val,
n = t.val,
s = i[0],
r = i[1],
o = i[2],
a = i[3],
h = i[4],
l = i[5],
u = i[6],
c = i[7],
d = i[8],
f = i[9],
p = i[10],
g = i[11],
v = i[12],
y = i[13],
m = i[14],
x = i[15],
b = n[0],
w = n[1],
T = n[2],
S = n[3],
_ = n[4],
E = n[5],
P = n[6],
A = n[7],
M = n[8],
C = n[9],
O = n[10],
k = n[11],
R = n[12],
L = n[13],
I = n[14],
D = n[15];
return e.setValues(
b * s + w * h + T * d + S * v,
w * r + w * l + T * f + S * y,
T * o + w * u + T * p + S * m,
S * a + w * c + T * g + S * x,
_ * s + E * h + P * d + A * v,
_ * r + E * l + P * f + A * y,
_ * o + E * u + P * p + A * m,
_ * a + E * c + P * g + A * x,
M * s + C * h + O * d + k * v,
M * r + C * l + O * f + k * y,
M * o + C * u + O * p + k * m,
M * a + C * c + O * g + k * x,
R * s + L * h + I * d + D * v,
R * r + L * l + I * f + D * y,
R * o + L * u + I * p + D * m,
R * a + L * c + I * g + D * x
);
},
fromRotationXYTranslation: function (t, e, i) {
var n = e.x,
s = e.y,
r = e.z,
o = Math.sin(t.x),
a = Math.cos(t.x),
h = Math.sin(t.y),
l = Math.cos(t.y),
u = n,
c = s,
d = r,
f = -o,
p = 0 - f * h,
g = 0 - a * h,
v = f * l,
y = a * l;
return i || ((u = l * n + h * r), (c = p * n + a * s + v * r), (d = g * n + o * s + y * r)), this.setValues(l, p, g, 0, 0, a, o, 0, h, v, y, 0, u, c, d, 1);
},
getMaxScaleOnAxis: function () {
var t = this.val,
e = t[0] * t[0] + t[1] * t[1] + t[2] * t[2],
i = t[4] * t[4] + t[5] * t[5] + t[6] * t[6],
n = t[8] * t[8] + t[9] * t[9] + t[10] * t[10];
return Math.sqrt(Math.max(e, i, n));
},
}),
h = new r(),
l = new r(),
o = new s(),
a = new s(),
u = new s();
t.exports = r;
},
function (t, e, i) {
t.exports = {
COMPLETE: i(987),
DECODED: i(988),
DECODED_ALL: i(989),
DESTROY: i(990),
DETUNE: i(991),
GLOBAL_DETUNE: i(992),
GLOBAL_MUTE: i(993),
GLOBAL_RATE: i(994),
GLOBAL_VOLUME: i(995),
LOOP: i(996),
LOOPED: i(997),
MUTE: i(998),
PAN: i(999),
PAUSE_ALL: i(1e3),
PAUSE: i(1001),
PLAY: i(1002),
RATE: i(1003),
RESUME_ALL: i(1004),
RESUME: i(1005),
SEEK: i(1006),
STOP_ALL: i(1007),
STOP: i(1008),
UNLOCKED: i(1009),
VOLUME: i(1010),
};
},
function (t, e, i) {
var n = i(0),
s = i(21),
c = i(23),
r = i(8),
d = i(2),
f = i(7),
o = new n({
Extends: c,
initialize: function t(e, i, n, s, r) {
var o,
a,
h = "png";
f(i) && ((i = d((a = i), "key")), (n = d(a, "url")), (o = d(a, "normalMap")), (s = d(a, "xhrSettings")), (h = d(a, "extension", h)), (r = d(a, "frameConfig"))),
Array.isArray(n) && ((o = n[1]), (n = n[0]));
var l,
u = { type: "image", cache: e.textureManager, extension: h, responseType: "blob", key: i, url: n, xhrSettings: s, config: r };
c.call(this, e, u), o && (((l = new t(e, this.key, o, s, r)).type = "normalMap"), this.setLink(l), e.addFile(l));
},
onProcess: function () {
(this.state = s.FILE_PROCESSING), (this.data = new Image()), (this.data.crossOrigin = this.crossOrigin);
var t = this;
(this.data.onload = function () {
c.revokeObjectURL(t.data), t.onProcessComplete();
}),
(this.data.onerror = function () {
c.revokeObjectURL(t.data), t.onProcessError();
}),
c.createObjectURL(this.data, this.xhrLoader.response, "image/png");
},
addToCache: function () {
var t,
e = this.linkFile;
e && e.state === s.FILE_COMPLETE
? ((t = "image" === this.type ? this.cache.addImage(this.key, this.data, e.data) : this.cache.addImage(e.key, e.data, this.data)), this.pendingDestroy(t), e.pendingDestroy(t))
: e || ((t = this.cache.addImage(this.key, this.data)), this.pendingDestroy(t));
},
});
r.register("image", function (t, e, i) {
if (Array.isArray(t)) for (var n = 0; n < t.length; n++) this.addFile(new o(this, t[n]));
else this.addFile(new o(this, t, e, i));
return this;
}),
(t.exports = o);
},
function (t, e) {
t.exports = function (t, e) {
e ? t.setCollision(!0, !0, !0, !0, !1) : t.resetCollision(!1);
};
},
function (t, e, i) {
var r = i(164),
n = i(0),
s = i(11),
o = i(15),
a = i(1065),
h = new n({
Extends: o,
Mixins: [s.Alpha, s.BlendMode, s.Depth, s.Flip, s.GetBounds, s.Mask, s.Origin, s.Pipeline, s.ScrollFactor, s.Size, s.TextureCrop, s.Tint, s.Transform, s.Visible, a],
initialize: function (t, e, i, n, s) {
o.call(this, t, "Sprite"),
(this._crop = this.resetCropObject()),
(this.anims = new r(this)),
this.setTexture(n, s),
this.setPosition(e, i),
this.setSizeToFrame(),
this.setOriginFromFrame(),
this.initPipeline();
},
addedToScene: function () {
this.scene.sys.updateList.add(this);
},
removedFromScene: function () {
this.scene.sys.updateList.remove(this);
},
preUpdate: function (t, e) {
this.anims.update(t, e);
},
play: function (t, e) {
return this.anims.play(t, e);
},
playReverse: function (t, e) {
return this.anims.playReverse(t, e);
},
playAfterDelay: function (t, e) {
return this.anims.playAfterDelay(t, e);
},
playAfterRepeat: function (t, e) {
return this.anims.playAfterRepeat(t, e);
},
chain: function (t) {
return this.anims.chain(t);
},
stop: function () {
return this.anims.stop();
},
stopAfterDelay: function (t) {
return this.anims.stopAfterDelay(t);
},
stopAfterRepeat: function (t) {
return this.anims.stopAfterRepeat(t);
},
stopOnFrame: function (t) {
return this.anims.stopOnFrame(t);
},
toJSON: function () {
return s.ToJSON(this);
},
preDestroy: function () {
this.anims.destroy(), (this.anims = void 0);
},
});
t.exports = h;
},
function (t, e) {
t.exports = function (t, e) {
if (!(e >= t.length)) {
for (var i = t.length - 1, n = t[e], s = e; s < i; s++) t[s] = t[s + 1];
return (t.length = i), n;
}
};
},
function (t, e, i) {
t.exports = {
ADDED_TO_SCENE: i(643),
DESTROY: i(644),
REMOVED_FROM_SCENE: i(645),
VIDEO_COMPLETE: i(646),
VIDEO_CREATED: i(647),
VIDEO_ERROR: i(648),
VIDEO_LOOP: i(649),
VIDEO_PLAY: i(650),
VIDEO_SEEKED: i(651),
VIDEO_SEEKING: i(652),
VIDEO_STOP: i(653),
VIDEO_TIMEOUT: i(654),
VIDEO_UNLOCKED: i(655),
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), 0 === e ? t : ((t -= i), (t = e * Math.floor(t / e)), n ? (i + t) / e : i + t);
};
},
function (t, e) {
t.exports = function (t) {
var e = {};
for (var i in t) Array.isArray(t[i]) ? (e[i] = t[i].slice(0)) : (e[i] = t[i]);
return e;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = t.length;
if (e < 0 || s < e || i <= e || s < i || s < e + i) {
if (n) throw new Error("Range Error: Values outside acceptable range");
return !1;
}
return !0;
};
},
function (t, e) {
function n(t, e) {
return String(t).localeCompare(e);
}
function o(t, e, i, n) {
for (var s, r, o, a, h = t.length, l = 0, u = 2 * i, c = 0; c < h; c += u)
for (r = (s = c + i) + i, h < s && (s = h), h < r && (r = h), o = c, a = s; ; )
if (o < s && a < r) e(t[o], t[a]) <= 0 ? (n[l++] = t[o++]) : (n[l++] = t[a++]);
else if (o < s) n[l++] = t[o++];
else {
if (!(a < r)) break;
n[l++] = t[a++];
}
}
t.exports = function (t, e) {
void 0 === e && (e = n);
var i = (function (t, e) {
var i = t.length;
if (i <= 1) return t;
for (var n = new Array(i), s = 1; s < i; s *= 2) {
o(t, e, s, n);
var r = t;
(t = n), (n = r);
}
return t;
})(t, e);
return i !== t && o(i, null, t.length, t), t;
};
},
function (t, e, i) {
var r = i(134),
o = i(205);
t.exports = function (t, e) {
var i,
n = r.Power0;
if (
("string" == typeof t
? r.hasOwnProperty(t)
? (n = r[t])
: ((i = ""),
t.indexOf(".") && ("in" === (i = t.substr(t.indexOf(".") + 1)).toLowerCase() ? (i = "easeIn") : "out" === i.toLowerCase() ? (i = "easeOut") : "inout" === i.toLowerCase() && (i = "easeInOut")),
(t = o(t.substr(0, t.indexOf(".") + 1) + i)),
r.hasOwnProperty(t) && (n = r[t]))
: "function" == typeof t
? (n = t)
: Array.isArray(t) && t.length,
!e)
)
return n;
var s = e.slice(0);
return (
s.unshift(0),
function (t) {
return (s[0] = t), n.apply(this, s);
}
);
};
},
function (t, e, i) {
var v = i(12);
t.exports = function (t, e, i, n, s) {
var r = t.strokeTint,
o = v.getTintAppendFloatAlpha(e.strokeColor, e.strokeAlpha * i);
(r.TL = o), (r.TR = o), (r.BL = o), (r.BR = o);
var a = e.pathData,
h = a.length - 1,
l = e.lineWidth,
u = l / 2,
c = a[0] - n,
d = a[1] - s;
e.closePath || (h -= 2);
for (var f = 2; f < h; f += 2) {
var p = a[f] - n,
g = a[f + 1] - s;
t.batchLine(c, d, p, g, u, u, l, f - 2, !!e.closePath && f === h - 1), (c = p), (d = g);
}
};
},
function (t, e, i) {
var n = i(0),
s = i(115),
r = i(476),
o = i(477),
a = i(56),
h = i(47),
l = i(181),
u = new n({
initialize: function (t, e, i, n, s, r) {
void 0 === t && (t = 0),
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 0),
void 0 === s && (s = 0),
void 0 === r && (r = 0),
(this.type = a.TRIANGLE),
(this.x1 = t),
(this.y1 = e),
(this.x2 = i),
(this.y2 = n),
(this.x3 = s),
(this.y3 = r);
},
contains: function (t, e) {
return s(this, t, e);
},
getPoint: function (t, e) {
return r(this, t, e);
},
getPoints: function (t, e, i) {
return o(this, t, e, i);
},
getRandomPoint: function (t) {
return l(this, t);
},
setTo: function (t, e, i, n, s, r) {
return (
void 0 === t && (t = 0),
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 0),
void 0 === s && (s = 0),
void 0 === r && (r = 0),
(this.x1 = t),
(this.y1 = e),
(this.x2 = i),
(this.y2 = n),
(this.x3 = s),
(this.y3 = r),
this
);
},
getLineA: function (t) {
return void 0 === t && (t = new h()), t.setTo(this.x1, this.y1, this.x2, this.y2), t;
},
getLineB: function (t) {
return void 0 === t && (t = new h()), t.setTo(this.x2, this.y2, this.x3, this.y3), t;
},
getLineC: function (t) {
return void 0 === t && (t = new h()), t.setTo(this.x3, this.y3, this.x1, this.y1), t;
},
left: {
get: function () {
return Math.min(this.x1, this.x2, this.x3);
},
set: function (t) {
var e = this.x1 <= this.x2 && this.x1 <= this.x3 ? this.x1 - t : this.x2 <= this.x1 && this.x2 <= this.x3 ? this.x2 - t : this.x3 - t;
(this.x1 -= e), (this.x2 -= e), (this.x3 -= e);
},
},
right: {
get: function () {
return Math.max(this.x1, this.x2, this.x3);
},
set: function (t) {
var e = this.x1 >= this.x2 && this.x1 >= this.x3 ? this.x1 - t : this.x2 >= this.x1 && this.x2 >= this.x3 ? this.x2 - t : this.x3 - t;
(this.x1 -= e), (this.x2 -= e), (this.x3 -= e);
},
},
top: {
get: function () {
return Math.min(this.y1, this.y2, this.y3);
},
set: function (t) {
var e = this.y1 <= this.y2 && this.y1 <= this.y3 ? this.y1 - t : this.y2 <= this.y1 && this.y2 <= this.y3 ? this.y2 - t : this.y3 - t;
(this.y1 -= e), (this.y2 -= e), (this.y3 -= e);
},
},
bottom: {
get: function () {
return Math.max(this.y1, this.y2, this.y3);
},
set: function (t) {
var e = this.y1 >= this.y2 && this.y1 >= this.y3 ? this.y1 - t : this.y2 >= this.y1 && this.y2 >= this.y3 ? this.y2 - t : this.y3 - t;
(this.y1 -= e), (this.y2 -= e), (this.y3 -= e);
},
},
});
t.exports = u;
},
function (t, e) {
var i = {};
((t.exports = i).create = function (t, e) {
return { x: t || 0, y: e || 0 };
}),
(i.clone = function (t) {
return { x: t.x, y: t.y };
}),
(i.magnitude = function (t) {
return Math.sqrt(t.x * t.x + t.y * t.y);
}),
(i.magnitudeSquared = function (t) {
return t.x * t.x + t.y * t.y;
}),
(i.rotate = function (t, e, i) {
var n = Math.cos(e),
s = Math.sin(e);
i = i || {};
var r = t.x * n - t.y * s;
return (i.y = t.x * s + t.y * n), (i.x = r), i;
}),
(i.rotateAbout = function (t, e, i, n) {
var s = Math.cos(e),
r = Math.sin(e);
n = n || {};
var o = i.x + ((t.x - i.x) * s - (t.y - i.y) * r);
return (n.y = i.y + ((t.x - i.x) * r + (t.y - i.y) * s)), (n.x = o), n;
}),
(i.normalise = function (t) {
var e = i.magnitude(t);
return 0 === e ? { x: 0, y: 0 } : { x: t.x / e, y: t.y / e };
}),
(i.dot = function (t, e) {
return t.x * e.x + t.y * e.y;
}),
(i.cross = function (t, e) {
return t.x * e.y - t.y * e.x;
}),
(i.cross3 = function (t, e, i) {
return (e.x - t.x) * (i.y - t.y) - (e.y - t.y) * (i.x - t.x);
}),
(i.add = function (t, e, i) {
return ((i = i || {}).x = t.x + e.x), (i.y = t.y + e.y), i;
}),
(i.sub = function (t, e, i) {
return ((i = i || {}).x = t.x - e.x), (i.y = t.y - e.y), i;
}),
(i.mult = function (t, e) {
return { x: t.x * e, y: t.y * e };
}),
(i.div = function (t, e) {
return { x: t.x / e, y: t.y / e };
}),
(i.perp = function (t, e) {
return { x: (e = !0 === e ? -1 : 1) * -t.y, y: e * t.x };
}),
(i.neg = function (t) {
return { x: -t.x, y: -t.y };
}),
(i.angle = function (t, e) {
return Math.atan2(e.y - t.y, e.x - t.x);
}),
(i._temp = [i.create(), i.create(), i.create(), i.create(), i.create(), i.create()]);
},
function (t, e) {
var i = {};
((t.exports = i).create = function (t) {
var e = { min: { x: 0, y: 0 }, max: { x: 0, y: 0 } };
return t && i.update(e, t), e;
}),
(i.update = function (t, e, i) {
(t.min.x = 1 / 0), (t.max.x = -1 / 0), (t.min.y = 1 / 0), (t.max.y = -1 / 0);
for (var n = 0; n < e.length; n++) {
var s = e[n];
s.x > t.max.x && (t.max.x = s.x), s.x < t.min.x && (t.min.x = s.x), s.y > t.max.y && (t.max.y = s.y), s.y < t.min.y && (t.min.y = s.y);
}
i && (0 < i.x ? (t.max.x += i.x) : (t.min.x += i.x), 0 < i.y ? (t.max.y += i.y) : (t.min.y += i.y));
}),
(i.contains = function (t, e) {
return e.x >= t.min.x && e.x <= t.max.x && e.y >= t.min.y && e.y <= t.max.y;
}),
(i.overlaps = function (t, e) {
return t.min.x <= e.max.x && t.max.x >= e.min.x && t.max.y >= e.min.y && t.min.y <= e.max.y;
}),
(i.translate = function (t, e) {
(t.min.x += e.x), (t.max.x += e.x), (t.min.y += e.y), (t.max.y += e.y);
}),
(i.shift = function (t, e) {
var i = t.max.x - t.min.x,
n = t.max.y - t.min.y;
(t.min.x = e.x), (t.max.x = e.x + i), (t.min.y = e.y), (t.max.y = e.y + n);
});
},
function (t, e, i) {
var n = i(29),
s = i(0),
r = i(11),
o = i(502),
a = new s({
Mixins: [r.Alpha, r.Flip, r.Visible],
initialize: function (t, e, i, n, s, r, o, a) {
(this.layer = t),
(this.index = e),
(this.x = i),
(this.y = n),
(this.width = s),
(this.height = r),
this.right,
this.bottom,
(this.baseWidth = void 0 !== o ? o : s),
(this.baseHeight = void 0 !== a ? a : r),
(this.pixelX = 0),
(this.pixelY = 0),
this.updatePixelXY(),
(this.properties = {}),
(this.rotation = 0),
(this.collideLeft = !1),
(this.collideRight = !1),
(this.collideUp = !1),
(this.collideDown = !1),
(this.faceLeft = !1),
(this.faceRight = !1),
(this.faceTop = !1),
(this.faceBottom = !1),
(this.collisionCallback = void 0),
((this.collisionCallbackContext = this).tint = 16777215),
(this.physics = {});
},
containsPoint: function (t, e) {
return !(t < this.pixelX || e < this.pixelY || t > this.right || e > this.bottom);
},
copy: function (t) {
return (
(this.index = t.index),
(this.alpha = t.alpha),
(this.properties = t.properties),
(this.visible = t.visible),
this.setFlip(t.flipX, t.flipY),
(this.tint = t.tint),
(this.rotation = t.rotation),
(this.collideUp = t.collideUp),
(this.collideDown = t.collideDown),
(this.collideLeft = t.collideLeft),
(this.collideRight = t.collideRight),
(this.collisionCallback = t.collisionCallback),
(this.collisionCallbackContext = t.collisionCallbackContext),
this
);
},
getCollisionGroup: function () {
return this.tileset ? this.tileset.getTileCollisionGroup(this.index) : null;
},
getTileData: function () {
return this.tileset ? this.tileset.getTileData(this.index) : null;
},
getLeft: function (t) {
var e = this.tilemapLayer;
return e ? e.tileToWorldX(this.x, t) : this.x * this.baseWidth;
},
getRight: function (t) {
var e = this.tilemapLayer;
return e ? this.getLeft(t) + this.width * e.scaleX : this.getLeft(t) + this.width;
},
getTop: function (t) {
var e = this.tilemapLayer;
return e ? e.tileToWorldY(this.y, t) - (this.height - this.baseHeight) * e.scaleY : this.y * this.baseHeight - (this.height - this.baseHeight);
},
getBottom: function (t) {
var e = this.tilemapLayer;
return e ? this.getTop(t) + this.height * e.scaleY : this.getTop(t) + this.height;
},
getBounds: function (t, e) {
return void 0 === e && (e = new o()), (e.x = this.getLeft()), (e.y = this.getTop()), (e.width = this.getRight() - e.x), (e.height = this.getBottom() - e.y), e;
},
getCenterX: function (t) {
return (this.getLeft(t) + this.getRight(t)) / 2;
},
getCenterY: function (t) {
return (this.getTop(t) + this.getBottom(t)) / 2;
},
intersects: function (t, e, i, n) {
return !(i <= this.pixelX || n <= this.pixelY || t >= this.right || e >= this.bottom);
},
isInteresting: function (t, e) {
return t && e ? this.canCollide || this.hasInterestingFace : t ? this.collides : !!e && this.hasInterestingFace;
},
resetCollision: function (t) {
return (
void 0 === t && (t = !0),
(this.collideLeft = !1),
(this.collideRight = !1),
(this.collideUp = !1),
(this.collideDown = !1),
(this.faceTop = !1),
(this.faceBottom = !1),
(this.faceLeft = !1),
(this.faceRight = !1),
t && this.tilemapLayer && this.tilemapLayer.calculateFacesAt(this.x, this.y),
this
);
},
resetFaces: function () {
return (this.faceTop = !1), (this.faceBottom = !1), (this.faceLeft = !1), (this.faceRight = !1), this;
},
setCollision: function (t, e, i, n, s) {
return (
void 0 === e && (e = t),
void 0 === i && (i = t),
void 0 === n && (n = t),
void 0 === s && (s = !0),
(this.collideLeft = t),
(this.collideRight = e),
(this.collideUp = i),
(this.collideDown = n),
(this.faceLeft = t),
(this.faceRight = e),
(this.faceTop = i),
(this.faceBottom = n),
s && this.tilemapLayer && this.tilemapLayer.calculateFacesAt(this.x, this.y),
this
);
},
setCollisionCallback: function (t, e) {
return null === t ? ((this.collisionCallback = void 0), (this.collisionCallbackContext = void 0)) : ((this.collisionCallback = t), (this.collisionCallbackContext = e)), this;
},
setSize: function (t, e, i, n) {
return void 0 !== t && (this.width = t), void 0 !== e && (this.height = e), void 0 !== i && (this.baseWidth = i), void 0 !== n && (this.baseHeight = n), this.updatePixelXY(), this;
},
updatePixelXY: function () {
var t,
e,
i = this.layer.orientation;
return (
i === n.ORTHOGONAL
? ((this.pixelX = this.x * this.baseWidth), (this.pixelY = this.y * this.baseHeight))
: i === n.ISOMETRIC
? ((this.pixelX = (this.x - this.y) * this.baseWidth * 0.5), (this.pixelY = (this.x + this.y) * this.baseHeight * 0.5))
: i === n.STAGGERED
? ((this.pixelX = this.x * this.baseWidth + (this.y % 2) * (this.baseWidth / 2)), (this.pixelY = this.y * (this.baseHeight / 2)))
: i === n.HEXAGONAL &&
((t = this.layer.hexSideLength), (e = (this.baseHeight - t) / 2 + t), (this.pixelX = this.x * this.baseWidth + (this.y % 2) * (this.baseWidth / 2)), (this.pixelY = this.y * e)),
(this.right = this.pixelX + this.baseWidth),
(this.bottom = this.pixelY + this.baseHeight),
this
);
},
destroy: function () {
(this.collisionCallback = void 0), (this.collisionCallbackContext = void 0), (this.properties = void 0);
},
canCollide: {
get: function () {
return this.collideLeft || this.collideRight || this.collideUp || this.collideDown || void 0 !== this.collisionCallback;
},
},
collides: {
get: function () {
return this.collideLeft || this.collideRight || this.collideUp || this.collideDown;
},
},
hasInterestingFace: {
get: function () {
return this.faceTop || this.faceBottom || this.faceLeft || this.faceRight;
},
},
tileset: {
get: function () {
var t = this.layer.tilemapLayer;
if (t) {
var e = t.gidMap[this.index];
if (e) return e;
}
return null;
},
},
tilemapLayer: {
get: function () {
return this.layer.tilemapLayer;
},
},
tilemap: {
get: function () {
var t = this.tilemapLayer;
return t ? t.tilemap : null;
},
},
});
t.exports = a;
},
function (t, e, i) {
var v = {};
t.exports = v;
var y = i(64),
m = i(32),
x = i(41),
d = i(84),
f = i(83),
b = i(1393);
(v.rectangle = function (t, e, i, n, s) {
s = s || {};
var r,
o = { label: "Rectangle Body", position: { x: t, y: e }, vertices: y.fromPath("L 0 0 L " + i + " 0 L " + i + " " + n + " L 0 " + n) };
return s.chamfer && ((r = s.chamfer), (o.vertices = y.chamfer(o.vertices, r.radius, r.quality, r.qualityMin, r.qualityMax)), delete s.chamfer), x.create(m.extend({}, o, s));
}),
(v.trapezoid = function (t, e, i, n, s, r) {
r = r || {};
var o,
a = i * (s *= 0.5),
h = a + (1 - 2 * s) * i,
l = h + a,
u = s < 0.5 ? "L 0 0 L " + a + " " + -n + " L " + h + " " + -n + " L " + l + " 0" : "L 0 0 L " + h + " " + -n + " L " + l + " 0",
c = { label: "Trapezoid Body", position: { x: t, y: e }, vertices: y.fromPath(u) };
return r.chamfer && ((o = r.chamfer), (c.vertices = y.chamfer(c.vertices, o.radius, o.quality, o.qualityMin, o.qualityMax)), delete r.chamfer), x.create(m.extend({}, c, r));
}),
(v.circle = function (t, e, i, n, s) {
n = n || {};
var r = { label: "Circle Body", circleRadius: i };
s = s || 25;
var o = Math.ceil(Math.max(10, Math.min(s, i)));
return o % 2 == 1 && (o += 1), v.polygon(t, e, o, i, m.extend({}, r, n));
}),
(v.polygon = function (t, e, i, n, s) {
if (((s = s || {}), i < 3)) return v.circle(t, e, n, s);
for (var r = (2 * Math.PI) / i, o = "", a = 0.5 * r, h = 0; h < i; h += 1) {
var l = a + h * r,
u = Math.cos(l) * n,
c = Math.sin(l) * n;
o += "L " + u.toFixed(3) + " " + c.toFixed(3) + " ";
}
var d,
f = { label: "Polygon Body", position: { x: t, y: e }, vertices: y.fromPath(o) };
return s.chamfer && ((d = s.chamfer), (f.vertices = y.chamfer(f.vertices, d.radius, d.quality, d.qualityMin, d.qualityMax)), delete s.chamfer), x.create(m.extend({}, f, s));
}),
(v.fromVertices = function (t, e, i, n, s, r, o) {
var a, h, l, u, c;
for (
n = n || {},
h = [],
s = void 0 !== s && s,
r = void 0 !== r ? r : 0.01,
o = void 0 !== o ? o : 10,
b || m.warn("Bodies.fromVertices: poly-decomp.js required. Could not decompose vertices. Fallback to convex hull."),
m.isArray(i[0]) || (i = [i]),
c = 0;
c < i.length;
c += 1
)
if (((u = i[c]), (l = y.isConvex(u)) || !b)) (u = l ? y.clockwiseSort(u) : y.hull(u)), h.push({ position: { x: t, y: e }, vertices: u });
else {
var d = u.map(function (t) {
return [t.x, t.y];
});
b.makeCCW(d), !1 !== r && b.removeCollinearPoints(d, r);
for (var f = b.quickDecomp(d), p = 0; p < f.length; p++) {
var g = f[p].map(function (t) {
return { x: t[0], y: t[1] };
});
(0 < o && y.area(g) < o) || h.push({ position: y.centre(g), vertices: g });
}
}
for (p = 0; p < h.length; p++) h[p] = x.create(m.extend(h[p], n));
return s && v.flagCoincidentParts(h, 5), 1 < h.length ? ((a = x.create(m.extend({ parts: h.slice(0) }, n))), x.setPosition(a, { x: t, y: e }), a) : h[0];
}),
(v.flagCoincidentParts = function (t, e) {
void 0 === e && (e = 5);
for (var i = 0; i < t.length; i++)
for (var n = t[i], s = i + 1; s < t.length; s++) {
var r = t[s];
if (d.overlaps(n.bounds, r.bounds))
for (var o = n.vertices, a = r.vertices, h = 0; h < n.vertices.length; h++)
for (var l = 0; l < r.vertices.length; l++) {
var u = f.magnitudeSquared(f.sub(o[(h + 1) % o.length], a[l])),
c = f.magnitudeSquared(f.sub(o[h], a[(l + 1) % a.length]));
u < e && c < e && ((o[h].isInternal = !0), (a[l].isInternal = !0));
}
}
return t;
});
},
function (t, e) {
t.exports = function (t) {
return t.x - t.width * t.originX + 0.5 * t.width;
};
},
function (t, e) {
t.exports = function (t, e) {
var i = t.width * t.originX;
return (t.x = e + i - 0.5 * t.width), t;
};
},
function (t, e) {
t.exports = function (t) {
return t.y - t.height * t.originY + 0.5 * t.height;
};
},
function (t, e) {
t.exports = function (t, e) {
var i = t.height * t.originY;
return (t.y = e + i - 0.5 * t.height), t;
};
},
function (t, e, i) {
t.exports = { POST_RENDER: i(628), PRE_RENDER: i(629), RENDER: i(630), RESIZE: i(631) };
},
function (t, e) {
t.exports = {
BITMAPMASK_PIPELINE: "BitmapMaskPipeline",
LIGHT_PIPELINE: "Light2D",
POINTLIGHT_PIPELINE: "PointLightPipeline",
SINGLE_PIPELINE: "SinglePipeline",
MULTI_PIPELINE: "MultiPipeline",
ROPE_PIPELINE: "RopePipeline",
GRAPHICS_PIPELINE: "GraphicsPipeline",
POSTFX_PIPELINE: "PostFXPipeline",
UTILITY_PIPELINE: "UtilityPipeline",
};
},
function (t, e, i) {
var h = i(74);
t.exports = function (t, e, i, n) {
if ((void 0 === n && (n = t), !Array.isArray(e))) return -1 !== (o = t.indexOf(e)) ? (h(t, o), i && i.call(n, e), e) : null;
for (var s = e.length - 1, r = []; 0 <= s; ) {
var o,
a = e[s];
-1 !== (o = t.indexOf(a)) && (h(t, o), r.push(a), i && i.call(n, a)), s--;
}
return r;
};
},
function (t, e, i) {
var n = i(0),
s = i(199),
r = i(10),
o = i(3),
a = new n({
initialize: function (t) {
(this.type = t),
(this.defaultDivisions = 5),
(this.arcLengthDivisions = 100),
(this.cacheArcLengths = []),
(this.needsUpdate = !0),
(this.active = !0),
(this._tmpVec2A = new o()),
(this._tmpVec2B = new o());
},
draw: function (t, e) {
return void 0 === e && (e = 32), t.strokePoints(this.getPoints(e));
},
getBounds: function (t, e) {
(t = t || new r()), void 0 === e && (e = 16);
var i = this.getLength();
i < e && (e = i / 2);
var n = Math.max(1, Math.round(i / e));
return s(this.getSpacedPoints(n), t);
},
getDistancePoints: function (t) {
var e = this.getLength(),
i = Math.max(1, e / t);
return this.getSpacedPoints(i);
},
getEndPoint: function (t) {
return void 0 === t && (t = new o()), this.getPointAt(1, t);
},
getLength: function () {
var t = this.getLengths();
return t[t.length - 1];
},
getLengths: function (t) {
if ((void 0 === t && (t = this.arcLengthDivisions), this.cacheArcLengths.length === t + 1 && !this.needsUpdate)) return this.cacheArcLengths;
this.needsUpdate = !1;
var e,
i = [],
n = this.getPoint(0, this._tmpVec2A),
s = 0;
i.push(0);
for (var r = 1; r <= t; r++) (s += (e = this.getPoint(r / t, this._tmpVec2B)).distance(n)), i.push(s), n.copy(e);
return (this.cacheArcLengths = i);
},
getPointAt: function (t, e) {
var i = this.getUtoTmapping(t);
return this.getPoint(i, e);
},
getPoints: function (t, e, i) {
void 0 === i && (i = []), (t = t || (e ? this.getLength() / e : this.defaultDivisions));
for (var n = 0; n <= t; n++) i.push(this.getPoint(n / t));
return i;
},
getRandomPoint: function (t) {
return void 0 === t && (t = new o()), this.getPoint(Math.random(), t);
},
getSpacedPoints: function (t, e, i) {
void 0 === i && (i = []), (t = t || (e ? this.getLength() / e : this.defaultDivisions));
for (var n = 0; n <= t; n++) {
var s = this.getUtoTmapping(n / t, null, t);
i.push(this.getPoint(s));
}
return i;
},
getStartPoint: function (t) {
return void 0 === t && (t = new o()), this.getPointAt(0, t);
},
getTangent: function (t, e) {
void 0 === e && (e = new o());
var i = t - 1e-4,
n = t + 1e-4;
return i < 0 && (i = 0), 1 < n && (n = 1), this.getPoint(i, this._tmpVec2A), this.getPoint(n, e), e.subtract(this._tmpVec2A).normalize();
},
getTangentAt: function (t, e) {
var i = this.getUtoTmapping(t);
return this.getTangent(i, e);
},
getTFromDistance: function (t, e) {
return t <= 0 ? 0 : this.getUtoTmapping(0, t, e);
},
getUtoTmapping: function (t, e, i) {
for (var n, s = this.getLengths(i), r = 0, o = s.length, a = e ? Math.min(e, s[o - 1]) : t * s[o - 1], h = 0, l = o - 1; h <= l; )
if ((n = s[(r = Math.floor(h + (l - h) / 2))] - a) < 0) h = r + 1;
else {
if (!(0 < n)) {
l = r;
break;
}
l = r - 1;
}
if (s[(r = l)] === a) return r / (o - 1);
var u = s[r];
return (r + (a - u) / (s[r + 1] - u)) / (o - 1);
},
updateArcLengths: function () {
(this.needsUpdate = !0), this.getLengths();
},
});
t.exports = a;
},
function (t, e, i) {
t.exports = {
ADD: i(968),
COMPLETE: i(969),
FILE_COMPLETE: i(970),
FILE_KEY_COMPLETE: i(971),
FILE_LOAD_ERROR: i(972),
FILE_LOAD: i(973),
FILE_PROGRESS: i(974),
POST_PROCESS: i(975),
PROGRESS: i(976),
START: i(977),
};
},
function (t, e, i) {
var p = i(4);
t.exports = function (t, e, i) {
void 0 === i && (i = new p());
var n = t.x1,
s = t.y1,
r = t.x2,
o = t.y2,
a = e.x1,
h = e.y1,
l = e.x2,
u = e.y2,
c = (u - h) * (r - n) - (l - a) * (o - s);
if (0 == c) return !1;
var d = ((l - a) * (s - h) - (u - h) * (n - a)) / c,
f = ((r - n) * (s - h) - (o - s) * (n - a)) / c;
return 0 <= d && d <= 1 && 0 <= f && f <= 1 && ((i.x = n + d * (r - n)), (i.y = s + d * (o - s)), !0);
};
},
function (t, e) {
t.exports = function (t) {
return Math.atan2(t.y2 - t.y1, t.x2 - t.x1);
};
},
function (t, e, i) {
var n = i(18);
t.exports = function (t, e, i) {
return (i - e) * (t = n(t, 0, 1)) + e;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return t && t.hasOwnProperty(e) ? t[e] : i;
};
},
function (t, e) {
t.exports = {
CREATED: 0,
INIT: 1,
DELAY: 2,
OFFSET_DELAY: 3,
PENDING_RENDER: 4,
PLAYING_FORWARD: 5,
PLAYING_BACKWARD: 6,
HOLD_DELAY: 7,
REPEAT_DELAY: 8,
COMPLETE: 9,
PENDING_ADD: 20,
PAUSED: 21,
LOOP_DELAY: 22,
ACTIVE: 23,
COMPLETE_DELAY: 24,
PENDING_REMOVE: 25,
REMOVED: 26,
};
},
function (t, e, i) {
var n = i(0),
a = i(315),
s = new n({
initialize: function (t, e) {
(this.parent = t),
(this.events = e) || (this.events = t.events ? t.events : t),
(this.list = {}),
(this.values = {}),
(this._frozen = !1),
!t.hasOwnProperty("sys") && this.events && this.events.once(a.DESTROY, this.destroy, this);
},
get: function (t) {
var e = this.list;
if (Array.isArray(t)) {
for (var i = [], n = 0; n < t.length; n++) i.push(e[t[n]]);
return i;
}
return e[t];
},
getAll: function () {
var t = {};
for (var e in this.list) this.list.hasOwnProperty(e) && (t[e] = this.list[e]);
return t;
},
query: function (t) {
var e = {};
for (var i in this.list) this.list.hasOwnProperty(i) && i.match(t) && (e[i] = this.list[i]);
return e;
},
set: function (t, e) {
if (this._frozen) return this;
if ("string" == typeof t) return this.setValue(t, e);
for (var i in t) this.setValue(i, t[i]);
return this;
},
inc: function (t, e) {
if (this._frozen) return this;
void 0 === e && (e = 1);
var i = this.get(t);
return void 0 === i && (i = 0), this.set(t, i + e), this;
},
toggle: function (t) {
return this._frozen || this.set(t, !this.get(t)), this;
},
setValue: function (i, t) {
return (
this._frozen ||
(this.has(i)
? (this.values[i] = t)
: ((s = (n = this).list),
(r = this.events),
(o = this.parent),
Object.defineProperty(this.values, i, {
enumerable: !0,
configurable: !0,
get: function () {
return s[i];
},
set: function (t) {
var e;
n._frozen || ((e = s[i]), (s[i] = t), r.emit(a.CHANGE_DATA, o, i, t, e), r.emit(a.CHANGE_DATA_KEY + i, o, t, e));
},
}),
(s[i] = t),
r.emit(a.SET_DATA, o, i, t))),
this
);
var n, s, r, o;
},
each: function (t, e) {
for (var i = [this.parent, null, void 0], n = 1; n < arguments.length; n++) i.push(arguments[n]);
for (var s in this.list) (i[1] = s), (i[2] = this.list[s]), t.apply(e, i);
return this;
},
merge: function (t, e) {
for (var i in (void 0 === e && (e = !0), t)) t.hasOwnProperty(i) && (e || (!e && !this.has(i))) && this.setValue(i, t[i]);
return this;
},
remove: function (t) {
if (this._frozen) return this;
if (!Array.isArray(t)) return this.removeValue(t);
for (var e = 0; e < t.length; e++) this.removeValue(t[e]);
return this;
},
removeValue: function (t) {
var e;
return this.has(t) && ((e = this.list[t]), delete this.list[t], delete this.values[t], this.events.emit(a.REMOVE_DATA, this.parent, t, e)), this;
},
pop: function (t) {
var e = void 0;
return !this._frozen && this.has(t) && ((e = this.list[t]), delete this.list[t], delete this.values[t], this.events.emit(a.REMOVE_DATA, this.parent, t, e)), e;
},
has: function (t) {
return this.list.hasOwnProperty(t);
},
setFreeze: function (t) {
return (this._frozen = t), this;
},
reset: function () {
for (var t in this.list) delete this.list[t], delete this.values[t];
return (this._frozen = !1), this;
},
destroy: function () {
this.reset(), this.events.off(a.CHANGE_DATA), this.events.off(a.SET_DATA), this.events.off(a.REMOVE_DATA), (this.parent = null);
},
freeze: {
get: function () {
return this._frozen;
},
set: function (t) {
this._frozen = !!t;
},
},
count: {
get: function () {
var t = 0;
for (var e in this.list) void 0 !== this.list[e] && t++;
return t;
},
},
});
t.exports = s;
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t) {
if (((this.entries = {}), (this.size = 0), Array.isArray(t))) for (var e = 0; e < t.length; e++) this.set(t[e][0], t[e][1]);
},
set: function (t, e) {
return this.has(t) || this.size++, (this.entries[t] = e), this;
},
get: function (t) {
if (this.has(t)) return this.entries[t];
},
getArray: function () {
var t = [],
e = this.entries;
for (var i in e) t.push(e[i]);
return t;
},
has: function (t) {
return this.entries.hasOwnProperty(t);
},
delete: function (t) {
return this.has(t) && (delete this.entries[t], this.size--), this;
},
clear: function () {
return (
Object.keys(this.entries).forEach(function (t) {
delete this.entries[t];
}, this),
(this.size = 0),
this
);
},
keys: function () {
return Object.keys(this.entries);
},
values: function () {
var t = [],
e = this.entries;
for (var i in e) t.push(e[i]);
return t;
},
dump: function () {
var t = this.entries;
for (var e in t);
},
each: function (t) {
var e = this.entries;
for (var i in e) if (!1 === t(i, e[i])) break;
return this;
},
contains: function (t) {
var e = this.entries;
for (var i in e) if (e[i] === t) return !0;
return !1;
},
merge: function (t, e) {
void 0 === e && (e = !1);
var i = this.entries,
n = t.entries;
for (var s in n) i.hasOwnProperty(s) && e ? (i[s] = n[s]) : this.set(s, n[s]);
return this;
},
});
t.exports = n;
},
function (t, e) {
t.exports = function (t, e, i) {
return (t << 16) | (e << 8) | i;
};
},
function (t, e, i) {
t.exports = { ENTER_FULLSCREEN: i(800), FULLSCREEN_FAILED: i(801), FULLSCREEN_UNSUPPORTED: i(802), LEAVE_FULLSCREEN: i(803), ORIENTATION_CHANGE: i(804), RESIZE: i(805) };
},
function (t, e, i) {
(function (i) {
var n = {
android: !1,
chromeOS: !1,
cordova: !1,
crosswalk: !1,
desktop: !1,
ejecta: !1,
electron: !1,
iOS: !1,
iOSVersion: 0,
iPad: !1,
iPhone: !1,
kindle: !1,
linux: !1,
macOS: !1,
node: !1,
nodeWebkit: !1,
pixelRatio: 1,
webApp: !1,
windows: !1,
windowsPhone: !1,
};
t.exports = (function () {
if ("function" == typeof importScripts) return n;
var t = navigator.userAgent;
/Windows/.test(t)
? (n.windows = !0)
: /Mac OS/.test(t) && !/like Mac OS/.test(t)
? navigator.maxTouchPoints && 2 < navigator.maxTouchPoints
? ((n.iOS = !0), (n.iPad = !0), navigator.appVersion.match(/Version\/(\d+)/), (n.iOSVersion = parseInt(RegExp.$1, 10)))
: (n.macOS = !0)
: /Android/.test(t)
? (n.android = !0)
: /Linux/.test(t)
? (n.linux = !0)
: /iP[ao]d|iPhone/i.test(t)
? ((n.iOS = !0),
navigator.appVersion.match(/OS (\d+)/),
(n.iOSVersion = parseInt(RegExp.$1, 10)),
(n.iPhone = -1 !== t.toLowerCase().indexOf("iphone")),
(n.iPad = -1 !== t.toLowerCase().indexOf("ipad")))
: /Kindle/.test(t) || /\bKF[A-Z][A-Z]+/.test(t) || /Silk.*Mobile Safari/.test(t)
? (n.kindle = !0)
: /CrOS/.test(t) && (n.chromeOS = !0),
(/Windows Phone/i.test(t) || /IEMobile/i.test(t)) && ((n.android = !1), (n.iOS = !1), (n.macOS = !1), (n.windows = !0), (n.windowsPhone = !0));
var e = /Silk/.test(t);
return (
(n.windows || n.macOS || (n.linux && !e) || n.chromeOS) && (n.desktop = !0),
(n.windowsPhone || (/Windows NT/i.test(t) && /Touch/i.test(t))) && (n.desktop = !1),
navigator.standalone && (n.webApp = !0),
"function" != typeof importScripts && (void 0 !== window.cordova && (n.cordova = !0), void 0 !== window.ejecta && (n.ejecta = !0)),
void 0 !== i && i.versions && i.versions.node && (n.node = !0),
n.node && "object" == typeof i.versions && ((n.nodeWebkit = !!i.versions["node-webkit"]), (n.electron = !!i.versions.electron)),
/Crosswalk/.test(t) && (n.crosswalk = !0),
(n.pixelRatio = window.devicePixelRatio || 1),
n
);
})();
}.call(this, i(807)));
},
function (t, e, i) {
t.exports = { ADD: i(861), ERROR: i(862), LOAD: i(863), READY: i(864), REMOVE: i(865) };
},
function (t, e) {
t.exports = {
BYTE: { enum: 5120, size: 1 },
UNSIGNED_BYTE: { enum: 5121, size: 1 },
SHORT: { enum: 5122, size: 2 },
UNSIGNED_SHORT: { enum: 5123, size: 2 },
INT: { enum: 5124, size: 4 },
UNSIGNED_INT: { enum: 5125, size: 4 },
FLOAT: { enum: 5126, size: 4 },
};
},
function (t, e, i) {
var n = i(0),
M = i(59),
s = i(2),
r = i(878),
o = i(879),
a = i(25),
X = i(12),
h = i(107),
l = i(58),
u = new n({
Extends: l,
initialize: function (t) {
var e = t.game.renderer,
i = s(t, "fragShader", r);
(t.fragShader = X.parseFragmentShaderMaxTextures(i, e.maxTextures)),
(t.vertShader = s(t, "vertShader", o)),
(t.attributes = s(t, "attributes", [
{ name: "inPosition", size: 2 },
{ name: "inTexCoord", size: 2 },
{ name: "inTexId" },
{ name: "inTintEffect" },
{ name: "inTint", size: 4, type: h.UNSIGNED_BYTE, normalized: !0 },
])),
l.call(this, t),
(this._tempMatrix1 = new a()),
(this._tempMatrix2 = new a()),
(this._tempMatrix3 = new a()),
(this.calcMatrix = new a()),
(this.tempTriangle = [
{ x: 0, y: 0, width: 0 },
{ x: 0, y: 0, width: 0 },
{ x: 0, y: 0, width: 0 },
{ x: 0, y: 0, width: 0 },
]),
(this.strokeTint = { TL: 0, TR: 0, BL: 0, BR: 0 }),
(this.fillTint = { TL: 0, TR: 0, BL: 0, BR: 0 }),
(this.currentFrame = { u0: 0, v0: 0, u1: 1, v1: 1 }),
(this.firstQuad = [0, 0, 0, 0, 0]),
(this.prevQuad = [0, 0, 0, 0, 0]),
(this.polygonCache = []);
},
boot: function () {
l.prototype.boot.call(this), this.currentShader.set1iv("uMainSampler", this.renderer.textureIndexes);
},
batchSprite: function (t, e, i) {
this.manager.set(this, t);
var n,
s = this._tempMatrix1,
r = this._tempMatrix2,
o = this._tempMatrix3,
a = t.frame,
h = a.glTexture,
l = a.u0,
u = a.v0,
c = a.u1,
d = a.v1,
f = a.x,
p = a.y,
g = a.cutWidth,
v = a.cutHeight,
y = a.customPivot,
m = t.displayOriginX,
x = t.displayOriginY,
b = -m + f,
w = -x + p;
t.isCropped &&
(((n = t._crop).flipX === t.flipX && n.flipY === t.flipY) || a.updateCropUVs(n, t.flipX, t.flipY),
(l = n.u0),
(u = n.v0),
(c = n.u1),
(d = n.v1),
(g = n.width),
(v = n.height),
(b = -m + n.x),
(w = -x + n.y));
var T = 1,
S = 1;
t.flipX && (y || (b += -a.realWidth + 2 * m), (T = -1)),
(t.flipY || (a.source.isGLTexture && !h.flipY)) && (y || (w += -a.realHeight + 2 * x), (S = -1)),
r.applyITRS(t.x, t.y, t.rotation, t.scaleX * T, t.scaleY * S),
s.copyFrom(e.matrix),
i ? (s.multiplyWithOffset(i, -e.scrollX * t.scrollFactorX, -e.scrollY * t.scrollFactorY), (r.e = t.x), (r.f = t.y)) : ((r.e -= e.scrollX * t.scrollFactorX), (r.f -= e.scrollY * t.scrollFactorY)),
s.multiply(r, o);
var _ = b + g,
E = w + v,
P = e.roundPixels,
A = o.getXRound(b, w, P),
M = o.getYRound(b, w, P),
C = o.getXRound(b, E, P),
O = o.getYRound(b, E, P),
k = o.getXRound(_, E, P),
R = o.getYRound(_, E, P),
L = o.getXRound(_, w, P),
I = o.getYRound(_, w, P),
D = X.getTintAppendFloatAlpha,
F = e.alpha,
B = D(t.tintTopLeft, F * t._alphaTL),
N = D(t.tintTopRight, F * t._alphaTR),
U = D(t.tintBottomLeft, F * t._alphaBL),
Y = D(t.tintBottomRight, F * t._alphaBR);
this.shouldFlush(6) && this.flush();
var z = this.setGameObject(t, a);
this.manager.preBatch(t), this.batchQuad(t, A, M, C, O, k, R, L, I, l, u, c, d, B, N, U, Y, t.tintFill, h, z), this.manager.postBatch(t);
},
batchTexture: function (t, e, i, n, s, r, o, a, h, l, u, c, d, f, p, g, v, y, m, x, b, w, T, S, _, E, P, A, M, C, O, k) {
this.manager.set(this, t);
var R,
L,
I,
D,
F,
B = this._tempMatrix1,
N = this._tempMatrix2,
U = this._tempMatrix3,
Y = y / i + P,
z = m / n + A,
X = (y + x) / i + P,
V = (m + b) / n + A,
G = o,
j = a,
H = -g,
W = -v;
t.isCropped &&
((o = G = L = (R = t._crop).width),
(a = j = I = R.height),
(D = y = R.x),
(F = m = R.y),
c && (D = x - R.x - L),
d && (F = b - R.y - I),
(Y = D / i + P),
(z = F / n + A),
(X = (D + L) / i + P),
(V = (F + I) / n + A),
(H = -g + y),
(W = -v + m)),
c && ((G *= -1), (H += o)),
(d ^= !O && e.isRenderTexture ? 1 : 0) && ((j *= -1), (W += a));
var K = H + G,
q = W + j;
N.applyITRS(s, r, u, h, l),
B.copyFrom(M.matrix),
C ? (B.multiplyWithOffset(C, -M.scrollX * f, -M.scrollY * p), (N.e = s), (N.f = r)) : ((N.e -= M.scrollX * f), (N.f -= M.scrollY * p)),
B.multiply(N, U);
var Z = M.roundPixels,
J = U.getXRound(H, W, Z),
Q = U.getYRound(H, W, Z),
$ = U.getXRound(H, q, Z),
tt = U.getYRound(H, q, Z),
et = U.getXRound(K, q, Z),
it = U.getYRound(K, q, Z),
nt = U.getXRound(K, W, Z),
st = U.getYRound(K, W, Z);
void 0 === k && (k = this.renderer.setTexture2D(e)), t && this.manager.preBatch(t), this.batchQuad(t, J, Q, $, tt, et, it, nt, st, Y, z, X, V, w, T, S, _, E, e, k), t && this.manager.postBatch(t);
},
batchTextureFrame: function (t, e, i, n, s, r, o) {
this.manager.set(this);
var a = this._tempMatrix1.copyFrom(r),
h = this._tempMatrix2,
l = e + t.width,
u = i + t.height;
o ? a.multiply(o, h) : (h = a);
var c = h.getX(e, i),
d = h.getY(e, i),
f = h.getX(e, u),
p = h.getY(e, u),
g = h.getX(l, u),
v = h.getY(l, u),
y = h.getX(l, i),
m = h.getY(l, i),
x = this.renderer.setTextureSource(t.source);
(n = X.getTintAppendFloatAlpha(n, s)), this.batchQuad(null, c, d, f, p, g, v, y, m, t.u0, t.v0, t.u1, t.v1, n, n, n, n, 0, t.glTexture, x);
},
batchFillRect: function (t, e, i, n, s, r) {
this.renderer.pipelines.set(this);
var o = this.calcMatrix;
r && r.multiply(s, o);
var a = t + i,
h = e + n,
l = o.getX(t, e),
u = o.getY(t, e),
c = o.getX(t, h),
d = o.getY(t, h),
f = o.getX(a, h),
p = o.getY(a, h),
g = o.getX(a, e),
v = o.getY(a, e),
y = this.fillTint;
this.batchQuad(null, l, u, c, d, f, p, g, v, 0, 0, 1, 1, y.TL, y.TR, y.BL, y.BR, 2);
},
batchFillTriangle: function (t, e, i, n, s, r, o, a) {
this.renderer.pipelines.set(this);
var h = this.calcMatrix;
a && a.multiply(o, h);
var l = h.getX(t, e),
u = h.getY(t, e),
c = h.getX(i, n),
d = h.getY(i, n),
f = h.getX(s, r),
p = h.getY(s, r),
g = this.fillTint;
this.batchTri(null, l, u, c, d, f, p, 0, 0, 1, 1, g.TL, g.TR, g.BL, 2);
},
batchStrokeTriangle: function (t, e, i, n, s, r, o, a, h) {
var l = this.tempTriangle;
(l[0].x = t),
(l[0].y = e),
(l[0].width = o),
(l[1].x = i),
(l[1].y = n),
(l[1].width = o),
(l[2].x = s),
(l[2].y = r),
(l[2].width = o),
(l[3].x = t),
(l[3].y = e),
(l[3].width = o),
this.batchStrokePath(l, o, !1, a, h);
},
batchFillPath: function (t, e, i) {
this.renderer.pipelines.set(this);
var n = this.calcMatrix;
i && i.multiply(e, n);
for (var s, r, o = t.length, a = this.polygonCache, h = this.fillTint.TL, l = this.fillTint.TR, u = this.fillTint.BL, c = 0; c < o; ++c) (r = t[c]), a.push(r.x, r.y);
o = (s = M(a)).length;
for (var d = 0; d < o; d += 3) {
var f = 2 * s[d + 0],
p = 2 * s[d + 1],
g = 2 * s[d + 2],
v = a[0 + f],
y = a[1 + f],
m = a[0 + p],
x = a[1 + p],
b = a[0 + g],
w = a[1 + g],
T = n.getX(v, y),
S = n.getY(v, y),
_ = n.getX(m, x),
E = n.getY(m, x),
P = n.getX(b, w),
A = n.getY(b, w);
this.batchTri(null, T, S, _, E, P, A, 0, 0, 1, 1, h, l, u, 2);
}
a.length = 0;
},
batchStrokePath: function (t, e, i, n, s) {
this.renderer.pipelines.set(this), (this.prevQuad[4] = 0), (this.firstQuad[4] = 0);
for (var r = t.length - 1, o = 0; o < r; o++) {
var a = t[o],
h = t[o + 1];
this.batchLine(a.x, a.y, h.x, h.y, a.width / 2, h.width / 2, e, o, !i && o === r - 1, n, s);
}
},
batchLine: function (t, e, i, n, s, r, o, a, h, l, u) {
this.renderer.pipelines.set(this);
var c = this.calcMatrix;
u && u.multiply(l, c);
var d,
f,
p = i - t,
g = n - e,
v = Math.sqrt(p * p + g * g),
y = (s * (n - e)) / v,
m = (s * (t - i)) / v,
x = (r * (n - e)) / v,
b = (r * (t - i)) / v,
w = i - x,
T = n - b,
S = t - y,
_ = e - m,
E = i + x,
P = n + b,
A = t + y,
M = e + m,
C = c.getX(w, T),
O = c.getY(w, T),
k = c.getX(S, _),
R = c.getY(S, _),
L = c.getX(E, P),
I = c.getY(E, P),
D = c.getX(A, M),
F = c.getY(A, M),
B = this.strokeTint,
N = B.TL,
U = B.TR,
Y = B.BL,
z = B.BR;
this.batchQuad(null, D, F, k, R, C, O, L, I, 0, 0, 1, 1, N, U, Y, z, 2),
o <= 2 ||
((d = this.prevQuad),
(f = this.firstQuad),
0 < a && d[4] ? this.batchQuad(null, D, F, k, R, d[0], d[1], d[2], d[3], 0, 0, 1, 1, N, U, Y, z, 2) : ((f[0] = D), (f[1] = F), (f[2] = k), (f[3] = R), (f[4] = 1)),
h && f[4] ? this.batchQuad(null, C, O, L, I, f[0], f[1], f[2], f[3], 0, 0, 1, 1, N, U, Y, z, 2) : ((d[0] = C), (d[1] = O), (d[2] = L), (d[3] = I), (d[4] = 1)));
},
});
t.exports = u;
},
function (t, e, i) {
var n = i(0),
A = i(18),
s = i(17),
r = new n({
initialize: function (t, e, i, n, s, r, o) {
(this.texture = t),
(this.name = e),
(this.source = t.source[i]),
(this.sourceIndex = i),
(this.glTexture = this.source.glTexture),
this.cutX,
this.cutY,
this.cutWidth,
this.cutHeight,
(this.x = 0),
(this.y = 0),
this.width,
this.height,
this.halfWidth,
this.halfHeight,
this.centerX,
this.centerY,
(this.pivotX = 0),
(this.pivotY = 0),
(this.customPivot = !1),
(this.rotated = !1),
(this.autoRound = -1),
(this.customData = {}),
(this.u0 = 0),
(this.v0 = 0),
(this.u1 = 0),
(this.v1 = 0),
(this.data = {
cut: { x: 0, y: 0, w: 0, h: 0, r: 0, b: 0 },
trim: !1,
sourceSize: { w: 0, h: 0 },
spriteSourceSize: { x: 0, y: 0, w: 0, h: 0, r: 0, b: 0 },
radius: 0,
drawImage: { x: 0, y: 0, width: 0, height: 0 },
}),
this.setSize(r, o, n, s);
},
setSize: function (t, e, i, n) {
void 0 === i && (i = 0),
void 0 === n && (n = 0),
(this.cutX = i),
(this.cutY = n),
(this.cutWidth = t),
(this.cutHeight = e),
(this.width = t),
(this.height = e),
(this.halfWidth = Math.floor(0.5 * t)),
(this.halfHeight = Math.floor(0.5 * e)),
(this.centerX = Math.floor(t / 2)),
(this.centerY = Math.floor(e / 2));
var s = this.data,
r = s.cut;
(r.x = i),
(r.y = n),
(r.w = t),
(r.h = e),
(r.r = i + t),
(r.b = n + e),
(s.sourceSize.w = t),
(s.sourceSize.h = e),
(s.spriteSourceSize.w = t),
(s.spriteSourceSize.h = e),
(s.radius = 0.5 * Math.sqrt(t * t + e * e));
var o = s.drawImage;
return (o.x = i), (o.y = n), (o.width = t), (o.height = e), this.updateUVs();
},
setTrim: function (t, e, i, n, s, r) {
var o = this.data,
a = o.spriteSourceSize;
return (
(o.trim = !0),
(o.sourceSize.w = t),
(o.sourceSize.h = e),
(a.x = i),
(a.y = n),
(a.w = s),
(a.h = r),
(a.r = i + s),
(a.b = n + r),
(this.x = i),
(this.y = n),
(this.width = s),
(this.height = r),
(this.halfWidth = 0.5 * s),
(this.halfHeight = 0.5 * r),
(this.centerX = Math.floor(s / 2)),
(this.centerY = Math.floor(r / 2)),
this.updateUVs()
);
},
setCropUVs: function (t, e, i, n, s, r, o) {
var a,
h,
l,
u,
c,
d,
f,
p = this.cutX,
g = this.cutY,
v = this.cutWidth,
y = this.cutHeight,
m = this.realWidth,
x = this.realHeight,
b = p + (e = A(e, 0, m)),
w = g + (i = A(i, 0, x)),
T = (n = A(n, 0, m - e)),
S = (s = A(s, 0, x - i)),
_ = this.data;
_.trim
? ((a = _.spriteSourceSize),
(h = e + (n = A(n, 0, v - e))),
(l = i + (s = A(s, 0, y - i))),
a.r < e || a.b < i || a.x > h || a.y > l
? (S = T = w = b = 0)
: ((u = Math.max(a.x, e)),
(c = Math.max(a.y, i)),
(T = d = Math.min(a.r, h) - u),
(S = f = Math.min(a.b, l) - c),
(b = r ? p + (v - (u - a.x) - d) : p + (u - a.x)),
(w = o ? g + (y - (c - a.y) - f) : g + (c - a.y)),
(e = u),
(i = c),
(n = d),
(s = f)))
: (r && (b = p + (v - e - n)), o && (w = g + (y - i - s)));
var E = this.source.width,
P = this.source.height;
return (
(t.u0 = Math.max(0, b / E)),
(t.v0 = Math.max(0, w / P)),
(t.u1 = Math.min(1, (b + T) / E)),
(t.v1 = Math.min(1, (w + S) / P)),
(t.x = e),
(t.y = i),
(t.cx = b),
(t.cy = w),
(t.cw = T),
(t.ch = S),
(t.width = n),
(t.height = s),
(t.flipX = r),
(t.flipY = o),
t
);
},
updateCropUVs: function (t, e, i) {
return this.setCropUVs(t, t.x, t.y, t.width, t.height, e, i);
},
setUVs: function (t, e, i, n, s, r) {
var o = this.data.drawImage;
return (o.width = t), (o.height = e), (this.u0 = i), (this.v0 = n), (this.u1 = s), (this.v1 = r), this;
},
updateUVs: function () {
var t = this.cutX,
e = this.cutY,
i = this.cutWidth,
n = this.cutHeight,
s = this.data.drawImage;
(s.width = i), (s.height = n);
var r = this.source.width,
o = this.source.height;
return (this.u0 = t / r), (this.v0 = e / o), (this.u1 = (t + i) / r), (this.v1 = (e + n) / o), this;
},
updateUVsInverted: function () {
var t = this.source.width,
e = this.source.height;
return (this.u0 = (this.cutX + this.cutHeight) / t), (this.v0 = this.cutY / e), (this.u1 = this.cutX / t), (this.v1 = (this.cutY + this.cutWidth) / e), this;
},
clone: function () {
var t = new r(this.texture, this.name, this.sourceIndex);
return (
(t.cutX = this.cutX),
(t.cutY = this.cutY),
(t.cutWidth = this.cutWidth),
(t.cutHeight = this.cutHeight),
(t.x = this.x),
(t.y = this.y),
(t.width = this.width),
(t.height = this.height),
(t.halfWidth = this.halfWidth),
(t.halfHeight = this.halfHeight),
(t.centerX = this.centerX),
(t.centerY = this.centerY),
(t.rotated = this.rotated),
(t.data = s(!0, t.data, this.data)),
t.updateUVs(),
t
);
},
destroy: function () {
(this.source = null), (this.texture = null), (this.glTexture = null), (this.customData = null), (this.data = null);
},
realWidth: {
get: function () {
return this.data.sourceSize.w;
},
},
realHeight: {
get: function () {
return this.data.sourceSize.h;
},
},
radius: {
get: function () {
return this.data.radius;
},
},
trimmed: {
get: function () {
return this.data.trim;
},
},
canvasData: {
get: function () {
return this.data.drawImage;
},
},
});
t.exports = r;
},
function (t, e, i) {
var s = i(208),
n = i(0),
r = i(1),
o = i(79),
a = new n({
initialize: function (t) {
(this.parent = t), (this.list = []), (this.position = 0), (this.addCallback = r), (this.removeCallback = r), (this._sortKey = "");
},
add: function (t, e) {
return e ? s.Add(this.list, t) : s.Add(this.list, t, 0, this.addCallback, this);
},
addAt: function (t, e, i) {
return i ? s.AddAt(this.list, t, e) : s.AddAt(this.list, t, e, 0, this.addCallback, this);
},
getAt: function (t) {
return this.list[t];
},
getIndex: function (t) {
return this.list.indexOf(t);
},
sort: function (i, t) {
return (
i &&
(void 0 === t &&
(t = function (t, e) {
return t[i] - e[i];
}),
o(this.list, t)),
this
);
},
getByName: function (t) {
return s.GetFirst(this.list, "name", t);
},
getRandom: function (t, e) {
return s.GetRandom(this.list, t, e);
},
getFirst: function (t, e, i, n) {
return s.GetFirst(this.list, t, e, i, n);
},
getAll: function (t, e, i, n) {
return s.GetAll(this.list, t, e, i, n);
},
count: function (t, e) {
return s.CountAllMatching(this.list, t, e);
},
swap: function (t, e) {
s.Swap(this.list, t, e);
},
moveTo: function (t, e) {
return s.MoveTo(this.list, t, e);
},
moveAbove: function (t, e) {
return s.MoveAbove(this.list, t, e);
},
moveBelow: function (t, e) {
return s.MoveBelow(this.list, t, e);
},
remove: function (t, e) {
return e ? s.Remove(this.list, t) : s.Remove(this.list, t, this.removeCallback, this);
},
removeAt: function (t, e) {
return e ? s.RemoveAt(this.list, t) : s.RemoveAt(this.list, t, this.removeCallback, this);
},
removeBetween: function (t, e, i) {
return i ? s.RemoveBetween(this.list, t, e) : s.RemoveBetween(this.list, t, e, this.removeCallback, this);
},
removeAll: function (t) {
for (var e = this.list.length; e--; ) this.remove(this.list[e], t);
return this;
},
bringToTop: function (t) {
return s.BringToTop(this.list, t);
},
sendToBack: function (t) {
return s.SendToBack(this.list, t);
},
moveUp: function (t) {
return s.MoveUp(this.list, t), t;
},
moveDown: function (t) {
return s.MoveDown(this.list, t), t;
},
reverse: function () {
return this.list.reverse(), this;
},
shuffle: function () {
return s.Shuffle(this.list), this;
},
replace: function (t, e) {
return s.Replace(this.list, t, e);
},
exists: function (t) {
return -1 < this.list.indexOf(t);
},
setAll: function (t, e, i, n) {
return s.SetAll(this.list, t, e, i, n), this;
},
each: function (t, e) {
for (var i = [null], n = 2; n < arguments.length; n++) i.push(arguments[n]);
for (n = 0; n < this.list.length; n++) (i[0] = this.list[n]), t.apply(e, i);
},
shutdown: function () {
this.removeAll(), (this.list = []);
},
destroy: function () {
this.removeAll(), (this.parent = null), (this.addCallback = null), (this.removeCallback = null);
},
length: {
get: function () {
return this.list.length;
},
},
first: {
get: function () {
return (this.position = 0) < this.list.length ? this.list[0] : null;
},
},
last: {
get: function () {
return 0 < this.list.length ? ((this.position = this.list.length - 1), this.list[this.position]) : null;
},
},
next: {
get: function () {
return this.position < this.list.length ? (this.position++, this.list[this.position]) : null;
},
},
previous: {
get: function () {
return 0 < this.position ? (this.position--, this.list[this.position]) : null;
},
},
});
t.exports = a;
},
function (t, e, i) {
var n = i(0),
s = i(112),
r = i(445),
o = i(446),
a = i(56),
h = i(180),
l = new n({
initialize: function (t, e, i, n) {
void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === n && (n = 0), (this.type = a.ELLIPSE), (this.x = t), (this.y = e), (this.width = i), (this.height = n);
},
contains: function (t, e) {
return s(this, t, e);
},
getPoint: function (t, e) {
return r(this, t, e);
},
getPoints: function (t, e, i) {
return o(this, t, e, i);
},
getRandomPoint: function (t) {
return h(this, t);
},
setTo: function (t, e, i, n) {
return (this.x = t), (this.y = e), (this.width = i), (this.height = n), this;
},
setEmpty: function () {
return (this.width = 0), (this.height = 0), this;
},
setPosition: function (t, e) {
return void 0 === e && (e = t), (this.x = t), (this.y = e), this;
},
setSize: function (t, e) {
return void 0 === e && (e = t), (this.width = t), (this.height = e), this;
},
isEmpty: function () {
return this.width <= 0 || this.height <= 0;
},
getMinorRadius: function () {
return Math.min(this.width, this.height) / 2;
},
getMajorRadius: function () {
return Math.max(this.width, this.height) / 2;
},
left: {
get: function () {
return this.x - this.width / 2;
},
set: function (t) {
this.x = t + this.width / 2;
},
},
right: {
get: function () {
return this.x + this.width / 2;
},
set: function (t) {
this.x = t - this.width / 2;
},
},
top: {
get: function () {
return this.y - this.height / 2;
},
set: function (t) {
this.y = t + this.height / 2;
},
},
bottom: {
get: function () {
return this.y + this.height / 2;
},
set: function (t) {
this.y = t - this.height / 2;
},
},
});
t.exports = l;
},
function (t, e) {
t.exports = function (t, e, i) {
if (t.width <= 0 || t.height <= 0) return !1;
var n = (e - t.x) / t.width,
s = (i - t.y) / t.height;
return (n *= n) + (s *= s) < 0.25;
};
},
function (t, e, i) {
var z = i(275),
n = i(0),
r = i(75),
s = i(9),
o = i(207),
X = i(2),
V = i(6),
a = i(7),
G = i(437),
h = i(149),
l = i(73),
u = new n({
Extends: s,
initialize: function (t, e, i) {
s.call(this),
i ? e && !Array.isArray(e) && (e = [e]) : Array.isArray(e) ? a(e[0]) && ((i = e), (e = null)) : a(e) && ((i = e), (e = null)),
(this.scene = t),
(this.children = new h()),
(this.isParent = !0),
(this.type = "Group"),
(this.classType = X(i, "classType", l)),
(this.name = X(i, "name", "")),
(this.active = X(i, "active", !0)),
(this.maxSize = X(i, "maxSize", -1)),
(this.defaultKey = X(i, "defaultKey", null)),
(this.defaultFrame = X(i, "defaultFrame", null)),
(this.runChildUpdate = X(i, "runChildUpdate", !1)),
(this.createCallback = X(i, "createCallback", null)),
(this.removeCallback = X(i, "removeCallback", null)),
(this.createMultipleCallback = X(i, "createMultipleCallback", null)),
(this.internalCreateCallback = X(i, "internalCreateCallback", null)),
(this.internalRemoveCallback = X(i, "internalRemoveCallback", null)),
e && this.addMultiple(e),
i && this.createMultiple(i),
this.on(r.ADDED_TO_SCENE, this.addedToScene, this),
this.on(r.REMOVED_FROM_SCENE, this.removedFromScene, this);
},
addedToScene: function () {
this.scene.sys.updateList.add(this);
},
removedFromScene: function () {
this.scene.sys.updateList.remove(this);
},
create: function (t, e, i, n, s, r) {
if (
(void 0 === t && (t = 0),
void 0 === e && (e = 0),
void 0 === i && (i = this.defaultKey),
void 0 === n && (n = this.defaultFrame),
void 0 === s && (s = !0),
void 0 === r && (r = !0),
this.isFull())
)
return null;
var o = new this.classType(this.scene, t, e, i, n);
return o.addToDisplayList(this.scene.sys.displayList), o.addToUpdateList(), (o.visible = s), o.setActive(r), this.add(o), o;
},
createMultiple: function (t) {
if (this.isFull()) return [];
Array.isArray(t) || (t = [t]);
var e = [];
if (t[0].key)
for (var i = 0; i < t.length; i++) {
var n = this.createFromConfig(t[i]);
e = e.concat(n);
}
return e;
},
createFromConfig: function (t) {
if (this.isFull()) return [];
this.classType = X(t, "classType", this.classType);
var e = X(t, "key", void 0),
i = X(t, "frame", null),
n = X(t, "visible", !0),
s = X(t, "active", !0),
r = [];
if (void 0 === e) return r;
Array.isArray(e) || (e = [e]), Array.isArray(i) || (i = [i]);
var o = X(t, "repeat", 0),
a = X(t, "randomKey", !1),
h = X(t, "randomFrame", !1),
l = X(t, "yoyo", !1),
u = X(t, "quantity", !1),
c = X(t, "frameQuantity", 1),
d = X(t, "max", 0),
f = G(e, i, { max: d, qty: u || c, random: a, randomB: h, repeat: o, yoyo: l });
t.createCallback && (this.createCallback = t.createCallback), t.removeCallback && (this.removeCallback = t.removeCallback);
for (var p = 0; p < f.length; p++) {
var g = this.create(0, 0, f[p].a, f[p].b, n, s);
if (!g) break;
r.push(g);
}
var v = V(t, "setXY.x", 0),
y = V(t, "setXY.y", 0),
m = V(t, "setXY.stepX", 0),
x = V(t, "setXY.stepY", 0);
z.SetXY(r, v, y, m, x);
var b = V(t, "setRotation.value", 0),
w = V(t, "setRotation.step", 0);
z.SetRotation(r, b, w);
var T = V(t, "setScale.x", 1),
S = V(t, "setScale.y", T),
_ = V(t, "setScale.stepX", 0),
E = V(t, "setScale.stepY", 0);
z.SetScale(r, T, S, _, E);
var P = V(t, "setOrigin.x", 0.5),
A = V(t, "setOrigin.y", P),
M = V(t, "setOrigin.stepX", 0),
C = V(t, "setOrigin.stepY", 0);
z.SetOrigin(r, P, A, M, C);
var O = V(t, "setAlpha.value", 1),
k = V(t, "setAlpha.step", 0);
z.SetAlpha(r, O, k);
var R = V(t, "setDepth.value", 0),
L = V(t, "setDepth.step", 0);
z.SetDepth(r, R, L);
var I = V(t, "setScrollFactor.x", 1),
D = V(t, "setScrollFactor.y", I),
F = V(t, "setScrollFactor.stepX", 0),
B = V(t, "setScrollFactor.stepY", 0);
z.SetScrollFactor(r, I, D, F, B);
var N = X(t, "hitArea", null),
U = X(t, "hitAreaCallback", null);
N && z.SetHitArea(r, N, U);
var Y = X(t, "gridAlign", !1);
return Y && z.GridAlign(r, Y), this.createMultipleCallback && this.createMultipleCallback.call(this, r), r;
},
preUpdate: function (t, e) {
if (this.runChildUpdate && 0 !== this.children.size)
for (var i = this.children.entries.slice(), n = 0; n < i.length; n++) {
var s = i[n];
s.active && s.update(t, e);
}
},
add: function (t, e) {
return (
void 0 === e && (e = !1),
this.isFull() ||
(this.children.set(t),
this.internalCreateCallback && this.internalCreateCallback.call(this, t),
this.createCallback && this.createCallback.call(this, t),
e && (t.addToDisplayList(this.scene.sys.displayList), t.addToUpdateList()),
t.on(r.DESTROY, this.remove, this)),
this
);
},
addMultiple: function (t, e) {
if ((void 0 === e && (e = !1), Array.isArray(t))) for (var i = 0; i < t.length; i++) this.add(t[i], e);
return this;
},
remove: function (t, e, i) {
return (
void 0 === e && (e = !1),
void 0 === i && (i = !1),
this.children.contains(t) &&
(this.children.delete(t),
this.internalRemoveCallback && this.internalRemoveCallback.call(this, t),
this.removeCallback && this.removeCallback.call(this, t),
t.off(r.DESTROY, this.remove, this),
i ? t.destroy() : e && (t.removeFromDisplayList(), t.removeFromUpdateList())),
this
);
},
clear: function (t, e) {
void 0 === t && (t = !1), void 0 === e && (e = !1);
for (var i = this.children, n = 0; n < i.size; n++) {
var s = i.entries[n];
s.off(r.DESTROY, this.remove, this), e ? s.destroy() : t && (s.removeFromDisplayList(), s.removeFromUpdateList());
}
return this.children.clear(), this;
},
contains: function (t) {
return this.children.contains(t);
},
getChildren: function () {
return this.children.entries;
},
getLength: function () {
return this.children.size;
},
getMatching: function (t, e, i, n) {
return o(this.children.entries, t, e, i, n);
},
getFirst: function (t, e, i, n, s, r, o) {
return this.getHandler(!0, 1, t, e, i, n, s, r, o);
},
getFirstNth: function (t, e, i, n, s, r, o, a) {
return this.getHandler(!0, t, e, i, n, s, r, o, a);
},
getLast: function (t, e, i, n, s, r, o) {
return this.getHandler(!1, 1, t, e, i, n, s, r, o);
},
getLastNth: function (t, e, i, n, s, r, o, a) {
return this.getHandler(!1, t, e, i, n, s, r, o, a);
},
getHandler: function (t, e, i, n, s, r, o, a, h) {
var l, u;
void 0 === i && (i = !1), void 0 === n && (n = !1);
var c = 0,
d = this.children.entries;
if (t)
for (u = 0; u < d.length; u++)
if ((l = d[u]).active === i) {
if (++c === e) break;
} else l = null;
else
for (u = d.length - 1; 0 <= u; u--)
if ((l = d[u]).active === i) {
if (++c === e) break;
} else l = null;
return l ? ("number" == typeof s && (l.x = s), "number" == typeof r && (l.y = r), l) : n ? this.create(s, r, o, a, h) : null;
},
get: function (t, e, i, n, s) {
return this.getFirst(!1, !0, t, e, i, n, s);
},
getFirstAlive: function (t, e, i, n, s, r) {
return this.getFirst(!0, t, e, i, n, s, r);
},
getFirstDead: function (t, e, i, n, s, r) {
return this.getFirst(!1, t, e, i, n, s, r);
},
playAnimation: function (t, e) {
return z.PlayAnimation(this.children.entries, t, e), this;
},
isFull: function () {
return -1 !== this.maxSize && this.children.size >= this.maxSize;
},
countActive: function (t) {
void 0 === t && (t = !0);
for (var e = 0, i = 0; i < this.children.size; i++) this.children.entries[i].active === t && e++;
return e;
},
getTotalUsed: function () {
return this.countActive();
},
getTotalFree: function () {
var t = this.getTotalUsed();
return (-1 === this.maxSize ? 999999999999 : this.maxSize) - t;
},
setActive: function (t) {
return (this.active = t), this;
},
setName: function (t) {
return (this.name = t), this;
},
propertyValueSet: function (t, e, i, n, s) {
return z.PropertyValueSet(this.children.entries, t, e, i, n, s), this;
},
propertyValueInc: function (t, e, i, n, s) {
return z.PropertyValueInc(this.children.entries, t, e, i, n, s), this;
},
setX: function (t, e) {
return z.SetX(this.children.entries, t, e), this;
},
setY: function (t, e) {
return z.SetY(this.children.entries, t, e), this;
},
setXY: function (t, e, i, n) {
return z.SetXY(this.children.entries, t, e, i, n), this;
},
incX: function (t, e) {
return z.IncX(this.children.entries, t, e), this;
},
incY: function (t, e) {
return z.IncY(this.children.entries, t, e), this;
},
incXY: function (t, e, i, n) {
return z.IncXY(this.children.entries, t, e, i, n), this;
},
shiftPosition: function (t, e, i) {
return z.ShiftPosition(this.children.entries, t, e, i), this;
},
angle: function (t, e) {
return z.Angle(this.children.entries, t, e), this;
},
rotate: function (t, e) {
return z.Rotate(this.children.entries, t, e), this;
},
rotateAround: function (t, e) {
return z.RotateAround(this.children.entries, t, e), this;
},
rotateAroundDistance: function (t, e, i) {
return z.RotateAroundDistance(this.children.entries, t, e, i), this;
},
setAlpha: function (t, e) {
return z.SetAlpha(this.children.entries, t, e), this;
},
setTint: function (t, e, i, n) {
return z.SetTint(this.children.entries, t, e, i, n), this;
},
setOrigin: function (t, e, i, n) {
return z.SetOrigin(this.children.entries, t, e, i, n), this;
},
scaleX: function (t, e) {
return z.ScaleX(this.children.entries, t, e), this;
},
scaleY: function (t, e) {
return z.ScaleY(this.children.entries, t, e), this;
},
scaleXY: function (t, e, i, n) {
return z.ScaleXY(this.children.entries, t, e, i, n), this;
},
setDepth: function (t, e) {
return z.SetDepth(this.children.entries, t, e), this;
},
setBlendMode: function (t) {
return z.SetBlendMode(this.children.entries, t), this;
},
setHitArea: function (t, e) {
return z.SetHitArea(this.children.entries, t, e), this;
},
shuffle: function () {
return z.Shuffle(this.children.entries), this;
},
kill: function (t) {
this.children.contains(t) && t.setActive(!1);
},
killAndHide: function (t) {
this.children.contains(t) && (t.setActive(!1), t.setVisible(!1));
},
setVisible: function (t, e, i) {
return z.SetVisible(this.children.entries, t, e, i), this;
},
toggleVisible: function () {
return z.ToggleVisible(this.children.entries), this;
},
destroy: function (t, e) {
void 0 === t && (t = !1),
void 0 === e && (e = !1),
this.scene &&
!this.ignoreDestroy &&
(this.emit(r.DESTROY, this), this.removeAllListeners(), this.scene.sys.updateList.remove(this), this.clear(e, t), (this.scene = void 0), (this.children = void 0));
},
});
t.exports = u;
},
function (t, e, i) {
var E = i(12);
t.exports = function (t, e, i, n, s, r) {
for (var o = E.getTintAppendFloatAlpha(i.fillColor, i.fillAlpha * n), a = i.pathData, h = i.pathIndexes, l = 0; l < h.length; l += 3) {
var u = 2 * h[l],
c = 2 * h[l + 1],
d = 2 * h[l + 2],
f = a[0 + u] - s,
p = a[1 + u] - r,
g = a[0 + c] - s,
v = a[1 + c] - r,
y = a[0 + d] - s,
m = a[1 + d] - r,
x = e.getX(f, p),
b = e.getY(f, p),
w = e.getX(g, v),
T = e.getY(g, v),
S = e.getX(y, m),
_ = e.getY(y, m);
t.batchTri(i, x, b, w, T, S, _, 0, 0, 1, 1, o, o, o, 2);
}
};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = t.x3 - t.x1,
s = t.y3 - t.y1,
r = t.x2 - t.x1,
o = t.y2 - t.y1,
a = e - t.x1,
h = i - t.y1,
l = n * n + s * s,
u = n * r + s * o,
c = n * a + s * h,
d = r * r + o * o,
f = r * a + o * h,
p = l * d - u * u,
g = 0 == p ? 0 : 1 / p,
v = (d * c - u * f) * g,
y = (l * f - u * c) * g;
return 0 <= v && 0 <= y && v + y < 1;
};
},
function (t, e, i) {
var n = i(0),
s = i(10),
r = i(3);
function p(t, e, i, n) {
var s = t - i,
r = e - n,
o = s * s + r * r;
return Math.sqrt(o);
}
var o = new n({
initialize: function (t, e, i) {
(this.vertex1 = t), (this.vertex2 = e), (this.vertex3 = i), (this.bounds = new s()), (this._inCenter = new r());
},
getInCenter: function (t) {
void 0 === t && (t = !0);
var e,
i,
n,
s,
r,
o = this.vertex1,
a = this.vertex2,
h = this.vertex3,
l = t ? ((e = o.x), (i = o.y), (n = a.x), (s = a.y), (r = h.x), h.y) : ((e = o.vx), (i = o.vy), (n = a.vx), (s = a.vy), (r = h.vx), h.vy),
u = p(r, l, n, s),
c = p(e, i, r, l),
d = p(n, s, e, i),
f = u + c + d;
return this._inCenter.set((e * u + n * c + r * d) / f, (i * u + s * c + l * d) / f);
},
contains: function (t, e, i) {
var n,
s,
r,
o,
a,
h,
l = this.vertex1,
u = this.vertex2,
c = this.vertex3,
d = l.vx,
f = l.vy,
p = u.vx,
g = u.vy,
v = c.vx,
y = c.vy;
i &&
((n = i.a),
(s = i.b),
(r = i.c),
(o = i.d),
(a = i.e),
(h = i.f),
(d = l.vx * n + l.vy * r + a),
(f = l.vx * s + l.vy * o + h),
(p = u.vx * n + u.vy * r + a),
(g = u.vx * s + u.vy * o + h),
(v = c.vx * n + c.vy * r + a),
(y = c.vx * s + c.vy * o + h));
var m = v - d,
x = y - f,
b = p - d,
w = g - f,
T = t - d,
S = e - f,
_ = m * m + x * x,
E = m * b + x * w,
P = m * T + x * S,
A = b * b + w * w,
M = b * T + w * S,
C = _ * A - E * E,
O = 0 == C ? 0 : 1 / C,
k = (A * P - E * M) * O,
R = (_ * M - E * P) * O;
return 0 <= k && 0 <= R && k + R < 1;
},
isCounterClockwise: function (t) {
var e = this.vertex1,
i = this.vertex2,
n = this.vertex3,
s = (i.vx - e.vx) * (n.vy - e.vy) - (i.vy - e.vy) * (n.vx - e.vx);
return t <= 0 ? 0 <= s : s < 0;
},
load: function (t, e, i, n, s) {
return (i = this.vertex1.load(t, e, i, n, s)), (i = this.vertex2.load(t, e, i, n, s)), this.vertex3.load(t, e, i, n, s);
},
transformCoordinatesLocal: function (t, e, i, n) {
return this.vertex1.transformCoordinatesLocal(t, e, i, n), this.vertex2.transformCoordinatesLocal(t, e, i, n), this.vertex3.transformCoordinatesLocal(t, e, i, n), this;
},
updateBounds: function () {
var t = this.vertex1,
e = this.vertex2,
i = this.vertex3,
n = this.bounds;
return (n.x = Math.min(t.vx, e.vx, i.vx)), (n.y = Math.min(t.vy, e.vy, i.vy)), (n.width = Math.max(t.vx, e.vx, i.vx) - n.x), (n.height = Math.max(t.vy, e.vy, i.vy) - n.y), this;
},
isInView: function (t, e, i, n, s, r, o, a, h, l, u) {
var c = this.vertex1.update(s, r, o, a, h, l, u, n),
d = this.vertex2.update(s, r, o, a, h, l, u, n),
f = this.vertex3.update(s, r, o, a, h, l, u, n);
if (c.ta <= 0 && d.ta <= 0 && f.ta <= 0) return !1;
if (e && !this.isCounterClockwise(i)) return !1;
var p = this.bounds;
(p.x = Math.min(c.tx, d.tx, f.tx)), (p.y = Math.min(c.ty, d.ty, f.ty)), (p.width = Math.max(c.tx, d.tx, f.tx) - p.x), (p.height = Math.max(c.ty, d.ty, f.ty) - p.y);
var g = t.x + t.width,
v = t.y + t.height;
return !(p.width <= 0 || p.height <= 0 || t.width <= 0 || t.height <= 0 || p.right < t.x || p.bottom < t.y || p.x > g || p.y > v);
},
translate: function (t, e) {
void 0 === e && (e = 0);
var i = this.vertex1,
n = this.vertex2,
s = this.vertex3;
return (i.x += t), (i.y += e), (n.x += t), (n.y += e), (s.x += t), (s.y += e), this;
},
x: {
get: function () {
return this.getInCenter().x;
},
set: function (t) {
var e = this.getInCenter();
this.translate(t - e.x, 0);
},
},
y: {
get: function () {
return this.getInCenter().y;
},
set: function (t) {
var e = this.getInCenter();
this.translate(0, t - e.y);
},
},
alpha: {
get: function () {
var t = this.vertex1,
e = this.vertex2,
i = this.vertex3;
return (t.alpha + e.alpha + i.alpha) / 3;
},
set: function (t) {
(this.vertex1.alpha = t), (this.vertex2.alpha = t), (this.vertex3.alpha = t);
},
},
depth: {
get: function () {
var t = this.vertex1,
e = this.vertex2,
i = this.vertex3;
return (t.vz + e.vz + i.vz) / 3;
},
},
destroy: function () {
(this.vertex1 = null), (this.vertex2 = null), (this.vertex3 = null);
},
});
t.exports = o;
},
function (t, e, i) {
var n = i(0),
r = i(12),
u = i(39),
s = new n({
Extends: u,
initialize: function (t, e, i, n, s, r, o, a, h, l) {
void 0 === r && (r = 16777215),
void 0 === o && (o = 1),
void 0 === a && (a = 0),
void 0 === h && (h = 0),
void 0 === l && (l = 0),
u.call(this, t, e, i),
(this.vx = 0),
(this.vy = 0),
(this.vz = 0),
(this.nx = a),
(this.ny = h),
(this.nz = l),
(this.u = n),
(this.v = s),
(this.color = r),
(this.alpha = o),
(this.tx = 0),
(this.ty = 0),
(this.ta = 0);
},
setUVs: function (t, e) {
return (this.u = t), (this.v = e), this;
},
transformCoordinatesLocal: function (t, e, i, n) {
var s = this.x,
r = this.y,
o = this.z,
a = t.val,
h = s * a[0] + r * a[4] + o * a[8] + a[12],
l = s * a[1] + r * a[5] + o * a[9] + a[13],
u = s * a[2] + r * a[6] + o * a[10] + a[14],
c = s * a[3] + r * a[7] + o * a[11] + a[15];
(this.vx = (h / c) * e), (this.vy = (-l / c) * i), (this.vz = n <= 0 ? u / c : -u / c);
},
update: function (t, e, i, n, s, r, o, a) {
var h = this.vx * t + this.vy * i + s,
l = this.vx * e + this.vy * n + r;
return o && ((h = Math.round(h)), (l = Math.round(l))), (this.tx = h), (this.ty = l), (this.ta = this.alpha * a), this;
},
load: function (t, e, i, n, s) {
return (t[++i] = this.tx), (t[++i] = this.ty), (t[++i] = this.u), (t[++i] = this.v), (t[++i] = n), (t[++i] = s), (e[++i] = r.getTintAppendFloatAlpha(this.color, this.ta)), i;
},
});
t.exports = s;
},
function (t, e, i) {
var c = {};
t.exports = c;
var o = i(166),
r = i(32),
a = i(84),
d = i(41);
(c.create = function (t) {
return r.extend({ id: r.nextId(), type: "composite", parent: null, isModified: !1, bodies: [], constraints: [], composites: [], label: "Composite", plugin: {} }, t);
}),
(c.setModified = function (t, e, i, n) {
if ((o.trigger(t, "compositeModified", t), (t.isModified = e), i && t.parent && c.setModified(t.parent, e, i, n), n))
for (var s = 0; s < t.composites.length; s++) {
var r = t.composites[s];
c.setModified(r, e, i, n);
}
}),
(c.add = function (t, e) {
var i = [].concat(e);
o.trigger(t, "beforeAdd", { object: e });
for (var n = 0; n < i.length; n++) {
var s = i[n];
switch (s.type) {
case "body":
if (s.parent !== s) {
r.warn("Composite.add: skipped adding a compound body part (you must add its parent instead)");
break;
}
c.addBody(t, s);
break;
case "constraint":
c.addConstraint(t, s);
break;
case "composite":
c.addComposite(t, s);
break;
case "mouseConstraint":
c.addConstraint(t, s.constraint);
}
}
return o.trigger(t, "afterAdd", { object: e }), t;
}),
(c.remove = function (t, e, i) {
var n = [].concat(e);
o.trigger(t, "beforeRemove", { object: e });
for (var s = 0; s < n.length; s++) {
var r = n[s];
switch (r.type) {
case "body":
c.removeBody(t, r, i);
break;
case "constraint":
c.removeConstraint(t, r, i);
break;
case "composite":
c.removeComposite(t, r, i);
break;
case "mouseConstraint":
c.removeConstraint(t, r.constraint);
}
}
return o.trigger(t, "afterRemove", { object: e }), t;
}),
(c.addComposite = function (t, e) {
return t.composites.push(e), (e.parent = t), c.setModified(t, !0, !0, !1), t;
}),
(c.removeComposite = function (t, e, i) {
var n = t.composites.indexOf(e);
if ((-1 !== n && (c.removeCompositeAt(t, n), c.setModified(t, !0, !0, !1)), i)) for (var s = 0; s < t.composites.length; s++) c.removeComposite(t.composites[s], e, !0);
return t;
}),
(c.removeCompositeAt = function (t, e) {
return t.composites.splice(e, 1), c.setModified(t, !0, !0, !1), t;
}),
(c.addBody = function (t, e) {
return t.bodies.push(e), c.setModified(t, !0, !0, !1), t;
}),
(c.removeBody = function (t, e, i) {
var n = t.bodies.indexOf(e);
if ((-1 !== n && (c.removeBodyAt(t, n), c.setModified(t, !0, !0, !1)), i)) for (var s = 0; s < t.composites.length; s++) c.removeBody(t.composites[s], e, !0);
return t;
}),
(c.removeBodyAt = function (t, e) {
return t.bodies.splice(e, 1), c.setModified(t, !0, !0, !1), t;
}),
(c.addConstraint = function (t, e) {
return t.constraints.push(e), c.setModified(t, !0, !0, !1), t;
}),
(c.removeConstraint = function (t, e, i) {
var n = t.constraints.indexOf(e);
if ((-1 !== n && c.removeConstraintAt(t, n), i)) for (var s = 0; s < t.composites.length; s++) c.removeConstraint(t.composites[s], e, !0);
return t;
}),
(c.removeConstraintAt = function (t, e) {
return t.constraints.splice(e, 1), c.setModified(t, !0, !0, !1), t;
}),
(c.clear = function (t, e, i) {
if (i) for (var n = 0; n < t.composites.length; n++) c.clear(t.composites[n], e, !0);
return (
e
? (t.bodies = t.bodies.filter(function (t) {
return t.isStatic;
}))
: (t.bodies.length = 0),
(t.constraints.length = 0),
(t.composites.length = 0),
c.setModified(t, !0, !0, !1),
t
);
}),
(c.allBodies = function (t) {
for (var e = [].concat(t.bodies), i = 0; i < t.composites.length; i++) e = e.concat(c.allBodies(t.composites[i]));
return e;
}),
(c.allConstraints = function (t) {
for (var e = [].concat(t.constraints), i = 0; i < t.composites.length; i++) e = e.concat(c.allConstraints(t.composites[i]));
return e;
}),
(c.allComposites = function (t) {
for (var e = [].concat(t.composites), i = 0; i < t.composites.length; i++) e = e.concat(c.allComposites(t.composites[i]));
return e;
}),
(c.get = function (t, e, i) {
var n, s;
switch (i) {
case "body":
n = c.allBodies(t);
break;
case "constraint":
n = c.allConstraints(t);
break;
case "composite":
n = c.allComposites(t).concat(t);
}
return n &&
0 !==
(s = n.filter(function (t) {
return t.id.toString() === e.toString();
})).length
? s[0]
: null;
}),
(c.move = function (t, e, i) {
return c.remove(t, e), c.add(i, e), t;
}),
(c.rebase = function (t) {
for (var e = c.allBodies(t).concat(c.allConstraints(t)).concat(c.allComposites(t)), i = 0; i < e.length; i++) e[i].id = r.nextId();
return c.setModified(t, !0, !0, !1), t;
}),
(c.translate = function (t, e, i) {
for (var n = i ? c.allBodies(t) : t.bodies, s = 0; s < n.length; s++) d.translate(n[s], e);
return c.setModified(t, !0, !0, !1), t;
}),
(c.rotate = function (t, e, i, n) {
for (var s = Math.cos(e), r = Math.sin(e), o = n ? c.allBodies(t) : t.bodies, a = 0; a < o.length; a++) {
var h = o[a],
l = h.position.x - i.x,
u = h.position.y - i.y;
d.setPosition(h, { x: i.x + (l * s - u * r), y: i.y + (l * r + u * s) }), d.rotate(h, e);
}
return c.setModified(t, !0, !0, !1), t;
}),
(c.scale = function (t, e, i, n, s) {
for (var r = s ? c.allBodies(t) : t.bodies, o = 0; o < r.length; o++) {
var a = r[o],
h = a.position.x - n.x,
l = a.position.y - n.y;
d.setPosition(a, { x: n.x + h * e, y: n.y + l * i }), d.scale(a, e, i);
}
return c.setModified(t, !0, !0, !1), t;
}),
(c.bounds = function (t) {
for (var e = c.allBodies(t), i = [], n = 0; n < e.length; n += 1) {
var s = e[n];
i.push(s.bounds.min, s.bounds.max);
}
return a.create(i);
});
},
function (t, e) {
t.exports = function (t, e, i) {
return 0 <= t && t < i.width && 0 <= e && e < i.height;
};
},
function (t, e, i) {
var n = i(0),
s = i(29),
r = i(2),
o = new n({
initialize: function (t) {
void 0 === t && (t = {}),
(this.name = r(t, "name", "layer")),
(this.x = r(t, "x", 0)),
(this.y = r(t, "y", 0)),
(this.width = r(t, "width", 0)),
(this.height = r(t, "height", 0)),
(this.tileWidth = r(t, "tileWidth", 0)),
(this.tileHeight = r(t, "tileHeight", 0)),
(this.baseTileWidth = r(t, "baseTileWidth", this.tileWidth)),
(this.baseTileHeight = r(t, "baseTileHeight", this.tileHeight)),
(this.orientation = r(t, "orientation", s.ORTHOGONAL)),
(this.widthInPixels = r(t, "widthInPixels", this.width * this.baseTileWidth)),
(this.heightInPixels = r(t, "heightInPixels", this.height * this.baseTileHeight)),
(this.alpha = r(t, "alpha", 1)),
(this.visible = r(t, "visible", !0)),
(this.properties = r(t, "properties", [])),
(this.indexes = r(t, "indexes", [])),
(this.collideIndexes = r(t, "collideIndexes", [])),
(this.callbacks = r(t, "callbacks", [])),
(this.bodies = r(t, "bodies", [])),
(this.data = r(t, "data", [])),
(this.tilemapLayer = r(t, "tilemapLayer", null)),
(this.hexSideLength = r(t, "hexSideLength", 0));
},
});
t.exports = o;
},
function (t, e, i) {
var n = i(0),
s = i(29),
r = i(2),
o = new n({
initialize: function (t) {
void 0 === t && (t = {}),
(this.name = r(t, "name", "map")),
(this.width = r(t, "width", 0)),
(this.height = r(t, "height", 0)),
(this.infinite = r(t, "infinite", !1)),
(this.tileWidth = r(t, "tileWidth", 0)),
(this.tileHeight = r(t, "tileHeight", 0)),
(this.widthInPixels = r(t, "widthInPixels", this.width * this.tileWidth)),
(this.heightInPixels = r(t, "heightInPixels", this.height * this.tileHeight)),
(this.format = r(t, "format", null)),
(this.orientation = r(t, "orientation", s.ORTHOGONAL)),
(this.renderOrder = r(t, "renderOrder", "right-down")),
(this.version = r(t, "version", "1")),
(this.properties = r(t, "properties", {})),
(this.layers = r(t, "layers", [])),
(this.images = r(t, "images", [])),
(this.objects = r(t, "objects", {})),
(this.collision = r(t, "collision", {})),
(this.tilesets = r(t, "tilesets", [])),
(this.imageCollections = r(t, "imageCollections", [])),
(this.tiles = r(t, "tiles", [])),
(this.hexSideLength = r(t, "hexSideLength", 0));
},
});
t.exports = o;
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e, i, n, s, r, o, a) {
(void 0 === i || i <= 0) && (i = 32),
(void 0 === n || n <= 0) && (n = 32),
void 0 === s && (s = 0),
void 0 === r && (r = 0),
void 0 === o && (o = {}),
void 0 === a && (a = {}),
(this.name = t),
(this.firstgid = e),
(this.tileWidth = i),
(this.tileHeight = n),
(this.tileMargin = s),
(this.tileSpacing = r),
(this.tileProperties = o),
(this.tileData = a),
(this.image = null),
(this.glTexture = null),
(this.rows = 0),
(this.columns = 0),
(this.total = 0),
(this.texCoordinates = []);
},
getTileProperties: function (t) {
return this.containsTileIndex(t) ? this.tileProperties[t - this.firstgid] : null;
},
getTileData: function (t) {
return this.containsTileIndex(t) ? this.tileData[t - this.firstgid] : null;
},
getTileCollisionGroup: function (t) {
var e = this.getTileData(t);
return e && e.objectgroup ? e.objectgroup : null;
},
containsTileIndex: function (t) {
return t >= this.firstgid && t < this.firstgid + this.total;
},
getTileTextureCoordinates: function (t) {
return this.containsTileIndex(t) ? this.texCoordinates[t - this.firstgid] : null;
},
setImage: function (t) {
return (this.image = t), (this.glTexture = t.get().source.glTexture), this.updateTileData(this.image.source[0].width, this.image.source[0].height), this;
},
setTileSize: function (t, e) {
return void 0 !== t && (this.tileWidth = t), void 0 !== e && (this.tileHeight = e), this.image && this.updateTileData(this.image.source[0].width, this.image.source[0].height), this;
},
setSpacing: function (t, e) {
return void 0 !== t && (this.tileMargin = t), void 0 !== e && (this.tileSpacing = e), this.image && this.updateTileData(this.image.source[0].width, this.image.source[0].height), this;
},
updateTileData: function (t, e) {
var i = (e - 2 * this.tileMargin + this.tileSpacing) / (this.tileHeight + this.tileSpacing),
n = (t - 2 * this.tileMargin + this.tileSpacing) / (this.tileWidth + this.tileSpacing);
(i = Math.floor(i)), (n = Math.floor(n)), (this.rows = i), (this.columns = n), (this.total = i * n), (this.texCoordinates.length = 0);
for (var s = this.tileMargin, r = this.tileMargin, o = 0; o < this.rows; o++) {
for (var a = 0; a < this.columns; a++) this.texCoordinates.push({ x: s, y: r }), (s += this.tileWidth + this.tileSpacing);
(s = this.tileMargin), (r += this.tileHeight + this.tileSpacing);
}
return this;
},
});
t.exports = n;
},
function (t, e) {
t.exports = {
TOP_LEFT: 0,
TOP_CENTER: 1,
TOP_RIGHT: 2,
LEFT_TOP: 3,
LEFT_CENTER: 4,
LEFT_BOTTOM: 5,
CENTER: 6,
RIGHT_TOP: 7,
RIGHT_CENTER: 8,
RIGHT_BOTTOM: 9,
BOTTOM_LEFT: 10,
BOTTOM_CENTER: 11,
BOTTOM_RIGHT: 12,
};
},
function (t, e) {
t.exports = function (t, e, i) {
return void 0 === i && (i = 1e-4), Math.abs(t - e) < i;
};
},
function (t, e, i) {
var n = i(0),
s = i(11),
r = i(15),
o = i(1068),
a = new n({
Extends: r,
Mixins: [s.Alpha, s.BlendMode, s.Depth, s.Flip, s.GetBounds, s.Mask, s.Origin, s.Pipeline, s.ScrollFactor, s.Size, s.TextureCrop, s.Tint, s.Transform, s.Visible, o],
initialize: function (t, e, i, n, s) {
r.call(this, t, "Image"), (this._crop = this.resetCropObject()), this.setTexture(n, s), this.setPosition(e, i), this.setSizeToFrame(), this.setOriginFromFrame(), this.initPipeline();
},
});
t.exports = a;
},
function (t, e) {
t.exports = function (t, e) {
return t.hasOwnProperty(e);
};
},
function (t, e, i) {
var s = i(77);
t.exports = function (t, e) {
var i = s(t);
for (var n in e) i.hasOwnProperty(n) || (i[n] = e[n]);
return i;
};
},
function (t, e, i) {
var w = {};
t.exports = w;
var o = i(64),
T = i(83),
a = i(165),
h = i(84),
l = i(271),
u = i(32);
(w._warming = 0.4),
(w._torqueDampen = 1),
(w._minLength = 1e-6),
(w.create = function (t) {
var e = t;
e.bodyA && !e.pointA && (e.pointA = { x: 0, y: 0 }), e.bodyB && !e.pointB && (e.pointB = { x: 0, y: 0 });
var i = e.bodyA ? T.add(e.bodyA.position, e.pointA) : e.pointA,
n = e.bodyB ? T.add(e.bodyB.position, e.pointB) : e.pointB,
s = T.magnitude(T.sub(i, n));
(e.length = void 0 !== e.length ? e.length : s),
(e.id = e.id || u.nextId()),
(e.label = e.label || "Constraint"),
(e.type = "constraint"),
(e.stiffness = e.stiffness || (0 < e.length ? 1 : 0.7)),
(e.damping = e.damping || 0),
(e.angularStiffness = e.angularStiffness || 0),
(e.angleA = e.bodyA ? e.bodyA.angle : e.angleA),
(e.angleB = e.bodyB ? e.bodyB.angle : e.angleB),
(e.plugin = {});
var r = { visible: !0, type: "line", anchors: !0, lineColor: null, lineOpacity: null, lineThickness: null, pinSize: null, anchorColor: null, anchorSize: null };
return 0 === e.length && 0.1 < e.stiffness ? ((r.type = "pin"), (r.anchors = !1)) : e.stiffness < 0.9 && (r.type = "spring"), (e.render = u.extend(r, e.render)), e;
}),
(w.preSolveAll = function (t) {
for (var e = 0; e < t.length; e += 1) {
var i = t[e],
n = i.constraintImpulse;
i.isStatic || (0 === n.x && 0 === n.y && 0 === n.angle) || ((i.position.x += n.x), (i.position.y += n.y), (i.angle += n.angle));
}
}),
(w.solveAll = function (t, e) {
for (var i = 0; i < t.length; i += 1) {
var n = t[i],
s = !n.bodyA || (n.bodyA && n.bodyA.isStatic),
r = !n.bodyB || (n.bodyB && n.bodyB.isStatic);
(s || r) && w.solve(t[i], e);
}
for (i = 0; i < t.length; i += 1) (s = !(n = t[i]).bodyA || (n.bodyA && n.bodyA.isStatic)), (r = !n.bodyB || (n.bodyB && n.bodyB.isStatic)), s || r || w.solve(t[i], e);
}),
(w.solve = function (t, e) {
var i,
n,
s,
r,
o,
a,
h,
l,
u,
c,
d,
f,
p,
g,
v,
y = t.bodyA,
m = t.bodyB,
x = t.pointA,
b = t.pointB;
(y || m) &&
(y && !y.isStatic && (T.rotate(x, y.angle - t.angleA, x), (t.angleA = y.angle)),
m && !m.isStatic && (T.rotate(b, m.angle - t.angleB, b), (t.angleB = m.angle)),
(i = x),
(n = b),
y && (i = T.add(y.position, x)),
m && (n = T.add(m.position, b)),
i &&
n &&
((s = T.sub(i, n)),
(r = T.magnitude(s)) < w._minLength && (r = w._minLength),
(o = (r - t.length) / r),
(a = t.stiffness < 1 ? t.stiffness * e : t.stiffness),
(h = T.mult(s, o * a)),
(u = (l = (y ? y.inverseMass : 0) + (m ? m.inverseMass : 0)) + ((y ? y.inverseInertia : 0) + (m ? m.inverseInertia : 0))),
t.damping && ((f = T.create()), (p = T.div(s, r)), (g = T.sub((m && T.sub(m.position, m.positionPrev)) || f, (y && T.sub(y.position, y.positionPrev)) || f)), (v = T.dot(p, g))),
y &&
!y.isStatic &&
((d = y.inverseMass / l),
(y.constraintImpulse.x -= h.x * d),
(y.constraintImpulse.y -= h.y * d),
(y.position.x -= h.x * d),
(y.position.y -= h.y * d),
t.damping && ((y.positionPrev.x -= t.damping * p.x * v * d), (y.positionPrev.y -= t.damping * p.y * v * d)),
(c = (T.cross(x, h) / u) * w._torqueDampen * y.inverseInertia * (1 - t.angularStiffness)),
(y.constraintImpulse.angle -= c),
(y.angle -= c)),
m &&
!m.isStatic &&
((d = m.inverseMass / l),
(m.constraintImpulse.x += h.x * d),
(m.constraintImpulse.y += h.y * d),
(m.position.x += h.x * d),
(m.position.y += h.y * d),
t.damping && ((m.positionPrev.x += t.damping * p.x * v * d), (m.positionPrev.y += t.damping * p.y * v * d)),
(c = (T.cross(b, h) / u) * w._torqueDampen * m.inverseInertia * (1 - t.angularStiffness)),
(m.constraintImpulse.angle += c),
(m.angle += c))));
}),
(w.postSolveAll = function (t) {
for (var e = 0; e < t.length; e++) {
var i = t[e],
n = i.constraintImpulse;
if (!(i.isStatic || (0 === n.x && 0 === n.y && 0 === n.angle))) {
a.set(i, !1);
for (var s = 0; s < i.parts.length; s++) {
var r = i.parts[s];
o.translate(r.vertices, n),
0 < s && ((r.position.x += n.x), (r.position.y += n.y)),
0 !== n.angle && (o.rotate(r.vertices, n.angle, i.position), l.rotate(r.axes, n.angle), 0 < s && T.rotateAbout(r.position, n.angle, i.position, r.position)),
h.update(r.bounds, r.vertices, i.velocity);
}
(n.angle *= w._warming), (n.x *= w._warming), (n.y *= w._warming);
}
}
}),
(w.pointAWorld = function (t) {
return { x: (t.bodyA ? t.bodyA.position.x : 0) + t.pointA.x, y: (t.bodyA ? t.bodyA.position.y : 0) + t.pointA.y };
}),
(w.pointBWorld = function (t) {
return { x: (t.bodyB ? t.bodyB.position.x : 0) + t.pointB.x, y: (t.bodyB ? t.bodyB.position.y : 0) + t.pointB.y };
});
},
function (t, e, i) {
var r = i(35),
n = i(65),
s = i(66),
o = i(0),
a = i(11),
h = i(15),
l = i(10),
u = i(57),
c = new o({
Extends: h,
Mixins: [a.Depth, a.GetBounds, a.Origin, a.Transform, a.ScrollFactor, a.Visible],
initialize: function (t, e, i, n, s) {
void 0 === n && (n = 1), void 0 === s && (s = n), h.call(this, t, "Zone"), this.setPosition(e, i), (this.width = n), (this.height = s), (this.blendMode = r.NORMAL), this.updateDisplayOrigin();
},
displayWidth: {
get: function () {
return this.scaleX * this.width;
},
set: function (t) {
this.scaleX = t / this.width;
},
},
displayHeight: {
get: function () {
return this.scaleY * this.height;
},
set: function (t) {
this.scaleY = t / this.height;
},
},
setSize: function (t, e, i) {
void 0 === i && (i = !0), (this.width = t), (this.height = e), this.updateDisplayOrigin();
var n = this.input;
return i && n && !n.customHitArea && ((n.hitArea.width = t), (n.hitArea.height = e)), this;
},
setDisplaySize: function (t, e) {
return (this.displayWidth = t), (this.displayHeight = e), this;
},
setCircleDropZone: function (t) {
return this.setDropZone(new n(0, 0, t), s);
},
setRectangleDropZone: function (t, e) {
return this.setDropZone(new l(0, 0, t, e), u);
},
setDropZone: function (t, e) {
return void 0 === t ? this.setRectangleDropZone(this.width, this.height) : this.input || this.setInteractive(t, e, !0), this;
},
setAlpha: function () {},
setBlendMode: function () {},
renderCanvas: function (t, e, i) {
i.addToRenderList(e);
},
renderWebGL: function (t, e, i) {
i.addToRenderList(e);
},
});
t.exports = c;
},
function (t, e) {
t.exports = function (t) {
return 2 * (t.width + t.height);
};
},
function (t, e) {
t.exports = function (t) {
for (var e = t.length - 1; 0 < e; e--) {
var i = Math.floor(Math.random() * (e + 1)),
n = t[e];
(t[e] = t[i]), (t[i] = n);
}
return t;
};
},
function (t, e, i) {
t.exports = {
ADD_ANIMATION: i(724),
ANIMATION_COMPLETE: i(725),
ANIMATION_COMPLETE_KEY: i(726),
ANIMATION_REPEAT: i(727),
ANIMATION_RESTART: i(728),
ANIMATION_START: i(729),
ANIMATION_STOP: i(730),
ANIMATION_UPDATE: i(731),
PAUSE_ALL: i(732),
REMOVE_ANIMATION: i(733),
RESUME_ALL: i(734),
};
},
function (t, e, i) {
var n = i(0),
s = i(11),
r = i(36),
o = i(9),
a = i(37),
h = i(10),
l = i(25),
u = i(187),
E = i(3),
c = new n({
Extends: o,
Mixins: [s.Alpha, s.Visible],
initialize: function (t, e, i, n) {
void 0 === t && (t = 0),
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 0),
o.call(this),
this.scene,
this.sceneManager,
this.scaleManager,
this.cameraManager,
(this.id = 0),
(this.name = ""),
(this.roundPixels = !1),
(this.useBounds = !1),
(this.worldView = new h()),
(this.dirty = !0),
(this._x = t),
(this._y = e),
(this._width = i),
(this._height = n),
(this._bounds = new h()),
(this._scrollX = 0),
(this._scrollY = 0),
(this._zoomX = 1),
(this._zoomY = 1),
(this._rotation = 0),
(this.matrix = new l()),
(this.transparent = !0),
(this.backgroundColor = u("rgba(0,0,0,0)")),
(this.disableCull = !1),
(this.culledObjects = []),
(this.midPoint = new E(i / 2, n / 2)),
(this.originX = 0.5),
(this.originY = 0.5),
(this._customViewport = !1),
(this.mask = null),
(this._maskCamera = null),
(this.renderList = []);
},
addToRenderList: function (t) {
this.renderList.push(t);
},
setOrigin: function (t, e) {
return void 0 === t && (t = 0.5), void 0 === e && (e = t), (this.originX = t), (this.originY = e), this;
},
getScroll: function (t, e, i) {
void 0 === i && (i = new E());
var n = 0.5 * this.width,
s = 0.5 * this.height;
return (i.x = t - n), (i.y = e - s), this.useBounds && ((i.x = this.clampX(i.x)), (i.y = this.clampY(i.y))), i;
},
centerOnX: function (t) {
var e = 0.5 * this.width;
return (this.midPoint.x = t), (this.scrollX = t - e), this.useBounds && (this.scrollX = this.clampX(this.scrollX)), this;
},
centerOnY: function (t) {
var e = 0.5 * this.height;
return (this.midPoint.y = t), (this.scrollY = t - e), this.useBounds && (this.scrollY = this.clampY(this.scrollY)), this;
},
centerOn: function (t, e) {
return this.centerOnX(t), this.centerOnY(e), this;
},
centerToBounds: function () {
var t, e, i;
return (
this.useBounds && ((t = this._bounds), (e = 0.5 * this.width), (i = 0.5 * this.height), this.midPoint.set(t.centerX, t.centerY), (this.scrollX = t.centerX - e), (this.scrollY = t.centerY - i)),
this
);
},
centerToSize: function () {
return (this.scrollX = 0.5 * this.width), (this.scrollY = 0.5 * this.height), this;
},
cull: function (t) {
if (this.disableCull) return t;
var e = this.matrix.matrix,
i = e[0],
n = e[1],
s = e[2],
r = e[3];
if (!(i * r - n * s)) return t;
for (
var o = e[4], a = e[5], h = this.scrollX, l = this.scrollY, u = this.width, c = this.height, d = this.y, f = d + c, p = this.x, g = p + u, v = this.culledObjects, y = t.length, m = (v.length = 0);
m < y;
++m
) {
var x,
b,
w,
T,
S = t[m];
S.hasOwnProperty("width") && !S.parentContainer
? ((x = S.width),
(b = S.height),
p < ((w = S.x - h * S.scrollFactorX - x * S.originX) + x) * i + ((T = S.y - l * S.scrollFactorY - b * S.originY) + b) * s + o &&
w * i + T * s + o < g &&
d < (w + x) * n + (T + b) * r + a &&
w * n + T * r + a < f &&
v.push(S))
: v.push(S);
}
return v;
},
getWorldPoint: function (t, e, i) {
void 0 === i && (i = new E());
var n = this.matrix.matrix,
s = n[0],
r = n[1],
o = n[2],
a = n[3],
h = n[4],
l = n[5],
u = s * a - r * o;
if (!u) return (i.x = t), (i.y = e), i;
var c = a * (u = 1 / u),
d = -r * u,
f = -o * u,
p = s * u,
g = (o * l - a * h) * u,
v = (r * h - s * l) * u,
y = Math.cos(this.rotation),
m = Math.sin(this.rotation),
x = this.zoomX,
b = this.zoomY,
w = this.scrollX,
T = this.scrollY,
S = t + (w * y - T * m) * x,
_ = e + (w * m + T * y) * b;
return (i.x = S * c + _ * f + g), (i.y = S * d + _ * p + v), i;
},
ignore: function (t) {
var e = this.id;
Array.isArray(t) || (t = [t]);
for (var i = 0; i < t.length; i++) {
var n = t[i];
Array.isArray(n) ? this.ignore(n) : n.isParent ? this.ignore(n.getChildren()) : (n.cameraFilter |= e);
}
return this;
},
preRender: function () {
this.renderList.length = 0;
var t = this.width,
e = this.height,
i = 0.5 * t,
n = 0.5 * e,
s = this.zoomX,
r = this.zoomY,
o = this.matrix,
a = t * this.originX,
h = e * this.originY,
l = this.scrollX,
u = this.scrollY;
this.useBounds && ((l = this.clampX(l)), (u = this.clampY(u))), this.roundPixels && ((a = Math.round(a)), (h = Math.round(h)));
var c = (this.scrollX = l) + i,
d = (this.scrollY = u) + n;
this.midPoint.set(c, d);
var f = t / s,
p = e / r;
this.worldView.setTo(c - f / 2, d - p / 2, f, p), o.applyITRS(this.x + a, this.y + h, this.rotation, s, r), o.translate(-a, -h);
},
clampX: function (t) {
var e = this._bounds,
i = this.displayWidth,
n = e.x + (i - this.width) / 2,
s = Math.max(n, n + e.width - i);
return t < n ? (t = n) : s < t && (t = s), t;
},
clampY: function (t) {
var e = this._bounds,
i = this.displayHeight,
n = e.y + (i - this.height) / 2,
s = Math.max(n, n + e.height - i);
return t < n ? (t = n) : s < t && (t = s), t;
},
removeBounds: function () {
return (this.useBounds = !1), (this.dirty = !0), this._bounds.setEmpty(), this;
},
setAngle: function (t) {
return void 0 === t && (t = 0), (this.rotation = r(t)), this;
},
setBackgroundColor: function (t) {
return void 0 === t && (t = "rgba(0,0,0,0)"), (this.backgroundColor = u(t)), (this.transparent = 0 === this.backgroundColor.alpha), this;
},
setBounds: function (t, e, i, n, s) {
return (
void 0 === s && (s = !1),
this._bounds.setTo(t, e, i, n),
(this.dirty = !0),
(this.useBounds = !0),
s ? this.centerToBounds() : ((this.scrollX = this.clampX(this.scrollX)), (this.scrollY = this.clampY(this.scrollY))),
this
);
},
getBounds: function (t) {
void 0 === t && (t = new h());
var e = this._bounds;
return t.setTo(e.x, e.y, e.width, e.height), t;
},
setName: function (t) {
return void 0 === t && (t = ""), (this.name = t), this;
},
setPosition: function (t, e) {
return void 0 === e && (e = t), (this.x = t), (this.y = e), this;
},
setRotation: function (t) {
return void 0 === t && (t = 0), (this.rotation = t), this;
},
setRoundPixels: function (t) {
return (this.roundPixels = t), this;
},
setScene: function (t) {
this.scene && this._customViewport && this.sceneManager.customViewports--;
var e = (this.scene = t).sys;
return (this.sceneManager = e.game.scene), (this.scaleManager = e.scale), (this.cameraManager = e.cameras), this.updateSystem(), this;
},
setScroll: function (t, e) {
return void 0 === e && (e = t), (this.scrollX = t), (this.scrollY = e), this;
},
setSize: function (t, e) {
return void 0 === e && (e = t), (this.width = t), (this.height = e), this;
},
setViewport: function (t, e, i, n) {
return (this.x = t), (this.y = e), (this.width = i), (this.height = n), this;
},
setZoom: function (t, e) {
return void 0 === t && (t = 1), void 0 === e && (e = t), 0 === t && (t = 0.001), 0 === e && (e = 0.001), (this.zoomX = t), (this.zoomY = e), this;
},
setMask: function (t, e) {
return void 0 === e && (e = !0), (this.mask = t), (this._maskCamera = e ? this.cameraManager.default : this), this;
},
clearMask: function (t) {
return void 0 === t && (t = !1), t && this.mask && this.mask.destroy(), (this.mask = null), this;
},
toJSON: function () {
var t = {
name: this.name,
x: this.x,
y: this.y,
width: this.width,
height: this.height,
zoom: this.zoom,
rotation: this.rotation,
roundPixels: this.roundPixels,
scrollX: this.scrollX,
scrollY: this.scrollY,
backgroundColor: this.backgroundColor.rgba,
};
return this.useBounds && (t.bounds = { x: this._bounds.x, y: this._bounds.y, width: this._bounds.width, height: this._bounds.height }), t;
},
update: function () {},
updateSystem: function () {
var t, e;
this.scaleManager &&
((t = 0 !== this._x || 0 !== this._y || this.scaleManager.width !== this._width || this.scaleManager.height !== this._height),
(e = this.sceneManager),
t && !this._customViewport ? e.customViewports++ : !t && this._customViewport && e.customViewports--,
(this.dirty = !0),
(this._customViewport = t));
},
destroy: function () {
this.emit(a.DESTROY, this),
this.removeAllListeners(),
this.matrix.destroy(),
(this.culledObjects = []),
this._customViewport && this.sceneManager.customViewports--,
(this.renderList = []),
(this._bounds = null),
(this.scene = null),
(this.scaleManager = null),
(this.sceneManager = null),
(this.cameraManager = null);
},
x: {
get: function () {
return this._x;
},
set: function (t) {
(this._x = t), this.updateSystem();
},
},
y: {
get: function () {
return this._y;
},
set: function (t) {
(this._y = t), this.updateSystem();
},
},
width: {
get: function () {
return this._width;
},
set: function (t) {
(this._width = t), this.updateSystem();
},
},
height: {
get: function () {
return this._height;
},
set: function (t) {
(this._height = t), this.updateSystem();
},
},
scrollX: {
get: function () {
return this._scrollX;
},
set: function (t) {
(this._scrollX = t), (this.dirty = !0);
},
},
scrollY: {
get: function () {
return this._scrollY;
},
set: function (t) {
(this._scrollY = t), (this.dirty = !0);
},
},
zoom: {
get: function () {
return (this._zoomX + this._zoomY) / 2;
},
set: function (t) {
(this._zoomX = t), (this._zoomY = t), (this.dirty = !0);
},
},
zoomX: {
get: function () {
return this._zoomX;
},
set: function (t) {
(this._zoomX = t), (this.dirty = !0);
},
},
zoomY: {
get: function () {
return this._zoomY;
},
set: function (t) {
(this._zoomY = t), (this.dirty = !0);
},
},
rotation: {
get: function () {
return this._rotation;
},
set: function (t) {
(this._rotation = t), (this.dirty = !0);
},
},
centerX: {
get: function () {
return this.x + 0.5 * this.width;
},
},
centerY: {
get: function () {
return this.y + 0.5 * this.height;
},
},
displayWidth: {
get: function () {
return this.width / this.zoomX;
},
},
displayHeight: {
get: function () {
return this.height / this.zoomY;
},
},
});
t.exports = c;
},
function (t, e, i) {
var n = i(334),
s = i(335),
r = i(336),
o = i(337),
a = i(338),
h = i(339),
l = i(340),
u = i(341),
c = i(342),
d = i(343),
f = i(344),
p = i(345);
t.exports = {
Power0: l,
Power1: u.Out,
Power2: o.Out,
Power3: c.Out,
Power4: d.Out,
Linear: l,
Quad: u.Out,
Cubic: o.Out,
Quart: c.Out,
Quint: d.Out,
Sine: f.Out,
Expo: h.Out,
Circ: r.Out,
Elastic: a.Out,
Back: n.Out,
Bounce: s.Out,
Stepped: p,
"Quad.easeIn": u.In,
"Cubic.easeIn": o.In,
"Quart.easeIn": c.In,
"Quint.easeIn": d.In,
"Sine.easeIn": f.In,
"Expo.easeIn": h.In,
"Circ.easeIn": r.In,
"Elastic.easeIn": a.In,
"Back.easeIn": n.In,
"Bounce.easeIn": s.In,
"Quad.easeOut": u.Out,
"Cubic.easeOut": o.Out,
"Quart.easeOut": c.Out,
"Quint.easeOut": d.Out,
"Sine.easeOut": f.Out,
"Expo.easeOut": h.Out,
"Circ.easeOut": r.Out,
"Elastic.easeOut": a.Out,
"Back.easeOut": n.Out,
"Bounce.easeOut": s.Out,
"Quad.easeInOut": u.InOut,
"Cubic.easeInOut": o.InOut,
"Quart.easeInOut": c.InOut,
"Quint.easeInOut": d.InOut,
"Sine.easeInOut": f.InOut,
"Expo.easeInOut": h.InOut,
"Circ.easeInOut": r.InOut,
"Elastic.easeInOut": a.InOut,
"Back.easeInOut": n.InOut,
"Bounce.easeInOut": s.InOut,
};
},
function (t, e) {
t.exports = function (t, e, i) {
return (e - t) * i + t;
};
},
function (t, e, i) {
var n,
s = i(105),
r = { chrome: !1, chromeVersion: 0, edge: !1, firefox: !1, firefoxVersion: 0, ie: !1, ieVersion: 0, mobileSafari: !1, opera: !1, safari: !1, safariVersion: 0, silk: !1, trident: !1, tridentVersion: 0 };
t.exports =
((n = navigator.userAgent),
/Edge\/\d+/.test(n)
? (r.edge = !0)
: /Chrome\/(\d+)/.test(n) && !s.windowsPhone
? ((r.chrome = !0), (r.chromeVersion = parseInt(RegExp.$1, 10)))
: /Firefox\D+(\d+)/.test(n)
? ((r.firefox = !0), (r.firefoxVersion = parseInt(RegExp.$1, 10)))
: /AppleWebKit/.test(n) && s.iOS
? (r.mobileSafari = !0)
: /MSIE (\d+\.\d+);/.test(n)
? ((r.ie = !0), (r.ieVersion = parseInt(RegExp.$1, 10)))
: /Opera/.test(n)
? (r.opera = !0)
: /Safari/.test(n) && !s.windowsPhone
? (r.safari = !0)
: /Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(n) && ((r.ie = !0), (r.trident = !0), (r.tridentVersion = parseInt(RegExp.$1, 10)), (r.ieVersion = parseInt(RegExp.$3, 10))),
/Silk/.test(n) && (r.silk = !0),
r);
},
function (t, e) {
t.exports = function (t, e) {
return Math.random() * (e - t) + t;
};
},
function (t, e) {
t.exports = function (t, e) {
return 0 < t && 0 == (t & (t - 1)) && 0 < e && 0 == (e & (e - 1));
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), 0 === e ? t : ((t -= i), (t = e * Math.ceil(t / e)), n ? (i + t) / e : i + t);
};
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e, i, n) {
(this.x = 0),
(this.y = 0),
(this.z = 0),
(this.w = 0),
"object" == typeof t ? ((this.x = t.x || 0), (this.y = t.y || 0), (this.z = t.z || 0), (this.w = t.w || 0)) : ((this.x = t || 0), (this.y = e || 0), (this.z = i || 0), (this.w = n || 0));
},
clone: function () {
return new n(this.x, this.y, this.z, this.w);
},
copy: function (t) {
return (this.x = t.x), (this.y = t.y), (this.z = t.z || 0), (this.w = t.w || 0), this;
},
equals: function (t) {
return this.x === t.x && this.y === t.y && this.z === t.z && this.w === t.w;
},
set: function (t, e, i, n) {
return "object" == typeof t ? ((this.x = t.x || 0), (this.y = t.y || 0), (this.z = t.z || 0), (this.w = t.w || 0)) : ((this.x = t || 0), (this.y = e || 0), (this.z = i || 0), (this.w = n || 0)), this;
},
add: function (t) {
return (this.x += t.x), (this.y += t.y), (this.z += t.z || 0), (this.w += t.w || 0), this;
},
subtract: function (t) {
return (this.x -= t.x), (this.y -= t.y), (this.z -= t.z || 0), (this.w -= t.w || 0), this;
},
scale: function (t) {
return (this.x *= t), (this.y *= t), (this.z *= t), (this.w *= t), this;
},
length: function () {
var t = this.x,
e = this.y,
i = this.z,
n = this.w;
return Math.sqrt(t * t + e * e + i * i + n * n);
},
lengthSq: function () {
var t = this.x,
e = this.y,
i = this.z,
n = this.w;
return t * t + e * e + i * i + n * n;
},
normalize: function () {
var t = this.x,
e = this.y,
i = this.z,
n = this.w,
s = t * t + e * e + i * i + n * n;
return 0 < s && ((s = 1 / Math.sqrt(s)), (this.x = t * s), (this.y = e * s), (this.z = i * s), (this.w = n * s)), this;
},
dot: function (t) {
return this.x * t.x + this.y * t.y + this.z * t.z + this.w * t.w;
},
lerp: function (t, e) {
void 0 === e && (e = 0);
var i = this.x,
n = this.y,
s = this.z,
r = this.w;
return (this.x = i + e * (t.x - i)), (this.y = n + e * (t.y - n)), (this.z = s + e * (t.z - s)), (this.w = r + e * (t.w - r)), this;
},
multiply: function (t) {
return (this.x *= t.x), (this.y *= t.y), (this.z *= t.z || 1), (this.w *= t.w || 1), this;
},
divide: function (t) {
return (this.x /= t.x), (this.y /= t.y), (this.z /= t.z || 1), (this.w /= t.w || 1), this;
},
distance: function (t) {
var e = t.x - this.x,
i = t.y - this.y,
n = t.z - this.z || 0,
s = t.w - this.w || 0;
return Math.sqrt(e * e + i * i + n * n + s * s);
},
distanceSq: function (t) {
var e = t.x - this.x,
i = t.y - this.y,
n = t.z - this.z || 0,
s = t.w - this.w || 0;
return e * e + i * i + n * n + s * s;
},
negate: function () {
return (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), (this.w = -this.w), this;
},
transformMat4: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = this.w,
r = t.val;
return (
(this.x = r[0] * e + r[4] * i + r[8] * n + r[12] * s),
(this.y = r[1] * e + r[5] * i + r[9] * n + r[13] * s),
(this.z = r[2] * e + r[6] * i + r[10] * n + r[14] * s),
(this.w = r[3] * e + r[7] * i + r[11] * n + r[15] * s),
this
);
},
transformQuat: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = t.x,
r = t.y,
o = t.z,
a = t.w,
h = a * e + r * n - o * i,
l = a * i + o * e - s * n,
u = a * n + s * i - r * e,
c = -s * e - r * i - o * n;
return (this.x = h * a + c * -s + l * -o - u * -r), (this.y = l * a + c * -r + u * -s - h * -o), (this.z = u * a + c * -o + h * -r - l * -s), this;
},
reset: function () {
return (this.x = 0), (this.y = 0), (this.z = 0), (this.w = 0), this;
},
});
(n.prototype.sub = n.prototype.subtract),
(n.prototype.mul = n.prototype.multiply),
(n.prototype.div = n.prototype.divide),
(n.prototype.dist = n.prototype.distance),
(n.prototype.distSq = n.prototype.distanceSq),
(n.prototype.len = n.prototype.length),
(n.prototype.lenSq = n.prototype.lengthSq),
(t.exports = n);
},
function (t, e, i) {
var n = i(0),
s = i(91),
r = new n({
initialize: function (t, e, i, n, s, r, o) {
void 0 === n && (n = 1),
void 0 === s && (s = 0),
void 0 === r && (r = !0),
void 0 === o && (o = !1),
(this.renderer = t),
(this.framebuffer = null),
(this.texture = null),
(this.width = 0),
(this.height = 0),
(this.scale = n),
(this.minFilter = s),
(this.autoClear = r),
(this.autoResize = !1),
this.resize(e, i),
o && this.setAutoResize(!0);
},
setAutoResize: function (t) {
return (
t && !this.autoResize ? (this.renderer.on(s.RESIZE, this.resize, this), (this.autoResize = !0)) : !t && this.autoResize && (this.renderer.off(s.RESIZE, this.resize, this), (this.autoResize = !1)),
this
);
},
resize: function (t, e) {
var i,
n = t * this.scale,
s = e * this.scale;
return (
(n === this.width && s === this.height) ||
((i = this.renderer).deleteFramebuffer(this.framebuffer),
i.deleteTexture(this.texture),
(t *= this.scale),
(e *= this.scale),
(t = Math.round(t)) <= 0 && (t = 1),
(e = Math.round(e)) <= 0 && (e = 1),
(this.texture = i.createTextureFromSource(null, t, e, this.minFilter)),
(this.framebuffer = i.createFramebuffer(t, e, this.texture, !1)),
(this.width = t),
(this.height = e)),
this
);
},
bind: function (t, e, i) {
var n;
void 0 === t && (t = !1),
t && this.renderer.flush(),
e && i && this.resize(e, i),
this.renderer.pushFramebuffer(this.framebuffer, !1, !1, !1),
t && this.adjustViewport(),
this.autoClear && ((n = this.renderer.gl).clearColor(0, 0, 0, 0), n.clear(n.COLOR_BUFFER_BIT));
},
adjustViewport: function () {
var t = this.renderer.gl;
t.viewport(0, 0, this.width, this.height), t.disable(t.SCISSOR_TEST);
},
clear: function () {
var t = this.renderer,
e = t.gl;
t.pushFramebuffer(this.framebuffer), e.disable(e.SCISSOR_TEST), e.clearColor(0, 0, 0, 0), e.clear(e.COLOR_BUFFER_BIT), t.popFramebuffer(), t.resetScissor();
},
unbind: function (t) {
void 0 === t && (t = !1);
var e = this.renderer;
return t && e.flush(), e.popFramebuffer();
},
destroy: function () {
var t = this.renderer;
t.deleteFramebuffer(this.framebuffer), t.deleteTexture(this.texture), t.off(s.RESIZE, this.resize, this), (this.renderer = null), (this.framebuffer = null), (this.texture = null);
},
});
t.exports = r;
},
function (t, e) {
t.exports = function (t, e) {
var i;
if (e) "string" == typeof e ? (i = document.getElementById(e)) : "object" == typeof e && 1 === e.nodeType && (i = e);
else if (t.parentElement || null === e) return t;
return (i = i || document.body).appendChild(t), t;
};
},
function (t, e) {
t.exports = {
BACKSPACE: 8,
TAB: 9,
ENTER: 13,
SHIFT: 16,
CTRL: 17,
ALT: 18,
PAUSE: 19,
CAPS_LOCK: 20,
ESC: 27,
SPACE: 32,
PAGE_UP: 33,
PAGE_DOWN: 34,
END: 35,
HOME: 36,
LEFT: 37,
UP: 38,
RIGHT: 39,
DOWN: 40,
PRINT_SCREEN: 42,
INSERT: 45,
DELETE: 46,
ZERO: 48,
ONE: 49,
TWO: 50,
THREE: 51,
FOUR: 52,
FIVE: 53,
SIX: 54,
SEVEN: 55,
EIGHT: 56,
NINE: 57,
NUMPAD_ZERO: 96,
NUMPAD_ONE: 97,
NUMPAD_TWO: 98,
NUMPAD_THREE: 99,
NUMPAD_FOUR: 100,
NUMPAD_FIVE: 101,
NUMPAD_SIX: 102,
NUMPAD_SEVEN: 103,
NUMPAD_EIGHT: 104,
NUMPAD_NINE: 105,
NUMPAD_ADD: 107,
NUMPAD_SUBTRACT: 109,
A: 65,
B: 66,
C: 67,
D: 68,
E: 69,
F: 70,
G: 71,
H: 72,
I: 73,
J: 74,
K: 75,
L: 76,
M: 77,
N: 78,
O: 79,
P: 80,
Q: 81,
R: 82,
S: 83,
T: 84,
U: 85,
V: 86,
W: 87,
X: 88,
Y: 89,
Z: 90,
F1: 112,
F2: 113,
F3: 114,
F4: 115,
F5: 116,
F6: 117,
F7: 118,
F8: 119,
F9: 120,
F10: 121,
F11: 122,
F12: 123,
SEMICOLON: 186,
PLUS: 187,
COMMA: 188,
MINUS: 189,
PERIOD: 190,
FORWARD_SLASH: 191,
BACK_SLASH: 220,
QUOTES: 222,
BACKTICK: 192,
OPEN_BRACKET: 219,
CLOSED_BRACKET: 221,
SEMICOLON_FIREFOX: 59,
COLON: 58,
COMMA_FIREFOX_WINDOWS: 60,
COMMA_FIREFOX: 62,
BRACKET_RIGHT_FIREFOX: 174,
BRACKET_LEFT_FIREFOX: 175,
};
},
function (t, e) {
t.exports = { PENDING: 0, INIT: 1, START: 2, LOADING: 3, CREATING: 4, RUNNING: 5, PAUSED: 6, SLEEPING: 7, SHUTDOWN: 8, DESTROYED: 9 };
},
function (t, e, i) {
var n = i(0),
o = i(77),
s = i(9),
r = i(70),
a = i(22),
h = i(1),
l = i(207),
u = i(428),
c = new n({
Extends: s,
initialize: function (t) {
s.call(this),
(this.game = t),
(this.jsonCache = t.cache.json),
(this.sounds = []),
(this.mute = !1),
(this.volume = 1),
(this.pauseOnBlur = !0),
(this._rate = 1),
(this._detune = 0),
(this.locked = this.locked || !1),
(this.unlocked = !1),
t.events.on(a.BLUR, this.onGameBlur, this),
t.events.on(a.FOCUS, this.onGameFocus, this),
t.events.on(a.PRE_STEP, this.update, this),
t.events.once(a.DESTROY, this.destroy, this);
},
add: h,
addAudioSprite: function (t, e) {
void 0 === e && (e = {});
var i,
n,
s = this.add(t, e);
for (var r in ((s.spritemap = this.jsonCache.get(t).spritemap), s.spritemap))
s.spritemap.hasOwnProperty(r) &&
((i = o(e)), (n = s.spritemap[r]), (i.loop = !!n.hasOwnProperty("loop") && n.loop), s.addMarker({ name: r, start: n.start, duration: n.end - n.start, config: i }));
return s;
},
get: function (t) {
return u(this.sounds, "key", t);
},
getAll: function (t) {
return l(this.sounds, "key", t);
},
play: function (t, e) {
var i = this.add(t);
return i.once(r.COMPLETE, i.destroy, i), e ? (e.name ? (i.addMarker(e), i.play(e.name)) : i.play(e)) : i.play();
},
playAudioSprite: function (t, e, i) {
var n = this.addAudioSprite(t);
return n.once(r.COMPLETE, n.destroy, n), n.play(e, i);
},
remove: function (t) {
var e = this.sounds.indexOf(t);
return -1 !== e && (t.destroy(), this.sounds.splice(e, 1), !0);
},
removeAll: function () {
this.sounds.forEach(function (t) {
t.destroy();
}),
(this.sounds.length = 0);
},
removeByKey: function (t) {
for (var e = 0, i = this.sounds.length - 1; 0 <= i; i--) {
var n = this.sounds[i];
n.key === t && (n.destroy(), this.sounds.splice(i, 1), e++);
}
return e;
},
pauseAll: function () {
this.forEachActiveSound(function (t) {
t.pause();
}),
this.emit(r.PAUSE_ALL, this);
},
resumeAll: function () {
this.forEachActiveSound(function (t) {
t.resume();
}),
this.emit(r.RESUME_ALL, this);
},
stopAll: function () {
this.forEachActiveSound(function (t) {
t.stop();
}),
this.emit(r.STOP_ALL, this);
},
stopByKey: function (t) {
var e = 0;
return (
this.getAll(t).forEach(function (t) {
t.stop() && e++;
}),
e
);
},
unlock: h,
onBlur: h,
onFocus: h,
onGameBlur: function () {
this.pauseOnBlur && this.onBlur();
},
onGameFocus: function () {
this.pauseOnBlur && this.onFocus();
},
update: function (e, i) {
this.unlocked && ((this.unlocked = !1), (this.locked = !1), this.emit(r.UNLOCKED, this));
for (var t = this.sounds.length - 1; 0 <= t; t--) this.sounds[t].pendingRemove && this.sounds.splice(t, 1);
this.sounds.forEach(function (t) {
t.update(e, i);
});
},
destroy: function () {
this.game.events.off(a.BLUR, this.onGameBlur, this),
this.game.events.off(a.FOCUS, this.onGameFocus, this),
this.game.events.off(a.PRE_STEP, this.update, this),
this.removeAllListeners(),
this.removeAll(),
(this.sounds.length = 0),
(this.sounds = null),
(this.game = null);
},
forEachActiveSound: function (i, n) {
var s = this;
this.sounds.forEach(function (t, e) {
t && !t.pendingRemove && i.call(n || s, t, e, s.sounds);
});
},
setRate: function (t) {
return (this.rate = t), this;
},
rate: {
get: function () {
return this._rate;
},
set: function (t) {
(this._rate = t),
this.forEachActiveSound(function (t) {
t.calculateRate();
}),
this.emit(r.GLOBAL_RATE, this, t);
},
},
setDetune: function (t) {
return (this.detune = t), this;
},
detune: {
get: function () {
return this._detune;
},
set: function (t) {
(this._detune = t),
this.forEachActiveSound(function (t) {
t.calculateRate();
}),
this.emit(r.GLOBAL_DETUNE, this, t);
},
},
});
t.exports = c;
},
function (t, e, i) {
var n = i(0),
s = i(9),
r = i(70),
o = i(17),
a = i(1),
h = new n({
Extends: s,
initialize: function (t, e, i) {
s.call(this),
(this.manager = t),
(this.key = e),
(this.isPlaying = !1),
(this.isPaused = !1),
(this.totalRate = 1),
(this.duration = this.duration || 0),
(this.totalDuration = this.totalDuration || 0),
(this.config = { mute: !1, volume: 1, rate: 1, detune: 0, seek: 0, loop: !1, delay: 0, pan: 0 }),
(this.currentConfig = this.config),
(this.config = o(this.config, i)),
(this.markers = {}),
(this.currentMarker = null),
(this.pendingRemove = !1);
},
addMarker: function (t) {
return !(
!t ||
!t.name ||
"string" != typeof t.name ||
this.markers[t.name] ||
((t = o(!0, { name: "", start: 0, duration: this.totalDuration - (t.start || 0), config: { mute: !1, volume: 1, rate: 1, detune: 0, seek: 0, loop: !1, delay: 0, pan: 0 } }, t)),
(this.markers[t.name] = t),
0)
);
},
updateMarker: function (t) {
return !(!t || !t.name || "string" != typeof t.name || !this.markers[t.name] || ((this.markers[t.name] = o(!0, this.markers[t.name], t)), 0));
},
removeMarker: function (t) {
var e = this.markers[t];
return e ? ((this.markers[t] = null), e) : null;
},
play: function (t, e) {
if ((void 0 === t && (t = ""), "object" == typeof t && ((e = t), (t = "")), "string" != typeof t)) return !1;
if (t) {
if (!this.markers[t]) return !1;
(this.currentMarker = this.markers[t]), (this.currentConfig = this.currentMarker.config), (this.duration = this.currentMarker.duration);
} else (this.currentMarker = null), (this.currentConfig = this.config), (this.duration = this.totalDuration);
return this.resetConfig(), (this.currentConfig = o(this.currentConfig, e)), (this.isPlaying = !0), !(this.isPaused = !1);
},
pause: function () {
return !(this.isPaused || !this.isPlaying) && ((this.isPlaying = !1), (this.isPaused = !0));
},
resume: function () {
return !(!this.isPaused || this.isPlaying || ((this.isPlaying = !0), (this.isPaused = !1)));
},
stop: function () {
return !((!this.isPaused && !this.isPlaying) || ((this.isPlaying = !1), (this.isPaused = !1), this.resetConfig(), 0));
},
applyConfig: function () {
(this.mute = this.currentConfig.mute),
(this.volume = this.currentConfig.volume),
(this.rate = this.currentConfig.rate),
(this.detune = this.currentConfig.detune),
(this.loop = this.currentConfig.loop),
(this.pan = this.currentConfig.pan);
},
resetConfig: function () {
(this.currentConfig.seek = 0), (this.currentConfig.delay = 0);
},
update: a,
calculateRate: function () {
var t = this.currentConfig.detune + this.manager.detune,
e = Math.pow(1.0005777895065548, t);
this.totalRate = this.currentConfig.rate * this.manager.rate * e;
},
destroy: function () {
this.pendingRemove ||
(this.emit(r.DESTROY, this),
(this.pendingRemove = !0),
(this.manager = null),
(this.key = ""),
this.removeAllListeners(),
(this.isPlaying = !1),
(this.isPaused = !1),
(this.config = null),
(this.currentConfig = null),
(this.markers = null),
(this.currentMarker = null));
},
});
t.exports = h;
},
function (t, e, i) {
var n = i(209),
s = i(435);
t.exports = function (t, e) {
if ((void 0 === e && (e = 90), !n(t))) return null;
if (("string" != typeof e && (e = ((e % 360) + 360) % 360), 90 === e || -270 === e || "rotateLeft" === e)) (t = s(t)).reverse();
else if (-90 === e || 270 === e || "rotateRight" === e) t.reverse(), (t = s(t));
else if (180 === Math.abs(e) || "rotate180" === e) {
for (var i = 0; i < t.length; i++) t[i].reverse();
t.reverse();
}
return t;
};
},
function (t, e, i) {
var n = i(0),
f = i(18),
s = i(11),
h = i(15),
l = i(1043),
r = i(1044),
o = i(212),
u = i(10),
a = i(1045),
c = new n({
Extends: h,
Mixins: [s.Alpha, s.BlendMode, s.Depth, s.Mask, s.Origin, s.Pipeline, s.ScrollFactor, s.Texture, s.Tint, s.Transform, s.Visible, a],
initialize: function (t, e, i, n, s, r, o) {
void 0 === s && (s = ""), void 0 === o && (o = 0), h.call(this, t, "BitmapText"), (this.font = n);
var a = this.scene.sys.cache.bitmapFont.get(n);
(this.fontData = a.data),
(this._text = ""),
(this._fontSize = r || this.fontData.size),
(this._letterSpacing = 0),
(this._align = o),
(this._bounds = l()),
(this._dirty = !0),
(this._maxWidth = 0),
(this.wordWrapCharCode = 32),
(this.charColors = []),
(this.dropShadowX = 0),
(this.dropShadowY = 0),
(this.dropShadowColor = 0),
(this.dropShadowAlpha = 0.5),
(this.fromAtlas = a.fromAtlas),
this.setTexture(a.texture, a.frame),
this.setPosition(e, i),
this.setOrigin(0, 0),
this.initPipeline(),
this.setText(s);
},
setLeftAlign: function () {
return (this._align = c.ALIGN_LEFT), (this._dirty = !0), this;
},
setCenterAlign: function () {
return (this._align = c.ALIGN_CENTER), (this._dirty = !0), this;
},
setRightAlign: function () {
return (this._align = c.ALIGN_RIGHT), (this._dirty = !0), this;
},
setFontSize: function (t) {
return (this._fontSize = t), (this._dirty = !0), this;
},
setLetterSpacing: function (t) {
return void 0 === t && (t = 0), (this._letterSpacing = t), (this._dirty = !0), this;
},
setText: function (t) {
return t || 0 === t || (t = ""), Array.isArray(t) && (t = t.join("\n")), t !== this.text && ((this._text = t.toString()), (this._dirty = !0), this.updateDisplayOrigin()), this;
},
setDropShadow: function (t, e, i, n) {
return (
void 0 === t && (t = 0),
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 0.5),
(this.dropShadowX = t),
(this.dropShadowY = e),
(this.dropShadowColor = i),
(this.dropShadowAlpha = n),
this
);
},
setCharacterTint: function (t, e, i, n, s, r, o) {
void 0 === t && (t = 0), void 0 === e && (e = 1), void 0 === i && (i = !1), void 0 === n && (n = -1), void 0 === s && (o = r = s = n);
var a = this.text.length;
-1 === e && (e = a), t < 0 && (t = a + t), (t = f(t, 0, a - 1));
for (var h = f(t + e, t, a), l = this.charColors, u = t; u < h; u++) {
var c,
d = l[u];
-1 === n
? (l[u] = null)
: ((c = i ? 1 : 0), d ? ((d.tintEffect = c), (d.tintTL = n), (d.tintTR = s), (d.tintBL = r), (d.tintBR = o)) : (l[u] = { tintEffect: c, tintTL: n, tintTR: s, tintBL: r, tintBR: o }));
}
return this;
},
setWordTint: function (t, e, i, n, s, r, o) {
void 0 === e && (e = 1);
for (var a = this.getTextBounds().words, h = "number" == typeof t, l = 0, u = 0; u < a.length; u++) {
var c = a[u];
if (((h && u === t) || (!h && c.word === t)) && (this.setCharacterTint(c.i, c.word.length, i, n, s, r, o), ++l === e)) return this;
}
return this;
},
getTextBounds: function (t) {
var e = this._bounds;
return (this._dirty || t || this.scaleX !== e.scaleX || this.scaleY !== e.scaleY) && (l(this, t, !0, e), (this._dirty = !1)), e;
},
getCharacterAt: function (t, e, i) {
for (var n = this.getLocalPoint(t, e, null, i), s = this.getTextBounds().characters, r = new u(), o = 0; o < s.length; o++) {
var a = s[o];
if ((r.setTo(a.x, a.t, a.r - a.x, a.b), r.contains(n.x, n.y))) return a;
}
return null;
},
updateDisplayOrigin: function () {
return (this._dirty = !0), this.getTextBounds(!1), this;
},
setFont: function (t, e, i) {
var n;
return (
void 0 === e && (e = this._fontSize),
void 0 === i && (i = this._align),
t === this.font ||
((n = this.scene.sys.cache.bitmapFont.get(t)) &&
((this.font = t),
(this.fontData = n.data),
(this._fontSize = e),
(this._align = i),
(this.fromAtlas = !0 === n.fromAtlas),
this.setTexture(n.texture, n.frame),
l(this, !1, !0, this._bounds))),
this
);
},
setMaxWidth: function (t, e) {
return (this._maxWidth = t), (this._dirty = !0), void 0 !== e && (this.wordWrapCharCode = e), this;
},
align: {
set: function (t) {
(this._align = t), (this._dirty = !0);
},
get: function () {
return this._align;
},
},
text: {
set: function (t) {
this.setText(t);
},
get: function () {
return this._text;
},
},
fontSize: {
set: function (t) {
(this._fontSize = t), (this._dirty = !0);
},
get: function () {
return this._fontSize;
},
},
letterSpacing: {
set: function (t) {
(this._letterSpacing = t), (this._dirty = !0);
},
get: function () {
return this._letterSpacing;
},
},
maxWidth: {
set: function (t) {
(this._maxWidth = t), (this._dirty = !0);
},
get: function () {
return this._maxWidth;
},
},
width: {
get: function () {
return this.getTextBounds(!1), this._bounds.global.width;
},
},
height: {
get: function () {
return this.getTextBounds(!1), this._bounds.global.height;
},
},
toJSON: function () {
var t = s.ToJSON(this),
e = { font: this.font, text: this.text, fontSize: this.fontSize, letterSpacing: this.letterSpacing, align: this.align };
return (t.data = e), t;
},
preDestroy: function () {
(this.charColors.length = 0), (this._bounds = null), (this.fontData = null);
},
});
(c.ALIGN_LEFT = 0), (c.ALIGN_CENTER = 1), (c.ALIGN_RIGHT = 2), (c.ParseFromAtlas = r), (c.ParseXMLBitmapFont = o), (t.exports = c);
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t) {
if (((this.entries = []), Array.isArray(t))) for (var e = 0; e < t.length; e++) this.set(t[e]);
},
set: function (t) {
return -1 === this.entries.indexOf(t) && this.entries.push(t), this;
},
get: function (t, e) {
for (var i = 0; i < this.entries.length; i++) {
var n = this.entries[i];
if (n[t] === e) return n;
}
},
getArray: function () {
return this.entries.slice(0);
},
delete: function (t) {
var e = this.entries.indexOf(t);
return -1 < e && this.entries.splice(e, 1), this;
},
dump: function () {
for (var t = 0; t < this.entries.length; t++) this.entries[t];
},
each: function (t, e) {
var i,
n = this.entries.slice(),
s = n.length;
if (e) for (i = 0; i < s && !1 !== t.call(e, n[i], i); i++);
else for (i = 0; i < s && !1 !== t(n[i], i); i++);
return this;
},
iterate: function (t, e) {
var i,
n = this.entries.length;
if (e) for (i = 0; i < n && !1 !== t.call(e, this.entries[i], i); i++);
else for (i = 0; i < n && !1 !== t(this.entries[i], i); i++);
return this;
},
iterateLocal: function (t) {
for (var e = [], i = 1; i < arguments.length; i++) e.push(arguments[i]);
var n = this.entries.length;
for (i = 0; i < n; i++) {
var s = this.entries[i];
s[t].apply(s, e);
}
return this;
},
clear: function () {
return (this.entries.length = 0), this;
},
contains: function (t) {
return -1 < this.entries.indexOf(t);
},
union: function (t) {
var e = new n();
return (
t.entries.forEach(function (t) {
e.set(t);
}),
this.entries.forEach(function (t) {
e.set(t);
}),
e
);
},
intersect: function (e) {
var i = new n();
return (
this.entries.forEach(function (t) {
e.contains(t) && i.set(t);
}),
i
);
},
difference: function (e) {
var i = new n();
return (
this.entries.forEach(function (t) {
e.contains(t) || i.set(t);
}),
i
);
},
size: {
get: function () {
return this.entries.length;
},
set: function (t) {
return t < this.entries.length ? (this.entries.length = t) : this.entries.length;
},
},
});
t.exports = n;
},
function (t, e, i) {
var n = i(0),
s = i(11),
a = i(15),
h = i(189),
l = i(92),
r = i(1182),
o = new n({
Extends: a,
Mixins: [s.AlphaSingle, s.BlendMode, s.Depth, s.GetBounds, s.Mask, s.Pipeline, s.ScrollFactor, s.Transform, s.Visible, r],
initialize: function (t, e, i, n, s, r, o) {
void 0 === n && (n = 16777215),
void 0 === s && (s = 128),
void 0 === r && (r = 1),
void 0 === o && (o = 0.1),
a.call(this, t, "PointLight"),
this.initPipeline(l.POINTLIGHT_PIPELINE),
this.setPosition(e, i),
(this.color = h(n)),
(this.intensity = r),
(this.attenuation = o),
(this.width = 2 * s),
(this.height = 2 * s),
(this._radius = s);
},
radius: {
get: function () {
return this._radius;
},
set: function (t) {
(this._radius = t), (this.width = 2 * t), (this.height = 2 * t);
},
},
originX: {
get: function () {
return 0.5;
},
},
originY: {
get: function () {
return 0.5;
},
},
displayOriginX: {
get: function () {
return this._radius;
},
},
displayOriginY: {
get: function () {
return this._radius;
},
},
});
t.exports = o;
},
function (t, e) {
t.exports = function (t, e) {
var i = e.width / 2,
n = e.height / 2,
s = Math.abs(t.x - e.x - i),
r = Math.abs(t.y - e.y - n),
o = i + t.radius,
a = n + t.radius;
if (o < s || a < r) return !1;
if (s <= i || r <= n) return !0;
var h = s - i,
l = r - n;
return h * h + l * l <= t.radius * t.radius;
};
},
function (t, e) {
t.exports = function (t, e) {
return !(t.width <= 0 || t.height <= 0 || e.width <= 0 || e.height <= 0 || t.right < e.x || t.bottom < e.y || t.x > e.right || t.y > e.bottom);
};
},
function (t, e, i) {
var l = i(6),
u = {},
n = {
register: function (t, e, i, n, s) {
u[t] = { plugin: e, mapping: i, settingsKey: n, configKey: s };
},
getPlugin: function (t) {
return u[t];
},
install: function (t) {
var e = t.scene.sys,
i = e.settings.input,
n = e.game.config;
for (var s in u) {
var r = u[s].plugin,
o = u[s].mapping,
a = u[s].settingsKey,
h = u[s].configKey;
l(i, a, n[h]) && (t[o] = new r(t));
}
},
remove: function (t) {
u.hasOwnProperty(t) && delete u[t];
},
};
t.exports = n;
},
function (t, e, i) {
t.exports = { ANY_KEY_DOWN: i(1323), ANY_KEY_UP: i(1324), COMBO_MATCH: i(1325), DOWN: i(1326), KEY_DOWN: i(1327), KEY_UP: i(1328), UP: i(1329) };
},
function (t, e) {
t.exports = function (t, e) {
return !!t.url && (t.url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/) ? t.url : e + t.url);
};
},
function (t, e) {
t.exports = function (t, e, i, n, s, r) {
return (
void 0 === t && (t = ""),
void 0 === e && (e = !0),
void 0 === i && (i = ""),
void 0 === n && (n = ""),
void 0 === s && (s = 0),
void 0 === r && (r = !1),
{ responseType: t, async: e, user: i, password: n, timeout: s, headers: void 0, header: void 0, headerValue: void 0, requestedWith: !1, overrideMimeType: void 0, withCredentials: r }
);
};
},
function (t, e, i) {
var n = i(0),
s = i(243),
r = i(73),
o = new n({
Extends: r,
Mixins: [s.Acceleration, s.Angular, s.Bounce, s.Debug, s.Drag, s.Enable, s.Friction, s.Gravity, s.Immovable, s.Mass, s.Pushable, s.Size, s.Velocity],
initialize: function (t, e, i, n, s) {
r.call(this, t, e, i, n, s), (this.body = null);
},
});
t.exports = o;
},
function (t, e, i) {
var r = i(119);
t.exports = function (t, e, i, n) {
if ((void 0 === i && (i = !1), r(t, e, n))) {
var s = n.data[e][t] || null;
return s && (-1 !== s.index || i) ? s : null;
}
return null;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s,
r,
o,
a = t.data,
h = t.width,
l = t.height,
u = t.tilemapLayer,
c = Math.max(0, e.left),
d = Math.min(h, e.right),
f = Math.max(0, e.top),
p = Math.min(l, e.bottom);
if (0 === i) for (r = f; r < p; r++) for (s = c; a[r] && s < d; s++) (o = a[r][s]) && -1 !== o.index && o.visible && 0 !== o.alpha && n.push(o);
else if (1 === i) for (r = f; r < p; r++) for (s = d; a[r] && c <= s; s--) (o = a[r][s]) && -1 !== o.index && o.visible && 0 !== o.alpha && n.push(o);
else if (2 === i) for (r = p; f <= r; r--) for (s = c; a[r] && s < d; s++) (o = a[r][s]) && -1 !== o.index && o.visible && 0 !== o.alpha && n.push(o);
else if (3 === i) for (r = p; f <= r; r--) for (s = d; a[r] && c <= s; s--) (o = a[r][s]) && -1 !== o.index && o.visible && 0 !== o.alpha && n.push(o);
return (u.tilesDrawn = n.length), (u.tilesTotal = h * l), n;
};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = i.collideIndexes.indexOf(t);
e && -1 === n ? i.collideIndexes.push(t) : e || -1 === n || i.collideIndexes.splice(n, 1);
};
},
function (t, e, i) {
var r = i(2);
t.exports = function (t, e, i) {
if (!e) return { i: 0, layers: t.layers, name: "", opacity: 1, visible: !0, x: 0, y: 0 };
var n = e.x + r(e, "startx", 0) * t.tilewidth + r(e, "offsetx", 0),
s = e.y + r(e, "starty", 0) * t.tileheight + r(e, "offsety", 0);
return { i: 0, layers: e.layers, name: i.name + e.name + "/", opacity: i.opacity * e.opacity, visible: i.visible && e.visible, x: i.x + n, y: i.y + s };
};
},
function (t, e) {
t.exports = function (o, a, t) {
return o.hasOwnProperty(a)
? "function" == typeof o[a]
? function (t, e, i, n, s, r) {
return o[a](t, e, i, n, s, r);
}
: function () {
return o[a];
}
: "function" == typeof t
? t
: function () {
return t;
};
};
},
function (t, e, i) {
var k = i(265),
R = i(13),
L = i(99),
I = i(80),
D = i(162),
F = i(583),
B = i(263),
N = i(6),
U = i(264),
Y = i(266),
z = i(268);
t.exports = function (t, e, i) {
void 0 === i && (i = k);
for (
var n = i.targets ? i.targets : B(e),
s = F(e),
r = D(e, "delay", i.delay),
o = D(e, "duration", i.duration),
a = N(e, "easeParams", i.easeParams),
h = I(N(e, "ease", i.ease), a),
l = D(e, "hold", i.hold),
u = D(e, "repeat", i.repeat),
c = D(e, "repeatDelay", i.repeatDelay),
d = L(e, "yoyo", i.yoyo),
f = L(e, "flipX", i.flipX),
p = L(e, "flipY", i.flipY),
g = [],
v = 0;
v < s.length;
v++
)
for (var y = s[v].key, m = s[v].value, x = 0; x < n.length; x++) {
var b = U(y, m),
w = z(
n[x],
x,
y,
b.getEnd,
b.getStart,
b.getActive,
I(N(m, "ease", h), N(m, "easeParams", a)),
D(m, "delay", r),
D(m, "duration", o),
L(m, "yoyo", d),
D(m, "hold", l),
D(m, "repeat", u),
D(m, "repeatDelay", c),
L(m, "flipX", f),
L(m, "flipY", p)
);
g.push(w);
}
var T = new Y(t, g, n);
(T.offset = R(e, "offset", null)),
(T.completeDelay = R(e, "completeDelay", 0)),
(T.loop = Math.round(R(e, "loop", 0))),
(T.loopDelay = Math.round(R(e, "loopDelay", 0))),
(T.paused = L(e, "paused", !1)),
(T.useFrames = L(e, "useFrames", !1));
for (var S = N(e, "callbackScope", T), _ = [T, null], E = Y.TYPES, P = 0; P < E.length; P++) {
var A,
M,
C = E[P],
O = N(e, C, !1);
O && ((A = N(e, C + "Scope", S)), (M = N(e, C + "Params", [])), T.setCallback(C, O, _.concat(M), A));
}
return T;
};
},
function (t, e, i) {
var n = i(0),
s = i(102),
l = i(2),
r = i(132),
o = i(185),
a = new n({
initialize: function (t) {
(this.parent = t),
(this.animationManager = t.scene.sys.anims),
this.animationManager.on(r.REMOVE_ANIMATION, this.globalRemove, this),
(this.textureManager = this.animationManager.textureManager),
(this.anims = null),
(this.isPlaying = !1),
(this.hasStarted = !1),
(this.currentAnim = null),
(this.currentFrame = null),
(this.nextAnim = null),
(this.nextAnimsQueue = []),
(this.timeScale = 1),
(this.frameRate = 0),
(this.duration = 0),
(this.msPerFrame = 0),
(this.skipMissedFrames = !0),
(this.delay = 0),
(this.repeat = 0),
(this.repeatDelay = 0),
(this.yoyo = !1),
(this.showOnStart = !1),
(this.hideOnComplete = !1),
(this.forward = !0),
(this.inReverse = !1),
(this.accumulator = 0),
(this.nextTick = 0),
(this.delayCounter = 0),
(this.repeatCounter = 0),
(this.pendingRepeat = !1),
(this._paused = !1),
(this._wasPlaying = !1),
(this._pendingStop = 0),
this._pendingStopValue;
},
chain: function (t) {
var e = this.parent;
if (void 0 === t) return (this.nextAnimsQueue.length = 0), (this.nextAnim = null), e;
Array.isArray(t) || (t = [t]);
for (var i = 0; i < t.length; i++) {
var n = t[i];
null === this.nextAnim ? (this.nextAnim = n) : this.nextAnimsQueue.push(n);
}
return this.parent;
},
getName: function () {
return this.currentAnim ? this.currentAnim.key : "";
},
getFrameName: function () {
return this.currentFrame ? this.currentFrame.textureFrame : "";
},
load: function (t) {
this.isPlaying && this.stop();
var e,
i,
n,
s,
r,
o = this.animationManager,
a = "string" == typeof t ? t : l(t, "key", null),
h = this.exists(a) ? this.get(a) : o.get(a);
return (
h &&
((e = (this.currentAnim = h).getTotalFrames()),
(i = l(t, "frameRate", h.frameRate)),
(n = l(t, "duration", h.duration)),
h.calculateDuration(this, e, n, i),
(this.delay = l(t, "delay", h.delay)),
(this.repeat = l(t, "repeat", h.repeat)),
(this.repeatDelay = l(t, "repeatDelay", h.repeatDelay)),
(this.yoyo = l(t, "yoyo", h.yoyo)),
(this.showOnStart = l(t, "showOnStart", h.showOnStart)),
(this.hideOnComplete = l(t, "hideOnComplete", h.hideOnComplete)),
(this.skipMissedFrames = l(t, "skipMissedFrames", h.skipMissedFrames)),
(this.timeScale = l(t, "timeScale", this.timeScale)),
(s = l(t, "startFrame", 0)) > h.getTotalFrames() && (s = 0),
(r = h.frames[s]),
0 !== s || this.forward || (r = h.getLastFrame()),
(this.currentFrame = r)),
this.parent
);
},
pause: function (t) {
return this._paused || ((this._paused = !0), (this._wasPlaying = this.isPlaying), (this.isPlaying = !1)), void 0 !== t && this.setCurrentFrame(t), this.parent;
},
resume: function (t) {
return this._paused && ((this._paused = !1), (this.isPlaying = this._wasPlaying)), void 0 !== t && this.setCurrentFrame(t), this.parent;
},
playAfterDelay: function (t, e) {
var i, n;
return (
this.isPlaying
? ((i = this.nextAnim), (n = this.nextAnimsQueue), i && n.unshift(i), (this.nextAnim = t), (this._pendingStop = 1), (this._pendingStopValue = e))
: ((this.delayCounter = e), this.play(t, !0)),
this.parent
);
},
playAfterRepeat: function (t, e) {
var i, n;
return (
void 0 === e && (e = 1),
this.isPlaying
? ((i = this.nextAnim),
(n = this.nextAnimsQueue),
i && n.unshift(i),
-1 !== this.repeatCounter && e > this.repeatCounter && (e = this.repeatCounter),
(this.nextAnim = t),
(this._pendingStop = 2),
(this._pendingStopValue = e))
: this.play(t),
this.parent
);
},
play: function (t, e) {
void 0 === e && (e = !1);
var i = this.currentAnim,
n = this.parent,
s = "string" == typeof t ? t : t.key;
if (e && this.isPlaying && i.key === s) return n;
if (i && this.isPlaying) {
var r = this.animationManager.getMix(i.key, t);
if (0 < r) return this.playAfterDelay(t, r);
}
return (this.forward = !0), (this.inReverse = !1), (this._paused = !1), (this._wasPlaying = !0), this.startAnimation(t);
},
playReverse: function (t, e) {
void 0 === e && (e = !1);
var i = "string" == typeof t ? t : t.key;
return e && this.isPlaying && this.currentAnim.key === i ? this.parent : ((this.forward = !1), (this.inReverse = !0), (this._paused = !1), (this._wasPlaying = !0), this.startAnimation(t));
},
startAnimation: function (t) {
this.load(t);
var e = this.currentAnim,
i = this.parent;
return (
e &&
((this.repeatCounter = -1 === this.repeat ? Number.MAX_VALUE : this.repeat),
e.getFirstTick(this),
(this.isPlaying = !0),
(this.pendingRepeat = !1),
(this.hasStarted = !1),
(this._pendingStop = 0),
(this._pendingStopValue = 0),
(this._paused = !1),
(this.delayCounter += this.delay),
0 === this.delayCounter && this.handleStart()),
i
);
},
handleStart: function () {
this.showOnStart && this.parent.setVisible(!0), this.setCurrentFrame(this.currentFrame), (this.hasStarted = !0), this.emitEvents(r.ANIMATION_START);
},
handleRepeat: function () {
(this.pendingRepeat = !1), this.emitEvents(r.ANIMATION_REPEAT);
},
handleStop: function () {
(this._pendingStop = 0), (this.isPlaying = !1), this.emitEvents(r.ANIMATION_STOP);
},
handleComplete: function () {
(this._pendingStop = 0), (this.isPlaying = !1), this.hideOnComplete && this.parent.setVisible(!1), this.emitEvents(r.ANIMATION_COMPLETE, r.ANIMATION_COMPLETE_KEY);
},
emitEvents: function (t, e) {
var i = this.currentAnim,
n = this.currentFrame,
s = this.parent,
r = n.textureFrame;
s.emit(t, i, n, s, r), e && s.emit(e + i.key, i, n, s, r);
},
reverse: function () {
return this.isPlaying && ((this.inReverse = !this.inReverse), (this.forward = !this.forward)), this.parent;
},
getProgress: function () {
var t = this.currentFrame;
if (!t) return 0;
var e = t.progress;
return this.inReverse && (e *= -1), e;
},
setProgress: function (t) {
return this.forward || (t = 1 - t), this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)), this.parent;
},
setRepeat: function (t) {
return (this.repeatCounter = -1 === t ? Number.MAX_VALUE : t), this.parent;
},
globalRemove: function (t, e) {
void 0 === e && (e = this.currentAnim), this.isPlaying && e.key === this.currentAnim.key && (this.stop(), this.setCurrentFrame(this.currentAnim.frames[0]));
},
restart: function (t, e) {
void 0 === t && (t = !1), void 0 === e && (e = !1);
var i = this.currentAnim,
n = this.parent;
return i
? (e && (this.repeatCounter = -1 === this.repeat ? Number.MAX_VALUE : this.repeat),
i.getFirstTick(this),
this.emitEvents(r.ANIMATION_RESTART),
(this.isPlaying = !0),
(this.pendingRepeat = !1),
(this.hasStarted = !t),
(this._pendingStop = 0),
(this._pendingStopValue = 0),
(this._paused = !1),
this.setCurrentFrame(i.frames[0]),
this.parent)
: n;
},
complete: function () {
var t;
return (
(this._pendingStop = 0),
(this.isPlaying = !1),
this.currentAnim && this.handleComplete(),
this.nextAnim && ((t = this.nextAnim), (this.nextAnim = 0 < this.nextAnimsQueue.length ? this.nextAnimsQueue.shift() : null), this.play(t)),
this.parent
);
},
stop: function () {
var t;
return (
(this._pendingStop = 0),
(this.isPlaying = !1),
this.currentAnim && this.handleStop(),
this.nextAnim && ((t = this.nextAnim), (this.nextAnim = this.nextAnimsQueue.shift()), this.play(t)),
this.parent
);
},
stopAfterDelay: function (t) {
return (this._pendingStop = 1), (this._pendingStopValue = t), this.parent;
},
stopAfterRepeat: function (t) {
return void 0 === t && (t = 1), -1 !== this.repeatCounter && t > this.repeatCounter && (t = this.repeatCounter), (this._pendingStop = 2), (this._pendingStopValue = t), this.parent;
},
stopOnFrame: function (t) {
return (this._pendingStop = 3), (this._pendingStopValue = t), this.parent;
},
getTotalFrames: function () {
return this.currentAnim ? this.currentAnim.getTotalFrames() : 0;
},
update: function (t, e) {
var i = this.currentAnim;
if (this.isPlaying && i && !i.paused) {
if (((this.accumulator += e * this.timeScale), 1 === this._pendingStop && ((this._pendingStopValue -= e), this._pendingStopValue <= 0))) return this.stop();
if (this.hasStarted) {
if (
this.accumulator >= this.nextTick &&
(this.forward ? i.nextFrame(this) : i.previousFrame(this), this.isPlaying && 0 === this._pendingStop && this.skipMissedFrames && this.accumulator > this.nextTick)
)
for (var n = 0; this.forward ? i.nextFrame(this) : i.previousFrame(this), n++, this.isPlaying && this.accumulator > this.nextTick && n < 60; );
} else this.accumulator >= this.delayCounter && ((this.accumulator -= this.delayCounter), this.handleStart());
}
},
setCurrentFrame: function (t) {
var e = this.parent;
return (
(this.currentFrame = t),
(e.texture = t.frame.texture),
(e.frame = t.frame),
e.isCropped && e.frame.updateCropUVs(e._crop, e.flipX, e.flipY),
t.setAlpha && (e.alpha = t.alpha),
e.setSizeToFrame(),
e._originComponent && (t.frame.customPivot ? e.setOrigin(t.frame.pivotX, t.frame.pivotY) : e.updateDisplayOrigin()),
this.isPlaying && this.hasStarted && (this.emitEvents(r.ANIMATION_UPDATE), 3 === this._pendingStop && this._pendingStopValue === t && this.stop()),
e
);
},
nextFrame: function () {
return this.currentAnim && this.currentAnim.nextFrame(this), this.parent;
},
previousFrame: function () {
return this.currentAnim && this.currentAnim.previousFrame(this), this.parent;
},
get: function (t) {
return this.anims ? this.anims.get(t) : null;
},
exists: function (t) {
return !!this.anims && this.anims.has(t);
},
create: function (t) {
var e = t.key,
i = !1;
return e && ((i = this.get(e)) || ((i = new o(this, e, t)), this.anims || (this.anims = new s()), this.anims.set(e, i))), i;
},
generateFrameNames: function (t, e) {
return this.animationManager.generateFrameNames(t, e);
},
generateFrameNumbers: function (t, e) {
return this.animationManager.generateFrameNumbers(t, e);
},
remove: function (t) {
var e = this.get(t);
return e && (this.currentAnim === e && this.stop(), this.anims.delete(t)), e;
},
destroy: function () {
this.animationManager.off(r.REMOVE_ANIMATION, this.globalRemove, this),
this.anims && this.anims.clear(),
(this.animationManager = null),
(this.parent = null),
(this.nextAnim = null),
(this.nextAnimsQueue.length = 0),
(this.currentAnim = null),
(this.currentFrame = null);
},
isPaused: {
get: function () {
return this._paused;
},
},
});
t.exports = a;
},
function (t, e, i) {
var u = {};
t.exports = u;
var n = i(166);
(u._motionWakeThreshold = 0.18),
(u._motionSleepThreshold = 0.08),
(u._minBias = 0.9),
(u.update = function (t, e) {
for (var i = e * e * e, n = 0; n < t.length; n++) {
var s,
r,
o = t[n],
a = o.speed * o.speed + o.angularSpeed * o.angularSpeed;
0 === o.force.x && 0 === o.force.y
? ((s = Math.min(o.motion, a)),
(r = Math.max(o.motion, a)),
(o.motion = u._minBias * s + (1 - u._minBias) * r),
0 < o.sleepThreshold && o.motion < u._motionSleepThreshold * i ? ((o.sleepCounter += 1), o.sleepCounter >= o.sleepThreshold && u.set(o, !0)) : 0 < o.sleepCounter && --o.sleepCounter)
: u.set(o, !1);
}
}),
(u.afterCollisions = function (t, e) {
for (var i = e * e * e, n = 0; n < t.length; n++) {
var s,
r,
o,
a,
h,
l = t[n];
l.isActive &&
((r = (s = l.collision).bodyA.parent),
(o = s.bodyB.parent),
(r.isSleeping && o.isSleeping) ||
r.isStatic ||
o.isStatic ||
((r.isSleeping || o.isSleeping) && ((h = (a = r.isSleeping && !r.isStatic ? r : o) === r ? o : r), !a.isStatic && h.motion > u._motionWakeThreshold * i && u.set(a, !1))));
}
}),
(u.set = function (t, e) {
var i = t.isSleeping;
e
? ((t.isSleeping = !0),
(t.sleepCounter = t.sleepThreshold),
(t.positionImpulse.x = 0),
(t.positionImpulse.y = 0),
(t.positionPrev.x = t.position.x),
(t.positionPrev.y = t.position.y),
(t.anglePrev = t.angle),
(t.speed = 0),
(t.angularSpeed = 0),
(t.motion = 0),
i || n.trigger(t, "sleepStart"))
: ((t.isSleeping = !1), (t.sleepCounter = 0), i && n.trigger(t, "sleepEnd"));
});
},
function (t, e, i) {
var n = {};
t.exports = n;
var u = i(32);
(n.on = function (t, e, i) {
for (var n, s = e.split(" "), r = 0; r < s.length; r++) (n = s[r]), (t.events = t.events || {}), (t.events[n] = t.events[n] || []), t.events[n].push(i);
return i;
}),
(n.off = function (t, e, i) {
if (e) {
"function" == typeof e && ((i = e), (e = u.keys(t.events).join(" ")));
for (var n = e.split(" "), s = 0; s < n.length; s++) {
var r = t.events[n[s]],
o = [];
if (i && r) for (var a = 0; a < r.length; a++) r[a] !== i && o.push(r[a]);
t.events[n[s]] = o;
}
} else t.events = {};
}),
(n.trigger = function (t, e, i) {
var n,
s,
r,
o,
a = t.events;
if (a && 0 < u.keys(a).length) {
(i = i || {}), (n = e.split(" "));
for (var h = 0; h < n.length; h++)
if ((r = a[(s = n[h])])) {
((o = u.clone(i, !1)).name = s), (o.source = t);
for (var l = 0; l < r.length; l++) r[l].apply(t, [o]);
}
}
});
},
function (t, e, i) {
var a = i(175),
s = i(92),
r = i(74),
n = {
defaultPipeline: null,
pipeline: null,
hasPostPipeline: !1,
postPipelines: null,
pipelineData: null,
initPipeline: function (t) {
void 0 === t && (t = s.MULTI_PIPELINE);
var e = this.scene.sys.renderer;
if (!e) return !1;
var i = e.pipelines;
if (((this.postPipelines = []), (this.pipelineData = {}), i)) {
var n = i.get(t);
if (n) return (this.defaultPipeline = n), (this.pipeline = n), !0;
}
return !1;
},
setPipeline: function (t, e, i) {
var n = this.scene.sys.renderer;
if (!n) return this;
var s,
r = n.pipelines;
return r && ((s = r.get(t)) && (this.pipeline = s), e && (this.pipelineData = i ? a(e) : e)), this;
},
setPostPipeline: function (t, e, i) {
var n = this.scene.sys.renderer;
if (!n) return this;
var s = n.pipelines;
if (s) {
Array.isArray(t) || (t = [t]);
for (var r = 0; r < t.length; r++) {
var o = s.getPostPipeline(t[r], this);
o && this.postPipelines.push(o);
}
e && (this.pipelineData = i ? a(e) : e);
}
return (this.hasPostPipeline = 0 < this.postPipelines.length), this;
},
setPipelineData: function (t, e) {
var i = this.pipelineData;
return void 0 === e ? delete i[t] : (i[t] = e), this;
},
getPostPipeline: function (t) {
for (var e = this.postPipelines, i = [], n = 0; n < e.length; n++) {
var s = e[n];
(("string" == typeof t && s.name === t) || s instanceof t) && i.push(s);
}
return 1 === i.length ? i[0] : i;
},
resetPipeline: function (t, e) {
return (
void 0 === t && (t = !1),
void 0 === e && (e = !1),
(this.pipeline = this.defaultPipeline),
t && ((this.postPipelines = []), (this.hasPostPipeline = !1)),
e && (this.pipelineData = {}),
null !== this.pipeline
);
},
resetPostPipeline: function (t) {
void 0 === t && (t = !1);
for (var e = this.postPipelines, i = 0; i < e.length; i++) e[i].destroy();
(this.postPipelines = []), (this.hasPostPipeline = !1), t && (this.pipelineData = {});
},
removePostPipeline: function (t) {
for (var e = this.postPipelines, i = e.length - 1; 0 <= i; i--) {
var n = e[i];
(("string" == typeof t && n.name === t) || ("string" != typeof t && n instanceof t)) && (n.destroy(), r(e, i));
}
return (this.hasPostPipeline = 0 < this.postPipelines.length), this;
},
getPipelineName: function () {
return this.pipeline.name;
},
};
t.exports = n;
},
function (t, e) {
t.exports = { DEFAULT: 0, LINEAR: 0, NEAREST: 1 };
},
function (t, e, i) {
var n = i(4);
t.exports = function (t, e, i) {
return void 0 === i && (i = new n()), (i.x = t.x + t.radius * Math.cos(e)), (i.y = t.y + t.radius * Math.sin(e)), i;
};
},
function (t, e, i) {
var a = i(4);
t.exports = function (t, e) {
void 0 === e && (e = new a());
var i = 2 * Math.PI * Math.random(),
n = Math.random() + Math.random(),
s = 1 < n ? 2 - n : n,
r = s * Math.cos(i),
o = s * Math.sin(i);
return (e.x = t.x + r * t.radius), (e.y = t.y + o * t.radius), e;
};
},
function (t, e, i) {
var s = i(130),
r = i(4);
t.exports = function (t, e, i) {
if ((void 0 === i && (i = new r()), e <= 0 || 1 <= e)) return (i.x = t.x), (i.y = t.y), i;
var n = s(t) * e;
return (
0.5 < e
? (n -= t.width + t.height) <= t.width
? ((i.x = t.right - n), (i.y = t.bottom))
: ((i.x = t.x), (i.y = t.bottom - (n - t.width)))
: n <= t.width
? ((i.x = t.x + n), (i.y = t.y))
: ((i.x = t.right), (i.y = t.y + (n - t.width))),
i
);
};
},
function (t, e, i) {
var d = i(67),
f = i(4);
t.exports = function (t, e, i, n) {
void 0 === n && (n = []), !e && 0 < i && (e = d(t) / i);
for (var s = t.x1, r = t.y1, o = t.x2, a = t.y2, h = 0; h < e; h++) {
var l = h / e,
u = s + (o - s) * l,
c = r + (a - r) * l;
n.push(new f(u, c));
}
return n;
};
},
function (t, e, i) {
var n = i(4);
t.exports = function (t, e) {
void 0 === e && (e = new n());
var i = Math.random();
return (e.x = t.x1 + i * (t.x2 - t.x1)), (e.y = t.y1 + i * (t.y2 - t.y1)), e;
};
},
function (t, e, i) {
var n = i(4);
t.exports = function (t, e) {
return void 0 === e && (e = new n()), (e.x = t.x + Math.random() * t.width), (e.y = t.y + Math.random() * t.height), e;
};
},
function (t, e) {
var s = function (t) {
var e, i, n;
if ("object" != typeof t || null === t) return t;
for (n in ((e = Array.isArray(t) ? [] : {}), t)) (i = t[n]), (e[n] = s(i));
return e;
};
t.exports = s;
},
function (t, e) {
t.exports = function (t) {
var e = {
name: t.name,
type: t.type,
x: t.x,
y: t.y,
depth: t.depth,
scale: { x: t.scaleX, y: t.scaleY },
origin: { x: t.originX, y: t.originY },
flipX: t.flipX,
flipY: t.flipY,
rotation: t.rotation,
alpha: t.alpha,
visible: t.visible,
blendMode: t.blendMode,
textureKey: "",
frameKey: "",
data: {},
};
return t.texture && ((e.textureKey = t.texture.key), (e.frameKey = t.frame.name)), e;
};
},
function (t, e, i) {
var g = i(3);
t.exports = function (t, e, i, n, s, r, o, a) {
void 0 === a && (a = new g());
var h = Math.sin(s),
l = Math.cos(s),
u = l * r,
c = h * r,
d = -h * o,
f = l * o,
p = 1 / (u * f + d * -c);
return (a.x = f * p * t + -d * p * e + (n * d - i * f) * p), (a.y = u * p * e + -c * p * t + (-n * u + i * c) * p), a;
};
},
function (t, e) {
t.exports = function (t, e) {
void 0 === e && (e = 1);
for (var i = null, n = 0; n < e; n++) (i = t.shift()), t.push(i);
return i;
};
},
function (t, e) {
t.exports = function (t, e) {
void 0 === e && (e = 1);
for (var i = null, n = 0; n < e; n++) (i = t.pop()), t.unshift(i);
return i;
};
},
function (t, e, i) {
var s = i(4);
t.exports = function (t, e) {
void 0 === e && (e = new s());
var i = Math.random() * Math.PI * 2,
n = Math.sqrt(Math.random());
return (e.x = t.x + (n * Math.cos(i) * t.width) / 2), (e.y = t.y + (n * Math.sin(i) * t.height) / 2), e;
};
},
function (t, e, i) {
var h = i(4);
t.exports = function (t, e) {
void 0 === e && (e = new h());
var i = t.x2 - t.x1,
n = t.y2 - t.y1,
s = t.x3 - t.x1,
r = t.y3 - t.y1,
o = Math.random(),
a = Math.random();
return 1 <= o + a && ((o = 1 - o), (a = 1 - a)), (e.x = t.x1 + (i * o + s * a)), (e.y = t.y1 + (n * o + r * a)), e;
};
},
function (t, e) {
t.exports = function (t, e, i, n, s) {
var r = n + Math.atan2(t.y - i, t.x - e);
return (t.x = e + s * Math.cos(r)), (t.y = i + s * Math.sin(r)), t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return (t = Math.max(0, Math.min(1, (t - e) / (i - e)))) * t * t * (t * (6 * t - 15) + 10);
};
},
function (t, e) {
t.exports = function (t, e, i) {
return t <= e ? 0 : i <= t ? 1 : (t = (t - e) / (i - e)) * t * (3 - 2 * t);
};
},
function (t, e, i) {
var n = i(18),
s = i(0),
r = i(132),
o = i(318),
v = i(319),
y = i(6),
m = i(320),
a = new s({
initialize: function (t, e, i) {
(this.manager = t),
(this.key = e),
(this.type = "frame"),
(this.frames = this.getFrames(t.textureManager, y(i, "frames", []), y(i, "defaultTextureKey", null), y(i, "sortFrames", !0))),
(this.frameRate = y(i, "frameRate", null)),
(this.duration = y(i, "duration", null)),
this.msPerFrame,
(this.skipMissedFrames = y(i, "skipMissedFrames", !0)),
(this.delay = y(i, "delay", 0)),
(this.repeat = y(i, "repeat", 0)),
(this.repeatDelay = y(i, "repeatDelay", 0)),
(this.yoyo = y(i, "yoyo", !1)),
(this.showOnStart = y(i, "showOnStart", !1)),
(this.hideOnComplete = y(i, "hideOnComplete", !1)),
(this.paused = !1),
this.calculateDuration(this, this.getTotalFrames(), this.duration, this.frameRate),
this.manager.on && (this.manager.on(r.PAUSE_ALL, this.pause, this), this.manager.on(r.RESUME_ALL, this.resume, this));
},
getTotalFrames: function () {
return this.frames.length;
},
calculateDuration: function (t, e, i, n) {
null === i && null === n
? ((t.frameRate = 24), (t.duration = (24 / e) * 1e3))
: i && null === n
? ((t.duration = i), (t.frameRate = e / (i / 1e3)))
: ((t.frameRate = n), (t.duration = (e / n) * 1e3)),
(t.msPerFrame = 1e3 / t.frameRate);
},
addFrame: function (t) {
return this.addFrameAt(this.frames.length, t);
},
addFrameAt: function (t, e) {
var i,
n,
s = this.getFrames(this.manager.textureManager, e);
return (
0 < s.length &&
(0 === t
? (this.frames = s.concat(this.frames))
: t === this.frames.length
? (this.frames = this.frames.concat(s))
: ((i = this.frames.slice(0, t)), (n = this.frames.slice(t)), (this.frames = i.concat(s, n))),
this.updateFrameSequence()),
this
);
},
checkFrame: function (t) {
return 0 <= t && t < this.frames.length;
},
getFirstTick: function (t) {
(t.accumulator = 0), (t.nextTick = t.msPerFrame + t.currentFrame.duration);
},
getFrameAt: function (t) {
return this.frames[t];
},
getFrames: function (t, e, i, n) {
void 0 === n && (n = !0);
var s,
r,
o,
a = [],
h = 1;
if (
("string" == typeof e &&
((r = e),
(o = t.get(r).getFrameNames()),
n && m(o),
(e = []),
o.forEach(function (t) {
e.push({ key: r, frame: t });
})),
!Array.isArray(e) || 0 === e.length)
)
return a;
for (g = 0; g < e.length; g++) {
var l,
u,
c,
d = e[g],
f = y(d, "key", i);
f && ((l = y(d, "frame", 0)), (u = t.getFrame(f, l)), ((c = new v(f, l, h, u)).duration = y(d, "duration", 0)), (c.isFirst = !s), s && ((s.nextFrame = c).prevFrame = s), a.push(c), (s = c), h++);
}
if (0 < a.length) {
(c.isLast = !0), (c.nextFrame = a[0]), (a[0].prevFrame = c);
for (var p = 1 / (a.length - 1), g = 0; g < a.length; g++) a[g].progress = g * p;
}
return a;
},
getNextTick: function (t) {
(t.accumulator -= t.nextTick), (t.nextTick = t.msPerFrame + t.currentFrame.duration);
},
getFrameByProgress: function (t) {
return (t = n(t, 0, 1)), o(t, this.frames, "progress");
},
nextFrame: function (t) {
var e = t.currentFrame;
e.isLast
? t.yoyo
? this.handleYoyoFrame(t, !1)
: 0 < t.repeatCounter
? t.inReverse && t.forward
? (t.forward = !1)
: this.repeatAnimation(t)
: t.complete()
: this.updateAndGetNextTick(t, e.nextFrame);
},
handleYoyoFrame: function (t, e) {
if (((e = e || !1), t.inReverse === !e && 0 < t.repeatCounter)) return (0 !== t.repeatDelay && !t.pendingRepeat) || (t.forward = e), void this.repeatAnimation(t);
var i;
t.inReverse === e || 0 !== t.repeatCounter ? ((i = (t.forward = e) ? t.currentFrame.nextFrame : t.currentFrame.prevFrame), this.updateAndGetNextTick(t, i)) : t.complete();
},
getLastFrame: function () {
return this.frames[this.frames.length - 1];
},
previousFrame: function (t) {
var e = t.currentFrame;
e.isFirst
? t.yoyo
? this.handleYoyoFrame(t, !0)
: 0 < t.repeatCounter
? ((t.inReverse && !t.forward) || (t.forward = !0), this.repeatAnimation(t))
: t.complete()
: this.updateAndGetNextTick(t, e.prevFrame);
},
updateAndGetNextTick: function (t, e) {
t.setCurrentFrame(e), this.getNextTick(t);
},
removeFrame: function (t) {
var e = this.frames.indexOf(t);
return -1 !== e && this.removeFrameAt(e), this;
},
removeFrameAt: function (t) {
return this.frames.splice(t, 1), this.updateFrameSequence(), this;
},
repeatAnimation: function (t) {
if (2 === t._pendingStop) {
if (0 === t._pendingStopValue) return t.stop();
t._pendingStopValue--;
}
0 < t.repeatDelay && !t.pendingRepeat
? ((t.pendingRepeat = !0), (t.accumulator -= t.nextTick), (t.nextTick += t.repeatDelay))
: (t.repeatCounter--, t.forward ? t.setCurrentFrame(t.currentFrame.nextFrame) : t.setCurrentFrame(t.currentFrame.prevFrame), t.isPlaying && (this.getNextTick(t), t.handleRepeat()));
},
toJSON: function () {
var e = {
key: this.key,
type: this.type,
frames: [],
frameRate: this.frameRate,
duration: this.duration,
skipMissedFrames: this.skipMissedFrames,
delay: this.delay,
repeat: this.repeat,
repeatDelay: this.repeatDelay,
yoyo: this.yoyo,
showOnStart: this.showOnStart,
hideOnComplete: this.hideOnComplete,
};
return (
this.frames.forEach(function (t) {
e.frames.push(t.toJSON());
}),
e
);
},
updateFrameSequence: function () {
for (var t, e = this.frames.length, i = 1 / (e - 1), n = 0; n < e; n++)
((t = this.frames[n]).index = n + 1),
(t.isFirst = !1),
(t.isLast = !1),
(t.progress = n * i),
0 === n
? ((t.isFirst = !0), 1 === e ? ((t.isLast = !0), ((t.nextFrame = t).prevFrame = t)) : ((t.isLast = !1), (t.prevFrame = this.frames[e - 1]), (t.nextFrame = this.frames[n + 1])))
: n === e - 1 && 1 < e
? ((t.isLast = !0), (t.prevFrame = this.frames[e - 2]), (t.nextFrame = this.frames[0]))
: 1 < e && ((t.prevFrame = this.frames[n - 1]), (t.nextFrame = this.frames[n + 1]));
return this;
},
pause: function () {
return (this.paused = !0), this;
},
resume: function () {
return (this.paused = !1), this;
},
destroy: function () {
this.manager.off && (this.manager.off(r.PAUSE_ALL, this.pause, this), this.manager.off(r.RESUME_ALL, this.resume, this)), this.manager.remove(this.key);
for (var t = 0; t < this.frames.length; t++) this.frames[t].destroy();
(this.frames = []), (this.manager = null);
},
});
t.exports = a;
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s;
if ((void 0 === e && (e = 0), void 0 === i && (i = " "), void 0 === n && (n = 3), e + 1 >= (t = t.toString()).length))
switch (n) {
case 1:
t = new Array(e + 1 - t.length).join(i) + t;
break;
case 3:
var r = Math.ceil((s = e - t.length) / 2);
t = new Array(s - r + 1).join(i) + t + new Array(r + 1).join(i);
break;
default:
t += new Array(e + 1 - t.length).join(i);
}
return t;
};
},
function (t, e, i) {
var n = i(327),
s = i(189),
r = i(331),
o = i(332);
t.exports = function (t) {
switch (typeof t) {
case "string":
return ("rgb" === t.substr(0, 3).toLowerCase() ? o : n)(t);
case "number":
return s(t);
case "object":
return r(t);
}
};
},
function (t, e, i) {
var a = i(103);
function h(t, e, i, n) {
var s = (t + 6 * e) % 6,
r = Math.min(s, 4 - s, 1);
return Math.round(255 * (n - n * i * Math.max(0, r)));
}
t.exports = function (t, e, i, n) {
void 0 === e && (e = 1), void 0 === i && (i = 1);
var s = h(5, t, e, i),
r = h(3, t, e, i),
o = h(1, t, e, i);
return n ? (n.setTo ? n.setTo(s, r, o, n.alpha, !1) : ((n.r = s), (n.g = r), (n.b = o), (n.color = a(s, r, o)), n)) : { r: s, g: r, b: o, color: a(s, r, o) };
};
},
function (t, e, i) {
var n = i(38),
s = i(330);
t.exports = function (t) {
var e = s(t);
return new n(e.r, e.g, e.b, e.a);
};
},
function (t, e) {
t.exports = function (t, e, i) {
return (t.x = e - t.width / 2), (t.y = i - t.height / 2), t;
};
},
function (t, e, i) {
var n = i(105),
r = i(136),
o = i(31),
a = { canvas: !1, canvasBitBltShift: null, file: !1, fileSystem: !1, getUserMedia: !0, littleEndian: !1, localStorage: !1, pointerLock: !1, support32bit: !1, vibration: !1, webGL: !1, worker: !1 };
t.exports = (function () {
if ("function" == typeof importScripts) return a;
a.canvas = !!window.CanvasRenderingContext2D;
try {
a.localStorage = !!localStorage.getItem;
} catch (t) {
a.localStorage = !1;
}
(a.file = !!(window.File && window.FileReader && window.FileList && window.Blob)), (a.fileSystem = !!window.requestFileSystem);
var t,
e,
i,
s = !1;
return (
(a.webGL = (function () {
if (window.WebGLRenderingContext)
try {
var t = o.createWebGL(this),
e = t.getContext("webgl") || t.getContext("experimental-webgl"),
i = o.create2D(this),
n = i.getContext("2d").createImageData(1, 1);
return (s = n.data instanceof Uint8ClampedArray), o.remove(t), o.remove(i), !!e;
} catch (t) {
return !1;
}
return !1;
})()),
(a.worker = !!window.Worker),
(a.pointerLock = "pointerLockElement" in document || "mozPointerLockElement" in document || "webkitPointerLockElement" in document),
(navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia),
(window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL),
(a.getUserMedia = a.getUserMedia && !!navigator.getUserMedia && !!window.URL),
r.firefox && r.firefoxVersion < 21 && (a.getUserMedia = !1),
!n.iOS && (r.ie || r.firefox || r.chrome) && (a.canvasBitBltShift = !0),
(r.safari || r.mobileSafari) && (a.canvasBitBltShift = !1),
(navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate),
navigator.vibrate && (a.vibration = !0),
"undefined" != typeof ArrayBuffer &&
"undefined" != typeof Uint8Array &&
"undefined" != typeof Uint32Array &&
(a.littleEndian =
((t = new ArrayBuffer(4)), (e = new Uint8Array(t)), (i = new Uint32Array(t)), (e[0] = 161), (e[1] = 178), (e[2] = 195), (e[3] = 212), 3569595041 === i[0] || (2712847316 !== i[0] && null))),
(a.support32bit = "undefined" != typeof ArrayBuffer && "undefined" != typeof Uint8ClampedArray && "undefined" != typeof Int32Array && null !== a.littleEndian && s),
a
);
})();
},
function (t, e) {
var i = "";
function n(t) {
for (var e = ["i", "webkitI", "msI", "mozI", "oI"], i = 0; i < e.length; i++) {
var n = e[i] + "mageSmoothingEnabled";
if (n in t) return n;
}
return null;
}
t.exports = {
disable: function (t) {
return "" === i && (i = n(t)), i && (t[i] = !1), t;
},
enable: function (t) {
return "" === i && (i = n(t)), i && (t[i] = !0), t;
},
getPrefix: n,
isEnabled: function (t) {
return null !== i ? t[i] : null;
},
};
},
function (t, e, i) {
var n = i(14),
s = i(17)(
!1,
(s = {
Angle: i(812),
Distance: i(821),
Easing: i(826),
Fuzzy: i(827),
Interpolation: i(830),
Pow2: i(835),
Snap: i(837),
RandomDataGenerator: i(839),
Average: i(840),
Bernstein: i(356),
Between: i(195),
CatmullRom: i(194),
CeilTo: i(841),
Clamp: i(18),
DegToRad: i(36),
Difference: i(842),
Euler: i(843),
Factorial: i(357),
FloatBetween: i(137),
FloorTo: i(844),
FromPercent: i(98),
GetSpeed: i(845),
IsEven: i(846),
IsEvenStrict: i(847),
Linear: i(135),
MaxAdd: i(848),
Median: i(849),
MinSub: i(850),
Percent: i(851),
RadToDeg: i(196),
RandomXY: i(852),
RandomXYZ: i(853),
RandomXYZW: i(854),
Rotate: i(362),
RotateAround: i(308),
RotateAroundDistance: i(182),
RotateTo: i(855),
RoundAwayFromZero: i(363),
RoundTo: i(856),
SinCosTableGenerator: i(857),
SmootherStep: i(183),
SmoothStep: i(184),
ToXY: i(858),
TransformXY: i(177),
Within: i(859),
Wrap: i(68),
Vector2: i(3),
Vector3: i(39),
Vector4: i(140),
Matrix3: i(364),
Matrix4: i(69),
Quaternion: i(365),
RotateVec3: i(860),
}),
n
);
t.exports = s;
},
function (t, e) {
t.exports = function (t, e, i, n, s) {
var r = 0.5 * (n - e),
o = 0.5 * (s - i),
a = t * t;
return (2 * i - 2 * n + r + o) * (t * a) + (-3 * i + 3 * n - 2 * r - o) * a + r * t + i;
};
},
function (t, e) {
t.exports = function (t, e) {
return Math.floor(Math.random() * (e - t + 1) + t);
};
},
function (t, e, i) {
var n = i(14);
t.exports = function (t) {
return t * n.RAD_TO_DEG;
};
},
function (t, e, i) {
t.exports = {
Global: ["game", "anims", "cache", "plugins", "registry", "scale", "sound", "textures", "renderer"],
CoreScene: ["EventEmitter", "CameraManager", "GameObjectCreator", "GameObjectFactory", "ScenePlugin", "DisplayList", "UpdateList"],
DefaultScene: ["Clock", "DataManagerPlugin", "InputPlugin", "Loader", "TweenManager", "LightsPlugin"],
};
},
function (t, e, i) {
var n = new (i(0))({
initialize: function () {
(this._matrix = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]), (this.alpha = 1), (this._dirty = !0), this._data;
},
set: function (t) {
return (this._matrix = t), (this._dirty = !0), this;
},
reset: function () {
var t = this._matrix;
return (
(t[0] = 1),
(t[1] = 0),
(t[2] = 0),
(t[3] = 0),
(t[4] = 0),
(t[5] = 0),
(t[6] = 1),
(t[7] = 0),
(t[8] = 0),
(t[9] = 0),
(t[10] = 0),
(t[11] = 0),
(t[12] = 1),
(t[13] = 0),
(t[14] = 0),
(t[15] = 0),
(t[16] = 0),
(t[17] = 0),
(t[18] = 1),
(t[19] = 0),
(this._dirty = !0),
this
);
},
getData: function () {
var t;
return this._dirty && (((t = new Float32Array(this._matrix))[4] /= 255), (t[9] /= 255), (t[14] /= 255), (t[19] /= 255), (this._data = t), (this._dirty = !1)), this._data;
},
brightness: function (t, e) {
return void 0 === t && (t = 0), void 0 === e && (e = !1), this.multiply([t, 0, 0, 0, 0, 0, t, 0, 0, 0, 0, 0, t, 0, 0, 0, 0, 0, 1, 0], e);
},
saturate: function (t, e) {
void 0 === t && (t = 0), void 0 === e && (e = !1);
var i = (2 * t) / 3 + 1,
n = -0.5 * (i - 1);
return this.multiply([i, n, n, 0, 0, n, i, n, 0, 0, n, n, i, 0, 0, 0, 0, 0, 1, 0], e);
},
desaturate: function (t) {
return void 0 === t && (t = !1), this.saturate(-1, t);
},
hue: function (t, e) {
void 0 === t && (t = 0), void 0 === e && (e = !1), (t = (t / 180) * Math.PI);
var i = Math.cos(t),
n = Math.sin(t);
return this.multiply(
[
0.213 + 0.787 * i + -0.213 * n,
0.715 + -0.715 * i + -0.715 * n,
0.072 + -0.072 * i + 0.928 * n,
0,
0,
0.213 + -0.213 * i + 0.143 * n,
0.715 + i * (1 - 0.715) + 0.14 * n,
0.072 + -0.072 * i + -0.283 * n,
0,
0,
0.213 + -0.213 * i + -0.787 * n,
0.715 + -0.715 * i + 0.715 * n,
0.072 + 0.928 * i + 0.072 * n,
0,
0,
0,
0,
0,
1,
0,
],
e
);
},
grayscale: function (t, e) {
return void 0 === t && (t = 1), void 0 === e && (e = !1), this.saturate(-t, e);
},
blackWhite: function (t) {
return void 0 === t && (t = !1), this.multiply([0.3, 0.6, 0.1, 0, 0, 0.3, 0.6, 0.1, 0, 0, 0.3, 0.6, 0.1, 0, 0, 0, 0, 0, 1, 0], t);
},
contrast: function (t, e) {
void 0 === t && (t = 0), void 0 === e && (e = !1);
var i = t + 1,
n = -0.5 * (i - 1);
return this.multiply([i, 0, 0, 0, n, 0, i, 0, 0, n, 0, 0, i, 0, n, 0, 0, 0, 1, 0], e);
},
negative: function (t) {
return void 0 === t && (t = !1), this.multiply([-1, 0, 0, 1, 0, 0, -1, 0, 1, 0, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0], t);
},
desaturateLuminance: function (t) {
return void 0 === t && (t = !1), this.multiply([0.2764723, 0.929708, 0.0938197, 0, -37.1, 0.2764723, 0.929708, 0.0938197, 0, -37.1, 0.2764723, 0.929708, 0.0938197, 0, -37.1, 0, 0, 0, 1, 0], t);
},
sepia: function (t) {
return void 0 === t && (t = !1), this.multiply([0.393, 0.7689999, 0.18899999, 0, 0, 0.349, 0.6859999, 0.16799999, 0, 0, 0.272, 0.5339999, 0.13099999, 0, 0, 0, 0, 0, 1, 0], t);
},
night: function (t, e) {
return void 0 === t && (t = 0.1), void 0 === e && (e = !1), this.multiply([-2 * t, -t, 0, 0, 0, -t, 0, t, 0, 0, 0, t, 2 * t, 0, 0, 0, 0, 0, 1, 0], e);
},
lsd: function (t) {
return void 0 === t && (t = !1), this.multiply([2, -0.4, 0.5, 0, 0, -0.5, 2, -0.4, 0, 0, -0.4, -0.5, 3, 0, 0, 0, 0, 0, 1, 0], t);
},
brown: function (t) {
return (
void 0 === t && (t = !1),
this.multiply(
[
0.5997023498159715,
0.34553243048391263,
-0.2708298674538042,
0,
47.43192855600873,
-0.037703249837783157,
0.8609577587992641,
0.15059552388459913,
0,
-36.96841498319127,
0.24113635128153335,
-0.07441037908422492,
0.44972182064877153,
0,
-7.562075277591283,
0,
0,
0,
1,
0,
],
t
)
);
},
vintagePinhole: function (t) {
return (
void 0 === t && (t = !1),
this.multiply(
[
0.6279345635605994,
0.3202183420819367,
-0.03965408211312453,
0,
9.651285835294123,
0.02578397704808868,
0.6441188644374771,
0.03259127616149294,
0,
7.462829176470591,
0.0466055556782719,
-0.0851232987247891,
0.5241648018700465,
0,
5.159190588235296,
0,
0,
0,
1,
0,
],
t
)
);
},
kodachrome: function (t) {
return (
void 0 === t && (t = !1),
this.multiply(
[
1.1285582396593525,
-0.3967382283601348,
-0.03992559172921793,
0,
63.72958762196502,
-0.16404339962244616,
1.0835251566291304,
-0.05498805115633132,
0,
24.732407896706203,
-0.16786010706155763,
-0.5603416277695248,
1.6014850761964943,
0,
35.62982807460946,
0,
0,
0,
1,
0,
],
t
)
);
},
technicolor: function (t) {
return (
void 0 === t && (t = !1),
this.multiply(
[
1.9125277891456083,
-0.8545344976951645,
-0.09155508482755585,
0,
11.793603434377337,
-0.3087833385928097,
1.7658908555458428,
-0.10601743074722245,
0,
-70.35205161461398,
-0.231103377548616,
-0.7501899197440212,
1.847597816108189,
0,
30.950940869491138,
0,
0,
0,
1,
0,
],
t
)
);
},
polaroid: function (t) {
return void 0 === t && (t = !1), this.multiply([1.438, -0.062, -0.062, 0, 0, -0.122, 1.378, -0.122, 0, 0, -0.016, -0.016, 1.483, 0, 0, 0, 0, 0, 1, 0], t);
},
shiftToBGR: function (t) {
return void 0 === t && (t = !1), this.multiply([0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0], t);
},
multiply: function (t, e) {
e || this.reset();
for (var i = this._matrix, n = [], s = 0; s < 20; s++) n[s] = i[s];
return (
(i[0] = n[0] * t[0] + n[1] * t[5] + n[2] * t[10] + n[3] * t[15]),
(i[1] = n[0] * t[1] + n[1] * t[6] + n[2] * t[11] + n[3] * t[16]),
(i[2] = n[0] * t[2] + n[1] * t[7] + n[2] * t[12] + n[3] * t[17]),
(i[3] = n[0] * t[3] + n[1] * t[8] + n[2] * t[13] + n[3] * t[18]),
(i[4] = n[0] * t[4] + n[1] * t[9] + n[2] * t[14] + n[3] * t[19] + n[4]),
(i[5] = n[5] * t[0] + n[6] * t[5] + n[7] * t[10] + n[8] * t[15]),
(i[6] = n[5] * t[1] + n[6] * t[6] + n[7] * t[11] + n[8] * t[16]),
(i[7] = n[5] * t[2] + n[6] * t[7] + n[7] * t[12] + n[8] * t[17]),
(i[8] = n[5] * t[3] + n[6] * t[8] + n[7] * t[13] + n[8] * t[18]),
(i[9] = n[5] * t[4] + n[6] * t[9] + n[7] * t[14] + n[8] * t[19] + n[9]),
(i[10] = n[10] * t[0] + n[11] * t[5] + n[12] * t[10] + n[13] * t[15]),
(i[11] = n[10] * t[1] + n[11] * t[6] + n[12] * t[11] + n[13] * t[16]),
(i[12] = n[10] * t[2] + n[11] * t[7] + n[12] * t[12] + n[13] * t[17]),
(i[13] = n[10] * t[3] + n[11] * t[8] + n[12] * t[13] + n[13] * t[18]),
(i[14] = n[10] * t[4] + n[11] * t[9] + n[12] * t[14] + n[13] * t[19] + n[14]),
(i[15] = n[15] * t[0] + n[16] * t[5] + n[17] * t[10] + n[18] * t[15]),
(i[16] = n[15] * t[1] + n[16] * t[6] + n[17] * t[11] + n[18] * t[16]),
(i[17] = n[15] * t[2] + n[16] * t[7] + n[17] * t[12] + n[18] * t[17]),
(i[18] = n[15] * t[3] + n[16] * t[8] + n[17] * t[13] + n[18] * t[18]),
(i[19] = n[15] * t[4] + n[16] * t[9] + n[17] * t[14] + n[18] * t[19] + n[19]),
(this._dirty = !0),
this
);
},
});
t.exports = n;
},
function (t, e, i) {
var u = i(10),
c = i(14);
t.exports = function (t, e) {
if ((void 0 === e && (e = new u()), 0 === t.length)) return e;
for (var i, n, s, r = Number.MAX_VALUE, o = Number.MAX_VALUE, a = c.MIN_SAFE_INTEGER, h = c.MIN_SAFE_INTEGER, l = 0; l < t.length; l++)
(i = t[l]), (s = Array.isArray(i) ? ((n = i[0]), i[1]) : ((n = i.x), i.y)), (r = Math.min(r, n)), (o = Math.min(o, s)), (a = Math.max(a, n)), (h = Math.max(h, s));
return (e.x = r), (e.y = o), (e.width = a - r), (e.height = h - o), e;
};
},
function (t, e, i) {
var n = i(0),
s = i(1),
r = new n({
initialize: function (t, e, i) {
(this._rgb = [0, 0, 0]), (this.onChangeCallback = s), (this.dirty = !1), this.set(t, e, i);
},
set: function (t, e, i) {
return void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 0), (this._rgb = [t, e, i]), this.onChange(), this;
},
equals: function (t, e, i) {
var n = this._rgb;
return n.r === t && n.g === e && n.b === i;
},
onChange: function () {
this.dirty = !0;
var t = this._rgb;
this.onChangeCallback.call(this, t[0], t[1], t[2]);
},
r: {
get: function () {
return this._rgb[0];
},
set: function (t) {
(this._rgb[0] = t), this.onChange();
},
},
g: {
get: function () {
return this._rgb[1];
},
set: function (t) {
(this._rgb[1] = t), this.onChange();
},
},
b: {
get: function () {
return this._rgb[2];
},
set: function (t) {
(this._rgb[2] = t), this.onChange();
},
},
destroy: function () {
this.onChangeCallback = null;
},
});
t.exports = r;
},
function (t, e, i) {
var n = { CENTER: i(403), ORIENTATION: i(404), SCALE_MODE: i(405), ZOOM: i(406) };
t.exports = n;
},
function (t, e) {
t.exports = function (t) {
t.parentNode && t.parentNode.removeChild(t);
};
},
function (t, e) {
t.exports = { MOUSE_DOWN: 0, MOUSE_MOVE: 1, MOUSE_UP: 2, TOUCH_START: 3, TOUCH_MOVE: 4, TOUCH_END: 5, POINTER_LOCK_CHANGE: 6, TOUCH_CANCEL: 7, MOUSE_WHEEL: 8 };
},
function (t, e, i) {
var n = i(0),
s = i(144),
r = i(197),
o = i(20),
a = i(419),
h = i(420),
l = i(33),
u = i(1),
c = i(421),
d = new n({
initialize: function (t, e) {
(this.scene = t),
this.game,
this.renderer,
(this.config = e),
(this.settings = c.create(e)),
this.canvas,
this.context,
this.anims,
this.cache,
this.plugins,
this.registry,
this.scale,
this.sound,
this.textures,
this.add,
this.cameras,
this.displayList,
this.events,
this.make,
this.scenePlugin,
this.updateList,
(this.sceneUpdate = u);
},
init: function (t) {
(this.settings.status = s.INIT), (this.sceneUpdate = u), (this.game = t), (this.renderer = t.renderer), (this.canvas = t.canvas), (this.context = t.context);
var e = t.plugins;
(this.plugins = e).addToScene(this, r.Global, [r.CoreScene, h(this), a(this)]), this.events.emit(o.BOOT, this), (this.settings.isBooted = !0);
},
step: function (t, e) {
var i = this.events;
i.emit(o.PRE_UPDATE, t, e), i.emit(o.UPDATE, t, e), this.sceneUpdate.call(this.scene, t, e), i.emit(o.POST_UPDATE, t, e);
},
render: function (t) {
var e = this.displayList;
e.depthSort(), this.events.emit(o.PRE_RENDER, t), this.cameras.render(t, e), this.events.emit(o.RENDER, t);
},
queueDepthSort: function () {
this.displayList.queueDepthSort();
},
depthSort: function () {
this.displayList.depthSort();
},
pause: function (t) {
var e = this.events,
i = this.settings;
return this.settings.active && ((i.status = s.PAUSED), (i.active = !1), e.emit(o.PAUSE, this, t)), this;
},
resume: function (t) {
var e = this.events,
i = this.settings;
return this.settings.active || ((i.status = s.RUNNING), (i.active = !0), e.emit(o.RESUME, this, t)), this;
},
sleep: function (t) {
var e = this.events,
i = this.settings;
return (i.status = s.SLEEPING), (i.active = !1), (i.visible = !1), e.emit(o.SLEEP, this, t), this;
},
wake: function (t) {
var e = this.events,
i = this.settings;
return (i.status = s.RUNNING), (i.active = !0), (i.visible = !0), e.emit(o.WAKE, this, t), i.isTransition && e.emit(o.TRANSITION_WAKE, i.transitionFrom, i.transitionDuration), this;
},
getData: function () {
return this.settings.data;
},
isSleeping: function () {
return this.settings.status === s.SLEEPING;
},
isActive: function () {
return this.settings.status === s.RUNNING;
},
isPaused: function () {
return this.settings.status === s.PAUSED;
},
isTransitioning: function () {
return this.settings.isTransition || null !== this.scenePlugin._target;
},
isTransitionOut: function () {
return null !== this.scenePlugin._target && 0 < this.scenePlugin._duration;
},
isTransitionIn: function () {
return this.settings.isTransition;
},
isVisible: function () {
return this.settings.visible;
},
setVisible: function (t) {
return (this.settings.visible = t), this;
},
setActive: function (t, e) {
return t ? this.resume(e) : this.pause(e);
},
start: function (t) {
var e = this.events,
i = this.settings;
t && (i.data = t), (i.status = s.START), (i.active = !0), (i.visible = !0), e.emit(o.START, this), e.emit(o.READY, this, t);
},
shutdown: function (t) {
var e = this.events,
i = this.settings;
e.off(o.TRANSITION_INIT),
e.off(o.TRANSITION_START),
e.off(o.TRANSITION_COMPLETE),
e.off(o.TRANSITION_OUT),
(i.status = s.SHUTDOWN),
(i.active = !1),
(i.visible = !1),
this.renderer === l.WEBGL && this.renderer.resetTextures(!0),
e.emit(o.SHUTDOWN, this, t);
},
destroy: function () {
var t = this.events,
e = this.settings;
(e.status = s.DESTROYED), (e.active = !1), (e.visible = !1), t.emit(o.DESTROY, this), t.removeAllListeners();
for (var i = ["scene", "game", "anims", "cache", "plugins", "registry", "sound", "textures", "add", "camera", "displayList", "events", "make", "scenePlugin", "updateList"], n = 0; n < i.length; n++)
this[i[n]] = null;
},
});
t.exports = d;
},
function (t, e) {
t.exports = function (t) {
return t && t[0].toUpperCase() + t.slice(1);
};
},
function (t, e, i) {
var n = i(33),
s = i(0),
a = i(109),
o = i(424),
r = new s({
initialize: function (t, e, i, n, s) {
Array.isArray(i) || (i = [i]), (this.manager = t), (this.key = e), (this.source = []), (this.dataSource = []), (this.frames = {}), (this.customData = {}), (this.firstFrame = "__BASE");
for (var r = (this.frameTotal = 0); r < i.length; r++) this.source.push(new o(this, i[r], n, s));
},
add: function (t, e, i, n, s, r) {
if (this.has(t)) return null;
var o = new a(this, t, e, i, n, s, r);
return (this.frames[t] = o), "__BASE" === this.firstFrame && (this.firstFrame = t), this.frameTotal++, o;
},
remove: function (t) {
return !!this.has(t) && (this.get(t).destroy(), delete this.frames[t], !0);
},
has: function (t) {
return this.frames[t];
},
get: function (t) {
t = t || this.firstFrame;
var e = this.frames[t];
return e || (e = this.frames[this.firstFrame]), e;
},
getTextureSourceIndex: function (t) {
for (var e = 0; e < this.source.length; e++) if (this.source[e] === t) return e;
return -1;
},
getFramesFromTextureSource: function (t, e) {
void 0 === e && (e = !1);
var i,
n = [];
for (var s in this.frames) ("__BASE" === s && !e) || ((i = this.frames[s]).sourceIndex === t && n.push(i));
return n;
},
getFrameNames: function (t) {
void 0 === t && (t = !1);
var e,
i = Object.keys(this.frames);
return t || (-1 !== (e = i.indexOf("__BASE")) && i.splice(e, 1)), i;
},
getSourceImage: function (t) {
(null != t && 1 !== this.frameTotal) || (t = "__BASE");
var e = this.frames[t];
return e ? e.source.image : this.frames.__BASE.source.image;
},
getDataSourceImage: function (t) {
(null != t && 1 !== this.frameTotal) || (t = "__BASE");
var e = this.frames[t],
i = e ? e.sourceIndex : this.frames.__BASE.sourceIndex;
return this.dataSource[i].image;
},
setDataSource: function (t) {
Array.isArray(t) || (t = [t]);
for (var e = 0; e < t.length; e++) {
var i = this.source[e];
this.dataSource.push(new o(this, t[e], i.width, i.height));
}
},
setFilter: function (t) {
for (var e = 0; e < this.source.length; e++) this.source[e].setFilter(t);
for (e = 0; e < this.dataSource.length; e++) this.dataSource[e].setFilter(t);
},
destroy: function () {
for (var t = 0; t < this.source.length; t++) this.source[t].destroy();
for (t = 0; t < this.dataSource.length; t++) this.dataSource[t].destroy();
for (var e in this.frames) this.frames[e].destroy();
(this.source = []), (this.dataSource = []), (this.frames = {}), this.manager.removeKey(this.key);
var i = this.manager.game.renderer;
i && i.type === n.WEBGL && i.resetTextures(!0), (this.manager = null);
},
});
t.exports = r;
},
function (t, e, i) {
var h = i(78);
t.exports = function (t, e, i, n, s) {
void 0 === n && (n = 0), void 0 === s && (s = t.length);
var r = [];
if (h(t, n, s))
for (var o = n; o < s; o++) {
var a = t[o];
(!e || (e && void 0 === i && a.hasOwnProperty(e)) || (e && void 0 !== i && a[e] === i)) && r.push(a);
}
return r;
};
},
function (t, e, i) {
t.exports = {
Matrix: i(1013),
Add: i(1021),
AddAt: i(1022),
BringToTop: i(1023),
CountAllMatching: i(1024),
Each: i(1025),
EachInRange: i(1026),
FindClosestInSorted: i(318),
GetAll: i(207),
GetFirst: i(428),
GetRandom: i(210),
MoveDown: i(1027),
MoveTo: i(1028),
MoveUp: i(1029),
MoveAbove: i(1030),
MoveBelow: i(1031),
NumberArray: i(322),
NumberArrayStep: i(1032),
QuickSelect: i(436),
Range: i(437),
Remove: i(93),
RemoveAt: i(1033),
RemoveBetween: i(1034),
RemoveRandomElement: i(1035),
Replace: i(1036),
RotateLeft: i(178),
RotateRight: i(179),
SafeRange: i(78),
SendToBack: i(1037),
SetAll: i(1038),
Shuffle: i(131),
SortByDigits: i(320),
SpliceOne: i(74),
StableSort: i(79),
Swap: i(1039),
};
},
function (t, e) {
t.exports = function (t) {
if (!Array.isArray(t) || t.length < 2 || !Array.isArray(t[0])) return !1;
for (var e = t[0].length, i = 1; i < t.length; i++) if (t[i].length !== e) return !1;
return !0;
};
},
function (t, e) {
t.exports = function (t, e, i) {
void 0 === e && (e = 0), void 0 === i && (i = t.length);
var n = e + Math.floor(Math.random() * i);
return void 0 === t[n] ? null : t[n];
};
},
function (t, e, i) {
var n = i(0),
s = i(9),
r = i(438),
o = new n({
Extends: s,
initialize: function () {
s.call(this), (this._pending = []), (this._active = []), (this._destroy = []), (this._toProcess = 0), (this.checkQueue = !1);
},
add: function (t) {
return this._pending.push(t), this._toProcess++, t;
},
remove: function (t) {
return this._destroy.push(t), this._toProcess++, t;
},
removeAll: function () {
for (var t = this._active, e = this._destroy, i = t.length; i--; ) e.push(t[i]), this._toProcess++;
return this;
},
update: function () {
if (0 === this._toProcess) return this._active;
for (var t, e = this._destroy, i = this._active, n = 0; n < e.length; n++) {
t = e[n];
var s = i.indexOf(t);
-1 !== s && (i.splice(s, 1), this.emit(r.PROCESS_QUEUE_REMOVE, t));
}
for (e.length = 0, e = this._pending, n = 0; n < e.length; n++) (t = e[n]), (!this.checkQueue || (this.checkQueue && -1 === i.indexOf(t))) && (i.push(t), this.emit(r.PROCESS_QUEUE_ADD, t));
return (e.length = 0), (this._toProcess = 0), i;
},
getActive: function () {
return this._active;
},
length: {
get: function () {
return this._active.length;
},
},
destroy: function () {
(this._toProcess = 0), (this._pending = []), (this._active = []), (this._destroy = []);
},
});
t.exports = o;
},
function (t, e) {
function D(t, e) {
return parseInt(t.getAttribute(e), 10);
}
t.exports = function (t, e, i, n, s) {
void 0 === i && (i = 0), void 0 === n && (n = 0);
var r = e.cutX,
o = e.cutY,
a = e.source.width,
h = e.source.height,
l = e.sourceIndex,
u = {},
c = t.getElementsByTagName("info")[0],
d = t.getElementsByTagName("common")[0];
(u.font = c.getAttribute("face")), (u.size = D(c, "size")), (u.lineHeight = D(d, "lineHeight") + n), (u.chars = {});
var f,
p,
g = t.getElementsByTagName("char"),
v = void 0 !== e && e.trimmed;
v && ((f = e.height), (p = e.width));
for (var y = 0; y < g.length; y++) {
var m = g[y],
x = D(m, "id"),
b = String.fromCharCode(x),
w = D(m, "x"),
T = D(m, "y"),
S = D(m, "width"),
_ = D(m, "height");
v && (w < p && (p = w), T < f && (f = T)), v && 0 !== f && 0 !== p && ((w -= e.x), (T -= e.y));
var E,
P = (r + w) / a,
A = (o + T) / h,
M = (r + w + S) / a,
C = (o + T + _) / h;
(u.chars[x] = {
x: w,
y: T,
width: S,
height: _,
centerX: Math.floor(S / 2),
centerY: Math.floor(_ / 2),
xOffset: D(m, "xoffset"),
yOffset: D(m, "yoffset"),
xAdvance: D(m, "xadvance") + i,
data: {},
kerning: {},
u0: P,
v0: A,
u1: M,
v1: C,
}),
!s || 0 === S || 0 === _ || ((E = s.add(b, l, w, T, S, _)) && E.setUVs(S, _, P, A, M, C));
}
var O = t.getElementsByTagName("kerning");
for (y = 0; y < O.length; y++) {
var k = O[y],
R = D(k, "first"),
L = D(k, "second"),
I = D(k, "amount");
u.chars[L].kerning[R] = I;
}
return u;
};
},
function (t, e, i) {
var n = i(1049),
o = i(440),
s = i(0),
r = i(11),
a = i(109),
h = i(15),
l = i(110),
u = new s({
Extends: h,
Mixins: [r.Alpha, r.BlendMode, r.Depth, r.Mask, r.Pipeline, r.ScrollFactor, r.Size, r.Texture, r.Transform, r.Visible, n],
initialize: function (t, e, i, n, s) {
h.call(this, t, "Blitter"), this.setTexture(n, s), this.setPosition(e, i), this.initPipeline(), (this.children = new l()), (this.renderList = []), (this.dirty = !1);
},
create: function (t, e, i, n, s) {
void 0 === n && (n = !0), void 0 === s && (s = this.children.length), void 0 === i ? (i = this.frame) : i instanceof a || (i = this.texture.get(i));
var r = new o(this, t, e, i, n);
return this.children.addAt(r, s, !1), (this.dirty = !0), r;
},
createFromCallback: function (t, e, i, n) {
for (var s = this.createMultiple(e, i, n), r = 0; r < s.length; r++) {
var o = s[r];
t.call(this, o, r);
}
return s;
},
createMultiple: function (i, t, n) {
void 0 === t && (t = this.frame.name), void 0 === n && (n = !0), Array.isArray(t) || (t = [t]);
var s = [],
r = this;
return (
t.forEach(function (t) {
for (var e = 0; e < i; e++) s.push(r.create(0, 0, t, n));
}),
s
);
},
childCanRender: function (t) {
return t.visible && 0 < t.alpha;
},
getRenderList: function () {
return this.dirty && ((this.renderList = this.children.list.filter(this.childCanRender, this)), (this.dirty = !1)), this.renderList;
},
clear: function () {
this.children.removeAll(), (this.dirty = !0);
},
preDestroy: function () {
this.children.destroy(), (this.renderList = []);
},
});
t.exports = u;
},
function (t, e, i) {
var r = i(208),
s = i(35),
n = i(0),
o = i(11),
a = i(75),
h = i(15),
l = i(10),
u = i(1052),
c = i(441),
d = i(3),
f = new n({
Extends: h,
Mixins: [o.AlphaSingle, o.BlendMode, o.ComputedSize, o.Depth, o.Mask, o.Pipeline, o.Transform, o.Visible, u],
initialize: function (t, e, i, n) {
h.call(this, t, "Container"),
(this.list = []),
(this.exclusive = !0),
(this.maxSize = -1),
(this.position = 0),
(this.localTransform = new o.TransformMatrix()),
(this.tempTransformMatrix = new o.TransformMatrix()),
(this._sortKey = ""),
(this._sysEvents = t.sys.events),
(this.scrollFactorX = 1),
(this.scrollFactorY = 1),
this.initPipeline(),
this.setPosition(e, i),
this.clearAlpha(),
this.setBlendMode(s.SKIP_CHECK),
n && this.add(n);
},
originX: {
get: function () {
return 0.5;
},
},
originY: {
get: function () {
return 0.5;
},
},
displayOriginX: {
get: function () {
return 0.5 * this.width;
},
},
displayOriginY: {
get: function () {
return 0.5 * this.height;
},
},
setExclusive: function (t) {
return void 0 === t && (t = !0), (this.exclusive = t), this;
},
getBounds: function (t) {
var e;
if (
(void 0 === t && (t = new l()),
t.setTo(this.x, this.y, 0, 0),
this.parentContainer && ((e = this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x, this.y)), t.setTo(e.x, e.y, 0, 0)),
0 < this.list.length)
) {
var i = this.list,
n = new l(),
s = !1;
t.setEmpty();
for (var r = 0; r < i.length; r++) {
var o = i[r];
o.getBounds && (o.getBounds(n), s ? c(n, t, t) : (t.setTo(n.x, n.y, n.width, n.height), (s = !0)));
}
}
return t;
},
addHandler: function (t) {
t.once(a.DESTROY, this.remove, this), this.exclusive && (t.parentContainer && t.parentContainer.remove(t), t.removeFromDisplayList(), (t.parentContainer = this));
},
removeHandler: function (t) {
t.off(a.DESTROY, this.remove), this.exclusive && ((t.parentContainer = null), t.addToDisplayList());
},
pointToContainer: function (t, e) {
void 0 === e && (e = new d()), this.parentContainer ? this.parentContainer.pointToContainer(t, e) : (e = new d(t.x, t.y));
var i = this.tempTransformMatrix;
return i.applyITRS(this.x, this.y, this.rotation, this.scaleX, this.scaleY), i.invert(), i.transformPoint(t.x, t.y, e), e;
},
getBoundsTransformMatrix: function () {
return this.getWorldTransformMatrix(this.tempTransformMatrix, this.localTransform);
},
add: function (t) {
return r.Add(this.list, t, this.maxSize, this.addHandler, this), this;
},
addAt: function (t, e) {
return r.AddAt(this.list, t, e, this.maxSize, this.addHandler, this), this;
},
getAt: function (t) {
return this.list[t];
},
getIndex: function (t) {
return this.list.indexOf(t);
},
sort: function (i, t) {
return (
i &&
(void 0 === t &&
(t = function (t, e) {
return t[i] - e[i];
}),
r.StableSort(this.list, t)),
this
);
},
getByName: function (t) {
return r.GetFirst(this.list, "name", t);
},
getRandom: function (t, e) {
return r.GetRandom(this.list, t, e);
},
getFirst: function (t, e, i, n) {
return r.GetFirst(this.list, t, e, i, n);
},
getAll: function (t, e, i, n) {
return r.GetAll(this.list, t, e, i, n);
},
count: function (t, e, i, n) {
return r.CountAllMatching(this.list, t, e, i, n);
},
swap: function (t, e) {
return r.Swap(this.list, t, e), this;
},
moveTo: function (t, e) {
return r.MoveTo(this.list, t, e), this;
},
moveAbove: function (t, e) {
return r.MoveAbove(this.list, t, e), this;
},
moveBelow: function (t, e) {
return r.MoveBelow(this.list, t, e), this;
},
remove: function (t, e) {
var i = r.Remove(this.list, t, this.removeHandler, this);
if (e && i) {
Array.isArray(i) || (i = [i]);
for (var n = 0; n < i.length; n++) i[n].destroy();
}
return this;
},
removeAt: function (t, e) {
var i = r.RemoveAt(this.list, t, this.removeHandler, this);
return e && i && i.destroy(), this;
},
removeBetween: function (t, e, i) {
var n = r.RemoveBetween(this.list, t, e, this.removeHandler, this);
if (i) for (var s = 0; s < n.length; s++) n[s].destroy();
return this;
},
removeAll: function (t) {
var e = r.RemoveBetween(this.list, 0, this.list.length, this.removeHandler, this);
if (t) for (var i = 0; i < e.length; i++) e[i].destroy();
return this;
},
bringToTop: function (t) {
return r.BringToTop(this.list, t), this;
},
sendToBack: function (t) {
return r.SendToBack(this.list, t), this;
},
moveUp: function (t) {
return r.MoveUp(this.list, t), this;
},
moveDown: function (t) {
return r.MoveDown(this.list, t), this;
},
reverse: function () {
return this.list.reverse(), this;
},
shuffle: function () {
return r.Shuffle(this.list), this;
},
replace: function (t, e, i) {
return r.Replace(this.list, t, e) && (this.addHandler(e), this.removeHandler(t), i && t.destroy()), this;
},
exists: function (t) {
return -1 < this.list.indexOf(t);
},
setAll: function (t, e, i, n) {
return r.SetAll(this.list, t, e, i, n), this;
},
each: function (t, e) {
for (var i = [null], n = this.list.slice(), s = n.length, r = 2; r < arguments.length; r++) i.push(arguments[r]);
for (r = 0; r < s; r++) (i[0] = n[r]), t.apply(e, i);
return this;
},
iterate: function (t, e) {
for (var i = [null], n = 2; n < arguments.length; n++) i.push(arguments[n]);
for (n = 0; n < this.list.length; n++) (i[0] = this.list[n]), t.apply(e, i);
return this;
},
setScrollFactor: function (t, e, i) {
return (
void 0 === e && (e = t), void 0 === i && (i = !1), (this.scrollFactorX = t), (this.scrollFactorY = e), i && (r.SetAll(this.list, "scrollFactorX", t), r.SetAll(this.list, "scrollFactorY", e)), this
);
},
length: {
get: function () {
return this.list.length;
},
},
first: {
get: function () {
return (this.position = 0) < this.list.length ? this.list[0] : null;
},
},
last: {
get: function () {
return 0 < this.list.length ? ((this.position = this.list.length - 1), this.list[this.position]) : null;
},
},
next: {
get: function () {
return this.position < this.list.length ? (this.position++, this.list[this.position]) : null;
},
},
previous: {
get: function () {
return 0 < this.position ? (this.position--, this.list[this.position]) : null;
},
},
preDestroy: function () {
this.removeAll(!!this.exclusive), this.localTransform.destroy(), this.tempTransformMatrix.destroy(), (this.list = []);
},
});
t.exports = f;
},
function (t, e, i) {
var a = i(148),
n = i(0),
s = i(1057),
r = new n({
Extends: a,
Mixins: [s],
initialize: function (t, e, i, n, s, r, o) {
a.call(this, t, e, i, n, s, r, o),
(this.type = "DynamicBitmapText"),
(this.scrollX = 0),
(this.scrollY = 0),
(this.cropWidth = 0),
(this.cropHeight = 0),
this.displayCallback,
(this.callbackData = { parent: this, color: 0, tint: { topLeft: 0, topRight: 0, bottomLeft: 0, bottomRight: 0 }, index: 0, charCode: 0, x: 0, y: 0, scale: 0, rotation: 0, data: 0 });
},
setSize: function (t, e) {
return (this.cropWidth = t), (this.cropHeight = e), this;
},
setDisplayCallback: function (t) {
return (this.displayCallback = t), this;
},
setScrollX: function (t) {
return (this.scrollX = t), this;
},
setScrollY: function (t) {
return (this.scrollY = t), this;
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(133),
s = i(0),
h = i(217),
r = i(303),
o = i(304),
a = i(305),
l = i(309),
u = i(167),
c = i(312),
d = i(313),
f = i(314),
p = i(111),
g = i(15),
v = i(2),
y = i(6),
m = i(14),
x = i(1063),
b = new s({
Extends: g,
Mixins: [r, o, a, l, u, d, f, c, x],
initialize: function (t, e) {
var i = y(e, "x", 0),
n = y(e, "y", 0);
g.call(this, t, "Graphics"),
this.setPosition(i, n),
this.initPipeline(),
(this.displayOriginX = 0),
(this.displayOriginY = 0),
(this.commandBuffer = []),
(this.defaultFillColor = -1),
(this.defaultFillAlpha = 1),
(this.defaultStrokeWidth = 1),
(this.defaultStrokeColor = -1),
(this.defaultStrokeAlpha = 1),
(this._lineWidth = 1),
this.setDefaultStyles(e);
},
setDefaultStyles: function (t) {
return (
y(t, "lineStyle", null) &&
((this.defaultStrokeWidth = y(t, "lineStyle.width", 1)),
(this.defaultStrokeColor = y(t, "lineStyle.color", 16777215)),
(this.defaultStrokeAlpha = y(t, "lineStyle.alpha", 1)),
this.lineStyle(this.defaultStrokeWidth, this.defaultStrokeColor, this.defaultStrokeAlpha)),
y(t, "fillStyle", null) &&
((this.defaultFillColor = y(t, "fillStyle.color", 16777215)), (this.defaultFillAlpha = y(t, "fillStyle.alpha", 1)), this.fillStyle(this.defaultFillColor, this.defaultFillAlpha)),
this
);
},
lineStyle: function (t, e, i) {
return void 0 === i && (i = 1), this.commandBuffer.push(h.LINE_STYLE, t, e, i), (this._lineWidth = t), this;
},
fillStyle: function (t, e) {
return void 0 === e && (e = 1), this.commandBuffer.push(h.FILL_STYLE, t, e), this;
},
fillGradientStyle: function (t, e, i, n, s, r, o, a) {
return void 0 === s && (s = 1), void 0 === r && (r = s), void 0 === o && (o = s), void 0 === a && (a = s), this.commandBuffer.push(h.GRADIENT_FILL_STYLE, s, r, o, a, t, e, i, n), this;
},
lineGradientStyle: function (t, e, i, n, s, r) {
return void 0 === r && (r = 1), this.commandBuffer.push(h.GRADIENT_LINE_STYLE, t, r, e, i, n, s), this;
},
beginPath: function () {
return this.commandBuffer.push(h.BEGIN_PATH), this;
},
closePath: function () {
return this.commandBuffer.push(h.CLOSE_PATH), this;
},
fillPath: function () {
return this.commandBuffer.push(h.FILL_PATH), this;
},
fill: function () {
return this.commandBuffer.push(h.FILL_PATH), this;
},
strokePath: function () {
return this.commandBuffer.push(h.STROKE_PATH), this;
},
stroke: function () {
return this.commandBuffer.push(h.STROKE_PATH), this;
},
fillCircleShape: function (t) {
return this.fillCircle(t.x, t.y, t.radius);
},
strokeCircleShape: function (t) {
return this.strokeCircle(t.x, t.y, t.radius);
},
fillCircle: function (t, e, i) {
return this.beginPath(), this.arc(t, e, i, 0, m.PI2), this.fillPath(), this;
},
strokeCircle: function (t, e, i) {
return this.beginPath(), this.arc(t, e, i, 0, m.PI2), this.strokePath(), this;
},
fillRectShape: function (t) {
return this.fillRect(t.x, t.y, t.width, t.height);
},
strokeRectShape: function (t) {
return this.strokeRect(t.x, t.y, t.width, t.height);
},
fillRect: function (t, e, i, n) {
return this.commandBuffer.push(h.FILL_RECT, t, e, i, n), this;
},
strokeRect: function (t, e, i, n) {
var s = this._lineWidth / 2,
r = t - s,
o = t + s;
return (
this.beginPath(),
this.moveTo(t, e),
this.lineTo(t, e + n),
this.strokePath(),
this.beginPath(),
this.moveTo(t + i, e),
this.lineTo(t + i, e + n),
this.strokePath(),
this.beginPath(),
this.moveTo(r, e),
this.lineTo(o + i, e),
this.strokePath(),
this.beginPath(),
this.moveTo(r, e + n),
this.lineTo(o + i, e + n),
this.strokePath(),
this
);
},
fillRoundedRect: function (t, e, i, n, s) {
void 0 === s && (s = 20);
var r = s,
o = s,
a = s,
h = s;
return (
"number" != typeof s && ((r = v(s, "tl", 20)), (o = v(s, "tr", 20)), (a = v(s, "bl", 20)), (h = v(s, "br", 20))),
this.beginPath(),
this.moveTo(t + r, e),
this.lineTo(t + i - o, e),
this.arc(t + i - o, e + o, o, -m.TAU, 0),
this.lineTo(t + i, e + n - h),
this.arc(t + i - h, e + n - h, h, 0, m.TAU),
this.lineTo(t + a, e + n),
this.arc(t + a, e + n - a, a, m.TAU, Math.PI),
this.lineTo(t, e + r),
this.arc(t + r, e + r, r, -Math.PI, -m.TAU),
this.fillPath(),
this
);
},
strokeRoundedRect: function (t, e, i, n, s) {
void 0 === s && (s = 20);
var r = s,
o = s,
a = s,
h = s;
return (
"number" != typeof s && ((r = v(s, "tl", 20)), (o = v(s, "tr", 20)), (a = v(s, "bl", 20)), (h = v(s, "br", 20))),
this.beginPath(),
this.moveTo(t + r, e),
this.lineTo(t + i - o, e),
this.moveTo(t + i - o, e),
this.arc(t + i - o, e + o, o, -m.TAU, 0),
this.lineTo(t + i, e + n - h),
this.moveTo(t + i, e + n - h),
this.arc(t + i - h, e + n - h, h, 0, m.TAU),
this.lineTo(t + a, e + n),
this.moveTo(t + a, e + n),
this.arc(t + a, e + n - a, a, m.TAU, Math.PI),
this.lineTo(t, e + r),
this.moveTo(t, e + r),
this.arc(t + r, e + r, r, -Math.PI, -m.TAU),
this.strokePath(),
this
);
},
fillPointShape: function (t, e) {
return this.fillPoint(t.x, t.y, e);
},
fillPoint: function (t, e, i) {
return !i || i < 1 ? (i = 1) : ((t -= i / 2), (e -= i / 2)), this.commandBuffer.push(h.FILL_RECT, t, e, i, i), this;
},
fillTriangleShape: function (t) {
return this.fillTriangle(t.x1, t.y1, t.x2, t.y2, t.x3, t.y3);
},
strokeTriangleShape: function (t) {
return this.strokeTriangle(t.x1, t.y1, t.x2, t.y2, t.x3, t.y3);
},
fillTriangle: function (t, e, i, n, s, r) {
return this.commandBuffer.push(h.FILL_TRIANGLE, t, e, i, n, s, r), this;
},
strokeTriangle: function (t, e, i, n, s, r) {
return this.commandBuffer.push(h.STROKE_TRIANGLE, t, e, i, n, s, r), this;
},
strokeLineShape: function (t) {
return this.lineBetween(t.x1, t.y1, t.x2, t.y2);
},
lineBetween: function (t, e, i, n) {
return this.beginPath(), this.moveTo(t, e), this.lineTo(i, n), this.strokePath(), this;
},
lineTo: function (t, e) {
return this.commandBuffer.push(h.LINE_TO, t, e), this;
},
moveTo: function (t, e) {
return this.commandBuffer.push(h.MOVE_TO, t, e), this;
},
strokePoints: function (t, e, i, n) {
void 0 === e && (e = !1), void 0 === i && (i = !1), void 0 === n && (n = t.length), this.beginPath(), this.moveTo(t[0].x, t[0].y);
for (var s = 1; s < n; s++) this.lineTo(t[s].x, t[s].y);
return e && this.lineTo(t[0].x, t[0].y), i && this.closePath(), this.strokePath(), this;
},
fillPoints: function (t, e, i, n) {
void 0 === e && (e = !1), void 0 === i && (i = !1), void 0 === n && (n = t.length), this.beginPath(), this.moveTo(t[0].x, t[0].y);
for (var s = 1; s < n; s++) this.lineTo(t[s].x, t[s].y);
return e && this.lineTo(t[0].x, t[0].y), i && this.closePath(), this.fillPath(), this;
},
strokeEllipseShape: function (t, e) {
void 0 === e && (e = 32);
var i = t.getPoints(e);
return this.strokePoints(i, !0);
},
strokeEllipse: function (t, e, i, n, s) {
void 0 === s && (s = 32);
var r = new p(t, e, i, n).getPoints(s);
return this.strokePoints(r, !0);
},
fillEllipseShape: function (t, e) {
void 0 === e && (e = 32);
var i = t.getPoints(e);
return this.fillPoints(i, !0);
},
fillEllipse: function (t, e, i, n, s) {
void 0 === s && (s = 32);
var r = new p(t, e, i, n).getPoints(s);
return this.fillPoints(r, !0);
},
arc: function (t, e, i, n, s, r, o) {
return void 0 === r && (r = !1), void 0 === o && (o = 0), this.commandBuffer.push(h.ARC, t, e, i, n, s, r, o), this;
},
slice: function (t, e, i, n, s, r, o) {
return (
void 0 === r && (r = !1),
void 0 === o && (o = 0),
this.commandBuffer.push(h.BEGIN_PATH),
this.commandBuffer.push(h.MOVE_TO, t, e),
this.commandBuffer.push(h.ARC, t, e, i, n, s, r, o),
this.commandBuffer.push(h.CLOSE_PATH),
this
);
},
save: function () {
return this.commandBuffer.push(h.SAVE), this;
},
restore: function () {
return this.commandBuffer.push(h.RESTORE), this;
},
translateCanvas: function (t, e) {
return this.commandBuffer.push(h.TRANSLATE, t, e), this;
},
scaleCanvas: function (t, e) {
return this.commandBuffer.push(h.SCALE, t, e), this;
},
rotateCanvas: function (t) {
return this.commandBuffer.push(h.ROTATE, t), this;
},
clear: function () {
return (
(this.commandBuffer.length = 0),
-1 < this.defaultFillColor && this.fillStyle(this.defaultFillColor, this.defaultFillAlpha),
-1 < this.defaultStrokeColor && this.lineStyle(this.defaultStrokeWidth, this.defaultStrokeColor, this.defaultStrokeAlpha),
this
);
},
generateTexture: function (t, e, i) {
var n,
s,
r,
o = this.scene.sys,
a = o.game.renderer;
return (
void 0 === e && (e = o.scale.width),
void 0 === i && (i = o.scale.height),
b.TargetCamera.setScene(this.scene),
b.TargetCamera.setViewport(0, 0, e, i),
(b.TargetCamera.scrollX = this.x),
(b.TargetCamera.scrollY = this.y),
"string" == typeof t
? o.textures.exists(t)
? (r = (n = o.textures.get(t)).getSourceImage()) instanceof HTMLCanvasElement && (s = r.getContext("2d"))
: (s = (n = o.textures.createCanvas(t, e, i)).getSourceImage().getContext("2d"))
: t instanceof HTMLCanvasElement && (s = t.getContext("2d")),
s && (this.renderCanvas(a, this, b.TargetCamera, null, s, !1), n && n.refresh()),
this
);
},
preDestroy: function () {
this.commandBuffer = [];
},
});
(b.TargetCamera = new n()), (t.exports = b);
},
function (t, e) {
t.exports = {
ARC: 0,
BEGIN_PATH: 1,
CLOSE_PATH: 2,
FILL_RECT: 3,
LINE_TO: 4,
MOVE_TO: 5,
LINE_STYLE: 6,
FILL_STYLE: 7,
FILL_PATH: 8,
STROKE_PATH: 9,
FILL_TRIANGLE: 10,
STROKE_TRIANGLE: 11,
SAVE: 14,
RESTORE: 15,
TRANSLATE: 16,
SCALE: 17,
ROTATE: 18,
GRADIENT_FILL_STYLE: 21,
GRADIENT_LINE_STYLE: 22,
};
},
function (t, e, i) {
var r = i(4);
t.exports = function (t, e, i) {
void 0 === i && (i = new r());
var n = t.width / 2,
s = t.height / 2;
return (i.x = t.x + n * Math.cos(e)), (i.y = t.y + s * Math.sin(e)), i;
};
},
function (t, e, i) {
var n = i(35),
s = i(0),
r = i(11),
o = i(176),
a = i(101),
h = i(9),
l = i(75),
u = i(110),
c = i(1071),
d = i(20),
f = i(79),
p = new s({
Extends: u,
Mixins: [r.AlphaSingle, r.BlendMode, r.Depth, r.Mask, r.Pipeline, r.Visible, h, c],
initialize: function (t, e) {
u.call(this, t),
h.call(this),
(this.scene = t),
(this.displayList = null),
(this.type = "Layer"),
(this.state = 0),
(this.parentContainer = null),
(this.name = ""),
(this.active = !0),
(this.tabIndex = -1),
(this.data = null),
(this.renderFlags = 15),
(this.cameraFilter = 0),
(this.input = null),
(this.body = null),
(this.ignoreDestroy = !1),
(this.systems = t.sys),
(this.events = t.sys.events),
(this.sortChildrenFlag = !1),
(this.addCallback = this.addChildCallback),
(this.removeCallback = this.removeChildCallback),
this.initPipeline(),
this.clearAlpha(),
this.setBlendMode(n.SKIP_CHECK),
e && this.add(e),
t.sys.queueDepthSort();
},
setActive: function (t) {
return (this.active = t), this;
},
setName: function (t) {
return (this.name = t), this;
},
setState: function (t) {
return (this.state = t), this;
},
setDataEnabled: function () {
return this.data || (this.data = new a(this)), this;
},
setData: function (t, e) {
return this.data || (this.data = new a(this)), this.data.set(t, e), this;
},
incData: function (t, e) {
return this.data || (this.data = new a(this)), this.data.inc(t, e), this;
},
toggleData: function (t) {
return this.data || (this.data = new a(this)), this.data.toggle(t), this;
},
getData: function (t) {
return this.data || (this.data = new a(this)), this.data.get(t);
},
setInteractive: function () {
return this;
},
disableInteractive: function () {
return this;
},
removeInteractive: function () {
return this;
},
addedToScene: function () {},
removedFromScene: function () {},
update: function () {},
toJSON: function () {
return o(this);
},
willRender: function (t) {
return !(15 !== this.renderFlags || 0 === this.list.length || (0 !== this.cameraFilter && this.cameraFilter & t.id));
},
getIndexList: function () {
for (var t = this, e = this.parentContainer, i = []; e && (i.unshift(e.getIndex(t)), (t = e).parentContainer); ) e = e.parentContainer;
return i.unshift(this.displayList.getIndex(t)), i;
},
addChildCallback: function (t) {
t.displayList && t.displayList !== this && t.removeFromDisplayList(),
t.displayList || (this.queueDepthSort(), (t.displayList = this), t.emit(l.ADDED_TO_SCENE, t, this.scene), this.events.emit(d.ADDED_TO_SCENE, t, this.scene));
},
removeChildCallback: function (t) {
this.queueDepthSort(), (t.displayList = null), t.emit(l.REMOVED_FROM_SCENE, t, this.scene), this.events.emit(d.REMOVED_FROM_SCENE, t, this.scene);
},
queueDepthSort: function () {
this.sortChildrenFlag = !0;
},
depthSort: function () {
this.sortChildrenFlag && (f(this.list, this.sortByDepth), (this.sortChildrenFlag = !1));
},
sortByDepth: function (t, e) {
return t._depth - e._depth;
},
getChildren: function () {
return this.list;
},
destroy: function () {
if (this.scene && !this.ignoreDestroy) {
this.emit(l.DESTROY, this);
for (var t = this.list.length; t--; ) this.list[t].destroy();
this.removeAllListeners(),
this.resetPostPipeline(!0),
this.displayList && (this.displayList.remove(this, !0), this.displayList.queueDepthSort()),
this.data && (this.data.destroy(), (this.data = void 0)),
(this.active = !1),
(this.visible = !1),
(this.list = void 0),
(this.scene = void 0),
(this.displayList = void 0),
(this.systems = void 0),
(this.events = void 0);
}
},
});
t.exports = p;
},
function (t, e, i) {
var n = i(0),
s = i(11),
r = i(15),
o = i(450),
a = i(110),
h = i(452),
l = i(1075),
u = new n({
Extends: r,
Mixins: [s.Depth, s.Mask, s.Pipeline, s.Transform, s.Visible, l],
initialize: function (t, e, i, n) {
if (
(r.call(this, t, "ParticleEmitterManager"),
(this.blendMode = -1),
(this.timeScale = 1),
(this.texture = null),
(this.frame = null),
(this.frameNames = []),
null === i || ("object" != typeof i && !Array.isArray(i)) || ((n = i), (i = null)),
this.setTexture(e, i),
this.initPipeline(),
(this.emitters = new a(this)),
(this.wells = new a(this)),
n)
) {
Array.isArray(n) || (n = [n]);
for (var s = 0; s < n.length; s++) this.createEmitter(n[s]);
}
},
addedToScene: function () {
this.scene.sys.updateList.add(this);
},
removedFromScene: function () {
this.scene.sys.updateList.remove(this);
},
setTexture: function (t, e) {
return (this.texture = this.scene.sys.textures.get(t)), this.setFrame(e);
},
setFrame: function (t) {
this.frame = this.texture.get(t);
var e = this.texture.getFramesFromTextureSource(this.frame.sourceIndex),
i = [];
return (
e.forEach(function (t) {
i.push(t.name);
}),
(this.frameNames = i),
(this.defaultFrame = this.frame),
this
);
},
setEmitterFrames: function (t, e) {
Array.isArray(t) || (t = [t]);
for (var i = e.frames, n = (i.length = 0); n < t.length; n++) {
var s = t[n];
-1 !== this.frameNames.indexOf(s) && i.push(this.texture.get(s));
}
return 0 < i.length ? (e.defaultFrame = i[0]) : (e.defaultFrame = this.defaultFrame), this;
},
addEmitter: function (t) {
return this.emitters.add(t);
},
createEmitter: function (t) {
return this.addEmitter(new h(this, t));
},
removeEmitter: function (t) {
return this.emitters.remove(t, !0);
},
addGravityWell: function (t) {
return this.wells.add(t);
},
createGravityWell: function (t) {
return this.addGravityWell(new o(t));
},
emitParticle: function (t, e, i) {
for (var n = this.emitters.list, s = 0; s < n.length; s++) {
var r = n[s];
r.active && r.emitParticle(t, e, i);
}
return this;
},
emitParticleAt: function (t, e, i) {
return this.emitParticle(i, t, e);
},
pause: function () {
return (this.active = !1), this;
},
resume: function () {
return (this.active = !0), this;
},
getProcessors: function () {
return this.wells.getAll("active", !0);
},
preUpdate: function (t, e) {
e *= this.timeScale;
for (var i = this.emitters.list, n = 0; n < i.length; n++) {
var s = i[n];
s.active && s.preUpdate(t, e);
}
},
setAlpha: function () {},
setScrollFactor: function () {},
setBlendMode: function () {},
});
t.exports = u;
},
function (t, e, i) {
var o = i(35),
h = i(133),
l = i(31),
n = i(0),
s = i(11),
u = i(33),
a = i(109),
c = i(15),
d = i(1),
f = i(92),
r = i(1079),
p = i(141),
x = i(12),
g = i(222),
v = new n({
Extends: c,
Mixins: [s.Alpha, s.BlendMode, s.ComputedSize, s.Crop, s.Depth, s.Flip, s.GetBounds, s.Mask, s.Origin, s.Pipeline, s.ScrollFactor, s.Tint, s.Transform, s.Visible, r],
initialize: function (t, e, i, n, s, r, o) {
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 32),
void 0 === s && (s = 32),
c.call(this, t, "RenderTexture"),
(this.renderer = t.sys.renderer),
(this.textureManager = t.sys.textures),
(this.globalTint = 16777215),
(this.globalAlpha = 1),
(this.canvas = null),
(this.dirty = !1),
(this._crop = this.resetCropObject()),
(this.texture = null),
(this.frame = null),
(this._saved = !1),
void 0 === r
? ((this.canvas = l.create2D(this, n, s)), (this.texture = t.sys.textures.addCanvas(g(), this.canvas)), (this.frame = this.texture.get()))
: ((this.texture = t.sys.textures.get(r)),
(this.frame = this.texture.get(o)),
(this.canvas = this.frame.source.image),
(this._saved = !0),
(this.dirty = !0),
(this.width = this.frame.cutWidth),
(this.height = this.frame.cutHeight)),
(this.context = this.canvas.getContext("2d")),
(this._eraseMode = !1),
(this.camera = new h(0, 0, n, s)),
(this.renderTarget = null);
var a = this.renderer;
a
? a.type === u.WEBGL
? ((this.drawGameObject = this.batchGameObjectWebGL), (this.renderTarget = new p(a, n, s, 1, 0, !1)))
: a.type === u.CANVAS && (this.drawGameObject = this.batchGameObjectCanvas)
: (this.drawGameObject = d),
this.camera.setScene(t),
this.setPosition(e, i),
void 0 === r && this.setSize(n, s),
this.setOrigin(0, 0),
this.initPipeline(f.SINGLE_PIPELINE);
},
setSize: function (t, e) {
return this.resize(t, e);
},
resize: function (t, e) {
void 0 === e && (e = t);
var i,
n,
s = this.frame;
t !== this.width || e !== this.height
? "__BASE" === s.name &&
((this.canvas.width = t),
(this.canvas.height = e),
(this.texture.width = t),
(this.texture.height = e),
(i = this.renderTarget) && (i.resize(t, e), (s.glTexture = i.texture), (s.source.isRenderTexture = !0), (s.source.isGLTexture = !0), (s.source.glTexture = i.texture)),
this.camera.setSize(t, e),
(s.source.width = t),
(s.source.height = e),
s.setSize(t, e),
(this.width = t),
(this.height = e))
: ((n = this.texture.getSourceImage()), s.cutX + t > n.width && (t = n.width - s.cutX), s.cutY + e > n.height && (e = n.height - s.cutY), s.setSize(t, e, s.cutX, s.cutY)),
this.updateDisplayOrigin();
var r = this.input;
return r && !r.customHitArea && ((r.hitArea.width = t), (r.hitArea.height = e)), this;
},
setGlobalTint: function (t) {
return (this.globalTint = t), this;
},
setGlobalAlpha: function (t) {
return (this.globalAlpha = t), this;
},
saveTexture: function (t) {
return this.textureManager.renameTexture(this.texture.key, t), (this._saved = !0), this.texture;
},
fill: function (t, e, i, n, s, r) {
var o = this.frame,
a = this.camera,
h = this.renderer;
void 0 === e && (e = 1), void 0 === i && (i = 0), void 0 === n && (n = 0), void 0 === s && (s = o.cutWidth), void 0 === r && (r = o.cutHeight);
var l,
u,
c,
d,
f,
p,
g = ((t >> 16) & 255) / 255,
v = ((t >> 8) & 255) / 255,
y = (255 & t) / 255,
m = this.renderTarget;
return (
a.preRender(),
m
? (m.bind(!0),
(l = this.pipeline).manager.set(l),
(u = m.width),
(c = m.height),
(d = h.width / u),
(f = h.height / c),
l.drawFillRect(i * d, n * f, s * d, r * f, x.getTintFromFloats(y, v, g, 1), e),
m.unbind(!0))
: ((p = this.context), h.setContext(p), (p.fillStyle = "rgba(" + g + "," + v + "," + y + "," + e + ")"), p.fillRect(i + o.cutX, n + o.cutY, s, r), h.setContext()),
(this.dirty = !0),
this
);
},
clear: function () {
var t, e;
return (
this.dirty &&
((t = this.renderTarget)
? t.clear()
: ((e = this.context).save(), e.setTransform(1, 0, 0, 1, 0, 0), e.clearRect(this.frame.cutX, this.frame.cutY, this.frame.cutWidth, this.frame.cutHeight), e.restore()),
(this.dirty = !1)),
this
);
},
erase: function (t, e, i) {
return (this._eraseMode = !0), this.draw(t, e, i, 1, 16777215), (this._eraseMode = !1), this;
},
draw: function (t, e, i, n, s) {
return this.beginDraw(), this.batchDraw(t, e, i, n, s), this.endDraw(), this;
},
drawFrame: function (t, e, i, n, s, r) {
return this.beginDraw(), this.batchDrawFrame(t, e, i, n, s, r), this.endDraw(), this;
},
beginDraw: function () {
var t = this.camera,
e = this.renderer,
i = this.renderTarget;
return t.preRender(), i ? e.beginCapture(i.width, i.height) : e.setContext(this.context), this;
},
batchDraw: function (t, e, i, n, s) {
return (
void 0 === n && (n = this.globalAlpha),
(s = void 0 === s ? (this.globalTint >> 16) + (65280 & this.globalTint) + ((255 & this.globalTint) << 16) : (s >> 16) + (65280 & s) + ((255 & s) << 16)),
Array.isArray(t) || (t = [t]),
this.batchList(t, e, i, n, s),
this
);
},
batchDrawFrame: function (t, e, i, n, s, r) {
void 0 === i && (i = 0),
void 0 === n && (n = 0),
void 0 === s && (s = this.globalAlpha),
(r = void 0 === r ? (this.globalTint >> 16) + (65280 & this.globalTint) + ((255 & this.globalTint) << 16) : (r >> 16) + (65280 & r) + ((255 & r) << 16));
var o = this.textureManager.getFrame(t, e);
return o && (this.renderTarget ? this.pipeline.batchTextureFrame(o, i, n, r, s, this.camera.matrix, null) : this.batchTextureFrame(o, i + this.frame.cutX, n + this.frame.cutY, s, r)), this;
},
endDraw: function (t) {
void 0 === t && (t = this._eraseMode);
var e,
i = this.renderer,
n = this.renderTarget;
return n ? ((e = i.endCapture()), i.pipelines.setUtility().blitFrame(e, n, 1, !1, !1, t), i.resetScissor(), i.resetViewport()) : i.setContext(), (this.dirty = !0), this;
},
batchList: function (t, e, i, n, s) {
for (var r = 0; r < t.length; r++) {
var o = t[r];
o &&
o !== this &&
(o.renderWebGL || o.renderCanvas
? this.drawGameObject(o, e, i)
: o.isParent || o.list
? this.batchGroup(o.getChildren(), e, i)
: "string" == typeof o
? this.batchTextureFrameKey(o, null, e, i, n, s)
: o instanceof a
? this.batchTextureFrame(o, e, i, n, s)
: Array.isArray(o) && this.batchList(o, e, i, n, s));
}
},
batchGroup: function (t, e, i) {
void 0 === e && (e = 0), void 0 === i && (i = 0), (e += this.frame.cutX), (i += this.frame.cutY);
for (var n = 0; n < t.length; n++) {
var s,
r,
o = t[n];
o.willRender(this.camera) && ((s = o.x + e), (r = o.y + i), this.drawGameObject(o, s, r));
}
},
batchGameObjectWebGL: function (t, e, i) {
void 0 === e && (e = t.x), void 0 === i && (i = t.y);
var n = t.x,
s = t.y;
t.setPosition(e + this.frame.cutX, i + this.frame.cutY), t.renderDirect ? t.renderDirect(this.renderer, t, this.camera) : t.renderWebGL(this.renderer, t, this.camera), t.setPosition(n, s);
},
batchGameObjectCanvas: function (t, e, i) {
void 0 === e && (e = t.x), void 0 === i && (i = t.y);
var n,
s = t.x,
r = t.y;
this._eraseMode && ((n = t.blendMode), (t.blendMode = o.ERASE)),
t.setPosition(e + this.frame.cutX, i + this.frame.cutY),
t.renderCanvas(this.renderer, t, this.camera, null),
t.setPosition(s, r),
this._eraseMode && (t.blendMode = n);
},
batchTextureFrameKey: function (t, e, i, n, s, r) {
var o = this.textureManager.getFrame(t, e);
o && this.batchTextureFrame(o, i, n, s, r);
},
batchTextureFrame: function (t, e, i, n, s) {
var r, o, a, h;
void 0 === e && (e = 0),
void 0 === i && (i = 0),
(e += this.frame.cutX),
(i += this.frame.cutY),
this.renderTarget
? this.pipeline.batchTextureFrame(t, e, i, s, n, this.camera.matrix, null)
: ((r = this.context),
(o = t.canvasData),
(a = t.source.image),
(h = this.camera.matrix),
r.save(),
(r.globalCompositeOperation = this._eraseMode ? "destination-out" : "source-over"),
(r.globalAlpha = n),
h.setToContext(r),
r.drawImage(a, o.x, o.y, o.width, o.height, e, i, o.width, o.height),
r.restore());
},
snapshotArea: function (t, e, i, n, s, r, o) {
return (
this.renderTarget
? this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer, this.width, this.height, s, !1, t, e, i, n, r, o)
: this.renderer.snapshotCanvas(this.canvas, s, !1, t, e, i, n, r, o),
this
);
},
snapshot: function (t, e, i) {
return (
this.renderTarget
? this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer, this.width, this.height, t, !1, 0, 0, this.width, this.height, e, i)
: this.renderer.snapshotCanvas(this.canvas, t, !1, 0, 0, this.width, this.height, e, i),
this
);
},
snapshotPixel: function (t, e, i) {
return this.renderTarget ? this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer, this.width, this.height, i, !0, t, e) : this.renderer.snapshotCanvas(this.canvas, i, !0, t, e), this;
},
preDestroy: function () {
this._saved ||
(l.remove(this.canvas), this.renderTarget && this.renderTarget.destroy(), this.texture.destroy(), this.camera.destroy(), (this.canvas = null), (this.context = null), (this.texture = null));
},
});
t.exports = v;
},
function (t, e) {
t.exports = function () {
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (t) {
var e = (16 * Math.random()) | 0;
return ("x" === t ? e : (3 & e) | 8).toString(16);
});
};
},
function (t, e, i) {
var l = i(164),
n = i(0),
s = i(11),
u = i(15),
c = i(92),
r = i(1085),
d = i(3),
o = new n({
Extends: u,
Mixins: [s.AlphaSingle, s.BlendMode, s.Depth, s.Flip, s.Mask, s.Pipeline, s.Size, s.Texture, s.Transform, s.Visible, s.ScrollFactor, r],
initialize: function (t, e, i, n, s, r, o, a, h) {
void 0 === n && (n = "__DEFAULT"),
void 0 === r && (r = 2),
void 0 === o && (o = !0),
u.call(this, t, "Rope"),
(this.anims = new l(this)),
(this.points = r),
this.vertices,
this.uv,
this.colors,
this.alphas,
(this.tintFill = "__DEFAULT" === n),
(this.dirty = !1),
(this.horizontal = o),
(this._flipX = !1),
(this._flipY = !1),
(this._perp = new d()),
(this.debugCallback = null),
(this.debugGraphic = null),
this.setTexture(n, s),
this.setPosition(e, i),
this.setSizeToFrame(),
this.initPipeline(c.ROPE_PIPELINE),
Array.isArray(r) && this.resizeArrays(r.length),
this.setPoints(r, a, h),
this.updateVertices();
},
addedToScene: function () {
this.scene.sys.updateList.add(this);
},
removedFromScene: function () {
this.scene.sys.updateList.remove(this);
},
preUpdate: function (t, e) {
var i = this.anims.currentFrame;
this.anims.update(t, e), this.anims.currentFrame !== i && (this.updateUVs(), this.updateVertices());
},
play: function (t, e, i) {
return this.anims.play(t, e, i), this;
},
setDirty: function () {
return (this.dirty = !0), this;
},
setHorizontal: function (t, e, i) {
return void 0 === t && (t = this.points.length), this.horizontal ? this : ((this.horizontal = !0), this.setPoints(t, e, i));
},
setVertical: function (t, e, i) {
return void 0 === t && (t = this.points.length), this.horizontal ? ((this.horizontal = !1), this.setPoints(t, e, i)) : this;
},
setTintFill: function (t) {
return void 0 === t && (t = !1), (this.tintFill = t), this;
},
setAlphas: function (t, e) {
var i = this.points.length;
if (i < 1) return this;
var n = this.alphas;
void 0 === t ? (t = [1]) : Array.isArray(t) || void 0 !== e || (t = [t]);
var s = 0;
if (void 0 !== e) for (o = 0; o < i; o++) (n[(s = 2 * o)] = t), (n[s + 1] = e);
else if (t.length === i) for (o = 0; o < i; o++) (n[(s = 2 * o)] = t[o]), (n[s + 1] = t[o]);
else for (var r = t[0], o = 0; o < i; o++) (s = 2 * o), t.length > s && (r = t[s]), (n[s] = r), t.length > s + 1 && (r = t[s + 1]), (n[s + 1] = r);
return this;
},
setColors: function (t) {
var e = this.points.length;
if (e < 1) return this;
var i = this.colors;
void 0 === t ? (t = [16777215]) : Array.isArray(t) || (t = [t]);
var n = 0;
if (t.length === e) for (r = 0; r < e; r++) (i[(n = 2 * r)] = t[r]), (i[n + 1] = t[r]);
else for (var s = t[0], r = 0; r < e; r++) (n = 2 * r), t.length > n && (s = t[n]), (i[n] = s), t.length > n + 1 && (s = t[n + 1]), (i[n + 1] = s);
return this;
},
setPoints: function (t, e, i) {
if ((void 0 === t && (t = 2), "number" == typeof t)) {
var n,
s,
r,
o = t;
if ((o < 2 && (o = 2), (t = []), this.horizontal)) for (r = -this.frame.halfWidth, s = this.frame.width / (o - 1), n = 0; n < o; n++) t.push({ x: r + n * s, y: 0 });
else for (r = -this.frame.halfHeight, s = this.frame.height / (o - 1), n = 0; n < o; n++) t.push({ x: 0, y: r + n * s });
}
var a = t.length,
h = this.points.length;
return (
a < 1 || (1 === a && (t.unshift({ x: 0, y: 0 }), a++), h !== a && this.resizeArrays(a), (this.points = t), this.updateUVs(), null != e && this.setColors(e), null != i && this.setAlphas(i)), this
);
},
updateUVs: function () {
for (var t = this.uv, e = this.points.length, i = this.frame.u0, n = this.frame.v0, s = this.frame.u1, r = this.frame.v1, o = (s - i) / (e - 1), a = (r - n) / (e - 1), h = 0; h < e; h++) {
var l,
u,
c,
d = 4 * h,
f = this.horizontal
? ((c = l = this._flipX ? s - h * o : i + h * o), this._flipY ? ((u = r), n) : ((u = n), r))
: ((c = this._flipX ? ((l = i), s) : ((l = s), i)), (u = this._flipY ? r - h * a : n + h * a));
(t[0 + d] = l), (t[1 + d] = u), (t[2 + d] = c), (t[3 + d] = f);
}
return this;
},
resizeArrays: function (t) {
var e = this.colors,
i = this.alphas;
(this.vertices = new Float32Array(4 * t)), (this.uv = new Float32Array(4 * t)), (e = new Uint32Array(2 * t)), (i = new Float32Array(2 * t));
for (var n = 0; n < 2 * t; n++) (e[n] = 16777215), (i[n] = 1);
return (this.colors = e), (this.alphas = i), (this.dirty = !0), this;
},
updateVertices: function () {
var t = this._perp,
e = this.points,
i = this.vertices,
n = e.length;
if (((this.dirty = !1), !(n < 1))) {
for (var s = e[0], r = this.horizontal ? this.frame.halfHeight : this.frame.halfWidth, o = 0; o < n; o++) {
var a = e[o],
h = 4 * o,
l = o < n - 1 ? e[o + 1] : a;
(t.x = l.y - s.y), (t.y = -(l.x - s.x));
var u = t.length();
(t.x /= u), (t.y /= u), (t.x *= r), (t.y *= r), (i[h] = a.x + t.x), (i[1 + h] = a.y + t.y), (i[2 + h] = a.x - t.x), (i[3 + h] = a.y - t.y), (s = a);
}
return this;
}
},
setDebug: function (t, e) {
return (this.debugGraphic = t), (this.debugCallback = t || e ? e || this.renderDebugVerts : null), this;
},
renderDebugVerts: function (t, e, i) {
var n = t.debugGraphic,
s = i[0],
r = i[1],
o = i[2],
a = i[3];
n.lineBetween(s, r, o, a);
for (var h = 4; h < e; h += 4) {
var l = i[h + 0],
u = i[h + 1],
c = i[h + 2],
d = i[h + 3];
n.lineBetween(s, r, l, u), n.lineBetween(o, a, c, d), n.lineBetween(o, a, l, u), n.lineBetween(l, u, c, d), (s = l), (r = u), (o = c), (a = d);
}
},
preDestroy: function () {
this.anims.destroy(),
(this.anims = void 0),
(this.points = null),
(this.vertices = null),
(this.uv = null),
(this.colors = null),
(this.alphas = null),
(this.debugCallback = null),
(this.debugGraphic = null);
},
flipX: {
get: function () {
return this._flipX;
},
set: function (t) {
return (this._flipX = t), this.updateUVs();
},
},
flipY: {
get: function () {
return this._flipY;
},
set: function (t) {
return (this._flipY = t), this.updateUVs();
},
},
});
t.exports = o;
},
function (t, e, i) {
var n = i(142),
r = i(31),
s = i(0),
o = i(11),
a = i(22),
h = i(15),
T = i(458),
l = i(6),
u = i(202),
c = i(1088),
d = i(459),
f = new s({
Extends: h,
Mixins: [o.Alpha, o.BlendMode, o.ComputedSize, o.Crop, o.Depth, o.Flip, o.GetBounds, o.Mask, o.Origin, o.Pipeline, o.ScrollFactor, o.Tint, o.Transform, o.Visible, c],
initialize: function (t, e, i, n, s) {
void 0 === e && (e = 0),
void 0 === i && (i = 0),
h.call(this, t, "Text"),
(this.renderer = t.sys.renderer),
this.setPosition(e, i),
this.setOrigin(0, 0),
this.initPipeline(),
(this.canvas = r.create(this)),
(this.context = this.canvas.getContext("2d")),
(this.style = new d(this, s)),
(this.autoRound = !0),
(this.splitRegExp = /(?:\r\n|\r|\n)/),
(this._text = void 0),
(this.padding = { left: 0, right: 0, top: 0, bottom: 0 }),
(this.width = 1),
(this.height = 1),
(this.lineSpacing = 0),
(this.dirty = !1),
0 === this.style.resolution && (this.style.resolution = 1),
(this._crop = this.resetCropObject()),
(this.texture = t.sys.textures.addCanvas(null, this.canvas, !0)),
(this.frame = this.texture.get()),
(this.frame.source.resolution = this.style.resolution),
this.renderer && this.renderer.gl && (this.renderer.deleteTexture(this.frame.source.glTexture), (this.frame.source.glTexture = null)),
this.initRTL(),
this.setText(n),
s && s.padding && this.setPadding(s.padding),
s && s.lineSpacing && this.setLineSpacing(s.lineSpacing),
t.sys.game.events.on(
a.CONTEXT_RESTORED,
function () {
this.dirty = !0;
},
this
);
},
initRTL: function () {
this.style.rtl && ((this.canvas.dir = "rtl"), (this.context.direction = "rtl"), (this.canvas.style.display = "none"), n(this.canvas, this.scene.sys.canvas), (this.originX = 1));
},
runWordWrap: function (t) {
var e = this.style;
if (e.wordWrapCallback) {
var i = e.wordWrapCallback.call(e.wordWrapCallbackScope, t, this);
return Array.isArray(i) && (i = i.join("\n")), i;
}
return e.wordWrapWidth ? (e.wordWrapUseAdvanced ? this.advancedWordWrap(t, this.context, this.style.wordWrapWidth) : this.basicWordWrap(t, this.context, this.style.wordWrapWidth)) : t;
},
advancedWordWrap: function (t, e, i) {
for (var n = "", s = t.replace(/ +/gi, " ").split(this.splitRegExp), r = s.length, o = 0; o < r; o++) {
var a = "",
h = (h = s[o]).replace(/^ *|\s*$/gi, "");
if (e.measureText(h).width < i) n += h + "\n";
else {
for (var l = i, u = h.split(" "), c = 0; c < u.length; c++) {
var d = u[c],
f = d + " ",
p = e.measureText(f).width;
if (l < p) {
if (0 === c) {
for (var g = f; g.length && ((g = g.slice(0, -1)), !((p = e.measureText(g).width) <= l)); );
if (!g.length) throw new Error("This text's wordWrapWidth setting is less than a single character!");
var v = d.substr(g.length);
(u[c] = v), (a += g);
}
var y = u[c].length ? c : c + 1,
m = u
.slice(y)
.join(" ")
.replace(/[ \n]*$/gi, "");
(s[o + 1] = m + " " + (s[o + 1] || "")), (r = s.length);
break;
}
(a += f), (l -= p);
}
n += a.replace(/[ \n]*$/gi, "") + "\n";
}
}
return n.replace(/[\s|\n]*$/gi, "");
},
basicWordWrap: function (t, e, i) {
for (var n = "", s = t.split(this.splitRegExp), r = s.length - 1, o = e.measureText(" ").width, a = 0; a <= r; a++) {
for (var h = i, l = s[a].split(" "), u = l.length - 1, c = 0; c <= u; c++) {
var d = l[c],
f = e.measureText(d).width,
p = f;
c < u && (p += o), h < p && 0 < c && ((n += "\n"), (h = i)), (n += d), c < u ? ((n += " "), (h -= p)) : (h -= f);
}
a < r && (n += "\n");
}
return n;
},
getWrappedText: function (t) {
return void 0 === t && (t = this._text), this.style.syncFont(this.canvas, this.context), this.runWordWrap(t).split(this.splitRegExp);
},
setText: function (t) {
return t || 0 === t || (t = ""), Array.isArray(t) && (t = t.join("\n")), t !== this._text && ((this._text = t.toString()), this.updateText()), this;
},
setStyle: function (t) {
return this.style.setStyle(t);
},
setFont: function (t) {
return this.style.setFont(t);
},
setFontFamily: function (t) {
return this.style.setFontFamily(t);
},
setFontSize: function (t) {
return this.style.setFontSize(t);
},
setFontStyle: function (t) {
return this.style.setFontStyle(t);
},
setFixedSize: function (t, e) {
return this.style.setFixedSize(t, e);
},
setBackgroundColor: function (t) {
return this.style.setBackgroundColor(t);
},
setFill: function (t) {
return this.style.setFill(t);
},
setColor: function (t) {
return this.style.setColor(t);
},
setStroke: function (t, e) {
return this.style.setStroke(t, e);
},
setShadow: function (t, e, i, n, s, r) {
return this.style.setShadow(t, e, i, n, s, r);
},
setShadowOffset: function (t, e) {
return this.style.setShadowOffset(t, e);
},
setShadowColor: function (t) {
return this.style.setShadowColor(t);
},
setShadowBlur: function (t) {
return this.style.setShadowBlur(t);
},
setShadowStroke: function (t) {
return this.style.setShadowStroke(t);
},
setShadowFill: function (t) {
return this.style.setShadowFill(t);
},
setWordWrapWidth: function (t, e) {
return this.style.setWordWrapWidth(t, e);
},
setWordWrapCallback: function (t, e) {
return this.style.setWordWrapCallback(t, e);
},
setAlign: function (t) {
return this.style.setAlign(t);
},
setResolution: function (t) {
return this.style.setResolution(t);
},
setLineSpacing: function (t) {
return (this.lineSpacing = t), this.updateText();
},
setPadding: function (t, e, i, n) {
var s, r, o;
return (
"object" == typeof t
? ((i = null !== (r = l((s = t), "x", null)) ? (t = r) : ((t = l(s, "left", 0)), l(s, "right", t))), (n = null !== (o = l(s, "y", null)) ? (e = o) : ((e = l(s, "top", 0)), l(s, "bottom", e))))
: (void 0 === t && (t = 0), void 0 === e && (e = t), void 0 === i && (i = t), void 0 === n && (n = e)),
(this.padding.left = t),
(this.padding.top = e),
(this.padding.right = i),
(this.padding.bottom = n),
this.updateText()
);
},
setMaxLines: function (t) {
return this.style.setMaxLines(t);
},
updateText: function () {
var t = this.canvas,
e = this.context,
i = this.style,
n = i.resolution,
s = i.metrics;
i.syncFont(t, e);
var r = this._text;
(i.wordWrapWidth || i.wordWrapCallback) && (r = this.runWordWrap(this._text));
var o,
a = r.split(this.splitRegExp),
h = T(this, s, a),
l = this.padding;
0 === i.fixedWidth ? ((this.width = h.width + l.left + l.right), (o = h.width)) : ((this.width = i.fixedWidth), (o = this.width - l.left - l.right) < h.width && (o = h.width)),
0 === i.fixedHeight ? (this.height = h.height + l.top + l.bottom) : (this.height = i.fixedHeight);
var u,
c,
d = this.width,
f = this.height;
this.updateDisplayOrigin(),
(d *= n),
(f *= n),
(d = Math.max(d, 1)),
(f = Math.max(f, 1)),
t.width !== d || t.height !== f ? ((t.width = d), (t.height = f), this.frame.setSize(d, f), i.syncFont(t, e)) : e.clearRect(0, 0, d, f),
e.save(),
e.scale(n, n),
i.backgroundColor && ((e.fillStyle = i.backgroundColor), e.fillRect(0, 0, d, f)),
i.syncStyle(t, e),
(e.textBaseline = "alphabetic"),
e.translate(l.left, l.top);
for (var p = 0; p < h.lines; p++) {
if (((u = i.strokeThickness / 2), (c = i.strokeThickness / 2 + p * h.lineHeight + s.ascent), 0 < p && (c += h.lineSpacing * p), i.rtl)) u = d - u;
else if ("right" === i.align) u += o - h.lineWidths[p];
else if ("center" === i.align) u += (o - h.lineWidths[p]) / 2;
else if ("justify" === i.align && 0.85 <= h.lineWidths[p] / h.width) {
var g = h.width - h.lineWidths[p],
v = e.measureText(" ").width,
y = a[p].trim(),
m = y.split(" ");
g += (a[p].length - y.length) * v;
for (var x = Math.floor(g / v), b = 0; 0 < x; ) (m[b] += " "), (b = (b + 1) % (m.length - 1 || 1)), --x;
a[p] = m.join(" ");
}
this.autoRound && ((u = Math.round(u)), (c = Math.round(c))),
i.strokeThickness && (this.style.syncShadow(e, i.shadowStroke), e.strokeText(a[p], u, c)),
i.color && (this.style.syncShadow(e, i.shadowFill), e.fillText(a[p], u, c));
}
e.restore(),
this.renderer && this.renderer.gl && ((this.frame.source.glTexture = this.renderer.canvasToTexture(t, this.frame.source.glTexture, !0)), (this.frame.glTexture = this.frame.source.glTexture)),
(this.dirty = !0);
var w = this.input;
return w && !w.customHitArea && ((w.hitArea.width = this.width), (w.hitArea.height = this.height)), this;
},
getTextMetrics: function () {
return this.style.getTextMetrics();
},
text: {
get: function () {
return this._text;
},
set: function (t) {
this.setText(t);
},
},
toJSON: function () {
var t = o.ToJSON(this),
e = {
autoRound: this.autoRound,
text: this._text,
style: this.style.toJSON(),
padding: { left: this.padding.left, right: this.padding.right, top: this.padding.top, bottom: this.padding.bottom },
};
return (t.data = e), t;
},
preDestroy: function () {
this.style.rtl && u(this.canvas), r.remove(this.canvas), this.texture.destroy();
},
});
t.exports = f;
},
function (t, e, i) {
var u = i(31),
n = i(0),
s = i(11),
c = i(22),
d = i(15),
f = i(361),
o = i(192),
r = i(1091),
p = i(3),
a = new n({
Extends: d,
Mixins: [s.Alpha, s.BlendMode, s.ComputedSize, s.Crop, s.Depth, s.Flip, s.GetBounds, s.Mask, s.Origin, s.Pipeline, s.ScrollFactor, s.Tint, s.Transform, s.Visible, r],
initialize: function (t, e, i, n, s, r, o) {
var a = t.sys.renderer;
d.call(this, t, "TileSprite");
var h = t.sys.textures.get(r),
l = h.get(o);
(s = n && s ? ((n = Math.floor(n)), Math.floor(s)) : ((n = l.width), l.height)),
(this._tilePosition = new p()),
(this._tileScale = new p(1, 1)),
(this.dirty = !1),
(this.renderer = a),
(this.canvas = u.create(this, n, s)),
(this.context = this.canvas.getContext("2d")),
(this.displayTexture = h),
(this.displayFrame = l),
(this._crop = this.resetCropObject()),
(this.texture = t.sys.textures.addCanvas(null, this.canvas, !0)),
(this.frame = this.texture.get()),
(this.potWidth = f(l.width)),
(this.potHeight = f(l.height)),
(this.fillCanvas = u.create2D(this, this.potWidth, this.potHeight)),
(this.fillContext = this.fillCanvas.getContext("2d")),
(this.fillPattern = null),
this.setPosition(e, i),
this.setSize(n, s),
this.setFrame(o),
this.setOriginFromFrame(),
this.initPipeline(),
t.sys.game.events.on(
c.CONTEXT_RESTORED,
function (t) {
var e;
t &&
((e = t.gl),
(this.dirty = !0),
(this.fillPattern = null),
(this.fillPattern = t.createTexture2D(0, e.LINEAR, e.LINEAR, e.REPEAT, e.REPEAT, e.RGBA, this.fillCanvas, this.potWidth, this.potHeight)));
},
this
);
},
setTexture: function (t, e) {
return (this.displayTexture = this.scene.sys.textures.get(t)), this.setFrame(e);
},
setFrame: function (t) {
var e = this.displayTexture.get(t);
return (
(this.potWidth = f(e.width)),
(this.potHeight = f(e.height)),
(this.canvas.width = 0),
e.cutWidth && e.cutHeight ? (this.renderFlags |= 8) : (this.renderFlags &= -9),
(this.displayFrame = e),
(this.dirty = !0),
this.updateTileTexture(),
this
);
},
setTilePosition: function (t, e) {
return void 0 !== t && (this.tilePositionX = t), void 0 !== e && (this.tilePositionY = e), this;
},
setTileScale: function (t, e) {
return void 0 === t && (t = this.tileScaleX), void 0 === e && (e = t), (this.tileScaleX = t), (this.tileScaleY = e), this;
},
updateTileTexture: function () {
if (this.dirty && this.renderer) {
var t = this.displayFrame;
if (t.source.isRenderTexture || t.source.isGLTexture) return void (this.dirty = !1);
var e = this.fillContext,
i = this.fillCanvas,
n = this.potWidth,
s = this.potHeight;
(this.renderer && this.renderer.gl) || ((n = t.cutWidth), (s = t.cutHeight)),
e.clearRect(0, 0, n, s),
(i.width = n),
(i.height = s),
e.drawImage(t.source.image, t.cutX, t.cutY, t.cutWidth, t.cutHeight, 0, 0, n, s),
this.renderer && this.renderer.gl ? (this.fillPattern = this.renderer.canvasToTexture(i, this.fillPattern)) : (this.fillPattern = e.createPattern(i, "repeat")),
this.updateCanvas(),
(this.dirty = !1);
}
},
updateCanvas: function () {
var t,
e,
i,
n,
s,
r = this.canvas;
(r.width === this.width && r.height === this.height) || ((r.width = this.width), (r.height = this.height), this.frame.setSize(this.width, this.height), this.updateDisplayOrigin(), (this.dirty = !0)),
!this.dirty ||
(this.renderer && this.renderer.gl) ||
((t = this.context),
this.scene.sys.game.config.antialias || o.disable(t),
(e = this._tileScale.x),
(i = this._tileScale.y),
(n = this._tilePosition.x),
(s = this._tilePosition.y),
t.clearRect(0, 0, this.width, this.height),
t.save(),
t.scale(e, i),
t.translate(-n, -s),
(t.fillStyle = this.fillPattern),
t.fillRect(n, s, this.width / e, this.height / i),
t.restore()),
(this.dirty = !1);
},
preDestroy: function () {
this.renderer && this.renderer.gl && this.renderer.deleteTexture(this.fillPattern),
u.remove(this.canvas),
u.remove(this.fillCanvas),
(this.fillPattern = null),
(this.fillContext = null),
(this.fillCanvas = null),
(this.displayTexture = null),
(this.displayFrame = null),
this.texture.destroy(),
(this.renderer = null);
},
tilePositionX: {
get: function () {
return this._tilePosition.x;
},
set: function (t) {
(this._tilePosition.x = t), (this.dirty = !0);
},
},
tilePositionY: {
get: function () {
return this._tilePosition.y;
},
set: function (t) {
(this._tilePosition.y = t), (this.dirty = !0);
},
},
tileScaleX: {
get: function () {
return this._tileScale.x;
},
set: function (t) {
(this._tileScale.x = t), (this.dirty = !0);
},
},
tileScaleY: {
get: function () {
return this._tileScale.y;
},
set: function (t) {
(this._tileScale.y = t), (this.dirty = !0);
},
},
});
t.exports = a;
},
function (t, e, i) {
var n = i(0),
s = i(18),
r = i(11),
o = i(75),
a = i(22),
h = i(51),
l = i(15),
u = i(70),
c = i(222),
d = i(1094),
f = i(14),
p = new n({
Extends: l,
Mixins: [r.Alpha, r.BlendMode, r.Depth, r.Flip, r.GetBounds, r.Mask, r.Origin, r.Pipeline, r.ScrollFactor, r.Size, r.TextureCrop, r.Tint, r.Transform, r.Visible, d],
initialize: function (t, e, i, n) {
l.call(this, t, "Video"),
(this.video = null),
(this.videoTexture = null),
(this.videoTextureSource = null),
(this.snapshotTexture = null),
(this.flipY = !1),
(this._key = c()),
(this.touchLocked = !0),
(this.playWhenUnlocked = !1),
(this.retryLimit = 20),
(this.retry = 0),
(this.retryInterval = 500),
(this._retryID = null),
(this._systemMuted = !1),
(this._codeMuted = !1),
(this._systemPaused = !1),
(this._codePaused = !1),
(this._callbacks = {
play: this.playHandler.bind(this),
error: this.loadErrorHandler.bind(this),
end: this.completeHandler.bind(this),
time: this.timeUpdateHandler.bind(this),
seeking: this.seekingHandler.bind(this),
seeked: this.seekedHandler.bind(this),
}),
(this._crop = this.resetCropObject()),
(this.markers = {}),
(this._markerIn = -1),
(this._markerOut = f.MAX_SAFE_INTEGER),
(this._lastUpdate = 0),
(this._cacheKey = ""),
(this._isSeeking = !1),
(this.removeVideoElementOnDestroy = !1),
this.setPosition(e, i),
this.initPipeline(),
n && this.changeSource(n, !1);
var s = t.sys.game.events;
s.on(a.PAUSE, this.globalPause, this), s.on(a.RESUME, this.globalResume, this);
var r = t.sys.sound;
r && r.on(u.GLOBAL_MUTE, this.globalMute, this);
},
addedToScene: function () {
this.scene.sys.updateList.add(this);
},
removedFromScene: function () {
this.scene.sys.updateList.remove(this);
},
play: function (t, e, i) {
if ((this.touchLocked && this.playWhenUnlocked) || this.isPlaying()) return this;
var n = this.video;
if (!n) return this;
void 0 === t && (t = n.loop);
var s = this.scene.sys.sound;
s && s.mute && this.setMute(!0), isNaN(e) || (this._markerIn = e), !isNaN(i) && e < i && (this._markerOut = i), (n.loop = t);
var r = this._callbacks,
o = n.play();
return (
void 0 !== o
? o.then(this.playPromiseSuccessHandler.bind(this)).catch(this.playPromiseErrorHandler.bind(this))
: (n.addEventListener("playing", r.play, !0),
n.readyState < 2 && ((this.retry = this.retryLimit), (this._retryID = window.setTimeout(this.checkVideoProgress.bind(this), this.retryInterval)))),
n.addEventListener("ended", r.end, !0),
n.addEventListener("timeupdate", r.time, !0),
n.addEventListener("seeking", r.seeking, !0),
n.addEventListener("seeked", r.seeked, !0),
this
);
},
changeSource: function (t, e, i, n, s) {
void 0 === e && (e = !0), this.video && this.stop();
var r = this.scene.sys.cache.video.get(t);
return (
r
? ((this.video = r),
(this._cacheKey = t),
(this._codePaused = r.paused),
(this._codeMuted = r.muted),
this.videoTexture
? (this.scene.sys.textures.remove(this._key),
(this.videoTexture = this.scene.sys.textures.create(this._key, r, r.videoWidth, r.videoHeight)),
(this.videoTextureSource = this.videoTexture.source[0]),
this.videoTexture.add("__BASE", 0, 0, 0, r.videoWidth, r.videoHeight),
this.setTexture(this.videoTexture),
this.setSizeToFrame(),
this.updateDisplayOrigin(),
this.emit(o.VIDEO_CREATED, this, r.videoWidth, r.videoHeight))
: this.updateTexture(),
(r.currentTime = 0),
(this._lastUpdate = 0),
e && this.play(i, n, s))
: (this.video = null),
this
);
},
addMarker: function (t, e, i) {
return !isNaN(e) && 0 <= e && !isNaN(i) && (this.markers[t] = [e, i]), this;
},
playMarker: function (t, e) {
var i = this.markers[t];
return i && this.play(e, i[0], i[1]), this;
},
removeMarker: function (t) {
return delete this.markers[t], this;
},
snapshot: function (t, e) {
return void 0 === t && (t = this.width), void 0 === e && (e = this.height), this.snapshotArea(0, 0, this.width, this.height, t, e);
},
snapshotArea: function (t, e, i, n, s, r) {
void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = this.width), void 0 === n && (n = this.height), void 0 === s && (s = i), void 0 === r && (r = n);
var o = this.video,
a = this.snapshotTexture;
return a ? a.setSize(s, r) : ((a = this.scene.sys.textures.createCanvas(c(), s, r)), (this.snapshotTexture = a)), o && a.context.drawImage(o, t, e, i, n, 0, 0, s, r), a.update();
},
saveSnapshotTexture: function (t) {
return (
this.snapshotTexture ? this.scene.sys.textures.renameTexture(this.snapshotTexture.key, t) : (this.snapshotTexture = this.scene.sys.textures.createCanvas(t, this.width, this.height)),
this.snapshotTexture
);
},
loadURL: function (t, e, i) {
void 0 === e && (e = "loadeddata"), void 0 === i && (i = !1), this.video && this.stop(), this.videoTexture && this.scene.sys.textures.remove(this._key);
var n = document.createElement("video");
return (
(n.controls = !1),
i && ((n.muted = !0), (n.defaultMuted = !0), n.setAttribute("autoplay", "autoplay")),
n.setAttribute("playsinline", "playsinline"),
n.setAttribute("preload", "auto"),
n.addEventListener("error", this._callbacks.error, !0),
(n.src = t),
n.load(),
(this.video = n),
this
);
},
loadMediaStream: function (t, e, i) {
void 0 === e && (e = "loadeddata"), void 0 === i && (i = !1), this.video && this.stop(), this.videoTexture && this.scene.sys.textures.remove(this._key);
var n = document.createElement("video");
(n.controls = !1),
i && ((n.muted = !0), (n.defaultMuted = !0), n.setAttribute("autoplay", "autoplay")),
n.setAttribute("playsinline", "playsinline"),
n.setAttribute("preload", "auto"),
n.addEventListener("error", this._callbacks.error, !0);
try {
n.srcObject = t;
} catch (e) {
n.src = window.URL.createObjectURL(t);
}
return n.load(), (this.video = n), this;
},
playPromiseSuccessHandler: function () {
(this._codePaused = !1), (this.touchLocked = !1), this.emit(o.VIDEO_PLAY, this), -1 < this._markerIn && (this.video.currentTime = this._markerIn);
},
playPromiseErrorHandler: function (t) {
this.scene.sys.input.once(h.POINTER_DOWN, this.unlockHandler, this), (this.touchLocked = !0), (this.playWhenUnlocked = !0), this.emit(o.VIDEO_ERROR, this, t);
},
playHandler: function () {
(this._codePaused = !1), (this.touchLocked = !1), this.emit(o.VIDEO_PLAY, this), this.video.removeEventListener("playing", this._callbacks.play, !0);
},
loadErrorHandler: function (t) {
this.stop(), this.emit(o.VIDEO_ERROR, this, t);
},
unlockHandler: function () {
(this.touchLocked = !1),
(this.playWhenUnlocked = !1),
this.emit(o.VIDEO_UNLOCKED, this),
-1 < this._markerIn && (this.video.currentTime = this._markerIn),
this.video.play(),
this.emit(o.VIDEO_PLAY, this);
},
completeHandler: function () {
this.emit(o.VIDEO_COMPLETE, this);
},
timeUpdateHandler: function () {
this.video && this.video.currentTime < this._lastUpdate && (this.emit(o.VIDEO_LOOP, this), (this._lastUpdate = 0));
},
preUpdate: function () {
var t,
e = this.video;
!e ||
((t = e.currentTime) !== this._lastUpdate &&
((this._lastUpdate = t),
this.updateTexture(),
t >= this._markerOut &&
(e.loop ? ((e.currentTime = this._markerIn), this.updateTexture(), (this._lastUpdate = t), this.emit(o.VIDEO_LOOP, this)) : (this.emit(o.VIDEO_COMPLETE, this), this.stop()))));
},
checkVideoProgress: function () {
2 <= this.video.readyState
? this.updateTexture()
: (this.retry--, 0 < this.retry ? (this._retryID = window.setTimeout(this.checkVideoProgress.bind(this), this.retryInterval)) : this.emit(o.VIDEO_TIMEOUT, this));
},
updateTexture: function () {
var t,
e = this.video,
i = e.videoWidth,
n = e.videoHeight;
this.videoTexture
? ((t = this.videoTextureSource).source !== e && ((t.source = e), (t.width = i), (t.height = n)), t.update())
: ((this.videoTexture = this.scene.sys.textures.create(this._key, e, i, n)),
(this.videoTextureSource = this.videoTexture.source[0]),
this.videoTexture.add("__BASE", 0, 0, 0, i, n),
this.setTexture(this.videoTexture),
this.setSizeToFrame(),
this.updateDisplayOrigin(),
this.emit(o.VIDEO_CREATED, this, i, n));
},
getVideoKey: function () {
return this._cacheKey;
},
seekTo: function (t) {
var e,
i,
n = this.video;
return n && ((e = n.duration) === 1 / 0 || isNaN(e) || ((i = e * t), this.setCurrentTime(i))), this;
},
getCurrentTime: function () {
return this.video ? this.video.currentTime : 0;
},
setCurrentTime: function (t) {
var e,
i,
n = this.video;
return (
n && ("string" == typeof t && ((e = t[0]), (i = parseFloat(t.substr(1))), "+" === e ? (t = n.currentTime + i) : "-" === e && (t = n.currentTime - i)), (n.currentTime = t), (this._lastUpdate = t)),
this
);
},
isSeeking: function () {
return this._isSeeking;
},
seekingHandler: function () {
(this._isSeeking = !0), this.emit(o.VIDEO_SEEKING, this);
},
seekedHandler: function () {
(this._isSeeking = !1), this.emit(o.VIDEO_SEEKED, this), this.video && this.updateTexture();
},
getProgress: function () {
var t = this.video;
if (t) {
var e = t.currentTime,
i = t.duration;
if (i !== 1 / 0 && !isNaN(i)) return e / i;
}
return 0;
},
getDuration: function () {
return this.video ? this.video.duration : 0;
},
setMute: function (t) {
void 0 === t && (t = !0), (this._codeMuted = t);
var e = this.video;
return e && (e.muted = !!this._systemMuted || t), this;
},
isMuted: function () {
return this._codeMuted;
},
globalMute: function (t, e) {
this._systemMuted = e;
var i = this.video;
i && (i.muted = !!this._codeMuted || e);
},
globalPause: function () {
(this._systemPaused = !0), this.video && this.video.pause();
},
globalResume: function () {
(this._systemPaused = !1), this.video && !this._codePaused && this.video.play();
},
setPaused: function (t) {
void 0 === t && (t = !0);
var e = this.video;
return (this._codePaused = t), e && (t ? e.paused || e.pause() : t || (e.paused && !this._systemPaused && e.play())), this;
},
getVolume: function () {
return this.video ? this.video.volume : 1;
},
setVolume: function (t) {
return void 0 === t && (t = 1), this.video && (this.video.volume = s(t, 0, 1)), this;
},
getPlaybackRate: function () {
return this.video ? this.video.playbackRate : 1;
},
setPlaybackRate: function (t) {
return this.video && (this.video.playbackRate = t), this;
},
getLoop: function () {
return !!this.video && this.video.loop;
},
setLoop: function (t) {
return void 0 === t && (t = !0), this.video && (this.video.loop = t), this;
},
isPlaying: function () {
return !!this.video && !(this.video.paused || this.video.ended);
},
isPaused: function () {
return (this.video && this.video.paused) || this._codePaused || this._systemPaused;
},
saveTexture: function (t, e) {
return (
void 0 === e && (e = !1),
this.videoTexture && this.scene.sys.textures.renameTexture(this._key, t),
(this._key = t),
(this.flipY = e),
this.videoTextureSource && this.videoTextureSource.setFlipY(e),
this.videoTexture
);
},
stop: function () {
var t = this.video;
if (t) {
var e = this._callbacks;
for (var i in e) t.removeEventListener(i, e[i], !0);
t.pause();
}
return this._retryID && window.clearTimeout(this._retryID), this.emit(o.VIDEO_STOP, this), this;
},
removeVideoElement: function () {
var t = this.video;
if (t) {
for (t.parentNode && t.parentNode.removeChild(t); t.hasChildNodes(); ) t.removeChild(t.firstChild);
t.removeAttribute("autoplay"), t.removeAttribute("src"), (this.video = null);
}
},
preDestroy: function () {
this.stop(), this.removeVideoElementOnDestroy && this.removeVideoElement();
var t = this.scene.sys.game.events;
t.off(a.PAUSE, this.globalPause, this), t.off(a.RESUME, this.globalResume, this);
var e = this.scene.sys.sound;
e && e.off(u.GLOBAL_MUTE, this.globalMute, this), this._retryID && window.clearTimeout(this._retryID);
},
});
t.exports = p;
},
function (t, e, i) {
var n = i(0),
s = i(228),
r = i(470),
o = i(56),
a = new n({
initialize: function (t) {
(this.type = o.POLYGON), (this.area = 0), (this.points = []), t && this.setTo(t);
},
contains: function (t, e) {
return s(this, t, e);
},
setTo: function (t) {
if (((this.area = 0), (this.points = []), "string" == typeof t && (t = t.split(" ")), !Array.isArray(t))) return this;
for (var e, i = Number.MAX_VALUE, n = 0; n < t.length; n++)
(e = { x: 0, y: 0 }),
"number" == typeof t[n] || "string" == typeof t[n]
? ((e.x = parseFloat(t[n])), (e.y = parseFloat(t[n + 1])), n++)
: Array.isArray(t[n])
? ((e.x = t[n][0]), (e.y = t[n][1]))
: ((e.x = t[n].x), (e.y = t[n].y)),
this.points.push(e),
e.y < i && (i = e.y);
return this.calculateArea(i), this;
},
calculateArea: function () {
if (this.points.length < 3) return (this.area = 0), this.area;
for (var t, e, i = 0, n = 0; n < this.points.length - 1; n++) (t = this.points[n]), (i += ((e = this.points[n + 1]).x - t.x) * (t.y + e.y));
return (t = this.points[0]), (e = this.points[this.points.length - 1]), (i += (t.x - e.x) * (e.y + t.y)), (this.area = 0.5 * -i), this.area;
},
getPoints: function (t, e, i) {
return r(this, t, e, i);
},
});
t.exports = a;
},
function (t, e) {
t.exports = function (t, e, i) {
for (var n = !1, s = -1, r = t.points.length - 1; ++s < t.points.length; r = s) {
var o = t.points[s].x,
a = t.points[s].y,
h = t.points[r].x,
l = t.points[r].y;
((a <= i && i < l) || (l <= i && i < a)) && e < ((h - o) * (i - a)) / (l - a) + o && (n = !n);
}
return n;
};
},
function (t, e, i) {
var n = i(0),
s = i(11),
l = i(15),
c = i(2),
u = i(17),
r = i(478),
o = i(1176),
d = i(25),
a = new n({
Extends: l,
Mixins: [s.ComputedSize, s.Depth, s.GetBounds, s.Mask, s.Origin, s.ScrollFactor, s.Transform, s.Visible, o],
initialize: function (t, e, i, n, s, r, o, a) {
void 0 === i && (i = 0), void 0 === n && (n = 0), void 0 === s && (s = 128), void 0 === r && (r = 128), l.call(this, t, "Shader"), (this.blendMode = -1), this.shader;
var h = t.sys.renderer;
(this.renderer = h),
(this.gl = h.gl),
(this.vertexData = new ArrayBuffer(2 * Float32Array.BYTES_PER_ELEMENT * 6)),
(this.vertexBuffer = h.createVertexBuffer(this.vertexData.byteLength, this.gl.STREAM_DRAW)),
(this.program = null),
(this.bytes = new Uint8Array(this.vertexData)),
(this.vertexViewF32 = new Float32Array(this.vertexData)),
(this._tempMatrix1 = new d()),
(this._tempMatrix2 = new d()),
(this._tempMatrix3 = new d()),
(this.viewMatrix = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])),
(this.projectionMatrix = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])),
(this.uniforms = {}),
(this.pointer = null),
(this._rendererWidth = h.width),
(this._rendererHeight = h.height),
(this._textureCount = 0),
(this.framebuffer = null),
(this.glTexture = null),
(this.renderToTexture = !1),
(this.texture = null),
this.setPosition(i, n),
this.setSize(s, r),
this.setOrigin(0.5, 0.5),
this.setShader(e, o, a);
},
willRender: function (t) {
return !!this.renderToTexture || !(l.RENDER_MASK !== this.renderFlags || (0 !== this.cameraFilter && this.cameraFilter & t.id));
},
setRenderToTexture: function (t, e) {
var i, n, s;
return (
void 0 === e && (e = !1),
this.renderToTexture ||
((i = this.width),
(n = this.height),
(s = this.renderer),
(this.glTexture = s.createTextureFromSource(null, i, n, 0)),
(this.glTexture.flipY = e),
(this.framebuffer = s.createFramebuffer(i, n, this.glTexture, !1)),
(this._rendererWidth = i),
(this._rendererHeight = n),
(this.renderToTexture = !0),
this.projOrtho(0, this.width, this.height, 0),
t && (this.texture = this.scene.sys.textures.addGLTexture(t, this.glTexture, i, n))),
this.shader && (s.pipelines.clear(), this.load(), this.flush(), s.pipelines.rebind()),
this
);
},
setShader: function (t, e, i) {
if ((void 0 === e && (e = []), "string" == typeof t)) {
var n = this.scene.sys.cache.shader;
if (!n.has(t)) return this;
this.shader = n.get(t);
} else this.shader = t;
var s = this.gl,
r = this.renderer;
this.program && s.deleteProgram(this.program);
var o = r.createProgram(this.shader.vertexSrc, this.shader.fragmentSrc);
s.uniformMatrix4fv(s.getUniformLocation(o, "uViewMatrix"), !1, this.viewMatrix),
s.uniformMatrix4fv(s.getUniformLocation(o, "uProjectionMatrix"), !1, this.projectionMatrix),
s.uniform2f(s.getUniformLocation(o, "uResolution"), this.width, this.height),
(this.program = o);
var a = new Date(),
h = {
resolution: { type: "2f", value: { x: this.width, y: this.height } },
time: { type: "1f", value: 0 },
mouse: { type: "2f", value: { x: this.width / 2, y: this.height / 2 } },
date: { type: "4fv", value: [a.getFullYear(), a.getMonth(), a.getDate(), 60 * a.getHours() * 60 + 60 * a.getMinutes() + a.getSeconds()] },
sampleRate: { type: "1f", value: 44100 },
iChannel0: { type: "sampler2D", value: null, textureData: { repeat: !0 } },
iChannel1: { type: "sampler2D", value: null, textureData: { repeat: !0 } },
iChannel2: { type: "sampler2D", value: null, textureData: { repeat: !0 } },
iChannel3: { type: "sampler2D", value: null, textureData: { repeat: !0 } },
};
this.shader.uniforms ? (this.uniforms = u(!0, {}, this.shader.uniforms, h)) : (this.uniforms = h);
for (var l = 0; l < 4; l++) e[l] && this.setSampler2D("iChannel" + l, e[l], l, i);
return this.initUniforms(), this.projOrtho(0, this._rendererWidth, this._rendererHeight, 0), this;
},
setPointer: function (t) {
return (this.pointer = t), this;
},
projOrtho: function (t, e, i, n) {
var s = 1 / (t - e),
r = 1 / (i - n),
o = this.projectionMatrix;
(o[0] = -2 * s), (o[5] = -2 * r), (o[10] = -0.001), (o[12] = (t + e) * s), (o[13] = (n + i) * r), (o[14] = -0);
var a = this.program,
h = this.gl;
this.renderer.setProgram(a), h.uniformMatrix4fv(h.getUniformLocation(a, "uProjectionMatrix"), !1, this.projectionMatrix), (this._rendererWidth = e), (this._rendererHeight = i);
},
initUniforms: function () {
var t = this.gl,
e = this.renderer.glFuncMap,
i = this.program;
for (var n in ((this._textureCount = 0), this.uniforms)) {
var s = this.uniforms[n],
r = s.type,
o = e[r];
(s.uniformLocation = t.getUniformLocation(i, n)), "sampler2D" !== r && ((s.glMatrix = o.matrix), (s.glValueLength = o.length), (s.glFunc = o.func));
}
},
setSampler2DBuffer: function (t, e, i, n, s, r) {
void 0 === s && (s = 0), void 0 === r && (r = {});
var o = this.uniforms[t];
return (o.value = e), (r.width = i), (r.height = n), (o.textureData = r), (this._textureCount = s), this.initSampler2D(o), this;
},
setSampler2D: function (t, e, i, n) {
void 0 === i && (i = 0);
var s = this.scene.sys.textures;
if (s.exists(e)) {
var r = s.getFrame(e);
if (r.glTexture && r.glTexture.isRenderTexture) return this.setSampler2DBuffer(t, r.glTexture, r.width, r.height, i, n);
var o = this.uniforms[t],
a = r.source;
(o.textureKey = e),
(o.source = a.image),
(o.value = r.glTexture),
a.isGLTexture && (((n = n || {}).width = a.width), (n.height = a.height)),
n && (o.textureData = n),
(this._textureCount = i),
this.initSampler2D(o);
}
return this;
},
setUniform: function (t, e) {
return r(this.uniforms, t, e), this;
},
getUniform: function (t) {
return c(this.uniforms, t, null);
},
setChannel0: function (t, e) {
return this.setSampler2D("iChannel0", t, 0, e);
},
setChannel1: function (t, e) {
return this.setSampler2D("iChannel1", t, 1, e);
},
setChannel2: function (t, e) {
return this.setSampler2D("iChannel2", t, 2, e);
},
setChannel3: function (t, e) {
return this.setSampler2D("iChannel3", t, 3, e);
},
initSampler2D: function (t) {
var e, i, n, s, r, o, a, h, l, u;
t.value &&
((e = this.gl).activeTexture(e.TEXTURE0 + this._textureCount),
e.bindTexture(e.TEXTURE_2D, t.value),
(i = t.textureData) &&
!t.value.isRenderTexture &&
((n = e[c(i, "magFilter", "linear").toUpperCase()]),
(s = e[c(i, "minFilter", "linear").toUpperCase()]),
(r = e[c(i, "wrapS", "repeat").toUpperCase()]),
(o = e[c(i, "wrapT", "repeat").toUpperCase()]),
(a = e[c(i, "format", "rgba").toUpperCase()]),
i.repeat && ((r = e.REPEAT), (o = e.REPEAT)),
e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, !!i.flipY),
i.width
? ((h = c(i, "width", 512)), (l = c(i, "height", 2)), (u = c(i, "border", 0)), e.texImage2D(e.TEXTURE_2D, 0, a, h, l, u, a, e.UNSIGNED_BYTE, null))
: e.texImage2D(e.TEXTURE_2D, 0, a, e.RGBA, e.UNSIGNED_BYTE, t.source),
e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, n),
e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, s),
e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, r),
e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, o)),
this.renderer.setProgram(this.program),
e.uniform1i(t.uniformLocation, this._textureCount),
this._textureCount++);
},
syncUniforms: function () {
var t,
e,
i,
n,
s,
r = this.gl,
o = this.uniforms,
a = 0;
for (var h in o)
(i = (t = o[h]).glFunc),
(e = t.glValueLength),
(n = t.uniformLocation),
null !== (s = t.value) &&
(1 === e
? t.glMatrix
? i.call(r, n, t.transpose, s)
: i.call(r, n, s)
: 2 === e
? i.call(r, n, s.x, s.y)
: 3 === e
? i.call(r, n, s.x, s.y, s.z)
: 4 === e
? i.call(r, n, s.x, s.y, s.z, s.w)
: "sampler2D" === t.type && (r.activeTexture(r.TEXTURE0 + a), r.bindTexture(r.TEXTURE_2D, s), r.uniform1i(n, a), a++));
},
load: function (t) {
var e,
i,
n = this.gl,
s = this.width,
r = this.height,
o = this.renderer,
a = this.program,
h = this.viewMatrix;
this.renderToTexture ||
((e = -this._displayOriginX),
(i = -this._displayOriginY),
(h[0] = t[0]),
(h[1] = t[1]),
(h[4] = t[2]),
(h[5] = t[3]),
(h[8] = t[4]),
(h[9] = t[5]),
(h[12] = h[0] * e + h[4] * i),
(h[13] = h[1] * e + h[5] * i)),
n.useProgram(a),
n.uniformMatrix4fv(n.getUniformLocation(a, "uViewMatrix"), !1, h),
n.uniform2f(n.getUniformLocation(a, "uResolution"), this.width, this.height);
var l = this.uniforms,
u = l.resolution;
(u.value.x = s), (u.value.y = r), (l.time.value = o.game.loop.getDuration());
var c,
d,
f,
p = this.pointer;
p && ((c = l.mouse), (d = p.x / s), (f = 1 - p.y / r), (c.value.x = d.toFixed(2)), (c.value.y = f.toFixed(2))), this.syncUniforms();
},
flush: function () {
var t = this.width,
e = this.height,
i = this.program,
n = this.gl,
s = this.vertexBuffer,
r = this.renderer,
o = 2 * Float32Array.BYTES_PER_ELEMENT;
this.renderToTexture && (r.setFramebuffer(this.framebuffer), n.clearColor(0, 0, 0, 0), n.clear(n.COLOR_BUFFER_BIT)), n.bindBuffer(n.ARRAY_BUFFER, s);
var a = n.getAttribLocation(i, "inPosition");
-1 !== a && (n.enableVertexAttribArray(a), n.vertexAttribPointer(a, 2, n.FLOAT, !1, o, 0));
var h = this.vertexViewF32;
(h[3] = e),
(h[4] = t),
(h[5] = e),
(h[8] = t),
(h[9] = e),
(h[10] = t),
n.bufferSubData(n.ARRAY_BUFFER, 0, this.bytes.subarray(0, 6 * o)),
n.drawArrays(n.TRIANGLES, 0, 6),
this.renderToTexture && r.setFramebuffer(null, !1);
},
setAlpha: function () {},
setBlendMode: function () {},
preDestroy: function () {
var t = this.gl;
t.deleteProgram(this.program),
t.deleteBuffer(this.vertexBuffer),
this.renderToTexture && (this.renderer.deleteFramebuffer(this.framebuffer), this.texture.destroy(), (this.framebuffer = null), (this.glTexture = null), (this.texture = null));
},
});
t.exports = a;
},
function (t, e, i) {
var n = i(0),
s = i(11),
r = i(36),
o = i(116),
f = i(15),
h = i(479),
u = i(480),
l = i(19),
p = i(69),
a = i(1179),
c = i(79),
g = i(39),
d = i(117),
v = new n({
Extends: f,
Mixins: [s.AlphaSingle, s.BlendMode, s.Depth, s.Mask, s.Pipeline, s.Size, s.Texture, s.Transform, s.Visible, s.ScrollFactor, a],
initialize: function (t, e, i, n, s, r, o, a, h, l, u, c) {
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = "__WHITE"),
f.call(this, t, "Mesh"),
(this.faces = []),
(this.vertices = []),
(this.tintFill = !1),
(this.debugCallback = null),
(this.debugGraphic = null),
(this.hideCCW = !0),
(this.modelPosition = new g()),
(this.modelScale = new g(1, 1, 1)),
(this.modelRotation = new g()),
(this.dirtyCache = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]),
(this.transformMatrix = new p()),
(this.viewPosition = new g()),
(this.viewMatrix = new p()),
(this.projectionMatrix = new p()),
(this.totalRendered = 0),
(this.totalFrame = 0),
(this.ignoreDirtyCache = !1);
var d = t.sys.renderer;
this.setPosition(e, i), this.setTexture(n, s), this.setSize(d.width, d.height), this.initPipeline(), this.setPerspective(d.width, d.height), r && this.addVertices(r, o, a, h, l, u, c);
},
addedToScene: function () {
this.scene.sys.updateList.add(this);
},
removedFromScene: function () {
this.scene.sys.updateList.remove(this);
},
panX: function (t) {
return this.viewPosition.addScale(g.LEFT, t), (this.dirtyCache[10] = 1), this;
},
panY: function (t) {
return (this.viewPosition.y += g.DOWN.y * t), (this.dirtyCache[10] = 1), this;
},
panZ: function (t) {
return (this.viewPosition.z += t), (this.dirtyCache[10] = 1), this;
},
setPerspective: function (t, e, i, n, s) {
return (
void 0 === i && (i = 45), void 0 === n && (n = 0.01), void 0 === s && (s = 1e3), this.projectionMatrix.perspective(r(i), t / e, n, s), (this.dirtyCache[10] = 1), (this.dirtyCache[11] = 0), this
);
},
setOrtho: function (t, e, i, n) {
return (
void 0 === t && (t = this.scene.sys.renderer.getAspectRatio()),
void 0 === e && (e = 1),
void 0 === i && (i = -1e3),
void 0 === n && (n = 1e3),
this.projectionMatrix.ortho(-t, t, -e, e, i, n),
(this.dirtyCache[10] = 1),
(this.dirtyCache[11] = 1),
this
);
},
clear: function () {
return (
this.faces.forEach(function (t) {
t.destroy();
}),
(this.faces = []),
(this.vertices = []),
this
);
},
addVerticesFromObj: function (t, e, i, n, s, r, o, a, h) {
var l = this.scene.sys.cache.obj.get(t);
return l && u(l, this, e, i, n, s, r, o, a, h), this;
},
sortByDepth: function (t, e) {
return t.depth - e.depth;
},
depthSort: function () {
return c(this.faces, this.sortByDepth), this;
},
addVertex: function (t, e, i, n, s, r, o) {
var a = new d(t, e, i, n, s, r, o);
return this.vertices.push(a), a;
},
addFace: function (t, e, i) {
var n = new o(t, e, i);
return this.faces.push(n), (this.dirtyCache[9] = -1), n;
},
addVertices: function (t, e, i, n, s, r, o) {
var a = h(t, e, i, n, s, r, o);
return a && ((this.faces = this.faces.concat(a.faces)), (this.vertices = this.vertices.concat(a.vertices))), (this.dirtyCache[9] = -1), this;
},
getFaceCount: function () {
return this.faces.length;
},
getVertexCount: function () {
return this.vertices.length;
},
getFace: function (t) {
return this.faces[t];
},
getFaceAt: function (t, e, i) {
void 0 === i && (i = this.scene.sys.cameras.main);
for (var n = l(this, i).calc, s = this.faces, r = [], o = 0; o < s.length; o++) {
var a = s[o];
a.contains(t, e, n) && r.push(a);
}
return c(r, this.sortByDepth);
},
setDebug: function (t, e) {
return (this.debugGraphic = t), (this.debugCallback = t || e ? e || this.renderDebug : null), this;
},
isDirty: function () {
var t = this.modelPosition,
e = this.modelRotation,
i = this.modelScale,
n = this.dirtyCache,
s = t.x,
r = t.y,
o = t.z,
a = e.x,
h = e.y,
l = e.z,
u = i.x,
c = i.y,
d = i.z,
f = this.getFaceCount(),
p = n[0],
g = n[1],
v = n[2],
y = n[3],
m = n[4],
x = n[5],
b = n[6],
w = n[7],
T = n[8],
S = n[9];
return (
(n[0] = s),
(n[1] = r),
(n[2] = o),
(n[3] = a),
(n[4] = h),
(n[5] = l),
(n[6] = u),
(n[7] = c),
(n[8] = d),
(n[9] = f),
p !== s || g !== r || v !== o || y !== a || m !== h || x !== l || b !== u || w !== c || T !== d || S !== f
);
},
preUpdate: function () {
(this.totalRendered = this.totalFrame), (this.totalFrame = 0);
var t = this.dirtyCache;
if (this.ignoreDirtyCache || t[10] || this.isDirty()) {
var e = this.width,
i = this.height,
n = this.viewMatrix,
s = this.viewPosition;
t[10] && (n.identity(), n.translate(s), n.invert(), (t[10] = 0));
var r = this.transformMatrix;
r.setWorldMatrix(this.modelRotation, this.modelPosition, this.modelScale, this.viewMatrix, this.projectionMatrix);
for (var o = s.z, a = this.faces, h = 0; h < a.length; h++) a[h].transformCoordinatesLocal(r, e, i, o);
this.depthSort();
}
},
renderDebug: function (t, e) {
for (var i = t.debugGraphic, n = 0; n < e.length; n++) {
var s = e[n],
r = s.vertex1.tx,
o = s.vertex1.ty,
a = s.vertex2.tx,
h = s.vertex2.ty,
l = s.vertex3.tx,
u = s.vertex3.ty;
i.strokeTriangle(r, o, a, h, l, u);
}
},
preDestroy: function () {
this.clear(), (this.debugCallback = null), (this.debugGraphic = null);
},
});
t.exports = v;
},
function (t, e, i) {
var n = i(50);
t.exports = function (t, e) {
return n(t.x, t.y, e.x, e.y) <= t.radius + e.radius;
};
},
function (t, e, i) {
var b = i(4),
w = i(233);
t.exports = function (t, e, i) {
var n, s, r, o, a, h, l, u, c, d, f, p, g, v, y, m, x;
return (
void 0 === i && (i = []),
w(t, e) &&
((n = t.x1),
(s = t.y1),
(r = t.x2),
(o = t.y2),
0 == (p = (f = 2 * ((h = r - n) * (u = n - e.x) + (l = o - s) * (c = s - e.y))) * f - 4 * (d = h * h + l * l) * (u * u + c * c - (a = e.radius) * a))
? ((v = n + (g = -f / (2 * d)) * h), (y = s + g * l), 0 <= g && g <= 1 && i.push(new b(v, y)))
: 0 < p &&
((v = n + (m = (-f - Math.sqrt(p)) / (2 * d)) * h),
(y = s + m * l),
0 <= m && m <= 1 && i.push(new b(v, y)),
(v = n + (x = (-f + Math.sqrt(p)) / (2 * d)) * h),
(y = s + x * l),
0 <= x && x <= 1 && i.push(new b(v, y)))),
i
);
};
},
function (t, e, i) {
var c = i(66),
d = new (i(4))();
t.exports = function (t, e, i) {
if ((void 0 === i && (i = d), c(e, t.x1, t.y1))) return (i.x = t.x1), (i.y = t.y1), !0;
if (c(e, t.x2, t.y2)) return (i.x = t.x2), (i.y = t.y2), !0;
var n,
s = t.x2 - t.x1,
r = t.y2 - t.y1,
o = e.x - t.x1,
a = e.y - t.y1,
h = s * s + r * r,
l = s,
u = r;
return 0 < h && ((l *= n = (o * s + a * r) / h), (u *= n)), (i.x = t.x1 + l), (i.y = t.y1 + u), l * l + u * u <= h && 0 <= l * s + u * r && c(e, i.x, i.y);
};
},
function (t, e, i) {
var u = i(4),
c = i(96),
d = i(488);
t.exports = function (t, e, i) {
if ((void 0 === i && (i = []), d(t, e)))
for (
var n = e.getLineA(), s = e.getLineB(), r = e.getLineC(), o = e.getLineD(), a = [new u(), new u(), new u(), new u()], h = [c(n, t, a[0]), c(s, t, a[1]), c(r, t, a[2]), c(o, t, a[3])], l = 0;
l < 4;
l++
)
h[l] && i.push(a[l]);
return i;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
void 0 === i && (i = !1), void 0 === n && (n = []);
for (
var s,
r,
o,
a,
h,
l,
u = t.x3 - t.x1,
c = t.y3 - t.y1,
d = t.x2 - t.x1,
f = t.y2 - t.y1,
p = u * u + c * c,
g = u * d + c * f,
v = d * d + f * f,
y = p * v - g * g,
m = 0 == y ? 0 : 1 / y,
x = t.x1,
b = t.y1,
w = 0;
w < e.length &&
((r = (p * (l = d * (o = e[w].x - x) + f * (a = e[w].y - b)) - g * (h = u * o + c * a)) * m), !(0 <= (s = (v * h - g * l) * m) && 0 <= r && s + r < 1 && (n.push({ x: e[w].x, y: e[w].y }), i)));
w++
);
return n;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = Math.cos(n),
r = Math.sin(n),
o = t.x1 - e,
a = t.y1 - i;
return (t.x1 = o * s - a * r + e), (t.y1 = o * r + a * s + i), (o = t.x2 - e), (a = t.y2 - i), (t.x2 = o * s - a * r + e), (t.y2 = o * r + a * s + i), t;
};
},
function (t, e) {
t.exports = function (t) {
return 0 === t.height ? NaN : t.width / t.height;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = Math.cos(n),
r = Math.sin(n),
o = t.x1 - e,
a = t.y1 - i;
return (
(t.x1 = o * s - a * r + e),
(t.y1 = o * r + a * s + i),
(o = t.x2 - e),
(a = t.y2 - i),
(t.x2 = o * s - a * r + e),
(t.y2 = o * r + a * s + i),
(o = t.x3 - e),
(a = t.y3 - i),
(t.x3 = o * s - a * r + e),
(t.y3 = o * r + a * s + i),
t
);
};
},
function (t, e, i) {
t.exports = { BUTTON_DOWN: i(1310), BUTTON_UP: i(1311), CONNECTED: i(1312), DISCONNECTED: i(1313), GAMEPAD_BUTTON_DOWN: i(1314), GAMEPAD_BUTTON_UP: i(1315) };
},
function (t, e, i) {
var s = i(17),
r = i(156);
t.exports = function (t, e) {
var i = void 0 === t ? r() : s({}, t);
if (e) for (var n in e) void 0 !== e[n] && (i[n] = e[n]);
return i;
};
},
function (t, e, i) {
var n = i(0),
s = i(21),
a = i(23),
r = i(8),
h = i(2),
l = i(7),
o = i(408),
u = new n({
Extends: a,
initialize: function (t, e, i, n) {
var s,
r = "xml";
l(e) && ((e = h((s = e), "key")), (i = h(s, "url")), (n = h(s, "xhrSettings")), (r = h(s, "extension", r)));
var o = { type: "xml", cache: t.cacheManager.xml, extension: r, responseType: "text", key: e, url: i, xhrSettings: n };
a.call(this, t, o);
},
onProcess: function () {
(this.state = s.FILE_PROCESSING), (this.data = o(this.xhrLoader.responseText)), this.data ? this.onProcessComplete() : this.onProcessError();
},
});
r.register("xml", function (t, e, i) {
if (Array.isArray(t)) for (var n = 0; n < t.length; n++) this.addFile(new u(this, t[n]));
else this.addFile(new u(this, t, e, i));
return this;
}),
(t.exports = u);
},
function (t, e, i) {
var n = i(0),
s = i(21),
l = i(23),
r = i(8),
u = i(2),
c = i(7),
o = new n({
Extends: l,
initialize: function (t, e, i, n) {
var s,
r = "text",
o = "txt",
a = t.cacheManager.text;
c(e) && ((e = u((s = e), "key")), (i = u(s, "url")), (n = u(s, "xhrSettings")), (o = u(s, "extension", o)), (r = u(s, "type", r)), (a = u(s, "cache", a)));
var h = { type: r, cache: a, extension: o, responseType: "text", key: e, url: i, xhrSettings: n };
l.call(this, t, h);
},
onProcess: function () {
(this.state = s.FILE_PROCESSING), (this.data = this.xhrLoader.responseText), this.onProcessComplete();
},
});
r.register("text", function (t, e, i) {
if (Array.isArray(t)) for (var n = 0; n < t.length; n++) this.addFile(new o(this, t[n]));
else this.addFile(new o(this, t, e, i));
return this;
}),
(t.exports = o);
},
function (t, e, i) {
t.exports = {
Acceleration: i(1368),
Angular: i(1369),
Bounce: i(1370),
Debug: i(1371),
Drag: i(1372),
Enable: i(1373),
Friction: i(1374),
Gravity: i(1375),
Immovable: i(1376),
Mass: i(1377),
OverlapCirc: i(523),
OverlapRect: i(244),
Pushable: i(1378),
Size: i(1379),
Velocity: i(1380),
};
},
function (t, e) {
t.exports = function (t, e, i, n, s, r, o) {
void 0 === r && (r = !0), void 0 === o && (o = !1);
var a,
h,
l,
u = [],
c = [],
d = t.treeMinMax;
return (
(d.minX = e),
(d.minY = i),
(d.maxX = e + n),
(d.maxY = i + s),
o && (c = t.staticTree.search(d)),
r && t.useTree
? (u = t.tree.search(d))
: r &&
((a = t.bodies),
(h = { position: { x: e, y: i }, left: e, top: i, right: e + n, bottom: i + s, isCircle: !1 }),
(l = t.intersects),
a.iterate(function (t) {
l(t, h) && u.push(t);
})),
c.concat(u)
);
};
},
function (t, e, i) {
t.exports = { COLLIDE: i(1381), OVERLAP: i(1382), PAUSE: i(1383), RESUME: i(1384), TILE_COLLIDE: i(1385), TILE_OVERLAP: i(1386), WORLD_BOUNDS: i(1387), WORLD_STEP: i(1388) };
},
function (t, e, i) {
var o = i(62);
t.exports = function (t, e, i, n) {
var s = 0,
r = t.deltaAbsX() + e.deltaAbsX() + n;
return (
0 === t._dx && 0 === e._dx
? ((t.embedded = !0), (e.embedded = !0))
: t._dx > e._dx
? (r < (s = t.right - e.x) && !i) || !1 === t.checkCollision.right || !1 === e.checkCollision.left
? (s = 0)
: ((t.touching.none = !1),
(t.touching.right = !0),
(e.touching.none = !1),
(e.touching.left = !0),
e.physicsType !== o.STATIC_BODY || i || ((t.blocked.none = !1), (t.blocked.right = !0)),
t.physicsType !== o.STATIC_BODY || i || ((e.blocked.none = !1), (e.blocked.left = !0)))
: t._dx < e._dx &&
((r < -(s = t.x - e.width - e.x) && !i) || !1 === t.checkCollision.left || !1 === e.checkCollision.right
? (s = 0)
: ((t.touching.none = !1),
(t.touching.left = !0),
(e.touching.none = !1),
(e.touching.right = !0),
e.physicsType !== o.STATIC_BODY || i || ((t.blocked.none = !1), (t.blocked.left = !0)),
t.physicsType !== o.STATIC_BODY || i || ((e.blocked.none = !1), (e.blocked.right = !0)))),
(t.overlapX = s),
(e.overlapX = s)
);
};
},
function (t, e, i) {
var o = i(62);
t.exports = function (t, e, i, n) {
var s = 0,
r = t.deltaAbsY() + e.deltaAbsY() + n;
return (
0 === t._dy && 0 === e._dy
? ((t.embedded = !0), (e.embedded = !0))
: t._dy > e._dy
? (r < (s = t.bottom - e.y) && !i) || !1 === t.checkCollision.down || !1 === e.checkCollision.up
? (s = 0)
: ((t.touching.none = !1),
(t.touching.down = !0),
(e.touching.none = !1),
(e.touching.up = !0),
e.physicsType !== o.STATIC_BODY || i || ((t.blocked.none = !1), (t.blocked.down = !0)),
t.physicsType !== o.STATIC_BODY || i || ((e.blocked.none = !1), (e.blocked.up = !0)))
: t._dy < e._dy &&
((r < -(s = t.y - e.bottom) && !i) || !1 === t.checkCollision.up || !1 === e.checkCollision.down
? (s = 0)
: ((t.touching.none = !1),
(t.touching.up = !0),
(e.touching.none = !1),
(e.touching.down = !0),
e.physicsType !== o.STATIC_BODY || i || ((t.blocked.none = !1), (t.blocked.up = !0)),
t.physicsType !== o.STATIC_BODY || i || ((e.blocked.none = !1), (e.blocked.down = !0)))),
(t.overlapY = s),
(e.overlapY = s)
);
};
},
function (t, e) {
t.exports = function (t, e) {
return !(e.right <= t.left || e.bottom <= t.top || e.position.x >= t.right || e.position.y >= t.bottom);
};
},
function (t, e, i) {
t.exports = {
Bounce: i(1495),
Collision: i(1496),
Force: i(1497),
Friction: i(1498),
Gravity: i(1499),
Mass: i(1500),
Sensor: i(1501),
SetBody: i(1502),
Sleep: i(1503),
Static: i(1520),
Transform: i(1521),
Velocity: i(1522),
};
},
function (t, e) {
var l = {};
((t.exports = l).create = function (t, e) {
var i = t.bodyA,
n = t.bodyB,
s = {
id: l.id(i, n),
bodyA: i,
bodyB: n,
activeContacts: [],
separation: 0,
isActive: !0,
confirmedActive: !0,
isSensor: i.isSensor || n.isSensor,
timeCreated: e,
timeUpdated: e,
collision: null,
inverseMass: 0,
friction: 0,
frictionStatic: 0,
restitution: 0,
slop: 0,
};
return l.update(s, t, e), s;
}),
(l.update = function (t, e, i) {
if ((t.collision = e).collided) {
var n = e.supports,
s = t.activeContacts,
r = e.parentA,
o = e.parentB;
(t.inverseMass = r.inverseMass + o.inverseMass),
(t.friction = Math.min(r.friction, o.friction)),
(t.frictionStatic = Math.max(r.frictionStatic, o.frictionStatic)),
(t.restitution = Math.max(r.restitution, o.restitution)),
(t.slop = Math.max(r.slop, o.slop));
for (var a = 0; a < n.length; a++) s[a] = n[a].contact;
var h = n.length;
h < s.length && (s.length = h), (t.separation = e.depth), l.setActive(t, !0, i);
} else !0 === t.isActive && l.setActive(t, !1, i);
}),
(l.setActive = function (t, e, i) {
e ? ((t.isActive = !0), (t.timeUpdated = i)) : ((t.isActive = !1), (t.activeContacts.length = 0));
}),
(l.id = function (t, e) {
return t.id < e.id ? "A" + t.id + "B" + e.id : "A" + e.id + "B" + t.id;
});
},
function (t, e, i) {
t.exports = {
CalculateFacesAt: i(252),
CalculateFacesWithin: i(63),
CheckIsoBounds: i(541),
Copy: i(1420),
CreateFromTiles: i(1421),
CullBounds: i(543),
CullTiles: i(544),
Fill: i(1422),
FilterTiles: i(1423),
FindByIndex: i(1424),
FindTile: i(1425),
ForEachTile: i(1426),
GetCullTilesFunction: i(1427),
GetTileAt: i(158),
GetTileAtWorldXY: i(1428),
GetTilesWithin: i(26),
GetTilesWithinShape: i(1429),
GetTilesWithinWorldXY: i(529),
GetTileToWorldXFunction: i(1430),
GetTileToWorldXYFunction: i(1431),
GetTileToWorldYFunction: i(1432),
GetWorldToTileXFunction: i(1433),
GetWorldToTileXYFunction: i(1434),
GetWorldToTileYFunction: i(1435),
HasTileAt: i(562),
HasTileAtWorldXY: i(1436),
HexagonalCullBounds: i(546),
HexagonalCullTiles: i(545),
HexagonalTileToWorldXY: i(550),
HexagonalTileToWorldY: i(554),
HexagonalWorldToTileXY: i(556),
HexagonalWorldToTileY: i(560),
IsInLayerBounds: i(119),
IsometricCullTiles: i(547),
IsometricTileToWorldXY: i(551),
IsometricWorldToTileXY: i(557),
PutTileAt: i(257),
PutTileAtWorldXY: i(1437),
PutTilesAt: i(1438),
Randomize: i(1439),
RemoveTileAt: i(563),
RemoveTileAtWorldXY: i(1440),
RenderDebug: i(1441),
ReplaceByIndex: i(542),
RunCull: i(159),
SetCollision: i(1442),
SetCollisionBetween: i(1443),
SetCollisionByExclusion: i(1444),
SetCollisionByProperty: i(1445),
SetCollisionFromCollisionGroup: i(1446),
SetLayerCollisionIndex: i(160),
SetTileCollision: i(72),
SetTileIndexCallback: i(1447),
SetTileLocationCallback: i(1448),
Shuffle: i(1449),
StaggeredCullBounds: i(549),
StaggeredCullTiles: i(548),
StaggeredTileToWorldXY: i(552),
StaggeredTileToWorldY: i(555),
StaggeredWorldToTileXY: i(558),
StaggeredWorldToTileY: i(561),
SwapByIndex: i(1450),
TileToWorldX: i(253),
TileToWorldXY: i(553),
TileToWorldY: i(254),
WeightedRandomize: i(1451),
WorldToTileX: i(255),
WorldToTileXY: i(559),
WorldToTileY: i(256),
};
},
function (t, e, i) {
var l = i(158);
t.exports = function (t, e, i) {
var n = l(t, e, !0, i),
s = l(t, e - 1, !0, i),
r = l(t, e + 1, !0, i),
o = l(t - 1, e, !0, i),
a = l(t + 1, e, !0, i),
h = n && n.collides;
return (
h && ((n.faceTop = !0), (n.faceBottom = !0), (n.faceLeft = !0), (n.faceRight = !0)),
s && s.collides && (h && (n.faceTop = !1), (s.faceBottom = !h)),
r && r.collides && (h && (n.faceBottom = !1), (r.faceTop = !h)),
o && o.collides && (h && (n.faceLeft = !1), (o.faceRight = !h)),
a && a.collides && (h && (n.faceRight = !1), (a.faceLeft = !h)),
n && !n.collides && n.resetFaces(),
n
);
};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = i.baseTileWidth,
s = i.tilemapLayer,
r = 0;
return s && ((e = e || s.scene.cameras.main), (r = s.x + e.scrollX * (1 - s.scrollFactorX)), (n *= s.scaleX)), r + t * n;
};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = i.baseTileHeight,
s = i.tilemapLayer,
r = 0;
return s && ((e = e || s.scene.cameras.main), (r = s.y + e.scrollY * (1 - s.scrollFactorY)), (n *= s.scaleY)), r + t * n;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
void 0 === e && (e = !0);
var s = n.baseTileWidth,
r = n.tilemapLayer;
return r && ((i = i || r.scene.cameras.main), (t -= r.x + i.scrollX * (1 - r.scrollFactorX)), (s *= r.scaleX)), e ? Math.floor(t / s) : t / s;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
void 0 === e && (e = !0);
var s = n.baseTileHeight,
r = n.tilemapLayer;
return r && ((i = i || r.scene.cameras.main), (t -= r.y + i.scrollY * (1 - r.scrollFactorY)), (s *= r.scaleY)), e ? Math.floor(t / s) : t / s;
};
},
function (t, e, i) {
var u = i(85),
c = i(119),
d = i(252),
f = i(72);
t.exports = function (t, e, i, n, s) {
if ((void 0 === n && (n = !0), !c(e, i, s))) return null;
var r,
o = s.data[i][e],
a = o && o.collides;
t instanceof u
? (null === s.data[i][e] && (s.data[i][e] = new u(s, t.index, e, i, s.tileWidth, s.tileHeight)), s.data[i][e].copy(t))
: ((r = t), null === s.data[i][e] ? (s.data[i][e] = new u(s, r, e, i, s.tileWidth, s.tileHeight)) : (s.data[i][e].index = r));
var h = s.data[i][e],
l = -1 !== s.collideIndexes.indexOf(h.index);
return f(h, l), n && a !== h.collides && d(e, i, s), h;
};
},
function (t, e, i) {
var n = i(29);
t.exports = function (t) {
return "isometric" === (t = t.toLowerCase()) ? n.ISOMETRIC : "staggered" === t ? n.STAGGERED : "hexagonal" === t ? n.HEXAGONAL : n.ORTHOGONAL;
};
},
function (t, e, i) {
var p = i(40),
g = i(120),
v = i(121),
y = i(85);
t.exports = function (t, e, i, n, s) {
for (var r = new g({ tileWidth: i, tileHeight: n }), o = new v({ name: t, tileWidth: i, tileHeight: n, format: p.ARRAY_2D, layers: [r] }), a = [], h = e.length, l = 0, u = 0; u < e.length; u++) {
a[u] = [];
for (var c = e[u], d = 0; d < c.length; d++) {
var f = parseInt(c[d], 10);
isNaN(f) || -1 === f ? (a[u][d] = s ? null : new y(r, -1, d, u, i, n)) : (a[u][d] = new y(r, f, d, u, i, n));
}
0 === l && (l = c.length);
}
return (o.width = r.width = l), (o.height = r.height = h), (o.widthInPixels = r.widthInPixels = l * i), (o.heightInPixels = r.heightInPixels = h * n), (r.data = a), o;
};
},
function (t, e, i) {
function r(t) {
return { x: t.x, y: t.y };
}
var o = i(571),
a = i(261),
h = ["id", "name", "type", "rotation", "properties", "visible", "x", "y", "width", "height"];
t.exports = function (t, e, i) {
void 0 === e && (e = 0), void 0 === i && (i = 0);
var n,
s = o(t, h);
return (
(s.x += e),
(s.y += i),
t.gid
? ((n = a(t.gid)), (s.gid = n.gid), (s.flippedHorizontal = n.flippedHorizontal), (s.flippedVertical = n.flippedVertical), (s.flippedAntiDiagonal = n.flippedAntiDiagonal))
: t.polyline
? (s.polyline = t.polyline.map(r))
: t.polygon
? (s.polygon = t.polygon.map(r))
: t.ellipse
? (s.ellipse = t.ellipse)
: t.text
? (s.text = t.text)
: t.point
? (s.point = !0)
: (s.rectangle = !0),
s
);
};
},
function (t, e) {
t.exports = function (t) {
var e = Boolean(2147483648 & t),
i = Boolean(1073741824 & t),
n = Boolean(536870912 & t);
t &= 536870911;
var s = 0,
r = !1;
return (
e && i && n
? ((s = Math.PI / 2), (r = !0))
: e && i && !n
? ((s = Math.PI), (r = !1))
: e && !i && n
? ((s = Math.PI / 2), (r = !1))
: !e || i || n
? !e && i && n
? ((s = (3 * Math.PI) / 2), (r = !1))
: e || !i || n
? e || i || !n
? e || i || n || ((s = 0), (r = !1))
: ((s = (3 * Math.PI) / 2), (r = !0))
: ((s = Math.PI), (r = !0))
: (r = !(s = 0)),
{ gid: t, flippedHorizontal: e, flippedVertical: i, flippedAntiDiagonal: n, rotation: s, flipped: r }
);
};
},
function (t, e, i) {
var u = i(40),
c = i(121),
d = i(564),
f = i(580);
t.exports = function (t, e, i, n, s, r, o, a) {
void 0 === i && (i = 32), void 0 === n && (n = 32), void 0 === s && (s = 10), void 0 === r && (r = 10), void 0 === a && (a = !1);
var h,
l = null;
return (
Array.isArray(o) ? (l = d(void 0 !== e ? e : "map", u.ARRAY_2D, o, i, n, a)) : void 0 !== e && (h = t.cache.tilemap.get(e)) && (l = d(e, h.format, h.data, i, n, a)),
null === l && (l = new c({ tileWidth: i, tileHeight: n, width: s, height: r })),
new f(t, l)
);
};
},
function (t, e, i) {
var n = i(6);
t.exports = function (t) {
var e = n(t, "targets", null);
return null === e || ("function" == typeof e && (e = e.call()), Array.isArray(e) || (e = [e])), e;
};
},
function (t, e) {
function g(t) {
return !!t.getActive && "function" == typeof t.getActive;
}
function v(t) {
return !!t.getStart && "function" == typeof t.getStart;
}
function y(t) {
return !!t.getEnd && "function" == typeof t.getEnd;
}
var m = function (t, e) {
var i,
n,
s,
r,
o,
a,
h,
l = function (t, e, i) {
return i;
},
u = function (t, e, i) {
return i;
},
c = null,
d = typeof e;
if ("number" == d)
l = function () {
return e;
};
else if ("string" == d) {
var f = e[0],
p = parseFloat(e.substr(2));
switch (f) {
case "+":
l = function (t, e, i) {
return i + p;
};
break;
case "-":
l = function (t, e, i) {
return i - p;
};
break;
case "*":
l = function (t, e, i) {
return i * p;
};
break;
case "/":
l = function (t, e, i) {
return i / p;
};
break;
default:
l = function () {
return parseFloat(e);
};
}
} else
"function" == d
? (l = e)
: "object" == d &&
(v((h = e)) || y(h) || g(h)
? (g(e) && (c = e.getActive), y(e) && (l = e.getEnd), v(e) && (u = e.getStart))
: e.hasOwnProperty("value")
? (a = m(t, e.value))
: ((i = e.hasOwnProperty("to")),
(n = e.hasOwnProperty("from")),
(s = e.hasOwnProperty("start")),
i && (n || s) && ((a = m(t, e.to)), s && ((r = m(t, e.start)), (a.getActive = r.getEnd)), n && ((o = m(t, e.from)), (a.getStart = o.getEnd)))));
return a || { getActive: c, getEnd: l, getStart: u };
};
t.exports = m;
},
function (t, e) {
t.exports = { targets: null, delay: 0, duration: 1e3, ease: "Power0", easeParams: null, hold: 0, repeat: 0, repeatDelay: 0, yoyo: !1, flipX: !1, flipY: !1 };
},
function (t, e, i) {
var n = i(0),
s = i(9),
u = i(267),
r = i(16),
o = i(5),
c = i(100),
a = i(14),
h = new n({
Extends: s,
initialize: function (t, e, i) {
s.call(this),
(this.parent = t),
(this.parentIsTimeline = t.hasOwnProperty("isTimeline")),
(this.data = e),
(this.totalData = e.length),
(this.targets = i),
(this.totalTargets = i.length),
(this.useFrames = !1),
(this.timeScale = 1),
(this.loop = 0),
(this.loopDelay = 0),
(this.loopCounter = 0),
(this.startDelay = 0),
(this.hasStarted = !1),
(this.isSeeking = !1),
(this.completeDelay = 0),
(this.countdown = 0),
(this.offset = 0),
(this.calculatedOffset = 0),
(this.state = c.PENDING_ADD),
(this._pausedState = c.INIT),
(this.paused = !1),
(this.elapsed = 0),
(this.totalElapsed = 0),
(this.duration = 0),
(this.progress = 0),
(this.totalDuration = 0),
(this.totalProgress = 0),
(this.callbacks = { onActive: null, onComplete: null, onLoop: null, onRepeat: null, onStart: null, onStop: null, onUpdate: null, onYoyo: null }),
this.callbackScope;
},
getValue: function (t) {
return void 0 === t && (t = 0), this.data[t].current;
},
setTimeScale: function (t) {
return (this.timeScale = t), this;
},
getTimeScale: function () {
return this.timeScale;
},
isPlaying: function () {
return this.state === c.ACTIVE;
},
isPaused: function () {
return this.state === c.PAUSED;
},
hasTarget: function (t) {
return -1 !== this.targets.indexOf(t);
},
updateTo: function (t, e, i) {
void 0 === i && (i = !1);
for (var n = 0; n < this.totalData; n++) {
var s = this.data[n];
s.key === t && ((s.end = e), i && (s.start = s.current));
}
return this;
},
restart: function () {
return (
(this.elapsed = 0),
(this.progress = 0),
(this.totalElapsed = 0),
(this.totalProgress = 0),
this.state === c.ACTIVE ? this.seek(0) : this.state === c.REMOVED ? (this.seek(0), this.parent.makeActive(this), this) : this.state === c.PENDING_ADD ? this : this.play()
);
},
calcDuration: function () {
for (var t = 0, e = a.MAX_SAFE_INTEGER, i = this.data, n = 0; n < this.totalData; n++) {
var s = i[n];
(s.t1 = s.duration + s.hold),
s.yoyo && (s.t1 += s.duration),
(s.t2 = s.t1 + s.repeatDelay),
(s.totalDuration = s.delay + s.t1),
-1 === s.repeat ? (s.totalDuration += 999999999999 * s.t2) : 0 < s.repeat && (s.totalDuration += s.t2 * s.repeat),
s.totalDuration > t && (t = s.totalDuration),
s.delay < e && (e = s.delay);
}
(this.duration = Math.max(t, 0.001)),
(this.loopCounter = -1 === this.loop ? 999999999999 : this.loop),
0 < this.loopCounter ? (this.totalDuration = this.duration + this.completeDelay + (this.duration + this.loopDelay) * this.loopCounter) : (this.totalDuration = this.duration + this.completeDelay),
(this.startDelay = e);
},
init: function () {
if (this.paused && !this.parentIsTimeline) return (this.state = c.PENDING_ADD), (this._pausedState = c.INIT), !1;
for (var t = this.data, e = this.totalTargets, i = 0; i < this.totalData; i++) {
var n = t[i],
s = n.target,
r = n.gen,
o = n.key,
a = n.index;
(n.delay = r.delay(s, o, 0, a, e, this)),
(n.duration = Math.max(r.duration(s, o, 0, a, e, this), 0.001)),
(n.hold = r.hold(s, o, 0, a, e, this)),
(n.repeat = r.repeat(s, o, 0, a, e, this)),
(n.repeatDelay = r.repeatDelay(s, o, 0, a, e, this));
}
return this.calcDuration(), (this.progress = 0), (this.totalProgress = 0), (this.elapsed = 0), (this.totalElapsed = 0), (this.state = c.INIT), !0;
},
makeActive: function () {
this.parent.makeActive(this), this.dispatchTweenEvent(u.TWEEN_ACTIVE, this.callbacks.onActive);
},
nextState: function () {
0 < this.loopCounter
? ((this.elapsed = 0),
(this.progress = 0),
this.loopCounter--,
this.resetTweenData(!0),
0 < this.loopDelay ? ((this.countdown = this.loopDelay), (this.state = c.LOOP_DELAY)) : ((this.state = c.ACTIVE), this.dispatchTweenEvent(u.TWEEN_LOOP, this.callbacks.onLoop)))
: 0 < this.completeDelay
? ((this.state = c.COMPLETE_DELAY), (this.countdown = this.completeDelay))
: ((this.state = c.PENDING_REMOVE), this.dispatchTweenEvent(u.TWEEN_COMPLETE, this.callbacks.onComplete));
},
pause: function () {
return this.state === c.PAUSED || ((this.paused = !0), (this._pausedState = this.state), (this.state = c.PAUSED)), this;
},
play: function (t) {
void 0 === t && (t = !1);
var e = this.state;
return (
e !== c.INIT || this.parentIsTimeline
? e === c.ACTIVE ||
(e === c.PENDING_ADD && this._pausedState === c.PENDING_ADD) ||
(this.parentIsTimeline || (e !== c.PENDING_REMOVE && e !== c.REMOVED)
? this.parentIsTimeline
? (this.resetTweenData(t), 0 === this.calculatedOffset ? (this.state = c.ACTIVE) : ((this.countdown = this.calculatedOffset), (this.state = c.OFFSET_DELAY)))
: (this.paused ? (this.paused = !1) : (this.resetTweenData(t), (this.state = c.ACTIVE)), this.makeActive())
: (this.seek(0), this.parent.makeActive(this)))
: (this.resetTweenData(!1), (this.state = c.ACTIVE)),
this
);
},
resetTweenData: function (t) {
for (var e = this.data, i = this.totalData, n = this.totalTargets, s = 0; s < i; s++) {
var r = e[s],
o = r.target,
a = r.key,
h = r.index;
(r.progress = 0),
(r.elapsed = 0),
(r.repeatCounter = -1 === r.repeat ? 999999999999 : r.repeat),
t
? ((r.start = r.getStartValue(o, a, r.start, h, n, this)), (r.end = r.getEndValue(o, a, r.end, h, n, this)), (r.current = r.start), (r.state = c.PLAYING_FORWARD))
: (r.state = c.PENDING_RENDER),
0 < r.delay && ((r.elapsed = r.delay), (r.state = c.DELAY)),
r.getActiveValue && (o[a] = r.getActiveValue(r.target, r.key, r.start));
}
},
resume: function () {
return this.state === c.PAUSED ? ((this.paused = !1), (this.state = this._pausedState)) : this.play(), this;
},
seek: function (t, e) {
void 0 === e && (e = 16.6), this.state === c.REMOVED && this.makeActive(), (this.elapsed = 0), (this.progress = 0), (this.totalElapsed = 0), (this.totalProgress = 0);
for (var i = this.data, n = this.totalTargets, s = 0; s < this.totalData; s++) {
var r = i[s],
o = r.target,
a = r.gen,
h = r.key,
l = r.index;
(r.progress = 0),
(r.elapsed = 0),
(r.repeatCounter = -1 === r.repeat ? 999999999999 : r.repeat),
(r.delay = a.delay(o, h, 0, l, n, this)),
(r.duration = Math.max(a.duration(o, h, 0, l, n, this), 0.001)),
(r.hold = a.hold(o, h, 0, l, n, this)),
(r.repeat = a.repeat(o, h, 0, l, n, this)),
(r.repeatDelay = a.repeatDelay(o, h, 0, l, n, this)),
(r.current = r.start),
(r.state = c.PLAYING_FORWARD),
this.updateTweenData(this, r, 0, l, n),
0 < r.delay && ((r.elapsed = r.delay), (r.state = c.DELAY));
}
this.calcDuration();
var u = !1;
for (this.state === c.PAUSED && ((u = !0), (this.state = c.ACTIVE)), this.isSeeking = !0; this.update(0, e), this.totalProgress < t; );
return (this.isSeeking = !1), u && (this.state = c.PAUSED), this;
},
setCallback: function (t, e, i, n) {
return (this.callbacks[t] = { func: e, scope: n, params: i }), this;
},
complete: function (t) {
return (
void 0 === t && (t = 0), t ? ((this.state = c.COMPLETE_DELAY), (this.countdown = t)) : ((this.state = c.PENDING_REMOVE), this.dispatchTweenEvent(u.TWEEN_COMPLETE, this.callbacks.onComplete)), this
);
},
remove: function () {
return this.parent.remove(this), this;
},
stop: function (t) {
return (
this.state === c.ACTIVE && void 0 !== t && this.seek(t),
this.state !== c.REMOVED &&
((this.state !== c.PAUSED && this.state !== c.PENDING_ADD) ||
(this.parentIsTimeline ? (this.parent.manager._destroy.push(this), this.parent.manager._toProcess++) : (this.parent._destroy.push(this), this.parent._toProcess++)),
this.dispatchTweenEvent(u.TWEEN_STOP, this.callbacks.onStop),
this.removeAllListeners(),
(this.state = c.PENDING_REMOVE)),
this
);
},
update: function (t, e) {
if (this.state === c.PAUSED) return !1;
switch (
(this.useFrames && (e = +this.parent.timeScale),
(e *= this.timeScale),
(this.elapsed += e),
(this.progress = Math.min(this.elapsed / this.duration, 1)),
(this.totalElapsed += e),
(this.totalProgress = Math.min(this.totalElapsed / this.totalDuration, 1)),
this.state)
) {
case c.ACTIVE:
this.hasStarted || this.isSeeking || ((this.startDelay -= e), this.startDelay <= 0 && ((this.hasStarted = !0), this.dispatchTweenEvent(u.TWEEN_START, this.callbacks.onStart)));
for (var i = !1, n = 0; n < this.totalData; n++) {
var s = this.data[n];
this.updateTweenData(this, s, e) && (i = !0);
}
i || this.nextState();
break;
case c.LOOP_DELAY:
(this.countdown -= e), this.countdown <= 0 && ((this.state = c.ACTIVE), this.dispatchTweenEvent(u.TWEEN_LOOP, this.callbacks.onLoop));
break;
case c.OFFSET_DELAY:
(this.countdown -= e), this.countdown <= 0 && (this.state = c.ACTIVE);
break;
case c.COMPLETE_DELAY:
(this.countdown -= e), this.countdown <= 0 && ((this.state = c.PENDING_REMOVE), this.dispatchTweenEvent(u.TWEEN_COMPLETE, this.callbacks.onComplete));
}
return this.state === c.PENDING_REMOVE;
},
dispatchTweenDataEvent: function (t, e, i) {
this.isSeeking || (this.emit(t, this, i.key, i.target, i.current, i.previous), e && ((e.params[1] = i.target), e.func.apply(e.scope, e.params)));
},
dispatchTweenEvent: function (t, e) {
this.isSeeking || (this.emit(t, this, this.targets), e && ((e.params[1] = this.targets), e.func.apply(e.scope, e.params)));
},
setStateFromEnd: function (t, e, i) {
return e.yoyo
? ((e.elapsed = i),
(e.progress = i / e.duration),
e.flipX && e.target.toggleFlipX(),
e.flipY && e.target.toggleFlipY(),
this.dispatchTweenDataEvent(u.TWEEN_YOYO, t.callbacks.onYoyo, e),
(e.start = e.getStartValue(e.target, e.key, e.start, e.index, t.totalTargets, t)),
c.PLAYING_BACKWARD)
: 0 < e.repeatCounter
? (e.repeatCounter--,
(e.elapsed = i),
(e.progress = i / e.duration),
e.flipX && e.target.toggleFlipX(),
e.flipY && e.target.toggleFlipY(),
(e.start = e.getStartValue(e.target, e.key, e.start, e.index, t.totalTargets, t)),
(e.end = e.getEndValue(e.target, e.key, e.start, e.index, t.totalTargets, t)),
0 < e.repeatDelay
? ((e.elapsed = e.repeatDelay - i), (e.current = e.start), (e.target[e.key] = e.current), c.REPEAT_DELAY)
: (this.dispatchTweenDataEvent(u.TWEEN_REPEAT, t.callbacks.onRepeat, e), c.PLAYING_FORWARD))
: c.COMPLETE;
},
setStateFromStart: function (t, e, i) {
return 0 < e.repeatCounter
? (e.repeatCounter--,
(e.elapsed = i),
(e.progress = i / e.duration),
e.flipX && e.target.toggleFlipX(),
e.flipY && e.target.toggleFlipY(),
(e.end = e.getEndValue(e.target, e.key, e.start, e.index, t.totalTargets, t)),
0 < e.repeatDelay
? ((e.elapsed = e.repeatDelay - i), (e.current = e.start), (e.target[e.key] = e.current), c.REPEAT_DELAY)
: (this.dispatchTweenDataEvent(u.TWEEN_REPEAT, t.callbacks.onRepeat, e), c.PLAYING_FORWARD))
: c.COMPLETE;
},
updateTweenData: function (t, e, i) {
var n = e.target;
switch (e.state) {
case c.PLAYING_FORWARD:
case c.PLAYING_BACKWARD:
if (!n) {
e.state = c.COMPLETE;
break;
}
var s = e.elapsed,
r = e.duration,
o = 0;
r < (s += i) && ((o = s - r), (s = r));
var a,
h = e.state === c.PLAYING_FORWARD,
l = s / r;
(e.elapsed = s),
(e.progress = l),
(e.previous = e.current),
1 == l
? h
? ((e.current = e.end), (n[e.key] = e.end), 0 < e.hold ? ((e.elapsed = e.hold - o), (e.state = c.HOLD_DELAY)) : (e.state = this.setStateFromEnd(t, e, o)))
: ((e.current = e.start), (n[e.key] = e.start), (e.state = this.setStateFromStart(t, e, o)))
: ((a = h ? e.ease(l) : e.ease(1 - l)), (e.current = e.start + (e.end - e.start) * a), (n[e.key] = e.current)),
this.dispatchTweenDataEvent(u.TWEEN_UPDATE, t.callbacks.onUpdate, e);
break;
case c.DELAY:
(e.elapsed -= i), e.elapsed <= 0 && ((e.elapsed = Math.abs(e.elapsed)), (e.state = c.PENDING_RENDER));
break;
case c.REPEAT_DELAY:
(e.elapsed -= i), e.elapsed <= 0 && ((e.elapsed = Math.abs(e.elapsed)), (e.state = c.PLAYING_FORWARD), this.dispatchTweenDataEvent(u.TWEEN_REPEAT, t.callbacks.onRepeat, e));
break;
case c.HOLD_DELAY:
(e.elapsed -= i), e.elapsed <= 0 && (e.state = this.setStateFromEnd(t, e, Math.abs(e.elapsed)));
break;
case c.PENDING_RENDER:
n
? ((e.start = e.getStartValue(n, e.key, n[e.key], e.index, t.totalTargets, t)),
(e.end = e.getEndValue(n, e.key, e.start, e.index, t.totalTargets, t)),
(e.current = e.start),
(n[e.key] = e.start),
(e.state = c.PLAYING_FORWARD))
: (e.state = c.COMPLETE);
}
return e.state !== c.COMPLETE;
},
});
(h.TYPES = ["onActive", "onComplete", "onLoop", "onRepeat", "onStart", "onStop", "onUpdate", "onYoyo"]),
o.register("tween", function (t) {
return this.scene.sys.tweens.add(t);
}),
r.register("tween", function (t) {
return this.scene.sys.tweens.create(t);
}),
(t.exports = h);
},
function (t, e, i) {
t.exports = {
TIMELINE_COMPLETE: i(1466),
TIMELINE_LOOP: i(1467),
TIMELINE_PAUSE: i(1468),
TIMELINE_RESUME: i(1469),
TIMELINE_START: i(1470),
TIMELINE_UPDATE: i(1471),
TWEEN_ACTIVE: i(1472),
TWEEN_COMPLETE: i(1473),
TWEEN_LOOP: i(1474),
TWEEN_REPEAT: i(1475),
TWEEN_START: i(1476),
TWEEN_STOP: i(1477),
TWEEN_UPDATE: i(1478),
TWEEN_YOYO: i(1479),
};
},
function (t, e) {
t.exports = function (t, e, i, n, s, r, o, a, h, l, u, c, d, f, p) {
return {
target: t,
index: e,
key: i,
getActiveValue: r,
getEndValue: n,
getStartValue: s,
ease: o,
duration: 0,
totalDuration: 0,
delay: 0,
yoyo: l,
hold: 0,
repeat: 0,
repeatDelay: 0,
flipX: f,
flipY: p,
progress: 0,
elapsed: 0,
repeatCounter: 0,
start: 0,
previous: 0,
current: 0,
end: 0,
t1: 0,
t2: 0,
gen: { delay: a, duration: h, hold: u, repeat: c, repeatDelay: d },
state: 0,
};
};
},
function (t, e, i) {
var n = i(68);
t.exports = function (t) {
return n(t, -Math.PI, Math.PI);
};
},
function (t, e, i) {
var n = i(68);
t.exports = function (t) {
return n(t, -180, 180);
};
},
function (t, e, i) {
var n = {};
t.exports = n;
var r = i(83),
o = i(32);
(n.fromVertices = function (t) {
for (var e = {}, i = 0; i < t.length; i++) {
var n = (i + 1) % t.length,
s = r.normalise({ x: t[n].y - t[i].y, y: t[i].x - t[n].x });
e[(0 === s.y ? 1 / 0 : s.x / s.y).toFixed(3).toString()] = s;
}
return o.values(e);
}),
(n.rotate = function (t, e) {
if (0 !== e)
for (var i = Math.cos(e), n = Math.sin(e), s = 0; s < t.length; s++) {
var r = t[s],
o = r.x * i - r.y * n;
(r.y = r.x * n + r.y * i), (r.x = o);
}
});
},
function (t, e, i) {
t.exports = {
AFTER_ADD: i(1504),
AFTER_REMOVE: i(1505),
AFTER_UPDATE: i(1506),
BEFORE_ADD: i(1507),
BEFORE_REMOVE: i(1508),
BEFORE_UPDATE: i(1509),
COLLISION_ACTIVE: i(1510),
COLLISION_END: i(1511),
COLLISION_START: i(1512),
DRAG_END: i(1513),
DRAG: i(1514),
DRAG_START: i(1515),
PAUSE: i(1516),
RESUME: i(1517),
SLEEP_END: i(1518),
SLEEP_START: i(1519),
};
},
function (t, e, i) {
var g = {};
t.exports = g;
var v = i(274),
y = i(250),
m = i(84);
(g.collisions = function (t, e) {
for (var i = [], n = e.pairs.table, s = e.metrics, r = 0; r < t.length; r++) {
var o = t[r][0],
a = t[r][1];
if (((!o.isStatic && !o.isSleeping) || (!a.isStatic && !a.isSleeping)) && g.canCollide(o.collisionFilter, a.collisionFilter) && ((s.midphaseTests += 1), m.overlaps(o.bounds, a.bounds)))
for (var h = 1 < o.parts.length ? 1 : 0; h < o.parts.length; h++)
for (var l = o.parts[h], u = 1 < a.parts.length ? 1 : 0; u < a.parts.length; u++) {
var c,
d,
f,
p = a.parts[u];
((l === o && p === a) || m.overlaps(l.bounds, p.bounds)) &&
((d = (c = n[y.id(l, p)]) && c.isActive ? c.collision : null),
(f = v.collides(l, p, d)),
(s.narrowphaseTests += 1),
f.reused && (s.narrowReuseCount += 1),
f.collided && (i.push(f), (s.narrowDetections += 1)));
}
}
return i;
}),
(g.canCollide = function (t, e) {
return t.group === e.group && 0 !== t.group ? 0 < t.group : 0 != (t.mask & e.category) && 0 != (e.mask & t.category);
});
},
function (t, e, i) {
var y = {};
t.exports = y;
var m = i(64),
x = i(83);
(y.collides = function (t, e, i) {
var n,
s,
r,
o,
a,
h,
l = !1;
if (
((h = i
? ((r = t.parent), (o = e.parent), (a = r.speed * r.speed + r.angularSpeed * r.angularSpeed + o.speed * o.speed + o.angularSpeed * o.angularSpeed), (l = i && i.collided && a < 0.2), i)
: { collided: !1, bodyA: t, bodyB: e }),
i && l)
) {
var u = h.axisBody,
c = u === t ? e : t,
d = [u.axes[i.axisNumber]],
f = y._overlapAxes(u.vertices, c.vertices, d);
if (((h.reused = !0), f.overlap <= 0)) return (h.collided = !1), h;
} else {
if ((n = y._overlapAxes(t.vertices, e.vertices, t.axes)).overlap <= 0) return (h.collided = !1), h;
if ((s = y._overlapAxes(e.vertices, t.vertices, e.axes)).overlap <= 0) return (h.collided = !1), h;
n.overlap < s.overlap ? ((f = n), (h.axisBody = t)) : ((f = s), (h.axisBody = e)), (h.axisNumber = f.axisNumber);
}
(h.bodyA = t.id < e.id ? t : e),
(h.bodyB = t.id < e.id ? e : t),
(h.collided = !0),
(h.depth = f.overlap),
(h.parentA = h.bodyA.parent),
(h.parentB = h.bodyB.parent),
(t = h.bodyA),
(e = h.bodyB),
x.dot(f.axis, x.sub(e.position, t.position)) < 0 ? (h.normal = { x: f.axis.x, y: f.axis.y }) : (h.normal = { x: -f.axis.x, y: -f.axis.y }),
(h.tangent = x.perp(h.normal)),
(h.penetration = h.penetration || {}),
(h.penetration.x = h.normal.x * h.depth),
(h.penetration.y = h.normal.y * h.depth);
var p,
g = y._findSupports(t, e, h.normal),
v = [];
return (
m.contains(t.vertices, g[0]) && v.push(g[0]),
m.contains(t.vertices, g[1]) && v.push(g[1]),
v.length < 2 && ((p = y._findSupports(e, t, x.neg(h.normal))), m.contains(e.vertices, p[0]) && v.push(p[0]), v.length < 2 && m.contains(e.vertices, p[1]) && v.push(p[1])),
v.length < 1 && (v = [g[0]]),
(h.supports = v),
h
);
}),
(y._overlapAxes = function (t, e, i) {
for (var n, s, r = x._temp[0], o = x._temp[1], a = { overlap: Number.MAX_VALUE }, h = 0; h < i.length; h++) {
if (((s = i[h]), y._projectToAxis(r, t, s), y._projectToAxis(o, e, s), (n = Math.min(r.max - o.min, o.max - r.min)) <= 0)) return (a.overlap = n), a;
n < a.overlap && ((a.overlap = n), (a.axis = s), (a.axisNumber = h));
}
return a;
}),
(y._projectToAxis = function (t, e, i) {
for (var n = x.dot(e[0], i), s = n, r = 1; r < e.length; r += 1) {
var o = x.dot(e[r], i);
s < o ? (s = o) : o < n && (n = o);
}
(t.min = n), (t.max = s);
}),
(y._findSupports = function (t, e, i) {
for (var n, s, r, o = Number.MAX_VALUE, a = x._temp[0], h = e.vertices, l = t.position, u = 0; u < h.length; u++)
(c = h[u]), (a.x = c.x - l.x), (a.y = c.y - l.y), (n = -x.dot(i, a)) < o && ((o = n), (s = c));
var c = h[0 <= s.index - 1 ? s.index - 1 : h.length - 1];
return (a.x = c.x - l.x), (a.y = c.y - l.y), (o = -x.dot(i, a)), (r = c), (c = h[(s.index + 1) % h.length]), (a.x = c.x - l.x), (a.y = c.y - l.y), (n = -x.dot(i, a)) < o && (r = c), [s, r];
});
},
function (t, e, i) {
t.exports = {
AlignTo: i(601),
Angle: i(602),
Call: i(603),
GetFirst: i(604),
GetLast: i(605),
GridAlign: i(606),
IncAlpha: i(678),
IncX: i(679),
IncXY: i(680),
IncY: i(681),
PlaceOnCircle: i(682),
PlaceOnEllipse: i(683),
PlaceOnLine: i(684),
PlaceOnRectangle: i(685),
PlaceOnTriangle: i(686),
PlayAnimation: i(687),
PropertyValueInc: i(46),
PropertyValueSet: i(27),
RandomCircle: i(688),
RandomEllipse: i(689),
RandomLine: i(690),
RandomRectangle: i(691),
RandomTriangle: i(692),
Rotate: i(693),
RotateAround: i(694),
RotateAroundDistance: i(695),
ScaleX: i(696),
ScaleXY: i(697),
ScaleY: i(698),
SetAlpha: i(699),
SetBlendMode: i(700),
SetDepth: i(701),
SetHitArea: i(702),
SetOrigin: i(703),
SetRotation: i(704),
SetScale: i(705),
SetScaleX: i(706),
SetScaleY: i(707),
SetScrollFactor: i(708),
SetScrollFactorX: i(709),
SetScrollFactorY: i(710),
SetTint: i(711),
SetVisible: i(712),
SetX: i(713),
SetXY: i(714),
SetY: i(715),
ShiftPosition: i(716),
Shuffle: i(717),
SmootherStep: i(718),
SmoothStep: i(719),
Spread: i(720),
ToggleVisible: i(721),
WrapInRectangle: i(722),
};
},
function (t, e, i) {
var n = i(123),
r = [];
(r[n.BOTTOM_CENTER] = i(277)),
(r[n.BOTTOM_LEFT] = i(278)),
(r[n.BOTTOM_RIGHT] = i(279)),
(r[n.LEFT_BOTTOM] = i(280)),
(r[n.LEFT_CENTER] = i(281)),
(r[n.LEFT_TOP] = i(282)),
(r[n.RIGHT_BOTTOM] = i(283)),
(r[n.RIGHT_CENTER] = i(284)),
(r[n.RIGHT_TOP] = i(285)),
(r[n.TOP_CENTER] = i(286)),
(r[n.TOP_LEFT] = i(287)),
(r[n.TOP_RIGHT] = i(288)),
(t.exports = function (t, e, i, n, s) {
return r[i](t, e, n, s);
});
},
function (t, e, i) {
var s = i(42),
r = i(87),
o = i(88),
a = i(52);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), o(t, r(e) + i), a(t, s(e) + n), t;
};
},
function (t, e, i) {
var s = i(42),
r = i(43),
o = i(53),
a = i(52);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), o(t, r(e) - i), a(t, s(e) + n), t;
};
},
function (t, e, i) {
var s = i(42),
r = i(44),
o = i(54),
a = i(52);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), o(t, r(e) + i), a(t, s(e) + n), t;
};
},
function (t, e, i) {
var s = i(42),
r = i(43),
o = i(55),
a = i(54);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), a(t, r(e) - i), o(t, s(e) + n), t;
};
},
function (t, e, i) {
var s = i(89),
r = i(43),
o = i(90),
a = i(54);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), a(t, r(e) - i), o(t, s(e) + n), t;
};
},
function (t, e, i) {
var s = i(43),
r = i(45),
o = i(54),
a = i(52);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), o(t, s(e) - i), a(t, r(e) - n), t;
};
},
function (t, e, i) {
var s = i(42),
r = i(44),
o = i(55),
a = i(53);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), a(t, r(e) + i), o(t, s(e) + n), t;
};
},
function (t, e, i) {
var s = i(89),
r = i(44),
o = i(90),
a = i(53);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), a(t, r(e) + i), o(t, s(e) + n), t;
};
},
function (t, e, i) {
var s = i(44),
r = i(45),
o = i(53),
a = i(52);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), o(t, s(e) + i), a(t, r(e) - n), t;
};
},
function (t, e, i) {
var s = i(87),
r = i(45),
o = i(55),
a = i(88);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), a(t, s(e) + i), o(t, r(e) - n), t;
};
},
function (t, e, i) {
var s = i(43),
r = i(45),
o = i(55),
a = i(53);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), a(t, s(e) - i), o(t, r(e) - n), t;
};
},
function (t, e, i) {
var s = i(44),
r = i(45),
o = i(55),
a = i(54);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), a(t, s(e) + i), o(t, r(e) - n), t;
};
},
function (t, e, i) {
var n = i(123),
r = [];
(r[n.BOTTOM_CENTER] = i(290)),
(r[n.BOTTOM_LEFT] = i(291)),
(r[n.BOTTOM_RIGHT] = i(292)),
(r[n.CENTER] = i(293)),
(r[n.LEFT_CENTER] = i(295)),
(r[n.RIGHT_CENTER] = i(296)),
(r[n.TOP_CENTER] = i(297)),
(r[n.TOP_LEFT] = i(298)),
(r[n.TOP_RIGHT] = i(299)),
(r[n.LEFT_BOTTOM] = r[n.BOTTOM_LEFT]),
(r[n.LEFT_TOP] = r[n.TOP_LEFT]),
(r[n.RIGHT_BOTTOM] = r[n.BOTTOM_RIGHT]),
(r[n.RIGHT_TOP] = r[n.TOP_RIGHT]),
(t.exports = function (t, e, i, n, s) {
return r[i](t, e, n, s);
});
},
function (t, e, i) {
var s = i(42),
r = i(87),
o = i(55),
a = i(88);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), a(t, r(e) + i), o(t, s(e) + n), t;
};
},
function (t, e, i) {
var s = i(42),
r = i(43),
o = i(55),
a = i(53);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), a(t, r(e) - i), o(t, s(e) + n), t;
};
},
function (t, e, i) {
var s = i(42),
r = i(44),
o = i(55),
a = i(54);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), a(t, r(e) + i), o(t, s(e) + n), t;
};
},
function (t, e, i) {
var s = i(294),
r = i(87),
o = i(89);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), s(t, r(e) + i, o(e) + n), t;
};
},
function (t, e, i) {
var n = i(88),
s = i(90);
t.exports = function (t, e, i) {
return n(t, e), s(t, i);
};
},
function (t, e, i) {
var s = i(89),
r = i(43),
o = i(90),
a = i(53);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), a(t, r(e) - i), o(t, s(e) + n), t;
};
},
function (t, e, i) {
var s = i(89),
r = i(44),
o = i(90),
a = i(54);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), a(t, r(e) + i), o(t, s(e) + n), t;
};
},
function (t, e, i) {
var s = i(87),
r = i(45),
o = i(88),
a = i(52);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), o(t, s(e) + i), a(t, r(e) - n), t;
};
},
function (t, e, i) {
var s = i(43),
r = i(45),
o = i(53),
a = i(52);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), o(t, s(e) - i), a(t, r(e) - n), t;
};
},
function (t, e, i) {
var s = i(44),
r = i(45),
o = i(54),
a = i(52);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = 0), o(t, s(e) + i), a(t, r(e) - n), t;
};
},
function (t, e, i) {
var s = i(169),
r = i(98),
o = i(14),
a = i(4);
t.exports = function (t, e, i) {
void 0 === i && (i = new a());
var n = r(e, 0, o.PI2);
return s(t, n, i);
};
},
function (t, e, i) {
var o = i(302),
a = i(169),
h = i(98),
l = i(14);
t.exports = function (t, e, i, n) {
void 0 === n && (n = []), !e && 0 < i && (e = o(t) / i);
for (var s = 0; s < e; s++) {
var r = h(s / e, 0, l.PI2);
n.push(a(t, r));
}
return n;
};
},
function (t, e) {
t.exports = function (t) {
return Math.PI * t.radius * 2;
};
},
function (t, e, i) {
var n = i(18),
s = {
_alpha: 1,
clearAlpha: function () {
return this.setAlpha(1);
},
setAlpha: function (t) {
return void 0 === t && (t = 1), (this.alpha = t), this;
},
alpha: {
get: function () {
return this._alpha;
},
set: function (t) {
var e = n(t, 0, 1);
0 === (this._alpha = e) ? (this.renderFlags &= -3) : (this.renderFlags |= 2);
},
},
};
t.exports = s;
},
function (t, e, i) {
var n = i(35),
s = {
_blendMode: n.NORMAL,
blendMode: {
get: function () {
return this._blendMode;
},
set: function (t) {
"string" == typeof t && (t = n[t]), -1 <= (t |= 0) && (this._blendMode = t);
},
},
setBlendMode: function (t) {
return (this.blendMode = t), this;
},
};
t.exports = s;
},
function (t, e) {
t.exports = {
_depth: 0,
depth: {
get: function () {
return this._depth;
},
set: function (t) {
this.displayList && this.displayList.queueDepthSort(), (this._depth = t);
},
},
setDepth: function (t) {
return void 0 === t && (t = 0), (this.depth = t), this;
},
};
},
function (t, e, i) {
var o = i(171),
a = i(130);
t.exports = function (t, e, i, n) {
void 0 === n && (n = []), !e && 0 < i && (e = a(t) / i);
for (var s = 0; s < e; s++) {
var r = s / e;
n.push(o(t, r));
}
return n;
};
},
function (t, e, i) {
var n = i(4);
t.exports = function (t, e, i) {
return void 0 === i && (i = new n()), (i.x = t.x1 + (t.x2 - t.x1) * e), (i.y = t.y1 + (t.y2 - t.y1) * e), i;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = Math.cos(n),
r = Math.sin(n),
o = t.x - e,
a = t.y - i;
return (t.x = o * s - a * r + e), (t.y = o * r + a * s + i), t;
};
},
function (t, e, i) {
var n = i(310),
s = i(311),
r = {
mask: null,
setMask: function (t) {
return (this.mask = t), this;
},
clearMask: function (t) {
return void 0 === t && (t = !1), t && this.mask && this.mask.destroy(), (this.mask = null), this;
},
createBitmapMask: function (t) {
return void 0 === t && (this.texture || this.shader) && (t = this), new n(this.scene, t);
},
createGeometryMask: function (t) {
return void 0 === t && "Graphics" === this.type && (t = this), new s(this.scene, t);
},
};
t.exports = r;
},
function (t, e, i) {
var n = i(0),
s = i(22),
r = i(91),
o = new n({
initialize: function (t, e) {
var i = t.sys.renderer;
(this.renderer = i),
(this.bitmapMask = e),
(this.maskTexture = null),
(this.mainTexture = null),
(this.dirty = !0),
(this.mainFramebuffer = null),
(this.maskFramebuffer = null),
(this.invertAlpha = !1),
(this.isStencil = !1),
this.createMask(),
t.sys.game.events.on(s.CONTEXT_RESTORED, this.createMask, this),
i && i.on(r.RESIZE, this.createMask, this);
},
createMask: function () {
var t,
e,
i,
n,
s,
r,
o = this.renderer;
o &&
o.gl &&
(this.mainTexture && this.clearMask(),
(t = o.width),
(e = o.height),
(i = 0 == (t & (t - 1)) && 0 == (e & (e - 1))),
(n = o.gl),
(s = i ? n.REPEAT : n.CLAMP_TO_EDGE),
(r = n.LINEAR),
(this.mainTexture = o.createTexture2D(0, r, r, s, s, n.RGBA, null, t, e)),
(this.maskTexture = o.createTexture2D(0, r, r, s, s, n.RGBA, null, t, e)),
(this.mainFramebuffer = o.createFramebuffer(t, e, this.mainTexture, !0)),
(this.maskFramebuffer = o.createFramebuffer(t, e, this.maskTexture, !0)));
},
clearMask: function () {
var t = this.renderer;
t &&
t.gl &&
this.mainTexture &&
(t.deleteTexture(this.mainTexture),
t.deleteTexture(this.maskTexture),
t.deleteFramebuffer(this.mainFramebuffer),
t.deleteFramebuffer(this.maskFramebuffer),
(this.mainTexture = null),
(this.maskTexture = null),
(this.mainFramebuffer = null),
(this.maskFramebuffer = null));
},
setBitmap: function (t) {
this.bitmapMask = t;
},
preRenderWebGL: function (t, e, i) {
t.pipelines.BITMAPMASK_PIPELINE.beginMask(this, e, i);
},
postRenderWebGL: function (t, e) {
t.pipelines.BITMAPMASK_PIPELINE.endMask(this, e);
},
preRenderCanvas: function () {},
postRenderCanvas: function () {},
destroy: function () {
this.clearMask(), this.renderer && this.renderer.off(r.RESIZE, this.createMask, this), (this.bitmapMask = null), (this.prevFramebuffer = null), (this.renderer = null);
},
});
t.exports = o;
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e) {
(this.geometryMask = e), (this.invertAlpha = !1), (this.isStencil = !0), (this.level = 0);
},
setShape: function (t) {
return (this.geometryMask = t), this;
},
setInvertAlpha: function (t) {
return void 0 === t && (t = !0), (this.invertAlpha = t), this;
},
preRenderWebGL: function (t, e, i) {
var n = t.gl;
t.flush(),
0 === t.maskStack.length && (n.enable(n.STENCIL_TEST), n.clear(n.STENCIL_BUFFER_BIT), (t.maskCount = 0)),
t.currentCameraMask.mask !== this && (t.currentMask.mask = this),
t.maskStack.push({ mask: this, camera: i }),
this.applyStencil(t, i, !0),
t.maskCount++;
},
applyStencil: function (t, e, i) {
var n = t.gl,
s = this.geometryMask,
r = t.maskCount;
n.colorMask(!1, !1, !1, !1),
i ? (n.stencilFunc(n.EQUAL, r, 255), n.stencilOp(n.KEEP, n.KEEP, n.INCR)) : (n.stencilFunc(n.EQUAL, r + 1, 255), n.stencilOp(n.KEEP, n.KEEP, n.DECR)),
s.renderWebGL(t, s, e),
t.flush(),
n.colorMask(!0, !0, !0, !0),
n.stencilOp(n.KEEP, n.KEEP, n.KEEP),
i ? (this.invertAlpha ? n.stencilFunc(n.NOTEQUAL, r + 1, 255) : n.stencilFunc(n.EQUAL, r + 1, 255)) : this.invertAlpha ? n.stencilFunc(n.NOTEQUAL, r, 255) : n.stencilFunc(n.EQUAL, r, 255);
},
postRenderWebGL: function (t) {
var e = t.gl;
t.maskStack.pop(), t.maskCount--, t.flush();
var i,
n = t.currentMask;
0 === t.maskStack.length
? ((n.mask = null), e.disable(e.STENCIL_TEST))
: ((i = t.maskStack[t.maskStack.length - 1]).mask.applyStencil(t, i.camera, !1), t.currentCameraMask.mask !== i.mask ? ((n.mask = i.mask), (n.camera = i.camera)) : (n.mask = null));
},
preRenderCanvas: function (t, e, i) {
var n = this.geometryMask;
t.currentContext.save(), n.renderCanvas(t, n, i, null, null, !0), t.currentContext.clip();
},
postRenderCanvas: function (t) {
t.currentContext.restore();
},
destroy: function () {
this.geometryMask = null;
},
});
t.exports = n;
},
function (t, e) {
t.exports = {
scrollFactorX: 1,
scrollFactorY: 1,
setScrollFactor: function (t, e) {
return void 0 === e && (e = t), (this.scrollFactorX = t), (this.scrollFactorY = e), this;
},
};
},
function (t, e, i) {
var n = i(14),
s = i(25),
h = i(177),
r = i(269),
o = i(270),
l = i(3),
a = {
_scaleX: 1,
_scaleY: 1,
_rotation: 0,
x: 0,
y: 0,
z: 0,
w: 0,
scale: {
get: function () {
return (this._scaleX + this._scaleY) / 2;
},
set: function (t) {
(this._scaleX = t), 0 === (this._scaleY = t) ? (this.renderFlags &= -5) : (this.renderFlags |= 4);
},
},
scaleX: {
get: function () {
return this._scaleX;
},
set: function (t) {
0 === (this._scaleX = t) ? (this.renderFlags &= -5) : (this.renderFlags |= 4);
},
},
scaleY: {
get: function () {
return this._scaleY;
},
set: function (t) {
0 === (this._scaleY = t) ? (this.renderFlags &= -5) : (this.renderFlags |= 4);
},
},
angle: {
get: function () {
return o(this._rotation * n.RAD_TO_DEG);
},
set: function (t) {
this.rotation = o(t) * n.DEG_TO_RAD;
},
},
rotation: {
get: function () {
return this._rotation;
},
set: function (t) {
this._rotation = r(t);
},
},
setPosition: function (t, e, i, n) {
return void 0 === t && (t = 0), void 0 === e && (e = t), void 0 === i && (i = 0), void 0 === n && (n = 0), (this.x = t), (this.y = e), (this.z = i), (this.w = n), this;
},
copyPosition: function (t) {
return void 0 !== t.x && (this.x = t.x), void 0 !== t.y && (this.y = t.y), void 0 !== t.z && (this.z = t.z), void 0 !== t.w && (this.w = t.w), this;
},
setRandomPosition: function (t, e, i, n) {
return (
void 0 === t && (t = 0),
void 0 === e && (e = 0),
void 0 === i && (i = this.scene.sys.scale.width),
void 0 === n && (n = this.scene.sys.scale.height),
(this.x = t + Math.random() * i),
(this.y = e + Math.random() * n),
this
);
},
setRotation: function (t) {
return void 0 === t && (t = 0), (this.rotation = t), this;
},
setAngle: function (t) {
return void 0 === t && (t = 0), (this.angle = t), this;
},
setScale: function (t, e) {
return void 0 === t && (t = 1), void 0 === e && (e = t), (this.scaleX = t), (this.scaleY = e), this;
},
setX: function (t) {
return void 0 === t && (t = 0), (this.x = t), this;
},
setY: function (t) {
return void 0 === t && (t = 0), (this.y = t), this;
},
setZ: function (t) {
return void 0 === t && (t = 0), (this.z = t), this;
},
setW: function (t) {
return void 0 === t && (t = 0), (this.w = t), this;
},
getLocalTransformMatrix: function (t) {
return void 0 === t && (t = new s()), t.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY);
},
getWorldTransformMatrix: function (t, e) {
void 0 === t && (t = new s()), void 0 === e && (e = new s());
var i = this.parentContainer;
if (!i) return this.getLocalTransformMatrix(t);
for (t.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY); i; ) e.applyITRS(i.x, i.y, i._rotation, i._scaleX, i._scaleY), e.multiply(t, t), (i = i.parentContainer);
return t;
},
getLocalPoint: function (t, e, i, n) {
i = i || new l();
var s = (n = n || this.scene.sys.cameras.main).scrollX,
r = n.scrollY,
o = t + s * this.scrollFactorX - s,
a = e + r * this.scrollFactorY - r;
return (
this.parentContainer ? this.getWorldTransformMatrix().applyInverse(o, a, i) : h(o, a, this.x, this.y, this.rotation, this.scaleX, this.scaleY, i),
this._originComponent && ((i.x += this._displayOriginX), (i.y += this._displayOriginY)),
i
);
},
getParentRotation: function () {
for (var t = 0, e = this.parentContainer; e; ) (t += e.rotation), (e = e.parentContainer);
return t;
},
};
t.exports = a;
},
function (t, e) {
t.exports = {
_visible: !0,
visible: {
get: function () {
return this._visible;
},
set: function (t) {
t ? ((this._visible = !0), (this.renderFlags |= 1)) : ((this._visible = !1), (this.renderFlags &= -2));
},
},
setVisible: function (t) {
return (this.visible = t), this;
},
};
},
function (t, e, i) {
t.exports = { CHANGE_DATA: i(638), CHANGE_DATA_KEY: i(639), DESTROY: i(640), REMOVE_DATA: i(641), SET_DATA: i(642) };
},
function (t, e, i) {
var h = i(130),
l = i(4);
t.exports = function (t, e, i, n) {
if ((void 0 === n && (n = []), !e && !i)) return n;
e ? (i = Math.round(h(t) / e)) : (e = h(t) / i);
for (var s = t.x, r = t.y, o = 0, a = 0; a < i; a++)
switch ((n.push(new l(s, r)), o)) {
case 0:
(s += e) >= t.right && ((o = 1), (r += s - t.right), (s = t.right));
break;
case 1:
(r += e) >= t.bottom && ((o = 2), (s -= r - t.bottom), (r = t.bottom));
break;
case 2:
(s -= e) <= t.left && ((o = 3), (r -= t.left - s), (s = t.left));
break;
case 3:
(r -= e) <= t.top && ((o = 0), (r = t.top));
}
return n;
};
},
function (t, e) {
t.exports = function (t, e, i) {
void 0 === e && (e = 1), void 0 === i && (i = []);
var n = Math.round(t.x1),
s = Math.round(t.y1),
r = Math.round(t.x2),
o = Math.round(t.y2),
a = Math.abs(r - n),
h = Math.abs(o - s),
l = n < r ? 1 : -1,
u = s < o ? 1 : -1,
c = a - h;
i.push({ x: n, y: s });
for (var d = 1; n !== r || s !== o; ) {
var f = c << 1;
-h < f && ((c -= h), (n += l)), f < a && ((c += a), (s += u)), d % e == 0 && i.push({ x: n, y: s }), d++;
}
return i;
};
},
function (t, e) {
t.exports = function (t, e, i) {
if (!e.length) return NaN;
if (1 === e.length) return e[0];
var n,
s,
r = 1;
if (i) {
if (t < e[0][i]) return e[0];
for (; e[r][i] < t; ) r++;
} else for (; e[r] < t; ) r++;
return r > e.length && (r = e.length), i ? ((n = e[r - 1][i]), (s = e[r][i]) - t <= t - n ? e[r] : e[r - 1]) : ((n = e[r - 1]), (s = e[r]) - t <= t - n ? s : n);
};
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e, i, n, s) {
void 0 === s && (s = !1),
(this.textureKey = t),
(this.textureFrame = e),
(this.index = i),
(this.frame = n),
(this.isFirst = !1),
(this.isLast = !1),
(this.prevFrame = null),
(this.nextFrame = null),
(this.duration = 0),
(this.progress = 0),
(this.isKeyFrame = s);
},
toJSON: function () {
return { key: this.textureKey, frame: this.textureFrame, duration: this.duration, keyframe: this.isKeyFrame };
},
destroy: function () {
this.frame = void 0;
},
});
t.exports = n;
},
function (t, e) {
t.exports = function (t) {
var i = /\D/g;
return (
t.sort(function (t, e) {
return parseInt(t.replace(i, ""), 10) - parseInt(e.replace(i, ""), 10);
}),
t
);
};
},
function (t, e, i) {
var n = i(185),
s = i(0),
r = i(102),
o = i(9),
a = i(132),
h = i(22),
b = i(2),
d = i(6),
f = i(186),
p = i(322),
l = new s({
Extends: o,
initialize: function (t) {
o.call(this),
(this.game = t),
(this.textureManager = null),
(this.globalTimeScale = 1),
(this.anims = new r()),
(this.mixes = new r()),
(this.paused = !1),
(this.name = "AnimationManager"),
t.events.once(h.BOOT, this.boot, this);
},
boot: function () {
(this.textureManager = this.game.textures), this.game.events.once(h.DESTROY, this.destroy, this);
},
addMix: function (t, e, i) {
var n,
s = this.anims,
r = this.mixes,
o = "string" == typeof t ? t : t.key,
a = "string" == typeof e ? e : e.key;
return s.has(o) && s.has(a) && (((n = (n = r.get(o)) || {})[a] = i), r.set(o, n)), this;
},
removeMix: function (t, e) {
var i,
n = this.mixes,
s = "string" == typeof t ? t : t.key,
r = n.get(s);
return r && (e ? ((i = "string" == typeof e ? e : e.key), r.hasOwnProperty(i) && delete r[i]) : e || n.delete(s)), this;
},
getMix: function (t, e) {
var i = this.mixes,
n = "string" == typeof t ? t : t.key,
s = "string" == typeof e ? e : e.key,
r = i.get(n);
return r && r.hasOwnProperty(s) ? r[s] : 0;
},
add: function (t, e) {
return this.anims.has(t) || ((e.key = t), this.anims.set(t, e), this.emit(a.ADD_ANIMATION, t, e)), this;
},
exists: function (t) {
return this.anims.has(t);
},
createFromAseprite: function (g, v) {
var y = [],
t = this.game.cache.json.get(g);
if (!t) return y;
var m = this,
e = d(t, "meta", null),
x = d(t, "frames", null);
return (
e &&
x &&
d(e, "frameTags", []).forEach(function (t) {
var e = [],
i = b(t, "name", null),
n = b(t, "from", 0),
s = b(t, "to", 0),
r = b(t, "direction", "forward");
if (i && (!v || (v && -1 < v.indexOf(i)))) {
for (var o = [], a = Number.MAX_SAFE_INTEGER, h = n; h <= s; h++) {
var l,
u = h.toString(),
c = x[u];
c && ((l = b(c, "duration", Number.MAX_SAFE_INTEGER)) < a && (a = l), o.push({ frame: u, duration: l }));
}
o.forEach(function (t) {
e.push({ key: g, frame: t.frame, duration: a - t.duration });
});
var d = a * e.length;
"reverse" === r && (e = e.reverse());
var f = { key: i, frames: e, duration: d, yoyo: "pingpong" === r },
p = m.create(f);
p && y.push(p);
}
}),
y
);
},
create: function (t) {
var e = t.key,
i = !1;
return e && ((i = this.get(e)) || ((i = new n(this, e, t)), this.anims.set(e, i), this.emit(a.ADD_ANIMATION, e, i))), i;
},
fromJSON: function (t, e) {
void 0 === e && (e = !1), e && this.anims.clear(), "string" == typeof t && (t = JSON.parse(t));
var i = [];
if (t.hasOwnProperty("anims") && Array.isArray(t.anims)) {
for (var n = 0; n < t.anims.length; n++) i.push(this.create(t.anims[n]));
t.hasOwnProperty("globalTimeScale") && (this.globalTimeScale = t.globalTimeScale);
} else t.hasOwnProperty("key") && "frame" === t.type && i.push(this.create(t));
return i;
},
generateFrameNames: function (t, e) {
var i,
n = d(e, "prefix", ""),
s = d(e, "start", 0),
r = d(e, "end", 0),
o = d(e, "suffix", ""),
a = d(e, "zeroPad", 0),
h = d(e, "outputArray", []),
l = d(e, "frames", !1),
u = this.textureManager.get(t);
if (!u) return h;
if (e)
for (l = l || p(s, r), i = 0; i < l.length; i++) {
var c = n + f(l[i], a, "0", 1) + o;
u.has(c) && h.push({ key: t, frame: c });
}
else for (l = u.getFrameNames(), i = 0; i < l.length; i++) h.push({ key: t, frame: l[i] });
return h;
},
generateFrameNumbers: function (t, e) {
var i = d(e, "start", 0),
n = d(e, "end", -1),
s = d(e, "first", !1),
r = d(e, "outputArray", []),
o = d(e, "frames", !1),
a = this.textureManager.get(t);
if (!a) return r;
s && a.has(s) && r.push({ key: t, frame: s }), o || (-1 === n && (n = a.frameTotal - 2), (o = p(i, n)));
for (var h = 0; h < o.length; h++) a.has(o[h]) && r.push({ key: t, frame: o[h] });
return r;
},
get: function (t) {
return this.anims.get(t);
},
pauseAll: function () {
return this.paused || ((this.paused = !0), this.emit(a.PAUSE_ALL)), this;
},
play: function (t, e) {
Array.isArray(e) || (e = [e]);
for (var i = 0; i < e.length; i++) e[i].anims.play(t);
return this;
},
staggerPlay: function (t, e, i, n) {
void 0 === i && (i = 0), void 0 === n && (n = !0), Array.isArray(e) || (e = [e]);
var s = e.length;
n || s--;
for (var r = 0; r < e.length; r++) {
var o = i < 0 ? Math.abs(i) * (s - r) : i * r;
e[r].anims.playAfterDelay(t, o);
}
return this;
},
remove: function (t) {
var e = this.get(t);
return e && (this.emit(a.REMOVE_ANIMATION, t, e), this.anims.delete(t), this.removeMix(t)), e;
},
resumeAll: function () {
return this.paused && ((this.paused = !1), this.emit(a.RESUME_ALL)), this;
},
toJSON: function (t) {
var i = { anims: [], globalTimeScale: this.globalTimeScale };
return (
void 0 !== t && "" !== t
? i.anims.push(this.anims.get(t).toJSON())
: this.anims.each(function (t, e) {
i.anims.push(e.toJSON());
}),
i
);
},
destroy: function () {
this.anims.clear(), this.mixes.clear(), (this.textureManager = null), (this.game = null);
},
});
t.exports = l;
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s,
r = [],
o = !1;
if (((i || n) && ((o = !0), (i = i || ""), (n = n || "")), e < t)) for (s = t; e <= s; s--) o ? r.push(i + s.toString() + n) : r.push(s);
else for (s = t; s <= e; s++) o ? r.push(i + s.toString() + n) : r.push(s);
return r;
};
},
function (t, e, i) {
var n = i(0),
s = i(102),
r = i(9),
o = i(324),
a = new n({
initialize: function () {
(this.entries = new s()), (this.events = new r());
},
add: function (t, e) {
return this.entries.set(t, e), this.events.emit(o.ADD, this, t, e), this;
},
has: function (t) {
return this.entries.has(t);
},
exists: function (t) {
return this.entries.has(t);
},
get: function (t) {
return this.entries.get(t);
},
remove: function (t) {
var e = this.get(t);
return e && (this.entries.delete(t), this.events.emit(o.REMOVE, this, t, e.data)), this;
},
getKeys: function () {
return this.entries.keys();
},
destroy: function () {
this.entries.clear(), this.events.removeAllListeners(), (this.entries = null), (this.events = null);
},
});
t.exports = a;
},
function (t, e, i) {
t.exports = { ADD: i(736), REMOVE: i(737) };
},
function (t, e, i) {
var n = i(323),
s = i(0),
r = i(22),
o = new s({
initialize: function (t) {
(this.game = t),
(this.binary = new n()),
(this.bitmapFont = new n()),
(this.json = new n()),
(this.physics = new n()),
(this.shader = new n()),
(this.audio = new n()),
(this.video = new n()),
(this.text = new n()),
(this.html = new n()),
(this.obj = new n()),
(this.tilemap = new n()),
(this.xml = new n()),
(this.custom = {}),
this.game.events.once(r.DESTROY, this.destroy, this);
},
addCustom: function (t) {
return this.custom.hasOwnProperty(t) || (this.custom[t] = new n()), this.custom[t];
},
destroy: function () {
for (var t = ["binary", "bitmapFont", "json", "physics", "shader", "audio", "video", "text", "html", "obj", "tilemap", "xml"], e = 0; e < t.length; e++) this[t[e]].destroy(), (this[t[e]] = null);
for (var i in this.custom) this.custom[i].destroy();
(this.custom = null), (this.game = null);
},
});
t.exports = o;
},
function (t, e, i) {
var s = i(133),
w = i(190),
u = i(18),
n = i(0),
r = i(11),
o = i(333),
T = i(37),
S = i(135),
a = i(10),
h = i(3),
l = new n({
Extends: s,
Mixins: [r.Flip, r.Tint, r.Pipeline],
initialize: function (t, e, i, n) {
s.call(this, t, e, i, n),
(this.postPipelines = []),
(this.pipelineData = {}),
(this.inputEnabled = !0),
(this.fadeEffect = new o.Fade(this)),
(this.flashEffect = new o.Flash(this)),
(this.shakeEffect = new o.Shake(this)),
(this.panEffect = new o.Pan(this)),
(this.rotateToEffect = new o.RotateTo(this)),
(this.zoomEffect = new o.Zoom(this)),
(this.lerp = new h(1, 1)),
(this.followOffset = new h()),
(this.deadzone = null),
(this._follow = null);
},
setDeadzone: function (t, e) {
var i, n, s, r;
return (
void 0 === t
? (this.deadzone = null)
: (this.deadzone ? ((this.deadzone.width = t), (this.deadzone.height = e)) : (this.deadzone = new a(0, 0, t, e)),
this._follow &&
((i = this.width / 2),
(n = this.height / 2),
(s = this._follow.x - this.followOffset.x),
(r = this._follow.y - this.followOffset.y),
this.midPoint.set(s, r),
(this.scrollX = s - i),
(this.scrollY = r - n)),
w(this.deadzone, this.midPoint.x, this.midPoint.y)),
this
);
},
fadeIn: function (t, e, i, n, s, r) {
return this.fadeEffect.start(!1, t, e, i, n, !0, s, r);
},
fadeOut: function (t, e, i, n, s, r) {
return this.fadeEffect.start(!0, t, e, i, n, !0, s, r);
},
fadeFrom: function (t, e, i, n, s, r, o) {
return this.fadeEffect.start(!1, t, e, i, n, s, r, o);
},
fade: function (t, e, i, n, s, r, o) {
return this.fadeEffect.start(!0, t, e, i, n, s, r, o);
},
flash: function (t, e, i, n, s, r, o) {
return this.flashEffect.start(t, e, i, n, s, r, o);
},
shake: function (t, e, i, n, s) {
return this.shakeEffect.start(t, e, i, n, s);
},
pan: function (t, e, i, n, s, r, o) {
return this.panEffect.start(t, e, i, n, s, r, o);
},
rotateTo: function (t, e, i, n, s, r, o) {
return this.rotateToEffect.start(t, e, i, n, s, r, o);
},
zoomTo: function (t, e, i, n, s, r) {
return this.zoomEffect.start(t, e, i, n, s, r);
},
preRender: function () {
this.renderList.length = 0;
var t = this.width,
e = this.height,
i = 0.5 * t,
n = 0.5 * e,
s = this.zoom,
r = this.matrix,
o = t * this.originX,
a = e * this.originY,
h = this._follow,
l = this.deadzone,
u = this.scrollX,
c = this.scrollY;
l && w(l, this.midPoint.x, this.midPoint.y);
var d,
f,
p = !1;
h &&
!this.panEffect.isRunning &&
((d = h.x - this.followOffset.x),
(f = h.y - this.followOffset.y),
l
? (d < l.x ? (u = S(u, u - (l.x - d), this.lerp.x)) : d > l.right && (u = S(u, u + (d - l.right), this.lerp.x)),
f < l.y ? (c = S(c, c - (l.y - f), this.lerp.y)) : f > l.bottom && (c = S(c, c + (f - l.bottom), this.lerp.y)))
: ((u = S(u, d - o, this.lerp.x)), (c = S(c, f - a, this.lerp.y))),
(p = !0)),
this.useBounds && ((u = this.clampX(u)), (c = this.clampY(c))),
this.roundPixels && ((o = Math.round(o)), (a = Math.round(a)), (u = Math.round(u)), (c = Math.round(c)));
var g = (this.scrollX = u) + i,
v = (this.scrollY = c) + n;
this.midPoint.set(g, v);
var y = t / s,
m = e / s,
x = g - y / 2,
b = v - m / 2;
this.roundPixels && ((x = Math.round(x)), (b = Math.round(b))),
this.worldView.setTo(x, b, y, m),
r.applyITRS(this.x + o, this.y + a, this.rotation, s, s),
r.translate(-o, -a),
this.shakeEffect.preRender(),
p && this.emit(T.FOLLOW_UPDATE, this, h);
},
setLerp: function (t, e) {
return void 0 === t && (t = 1), void 0 === e && (e = t), this.lerp.set(t, e), this;
},
setFollowOffset: function (t, e) {
return void 0 === t && (t = 0), void 0 === e && (e = 0), this.followOffset.set(t, e), this;
},
startFollow: function (t, e, i, n, s, r) {
void 0 === e && (e = !1),
void 0 === i && (i = 1),
void 0 === n && (n = i),
void 0 === s && (s = 0),
void 0 === r && (r = s),
(this._follow = t),
(this.roundPixels = e),
(i = u(i, 0, 1)),
(n = u(n, 0, 1)),
this.lerp.set(i, n),
this.followOffset.set(s, r);
var o = this.width / 2,
a = this.height / 2,
h = t.x - s,
l = t.y - r;
return this.midPoint.set(h, l), (this.scrollX = h - o), (this.scrollY = l - a), this.useBounds && ((this.scrollX = this.clampX(this.scrollX)), (this.scrollY = this.clampY(this.scrollY))), this;
},
stopFollow: function () {
return (this._follow = null), this;
},
resetFX: function () {
return this.rotateToEffect.reset(), this.panEffect.reset(), this.shakeEffect.reset(), this.flashEffect.reset(), this.fadeEffect.reset(), this;
},
update: function (t, e) {
this.visible &&
(this.rotateToEffect.update(t, e), this.panEffect.update(t, e), this.zoomEffect.update(t, e), this.shakeEffect.update(t, e), this.flashEffect.update(t, e), this.fadeEffect.update(t, e));
},
destroy: function () {
this.resetFX(), s.prototype.destroy.call(this), (this._follow = null), (this.deadzone = null);
},
});
t.exports = l;
},
function (t, e, i) {
var o = i(38);
t.exports = function (t) {
var e = new o();
t = t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i, function (t, e, i, n) {
return e + e + i + i + n + n;
});
var i,
n,
s,
r = /^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
return r && ((i = parseInt(r[1], 16)), (n = parseInt(r[2], 16)), (s = parseInt(r[3], 16)), e.setTo(i, n, s)), e;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
return (n << 24) | (t << 16) | (e << 8) | i;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
void 0 === n && (n = { h: 0, s: 0, v: 0 }), (t /= 255), (e /= 255), (i /= 255);
var s = Math.min(t, e, i),
r = Math.max(t, e, i),
o = r - s,
a = 0,
h = 0 === r ? 0 : o / r,
l = r;
return (
r !== s && (r === t ? (a = (e - i) / o + (e < i ? 6 : 0)) : r === e ? (a = (i - t) / o + 2) : r === i && (a = (t - e) / o + 4), (a /= 6)),
n.hasOwnProperty("_h") ? ((n._h = a), (n._s = h), (n._v = l)) : ((n.h = a), (n.s = h), (n.v = l)),
n
);
};
},
function (t, e) {
t.exports = function (t) {
return 16777215 < t ? { a: t >>> 24, r: (t >> 16) & 255, g: (t >> 8) & 255, b: 255 & t } : { a: 255, r: (t >> 16) & 255, g: (t >> 8) & 255, b: 255 & t };
};
},
function (t, e, i) {
var n = i(38);
t.exports = function (t) {
return new n(t.r, t.g, t.b, t.a);
};
},
function (t, e, i) {
var a = i(38);
t.exports = function (t) {
var e,
i,
n,
s,
r = new a(),
o = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());
return o && ((e = parseInt(o[1], 10)), (i = parseInt(o[2], 10)), (n = parseInt(o[3], 10)), (s = void 0 !== o[4] ? parseFloat(o[4]) : 1), r.setTo(e, i, n, 255 * s)), r;
};
},
function (t, e, i) {
t.exports = { Fade: i(761), Flash: i(762), Pan: i(763), Shake: i(796), RotateTo: i(797), Zoom: i(798) };
},
function (t, e, i) {
t.exports = { In: i(764), Out: i(765), InOut: i(766) };
},
function (t, e, i) {
t.exports = { In: i(767), Out: i(768), InOut: i(769) };
},
function (t, e, i) {
t.exports = { In: i(770), Out: i(771), InOut: i(772) };
},
function (t, e, i) {
t.exports = { In: i(773), Out: i(774), InOut: i(775) };
},
function (t, e, i) {
t.exports = { In: i(776), Out: i(777), InOut: i(778) };
},
function (t, e, i) {
t.exports = { In: i(779), Out: i(780), InOut: i(781) };
},
function (t, e, i) {
t.exports = i(782);
},
function (t, e, i) {
t.exports = { In: i(783), Out: i(784), InOut: i(785) };
},
function (t, e, i) {
t.exports = { In: i(786), Out: i(787), InOut: i(788) };
},
function (t, e, i) {
t.exports = { In: i(789), Out: i(790), InOut: i(791) };
},
function (t, e, i) {
t.exports = { In: i(792), Out: i(793), InOut: i(794) };
},
function (t, e, i) {
t.exports = i(795);
},
function (t, e, i) {
var n = i(0),
h = i(33),
l = i(347),
u = i(2),
c = i(6),
d = i(7),
f = i(193),
p = i(1),
g = i(197),
v = i(187),
s = new n({
initialize: function (t) {
void 0 === t && (t = {}),
(this.width = c(t, "width", 1024)),
(this.height = c(t, "height", 768)),
(this.zoom = c(t, "zoom", 1)),
(this.parent = c(t, "parent", void 0)),
(this.scaleMode = c(t, "scaleMode", 0)),
(this.expandParent = c(t, "expandParent", !0)),
(this.autoRound = c(t, "autoRound", !1)),
(this.autoCenter = c(t, "autoCenter", 0)),
(this.resizeInterval = c(t, "resizeInterval", 500)),
(this.fullscreenTarget = c(t, "fullscreenTarget", null)),
(this.minWidth = c(t, "minWidth", 0)),
(this.maxWidth = c(t, "maxWidth", 0)),
(this.minHeight = c(t, "minHeight", 0)),
(this.maxHeight = c(t, "maxHeight", 0));
var e = c(t, "scale", null);
e &&
((this.width = c(e, "width", this.width)),
(this.height = c(e, "height", this.height)),
(this.zoom = c(e, "zoom", this.zoom)),
(this.parent = c(e, "parent", this.parent)),
(this.scaleMode = c(e, "mode", this.scaleMode)),
(this.expandParent = c(e, "expandParent", this.expandParent)),
(this.autoRound = c(e, "autoRound", this.autoRound)),
(this.autoCenter = c(e, "autoCenter", this.autoCenter)),
(this.resizeInterval = c(e, "resizeInterval", this.resizeInterval)),
(this.fullscreenTarget = c(e, "fullscreenTarget", this.fullscreenTarget)),
(this.minWidth = c(e, "min.width", this.minWidth)),
(this.maxWidth = c(e, "max.width", this.maxWidth)),
(this.minHeight = c(e, "min.height", this.minHeight)),
(this.maxHeight = c(e, "max.height", this.maxHeight))),
(this.renderType = c(t, "type", h.AUTO)),
(this.canvas = c(t, "canvas", null)),
(this.context = c(t, "context", null)),
(this.canvasStyle = c(t, "canvasStyle", null)),
(this.customEnvironment = c(t, "customEnvironment", !1)),
(this.sceneConfig = c(t, "scene", null)),
(this.seed = c(t, "seed", [(Date.now() * Math.random()).toString()])),
(f.RND = new f.RandomDataGenerator(this.seed)),
(this.gameTitle = c(t, "title", "")),
(this.gameURL = c(t, "url", "https://phaser.io")),
(this.gameVersion = c(t, "version", "")),
(this.autoFocus = c(t, "autoFocus", !0)),
(this.domCreateContainer = c(t, "dom.createContainer", !1)),
(this.domBehindCanvas = c(t, "dom.behindCanvas", !1)),
(this.domPointerEvents = c(t, "dom.pointerEvents", "none")),
(this.inputKeyboard = c(t, "input.keyboard", !0)),
(this.inputKeyboardEventTarget = c(t, "input.keyboard.target", window)),
(this.inputKeyboardCapture = c(t, "input.keyboard.capture", [])),
(this.inputMouse = c(t, "input.mouse", !0)),
(this.inputMouseEventTarget = c(t, "input.mouse.target", null)),
(this.inputMousePreventDefaultDown = c(t, "input.mouse.preventDefaultDown", !0)),
(this.inputMousePreventDefaultUp = c(t, "input.mouse.preventDefaultUp", !0)),
(this.inputMousePreventDefaultMove = c(t, "input.mouse.preventDefaultMove", !0)),
(this.inputMousePreventDefaultWheel = c(t, "input.mouse.preventDefaultWheel", !0)),
(this.inputTouch = c(t, "input.touch", l.input.touch)),
(this.inputTouchEventTarget = c(t, "input.touch.target", null)),
(this.inputTouchCapture = c(t, "input.touch.capture", !0)),
(this.inputActivePointers = c(t, "input.activePointers", 1)),
(this.inputSmoothFactor = c(t, "input.smoothFactor", 0)),
(this.inputWindowEvents = c(t, "input.windowEvents", !0)),
(this.inputGamepad = c(t, "input.gamepad", !1)),
(this.inputGamepadEventTarget = c(t, "input.gamepad.target", window)),
(this.disableContextMenu = c(t, "disableContextMenu", !1)),
(this.audio = c(t, "audio", {})),
(this.hideBanner = !1 === c(t, "banner", null)),
(this.hidePhaser = c(t, "banner.hidePhaser", !1)),
(this.bannerTextColor = c(t, "banner.text", "#ffffff")),
(this.bannerBackgroundColor = c(t, "banner.background", ["#ff0000", "#ffff00", "#00ff00", "#00ffff", "#000000"])),
"" === this.gameTitle && this.hidePhaser && (this.hideBanner = !0),
(this.fps = c(t, "fps", null));
var i = c(t, "render", t);
(this.pipeline = c(i, "pipeline", null)),
(this.antialias = c(i, "antialias", !0)),
(this.antialiasGL = c(i, "antialiasGL", !0)),
(this.mipmapFilter = c(i, "mipmapFilter", "LINEAR")),
(this.desynchronized = c(i, "desynchronized", !1)),
(this.roundPixels = c(i, "roundPixels", !1)),
(this.pixelArt = c(i, "pixelArt", 1 !== this.zoom)),
this.pixelArt && ((this.antialias = !1), (this.antialiasGL = !1), (this.roundPixels = !0)),
(this.transparent = c(i, "transparent", !1)),
(this.clearBeforeRender = c(i, "clearBeforeRender", !0)),
(this.preserveDrawingBuffer = c(i, "preserveDrawingBuffer", !1)),
(this.premultipliedAlpha = c(i, "premultipliedAlpha", !0)),
(this.failIfMajorPerformanceCaveat = c(i, "failIfMajorPerformanceCaveat", !1)),
(this.powerPreference = c(i, "powerPreference", "default")),
(this.batchSize = c(i, "batchSize", 4096)),
(this.maxTextures = c(i, "maxTextures", -1)),
(this.maxLights = c(i, "maxLights", 10));
var n = c(t, "backgroundColor", 0);
(this.backgroundColor = v(n)),
this.transparent && ((this.backgroundColor = v(0)), (this.backgroundColor.alpha = 0)),
(this.preBoot = c(t, "callbacks.preBoot", p)),
(this.postBoot = c(t, "callbacks.postBoot", p)),
(this.physics = c(t, "physics", {})),
(this.defaultPhysicsSystem = c(this.physics, "default", !1)),
(this.loaderBaseURL = c(t, "loader.baseURL", "")),
(this.loaderPath = c(t, "loader.path", ""));
var s = l.os.android ? 6 : 32;
(this.loaderMaxParallelDownloads = c(t, "loader.maxParallelDownloads", s)),
(this.loaderCrossOrigin = c(t, "loader.crossOrigin", void 0)),
(this.loaderResponseType = c(t, "loader.responseType", "")),
(this.loaderAsync = c(t, "loader.async", !0)),
(this.loaderUser = c(t, "loader.user", "")),
(this.loaderPassword = c(t, "loader.password", "")),
(this.loaderTimeout = c(t, "loader.timeout", 0)),
(this.loaderWithCredentials = c(t, "loader.withCredentials", !1)),
(this.installGlobalPlugins = []),
(this.installScenePlugins = []);
var r = c(t, "plugins", null),
o = g.DefaultScene;
r &&
(Array.isArray(r)
? (this.defaultPlugins = r)
: d(r) &&
((this.installGlobalPlugins = u(r, "global", [])),
(this.installScenePlugins = u(r, "scene", [])),
Array.isArray(r.default) ? (o = r.default) : Array.isArray(r.defaultMerge) && (o = o.concat(r.defaultMerge)))),
(this.defaultPlugins = o);
var a = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";
(this.defaultImage = c(t, "images.default", a + "AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg==")),
(this.missingImage = c(
t,
"images.missing",
a +
"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="
)),
(this.whiteImage = c(
t,
"images.white",
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"
)),
window && (window.FORCE_WEBGL ? (this.renderType = h.WEBGL) : window.FORCE_CANVAS && (this.renderType = h.CANVAS));
},
});
t.exports = s;
},
function (t, e, i) {
t.exports = { os: i(105), browser: i(136), features: i(191), input: i(808), audio: i(809), video: i(810), fullscreen: i(811), canvasFeatures: i(348) };
},
function (t, e, i) {
var n,
s,
r,
o = i(31),
a = { supportInverseAlpha: !1, supportNewBlendModes: !1 };
t.exports =
("function" != typeof importScripts &&
void 0 !== document &&
((a.supportNewBlendModes =
((n = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/"),
(s = "AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg=="),
((r = new Image()).onload = function () {
var i = new Image();
(i.onload = function () {
var t = o.create(i, 6, 1).getContext("2d");
if (((t.globalCompositeOperation = "multiply"), t.drawImage(r, 0, 0), t.drawImage(i, 2, 0), !t.getImageData(2, 0, 1, 1))) return !1;
var e = t.getImageData(2, 0, 1, 1).data;
o.remove(i), (a.supportNewBlendModes = 255 === e[0] && 0 === e[1] && 0 === e[2]);
}),
(i.src = n + "/wCKxvRF" + s);
}),
(r.src = n + "AP804Oa6" + s),
!1)),
(a.supportInverseAlpha = (function () {
var t = o.create(this, 2, 1).getContext("2d");
(t.fillStyle = "rgba(10, 20, 30, 0.5)"), t.fillRect(0, 0, 1, 1);
var e = t.getImageData(0, 0, 1, 1);
if (null === e) return !1;
t.putImageData(e, 1, 0);
var i = t.getImageData(1, 0, 1, 1);
return i.data[0] === e.data[0] && i.data[1] === e.data[1] && i.data[2] === e.data[2] && i.data[3] === e.data[3];
})())),
a);
},
function (t, e) {
t.exports = function (t, e, i, n) {
return Math.atan2(n - e, i - t);
};
},
function (t, e) {
t.exports = function (t, e) {
return Math.atan2(e.y - t.y, e.x - t.x);
};
},
function (t, e) {
t.exports = function (t) {
return 0 <= (t %= 2 * Math.PI) ? t : t + 2 * Math.PI;
};
},
function (t, e) {
t.exports = function (t, e) {
var i = t.x - e.x,
n = t.y - e.y;
return Math.sqrt(i * i + n * n);
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = t - i,
r = e - n;
return s * s + r * r;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return void 0 === i && (i = 1e-4), e - i < t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return void 0 === i && (i = 1e-4), t < e + i;
};
},
function (t, e, i) {
var n = i(357);
t.exports = function (t, e) {
return n(t) / n(e) / n(t - e);
};
},
function (t, e) {
t.exports = function (t) {
if (0 === t) return 1;
for (var e = t; --t; ) e *= t;
return e;
};
},
function (t, e) {
t.exports = function (t, e, i, n, s) {
return (l = 1 - t) * l * l * e + 3 * (h = 1 - (a = t)) * h * a * i + 3 * (1 - (o = t)) * o * o * n + (r = t) * r * r * s;
var r, o, a, h, l;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
return (o = 1 - t) * o * e + 2 * (1 - (r = t)) * r * i + (s = t) * s * n;
var s, r, o;
};
},
function (t, e, i) {
var n = i(184);
t.exports = function (t, e, i) {
return e + (i - e) * n(t, 0, 1);
};
},
function (t, e) {
t.exports = function (t) {
var e = Math.log(t) / 0.6931471805599453;
return 1 << Math.ceil(e);
};
},
function (t, e) {
t.exports = function (t, e) {
var i = t.x,
n = t.y;
return (t.x = i * Math.cos(e) - n * Math.sin(e)), (t.y = i * Math.sin(e) + n * Math.cos(e)), t;
};
},
function (t, e) {
t.exports = function (t) {
return 0 < t ? Math.ceil(t) : Math.floor(t);
};
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t) {
(this.val = new Float32Array(9)), t ? this.copy(t) : this.identity();
},
clone: function () {
return new n(this);
},
set: function (t) {
return this.copy(t);
},
copy: function (t) {
var e = this.val,
i = t.val;
return (e[0] = i[0]), (e[1] = i[1]), (e[2] = i[2]), (e[3] = i[3]), (e[4] = i[4]), (e[5] = i[5]), (e[6] = i[6]), (e[7] = i[7]), (e[8] = i[8]), this;
},
fromMat4: function (t) {
var e = t.val,
i = this.val;
return (i[0] = e[0]), (i[1] = e[1]), (i[2] = e[2]), (i[3] = e[4]), (i[4] = e[5]), (i[5] = e[6]), (i[6] = e[8]), (i[7] = e[9]), (i[8] = e[10]), this;
},
fromArray: function (t) {
var e = this.val;
return (e[0] = t[0]), (e[1] = t[1]), (e[2] = t[2]), (e[3] = t[3]), (e[4] = t[4]), (e[5] = t[5]), (e[6] = t[6]), (e[7] = t[7]), (e[8] = t[8]), this;
},
identity: function () {
var t = this.val;
return (t[0] = 1), (t[1] = 0), (t[2] = 0), (t[3] = 0), (t[4] = 1), (t[5] = 0), (t[6] = 0), (t[7] = 0), (t[8] = 1), this;
},
transpose: function () {
var t = this.val,
e = t[1],
i = t[2],
n = t[5];
return (t[1] = t[3]), (t[2] = t[6]), (t[3] = e), (t[5] = t[7]), (t[6] = i), (t[7] = n), this;
},
invert: function () {
var t = this.val,
e = t[0],
i = t[1],
n = t[2],
s = t[3],
r = t[4],
o = t[5],
a = t[6],
h = t[7],
l = t[8],
u = l * r - o * h,
c = -l * s + o * a,
d = h * s - r * a,
f = e * u + i * c + n * d;
return f
? ((f = 1 / f),
(t[0] = u * f),
(t[1] = (-l * i + n * h) * f),
(t[2] = (o * i - n * r) * f),
(t[3] = c * f),
(t[4] = (l * e - n * a) * f),
(t[5] = (-o * e + n * s) * f),
(t[6] = d * f),
(t[7] = (-h * e + i * a) * f),
(t[8] = (r * e - i * s) * f),
this)
: null;
},
adjoint: function () {
var t = this.val,
e = t[0],
i = t[1],
n = t[2],
s = t[3],
r = t[4],
o = t[5],
a = t[6],
h = t[7],
l = t[8];
return (
(t[0] = r * l - o * h),
(t[1] = n * h - i * l),
(t[2] = i * o - n * r),
(t[3] = o * a - s * l),
(t[4] = e * l - n * a),
(t[5] = n * s - e * o),
(t[6] = s * h - r * a),
(t[7] = i * a - e * h),
(t[8] = e * r - i * s),
this
);
},
determinant: function () {
var t = this.val,
e = t[0],
i = t[1],
n = t[2],
s = t[3],
r = t[4],
o = t[5],
a = t[6],
h = t[7],
l = t[8];
return e * (l * r - o * h) + i * (-l * s + o * a) + n * (h * s - r * a);
},
multiply: function (t) {
var e = this.val,
i = e[0],
n = e[1],
s = e[2],
r = e[3],
o = e[4],
a = e[5],
h = e[6],
l = e[7],
u = e[8],
c = t.val,
d = c[0],
f = c[1],
p = c[2],
g = c[3],
v = c[4],
y = c[5],
m = c[6],
x = c[7],
b = c[8];
return (
(e[0] = d * i + f * r + p * h),
(e[1] = d * n + f * o + p * l),
(e[2] = d * s + f * a + p * u),
(e[3] = g * i + v * r + y * h),
(e[4] = g * n + v * o + y * l),
(e[5] = g * s + v * a + y * u),
(e[6] = m * i + x * r + b * h),
(e[7] = m * n + x * o + b * l),
(e[8] = m * s + x * a + b * u),
this
);
},
translate: function (t) {
var e = this.val,
i = t.x,
n = t.y;
return (e[6] = i * e[0] + n * e[3] + e[6]), (e[7] = i * e[1] + n * e[4] + e[7]), (e[8] = i * e[2] + n * e[5] + e[8]), this;
},
rotate: function (t) {
var e = this.val,
i = e[0],
n = e[1],
s = e[2],
r = e[3],
o = e[4],
a = e[5],
h = Math.sin(t),
l = Math.cos(t);
return (e[0] = l * i + h * r), (e[1] = l * n + h * o), (e[2] = l * s + h * a), (e[3] = l * r - h * i), (e[4] = l * o - h * n), (e[5] = l * a - h * s), this;
},
scale: function (t) {
var e = this.val,
i = t.x,
n = t.y;
return (e[0] = i * e[0]), (e[1] = i * e[1]), (e[2] = i * e[2]), (e[3] = n * e[3]), (e[4] = n * e[4]), (e[5] = n * e[5]), this;
},
fromQuat: function (t) {
var e = t.x,
i = t.y,
n = t.z,
s = t.w,
r = e + e,
o = i + i,
a = n + n,
h = e * r,
l = e * o,
u = e * a,
c = i * o,
d = i * a,
f = n * a,
p = s * r,
g = s * o,
v = s * a,
y = this.val;
return (y[0] = 1 - (c + f)), (y[3] = l + v), (y[6] = u - g), (y[1] = l - v), (y[4] = 1 - (h + f)), (y[7] = d + p), (y[2] = u + g), (y[5] = d - p), (y[8] = 1 - (h + c)), this;
},
normalFromMat4: function (t) {
var e = t.val,
i = this.val,
n = e[0],
s = e[1],
r = e[2],
o = e[3],
a = e[4],
h = e[5],
l = e[6],
u = e[7],
c = e[8],
d = e[9],
f = e[10],
p = e[11],
g = e[12],
v = e[13],
y = e[14],
m = e[15],
x = n * h - s * a,
b = n * l - r * a,
w = n * u - o * a,
T = s * l - r * h,
S = s * u - o * h,
_ = r * u - o * l,
E = c * v - d * g,
P = c * y - f * g,
A = c * m - p * g,
M = d * y - f * v,
C = d * m - p * v,
O = f * m - p * y,
k = x * O - b * C + w * M + T * A - S * P + _ * E;
return k
? ((k = 1 / k),
(i[0] = (h * O - l * C + u * M) * k),
(i[1] = (l * A - a * O - u * P) * k),
(i[2] = (a * C - h * A + u * E) * k),
(i[3] = (r * C - s * O - o * M) * k),
(i[4] = (n * O - r * A + o * P) * k),
(i[5] = (s * A - n * C - o * E) * k),
(i[6] = (v * _ - y * S + m * T) * k),
(i[7] = (y * w - g * _ - m * b) * k),
(i[8] = (g * S - v * w + m * x) * k),
this)
: null;
},
});
t.exports = n;
},
function (t, e, i) {
var n = i(0),
s = i(364),
r = i(1),
o = i(39),
a = new Int8Array([1, 2, 0]),
h = new Float32Array([0, 0, 0]),
l = new o(1, 0, 0),
u = new o(0, 1, 0),
c = new o(),
d = new s(),
f = new n({
initialize: function (t, e, i, n) {
(this.onChangeCallback = r), this.set(t, e, i, n);
},
x: {
get: function () {
return this._x;
},
set: function (t) {
(this._x = t), this.onChangeCallback(this);
},
},
y: {
get: function () {
return this._y;
},
set: function (t) {
(this._y = t), this.onChangeCallback(this);
},
},
z: {
get: function () {
return this._z;
},
set: function (t) {
(this._z = t), this.onChangeCallback(this);
},
},
w: {
get: function () {
return this._w;
},
set: function (t) {
(this._w = t), this.onChangeCallback(this);
},
},
copy: function (t) {
return this.set(t);
},
set: function (t, e, i, n, s) {
return (
void 0 === s && (s = !0),
"object" == typeof t ? ((this._x = t.x || 0), (this._y = t.y || 0), (this._z = t.z || 0), (this._w = t.w || 0)) : ((this._x = t || 0), (this._y = e || 0), (this._z = i || 0), (this._w = n || 0)),
s && this.onChangeCallback(this),
this
);
},
add: function (t) {
return (this._x += t.x), (this._y += t.y), (this._z += t.z), (this._w += t.w), this.onChangeCallback(this), this;
},
subtract: function (t) {
return (this._x -= t.x), (this._y -= t.y), (this._z -= t.z), (this._w -= t.w), this.onChangeCallback(this), this;
},
scale: function (t) {
return (this._x *= t), (this._y *= t), (this._z *= t), (this._w *= t), this.onChangeCallback(this), this;
},
length: function () {
var t = this.x,
e = this.y,
i = this.z,
n = this.w;
return Math.sqrt(t * t + e * e + i * i + n * n);
},
lengthSq: function () {
var t = this.x,
e = this.y,
i = this.z,
n = this.w;
return t * t + e * e + i * i + n * n;
},
normalize: function () {
var t = this.x,
e = this.y,
i = this.z,
n = this.w,
s = t * t + e * e + i * i + n * n;
return 0 < s && ((s = 1 / Math.sqrt(s)), (this._x = t * s), (this._y = e * s), (this._z = i * s), (this._w = n * s)), this.onChangeCallback(this), this;
},
dot: function (t) {
return this.x * t.x + this.y * t.y + this.z * t.z + this.w * t.w;
},
lerp: function (t, e) {
void 0 === e && (e = 0);
var i = this.x,
n = this.y,
s = this.z,
r = this.w;
return this.set(i + e * (t.x - i), n + e * (t.y - n), s + e * (t.z - s), r + e * (t.w - r));
},
rotationTo: function (t, e) {
var i = t.x * e.x + t.y * e.y + t.z * e.z;
return i < -0.999999
? (c.copy(l).cross(t).length() < 1e-6 && c.copy(u).cross(t), c.normalize(), this.setAxisAngle(c, Math.PI))
: 0.999999 < i
? this.set(0, 0, 0, 1)
: (c.copy(t).cross(e), (this._x = c.x), (this._y = c.y), (this._z = c.z), (this._w = 1 + i), this.normalize());
},
setAxes: function (t, e, i) {
var n = d.val;
return (n[0] = e.x), (n[3] = e.y), (n[6] = e.z), (n[1] = i.x), (n[4] = i.y), (n[7] = i.z), (n[2] = -t.x), (n[5] = -t.y), (n[8] = -t.z), this.fromMat3(d).normalize();
},
identity: function () {
return this.set(0, 0, 0, 1);
},
setAxisAngle: function (t, e) {
e *= 0.5;
var i = Math.sin(e);
return this.set(i * t.x, i * t.y, i * t.z, Math.cos(e));
},
multiply: function (t) {
var e = this.x,
i = this.y,
n = this.z,
s = this.w,
r = t.x,
o = t.y,
a = t.z,
h = t.w;
return this.set(e * h + s * r + i * a - n * o, i * h + s * o + n * r - e * a, n * h + s * a + e * o - i * r, s * h - e * r - i * o - n * a);
},
slerp: function (t, e) {
var i = this.x,
n = this.y,
s = this.z,
r = this.w,
o = t.x,
a = t.y,
h = t.z,
l = t.w,
u = i * o + n * a + s * h + r * l;
u < 0 && ((u = -u), (o = -o), (a = -a), (h = -h), (l = -l));
var c,
d,
f = 1 - e,
p = e;
return 1e-6 < 1 - u && ((c = Math.acos(u)), (d = Math.sin(c)), (f = Math.sin((1 - e) * c) / d), (p = Math.sin(e * c) / d)), this.set(f * i + p * o, f * n + p * a, f * s + p * h, f * r + p * l);
},
invert: function () {
var t = this.x,
e = this.y,
i = this.z,
n = this.w,
s = t * t + e * e + i * i + n * n,
r = s ? 1 / s : 0;
return this.set(-t * r, -e * r, -i * r, n * r);
},
conjugate: function () {
return (this._x = -this.x), (this._y = -this.y), (this._z = -this.z), this.onChangeCallback(this), this;
},
rotateX: function (t) {
t *= 0.5;
var e = this.x,
i = this.y,
n = this.z,
s = this.w,
r = Math.sin(t),
o = Math.cos(t);
return this.set(e * o + s * r, i * o + n * r, n * o - i * r, s * o - e * r);
},
rotateY: function (t) {
t *= 0.5;
var e = this.x,
i = this.y,
n = this.z,
s = this.w,
r = Math.sin(t),
o = Math.cos(t);
return this.set(e * o - n * r, i * o + s * r, n * o + e * r, s * o - i * r);
},
rotateZ: function (t) {
t *= 0.5;
var e = this.x,
i = this.y,
n = this.z,
s = this.w,
r = Math.sin(t),
o = Math.cos(t);
return this.set(e * o + i * r, i * o - e * r, n * o + s * r, s * o - n * r);
},
calculateW: function () {
var t = this.x,
e = this.y,
i = this.z;
return (this.w = -Math.sqrt(1 - t * t - e * e - i * i)), this;
},
setFromEuler: function (t, e) {
var i = t.x / 2,
n = t.y / 2,
s = t.z / 2,
r = Math.cos(i),
o = Math.cos(n),
a = Math.cos(s),
h = Math.sin(i),
l = Math.sin(n),
u = Math.sin(s);
switch (t.order) {
case "XYZ":
this.set(h * o * a + r * l * u, r * l * a - h * o * u, r * o * u + h * l * a, r * o * a - h * l * u, e);
break;
case "YXZ":
this.set(h * o * a + r * l * u, r * l * a - h * o * u, r * o * u - h * l * a, r * o * a + h * l * u, e);
break;
case "ZXY":
this.set(h * o * a - r * l * u, r * l * a + h * o * u, r * o * u + h * l * a, r * o * a - h * l * u, e);
break;
case "ZYX":
this.set(h * o * a - r * l * u, r * l * a + h * o * u, r * o * u - h * l * a, r * o * a + h * l * u, e);
break;
case "YZX":
this.set(h * o * a + r * l * u, r * l * a + h * o * u, r * o * u - h * l * a, r * o * a - h * l * u, e);
break;
case "XZY":
this.set(h * o * a - r * l * u, r * l * a - h * o * u, r * o * u + h * l * a, r * o * a + h * l * u, e);
}
return this;
},
setFromRotationMatrix: function (t) {
var e,
i = t.val,
n = i[0],
s = i[4],
r = i[8],
o = i[1],
a = i[5],
h = i[9],
l = i[2],
u = i[6],
c = i[10],
d = n + a + c;
return (
0 < d
? ((e = 0.5 / Math.sqrt(d + 1)), this.set((u - h) * e, (r - l) * e, (o - s) * e, 0.25 / e))
: a < n && c < n
? ((e = 2 * Math.sqrt(1 + n - a - c)), this.set(0.25 * e, (s + o) / e, (r + l) / e, (u - h) / e))
: c < a
? ((e = 2 * Math.sqrt(1 + a - n - c)), this.set((s + o) / e, 0.25 * e, (h + u) / e, (r - l) / e))
: ((e = 2 * Math.sqrt(1 + c - n - a)), this.set((r + l) / e, (h + u) / e, 0.25 * e, (o - s) / e)),
this
);
},
fromMat3: function (t) {
var e,
i,
n,
s,
r = t.val,
o = r[0] + r[4] + r[8];
return (
0 < o
? ((s = Math.sqrt(o + 1)), (this.w = 0.5 * s), (s = 0.5 / s), (this._x = (r[7] - r[5]) * s), (this._y = (r[2] - r[6]) * s), (this._z = (r[3] - r[1]) * s))
: ((e = 0),
r[4] > r[0] && (e = 1),
r[8] > r[3 * e + e] && (e = 2),
(i = a[e]),
(n = a[i]),
(s = Math.sqrt(r[3 * e + e] - r[3 * i + i] - r[3 * n + n] + 1)),
(h[e] = 0.5 * s),
(s = 0.5 / s),
(h[i] = (r[3 * i + e] + r[3 * e + i]) * s),
(h[n] = (r[3 * n + e] + r[3 * e + n]) * s),
(this._x = h[0]),
(this._y = h[1]),
(this._z = h[2]),
(this._w = (r[3 * n + i] - r[3 * i + n]) * s)),
this.onChangeCallback(this),
this
);
},
});
t.exports = f;
},
function (t, e, a) {
var h = a(367),
l = a(31),
u = a(33),
c = a(191);
t.exports = function (t) {
var e = t.config;
if ((e.customEnvironment || e.canvas) && e.renderType === u.AUTO) throw new Error("Must set explicit renderType in custom environment");
if (!e.customEnvironment && !e.canvas && e.renderType !== u.HEADLESS)
if (e.renderType === u.CANVAS || (e.renderType !== u.CANVAS && !c.webGL)) {
if (!c.canvas) throw new Error("Cannot create Canvas or WebGL context, aborting.");
e.renderType = u.CANVAS;
} else e.renderType = u.WEBGL;
e.antialias || l.disableSmoothing();
var i,
n,
s = t.scale.baseSize,
r = s.width,
o = s.height;
e.canvas ? ((t.canvas = e.canvas), (t.canvas.width = r), (t.canvas.height = o)) : (t.canvas = l.create(t, r, o, e.renderType)),
e.canvasStyle && (t.canvas.style = e.canvasStyle),
e.antialias || h.setCrisp(t.canvas),
e.renderType !== u.HEADLESS && ((i = a(368)), (n = a(371)), e.renderType === u.WEBGL ? (t.renderer = new n(t)) : ((t.renderer = new i(t)), (t.context = t.renderer.gameContext)));
};
},
function (t, e) {
t.exports = {
setCrisp: function (e) {
return (
["optimizeSpeed", "-moz-crisp-edges", "-o-crisp-edges", "-webkit-optimize-contrast", "optimize-contrast", "crisp-edges", "pixelated"].forEach(function (t) {
e.style["image-rendering"] = t;
}),
(e.style.msInterpolationMode = "nearest-neighbor"),
e
);
},
setBicubic: function (t) {
return (t.style["image-rendering"] = "auto"), (t.style.msInterpolationMode = "bicubic"), t;
},
};
},
function (t, e, i) {
var d = i(37),
u = i(369),
n = i(0),
s = i(33),
r = i(9),
f = i(91),
o = i(370),
a = i(104),
h = i(106),
l = i(25),
c = new n({
Extends: r,
initialize: function (t) {
r.call(this);
var e = t.config;
(this.config = { clearBeforeRender: e.clearBeforeRender, backgroundColor: e.backgroundColor, antialias: e.antialias, roundPixels: e.roundPixels }),
(this.game = t),
(this.type = s.CANVAS),
(this.drawCount = 0),
(this.width = 0),
(this.height = 0),
(this.gameCanvas = t.canvas);
var i = { alpha: t.config.transparent, desynchronized: t.config.desynchronized };
(this.gameContext = e.context ? e.context : this.gameCanvas.getContext("2d", i)),
(this.currentContext = this.gameContext),
(this.antialias = t.config.antialias),
(this.blendModes = o()),
(this.snapshotState = { x: 0, y: 0, width: 1, height: 1, getPixel: !1, callback: null, type: "image/png", encoder: 0.92 }),
(this._tempMatrix1 = new l()),
(this._tempMatrix2 = new l()),
(this._tempMatrix3 = new l()),
(this.isBooted = !1),
this.init();
},
init: function () {
this.game.textures.once(h.READY, this.boot, this);
},
boot: function () {
var t = this.game,
e = t.scale.baseSize;
(this.width = e.width), (this.height = e.height), (this.isBooted = !0), t.scale.on(a.RESIZE, this.onResize, this), this.resize(e.width, e.height);
},
onResize: function (t, e) {
(e.width === this.width && e.height === this.height) || this.resize(e.width, e.height);
},
resize: function (t, e) {
(this.width = t), (this.height = e), this.emit(f.RESIZE, t, e);
},
resetTransform: function () {
this.currentContext.setTransform(1, 0, 0, 1, 0, 0);
},
setBlendMode: function (t) {
return (this.currentContext.globalCompositeOperation = t), this;
},
setContext: function (t) {
return (this.currentContext = t || this.gameContext), this;
},
setAlpha: function (t) {
return (this.currentContext.globalAlpha = t), this;
},
preRender: function () {
var t = this.gameContext,
e = this.config,
i = this.width,
n = this.height;
(t.globalAlpha = 1),
(t.globalCompositeOperation = "source-over"),
t.setTransform(1, 0, 0, 1, 0, 0),
e.clearBeforeRender && (t.clearRect(0, 0, i, n), e.transparent || ((t.fillStyle = e.backgroundColor.rgba), t.fillRect(0, 0, i, n))),
t.save(),
(this.drawCount = 0),
this.emit(f.PRE_RENDER);
},
render: function (t, e, i) {
var n = e.length;
this.emit(f.RENDER, t, i);
var s = i.x,
r = i.y,
o = i.width,
a = i.height,
h = i.renderToTexture ? i.context : t.sys.context;
h.save(), this.game.scene.customViewports && (h.beginPath(), h.rect(s, r, o, a), h.clip()), (this.currentContext = h);
var l = i.mask;
l && l.preRenderCanvas(this, null, i._maskCamera),
i.transparent || ((h.fillStyle = i.backgroundColor.rgba), h.fillRect(s, r, o, a)),
(h.globalAlpha = i.alpha),
(h.globalCompositeOperation = "source-over"),
(this.drawCount += n),
i.renderToTexture && i.emit(d.PRE_RENDER, i),
i.matrix.copyToContext(h);
for (var u = 0; u < n; u++) {
var c = e[u];
c.mask && c.mask.preRenderCanvas(this, c, i), c.renderCanvas(this, c, i), c.mask && c.mask.postRenderCanvas(this, c, i);
}
h.setTransform(1, 0, 0, 1, 0, 0),
(h.globalCompositeOperation = "source-over"),
(h.globalAlpha = 1),
i.flashEffect.postRenderCanvas(h),
i.fadeEffect.postRenderCanvas(h),
(i.dirty = !1),
l && l.postRenderCanvas(this),
h.restore(),
i.renderToTexture && (i.emit(d.POST_RENDER, i), i.renderToGame && t.sys.context.drawImage(i.canvas, s, r));
},
postRender: function () {
this.gameContext.restore(), this.emit(f.POST_RENDER);
var t = this.snapshotState;
t.callback && (u(this.gameCanvas, t), (t.callback = null));
},
snapshotCanvas: function (t, e, i, n, s, r, o, a, h) {
void 0 === i && (i = !1), this.snapshotArea(n, s, r, o, e, a, h);
var l = this.snapshotState;
return (l.getPixel = i), u(this.canvas, l), (l.callback = null), this;
},
snapshot: function (t, e, i) {
return this.snapshotArea(0, 0, this.gameCanvas.width, this.gameCanvas.height, t, e, i);
},
snapshotArea: function (t, e, i, n, s, r, o) {
var a = this.snapshotState;
return (a.callback = s), (a.type = r), (a.encoder = o), (a.getPixel = !1), (a.x = t), (a.y = e), (a.width = Math.min(i, this.gameCanvas.width)), (a.height = Math.min(n, this.gameCanvas.height)), this;
},
snapshotPixel: function (t, e, i) {
return this.snapshotArea(t, e, 1, 1, i), (this.snapshotState.getPixel = !0), this;
},
batchSprite: function (t, e, i, n) {
var s,
r,
o,
a,
h,
l,
u,
c,
d,
f,
p,
g,
v,
y,
m,
x,
b,
w = i.alpha * t.alpha;
0 != w &&
((s = this.currentContext),
(r = this._tempMatrix1),
(o = this._tempMatrix2),
(h = (a = e.canvasData).x),
(l = a.y),
(u = e.cutWidth),
(c = e.cutHeight),
(d = e.customPivot),
(f = e.source.resolution),
(p = t.displayOriginX),
(g = t.displayOriginY),
(v = -p + e.x),
(y = -g + e.y),
t.isCropped &&
(((m = t._crop).flipX === t.flipX && m.flipY === t.flipY) || e.updateCropUVs(m, t.flipX, t.flipY),
(u = m.cw),
(c = m.ch),
(h = m.cx),
(l = m.cy),
(v = -p + m.x),
(y = -g + m.y),
t.flipX && (0 <= v ? (v = -(v + u)) : v < 0 && (v = Math.abs(v) - u)),
t.flipY && (0 <= y ? (y = -(y + c)) : y < 0 && (y = Math.abs(y) - c))),
(b = x = 1),
t.flipX && (d || (v += -e.realWidth + 2 * p), (x = -1)),
t.flipY && (d || (y += -e.realHeight + 2 * g), (b = -1)),
o.applyITRS(t.x, t.y, t.rotation, t.scaleX * x, t.scaleY * b),
r.copyFrom(i.matrix),
n ? (r.multiplyWithOffset(n, -i.scrollX * t.scrollFactorX, -i.scrollY * t.scrollFactorY), (o.e = t.x), (o.f = t.y)) : ((o.e -= i.scrollX * t.scrollFactorX), (o.f -= i.scrollY * t.scrollFactorY)),
r.multiply(o),
s.save(),
r.setToContext(s),
(s.globalCompositeOperation = this.blendModes[t.blendMode]),
(s.globalAlpha = w),
(s.imageSmoothingEnabled = !(!this.antialias || e.source.scaleMode)),
t.mask && t.mask.preRenderCanvas(this, t, i),
s.drawImage(e.source.image, h, l, u, c, v, y, u / f, c / f),
t.mask && t.mask.postRenderCanvas(this, t, i),
s.restore());
},
destroy: function () {
this.removeAllListeners(), (this.game = null), (this.gameCanvas = null), (this.gameContext = null);
},
});
t.exports = c;
},
function (t, e, i) {
var f = i(31),
p = i(38),
g = i(2);
t.exports = function (t, e) {
var i,
n,
s,
r,
o = g(e, "callback"),
a = g(e, "type", "image/png"),
h = g(e, "encoder", 0.92),
l = Math.abs(Math.round(g(e, "x", 0))),
u = Math.abs(Math.round(g(e, "y", 0))),
c = g(e, "width", t.width),
d = g(e, "height", t.height);
g(e, "getPixel", !1)
? ((i = t.getContext("2d").getImageData(l, u, 1, 1).data), o.call(null, new p(i[0], i[1], i[2], i[3] / 255)))
: 0 !== l || 0 !== u || c !== t.width || d !== t.height
? ((n = f.createWebGL(this, c, d)).getContext("2d").drawImage(t, l, u, c, d, 0, 0, c, d),
((s = new Image()).onerror = function () {
o.call(null), f.remove(n);
}),
(s.onload = function () {
o.call(null, s), f.remove(n);
}),
(s.src = n.toDataURL(a, h)))
: (((r = new Image()).onerror = function () {
o.call(null);
}),
(r.onload = function () {
o.call(null, r);
}),
(r.src = t.toDataURL(a, h)));
};
},
function (t, e, i) {
var n = i(35),
s = i(348);
t.exports = function () {
var t = [],
e = s.supportNewBlendModes,
i = "source-over";
return (
(t[n.NORMAL] = i),
(t[n.ADD] = "lighter"),
(t[n.MULTIPLY] = e ? "multiply" : i),
(t[n.SCREEN] = e ? "screen" : i),
(t[n.OVERLAY] = e ? "overlay" : i),
(t[n.DARKEN] = e ? "darken" : i),
(t[n.LIGHTEN] = e ? "lighten" : i),
(t[n.COLOR_DODGE] = e ? "color-dodge" : i),
(t[n.COLOR_BURN] = e ? "color-burn" : i),
(t[n.HARD_LIGHT] = e ? "hard-light" : i),
(t[n.SOFT_LIGHT] = e ? "soft-light" : i),
(t[n.DIFFERENCE] = e ? "difference" : i),
(t[n.EXCLUSION] = e ? "exclusion" : i),
(t[n.HUE] = e ? "hue" : i),
(t[n.SATURATION] = e ? "saturation" : i),
(t[n.COLOR] = e ? "color" : i),
(t[n.LUMINOSITY] = e ? "luminosity" : i),
(t[n.ERASE] = "destination-out"),
(t[n.SOURCE_IN] = "source-in"),
(t[n.SOURCE_OUT] = "source-out"),
(t[n.SOURCE_ATOP] = "source-atop"),
(t[n.DESTINATION_OVER] = "destination-over"),
(t[n.DESTINATION_IN] = "destination-in"),
(t[n.DESTINATION_OUT] = "destination-out"),
(t[n.DESTINATION_ATOP] = "destination-atop"),
(t[n.LIGHTER] = "lighter"),
(t[n.COPY] = "copy"),
(t[n.XOR] = "xor"),
t
);
};
},
function (t, e, i) {
var n = i(93),
o = i(37),
s = i(0),
v = i(33),
r = i(9),
l = i(91),
y = i(22),
g = i(138),
m = i(69),
a = i(1),
x = i(372),
h = i(141),
u = i(104),
b = i(106),
w = i(12),
f = i(383),
c = new s({
Extends: r,
initialize: function (t) {
r.call(this);
var e = t.config,
i = {
alpha: e.transparent,
desynchronized: e.desynchronized,
depth: !1,
antialias: e.antialiasGL,
premultipliedAlpha: e.premultipliedAlpha,
stencil: !0,
failIfMajorPerformanceCaveat: e.failIfMajorPerformanceCaveat,
powerPreference: e.powerPreference,
preserveDrawingBuffer: e.preserveDrawingBuffer,
};
(this.config = {
clearBeforeRender: e.clearBeforeRender,
antialias: e.antialias,
backgroundColor: e.backgroundColor,
contextCreation: i,
roundPixels: e.roundPixels,
maxTextures: e.maxTextures,
maxTextureSize: e.maxTextureSize,
batchSize: e.batchSize,
maxLights: e.maxLights,
mipmapFilter: e.mipmapFilter,
}),
(this.game = t),
(this.type = v.WEBGL),
(this.pipelines = null),
(this.width = 0),
(this.height = 0),
(this.canvas = t.canvas),
(this.blendModes = []),
(this.contextLost = !1),
(this.snapshotState = { x: 0, y: 0, width: 1, height: 1, getPixel: !1, callback: null, type: "image/png", encoder: 0.92, isFramebuffer: !1, bufferWidth: 0, bufferHeight: 0 }),
(this.currentActiveTexture = 0),
(this.startActiveTexture = 0),
(this.maxTextures = 0),
this.textureIndexes,
this.tempTextures,
this.textureZero,
this.normalTexture,
(this.currentFramebuffer = null),
(this.fboStack = []),
(this.currentProgram = null),
(this.currentBlendMode = 1 / 0),
(this.currentScissorEnabled = !1),
(this.currentScissor = null),
(this.scissorStack = []),
(this.contextLostHandler = a),
(this.contextRestoredHandler = a),
(this.gl = null),
(this.supportedExtensions = null),
(this.instancedArraysExtension = null),
(this.vaoExtension = null),
(this.extensions = {}),
(this.glFormats = []),
(this.compression = { ETC1: !1, PVRTC: !1, S3TC: !1 }),
(this.drawingBufferHeight = 0),
(this.blankTexture = null),
(this.whiteTexture = null),
(this.maskCount = 0),
(this.maskStack = []),
(this.currentMask = { mask: null, camera: null }),
(this.currentCameraMask = { mask: null, camera: null }),
(this.glFuncMap = null),
(this.currentType = ""),
(this.newType = !1),
(this.nextTypeMatch = !1),
(this.finalType = !1),
(this.mipmapFilter = null),
(this.textureFlush = 0),
(this.isTextureClean = !1),
(this.defaultScissor = [0, 0, 0, 0]),
(this.isBooted = !1),
(this.renderTarget = null),
this.projectionMatrix,
(this.projectionWidth = 0),
(this.projectionHeight = 0),
this.init(this.config);
},
init: function (t) {
var e = this.game,
i = this.canvas,
n = t.backgroundColor,
s = e.config.context ? e.config.context : i.getContext("webgl", t.contextCreation) || i.getContext("experimental-webgl", t.contextCreation);
if (!s || s.isContextLost()) throw ((this.contextLost = !0), new Error("WebGL unsupported"));
this.gl = s;
var r = this;
(this.contextLostHandler = function (t) {
(r.contextLost = !0), r.game.events.emit(y.CONTEXT_LOST, r), t.preventDefault();
}),
(this.contextRestoredHandler = function () {
(r.contextLost = !1), r.init(r.config), r.game.events.emit(y.CONTEXT_RESTORED, r);
}),
i.addEventListener("webglcontextlost", this.contextLostHandler, !1),
i.addEventListener("webglcontextrestored", this.contextRestoredHandler, !1),
(e.context = s);
for (var o = 0; o <= 27; o++) this.blendModes.push({ func: [s.ONE, s.ONE_MINUS_SRC_ALPHA], equation: s.FUNC_ADD });
(this.blendModes[1].func = [s.ONE, s.DST_ALPHA]),
(this.blendModes[2].func = [s.DST_COLOR, s.ONE_MINUS_SRC_ALPHA]),
(this.blendModes[3].func = [s.ONE, s.ONE_MINUS_SRC_COLOR]),
(this.blendModes[17] = { func: [s.ZERO, s.ONE_MINUS_SRC_ALPHA], equation: s.FUNC_REVERSE_SUBTRACT }),
(this.glFormats[0] = s.BYTE),
(this.glFormats[1] = s.SHORT),
(this.glFormats[2] = s.UNSIGNED_BYTE),
(this.glFormats[3] = s.UNSIGNED_SHORT),
(this.glFormats[4] = s.FLOAT),
(this.glFuncMap = {
mat2: { func: s.uniformMatrix2fv, length: 1, matrix: !0 },
mat3: { func: s.uniformMatrix3fv, length: 1, matrix: !0 },
mat4: { func: s.uniformMatrix4fv, length: 1, matrix: !0 },
"1f": { func: s.uniform1f, length: 1 },
"1fv": { func: s.uniform1fv, length: 1 },
"1i": { func: s.uniform1i, length: 1 },
"1iv": { func: s.uniform1iv, length: 1 },
"2f": { func: s.uniform2f, length: 2 },
"2fv": { func: s.uniform2fv, length: 1 },
"2i": { func: s.uniform2i, length: 2 },
"2iv": { func: s.uniform2iv, length: 1 },
"3f": { func: s.uniform3f, length: 3 },
"3fv": { func: s.uniform3fv, length: 1 },
"3i": { func: s.uniform3i, length: 3 },
"3iv": { func: s.uniform3iv, length: 1 },
"4f": { func: s.uniform4f, length: 4 },
"4fv": { func: s.uniform4fv, length: 1 },
"4i": { func: s.uniform4i, length: 4 },
"4iv": { func: s.uniform4iv, length: 1 },
});
var a = s.getSupportedExtensions();
(t.maxTextures && -1 !== t.maxTextures) || (t.maxTextures = s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS)), t.maxTextureSize || (t.maxTextureSize = s.getParameter(s.MAX_TEXTURE_SIZE));
var h = "WEBGL_compressed_texture_",
l = "WEBKIT_" + h;
(this.compression.ETC1 = s.getExtension(h + "etc1") || s.getExtension(l + "etc1")),
(this.compression.PVRTC = s.getExtension(h + "pvrtc") || s.getExtension(l + "pvrtc")),
(this.compression.S3TC = s.getExtension(h + "s3tc") || s.getExtension(l + "s3tc")),
(this.supportedExtensions = a);
var u = "ANGLE_instanced_arrays";
this.instancedArraysExtension = -1 < a.indexOf(u) ? s.getExtension(u) : null;
var c = "OES_vertex_array_object";
(this.vaoExtension = -1 < a.indexOf(c) ? s.getExtension(c) : null),
s.disable(s.DEPTH_TEST),
s.disable(s.CULL_FACE),
s.enable(s.BLEND),
s.clearColor(n.redGL, n.greenGL, n.blueGL, n.alphaGL),
(this.mipmapFilter = s[t.mipmapFilter]),
(this.maxTextures = w.checkShaderMax(s, t.maxTextures)),
(this.textureIndexes = []);
var d = this.tempTextures;
if (Array.isArray(d)) for (var f = 0; o < this.maxTextures; f++) s.deleteTexture(d[f]);
else d = new Array(this.maxTextures);
for (var p = 0; p < this.maxTextures; p++) {
var g = s.createTexture();
s.activeTexture(s.TEXTURE0 + p),
s.bindTexture(s.TEXTURE_2D, g),
s.texImage2D(s.TEXTURE_2D, 0, s.RGBA, 1, 1, 0, s.RGBA, s.UNSIGNED_BYTE, new Uint8Array([0, 0, 255, 255])),
(d[p] = g),
this.textureIndexes.push(p);
}
return (
(this.tempTextures = d),
(this.currentActiveTexture = 1),
this.startActiveTexture++,
s.activeTexture(s.TEXTURE1),
(this.pipelines = new x(this)),
this.setBlendMode(v.BlendModes.NORMAL),
(this.projectionMatrix = new m().identity()),
e.textures.once(b.READY, this.boot, this),
this
);
},
boot: function () {
var t = this.game,
e = this.pipelines,
i = t.scale.baseSize;
(this.width = i.width),
(this.height = i.height),
(this.isBooted = !0),
(this.renderTarget = new h(this, this.width, this.height, 1, 0, !0, !0)),
e.boot(t.config.pipeline),
(this.blankTexture = t.textures.getFrame("__DEFAULT")),
(this.whiteTexture = t.textures.getFrame("__WHITE"));
var n = this.gl;
n.bindFramebuffer(n.FRAMEBUFFER, null), n.enable(n.SCISSOR_TEST), t.scale.on(u.RESIZE, this.onResize, this), this.resize(i.width, i.height);
},
onResize: function (t, e) {
(e.width === this.width && e.height === this.height) || this.resize(e.width, e.height);
},
beginCapture: function (t, e) {
void 0 === t && (t = this.width), void 0 === e && (e = this.height), this.renderTarget.bind(!0, t, e), this.setProjectionMatrix(t, e), this.resetTextures();
},
endCapture: function () {
return this.renderTarget.unbind(!0), this.resetProjectionMatrix(), this.renderTarget;
},
resize: function (t, e) {
var i = this.gl;
return (
(this.width = t),
(this.height = e),
this.setProjectionMatrix(t, e),
i.viewport(0, 0, t, e),
(this.drawingBufferHeight = i.drawingBufferHeight),
i.scissor(0, i.drawingBufferHeight - e, t, e),
(this.defaultScissor[2] = t),
(this.defaultScissor[3] = e),
this.emit(l.RESIZE, t, e),
this
);
},
getAspectRatio: function () {
return this.width / this.height;
},
setProjectionMatrix: function (t, e) {
return (t === this.projectionWidth && e === this.projectionHeight) || ((this.projectionWidth = t), (this.projectionHeight = e), this.projectionMatrix.ortho(0, t, e, 0, -1e3, 1e3)), this;
},
resetProjectionMatrix: function () {
(this.projectionWidth = this.width), (this.projectionHeight = this.height), this.projectionMatrix.ortho(0, this.width, this.height, 0, -1e3, 1e3);
},
hasExtension: function (t) {
return !!this.supportedExtensions && this.supportedExtensions.indexOf(t);
},
getExtension: function (t) {
return this.hasExtension(t) ? (t in this.extensions || (this.extensions[t] = this.gl.getExtension(t)), this.extensions[t]) : null;
},
flush: function () {
this.pipelines.flush();
},
pushScissor: function (t, e, i, n, s) {
void 0 === s && (s = this.drawingBufferHeight);
var r = [t, e, i, n];
return this.scissorStack.push(r), this.setScissor(t, e, i, n, s), (this.currentScissor = r);
},
setScissor: function (t, e, i, n, s) {
void 0 === s && (s = this.drawingBufferHeight);
var r,
o,
a,
h,
l = this.gl,
u = this.currentScissor,
c = 0 < i && 0 < n;
u && c && ((r = u[0]), (o = u[1]), (a = u[2]), (h = u[3]), (c = r !== t || o !== e || a !== i || h !== n)), c && (this.flush(), l.scissor(t, s - e - n, i, n));
},
resetScissor: function () {
var t = this.gl;
t.enable(t.SCISSOR_TEST);
var e,
i,
n,
s,
r = this.currentScissor;
r && ((e = r[0]), (i = r[1]), (n = r[2]), (s = r[3]), 0 < n && 0 < s && t.scissor(e, this.drawingBufferHeight - i - s, n, s));
},
popScissor: function () {
var t = this.scissorStack;
t.pop();
var e = t[t.length - 1];
e && this.setScissor(e[0], e[1], e[2], e[3]), (this.currentScissor = e);
},
hasActiveStencilMask: function () {
var t = this.currentMask.mask,
e = this.currentCameraMask.mask;
return (t && t.isStencil) || (e && e.isStencil);
},
resetViewport: function () {
var t = this.gl;
t.viewport(0, 0, this.width, this.height), (this.drawingBufferHeight = t.drawingBufferHeight);
},
setBlendMode: function (t, e) {
void 0 === e && (e = !1);
var i = this.gl,
n = this.blendModes[t];
return (
!!(e || (t !== v.BlendModes.SKIP_CHECK && this.currentBlendMode !== t)) &&
(this.flush(),
i.enable(i.BLEND),
i.blendEquation(n.equation),
2 < n.func.length ? i.blendFuncSeparate(n.func[0], n.func[1], n.func[2], n.func[3]) : i.blendFunc(n.func[0], n.func[1]),
(this.currentBlendMode = t),
!0)
);
},
addBlendMode: function (t, e) {
return this.blendModes.push({ func: t, equation: e }) - 1;
},
updateBlendMode: function (t, e, i) {
return this.blendModes[t] && ((this.blendModes[t].func = e), i && (this.blendModes[t].equation = i)), this;
},
removeBlendMode: function (t) {
return 17 < t && this.blendModes[t] && this.blendModes.splice(t, 1), this;
},
setBlankTexture: function () {
this.setTexture2D(this.blankTexture.glTexture);
},
setTextureSource: function (t) {
if (this.pipelines.forceZero()) return this.setTextureZero(t.glTexture, !0), 0;
var e = this.gl,
i = this.currentActiveTexture;
return (
t.glIndexCounter < this.startActiveTexture &&
((t.glIndexCounter = this.startActiveTexture),
i < this.maxTextures
? ((t.glIndex = i), e.activeTexture(e.TEXTURE0 + i), e.bindTexture(e.TEXTURE_2D, t.glTexture), this.currentActiveTexture++)
: (this.flush(),
this.startActiveTexture++,
this.textureFlush++,
(t.glIndexCounter = this.startActiveTexture),
(t.glIndex = 1),
e.activeTexture(e.TEXTURE1),
e.bindTexture(e.TEXTURE_2D, t.glTexture),
(this.currentActiveTexture = 2))),
(this.isTextureClean = !1),
t.glIndex
);
},
isNewNormalMap: function (t, e) {
return this.textureZero !== t || this.normalTexture !== e;
},
setTextureZero: function (t, e) {
var i;
this.textureZero !== t && (e && this.flush(), (i = this.gl).activeTexture(i.TEXTURE0), i.bindTexture(i.TEXTURE_2D, t), (this.textureZero = t));
},
clearTextureZero: function () {
this.textureZero = null;
},
setNormalMap: function (t) {
var e;
this.normalTexture !== t && ((e = this.gl).activeTexture(e.TEXTURE1), e.bindTexture(e.TEXTURE_2D, t), (this.normalTexture = t), 1 === this.currentActiveTexture && (this.currentActiveTexture = 2));
},
clearNormalMap: function () {
(this.normalTexture = null), this.startActiveTexture++, (this.currentActiveTexture = 1), this.textureFlush++;
},
unbindTextures: function () {
for (var t = this.gl, e = this.tempTextures, i = 0; i < e.length; i++) t.activeTexture(t.TEXTURE0 + i), t.bindTexture(t.TEXTURE_2D, null);
(this.normalTexture = null), (this.textureZero = null), (this.currentActiveTexture = 1), this.startActiveTexture++, this.textureFlush++;
},
resetTextures: function (t) {
if ((void 0 === t && (t = !1), !this.isTextureClean)) {
this.flush();
var e = this.gl,
i = this.tempTextures;
if (t) {
for (var n = 0; n < i.length; n++) e.activeTexture(e.TEXTURE0 + n), e.bindTexture(e.TEXTURE_2D, i[n]);
e.activeTexture(e.TEXTURE1), e.bindTexture(e.TEXTURE_2D, i[1]), (this.isTextureClean = !0);
} else e.activeTexture(e.TEXTURE0), e.bindTexture(e.TEXTURE_2D, i[0]), e.activeTexture(e.TEXTURE1), e.bindTexture(e.TEXTURE_2D, i[1]);
(this.normalTexture = null), (this.textureZero = null), (this.currentActiveTexture = 1), this.startActiveTexture++, this.textureFlush++;
}
},
setTexture2D: function (t) {
if (this.pipelines.forceZero()) return this.setTextureZero(t, !0), 0;
var e = this.gl,
i = this.currentActiveTexture;
return (
t.glIndexCounter < this.startActiveTexture &&
((t.glIndexCounter = this.startActiveTexture),
i < this.maxTextures
? ((t.glIndex = i), e.activeTexture(e.TEXTURE0 + i), e.bindTexture(e.TEXTURE_2D, t), this.currentActiveTexture++)
: (this.flush(),
this.startActiveTexture++,
this.textureFlush++,
(t.glIndexCounter = this.startActiveTexture),
(t.glIndex = 1),
e.activeTexture(e.TEXTURE1),
e.bindTexture(e.TEXTURE_2D, t),
(this.currentActiveTexture = 2))),
(this.isTextureClean = !1),
t.glIndex
);
},
pushFramebuffer: function (t, e, i, n) {
return t === this.currentFramebuffer ? this : (this.fboStack.push(t), this.setFramebuffer(t, e, i, n));
},
setFramebuffer: function (t, e, i, n) {
if ((void 0 === e && (e = !1), void 0 === i && (i = !1), void 0 === n && (n = !0), t === this.currentFramebuffer)) return this;
var s = this.gl,
r = this.width,
o = this.height;
return (
t && t.renderTexture && n ? ((r = t.renderTexture.width), (o = t.renderTexture.height)) : this.flush(),
s.bindFramebuffer(s.FRAMEBUFFER, t),
n && s.viewport(0, 0, r, o),
e && (t ? ((this.drawingBufferHeight = o), this.pushScissor(0, 0, r, o)) : ((this.drawingBufferHeight = this.height), this.popScissor())),
(this.currentFramebuffer = t),
i && this.resetTextures(),
this
);
},
popFramebuffer: function (t, e, i) {
void 0 === t && (t = !1), void 0 === e && (e = !1), void 0 === i && (i = !0);
var n = this.fboStack;
n.pop();
var s = (s = n[n.length - 1]) || null;
return this.setFramebuffer(s, t, e, i), s;
},
setProgram: function (t) {
return t !== this.currentProgram && (this.flush(), this.gl.useProgram(t), (this.currentProgram = t), !0);
},
resetProgram: function () {
return this.gl.useProgram(this.currentProgram), this;
},
createTextureFromSource: function (t, e, i, n) {
var s = this.gl,
r = s.NEAREST,
o = s.NEAREST,
a = s.CLAMP_TO_EDGE;
(e = t ? t.width : e), (i = t ? t.height : i);
var h = g(e, i);
return (
h && (a = s.REPEAT),
n === v.ScaleModes.LINEAR && this.config.antialias && ((r = h ? this.mipmapFilter : s.LINEAR), (o = s.LINEAR)),
t || "number" != typeof e || "number" != typeof i ? this.createTexture2D(0, r, o, a, a, s.RGBA, t) : this.createTexture2D(0, r, o, a, a, s.RGBA, null, e, i)
);
},
createTexture2D: function (t, e, i, n, s, r, o, a, h, l, u, c) {
(l = null == l || l), void 0 === u && (u = !1), void 0 === c && (c = !1);
var d = this.gl,
f = d.createTexture();
d.activeTexture(d.TEXTURE0);
var p = d.getParameter(d.TEXTURE_BINDING_2D);
return (
d.bindTexture(d.TEXTURE_2D, f),
d.texParameteri(d.TEXTURE_2D, d.TEXTURE_MIN_FILTER, e),
d.texParameteri(d.TEXTURE_2D, d.TEXTURE_MAG_FILTER, i),
d.texParameteri(d.TEXTURE_2D, d.TEXTURE_WRAP_S, s),
d.texParameteri(d.TEXTURE_2D, d.TEXTURE_WRAP_T, n),
d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL, l),
d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL, c),
null == o ? d.texImage2D(d.TEXTURE_2D, t, r, a, h, 0, r, d.UNSIGNED_BYTE, null) : (u || ((a = o.width), (h = o.height)), d.texImage2D(d.TEXTURE_2D, t, r, r, d.UNSIGNED_BYTE, o)),
g(a, h) && d.generateMipmap(d.TEXTURE_2D),
p && d.bindTexture(d.TEXTURE_2D, p),
(f.isAlphaPremultiplied = l),
(f.isRenderTexture = !1),
(f.width = a),
(f.height = h),
(f.glIndex = 0),
(f.glIndexCounter = -1),
f
);
},
createFramebuffer: function (t, e, i, n) {
var s,
r,
o = this.gl,
a = o.createFramebuffer();
if (
(this.setFramebuffer(a),
n &&
((r = o.createRenderbuffer()),
o.bindRenderbuffer(o.RENDERBUFFER, r),
o.renderbufferStorage(o.RENDERBUFFER, o.DEPTH_STENCIL, t, e),
o.framebufferRenderbuffer(o.FRAMEBUFFER, o.DEPTH_STENCIL_ATTACHMENT, o.RENDERBUFFER, r)),
(i.isRenderTexture = !0),
(i.isAlphaPremultiplied = !1),
o.framebufferTexture2D(o.FRAMEBUFFER, o.COLOR_ATTACHMENT0, o.TEXTURE_2D, i, 0),
(s = o.checkFramebufferStatus(o.FRAMEBUFFER)) === o.FRAMEBUFFER_COMPLETE)
)
return (a.renderTexture = i), this.setFramebuffer(null), this.resetTextures(), a;
throw new Error("Framebuffer status: " + { 36054: "Incomplete Attachment", 36055: "Missing Attachment", 36057: "Incomplete Dimensions", 36061: "Framebuffer Unsupported" }[s]);
},
createProgram: function (t, e) {
var i = this.gl,
n = i.createProgram(),
s = i.createShader(i.VERTEX_SHADER),
r = i.createShader(i.FRAGMENT_SHADER);
if ((i.shaderSource(s, t), i.shaderSource(r, e), i.compileShader(s), i.compileShader(r), !i.getShaderParameter(s, i.COMPILE_STATUS)))
throw new Error("Vertex Shader failed:\n" + i.getShaderInfoLog(s));
if (!i.getShaderParameter(r, i.COMPILE_STATUS)) throw new Error("Fragment Shader failed:\n" + i.getShaderInfoLog(r));
if ((i.attachShader(n, s), i.attachShader(n, r), i.linkProgram(n), !i.getProgramParameter(n, i.LINK_STATUS))) throw new Error("Link Program failed:\n" + i.getProgramInfoLog(n));
return i.useProgram(n), n;
},
createVertexBuffer: function (t, e) {
var i = this.gl,
n = i.createBuffer();
return i.bindBuffer(i.ARRAY_BUFFER, n), i.bufferData(i.ARRAY_BUFFER, t, e), i.bindBuffer(i.ARRAY_BUFFER, null), n;
},
createIndexBuffer: function (t, e) {
var i = this.gl,
n = i.createBuffer();
return i.bindBuffer(i.ELEMENT_ARRAY_BUFFER, n), i.bufferData(i.ELEMENT_ARRAY_BUFFER, t, e), i.bindBuffer(i.ELEMENT_ARRAY_BUFFER, null), n;
},
deleteTexture: function (t, e) {
return e && this.resetTextures(!0), t && this.gl.deleteTexture(t), this;
},
deleteFramebuffer: function (t) {
return t && (this.gl.deleteFramebuffer(t), n(this.fboStack, t), this.currentFramebuffer === t && (this.currentFramebuffer = null)), this;
},
deleteProgram: function (t) {
return t && this.gl.deleteProgram(t), this;
},
deleteBuffer: function (t) {
return this.gl.deleteBuffer(t), this;
},
preRenderCamera: function (t) {
var e = t.x,
i = t.y,
n = t.width,
s = t.height,
r = t.backgroundColor;
t.emit(o.PRE_RENDER, t),
this.pipelines.preBatchCamera(t),
this.pushScissor(e, i, n, s),
t.mask && ((this.currentCameraMask.mask = t.mask), (this.currentCameraMask.camera = t._maskCamera), t.mask.preRenderWebGL(this, t, t._maskCamera)),
0 < r.alphaGL && this.pipelines.setMulti().drawFillRect(e, i, n, s, w.getTintFromFloats(r.blueGL, r.greenGL, r.redGL, 1), r.alphaGL);
},
getCurrentStencilMask: function () {
var t = null,
e = this.maskStack,
i = this.currentCameraMask;
return 0 < e.length ? (t = e[e.length - 1]) : i.mask && i.mask.isStencil && (t = i), t;
},
postRenderCamera: function (t) {
var e,
i = t.flashEffect,
n = t.fadeEffect;
(i.isRunning || n.isRunning || n.isComplete) && ((e = this.pipelines.setMulti()), i.postRenderWebGL(e, w.getTintFromFloats), n.postRenderWebGL(e, w.getTintFromFloats)),
(t.dirty = !1),
this.popScissor(),
t.mask && ((this.currentCameraMask.mask = null), t.mask.postRenderWebGL(this, t._maskCamera)),
this.pipelines.postBatchCamera(t),
t.emit(o.POST_RENDER, t);
},
preRender: function () {
var t, e;
this.contextLost ||
((t = this.gl).bindFramebuffer(t.FRAMEBUFFER, null),
this.config.clearBeforeRender &&
((e = this.config.backgroundColor), t.clearColor(e.redGL, e.greenGL, e.blueGL, e.alphaGL), t.clear(t.COLOR_BUFFER_BIT | t.DEPTH_BUFFER_BIT | t.STENCIL_BUFFER_BIT)),
t.enable(t.SCISSOR_TEST),
(this.currentScissor = this.defaultScissor),
(this.scissorStack.length = 0),
this.scissorStack.push(this.currentScissor),
this.game.scene.customViewports && t.scissor(0, this.drawingBufferHeight - this.height, this.width, this.height),
(this.currentMask.mask = null),
(this.currentCameraMask.mask = null),
(this.maskStack.length = 0),
(this.textureFlush = 0),
this.emit(l.PRE_RENDER));
},
render: function (t, e, i) {
if (!this.contextLost) {
var n = e.length;
if ((this.emit(l.RENDER, t, i), this.preRenderCamera(i), 0 === n)) return this.setBlendMode(v.BlendModes.NORMAL), void this.postRenderCamera(i);
this.currentType = "";
for (var s = this.currentMask, r = 0; r < n; r++) {
this.finalType = r === n - 1;
var o = e[r],
a = o.mask;
(s = this.currentMask).mask && s.mask !== a && s.mask.postRenderWebGL(this, s.camera),
a && s.mask !== a && a.preRenderWebGL(this, o, i),
o.blendMode !== this.currentBlendMode && this.setBlendMode(o.blendMode);
var h = o.type;
h !== this.currentType && ((this.newType = !0), (this.currentType = h)),
this.finalType ? (this.nextTypeMatch = !1) : (this.nextTypeMatch = e[r + 1].type === this.currentType),
o.renderWebGL(this, o, i),
(this.newType = !1);
}
(s = this.currentMask).mask && s.mask.postRenderWebGL(this, s.camera), this.setBlendMode(v.BlendModes.NORMAL), this.postRenderCamera(i);
}
},
postRender: function () {
var t;
this.contextLost ||
(this.flush(),
this.emit(l.POST_RENDER),
(t = this.snapshotState).callback && (f(this.canvas, t), (t.callback = null)),
0 < this.textureFlush && (this.startActiveTexture++, (this.currentActiveTexture = 1)));
},
snapshot: function (t, e, i) {
return this.snapshotArea(0, 0, this.gl.drawingBufferWidth, this.gl.drawingBufferHeight, t, e, i);
},
snapshotArea: function (t, e, i, n, s, r, o) {
var a = this.snapshotState;
return (
(a.callback = s),
(a.type = r),
(a.encoder = o),
(a.getPixel = !1),
(a.x = t),
(a.y = e),
(a.width = Math.min(i, this.gl.drawingBufferWidth)),
(a.height = Math.min(n, this.gl.drawingBufferHeight)),
this
);
},
snapshotPixel: function (t, e, i) {
return this.snapshotArea(t, e, 1, 1, i), (this.snapshotState.getPixel = !0), this;
},
snapshotFramebuffer: function (t, e, i, n, s, r, o, a, h, l, u) {
void 0 === s && (s = !1), void 0 === r && (r = 0), void 0 === o && (o = 0), void 0 === a && (a = e), void 0 === h && (h = i);
var c = this.currentFramebuffer;
this.snapshotArea(r, o, a, h, n, l, u);
var d = this.snapshotState;
return (
(d.getPixel = s),
(d.isFramebuffer = !0),
(d.bufferWidth = e),
(d.bufferHeight = i),
this.setFramebuffer(t),
f(this.canvas, d),
this.setFramebuffer(c),
(d.callback = null),
(d.isFramebuffer = !1),
this
);
},
canvasToTexture: function (t, e, i, n) {
return void 0 === i && (i = !1), void 0 === n && (n = !1), e ? this.updateCanvasTexture(t, e, n) : this.createCanvasTexture(t, i, n);
},
createCanvasTexture: function (t, e, i) {
void 0 === e && (e = !1), void 0 === i && (i = !1);
var n = this.gl,
s = n.NEAREST,
r = n.NEAREST,
o = t.width,
a = t.height,
h = n.CLAMP_TO_EDGE,
l = g(o, a);
return !e && l && (h = n.REPEAT), this.config.antialias && ((s = l ? this.mipmapFilter : n.LINEAR), (r = n.LINEAR)), this.createTexture2D(0, s, r, h, h, n.RGBA, t, o, a, !0, !1, i);
},
updateCanvasTexture: function (t, e, i) {
void 0 === i && (i = !1);
var n,
s = this.gl,
r = t.width,
o = t.height;
return (
0 < r &&
0 < o &&
(s.activeTexture(s.TEXTURE0),
(n = s.getParameter(s.TEXTURE_BINDING_2D)),
s.bindTexture(s.TEXTURE_2D, e),
s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, i),
s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0),
s.texImage2D(s.TEXTURE_2D, 0, s.RGBA, s.RGBA, s.UNSIGNED_BYTE, t),
(e.width = r),
(e.height = o),
n && s.bindTexture(s.TEXTURE_2D, n)),
e
);
},
createVideoTexture: function (t, e, i) {
void 0 === e && (e = !1), void 0 === i && (i = !1);
var n = this.gl,
s = n.NEAREST,
r = n.NEAREST,
o = t.videoWidth,
a = t.videoHeight,
h = n.CLAMP_TO_EDGE,
l = g(o, a);
return !e && l && (h = n.REPEAT), this.config.antialias && ((s = l ? this.mipmapFilter : n.LINEAR), (r = n.LINEAR)), this.createTexture2D(0, s, r, h, h, n.RGBA, t, o, a, !0, !0, i);
},
updateVideoTexture: function (t, e, i) {
void 0 === i && (i = !1);
var n,
s = this.gl,
r = t.videoWidth,
o = t.videoHeight;
return (
0 < r &&
0 < o &&
(s.activeTexture(s.TEXTURE0),
(n = s.getParameter(s.TEXTURE_BINDING_2D)),
s.bindTexture(s.TEXTURE_2D, e),
s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, i),
s.texImage2D(s.TEXTURE_2D, 0, s.RGBA, s.RGBA, s.UNSIGNED_BYTE, t),
(e.width = r),
(e.height = o),
n && s.bindTexture(s.TEXTURE_2D, n)),
e
);
},
setTextureFilter: function (t, e) {
var i = this.gl,
n = [i.LINEAR, i.NEAREST][e];
i.activeTexture(i.TEXTURE0);
var s = i.getParameter(i.TEXTURE_BINDING_2D);
return i.bindTexture(i.TEXTURE_2D, t), i.texParameteri(i.TEXTURE_2D, i.TEXTURE_MIN_FILTER, n), i.texParameteri(i.TEXTURE_2D, i.TEXTURE_MAG_FILTER, n), s && i.bindTexture(i.TEXTURE_2D, s), this;
},
getMaxTextureSize: function () {
return this.config.maxTextureSize;
},
destroy: function () {
this.canvas.removeEventListener("webglcontextlost", this.contextLostHandler, !1), this.canvas.removeEventListener("webglcontextrestored", this.contextRestoredHandler, !1);
for (var t = this.gl, e = this.tempTextures, i = 0; i < e.length; i++) t.deleteTexture(e[i]);
this.pipelines.destroy(),
this.removeAllListeners(),
(this.fboStack = []),
(this.maskStack = []),
(this.extensions = {}),
(this.textureIndexes = []),
(this.gl = null),
(this.game = null),
(this.canvas = null),
(this.contextLost = !0),
(this.currentMask = null),
(this.currentCameraMask = null);
},
});
t.exports = c;
},
function (t, e, i) {
var n = i(0),
o = i(92),
s = i(102),
r = i(373),
a = i(376),
h = i(377),
l = i(108),
u = i(378),
c = i(379),
d = i(380),
f = i(381),
p = new n({
initialize: function (t) {
(this.game = t.game),
(this.renderer = t),
(this.classes = new s([
[o.UTILITY_PIPELINE, f],
[o.MULTI_PIPELINE, l],
[o.BITMAPMASK_PIPELINE, r],
[o.SINGLE_PIPELINE, d],
[o.ROPE_PIPELINE, c],
[o.LIGHT_PIPELINE, h],
[o.POINTLIGHT_PIPELINE, u],
[o.GRAPHICS_PIPELINE, a],
])),
(this.postPipelineClasses = new s()),
(this.pipelines = new s()),
(this.current = null),
(this.previous = null),
(this.MULTI_PIPELINE = null),
(this.BITMAPMASK_PIPELINE = null),
(this.UTILITY_PIPELINE = null),
this.fullFrame1,
this.fullFrame2,
this.halfFrame1,
this.halfFrame2;
},
boot: function (t) {
var e,
i = this,
n = this.game;
if (
(this.classes.each(function (t, e) {
(s = i.add(t, new e({ game: n }))),
t === o.UTILITY_PIPELINE && ((i.UTILITY_PIPELINE = s), (i.fullFrame1 = s.fullFrame1), (i.fullFrame2 = s.fullFrame2), (i.halfFrame1 = s.halfFrame1), (i.halfFrame2 = s.halfFrame2));
}),
(this.MULTI_PIPELINE = this.get(o.MULTI_PIPELINE)),
(this.BITMAPMASK_PIPELINE = this.get(o.BITMAPMASK_PIPELINE)),
t)
)
for (e in t) {
var s,
r = t[e];
(s = new r(n)).isPostFX ? this.postPipelineClasses.set(e, r) : this.has(e) || (this.classes.set(e, r), this.add(e, s));
}
},
add: function (t, e) {
if (!e.isPostFX) {
var i = this.pipelines,
n = this.renderer;
return i.has(t) || ((e.name = t), (e.manager = this), i.set(t, e)), e.hasBooted || e.boot(), 0 !== n.width && 0 !== n.height && e.resize(n.width, n.height), e;
}
},
addPostPipeline: function (t, e) {
this.postPipelineClasses.has(t) || this.postPipelineClasses.set(t, e);
},
flush: function () {
this.current && this.current.flush();
},
has: function (t) {
var e = this.pipelines;
return "string" == typeof t ? e.has(t) : !!e.contains(t);
},
get: function (t) {
var e = this.pipelines;
return "string" == typeof t ? e.get(t) : e.contains(t) ? t : void 0;
},
getPostPipeline: function (t, e) {
var i,
n = this.postPipelineClasses;
if (("string" == typeof t ? (i = n.get(t)) : "function" == typeof t ? n.contains(t) && (i = t) : "object" == typeof t && (i = n.get(t.name)), i)) {
var s = new i(this.game);
return e && (s.gameObject = e), s;
}
},
remove: function (t, e, i) {
void 0 === e && (e = !0), void 0 === i && (i = !0), this.pipelines.delete(t), e && this.classes.delete(t), i && this.postPipelineClasses.delete(t);
},
set: function (t, e, i) {
if (!t.isPostFX) return this.isCurrent(t, i) || (this.flush(), this.current && this.current.unbind(), (this.current = t).bind(i)), t.updateProjectionMatrix(), t.onBind(e), t;
},
preBatch: function (t) {
if (t.hasPostPipeline) {
this.flush();
for (var e = t.postPipelines, i = e.length - 1; 0 <= i; i--) {
var n = e[i];
n.active && n.preBatch(t);
}
}
},
postBatch: function (t) {
if (t.hasPostPipeline) {
this.flush();
for (var e = t.postPipelines, i = 0; i < e.length; i++) {
var n = e[i];
n.active && n.postBatch(t);
}
}
},
preBatchCamera: function (t) {
if (t.hasPostPipeline) {
this.flush();
for (var e = t.postPipelines, i = e.length - 1; 0 <= i; i--) {
var n = e[i];
n.active && n.preBatch(t);
}
}
},
postBatchCamera: function (t) {
if (t.hasPostPipeline) {
this.flush();
for (var e = t.postPipelines, i = 0; i < e.length; i++) {
var n = e[i];
n.active && n.postBatch(t);
}
}
},
isCurrent: function (t, e) {
var i = this.renderer,
n = this.current;
return n && !e && (e = n.currentShader), !(n !== t || e.program !== i.currentProgram);
},
copyFrame: function (t, e, i, n, s) {
return this.setUtility(this.UTILITY_PIPELINE.copyShader).copyFrame(t, e, i, n, s), this;
},
copyToGame: function (t) {
return this.setUtility(this.UTILITY_PIPELINE.copyShader).copyToGame(t), this;
},
drawFrame: function (t, e, i, n) {
return this.setUtility(this.UTILITY_PIPELINE.colorMatrixShader).drawFrame(t, e, i, n), this;
},
blendFrames: function (t, e, i, n, s) {
return this.setUtility(this.UTILITY_PIPELINE.linearShader).blendFrames(t, e, i, n, s), this;
},
blendFramesAdditive: function (t, e, i, n, s) {
return this.setUtility(this.UTILITY_PIPELINE.addShader).blendFramesAdditive(t, e, i, n, s), this;
},
clearFrame: function (t, e) {
return this.UTILITY_PIPELINE.clearFrame(t, e), this;
},
blitFrame: function (t, e, i, n, s, r) {
return this.setUtility(this.UTILITY_PIPELINE.copyShader).blitFrame(t, e, i, n, s, r), this;
},
copyFrameRect: function (t, e, i, n, s, r, o, a) {
return this.UTILITY_PIPELINE.copyFrameRect(t, e, i, n, s, r, o, a), this;
},
forceZero: function () {
return this.current && this.current.forceZero;
},
setMulti: function () {
return this.set(this.MULTI_PIPELINE);
},
setUtility: function (t) {
return this.UTILITY_PIPELINE.bind(t);
},
rebind: function (t) {
void 0 === t && this.previous && (t = this.previous);
var e = this.renderer,
i = e.gl;
i.disable(i.DEPTH_TEST),
i.disable(i.CULL_FACE),
e.hasActiveStencilMask() ? i.clear(i.DEPTH_BUFFER_BIT) : (i.disable(i.STENCIL_TEST), i.clear(i.DEPTH_BUFFER_BIT | i.STENCIL_BUFFER_BIT)),
i.viewport(0, 0, e.width, e.height),
(e.currentProgram = null),
e.setBlendMode(0, !0);
var n = this.pipelines.entries;
for (var s in n) n[s].glReset = !0;
t && (this.current = t).rebind(), e.resetTextures();
},
clear: function () {
var t = this.renderer;
this.flush(), this.current ? (this.current.unbind(), (this.previous = this.current), (this.current = null)) : (this.previous = null), (t.currentProgram = null), t.setBlendMode(0, !0);
},
destroy: function () {
this.flush(),
this.classes.clear(),
this.postPipelineClasses.clear(),
this.pipelines.clear(),
(this.renderer = null),
(this.game = null),
(this.classes = null),
(this.postPipelineClasses = null),
(this.pipelines = null),
(this.current = null),
(this.previous = null);
},
});
t.exports = p;
},
function (t, e, i) {
var n = i(0),
s = i(2),
r = i(866),
o = i(867),
a = i(107),
h = i(58),
l = new n({
Extends: h,
initialize: function (t) {
(t.fragShader = s(t, "fragShader", r)),
(t.vertShader = s(t, "vertShader", o)),
(t.batchSize = s(t, "batchSize", 1)),
(t.vertices = s(t, "vertices", [-1, 1, -1, -7, 7, 1])),
(t.attributes = s(t, "attributes", [{ name: "inPosition", size: 2, type: a.FLOAT }])),
h.call(this, t);
},
boot: function () {
h.prototype.boot.call(this), this.set1i("uMainSampler", 0), this.set1i("uMaskSampler", 1);
},
resize: function (t, e) {
h.prototype.resize.call(this, t, e), this.set2f("uResolution", t, e);
},
beginMask: function (t, e, i) {
var n,
s = this.gl;
t.bitmapMask &&
s &&
((n = this.renderer).flush(),
n.pushFramebuffer(t.mainFramebuffer),
s.disable(s.STENCIL_TEST),
s.clearColor(0, 0, 0, 0),
s.clear(s.COLOR_BUFFER_BIT),
n.currentCameraMask.mask !== t && ((n.currentMask.mask = t), (n.currentMask.camera = i)));
},
endMask: function (t, e) {
var i,
n = this.gl,
s = this.renderer,
r = t.bitmapMask;
r &&
n &&
(s.flush(),
s.pushFramebuffer(t.maskFramebuffer),
n.clearColor(0, 0, 0, 0),
n.clear(n.COLOR_BUFFER_BIT),
s.setBlendMode(0, !0),
r.renderWebGL(s, r, e),
s.flush(),
s.popFramebuffer(),
s.popFramebuffer(),
(i = s.getCurrentStencilMask()) ? (n.enable(n.STENCIL_TEST), i.mask.applyStencil(s, i.camera, !0)) : (s.currentMask.mask = null),
s.pipelines.set(this),
n.activeTexture(n.TEXTURE1),
n.bindTexture(n.TEXTURE_2D, t.maskTexture),
n.activeTexture(n.TEXTURE0),
n.bindTexture(n.TEXTURE_2D, t.mainTexture),
this.set1i("uInvertMaskAlpha", t.invertAlpha),
n.drawArrays(this.topology, 0, 3),
s.resetTextures());
},
});
t.exports = l;
},
function (t, e, i) {
t.exports = { AFTER_FLUSH: i(868), BEFORE_FLUSH: i(869), BIND: i(870), BOOT: i(871), DESTROY: i(872), REBIND: i(873), RESIZE: i(874) };
},
function (t, e, i) {
var n = i(0),
d = i(2),
f = i(107),
s = new n({
initialize: function (t, e, i, n, s) {
(this.pipeline = t),
(this.name = e),
(this.renderer = t.renderer),
(this.gl = this.renderer.gl),
(this.program = this.renderer.createProgram(i, n)),
this.attributes,
(this.vertexComponentCount = 0),
(this.vertexSize = 0),
(this.uniforms = {}),
this.createAttributes(s),
this.createUniforms();
},
createAttributes: function (t) {
for (var e = 0, i = 0, n = [], s = (this.vertexComponentCount = 0); s < t.length; s++) {
var r = t[s],
o = r.name,
a = d(r, "size", 1),
h = d(r, "type", f.FLOAT),
l = h.enum,
u = h.size,
c = !!r.normalized;
n.push({ name: o, size: a, type: l, normalized: c, offset: i, enabled: !1, location: -1 }), 4 === u ? (e += a) : e++, (i += a * u);
}
(this.vertexSize = i), (this.vertexComponentCount = e), (this.attributes = n);
},
bind: function (t, e) {
return void 0 === t && (t = !1), void 0 === e && (e = !1), e && this.pipeline.flush(), this.renderer.setProgram(this.program), t && this.setAttribPointers(), this;
},
rebind: function () {
return this.renderer.setProgram(this.program), this.setAttribPointers(!0), this;
},
setAttribPointers: function (t) {
void 0 === t && (t = !1);
for (var e = this.gl, i = this.vertexSize, n = this.attributes, s = this.program, r = 0; r < n.length; r++) {
var o,
a = n[r],
h = a.size,
l = a.type,
u = a.offset,
c = a.enabled,
d = a.location,
f = !!a.normalized;
t
? 0 <= (o = e.getAttribLocation(s, a.name))
? (e.enableVertexAttribArray(o), e.vertexAttribPointer(o, h, l, f, i, u), (a.enabled = !0), (a.location = o))
: -1 !== o && e.disableVertexAttribArray(o)
: c
? e.vertexAttribPointer(d, h, l, f, i, u)
: !c && -1 < d && (e.disableVertexAttribArray(d), (a.location = -1));
}
return this;
},
createUniforms: function () {
for (var t, e, i = this.gl, n = this.program, s = this.uniforms, r = i.getProgramParameter(n, i.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
var a,
h = i.getActiveUniform(n, o);
h &&
((t = h.name),
null !== (e = i.getUniformLocation(n, t)) && (s[t] = { name: t, location: e, value1: null, value2: null, value3: null, value4: null }),
0 < (a = t.indexOf("[")) &&
((t = t.substr(0, a)), s.hasOwnProperty(t) || (null !== (e = i.getUniformLocation(n, t)) && (s[t] = { name: t, location: e, value1: null, value2: null, value3: null, value4: null }))));
}
return this;
},
hasUniform: function (t) {
return this.uniforms.hasOwnProperty(t);
},
resetUniform: function (t) {
var e = this.uniforms[t];
return e && ((e.value1 = null), (e.value2 = null), (e.value3 = null), (e.value4 = null)), this;
},
setUniform1: function (t, e, i, n) {
var s = this.uniforms[e];
return s && ((!n && s.value1 === i) || ((s.value1 = i), this.renderer.setProgram(this.program), t.call(this.gl, s.location, i), (this.pipeline.currentShader = this))), this;
},
setUniform2: function (t, e, i, n, s) {
var r = this.uniforms[e];
return (
r &&
((!s && r.value1 === i && r.value2 === n) || ((r.value1 = i), (r.value2 = n), this.renderer.setProgram(this.program), t.call(this.gl, r.location, i, n), (this.pipeline.currentShader = this))),
this
);
},
setUniform3: function (t, e, i, n, s, r) {
var o = this.uniforms[e];
return (
o &&
((!r && o.value1 === i && o.value2 === n && o.value3 === s) ||
((o.value1 = i), (o.value2 = n), (o.value3 = s), this.renderer.setProgram(this.program), t.call(this.gl, o.location, i, n, s), (this.pipeline.currentShader = this))),
this
);
},
setUniform4: function (t, e, i, n, s, r, o) {
var a = this.uniforms[e];
return (
a &&
((!o && a.value1 === i && a.value2 === n && a.value3 === s && a.value4 === r) ||
((a.value1 = i), (a.value2 = n), (a.value3 = s), (a.value4 = r), this.renderer.setProgram(this.program), t.call(this.gl, a.location, i, n, s, r), (this.pipeline.currentShader = this))),
this
);
},
set1f: function (t, e) {
return this.setUniform1(this.gl.uniform1f, t, e);
},
set2f: function (t, e, i) {
return this.setUniform2(this.gl.uniform2f, t, e, i);
},
set3f: function (t, e, i, n) {
return this.setUniform3(this.gl.uniform3f, t, e, i, n);
},
set4f: function (t, e, i, n, s) {
return this.setUniform4(this.gl.uniform4f, t, e, i, n, s);
},
set1fv: function (t, e) {
return this.setUniform1(this.gl.uniform1fv, t, e, !0);
},
set2fv: function (t, e) {
return this.setUniform1(this.gl.uniform2fv, t, e, !0);
},
set3fv: function (t, e) {
return this.setUniform1(this.gl.uniform3fv, t, e, !0);
},
set4fv: function (t, e) {
return this.setUniform1(this.gl.uniform4fv, t, e, !0);
},
set1iv: function (t, e) {
return this.setUniform1(this.gl.uniform1iv, t, e, !0);
},
set2iv: function (t, e) {
return this.setUniform1(this.gl.uniform2iv, t, e, !0);
},
set3iv: function (t, e) {
return this.setUniform1(this.gl.uniform3iv, t, e, !0);
},
set4iv: function (t, e) {
return this.setUniform1(this.gl.uniform4iv, t, e, !0);
},
set1i: function (t, e) {
return this.setUniform1(this.gl.uniform1i, t, e);
},
set2i: function (t, e, i) {
return this.setUniform2(this.gl.uniform2i, t, e, i);
},
set3i: function (t, e, i, n) {
return this.setUniform3(this.gl.uniform3i, t, e, i, n);
},
set4i: function (t, e, i, n, s) {
return this.setUniform4(this.gl.uniform4i, t, e, i, n, s);
},
setMatrix2fv: function (t, e, i) {
return this.setUniform2(this.gl.uniformMatrix2fv, t, e, i, !0);
},
setMatrix3fv: function (t, e, i) {
return this.setUniform2(this.gl.uniformMatrix3fv, t, e, i, !0);
},
setMatrix4fv: function (t, e, i) {
return this.setUniform2(this.gl.uniformMatrix4fv, t, e, i, !0);
},
destroy: function () {
this.gl.deleteProgram(this.program), (this.pipeline = null), (this.renderer = null), (this.gl = null), (this.program = null), (this.attributes = null), (this.uniforms = null);
},
});
t.exports = s;
},
function (t, e, i) {
var n = i(0),
M = i(59),
s = i(2),
r = i(875),
o = i(876),
a = i(25),
h = i(107),
l = i(58),
u = new n({
Extends: l,
initialize: function (t) {
(t.fragShader = s(t, "fragShader", r)),
(t.vertShader = s(t, "vertShader", o)),
(t.attributes = s(t, "attributes", [
{ name: "inPosition", size: 2 },
{ name: "inColor", size: 4, type: h.UNSIGNED_BYTE, normalized: !0 },
])),
l.call(this, t),
(this.calcMatrix = new a()),
(this.tempTriangle = [
{ x: 0, y: 0, width: 0 },
{ x: 0, y: 0, width: 0 },
{ x: 0, y: 0, width: 0 },
{ x: 0, y: 0, width: 0 },
]),
(this.strokeTint = { TL: 0, TR: 0, BL: 0, BR: 0 }),
(this.fillTint = { TL: 0, TR: 0, BL: 0, BR: 0 }),
(this.currentFrame = { u0: 0, v0: 0, u1: 1, v1: 1 }),
(this.firstQuad = [0, 0, 0, 0, 0]),
(this.prevQuad = [0, 0, 0, 0, 0]),
(this.polygonCache = []);
},
batchFillRect: function (t, e, i, n, s, r) {
this.renderer.pipelines.set(this);
var o = this.calcMatrix;
r && r.multiply(s, o);
var a = t + i,
h = e + n,
l = o.getX(t, e),
u = o.getY(t, e),
c = o.getX(t, h),
d = o.getY(t, h),
f = o.getX(a, h),
p = o.getY(a, h),
g = o.getX(a, e),
v = o.getY(a, e),
y = this.fillTint;
this.batchQuad(l, u, c, d, f, p, g, v, y.TL, y.TR, y.BL, y.BR);
},
batchFillTriangle: function (t, e, i, n, s, r, o, a) {
this.renderer.pipelines.set(this);
var h = this.calcMatrix;
a && a.multiply(o, h);
var l = h.getX(t, e),
u = h.getY(t, e),
c = h.getX(i, n),
d = h.getY(i, n),
f = h.getX(s, r),
p = h.getY(s, r),
g = this.fillTint;
this.batchTri(l, u, c, d, f, p, g.TL, g.TR, g.BL);
},
batchStrokeTriangle: function (t, e, i, n, s, r, o, a, h) {
var l = this.tempTriangle;
(l[0].x = t),
(l[0].y = e),
(l[0].width = o),
(l[1].x = i),
(l[1].y = n),
(l[1].width = o),
(l[2].x = s),
(l[2].y = r),
(l[2].width = o),
(l[3].x = t),
(l[3].y = e),
(l[3].width = o),
this.batchStrokePath(l, o, !1, a, h);
},
batchFillPath: function (t, e, i) {
this.renderer.pipelines.set(this);
var n = this.calcMatrix;
i && i.multiply(e, n);
for (var s, r, o = t.length, a = this.polygonCache, h = this.fillTint.TL, l = this.fillTint.TR, u = this.fillTint.BL, c = 0; c < o; ++c) (r = t[c]), a.push(r.x, r.y);
o = (s = M(a)).length;
for (var d = 0; d < o; d += 3) {
var f = 2 * s[d + 0],
p = 2 * s[d + 1],
g = 2 * s[d + 2],
v = a[0 + f],
y = a[1 + f],
m = a[0 + p],
x = a[1 + p],
b = a[0 + g],
w = a[1 + g],
T = n.getX(v, y),
S = n.getY(v, y),
_ = n.getX(m, x),
E = n.getY(m, x),
P = n.getX(b, w),
A = n.getY(b, w);
this.batchTri(T, S, _, E, P, A, h, l, u);
}
a.length = 0;
},
batchStrokePath: function (t, e, i, n, s) {
this.renderer.pipelines.set(this), (this.prevQuad[4] = 0), (this.firstQuad[4] = 0);
for (var r = t.length - 1, o = 0; o < r; o++) {
var a = t[o],
h = t[o + 1];
this.batchLine(a.x, a.y, h.x, h.y, a.width / 2, h.width / 2, e, o, !i && o === r - 1, n, s);
}
},
batchLine: function (t, e, i, n, s, r, o, a, h, l, u) {
this.renderer.pipelines.set(this);
var c = this.calcMatrix;
u && u.multiply(l, c);
var d,
f,
p = i - t,
g = n - e,
v = Math.sqrt(p * p + g * g),
y = (s * (n - e)) / v,
m = (s * (t - i)) / v,
x = (r * (n - e)) / v,
b = (r * (t - i)) / v,
w = i - x,
T = n - b,
S = t - y,
_ = e - m,
E = i + x,
P = n + b,
A = t + y,
M = e + m,
C = c.getX(w, T),
O = c.getY(w, T),
k = c.getX(S, _),
R = c.getY(S, _),
L = c.getX(E, P),
I = c.getY(E, P),
D = c.getX(A, M),
F = c.getY(A, M),
B = this.strokeTint,
N = B.TL,
U = B.TR,
Y = B.BL,
z = B.BR;
this.batchQuad(D, F, k, R, C, O, L, I, N, U, Y, z),
o <= 2 ||
((d = this.prevQuad),
(f = this.firstQuad),
0 < a && d[4] ? this.batchQuad(D, F, k, R, d[0], d[1], d[2], d[3], N, U, Y, z) : ((f[0] = D), (f[1] = F), (f[2] = k), (f[3] = R), (f[4] = 1)),
h && f[4] ? this.batchQuad(C, O, L, I, f[0], f[1], f[2], f[3], N, U, Y, z) : ((d[0] = C), (d[1] = O), (d[2] = L), (d[3] = I), (d[4] = 1)));
},
batchVert: function (t, e, i) {
var n = this.vertexViewF32,
s = this.vertexViewU32,
r = this.vertexCount * this.currentShader.vertexComponentCount - 1;
(n[++r] = t), (n[++r] = e), (s[++r] = i), this.vertexCount++;
},
batchQuad: function (t, e, i, n, s, r, o, a, h, l, u, c) {
var d = !1;
return (
this.shouldFlush(6) && (this.flush(), (d = !0)),
this.batchVert(t, e, h),
this.batchVert(i, n, u),
this.batchVert(s, r, c),
this.batchVert(t, e, h),
this.batchVert(s, r, c),
this.batchVert(o, a, l),
d
);
},
batchTri: function (t, e, i, n, s, r, o, a, h) {
var l = !1;
return this.shouldFlush(3) && (this.flush(), (l = !0)), this.batchVert(t, e, o), this.batchVert(i, n, a), this.batchVert(s, r, h), l;
},
destroy: function () {
return l.prototype.destroy.call(this), (this.polygonCache = null), this;
},
});
t.exports = u;
},
function (t, e, i) {
var n = i(0),
s = i(2),
r = i(877),
R = i(108),
o = i(3),
a = i(58),
h = 10,
c = new o(),
l = new n({
Extends: R,
initialize: function (t) {
h = t.game.renderer.config.maxLights;
for (var e = s(t, "fragShader", r), i = [], n = 1; n <= h; n++) i.push({ name: "lights" + n, fragShader: e.replace("%LIGHT_COUNT%", n.toString()) });
(t.shaders = i), R.call(this, t), (this.inverseRotationMatrix = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1])), this.defaultNormalMap, (this.lightsActive = !0);
},
boot: function () {
a.prototype.boot.call(this);
var t = this.gl,
e = t.createTexture();
t.activeTexture(t.TEXTURE0),
t.bindTexture(t.TEXTURE_2D, e),
t.texImage2D(t.TEXTURE_2D, 0, t.RGBA, 1, 1, 0, t.RGBA, t.UNSIGNED_BYTE, new Uint8Array([127, 127, 255, 255])),
(this.defaultNormalMap = { glTexture: e });
for (var i = 0; i < this.shaders.length; i++) this["lightShader" + (i + 1)] = this.shaders[i];
},
onRender: function (t, e) {
var i = t.sys.lights;
if (((this.lightsActive = !1), i && i.active)) {
var n,
s = i.getLights(e),
r = s.length;
if (0 !== r) {
(this.lightsActive = !0), this.setShader(this["lightShader" + r], !0);
var o = this.renderer.height,
a = e.matrix;
for (
this.set1i("uMainSampler", 0),
this.set1i("uNormSampler", 1),
this.set2f("uResolution", this.width / 2, this.height / 2),
this.set4f("uCamera", e.x, e.y, e.rotation, e.zoom),
this.set3f("uAmbientLightColor", i.ambientColor.r, i.ambientColor.g, i.ambientColor.b),
n = 0;
n < r;
n++
) {
var h = s[n].light,
l = h.color,
u = "uLights[" + n + "].";
a.transformPoint(h.x, h.y, c),
this.set2f(u + "position", c.x - e.scrollX * h.scrollFactorX * e.zoom, o - (c.y - e.scrollY * h.scrollFactorY * e.zoom)),
this.set3f(u + "color", l.r, l.g, l.b),
this.set1f(u + "intensity", h.intensity),
this.set1f(u + "radius", h.radius);
}
this.currentNormalMapRotation = null;
}
}
},
setNormalMapRotation: function (t) {
var e, i, n, s;
(t === this.currentNormalMapRotation && 0 !== this.vertexCount) ||
(0 < this.vertexCount && this.flush(),
(e = this.inverseRotationMatrix),
t ? ((i = -t), (n = Math.cos(i)), (s = Math.sin(i)), (e[1] = s), (e[3] = -s), (e[0] = e[4] = n)) : ((e[0] = e[4] = 1), (e[1] = e[3] = 0)),
this.setMatrix3fv("uInverseRotationMatrix", !1, e),
(this.currentNormalMapRotation = t));
},
setTexture2D: function (t, e) {
var i = this.renderer;
void 0 === t && (t = i.tempTextures[0]);
var n = this.getNormalMap(e);
i.isNewNormalMap(t, n) && (this.flush(), i.setTextureZero(t), i.setNormalMap(n));
var s = e ? e.rotation : 0;
return this.setNormalMapRotation(s), (this.currentUnit = 0);
},
setGameObject: function (t, e) {
void 0 === e && (e = t.frame);
var i = this.renderer,
n = e.glTexture,
s = this.getNormalMap(t);
return i.isNewNormalMap() && (this.flush(), i.setTextureZero(n), i.setNormalMap(s)), this.setNormalMapRotation(t.rotation), (this.currentUnit = 0);
},
getNormalMap: function (t) {
var e;
return (
t
? t.displayTexture
? (e = t.displayTexture.dataSource[t.displayFrame.sourceIndex])
: t.texture
? (e = t.texture.dataSource[t.frame.sourceIndex])
: t.tileset && (e = Array.isArray(t.tileset) ? t.tileset[0].image.dataSource[0] : t.tileset.image.dataSource[0])
: (e = this.defaultNormalMap),
(e = e || this.defaultNormalMap).glTexture
);
},
batchSprite: function (t, e, i) {
this.lightsActive && R.prototype.batchSprite.call(this, t, e, i);
},
batchTexture: function (t, e, i, n, s, r, o, a, h, l, u, c, d, f, p, g, v, y, m, x, b, w, T, S, _, E, P, A, M, C, O, k) {
this.lightsActive && R.prototype.batchTexture.call(this, t, e, i, n, s, r, o, a, h, l, u, c, d, f, p, g, v, y, m, x, b, w, T, S, _, E, P, A, M, C, O, k);
},
batchTextureFrame: function (t, e, i, n, s, r, o) {
this.lightsActive && R.prototype.batchTextureFrame.call(this, t, e, i, n, s, r, o);
},
});
(l.LIGHT_COUNT = h), (t.exports = l);
},
function (t, e, i) {
var n = i(0),
s = i(2),
r = i(880),
o = i(881),
a = i(58),
h = new n({
Extends: a,
initialize: function (t) {
(t.vertShader = s(t, "vertShader", o)),
(t.fragShader = s(t, "fragShader", r)),
(t.attributes = s(t, "attributes", [
{ name: "inPosition", size: 2 },
{ name: "inLightPosition", size: 2 },
{ name: "inLightRadius" },
{ name: "inLightAttenuation" },
{ name: "inLightColor", size: 4 },
])),
a.call(this, t);
},
onRender: function (t, e) {
this.set2f("uResolution", this.width, this.height), this.set1f("uCameraZoom", e.zoom);
},
batchPointLight: function (t, e, i, n, s, r, o, a, h, l, u, c) {
var d = t.color,
f = t.intensity,
p = t.radius,
g = t.attenuation,
v = d.r * f,
y = d.g * f,
m = d.b * f,
x = e.alpha * t.alpha;
this.shouldFlush(6) && this.flush(),
this.batchLightVert(i, n, u, c, p, g, v, y, m, x),
this.batchLightVert(s, r, u, c, p, g, v, y, m, x),
this.batchLightVert(o, a, u, c, p, g, v, y, m, x),
this.batchLightVert(i, n, u, c, p, g, v, y, m, x),
this.batchLightVert(o, a, u, c, p, g, v, y, m, x),
this.batchLightVert(h, l, u, c, p, g, v, y, m, x);
},
batchLightVert: function (t, e, i, n, s, r, o, a, h, l) {
var u = this.vertexViewF32,
c = this.vertexCount * this.currentShader.vertexComponentCount - 1;
(u[++c] = t), (u[++c] = e), (u[++c] = i), (u[++c] = n), (u[++c] = s), (u[++c] = r), (u[++c] = o), (u[++c] = a), (u[++c] = h), (u[++c] = l), this.vertexCount++;
},
});
t.exports = h;
},
function (t, e, i) {
var n = i(0),
s = i(2),
r = i(108),
o = new n({
Extends: r,
initialize: function (t) {
(t.topology = 5), (t.batchSize = s(t, "batchSize", 256)), r.call(this, t);
},
});
t.exports = o;
},
function (t, e, i) {
var n = i(0),
s = i(2),
r = i(108),
o = i(882),
a = i(883),
h = i(58),
l = new n({
Extends: r,
initialize: function (t) {
(t.fragShader = s(t, "fragShader", o)), (t.vertShader = s(t, "vertShader", a)), (t.forceZero = !0), r.call(this, t);
},
boot: function () {
h.prototype.boot.call(this), this.set1i("uMainSampler", 0);
},
});
t.exports = l;
},
function (t, e, i) {
var n = i(884),
l = i(35),
s = i(0),
r = i(198),
o = i(885),
a = i(886),
h = i(2),
u = i(887),
c = i(382),
d = i(58),
f = new s({
Extends: d,
initialize: function (t) {
(t.renderTarget = h(t, "renderTarget", [{ scale: 1 }, { scale: 1 }, { scale: 0.5 }, { scale: 0.5 }])),
(t.vertShader = h(t, "vertShader", c)),
(t.shaders = h(t, "shaders", [
{ name: "Copy", fragShader: a },
{ name: "AddBlend", fragShader: n },
{ name: "LinearBlend", fragShader: u },
{ name: "ColorMatrix", fragShader: o },
])),
(t.attributes = h(t, "attributes", [
{ name: "inPosition", size: 2 },
{ name: "inTexCoord", size: 2 },
])),
(t.vertices = [-1, -1, 0, 0, -1, 1, 0, 1, 1, 1, 1, 1, -1, -1, 0, 0, 1, 1, 1, 1, 1, -1, 1, 0]),
(t.batchSize = 1),
d.call(this, t),
(this.colorMatrix = new r()),
this.copyShader,
this.addShader,
this.linearShader,
this.colorMatrixShader,
this.fullFrame1,
this.fullFrame2,
this.halfFrame1,
this.halfFrame2;
},
boot: function () {
d.prototype.boot.call(this);
var t = this.shaders,
e = this.renderTargets;
(this.copyShader = t[0]),
(this.addShader = t[1]),
(this.linearShader = t[2]),
(this.colorMatrixShader = t[3]),
(this.fullFrame1 = e[0]),
(this.fullFrame2 = e[1]),
(this.halfFrame1 = e[2]),
(this.halfFrame2 = e[3]);
},
copyFrame: function (t, e, i, n, s) {
void 0 === i && (i = 1), void 0 === n && (n = !0), void 0 === s && (s = !0);
var r = this.gl;
this.setShader(this.copyShader),
this.set1i("uMainSampler", 0),
this.set1f("uBrightness", i),
r.activeTexture(r.TEXTURE0),
r.bindTexture(r.TEXTURE_2D, t.texture),
e
? (r.viewport(0, 0, e.width, e.height), r.bindFramebuffer(r.FRAMEBUFFER, e.framebuffer), r.framebufferTexture2D(r.FRAMEBUFFER, r.COLOR_ATTACHMENT0, r.TEXTURE_2D, e.texture, 0))
: r.viewport(0, 0, t.width, t.height),
n && (s ? r.clearColor(0, 0, 0, 0) : r.clearColor(0, 0, 0, 1), r.clear(r.COLOR_BUFFER_BIT)),
r.bufferData(r.ARRAY_BUFFER, this.vertexData, r.STATIC_DRAW),
r.drawArrays(r.TRIANGLES, 0, 6),
r.bindFramebuffer(r.FRAMEBUFFER, null),
r.bindTexture(r.TEXTURE_2D, null);
},
blitFrame: function (t, e, i, n, s, r) {
void 0 === i && (i = 1), void 0 === n && (n = !0), void 0 === s && (s = !0), void 0 === r && (r = !1);
var o,
a,
h = this.gl;
this.setShader(this.copyShader),
this.set1i("uMainSampler", 0),
this.set1f("uBrightness", i),
h.activeTexture(h.TEXTURE0),
h.bindTexture(h.TEXTURE_2D, t.texture),
t.height > e.height ? (h.viewport(0, 0, t.width, t.height), this.setTargetUVs(t, e)) : ((o = e.height - t.height), h.viewport(0, o, t.width, t.height)),
h.bindFramebuffer(h.FRAMEBUFFER, e.framebuffer),
h.framebufferTexture2D(h.FRAMEBUFFER, h.COLOR_ATTACHMENT0, h.TEXTURE_2D, e.texture, 0),
n && (s ? h.clearColor(0, 0, 0, 0) : h.clearColor(0, 0, 0, 1), h.clear(h.COLOR_BUFFER_BIT)),
r && ((a = this.renderer.currentBlendMode), this.renderer.setBlendMode(l.ERASE)),
h.bufferData(h.ARRAY_BUFFER, this.vertexData, h.STATIC_DRAW),
h.drawArrays(h.TRIANGLES, 0, 6),
r && this.renderer.setBlendMode(a),
h.bindFramebuffer(h.FRAMEBUFFER, null),
h.bindTexture(h.TEXTURE_2D, null),
this.resetUVs();
},
copyFrameRect: function (t, e, i, n, s, r, o, a) {
void 0 === o && (o = !0), void 0 === a && (a = !0);
var h = this.gl;
h.bindFramebuffer(h.FRAMEBUFFER, t.framebuffer),
h.framebufferTexture2D(h.FRAMEBUFFER, h.COLOR_ATTACHMENT0, h.TEXTURE_2D, t.texture, 0),
o && (a ? h.clearColor(0, 0, 0, 0) : h.clearColor(0, 0, 0, 1), h.clear(h.COLOR_BUFFER_BIT)),
h.activeTexture(h.TEXTURE0),
h.bindTexture(h.TEXTURE_2D, e.texture),
h.copyTexSubImage2D(h.TEXTURE_2D, 0, 0, 0, i, n, s, r),
h.bindFramebuffer(h.FRAMEBUFFER, null),
h.bindTexture(h.TEXTURE_2D, null);
},
copyToGame: function (t) {
var e = this.gl;
this.setShader(this.copyShader),
this.set1i("uMainSampler", 0),
this.set1f("uBrightness", 1),
this.renderer.popFramebuffer(),
e.activeTexture(e.TEXTURE0),
e.bindTexture(e.TEXTURE_2D, t.texture),
e.bufferData(e.ARRAY_BUFFER, this.vertexData, e.STATIC_DRAW),
e.drawArrays(e.TRIANGLES, 0, 6),
this.renderer.resetTextures();
},
drawFrame: function (t, e, i, n) {
void 0 === i && (i = !0), void 0 === n && (n = this.colorMatrix);
var s = this.gl;
this.setShader(this.colorMatrixShader),
this.set1i("uMainSampler", 0),
this.set1fv("uColorMatrix", n.getData()),
this.set1f("uAlpha", n.alpha),
s.activeTexture(s.TEXTURE0),
s.bindTexture(s.TEXTURE_2D, t.texture),
e
? (s.viewport(0, 0, e.width, e.height), s.bindFramebuffer(s.FRAMEBUFFER, e.framebuffer), s.framebufferTexture2D(s.FRAMEBUFFER, s.COLOR_ATTACHMENT0, s.TEXTURE_2D, e.texture, 0))
: s.viewport(0, 0, t.width, t.height),
i ? s.clearColor(0, 0, 0, 0) : s.clearColor(0, 0, 0, 1),
s.clear(s.COLOR_BUFFER_BIT),
s.bufferData(s.ARRAY_BUFFER, this.vertexData, s.STATIC_DRAW),
s.drawArrays(s.TRIANGLES, 0, 6),
s.bindFramebuffer(s.FRAMEBUFFER, null),
s.bindTexture(s.TEXTURE_2D, null);
},
blendFrames: function (t, e, i, n, s, r) {
void 0 === n && (n = 1), void 0 === s && (s = !0), void 0 === r && (r = this.linearShader);
var o = this.gl;
this.setShader(r),
this.set1i("uMainSampler1", 0),
this.set1i("uMainSampler2", 1),
this.set1f("uStrength", n),
o.activeTexture(o.TEXTURE0),
o.bindTexture(o.TEXTURE_2D, t.texture),
o.activeTexture(o.TEXTURE1),
o.bindTexture(o.TEXTURE_2D, e.texture),
i
? (o.bindFramebuffer(o.FRAMEBUFFER, i.framebuffer), o.framebufferTexture2D(o.FRAMEBUFFER, o.COLOR_ATTACHMENT0, o.TEXTURE_2D, i.texture, 0), o.viewport(0, 0, i.width, i.height))
: o.viewport(0, 0, t.width, t.height),
s ? o.clearColor(0, 0, 0, 0) : o.clearColor(0, 0, 0, 1),
o.clear(o.COLOR_BUFFER_BIT),
o.bufferData(o.ARRAY_BUFFER, this.vertexData, o.STATIC_DRAW),
o.drawArrays(o.TRIANGLES, 0, 6),
o.bindFramebuffer(o.FRAMEBUFFER, null),
o.bindTexture(o.TEXTURE_2D, null);
},
blendFramesAdditive: function (t, e, i, n, s) {
this.blendFrames(t, e, i, n, s, this.addShader);
},
clearFrame: function (t, e) {
void 0 === e && (e = !0);
var i = this.gl;
i.viewport(0, 0, t.width, t.height), i.bindFramebuffer(i.FRAMEBUFFER, t.framebuffer), e ? i.clearColor(0, 0, 0, 0) : i.clearColor(0, 0, 0, 1), i.clear(i.COLOR_BUFFER_BIT);
var n = this.renderer.currentFramebuffer;
i.bindFramebuffer(i.FRAMEBUFFER, n);
},
setUVs: function (t, e, i, n, s, r, o, a) {
var h = this.vertexViewF32;
(h[2] = t), (h[3] = e), (h[6] = i), (h[7] = n), (h[10] = s), (h[11] = r), (h[14] = t), (h[15] = e), (h[18] = s), (h[19] = r), (h[22] = o), (h[23] = a);
},
setTargetUVs: function (t, e) {
var i = 0.5 < (i = e.height / t.height) ? 0.5 - (i - 0.5) : 0.5 - i + 0.5;
this.setUVs(0, i, 0, 1 + i, 1, 1 + i, 1, i);
},
flipX: function () {
this.setUVs(1, 0, 1, 1, 0, 1, 0, 0);
},
flipY: function () {
this.setUVs(0, 1, 0, 0, 1, 0, 1, 1);
},
resetUVs: function () {
this.setUVs(0, 0, 0, 1, 1, 1, 1, 0);
},
});
t.exports = f;
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_QUAD_VS",
"",
"precision mediump float;",
"",
"attribute vec2 inPosition;",
"attribute vec2 inTexCoord;",
"",
"varying vec2 outFragCoord;",
"varying vec2 outTexCoord;",
"",
"void main ()",
"{",
" outFragCoord = inPosition.xy * 0.5 + 0.5;",
" outTexCoord = inTexCoord;",
"",
" gl_Position = vec4(inPosition, 0, 1);",
"}",
"",
].join("\n");
},
function (t, e, i) {
var P = i(31),
A = i(38),
M = i(2);
t.exports = function (t, e) {
var i = t.getContext("experimental-webgl"),
n = M(e, "callback"),
s = M(e, "type", "image/png"),
r = M(e, "encoder", 0.92),
o = M(e, "x", 0),
a = M(e, "y", 0),
h = M(e, "getPixel", !1),
l = M(e, "isFramebuffer", !1),
u = l ? M(e, "bufferWidth", 1) : i.drawingBufferWidth,
c = l ? M(e, "bufferHeight", 1) : i.drawingBufferHeight;
if (h) {
var d = new Uint8Array(4),
f = l ? a : c - a;
i.readPixels(o, f, 1, 1, i.RGBA, i.UNSIGNED_BYTE, d), n.call(null, new A(d[0], d[1], d[2], d[3] / 255));
} else {
var p = M(e, "width", u),
g = M(e, "height", c),
v = new Uint8Array(p * g * 4);
i.readPixels(o, c - a - g, p, g, i.RGBA, i.UNSIGNED_BYTE, v);
for (var y = P.createWebGL(this, p, g), m = y.getContext("2d"), x = m.getImageData(0, 0, p, g), b = x.data, w = 0; w < g; w++)
for (var T = 0; T < p; T++) {
var S = 4 * ((g - w - 1) * p + T),
_ = 4 * (w * p + T);
(b[0 + _] = v[0 + S]), (b[1 + _] = v[1 + S]), (b[2 + _] = v[2 + S]), (b[3 + _] = v[3 + S]);
}
m.putImageData(x, 0, 0);
var E = new Image();
(E.onerror = function () {
n.call(null), P.remove(y);
}),
(E.onload = function () {
n.call(null, E), P.remove(y);
}),
(E.src = y.toDataURL(s, r));
}
};
},
function (t, e, i) {
var l = i(33);
t.exports = function (t) {
var e,
i,
n,
s,
r,
o,
a,
h = t.config;
h.hideBanner ||
((e = "WebGL"),
h.renderType === l.CANVAS ? (e = "Canvas") : h.renderType === l.HEADLESS && (e = "Headless"),
(i = h.audio),
(a = (n = t.device.audio).webAudio && !i.disableWebAudio ? "Web Audio" : i.noAudio || (!n.webAudio && !n.audioData) ? "No Audio" : "HTML5 Audio"),
t.device.browser.ie
? window.console
: ((r = [(s = "")]),
Array.isArray(h.bannerBackgroundColor)
? (h.bannerBackgroundColor.forEach(function (t) {
(s = s.concat("%c ")), r.push("background: " + t), (o = t);
}),
(r[r.length - 1] = "color: " + h.bannerTextColor + "; background: " + o))
: ((s = s.concat("%c ")), r.push("color: " + h.bannerTextColor + "; background: " + h.bannerBackgroundColor)),
r.push("background: transparent"),
h.gameTitle && ((s = s.concat(h.gameTitle)), h.gameVersion && (s = s.concat(" v" + h.gameVersion)), h.hidePhaser || (s = s.concat(" / "))),
h.hidePhaser || (s = s.concat("Phaser v" + l.VERSION + " (" + e + " | " + a + ")")),
(s = s.concat(" %c " + h.gameURL)),
(r[0] = s)));
};
},
function (t, e, i) {
var n = i(0),
s = i(6),
r = i(1),
o = i(386),
a = new n({
initialize: function (t, e) {
(this.game = t),
(this.raf = new o()),
(this.started = !1),
(this.running = !1),
(this.minFps = s(e, "min", 5)),
(this.targetFps = s(e, "target", 60)),
(this._min = 1e3 / this.minFps),
(this._target = 1e3 / this.targetFps),
(this.actualFps = this.targetFps),
(this.nextFpsUpdate = 0),
(this.framesThisSecond = 0),
(this.callback = r),
(this.forceSetTimeOut = s(e, "forceSetTimeOut", !1)),
(this.time = 0),
(this.startTime = 0),
(this.lastTime = 0),
(this.frame = 0),
(this.inFocus = !0),
(this._pauseTime = 0),
(this._coolDown = 0),
(this.delta = 0),
(this.deltaIndex = 0),
(this.deltaHistory = []),
(this.deltaSmoothingMax = s(e, "deltaHistory", 10)),
(this.panicMax = s(e, "panicMax", 120)),
(this.rawDelta = 0),
(this.now = 0),
(this.smoothStep = s(e, "smoothStep", !0));
},
blur: function () {
this.inFocus = !1;
},
focus: function () {
(this.inFocus = !0), this.resetDelta();
},
pause: function () {
this._pauseTime = window.performance.now();
},
resume: function () {
this.resetDelta(), (this.startTime += this.time - this._pauseTime);
},
resetDelta: function () {
var t = window.performance.now();
(this.time = t), (this.lastTime = t), (this.nextFpsUpdate = t + 1e3);
for (var e = (this.framesThisSecond = 0); e < this.deltaSmoothingMax; e++) this.deltaHistory[e] = Math.min(this._target, this.deltaHistory[e]);
(this.delta = 0), (this.deltaIndex = 0), (this._coolDown = this.panicMax);
},
start: function (t) {
if (this.started) return this;
(this.started = !0), (this.running = !0);
for (var e = 0; e < this.deltaSmoothingMax; e++) this.deltaHistory[e] = this._target;
this.resetDelta(), (this.startTime = window.performance.now()), (this.callback = t), this.raf.start(this.step.bind(this), this.forceSetTimeOut, this._target);
},
step: function () {
var t = window.performance.now(),
e = (this.now = t) - this.lastTime;
e < 0 && (e = 0), (this.rawDelta = e);
var i = this.deltaIndex,
n = this.deltaHistory,
s = this.deltaSmoothingMax,
r = e,
o = e;
if (this.smoothStep) {
(0 < this._coolDown || !this.inFocus) && (this._coolDown--, (r = Math.min(r, this._target))),
r > this._min && ((r = n[i]), (r = Math.min(r, this._min))),
(n[i] = r),
this.deltaIndex++,
this.deltaIndex > s && (this.deltaIndex = 0);
for (var a = (o = 0); a < s; a++) o += n[a];
o /= s;
}
(this.delta = o),
(this.time += this.rawDelta),
t > this.nextFpsUpdate && ((this.actualFps = 0.25 * this.framesThisSecond + 0.75 * this.actualFps), (this.nextFpsUpdate = t + 1e3), (this.framesThisSecond = 0)),
this.framesThisSecond++;
var h = o / this._target;
this.callback(t, o, h), (this.lastTime = t), this.frame++;
},
tick: function () {
this.step();
},
sleep: function () {
this.running && (this.raf.stop(), (this.running = !1));
},
wake: function (t) {
this.running || (t && (this.startTime += -this.lastTime + (this.lastTime + window.performance.now())), this.raf.start(this.step.bind(this), this.useRAF), (this.running = !0), this.step());
},
getDuration: function () {
return Math.round(this.lastTime - this.startTime) / 1e3;
},
getDurationMS: function () {
return Math.round(this.lastTime - this.startTime);
},
stop: function () {
return (this.running = !1), (this.started = !1), this.raf.stop(), this;
},
destroy: function () {
this.stop(), (this.callback = r), (this.raf = null), (this.game = null);
},
});
t.exports = a;
},
function (t, e, i) {
var n = i(0),
s = i(1),
r = new n({
initialize: function () {
(this.isRunning = !1), (this.callback = s), (this.tick = 0), (this.isSetTimeOut = !1), (this.timeOutID = null), (this.lastTime = 0), (this.target = 0);
var n = this;
(this.step = function t() {
var e = window.performance.now();
(n.lastTime = n.tick), (n.tick = e), n.callback(e), (n.timeOutID = window.requestAnimationFrame(t));
}),
(this.stepTimeout = function t() {
var e = Date.now(),
i = Math.min(Math.max(2 * n.target + n.tick - e, 0), n.target);
(n.lastTime = n.tick), (n.tick = e), n.callback(e), (n.timeOutID = window.setTimeout(t, i));
});
},
start: function (t, e, i) {
this.isRunning ||
((this.callback = t), (this.isSetTimeOut = e), (this.target = i), (this.isRunning = !0), (this.timeOutID = e ? window.setTimeout(this.stepTimeout, 0) : window.requestAnimationFrame(this.step)));
},
stop: function () {
(this.isRunning = !1), this.isSetTimeOut ? clearTimeout(this.timeOutID) : window.cancelAnimationFrame(this.timeOutID);
},
destroy: function () {
this.stop(), (this.callback = s);
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(22);
t.exports = function (t) {
var e,
i = t.events;
void 0 !== document.hidden
? (e = "visibilitychange")
: ["webkit", "moz", "ms"].forEach(function (t) {
void 0 !== document[t + "Hidden"] &&
((document.hidden = function () {
return document[t + "Hidden"];
}),
(e = t + "visibilitychange"));
}),
e &&
document.addEventListener(
e,
function (t) {
document.hidden || "pause" === t.type ? i.emit(n.HIDDEN) : i.emit(n.VISIBLE);
},
!1
),
(window.onblur = function () {
i.emit(n.BLUR);
}),
(window.onfocus = function () {
i.emit(n.FOCUS);
}),
window.focus && t.config.autoFocus && window.focus();
};
},
function (t, e, i) {
var y = i(389),
m = i(31),
x = i(6);
t.exports = function (t) {
var e = x(t, "data", []),
i = x(t, "canvas", null),
n = x(t, "palette", y),
s = x(t, "pixelWidth", 1),
r = x(t, "pixelHeight", s),
o = x(t, "resizeCanvas", !0),
a = x(t, "clearCanvas", !0),
h = x(t, "preRender", null),
l = x(t, "postRender", null),
u = Math.floor(Math.abs(e[0].length * s)),
c = Math.floor(Math.abs(e.length * r));
i || ((i = m.create2D(this, u, c)), (a = o = !1)), o && ((i.width = u), (i.height = c));
var d = i.getContext("2d");
a && d.clearRect(0, 0, u, c), h && h(i, d);
for (var f = 0; f < e.length; f++)
for (var p = e[f], g = 0; g < p.length; g++) {
var v = p[g];
"." !== v && " " !== v && ((d.fillStyle = n[v]), d.fillRect(g * s, f * r, s, r));
}
return l && l(i, d), i;
};
},
function (t, e) {
t.exports = {
0: "#000",
1: "#9D9D9D",
2: "#FFF",
3: "#BE2633",
4: "#E06F8B",
5: "#493C2B",
6: "#A46422",
7: "#EB8931",
8: "#F7E26B",
9: "#2F484E",
A: "#44891A",
B: "#A3CE27",
C: "#1B2632",
D: "#005784",
E: "#31A2F2",
F: "#B2DCEF",
};
},
function (t, e, i) {
var n = i(0),
o = i(358),
s = i(94),
a = i(3),
h = new n({
Extends: s,
initialize: function (t, e, i, n) {
s.call(this, "CubicBezierCurve"),
Array.isArray(t) && ((n = new a(t[6], t[7])), (i = new a(t[4], t[5])), (e = new a(t[2], t[3])), (t = new a(t[0], t[1]))),
(this.p0 = t),
(this.p1 = e),
(this.p2 = i),
(this.p3 = n);
},
getStartPoint: function (t) {
return void 0 === t && (t = new a()), t.copy(this.p0);
},
getResolution: function (t) {
return t;
},
getPoint: function (t, e) {
void 0 === e && (e = new a());
var i = this.p0,
n = this.p1,
s = this.p2,
r = this.p3;
return e.set(o(t, i.x, n.x, s.x, r.x), o(t, i.y, n.y, s.y, r.y));
},
draw: function (t, e) {
void 0 === e && (e = 32);
var i = this.getPoints(e);
t.beginPath(), t.moveTo(this.p0.x, this.p0.y);
for (var n = 1; n < i.length; n++) t.lineTo(i[n].x, i[n].y);
return t.strokePath(), t;
},
toJSON: function () {
return { type: this.type, points: [this.p0.x, this.p0.y, this.p1.x, this.p1.y, this.p2.x, this.p2.y, this.p3.x, this.p3.y] };
},
});
(h.fromJSON = function (t) {
var e = t.points,
i = new a(e[0], e[1]),
n = new a(e[2], e[3]),
s = new a(e[4], e[5]),
r = new a(e[6], e[7]);
return new h(i, n, s, r);
}),
(t.exports = h);
},
function (t, e, i) {
var n = i(0),
l = i(94),
u = i(36),
c = i(6),
s = i(196),
d = i(3),
r = new n({
Extends: l,
initialize: function (t, e, i, n, s, r, o, a) {
var h;
"object" == typeof t
? ((t = c((h = t), "x", 0)),
(e = c(h, "y", 0)),
(i = c(h, "xRadius", 0)),
(n = c(h, "yRadius", i)),
(s = c(h, "startAngle", 0)),
(r = c(h, "endAngle", 360)),
(o = c(h, "clockwise", !1)),
(a = c(h, "rotation", 0)))
: (void 0 === n && (n = i), void 0 === s && (s = 0), void 0 === r && (r = 360), void 0 === o && (o = !1), void 0 === a && (a = 0)),
l.call(this, "EllipseCurve"),
(this.p0 = new d(t, e)),
(this._xRadius = i),
(this._yRadius = n),
(this._startAngle = u(s)),
(this._endAngle = u(r)),
(this._clockwise = o),
(this._rotation = u(a));
},
getStartPoint: function (t) {
return void 0 === t && (t = new d()), this.getPoint(0, t);
},
getResolution: function (t) {
return 2 * t;
},
getPoint: function (t, e) {
void 0 === e && (e = new d());
for (var i = 2 * Math.PI, n = this._endAngle - this._startAngle, s = Math.abs(n) < Number.EPSILON; n < 0; ) n += i;
for (; i < n; ) n -= i;
n < Number.EPSILON && (n = s ? 0 : i), this._clockwise && !s && (n === i ? (n = -i) : (n -= i));
var r,
o,
a,
h,
l = this._startAngle + t * n,
u = this.p0.x + this._xRadius * Math.cos(l),
c = this.p0.y + this._yRadius * Math.sin(l);
return (
0 !== this._rotation && ((r = Math.cos(this._rotation)), (o = Math.sin(this._rotation)), (u = (a = u - this.p0.x) * r - (h = c - this.p0.y) * o + this.p0.x), (c = a * o + h * r + this.p0.y)),
e.set(u, c)
);
},
setXRadius: function (t) {
return (this.xRadius = t), this;
},
setYRadius: function (t) {
return (this.yRadius = t), this;
},
setWidth: function (t) {
return (this.xRadius = t / 2), this;
},
setHeight: function (t) {
return (this.yRadius = t / 2), this;
},
setStartAngle: function (t) {
return (this.startAngle = t), this;
},
setEndAngle: function (t) {
return (this.endAngle = t), this;
},
setClockwise: function (t) {
return (this.clockwise = t), this;
},
setRotation: function (t) {
return (this.rotation = t), this;
},
x: {
get: function () {
return this.p0.x;
},
set: function (t) {
this.p0.x = t;
},
},
y: {
get: function () {
return this.p0.y;
},
set: function (t) {
this.p0.y = t;
},
},
xRadius: {
get: function () {
return this._xRadius;
},
set: function (t) {
this._xRadius = t;
},
},
yRadius: {
get: function () {
return this._yRadius;
},
set: function (t) {
this._yRadius = t;
},
},
startAngle: {
get: function () {
return s(this._startAngle);
},
set: function (t) {
this._startAngle = u(t);
},
},
endAngle: {
get: function () {
return s(this._endAngle);
},
set: function (t) {
this._endAngle = u(t);
},
},
clockwise: {
get: function () {
return this._clockwise;
},
set: function (t) {
this._clockwise = t;
},
},
angle: {
get: function () {
return s(this._rotation);
},
set: function (t) {
this._rotation = u(t);
},
},
rotation: {
get: function () {
return this._rotation;
},
set: function (t) {
this._rotation = t;
},
},
toJSON: function () {
return {
type: this.type,
x: this.p0.x,
y: this.p0.y,
xRadius: this._xRadius,
yRadius: this._yRadius,
startAngle: s(this._startAngle),
endAngle: s(this._endAngle),
clockwise: this._clockwise,
rotation: s(this._rotation),
};
},
});
(r.fromJSON = function (t) {
return new r(t);
}),
(t.exports = r);
},
function (t, e, i) {
var n = i(0),
s = i(94),
r = i(199),
o = i(10),
a = i(3),
h = new n({
Extends: s,
initialize: function (t, e) {
s.call(this, "LineCurve"), Array.isArray(t) && ((e = new a(t[2], t[3])), (t = new a(t[0], t[1]))), (this.p0 = t), (this.p1 = e), (this.arcLengthDivisions = 1);
},
getBounds: function (t) {
return void 0 === t && (t = new o()), r([this.p0, this.p1], t);
},
getStartPoint: function (t) {
return void 0 === t && (t = new a()), t.copy(this.p0);
},
getResolution: function (t) {
return void 0 === t && (t = 1), t;
},
getPoint: function (t, e) {
return void 0 === e && (e = new a()), 1 === t ? e.copy(this.p1) : (e.copy(this.p1).subtract(this.p0).scale(t).add(this.p0), e);
},
getPointAt: function (t, e) {
return this.getPoint(t, e);
},
getTangent: function (t, e) {
return void 0 === e && (e = new a()), e.copy(this.p1).subtract(this.p0).normalize(), e;
},
getUtoTmapping: function (t, e, i) {
var n, s;
return e ? ((s = (n = this.getLengths(i))[n.length - 1]), Math.min(e, s) / s) : t;
},
draw: function (t) {
return t.lineBetween(this.p0.x, this.p0.y, this.p1.x, this.p1.y), t;
},
toJSON: function () {
return { type: this.type, points: [this.p0.x, this.p0.y, this.p1.x, this.p1.y] };
},
});
(h.fromJSON = function (t) {
var e = t.points,
i = new a(e[0], e[1]),
n = new a(e[2], e[3]);
return new h(i, n);
}),
(t.exports = h);
},
function (t, e, i) {
var n = i(0),
s = i(3),
r = new n({
initialize: function (t, e) {
(this.active = !1), (this.p0 = new s(t, e));
},
getPoint: function (t, e) {
return void 0 === e && (e = new s()), e.copy(this.p0);
},
getPointAt: function (t, e) {
return this.getPoint(t, e);
},
getResolution: function () {
return 1;
},
getLength: function () {
return 0;
},
toJSON: function () {
return { type: "MoveTo", points: [this.p0.x, this.p0.y] };
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(0),
s = i(94),
r = i(359),
o = i(3),
a = new n({
Extends: s,
initialize: function (t, e, i) {
s.call(this, "QuadraticBezier"), Array.isArray(t) && ((i = new o(t[4], t[5])), (e = new o(t[2], t[3])), (t = new o(t[0], t[1]))), (this.p0 = t), (this.p1 = e), (this.p2 = i);
},
getStartPoint: function (t) {
return void 0 === t && (t = new o()), t.copy(this.p0);
},
getResolution: function (t) {
return t;
},
getPoint: function (t, e) {
void 0 === e && (e = new o());
var i = this.p0,
n = this.p1,
s = this.p2;
return e.set(r(t, i.x, n.x, s.x), r(t, i.y, n.y, s.y));
},
draw: function (t, e) {
void 0 === e && (e = 32);
var i = this.getPoints(e);
t.beginPath(), t.moveTo(this.p0.x, this.p0.y);
for (var n = 1; n < i.length; n++) t.lineTo(i[n].x, i[n].y);
return t.strokePath(), t;
},
toJSON: function () {
return { type: this.type, points: [this.p0.x, this.p0.y, this.p1.x, this.p1.y, this.p2.x, this.p2.y] };
},
});
(a.fromJSON = function (t) {
var e = t.points,
i = new o(e[0], e[1]),
n = new o(e[2], e[3]),
s = new o(e[4], e[5]);
return new a(i, n, s);
}),
(t.exports = a);
},
function (t, e, i) {
var u = i(194),
n = i(0),
s = i(94),
c = i(3),
r = new n({
Extends: s,
initialize: function (t) {
void 0 === t && (t = []), s.call(this, "SplineCurve"), (this.points = []), this.addPoints(t);
},
addPoints: function (t) {
for (var e = 0; e < t.length; e++) {
var i = new c();
"number" == typeof t[e] ? ((i.x = t[e]), (i.y = t[e + 1]), e++) : Array.isArray(t[e]) ? ((i.x = t[e][0]), (i.y = t[e][1])) : ((i.x = t[e].x), (i.y = t[e].y)), this.points.push(i);
}
return this;
},
addPoint: function (t, e) {
var i = new c(t, e);
return this.points.push(i), i;
},
getStartPoint: function (t) {
return void 0 === t && (t = new c()), t.copy(this.points[0]);
},
getResolution: function (t) {
return t * this.points.length;
},
getPoint: function (t, e) {
void 0 === e && (e = new c());
var i = this.points,
n = (i.length - 1) * t,
s = Math.floor(n),
r = n - s,
o = i[0 === s ? s : s - 1],
a = i[s],
h = i[s > i.length - 2 ? i.length - 1 : s + 1],
l = i[s > i.length - 3 ? i.length - 1 : s + 2];
return e.set(u(r, o.x, a.x, h.x, l.x), u(r, o.y, a.y, h.y, l.y));
},
toJSON: function () {
for (var t = [], e = 0; e < this.points.length; e++) t.push(this.points[e].x), t.push(this.points[e].y);
return { type: this.type, points: t };
},
});
(r.fromJSON = function (t) {
return new r(t.points);
}),
(t.exports = r);
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e, i, n) {
(e && "" !== e) ||
(e = [
"precision mediump float;",
"uniform vec2 resolution;",
"varying vec2 fragCoord;",
"void main () {",
" vec2 uv = fragCoord / resolution.xy;",
" gl_FragColor = vec4(uv.xyx, 1.0);",
"}",
].join("\n")),
(i && "" !== i) ||
(i = [
"precision mediump float;",
"uniform mat4 uProjectionMatrix;",
"uniform mat4 uViewMatrix;",
"uniform vec2 uResolution;",
"attribute vec2 inPosition;",
"varying vec2 fragCoord;",
"varying vec2 outTexCoord;",
"void main () {",
" gl_Position = uProjectionMatrix * uViewMatrix * vec4(inPosition, 1.0, 1.0);",
" fragCoord = vec2(inPosition.x, uResolution.y - inPosition.y);",
" outTexCoord = vec2(inPosition.x / uResolution.x, fragCoord.y / uResolution.y);",
"}",
].join("\n")),
void 0 === n && (n = null),
(this.key = t),
(this.fragmentSrc = e),
(this.vertexSrc = i),
(this.uniforms = n);
},
});
t.exports = n;
},
function (t, e, i) {
var n = i(38);
(n.ColorSpectrum = i(909)),
(n.ColorToRGBA = i(910)),
(n.ComponentToHex = i(398)),
(n.GetColor = i(103)),
(n.GetColor32 = i(328)),
(n.HexStringToColor = i(327)),
(n.HSLToColor = i(911)),
(n.HSVColorWheel = i(912)),
(n.HSVToRGB = i(188)),
(n.HueToComponent = i(399)),
(n.IntegerToColor = i(189)),
(n.IntegerToRGB = i(330)),
(n.Interpolate = i(913)),
(n.ObjectToColor = i(331)),
(n.RandomRGB = i(914)),
(n.RGBStringToColor = i(332)),
(n.RGBToHSV = i(329)),
(n.RGBToString = i(915)),
(n.ValueToColor = i(187)),
(t.exports = n);
},
function (t, e) {
t.exports = function (t) {
var e = t.toString(16);
return 1 === e.length ? "0" + e : e;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return i < 0 && (i += 1), 1 < i && --i, i < 1 / 6 ? t + 6 * (e - t) * i : i < 0.5 ? e : i < 2 / 3 ? t + (e - t) * (2 / 3 - i) * 6 : t;
};
},
function (t, e, i) {
var n = i(105);
t.exports = function (t) {
var e;
"complete" !== document.readyState && "interactive" !== document.readyState
? ((e = function () {
document.removeEventListener("deviceready", e, !0), document.removeEventListener("DOMContentLoaded", e, !0), window.removeEventListener("load", e, !0), t();
}),
document.body ? (n.cordova ? document.addEventListener("deviceready", e, !1) : (document.addEventListener("DOMContentLoaded", e, !0), window.addEventListener("load", e, !0))) : window.setTimeout(e, 20))
: t();
};
},
function (t, e) {
t.exports = function (t) {
if (!t) return window.innerHeight;
var e = Math.abs(window.orientation),
i = { w: 0, h: 0 },
n = document.createElement("div");
return (
n.setAttribute("style", "position: fixed; height: 100vh; width: 0; top: 0"),
document.documentElement.appendChild(n),
(i.w = 90 === e ? n.offsetHeight : window.innerWidth),
(i.h = 90 === e ? window.innerWidth : n.offsetHeight),
document.documentElement.removeChild(n),
(n = null),
90 !== Math.abs(window.orientation) ? i.h : i.w
);
};
},
function (t, e, i) {
var s = i(201);
t.exports = function (t, e) {
var i = window.screen,
n = !!i && (i.orientation || i.mozOrientation || i.msOrientation);
return n && "string" == typeof n.type
? n.type
: "string" == typeof n
? n
: "number" == typeof window.orientation
? 0 === window.orientation || 180 === window.orientation
? s.ORIENTATION.PORTRAIT
: s.ORIENTATION.LANDSCAPE
: window.matchMedia
? window.matchMedia("(orientation: portrait)").matches
? s.ORIENTATION.PORTRAIT
: window.matchMedia("(orientation: landscape)").matches
? s.ORIENTATION.LANDSCAPE
: void 0
: t < e
? s.ORIENTATION.PORTRAIT
: s.ORIENTATION.LANDSCAPE;
};
},
function (t, e) {
t.exports = { NO_CENTER: 0, CENTER_BOTH: 1, CENTER_HORIZONTALLY: 2, CENTER_VERTICALLY: 3 };
},
function (t, e) {
t.exports = { LANDSCAPE: "landscape-primary", PORTRAIT: "portrait-primary" };
},
function (t, e) {
t.exports = { NONE: 0, WIDTH_CONTROLS_HEIGHT: 1, HEIGHT_CONTROLS_WIDTH: 2, FIT: 3, ENVELOP: 4, RESIZE: 5 };
},
function (t, e) {
t.exports = { NO_ZOOM: 1, ZOOM_2X: 2, ZOOM_4X: 4, MAX_ZOOM: -1 };
},
function (t, e) {
t.exports = function (t) {
var e;
return "" !== t && ("string" == typeof t ? (e = document.getElementById(t)) : t && 1 === t.nodeType && (e = t)), e || document.body;
};
},
function (t, e) {
t.exports = function (t) {
var e = "";
try {
window.DOMParser ? (e = new DOMParser().parseFromString(t, "text/xml")) : (e = new ActiveXObject("Microsoft.XMLDOM")).loadXML(t);
} catch (t) {
e = null;
}
return e && e.documentElement && !e.getElementsByTagName("parsererror").length ? e : null;
};
},
function (t, e, i) {
var n = i(0),
a = i(203),
s = i(9),
r = i(51),
o = i(22),
h = i(410),
l = i(411),
u = i(412),
c = i(413),
d = i(25),
v = i(177),
f = new n({
initialize: function (t, e) {
(this.game = t),
this.scaleManager,
this.canvas,
(this.config = e),
(this.enabled = !0),
(this.events = new s()),
(this.isOver = !0),
(this.defaultCursor = ""),
(this.keyboard = e.inputKeyboard ? new h(this) : null),
(this.mouse = e.inputMouse ? new l(this) : null),
(this.touch = e.inputTouch ? new c(this) : null),
(this.pointers = []),
(this.pointersTotal = e.inputActivePointers),
e.inputTouch && 1 === this.pointersTotal && (this.pointersTotal = 2);
for (var i = 0; i <= this.pointersTotal; i++) {
var n = new u(this, i);
(n.smoothFactor = e.inputSmoothFactor), this.pointers.push(n);
}
(this.mousePointer = e.inputMouse ? this.pointers[0] : null),
(this.activePointer = this.pointers[0]),
(this.globalTopOnly = !0),
(this.time = 0),
(this._tempPoint = { x: 0, y: 0 }),
(this._tempHitTest = []),
(this._tempMatrix = new d()),
(this._tempMatrix2 = new d()),
(this._tempSkip = !1),
(this.mousePointerContainer = [this.mousePointer]),
t.events.once(o.BOOT, this.boot, this);
},
boot: function () {
(this.canvas = this.game.canvas),
(this.scaleManager = this.game.scale),
this.events.emit(r.MANAGER_BOOT),
this.game.events.on(o.PRE_RENDER, this.preRender, this),
this.game.events.once(o.DESTROY, this.destroy, this);
},
setCanvasOver: function (t) {
(this.isOver = !0), this.events.emit(r.GAME_OVER, t);
},
setCanvasOut: function (t) {
(this.isOver = !1), this.events.emit(r.GAME_OUT, t);
},
preRender: function () {
var t = this.game.loop.now,
e = this.game.loop.delta,
i = this.game.scene.getScenes(!0, !0);
(this.time = t), this.events.emit(r.MANAGER_UPDATE);
for (var n = 0; n < i.length; n++) {
var s = i[n];
if (s.sys.input && s.sys.input.updatePoll(t, e) && this.globalTopOnly) return;
}
},
setDefaultCursor: function (t) {
(this.defaultCursor = t), this.canvas.style.cursor !== t && (this.canvas.style.cursor = t);
},
setCursor: function (t) {
t.cursor && (this.canvas.style.cursor = t.cursor);
},
resetCursor: function (t) {
t.cursor && this.canvas && (this.canvas.style.cursor = this.defaultCursor);
},
addPointer: function (t) {
void 0 === t && (t = 1);
var e = [];
10 < this.pointersTotal + t && (t = 10 - this.pointersTotal);
for (var i = 0; i < t; i++) {
var n = this.pointers.length,
s = new u(this, n);
(s.smoothFactor = this.config.inputSmoothFactor), this.pointers.push(s), this.pointersTotal++, e.push(s);
}
return e;
},
updateInputPlugins: function (t, e) {
var i = this.game.scene.getScenes(!0, !0);
this._tempSkip = !1;
for (var n = 0; n < i.length; n++) {
var s = i[n];
if (s.sys.input && ((s.sys.input.update(t, e) && this.globalTopOnly) || this._tempSkip)) return;
}
},
onTouchStart: function (t) {
for (var e = this.pointers, i = [], n = 0; n < t.changedTouches.length; n++)
for (var s = t.changedTouches[n], r = 1; r < this.pointersTotal; r++) {
var o = e[r];
if (!o.active) {
o.touchstart(s, t), (this.activePointer = o), i.push(o);
break;
}
}
this.updateInputPlugins(a.TOUCH_START, i);
},
onTouchMove: function (t) {
for (var e = this.pointers, i = [], n = 0; n < t.changedTouches.length; n++)
for (var s = t.changedTouches[n], r = 1; r < this.pointersTotal; r++) {
var o = e[r];
if (o.active && o.identifier === s.identifier) {
o.touchmove(s, t), (this.activePointer = o), i.push(o);
break;
}
}
this.updateInputPlugins(a.TOUCH_MOVE, i);
},
onTouchEnd: function (t) {
for (var e = this.pointers, i = [], n = 0; n < t.changedTouches.length; n++)
for (var s = t.changedTouches[n], r = 1; r < this.pointersTotal; r++) {
var o = e[r];
if (o.active && o.identifier === s.identifier) {
o.touchend(s, t), i.push(o);
break;
}
}
this.updateInputPlugins(a.TOUCH_END, i);
},
onTouchCancel: function (t) {
for (var e = this.pointers, i = [], n = 0; n < t.changedTouches.length; n++)
for (var s = t.changedTouches[n], r = 1; r < this.pointersTotal; r++) {
var o = e[r];
if (o.active && o.identifier === s.identifier) {
o.touchcancel(s, t), i.push(o);
break;
}
}
this.updateInputPlugins(a.TOUCH_CANCEL, i);
},
onMouseDown: function (t) {
var e = this.mousePointer;
e.down(t), e.updateMotion(), (this.activePointer = e), this.updateInputPlugins(a.MOUSE_DOWN, this.mousePointerContainer);
},
onMouseMove: function (t) {
var e = this.mousePointer;
e.move(t), e.updateMotion(), (this.activePointer = e), this.updateInputPlugins(a.MOUSE_MOVE, this.mousePointerContainer);
},
onMouseUp: function (t) {
var e = this.mousePointer;
e.up(t), e.updateMotion(), (this.activePointer = e), this.updateInputPlugins(a.MOUSE_UP, this.mousePointerContainer);
},
onMouseWheel: function (t) {
var e = this.mousePointer;
e.wheel(t), (this.activePointer = e), this.updateInputPlugins(a.MOUSE_WHEEL, this.mousePointerContainer);
},
onPointerLockChange: function (t) {
var e = this.mouse.locked;
(this.mousePointer.locked = e), this.events.emit(r.POINTERLOCK_CHANGE, t, e);
},
inputCandidate: function (t, e) {
var i = t.input;
if (!i || !i.enabled || (!i.alwaysEnabled && !t.willRender(e))) return !1;
var n = !0,
s = t.parentContainer;
if (s)
do {
if (!s.willRender(e)) {
n = !1;
break;
}
s = s.parentContainer;
} while (s);
return n;
},
hitTest: function (t, e, i, n) {
void 0 === n && (n = this._tempHitTest);
var s = this._tempPoint,
r = i.scrollX,
o = i.scrollY;
n.length = 0;
var a = t.x,
h = t.y;
i.getWorldPoint(a, h, s), (t.worldX = s.x), (t.worldY = s.y);
for (var l = { x: 0, y: 0 }, u = this._tempMatrix, c = this._tempMatrix2, d = 0; d < e.length; d++) {
var f,
p,
g = e[d];
this.inputCandidate(g, i) &&
((f = s.x + r * g.scrollFactorX - r),
(p = s.y + o * g.scrollFactorY - o),
g.parentContainer ? (g.getWorldTransformMatrix(u, c), u.applyInverse(f, p, l)) : v(f, p, g.x, g.y, g.rotation, g.scaleX, g.scaleY, l),
this.pointWithinHitArea(g, l.x, l.y) && n.push(g));
}
return n;
},
pointWithinHitArea: function (t, e, i) {
(e += t.displayOriginX), (i += t.displayOriginY);
var n = t.input;
return !(!n || !n.hitAreaCallback(n.hitArea, e, i, t) || ((n.localX = e), (n.localY = i), 0));
},
pointWithinInteractiveObject: function (t, e, i) {
return !!t.hitArea && ((e += t.gameObject.displayOriginX), (i += t.gameObject.displayOriginY), (t.localX = e), (t.localY = i), t.hitAreaCallback(t.hitArea, e, i, t));
},
transformPointer: function (t, e, i, n) {
var s = t.position,
r = t.prevPosition;
(r.x = s.x), (r.y = s.y);
var o = this.scaleManager.transformX(e),
a = this.scaleManager.transformY(i),
h = t.smoothFactor;
n && 0 !== h ? ((s.x = o * h + r.x * (1 - h)), (s.y = a * h + r.y * (1 - h))) : ((s.x = o), (s.y = a));
},
destroy: function () {
this.events.removeAllListeners(), this.game.events.off(o.PRE_RENDER), this.keyboard && this.keyboard.destroy(), this.mouse && this.mouse.destroy(), this.touch && this.touch.destroy();
for (var t = 0; t < this.pointers.length; t++) this.pointers[t].destroy();
(this.pointers = []), (this._tempHitTest = []), this._tempMatrix.destroy(), (this.canvas = null), (this.game = null);
},
});
t.exports = f;
},
function (t, e, i) {
var s = i(93),
n = i(0),
r = i(22),
o = i(51),
a = i(143),
h = i(1),
l = new n({
initialize: function (t) {
(this.manager = t),
(this.queue = []),
(this.preventDefault = !0),
(this.captures = []),
(this.enabled = !1),
this.target,
(this.onKeyDown = h),
(this.onKeyUp = h),
t.events.once(o.MANAGER_BOOT, this.boot, this);
},
boot: function () {
var t = this.manager.config;
(this.enabled = t.inputKeyboard),
(this.target = t.inputKeyboardEventTarget),
this.addCapture(t.inputKeyboardCapture),
!this.target && window && (this.target = window),
this.enabled && this.target && this.startListeners(),
this.manager.game.events.on(r.POST_STEP, this.postUpdate, this);
},
startListeners: function () {
var i = this;
(this.onKeyDown = function (t) {
var e;
!t.defaultPrevented &&
i.enabled &&
i.manager &&
(i.queue.push(t),
i.manager.events.emit(o.MANAGER_PROCESS),
(e = t.altKey || t.ctrlKey || t.shiftKey || t.metaKey),
i.preventDefault && !e && -1 < i.captures.indexOf(t.keyCode) && t.preventDefault());
}),
(this.onKeyUp = function (t) {
var e;
!t.defaultPrevented &&
i.enabled &&
i.manager &&
(i.queue.push(t),
i.manager.events.emit(o.MANAGER_PROCESS),
(e = t.altKey || t.ctrlKey || t.shiftKey || t.metaKey),
i.preventDefault && !e && -1 < i.captures.indexOf(t.keyCode) && t.preventDefault());
});
var t = this.target;
t && (t.addEventListener("keydown", this.onKeyDown, !1), t.addEventListener("keyup", this.onKeyUp, !1), (this.enabled = !0));
},
stopListeners: function () {
var t = this.target;
t.removeEventListener("keydown", this.onKeyDown, !1), t.removeEventListener("keyup", this.onKeyUp, !1), (this.enabled = !1);
},
postUpdate: function () {
this.queue = [];
},
addCapture: function (t) {
"string" == typeof t && (t = t.split(",")), Array.isArray(t) || (t = [t]);
for (var e = this.captures, i = 0; i < t.length; i++) {
var n = t[i];
"string" == typeof n && (n = a[n.trim().toUpperCase()]), -1 === e.indexOf(n) && e.push(n);
}
this.preventDefault = 0 < e.length;
},
removeCapture: function (t) {
"string" == typeof t && (t = t.split(",")), Array.isArray(t) || (t = [t]);
for (var e = this.captures, i = 0; i < t.length; i++) {
var n = t[i];
"string" == typeof n && (n = a[n.toUpperCase()]), s(e, n);
}
this.preventDefault = 0 < e.length;
},
clearCaptures: function () {
(this.captures = []), (this.preventDefault = !1);
},
destroy: function () {
this.stopListeners(), this.clearCaptures(), (this.queue = []), this.manager.game.events.off(r.POST_RENDER, this.postUpdate, this), (this.target = null), (this.enabled = !1), (this.manager = null);
},
});
t.exports = l;
},
function (t, e, i) {
var n = i(0),
o = i(191),
s = i(51),
r = i(1),
a = new n({
initialize: function (t) {
(this.manager = t),
(this.preventDefaultDown = !0),
(this.preventDefaultUp = !0),
(this.preventDefaultMove = !0),
(this.preventDefaultWheel = !1),
(this.enabled = !1),
this.target,
(this.locked = !1),
(this.onMouseMove = r),
(this.onMouseDown = r),
(this.onMouseUp = r),
(this.onMouseDownWindow = r),
(this.onMouseUpWindow = r),
(this.onMouseOver = r),
(this.onMouseOut = r),
(this.onMouseWheel = r),
(this.pointerLockChange = r),
(this.isTop = !0),
t.events.once(s.MANAGER_BOOT, this.boot, this);
},
boot: function () {
var t = this.manager.config;
(this.enabled = t.inputMouse),
(this.target = t.inputMouseEventTarget),
(this.passive = t.inputMousePassive),
(this.preventDefaultDown = t.inputMousePreventDefaultDown),
(this.preventDefaultUp = t.inputMousePreventDefaultUp),
(this.preventDefaultMove = t.inputMousePreventDefaultMove),
(this.preventDefaultWheel = t.inputMousePreventDefaultWheel),
this.target ? "string" == typeof this.target && (this.target = document.getElementById(this.target)) : (this.target = this.manager.game.canvas),
t.disableContextMenu && this.disableContextMenu(),
this.enabled && this.target && this.startListeners();
},
disableContextMenu: function () {
return (
document.body.addEventListener("contextmenu", function (t) {
return t.preventDefault(), !1;
}),
this
);
},
requestPointerLock: function () {
var t;
o.pointerLock && (((t = this.target).requestPointerLock = t.requestPointerLock || t.mozRequestPointerLock || t.webkitRequestPointerLock), t.requestPointerLock());
},
releasePointerLock: function () {
o.pointerLock && ((document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock), document.exitPointerLock());
},
startListeners: function () {
var t = this.target;
if (t) {
var i = this,
n = this.manager,
e = n.canvas,
s = window && window.focus && n.game.config.autoFocus;
(this.onMouseMove = function (t) {
!t.defaultPrevented && i.enabled && n && n.enabled && (n.onMouseMove(t), i.preventDefaultMove && t.preventDefault());
}),
(this.onMouseDown = function (t) {
s && window.focus(), !t.defaultPrevented && i.enabled && n && n.enabled && (n.onMouseDown(t), i.preventDefaultDown && t.target === e && t.preventDefault());
}),
(this.onMouseDownWindow = function (t) {
!t.defaultPrevented && i.enabled && n && n.enabled && t.target !== e && n.onMouseDown(t);
}),
(this.onMouseUp = function (t) {
!t.defaultPrevented && i.enabled && n && n.enabled && (n.onMouseUp(t), i.preventDefaultUp && t.target === e && t.preventDefault());
}),
(this.onMouseUpWindow = function (t) {
!t.defaultPrevented && i.enabled && n && n.enabled && t.target !== e && n.onMouseUp(t);
}),
(this.onMouseOver = function (t) {
!t.defaultPrevented && i.enabled && n && n.enabled && n.setCanvasOver(t);
}),
(this.onMouseOut = function (t) {
!t.defaultPrevented && i.enabled && n && n.enabled && n.setCanvasOut(t);
}),
(this.onMouseWheel = function (t) {
!t.defaultPrevented && i.enabled && n && n.enabled && n.onMouseWheel(t), i.preventDefaultWheel && t.target === e && t.preventDefault();
});
var r = { passive: !0 };
if (
(t.addEventListener("mousemove", this.onMouseMove),
t.addEventListener("mousedown", this.onMouseDown),
t.addEventListener("mouseup", this.onMouseUp),
t.addEventListener("mouseover", this.onMouseOver, r),
t.addEventListener("mouseout", this.onMouseOut, r),
this.preventDefaultWheel ? t.addEventListener("wheel", this.onMouseWheel, { passive: !1 }) : t.addEventListener("wheel", this.onMouseWheel, r),
window && n.game.config.inputWindowEvents)
)
try {
window.top.addEventListener("mousedown", this.onMouseDownWindow, r), window.top.addEventListener("mouseup", this.onMouseUpWindow, r);
} catch (t) {
window.addEventListener("mousedown", this.onMouseDownWindow, r), window.addEventListener("mouseup", this.onMouseUpWindow, r), (this.isTop = !1);
}
o.pointerLock &&
((this.pointerLockChange = function (t) {
var e = i.target;
(i.locked = document.pointerLockElement === e || document.mozPointerLockElement === e || document.webkitPointerLockElement === e), n.onPointerLockChange(t);
}),
document.addEventListener("pointerlockchange", this.pointerLockChange, !0),
document.addEventListener("mozpointerlockchange", this.pointerLockChange, !0),
document.addEventListener("webkitpointerlockchange", this.pointerLockChange, !0)),
(this.enabled = !0);
}
},
stopListeners: function () {
var t = this.target;
t.removeEventListener("mousemove", this.onMouseMove),
t.removeEventListener("mousedown", this.onMouseDown),
t.removeEventListener("mouseup", this.onMouseUp),
t.removeEventListener("mouseover", this.onMouseOver),
t.removeEventListener("mouseout", this.onMouseOut),
window && ((t = this.isTop ? window.top : window).removeEventListener("mousedown", this.onMouseDownWindow), t.removeEventListener("mouseup", this.onMouseUpWindow)),
o.pointerLock &&
(document.removeEventListener("pointerlockchange", this.pointerLockChange, !0),
document.removeEventListener("mozpointerlockchange", this.pointerLockChange, !0),
document.removeEventListener("webkitpointerlockchange", this.pointerLockChange, !0));
},
destroy: function () {
this.stopListeners(), (this.target = null), (this.enabled = !1), (this.manager = null);
},
});
t.exports = a;
},
function (t, e, i) {
var h = i(349),
n = i(0),
s = i(50),
l = i(124),
u = i(360),
r = i(3),
o = i(105),
a = new n({
initialize: function (t, e) {
(this.manager = t),
(this.id = e),
this.event,
this.downElement,
this.upElement,
(this.camera = null),
(this.button = 0),
(this.buttons = 0),
(this.position = new r()),
(this.prevPosition = new r()),
(this.midPoint = new r(-1, -1)),
(this.velocity = new r()),
(this.angle = 0),
(this.distance = 0),
(this.smoothFactor = 0),
(this.motionFactor = 0.2),
(this.worldX = 0),
(this.worldY = 0),
(this.moveTime = 0),
(this.downX = 0),
(this.downY = 0),
(this.downTime = 0),
(this.upX = 0),
(this.upY = 0),
(this.upTime = 0),
(this.primaryDown = !1),
(this.isDown = !1),
(this.wasTouch = !1),
(this.wasCanceled = !1),
(this.movementX = 0),
(this.movementY = 0),
(this.identifier = 0),
(this.pointerId = null),
(this.active = 0 === e),
(this.locked = !1),
(this.deltaX = 0),
(this.deltaY = 0),
(this.deltaZ = 0);
},
updateWorldPoint: function (t) {
var e = t.getWorldPoint(this.x, this.y);
return (this.worldX = e.x), (this.worldY = e.y), this;
},
positionToCamera: function (t, e) {
return t.getWorldPoint(this.x, this.y, e);
},
updateMotion: function () {
var t,
e,
i,
n,
s = this.position.x,
r = this.position.y,
o = this.midPoint.x,
a = this.midPoint.y;
(s === o && r === a) ||
((t = u(this.motionFactor, o, s)),
(e = u(this.motionFactor, a, r)),
l(t, s, 0.1) && (t = s),
l(e, r, 0.1) && (e = r),
this.midPoint.set(t, e),
(i = s - t),
(n = r - e),
this.velocity.set(i, n),
(this.angle = h(t, e, s, r)),
(this.distance = Math.sqrt(i * i + n * n)));
},
up: function (t) {
"buttons" in t && (this.buttons = t.buttons),
(this.event = t),
(this.button = t.button),
(this.upElement = t.target),
this.manager.transformPointer(this, t.pageX, t.pageY, !1),
0 === t.button && ((this.primaryDown = !1), (this.upX = this.x), (this.upY = this.y)),
0 === this.buttons && ((this.isDown = !1), (this.upTime = t.timeStamp), (this.wasTouch = !1));
},
down: function (t) {
"buttons" in t && (this.buttons = t.buttons),
(this.event = t),
(this.button = t.button),
(this.downElement = t.target),
this.manager.transformPointer(this, t.pageX, t.pageY, !1),
0 === t.button && ((this.primaryDown = !0), (this.downX = this.x), (this.downY = this.y)),
o.macOS && t.ctrlKey && ((this.buttons = 2), (this.primaryDown = !1)),
this.isDown || ((this.isDown = !0), (this.downTime = t.timeStamp)),
(this.wasTouch = !1);
},
move: function (t) {
"buttons" in t && (this.buttons = t.buttons),
(this.event = t),
this.manager.transformPointer(this, t.pageX, t.pageY, !0),
this.locked && ((this.movementX = t.movementX || t.mozMovementX || t.webkitMovementX || 0), (this.movementY = t.movementY || t.mozMovementY || t.webkitMovementY || 0)),
(this.moveTime = t.timeStamp),
(this.wasTouch = !1);
},
wheel: function (t) {
"buttons" in t && (this.buttons = t.buttons),
(this.event = t),
this.manager.transformPointer(this, t.pageX, t.pageY, !1),
(this.deltaX = t.deltaX),
(this.deltaY = t.deltaY),
(this.deltaZ = t.deltaZ),
(this.wasTouch = !1);
},
touchstart: function (t, e) {
t.pointerId && (this.pointerId = t.pointerId),
(this.identifier = t.identifier),
(this.target = t.target),
(this.active = !0),
(this.buttons = 1),
(this.event = e),
(this.downElement = t.target),
this.manager.transformPointer(this, t.pageX, t.pageY, !1),
(this.primaryDown = !0),
(this.downX = this.x),
(this.downY = this.y),
(this.downTime = e.timeStamp),
(this.isDown = !0),
(this.wasTouch = !0),
(this.wasCanceled = !1),
this.updateMotion();
},
touchmove: function (t, e) {
(this.event = e), this.manager.transformPointer(this, t.pageX, t.pageY, !0), (this.moveTime = e.timeStamp), (this.wasTouch = !0), this.updateMotion();
},
touchend: function (t, e) {
(this.buttons = 0),
(this.event = e),
(this.upElement = t.target),
this.manager.transformPointer(this, t.pageX, t.pageY, !1),
(this.primaryDown = !1),
(this.upX = this.x),
(this.upY = this.y),
(this.upTime = e.timeStamp),
(this.isDown = !1),
(this.wasTouch = !0),
(this.wasCanceled = !1),
(this.active = !1),
this.updateMotion();
},
touchcancel: function (t, e) {
(this.buttons = 0),
(this.event = e),
(this.upElement = t.target),
this.manager.transformPointer(this, t.pageX, t.pageY, !1),
(this.primaryDown = !1),
(this.upX = this.x),
(this.upY = this.y),
(this.upTime = e.timeStamp),
(this.isDown = !1),
(this.wasTouch = !0),
(this.wasCanceled = !0),
(this.active = !1);
},
noButtonDown: function () {
return 0 === this.buttons;
},
leftButtonDown: function () {
return !!(1 & this.buttons);
},
rightButtonDown: function () {
return !!(2 & this.buttons);
},
middleButtonDown: function () {
return !!(4 & this.buttons);
},
backButtonDown: function () {
return !!(8 & this.buttons);
},
forwardButtonDown: function () {
return !!(16 & this.buttons);
},
leftButtonReleased: function () {
return 0 === this.button && !this.isDown;
},
rightButtonReleased: function () {
return 2 === this.button && !this.isDown;
},
middleButtonReleased: function () {
return 1 === this.button && !this.isDown;
},
backButtonReleased: function () {
return 3 === this.button && !this.isDown;
},
forwardButtonReleased: function () {
return 4 === this.button && !this.isDown;
},
getDistance: function () {
return this.isDown ? s(this.downX, this.downY, this.x, this.y) : s(this.downX, this.downY, this.upX, this.upY);
},
getDistanceX: function () {
return this.isDown ? Math.abs(this.downX - this.x) : Math.abs(this.downX - this.upX);
},
getDistanceY: function () {
return this.isDown ? Math.abs(this.downY - this.y) : Math.abs(this.downY - this.upY);
},
getDuration: function () {
return this.isDown ? this.manager.time - this.downTime : this.upTime - this.downTime;
},
getAngle: function () {
return this.isDown ? h(this.downX, this.downY, this.x, this.y) : h(this.downX, this.downY, this.upX, this.upY);
},
getInterpolatedPosition: function (t, e) {
void 0 === t && (t = 10), void 0 === e && (e = []);
for (var i = this.prevPosition.x, n = this.prevPosition.y, s = this.position.x, r = this.position.y, o = 0; o < t; o++) {
var a = (1 / t) * o;
e[o] = { x: u(a, i, s), y: u(a, n, r) };
}
return e;
},
destroy: function () {
(this.camera = null), (this.manager = null), (this.position = null);
},
x: {
get: function () {
return this.position.x;
},
set: function (t) {
this.position.x = t;
},
},
y: {
get: function () {
return this.position.y;
},
set: function (t) {
this.position.y = t;
},
},
time: {
get: function () {
return this.event ? this.event.timeStamp : 0;
},
},
});
t.exports = a;
},
function (t, e, i) {
var n = i(0),
s = i(51),
r = i(1),
o = new n({
initialize: function (t) {
(this.manager = t),
(this.capture = !0),
(this.enabled = !1),
this.target,
(this.onTouchStart = r),
(this.onTouchStartWindow = r),
(this.onTouchMove = r),
(this.onTouchEnd = r),
(this.onTouchEndWindow = r),
(this.onTouchCancel = r),
(this.onTouchCancelWindow = r),
(this.onTouchOver = r),
(this.onTouchOut = r),
t.events.once(s.MANAGER_BOOT, this.boot, this);
},
boot: function () {
var t = this.manager.config;
(this.enabled = t.inputTouch),
(this.target = t.inputTouchEventTarget),
(this.capture = t.inputTouchCapture),
this.target || (this.target = this.manager.game.canvas),
t.disableContextMenu && this.disableContextMenu(),
this.enabled && this.target && this.startListeners();
},
disableContextMenu: function () {
return (
document.body.addEventListener("contextmenu", function (t) {
return t.preventDefault(), !1;
}),
this
);
},
startListeners: function () {
var e = this,
i = this.manager.canvas,
n = window && window.focus && this.manager.game.config.autoFocus;
(this.onTouchStart = function (t) {
n && window.focus(), !t.defaultPrevented && e.enabled && e.manager && e.manager.enabled && (e.manager.onTouchStart(t), e.capture && t.cancelable && t.target === i && t.preventDefault());
}),
(this.onTouchStartWindow = function (t) {
!t.defaultPrevented && e.enabled && e.manager && e.manager.enabled && t.target !== i && e.manager.onTouchStart(t);
}),
(this.onTouchMove = function (t) {
!t.defaultPrevented && e.enabled && e.manager && e.manager.enabled && (e.manager.onTouchMove(t), e.capture && t.cancelable && t.preventDefault());
}),
(this.onTouchEnd = function (t) {
!t.defaultPrevented && e.enabled && e.manager && e.manager.enabled && (e.manager.onTouchEnd(t), e.capture && t.cancelable && t.target === i && t.preventDefault());
}),
(this.onTouchEndWindow = function (t) {
!t.defaultPrevented && e.enabled && e.manager && e.manager.enabled && t.target !== i && e.manager.onTouchEnd(t);
}),
(this.onTouchCancel = function (t) {
!t.defaultPrevented && e.enabled && e.manager && e.manager.enabled && (e.manager.onTouchCancel(t), e.capture && t.preventDefault());
}),
(this.onTouchCancelWindow = function (t) {
!t.defaultPrevented && e.enabled && e.manager && e.manager.enabled && e.manager.onTouchCancel(t);
}),
(this.onTouchOver = function (t) {
!t.defaultPrevented && e.enabled && e.manager && e.manager.enabled && e.manager.setCanvasOver(t);
}),
(this.onTouchOut = function (t) {
!t.defaultPrevented && e.enabled && e.manager && e.manager.enabled && e.manager.setCanvasOut(t);
});
var t,
s,
r = this.target;
r &&
((s = { passive: ((t = { passive: !0 }), !1) }),
r.addEventListener("touchstart", this.onTouchStart, this.capture ? s : t),
r.addEventListener("touchmove", this.onTouchMove, this.capture ? s : t),
r.addEventListener("touchend", this.onTouchEnd, this.capture ? s : t),
r.addEventListener("touchcancel", this.onTouchCancel, this.capture ? s : t),
r.addEventListener("touchover", this.onTouchOver, this.capture ? s : t),
r.addEventListener("touchout", this.onTouchOut, this.capture ? s : t),
window &&
this.manager.game.config.inputWindowEvents &&
(window.addEventListener("touchstart", this.onTouchStartWindow, s),
window.addEventListener("touchend", this.onTouchEndWindow, s),
window.addEventListener("touchcancel", this.onTouchCancelWindow, s)),
(this.enabled = !0));
},
stopListeners: function () {
var t = this.target;
t.removeEventListener("touchstart", this.onTouchStart),
t.removeEventListener("touchmove", this.onTouchMove),
t.removeEventListener("touchend", this.onTouchEnd),
t.removeEventListener("touchcancel", this.onTouchCancel),
t.removeEventListener("touchover", this.onTouchOver),
t.removeEventListener("touchout", this.onTouchOut),
window && (window.removeEventListener("touchstart", this.onTouchStartWindow), window.removeEventListener("touchend", this.onTouchEndWindow));
},
destroy: function () {
this.stopListeners(), (this.target = null), (this.enabled = !1), (this.manager = null);
},
});
t.exports = o;
},
function (t, e, i) {
var n = i(0),
l = i(22),
s = i(9),
r = i(8),
o = i(16),
a = i(5),
u = i(2),
g = i(24),
h = i(93),
c = new n({
Extends: s,
initialize: function (t) {
s.call(this), (this.game = t), (this.plugins = []), (this.scenePlugins = []), (this._pendingGlobal = []), (this._pendingScene = []), t.isBooted ? this.boot() : t.events.once(l.BOOT, this.boot, this);
},
boot: function () {
for (var t, e, i, n, s, r, o = this.game.config, a = (a = o.installGlobalPlugins).concat(this._pendingGlobal), h = 0; h < a.length; h++)
(t = a[h]), (e = u(t, "key", null)), (i = u(t, "plugin", null)), (n = u(t, "start", !1)), (s = u(t, "mapping", null)), (r = u(t, "data", null)), e && i && this.install(e, i, n, s, r);
for (a = (a = o.installScenePlugins).concat(this._pendingScene), h = 0; h < a.length; h++)
(t = a[h]), (e = u(t, "key", null)), (i = u(t, "plugin", null)), (s = u(t, "mapping", null)), e && i && this.installScenePlugin(e, i, s);
(this._pendingGlobal = []), (this._pendingScene = []), this.game.events.once(l.DESTROY, this.destroy, this);
},
addToScene: function (t, e, i) {
for (var n, s = this.game, r = t.scene, o = t.settings.map, a = t.settings.isBooted, h = 0; h < e.length; h++)
s[(f = e[h])] ? ((t[f] = s[f]), o.hasOwnProperty(f) && (r[o[f]] = t[f])) : "game" === f && o.hasOwnProperty(f) && (r[o[f]] = s);
for (var l = 0; l < i.length; l++)
for (n = i[l], h = 0; h < n.length; h++) {
var u,
c,
d,
f = n[h];
g.hasCore(f) && ((c = (u = g.getCore(f)).mapping), (d = new u.plugin(r, this, c)), (t[c] = d), u.custom ? (r[c] = d) : o.hasOwnProperty(c) && (r[o[c]] = d), a && d.boot());
}
for (n = this.plugins, h = 0; h < n.length; h++) {
var p = n[h];
p.mapping && (r[p.mapping] = p.plugin);
}
},
getDefaultScenePlugins: function () {
return this.game.config.defaultPlugins.concat(this.scenePlugins);
},
installScenePlugin: function (t, e, i, n, s) {
if ((void 0 === s && (s = !1), "function" == typeof e)) {
if (g.hasCore(t)) {
if (!s && g.hasCore(t)) return;
} else g.register(t, e, i, !0), this.scenePlugins.push(t);
var r;
n && ((r = new e(n, this, t)), (n.sys[t] = r), i && "" !== i && (n[i] = r), r.boot());
}
},
install: function (t, e, i, n, s) {
if ((void 0 === i && (i = !1), void 0 === n && (n = null), void 0 === s && (s = null), "function" != typeof e)) return null;
if (g.hasCustom(t)) return null;
if ((null !== n && (i = !0), this.game.isBooted)) {
if ((g.registerCustom(t, e, n, s), i)) return this.start(t);
} else this._pendingGlobal.push({ key: t, plugin: e, start: i, mapping: n, data: s });
return null;
},
getIndex: function (t) {
for (var e = this.plugins, i = 0; i < e.length; i++) if (e[i].key === t) return i;
return -1;
},
getEntry: function (t) {
var e = this.getIndex(t);
if (-1 !== e) return this.plugins[e];
},
isActive: function (t) {
var e = this.getEntry(t);
return e && e.active;
},
start: function (t, e) {
void 0 === e && (e = t);
var i = this.getEntry(e);
return i && !i.active ? ((i.active = !0), i.plugin.start()) : (i = i || this.createEntry(t, e)), i ? i.plugin : null;
},
createEntry: function (t, e) {
var i,
n = g.getCustom(t);
return n && ((n = { key: e, plugin: (i = new n.plugin(this)), active: !0, mapping: n.mapping, data: n.data }), this.plugins.push(n), i.init(n.data), i.start()), n;
},
stop: function (t) {
var e = this.getEntry(t);
return e && e.active && ((e.active = !1), e.plugin.stop()), this;
},
get: function (t, e) {
void 0 === e && (e = !0);
var i = this.getEntry(t);
if (i) return i.plugin;
var n = this.getClass(t);
return n && e ? ((i = this.createEntry(t, t)) ? i.plugin : null) : n || null;
},
getClass: function (t) {
return g.getCustomClass(t);
},
removeGlobalPlugin: function (t) {
var e = this.getEntry(t);
e && h(this.plugins, e), g.removeCustom(t);
},
removeScenePlugin: function (t) {
h(this.scenePlugins, t), g.remove(t);
},
registerGameObject: function (t, e, i) {
return e && a.register(t, e), i && o.register(t, i), this;
},
removeGameObject: function (t, e, i) {
return void 0 === e && (e = !0), void 0 === i && (i = !0), e && a.remove(t), i && o.remove(t), this;
},
registerFileType: function (t, e, i) {
r.register(t, e), i && i.sys.load && (i.sys.load[t] = e);
},
destroy: function () {
for (var t = 0; t < this.plugins.length; t++) this.plugins[t].plugin.destroy();
g.destroyCustomPlugins(), this.game.noReturn && g.destroyCorePlugins(), (this.game = null), (this.plugins = []), (this.scenePlugins = []);
},
});
t.exports = c;
},
function (t, e, i) {
var u = i(201),
n = i(0),
s = i(9),
r = i(104),
o = i(22),
a = i(401),
h = i(407),
c = i(402),
l = i(1),
d = i(10),
f = i(416),
p = i(76),
g = i(3),
v = new n({
Extends: s,
initialize: function (t) {
s.call(this),
(this.game = t),
this.canvas,
(this.canvasBounds = new d()),
(this.parent = null),
(this.parentIsWindow = !1),
(this.parentSize = new f()),
(this.gameSize = new f()),
(this.baseSize = new f()),
(this.displaySize = new f()),
(this.scaleMode = u.SCALE_MODE.NONE),
(this.zoom = 1),
(this._resetZoom = !1),
(this.displayScale = new g(1, 1)),
(this.autoRound = !1),
(this.autoCenter = u.CENTER.NO_CENTER),
(this.orientation = u.ORIENTATION.LANDSCAPE),
this.fullscreen,
(this.fullscreenTarget = null),
(this._createdFullscreenTarget = !1),
(this.dirty = !1),
(this.resizeInterval = 500),
(this._lastCheck = 0),
(this._checkOrientation = !1),
(this.listeners = { orientationChange: l, windowResize: l, fullScreenChange: l, fullScreenError: l });
},
preBoot: function () {
this.parseConfig(this.game.config), this.game.events.once(o.BOOT, this.boot, this);
},
boot: function () {
var t = this.game;
(this.canvas = t.canvas),
(this.fullscreen = t.device.fullscreen),
this.scaleMode !== u.SCALE_MODE.RESIZE && this.displaySize.setAspectMode(this.scaleMode),
this.scaleMode === u.SCALE_MODE.NONE
? this.resize(this.width, this.height)
: (this.getParentBounds(), 0 < this.parentSize.width && 0 < this.parentSize.height && this.displaySize.setParent(this.parentSize), this.refresh()),
t.events.on(o.PRE_STEP, this.step, this),
t.events.once(o.READY, this.refresh, this),
t.events.once(o.DESTROY, this.destroy, this),
this.startListeners();
},
parseConfig: function (t) {
this.getParent(t), this.getParentBounds();
var e,
i,
n,
s,
r = t.width,
o = t.height,
a = t.scaleMode,
h = t.zoom,
l = t.autoRound;
"string" == typeof r && (0 === (e = this.parentSize.width) && (e = window.innerWidth), (i = parseInt(r, 10) / 100), (r = Math.floor(e * i))),
"string" == typeof o && (0 === (n = this.parentSize.height) && (n = window.innerHeight), (s = parseInt(o, 10) / 100), (o = Math.floor(n * s))),
(this.scaleMode = a),
(this.autoRound = l),
(this.autoCenter = t.autoCenter),
(this.resizeInterval = t.resizeInterval),
l && ((r = Math.floor(r)), (o = Math.floor(o))),
this.gameSize.setSize(r, o),
h === u.ZOOM.MAX_ZOOM && (h = this.getMaxZoom()),
1 !== (this.zoom = h) && (this._resetZoom = !0),
this.baseSize.setSize(r, o),
l && ((this.baseSize.width = Math.floor(this.baseSize.width)), (this.baseSize.height = Math.floor(this.baseSize.height))),
0 < t.minWidth && this.displaySize.setMin(t.minWidth * h, t.minHeight * h),
0 < t.maxWidth && this.displaySize.setMax(t.maxWidth * h, t.maxHeight * h),
this.displaySize.setSize(r, o),
(this.orientation = c(r, o));
},
getParent: function (t) {
var e,
i = t.parent;
null !== i &&
((this.parent = h(i)),
(this.parentIsWindow = this.parent === document.body),
t.expandParent &&
t.scaleMode !== u.SCALE_MODE.NONE &&
((e = this.parent.getBoundingClientRect()),
(!this.parentIsWindow && 0 !== e.height) ||
((document.documentElement.style.height = "100%"),
(document.body.style.height = "100%"),
(e = this.parent.getBoundingClientRect()),
this.parentIsWindow || 0 !== e.height || ((this.parent.style.overflow = "hidden"), (this.parent.style.width = "100%"), (this.parent.style.height = "100%")))),
t.fullscreenTarget && !this.fullscreenTarget && (this.fullscreenTarget = h(t.fullscreenTarget)));
},
getParentBounds: function () {
if (!this.parent) return !1;
var t = this.parentSize,
e = this.parent.getBoundingClientRect();
this.parentIsWindow && this.game.device.os.iOS && (e.height = a(!0));
var i = e.width,
n = e.height;
return (t.width !== i || t.height !== n) && (t.setSize(i, n), !0);
},
lockOrientation: function (t) {
var e = screen.lockOrientation || screen.mozLockOrientation || screen.msLockOrientation;
return !!e && e.call(screen, t);
},
setParentSize: function (t, e) {
return this.parentSize.setSize(t, e), this.refresh();
},
setGameSize: function (t, e) {
var i = this.autoRound;
i && ((t = Math.floor(t)), (e = Math.floor(e)));
var n = this.width,
s = this.height;
return (
this.gameSize.resize(t, e),
this.baseSize.resize(t, e),
i && ((this.baseSize.width = Math.floor(this.baseSize.width)), (this.baseSize.height = Math.floor(this.baseSize.height))),
this.displaySize.setAspectRatio(t / e),
(this.canvas.width = this.baseSize.width),
(this.canvas.height = this.baseSize.height),
this.refresh(n, s)
);
},
resize: function (t, e) {
var i = this.zoom,
n = this.autoRound;
n && ((t = Math.floor(t)), (e = Math.floor(e)));
var s = this.width,
r = this.height;
this.gameSize.resize(t, e),
this.baseSize.resize(t, e),
n && ((this.baseSize.width = Math.floor(this.baseSize.width)), (this.baseSize.height = Math.floor(this.baseSize.height))),
this.displaySize.setSize(t * i, e * i),
(this.canvas.width = this.baseSize.width),
(this.canvas.height = this.baseSize.height);
var o = this.canvas.style,
a = t * i,
h = e * i;
return n && ((a = Math.floor(a)), (h = Math.floor(h))), (a === t && h === e) || ((o.width = a + "px"), (o.height = h + "px")), this.refresh(s, r);
},
setZoom: function (t) {
return (this.zoom = t), (this._resetZoom = !0), this.refresh();
},
setMaxZoom: function () {
return (this.zoom = this.getMaxZoom()), (this._resetZoom = !0), this.refresh();
},
refresh: function (t, e) {
void 0 === t && (t = this.width),
void 0 === e && (e = this.height),
this.updateScale(),
this.updateBounds(),
this.updateOrientation(),
this.displayScale.set(this.baseSize.width / this.canvasBounds.width, this.baseSize.height / this.canvasBounds.height);
var i,
n,
s = this.game.domContainer;
return (
s &&
(this.baseSize.setCSS(s),
(i = this.canvas.style),
((n = s.style).transform = "scale(" + this.displaySize.width / this.baseSize.width + "," + this.displaySize.height / this.baseSize.height + ")"),
(n.marginLeft = i.marginLeft),
(n.marginTop = i.marginTop)),
this.emit(r.RESIZE, this.gameSize, this.baseSize, this.displaySize, t, e),
this
);
},
updateOrientation: function () {
var t;
this._checkOrientation && ((this._checkOrientation = !1), (t = c(this.width, this.height)) !== this.orientation && ((this.orientation = t), this.emit(r.ORIENTATION_CHANGE, t)));
},
updateScale: function () {
var t,
e,
i = this.canvas.style,
n = this.gameSize.width,
s = this.gameSize.height,
r = this.zoom,
o = this.autoRound;
this.scaleMode === u.SCALE_MODE.NONE
? (this.displaySize.setSize(n * r, s * r),
(t = this.displaySize.width),
(e = this.displaySize.height),
o && ((t = Math.floor(t)), (e = Math.floor(e))),
this._resetZoom && ((i.width = t + "px"), (i.height = e + "px"), (this._resetZoom = !1)))
: this.scaleMode === u.SCALE_MODE.RESIZE
? (this.displaySize.setSize(this.parentSize.width, this.parentSize.height),
this.gameSize.setSize(this.displaySize.width, this.displaySize.height),
this.baseSize.setSize(this.displaySize.width, this.displaySize.height),
(t = this.displaySize.width),
(e = this.displaySize.height),
o && ((t = Math.floor(t)), (e = Math.floor(e))),
(this.canvas.width = t),
(this.canvas.height = e))
: (this.displaySize.setSize(this.parentSize.width, this.parentSize.height),
(t = this.displaySize.width),
(e = this.displaySize.height),
o && ((t = Math.floor(t)), (e = Math.floor(e))),
(i.width = t + "px"),
(i.height = e + "px")),
this.getParentBounds(),
this.updateCenter();
},
getMaxZoom: function () {
var t = p(this.parentSize.width, this.gameSize.width, 0, !0),
e = p(this.parentSize.height, this.gameSize.height, 0, !0);
return Math.max(Math.min(t, e), 1);
},
updateCenter: function () {
var t,
e,
i,
n,
s,
r,
o,
a = this.autoCenter;
a !== u.CENTER.NO_CENTER &&
((e = (t = this.canvas).style),
(n = (i = t.getBoundingClientRect()).width),
(s = i.height),
(r = Math.floor((this.parentSize.width - n) / 2)),
(o = Math.floor((this.parentSize.height - s) / 2)),
a === u.CENTER.CENTER_HORIZONTALLY ? (o = 0) : a === u.CENTER.CENTER_VERTICALLY && (r = 0),
(e.marginLeft = r + "px"),
(e.marginTop = o + "px"));
},
updateBounds: function () {
var t = this.canvasBounds,
e = this.canvas.getBoundingClientRect();
(t.x = e.left + (window.pageXOffset || 0) - (document.documentElement.clientLeft || 0)),
(t.y = e.top + (window.pageYOffset || 0) - (document.documentElement.clientTop || 0)),
(t.width = e.width),
(t.height = e.height);
},
transformX: function (t) {
return (t - this.canvasBounds.left) * this.displayScale.x;
},
transformY: function (t) {
return (t - this.canvasBounds.top) * this.displayScale.y;
},
startFullscreen: function (t) {
void 0 === t && (t = { navigationUI: "hide" });
var e,
i = this.fullscreen;
i.available ? i.active || ((e = this.getFullscreenTarget()), i.keyboard ? e[i.request](Element.ALLOW_KEYBOARD_INPUT) : e[i.request](t)) : this.emit(r.FULLSCREEN_UNSUPPORTED);
},
fullscreenSuccessHandler: function () {
this.getParentBounds(), this.refresh(), this.emit(r.ENTER_FULLSCREEN);
},
fullscreenErrorHandler: function (t) {
this.removeFullscreenTarget(), this.emit(r.FULLSCREEN_FAILED, t);
},
getFullscreenTarget: function () {
var t;
return (
this.fullscreenTarget ||
(((t = document.createElement("div")).style.margin = "0"),
(t.style.padding = "0"),
(t.style.width = "100%"),
(t.style.height = "100%"),
(this.fullscreenTarget = t),
(this._createdFullscreenTarget = !0)),
this._createdFullscreenTarget && (this.canvas.parentNode.insertBefore(this.fullscreenTarget, this.canvas), this.fullscreenTarget.appendChild(this.canvas)),
this.fullscreenTarget
);
},
removeFullscreenTarget: function () {
var t, e;
!this._createdFullscreenTarget || ((t = this.fullscreenTarget) && t.parentNode && ((e = t.parentNode).insertBefore(this.canvas, t), e.removeChild(t)));
},
stopFullscreen: function () {
var t = this.fullscreen;
if (!t.available) return this.emit(r.FULLSCREEN_UNSUPPORTED), !1;
t.active && document[t.cancel](), this.removeFullscreenTarget(), this.getParentBounds(), this.emit(r.LEAVE_FULLSCREEN), this.refresh();
},
toggleFullscreen: function (t) {
this.fullscreen.active ? this.stopFullscreen() : this.startFullscreen(t);
},
startListeners: function () {
var e = this,
i = this.listeners;
(i.orientationChange = function () {
e.updateBounds(), (e._checkOrientation = !0), (e.dirty = !0);
}),
(i.windowResize = function () {
e.updateBounds(), (e.dirty = !0);
}),
window.addEventListener("orientationchange", i.orientationChange, !1),
window.addEventListener("resize", i.windowResize, !1),
this.fullscreen.available &&
((i.fullScreenChange = function (t) {
return e.onFullScreenChange(t);
}),
(i.fullScreenError = function (t) {
return e.onFullScreenError(t);
}),
["webkit", "moz", ""].forEach(function (t) {
document.addEventListener(t + "fullscreenchange", i.fullScreenChange, !1), document.addEventListener(t + "fullscreenerror", i.fullScreenError, !1);
}),
document.addEventListener("MSFullscreenChange", i.fullScreenChange, !1),
document.addEventListener("MSFullscreenError", i.fullScreenError, !1));
},
onFullScreenChange: function () {
document.fullscreenElement || document.webkitFullscreenElement || document.msFullscreenElement || document.mozFullScreenElement ? this.fullscreenSuccessHandler() : this.stopFullscreen();
},
onFullScreenError: function () {
this.removeFullscreenTarget();
},
step: function (t, e) {
this.parent && ((this._lastCheck += e), (this.dirty || this._lastCheck > this.resizeInterval) && (this.getParentBounds() && this.refresh(), (this.dirty = !1), (this._lastCheck = 0)));
},
stopListeners: function () {
var e = this.listeners;
window.removeEventListener("orientationchange", e.orientationChange, !1),
window.removeEventListener("resize", e.windowResize, !1),
["webkit", "moz", ""].forEach(function (t) {
document.removeEventListener(t + "fullscreenchange", e.fullScreenChange, !1), document.removeEventListener(t + "fullscreenerror", e.fullScreenError, !1);
}),
document.removeEventListener("MSFullscreenChange", e.fullScreenChange, !1),
document.removeEventListener("MSFullscreenError", e.fullScreenError, !1);
},
destroy: function () {
this.removeAllListeners(),
this.stopListeners(),
(this.game = null),
(this.canvas = null),
(this.canvasBounds = null),
(this.parent = null),
(this.fullscreenTarget = null),
this.parentSize.destroy(),
this.gameSize.destroy(),
this.baseSize.destroy(),
this.displaySize.destroy();
},
isFullscreen: {
get: function () {
return this.fullscreen.active;
},
},
width: {
get: function () {
return this.gameSize.width;
},
},
height: {
get: function () {
return this.gameSize.height;
},
},
isPortrait: {
get: function () {
return this.orientation === u.ORIENTATION.PORTRAIT;
},
},
isLandscape: {
get: function () {
return this.orientation === u.ORIENTATION.LANDSCAPE;
},
},
isGamePortrait: {
get: function () {
return this.height > this.width;
},
},
isGameLandscape: {
get: function () {
return this.width > this.height;
},
},
});
t.exports = v;
},
function (t, e, i) {
var n = i(18),
s = i(0),
r = i(76),
o = i(3),
a = new s({
initialize: function (t, e, i, n) {
void 0 === t && (t = 0),
void 0 === e && (e = t),
void 0 === i && (i = 0),
void 0 === n && (n = null),
(this._width = t),
(this._height = e),
(this._parent = n),
(this.aspectMode = i),
(this.aspectRatio = 0 === e ? 1 : t / e),
(this.minWidth = 0),
(this.minHeight = 0),
(this.maxWidth = Number.MAX_VALUE),
(this.maxHeight = Number.MAX_VALUE),
(this.snapTo = new o());
},
setAspectMode: function (t) {
return void 0 === t && (t = 0), (this.aspectMode = t), this.setSize(this._width, this._height);
},
setSnap: function (t, e) {
return void 0 === t && (t = 0), void 0 === e && (e = t), this.snapTo.set(t, e), this.setSize(this._width, this._height);
},
setParent: function (t) {
return (this._parent = t), this.setSize(this._width, this._height);
},
setMin: function (t, e) {
return void 0 === t && (t = 0), void 0 === e && (e = t), (this.minWidth = n(t, 0, this.maxWidth)), (this.minHeight = n(e, 0, this.maxHeight)), this.setSize(this._width, this._height);
},
setMax: function (t, e) {
return (
void 0 === t && (t = Number.MAX_VALUE),
void 0 === e && (e = t),
(this.maxWidth = n(t, this.minWidth, Number.MAX_VALUE)),
(this.maxHeight = n(e, this.minHeight, Number.MAX_VALUE)),
this.setSize(this._width, this._height)
);
},
setSize: function (t, e) {
switch ((void 0 === t && (t = 0), void 0 === e && (e = t), this.aspectMode)) {
case a.NONE:
(this._width = this.getNewWidth(r(t, this.snapTo.x))), (this._height = this.getNewHeight(r(e, this.snapTo.y))), (this.aspectRatio = 0 === this._height ? 1 : this._width / this._height);
break;
case a.WIDTH_CONTROLS_HEIGHT:
(this._width = this.getNewWidth(r(t, this.snapTo.x))), (this._height = this.getNewHeight(this._width * (1 / this.aspectRatio), !1));
break;
case a.HEIGHT_CONTROLS_WIDTH:
(this._height = this.getNewHeight(r(e, this.snapTo.y))), (this._width = this.getNewWidth(this._height * this.aspectRatio, !1));
break;
case a.FIT:
this.constrain(t, e, !0);
break;
case a.ENVELOP:
this.constrain(t, e, !1);
}
return this;
},
setAspectRatio: function (t) {
return (this.aspectRatio = t), this.setSize(this._width, this._height);
},
resize: function (t, e) {
return (this._width = this.getNewWidth(r(t, this.snapTo.x))), (this._height = this.getNewHeight(r(e, this.snapTo.y))), (this.aspectRatio = 0 === this._height ? 1 : this._width / this._height), this;
},
getNewWidth: function (t, e) {
return void 0 === e && (e = !0), (t = n(t, this.minWidth, this.maxWidth)), e && this._parent && t > this._parent.width && (t = Math.max(this.minWidth, this._parent.width)), t;
},
getNewHeight: function (t, e) {
return void 0 === e && (e = !0), (t = n(t, this.minHeight, this.maxHeight)), e && this._parent && t > this._parent.height && (t = Math.max(this.minHeight, this._parent.height)), t;
},
constrain: function (t, e, i) {
void 0 === t && (t = 0), void 0 === e && (e = t), void 0 === i && (i = !0), (t = this.getNewWidth(t)), (e = this.getNewHeight(e));
var n = this.snapTo,
s = 0 === e ? 1 : t / e;
return (
(i && this.aspectRatio > s) || (!i && this.aspectRatio < s)
? ((e = (t = r(t, n.x)) / this.aspectRatio), 0 < n.y && (t = (e = r(e, n.y)) * this.aspectRatio))
: ((i && this.aspectRatio < s) || (!i && this.aspectRatio > s)) && ((t = (e = r(e, n.y)) * this.aspectRatio), 0 < n.x && (e = (t = r(t, n.x)) * (1 / this.aspectRatio))),
(this._width = t),
(this._height = e),
this
);
},
fitTo: function (t, e) {
return this.constrain(t, e, !0);
},
envelop: function (t, e) {
return this.constrain(t, e, !1);
},
setWidth: function (t) {
return this.setSize(t, this._height);
},
setHeight: function (t) {
return this.setSize(this._width, t);
},
toString: function () {
return "[{ Size (width=" + this._width + " height=" + this._height + " aspectRatio=" + this.aspectRatio + " aspectMode=" + this.aspectMode + ") }]";
},
setCSS: function (t) {
t && t.style && ((t.style.width = this._width + "px"), (t.style.height = this._height + "px"));
},
copy: function (t) {
return t.setAspectMode(this.aspectMode), (t.aspectRatio = this.aspectRatio), t.setSize(this.width, this.height);
},
destroy: function () {
(this._parent = null), (this.snapTo = null);
},
width: {
get: function () {
return this._width;
},
set: function (t) {
this.setSize(t, this._height);
},
},
height: {
get: function () {
return this._height;
},
set: function (t) {
this.setSize(this._width, t);
},
},
});
(a.NONE = 0), (a.WIDTH_CONTROLS_HEIGHT = 1), (a.HEIGHT_CONTROLS_WIDTH = 2), (a.FIT = 3), (a.ENVELOP = 4), (t.exports = a);
},
function (t, e, i) {
var n = i(0),
r = i(144),
s = i(20),
o = i(22),
l = i(6),
a = i(95),
h = i(1),
u = i(418),
c = i(204),
d = new n({
initialize: function (t, e) {
if (
((this.game = t),
(this.keys = {}),
(this.scenes = []),
(this._pending = []),
(this._start = []),
(this._queue = []),
(this._data = {}),
(this.isProcessing = !1),
(this.isBooted = !1),
(this.customViewports = 0),
e)
) {
Array.isArray(e) || (e = [e]);
for (var i = 0; i < e.length; i++) this._pending.push({ key: "default", scene: e[i], autoStart: 0 === i, data: {} });
}
t.events.once(o.READY, this.bootQueue, this);
},
bootQueue: function () {
if (!this.isBooted) {
for (var t = 0; t < this._pending.length; t++) {
var e,
i,
n,
s = (i = this._pending[t]).key;
(n = i.scene) instanceof u
? (e = this.createSceneFromInstance(s, n))
: "object" == typeof n
? (e = this.createSceneFromObject(s, n))
: "function" == typeof n && (e = this.createSceneFromFunction(s, n)),
(s = e.sys.settings.key),
(this.keys[s] = e),
this.scenes.push(e),
this._data[s] && ((e.sys.settings.data = this._data[s].data), this._data[s].autoStart && (i.autoStart = !0)),
(i.autoStart || e.sys.settings.active) && this._start.push(s);
}
for (this._pending.length = 0, this._data = {}, this.isBooted = !0, t = 0; t < this._start.length; t++) (i = this._start[t]), this.start(i);
this._start.length = 0;
}
},
processQueue: function () {
var t,
e,
i = this._pending.length,
n = this._queue.length;
if (0 !== i || 0 !== n) {
if (i) {
for (t = 0; t < i; t++) (e = this._pending[t]), this.add(e.key, e.scene, e.autoStart, e.data);
for (t = 0; t < this._start.length; t++) (e = this._start[t]), this.start(e);
return (this._start.length = 0), void (this._pending.length = 0);
}
for (t = 0; t < this._queue.length; t++) this[(e = this._queue[t]).op](e.keyA, e.keyB);
this._queue.length = 0;
}
},
add: function (t, e, i, n) {
return (
void 0 === i && (i = !1),
void 0 === n && (n = {}),
this.isProcessing || !this.isBooted
? (this._pending.push({ key: t, scene: e, autoStart: i, data: n }), this.isBooted || (this._data[t] = { data: n }), null)
: ((t = this.getKey(t, e)),
e instanceof u
? (s = this.createSceneFromInstance(t, e))
: "object" == typeof e
? ((e.key = t), (s = this.createSceneFromObject(t, e)))
: "function" == typeof e && (s = this.createSceneFromFunction(t, e)),
(s.sys.settings.data = n),
(t = s.sys.settings.key),
(this.keys[t] = s),
this.scenes.push(s),
(i || s.sys.settings.active) && (this._pending.length ? this._start.push(t) : this.start(t)),
s)
);
var s;
},
remove: function (t) {
if (this.isProcessing) this._queue.push({ op: "remove", keyA: t, keyB: null });
else {
var e = this.getScene(t);
if (!e || e.sys.isTransitioning()) return this;
var i = this.scenes.indexOf(e),
n = e.sys.settings.key;
-1 < i && (delete this.keys[n], this.scenes.splice(i, 1), -1 < this._start.indexOf(n) && ((i = this._start.indexOf(n)), this._start.splice(i, 1)), e.sys.destroy());
}
return this;
},
bootScene: function (t) {
var e,
i = t.sys,
n = i.settings;
(i.sceneUpdate = h),
t.init && (t.init.call(t, n.data), (n.status = r.INIT), n.isTransition && i.events.emit(s.TRANSITION_INIT, n.transitionFrom, n.transitionDuration)),
i.load && (e = i.load).reset(),
e && t.preload ? (t.preload.call(t), 0 === e.list.size ? this.create(t) : ((n.status = r.LOADING), e.once(a.COMPLETE, this.loadComplete, this), e.start())) : this.create(t);
},
loadComplete: function (t) {
this.create(t.scene);
},
payloadComplete: function (t) {
this.bootScene(t.scene);
},
update: function (t, e) {
this.processQueue(), (this.isProcessing = !0);
for (var i = this.scenes.length - 1; 0 <= i; i--) {
var n = this.scenes[i].sys;
n.settings.status > r.START && n.settings.status <= r.RUNNING && n.step(t, e);
}
},
render: function (t) {
for (var e = 0; e < this.scenes.length; e++) {
var i = this.scenes[e].sys;
i.settings.visible && i.settings.status >= r.LOADING && i.settings.status < r.SLEEPING && i.render(t);
}
this.isProcessing = !1;
},
create: function (t) {
var e = t.sys,
i = e.settings;
(t.create && ((i.status = r.CREATING), t.create.call(t, i.data), i.status === r.DESTROYED)) ||
(i.isTransition && e.events.emit(s.TRANSITION_START, i.transitionFrom, i.transitionDuration), t.update && (e.sceneUpdate = t.update), (i.status = r.RUNNING), e.events.emit(s.CREATE, t));
},
createSceneFromFunction: function (t, e) {
var i = new e();
if (i instanceof u) {
var n = i.sys.settings.key;
if (("" !== n && (t = n), this.keys.hasOwnProperty(t))) throw new Error("Cannot add a Scene with duplicate key: " + t);
return this.createSceneFromInstance(t, i);
}
return (i.sys = new c(i)), (i.sys.settings.key = t), i.sys.init(this.game), i;
},
createSceneFromInstance: function (t, e) {
return "" === e.sys.settings.key && (e.sys.settings.key = t), e.sys.init(this.game), e;
},
createSceneFromObject: function (t, e) {
var i = new u(e),
n = i.sys.settings.key;
"" !== n ? (t = n) : (i.sys.settings.key = t), i.sys.init(this.game);
for (var s, r = ["init", "preload", "create", "update", "render"], o = 0; o < r.length; o++) {
var a = l(e, r[o], null);
a && (i[r[o]] = a);
}
if (e.hasOwnProperty("extend"))
for (var h in e.extend) e.extend.hasOwnProperty(h) && ((s = e.extend[h]), "data" === h && i.hasOwnProperty("data") && "object" == typeof s ? i.data.merge(s) : "sys" !== h && (i[h] = s));
return i;
},
getKey: function (t, e) {
if (((t = t || "default"), "function" == typeof e)) return t;
if ((e instanceof u ? (t = e.sys.settings.key) : "object" == typeof e && e.hasOwnProperty("key") && (t = e.key), this.keys.hasOwnProperty(t)))
throw new Error("Cannot add a Scene with duplicate key: " + t);
return t;
},
getScenes: function (t, e) {
void 0 === t && (t = !0), void 0 === e && (e = !1);
for (var i = [], n = this.scenes, s = 0; s < n.length; s++) {
var r = n[s];
r && (!t || (t && r.sys.isActive())) && i.push(r);
}
return e ? i.reverse() : i;
},
getScene: function (t) {
if ("string" == typeof t) {
if (this.keys[t]) return this.keys[t];
} else for (var e = 0; e < this.scenes.length; e++) if (t === this.scenes[e]) return t;
return null;
},
isActive: function (t) {
var e = this.getScene(t);
return e ? e.sys.isActive() : null;
},
isPaused: function (t) {
var e = this.getScene(t);
return e ? e.sys.isPaused() : null;
},
isVisible: function (t) {
var e = this.getScene(t);
return e ? e.sys.isVisible() : null;
},
isSleeping: function (t) {
var e = this.getScene(t);
return e ? e.sys.isSleeping() : null;
},
pause: function (t, e) {
var i = this.getScene(t);
return i && i.sys.pause(e), this;
},
resume: function (t, e) {
var i = this.getScene(t);
return i && i.sys.resume(e), this;
},
sleep: function (t, e) {
var i = this.getScene(t);
return i && !i.sys.isTransitioning() && i.sys.sleep(e), this;
},
wake: function (t, e) {
var i = this.getScene(t);
return i && i.sys.wake(e), this;
},
run: function (t, e) {
var i = this.getScene(t);
if (!i) {
for (var n = 0; n < this._pending.length; n++)
if (this._pending[n].key === t) {
this.queueOp("start", t, e);
break;
}
return this;
}
i.sys.isSleeping() ? i.sys.wake(e) : i.sys.isPaused() ? i.sys.resume(e) : this.start(t, e);
},
start: function (t, e) {
if (!this.isBooted) return (this._data[t] = { autoStart: !0, data: e }), this;
var i = this.getScene(t);
if (i) {
var n,
s = i.sys;
if (s.isActive() || s.isPaused()) s.shutdown(), (s.sceneUpdate = h), s.start(e);
else if (((s.sceneUpdate = h), s.start(e), s.load && (n = s.load), n && s.settings.hasOwnProperty("pack") && (n.reset(), n.addPack({ payload: s.settings.pack }))))
return (s.settings.status = r.LOADING), n.once(a.COMPLETE, this.payloadComplete, this), n.start(), this;
this.bootScene(i);
}
return this;
},
stop: function (t, e) {
var i = this.getScene(t);
return i && !i.sys.isTransitioning() && i.sys.shutdown(e), this;
},
switch: function (t, e) {
var i = this.getScene(t),
n = this.getScene(e);
return i && n && i !== n && (this.sleep(t), this.isSleeping(e) ? this.wake(e) : this.start(e)), this;
},
getAt: function (t) {
return this.scenes[t];
},
getIndex: function (t) {
var e = this.getScene(t);
return this.scenes.indexOf(e);
},
bringToTop: function (t) {
var e, i;
return (
this.isProcessing
? this._queue.push({ op: "bringToTop", keyA: t, keyB: null })
: -1 !== (e = this.getIndex(t)) && e < this.scenes.length && ((i = this.getScene(t)), this.scenes.splice(e, 1), this.scenes.push(i)),
this
);
},
sendToBack: function (t) {
var e, i;
return (
this.isProcessing
? this._queue.push({ op: "sendToBack", keyA: t, keyB: null })
: -1 !== (e = this.getIndex(t)) && 0 < e && ((i = this.getScene(t)), this.scenes.splice(e, 1), this.scenes.unshift(i)),
this
);
},
moveDown: function (t) {
var e, i, n, s;
return (
this.isProcessing
? this._queue.push({ op: "moveDown", keyA: t, keyB: null })
: 0 < (e = this.getIndex(t)) && ((i = e - 1), (n = this.getScene(t)), (s = this.getAt(i)), (this.scenes[e] = s), (this.scenes[i] = n)),
this
);
},
moveUp: function (t) {
var e, i, n, s;
return (
this.isProcessing
? this._queue.push({ op: "moveUp", keyA: t, keyB: null })
: (e = this.getIndex(t)) < this.scenes.length - 1 && ((i = e + 1), (n = this.getScene(t)), (s = this.getAt(i)), (this.scenes[e] = s), (this.scenes[i] = n)),
this
);
},
moveAbove: function (t, e) {
return (
t === e ||
(this.isProcessing
? this._queue.push({ op: "moveAbove", keyA: t, keyB: e })
: ((i = this.getIndex(t)), (n = this.getIndex(e)), -1 !== i && -1 !== n && ((s = this.getAt(n)), this.scenes.splice(n, 1), this.scenes.splice(i + 1, 0, s)))),
this
);
var i, n, s;
},
moveBelow: function (t, e) {
return (
t === e ||
(this.isProcessing
? this._queue.push({ op: "moveBelow", keyA: t, keyB: e })
: ((i = this.getIndex(t)),
(n = this.getIndex(e)),
-1 !== i && -1 !== n && ((s = this.getAt(n)), this.scenes.splice(n, 1), 0 === i ? this.scenes.unshift(s) : this.scenes.splice(i, 0, s)))),
this
);
var i, n, s;
},
queueOp: function (t, e, i) {
return this._queue.push({ op: t, keyA: e, keyB: i }), this;
},
swapPosition: function (t, e) {
return (
t === e ||
(this.isProcessing
? this._queue.push({ op: "swapPosition", keyA: t, keyB: e })
: (i = this.getIndex(t)) !== (n = this.getIndex(e)) && -1 !== i && -1 !== n && ((s = this.getAt(i)), (this.scenes[i] = this.scenes[n]), (this.scenes[n] = s))),
this
);
var i, n, s;
},
dump: function () {
for (var t = [], e = ["pending", "init", "start", "loading", "creating", "running", "paused", "sleeping", "shutdown", "destroyed"], i = 0; i < this.scenes.length; i++) {
var n = this.scenes[i].sys,
s = !n.settings.visible || (n.settings.status !== r.RUNNING && n.settings.status !== r.PAUSED) ? "[-] " : "[*] ";
(s += n.settings.key + " (" + e[n.settings.status] + ")"), t.push(s);
}
},
destroy: function () {
for (var t = 0; t < this.scenes.length; t++) this.scenes[t].sys.destroy();
(this.update = h), (this.scenes = []), (this._pending = []), (this._start = []), (this._queue = []), (this.game = null);
},
});
t.exports = d;
},
function (t, e, i) {
var n = i(0),
s = i(204),
r = new n({
initialize: function (t) {
(this.sys = new s(this, t)),
this.game,
this.anims,
this.cache,
this.registry,
this.sound,
this.textures,
this.events,
this.cameras,
this.add,
this.make,
this.scene,
this.children,
this.lights,
this.data,
this.input,
this.load,
this.time,
this.tweens,
this.physics,
this.matter,
this.scale,
this.plugins,
this.renderer;
},
update: function () {},
});
t.exports = r;
},
function (t, e, i) {
var r = i(2),
o = i(205);
t.exports = function (t) {
var e = t.game.config.defaultPhysicsSystem,
i = r(t.settings, "physics", !1);
if (e || i) {
var n = [];
if ((e && n.push(o(e + "Physics")), i)) for (var s in i) (s = o(s.concat("Physics"))), -1 === n.indexOf(s) && n.push(s);
return n;
}
};
},
function (t, e, i) {
var n = i(2);
t.exports = function (t) {
var e = t.plugins.getDefaultScenePlugins(),
i = n(t.settings, "plugins", !1);
return Array.isArray(i) ? i : e || [];
};
},
function (t, e, i) {
var n = i(144),
s = i(6),
r = i(127),
o = i(978),
a = {
create: function (t) {
return (
"string" == typeof t ? (t = { key: t }) : void 0 === t && (t = {}),
{
status: n.PENDING,
key: s(t, "key", ""),
active: s(t, "active", !1),
visible: s(t, "visible", !0),
isBooted: !1,
isTransition: !1,
transitionFrom: null,
transitionDuration: 0,
transitionAllowInput: !0,
data: {},
pack: s(t, "pack", !1),
cameras: s(t, "cameras", null),
map: s(t, "map", r(o, s(t, "mapAdd", {}))),
physics: s(t, "physics", {}),
loader: s(t, "loader", {}),
plugins: s(t, "plugins", !1),
input: s(t, "input", {}),
}
);
},
};
t.exports = a;
},
function (t, e, i) {
var h = i(31),
s = i(423),
n = i(0),
l = i(38),
r = i(33),
o = i(9),
u = i(106),
a = i(22),
c = i(388),
d = i(6),
f = i(425),
p = i(206),
g = new n({
Extends: o,
initialize: function (t) {
o.call(this),
(this.game = t),
(this.name = "TextureManager"),
(this.list = {}),
(this._tempCanvas = h.create2D(this, 1, 1)),
(this._tempContext = this._tempCanvas.getContext("2d")),
(this._pending = 0),
t.events.once(a.BOOT, this.boot, this);
},
boot: function () {
(this._pending = 3), this.on(u.LOAD, this.updatePending, this), this.on(u.ERROR, this.updatePending, this);
var t = this.game.config;
this.addBase64("__DEFAULT", t.defaultImage), this.addBase64("__MISSING", t.missingImage), this.addBase64("__WHITE", t.whiteImage), this.game.events.once(a.DESTROY, this.destroy, this);
},
updatePending: function () {
this._pending--, 0 === this._pending && (this.off(u.LOAD), this.off(u.ERROR), this.emit(u.READY));
},
checkKey: function (t) {
return !this.exists(t) || !1;
},
remove: function (t) {
if ("string" == typeof t) {
if (!this.exists(t)) return this;
t = this.get(t);
}
return this.list.hasOwnProperty(t.key) && (t.destroy(), this.emit(u.REMOVE, t.key)), this;
},
removeKey: function (t) {
return this.list.hasOwnProperty(t) && delete this.list[t], this;
},
addBase64: function (e, t) {
var i, n;
return (
this.checkKey(e) &&
((i = this),
((n = new Image()).onerror = function () {
i.emit(u.ERROR, e);
}),
(n.onload = function () {
var t = i.create(e, n);
f.Image(t, 0), i.emit(u.ADD, e, t), i.emit(u.LOAD, e, t);
}),
(n.src = t)),
this
);
},
getBase64: function (t, e, i, n) {
void 0 === i && (i = "image/png"), void 0 === n && (n = 0.92);
var s,
r,
o = "",
a = this.getFrame(t, e);
return (
(a && (a.source.isRenderTexture || a.source.isGLTexture)) ||
(a &&
((s = a.canvasData),
(r = h.create2D(this, s.width, s.height)).getContext("2d").drawImage(a.source.image, s.x, s.y, s.width, s.height, 0, 0, s.width, s.height),
(o = r.toDataURL(i, n)),
h.remove(r))),
o
);
},
addImage: function (t, e, i) {
var n = null;
return this.checkKey(t) && ((n = this.create(t, e)), f.Image(n, 0), i && n.setDataSource(i), this.emit(u.ADD, t, n)), n;
},
addGLTexture: function (t, e, i, n) {
var s = null;
return this.checkKey(t) && (void 0 === i && (i = e.width), void 0 === n && (n = e.height), (s = this.create(t, e, i, n)).add("__BASE", 0, 0, 0, i, n), this.emit(u.ADD, t, s)), s;
},
addRenderTexture: function (t, e) {
var i = null;
return this.checkKey(t) && ((i = this.create(t, e)).add("__BASE", 0, 0, 0, e.width, e.height), this.emit(u.ADD, t, i)), i;
},
generate: function (t, e) {
if (this.checkKey(t)) {
var i = h.create(this, 1, 1);
return (e.canvas = i), c(e), this.addCanvas(t, i);
}
return null;
},
createCanvas: function (t, e, i) {
if ((void 0 === e && (e = 256), void 0 === i && (i = 256), this.checkKey(t))) {
var n = h.create(this, e, i, r.CANVAS, !0);
return this.addCanvas(t, n);
}
return null;
},
addCanvas: function (t, e, i) {
void 0 === i && (i = !1);
var n = null;
return i ? (n = new s(this, t, e, e.width, e.height)) : this.checkKey(t) && ((n = new s(this, t, e, e.width, e.height)), (this.list[t] = n), this.emit(u.ADD, t, n)), n;
},
addAtlas: function (t, e, i, n) {
return Array.isArray(i.textures) || Array.isArray(i.frames) ? this.addAtlasJSONArray(t, e, i, n) : this.addAtlasJSONHash(t, e, i, n);
},
addAtlasJSONArray: function (t, e, i, n) {
var s = null;
if (this.checkKey(t)) {
if (((s = this.create(t, e)), Array.isArray(i)))
for (var r = 1 === i.length, o = 0; o < s.source.length; o++) {
var a = r ? i[0] : i[o];
f.JSONArray(s, o, a);
}
else f.JSONArray(s, 0, i);
n && s.setDataSource(n), this.emit(u.ADD, t, s);
}
return s;
},
addAtlasJSONHash: function (t, e, i, n) {
var s = null;
if (this.checkKey(t)) {
if (((s = this.create(t, e)), Array.isArray(i))) for (var r = 0; r < i.length; r++) f.JSONHash(s, r, i[r]);
else f.JSONHash(s, 0, i);
n && s.setDataSource(n), this.emit(u.ADD, t, s);
}
return s;
},
addAtlasXML: function (t, e, i, n) {
var s = null;
return this.checkKey(t) && ((s = this.create(t, e)), f.AtlasXML(s, 0, i), n && s.setDataSource(n), this.emit(u.ADD, t, s)), s;
},
addUnityAtlas: function (t, e, i, n) {
var s = null;
return this.checkKey(t) && ((s = this.create(t, e)), f.UnityYAML(s, 0, i), n && s.setDataSource(n), this.emit(u.ADD, t, s)), s;
},
addSpriteSheet: function (t, e, i) {
var n,
s,
r = null;
return this.checkKey(t) && ((n = (r = this.create(t, e)).source[0].width), (s = r.source[0].height), f.SpriteSheet(r, 0, 0, 0, n, s, i), this.emit(u.ADD, t, r)), r;
},
addSpriteSheetFromAtlas: function (t, e) {
if (!this.checkKey(t)) return null;
var i = d(e, "atlas", null),
n = d(e, "frame", null);
if (i && n) {
var s = this.get(i).get(n);
if (s) {
var r = this.create(t, s.source.image);
return s.trimmed ? f.SpriteSheetFromAtlas(r, s, e) : f.SpriteSheet(r, 0, s.cutX, s.cutY, s.cutWidth, s.cutHeight, e), this.emit(u.ADD, t, r), r;
}
}
},
create: function (t, e, i, n) {
var s = null;
return this.checkKey(t) && ((s = new p(this, t, e, i, n)), (this.list[t] = s)), s;
},
exists: function (t) {
return this.list.hasOwnProperty(t);
},
get: function (t) {
return void 0 === t && (t = "__DEFAULT"), this.list[t] ? this.list[t] : t instanceof p ? t : this.list.__MISSING;
},
cloneFrame: function (t, e) {
if (this.list[t]) return this.list[t].get(e).clone();
},
getFrame: function (t, e) {
if (this.list[t]) return this.list[t].get(e);
},
getTextureKeys: function () {
var t = [];
for (var e in this.list) "__DEFAULT" !== e && "__MISSING" !== e && t.push(e);
return t;
},
getPixel: function (t, e, i, n) {
var s = this.getFrame(i, n);
if (s) {
(t -= s.x), (e -= s.y);
var r = s.data.cut;
if (((t += r.x), (e += r.y), t >= r.x && t < r.r && e >= r.y && e < r.b)) {
var o = this._tempContext;
o.clearRect(0, 0, 1, 1), o.drawImage(s.source.image, t, e, 1, 1, 0, 0, 1, 1);
var a = o.getImageData(0, 0, 1, 1);
return new l(a.data[0], a.data[1], a.data[2], a.data[3]);
}
}
return null;
},
getPixelAlpha: function (t, e, i, n) {
var s = this.getFrame(i, n);
if (s) {
(t -= s.x), (e -= s.y);
var r = s.data.cut;
if (((t += r.x), (e += r.y), t >= r.x && t < r.r && e >= r.y && e < r.b)) {
var o = this._tempContext;
return o.clearRect(0, 0, 1, 1), o.drawImage(s.source.image, t, e, 1, 1, 0, 0, 1, 1), o.getImageData(0, 0, 1, 1).data[3];
}
}
return null;
},
setTexture: function (t, e, i) {
return this.list[e] && ((t.texture = this.list[e]), (t.frame = t.texture.get(i))), t;
},
renameTexture: function (t, e) {
var i = this.get(t);
return !(!i || t === e || ((i.key = e), (this.list[e] = i), delete this.list[t], 0));
},
each: function (t, e) {
for (var i = [null], n = 1; n < arguments.length; n++) i.push(arguments[n]);
for (var s in this.list) (i[0] = this.list[s]), t.apply(e, i);
},
destroy: function () {
for (var t in this.list) this.list[t].destroy();
(this.list = {}), (this.game = null), h.remove(this._tempCanvas);
},
});
t.exports = g;
},
function (t, e, i) {
var n = i(0),
f = i(18),
p = i(38),
s = i(33),
r = i(138),
o = i(206),
a = new n({
Extends: o,
initialize: function (t, e, i, n, s) {
o.call(this, t, e, i, n, s),
this.add("__BASE", 0, 0, 0, n, s),
(this._source = this.frames.__BASE.source),
(this.canvas = this._source.image),
(this.context = this.canvas.getContext("2d")),
(this.width = n),
(this.height = s),
(this.imageData = this.context.getImageData(0, 0, n, s)),
(this.data = null),
this.imageData && (this.data = this.imageData.data),
(this.pixels = null),
this.buffer,
this.data &&
(this.imageData.data.buffer
? ((this.buffer = this.imageData.data.buffer), (this.pixels = new Uint32Array(this.buffer)))
: window.ArrayBuffer
? ((this.buffer = new ArrayBuffer(this.imageData.data.length)), (this.pixels = new Uint32Array(this.buffer)))
: (this.pixels = this.imageData.data));
},
update: function () {
return (
(this.imageData = this.context.getImageData(0, 0, this.width, this.height)),
(this.data = this.imageData.data),
this.imageData.data.buffer
? ((this.buffer = this.imageData.data.buffer), (this.pixels = new Uint32Array(this.buffer)))
: window.ArrayBuffer
? ((this.buffer = new ArrayBuffer(this.imageData.data.length)), (this.pixels = new Uint32Array(this.buffer)))
: (this.pixels = this.imageData.data),
this.manager.game.config.renderType === s.WEBGL && this.refresh(),
this
);
},
draw: function (t, e, i) {
return this.context.drawImage(i, t, e), this.update();
},
drawFrame: function (t, e, i, n) {
void 0 === i && (i = 0), void 0 === n && (n = 0);
var s = this.manager.getFrame(t, e);
if (s) {
var r = s.canvasData,
o = s.cutWidth,
a = s.cutHeight,
h = s.source.resolution;
return this.context.drawImage(s.source.image, r.x, r.y, o, a, i, n, o / h, a / h), this.update();
}
return this;
},
setPixel: function (t, e, i, n, s, r) {
var o;
return (
void 0 === r && (r = 255),
(t = Math.abs(Math.floor(t))),
(e = Math.abs(Math.floor(e))),
-1 < this.getIndex(t, e) && (((o = this.context.getImageData(t, e, 1, 1)).data[0] = i), (o.data[1] = n), (o.data[2] = s), (o.data[3] = r), this.context.putImageData(o, t, e)),
this
);
},
putData: function (t, e, i, n, s, r, o) {
return void 0 === n && (n = 0), void 0 === s && (s = 0), void 0 === r && (r = t.width), void 0 === o && (o = t.height), this.context.putImageData(t, e, i, n, s, r, o), this;
},
getData: function (t, e, i, n) {
return (t = f(Math.floor(t), 0, this.width - 1)), (e = f(Math.floor(e), 0, this.height - 1)), (i = f(i, 1, this.width - t)), (n = f(n, 1, this.height - e)), this.context.getImageData(t, e, i, n);
},
getPixel: function (t, e, i) {
i = i || new p();
var n,
s,
r,
o,
a,
h = this.getIndex(t, e);
return -1 < h && ((s = (n = this.data)[h + 0]), (r = n[h + 1]), (o = n[h + 2]), (a = n[h + 3]), i.setTo(s, r, o, a)), i;
},
getPixels: function (t, e, i, n) {
void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = this.width), void 0 === n && (n = i), (t = Math.abs(Math.round(t))), (e = Math.abs(Math.round(e)));
for (var s = f(t, 0, this.width), r = f(t + i, 0, this.width), o = f(e, 0, this.height), a = f(e + n, 0, this.height), h = new p(), l = [], u = o; u < a; u++) {
for (var c = [], d = s; d < r; d++) (h = this.getPixel(d, u, h)), c.push({ x: d, y: u, color: h.color, alpha: h.alphaGL });
l.push(c);
}
return l;
},
getIndex: function (t, e) {
return (t = Math.abs(Math.round(t))), (e = Math.abs(Math.round(e))), t < this.width && e < this.height ? 4 * (t + e * this.width) : -1;
},
refresh: function () {
return this._source.update(), this;
},
getCanvas: function () {
return this.canvas;
},
getContext: function () {
return this.context;
},
clear: function (t, e, i, n) {
return void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = this.width), void 0 === n && (n = this.height), this.context.clearRect(t, e, i, n), this.update();
},
setSize: function (t, e) {
return (
void 0 === e && (e = t),
(t === this.width && e === this.height) ||
((this.canvas.width = t),
(this.canvas.height = e),
(this._source.width = t),
(this._source.height = e),
(this._source.isPowerOf2 = r(t, e)),
this.frames.__BASE.setSize(t, e, 0, 0),
(this.width = t),
(this.height = e),
this.refresh()),
this
);
},
destroy: function () {
o.prototype.destroy.call(this), (this._source = null), (this.canvas = null), (this.context = null), (this.imageData = null), (this.data = null), (this.pixels = null), (this.buffer = null);
},
});
t.exports = a;
},
function (t, e, i) {
var n = i(31),
s = i(0),
o = i(138),
a = i(168),
r = new s({
initialize: function (t, e, i, n, s) {
void 0 === s && (s = !1);
var r = t.manager.game;
(this.renderer = r.renderer),
(this.texture = t),
(this.source = e),
(this.image = e),
(this.compressionAlgorithm = null),
(this.resolution = 1),
(this.width = i || e.naturalWidth || e.videoWidth || e.width || 0),
(this.height = n || e.naturalHeight || e.videoHeight || e.height || 0),
(this.scaleMode = a.DEFAULT),
(this.isCanvas = e instanceof HTMLCanvasElement),
(this.isVideo = window.hasOwnProperty("HTMLVideoElement") && e instanceof HTMLVideoElement),
(this.isRenderTexture = "RenderTexture" === e.type),
(this.isGLTexture = window.hasOwnProperty("WebGLTexture") && e instanceof WebGLTexture),
(this.isPowerOf2 = o(this.width, this.height)),
(this.glTexture = null),
(this.glIndex = 0),
(this.glIndexCounter = -1),
(this.flipY = s),
this.init(r);
},
init: function (t) {
var e = this.renderer;
e &&
(e.gl
? this.isCanvas
? (this.glTexture = e.createCanvasTexture(this.image, !1, this.flipY))
: this.isVideo
? (this.glTexture = e.createVideoTexture(this.image, !1, this.flipY))
: this.isRenderTexture
? ((this.image = this.source.canvas), (this.glTexture = e.createTextureFromSource(null, this.width, this.height, this.scaleMode)))
: this.isGLTexture
? (this.glTexture = this.source)
: (this.glTexture = e.createTextureFromSource(this.image, this.width, this.height, this.scaleMode))
: this.isRenderTexture && (this.image = this.source.canvas)),
t.config.antialias || this.setFilter(1);
},
setFilter: function (t) {
this.renderer.gl && this.renderer.setTextureFilter(this.glTexture, t), (this.scaleMode = t);
},
setFlipY: function (t) {
return void 0 === t && (t = !0), (this.flipY = t), this;
},
update: function () {
var t = this.renderer.gl;
t && this.isCanvas
? (this.glTexture = this.renderer.updateCanvasTexture(this.image, this.glTexture, this.flipY))
: t && this.isVideo && (this.glTexture = this.renderer.updateVideoTexture(this.image, this.glTexture, this.flipY));
},
destroy: function () {
this.glTexture && this.renderer.deleteTexture(this.glTexture, !0),
this.isCanvas && n.remove(this.image),
(this.renderer = null),
(this.texture = null),
(this.source = null),
(this.image = null),
(this.glTexture = null);
},
});
t.exports = r;
},
function (t, e, i) {
t.exports = { AtlasXML: i(979), Canvas: i(980), Image: i(981), JSONArray: i(982), JSONHash: i(983), SpriteSheet: i(984), SpriteSheetFromAtlas: i(985), UnityYAML: i(986) };
},
function (t, e, i) {
var n = i(427),
s = i(430),
r = i(432),
o = {
create: function (t) {
var e = t.config.audio,
i = t.device.audio;
return new (e.noAudio || (!i.webAudio && !i.audioData) ? s : i.webAudio && !e.disableWebAudio ? r : n)(t);
},
};
t.exports = o;
},
function (t, e, i) {
var n = i(145),
s = i(0),
o = i(70),
r = i(429),
a = new s({
Extends: n,
initialize: function (t) {
(this.override = !0),
(this.audioPlayDelay = 0.1),
(this.loopEndOffset = 0.05),
(this.onBlurPausedSounds = []),
(this.locked = "ontouchstart" in window),
(this.lockedActionsQueue = this.locked ? [] : null),
(this._mute = !1),
(this._volume = 1),
n.call(this, t);
},
add: function (t, e) {
var i = new r(this, t, e);
return this.sounds.push(i), i;
},
unlock: function () {
this.locked = !1;
var e,
i,
n,
r = this;
this.game.cache.audio.entries.each(function (t, e) {
for (var i = 0; i < e.length; i++) if ("true" === e[i].dataset.locked) return !(r.locked = !0);
return !0;
}),
this.locked &&
((e = !1),
(i = function () {
e = !0;
}),
(n = function () {
var s, t;
e
? (e = !1)
: (document.body.removeEventListener("touchmove", i),
document.body.removeEventListener("touchend", n),
(s = []),
r.game.cache.audio.entries.each(function (t, e) {
for (var i = 0; i < e.length; i++) {
var n = e[i];
"true" === n.dataset.locked && s.push(n);
}
return !0;
}),
0 !== s.length &&
(((t = s[s.length - 1]).oncanplaythrough = function () {
(t.oncanplaythrough = null),
s.forEach(function (t) {
t.dataset.locked = "false";
}),
(r.unlocked = !0);
}),
s.forEach(function (t) {
t.load();
})));
}),
this.once(
o.UNLOCKED,
function () {
for (
this.forEachActiveSound(function (t) {
null === t.currentMarker && 0 === t.duration && (t.duration = t.tags[0].duration), (t.totalDuration = t.tags[0].duration);
});
this.lockedActionsQueue.length;
) {
var t = this.lockedActionsQueue.shift();
t.sound[t.prop].apply ? t.sound[t.prop].apply(t.sound, t.value || []) : (t.sound[t.prop] = t.value);
}
},
this
),
document.body.addEventListener("touchmove", i, !1),
document.body.addEventListener("touchend", n, !1));
},
onBlur: function () {
this.forEachActiveSound(function (t) {
t.isPlaying && (this.onBlurPausedSounds.push(t), t.onBlur());
});
},
onFocus: function () {
this.onBlurPausedSounds.forEach(function (t) {
t.onFocus();
}),
(this.onBlurPausedSounds.length = 0);
},
destroy: function () {
n.prototype.destroy.call(this), (this.onBlurPausedSounds.length = 0), (this.onBlurPausedSounds = null);
},
isLocked: function (t, e, i) {
return "true" === t.tags[0].dataset.locked && (this.lockedActionsQueue.push({ sound: t, prop: e, value: i }), !0);
},
setMute: function (t) {
return (this.mute = t), this;
},
mute: {
get: function () {
return this._mute;
},
set: function (t) {
(this._mute = t),
this.forEachActiveSound(function (t) {
t.updateMute();
}),
this.emit(o.GLOBAL_MUTE, this, t);
},
},
setVolume: function (t) {
return (this.volume = t), this;
},
volume: {
get: function () {
return this._volume;
},
set: function (t) {
(this._volume = t),
this.forEachActiveSound(function (t) {
t.updateVolume();
}),
this.emit(o.GLOBAL_VOLUME, this, t);
},
},
});
t.exports = a;
},
function (t, e, i) {
var a = i(78);
t.exports = function (t, e, i, n, s) {
if ((void 0 === n && (n = 0), void 0 === s && (s = t.length), a(t, n, s)))
for (var r = n; r < s; r++) {
var o = t[r];
if (!e || (e && void 0 === i && o.hasOwnProperty(e)) || (e && void 0 !== i && o[e] === i)) return o;
}
return null;
};
},
function (t, e, i) {
var n = i(146),
s = i(0),
r = i(70),
o = i(18),
a = new s({
Extends: n,
initialize: function (t, e, i) {
if ((void 0 === i && (i = {}), (this.tags = t.game.cache.audio.get(e)), !this.tags)) throw new Error('There is no audio asset with key "' + e + '" in the audio cache');
(this.audio = null), (this.startTime = 0), (this.previousTime = 0), (this.duration = this.tags[0].duration), (this.totalDuration = this.tags[0].duration), n.call(this, t, e, i);
},
play: function (t, e) {
return !(this.manager.isLocked(this, "play", [t, e]) || !n.prototype.play.call(this, t, e) || !this.pickAndPlayAudioTag() || (this.emit(r.PLAY, this), 0));
},
pause: function () {
return !(
this.manager.isLocked(this, "pause") ||
0 < this.startTime ||
!n.prototype.pause.call(this) ||
((this.currentConfig.seek = this.audio.currentTime - (this.currentMarker ? this.currentMarker.start : 0)), this.stopAndReleaseAudioTag(), this.emit(r.PAUSE, this), 0)
);
},
resume: function () {
return !(this.manager.isLocked(this, "resume") || 0 < this.startTime || !n.prototype.resume.call(this) || !this.pickAndPlayAudioTag() || (this.emit(r.RESUME, this), 0));
},
stop: function () {
return !this.manager.isLocked(this, "stop") && !!n.prototype.stop.call(this) && (this.stopAndReleaseAudioTag(), this.emit(r.STOP, this), !0);
},
pickAndPlayAudioTag: function () {
if (!this.pickAudioTag()) return this.reset(), !1;
var t = this.currentConfig.seek,
e = this.currentConfig.delay,
i = (this.currentMarker ? this.currentMarker.start : 0) + t;
return (
(this.previousTime = i),
(this.audio.currentTime = i),
this.applyConfig(),
0 === e ? ((this.startTime = 0), this.audio.paused && this.playCatchPromise()) : ((this.startTime = window.performance.now() + 1e3 * e), this.audio.paused || this.audio.pause()),
this.resetConfig(),
!0
);
},
pickAudioTag: function () {
if (this.audio) return !0;
for (var t = 0; t < this.tags.length; t++) {
var e = this.tags[t];
if ("false" === e.dataset.used) return (e.dataset.used = "true"), (this.audio = e), !0;
}
if (!this.manager.override) return !1;
var i = [];
this.manager.forEachActiveSound(function (t) {
t.key === this.key && t.audio && i.push(t);
}, this),
i.sort(function (t, e) {
return t.loop === e.loop ? e.seek / e.duration - t.seek / t.duration : t.loop ? 1 : -1;
});
var n = i[0];
return (this.audio = n.audio), n.reset(), (n.audio = null), (n.startTime = 0), !(n.previousTime = 0);
},
playCatchPromise: function () {
var t = this.audio.play();
t && t.catch(function (t) {});
},
stopAndReleaseAudioTag: function () {
(this.startTime = 0), (this.previousTime = 0), this.audio && (this.audio.pause(), (this.audio.dataset.used = "false"), (this.audio = null));
},
reset: function () {
n.prototype.stop.call(this);
},
onBlur: function () {
(this.isPlaying = !1),
(this.isPaused = !0),
(this.currentConfig.seek = this.audio.currentTime - (this.currentMarker ? this.currentMarker.start : 0)),
(this.currentConfig.delay = Math.max(0, (this.startTime - window.performance.now()) / 1e3)),
this.stopAndReleaseAudioTag();
},
onFocus: function () {
(this.isPlaying = !0), (this.isPaused = !1), this.pickAndPlayAudioTag();
},
update: function (t) {
if (this.isPlaying)
if (0 < this.startTime)
this.startTime < t - this.manager.audioPlayDelay &&
((this.audio.currentTime += Math.max(0, t - this.startTime) / 1e3), (this.startTime = 0), (this.previousTime = this.audio.currentTime), this.playCatchPromise());
else {
var e = this.currentMarker ? this.currentMarker.start : 0,
i = e + this.duration,
n = this.audio.currentTime;
if (this.currentConfig.loop)
n >= i - this.manager.loopEndOffset
? ((this.audio.currentTime = e + Math.max(0, n - i)), (n = this.audio.currentTime))
: n < e && ((this.audio.currentTime += e), (n = this.audio.currentTime)),
n < this.previousTime && this.emit(r.LOOPED, this);
else if (i <= n) return this.reset(), this.stopAndReleaseAudioTag(), void this.emit(r.COMPLETE, this);
this.previousTime = n;
}
},
destroy: function () {
n.prototype.destroy.call(this), (this.tags = null), this.audio && this.stopAndReleaseAudioTag();
},
updateMute: function () {
this.audio && (this.audio.muted = this.currentConfig.mute || this.manager.mute);
},
updateVolume: function () {
this.audio && (this.audio.volume = o(this.currentConfig.volume * this.manager.volume, 0, 1));
},
calculateRate: function () {
n.prototype.calculateRate.call(this), this.audio && (this.audio.playbackRate = this.totalRate);
},
mute: {
get: function () {
return this.currentConfig.mute;
},
set: function (t) {
(this.currentConfig.mute = t), this.manager.isLocked(this, "mute", t) || (this.updateMute(), this.emit(r.MUTE, this, t));
},
},
setMute: function (t) {
return (this.mute = t), this;
},
volume: {
get: function () {
return this.currentConfig.volume;
},
set: function (t) {
(this.currentConfig.volume = t), this.manager.isLocked(this, "volume", t) || (this.updateVolume(), this.emit(r.VOLUME, this, t));
},
},
setVolume: function (t) {
return (this.volume = t), this;
},
rate: {
get: function () {
return this.currentConfig.rate;
},
set: function (t) {
(this.currentConfig.rate = t), this.manager.isLocked(this, r.RATE, t) || (this.calculateRate(), this.emit(r.RATE, this, t));
},
},
setRate: function (t) {
return (this.rate = t), this;
},
detune: {
get: function () {
return this.currentConfig.detune;
},
set: function (t) {
(this.currentConfig.detune = t), this.manager.isLocked(this, r.DETUNE, t) || (this.calculateRate(), this.emit(r.DETUNE, this, t));
},
},
setDetune: function (t) {
return (this.detune = t), this;
},
seek: {
get: function () {
return this.isPlaying ? this.audio.currentTime - (this.currentMarker ? this.currentMarker.start : 0) : this.isPaused ? this.currentConfig.seek : 0;
},
set: function (t) {
this.manager.isLocked(this, "seek", t) ||
0 < this.startTime ||
((this.isPlaying || this.isPaused) &&
((t = Math.min(Math.max(0, t), this.duration)),
this.isPlaying ? ((this.previousTime = t), (this.audio.currentTime = t)) : this.isPaused && (this.currentConfig.seek = t),
this.emit(r.SEEK, this, t)));
},
},
setSeek: function (t) {
return (this.seek = t), this;
},
loop: {
get: function () {
return this.currentConfig.loop;
},
set: function (t) {
(this.currentConfig.loop = t), this.manager.isLocked(this, "loop", t) || (this.audio && (this.audio.loop = t), this.emit(r.LOOP, this, t));
},
},
setLoop: function (t) {
return (this.loop = t), this;
},
pan: {
get: function () {
return this.currentConfig.pan;
},
set: function (t) {
(this.currentConfig.pan = t), this.emit(r.PAN, this, t);
},
},
setPan: function (t) {
return (this.pan = t), this;
},
});
t.exports = a;
},
function (t, e, i) {
var n = i(145),
s = i(0),
r = i(9),
o = i(431),
a = i(1),
h = new s({
Extends: r,
initialize: function (t) {
r.call(this), (this.game = t), (this.sounds = []), (this.mute = !1), (this.volume = 1), (this.rate = 1), (this.detune = 0), (this.pauseOnBlur = !0), (this.locked = !1);
},
add: function (t, e) {
var i = new o(this, t, e);
return this.sounds.push(i), i;
},
addAudioSprite: function (t, e) {
var i = this.add(t, e);
return (i.spritemap = {}), i;
},
play: function (t, e) {
return !1;
},
playAudioSprite: function (t, e, i) {
return !1;
},
remove: function (t) {
return n.prototype.remove.call(this, t);
},
removeByKey: function (t) {
return n.prototype.removeByKey.call(this, t);
},
pauseAll: a,
resumeAll: a,
stopAll: a,
update: a,
setRate: a,
setDetune: a,
setMute: a,
setVolume: a,
forEachActiveSound: function (t, e) {
n.prototype.forEachActiveSound.call(this, t, e);
},
destroy: function () {
n.prototype.destroy.call(this);
},
});
t.exports = h;
},
function (t, e, i) {
function n() {
return !1;
}
function s() {
return this;
}
var r = i(146),
o = i(0),
a = i(9),
h = i(17),
l = new o({
Extends: a,
initialize: function (t, e, i) {
void 0 === i && (i = {}),
a.call(this),
(this.manager = t),
(this.key = e),
(this.isPlaying = !1),
(this.isPaused = !1),
(this.totalRate = 1),
(this.duration = 0),
(this.totalDuration = 0),
(this.config = h({ mute: !1, volume: 1, rate: 1, detune: 0, seek: 0, loop: !1, delay: 0, pan: 0 }, i)),
(this.currentConfig = this.config),
(this.mute = !1),
(this.volume = 1),
(this.rate = 1),
(this.detune = 0),
(this.seek = 0),
(this.loop = !1),
(this.pan = 0),
(this.markers = {}),
(this.currentMarker = null),
(this.pendingRemove = !1);
},
addMarker: n,
updateMarker: n,
removeMarker: function () {
return null;
},
play: n,
pause: n,
resume: n,
stop: n,
destroy: function () {
r.prototype.destroy.call(this);
},
setMute: s,
setVolume: s,
setRate: s,
setDetune: s,
setSeek: s,
setLoop: s,
setPan: s,
});
t.exports = l;
},
function (t, e, i) {
var c = i(433),
n = i(145),
s = i(0),
d = i(70),
r = i(22),
o = i(434),
a = new s({
Extends: n,
initialize: function (t) {
(this.context = this.createAudioContext(t)),
(this.masterMuteNode = this.context.createGain()),
(this.masterVolumeNode = this.context.createGain()),
this.masterMuteNode.connect(this.masterVolumeNode),
this.masterVolumeNode.connect(this.context.destination),
(this.destination = this.masterMuteNode),
(this.locked = "suspended" === this.context.state && ("ontouchstart" in window || "onclick" in window)),
n.call(this, t),
this.locked && t.isBooted ? this.unlock() : t.events.once(r.BOOT, this.unlock, this);
},
createAudioContext: function (t) {
var e = t.config.audio;
return e.context
? (e.context.resume(), e.context)
: window.hasOwnProperty("AudioContext")
? new AudioContext()
: window.hasOwnProperty("webkitAudioContext")
? new window.webkitAudioContext()
: void 0;
},
setAudioContext: function (t) {
return (
this.context && this.context.close(),
this.masterMuteNode && this.masterMuteNode.disconnect(),
this.masterVolumeNode && this.masterVolumeNode.disconnect(),
(this.context = t),
(this.masterMuteNode = t.createGain()),
(this.masterVolumeNode = t.createGain()),
this.masterMuteNode.connect(this.masterVolumeNode),
this.masterVolumeNode.connect(t.destination),
(this.destination = this.masterMuteNode),
this
);
},
add: function (t, e) {
var i = new o(this, t, e);
return this.sounds.push(i), i;
},
decodeAudio: function (t, e) {
for (var i = Array.isArray(t) ? t : [{ key: t, data: e }], n = this.game.cache.audio, s = i.length, r = 0; r < i.length; r++) {
var o = i[r],
a = o.key,
h = o.data;
"string" == typeof h && (h = c(h));
var l = function (t, e) {
n.add(t, e), this.emit(d.DECODED, t), 0 == --s && this.emit(d.DECODED_ALL);
}.bind(this, a),
u = function (t, e) {
0 == --s && this.emit(d.DECODED_ALL);
}.bind(this, a);
this.context.decodeAudioData(h, l, u);
}
},
unlock: function () {
function e() {
var t;
i.context &&
n &&
((t = n.removeEventListener),
i.context.resume().then(
function () {
t("touchstart", e), t("touchend", e), t("click", e), t("keydown", e), (i.unlocked = !0);
},
function () {
t("touchstart", e), t("touchend", e), t("click", e), t("keydown", e);
}
));
}
var i = this,
n = document.body;
n && (n.addEventListener("touchstart", e, !1), n.addEventListener("touchend", e, !1), n.addEventListener("click", e, !1), n.addEventListener("keydown", e, !1));
},
onBlur: function () {
this.locked || this.context.suspend();
},
onFocus: function () {
var t = this.context;
("suspended" !== t.state && "interrupted" !== t.state) || this.locked || t.resume();
},
update: function (t, e) {
n.prototype.update.call(this, t, e);
var i = this.context;
i && "interrupted" === i.state && i.resume();
},
destroy: function () {
var t;
(this.destination = null),
this.masterVolumeNode.disconnect(),
(this.masterVolumeNode = null),
this.masterMuteNode.disconnect(),
(this.masterMuteNode = null),
this.game.config.audio.context
? this.context.suspend()
: (t = this).context.close().then(function () {
t.context = null;
}),
n.prototype.destroy.call(this);
},
setMute: function (t) {
return (this.mute = t), this;
},
mute: {
get: function () {
return 0 === this.masterMuteNode.gain.value;
},
set: function (t) {
this.masterMuteNode.gain.setValueAtTime(t ? 0 : 1, 0), this.emit(d.GLOBAL_MUTE, this, t);
},
},
setVolume: function (t) {
return (this.volume = t), this;
},
volume: {
get: function () {
return this.masterVolumeNode.gain.value;
},
set: function (t) {
this.masterVolumeNode.gain.setValueAtTime(t, 0), this.emit(d.GLOBAL_VOLUME, this, t);
},
},
});
t.exports = a;
},
function (t, e) {
for (var i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", c = new Uint8Array(256), n = 0; n < i.length; n++) c[i.charCodeAt(n)] = n;
t.exports = function (t) {
var e,
i,
n,
s,
r = (t = t.substr(t.indexOf(",") + 1)).length,
o = 0.75 * r,
a = 0;
"=" === t[r - 1] && (o--, "=" === t[r - 2] && o--);
for (var h = new ArrayBuffer(o), l = new Uint8Array(h), u = 0; u < r; u += 4)
(e = c[t.charCodeAt(u)]),
(i = c[t.charCodeAt(u + 1)]),
(n = c[t.charCodeAt(u + 2)]),
(s = c[t.charCodeAt(u + 3)]),
(l[a++] = (e << 2) | (i >> 4)),
(l[a++] = ((15 & i) << 4) | (n >> 2)),
(l[a++] = ((3 & n) << 6) | (63 & s));
return h;
};
},
function (t, e, i) {
var n = i(146),
s = i(0),
r = i(70),
o = new s({
Extends: n,
initialize: function (t, e, i) {
if ((void 0 === i && (i = {}), (this.audioBuffer = t.game.cache.audio.get(e)), !this.audioBuffer)) throw new Error('Audio key "' + e + '" missing from cache');
(this.source = null),
(this.loopSource = null),
(this.muteNode = t.context.createGain()),
(this.volumeNode = t.context.createGain()),
(this.pannerNode = null),
(this.playTime = 0),
(this.startTime = 0),
(this.loopTime = 0),
(this.rateUpdates = []),
(this.hasEnded = !1),
(this.hasLooped = !1),
this.muteNode.connect(this.volumeNode),
t.context.createStereoPanner
? ((this.pannerNode = t.context.createStereoPanner()), this.volumeNode.connect(this.pannerNode), this.pannerNode.connect(t.destination))
: this.volumeNode.connect(t.destination),
(this.duration = this.audioBuffer.duration),
(this.totalDuration = this.audioBuffer.duration),
n.call(this, t, e, i);
},
play: function (t, e) {
return !!n.prototype.play.call(this, t, e) && (this.stopAndRemoveBufferSource(), this.createAndStartBufferSource(), this.emit(r.PLAY, this), !0);
},
pause: function () {
return !(
this.manager.context.currentTime < this.startTime ||
!n.prototype.pause.call(this) ||
((this.currentConfig.seek = this.getCurrentTime()), this.stopAndRemoveBufferSource(), this.emit(r.PAUSE, this), 0)
);
},
resume: function () {
return !(this.manager.context.currentTime < this.startTime || !n.prototype.resume.call(this) || (this.createAndStartBufferSource(), this.emit(r.RESUME, this), 0));
},
stop: function () {
return !!n.prototype.stop.call(this) && (this.stopAndRemoveBufferSource(), this.emit(r.STOP, this), !0);
},
createAndStartBufferSource: function () {
var t = this.currentConfig.seek,
e = this.currentConfig.delay,
i = this.manager.context.currentTime + e,
n = (this.currentMarker ? this.currentMarker.start : 0) + t,
s = this.duration - t;
(this.playTime = i - t), (this.startTime = i), (this.source = this.createBufferSource()), this.applyConfig(), this.source.start(Math.max(0, i), Math.max(0, n), Math.max(0, s)), this.resetConfig();
},
createAndStartLoopBufferSource: function () {
var t = this.getLoopTime(),
e = this.currentMarker ? this.currentMarker.start : 0,
i = this.duration;
(this.loopTime = t),
(this.loopSource = this.createBufferSource()),
this.loopSource.playbackRate.setValueAtTime(this.totalRate, 0),
this.loopSource.start(Math.max(0, t), Math.max(0, e), Math.max(0, i));
},
createBufferSource: function () {
var e = this,
t = this.manager.context.createBufferSource();
return (
(t.buffer = this.audioBuffer),
t.connect(this.muteNode),
(t.onended = function (t) {
t.target === e.source && (e.currentConfig.loop ? (e.hasLooped = !0) : (e.hasEnded = !0));
}),
t
);
},
stopAndRemoveBufferSource: function () {
this.source && (this.source.stop(), this.source.disconnect(), (this.source = null)), (this.playTime = 0), (this.startTime = 0), this.stopAndRemoveLoopBufferSource();
},
stopAndRemoveLoopBufferSource: function () {
this.loopSource && (this.loopSource.stop(), this.loopSource.disconnect(), (this.loopSource = null)), (this.loopTime = 0);
},
applyConfig: function () {
(this.rateUpdates.length = 0), this.rateUpdates.push({ time: 0, rate: 1 }), n.prototype.applyConfig.call(this);
},
update: function () {
this.hasEnded
? ((this.hasEnded = !1), n.prototype.stop.call(this), this.stopAndRemoveBufferSource(), this.emit(r.COMPLETE, this))
: this.hasLooped &&
((this.hasLooped = !1),
(this.source = this.loopSource),
(this.loopSource = null),
(this.playTime = this.startTime = this.loopTime),
(this.rateUpdates.length = 0),
this.rateUpdates.push({ time: 0, rate: this.totalRate }),
this.createAndStartLoopBufferSource(),
this.emit(r.LOOPED, this));
},
destroy: function () {
n.prototype.destroy.call(this),
(this.audioBuffer = null),
this.stopAndRemoveBufferSource(),
this.muteNode.disconnect(),
(this.muteNode = null),
this.volumeNode.disconnect(),
(this.volumeNode = null),
this.pannerNode && (this.pannerNode.disconnect(), (this.pannerNode = null)),
(this.rateUpdates.length = 0),
(this.rateUpdates = null);
},
calculateRate: function () {
n.prototype.calculateRate.call(this);
var t = this.manager.context.currentTime;
this.source && "number" == typeof this.totalRate && this.source.playbackRate.setValueAtTime(this.totalRate, t),
this.isPlaying &&
(this.rateUpdates.push({ time: Math.max(this.startTime, t) - this.playTime, rate: this.totalRate }),
this.loopSource && (this.stopAndRemoveLoopBufferSource(), this.createAndStartLoopBufferSource()));
},
getCurrentTime: function () {
for (var t = 0, e = 0; e < this.rateUpdates.length; e++)
t += ((e < this.rateUpdates.length - 1 ? this.rateUpdates[e + 1].time : this.manager.context.currentTime - this.playTime) - this.rateUpdates[e].time) * this.rateUpdates[e].rate;
return t;
},
getLoopTime: function () {
for (var t = 0, e = 0; e < this.rateUpdates.length - 1; e++) t += (this.rateUpdates[e + 1].time - this.rateUpdates[e].time) * this.rateUpdates[e].rate;
var i = this.rateUpdates[this.rateUpdates.length - 1];
return this.playTime + i.time + (this.duration - t) / i.rate;
},
rate: {
get: function () {
return this.currentConfig.rate;
},
set: function (t) {
(this.currentConfig.rate = t), this.calculateRate(), this.emit(r.RATE, this, t);
},
},
setRate: function (t) {
return (this.rate = t), this;
},
detune: {
get: function () {
return this.currentConfig.detune;
},
set: function (t) {
(this.currentConfig.detune = t), this.calculateRate(), this.emit(r.DETUNE, this, t);
},
},
setDetune: function (t) {
return (this.detune = t), this;
},
mute: {
get: function () {
return 0 === this.muteNode.gain.value;
},
set: function (t) {
(this.currentConfig.mute = t), this.muteNode.gain.setValueAtTime(t ? 0 : 1, 0), this.emit(r.MUTE, this, t);
},
},
setMute: function (t) {
return (this.mute = t), this;
},
volume: {
get: function () {
return this.volumeNode.gain.value;
},
set: function (t) {
(this.currentConfig.volume = t), this.volumeNode.gain.setValueAtTime(t, 0), this.emit(r.VOLUME, this, t);
},
},
setVolume: function (t) {
return (this.volume = t), this;
},
seek: {
get: function () {
return this.isPlaying ? (this.manager.context.currentTime < this.startTime ? this.startTime - this.playTime : this.getCurrentTime()) : this.isPaused ? this.currentConfig.seek : 0;
},
set: function (t) {
this.manager.context.currentTime < this.startTime ||
((this.isPlaying || this.isPaused) &&
((t = Math.min(Math.max(0, t), this.duration)),
(this.currentConfig.seek = t),
this.isPlaying && (this.stopAndRemoveBufferSource(), this.createAndStartBufferSource()),
this.emit(r.SEEK, this, t)));
},
},
setSeek: function (t) {
return (this.seek = t), this;
},
loop: {
get: function () {
return this.currentConfig.loop;
},
set: function (t) {
(this.currentConfig.loop = t), this.isPlaying && (this.stopAndRemoveLoopBufferSource(), t && this.createAndStartLoopBufferSource()), this.emit(r.LOOP, this, t);
},
},
setLoop: function (t) {
return (this.loop = t), this;
},
pan: {
get: function () {
return this.pannerNode ? this.pannerNode.pan.value : 0;
},
set: function (t) {
(this.currentConfig.pan = t), this.pannerNode && this.pannerNode.pan.setValueAtTime(t, this.manager.context.currentTime), this.emit(r.PAN, this, t);
},
},
setPan: function (t) {
return (this.pan = t), this;
},
});
t.exports = o;
},
function (t, e) {
t.exports = function (t) {
for (var e = t.length, i = t[0].length, n = new Array(i), s = 0; s < i; s++) {
n[s] = new Array(e);
for (var r = e - 1; -1 < r; r--) n[s][r] = t[r][s];
}
return n;
};
},
function (t, e) {
function g(t, e, i) {
var n = t[e];
(t[e] = t[i]), (t[i] = n);
}
function v(t, e) {
return t < e ? -1 : e < t ? 1 : 0;
}
var y = function (t, e, i, n, s) {
for (void 0 === i && (i = 0), void 0 === n && (n = t.length - 1), void 0 === s && (s = v); i < n; ) {
var r, o, a, h, l, u, c;
600 < n - i &&
((r = n - i + 1),
(o = e - i + 1),
(a = Math.log(r)),
(h = 0.5 * Math.exp((2 * a) / 3)),
(l = 0.5 * Math.sqrt((a * h * (r - h)) / r) * (o - r / 2 < 0 ? -1 : 1)),
(u = Math.max(i, Math.floor(e - (o * h) / r + l))),
(c = Math.min(n, Math.floor(e + ((r - o) * h) / r + l))),
y(t, e, u, c, s));
var d = t[e],
f = i,
p = n;
for (g(t, i, e), 0 < s(t[n], d) && g(t, i, n); f < p; ) {
for (g(t, f, p), f++, p--; s(t[f], d) < 0; ) f++;
for (; 0 < s(t[p], d); ) p--;
}
0 === s(t[i], d) ? g(t, i, p) : g(t, ++p, n), p <= e && (i = p + 1), e <= p && (n = p - 1);
}
};
t.exports = y;
},
function (t, e, i) {
var f = i(6),
p = i(131);
t.exports = function (t, e, i) {
var n,
s = f(i, "max", 0),
r = f(i, "qty", 1),
o = f(i, "random", !1),
a = f(i, "randomB", !1),
h = f(i, "repeat", 0),
l = f(i, "yoyo", !1),
u = [];
a && p(e), -1 === h && (h = 0 === s ? 0 : ((n = t.length * e.length * r), l && (n *= 2), Math.ceil(s / n)));
for (var c = 0; c <= h; c++) {
var d = (function (t, e, i) {
for (var n = [], s = 0; s < t.length; s++) for (var r = 0; r < e.length; r++) for (var o = 0; o < i; o++) n.push({ a: t[s], b: e[r] });
return n;
})(t, e, r);
o && p(d), (u = u.concat(d)), l && (d.reverse(), (u = u.concat(d)));
}
return s && u.splice(s), u;
};
},
function (t, e, i) {
t.exports = { PROCESS_QUEUE_ADD: i(1041), PROCESS_QUEUE_REMOVE: i(1042) };
},
function (t, e, i) {
var f = i(13);
t.exports = function (t, e) {
var i,
n,
s,
r,
o,
a,
h,
l,
u,
c,
d = f(e, "anims", null);
return (
null === d ||
("string" == typeof d
? t.anims.play(d)
: "object" == typeof d &&
((i = t.anims),
(n = f(d, "key", void 0)) &&
((s = f(d, "startFrame", void 0)),
(r = f(d, "delay", 0)),
(o = f(d, "repeat", 0)),
(a = f(d, "repeatDelay", 0)),
(h = f(d, "yoyo", !1)),
(l = f(d, "play", !1)),
(u = f(d, "delayedPlay", 0)),
(c = { key: n, delay: r, repeat: o, repeatDelay: a, yoyo: h, startFrame: s }),
l ? i.play(c) : 0 < u ? i.playAfterDelay(c, u) : i.load(c)))),
t
);
};
},
function (t, e, i) {
var n = i(0),
s = i(109),
r = new n({
initialize: function (t, e, i, n, s) {
(this.parent = t), (this.x = e), (this.y = i), (this.frame = n), (this.data = {}), (this.tint = 16777215), (this._visible = s), (this._alpha = 1), (this.flipX = !1), (this.flipY = !1);
},
setFrame: function (t) {
return void 0 === t ? (this.frame = this.parent.frame) : t instanceof s && t.texture === this.parent.texture ? (this.frame = t) : (this.frame = this.parent.texture.get(t)), this;
},
resetFlip: function () {
return (this.flipX = !1), (this.flipY = !1), this;
},
reset: function (t, e, i) {
return (this.x = t), (this.y = e), (this.flipX = !1), (this.flipY = !1), (this._alpha = 1), (this._visible = !0), (this.parent.dirty = !0), i && this.setFrame(i), this;
},
setPosition: function (t, e) {
return (this.x = t), (this.y = e), this;
},
setFlipX: function (t) {
return (this.flipX = t), this;
},
setFlipY: function (t) {
return (this.flipY = t), this;
},
setFlip: function (t, e) {
return (this.flipX = t), (this.flipY = e), this;
},
setVisible: function (t) {
return (this.visible = t), this;
},
setAlpha: function (t) {
return (this.alpha = t), this;
},
setTint: function (t) {
return (this.tint = t), this;
},
destroy: function () {
(this.parent.dirty = !0), this.parent.children.remove(this), (this.parent = void 0), (this.frame = void 0), (this.data = void 0);
},
visible: {
get: function () {
return this._visible;
},
set: function (t) {
(this.parent.dirty |= this._visible !== t), (this._visible = t);
},
},
alpha: {
get: function () {
return this._alpha;
},
set: function (t) {
(this.parent.dirty |= 0 < this._alpha != 0 < t), (this._alpha = t);
},
},
});
t.exports = r;
},
function (t, e, i) {
var a = i(10);
t.exports = function (t, e, i) {
void 0 === i && (i = new a());
var n = Math.min(t.x, e.x),
s = Math.min(t.y, e.y),
r = Math.max(t.right, e.right) - n,
o = Math.max(t.bottom, e.bottom) - s;
return i.setTo(n, s, r, o);
};
},
function (t, e, i) {
var n = i(0),
s = i(11),
r = i(1055),
o = i(15),
a = i(7),
h = i(202),
l = i(20),
u = i(140),
c = new n({
Extends: o,
Mixins: [s.AlphaSingle, s.BlendMode, s.Depth, s.Origin, s.ScrollFactor, s.Transform, s.Visible, r],
initialize: function (t, e, i, n, s, r) {
o.call(this, t, "DOMElement"),
(this.parent = t.sys.game.domContainer),
(this.cache = t.sys.cache.html),
this.node,
(this.transformOnly = !1),
(this.skewX = 0),
(this.skewY = 0),
(this.rotate3d = new u()),
(this.rotate3dAngle = "deg"),
(this.pointerEvents = "auto"),
(this.width = 0),
(this.height = 0),
(this.displayWidth = 0),
(this.displayHeight = 0),
(this.handler = this.dispatchNativeEvent.bind(this)),
this.setPosition(e, i),
"string" == typeof n ? ("#" === n[0] ? this.setElement(n.substr(1), s, r) : this.createElement(n, s, r)) : n && this.setElement(n, s, r),
t.sys.events.on(l.SLEEP, this.handleSceneEvent, this),
t.sys.events.on(l.WAKE, this.handleSceneEvent, this);
},
addedToScene: function () {
this.scene.sys.updateList.add(this);
},
removedFromScene: function () {
this.scene.sys.updateList.remove(this);
},
handleSceneEvent: function (t) {
var e = this.node,
i = e.style;
e && (i.display = t.settings.visible ? "block" : "none");
},
setSkew: function (t, e) {
return void 0 === t && (t = 0), void 0 === e && (e = t), (this.skewX = t), (this.skewY = e), this;
},
setPerspective: function (t) {
return (this.parent.style.perspective = t + "px"), this;
},
perspective: {
get: function () {
return parseFloat(this.parent.style.perspective);
},
set: function (t) {
this.parent.style.perspective = t + "px";
},
},
addListener: function (t) {
if (this.node) {
t = t.split(" ");
for (var e = 0; e < t.length; e++) this.node.addEventListener(t[e], this.handler, !1);
}
return this;
},
removeListener: function (t) {
if (this.node) {
t = t.split(" ");
for (var e = 0; e < t.length; e++) this.node.removeEventListener(t[e], this.handler);
}
return this;
},
dispatchNativeEvent: function (t) {
this.emit(t.type, t);
},
createElement: function (t, e, i) {
return this.setElement(document.createElement(t), e, i);
},
setElement: function (t, e, i) {
var n;
if ((this.removeElement(), "string" == typeof t ? ("#" === t[0] && (t = t.substr(1)), (n = document.getElementById(t))) : "object" == typeof t && 1 === t.nodeType && (n = t), !n)) return this;
if (((this.node = n), e && a(e))) for (var s in e) n.style[s] = e[s];
else "string" == typeof e && (n.style = e);
return (n.style.zIndex = "0"), (n.style.display = "inline"), (n.style.position = "absolute"), (n.phaser = this).parent && this.parent.appendChild(n), i && (n.innerText = i), this.updateSize();
},
createFromCache: function (t, e) {
var i = this.cache.get(t);
return i && this.createFromHTML(i, e), this;
},
createFromHTML: function (t, e) {
void 0 === e && (e = "div"), this.removeElement();
var i = document.createElement(e);
return (
((this.node = i).style.zIndex = "0"), (i.style.display = "inline"), (i.style.position = "absolute"), (i.phaser = this).parent && this.parent.appendChild(i), (i.innerHTML = t), this.updateSize()
);
},
removeElement: function () {
return this.node && (h(this.node), (this.node = null)), this;
},
updateSize: function () {
var t = this.node,
e = t.getBoundingClientRect();
return (this.width = t.clientWidth), (this.height = t.clientHeight), (this.displayWidth = e.width || 0), (this.displayHeight = e.height || 0), this;
},
getChildByProperty: function (t, e) {
if (this.node) for (var i = this.node.querySelectorAll("*"), n = 0; n < i.length; n++) if (i[n][t] === e) return i[n];
return null;
},
getChildByID: function (t) {
return this.getChildByProperty("id", t);
},
getChildByName: function (t) {
return this.getChildByProperty("name", t);
},
setClassName: function (t) {
return this.node && ((this.node.className = t), this.updateSize()), this;
},
setText: function (t) {
return this.node && ((this.node.innerText = t), this.updateSize()), this;
},
setHTML: function (t) {
return this.node && ((this.node.innerHTML = t), this.updateSize()), this;
},
preUpdate: function () {
var t = this.parentContainer,
e = this.node;
e && t && !t.willRender() && (e.style.display = "none");
},
willRender: function () {
return !0;
},
preDestroy: function () {
this.removeElement(), this.scene.sys.events.off(l.SLEEP, this.handleSceneEvent, this), this.scene.sys.events.off(l.WAKE, this.handleSceneEvent, this);
},
});
t.exports = c;
},
function (t, e, i) {
var g = i(1056),
v = i(15),
n = i(25),
y = new n(),
m = new n(),
x = new n();
t.exports = function (t, e, i, n) {
var s, r, o, a, h, l, u, c, d, f, p;
e.node &&
((s = e.node.style),
(r = e.scene.sys.settings),
!s || !r.visible || v.RENDER_MASK !== e.renderFlags || (0 !== e.cameraFilter && e.cameraFilter & i.id) || (e.parentContainer && !e.parentContainer.willRender())
? (s.display = "none")
: ((o = e.parentContainer),
(a = i.alpha * e.alpha),
o && (a *= o.alpha),
(h = y),
(l = m),
(u = x),
(d = c = 0),
(p = f = "0%"),
n
? ((c = e.width * e.scaleX * e.originX),
(d = e.height * e.scaleY * e.originY),
l.applyITRS(e.x - c, e.y - d, e.rotation, e.scaleX, e.scaleY),
h.copyFrom(i.matrix),
h.multiplyWithOffset(n, -i.scrollX * e.scrollFactorX, -i.scrollY * e.scrollFactorY),
(l.e = e.x - c),
(l.f = e.y - d))
: ((c = e.width * e.originX),
(d = e.height * e.originY),
l.applyITRS(e.x - c, e.y - d, e.rotation, e.scaleX, e.scaleY),
h.copyFrom(i.matrix),
(f = 100 * e.originX + "%"),
(p = 100 * e.originY + "%"),
(l.e -= i.scrollX * e.scrollFactorX),
(l.f -= i.scrollY * e.scrollFactorY)),
h.multiply(l, u),
e.transformOnly || ((s.display = "block"), (s.opacity = a), (s.zIndex = e._depth), (s.pointerEvents = e.pointerEvents), (s.mixBlendMode = g[e._blendMode])),
(s.transform = u.getCSSMatrix() + " skew(" + e.skewX + "rad, " + e.skewY + "rad) rotate3d(" + e.rotate3d.x + "," + e.rotate3d.y + "," + e.rotate3d.z + "," + e.rotate3d.w + e.rotate3dAngle + ")"),
(s.transformOrigin = f + " " + p)));
};
},
function (t, e, i) {
var n = i(0),
s = i(11),
r = i(15),
o = i(1060),
a = new n({
Extends: r,
Mixins: [s.Alpha, s.BlendMode, s.Depth, s.Flip, s.Origin, s.ScrollFactor, s.Size, s.Texture, s.Tint, s.Transform, s.Visible, o],
initialize: function (t) {
r.call(this, t, "Extern");
},
addedToScene: function () {
this.scene.sys.updateList.add(this);
},
removedFromScene: function () {
this.scene.sys.updateList.remove(this);
},
preUpdate: function () {},
render: function () {},
});
t.exports = a;
},
function (t, e, i) {
var s = i(218),
r = i(98),
o = i(14),
a = i(4);
t.exports = function (t, e, i) {
void 0 === i && (i = new a());
var n = r(e, 0, o.PI2);
return s(t, n, i);
};
},
function (t, e, i) {
var o = i(447),
a = i(218),
h = i(98),
l = i(14);
t.exports = function (t, e, i, n) {
void 0 === n && (n = []), !e && 0 < i && (e = o(t) / i);
for (var s = 0; s < e; s++) {
var r = h(s / e, 0, l.PI2);
n.push(a(t, r));
}
return n;
};
},
function (t, e) {
t.exports = function (t) {
var e = t.width / 2,
i = t.height / 2,
n = Math.pow(e - i, 2) / Math.pow(e + i, 2);
return Math.PI * (e + i) * (1 + (3 * n) / (10 + Math.sqrt(4 - 3 * n)));
};
},
function (t, e, i) {
var m = i(217),
x = i(30);
t.exports = function (t, e, i, n, s, r) {
var o = e.commandBuffer,
a = o.length,
h = s || t.currentContext;
if (0 !== a && x(t, h, e, i, n)) {
i.addToRenderList(e);
var l,
u,
c,
d,
f,
p = 0,
g = 0,
v = 0;
h.beginPath();
for (var y = 0; y < a; ++y)
switch (o[y]) {
case m.ARC:
h.arc(o[y + 1], o[y + 2], o[y + 3], o[y + 4], o[y + 5], o[y + 6]), (y += 7);
break;
case m.LINE_STYLE:
(f = o[y + 1]),
(c = o[y + 2]),
(l = o[y + 3]),
(p = (16711680 & c) >>> 16),
(g = (65280 & c) >>> 8),
(v = 255 & c),
(h.strokeStyle = "rgba(" + p + "," + g + "," + v + "," + l + ")"),
(h.lineWidth = f),
(y += 3);
break;
case m.FILL_STYLE:
(d = o[y + 1]), (u = o[y + 2]), (p = (16711680 & d) >>> 16), (g = (65280 & d) >>> 8), (v = 255 & d), (h.fillStyle = "rgba(" + p + "," + g + "," + v + "," + u + ")"), (y += 2);
break;
case m.BEGIN_PATH:
h.beginPath();
break;
case m.CLOSE_PATH:
h.closePath();
break;
case m.FILL_PATH:
r || h.fill();
break;
case m.STROKE_PATH:
r || h.stroke();
break;
case m.FILL_RECT:
r ? h.rect(o[y + 1], o[y + 2], o[y + 3], o[y + 4]) : h.fillRect(o[y + 1], o[y + 2], o[y + 3], o[y + 4]), (y += 4);
break;
case m.FILL_TRIANGLE:
h.beginPath(), h.moveTo(o[y + 1], o[y + 2]), h.lineTo(o[y + 3], o[y + 4]), h.lineTo(o[y + 5], o[y + 6]), h.closePath(), r || h.fill(), (y += 6);
break;
case m.STROKE_TRIANGLE:
h.beginPath(), h.moveTo(o[y + 1], o[y + 2]), h.lineTo(o[y + 3], o[y + 4]), h.lineTo(o[y + 5], o[y + 6]), h.closePath(), r || h.stroke(), (y += 6);
break;
case m.LINE_TO:
h.lineTo(o[y + 1], o[y + 2]), (y += 2);
break;
case m.MOVE_TO:
h.moveTo(o[y + 1], o[y + 2]), (y += 2);
break;
case m.LINE_FX_TO:
h.lineTo(o[y + 1], o[y + 2]), (y += 5);
break;
case m.MOVE_FX_TO:
h.moveTo(o[y + 1], o[y + 2]), (y += 5);
break;
case m.SAVE:
h.save();
break;
case m.RESTORE:
h.restore();
break;
case m.TRANSLATE:
h.translate(o[y + 1], o[y + 2]), (y += 2);
break;
case m.SCALE:
h.scale(o[y + 1], o[y + 2]), (y += 2);
break;
case m.ROTATE:
h.rotate(o[y + 1]), (y += 1);
break;
case m.GRADIENT_FILL_STYLE:
y += 5;
break;
case m.GRADIENT_LINE_STYLE:
y += 6;
}
h.restore();
}
};
},
function (t, e, i) {
var n = i(0),
s = i(137),
r = i(80),
o = i(2),
a = i(68),
h = new n({
initialize: function (t, e, i, n) {
void 0 === n && (n = !1),
(this.propertyKey = e),
(this.propertyValue = i),
(this.defaultValue = i),
(this.steps = 0),
(this.counter = 0),
(this.start = 0),
(this.end = 0),
this.ease,
(this.emitOnly = n),
(this.onEmit = this.defaultEmit),
(this.onUpdate = this.defaultUpdate),
this.loadConfig(t);
},
loadConfig: function (t, e) {
void 0 === t && (t = {}), e && (this.propertyKey = e), (this.propertyValue = o(t, this.propertyKey, this.defaultValue)), this.setMethods(), this.emitOnly && (this.onUpdate = this.defaultUpdate);
},
toJSON: function () {
return this.propertyValue;
},
onChange: function (t) {
return (this.propertyValue = t), this.setMethods();
},
setMethods: function () {
var t,
e,
i,
n = this.propertyValue,
s = typeof n;
return (
(this.onEmit = this.defaultEmit),
(this.onUpdate = this.defaultUpdate),
"number" == s
? ((this.onEmit = this.staticValueEmit), (this.onUpdate = this.staticValueUpdate))
: Array.isArray(n)
? (this.onEmit = this.randomStaticValueEmit)
: "function" == s
? this.emitOnly
? (this.onEmit = n)
: (this.onUpdate = n)
: "object" == s && this.hasBoth(n, "start", "end")
? ((this.start = n.start),
(this.end = n.end),
(t = this.has(n, "random")) && (this.onEmit = this.randomRangedValueEmit),
this.has(n, "steps")
? ((this.steps = n.steps), (this.counter = this.start), (this.onEmit = this.steppedEmit))
: ((e = this.has(n, "ease") ? n.ease : "Linear"), (this.ease = r(e, n.easeParams)), t || (this.onEmit = this.easedValueEmit), (this.onUpdate = this.easeValueUpdate)))
: "object" == s && this.hasBoth(n, "min", "max")
? ((this.start = n.min), (this.end = n.max), (this.onEmit = this.randomRangedValueEmit))
: "object" == s && this.has(n, "random")
? ((i = n.random), Array.isArray(i) && ((this.start = i[0]), (this.end = i[1])), (this.onEmit = this.randomRangedValueEmit))
: "object" == s && this.hasEither(n, "onEmit", "onUpdate") && (this.has(n, "onEmit") && (this.onEmit = n.onEmit), this.has(n, "onUpdate") && (this.onUpdate = n.onUpdate)),
this
);
},
has: function (t, e) {
return t.hasOwnProperty(e);
},
hasBoth: function (t, e, i) {
return t.hasOwnProperty(e) && t.hasOwnProperty(i);
},
hasEither: function (t, e, i) {
return t.hasOwnProperty(e) || t.hasOwnProperty(i);
},
defaultEmit: function (t, e, i) {
return i;
},
defaultUpdate: function (t, e, i, n) {
return n;
},
staticValueEmit: function () {
return this.propertyValue;
},
staticValueUpdate: function () {
return this.propertyValue;
},
randomStaticValueEmit: function () {
var t = Math.floor(Math.random() * this.propertyValue.length);
return this.propertyValue[t];
},
randomRangedValueEmit: function (t, e) {
var i = s(this.start, this.end);
return t && t.data[e] && (t.data[e].min = i), i;
},
steppedEmit: function () {
var t = this.counter,
e = this.counter + (this.end - this.start) / this.steps;
return (this.counter = a(e, this.start, this.end)), t;
},
easedValueEmit: function (t, e) {
var i;
return t && t.data[e] && (((i = t.data[e]).min = this.start), (i.max = this.end)), this.start;
},
easeValueUpdate: function (t, e, i) {
var n = t.data[e];
return (n.max - n.min) * this.ease(i) + n.min;
},
});
t.exports = h;
},
function (t, e, i) {
var n = i(0),
o = i(2),
s = new n({
initialize: function (t, e, i, n, s) {
var r;
"object" == typeof t
? ((t = o((r = t), "x", 0)), (e = o(r, "y", 0)), (i = o(r, "power", 0)), (n = o(r, "epsilon", 100)), (s = o(r, "gravity", 50)))
: (void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === n && (n = 100), void 0 === s && (s = 50)),
(this.x = t),
(this.y = e),
(this.active = !0),
(this._gravity = s),
(this._power = 0),
(this._epsilon = 0),
(this.power = i),
(this.epsilon = n);
},
update: function (t, e) {
var i,
n,
s = this.x - t.x,
r = this.y - t.y,
o = s * s + r * r;
0 !== o && ((i = Math.sqrt(o)), o < this._epsilon && (o = this._epsilon), (n = ((this._power * e) / (o * i)) * 100), (t.velocityX += s * n), (t.velocityY += r * n));
},
epsilon: {
get: function () {
return Math.sqrt(this._epsilon);
},
set: function (t) {
this._epsilon = t * t;
},
},
power: {
get: function () {
return this._power / this._gravity;
},
set: function (t) {
this._power = t * this._gravity;
},
},
gravity: {
get: function () {
return this._gravity;
},
set: function (t) {
var e = this.power;
(this._gravity = t), (this.power = e);
},
},
});
t.exports = s;
},
function (t, e, i) {
var n = i(0),
u = i(36),
c = i(50),
s = new n({
initialize: function (t) {
(this.emitter = t),
(this.frame = null),
(this.x = 0),
(this.y = 0),
(this.velocityX = 0),
(this.velocityY = 0),
(this.accelerationX = 0),
(this.accelerationY = 0),
(this.maxVelocityX = 1e4),
(this.maxVelocityY = 1e4),
(this.bounce = 0),
(this.scaleX = 1),
(this.scaleY = 1),
(this.alpha = 1),
(this.angle = 0),
(this.rotation = 0),
(this.tint = 16777215),
(this.life = 1e3),
(this.lifeCurrent = 1e3),
(this.delayCurrent = 0),
(this.lifeT = 0),
(this.data = { tint: { min: 16777215, max: 16777215, current: 16777215 }, alpha: { min: 1, max: 1 }, rotate: { min: 0, max: 0 }, scaleX: { min: 1, max: 1 }, scaleY: { min: 1, max: 1 } });
},
isAlive: function () {
return 0 < this.lifeCurrent;
},
resetPosition: function () {
(this.x = 0), (this.y = 0);
},
fire: function (t, e) {
var i = this.emitter;
(this.frame = i.getFrame()),
i.emitZone && i.emitZone.getPoint(this),
(this.x += void 0 === t ? i.x.onEmit(this, "x") : t),
(this.y += void 0 === e ? i.y.onEmit(this, "y") : e),
(this.life = i.lifespan.onEmit(this, "lifespan")),
(this.lifeCurrent = this.life),
(this.lifeT = 0);
var n,
s,
r,
o,
a,
h = i.speedX.onEmit(this, "speedX"),
l = i.speedY ? i.speedY.onEmit(this, "speedY") : h;
i.radial
? ((n = u(i.angle.onEmit(this, "angle"))), (this.velocityX = Math.cos(n) * Math.abs(h)), (this.velocityY = Math.sin(n) * Math.abs(l)))
: i.moveTo
? ((s = i.moveToX.onEmit(this, "moveToX")),
(r = i.moveToY ? i.moveToY.onEmit(this, "moveToY") : s),
(o = Math.atan2(r - this.y, s - this.x)),
(a = c(this.x, this.y, s, r) / (this.life / 1e3)),
(this.velocityX = Math.cos(o) * a),
(this.velocityY = Math.sin(o) * a))
: ((this.velocityX = h), (this.velocityY = l)),
i.acceleration && ((this.accelerationX = i.accelerationX.onEmit(this, "accelerationX")), (this.accelerationY = i.accelerationY.onEmit(this, "accelerationY"))),
(this.maxVelocityX = i.maxVelocityX.onEmit(this, "maxVelocityX")),
(this.maxVelocityY = i.maxVelocityY.onEmit(this, "maxVelocityY")),
(this.delayCurrent = i.delay.onEmit(this, "delay")),
(this.scaleX = i.scaleX.onEmit(this, "scaleX")),
(this.scaleY = i.scaleY ? i.scaleY.onEmit(this, "scaleY") : this.scaleX),
(this.angle = i.rotate.onEmit(this, "rotate")),
(this.rotation = u(this.angle)),
(this.bounce = i.bounce.onEmit(this, "bounce")),
(this.alpha = i.alpha.onEmit(this, "alpha")),
(this.tint = i.tint.onEmit(this, "tint"));
},
computeVelocity: function (t, e, i, n) {
var s = this.velocityX,
r = this.velocityY,
o = this.accelerationX,
a = this.accelerationY,
h = this.maxVelocityX,
l = this.maxVelocityY;
(s += t.gravityX * i),
(r += t.gravityY * i),
o && (s += o * i),
a && (r += a * i),
h < s ? (s = h) : s < -h && (s = -h),
l < r ? (r = l) : r < -l && (r = -l),
(this.velocityX = s),
(this.velocityY = r);
for (var u = 0; u < n.length; u++) n[u].update(this, e, i);
},
checkBounds: function (t) {
var e = t.bounds,
i = -this.bounce;
this.x < e.x && t.collideLeft ? ((this.x = e.x), (this.velocityX *= i)) : this.x > e.right && t.collideRight && ((this.x = e.right), (this.velocityX *= i)),
this.y < e.y && t.collideTop ? ((this.y = e.y), (this.velocityY *= i)) : this.y > e.bottom && t.collideBottom && ((this.y = e.bottom), (this.velocityY *= i));
},
update: function (t, e, i) {
if (0 < this.delayCurrent) return (this.delayCurrent -= t), !1;
var n = this.emitter,
s = 1 - this.lifeCurrent / this.life;
return (
(this.lifeT = s),
this.computeVelocity(n, t, e, i),
(this.x += this.velocityX * e),
(this.y += this.velocityY * e),
n.bounds && this.checkBounds(n),
n.deathZone && n.deathZone.willKill(this)
? !(this.lifeCurrent = 0)
: ((this.scaleX = n.scaleX.onUpdate(this, "scaleX", s, this.scaleX)),
n.scaleY ? (this.scaleY = n.scaleY.onUpdate(this, "scaleY", s, this.scaleY)) : (this.scaleY = this.scaleX),
(this.angle = n.rotate.onUpdate(this, "rotate", s, this.angle)),
(this.rotation = u(this.angle)),
(this.alpha = n.alpha.onUpdate(this, "alpha", s, this.alpha)),
(this.tint = n.tint.onUpdate(this, "tint", s, this.tint)),
(this.lifeCurrent -= t),
this.lifeCurrent <= 0)
);
},
});
t.exports = s;
},
function (t, e, i) {
var n = i(35),
s = i(0),
r = i(11),
o = i(453),
a = i(454),
h = i(449),
l = i(2),
u = i(210),
c = i(455),
d = i(126),
f = i(451),
p = i(456),
g = i(10),
v = i(79),
y = i(3),
m = i(68),
x = new s({
Mixins: [r.BlendMode, r.Mask, r.ScrollFactor, r.Visible],
initialize: function (t, e) {
(this.manager = t),
(this.texture = t.texture),
(this.frames = [t.defaultFrame]),
(this.defaultFrame = t.defaultFrame),
(this.configFastMap = [
"active",
"blendMode",
"collideBottom",
"collideLeft",
"collideRight",
"collideTop",
"deathCallback",
"deathCallbackScope",
"emitCallback",
"emitCallbackScope",
"follow",
"frequency",
"gravityX",
"gravityY",
"maxParticles",
"name",
"on",
"particleBringToTop",
"particleClass",
"radial",
"timeScale",
"trackVisible",
"visible",
]),
(this.configOpMap = [
"accelerationX",
"accelerationY",
"angle",
"alpha",
"bounce",
"delay",
"lifespan",
"maxVelocityX",
"maxVelocityY",
"moveToX",
"moveToY",
"quantity",
"rotate",
"scaleX",
"scaleY",
"speedX",
"speedY",
"tint",
"x",
"y",
]),
(this.name = ""),
(this.particleClass = f),
(this.x = new h(e, "x", 0, !0)),
(this.y = new h(e, "y", 0, !0)),
(this.radial = !0),
(this.gravityX = 0),
(this.gravityY = 0),
(this.acceleration = !1),
(this.accelerationX = new h(e, "accelerationX", 0, !0)),
(this.accelerationY = new h(e, "accelerationY", 0, !0)),
(this.maxVelocityX = new h(e, "maxVelocityX", 1e4, !0)),
(this.maxVelocityY = new h(e, "maxVelocityY", 1e4, !0)),
(this.speedX = new h(e, "speedX", 0, !0)),
(this.speedY = new h(e, "speedY", 0, !0)),
(this.moveTo = !1),
(this.moveToX = new h(e, "moveToX", 0, !0)),
(this.moveToY = new h(e, "moveToY", 0, !0)),
(this.bounce = new h(e, "bounce", 0, !0)),
(this.scaleX = new h(e, "scaleX", 1)),
(this.scaleY = new h(e, "scaleY", 1)),
(this.tint = new h(e, "tint", 16777215)),
(this.alpha = new h(e, "alpha", 1)),
(this.lifespan = new h(e, "lifespan", 1e3, !0)),
(this.angle = new h(e, "angle", { min: 0, max: 360 }, !0)),
(this.rotate = new h(e, "rotate", 0)),
(this.emitCallback = null),
(this.emitCallbackScope = null),
(this.deathCallback = null),
(this.deathCallbackScope = null),
(this.maxParticles = 0),
(this.quantity = new h(e, "quantity", 1, !0)),
(this.delay = new h(e, "delay", 0, !0)),
(this.frequency = 0),
(this.on = !0),
(this.particleBringToTop = !0),
(this.timeScale = 1),
(this.emitZone = null),
(this.deathZone = null),
(this.bounds = null),
(this.collideLeft = !0),
(this.collideRight = !0),
(this.collideTop = !0),
(this.collideBottom = !0),
(this.active = !0),
(this.visible = !0),
(this.blendMode = n.NORMAL),
(this.follow = null),
(this.followOffset = new y()),
(this.trackVisible = !1),
(this.currentFrame = 0),
(this.randomFrame = !0),
(this.frameQuantity = 1),
(this.dead = []),
(this.alive = []),
(this._counter = 0),
(this._frameCounter = 0),
e && this.fromJSON(e);
},
fromJSON: function (t) {
if (!t) return this;
var e,
i = 0,
n = "";
for (i = 0; i < this.configFastMap.length; i++) (n = this.configFastMap[i]), d(t, n) && (this[n] = l(t, n));
for (i = 0; i < this.configOpMap.length; i++) (n = this.configOpMap[i]), d(t, n) && this[n].loadConfig(t);
return (
(this.acceleration = 0 !== this.accelerationX.propertyValue || 0 !== this.accelerationY.propertyValue),
(this.moveTo = 0 !== this.moveToX.propertyValue || 0 !== this.moveToY.propertyValue),
d(t, "speed") && (this.speedX.loadConfig(t, "speed"), (this.speedY = null)),
(c(t, ["speedX", "speedY"]) || this.moveTo) && (this.radial = !1),
d(t, "scale") && (this.scaleX.loadConfig(t, "scale"), (this.scaleY = null)),
d(t, "callbackScope") && ((e = l(t, "callbackScope", null)), (this.emitCallbackScope = e), (this.deathCallbackScope = e)),
d(t, "emitZone") && this.setEmitZone(t.emitZone),
d(t, "deathZone") && this.setDeathZone(t.deathZone),
d(t, "bounds") && this.setBounds(t.bounds),
d(t, "followOffset") && this.followOffset.setFromObject(l(t, "followOffset", 0)),
d(t, "frame") && this.setFrame(t.frame),
d(t, "reserve") && this.reserve(t.reserve),
this
);
},
toJSON: function (t) {
void 0 === t && (t = {});
var e = 0,
i = "";
for (e = 0; e < this.configFastMap.length; e++) t[(i = this.configFastMap[e])] = this[i];
for (e = 0; e < this.configOpMap.length; e++) this[(i = this.configOpMap[e])] && (t[i] = this[i].toJSON());
return this.speedY || (delete t.speedX, (t.speed = this.speedX.toJSON())), this.scaleY || (delete t.scaleX, (t.scale = this.scaleX.toJSON())), t;
},
startFollow: function (t, e, i, n) {
return void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === n && (n = !1), (this.follow = t), this.followOffset.set(e, i), (this.trackVisible = n), this;
},
stopFollow: function () {
return (this.follow = null), this.followOffset.set(0, 0), (this.trackVisible = !1), this;
},
getFrame: function () {
if (1 === this.frames.length) return this.defaultFrame;
if (this.randomFrame) return u(this.frames);
var t = this.frames[this.currentFrame];
return this._frameCounter++, this._frameCounter === this.frameQuantity && ((this._frameCounter = 0), (this.currentFrame = m(this.currentFrame + 1, 0, this._frameLength))), t;
},
setFrame: function (t, e, i) {
void 0 === e && (e = !0), void 0 === i && (i = 1), (this.randomFrame = e), (this.frameQuantity = i), (this.currentFrame = 0), (this._frameCounter = 0);
var n,
s,
r = typeof t;
return (
Array.isArray(t) || "string" == r || "number" == r
? this.manager.setEmitterFrames(t, this)
: "object" == r && ((t = l((n = t), "frames", null)) && this.manager.setEmitterFrames(t, this), (s = l(n, "cycle", !1)), (this.randomFrame = !s), (this.frameQuantity = l(n, "quantity", i))),
(this._frameLength = this.frames.length),
1 === this._frameLength && ((this.frameQuantity = 1), (this.randomFrame = !1)),
this
);
},
setRadial: function (t) {
return void 0 === t && (t = !0), (this.radial = t), this;
},
setPosition: function (t, e) {
return this.x.onChange(t), this.y.onChange(e), this;
},
setBounds: function (t, e, i, n) {
var s;
return (
"object" == typeof t && ((t = (s = t).x), (e = s.y), (i = d(s, "w") ? s.w : s.width), (n = d(s, "h") ? s.h : s.height)),
this.bounds ? this.bounds.setTo(t, e, i, n) : (this.bounds = new g(t, e, i, n)),
this
);
},
setSpeedX: function (t) {
return this.speedX.onChange(t), (this.radial = !1), this;
},
setSpeedY: function (t) {
return this.speedY && (this.speedY.onChange(t), (this.radial = !1)), this;
},
setSpeed: function (t) {
return this.speedX.onChange(t), (this.speedY = null), (this.radial = !0), this;
},
setScaleX: function (t) {
return this.scaleX.onChange(t), this;
},
setScaleY: function (t) {
return this.scaleY.onChange(t), this;
},
setScale: function (t) {
return this.scaleX.onChange(t), (this.scaleY = null), this;
},
setGravityX: function (t) {
return (this.gravityX = t), this;
},
setGravityY: function (t) {
return (this.gravityY = t), this;
},
setGravity: function (t, e) {
return (this.gravityX = t), (this.gravityY = e), this;
},
setAlpha: function (t) {
return this.alpha.onChange(t), this;
},
setTint: function (t) {
return this.tint.onChange(t), this;
},
setEmitterAngle: function (t) {
return this.angle.onChange(t), this;
},
setAngle: function (t) {
return this.angle.onChange(t), this;
},
setLifespan: function (t) {
return this.lifespan.onChange(t), this;
},
setQuantity: function (t) {
return this.quantity.onChange(t), this;
},
setFrequency: function (t, e) {
return (this.frequency = t), (this._counter = 0), e && this.quantity.onChange(e), this;
},
setEmitZone: function (t) {
if (void 0 === t) this.emitZone = null;
else {
var e = l(t, "type", "random"),
i = l(t, "source", null);
switch (e) {
case "random":
this.emitZone = new p(i);
break;
case "edge":
var n = l(t, "quantity", 1),
s = l(t, "stepRate", 0),
r = l(t, "yoyo", !1),
o = l(t, "seamless", !0);
this.emitZone = new a(i, n, s, r, o);
}
}
return this;
},
setDeathZone: function (t) {
var e, i, n;
return (
void 0 === t ? (this.deathZone = null) : ((e = l(t, "type", "onEnter")), (i = l(t, "source", null)) && "function" == typeof i.contains && ((n = "onEnter" === e), (this.deathZone = new o(i, n)))),
this
);
},
reserve: function (t) {
for (var e = this.dead, i = 0; i < t; i++) e.push(new this.particleClass(this));
return this;
},
getAliveParticleCount: function () {
return this.alive.length;
},
getDeadParticleCount: function () {
return this.dead.length;
},
getParticleCount: function () {
return this.getAliveParticleCount() + this.getDeadParticleCount();
},
atLimit: function () {
return 0 < this.maxParticles && this.getParticleCount() === this.maxParticles;
},
onParticleEmit: function (t, e) {
return void 0 === t ? ((this.emitCallback = null), (this.emitCallbackScope = null)) : "function" == typeof t && ((this.emitCallback = t), e && (this.emitCallbackScope = e)), this;
},
onParticleDeath: function (t, e) {
return void 0 === t ? ((this.deathCallback = null), (this.deathCallbackScope = null)) : "function" == typeof t && ((this.deathCallback = t), e && (this.deathCallbackScope = e)), this;
},
killAll: function () {
for (var t = this.dead, e = this.alive; 0 < e.length; ) t.push(e.pop());
return this;
},
forEachAlive: function (t, e) {
for (var i = this.alive, n = i.length, s = 0; s < n; ++s) t.call(e, i[s], this);
return this;
},
forEachDead: function (t, e) {
for (var i = this.dead, n = i.length, s = 0; s < n; ++s) t.call(e, i[s], this);
return this;
},
start: function () {
return (this.on = !0), (this._counter = 0), this;
},
stop: function () {
return (this.on = !1), this;
},
pause: function () {
return (this.active = !1), this;
},
resume: function () {
return (this.active = !0), this;
},
remove: function () {
return this.manager.removeEmitter(this), this;
},
depthSort: function () {
return v(this.alive, this.depthSortCallback), this;
},
flow: function (t, e) {
return void 0 === e && (e = 1), (this.frequency = t), this.quantity.onChange(e), this.start();
},
explode: function (t, e, i) {
return (this.frequency = -1), this.emitParticle(t, e, i);
},
emitParticleAt: function (t, e, i) {
return this.emitParticle(i, t, e);
},
emitParticle: function (t, e, i) {
if (!this.atLimit()) {
void 0 === t && (t = this.quantity.onEmit());
for (var n = this.dead, s = this.follow ? this.follow.x + this.followOffset.x : e, r = this.follow ? this.follow.y + this.followOffset.y : i, o = 0; o < t; o++) {
var a = n.pop();
if (
((a = a || new this.particleClass(this)).fire(s, r),
this.particleBringToTop ? this.alive.push(a) : this.alive.unshift(a),
this.emitCallback && this.emitCallback.call(this.emitCallbackScope, a, this),
this.atLimit())
)
break;
}
return a;
}
},
preUpdate: function (t, e) {
var i = (e *= this.timeScale) / 1e3;
this.trackVisible && (this.visible = this.follow.visible);
var n = this.manager.getProcessors(),
s = this.alive,
r = this.dead,
o = 0,
a = [],
h = s.length;
for (o = 0; o < h; o++) {
var l = s[o];
l.update(e, i, n) && a.push({ index: o, particle: l });
}
if (0 < (h = a.length)) {
var u = this.deathCallback,
c = this.deathCallbackScope;
for (o = h - 1; 0 <= o; o--) {
var d = a[o];
s.splice(d.index, 1), r.push(d.particle), u && u.call(c, d.particle), d.particle.resetPosition();
}
}
this.on &&
(0 === this.frequency
? this.emitParticle()
: 0 < this.frequency && ((this._counter -= e), this._counter <= 0 && (this.emitParticle(), (this._counter = this.frequency - Math.abs(this._counter)))));
},
depthSortCallback: function (t, e) {
return t.y - e.y;
},
});
t.exports = x;
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e) {
(this.source = t), (this.killOnEnter = e);
},
willKill: function (t) {
var e = this.source.contains(t.x, t.y);
return (e && this.killOnEnter) || (!e && !this.killOnEnter);
},
});
t.exports = n;
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e, i, n, s) {
void 0 === n && (n = !1),
void 0 === s && (s = !0),
(this.source = t),
(this.points = []),
(this.quantity = e),
(this.stepRate = i),
(this.yoyo = n),
(this.counter = -1),
(this.seamless = s),
(this._length = 0),
(this._direction = 0),
this.updateSource();
},
updateSource: function () {
var t, e;
(this.points = this.source.getPoints(this.quantity, this.stepRate)), this.seamless && ((t = this.points[0]), (e = this.points[this.points.length - 1]), t.x === e.x && t.y === e.y && this.points.pop());
var i = this._length;
return (this._length = this.points.length), this._length < i && this.counter > this._length && (this.counter = this._length - 1), this;
},
changeSource: function (t) {
return (this.source = t), this.updateSource();
},
getPoint: function (t) {
0 === this._direction
? (this.counter++, this.counter >= this._length && (this.yoyo ? ((this._direction = 1), (this.counter = this._length - 1)) : (this.counter = 0)))
: (this.counter--, -1 === this.counter && (this.yoyo ? ((this._direction = 0), (this.counter = 0)) : (this.counter = this._length - 1)));
var e = this.points[this.counter];
e && ((t.x = e.x), (t.y = e.y));
},
});
t.exports = n;
},
function (t, e) {
t.exports = function (t, e) {
for (var i = 0; i < e.length; i++) if (t.hasOwnProperty(e[i])) return !0;
return !1;
};
},
function (t, e, i) {
var n = i(0),
s = i(3),
r = new n({
initialize: function (t) {
(this.source = t), (this._tempVec = new s());
},
getPoint: function (t) {
var e = this._tempVec;
this.source.getRandomPoint(e), (t.x = e.x), (t.y = e.y);
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(0),
s = i(11),
o = i(73),
r = new n({
Extends: o,
Mixins: [s.PathFollower],
initialize: function (t, e, i, n, s, r) {
o.call(this, t, i, n, s, r), (this.path = e);
},
preUpdate: function (t, e) {
this.anims.update(t, e), this.pathUpdate(t);
},
});
t.exports = r;
},
function (t, e) {
t.exports = function (t, e, i) {
var n = t.canvas,
s = t.context,
r = t.style,
o = [],
a = 0,
h = i.length;
0 < r.maxLines && r.maxLines < i.length && (h = r.maxLines), r.syncFont(n, s);
for (var l = 0; l < h; l++) {
var u = r.strokeThickness;
(u += s.measureText(i[l]).width), r.wordWrap && (u -= s.measureText(" ").width), (o[l] = Math.ceil(u)), (a = Math.max(a, o[l]));
}
var c = e.fontSize + r.strokeThickness,
d = c * h,
f = t.lineSpacing;
return 1 < h && (d += f * (h - 1)), { width: a, height: d, lines: h, lineWidths: o, lineSpacing: f, lineHeight: c };
};
},
function (t, e, i) {
var n = i(0),
a = i(13),
h = i(6),
s = i(460),
l = {
fontFamily: ["fontFamily", "Courier"],
fontSize: ["fontSize", "16px"],
fontStyle: ["fontStyle", ""],
backgroundColor: ["backgroundColor", null],
color: ["color", "#fff"],
stroke: ["stroke", "#fff"],
strokeThickness: ["strokeThickness", 0],
shadowOffsetX: ["shadow.offsetX", 0],
shadowOffsetY: ["shadow.offsetY", 0],
shadowColor: ["shadow.color", "#000"],
shadowBlur: ["shadow.blur", 0],
shadowStroke: ["shadow.stroke", !1],
shadowFill: ["shadow.fill", !1],
align: ["align", "left"],
maxLines: ["maxLines", 0],
fixedWidth: ["fixedWidth", 0],
fixedHeight: ["fixedHeight", 0],
resolution: ["resolution", 0],
rtl: ["rtl", !1],
testString: ["testString", "|MÉqgy"],
baselineX: ["baselineX", 1.2],
baselineY: ["baselineY", 1.4],
wordWrapWidth: ["wordWrap.width", null],
wordWrapCallback: ["wordWrap.callback", null],
wordWrapCallbackScope: ["wordWrap.callbackScope", null],
wordWrapUseAdvanced: ["wordWrap.useAdvancedWrap", !1],
},
r = new n({
initialize: function (t, e) {
(this.parent = t),
this.fontFamily,
this.fontSize,
this.fontStyle,
this.backgroundColor,
this.color,
this.stroke,
this.strokeThickness,
this.shadowOffsetX,
this.shadowOffsetY,
this.shadowColor,
this.shadowBlur,
this.shadowStroke,
this.shadowFill,
this.align,
this.maxLines,
this.fixedWidth,
this.fixedHeight,
this.resolution,
this.rtl,
this.testString,
this.baselineX,
this.baselineY,
this.wordWrapWidth,
this.wordWrapCallback,
this.wordWrapCallbackScope,
this.wordWrapUseAdvanced,
this._font,
this.setStyle(e, !1, !0);
var i = h(e, "metrics", !1);
this.metrics = i ? { ascent: h(i, "ascent", 0), descent: h(i, "descent", 0), fontSize: h(i, "fontSize", 0) } : s(this);
},
setStyle: function (t, e, i) {
for (var n in (void 0 === e && (e = !0), void 0 === i && (i = !1), t && t.hasOwnProperty("fontSize") && "number" == typeof t.fontSize && (t.fontSize = t.fontSize.toString() + "px"), l)) {
var s = i ? l[n][1] : this[n];
this[n] = ("wordWrapCallback" === n || "wordWrapCallbackScope" === n ? h : a)(t, l[n][0], s);
}
var r = h(t, "font", null);
null !== r && this.setFont(r, !1), (this._font = [this.fontStyle, this.fontSize, this.fontFamily].join(" ").trim());
var o = h(t, "fill", null);
return null !== o && (this.color = o), e ? this.update(!0) : this.parent;
},
syncFont: function (t, e) {
e.font = this._font;
},
syncStyle: function (t, e) {
(e.textBaseline = "alphabetic"), (e.fillStyle = this.color), (e.strokeStyle = this.stroke), (e.lineWidth = this.strokeThickness), (e.lineCap = "round"), (e.lineJoin = "round");
},
syncShadow: function (t, e) {
e
? ((t.shadowOffsetX = this.shadowOffsetX), (t.shadowOffsetY = this.shadowOffsetY), (t.shadowColor = this.shadowColor), (t.shadowBlur = this.shadowBlur))
: ((t.shadowOffsetX = 0), (t.shadowOffsetY = 0), (t.shadowColor = 0), (t.shadowBlur = 0));
},
update: function (t) {
return t && ((this._font = [this.fontStyle, this.fontSize, this.fontFamily].join(" ").trim()), (this.metrics = s(this))), this.parent.updateText();
},
setFont: function (t, e) {
void 0 === e && (e = !0);
var i,
n,
s = t,
r = "",
o = "";
return (
"string" != typeof t
? ((s = h(t, "fontFamily", "Courier")), (r = h(t, "fontSize", "16px")), (o = h(t, "fontStyle", "")))
: ((n = 0), (o = 2 < (i = t.split(" ")).length ? i[n++] : ""), (r = i[n++] || "16px"), (s = i[n++] || "Courier")),
(s === this.fontFamily && r === this.fontSize && o === this.fontStyle) || ((this.fontFamily = s), (this.fontSize = r), (this.fontStyle = o), e && this.update(!0)),
this.parent
);
},
setFontFamily: function (t) {
return this.fontFamily !== t && ((this.fontFamily = t), this.update(!0)), this.parent;
},
setFontStyle: function (t) {
return this.fontStyle !== t && ((this.fontStyle = t), this.update(!0)), this.parent;
},
setFontSize: function (t) {
return "number" == typeof t && (t = t.toString() + "px"), this.fontSize !== t && ((this.fontSize = t), this.update(!0)), this.parent;
},
setTestString: function (t) {
return (this.testString = t), this.update(!0);
},
setFixedSize: function (t, e) {
return (this.fixedWidth = t), (this.fixedHeight = e), t && (this.parent.width = t), e && (this.parent.height = e), this.update(!1);
},
setBackgroundColor: function (t) {
return (this.backgroundColor = t), this.update(!1);
},
setFill: function (t) {
return (this.color = t), this.update(!1);
},
setColor: function (t) {
return (this.color = t), this.update(!1);
},
setResolution: function (t) {
return (this.resolution = t), this.update(!1);
},
setStroke: function (t, e) {
return (
void 0 === e && (e = this.strokeThickness),
void 0 === t && 0 !== this.strokeThickness
? ((this.strokeThickness = 0), this.update(!0))
: (this.stroke === t && this.strokeThickness === e) || ((this.stroke = t), (this.strokeThickness = e), this.update(!0)),
this.parent
);
},
setShadow: function (t, e, i, n, s, r) {
return (
void 0 === t && (t = 0),
void 0 === e && (e = 0),
void 0 === i && (i = "#000"),
void 0 === n && (n = 0),
void 0 === s && (s = !1),
void 0 === r && (r = !0),
(this.shadowOffsetX = t),
(this.shadowOffsetY = e),
(this.shadowColor = i),
(this.shadowBlur = n),
(this.shadowStroke = s),
(this.shadowFill = r),
this.update(!1)
);
},
setShadowOffset: function (t, e) {
return void 0 === t && (t = 0), void 0 === e && (e = t), (this.shadowOffsetX = t), (this.shadowOffsetY = e), this.update(!1);
},
setShadowColor: function (t) {
return void 0 === t && (t = "#000"), (this.shadowColor = t), this.update(!1);
},
setShadowBlur: function (t) {
return void 0 === t && (t = 0), (this.shadowBlur = t), this.update(!1);
},
setShadowStroke: function (t) {
return (this.shadowStroke = t), this.update(!1);
},
setShadowFill: function (t) {
return (this.shadowFill = t), this.update(!1);
},
setWordWrapWidth: function (t, e) {
return void 0 === e && (e = !1), (this.wordWrapWidth = t), (this.wordWrapUseAdvanced = e), this.update(!1);
},
setWordWrapCallback: function (t, e) {
return void 0 === e && (e = null), (this.wordWrapCallback = t), (this.wordWrapCallbackScope = e), this.update(!1);
},
setAlign: function (t) {
return void 0 === t && (t = "left"), (this.align = t), this.update(!1);
},
setMaxLines: function (t) {
return void 0 === t && (t = 0), (this.maxLines = t), this.update(!1);
},
getTextMetrics: function () {
var t = this.metrics;
return { ascent: t.ascent, descent: t.descent, fontSize: t.fontSize };
},
toJSON: function () {
var t = {};
for (var e in l) t[e] = this[e];
return (t.metrics = this.getTextMetrics()), t;
},
destroy: function () {
this.parent = void 0;
},
});
t.exports = r;
},
function (t, e, i) {
var m = i(31);
t.exports = function (t) {
var e = m.create(this),
i = e.getContext("2d");
t.syncFont(e, i);
var n = i.measureText(t.testString);
if ("actualBoundingBoxAscent" in n) {
var s = n.actualBoundingBoxAscent,
r = n.actualBoundingBoxDescent;
return m.remove(e), { ascent: s, descent: r, fontSize: s + r };
}
var o = Math.ceil(n.width * t.baselineX),
a = 2 * (h = o),
h = (h * t.baselineY) | 0;
(e.width = o), (e.height = a), (i.fillStyle = "#f00"), i.fillRect(0, 0, o, a), (i.font = t._font), (i.textBaseline = "alphabetic"), (i.fillStyle = "#000"), i.fillText(t.testString, 0, h);
var l = { ascent: 0, descent: 0, fontSize: 0 },
u = i.getImageData(0, 0, o, a);
if (!u) return (l.ascent = h), (l.descent = 6 + h), (l.fontSize = l.ascent + l.descent), m.remove(e), l;
for (var c, d = u.data, f = d.length, p = 4 * o, g = 0, v = !1, y = 0; y < h; y++) {
for (c = 0; c < p; c += 4)
if (255 !== d[g + c]) {
v = !0;
break;
}
if (v) break;
g += p;
}
for (l.ascent = h - y, g = f - p, v = !1, y = a; h < y; y--) {
for (c = 0; c < p; c += 4)
if (255 !== d[g + c]) {
v = !0;
break;
}
if (v) break;
g -= p;
}
return (l.descent = y - h), (l.fontSize = l.ascent + l.descent), m.remove(e), l;
};
},
function (t, e, i) {
var n = i(1097),
s = i(0),
l = i(36),
u = i(59),
c = i(65),
d = i(14),
f = i(34),
r = new s({
Extends: f,
Mixins: [n],
initialize: function (t, e, i, n, s, r, o, a, h) {
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 128),
void 0 === s && (s = 0),
void 0 === r && (r = 360),
void 0 === o && (o = !1),
f.call(this, t, "Arc", new c(0, 0, n)),
(this._startAngle = s),
(this._endAngle = r),
(this._anticlockwise = o),
(this._iterations = 0.01),
this.setPosition(e, i);
var l = 2 * this.geom.radius;
this.setSize(l, l), void 0 !== a && this.setFillStyle(a, h), this.updateDisplayOrigin(), this.updateData();
},
iterations: {
get: function () {
return this._iterations;
},
set: function (t) {
(this._iterations = t), this.updateData();
},
},
radius: {
get: function () {
return this.geom.radius;
},
set: function (t) {
var e = 2 * (this.geom.radius = t);
this.setSize(e, e), this.updateDisplayOrigin(), this.updateData();
},
},
startAngle: {
get: function () {
return this._startAngle;
},
set: function (t) {
(this._startAngle = t), this.updateData();
},
},
endAngle: {
get: function () {
return this._endAngle;
},
set: function (t) {
(this._endAngle = t), this.updateData();
},
},
anticlockwise: {
get: function () {
return this._anticlockwise;
},
set: function (t) {
(this._anticlockwise = t), this.updateData();
},
},
setRadius: function (t) {
return (this.radius = t), this;
},
setIterations: function (t) {
return void 0 === t && (t = 0.01), (this.iterations = t), this;
},
setStartAngle: function (t, e) {
return (this._startAngle = t), void 0 !== e && (this._anticlockwise = e), this.updateData();
},
setEndAngle: function (t, e) {
return (this._endAngle = t), void 0 !== e && (this._anticlockwise = e), this.updateData();
},
updateData: function () {
var t = this._iterations,
e = t,
i = this.geom.radius,
n = l(this._startAngle),
s = l(this._endAngle),
r = i,
o = i;
(s -= n), this._anticlockwise ? (s < -d.PI2 ? (s = -d.PI2) : 0 < s && (s = -d.PI2 + (s % d.PI2))) : s > d.PI2 ? (s = d.PI2) : s < 0 && (s = d.PI2 + (s % d.PI2));
for (var a, h = [r + Math.cos(n) * i, o + Math.sin(n) * i]; e < 1; ) (a = s * e + n), h.push(r + Math.cos(a) * i, o + Math.sin(a) * i), (e += t);
return (a = s + n), h.push(r + Math.cos(a) * i, o + Math.sin(a) * i), h.push(r + Math.cos(n) * i, o + Math.sin(n) * i), (this.pathIndexes = u(h)), (this.pathData = h), this;
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(0),
s = i(1100),
r = i(59),
o = i(10),
a = i(34),
h = new n({
Extends: a,
Mixins: [s],
initialize: function (t, e, i, n, s, r) {
void 0 === e && (e = 0),
void 0 === i && (i = 0),
a.call(this, t, "Curve", n),
(this._smoothness = 32),
(this._curveBounds = new o()),
(this.closePath = !1),
this.setPosition(e, i),
void 0 !== s && this.setFillStyle(s, r),
this.updateData();
},
smoothness: {
get: function () {
return this._smoothness;
},
set: function (t) {
(this._smoothness = t), this.updateData();
},
},
setSmoothness: function (t) {
return (this._smoothness = t), this.updateData();
},
updateData: function () {
var t = this._curveBounds,
e = this._smoothness;
this.geom.getBounds(t, e), this.setSize(t.width, t.height), this.updateDisplayOrigin();
for (var i = [], n = this.geom.getPoints(e), s = 0; s < n.length; s++) i.push(n[s].x, n[s].y);
return i.push(n[0].x, n[0].y), (this.pathIndexes = r(i)), (this.pathData = i), this;
},
});
t.exports = h;
},
function (t, e, i) {
var n = i(0),
s = i(59),
r = i(1103),
a = i(111),
h = i(34),
o = new n({
Extends: h,
Mixins: [r],
initialize: function (t, e, i, n, s, r, o) {
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 128),
void 0 === s && (s = 128),
h.call(this, t, "Ellipse", new a(n / 2, s / 2, n, s)),
(this._smoothness = 64),
this.setPosition(e, i),
(this.width = n),
(this.height = s),
void 0 !== r && this.setFillStyle(r, o),
this.updateDisplayOrigin(),
this.updateData();
},
smoothness: {
get: function () {
return this._smoothness;
},
set: function (t) {
(this._smoothness = t), this.updateData();
},
},
setSize: function (t, e) {
return (this.width = t), (this.height = e), this.geom.setPosition(t / 2, e / 2), this.geom.setSize(t, e), this.updateData();
},
setSmoothness: function (t) {
return (this._smoothness = t), this.updateData();
},
updateData: function () {
for (var t = [], e = this.geom.getPoints(this._smoothness), i = 0; i < e.length; i++) t.push(e[i].x, e[i].y);
return t.push(e[0].x, e[0].y), (this.pathIndexes = s(t)), (this.pathData = t), this;
},
});
t.exports = o;
},
function (t, e, i) {
var n = i(0),
c = i(34),
s = i(1106),
r = new n({
Extends: c,
Mixins: [s],
initialize: function (t, e, i, n, s, r, o, a, h, l, u) {
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 128),
void 0 === s && (s = 128),
void 0 === r && (r = 32),
void 0 === o && (o = 32),
c.call(this, t, "Grid", null),
(this.cellWidth = r),
(this.cellHeight = o),
(this.showCells = !0),
(this.outlineFillColor = 0),
(this.outlineFillAlpha = 0),
(this.showOutline = !0),
(this.showAltCells = !1),
this.altFillColor,
this.altFillAlpha,
this.setPosition(e, i),
this.setSize(n, s),
this.setFillStyle(a, h),
void 0 !== l && this.setOutlineStyle(l, u),
this.updateDisplayOrigin();
},
setFillStyle: function (t, e) {
return void 0 === e && (e = 1), void 0 === t ? (this.showCells = !1) : ((this.fillColor = t), (this.fillAlpha = e), (this.showCells = !0)), this;
},
setAltFillStyle: function (t, e) {
return void 0 === e && (e = 1), void 0 === t ? (this.showAltCells = !1) : ((this.altFillColor = t), (this.altFillAlpha = e), (this.showAltCells = !0)), this;
},
setOutlineStyle: function (t, e) {
return void 0 === e && (e = 1), void 0 === t ? (this.showOutline = !1) : ((this.outlineFillColor = t), (this.outlineFillAlpha = e), (this.showOutline = !0)), this;
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(1109),
s = i(0),
h = i(34),
r = new s({
Extends: h,
Mixins: [n],
initialize: function (t, e, i, n, s, r, o, a) {
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 48),
void 0 === s && (s = 32),
void 0 === r && (r = 15658734),
void 0 === o && (o = 10066329),
void 0 === a && (a = 13421772),
h.call(this, t, "IsoBox", null),
(this.projection = 4),
(this.fillTop = r),
(this.fillLeft = o),
(this.fillRight = a),
(this.showTop = !0),
(this.showLeft = !0),
(this.showRight = !0),
(this.isFilled = !0),
this.setPosition(e, i),
this.setSize(n, s),
this.updateDisplayOrigin();
},
setProjection: function (t) {
return (this.projection = t), this;
},
setFaces: function (t, e, i) {
return void 0 === t && (t = !0), void 0 === e && (e = !0), void 0 === i && (i = !0), (this.showTop = t), (this.showLeft = e), (this.showRight = i), this;
},
setFillStyle: function (t, e, i) {
return (this.fillTop = t), (this.fillLeft = e), (this.fillRight = i), (this.isFilled = !0), this;
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(0),
s = i(1112),
l = i(34),
r = new n({
Extends: l,
Mixins: [s],
initialize: function (t, e, i, n, s, r, o, a, h) {
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 48),
void 0 === s && (s = 32),
void 0 === r && (r = !1),
void 0 === o && (o = 15658734),
void 0 === a && (a = 10066329),
void 0 === h && (h = 13421772),
l.call(this, t, "IsoTriangle", null),
(this.projection = 4),
(this.fillTop = o),
(this.fillLeft = a),
(this.fillRight = h),
(this.showTop = !0),
(this.showLeft = !0),
(this.showRight = !0),
(this.isReversed = r),
(this.isFilled = !0),
this.setPosition(e, i),
this.setSize(n, s),
this.updateDisplayOrigin();
},
setProjection: function (t) {
return (this.projection = t), this;
},
setReversed: function (t) {
return (this.isReversed = t), this;
},
setFaces: function (t, e, i) {
return void 0 === t && (t = !0), void 0 === e && (e = !0), void 0 === i && (i = !0), (this.showTop = t), (this.showLeft = e), (this.showRight = i), this;
},
setFillStyle: function (t, e, i) {
return (this.fillTop = t), (this.fillLeft = e), (this.fillRight = i), (this.isFilled = !0), this;
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(0),
c = i(34),
d = i(47),
s = i(1115),
r = new n({
Extends: c,
Mixins: [s],
initialize: function (t, e, i, n, s, r, o, a, h) {
void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === n && (n = 0), void 0 === s && (s = 0), void 0 === r && (r = 128), void 0 === o && (o = 0), c.call(this, t, "Line", new d(n, s, r, o));
var l = Math.max(1, this.geom.right - this.geom.left),
u = Math.max(1, this.geom.bottom - this.geom.top);
(this.lineWidth = 1), (this._startWidth = 1), (this._endWidth = 1), this.setPosition(e, i), this.setSize(l, u), void 0 !== a && this.setStrokeStyle(1, a, h), this.updateDisplayOrigin();
},
setLineWidth: function (t, e) {
return void 0 === e && (e = t), (this._startWidth = t), (this._endWidth = e), (this.lineWidth = t), this;
},
setTo: function (t, e, i, n) {
return this.geom.setTo(t, e, i, n), this;
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(1118),
s = i(0),
r = i(59),
a = i(469),
h = i(227),
l = i(34),
o = i(472),
u = new s({
Extends: l,
Mixins: [n],
initialize: function (t, e, i, n, s, r) {
void 0 === e && (e = 0), void 0 === i && (i = 0), l.call(this, t, "Polygon", new h(n));
var o = a(this.geom);
this.setPosition(e, i), this.setSize(o.width, o.height), void 0 !== s && this.setFillStyle(s, r), this.updateDisplayOrigin(), this.updateData();
},
smooth: function (t) {
void 0 === t && (t = 1);
for (var e = 0; e < t; e++) o(this.geom);
return this.updateData();
},
updateData: function () {
for (var t = [], e = this.geom.points, i = 0; i < e.length; i++) t.push(e[i].x, e[i].y);
return t.push(e[0].x, e[0].y), (this.pathIndexes = r(t)), (this.pathData = t), this;
},
});
t.exports = u;
},
function (t, e, i) {
var h = i(10);
t.exports = function (t, e) {
void 0 === e && (e = new h());
for (var i, n = 1 / 0, s = 1 / 0, r = -n, o = -s, a = 0; a < t.points.length; a++) (i = t.points[a]), (n = Math.min(n, i.x)), (s = Math.min(s, i.y)), (r = Math.max(r, i.x)), (o = Math.max(o, i.y));
return (e.x = n), (e.y = s), (e.width = r - n), (e.height = o - s), e;
};
},
function (t, e, i) {
var g = i(67),
v = i(47),
y = i(471);
t.exports = function (t, e, i, n) {
void 0 === n && (n = []);
var s = t.points,
r = y(t);
!e && 0 < i && (e = r / i);
for (var o = 0; o < e; o++)
for (var a = r * (o / e), h = 0, l = 0; l < s.length; l++) {
var u = s[l],
c = s[(l + 1) % s.length],
d = new v(u.x, u.y, c.x, c.y),
f = g(d);
if (!(a < h || h + f < a)) {
var p = d.getPoint((a - h) / f);
n.push(p);
break;
}
h += f;
}
return n;
};
},
function (t, e, i) {
var a = i(67),
h = i(47);
t.exports = function (t) {
for (var e = t.points, i = 0, n = 0; n < e.length; n++) {
var s = e[n],
r = e[(n + 1) % e.length],
o = new h(s.x, s.y, r.x, r.y);
i += a(o);
}
return i;
};
},
function (t, e) {
function c(t, e) {
return (t[0] = e[0]), (t[1] = e[1]), t;
}
t.exports = function (t) {
for (var e = [], i = t.points, n = 0; n < i.length; n++) e.push([i[n].x, i[n].y]);
var s = [];
for (0 < e.length && s.push(c([0, 0], e[0])), n = 0; n < e.length - 1; n++) {
var r = e[n],
o = e[n + 1],
a = r[0],
h = r[1],
l = o[0],
u = o[1];
s.push([0.85 * a + 0.15 * l, 0.85 * h + 0.15 * u]), s.push([0.15 * a + 0.85 * l, 0.15 * h + 0.85 * u]);
}
return 1 < e.length && s.push(c([0, 0], e[e.length - 1])), t.setTo(s);
};
},
function (t, e, i) {
var n = i(0),
a = i(10),
h = i(34),
s = i(1121),
r = new n({
Extends: h,
Mixins: [s],
initialize: function (t, e, i, n, s, r, o) {
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 128),
void 0 === s && (s = 128),
h.call(this, t, "Rectangle", new a(0, 0, n, s)),
this.setPosition(e, i),
this.setSize(n, s),
void 0 !== r && this.setFillStyle(r, o),
this.updateDisplayOrigin(),
this.updateData();
},
setSize: function (t, e) {
return (this.width = t), (this.height = e), this.geom.setSize(t, e), this.updateData(), this;
},
updateData: function () {
var t = [],
e = this.geom,
i = this._tempLine;
return e.getLineA(i), t.push(i.x1, i.y1, i.x2, i.y2), e.getLineB(i), t.push(i.x2, i.y2), e.getLineC(i), t.push(i.x2, i.y2), e.getLineD(i), t.push(i.x2, i.y2), (this.pathData = t), this;
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(1124),
s = i(0),
l = i(59),
h = i(34),
r = new s({
Extends: h,
Mixins: [n],
initialize: function (t, e, i, n, s, r, o, a) {
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 5),
void 0 === s && (s = 32),
void 0 === r && (r = 64),
h.call(this, t, "Star", null),
(this._points = n),
(this._innerRadius = s),
(this._outerRadius = r),
this.setPosition(e, i),
this.setSize(2 * r, 2 * r),
void 0 !== o && this.setFillStyle(o, a),
this.updateDisplayOrigin(),
this.updateData();
},
setPoints: function (t) {
return (this._points = t), this.updateData();
},
setInnerRadius: function (t) {
return (this._innerRadius = t), this.updateData();
},
setOuterRadius: function (t) {
return (this._outerRadius = t), this.updateData();
},
points: {
get: function () {
return this._points;
},
set: function (t) {
(this._points = t), this.updateData();
},
},
innerRadius: {
get: function () {
return this._innerRadius;
},
set: function (t) {
(this._innerRadius = t), this.updateData();
},
},
outerRadius: {
get: function () {
return this._outerRadius;
},
set: function (t) {
(this._outerRadius = t), this.updateData();
},
},
updateData: function () {
var t = [],
e = this._points,
i = this._innerRadius,
n = this._outerRadius,
s = (Math.PI / 2) * 3,
r = Math.PI / e,
o = n,
a = n;
t.push(o, a + -n);
for (var h = 0; h < e; h++) t.push(o + Math.cos(s) * n, a + Math.sin(s) * n), (s += r), t.push(o + Math.cos(s) * i, a + Math.sin(s) * i), (s += r);
return t.push(o, a + -n), (this.pathIndexes = l(t)), (this.pathData = t), this;
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(0),
f = i(34),
p = i(82),
s = i(1127),
r = new n({
Extends: f,
Mixins: [s],
initialize: function (t, e, i, n, s, r, o, a, h, l, u) {
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 0),
void 0 === s && (s = 128),
void 0 === r && (r = 64),
void 0 === o && (o = 0),
void 0 === a && (a = 128),
void 0 === h && (h = 128),
f.call(this, t, "Triangle", new p(n, s, r, o, a, h));
var c = this.geom.right - this.geom.left,
d = this.geom.bottom - this.geom.top;
this.setPosition(e, i), this.setSize(c, d), void 0 !== l && this.setFillStyle(l, u), this.updateDisplayOrigin(), this.updateData();
},
setTo: function (t, e, i, n, s, r) {
return this.geom.setTo(t, e, i, n, s, r), this.updateData();
},
updateData: function () {
var t = [],
e = this.geom,
i = this._tempLine;
return e.getLineA(i), t.push(i.x1, i.y1, i.x2, i.y2), e.getLineB(i), t.push(i.x2, i.y2), e.getLineC(i), t.push(i.x2, i.y2), (this.pathData = t), this;
},
});
t.exports = r;
},
function (t, e, i) {
var c = i(4),
d = i(67);
t.exports = function (t, e, i) {
void 0 === i && (i = new c());
var n = t.getLineA(),
s = t.getLineB(),
r = t.getLineC();
if (e <= 0 || 1 <= e) return (i.x = n.x1), (i.y = n.y1), i;
var o = d(n),
a = d(s),
h = d(r),
l = (o + a + h) * e,
u = 0;
return (
l < o
? ((u = l / o), (i.x = n.x1 + (n.x2 - n.x1) * u), (i.y = n.y1 + (n.y2 - n.y1) * u))
: o + a < l
? ((u = (l -= o + a) / h), (i.x = r.x1 + (r.x2 - r.x1) * u), (i.y = r.y1 + (r.y2 - r.y1) * u))
: ((u = (l -= o) / a), (i.x = s.x1 + (s.x2 - s.x1) * u), (i.y = s.y1 + (s.y2 - s.y1) * u)),
i
);
};
},
function (t, e, i) {
var g = i(67),
v = i(4);
t.exports = function (t, e, i, n) {
void 0 === n && (n = []);
var s = t.getLineA(),
r = t.getLineB(),
o = t.getLineC(),
a = g(s),
h = g(r),
l = g(o),
u = a + h + l;
!e && 0 < i && (e = u / i);
for (var c = 0; c < e; c++) {
var d = u * (c / e),
f = 0,
p = new v();
d < a
? ((f = d / a), (p.x = s.x1 + (s.x2 - s.x1) * f), (p.y = s.y1 + (s.y2 - s.y1) * f))
: a + h < d
? ((f = (d -= a + h) / l), (p.x = o.x1 + (o.x2 - o.x1) * f), (p.y = o.y1 + (o.y2 - o.y1) * f))
: ((f = (d -= a) / h), (p.x = r.x1 + (r.x2 - r.x1) * f), (p.y = r.y1 + (r.y2 - r.y1) * f)),
n.push(p);
}
return n;
};
},
function (t, e) {
t.exports = function (t, e, i) {
if (!t || "number" == typeof t) return !1;
if (t.hasOwnProperty(e)) return (t[e] = i), !0;
if (-1 === e.indexOf(".")) return !1;
for (var n = e.split("."), s = t, r = t, o = 0; o < n.length; o++) {
if (!s.hasOwnProperty(n[o])) return !1;
s = (r = s)[n[o]];
}
return (r[n[n.length - 1]] = i), !0;
};
},
function (t, e, i) {
var O = i(116),
k = i(117);
t.exports = function (t, e, i, n, s, r, o) {
if ((void 0 === n && (n = !1), void 0 === r && (r = 16777215), void 0 === o && (o = 1), t.length === e.length)) {
var a = { faces: [], vertices: [] },
h = n ? 3 : 2,
l = Array.isArray(r),
u = Array.isArray(o);
if (Array.isArray(i) && 0 < i.length)
for (P = 0; P < i.length; P++) {
var c = i[P],
d = 2 * i[P],
f = i[P] * h,
p = t[f],
g = t[1 + f],
v = n ? t[2 + f] : 0,
y = e[d],
m = e[1 + d],
x = l ? r[c] : r,
b = u ? o[c] : o,
w = 0,
T = 0,
S = 0;
s && ((w = s[f]), (T = s[1 + f]), (S = n ? s[2 + f] : 0)), a.vertices.push(new k(p, g, v, y, m, x, b, w, T, S));
}
else
for (var _ = 0, E = 0, P = 0; P < t.length; P += h)
(p = t[P]),
(g = t[P + 1]),
(v = n ? t[P + 2] : 0),
(y = e[_]),
(m = e[_ + 1]),
(x = l ? r[E] : r),
(b = u ? o[E] : o),
(S = T = w = 0),
s && ((w = s[P]), (T = s[P + 1]), (S = n ? s[P + 2] : 0)),
a.vertices.push(new k(p, g, v, y, m, x, b, w, T, S)),
(_ += 2),
E++;
for (P = 0; P < a.vertices.length; P += 3) {
var A = a.vertices[P],
M = a.vertices[P + 1],
C = a.vertices[P + 2];
a.faces.push(new O(A, M, C));
}
return a;
}
};
},
function (t, e, i) {
var D = i(116),
n = i(69),
s = i(39),
F = i(117),
B = new s(),
N = new s(),
U = new n();
t.exports = function (t, e, i, n, s, r, o, a, h, l) {
void 0 === i && (i = 1), void 0 === n && (n = 0), void 0 === s && (s = 0), void 0 === r && (r = 0), void 0 === o && (o = 0), void 0 === a && (a = 0), void 0 === h && (h = 0), void 0 === l && (l = !0);
var u = { faces: [], verts: [] },
c = t.materials;
B.set(n, s, r), N.set(o, a, h), U.fromRotationXYTranslation(N, B, l);
for (var d = 0; d < t.models.length; d++)
for (var f = t.models[d], p = f.vertices, g = f.textureCoords, v = f.faces, y = 0; y < v.length; y++) {
var m = v[y],
x = m.vertices[0],
b = m.vertices[1],
w = m.vertices[2],
T = p[x.vertexIndex],
S = p[b.vertexIndex],
_ = p[w.vertexIndex],
E = x.textureCoordsIndex,
P = b.textureCoordsIndex,
A = w.textureCoordsIndex,
M = -1 === E ? { u: 0, v: 1 } : g[E],
C = -1 === P ? { u: 0, v: 0 } : g[P],
O = -1 === A ? { u: 1, v: 1 } : g[A],
k = 16777215;
"" !== m.material && c[m.material] && (k = c[m.material]);
var R = new F(T.x * i, T.y * i, T.z * i, M.u, M.v, k).transformMat4(U),
L = new F(S.x * i, S.y * i, S.z * i, C.u, C.v, k).transformMat4(U),
I = new F(_.x * i, _.y * i, _.z * i, O.u, O.v, k).transformMat4(U);
u.verts.push(R, L, I), u.faces.push(new D(R, L, I));
}
return e && ((e.faces = e.faces.concat(u.faces)), (e.vertices = e.vertices.concat(u.verts))), u;
};
},
function (t, e, i) {
var a = i(65),
n = i(0),
s = i(11),
h = i(200),
r = i(12),
o = new n({
Extends: a,
Mixins: [s.ScrollFactor, s.Visible],
initialize: function (t, e, i, n, s, r, o) {
a.call(this, t, e, i), (this.color = new h(n, s, r)), (this.intensity = o), (this.renderFlags = 15), (this.cameraFilter = 0), this.setScrollFactor(1, 1);
},
willRender: function (t) {
return !(o.RENDER_MASK !== this.renderFlags || (0 !== this.cameraFilter && this.cameraFilter & t.id));
},
setColor: function (t) {
var e = r.getFloatsFromUintRGB(t);
return this.color.set(e[0], e[1], e[2]), this;
},
setIntensity: function (t) {
return (this.intensity = t), this;
},
setRadius: function (t) {
return (this.radius = t), this;
},
});
(o.RENDER_MASK = 15), (t.exports = o);
},
function (t, e, i) {
var o = i(151),
n = i(0),
a = i(50),
h = i(481),
l = i(150),
s = i(200),
r = i(74),
u = i(79),
c = i(12),
d = new n({
initialize: function () {
(this.lights = []), (this.ambientColor = new s(0.1, 0.1, 0.1)), (this.active = !1), (this.maxLights = -1), (this.visibleLights = 0);
},
addPointLight: function (t, e, i, n, s, r) {
return this.systems.displayList.add(new l(this.scene, t, e, i, n, s, r));
},
enable: function () {
return -1 === this.maxLights && (this.maxLights = this.systems.renderer.config.maxLights), (this.active = !0), this;
},
disable: function () {
return (this.active = !1), this;
},
getLights: function (t) {
for (var e = this.lights, i = t.worldView, n = [], s = 0; s < e.length; s++) {
var r = e[s];
r.willRender(t) && o(r, i) && n.push({ light: r, distance: a(r.x, r.y, i.centerX, i.centerY) });
}
return n.length > this.maxLights && (u(n, this.sortByDistance), (n = n.slice(0, this.maxLights))), (this.visibleLights = n.length), n;
},
sortByDistance: function (t, e) {
return t.distance >= e.distance;
},
setAmbientColor: function (t) {
var e = c.getFloatsFromUintRGB(t);
return this.ambientColor.set(e[0], e[1], e[2]), this;
},
getMaxVisibleLights: function () {
return this.maxLights;
},
getLightCount: function () {
return this.lights.length;
},
addLight: function (t, e, i, n, s) {
void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 128), void 0 === n && (n = 16777215), void 0 === s && (s = 1);
var r = c.getFloatsFromUintRGB(n),
o = new h(t, e, i, r[0], r[1], r[2], s);
return this.lights.push(o), o;
},
removeLight: function (t) {
var e = this.lights.indexOf(t);
return 0 <= e && r(this.lights, e), this;
},
shutdown: function () {
this.lights.length = 0;
},
destroy: function () {
this.shutdown();
},
});
t.exports = d;
},
function (t, e, i) {
var n = i(56),
s = i(17)(!1, (s = { Circle: i(1191), Ellipse: i(1201), Intersects: i(484), Line: i(1221), Mesh: i(1243), Point: i(1246), Polygon: i(1260), Rectangle: i(502), Triangle: i(1293) }), n);
t.exports = s;
},
function (t, e, i) {
t.exports = {
CircleToCircle: i(231),
CircleToRectangle: i(151),
GetCircleToCircle: i(1211),
GetCircleToRectangle: i(1212),
GetLineToCircle: i(232),
GetLineToLine: i(485),
GetLineToPoints: i(486),
GetLineToPolygon: i(487),
GetLineToRectangle: i(234),
GetRaysFromPointToPolygon: i(1213),
GetRectangleIntersection: i(1214),
GetRectangleToRectangle: i(1215),
GetRectangleToTriangle: i(1216),
GetTriangleToCircle: i(1217),
GetTriangleToLine: i(492),
GetTriangleToTriangle: i(1218),
LineToCircle: i(233),
LineToLine: i(96),
LineToRectangle: i(488),
PointToLine: i(496),
PointToLineSegment: i(1219),
RectangleToRectangle: i(152),
RectangleToTriangle: i(489),
RectangleToValues: i(1220),
TriangleToCircle: i(491),
TriangleToLine: i(493),
TriangleToTriangle: i(494),
};
},
function (t, e, i) {
var g = i(39);
t.exports = function (t, e, i) {
var n = t.x1,
s = t.y1,
r = t.x2,
o = t.y2,
a = e.x1,
h = e.y1,
l = r - n,
u = o - s,
c = e.x2 - a,
d = e.y2 - h;
if (0 == l || 0 == d * l - c * u) return !1;
var f = (l * (h - s) + u * (n - a)) / (c * u - d * l),
p = (a + c * f - n) / l;
return p < 0 || f < 0 || 1 < f ? null : (void 0 === i && (i = new g()), i.set(n + l * p, s + u * p, p));
};
},
function (t, e, i) {
var a = i(39),
h = i(485),
l = new (i(47))(),
u = new a();
t.exports = function (t, e, i) {
void 0 === i && (i = new a());
var n = !1;
i.set(), u.set();
for (var s = e[0], r = 1; r < e.length; r++) {
var o = e[r];
l.setTo(s.x, s.y, o.x, o.y), (s = o), h(t, l, u) && (!n || u.z < i.z) && (i.copy(u), (n = !0));
}
return n ? i : null;
};
},
function (t, e, i) {
var n = i(39),
r = i(140),
o = i(486),
a = new n();
t.exports = function (t, e, i) {
void 0 === i && (i = new r()), Array.isArray(e) || (e = [e]);
var n = !1;
i.set(), a.set();
for (var s = 0; s < e.length; s++) o(t, e[s].points, a) && (!n || a.z < i.z) && (i.set(a.x, a.y, a.z, s), (n = !0));
return n ? i : null;
};
},
function (t, e) {
t.exports = function (t, e) {
var i = t.x1,
n = t.y1,
s = t.x2,
r = t.y2,
o = e.x,
a = e.y,
h = e.right,
l = e.bottom,
u = 0;
if ((o <= i && i <= h && a <= n && n <= l) || (o <= s && s <= h && a <= r && r <= l)) return !0;
if (i < o && o <= s) {
if (a < (u = n + ((r - n) * (o - i)) / (s - i)) && u <= l) return !0;
} else if (h < i && s <= h && a <= (u = n + ((r - n) * (h - i)) / (s - i)) && u <= l) return !0;
if (n < a && a <= r) {
if (o <= (u = i + ((s - i) * (a - n)) / (r - n)) && u <= h) return !0;
} else if (l < n && r <= l && o <= (u = i + ((s - i) * (l - n)) / (r - n)) && u <= h) return !0;
return !1;
};
},
function (t, e, i) {
var u = i(96),
c = i(57),
d = i(235),
f = i(490);
t.exports = function (t, e) {
if (e.left > t.right || e.right < t.left || e.top > t.bottom || e.bottom < t.top) return !1;
var i = e.getLineA(),
n = e.getLineB(),
s = e.getLineC();
if (c(t, i.x1, i.y1) || c(t, i.x2, i.y2)) return !0;
if (c(t, n.x1, n.y1) || c(t, n.x2, n.y2)) return !0;
if (c(t, s.x1, s.y1) || c(t, s.x2, s.y2)) return !0;
var r = t.getLineA(),
o = t.getLineB(),
a = t.getLineC(),
h = t.getLineD();
if (u(i, r) || u(i, o) || u(i, a) || u(i, h)) return !0;
if (u(n, r) || u(n, o) || u(n, a) || u(n, h)) return !0;
if (u(s, r) || u(s, o) || u(s, a) || u(s, h)) return !0;
var l = f(t);
return 0 < d(e, l, !0).length;
};
},
function (t, e) {
t.exports = function (t, e) {
return void 0 === e && (e = []), e.push({ x: t.x, y: t.y }), e.push({ x: t.right, y: t.y }), e.push({ x: t.right, y: t.bottom }), e.push({ x: t.x, y: t.bottom }), e;
};
},
function (t, e, i) {
var n = i(233),
s = i(115);
t.exports = function (t, e) {
return !(t.left > e.right || t.right < e.left || t.top > e.bottom || t.bottom < e.top || (!s(t, e.x, e.y) && !n(t.getLineA(), e) && !n(t.getLineB(), e) && !n(t.getLineC(), e)));
};
},
function (t, e, i) {
var l = i(4),
u = i(493),
c = i(96);
t.exports = function (t, e, i) {
if ((void 0 === i && (i = []), u(t, e)))
for (var n = t.getLineA(), s = t.getLineB(), r = t.getLineC(), o = [new l(), new l(), new l()], a = [c(n, e, o[0]), c(s, e, o[1]), c(r, e, o[2])], h = 0; h < 3; h++) a[h] && i.push(o[h]);
return i;
};
},
function (t, e, i) {
var n = i(96);
t.exports = function (t, e) {
return !!(t.contains(e.x1, e.y1) || t.contains(e.x2, e.y2) || n(t.getLineA(), e) || n(t.getLineB(), e) || n(t.getLineC(), e));
};
},
function (t, e, i) {
var l = i(235),
u = i(495),
c = i(96);
t.exports = function (t, e) {
if (t.left > e.right || t.right < e.left || t.top > e.bottom || t.bottom < e.top) return !1;
var i = t.getLineA(),
n = t.getLineB(),
s = t.getLineC(),
r = e.getLineA(),
o = e.getLineB(),
a = e.getLineC();
if (c(i, r) || c(i, o) || c(i, a)) return !0;
if (c(n, r) || c(n, o) || c(n, a)) return !0;
if (c(s, r) || c(s, o) || c(s, a)) return !0;
var h = u(t);
return 0 < l(e, h, !0).length || ((h = u(e)), 0 < l(t, h, !0).length);
};
},
function (t, e) {
t.exports = function (t, e) {
return void 0 === e && (e = []), e.push({ x: t.x1, y: t.y1 }), e.push({ x: t.x2, y: t.y2 }), e.push({ x: t.x3, y: t.y3 }), e;
};
},
function (t, e) {
t.exports = function (t, e, i) {
void 0 === i && (i = 1);
var n = e.x1,
s = e.y1,
r = e.x2,
o = e.y2,
a = t.x,
h = t.y,
l = (r - n) * (r - n) + (o - s) * (o - s);
if (0 == l) return !1;
var u = ((a - n) * (r - n) + (h - s) * (o - s)) / l;
if (u < 0) return Math.sqrt((n - a) * (n - a) + (s - h) * (s - h)) <= i;
if (0 <= u && u <= 1) {
var c = ((s - h) * (r - n) - (n - a) * (o - s)) / l;
return Math.abs(c) * Math.sqrt(l) <= i;
}
return Math.sqrt((r - a) * (r - a) + (o - h) * (o - h)) <= i;
};
},
function (t, e, i) {
var n = i(14),
s = i(68),
r = i(97);
t.exports = function (t) {
var e = r(t) - n.TAU;
return s(e, -Math.PI, Math.PI);
};
},
function (t, e) {
var L = !0,
I = "untitled",
D = "",
F = "";
function B(t) {
return 0 === t.models.length && t.models.push({ faces: [], name: I, textureCoords: [], vertexNormals: [], vertices: [] }), (D = ""), t.models[t.models.length - 1];
}
t.exports = function (t, e) {
void 0 === e && (e = !0), (L = e);
var i = { materials: {}, materialLibraries: [], models: [] };
F = D = "";
for (var n, s, r, o, a, h, l, u, c, d, f, p, g, v, y, m, x, b, w, T, S, _, E, P, A, M, C, O = t.split("\n"), k = 0; k < O.length; k++) {
var R = ((M = O[k]), -1 < (C = M.indexOf("#")) ? M.substring(0, C) : M).replace(/\s\s+/g, " ").trim().split(" ");
switch (R[0].toLowerCase()) {
case "o":
(P = i), (A = 2 <= (E = R).length ? E[1] : I), P.models.push({ faces: [], name: A, textureCoords: [], vertexNormals: [], vertices: [] }), (D = "");
break;
case "g":
2 === (_ = R).length && (D = _[1]);
break;
case "v":
(x = i), (w = 2 <= (b = (m = R).length) ? parseFloat(m[1]) : 0), (T = 3 <= b ? parseFloat(m[2]) : 0), (S = 4 <= b ? parseFloat(m[3]) : 0), B(x).vertices.push({ x: w, y: T, z: S });
break;
case "vt":
(f = i),
(y = v = g = void 0),
(g = 2 <= (p = (d = R).length) ? parseFloat(d[1]) : 0),
(v = 3 <= p ? parseFloat(d[2]) : 0),
(y = 4 <= p ? parseFloat(d[3]) : 0),
isNaN(g) && (g = 0),
isNaN(v) && (v = 0),
isNaN(y) && (y = 0),
L && (v = 1 - v),
B(f).textureCoords.push({ u: g, v: v, w: y });
break;
case "vn":
(a = i), (l = 2 <= (h = (o = R).length) ? parseFloat(o[1]) : 0), (u = 3 <= h ? parseFloat(o[2]) : 0), (c = 4 <= h ? parseFloat(o[3]) : 0), B(a).vertexNormals.push({ x: l, y: u, z: c });
break;
case "f":
!(function (t, e) {
var i = t.length - 1;
if (!(i < 3)) {
for (var n = { group: D, material: F, vertices: [] }, s = 0; s < i; s++) {
var r,
o,
a,
h = t[s + 1].split("/"),
l = h.length;
l < 1 ||
3 < l ||
((o = r = a = 0),
(a = parseInt(h[0], 10)),
1 < l && "" !== h[1] && (r = parseInt(h[1], 10)),
2 < l && (o = parseInt(h[2], 10)),
0 !== a && (a < 0 && (a = B(e).vertices.length + 1 + a), --r, --a, --o, n.vertices.push({ textureCoordsIndex: r, vertexIndex: a, vertexNormalIndex: o })));
}
B(e).faces.push(n);
}
})(R, i);
break;
case "mtllib":
(r = i), 2 <= (s = R).length && r.materialLibraries.push(s[1]);
break;
case "usemtl":
2 <= (n = R).length && (F = n[1]);
}
}
return i;
};
},
function (t, e, i) {
var u = i(103);
t.exports = function (t) {
for (var e = {}, i = t.split("\n"), n = "", s = 0; s < i.length; s++) {
var r = i[s].trim();
if (0 !== r.indexOf("#") && "" !== r) {
var o = r.replace(/\s\s+/g, " ").trim().split(" ");
switch (o[0].toLowerCase()) {
case "newmtl":
n = o[1];
break;
case "kd":
var a = Math.floor(255 * o[1]),
h = 2 <= o.length ? Math.floor(255 * o[2]) : a,
l = 3 <= o.length ? Math.floor(255 * o[3]) : a;
e[n] = u(a, h, l);
}
}
}
return e;
};
},
function (t, e) {
t.exports = function (t) {
return Math.sqrt(t.x * t.x + t.y * t.y);
};
},
function (t, e) {
t.exports = function (t) {
return t.x * t.x + t.y * t.y;
};
},
function (t, e, i) {
var n = i(10);
(n.Area = i(1267)),
(n.Ceil = i(1268)),
(n.CeilAll = i(1269)),
(n.CenterOn = i(190)),
(n.Clone = i(1270)),
(n.Contains = i(57)),
(n.ContainsPoint = i(1271)),
(n.ContainsRect = i(503)),
(n.CopyFrom = i(1272)),
(n.Decompose = i(490)),
(n.Equals = i(1273)),
(n.FitInside = i(1274)),
(n.FitOutside = i(1275)),
(n.Floor = i(1276)),
(n.FloorAll = i(1277)),
(n.FromPoints = i(199)),
(n.FromXY = i(1278)),
(n.GetAspectRatio = i(237)),
(n.GetCenter = i(1279)),
(n.GetPoint = i(171)),
(n.GetPoints = i(306)),
(n.GetSize = i(1280)),
(n.Inflate = i(1281)),
(n.Intersection = i(1282)),
(n.MarchingAnts = i(316)),
(n.MergePoints = i(1283)),
(n.MergeRect = i(1284)),
(n.MergeXY = i(1285)),
(n.Offset = i(1286)),
(n.OffsetPoint = i(1287)),
(n.Overlaps = i(1288)),
(n.Perimeter = i(130)),
(n.PerimeterPoint = i(1289)),
(n.Random = i(174)),
(n.RandomOutside = i(1290)),
(n.SameDimensions = i(1291)),
(n.Scale = i(1292)),
(n.Union = i(441)),
(t.exports = n);
},
function (t, e) {
t.exports = function (t, e) {
return !(e.width * e.height > t.width * t.height) && e.x > t.x && e.x < t.right && e.right > t.x && e.right < t.right && e.y > t.y && e.y < t.bottom && e.bottom > t.y && e.bottom < t.bottom;
};
},
function (t, e, i) {
var n = i(4);
t.exports = function (t, e) {
return void 0 === e && (e = new n()), (e.x = (t.x1 + t.x2 + t.x3) / 3), (e.y = (t.y1 + t.y2 + t.y3) / 3), e;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return (t.x1 += e), (t.y1 += i), (t.x2 += e), (t.y2 += i), (t.x3 += e), (t.y3 += i), t;
};
},
function (t, e, i) {
var d = i(4);
function f(t, e, i, n) {
var s = t - i,
r = e - n,
o = s * s + r * r;
return Math.sqrt(o);
}
t.exports = function (t, e) {
void 0 === e && (e = new d());
var i = t.x1,
n = t.y1,
s = t.x2,
r = t.y2,
o = t.x3,
a = t.y3,
h = f(o, a, s, r),
l = f(i, n, o, a),
u = f(s, r, i, n),
c = h + l + u;
return (e.x = (i * h + s * l + o * u) / c), (e.y = (n * h + r * l + a * u) / c), e;
};
},
function (t, e) {
t.exports = function (r, o) {
return function (t, e, i, n) {
var s = r.getPixelAlpha(e, i, n.texture.key, n.frame.name);
return s && o <= s;
};
};
},
function (t, e) {
t.exports = function (t, e, i) {
return {
gameObject: t,
enabled: !0,
alwaysEnabled: !1,
draggable: !1,
dropZone: !1,
cursor: !1,
target: null,
camera: null,
hitArea: e,
hitAreaCallback: i,
hitAreaDebug: null,
customHitArea: !1,
localX: 0,
localY: 0,
dragState: 0,
dragStartX: 0,
dragStartY: 0,
dragStartXGlobal: 0,
dragStartYGlobal: 0,
dragX: 0,
dragY: 0,
};
};
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e) {
(this.pad = t), (this.events = t.events), (this.index = e), (this.value = 0), (this.threshold = 0.1);
},
update: function (t) {
this.value = t;
},
getValue: function () {
return Math.abs(this.value) < this.threshold ? 0 : this.value;
},
destroy: function () {
(this.pad = null), (this.events = null);
},
});
t.exports = n;
},
function (t, e, i) {
var n = i(0),
s = i(239),
r = new n({
initialize: function (t, e) {
(this.pad = t), (this.events = t.manager), (this.index = e), (this.value = 0), (this.threshold = 1), (this.pressed = !1);
},
update: function (t) {
this.value = t;
var e = this.pad,
i = this.index;
t >= this.threshold
? this.pressed || ((this.pressed = !0), this.events.emit(s.BUTTON_DOWN, e, this, t), this.pad.emit(s.GAMEPAD_BUTTON_DOWN, i, t, this))
: this.pressed && ((this.pressed = !1), this.events.emit(s.BUTTON_UP, e, this, t), this.pad.emit(s.GAMEPAD_BUTTON_UP, i, t, this));
},
destroy: function () {
(this.pad = null), (this.events = null);
},
});
t.exports = r;
},
function (t, e, i) {
var a = i(509),
h = i(510),
n = i(0),
l = i(9),
u = i(3),
s = new n({
Extends: l,
initialize: function (t, e) {
l.call(this), (this.manager = t), (this.pad = e), (this.id = e.id), (this.index = e.index);
for (var i = [], n = 0; n < e.buttons.length; n++) i.push(new h(this, n));
this.buttons = i;
var s = [];
for (n = 0; n < e.axes.length; n++) s.push(new a(this, n));
(this.axes = s), (this.vibration = e.vibrationActuator);
var r = { value: 0, pressed: !1 };
(this._LCLeft = i[14] ? i[14] : r),
(this._LCRight = i[15] ? i[15] : r),
(this._LCTop = i[12] ? i[12] : r),
(this._LCBottom = i[13] ? i[13] : r),
(this._RCLeft = i[2] ? i[2] : r),
(this._RCRight = i[1] ? i[1] : r),
(this._RCTop = i[3] ? i[3] : r),
(this._RCBottom = i[0] ? i[0] : r),
(this._FBLeftTop = i[4] ? i[4] : r),
(this._FBLeftBottom = i[6] ? i[6] : r),
(this._FBRightTop = i[5] ? i[5] : r),
(this._FBRightBottom = i[7] ? i[7] : r);
var o = { value: 0 };
(this._HAxisLeft = s[0] ? s[0] : o),
(this._VAxisLeft = s[1] ? s[1] : o),
(this._HAxisRight = s[2] ? s[2] : o),
(this._VAxisRight = s[3] ? s[3] : o),
(this.leftStick = new u()),
(this.rightStick = new u()),
(this._created = performance.now());
},
getAxisTotal: function () {
return this.axes.length;
},
getAxisValue: function (t) {
return this.axes[t].getValue();
},
setAxisThreshold: function (t) {
for (var e = 0; e < this.axes.length; e++) this.axes[e].threshold = t;
},
getButtonTotal: function () {
return this.buttons.length;
},
getButtonValue: function (t) {
return this.buttons[t].value;
},
isButtonDown: function (t) {
return this.buttons[t].pressed;
},
update: function (t) {
if (!(t.timestamp < this._created)) {
for (var e = this.buttons, i = t.buttons, n = e.length, s = 0; s < n; s++) e[s].update(i[s].value);
var r = this.axes,
o = t.axes;
for (n = r.length, s = 0; s < n; s++) r[s].update(o[s]);
2 <= n && (this.leftStick.set(r[0].getValue(), r[1].getValue()), 4 <= n && this.rightStick.set(r[2].getValue(), r[3].getValue()));
}
},
destroy: function () {
var t;
for (this.removeAllListeners(), this.manager = null, this.pad = null, t = 0; t < this.buttons.length; t++) this.buttons[t].destroy();
for (t = 0; t < this.axes.length; t++) this.axes[t].destroy();
(this.buttons = []), (this.axes = []);
},
connected: {
get: function () {
return this.pad.connected;
},
},
timestamp: {
get: function () {
return this.pad.timestamp;
},
},
left: {
get: function () {
return this._LCLeft.pressed;
},
},
right: {
get: function () {
return this._LCRight.pressed;
},
},
up: {
get: function () {
return this._LCTop.pressed;
},
},
down: {
get: function () {
return this._LCBottom.pressed;
},
},
A: {
get: function () {
return this._RCBottom.pressed;
},
},
Y: {
get: function () {
return this._RCTop.pressed;
},
},
X: {
get: function () {
return this._RCLeft.pressed;
},
},
B: {
get: function () {
return this._RCRight.pressed;
},
},
L1: {
get: function () {
return this._FBLeftTop.value;
},
},
L2: {
get: function () {
return this._FBLeftBottom.value;
},
},
R1: {
get: function () {
return this._FBRightTop.value;
},
},
R2: {
get: function () {
return this._FBRightBottom.value;
},
},
});
t.exports = s;
},
function (t, e, i) {
var n = i(0),
s = i(9),
r = i(154),
o = new n({
Extends: s,
initialize: function (t, e) {
s.call(this),
(this.plugin = t),
(this.keyCode = e),
(this.originalEvent = void 0),
(this.enabled = !0),
(this.isDown = !1),
(this.isUp = !0),
(this.altKey = !1),
(this.ctrlKey = !1),
(this.shiftKey = !1),
(this.metaKey = !1),
(this.location = 0),
(this.timeDown = 0),
(this.duration = 0),
(this.timeUp = 0),
(this.emitOnRepeat = !1),
(this.repeats = 0),
(this._justDown = !1),
(this._justUp = !1),
(this._tick = -1);
},
setEmitOnRepeat: function (t) {
return (this.emitOnRepeat = t), this;
},
onDown: function (t) {
(this.originalEvent = t),
this.enabled &&
((this.altKey = t.altKey),
(this.ctrlKey = t.ctrlKey),
(this.shiftKey = t.shiftKey),
(this.metaKey = t.metaKey),
(this.location = t.location),
this.repeats++,
this.isDown
? this.emitOnRepeat && this.emit(r.DOWN, this, t)
: ((this.isDown = !0), (this.isUp = !1), (this.timeDown = t.timeStamp), (this.duration = 0), (this._justDown = !0), (this._justUp = !1), this.emit(r.DOWN, this, t)));
},
onUp: function (t) {
(this.originalEvent = t),
this.enabled &&
((this.isDown = !1),
(this.isUp = !0),
(this.timeUp = t.timeStamp),
(this.duration = this.timeUp - this.timeDown),
(this.repeats = 0),
(this._justDown = !1),
(this._justUp = !0),
(this._tick = -1),
this.emit(r.UP, this, t));
},
reset: function () {
return (
(this.preventDefault = !0),
(this.enabled = !0),
(this.isDown = !1),
(this.isUp = !0),
(this.altKey = !1),
(this.ctrlKey = !1),
(this.shiftKey = !1),
(this.metaKey = !1),
(this.timeDown = 0),
(this.duration = 0),
(this.timeUp = 0),
(this.repeats = 0),
(this._justDown = !1),
(this._justUp = !1),
(this._tick = -1),
this
);
},
getDuration: function () {
return this.isDown ? this.plugin.game.loop.time - this.timeDown : 0;
},
destroy: function () {
this.removeAllListeners(), (this.originalEvent = null), (this.plugin = null);
},
});
t.exports = o;
},
function (t, e, i) {
var n = i(0),
o = i(154),
a = i(2),
h = i(514),
l = i(516),
s = new n({
initialize: function (t, e, i) {
if ((void 0 === i && (i = {}), e.length < 2)) return !1;
(this.manager = t), (this.enabled = !0), (this.keyCodes = []);
for (var n = 0; n < e.length; n++) {
var s = e[n];
"string" == typeof s ? this.keyCodes.push(s.toUpperCase().charCodeAt(0)) : "number" == typeof s ? this.keyCodes.push(s) : s.hasOwnProperty("keyCode") && this.keyCodes.push(s.keyCode);
}
(this.current = this.keyCodes[0]),
(this.index = 0),
(this.size = this.keyCodes.length),
(this.timeLastMatched = 0),
(this.matched = !1),
(this.timeMatched = 0),
(this.resetOnWrongKey = a(i, "resetOnWrongKey", !0)),
(this.maxKeyDelay = a(i, "maxKeyDelay", 0)),
(this.resetOnMatch = a(i, "resetOnMatch", !1)),
(this.deleteOnMatch = a(i, "deleteOnMatch", !1));
var r = this;
(this.onKeyDown = function (t) {
!r.matched && r.enabled && h(t, r) && (r.manager.emit(o.COMBO_MATCH, r, t), r.resetOnMatch ? l(r) : r.deleteOnMatch && r.destroy());
}),
this.manager.on(o.ANY_KEY_DOWN, this.onKeyDown);
},
progress: {
get: function () {
return this.index / this.size;
},
},
destroy: function () {
(this.enabled = !1), (this.keyCodes = []), this.manager.off(o.ANY_KEY_DOWN, this.onKeyDown), (this.manager = null);
},
});
t.exports = s;
},
function (t, e, i) {
var r = i(515);
t.exports = function (t, e) {
if (e.matched) return !0;
var i,
n = !1,
s = !1;
return (
t.keyCode === e.current && (0 < e.index && 0 < e.maxKeyDelay ? ((i = e.timeLastMatched + e.maxKeyDelay), t.timeStamp <= i && ((s = !0), (n = r(t, e)))) : ((s = !0), (n = r(t, e)))),
!s && e.resetOnWrongKey && ((e.index = 0), (e.current = e.keyCodes[0])),
n && ((e.timeLastMatched = t.timeStamp), (e.matched = !0), (e.timeMatched = t.timeStamp)),
n
);
};
},
function (t, e) {
t.exports = function (t, e) {
return (e.timeLastMatched = t.timeStamp), e.index++, e.index === e.size || ((e.current = e.keyCodes[e.index]), !1);
};
},
function (t, e) {
t.exports = function (t) {
return (t.current = t.keyCodes[0]), (t.index = 0), (t.timeLastMatched = 0), (t.matched = !1), (t.timeMatched = 0), t;
};
},
function (t, e, i) {
var r = i(240);
t.exports = function (t, e) {
var i = r(e, t.xhrSettings),
n = new XMLHttpRequest();
if ((n.open("GET", t.src, i.async, i.user, i.password), (n.responseType = t.xhrSettings.responseType), (n.timeout = i.timeout), i.headers)) for (var s in i.headers) n.setRequestHeader(s, i.headers[s]);
return (
i.header && i.headerValue && n.setRequestHeader(i.header, i.headerValue),
i.requestedWith && n.setRequestHeader("X-Requested-With", i.requestedWith),
i.overrideMimeType && n.overrideMimeType(i.overrideMimeType),
i.withCredentials && (n.withCredentials = !0),
(n.onload = t.onLoad.bind(t, n)),
(n.onerror = t.onError.bind(t, n)),
(n.onprogress = t.onProgress.bind(t)),
n.send(),
n
);
};
},
function (t, e, i) {
var n = i(0),
s = i(21),
a = i(23),
r = i(8),
l = i(2),
u = i(519),
c = i(7),
d = new n({
Extends: a,
initialize: function (t, e, i, n, s) {
var r;
c(e) && ((e = l((r = e), "key")), (n = l(r, "xhrSettings")), (s = l(r, "context", s)));
var o = { type: "audio", cache: t.cacheManager.audio, extension: i.type, responseType: "arraybuffer", key: e, url: i.url, xhrSettings: n, config: { context: s } };
a.call(this, t, o);
},
onProcess: function () {
this.state = s.FILE_PROCESSING;
var e = this;
this.config.context.decodeAudioData(
this.xhrLoader.response,
function (t) {
(e.data = t), e.onProcessComplete();
},
function (t) {
e.onProcessError();
}
),
(this.config.context = null);
},
});
(d.create = function (t, e, i, n, s) {
var r = t.systems.game,
o = r.config.audio,
a = r.device.audio;
c(e) && ((i = l(e, "url", [])), (n = l(e, "config", {})));
var h = d.getAudioURL(r, i);
return h ? (a.webAudio && !o.disableWebAudio ? new d(t, e, h, s, r.sound.context) : new u(t, e, h, n)) : null;
}),
(d.getAudioURL = function (t, e) {
Array.isArray(e) || (e = [e]);
for (var i = 0; i < e.length; i++) {
var n = l(e[i], "url", e[i]);
if (0 === n.indexOf("blob:") || 0 === n.indexOf("data:")) return { url: n, type: "" };
var s = n.match(/\.([a-zA-Z0-9]+)($|\?)/);
if (((s = l(e[i], "type", s ? s[1] : "").toLowerCase()), t.device.audio[s])) return { url: n, type: s };
}
return null;
}),
r.register("audio", function (t, e, i, n) {
var s,
r = this.systems.game,
o = r.config.audio,
a = r.device.audio;
if (o.noAudio || (!a.webAudio && !a.audioData)) return this;
if (Array.isArray(t)) for (var h = 0; h < t.length; h++) (s = d.create(this, t[h])) && this.addFile(s);
else (s = d.create(this, t, e, i, n)) && this.addFile(s);
return this;
}),
(t.exports = d);
},
function (t, e, i) {
var n = i(0),
s = i(95),
o = i(23),
a = i(2),
r = i(155),
h = i(7),
l = new n({
Extends: o,
initialize: function (t, e, i, n) {
var s;
h(e) && ((e = a((s = e), "key")), (n = a(s, "config", n)));
var r = { type: "audio", cache: t.cacheManager.audio, extension: i.type, key: e, url: i.url, config: n };
o.call(this, t, r), (this.locked = "ontouchstart" in window), (this.loaded = !1), (this.filesLoaded = 0), (this.filesTotal = 0);
},
onLoad: function () {
this.loaded || ((this.loaded = !0), this.loader.nextFile(this, !0));
},
onError: function () {
for (var t = 0; t < this.data.length; t++) {
var e = this.data[t];
(e.oncanplaythrough = null), (e.onerror = null);
}
this.loader.nextFile(this, !1);
},
onProgress: function (t) {
var e = t.target;
(e.oncanplaythrough = null),
(e.onerror = null),
this.filesLoaded++,
(this.percentComplete = Math.min(this.filesLoaded / this.filesTotal, 1)),
this.loader.emit(s.FILE_PROGRESS, this, this.percentComplete),
this.filesLoaded === this.filesTotal && this.onLoad();
},
load: function () {
this.data = [];
var t = (this.config && this.config.instances) || 1;
(this.filesTotal = t), (this.filesLoaded = 0);
for (var e = (this.percentComplete = 0); e < t; e++) {
var i = new Audio();
i.dataset || (i.dataset = {}),
(i.dataset.name = this.key + ("0" + e).slice(-2)),
(i.dataset.used = "false"),
this.locked ? (i.dataset.locked = "true") : ((i.dataset.locked = "false"), (i.preload = "auto"), (i.oncanplaythrough = this.onProgress.bind(this)), (i.onerror = this.onError.bind(this))),
this.data.push(i);
}
for (e = 0; e < this.data.length; e++) ((i = this.data[e]).src = r(this, this.loader.baseURL)), this.locked || i.load();
this.locked && setTimeout(this.onLoad.bind(this));
},
});
t.exports = l;
},
function (t, e, i) {
var n = i(0),
s = i(21),
a = i(23),
r = i(8),
h = i(2),
l = i(7),
o = new n({
Extends: a,
initialize: function (t, e, i, n) {
var s,
r = "js";
l(e) && ((e = h((s = e), "key")), (i = h(s, "url")), (n = h(s, "xhrSettings")), (r = h(s, "extension", r)));
var o = { type: "script", cache: !1, extension: r, responseType: "text", key: e, url: i, xhrSettings: n };
a.call(this, t, o);
},
onProcess: function () {
(this.state = s.FILE_PROCESSING),
(this.data = document.createElement("script")),
(this.data.language = "javascript"),
(this.data.type = "text/javascript"),
(this.data.defer = !1),
(this.data.text = this.xhrLoader.responseText),
document.head.appendChild(this.data),
this.onProcessComplete();
},
});
r.register("script", function (t, e, i) {
if (Array.isArray(t)) for (var n = 0; n < t.length; n++) this.addFile(new o(this, t[n]));
else this.addFile(new o(this, t, e, i));
return this;
}),
(t.exports = o);
},
function (t, e, i) {
var r = i(522),
o = i(157),
n = i(0),
a = i(62),
s = i(524),
h = i(525),
l = new n({
initialize: function (t) {
(this.world = t), (this.scene = t.scene), (this.sys = t.scene.sys);
},
collider: function (t, e, i, n, s) {
return this.world.addCollider(t, e, i, n, s);
},
overlap: function (t, e, i, n, s) {
return this.world.addOverlap(t, e, i, n, s);
},
existing: function (t, e) {
var i = e ? a.STATIC_BODY : a.DYNAMIC_BODY;
return this.world.enableBody(t, i), t;
},
staticImage: function (t, e, i, n) {
var s = new r(this.scene, t, e, i, n);
return this.sys.displayList.add(s), this.world.enableBody(s, a.STATIC_BODY), s;
},
image: function (t, e, i, n) {
var s = new r(this.scene, t, e, i, n);
return this.sys.displayList.add(s), this.world.enableBody(s, a.DYNAMIC_BODY), s;
},
staticSprite: function (t, e, i, n) {
var s = new o(this.scene, t, e, i, n);
return this.sys.displayList.add(s), this.sys.updateList.add(s), this.world.enableBody(s, a.STATIC_BODY), s;
},
sprite: function (t, e, i, n) {
var s = new o(this.scene, t, e, i, n);
return this.sys.displayList.add(s), this.sys.updateList.add(s), this.world.enableBody(s, a.DYNAMIC_BODY), s;
},
staticGroup: function (t, e) {
return this.sys.updateList.add(new h(this.world, this.world.scene, t, e));
},
group: function (t, e) {
return this.sys.updateList.add(new s(this.world, this.world.scene, t, e));
},
destroy: function () {
(this.world = null), (this.scene = null), (this.sys = null);
},
});
t.exports = l;
},
function (t, e, i) {
var n = i(0),
s = i(243),
r = i(125),
o = new n({
Extends: r,
Mixins: [s.Acceleration, s.Angular, s.Bounce, s.Debug, s.Drag, s.Enable, s.Friction, s.Gravity, s.Immovable, s.Mass, s.Pushable, s.Size, s.Velocity],
initialize: function (t, e, i, n, s) {
r.call(this, t, e, i, n, s), (this.body = null);
},
});
t.exports = o;
},
function (t, e, i) {
var d = i(244),
f = i(65),
p = i(231),
g = i(151);
t.exports = function (t, e, i, n, s, r) {
var o = d(t, e - n, i - n, 2 * n, 2 * n, s, r);
if (0 === o.length) return o;
for (var a = new f(e, i, n), h = new f(), l = [], u = 0; u < o.length; u++) {
var c = o[u];
c.isCircle ? (h.setTo(c.center.x, c.center.y, c.halfWidth), p(a, h) && l.push(c)) : g(a, c) && l.push(c);
}
return l;
};
},
function (t, e, i) {
var r = i(157),
n = i(0),
o = i(62),
a = i(2),
h = i(113),
l = i(7),
s = new n({
Extends: h,
initialize: function (t, e, i, n) {
var s;
i || n
? l(i)
? ((n = i), (i = null), (n.internalCreateCallback = this.createCallbackHandler), (n.internalRemoveCallback = this.removeCallbackHandler))
: Array.isArray(i) && l(i[0])
? ((n = i[0]),
(s = this),
i.forEach(function (t) {
(t.internalCreateCallback = s.createCallbackHandler), (t.internalRemoveCallback = s.removeCallbackHandler);
}),
(i = null))
: (n = { internalCreateCallback: this.createCallbackHandler, internalRemoveCallback: this.removeCallbackHandler })
: (n = { internalCreateCallback: this.createCallbackHandler, internalRemoveCallback: this.removeCallbackHandler }),
(this.world = t),
(n.classType = a(n, "classType", r)),
(this.physicsType = o.DYNAMIC_BODY),
(this.defaults = {
setCollideWorldBounds: a(n, "collideWorldBounds", !1),
setBoundsRectangle: a(n, "customBoundsRectangle", null),
setAccelerationX: a(n, "accelerationX", 0),
setAccelerationY: a(n, "accelerationY", 0),
setAllowDrag: a(n, "allowDrag", !0),
setAllowGravity: a(n, "allowGravity", !0),
setAllowRotation: a(n, "allowRotation", !0),
setBounceX: a(n, "bounceX", 0),
setBounceY: a(n, "bounceY", 0),
setDragX: a(n, "dragX", 0),
setDragY: a(n, "dragY", 0),
setEnable: a(n, "enable", !0),
setGravityX: a(n, "gravityX", 0),
setGravityY: a(n, "gravityY", 0),
setFrictionX: a(n, "frictionX", 0),
setFrictionY: a(n, "frictionY", 0),
setMaxVelocityX: a(n, "maxVelocityX", 1e4),
setMaxVelocityY: a(n, "maxVelocityY", 1e4),
setVelocityX: a(n, "velocityX", 0),
setVelocityY: a(n, "velocityY", 0),
setAngularVelocity: a(n, "angularVelocity", 0),
setAngularAcceleration: a(n, "angularAcceleration", 0),
setAngularDrag: a(n, "angularDrag", 0),
setMass: a(n, "mass", 1),
setImmovable: a(n, "immovable", !1),
}),
h.call(this, e, i, n),
(this.type = "PhysicsGroup");
},
createCallbackHandler: function (t) {
t.body || this.world.enableBody(t, o.DYNAMIC_BODY);
var e = t.body;
for (var i in this.defaults) e[i](this.defaults[i]);
},
removeCallbackHandler: function (t) {
t.body && this.world.disableBody(t);
},
setVelocity: function (t, e, i) {
void 0 === i && (i = 0);
for (var n = this.getChildren(), s = 0; s < n.length; s++) n[s].body.velocity.set(t + s * i, e + s * i);
return this;
},
setVelocityX: function (t, e) {
void 0 === e && (e = 0);
for (var i = this.getChildren(), n = 0; n < i.length; n++) i[n].body.velocity.x = t + n * e;
return this;
},
setVelocityY: function (t, e) {
void 0 === e && (e = 0);
for (var i = this.getChildren(), n = 0; n < i.length; n++) i[n].body.velocity.y = t + n * e;
return this;
},
});
t.exports = s;
},
function (t, e, i) {
var s = i(157),
n = i(0),
r = i(62),
o = i(2),
a = i(113),
h = i(7),
l = new n({
Extends: a,
initialize: function (t, e, i, n) {
i || n
? h(i)
? ((n = i),
(i = null),
(n.internalCreateCallback = this.createCallbackHandler),
(n.internalRemoveCallback = this.removeCallbackHandler),
(n.createMultipleCallback = this.createMultipleCallbackHandler),
(n.classType = o(n, "classType", s)))
: Array.isArray(i) && h(i[0])
? ((n = i),
(i = null),
n.forEach(function (t) {
(t.internalCreateCallback = this.createCallbackHandler),
(t.internalRemoveCallback = this.removeCallbackHandler),
(t.createMultipleCallback = this.createMultipleCallbackHandler),
(t.classType = o(t, "classType", s));
}))
: (n = { internalCreateCallback: this.createCallbackHandler, internalRemoveCallback: this.removeCallbackHandler })
: (n = { internalCreateCallback: this.createCallbackHandler, internalRemoveCallback: this.removeCallbackHandler, createMultipleCallback: this.createMultipleCallbackHandler, classType: s }),
(this.world = t),
(this.physicsType = r.STATIC_BODY),
a.call(this, e, i, n),
(this.type = "StaticPhysicsGroup");
},
createCallbackHandler: function (t) {
t.body || this.world.enableBody(t, r.STATIC_BODY);
},
removeCallbackHandler: function (t) {
t.body && this.world.disableBody(t);
},
createMultipleCallbackHandler: function () {
this.refresh();
},
refresh: function () {
for (var t = this.children.entries, e = 0; e < t.length; e++) t[e].body.reset();
return this;
},
});
t.exports = l;
},
function (t, e, i) {
var v = i(350),
n = i(527),
p = i(18),
s = i(0),
o = i(528),
g = i(62),
y = i(50),
r = i(9),
m = i(245),
x = i(124),
b = i(354),
w = i(355),
T = i(246),
S = i(247),
_ = i(529),
a = i(6),
E = i(14),
h = i(211),
P = i(530),
l = i(10),
u = i(531),
A = i(532),
M = i(537),
C = i(538),
c = i(149),
d = i(539),
O = i(248),
f = i(25),
k = i(3),
R = i(68),
L = new s({
Extends: r,
initialize: function (t, e) {
r.call(this),
(this.scene = t),
(this.bodies = new c()),
(this.staticBodies = new c()),
(this.pendingDestroy = new c()),
(this.colliders = new h()),
(this.gravity = new k(a(e, "gravity.x", 0), a(e, "gravity.y", 0))),
(this.bounds = new l(a(e, "x", 0), a(e, "y", 0), a(e, "width", t.sys.scale.width), a(e, "height", t.sys.scale.height))),
(this.checkCollision = { up: a(e, "checkCollision.up", !0), down: a(e, "checkCollision.down", !0), left: a(e, "checkCollision.left", !0), right: a(e, "checkCollision.right", !0) }),
(this.fps = a(e, "fps", 60)),
(this.fixedStep = a(e, "fixedStep", !0)),
(this._elapsed = 0),
(this._frameTime = 1 / this.fps),
(this._frameTimeMS = 1e3 * this._frameTime),
(this.stepsLastFrame = 0),
(this.timeScale = a(e, "timeScale", 1)),
(this.OVERLAP_BIAS = a(e, "overlapBias", 4)),
(this.TILE_BIAS = a(e, "tileBias", 16)),
(this.forceX = a(e, "forceX", !1)),
(this.isPaused = a(e, "isPaused", !1)),
(this._total = 0),
(this.drawDebug = a(e, "debug", !1)),
this.debugGraphic,
(this.defaults = {
debugShowBody: a(e, "debugShowBody", !0),
debugShowStaticBody: a(e, "debugShowStaticBody", !0),
debugShowVelocity: a(e, "debugShowVelocity", !0),
bodyDebugColor: a(e, "debugBodyColor", 16711935),
staticBodyDebugColor: a(e, "debugStaticBodyColor", 255),
velocityDebugColor: a(e, "debugVelocityColor", 65280),
}),
(this.maxEntries = a(e, "maxEntries", 16)),
(this.useTree = a(e, "useTree", !0)),
(this.tree = new u(this.maxEntries)),
(this.staticTree = new u(this.maxEntries)),
(this.treeMinMax = { minX: 0, minY: 0, maxX: 0, maxY: 0 }),
(this._tempMatrix = new f()),
(this._tempMatrix2 = new f()),
this.drawDebug && this.createDebugGraphic();
},
enable: function (t, e) {
void 0 === e && (e = g.DYNAMIC_BODY), Array.isArray(t) || (t = [t]);
for (var i = 0; i < t.length; i++) {
var n = t[i];
if (n.isParent)
for (var s = n.getChildren(), r = 0; r < s.length; r++) {
var o = s[r];
o.isParent ? this.enable(o, e) : this.enableBody(o, e);
}
else this.enableBody(n, e);
}
},
enableBody: function (t, e) {
return void 0 === e && (e = g.DYNAMIC_BODY), t.body || (e === g.DYNAMIC_BODY ? (t.body = new n(this, t)) : e === g.STATIC_BODY && (t.body = new d(this, t))), this.add(t.body), t;
},
add: function (t) {
return t.physicsType === g.DYNAMIC_BODY ? this.bodies.set(t) : t.physicsType === g.STATIC_BODY && (this.staticBodies.set(t), this.staticTree.insert(t)), (t.enable = !0), t;
},
disable: function (t) {
Array.isArray(t) || (t = [t]);
for (var e = 0; e < t.length; e++) {
var i = t[e];
if (i.isParent)
for (var n = i.getChildren(), s = 0; s < n.length; s++) {
var r = n[s];
r.isParent ? this.disable(r) : this.disableBody(r.body);
}
else this.disableBody(i.body);
}
},
disableBody: function (t) {
this.remove(t), (t.enable = !1);
},
remove: function (t) {
t.physicsType === g.DYNAMIC_BODY ? (this.tree.remove(t), this.bodies.delete(t)) : t.physicsType === g.STATIC_BODY && (this.staticBodies.delete(t), this.staticTree.remove(t));
},
createDebugGraphic: function () {
var t = this.scene.sys.add.graphics({ x: 0, y: 0 });
return t.setDepth(Number.MAX_VALUE), (this.debugGraphic = t), (this.drawDebug = !0), t;
},
setBounds: function (t, e, i, n, s, r, o, a) {
return this.bounds.setTo(t, e, i, n), void 0 !== s && this.setBoundsCollision(s, r, o, a), this;
},
setBoundsCollision: function (t, e, i, n) {
return (
void 0 === t && (t = !0),
void 0 === e && (e = !0),
void 0 === i && (i = !0),
void 0 === n && (n = !0),
(this.checkCollision.left = t),
(this.checkCollision.right = e),
(this.checkCollision.up = i),
(this.checkCollision.down = n),
this
);
},
pause: function () {
return (this.isPaused = !0), this.emit(m.PAUSE), this;
},
resume: function () {
return (this.isPaused = !1), this.emit(m.RESUME), this;
},
addCollider: function (t, e, i, n, s) {
void 0 === i && (i = null), void 0 === n && (n = null), void 0 === s && (s = i);
var r = new o(this, !1, t, e, i, n, s);
return this.colliders.add(r), r;
},
addOverlap: function (t, e, i, n, s) {
void 0 === i && (i = null), void 0 === n && (n = null), void 0 === s && (s = i);
var r = new o(this, !0, t, e, i, n, s);
return this.colliders.add(r), r;
},
removeCollider: function (t) {
return this.colliders.remove(t), this;
},
setFPS: function (t) {
return (this.fps = t), (this._frameTime = 1 / this.fps), (this._frameTimeMS = 1e3 * this._frameTime), this;
},
update: function (t, e) {
if (!this.isPaused && 0 !== this.bodies.size) {
var i,
n = this._frameTime,
s = this._frameTimeMS * this.timeScale;
this._elapsed += e;
var r = this.bodies.entries,
o = this._elapsed >= s;
for (this.fixedStep || ((n = 0.001 * e), (o = !0), (this._elapsed = 0)), h = 0; h < r.length; h++) (i = r[h]).enable && i.preUpdate(o, n);
if (o) {
(this._elapsed -= s), (this.stepsLastFrame = 1), this.useTree && (this.tree.clear(), this.tree.load(r));
for (var a = this.colliders.update(), h = 0; h < a.length; h++) {
var l = a[h];
l.active && l.update();
}
this.emit(m.WORLD_STEP, n);
}
for (; this._elapsed >= s; ) (this._elapsed -= s), this.step(n);
}
},
step: function (t) {
for (var e, i = this.bodies.entries, n = i.length, s = 0; s < n; s++) (e = i[s]).enable && e.update(t);
this.useTree && (this.tree.clear(), this.tree.load(i));
var r = this.colliders.update();
for (s = 0; s < r.length; s++) {
var o = r[s];
o.active && o.update();
}
this.emit(m.WORLD_STEP, t), this.stepsLastFrame++;
},
postUpdate: function () {
var t,
e = (o = this.bodies.entries).length,
i = this.bodies,
n = this.staticBodies;
if (this.stepsLastFrame) for (l = this.stepsLastFrame = 0; l < e; l++) (t = o[l]).enable && t.postUpdate();
if (this.drawDebug) {
var s = this.debugGraphic;
for (s.clear(), l = 0; l < e; l++) (t = o[l]).willDrawDebug() && t.drawDebug(s);
for (e = (o = n.entries).length, l = 0; l < e; l++) (t = o[l]).willDrawDebug() && t.drawDebug(s);
}
var r = this.pendingDestroy;
if (0 < r.size) {
for (var o, a = this.tree, h = this.staticTree, l = ((e = (o = r.entries).length), 0); l < e; l++)
(t = o[l]).physicsType === g.DYNAMIC_BODY ? (a.remove(t), i.delete(t)) : t.physicsType === g.STATIC_BODY && (h.remove(t), n.delete(t)), (t.world = void 0), (t.gameObject = void 0);
r.clear();
}
},
updateMotion: function (t, e) {
t.allowRotation && this.computeAngularVelocity(t, e), this.computeVelocity(t, e);
},
computeAngularVelocity: function (t, e) {
var i = t.angularVelocity,
n = t.angularAcceleration,
s = t.angularDrag,
r = t.maxAngular;
n ? (i += n * e) : t.allowDrag && s && (b(i - (s *= e), 0, 0.1) ? (i -= s) : w(i + s, 0, 0.1) ? (i += s) : (i = 0));
var o = (i = p(i, -r, r)) - t.angularVelocity;
(t.angularVelocity += o), (t.rotation += t.angularVelocity * e);
},
computeVelocity: function (t, e) {
var i = t.velocity.x,
n = t.acceleration.x,
s = t.drag.x,
r = t.maxVelocity.x,
o = t.velocity.y,
a = t.acceleration.y,
h = t.drag.y,
l = t.maxVelocity.y,
u = t.speed,
c = t.maxSpeed,
d = t.allowDrag,
f = t.useDamping;
t.allowGravity && ((i += (this.gravity.x + t.gravity.x) * e), (o += (this.gravity.y + t.gravity.y) * e)),
n
? (i += n * e)
: d && s && (f ? ((i *= s = Math.pow(s, e)), (u = Math.sqrt(i * i + o * o)), x(u, 0, 0.001) && (i = 0)) : b(i - (s *= e), 0, 0.01) ? (i -= s) : w(i + s, 0, 0.01) ? (i += s) : (i = 0)),
a
? (o += a * e)
: d && h && (f ? ((o *= h = Math.pow(h, e)), (u = Math.sqrt(i * i + o * o)), x(u, 0, 0.001) && (o = 0)) : b(o - (h *= e), 0, 0.01) ? (o -= h) : w(o + h, 0, 0.01) ? (o += h) : (o = 0)),
(i = p(i, -r, r)),
(o = p(o, -l, l)),
t.velocity.set(i, o),
-1 < c && c < u && (t.velocity.normalize().scale(c), (u = c)),
(t.speed = u);
},
separate: function (t, e, i, n, s, r) {
if ((!r && !t.enable) || !e.enable || t.checkCollision.none || e.checkCollision.none || !this.intersects(t, e)) return !1;
if (i && !1 === i.call(n, t.gameObject, e.gameObject)) return !1;
if (t.isCircle && e.isCircle) return this.separateCircle(t, e, s);
if (t.isCircle !== e.isCircle) {
var o = t.isCircle ? e : t,
a = t.isCircle ? t : e,
h = o.x,
l = o.y,
u = o.right,
c = o.bottom,
d = a.center;
if ((d.y < l || d.y > c) && (d.x < h || d.x > u)) return this.separateCircle(t, e, s);
}
var f = !1,
p = !1;
s
? ((f = M(t, e, s, this.OVERLAP_BIAS)), (p = C(t, e, s, this.OVERLAP_BIAS)))
: this.forceX || Math.abs(this.gravity.y + t.gravity.y) < Math.abs(this.gravity.x + t.gravity.x)
? ((f = M(t, e, s, this.OVERLAP_BIAS)), this.intersects(t, e) && (p = C(t, e, s, this.OVERLAP_BIAS)))
: ((p = C(t, e, s, this.OVERLAP_BIAS)), this.intersects(t, e) && (f = M(t, e, s, this.OVERLAP_BIAS)));
var g = f || p;
return g && (s ? (t.onOverlap || e.onOverlap) && this.emit(m.OVERLAP, t.gameObject, e.gameObject, t, e) : (t.onCollide || e.onCollide) && this.emit(m.COLLIDE, t.gameObject, e.gameObject, t, e)), g;
},
separateCircle: function (t, e, i, n) {
T(t, e, !1, n), S(t, e, !1, n);
var s,
r,
o = 0;
if (
(t.isCircle !== e.isCircle
? ((s = { x: e.isCircle ? t.position.x : e.position.x, y: e.isCircle ? t.position.y : e.position.y, right: e.isCircle ? t.right : e.right, bottom: e.isCircle ? t.bottom : e.bottom }),
(r = { x: t.isCircle ? t.center.x : e.center.x, y: t.isCircle ? t.center.y : e.center.y, radius: t.isCircle ? t.halfWidth : e.halfWidth }).y < s.y
? r.x < s.x
? (o = y(r.x, r.y, s.x, s.y) - r.radius)
: s.right < r.x && (o = y(r.x, r.y, s.right, s.y) - r.radius)
: s.bottom < r.y && (r.x < s.x ? (o = y(r.x, r.y, s.x, s.bottom) - r.radius) : s.right < r.x && (o = y(r.x, r.y, s.right, s.bottom) - r.radius)),
(o *= -1))
: (o = t.halfWidth + e.halfWidth - y(t.center.x, t.center.y, e.center.x, e.center.y)),
(t.overlapR = o),
(e.overlapR = o),
i || 0 === o || (t.immovable && e.immovable) || t.customSeparateX || e.customSeparateX)
)
return 0 !== o && (t.onOverlap || e.onOverlap) && this.emit(m.OVERLAP, t.gameObject, e.gameObject, t, e), 0 !== o;
var a = t.center.x - e.center.x,
h = t.center.y - e.center.y,
l = Math.sqrt(Math.pow(a, 2) + Math.pow(h, 2)),
u = (e.center.x - t.center.x) / l || 0,
c = (e.center.y - t.center.y) / l || 0,
d = (2 * (t.velocity.x * u + t.velocity.y * c - e.velocity.x * u - e.velocity.y * c)) / (t.mass + e.mass);
(t.immovable || e.immovable) && (d *= 2),
t.immovable || ((t.velocity.x = t.velocity.x - (d / t.mass) * u), (t.velocity.y = t.velocity.y - (d / t.mass) * c)),
e.immovable || ((e.velocity.x = e.velocity.x + (d / e.mass) * u), (e.velocity.y = e.velocity.y + (d / e.mass) * c)),
t.immovable || e.immovable || (o /= 2);
var f = v(t.center, e.center),
p = (o + E.EPSILON) * Math.cos(f),
g = (o + E.EPSILON) * Math.sin(f);
return (
t.immovable || ((t.x -= p), (t.y -= g), t.updateCenter()),
e.immovable || ((e.x += p), (e.y += g), e.updateCenter()),
(t.velocity.x *= t.bounce.x),
(t.velocity.y *= t.bounce.y),
(e.velocity.x *= e.bounce.x),
(e.velocity.y *= e.bounce.y),
(t.onCollide || e.onCollide) && this.emit(m.COLLIDE, t.gameObject, e.gameObject, t, e),
!0
);
},
intersects: function (t, e) {
return (
t !== e &&
(t.isCircle || e.isCircle
? t.isCircle
? e.isCircle
? y(t.center.x, t.center.y, e.center.x, e.center.y) <= t.halfWidth + e.halfWidth
: this.circleBodyIntersects(t, e)
: this.circleBodyIntersects(e, t)
: !(t.right <= e.position.x || t.bottom <= e.position.y || t.position.x >= e.right || t.position.y >= e.bottom))
);
},
circleBodyIntersects: function (t, e) {
var i = p(t.center.x, e.left, e.right),
n = p(t.center.y, e.top, e.bottom);
return (t.center.x - i) * (t.center.x - i) + (t.center.y - n) * (t.center.y - n) <= t.halfWidth * t.halfWidth;
},
overlap: function (t, e, i, n, s) {
return void 0 === i && (i = null), void 0 === n && (n = null), void 0 === s && (s = i), this.collideObjects(t, e, i, n, s, !0);
},
collide: function (t, e, i, n, s) {
return void 0 === i && (i = null), void 0 === n && (n = null), void 0 === s && (s = i), this.collideObjects(t, e, i, n, s, !1);
},
collideObjects: function (t, e, i, n, s, r) {
var o;
t.isParent && void 0 === t.physicsType && (t = t.children.entries), e && e.isParent && void 0 === e.physicsType && (e = e.children.entries);
var a = Array.isArray(t),
h = Array.isArray(e);
if (((this._total = 0), a || h))
if (!a && h) for (o = 0; o < e.length; o++) this.collideHandler(t, e[o], i, n, s, r);
else if (a && !h)
if (e) for (o = 0; o < t.length; o++) this.collideHandler(t[o], e, i, n, s, r);
else for (o = 0; o < t.length; o++) for (var l = t[o], u = o + 1; u < t.length; u++) o !== u && this.collideHandler(l, t[u], i, n, s, r);
else for (o = 0; o < t.length; o++) for (u = 0; u < e.length; u++) this.collideHandler(t[o], e[u], i, n, s, r);
else this.collideHandler(t, e, i, n, s, r);
return 0 < this._total;
},
collideHandler: function (t, e, i, n, s, r) {
if (void 0 === e && t.isParent) return this.collideGroupVsGroup(t, t, i, n, s, r);
if (!t || !e) return !1;
if (t.body) {
if (e.body) return this.collideSpriteVsSprite(t, e, i, n, s, r);
if (e.isParent) return this.collideSpriteVsGroup(t, e, i, n, s, r);
if (e.isTilemap) return this.collideSpriteVsTilemapLayer(t, e, i, n, s, r);
} else if (t.isParent) {
if (e.body) return this.collideSpriteVsGroup(e, t, i, n, s, r);
if (e.isParent) return this.collideGroupVsGroup(t, e, i, n, s, r);
if (e.isTilemap) return this.collideGroupVsTilemapLayer(t, e, i, n, s, r);
} else if (t.isTilemap) {
if (e.body) return this.collideSpriteVsTilemapLayer(e, t, i, n, s, r);
if (e.isParent) return this.collideGroupVsTilemapLayer(e, t, i, n, s, r);
}
},
collideSpriteVsSprite: function (t, e, i, n, s, r) {
return !(!t.body || !e.body || (this.separate(t.body, e.body, n, s, r) && (i && i.call(s, t, e), this._total++), 0));
},
collideSpriteVsGroup: function (t, e, i, n, s, r) {
var o,
a = t.body;
if (0 !== e.length && a && a.enable && !a.checkCollision.none)
if (this.useTree || e.physicsType === g.STATIC_BODY) {
var h = this.treeMinMax;
(h.minX = a.left), (h.minY = a.top), (h.maxX = a.right), (h.maxY = a.bottom);
for (var l = e.physicsType === g.DYNAMIC_BODY ? this.tree.search(h) : this.staticTree.search(h), u = l.length, c = 0; c < u; c++)
a !== (o = l[c]) && o.enable && !o.checkCollision.none && e.contains(o.gameObject) && this.separate(a, o, n, s, r, !0) && (i && i.call(s, a.gameObject, o.gameObject), this._total++);
} else {
var d = e.getChildren(),
f = e.children.entries.indexOf(t);
for (u = d.length, c = 0; c < u; c++) (o = d[c].body) && c !== f && o.enable && this.separate(a, o, n, s, r) && (i && i.call(s, a.gameObject, o.gameObject), this._total++);
}
},
collideGroupVsTilemapLayer: function (t, e, i, n, s, r) {
var o = t.getChildren();
if (0 === o.length) return !1;
for (var a = !1, h = 0; h < o.length; h++) o[h].body && this.collideSpriteVsTilemapLayer(o[h], e, i, n, s, r) && (a = !0);
return a;
},
collideTiles: function (t, e, i, n, s) {
return !(!t.body.enable || 0 === e.length) && this.collideSpriteVsTilesHandler(t, e, i, n, s, !1, !1);
},
overlapTiles: function (t, e, i, n, s) {
return !(!t.body.enable || 0 === e.length) && this.collideSpriteVsTilesHandler(t, e, i, n, s, !0, !1);
},
collideSpriteVsTilemapLayer: function (t, e, i, n, s, r) {
var o = t.body;
if (!o.enable || o.checkCollision.none) return !1;
var a,
h = o.position.x,
l = o.position.y,
u = o.width,
c = o.height,
d = e.layer;
d.tileWidth > d.baseTileWidth && ((h -= a = (d.tileWidth - d.baseTileWidth) * e.scaleX), (u += a)), d.tileHeight > d.baseTileHeight && (c += (d.tileHeight - d.baseTileHeight) * e.scaleY);
var f = _(h, l, u, c, null, e.scene.cameras.main, e.layer);
return 0 !== f.length && this.collideSpriteVsTilesHandler(t, f, i, n, s, r, !0);
},
collideSpriteVsTilesHandler: function (t, e, i, n, s, r, o) {
for (var a, h, l = t.body, u = { left: 0, right: 0, top: 0, bottom: 0 }, c = !1, d = 0; d < e.length; d++) {
var f = (h = (a = e[d]).tilemapLayer).tileToWorldXY(a.x, a.y);
(u.left = f.x),
(u.top = f.y),
a.baseHeight !== a.height && (u.top -= (a.height - a.baseHeight) * h.scaleY),
(u.right = u.left + a.width * h.scaleX),
(u.bottom = u.top + a.height * h.scaleY),
O(u, l) &&
(!n || n.call(s, t, a)) &&
P(a, t) &&
(r || A(d, l, a, u, h, this.TILE_BIAS, o)) &&
(this._total++, (c = !0), i && i.call(s, t, a), r && l.onOverlap ? this.emit(m.TILE_OVERLAP, t, a, l) : l.onCollide && this.emit(m.TILE_COLLIDE, t, a, l));
}
return c;
},
collideGroupVsGroup: function (t, e, i, n, s, r) {
if (0 !== t.length && 0 !== e.length) for (var o = t.getChildren(), a = 0; a < o.length; a++) this.collideSpriteVsGroup(o[a], e, i, n, s, r);
},
wrap: function (t, e) {
t.body ? this.wrapObject(t, e) : t.getChildren ? this.wrapArray(t.getChildren(), e) : Array.isArray(t) ? this.wrapArray(t, e) : this.wrapObject(t, e);
},
wrapArray: function (t, e) {
for (var i = 0; i < t.length; i++) this.wrapObject(t[i], e);
},
wrapObject: function (t, e) {
void 0 === e && (e = 0), (t.x = R(t.x, this.bounds.left - e, this.bounds.right + e)), (t.y = R(t.y, this.bounds.top - e, this.bounds.bottom + e));
},
shutdown: function () {
this.tree.clear(), this.staticTree.clear(), this.bodies.clear(), this.staticBodies.clear(), this.colliders.destroy(), this.removeAllListeners();
},
destroy: function () {
this.shutdown(), (this.scene = null);
},
});
t.exports = L;
},
function (t, e, i) {
var n = i(0),
s = i(62),
r = i(245),
a = i(196),
o = i(10),
h = i(57),
l = i(3),
u = new n({
initialize: function (t, e) {
var i = e.displayWidth ? e.displayWidth : 64,
n = e.displayHeight ? e.displayHeight : 64;
(this.world = t),
(this.gameObject = e),
(this.transform = { x: e.x, y: e.y, rotation: e.angle, scaleX: e.scaleX, scaleY: e.scaleY, displayOriginX: e.displayOriginX, displayOriginY: e.displayOriginY }),
(this.debugShowBody = t.defaults.debugShowBody),
(this.debugShowVelocity = t.defaults.debugShowVelocity),
(this.debugBodyColor = t.defaults.bodyDebugColor),
(this.enable = !0),
(this.isCircle = !1),
(this.radius = 0),
(this.offset = new l()),
(this.position = new l(e.x - e.scaleX * e.displayOriginX, e.y - e.scaleY * e.displayOriginY)),
(this.prev = this.position.clone()),
(this.prevFrame = this.position.clone()),
(this.allowRotation = !0),
(this.rotation = e.angle),
(this.preRotation = e.angle),
(this.width = i),
(this.height = n),
(this.sourceWidth = i),
(this.sourceHeight = n),
e.frame && ((this.sourceWidth = e.frame.realWidth), (this.sourceHeight = e.frame.realHeight)),
(this.halfWidth = Math.abs(i / 2)),
(this.halfHeight = Math.abs(n / 2)),
(this.center = new l(this.position.x + this.halfWidth, this.position.y + this.halfHeight)),
(this.velocity = new l()),
(this.newVelocity = new l()),
(this.deltaMax = new l()),
(this.acceleration = new l()),
(this.allowDrag = !0),
(this.drag = new l()),
(this.allowGravity = !0),
(this.gravity = new l()),
(this.bounce = new l()),
(this.worldBounce = null),
(this.customBoundsRectangle = t.bounds),
(this.onWorldBounds = !1),
(this.onCollide = !1),
(this.onOverlap = !1),
(this.maxVelocity = new l(1e4, 1e4)),
(this.maxSpeed = -1),
(this.friction = new l(1, 0)),
(this.useDamping = !1),
(this.angularVelocity = 0),
(this.angularAcceleration = 0),
(this.angularDrag = 0),
(this.maxAngular = 1e3),
(this.mass = 1),
(this.angle = 0),
(this.speed = 0),
(this.facing = s.FACING_NONE),
(this.immovable = !1),
(this.pushable = !0),
(this.moves = !0),
(this.customSeparateX = !1),
(this.customSeparateY = !1),
(this.overlapX = 0),
(this.overlapY = 0),
(this.overlapR = 0),
(this.embedded = !1),
(this.collideWorldBounds = !1),
(this.checkCollision = { none: !1, up: !0, down: !0, left: !0, right: !0 }),
(this.touching = { none: !0, up: !1, down: !1, left: !1, right: !1 }),
(this.wasTouching = { none: !0, up: !1, down: !1, left: !1, right: !1 }),
(this.blocked = { none: !0, up: !1, down: !1, left: !1, right: !1 }),
(this.syncBounds = !1),
(this.physicsType = s.DYNAMIC_BODY),
(this._sx = e.scaleX),
(this._sy = e.scaleY),
(this._dx = 0),
(this._dy = 0),
(this._tx = 0),
(this._ty = 0),
(this._bounds = new o());
},
updateBounds: function () {
var t,
e = this.gameObject,
i = this.transform;
e.parentContainer
? ((t = e.getWorldTransformMatrix(this.world._tempMatrix, this.world._tempMatrix2)), (i.x = t.tx), (i.y = t.ty), (i.rotation = a(t.rotation)), (i.scaleX = t.scaleX), (i.scaleY = t.scaleY))
: ((i.x = e.x), (i.y = e.y), (i.rotation = e.angle), (i.scaleX = e.scaleX), (i.scaleY = e.scaleY)),
(i.displayOriginX = e.displayOriginX),
(i.displayOriginY = e.displayOriginY);
var n,
s,
r,
o = !1;
this.syncBounds
? ((n = e.getBounds(this._bounds)), (this.width = n.width), (this.height = n.height), (o = !0))
: ((s = Math.abs(i.scaleX)),
(r = Math.abs(i.scaleY)),
(this._sx === s && this._sy === r) || ((this.width = this.sourceWidth * s), (this.height = this.sourceHeight * r), (this._sx = s), (this._sy = r), (o = !0))),
o && ((this.halfWidth = Math.floor(this.width / 2)), (this.halfHeight = Math.floor(this.height / 2)), this.updateCenter());
},
updateCenter: function () {
this.center.set(this.position.x + this.halfWidth, this.position.y + this.halfHeight);
},
updateFromGameObject: function () {
this.updateBounds();
var t = this.transform;
(this.position.x = t.x + t.scaleX * (this.offset.x - t.displayOriginX)), (this.position.y = t.y + t.scaleY * (this.offset.y - t.displayOriginY)), this.updateCenter();
},
resetFlags: function (t) {
void 0 === t && (t = !1);
var e = this.wasTouching,
i = this.touching,
n = this.blocked;
t ? ((e.none = !0), (e.up = !1), (e.down = !1), (e.left = !1), (e.right = !1)) : ((e.none = i.none), (e.up = i.up), (e.down = i.down), (e.left = i.left), (e.right = i.right)),
(i.none = !0),
(i.up = !1),
(i.down = !1),
(i.left = !1),
(i.right = !1),
(n.none = !0),
(n.up = !1),
(n.down = !1),
(n.left = !1),
(n.right = !1),
(this.overlapR = 0),
(this.overlapX = 0),
(this.overlapY = 0),
(this.embedded = !1);
},
preUpdate: function (t, e) {
t && this.resetFlags(),
this.updateFromGameObject(),
(this.rotation = this.transform.rotation),
(this.preRotation = this.rotation),
this.moves && ((this.prev.x = this.position.x), (this.prev.y = this.position.y), (this.prevFrame.x = this.position.x), (this.prevFrame.y = this.position.y)),
t && this.update(e);
},
update: function (t) {
var e, i;
(this.prev.x = this.position.x),
(this.prev.y = this.position.y),
this.moves &&
(this.world.updateMotion(this, t),
(e = this.velocity.x),
(i = this.velocity.y),
this.newVelocity.set(e * t, i * t),
this.position.add(this.newVelocity),
this.updateCenter(),
(this.angle = Math.atan2(i, e)),
(this.speed = Math.sqrt(e * e + i * i)),
this.collideWorldBounds && this.checkWorldBounds() && this.onWorldBounds && this.world.emit(r.WORLD_BOUNDS, this, this.blocked.up, this.blocked.down, this.blocked.left, this.blocked.right)),
(this._dx = this.position.x - this.prev.x),
(this._dy = this.position.y - this.prev.y);
},
postUpdate: function () {
var t,
e,
i = this.position.x - this.prevFrame.x,
n = this.position.y - this.prevFrame.y;
this.moves &&
(0 !== (t = this.deltaMax.x) && 0 !== i && (i < 0 && i < -t ? (i = -t) : 0 < i && t < i && (i = t)),
0 !== (e = this.deltaMax.y) && 0 !== n && (n < 0 && n < -e ? (n = -e) : 0 < n && e < n && (n = e)),
(this.gameObject.x += i),
(this.gameObject.y += n)),
i < 0 ? (this.facing = s.FACING_LEFT) : 0 < i && (this.facing = s.FACING_RIGHT),
n < 0 ? (this.facing = s.FACING_UP) : 0 < n && (this.facing = s.FACING_DOWN),
this.allowRotation && (this.gameObject.angle += this.deltaZ()),
(this._tx = i),
(this._ty = n);
},
setBoundsRectangle: function (t) {
return (this.customBoundsRectangle = t || this.world.bounds), this;
},
checkWorldBounds: function () {
var t = this.position,
e = this.customBoundsRectangle,
i = this.world.checkCollision,
n = this.worldBounce ? -this.worldBounce.x : -this.bounce.x,
s = this.worldBounce ? -this.worldBounce.y : -this.bounce.y,
r = !1;
return (
t.x < e.x && i.left
? ((t.x = e.x), (this.velocity.x *= n), (r = this.blocked.left = !0))
: this.right > e.right && i.right && ((t.x = e.right - this.width), (this.velocity.x *= n), (r = this.blocked.right = !0)),
t.y < e.y && i.up
? ((t.y = e.y), (this.velocity.y *= s), (r = this.blocked.up = !0))
: this.bottom > e.bottom && i.down && ((t.y = e.bottom - this.height), (this.velocity.y *= s), (r = this.blocked.down = !0)),
r && ((this.blocked.none = !1), this.updateCenter()),
r
);
},
setOffset: function (t, e) {
return void 0 === e && (e = t), this.offset.set(t, e), this;
},
setSize: function (t, e, i) {
void 0 === i && (i = !0);
var n,
s,
r = this.gameObject;
return (
!t && r.frame && (t = r.frame.realWidth),
!e && r.frame && (e = r.frame.realHeight),
(this.sourceWidth = t),
(this.sourceHeight = e),
(this.width = this.sourceWidth * this._sx),
(this.height = this.sourceHeight * this._sy),
(this.halfWidth = Math.floor(this.width / 2)),
(this.halfHeight = Math.floor(this.height / 2)),
this.updateCenter(),
i && r.getCenter && ((n = (r.width - t) / 2), (s = (r.height - e) / 2), this.offset.set(n, s)),
(this.isCircle = !1),
(this.radius = 0),
this
);
},
setCircle: function (t, e, i) {
return (
void 0 === e && (e = this.offset.x),
void 0 === i && (i = this.offset.y),
0 < t
? ((this.isCircle = !0),
(this.radius = t),
(this.sourceWidth = 2 * t),
(this.sourceHeight = 2 * t),
(this.width = this.sourceWidth * this._sx),
(this.height = this.sourceHeight * this._sy),
(this.halfWidth = Math.floor(this.width / 2)),
(this.halfHeight = Math.floor(this.height / 2)),
this.offset.set(e, i),
this.updateCenter())
: (this.isCircle = !1),
this
);
},
reset: function (t, e) {
this.stop();
var i = this.gameObject;
i.setPosition(t, e),
i.getTopLeft ? i.getTopLeft(this.position) : this.position.set(t, e),
this.prev.copy(this.position),
this.prevFrame.copy(this.position),
(this.rotation = i.angle),
(this.preRotation = i.angle),
this.updateBounds(),
this.updateCenter(),
this.resetFlags(!0);
},
stop: function () {
return this.velocity.set(0), this.acceleration.set(0), (this.speed = 0), (this.angularVelocity = 0), (this.angularAcceleration = 0), this;
},
getBounds: function (t) {
return (t.x = this.x), (t.y = this.y), (t.right = this.right), (t.bottom = this.bottom), t;
},
hitTest: function (t, e) {
return this.isCircle
? 0 < this.radius &&
t >= this.left &&
t <= this.right &&
e >= this.top &&
e <= this.bottom &&
(this.center.x - t) * (this.center.x - t) + (this.center.y - e) * (this.center.y - e) <= this.radius * this.radius
: h(this, t, e);
},
onFloor: function () {
return this.blocked.down;
},
onCeiling: function () {
return this.blocked.up;
},
onWall: function () {
return this.blocked.left || this.blocked.right;
},
deltaAbsX: function () {
return 0 < this._dx ? this._dx : -this._dx;
},
deltaAbsY: function () {
return 0 < this._dy ? this._dy : -this._dy;
},
deltaX: function () {
return this._dx;
},
deltaY: function () {
return this._dy;
},
deltaXFinal: function () {
return this._tx;
},
deltaYFinal: function () {
return this._ty;
},
deltaZ: function () {
return this.rotation - this.preRotation;
},
destroy: function () {
(this.enable = !1), this.world && this.world.pendingDestroy.set(this);
},
drawDebug: function (t) {
var e = this.position,
i = e.x + this.halfWidth,
n = e.y + this.halfHeight;
this.debugShowBody &&
(t.lineStyle(t.defaultStrokeWidth, this.debugBodyColor),
this.isCircle
? t.strokeCircle(i, n, this.width / 2)
: (this.checkCollision.up && t.lineBetween(e.x, e.y, e.x + this.width, e.y),
this.checkCollision.right && t.lineBetween(e.x + this.width, e.y, e.x + this.width, e.y + this.height),
this.checkCollision.down && t.lineBetween(e.x, e.y + this.height, e.x + this.width, e.y + this.height),
this.checkCollision.left && t.lineBetween(e.x, e.y, e.x, e.y + this.height))),
this.debugShowVelocity && (t.lineStyle(t.defaultStrokeWidth, this.world.defaults.velocityDebugColor, 1), t.lineBetween(i, n, i + this.velocity.x / 2, n + this.velocity.y / 2));
},
willDrawDebug: function () {
return this.debugShowBody || this.debugShowVelocity;
},
setCollideWorldBounds: function (t, e, i, n) {
void 0 === t && (t = !0), (this.collideWorldBounds = t);
var s = void 0 !== e,
r = void 0 !== i;
return (s || r) && (this.worldBounce || (this.worldBounce = new l()), s && (this.worldBounce.x = e), r && (this.worldBounce.y = i)), void 0 !== n && (this.onWorldBounds = n), this;
},
setVelocity: function (t, e) {
return this.velocity.set(t, e), (t = this.velocity.x), (e = this.velocity.y), (this.speed = Math.sqrt(t * t + e * e)), this;
},
setVelocityX: function (t) {
this.velocity.x = t;
var e = this.velocity.y;
return (this.speed = Math.sqrt(t * t + e * e)), this;
},
setVelocityY: function (t) {
this.velocity.y = t;
var e = this.velocity.x;
return (this.speed = Math.sqrt(e * e + t * t)), this;
},
setMaxVelocity: function (t, e) {
return this.maxVelocity.set(t, e), this;
},
setMaxVelocityX: function (t) {
return (this.maxVelocity.x = t), this;
},
setMaxVelocityY: function (t) {
return (this.maxVelocity.y = t), this;
},
setMaxSpeed: function (t) {
return (this.maxSpeed = t), this;
},
setBounce: function (t, e) {
return this.bounce.set(t, e), this;
},
setBounceX: function (t) {
return (this.bounce.x = t), this;
},
setBounceY: function (t) {
return (this.bounce.y = t), this;
},
setAcceleration: function (t, e) {
return this.acceleration.set(t, e), this;
},
setAccelerationX: function (t) {
return (this.acceleration.x = t), this;
},
setAccelerationY: function (t) {
return (this.acceleration.y = t), this;
},
setAllowDrag: function (t) {
return void 0 === t && (t = !0), (this.allowDrag = t), this;
},
setAllowGravity: function (t) {
return void 0 === t && (t = !0), (this.allowGravity = t), this;
},
setAllowRotation: function (t) {
return void 0 === t && (t = !0), (this.allowRotation = t), this;
},
setDrag: function (t, e) {
return this.drag.set(t, e), this;
},
setDamping: function (t) {
return (this.useDamping = t), this;
},
setDragX: function (t) {
return (this.drag.x = t), this;
},
setDragY: function (t) {
return (this.drag.y = t), this;
},
setGravity: function (t, e) {
return this.gravity.set(t, e), this;
},
setGravityX: function (t) {
return (this.gravity.x = t), this;
},
setGravityY: function (t) {
return (this.gravity.y = t), this;
},
setFriction: function (t, e) {
return this.friction.set(t, e), this;
},
setFrictionX: function (t) {
return (this.friction.x = t), this;
},
setFrictionY: function (t) {
return (this.friction.y = t), this;
},
setAngularVelocity: function (t) {
return (this.angularVelocity = t), this;
},
setAngularAcceleration: function (t) {
return (this.angularAcceleration = t), this;
},
setAngularDrag: function (t) {
return (this.angularDrag = t), this;
},
setMass: function (t) {
return (this.mass = t), this;
},
setImmovable: function (t) {
return void 0 === t && (t = !0), (this.immovable = t), this;
},
setEnable: function (t) {
return void 0 === t && (t = !0), (this.enable = t), this;
},
processX: function (t, e, i, n) {
(this.x += t), this.updateCenter(), null !== e && (this.velocity.x = e);
var s = this.blocked;
i && (s.left = !0), n && (s.right = !0);
},
processY: function (t, e, i, n) {
(this.y += t), this.updateCenter(), null !== e && (this.velocity.y = e);
var s = this.blocked;
i && (s.up = !0), n && (s.down = !0);
},
x: {
get: function () {
return this.position.x;
},
set: function (t) {
this.position.x = t;
},
},
y: {
get: function () {
return this.position.y;
},
set: function (t) {
this.position.y = t;
},
},
left: {
get: function () {
return this.position.x;
},
},
right: {
get: function () {
return this.position.x + this.width;
},
},
top: {
get: function () {
return this.position.y;
},
},
bottom: {
get: function () {
return this.position.y + this.height;
},
},
});
t.exports = u;
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e, i, n, s, r, o) {
(this.world = t), (this.name = ""), (this.active = !0), (this.overlapOnly = e), (this.object1 = i), (this.object2 = n), (this.collideCallback = s), (this.processCallback = r), (this.callbackContext = o);
},
setName: function (t) {
return (this.name = t), this;
},
update: function () {
this.world.collideObjects(this.object1, this.object2, this.collideCallback, this.processCallback, this.callbackContext, this.overlapOnly);
},
destroy: function () {
this.world.removeCollider(this),
(this.active = !1),
(this.world = null),
(this.object1 = null),
(this.object2 = null),
(this.collideCallback = null),
(this.processCallback = null),
(this.callbackContext = null);
},
});
t.exports = n;
},
function (t, e, i) {
var d = i(26),
n = i(3),
f = new n(),
p = new n();
t.exports = function (t, e, i, n, s, r, o) {
var a = o.tilemapLayer.tilemap._convert.WorldToTileXY;
a(t, e, !0, f, r, o);
var h = f.x,
l = f.y;
a(t + i, e + n, !1, p, r, o);
var u = Math.ceil(p.x),
c = Math.ceil(p.y);
return d(h, l, u - h, c - l, s, o);
};
},
function (t, e) {
t.exports = function (t, e) {
return t.collisionCallback
? !t.collisionCallback.call(t.collisionCallbackContext, e, t)
: !t.layer.callbacks[t.index] || !t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext, e, t);
};
},
function (t, e, i) {
var a = i(436);
function n(t) {
if (!(this instanceof n)) return new n(t);
(this._maxEntries = Math.max(4, t || 9)), (this._minEntries = Math.max(2, Math.ceil(0.4 * this._maxEntries))), this.clear();
}
function f(t, e) {
y(t, 0, t.children.length, e, t);
}
function y(t, e, i, n, s) {
((s = s || p(null)).minX = 1 / 0), (s.minY = 1 / 0), (s.maxX = -1 / 0), (s.maxY = -1 / 0);
for (var r, o = e; o < i; o++) (r = t.children[o]), u(s, t.leaf ? n(r) : r);
return s;
}
function u(t, e) {
return (t.minX = Math.min(t.minX, e.minX)), (t.minY = Math.min(t.minY, e.minY)), (t.maxX = Math.max(t.maxX, e.maxX)), (t.maxY = Math.max(t.maxY, e.maxY)), t;
}
function r(t, e) {
return t.minX - e.minX;
}
function o(t, e) {
return t.minY - e.minY;
}
function m(t) {
return (t.maxX - t.minX) * (t.maxY - t.minY);
}
function c(t) {
return t.maxX - t.minX + (t.maxY - t.minY);
}
function d(t, e) {
return t.minX <= e.minX && t.minY <= e.minY && e.maxX <= t.maxX && e.maxY <= t.maxY;
}
function l(t, e) {
return e.minX <= t.maxX && e.minY <= t.maxY && e.maxX >= t.minX && e.maxY >= t.minY;
}
function p(t) {
return { children: t, height: 1, leaf: !0, minX: 1 / 0, minY: 1 / 0, maxX: -1 / 0, maxY: -1 / 0 };
}
function g(t, e, i, n, s) {
for (var r, o = [e, i]; o.length; ) (i = o.pop()) - (e = o.pop()) <= n || ((r = e + Math.ceil((i - e) / n / 2) * n), a(t, r, e, i, s), o.push(e, r, r, i));
}
(n.prototype = {
all: function () {
return this._all(this.data, []);
},
search: function (t) {
var e = this.data,
i = [],
n = this.toBBox;
if (!l(t, e)) return i;
for (var s, r, o, a, h = []; e; ) {
for (s = 0, r = e.children.length; s < r; s++) (o = e.children[s]), l(t, (a = e.leaf ? n(o) : o)) && (e.leaf ? i.push(o) : d(t, a) ? this._all(o, i) : h.push(o));
e = h.pop();
}
return i;
},
collides: function (t) {
var e = this.data,
i = this.toBBox;
if (!l(t, e)) return !1;
for (var n, s, r, o, a = []; e; ) {
for (n = 0, s = e.children.length; n < s; n++)
if (((r = e.children[n]), l(t, (o = e.leaf ? i(r) : r)))) {
if (e.leaf || d(t, o)) return !0;
a.push(r);
}
e = a.pop();
}
return !1;
},
load: function (t) {
if (!t || !t.length) return this;
if (t.length < this._minEntries) {
for (var e = 0, i = t.length; e < i; e++) this.insert(t[e]);
return this;
}
var n,
s = this._build(t.slice(), 0, t.length - 1, 0);
return (
this.data.children.length
? this.data.height === s.height
? this._splitRoot(this.data, s)
: (this.data.height < s.height && ((n = this.data), (this.data = s), (s = n)), this._insert(s, this.data.height - s.height - 1, !0))
: (this.data = s),
this
);
},
insert: function (t) {
return t && this._insert(t, this.data.height - 1), this;
},
clear: function () {
return (this.data = p([])), this;
},
remove: function (t, e) {
if (!t) return this;
for (var i, n, s, r, o = this.data, a = this.toBBox(t), h = [], l = []; o || h.length; ) {
if (
(o || ((o = h.pop()), (n = h[h.length - 1]), (i = l.pop()), (r = !0)),
o.leaf &&
-1 !==
(s = (function (t, e, i) {
if (!i) return e.indexOf(t);
for (var n = 0; n < e.length; n++) if (i(t, e[n])) return n;
return -1;
})(t, o.children, e)))
)
return o.children.splice(s, 1), h.push(o), this._condense(h), this;
r || o.leaf || !d(o, a) ? (n ? (i++, (o = n.children[i]), (r = !1)) : (o = null)) : (h.push(o), l.push(i), (i = 0), (o = (n = o).children[0]));
}
return this;
},
toBBox: function (t) {
return { minX: t.left, minY: t.top, maxX: t.right, maxY: t.bottom };
},
compareMinX: function (t, e) {
return t.left - e.left;
},
compareMinY: function (t, e) {
return t.top - e.top;
},
toJSON: function () {
return this.data;
},
fromJSON: function (t) {
return (this.data = t), this;
},
_all: function (t, e) {
for (var i = []; t; ) t.leaf ? e.push.apply(e, t.children) : i.push.apply(i, t.children), (t = i.pop());
return e;
},
_build: function (t, e, i, n) {
var s,
r = i - e + 1,
o = this._maxEntries;
if (r <= o) return f((s = p(t.slice(e, i + 1))), this.toBBox), s;
n || ((n = Math.ceil(Math.log(r) / Math.log(o))), (o = Math.ceil(r / Math.pow(o, n - 1)))), ((s = p([])).leaf = !1), (s.height = n);
var a,
h,
l,
u,
c = Math.ceil(r / o),
d = c * Math.ceil(Math.sqrt(o));
for (g(t, e, i, d, this.compareMinX), a = e; a <= i; a += d)
for (g(t, a, (l = Math.min(a + d - 1, i)), c, this.compareMinY), h = a; h <= l; h += c) (u = Math.min(h + c - 1, l)), s.children.push(this._build(t, h, u, n - 1));
return f(s, this.toBBox), s;
},
_chooseSubtree: function (t, e, i, n) {
for (var s, r, o, a, h, l, u, c, d, f; n.push(e), !e.leaf && n.length - 1 !== i; ) {
for (u = c = 1 / 0, s = 0, r = e.children.length; s < r; s++)
(h = m((o = e.children[s]))),
(d = t),
(f = o),
(l = (Math.max(f.maxX, d.maxX) - Math.min(f.minX, d.minX)) * (Math.max(f.maxY, d.maxY) - Math.min(f.minY, d.minY)) - h) < c
? ((c = l), (u = h < u ? h : u), (a = o))
: l === c && h < u && ((u = h), (a = o));
e = a || e.children[0];
}
return e;
},
_insert: function (t, e, i) {
var n = this.toBBox,
s = i ? t : n(t),
r = [],
o = this._chooseSubtree(s, this.data, e, r);
for (o.children.push(t), u(o, s); 0 <= e && r[e].children.length > this._maxEntries; ) this._split(r, e), e--;
this._adjustParentBBoxes(s, r, e);
},
_split: function (t, e) {
var i = t[e],
n = i.children.length,
s = this._minEntries;
this._chooseSplitAxis(i, s, n);
var r = this._chooseSplitIndex(i, s, n),
o = p(i.children.splice(r, i.children.length - r));
(o.height = i.height), (o.leaf = i.leaf), f(i, this.toBBox), f(o, this.toBBox), e ? t[e - 1].children.push(o) : this._splitRoot(i, o);
},
_splitRoot: function (t, e) {
(this.data = p([t, e])), (this.data.height = t.height + 1), (this.data.leaf = !1), f(this.data, this.toBBox);
},
_chooseSplitIndex: function (t, e, i) {
for (var n, s, r, o, a, h, l, u, c, d, f, p, g = (a = 1 / 0), v = e; v <= i - e; v++)
(l = n = y(t, 0, v, this.toBBox)),
(u = s = y(t, v, i, this.toBBox)),
(c = Math.max(l.minX, u.minX)),
(d = Math.max(l.minY, u.minY)),
(f = Math.min(l.maxX, u.maxX)),
(p = Math.min(l.maxY, u.maxY)),
(r = Math.max(0, f - c) * Math.max(0, p - d)),
(o = m(n) + m(s)),
r < g ? ((g = r), (h = v), (a = o < a ? o : a)) : r === g && o < a && ((a = o), (h = v));
return h;
},
_chooseSplitAxis: function (t, e, i) {
var n = t.leaf ? this.compareMinX : r,
s = t.leaf ? this.compareMinY : o;
this._allDistMargin(t, e, i, n) < this._allDistMargin(t, e, i, s) && t.children.sort(n);
},
_allDistMargin: function (t, e, i, n) {
t.children.sort(n);
for (var s, r = this.toBBox, o = y(t, 0, e, r), a = y(t, i - e, i, r), h = c(o) + c(a), l = e; l < i - e; l++) (s = t.children[l]), u(o, t.leaf ? r(s) : s), (h += c(o));
for (l = i - e - 1; e <= l; l--) (s = t.children[l]), u(a, t.leaf ? r(s) : s), (h += c(a));
return h;
},
_adjustParentBBoxes: function (t, e, i) {
for (var n = i; 0 <= n; n--) u(e[n], t);
},
_condense: function (t) {
for (var e, i = t.length - 1; 0 <= i; i--) 0 === t[i].children.length ? (0 < i ? (e = t[i - 1].children).splice(e.indexOf(t[i]), 1) : this.clear()) : f(t[i], this.toBBox);
},
}),
(t.exports = n);
},
function (t, e, i) {
var y = i(533),
m = i(535),
x = i(248);
t.exports = function (t, e, i, n, s, r, o) {
var a = n.left,
h = n.top,
l = n.right,
u = n.bottom,
c = i.faceLeft || i.faceRight,
d = i.faceTop || i.faceBottom;
if ((o || (d = c = !0), !c && !d)) return !1;
var f = 0,
p = 0,
g = 0,
v = 1;
if (
(e.deltaAbsX() > e.deltaAbsY() ? (g = -1) : e.deltaAbsX() < e.deltaAbsY() && (v = -1),
0 !== e.deltaX() && 0 !== e.deltaY() && c && d && ((g = Math.min(Math.abs(e.position.x - l), Math.abs(e.right - a))), (v = Math.min(Math.abs(e.position.y - u), Math.abs(e.bottom - h)))),
g < v)
) {
if (c && 0 !== (f = y(e, i, a, l, r, o)) && !x(n, e)) return !0;
d && (p = m(e, i, h, u, r, o));
} else {
if (d && 0 !== (p = m(e, i, h, u, r, o)) && !x(n, e)) return !0;
c && (f = y(e, i, a, l, r, o));
}
return 0 !== f || 0 !== p;
};
},
function (t, e, i) {
var c = i(534);
t.exports = function (t, e, i, n, s, r) {
var o = 0,
a = e.faceLeft,
h = e.faceRight,
l = e.collideLeft,
u = e.collideRight;
return (
r || (u = l = h = a = !0),
t.deltaX() < 0 && u && t.checkCollision.left ? h && t.x < n && (o = t.x - n) < -s && (o = 0) : 0 < t.deltaX() && l && t.checkCollision.right && a && t.right > i && s < (o = t.right - i) && (o = 0),
0 !== o && (t.customSeparateX ? (t.overlapX = o) : c(t, o)),
o
);
};
},
function (t, e) {
t.exports = function (t, e) {
e < 0 ? ((t.blocked.none = !1), (t.blocked.left = !0)) : 0 < e && ((t.blocked.none = !1), (t.blocked.right = !0)),
(t.position.x -= e),
0 === t.bounce.x ? (t.velocity.x = 0) : (t.velocity.x = -t.velocity.x * t.bounce.x);
};
},
function (t, e, i) {
var c = i(536);
t.exports = function (t, e, i, n, s, r) {
var o = 0,
a = e.faceTop,
h = e.faceBottom,
l = e.collideUp,
u = e.collideDown;
return (
r || (u = l = h = a = !0),
t.deltaY() < 0 && u && t.checkCollision.up ? h && t.y < n && (o = t.y - n) < -s && (o = 0) : 0 < t.deltaY() && l && t.checkCollision.down && a && t.bottom > i && s < (o = t.bottom - i) && (o = 0),
0 !== o && (t.customSeparateY ? (t.overlapY = o) : c(t, o)),
o
);
};
},
function (t, e) {
t.exports = function (t, e) {
e < 0 ? ((t.blocked.none = !1), (t.blocked.up = !0)) : 0 < e && ((t.blocked.none = !1), (t.blocked.down = !0)),
(t.position.y -= e),
0 === t.bounce.y ? (t.velocity.y = 0) : (t.velocity.y = -t.velocity.y * t.bounce.y);
};
},
function (t, e, i) {
var h = i(246),
l = i(1389);
t.exports = function (t, e, i, n) {
var s = h(t, e, i, n),
r = t.immovable,
o = e.immovable;
if (i || 0 === s || (r && o) || t.customSeparateX || e.customSeparateX) return 0 !== s || (t.embedded && e.embedded);
var a = l.Set(t, e, s);
return r || o ? (r ? l.RunImmovableBody1(a) : o && l.RunImmovableBody2(a), !0) : 0 < a || l.Check();
};
},
function (t, e, i) {
var h = i(247),
l = i(1390);
t.exports = function (t, e, i, n) {
var s = h(t, e, i, n),
r = t.immovable,
o = e.immovable;
if (i || 0 === s || (r && o) || t.customSeparateY || e.customSeparateY) return 0 !== s || (t.embedded && e.embedded);
var a = l.Set(t, e, s);
return r || o ? (r ? l.RunImmovableBody1(a) : o && l.RunImmovableBody2(a), !0) : 0 < a || l.Check();
};
},
function (t, e, i) {
var n = i(66),
s = i(0),
r = i(62),
o = i(57),
a = i(3),
h = new s({
initialize: function (t, e) {
var i = e.displayWidth ? e.displayWidth : 64,
n = e.displayHeight ? e.displayHeight : 64;
(this.world = t),
(this.gameObject = e),
(this.debugShowBody = t.defaults.debugShowStaticBody),
(this.debugBodyColor = t.defaults.staticBodyDebugColor),
(this.enable = !0),
(this.isCircle = !1),
(this.radius = 0),
(this.offset = new a()),
(this.position = new a(e.x - i * e.originX, e.y - n * e.originY)),
(this.width = i),
(this.height = n),
(this.halfWidth = Math.abs(this.width / 2)),
(this.halfHeight = Math.abs(this.height / 2)),
(this.center = new a(this.position.x + this.halfWidth, this.position.y + this.halfHeight)),
(this.velocity = a.ZERO),
(this.allowGravity = !1),
(this.gravity = a.ZERO),
(this.bounce = a.ZERO),
(this.onWorldBounds = !1),
(this.onCollide = !1),
(this.onOverlap = !1),
(this.mass = 1),
(this.immovable = !0),
(this.pushable = !1),
(this.customSeparateX = !1),
(this.customSeparateY = !1),
(this.overlapX = 0),
(this.overlapY = 0),
(this.overlapR = 0),
(this.embedded = !1),
(this.collideWorldBounds = !1),
(this.checkCollision = { none: !1, up: !0, down: !0, left: !0, right: !0 }),
(this.touching = { none: !0, up: !1, down: !1, left: !1, right: !1 }),
(this.wasTouching = { none: !0, up: !1, down: !1, left: !1, right: !1 }),
(this.blocked = { none: !0, up: !1, down: !1, left: !1, right: !1 }),
(this.physicsType = r.STATIC_BODY),
(this._dx = 0),
(this._dy = 0);
},
setGameObject: function (t, e) {
return t && t !== this.gameObject && ((this.gameObject.body = null), ((t.body = this).gameObject = t)), e && this.updateFromGameObject(), this;
},
updateFromGameObject: function () {
this.world.staticTree.remove(this);
var t = this.gameObject;
return (
t.getTopLeft(this.position),
(this.width = t.displayWidth),
(this.height = t.displayHeight),
(this.halfWidth = Math.abs(this.width / 2)),
(this.halfHeight = Math.abs(this.height / 2)),
this.center.set(this.position.x + this.halfWidth, this.position.y + this.halfHeight),
this.world.staticTree.insert(this),
this
);
},
setOffset: function (t, e) {
return (
void 0 === e && (e = t),
this.world.staticTree.remove(this),
(this.position.x -= this.offset.x),
(this.position.y -= this.offset.y),
this.offset.set(t, e),
(this.position.x += this.offset.x),
(this.position.y += this.offset.y),
this.updateCenter(),
this.world.staticTree.insert(this),
this
);
},
setSize: function (t, e, i) {
void 0 === i && (i = !0);
var n,
s,
r = this.gameObject;
return (
!t && r.frame && (t = r.frame.realWidth),
!e && r.frame && (e = r.frame.realHeight),
this.world.staticTree.remove(this),
(this.width = t),
(this.height = e),
(this.halfWidth = Math.floor(t / 2)),
(this.halfHeight = Math.floor(e / 2)),
i &&
r.getCenter &&
((n = r.displayWidth / 2),
(s = r.displayHeight / 2),
(this.position.x -= this.offset.x),
(this.position.y -= this.offset.y),
this.offset.set(n - this.halfWidth, s - this.halfHeight),
(this.position.x += this.offset.x),
(this.position.y += this.offset.y)),
this.updateCenter(),
(this.isCircle = !1),
(this.radius = 0),
this.world.staticTree.insert(this),
this
);
},
setCircle: function (t, e, i) {
return (
void 0 === e && (e = this.offset.x),
void 0 === i && (i = this.offset.y),
0 < t
? (this.world.staticTree.remove(this),
(this.isCircle = !0),
(this.radius = t),
(this.width = 2 * t),
(this.height = 2 * t),
(this.halfWidth = Math.floor(this.width / 2)),
(this.halfHeight = Math.floor(this.height / 2)),
this.offset.set(e, i),
this.updateCenter(),
this.world.staticTree.insert(this))
: (this.isCircle = !1),
this
);
},
updateCenter: function () {
this.center.set(this.position.x + this.halfWidth, this.position.y + this.halfHeight);
},
reset: function (t, e) {
var i = this.gameObject;
void 0 === t && (t = i.x), void 0 === e && (e = i.y), this.world.staticTree.remove(this), i.setPosition(t, e), i.getTopLeft(this.position), this.updateCenter(), this.world.staticTree.insert(this);
},
stop: function () {
return this;
},
getBounds: function (t) {
return (t.x = this.x), (t.y = this.y), (t.right = this.right), (t.bottom = this.bottom), t;
},
hitTest: function (t, e) {
return (this.isCircle ? n : o)(this, t, e);
},
postUpdate: function () {},
deltaAbsX: function () {
return 0;
},
deltaAbsY: function () {
return 0;
},
deltaX: function () {
return 0;
},
deltaY: function () {
return 0;
},
deltaZ: function () {
return 0;
},
destroy: function () {
(this.enable = !1), this.world.pendingDestroy.set(this);
},
drawDebug: function (t) {
var e = this.position,
i = e.x + this.halfWidth,
n = e.y + this.halfHeight;
this.debugShowBody && (t.lineStyle(t.defaultStrokeWidth, this.debugBodyColor, 1), this.isCircle ? t.strokeCircle(i, n, this.width / 2) : t.strokeRect(e.x, e.y, this.width, this.height));
},
willDrawDebug: function () {
return this.debugShowBody;
},
setMass: function (t) {
return t <= 0 && (t = 0.1), (this.mass = t), this;
},
x: {
get: function () {
return this.position.x;
},
set: function (t) {
this.world.staticTree.remove(this), (this.position.x = t), this.world.staticTree.insert(this);
},
},
y: {
get: function () {
return this.position.y;
},
set: function (t) {
this.world.staticTree.remove(this), (this.position.y = t), this.world.staticTree.insert(this);
},
},
left: {
get: function () {
return this.position.x;
},
},
right: {
get: function () {
return this.position.x + this.width;
},
},
top: {
get: function () {
return this.position.y;
},
},
bottom: {
get: function () {
return this.position.y + this.height;
},
},
});
t.exports = h;
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t) {
(this.pluginManager = t), (this.game = t.game);
},
init: function () {},
start: function () {},
stop: function () {},
destroy: function () {
(this.pluginManager = null), (this.game = null), (this.scene = null), (this.systems = null);
},
});
t.exports = n;
},
function (t, e, i) {
var h = new (i(3))();
t.exports = function (t, e, i, n) {
var s = i.tilemapLayer,
r = s.cullPaddingX,
o = s.cullPaddingY,
a = s.tilemap.tileToWorldXY(t, e, h, n, s);
return (
a.x > n.worldView.x + s.scaleX * i.tileWidth * (-r - 0.5) &&
a.x < n.worldView.right + s.scaleX * i.tileWidth * (r - 0.5) &&
a.y > n.worldView.y + s.scaleY * i.tileHeight * (-o - 1) &&
a.y < n.worldView.bottom + s.scaleY * i.tileHeight * (o - 0.5)
);
};
},
function (t, e, i) {
var l = i(26);
t.exports = function (t, e, i, n, s, r, o) {
for (var a = l(i, n, s, r, null, o), h = 0; h < a.length; h++) a[h] && a[h].index === t && (a[h].index = e);
};
},
function (t, e, i) {
var n = i(10),
u = i(139),
c = i(76),
d = new n();
t.exports = function (t, e) {
var i = t.tilemapLayer.tilemap,
n = t.tilemapLayer,
s = Math.floor(i.tileWidth * n.scaleX),
r = Math.floor(i.tileHeight * n.scaleY),
o = c(e.worldView.x - n.x, s, 0, !0) - n.cullPaddingX,
a = u(e.worldView.right - n.x, s, 0, !0) + n.cullPaddingX,
h = c(e.worldView.y - n.y, r, 0, !0) - n.cullPaddingY,
l = u(e.worldView.bottom - n.y, r, 0, !0) + n.cullPaddingY;
return d.setTo(o, h, a - o, l - h);
};
},
function (t, e, i) {
var o = i(543),
a = i(159);
t.exports = function (t, e, i, n) {
void 0 === i && (i = []), void 0 === n && (n = 0), (i.length = 0);
var s = t.tilemapLayer,
r = o(t, e);
return (!s.skipCull && 1 === s.scrollFactorX && 1 === s.scrollFactorY) || ((r.left = 0), (r.right = t.width), (r.top = 0), (r.bottom = t.height)), a(t, r, n, i), i;
};
},
function (t, e, i) {
var o = i(546),
a = i(159);
t.exports = function (t, e, i, n) {
void 0 === i && (i = []), void 0 === n && (n = 0), (i.length = 0);
var s,
r = t.tilemapLayer;
return r.skipCull || 1 !== r.scrollFactorX || 1 !== r.scrollFactorY || ((s = o(t, e)), a(t, s, n, i)), i;
};
},
function (t, e, i) {
var h = i(139),
l = i(76);
t.exports = function (t, e) {
var i = t.tilemapLayer.tilemap,
n = t.tilemapLayer,
s = Math.floor(i.tileWidth * n.scaleX),
r = Math.floor(i.tileHeight * n.scaleY),
o = t.hexSideLength,
a = (r - o) / 2 + o;
return {
left: l(e.worldView.x - n.x, s, 0, !0) - n.cullPaddingX,
right: h(e.worldView.right - n.x, s, 0, !0) + n.cullPaddingX,
top: l(e.worldView.y - n.y, a, 0, !0) - n.cullPaddingY,
bottom: h(e.worldView.bottom - n.y, a, 0, !0) + n.cullPaddingY,
};
};
},
function (t, e, i) {
var f = i(541);
t.exports = function (t, e, i, n) {
void 0 === i && (i = []), void 0 === n && (n = 0), (i.length = 0);
var s,
r,
o,
a = t.tilemapLayer,
h = t.data,
l = t.width,
u = t.height,
c = l,
d = u;
if (!a.skipCull)
if (0 === n) {
for (r = 0; r < d; r++)
for (s = 0; h[r] && s < c; s++)
if (f(s, r, t, e)) {
if (!(o = h[r][s]) || -1 === o.index || !o.visible || 0 === o.alpha) continue;
i.push(o);
}
} else if (1 === n) {
for (r = 0; r < d; r++)
for (s = c; h[r] && 0 <= s; s--)
if (f(s, r, t, e)) {
if (!(o = h[r][s]) || -1 === o.index || !o.visible || 0 === o.alpha) continue;
i.push(o);
}
} else if (2 === n) {
for (r = d; 0 <= r; r--)
for (s = 0; h[r] && s < c; s++)
if (f(s, r, t, e)) {
if (!(o = h[r][s]) || -1 === o.index || !o.visible || 0 === o.alpha) continue;
i.push(o);
}
} else if (3 === n)
for (r = d; 0 <= r; r--)
for (s = c; h[r] && 0 <= s; s--)
if (f(s, r, t, e)) {
if (!(o = h[r][s]) || -1 === o.index || !o.visible || 0 === o.alpha) continue;
i.push(o);
}
return (a.tilesDrawn = i.length), (a.tilesTotal = l * u), i;
};
},
function (t, e, i) {
var o = i(549),
a = i(159);
t.exports = function (t, e, i, n) {
void 0 === i && (i = []), void 0 === n && (n = 0), (i.length = 0);
var s,
r = t.tilemapLayer;
return r.skipCull || 1 !== r.scrollFactorX || 1 !== r.scrollFactorY || ((s = o(t, e)), a(t, s, n, i)), i;
};
},
function (t, e, i) {
var o = i(139),
a = i(76);
t.exports = function (t, e) {
var i = t.tilemapLayer.tilemap,
n = t.tilemapLayer,
s = Math.floor(i.tileWidth * n.scaleX),
r = Math.floor(i.tileHeight * n.scaleY);
return {
left: a(e.worldView.x - n.x, s, 0, !0) - n.cullPaddingX,
right: o(e.worldView.right - n.x, s, 0, !0) + n.cullPaddingX,
top: a(e.worldView.y - n.y, r / 2, 0, !0) - n.cullPaddingY,
bottom: o(e.worldView.bottom - n.y, r / 2, 0, !0) + n.cullPaddingY,
};
};
},
function (t, e, i) {
var f = i(3);
t.exports = function (t, e, i, n, s) {
i = i || new f();
var r = s.baseTileWidth,
o = s.baseTileHeight,
a = s.tilemapLayer,
h = 0,
l = 0;
a && ((n = n || a.scene.cameras.main), (h = a.x + n.scrollX * (1 - a.scrollFactorX)), (r *= a.scaleX), (l = a.y + n.scrollY * (1 - a.scrollFactorY)), (o *= a.scaleY));
var u = s.hexSideLength,
c = h + t * r + (e % 2) * (r / 2),
d = l + e * ((o - u) / 2 + u);
return i.set(c, d);
};
},
function (t, e, i) {
var d = i(3);
t.exports = function (t, e, i, n, s) {
i = i || new d();
var r = s.baseTileWidth,
o = s.baseTileHeight,
a = s.tilemapLayer,
h = 0,
l = 0;
a && ((n = n || a.scene.cameras.main), (h = a.x + n.scrollX * (1 - a.scrollFactorX)), (r *= a.scaleX), (l = a.y + n.scrollY * (1 - a.scrollFactorY)), (o *= a.scaleY));
var u = h + (r / 2) * (t - e),
c = l + (t + e) * (o / 2);
return i.set(u, c);
};
},
function (t, e, i) {
var d = i(3);
t.exports = function (t, e, i, n, s) {
i = i || new d();
var r = s.baseTileWidth,
o = s.baseTileHeight,
a = s.tilemapLayer,
h = 0,
l = 0;
a && ((n = n || a.scene.cameras.main), (h = a.x + n.scrollX * (1 - a.scrollFactorX)), (r *= a.scaleX), (l = a.y + n.scrollY * (1 - a.scrollFactorY)), (o *= a.scaleY));
var u = h + t * r + (e % 2) * (r / 2),
c = l + e * (o / 2);
return i.set(u, c);
};
},
function (t, e, i) {
var r = i(253),
o = i(254),
a = i(3);
t.exports = function (t, e, i, n, s) {
return ((i = i || new a(0, 0)).x = r(t, n, s)), (i.y = o(e, n, s)), i;
};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = i.baseTileHeight,
s = i.tilemapLayer,
r = 0;
s && (void 0 === e && (e = s.scene.cameras.main), (r = s.y + e.scrollY * (1 - s.scrollFactorY)), (n *= s.scaleY));
var o = s.tilemap.hexSideLength;
return r + t * ((n - o) / 2 + o);
};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = i.baseTileHeight,
s = i.tilemapLayer,
r = 0;
return s && (void 0 === e && (e = s.scene.cameras.main), (r = s.y + e.scrollY * (1 - s.scrollFactorY)), (n *= s.scaleY)), r + t * (n / 2);
};
},
function (t, e, i) {
var f = i(3);
t.exports = function (t, e, i, n, s, r) {
n = n || new f();
var o = r.baseTileWidth,
a = r.baseTileHeight,
h = r.tilemapLayer;
h && ((s = s || h.scene.cameras.main), (e -= h.y + s.scrollY * (1 - h.scrollFactorY)), (a *= h.scaleY), (t -= h.x + s.scrollX * (1 - h.scrollFactorX)), (o *= h.scaleX));
var l = r.hexSideLength,
u = (a - l) / 2 + l,
c = i ? Math.floor(e / u) : e / u,
d = i ? Math.floor((t - (c % 2) * 0.5 * o) / o) : (t - (c % 2) * 0.5 * o) / o;
return n.set(d, c);
};
},
function (t, e, i) {
var c = i(3);
t.exports = function (t, e, i, n, s, r) {
n = n || new c();
var o = r.baseTileWidth,
a = r.baseTileHeight,
h = r.tilemapLayer;
h && ((s = s || h.scene.cameras.main), (e -= h.y + s.scrollY * (1 - h.scrollFactorY)), (a *= h.scaleY), (t -= h.x + s.scrollX * (1 - h.scrollFactorX)), (o *= h.scaleX));
var l = i ? Math.floor((t / (o / 2) + e / (a / 2)) / 2) : (t / (o / 2) + e / (a / 2)) / 2,
u = i ? Math.floor((e / (a / 2) - t / (o / 2)) / 2) : (e / (a / 2) - t / (o / 2)) / 2;
return n.set(l, u);
};
},
function (t, e, i) {
var c = i(3);
t.exports = function (t, e, i, n, s, r) {
n = n || new c();
var o = r.baseTileWidth,
a = r.baseTileHeight,
h = r.tilemapLayer;
h && ((s = s || h.scene.cameras.main), (e -= h.y + s.scrollY * (1 - h.scrollFactorY)), (a *= h.scaleY), (t -= h.x + s.scrollX * (1 - h.scrollFactorX)), (o *= h.scaleX));
var l = i ? Math.floor(e / (a / 2)) : e / (a / 2),
u = i ? Math.floor((t + (l % 2) * 0.5 * o) / o) : (t + (l % 2) * 0.5 * o) / o;
return n.set(u, l);
};
},
function (t, e, i) {
var o = i(255),
a = i(256),
h = i(3);
t.exports = function (t, e, i, n, s, r) {
return void 0 === i && (i = !0), ((n = n || new h(0, 0)).x = o(t, i, s, r)), (n.y = a(e, i, s, r)), n;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = n.baseTileHeight,
r = n.tilemapLayer;
r && ((i = i || r.scene.cameras.main), (t -= r.y + i.scrollY * (1 - r.scrollFactorY)), (s *= r.scaleY));
var o = n.hexSideLength,
a = (s - o) / 2 + o;
return e ? Math.floor(t / a) : t / a;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = n.baseTileHeight,
r = n.tilemapLayer;
return r && ((i = i || r.scene.cameras.main), (t -= r.y + i.scrollY * (1 - r.scrollFactorY)), (s *= r.scaleY)), e ? Math.floor(t / (s / 2)) : t / (s / 2);
};
},
function (t, e, i) {
var s = i(119);
t.exports = function (t, e, i) {
if (s(t, e, i)) {
var n = i.data[e][t];
return null !== n && -1 < n.index;
}
return !1;
};
},
function (t, e, i) {
var o = i(85),
a = i(119),
h = i(252);
t.exports = function (t, e, i, n, s) {
if ((void 0 === i && (i = !0), void 0 === n && (n = !0), !a(t, e, s))) return null;
var r = s.data[e][t];
return r ? ((s.data[e][t] = i ? null : new o(s, -1, t, e, s.tileWidth, s.tileHeight)), n && r && r.collides && h(t, e, s), r) : null;
};
},
function (t, e, i) {
var a = i(40),
h = i(259),
l = i(565),
u = i(566),
c = i(577);
t.exports = function (t, e, i, n, s, r) {
var o;
switch (e) {
case a.ARRAY_2D:
o = h(t, i, n, s, r);
break;
case a.CSV:
o = l(t, i, n, s, r);
break;
case a.TILED_JSON:
o = u(t, i, r);
break;
case a.WELTMEISTER:
o = c(t, i, r);
break;
default:
o = null;
}
return o;
};
},
function (t, e, i) {
var a = i(40),
h = i(259);
t.exports = function (t, e, i, n, s) {
var r = e
.trim()
.split("\n")
.map(function (t) {
return t.split(",");
}),
o = h(t, r, i, n, s);
return (o.format = a.CSV), o;
};
},
function (t, e, i) {
var r = i(567),
o = i(568),
a = i(29),
h = i(40),
l = i(258),
u = i(121),
c = i(569),
d = i(570),
f = i(573),
p = i(575);
t.exports = function (t, e, i) {
var n = new u({
width: e.width,
height: e.height,
name: t,
tileWidth: e.tilewidth,
tileHeight: e.tileheight,
orientation: l(e.orientation),
format: h.TILED_JSON,
version: e.version,
properties: e.properties,
renderOrder: e.renderorder,
infinite: e.infinite,
});
n.orientation === a.HEXAGONAL && (n.hexSideLength = e.hexsidelength), (n.layers = f(e, i)), (n.images = c(e));
var s = p(e);
return (n.tilesets = s.tilesets), (n.imageCollections = s.imageCollections), (n.objects = d(e)), (n.tiles = o(n)), r(n), n;
};
},
function (t, e, i) {
var l = i(17);
t.exports = function (t) {
for (var e, i, n, s, r, o = 0; o < t.layers.length; o++) {
e = t.layers[o];
for (var a = 0; a < e.data.length; a++) {
r = e.data[a];
for (var h = 0; h < r.length; h++)
null === (i = r[h]) ||
i.index < 0 ||
((n = t.tiles[i.index][2]),
(s = t.tilesets[n]),
(i.width = s.tileWidth),
(i.height = s.tileHeight),
s.tileProperties && s.tileProperties[i.index - s.firstgid] && (i.properties = l(i.properties, s.tileProperties[i.index - s.firstgid])));
}
}
};
},
function (t, e, i) {
var p = i(122);
t.exports = function (t) {
for (var e = [], i = 0; i < t.imageCollections.length; i++)
for (var n = t.imageCollections[i], s = n.images, r = 0; r < s.length; r++) {
var o,
a = s[r];
(o = new p(a.image, a.gid, n.imageWidth, n.imageHeight, 0, 0)).updateTileData(n.imageWidth, n.imageHeight), t.tilesets.push(o);
}
for (i = 0; i < t.tilesets.length; i++)
for (
var h = (o = t.tilesets[i]).tileMargin, l = o.tileMargin, u = 0, c = 0, d = 0, f = o.firstgid;
f < o.firstgid + o.total &&
((e[f] = [h, l, i]), (h += o.tileWidth + o.tileSpacing), ++u !== o.total) &&
(++c !== o.columns || ((h = o.tileMargin), (l += o.tileHeight + o.tileSpacing), (c = 0), ++d !== o.rows));
f++
);
return e;
};
},
function (t, e, i) {
var h = i(2),
l = i(161);
t.exports = function (t) {
for (var e = [], i = [], n = l(t); n.i < n.layers.length || 0 < i.length; )
if (n.i >= n.layers.length) {
if (i.length < 1) break;
n = i.pop();
} else {
var s,
r,
o,
a = n.layers[n.i];
n.i++,
"imagelayer" === a.type
? ((s = h(a, "offsetx", 0) + h(a, "startx", 0)),
(r = h(a, "offsety", 0) + h(a, "starty", 0)),
e.push({ name: n.name + a.name, image: a.image, x: n.x + s + a.x, y: n.y + r + a.y, alpha: n.opacity * a.opacity, visible: n.visible && a.visible, properties: h(a, "properties", {}) }))
: "group" === a.type && ((o = l(t, a, n)), i.push(n), (n = o));
}
return e;
};
},
function (t, e, i) {
var d = i(2),
f = i(260),
p = i(572),
g = i(161);
t.exports = function (t) {
for (var e = [], i = [], n = g(t); n.i < n.layers.length || 0 < i.length; )
if (n.i >= n.layers.length) {
if (i.length < 1) break;
n = i.pop();
} else {
var s,
r = n.layers[n.i];
if ((n.i++, (r.opacity *= n.opacity), (r.visible = n.visible && r.visible), "objectgroup" === r.type)) {
r.name = n.name + r.name;
for (var o = n.x + d(r, "startx", 0) + d(r, "offsetx", 0), a = n.y + d(r, "starty", 0) + d(r, "offsety", 0), h = [], l = 0; l < r.objects.length; l++) {
var u = f(r.objects[l], o, a);
h.push(u);
}
var c = new p(r);
(c.objects = h), e.push(c);
} else "group" === r.type && ((s = g(t, r, n)), i.push(n), (n = s));
}
return e;
};
},
function (t, e, i) {
var r = i(126);
t.exports = function (t, e) {
for (var i = {}, n = 0; n < e.length; n++) {
var s = e[n];
r(t, s) && (i[s] = t[s]);
}
return i;
};
},
function (t, e, i) {
var n = i(0),
s = i(2),
r = new n({
initialize: function (t) {
void 0 === t && (t = {}),
(this.name = s(t, "name", "object layer")),
(this.opacity = s(t, "opacity", 1)),
(this.properties = s(t, "properties", {})),
(this.propertyTypes = s(t, "propertytypes", {})),
(this.type = s(t, "type", "objectgroup")),
(this.visible = s(t, "visible", !0)),
(this.objects = s(t, "objects", []));
},
});
t.exports = r;
},
function (t, e, i) {
var O = i(574),
k = i(29),
R = i(161),
L = i(258),
I = i(2),
D = i(120),
F = i(261),
B = i(85);
t.exports = function (t, e) {
for (var i = I(t, "infinite", !1), n = [], s = [], r = R(t); r.i < r.layers.length || 0 < s.length; )
if (r.i >= r.layers.length) {
if (s.length < 1) break;
r = s.pop();
} else {
var o,
a = r.layers[r.i];
if ((r.i++, "tilelayer" === a.type))
if (a.compression);
else {
if (a.encoding && "base64" === a.encoding) {
if (a.chunks) for (var h = 0; h < a.chunks.length; h++) a.chunks[h].data = O(a.chunks[h].data);
a.data && (a.data = O(a.data)), delete a.encoding;
}
var l,
u,
c = [],
d = 0;
if (i) {
var f,
p = I(a, "startx", 0) + a.x,
g = I(a, "starty", 0) + a.y;
(f = new D({
name: r.name + a.name,
x: r.x + I(a, "offsetx", 0) + p * t.tilewidth,
y: r.y + I(a, "offsety", 0) + g * t.tileheight,
width: a.width,
height: a.height,
tileWidth: t.tilewidth,
tileHeight: t.tileheight,
alpha: r.opacity * a.opacity,
visible: r.visible && a.visible,
properties: I(a, "properties", []),
orientation: L(t.orientation),
})).orientation === k.HEXAGONAL && (f.hexSideLength = t.hexsidelength);
for (var v = 0; v < a.height; v++) {
c.push([null]);
for (var y = 0; y < a.width; y++) c[v][y] = null;
}
for (v = 0, C = a.chunks.length; v < C; v++)
for (var m = a.chunks[v], x = m.x - p, b = m.y - g, w = 0, T = 0, S = m.data.length; T < S; T++) {
var _,
E = d + x,
P = w + b;
0 < (_ = F(m.data[T])).gid
? (((l = new B(f, _.gid, E, P, t.tilewidth, t.tileheight)).rotation = _.rotation), (l.flipX = _.flipped), (c[P][E] = l))
: ((u = e ? null : new B(f, -1, E, P, t.tilewidth, t.tileheight)), (c[P][E] = u)),
++d === m.width && (w++, (d = 0));
}
} else {
(f = new D({
name: r.name + a.name,
x: r.x + I(a, "offsetx", 0) + a.x,
y: r.y + I(a, "offsety", 0) + a.y,
width: a.width,
height: a.height,
tileWidth: t.tilewidth,
tileHeight: t.tileheight,
alpha: r.opacity * a.opacity,
visible: r.visible && a.visible,
properties: I(a, "properties", []),
orientation: L(t.orientation),
})).orientation === k.HEXAGONAL && (f.hexSideLength = t.hexsidelength);
for (var A = [], M = 0, C = a.data.length; M < C; M++)
0 < (_ = F(a.data[M])).gid
? (((l = new B(f, _.gid, d, c.length, t.tilewidth, t.tileheight)).rotation = _.rotation), (l.flipX = _.flipped), A.push(l))
: ((u = e ? null : new B(f, -1, d, c.length, t.tilewidth, t.tileheight)), A.push(u)),
++d === a.width && (c.push(A), (d = 0), (A = []));
}
(f.data = c), n.push(f);
}
else "group" === a.type && ((o = R(t, a, r)), s.push(r), (r = o));
}
return n;
};
},
function (t, e) {
t.exports = function (t) {
for (var e = window.atob(t), i = e.length, n = new Array(i / 4), s = 0; s < i; s += 4)
n[s / 4] = (e.charCodeAt(s) | (e.charCodeAt(s + 1) << 8) | (e.charCodeAt(s + 2) << 16) | (e.charCodeAt(s + 3) << 24)) >>> 0;
return n;
};
},
function (t, e, i) {
var w = i(122),
T = i(576),
S = i(260),
_ = i(1453);
t.exports = function (t) {
for (var e, i = [], n = [], s = null, r = 0; r < t.tilesets.length; r++) {
var o = t.tilesets[r];
if (o.source);
else if (o.image) {
var a = new w(o.name, o.firstgid, o.tilewidth, o.tileheight, o.margin, o.spacing);
if (1 < t.version) {
var h = void 0,
l = void 0;
if (Array.isArray(o.tiles)) {
(h = h || {}), (l = l || {});
for (var u = 0; u < o.tiles.length; u++) {
var c,
d,
f = o.tiles[u];
f.properties &&
((c = {}),
f.properties.forEach(function (t) {
c[t.name] = t.value;
}),
(l[f.id] = c)),
f.objectgroup &&
(((h[f.id] || (h[f.id] = {})).objectgroup = f.objectgroup),
f.objectgroup.objects &&
((d = f.objectgroup.objects.map(function (t) {
return S(t);
})),
(h[f.id].objectgroup.objects = d))),
f.animation && ((h[f.id] || (h[f.id] = {})).animation = f.animation),
f.type && ((h[f.id] || (h[f.id] = {})).type = f.type);
}
}
Array.isArray(o.wangsets) && ((h = h || {}), (l = l || {}), _(o.wangsets, h)), h && ((a.tileData = h), (a.tileProperties = l));
} else if ((o.tileproperties && (a.tileProperties = o.tileproperties), o.tiles))
for (e in ((a.tileData = o.tiles), a.tileData)) {
var p,
g = a.tileData[e].objectgroup;
g &&
g.objects &&
((p = g.objects.map(function (t) {
return S(t);
})),
(a.tileData[e].objectgroup.objects = p));
}
a.updateTileData(o.imagewidth, o.imageheight), i.push(a);
} else {
var v = new T(o.name, o.firstgid, o.tilewidth, o.tileheight, o.margin, o.spacing, o.properties),
y = 0;
for (u = 0; u < o.tiles.length; u++) {
var m = (f = o.tiles[u]).image,
x = parseInt(f.id, 10),
b = o.firstgid + x;
v.addImage(b, m), (y = Math.max(x, y));
}
(v.maxId = y), n.push(v);
}
s && (s.lastgid = o.firstgid - 1), (s = o);
}
return { tilesets: i, imageCollections: n };
};
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t, e, i, n, s, r, o) {
(void 0 === i || i <= 0) && (i = 32),
(void 0 === n || n <= 0) && (n = 32),
void 0 === s && (s = 0),
void 0 === r && (r = 0),
(this.name = t),
(this.firstgid = 0 | e),
(this.imageWidth = 0 | i),
(this.imageHeight = 0 | n),
(this.imageMargin = 0 | s),
(this.imageSpacing = 0 | r),
(this.properties = o || {}),
(this.images = []),
(this.total = 0);
},
containsImageIndex: function (t) {
return t >= this.firstgid && t < this.firstgid + this.total;
},
addImage: function (t, e) {
return this.images.push({ gid: t, image: e }), this.total++, this;
},
});
t.exports = n;
},
function (t, e, i) {
var a = i(40),
h = i(121),
l = i(578),
u = i(579);
t.exports = function (t, e, i) {
if (0 === e.layer.length) return null;
for (var n = 0, s = 0, r = 0; r < e.layer.length; r++) e.layer[r].width > n && (n = e.layer[r].width), e.layer[r].height > s && (s = e.layer[r].height);
var o = new h({ width: n, height: s, name: t, tileWidth: e.layer[0].tilesize, tileHeight: e.layer[0].tilesize, format: a.WELTMEISTER });
return (o.layers = l(e, i)), (o.tilesets = u(e)), o;
};
},
function (t, e, i) {
var d = i(120),
f = i(85);
t.exports = function (t, e) {
for (var i = [], n = 0; n < t.layer.length; n++) {
for (
var s = t.layer[n], r = new d({ name: s.name, width: s.width, height: s.height, tileWidth: s.tilesize, tileHeight: s.tilesize, visible: 1 === s.visible }), o = [], a = [], h = 0;
h < s.data.length;
h++
) {
for (var l = 0; l < s.data[h].length; l++) {
var u = s.data[h][l] - 1,
c = -1 < u ? new f(r, u, l, h, s.tilesize, s.tilesize) : e ? null : new f(r, -1, l, h, s.tilesize, s.tilesize);
o.push(c);
}
a.push(o), (o = []);
}
(r.data = a), i.push(r);
}
return i;
};
},
function (t, e, i) {
var o = i(122);
t.exports = function (t) {
for (var e = [], i = [], n = 0; n < t.layer.length; n++) {
var s = t.layer[n],
r = s.tilesetName;
"" !== r && -1 === i.indexOf(r) && (i.push(r), e.push(new o(r, 0, s.tilesize, s.tilesize, 0, 0)));
}
return e;
};
},
function (t, e, i) {
var n = i(0),
S = i(36),
u = i(40),
_ = i(2),
f = i(120),
s = i(29),
E = i(362),
r = i(74),
P = i(73),
p = i(85),
h = i(251),
g = i(581),
c = i(122),
o = new n({
initialize: function (t, e) {
(this.scene = t),
(this.tileWidth = e.tileWidth),
(this.tileHeight = e.tileHeight),
(this.width = e.width),
(this.height = e.height),
(this.orientation = e.orientation),
(this.renderOrder = e.renderOrder),
(this.format = e.format),
(this.version = e.version),
(this.properties = e.properties),
(this.widthInPixels = e.widthInPixels),
(this.heightInPixels = e.heightInPixels),
(this.imageCollections = e.imageCollections),
(this.images = e.images),
(this.layers = e.layers),
(this.tilesets = e.tilesets),
(this.objects = e.objects),
(this.currentLayerIndex = 0),
(this.hexSideLength = e.hexSideLength);
var i = this.orientation;
this._convert = {
WorldToTileXY: h.GetWorldToTileXYFunction(i),
WorldToTileX: h.GetWorldToTileXFunction(i),
WorldToTileY: h.GetWorldToTileYFunction(i),
TileToWorldXY: h.GetTileToWorldXYFunction(i),
TileToWorldX: h.GetTileToWorldXFunction(i),
TileToWorldY: h.GetTileToWorldYFunction(i),
};
},
createBlankDynamicLayer: function (t, e, i, n, s, r, o, a) {
return this.createBlankLayer(t, e, i, n, s, r, o, a);
},
createDynamicLayer: function (t, e, i, n) {
return this.createLayer(t, e, i, n);
},
createStaticLayer: function (t, e, i, n) {
return this.createLayer(t, e, i, n);
},
setRenderOrder: function (t) {
var e = ["right-down", "left-down", "right-up", "left-up"];
return "number" == typeof t && (t = e[t]), -1 < e.indexOf(t) && (this.renderOrder = t), this;
},
addTilesetImage: function (t, e, i, n, s, r, o) {
if (void 0 === t) return null;
if ((null == e && (e = t), !this.scene.sys.textures.exists(e))) return null;
var a = this.scene.sys.textures.get(e),
h = this.getTilesetIndex(t);
if (null === h && this.format === u.TILED_JSON) return null;
var l = this.tilesets[h];
return (
l
? (l.setTileSize(i, n), l.setSpacing(s, r), l.setImage(a))
: (void 0 === i && (i = this.tileWidth),
void 0 === n && (n = this.tileHeight),
void 0 === s && (s = 0),
void 0 === r && (r = 0),
void 0 === o && (o = 0),
(l = new c(t, o, i, n, s, r)).setImage(a),
this.tilesets.push(l)),
l
);
},
copy: function (t, e, i, n, s, r, o, a) {
return null !== (a = this.getLayer(a)) ? (h.Copy(t, e, i, n, s, r, o, a), this) : null;
},
createBlankLayer: function (t, e, i, n, s, r, o, a) {
if (
(void 0 === i && (i = 0),
void 0 === n && (n = 0),
void 0 === s && (s = this.width),
void 0 === r && (r = this.height),
void 0 === o && (o = this.tileWidth),
void 0 === a && (a = this.tileHeight),
null !== this.getLayerIndex(t))
)
return null;
for (var h, l = new f({ name: t, tileWidth: o, tileHeight: a, width: s, height: r, orientation: this.orientation }), u = 0; u < r; u++) {
h = [];
for (var c = 0; c < s; c++) h.push(new p(l, -1, c, u, o, a, this.tileWidth, this.tileHeight));
l.data.push(h);
}
this.layers.push(l), (this.currentLayerIndex = this.layers.length - 1);
var d = new g(this.scene, this, this.currentLayerIndex, e, i, n);
return d.setRenderOrder(this.renderOrder), this.scene.sys.displayList.add(d), d;
},
createLayer: function (t, e, i, n) {
var s = this.getLayerIndex(t);
if (null === s) return null;
var r = this.layers[s];
if (r.tilemapLayer) return null;
(this.currentLayerIndex = s), void 0 === i && (i = r.x), void 0 === n && (n = r.y);
var o = new g(this.scene, this, s, e, i, n);
return o.setRenderOrder(this.renderOrder), this.scene.sys.displayList.add(o), o;
},
createFromObjects: function (t, e) {
var i = [],
n = this.getObjectLayer(t);
if (!n) return i;
Array.isArray(e) || (e = [e]);
for (var s = n.objects, r = 0; r < e.length; r++) {
for (var o, a = e[r], h = _(a, "id", null), l = _(a, "gid", null), u = _(a, "name", null), c = [], d = 0; d < s.length; d++)
(o = s[d]), ((null === h && null === l && null === u) || (null !== h && o.id === h) || (null !== l && o.gid === l) || (null !== u && o.name === u)) && c.push(o);
for (var f = _(a, "classType", P), p = _(a, "scene", this.scene), g = _(a, "container", null), v = _(a, "key", null), y = _(a, "frame", null), m = 0; m < c.length; m++) {
o = c[m];
var x = new f(p);
x.setName(o.name), x.setPosition(o.x, o.y), x.setTexture(v, y), o.width && (x.displayWidth = o.width), o.height && (x.displayHeight = o.height);
var b,
w = { x: x.originX * o.width, y: (x.originY - 1) * o.height };
if (
(o.rotation && ((b = S(o.rotation)), E(w, b), (x.rotation = b)),
(x.x += w.x),
(x.y += w.y),
(void 0 === o.flippedHorizontal && void 0 === o.flippedVertical) || x.setFlip(o.flippedHorizontal, o.flippedVertical),
o.visible || (x.visible = !1),
Array.isArray(o.properties))
)
o.properties.forEach(function (t) {
var e = t.name;
void 0 !== x[e] ? (x[e] = t.value) : x.setData(e, t.value);
});
else for (var T in o.properties) void 0 !== x[T] ? (x[T] = o.properties[T]) : x.setData(T, o.properties[T]);
g ? g.add(x) : p.add.existing(x), i.push(x);
}
}
return i;
},
createFromTiles: function (t, e, i, n, s, r) {
return null === (r = this.getLayer(r)) ? null : h.CreateFromTiles(t, e, i, n, s, r);
},
fill: function (t, e, i, n, s, r, o) {
return void 0 === r && (r = !0), null === (o = this.getLayer(o)) ? null : (h.Fill(t, e, i, n, s, r, o), this);
},
filterObjects: function (t, e, i) {
if ("string" == typeof t) {
if (!(t = this.getObjectLayer(t))) return null;
}
return t.objects.filter(e, i);
},
filterTiles: function (t, e, i, n, s, r, o, a) {
return null === (a = this.getLayer(a)) ? null : h.FilterTiles(t, e, i, n, s, r, o, a);
},
findByIndex: function (t, e, i, n) {
return null === (n = this.getLayer(n)) ? null : h.FindByIndex(t, e, i, n);
},
findObject: function (t, e, i) {
if ("string" == typeof t) {
if (!(t = this.getObjectLayer(t))) return null;
}
return t.objects.find(e, i) || null;
},
findTile: function (t, e, i, n, s, r, o, a) {
return null === (a = this.getLayer(a)) ? null : h.FindTile(t, e, i, n, s, r, o, a);
},
forEachTile: function (t, e, i, n, s, r, o, a) {
return null === (a = this.getLayer(a)) ? null : (h.ForEachTile(t, e, i, n, s, r, o, a), this);
},
getImageIndex: function (t) {
return this.getIndex(this.images, t);
},
getImageLayerNames: function () {
return this.images && Array.isArray(this.images)
? this.images.map(function (t) {
return t.name;
})
: [];
},
getIndex: function (t, e) {
for (var i = 0; i < t.length; i++) if (t[i].name === e) return i;
return null;
},
getLayer: function (t) {
var e = this.getLayerIndex(t);
return null !== e ? this.layers[e] : null;
},
getObjectLayer: function (t) {
var e = this.getIndex(this.objects, t);
return null !== e ? this.objects[e] : null;
},
getObjectLayerNames: function () {
return this.objects && Array.isArray(this.objects)
? this.objects.map(function (t) {
return t.name;
})
: [];
},
getLayerIndex: function (t) {
return void 0 === t ? this.currentLayerIndex : "string" == typeof t ? this.getLayerIndexByName(t) : "number" == typeof t && t < this.layers.length ? t : t instanceof g ? t.layerIndex : null;
},
getLayerIndexByName: function (t) {
return this.getIndex(this.layers, t);
},
getTileAt: function (t, e, i, n) {
return null === (n = this.getLayer(n)) ? null : h.GetTileAt(t, e, i, n);
},
getTileAtWorldXY: function (t, e, i, n, s) {
return null === (s = this.getLayer(s)) ? null : h.GetTileAtWorldXY(t, e, i, n, s);
},
getTileLayerNames: function () {
return this.layers && Array.isArray(this.layers)
? this.layers.map(function (t) {
return t.name;
})
: [];
},
getTilesWithin: function (t, e, i, n, s, r) {
return null === (r = this.getLayer(r)) ? null : h.GetTilesWithin(t, e, i, n, s, r);
},
getTilesWithinShape: function (t, e, i, n) {
return null === (n = this.getLayer(n)) ? null : h.GetTilesWithinShape(t, e, i, n);
},
getTilesWithinWorldXY: function (t, e, i, n, s, r, o) {
return null === (o = this.getLayer(o)) ? null : h.GetTilesWithinWorldXY(t, e, i, n, s, r, o);
},
getTileset: function (t) {
var e = this.getIndex(this.tilesets, t);
return null !== e ? this.tilesets[e] : null;
},
getTilesetIndex: function (t) {
return this.getIndex(this.tilesets, t);
},
hasTileAt: function (t, e, i) {
return null === (i = this.getLayer(i)) ? null : h.HasTileAt(t, e, i);
},
hasTileAtWorldXY: function (t, e, i, n) {
return null === (n = this.getLayer(n)) ? null : h.HasTileAtWorldXY(t, e, i, n);
},
layer: {
get: function () {
return this.layers[this.currentLayerIndex];
},
set: function (t) {
this.setLayer(t);
},
},
putTileAt: function (t, e, i, n, s) {
return void 0 === n && (n = !0), null === (s = this.getLayer(s)) ? null : h.PutTileAt(t, e, i, n, s);
},
putTileAtWorldXY: function (t, e, i, n, s, r) {
return void 0 === n && (n = !0), null === (r = this.getLayer(r)) ? null : h.PutTileAtWorldXY(t, e, i, n, s, r);
},
putTilesAt: function (t, e, i, n, s) {
return void 0 === n && (n = !0), null === (s = this.getLayer(s)) ? null : (h.PutTilesAt(t, e, i, n, s), this);
},
randomize: function (t, e, i, n, s, r) {
return null === (r = this.getLayer(r)) ? null : (h.Randomize(t, e, i, n, s, r), this);
},
calculateFacesAt: function (t, e, i) {
return null === (i = this.getLayer(i)) ? null : (h.CalculateFacesAt(t, e, i), this);
},
calculateFacesWithin: function (t, e, i, n, s) {
return null === (s = this.getLayer(s)) ? null : (h.CalculateFacesWithin(t, e, i, n, s), this);
},
removeLayer: function (t) {
var e = this.getLayerIndex(t);
if (null === e) return null;
r(this.layers, e);
for (var i = e; i < this.layers.length; i++) this.layers[i].tilemapLayer && this.layers[i].tilemapLayer.layerIndex--;
return this.currentLayerIndex === e && (this.currentLayerIndex = 0), this;
},
destroyLayer: function (t) {
var e = this.getLayerIndex(t);
return null !== e ? ((t = this.layers[e]).destroy(), r(this.layers, e), this.currentLayerIndex === e && (this.currentLayerIndex = 0), this) : null;
},
removeAllLayers: function () {
for (var t = this.layers, e = 0; e < t.length; e++) t[e].tilemapLayer && t[e].tilemapLayer.destroy(!1);
return (t.length = 0), (this.currentLayerIndex = 0), this;
},
removeTile: function (t, e, i) {
void 0 === e && (e = -1), void 0 === i && (i = !0);
var n = [];
Array.isArray(t) || (t = [t]);
for (var s = 0; s < t.length; s++) {
var r = t[s];
n.push(this.removeTileAt(r.x, r.y, !0, i, r.tilemapLayer)), -1 < e && this.putTileAt(e, r.x, r.y, i, r.tilemapLayer);
}
return n;
},
removeTileAt: function (t, e, i, n, s) {
return void 0 === i && (i = !0), void 0 === n && (n = !0), null === (s = this.getLayer(s)) ? null : h.RemoveTileAt(t, e, i, n, s);
},
removeTileAtWorldXY: function (t, e, i, n, s, r) {
return void 0 === i && (i = !0), void 0 === n && (n = !0), null === (r = this.getLayer(r)) ? null : h.RemoveTileAtWorldXY(t, e, i, n, s, r);
},
renderDebug: function (t, e, i) {
return null === (i = this.getLayer(i)) ? null : (this.orientation === s.ORTHOGONAL && h.RenderDebug(t, e, i), this);
},
renderDebugFull: function (t, e) {
for (var i = this.layers, n = 0; n < i.length; n++) h.RenderDebug(t, e, i[n]);
return this;
},
replaceByIndex: function (t, e, i, n, s, r, o) {
return null === (o = this.getLayer(o)) ? null : (h.ReplaceByIndex(t, e, i, n, s, r, o), this);
},
setCollision: function (t, e, i, n, s) {
return void 0 === e && (e = !0), void 0 === i && (i = !0), void 0 === s && (s = !0), null === (n = this.getLayer(n)) ? null : (h.SetCollision(t, e, i, n, s), this);
},
setCollisionBetween: function (t, e, i, n, s) {
return void 0 === i && (i = !0), void 0 === n && (n = !0), null === (s = this.getLayer(s)) ? null : (h.SetCollisionBetween(t, e, i, n, s), this);
},
setCollisionByProperty: function (t, e, i, n) {
return void 0 === e && (e = !0), void 0 === i && (i = !0), null === (n = this.getLayer(n)) ? null : (h.SetCollisionByProperty(t, e, i, n), this);
},
setCollisionByExclusion: function (t, e, i, n) {
return void 0 === e && (e = !0), void 0 === i && (i = !0), null === (n = this.getLayer(n)) ? null : (h.SetCollisionByExclusion(t, e, i, n), this);
},
setCollisionFromCollisionGroup: function (t, e, i) {
return void 0 === t && (t = !0), void 0 === e && (e = !0), null === (i = this.getLayer(i)) ? null : (h.SetCollisionFromCollisionGroup(t, e, i), this);
},
setTileIndexCallback: function (t, e, i, n) {
return null === (n = this.getLayer(n)) ? null : (h.SetTileIndexCallback(t, e, i, n), this);
},
setTileLocationCallback: function (t, e, i, n, s, r, o) {
return null === (o = this.getLayer(o)) ? null : (h.SetTileLocationCallback(t, e, i, n, s, r, o), this);
},
setLayer: function (t) {
var e = this.getLayerIndex(t);
return null !== e && (this.currentLayerIndex = e), this;
},
setBaseTileSize: function (t, e) {
(this.tileWidth = t), (this.tileHeight = e), (this.widthInPixels = this.width * t), (this.heightInPixels = this.height * e);
for (var i = 0; i < this.layers.length; i++) {
(this.layers[i].baseTileWidth = t), (this.layers[i].baseTileHeight = e);
for (var n = this.layers[i].data, s = this.layers[i].width, r = this.layers[i].height, o = 0; o < r; o++)
for (var a = 0; a < s; a++) {
var h = n[o][a];
null !== h && h.setSize(void 0, void 0, t, e);
}
}
return this;
},
setLayerTileSize: function (t, e, i) {
if (null === (i = this.getLayer(i))) return this;
(i.tileWidth = t), (i.tileHeight = e);
for (var n = i.data, s = i.width, r = i.height, o = 0; o < r; o++)
for (var a = 0; a < s; a++) {
var h = n[o][a];
null !== h && h.setSize(t, e);
}
return this;
},
shuffle: function (t, e, i, n, s) {
return null === (s = this.getLayer(s)) ? null : (h.Shuffle(t, e, i, n, s), this);
},
swapByIndex: function (t, e, i, n, s, r, o) {
return null === (o = this.getLayer(o)) ? null : (h.SwapByIndex(t, e, i, n, s, r, o), this);
},
tileToWorldX: function (t, e, i) {
return null === (i = this.getLayer(i)) ? null : this._convert.TileToWorldX(t, e, i);
},
tileToWorldY: function (t, e, i) {
return null === (i = this.getLayer(i)) ? null : this._convert.TileToWorldY(t, e, i);
},
tileToWorldXY: function (t, e, i, n, s) {
return null === (s = this.getLayer(s)) ? null : this._convert.TileToWorldXY(t, e, i, n, s);
},
weightedRandomize: function (t, e, i, n, s, r) {
return null === (r = this.getLayer(r)) ? null : (h.WeightedRandomize(e, i, n, s, t, r), this);
},
worldToTileX: function (t, e, i, n) {
return null === (n = this.getLayer(n)) ? null : this._convert.WorldToTileX(t, e, i, n);
},
worldToTileY: function (t, e, i, n) {
return null === (n = this.getLayer(n)) ? null : this._convert.WorldToTileY(t, e, i, n);
},
worldToTileXY: function (t, e, i, n, s, r) {
return null === (r = this.getLayer(r)) ? null : this._convert.WorldToTileXY(t, e, i, n, s, r);
},
destroy: function () {
this.removeAllLayers(), (this.tilesets.length = 0), (this.objects.length = 0), (this.scene = null);
},
});
t.exports = o;
},
function (t, e, i) {
var n = i(0),
s = i(11),
o = i(15),
a = i(251),
r = i(1456),
h = new n({
Extends: o,
Mixins: [s.Alpha, s.BlendMode, s.ComputedSize, s.Depth, s.Flip, s.GetBounds, s.Origin, s.Pipeline, s.Transform, s.Visible, s.ScrollFactor, r],
initialize: function (t, e, i, n, s, r) {
o.call(this, t, "TilemapLayer"),
(this.isTilemap = !0),
(this.tilemap = e),
(this.layerIndex = i),
(this.layer = e.layers[i]),
((this.layer.tilemapLayer = this).tileset = []),
(this.tilesDrawn = 0),
(this.tilesTotal = this.layer.width * this.layer.height),
(this.culledTiles = []),
(this.skipCull = !1),
(this.cullPaddingX = 1),
(this.cullPaddingY = 1),
(this.cullCallback = a.GetCullTilesFunction(this.layer.orientation)),
(this._renderOrder = 0),
(this.gidMap = []),
this.setTilesets(n),
this.setAlpha(this.layer.alpha),
this.setPosition(s, r),
this.setOrigin(),
this.setSize(e.tileWidth * this.layer.width, e.tileHeight * this.layer.height),
this.initPipeline();
},
setTilesets: function (t) {
var e = [],
i = [],
n = this.tilemap;
Array.isArray(t) || (t = [t]);
for (var s = 0; s < t.length; s++) {
var r = t[s];
if (("string" == typeof r && (r = n.getTileset(r)), r)) {
i.push(r);
for (var o = r.firstgid, a = 0; a < r.total; a++) e[o + a] = r;
}
}
(this.gidMap = e), (this.tileset = i);
},
setRenderOrder: function (t) {
return "string" == typeof t && (t = ["right-down", "left-down", "right-up", "left-up"].indexOf(t)), 0 <= t && t < 4 && (this._renderOrder = t), this;
},
calculateFacesAt: function (t, e) {
return a.CalculateFacesAt(t, e, this.layer), this;
},
calculateFacesWithin: function (t, e, i, n) {
return a.CalculateFacesWithin(t, e, i, n, this.layer), this;
},
createFromTiles: function (t, e, i, n, s) {
return a.CreateFromTiles(t, e, i, n, s, this.layer);
},
cull: function (t) {
return this.cullCallback(this.layer, t, this.culledTiles, this._renderOrder);
},
copy: function (t, e, i, n, s, r, o) {
return a.Copy(t, e, i, n, s, r, o, this.layer), this;
},
fill: function (t, e, i, n, s, r) {
return a.Fill(t, e, i, n, s, r, this.layer), this;
},
filterTiles: function (t, e, i, n, s, r, o) {
return a.FilterTiles(t, e, i, n, s, r, o, this.layer);
},
findByIndex: function (t, e, i) {
return a.FindByIndex(t, e, i, this.layer);
},
findTile: function (t, e, i, n, s, r, o) {
return a.FindTile(t, e, i, n, s, r, o, this.layer);
},
forEachTile: function (t, e, i, n, s, r, o) {
return a.ForEachTile(t, e, i, n, s, r, o, this.layer), this;
},
getTileAt: function (t, e, i) {
return a.GetTileAt(t, e, i, this.layer);
},
getTileAtWorldXY: function (t, e, i, n) {
return a.GetTileAtWorldXY(t, e, i, n, this.layer);
},
getTilesWithin: function (t, e, i, n, s) {
return a.GetTilesWithin(t, e, i, n, s, this.layer);
},
getTilesWithinShape: function (t, e, i) {
return a.GetTilesWithinShape(t, e, i, this.layer);
},
getTilesWithinWorldXY: function (t, e, i, n, s, r) {
return a.GetTilesWithinWorldXY(t, e, i, n, s, r, this.layer);
},
hasTileAt: function (t, e) {
return a.HasTileAt(t, e, this.layer);
},
hasTileAtWorldXY: function (t, e, i) {
return a.HasTileAtWorldXY(t, e, i, this.layer);
},
putTileAt: function (t, e, i, n) {
return a.PutTileAt(t, e, i, n, this.layer);
},
putTileAtWorldXY: function (t, e, i, n, s) {
return a.PutTileAtWorldXY(t, e, i, n, s, this.layer);
},
putTilesAt: function (t, e, i, n) {
return a.PutTilesAt(t, e, i, n, this.layer), this;
},
randomize: function (t, e, i, n, s) {
return a.Randomize(t, e, i, n, s, this.layer), this;
},
removeTileAt: function (t, e, i, n) {
return a.RemoveTileAt(t, e, i, n, this.layer);
},
removeTileAtWorldXY: function (t, e, i, n, s) {
return a.RemoveTileAtWorldXY(t, e, i, n, s, this.layer);
},
renderDebug: function (t, e) {
return a.RenderDebug(t, e, this.layer), this;
},
replaceByIndex: function (t, e, i, n, s, r) {
return a.ReplaceByIndex(t, e, i, n, s, r, this.layer), this;
},
setSkipCull: function (t) {
return void 0 === t && (t = !0), (this.skipCull = t), this;
},
setCullPadding: function (t, e) {
return void 0 === t && (t = 1), void 0 === e && (e = 1), (this.cullPaddingX = t), (this.cullPaddingY = e), this;
},
setCollision: function (t, e, i, n) {
return a.SetCollision(t, e, i, this.layer, n), this;
},
setCollisionBetween: function (t, e, i, n) {
return a.SetCollisionBetween(t, e, i, n, this.layer), this;
},
setCollisionByProperty: function (t, e, i) {
return a.SetCollisionByProperty(t, e, i, this.layer), this;
},
setCollisionByExclusion: function (t, e, i) {
return a.SetCollisionByExclusion(t, e, i, this.layer), this;
},
setCollisionFromCollisionGroup: function (t, e) {
return a.SetCollisionFromCollisionGroup(t, e, this.layer), this;
},
setTileIndexCallback: function (t, e, i) {
return a.SetTileIndexCallback(t, e, i, this.layer), this;
},
setTileLocationCallback: function (t, e, i, n, s, r) {
return a.SetTileLocationCallback(t, e, i, n, s, r, this.layer), this;
},
shuffle: function (t, e, i, n) {
return a.Shuffle(t, e, i, n, this.layer), this;
},
swapByIndex: function (t, e, i, n, s, r) {
return a.SwapByIndex(t, e, i, n, s, r, this.layer), this;
},
tileToWorldX: function (t, e) {
return this.tilemap.tileToWorldX(t, e, this);
},
tileToWorldY: function (t, e) {
return this.tilemap.tileToWorldY(t, e, this);
},
tileToWorldXY: function (t, e, i, n) {
return this.tilemap.tileToWorldXY(t, e, i, n, this);
},
weightedRandomize: function (t, e, i, n, s) {
return a.WeightedRandomize(e, i, n, s, t, this.layer), this;
},
worldToTileX: function (t, e, i) {
return this.tilemap.worldToTileX(t, e, i, this);
},
worldToTileY: function (t, e, i) {
return this.tilemap.worldToTileY(t, e, i, this);
},
worldToTileXY: function (t, e, i, n, s) {
return this.tilemap.worldToTileXY(t, e, i, n, s, this);
},
destroy: function (t) {
void 0 === t && (t = !0),
this.tilemap &&
(this.layer.tilemapLayer === this && (this.layer.tilemapLayer = void 0),
t && this.tilemap.removeLayer(this),
(this.tilemap = void 0),
(this.layer = void 0),
(this.culledTiles.length = 0),
(this.cullCallback = null),
(this.gidMap = []),
(this.tileset = []),
o.prototype.destroy.call(this));
},
});
t.exports = h;
},
function (t, e, i) {
var n = i(0),
s = i(2),
r = new n({
initialize: function (t) {
(this.delay = 0),
(this.repeat = 0),
(this.repeatCount = 0),
(this.loop = !1),
this.callback,
this.callbackScope,
this.args,
(this.timeScale = 1),
(this.startAt = 0),
(this.elapsed = 0),
(this.paused = !1),
(this.hasDispatched = !1),
this.reset(t);
},
reset: function (t) {
return (
(this.delay = s(t, "delay", 0)),
(this.repeat = s(t, "repeat", 0)),
(this.loop = s(t, "loop", !1)),
(this.callback = s(t, "callback", void 0)),
(this.callbackScope = s(t, "callbackScope", this.callback)),
(this.args = s(t, "args", [])),
(this.timeScale = s(t, "timeScale", 1)),
(this.startAt = s(t, "startAt", 0)),
(this.paused = s(t, "paused", !1)),
(this.elapsed = this.startAt),
(this.hasDispatched = !1),
(this.repeatCount = -1 === this.repeat || this.loop ? 999999999999 : this.repeat),
this
);
},
getProgress: function () {
return this.elapsed / this.delay;
},
getOverallProgress: function () {
if (0 < this.repeat) {
var t = this.delay + this.delay * this.repeat;
return (this.elapsed + this.delay * (this.repeat - this.repeatCount)) / t;
}
return this.getProgress();
},
getRepeatCount: function () {
return this.repeatCount;
},
getElapsed: function () {
return this.elapsed;
},
getElapsedSeconds: function () {
return 0.001 * this.elapsed;
},
getRemaining: function () {
return this.delay - this.elapsed;
},
getRemainingSeconds: function () {
return 0.001 * this.getRemaining();
},
getOverallRemaining: function () {
return this.delay * (1 + this.repeatCount) - this.elapsed;
},
getOverallRemainingSeconds: function () {
return 0.001 * this.getOverallRemaining();
},
remove: function (t) {
void 0 === t && (t = !1), (this.elapsed = this.delay), (this.hasDispatched = !t), (this.repeatCount = 0);
},
destroy: function () {
(this.callback = void 0), (this.callbackScope = void 0), (this.args = []);
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(1465);
t.exports = function (t) {
var e,
i = [];
if (t.hasOwnProperty("props")) for (e in t.props) "_" !== e.substr(0, 1) && i.push({ key: e, value: t.props[e] });
else for (e in t) -1 === n.indexOf(e) && "_" !== e.substr(0, 1) && i.push({ key: e, value: t[e] });
return i;
};
},
function (t, e, i) {
var n = i(6);
t.exports = function (t) {
var e = n(t, "tweens", null);
return null === e ? [] : ("function" == typeof e && (e = e.call()), Array.isArray(e) || (e = [e]), e);
};
},
function (t, e, i) {
var P = i(265),
A = i(13),
M = i(99),
C = i(80),
O = i(162),
k = i(6),
R = i(264),
L = i(266),
I = i(268);
t.exports = function (t, e, i) {
void 0 === i && (i = P);
var n = k(e, "from", 0),
s = k(e, "to", 1),
r = [{ value: n }],
o = O(e, "delay", i.delay),
a = O(e, "duration", i.duration),
h = k(e, "easeParams", i.easeParams),
l = C(k(e, "ease", i.ease), h),
u = O(e, "hold", i.hold),
c = O(e, "repeat", i.repeat),
d = O(e, "repeatDelay", i.repeatDelay),
f = M(e, "yoyo", i.yoyo),
p = [],
g = R("value", s),
v = I(r[0], 0, "value", g.getEnd, g.getStart, g.getActive, l, o, a, f, u, c, d, !1, !1);
(v.start = n), (v.current = n), (v.to = s), p.push(v);
var y = new L(t, p, r);
(y.offset = A(e, "offset", null)),
(y.completeDelay = A(e, "completeDelay", 0)),
(y.loop = Math.round(A(e, "loop", 0))),
(y.loopDelay = Math.round(A(e, "loopDelay", 0))),
(y.paused = M(e, "paused", !1)),
(y.useFrames = M(e, "useFrames", !1));
for (var m = k(e, "callbackScope", y), x = [y, null], b = L.TYPES, w = 0; w < b.length; w++) {
var T,
S,
_ = b[w],
E = k(e, _, !1);
E && ((T = k(e, _ + "Scope", m)), (S = k(e, _ + "Params", [])), y.setCallback(_, E, x.concat(S), T));
}
return y;
};
},
function (t, e, i) {
var P = i(80),
A = i(6),
M = i(14);
t.exports = function (t, e) {
void 0 === e && (e = {});
var h = A(e, "start", 0),
i = A(e, "ease", null),
n = A(e, "grid", null),
a = A(e, "from", 0),
l = "first" === a,
u = "center" === a,
c = "last" === a,
d = "number" == typeof a,
f = Array.isArray(t),
p = f ? parseFloat(t[0]) : parseFloat(t),
g = f ? parseFloat(t[1]) : 0,
v = Math.max(p, g);
if ((f && (h += p), n)) {
var s,
r,
y = n[0],
m = n[1],
o = 0,
x = 0,
b = [];
c ? ((o = y - 1), (x = m - 1)) : d ? ((o = a % y), (x = Math.floor(a / y))) : u && ((o = (y - 1) / 2), (x = (m - 1) / 2));
for (var w = M.MIN_SAFE_INTEGER, T = 0; T < m; T++) {
b[T] = [];
for (var S = 0; S < y; S++) {
(s = o - S), (r = x - T);
var _ = Math.sqrt(s * s + r * r);
w < _ && (w = _), (b[T][S] = _);
}
}
}
var E = i ? P(i) : null;
return n
? function (t, e, i, n) {
var s,
r = 0,
o = n % y,
a = Math.floor(n / y);
return 0 <= o && o < y && 0 <= a && a < m && (r = b[a][o]), (f ? ((s = g - p), E ? (r / w) * s * E(r / w) : (r / w) * s) : E ? r * p * E(r / w) : r * p) + h;
}
: function (t, e, i, n, s) {
var r, o;
return (
s--,
l ? (r = n) : u ? (r = Math.abs(s / 2 - n)) : c ? (r = s - n) : d && (r = Math.abs(a - n)),
(f ? ((o = u ? ((g - p) / s) * (2 * r) : ((g - p) / s) * r), E ? o * E(r / s) : o) : E ? s * v * E(r / s) : r * p) + h
);
};
};
},
function (t, e, i) {
var _ = i(77),
E = i(265),
P = i(13),
A = i(99),
M = i(80),
C = i(162),
O = i(263),
k = i(584),
R = i(6),
L = i(588),
I = i(163);
t.exports = function (t, e) {
var i = new L(t);
(i.completeDelay = P(e, "completeDelay", 0)), (i.loop = Math.round(P(e, "loop", 0))), (i.loopDelay = Math.round(P(e, "loopDelay", 0))), (i.paused = A(e, "paused", !1)), (i.useFrames = A(e, "useFrames", !1));
var n,
s,
r = R(e, "callbackScope", i),
o = [i],
a = R(e, "onStart", !1);
a && ((n = R(e, "onStartScope", r)), (s = R(e, "onStartParams", [])), i.setCallback("onStart", a, o.concat(s), n));
var h,
l,
u = R(e, "onUpdate", !1);
u && ((h = R(e, "onUpdateScope", r)), (l = R(e, "onUpdateParams", [])), i.setCallback("onUpdate", u, o.concat(l), h));
var c,
d,
f = R(e, "onLoop", !1);
f && ((c = R(e, "onLoopScope", r)), (d = R(e, "onLoopParams", [])), i.setCallback("onLoop", f, o.concat(d), c));
var p,
g,
v = R(e, "onYoyo", !1);
v && ((p = R(e, "onYoyoScope", r)), (g = R(e, "onYoyoParams", [])), i.setCallback("onYoyo", v, o.concat(null, g), p));
var y,
m,
x = R(e, "onComplete", !1);
x && ((y = R(e, "onCompleteScope", r)), (m = R(e, "onCompleteParams", [])), i.setCallback("onComplete", x, o.concat(m), y));
var b = k(e);
if (0 === b.length) return (i.paused = !0), i;
var w = _(E);
w.targets = O(e);
var T = P(e, "totalDuration", 0);
(w.duration = 0 < T ? Math.floor(T / b.length) : C(e, "duration", w.duration)),
(w.delay = C(e, "delay", w.delay)),
(w.easeParams = R(e, "easeParams", w.easeParams)),
(w.ease = M(R(e, "ease", w.ease), w.easeParams)),
(w.hold = C(e, "hold", w.hold)),
(w.repeat = C(e, "repeat", w.repeat)),
(w.repeatDelay = C(e, "repeatDelay", w.repeatDelay)),
(w.yoyo = A(e, "yoyo", w.yoyo)),
(w.flipX = A(e, "flipX", w.flipX)),
(w.flipY = A(e, "flipY", w.flipY));
for (var S = 0; S < b.length; S++) i.queue(I(i, b[S], w));
return i;
};
},
function (t, e, i) {
var n = i(0),
s = i(9),
r = i(267),
o = i(163),
a = i(100),
h = new n({
Extends: s,
initialize: function (t) {
s.call(this),
(this.manager = t),
(this.isTimeline = !0),
(this.data = []),
(this.totalData = 0),
(this.useFrames = !1),
(this.timeScale = 1),
(this.loop = 0),
(this.loopDelay = 0),
(this.loopCounter = 0),
(this.completeDelay = 0),
(this.countdown = 0),
(this.state = a.PENDING_ADD),
(this._pausedState = a.PENDING_ADD),
(this.paused = !1),
(this.elapsed = 0),
(this.totalElapsed = 0),
(this.duration = 0),
(this.progress = 0),
(this.totalDuration = 0),
(this.totalProgress = 0),
(this.callbacks = { onComplete: null, onLoop: null, onStart: null, onUpdate: null, onYoyo: null }),
this.callbackScope;
},
dispatchTimelineEvent: function (t, e) {
this.emit(t, this), e && e.func.apply(e.scope, e.params);
},
setTimeScale: function (t) {
return (this.timeScale = t), this;
},
getTimeScale: function () {
return this.timeScale;
},
isPlaying: function () {
return this.state === a.ACTIVE;
},
add: function (t) {
return this.queue(o(this, t));
},
queue: function (t) {
return this.isPlaying() || ((t.parent = this), (t.parentIsTimeline = !0), this.data.push(t), (this.totalData = this.data.length)), this;
},
hasOffset: function (t) {
return null !== t.offset;
},
isOffsetAbsolute: function (t) {
return "number" == typeof t;
},
isOffsetRelative: function (t) {
if ("string" == typeof t) {
var e = t[0];
if ("-" === e || "+" === e) return !0;
}
return !1;
},
getRelativeOffset: function (t, e) {
var i = t[0],
n = parseFloat(t.substr(2)),
s = e;
switch (i) {
case "+":
s += n;
break;
case "-":
s -= n;
}
return Math.max(0, s);
},
calcDuration: function () {
for (var t = 0, e = 0, i = 0, n = 0; n < this.totalData; n++) {
var s = this.data[n];
s.init(),
this.hasOffset(s)
? this.isOffsetAbsolute(s.offset)
? ((s.calculatedOffset = s.offset), 0 === s.offset && (i = 0))
: this.isOffsetRelative(s.offset) && (s.calculatedOffset = this.getRelativeOffset(s.offset, t))
: (s.calculatedOffset = i),
(t = s.totalDuration + s.calculatedOffset),
(e += s.totalDuration),
(i += s.totalDuration);
}
(this.duration = e),
(this.loopCounter = -1 === this.loop ? 999999999999 : this.loop),
0 < this.loopCounter ? (this.totalDuration = this.duration + this.completeDelay + (this.duration + this.loopDelay) * this.loopCounter) : (this.totalDuration = this.duration + this.completeDelay);
},
init: function () {
return this.calcDuration(), (this.progress = 0), (this.totalProgress = 0), !this.paused || ((this.state = a.PAUSED), !1);
},
resetTweens: function (t) {
for (var e = 0; e < this.totalData; e++) this.data[e].play(t);
},
setCallback: function (t, e, i, n) {
return -1 !== h.TYPES.indexOf(t) && (this.callbacks[t] = { func: e, scope: n, params: i }), this;
},
makeActive: function (t) {
return this.manager.makeActive(t);
},
play: function () {
if (this.state !== a.ACTIVE) {
if (this.paused) return (this.paused = !1), void this.manager.makeActive(this);
this.resetTweens(!1), (this.state = a.ACTIVE), this.dispatchTimelineEvent(r.TIMELINE_START, this.callbacks.onStart);
}
},
nextState: function () {
0 < this.loopCounter
? ((this.elapsed = 0),
(this.progress = 0),
this.loopCounter--,
this.resetTweens(!0),
0 < this.loopDelay ? ((this.countdown = this.loopDelay), (this.state = a.LOOP_DELAY)) : ((this.state = a.ACTIVE), this.dispatchTimelineEvent(r.TIMELINE_LOOP, this.callbacks.onLoop)))
: 0 < this.completeDelay
? ((this.state = a.COMPLETE_DELAY), (this.countdown = this.completeDelay))
: ((this.state = a.PENDING_REMOVE), this.dispatchTimelineEvent(r.TIMELINE_COMPLETE, this.callbacks.onComplete));
},
update: function (t, e) {
if (this.state !== a.PAUSED) {
switch (
(this.useFrames && (e = +this.manager.timeScale),
(e *= this.timeScale),
(this.elapsed += e),
(this.progress = Math.min(this.elapsed / this.duration, 1)),
(this.totalElapsed += e),
(this.totalProgress = Math.min(this.totalElapsed / this.totalDuration, 1)),
this.state)
) {
case a.ACTIVE:
for (var i = this.totalData, n = 0; n < this.totalData; n++) this.data[n].update(t, e) && i--;
this.dispatchTimelineEvent(r.TIMELINE_UPDATE, this.callbacks.onUpdate), 0 === i && this.nextState();
break;
case a.LOOP_DELAY:
(this.countdown -= e), this.countdown <= 0 && ((this.state = a.ACTIVE), this.dispatchTimelineEvent(r.TIMELINE_LOOP, this.callbacks.onLoop));
break;
case a.COMPLETE_DELAY:
(this.countdown -= e), this.countdown <= 0 && ((this.state = a.PENDING_REMOVE), this.dispatchTimelineEvent(r.TIMELINE_COMPLETE, this.callbacks.onComplete));
}
return this.state === a.PENDING_REMOVE;
}
},
stop: function () {
this.state = a.PENDING_REMOVE;
},
pause: function () {
if (this.state !== a.PAUSED) return (this.paused = !0), (this._pausedState = this.state), (this.state = a.PAUSED), this.emit(r.TIMELINE_PAUSE, this), this;
},
resume: function () {
return this.state === a.PAUSED && ((this.paused = !1), (this.state = this._pausedState), this.emit(r.TIMELINE_RESUME, this)), this;
},
hasTarget: function (t) {
for (var e = 0; e < this.data.length; e++) if (this.data[e].hasTarget(t)) return !0;
return !1;
},
destroy: function () {
for (var t = 0; t < this.data.length; t++) this.data[t].stop();
},
});
(h.TYPES = ["onStart", "onUpdate", "onLoop", "onComplete", "onYoyo"]), (t.exports = h);
},
function (t, e, i) {
var o = i(86),
c = i(41),
d = i(32),
f = i(2),
s = i(64),
n = {
parseBody: function (t, e, i, n) {
void 0 === n && (n = {});
for (var s = f(i, "fixtures", []), r = [], o = 0; o < s.length; o++) for (var a = this.parseFixture(s[o]), h = 0; h < a.length; h++) r.push(a[h]);
var l = d.clone(i, !0);
d.extend(l, n, !0), delete l.fixtures, delete l.type;
var u = c.create(l);
return c.setParts(u, r), c.setPosition(u, { x: t, y: e }), u;
},
parseFixture: function (t) {
var e,
i,
n,
s,
r = d.extend({}, !1, t);
return (
delete r.circle,
delete r.vertices,
t.circle ? ((e = f(t.circle, "x")), (i = f(t.circle, "y")), (n = f(t.circle, "radius")), (s = [o.circle(e, i, n, r)])) : t.vertices && (s = this.parseVertices(t.vertices, r)),
s
);
},
parseVertices: function (t, e) {
void 0 === e && (e = {});
for (var i = [], n = 0; n < t.length; n++) s.clockwiseSort(t[n]), i.push(c.create(d.extend({ position: s.centre(t[n]), vertices: t[n] }, e)));
return o.flagCoincidentParts(i);
},
};
t.exports = n;
},
function (t, e, i) {
var l = i(86),
u = i(41),
n = {
parseBody: function (t, e, i, n) {
var s;
void 0 === n && (n = {});
var r = i.vertices;
if (1 === r.length) (n.vertices = r[0]), (s = u.create(n)), l.flagCoincidentParts(s.parts);
else {
for (var o = [], a = 0; a < r.length; a++) {
var h = u.create({ vertices: r[a] });
o.push(h);
}
l.flagCoincidentParts(o), (n.parts = o), (s = u.create(n));
}
return (s.label = i.label), u.setPosition(s, { x: t, y: e }), s;
},
};
t.exports = n;
},
function (t, e, i) {
var f = {};
t.exports = f;
var m = i(118),
g = i(128),
v = i(32),
x = i(41),
p = i(86);
(f.stack = function (t, e, i, n, s, r, o) {
for (var a, h = m.create({ label: "Stack" }), l = t, u = e, c = 0, d = 0; d < n; d++) {
for (var f = 0, p = 0; p < i; p++) {
var g,
v,
y = o(l, u, p, d, a, c);
y
? ((g = y.bounds.max.y - y.bounds.min.y),
(v = y.bounds.max.x - y.bounds.min.x),
f < g && (f = g),
x.translate(y, { x: 0.5 * v, y: 0.5 * g }),
(l = y.bounds.max.x + s),
m.addBody(h, y),
(a = y),
(c += 1))
: (l += s);
}
(u += f + r), (l = t);
}
return h;
}),
(f.chain = function (t, e, i, n, s, r) {
for (var o = t.bodies, a = 1; a < o.length; a++) {
var h = o[a - 1],
l = o[a],
u = h.bounds.max.y - h.bounds.min.y,
c = h.bounds.max.x - h.bounds.min.x,
d = l.bounds.max.y - l.bounds.min.y,
f = { bodyA: h, pointA: { x: c * e, y: u * i }, bodyB: l, pointB: { x: (l.bounds.max.x - l.bounds.min.x) * n, y: d * s } },
p = v.extend(f, r);
m.addConstraint(t, g.create(p));
}
return (t.label += " Chain"), t;
}),
(f.mesh = function (t, e, i, n, s) {
for (var r, o, a, h, l = t.bodies, u = 0; u < i; u++) {
for (r = 1; r < e; r++) (o = l[r - 1 + u * e]), (a = l[r + u * e]), m.addConstraint(t, g.create(v.extend({ bodyA: o, bodyB: a }, s)));
if (0 < u)
for (r = 0; r < e; r++)
(o = l[r + (u - 1) * e]),
(a = l[r + u * e]),
m.addConstraint(t, g.create(v.extend({ bodyA: o, bodyB: a }, s))),
n && 0 < r && ((h = l[r - 1 + (u - 1) * e]), m.addConstraint(t, g.create(v.extend({ bodyA: h, bodyB: a }, s)))),
n && r < e - 1 && ((h = l[r + 1 + (u - 1) * e]), m.addConstraint(t, g.create(v.extend({ bodyA: h, bodyB: a }, s))));
}
return (t.label += " Mesh"), t;
}),
(f.pyramid = function (h, t, l, u, c, e, d) {
return f.stack(h, t, l, u, c, e, function (t, e, i, n, s, r) {
var o = Math.min(u, Math.ceil(l / 2)),
a = s ? s.bounds.max.x - s.bounds.min.x : 0;
if (!(o < n || i < (n = o - n) || l - 1 - n < i)) return 1 === r && x.translate(s, { x: (i + (l % 2 == 1 ? 1 : -1)) * a, y: 0 }), d(h + (s ? i * a : 0) + i * c, e, i, n, s, r);
});
}),
(f.newtonsCradle = function (t, e, i, n, s) {
for (var r = m.create({ label: "Newtons Cradle" }), o = 0; o < i; o++) {
var a = p.circle(t + o * (1.9 * n), e + s, n, { inertia: 1 / 0, restitution: 1, friction: 0, frictionAir: 1e-4, slop: 1 }),
h = g.create({ pointA: { x: t + o * (1.9 * n), y: e }, bodyB: a });
m.addBody(r, a), m.addConstraint(r, h);
}
return r;
}),
(f.car = function (t, e, i, n, s) {
var r = x.nextGroup(!0),
o = 0.5 * -i + 20,
a = 0.5 * i - 20,
h = m.create({ label: "Car" }),
l = p.rectangle(t, e, i, n, { collisionFilter: { group: r }, chamfer: { radius: 0.5 * n }, density: 2e-4 }),
u = p.circle(t + o, e + 0, s, { collisionFilter: { group: r }, friction: 0.8 }),
c = p.circle(t + a, e + 0, s, { collisionFilter: { group: r }, friction: 0.8 }),
d = g.create({ bodyB: l, pointB: { x: o, y: 0 }, bodyA: u, stiffness: 1, length: 0 }),
f = g.create({ bodyB: l, pointB: { x: a, y: 0 }, bodyA: c, stiffness: 1, length: 0 });
return m.addBody(h, l), m.addBody(h, u), m.addBody(h, c), m.addConstraint(h, d), m.addConstraint(h, f), h;
}),
(f.softBody = function (t, e, i, n, s, r, o, a, h, l) {
(h = v.extend({ inertia: 1 / 0 }, h)), (l = v.extend({ stiffness: 0.2, render: { type: "line", anchors: !1 } }, l));
var u = f.stack(t, e, i, n, s, r, function (t, e) {
return p.circle(t, e, a, h);
});
return f.mesh(u, i, n, o, l), (u.label = "Soft Body"), u;
});
},
function (t, e, i) {
var x = {};
(t.exports = x), i(84);
var b = i(32);
(x.pathToVertices = function (t, e) {
"undefined" == typeof window || "SVGPathSeg" in window || b.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");
var i,
n,
s,
r,
o,
a,
h,
l,
u,
c,
d,
f = [],
p = 0,
g = 0,
v = 0;
function y(t, e, i) {
var n,
s = i % 2 == 1 && 1 < i;
(u && t == u.x && e == u.y) || ((d = u && s ? ((c = u.x), u.y) : (c = 0)), (n = { x: c + t, y: d + e }), (!s && u) || (u = n), f.push(n), (g = c + t), (v = d + e));
}
function m(t) {
var e = t.pathSegTypeAsLetter.toUpperCase();
if ("Z" !== e) {
switch (e) {
case "M":
case "L":
case "T":
case "C":
case "S":
case "Q":
(g = t.x), (v = t.y);
break;
case "H":
g = t.x;
break;
case "V":
v = t.y;
}
y(g, v, t.pathSegType);
}
}
for (e = e || 15, x._svgPathToAbsolute(t), s = t.getTotalLength(), a = [], i = 0; i < t.pathSegList.numberOfItems; i += 1) a.push(t.pathSegList.getItem(i));
for (h = a.concat(); p < s; ) {
if ((o = a[t.getPathSegAtLength(p)]) != l) {
for (; h.length && h[0] != o; ) m(h.shift());
l = o;
}
switch (o.pathSegTypeAsLetter.toUpperCase()) {
case "C":
case "T":
case "S":
case "Q":
case "A":
y((r = t.getPointAtLength(p)).x, r.y, 0);
}
p += e;
}
for (i = 0, n = h.length; i < n; ++i) m(h[i]);
return f;
}),
(x._svgPathToAbsolute = function (t) {
for (var e, i, n, s, r, o, a = t.pathSegList, h = 0, l = 0, u = a.numberOfItems, c = 0; c < u; ++c) {
var d = a.getItem(c),
f = d.pathSegTypeAsLetter;
if (/[MLHVCSQTA]/.test(f)) "x" in d && (h = d.x), "y" in d && (l = d.y);
else
switch (("x1" in d && (n = h + d.x1), "x2" in d && (r = h + d.x2), "y1" in d && (s = l + d.y1), "y2" in d && (o = l + d.y2), "x" in d && (h += d.x), "y" in d && (l += d.y), f)) {
case "m":
a.replaceItem(t.createSVGPathSegMovetoAbs(h, l), c);
break;
case "l":
a.replaceItem(t.createSVGPathSegLinetoAbs(h, l), c);
break;
case "h":
a.replaceItem(t.createSVGPathSegLinetoHorizontalAbs(h), c);
break;
case "v":
a.replaceItem(t.createSVGPathSegLinetoVerticalAbs(l), c);
break;
case "c":
a.replaceItem(t.createSVGPathSegCurvetoCubicAbs(h, l, n, s, r, o), c);
break;
case "s":
a.replaceItem(t.createSVGPathSegCurvetoCubicSmoothAbs(h, l, r, o), c);
break;
case "q":
a.replaceItem(t.createSVGPathSegCurvetoQuadraticAbs(h, l, n, s), c);
break;
case "t":
a.replaceItem(t.createSVGPathSegCurvetoQuadraticSmoothAbs(h, l), c);
break;
case "a":
a.replaceItem(t.createSVGPathSegArcAbs(h, l, d.r1, d.r2, d.angle, d.largeArcFlag, d.sweepFlag), c);
break;
case "z":
case "Z":
(h = e), (l = i);
}
("M" != f && "m" != f) || ((e = h), (i = l));
}
});
},
function (t, e, i) {
var m = i(86),
x = i(41),
n = i(0),
s = i(249),
o = i(9),
b = i(2),
w = i(126),
T = i(64),
r = new n({
Extends: o,
Mixins: [s.Bounce, s.Collision, s.Friction, s.Gravity, s.Mass, s.Sensor, s.Sleep, s.Static],
initialize: function (t, e, i) {
o.call(this), (this.tile = e), (this.world = t), e.physics.matterBody && e.physics.matterBody.destroy(), (e.physics.matterBody = this);
var n,
s = b(i, "body", null),
r = b(i, "addToWorld", !0);
s ? this.setBody(s, r) : ((n = e.getCollisionGroup()), 0 < b(n, "objects", []).length ? this.setFromTileCollision(i) : this.setFromTileRectangle(i));
},
setFromTileRectangle: function (t) {
void 0 === t && (t = {}), w(t, "isStatic") || (t.isStatic = !0), w(t, "addToWorld") || (t.addToWorld = !0);
var e = this.tile.getBounds(),
i = e.x + e.width / 2,
n = e.y + e.height / 2,
s = m.rectangle(i, n, e.width, e.height, t);
return this.setBody(s, t.addToWorld), this;
},
setFromTileCollision: function (t) {
void 0 === t && (t = {}), w(t, "isStatic") || (t.isStatic = !0), w(t, "addToWorld") || (t.addToWorld = !0);
for (
var e = this.tile.tilemapLayer.scaleX,
i = this.tile.tilemapLayer.scaleY,
n = this.tile.getLeft(),
s = this.tile.getTop(),
r = this.tile.getCollisionGroup(),
o = b(r, "objects", []),
a = [],
h = 0;
h < o.length;
h++
) {
var l,
u,
c,
d = o[h],
f = n + d.x * e,
p = s + d.y * i,
g = d.width * e,
v = d.height * i,
y = null;
d.rectangle
? (y = m.rectangle(f + g / 2, p + v / 2, g, v, t))
: d.ellipse
? (y = m.circle(f + g / 2, p + v / 2, g / 2, t))
: (d.polygon || d.polyline) &&
((l = (d.polygon ? d.polygon : d.polyline).map(function (t) {
return { x: t.x * e, y: t.y * i };
})),
(u = T.create(l)),
(f += (c = T.centre(u)).x),
(p += c.y),
(y = m.fromVertices(f, p, u, t))),
y && a.push(y);
}
return 1 === a.length ? this.setBody(a[0], t.addToWorld) : 1 < a.length && ((t.parts = a), this.setBody(x.create(t), t.addToWorld)), this;
},
setBody: function (t, e) {
return void 0 === e && (e = !0), this.body && this.removeBody(), (this.body = t), (this.body.gameObject = this), e && this.world.add(this.body), this;
},
removeBody: function () {
return this.body && (this.world.remove(this.body), (this.body.gameObject = void 0), (this.body = void 0)), this;
},
destroy: function () {
this.removeBody(), (this.tile.physics.matterBody = void 0), this.removeAllListeners();
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(1399);
(n.Body = i(41)),
(n.Composite = i(118)),
(n.World = i(596)),
(n.Detector = i(273)),
(n.Grid = i(597)),
(n.Pairs = i(598)),
(n.Pair = i(250)),
(n.Query = i(1400)),
(n.Resolver = i(599)),
(n.SAT = i(274)),
(n.Constraint = i(128)),
(n.Common = i(32)),
(n.Engine = i(1401)),
(n.Events = i(166)),
(n.Sleeping = i(165)),
(n.Plugin = i(595)),
(n.Bodies = i(86)),
(n.Composites = i(591)),
(n.Axes = i(271)),
(n.Bounds = i(84)),
(n.Svg = i(592)),
(n.Vector = i(83)),
(n.Vertices = i(64)),
(n.World.add = n.Composite.add),
(n.World.remove = n.Composite.remove),
(n.World.addComposite = n.Composite.addComposite),
(n.World.addBody = n.Composite.addBody),
(n.World.addConstraint = n.Composite.addConstraint),
(n.World.clear = n.Composite.clear),
(t.exports = n);
},
function (t, e, i) {
var a = {};
t.exports = a;
var h = i(32);
(a._registry = {}),
(a.register = function (t) {
var e, i, n;
return (
a.isPlugin(t) || h.warn("Plugin.register:", a.toString(t), "does not implement all required fields."),
t.name in a._registry
? ((e = a._registry[t.name]),
(i = a.versionParse(t.version).number),
(n = a.versionParse(e.version).number) < i
? (h.warn("Plugin.register:", a.toString(e), "was upgraded to", a.toString(t)), (a._registry[t.name] = t))
: i < n
? h.warn("Plugin.register:", a.toString(e), "can not be downgraded to", a.toString(t))
: t !== e && h.warn("Plugin.register:", a.toString(t), "is already registered to different plugin object"))
: (a._registry[t.name] = t),
t
);
}),
(a.resolve = function (t) {
return a._registry[a.dependencyParse(t).name];
}),
(a.toString = function (t) {
return "string" == typeof t ? t : (t.name || "anonymous") + "@" + (t.version || t.range || "0.0.0");
}),
(a.isPlugin = function (t) {
return t && t.name && t.version && t.install;
}),
(a.isUsed = function (t, e) {
return -1 < t.used.indexOf(e);
}),
(a.isFor = function (t, e) {
var i = t.for && a.dependencyParse(t.for);
return !t.for || (e.name === i.name && a.versionSatisfies(e.version, i.range));
}),
(a.use = function (t, e) {
if (((t.uses = (t.uses || []).concat(e || [])), 0 !== t.uses.length)) {
for (var i, n = a.dependencies(t), s = h.topologicalSort(n), r = [], o = 0; o < s.length; o += 1)
s[o] !== t.name &&
((i = a.resolve(s[o]))
? a.isUsed(t, i.name) ||
(a.isFor(i, t) || (h.warn("Plugin.use:", a.toString(i), "is for", i.for, "but installed on", a.toString(t) + "."), (i._warned = !0)),
i.install ? i.install(t) : (h.warn("Plugin.use:", a.toString(i), "does not specify an install function."), (i._warned = !0)),
i._warned ? (r.push("🔶 " + a.toString(i)), delete i._warned) : r.push("✅ " + a.toString(i)),
t.used.push(i.name))
: r.push("⌠" + s[o]));
0 < r.length && !i.silent && h.info(r.join(" "));
} else h.warn("Plugin.use:", a.toString(t), "does not specify any dependencies to install.");
}),
(a.dependencies = function (n, t) {
var s = a.dependencyParse(n),
e = s.name;
if (!(e in (t = t || {}))) {
(n = a.resolve(n) || n),
(t[e] = h.map(n.uses || [], function (t) {
a.isPlugin(t) && a.register(t);
var e = a.dependencyParse(t),
i = a.resolve(t);
return (
i && !a.versionSatisfies(i.version, e.range)
? (h.warn("Plugin.dependencies:", a.toString(i), "does not satisfy", a.toString(e), "used by", a.toString(s) + "."), (i._warned = !0), (n._warned = !0))
: i || (h.warn("Plugin.dependencies:", a.toString(t), "used by", a.toString(s), "could not be resolved."), (n._warned = !0)),
e.name
);
}));
for (var i = 0; i < t[e].length; i += 1) a.dependencies(t[e][i], t);
return t;
}
}),
(a.dependencyParse = function (t) {
return h.isString(t)
? (/^[\w-]+(@(\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-]+)?))?$/.test(t) || h.warn("Plugin.dependencyParse:", t, "is not a valid dependency string."),
{ name: t.split("@")[0], range: t.split("@")[1] || "*" })
: { name: t.name, range: t.range || t.version };
}),
(a.versionParse = function (t) {
/^\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-]+)?$/.test(t) || h.warn("Plugin.versionParse:", t, "is not a valid version or range.");
var e = t.split("-");
t = e[0];
var i = isNaN(Number(t[0])),
n = i ? t.substr(1) : t,
s = h.map(n.split("."), function (t) {
return Number(t);
});
return { isRange: i, version: n, range: t, operator: i ? t[0] : "", parts: s, prerelease: e[1], number: 1e8 * s[0] + 1e4 * s[1] + s[2] };
}),
(a.versionSatisfies = function (t, e) {
e = e || "*";
var i = a.versionParse(e),
n = i.parts,
s = a.versionParse(t),
r = s.parts;
if (i.isRange) {
if ("*" === i.operator || "*" === t) return !0;
if ("~" === i.operator) return r[0] === n[0] && r[1] === n[1] && r[2] >= n[2];
if ("^" === i.operator) return 0 < n[0] ? r[0] === n[0] && s.number >= i.number : 0 < n[1] ? r[1] === n[1] && r[2] >= n[2] : r[2] === n[2];
}
return t === e || "*" === t;
});
},
function (t, e, i) {
var n = {};
t.exports = n;
var s = i(118),
r = (i(128), i(32));
n.create = function (t) {
var e = s.create();
return r.extend(e, { label: "World", gravity: { x: 0, y: 1, scale: 0.001 }, bounds: { min: { x: -1 / 0, y: -1 / 0 }, max: { x: 1 / 0, y: 1 / 0 } } }, t);
};
},
function (t, e, i) {
var m = {};
t.exports = m;
var a = i(250),
n = i(273),
r = i(32);
(m.create = function (t) {
var e = { controller: m, detector: n.collisions, buckets: {}, pairs: {}, pairsList: [], bucketWidth: 48, bucketHeight: 48 };
return r.extend(e, t);
}),
(m.update = function (t, e, i, n) {
for (var s, r, o, a = i.world, h = t.buckets, l = !1, u = i.metrics, c = (u.broadphaseTests = 0); c < e.length; c++) {
var d = e[c];
if ((!d.isSleeping || n) && !(d.bounds.max.x < a.bounds.min.x || d.bounds.min.x > a.bounds.max.x || d.bounds.max.y < a.bounds.min.y || d.bounds.min.y > a.bounds.max.y)) {
var f = m._getRegion(t, d);
if (!d.region || f.id !== d.region.id || n) {
(u.broadphaseTests += 1), (d.region && !n) || (d.region = f);
for (var p = m._regionUnion(f, d.region), g = p.startCol; g <= p.endCol; g++)
for (s = p.startRow; s <= p.endRow; s++) {
r = h[(o = m._getBucketId(g, s))];
var v = g >= f.startCol && g <= f.endCol && s >= f.startRow && s <= f.endRow,
y = g >= d.region.startCol && g <= d.region.endCol && s >= d.region.startRow && s <= d.region.endRow;
!v && y && y && r && m._bucketRemoveBody(t, r, d), (d.region === f || (v && !y) || n) && ((r = r || m._createBucket(h, o)), m._bucketAddBody(t, r, d));
}
(d.region = f), (l = !0);
}
}
}
l && (t.pairsList = m._createActivePairsList(t));
}),
(m.clear = function (t) {
(t.buckets = {}), (t.pairs = {}), (t.pairsList = []);
}),
(m._regionUnion = function (t, e) {
var i = Math.min(t.startCol, e.startCol),
n = Math.max(t.endCol, e.endCol),
s = Math.min(t.startRow, e.startRow),
r = Math.max(t.endRow, e.endRow);
return m._createRegion(i, n, s, r);
}),
(m._getRegion = function (t, e) {
var i = e.bounds,
n = Math.floor(i.min.x / t.bucketWidth),
s = Math.floor(i.max.x / t.bucketWidth),
r = Math.floor(i.min.y / t.bucketHeight),
o = Math.floor(i.max.y / t.bucketHeight);
return m._createRegion(n, s, r, o);
}),
(m._createRegion = function (t, e, i, n) {
return { id: t + "," + e + "," + i + "," + n, startCol: t, endCol: e, startRow: i, endRow: n };
}),
(m._getBucketId = function (t, e) {
return "C" + t + "R" + e;
}),
(m._createBucket = function (t, e) {
return (t[e] = []);
}),
(m._bucketAddBody = function (t, e, i) {
for (var n = 0; n < e.length; n++) {
var s,
r,
o = e[n];
i.id === o.id || (i.isStatic && o.isStatic) || ((s = a.id(i, o)), (r = t.pairs[s]) ? (r[2] += 1) : (t.pairs[s] = [i, o, 1]));
}
e.push(i);
}),
(m._bucketRemoveBody = function (t, e, i) {
e.splice(e.indexOf(i), 1);
for (var n = 0; n < e.length; n++) {
var s = e[n],
r = a.id(i, s),
o = t.pairs[r];
o && --o[2];
}
}),
(m._createActivePairsList = function (t) {
for (var e, i = [], n = r.keys(t.pairs), s = 0; s < n.length; s++) 0 < (e = t.pairs[n[s]])[2] ? i.push(e) : delete t.pairs[n[s]];
return i;
});
},
function (t, e, i) {
var l = {};
t.exports = l;
var d = i(250),
n = i(32);
(l._pairMaxIdleLife = 1e3),
(l.create = function (t) {
return n.extend({ table: {}, list: [], collisionStart: [], collisionActive: [], collisionEnd: [] }, t);
}),
(l.update = function (t, e, i) {
var n,
s,
r,
o,
a = t.list,
h = t.table,
l = t.collisionStart,
u = t.collisionEnd,
c = t.collisionActive;
for (l.length = 0, u.length = 0, o = c.length = 0; o < a.length; o++) a[o].confirmedActive = !1;
for (o = 0; o < e.length; o++)
(n = e[o]).collided &&
((r = h[(s = d.id(n.bodyA, n.bodyB))]) ? (r.isActive ? c.push(r) : l.push(r), d.update(r, n, i), (r.confirmedActive = !0)) : ((r = d.create(n, i)), (h[s] = r), l.push(r), a.push(r)));
for (o = 0; o < a.length; o++) (r = a[o]).isActive && !r.confirmedActive && (d.setActive(r, !1, i), u.push(r));
}),
(l.removeOld = function (t, e) {
for (var i, n, s, r = t.list, o = t.table, a = [], h = 0; h < r.length; h++)
(n = (i = r[h]).collision).bodyA.isSleeping || n.bodyB.isSleeping ? (i.timeUpdated = e) : e - i.timeUpdated > l._pairMaxIdleLife && a.push(h);
for (h = 0; h < a.length; h++) delete o[(i = r[(s = a[h] - h)]).id], r.splice(s, 1);
}),
(l.clear = function (t) {
return (t.table = {}), (t.list.length = 0), (t.collisionStart.length = 0), (t.collisionActive.length = 0), (t.collisionEnd.length = 0), t;
});
},
function (t, e, i) {
var U = {};
t.exports = U;
var r = i(64),
Y = i(83),
z = i(32),
o = i(84);
(U._restingThresh = 4),
(U._restingThreshTangent = 6),
(U._positionDampen = 0.9),
(U._positionWarming = 0.8),
(U._frictionNormalMultiplier = 5),
(U.preSolvePosition = function (t) {
for (var e, i, n = 0; n < t.length; n++) (e = t[n]).isActive && ((i = e.activeContacts.length), (e.collision.parentA.totalContacts += i), (e.collision.parentB.totalContacts += i));
}),
(U.solvePosition = function (t, e, i) {
for (var n, s, r, o, a, h, l, u, c, d, f, p, g, v, y, m = i * U._positionDampen, x = 0; x < e.length; x++) {
var b = e[x];
(b.previousPositionImpulse.x = b.positionImpulse.x), (b.previousPositionImpulse.y = b.positionImpulse.y);
}
for (x = 0; x < t.length; x++)
(r = t[x]).isActive &&
!r.isSensor &&
((a = (o = r.collision).parentA),
(h = o.parentB),
(l = o.normal),
(d = a.previousPositionImpulse),
(f = h.previousPositionImpulse),
(c = o.penetration),
(g = f.x - d.x + c.x),
(v = f.y - d.y + c.y),
(u = (n = l.x) * g + (s = l.y) * v),
(y = ((r.separation = u) - r.slop) * m),
(a.isStatic || h.isStatic) && (y *= 2),
a.isStatic || a.isSleeping || ((p = y / a.totalContacts), (a.positionImpulse.x += n * p), (a.positionImpulse.y += s * p)),
h.isStatic || h.isSleeping || ((p = y / h.totalContacts), (h.positionImpulse.x -= n * p), (h.positionImpulse.y -= s * p)));
}),
(U.postSolvePosition = function (t) {
for (var e = 0; e < t.length; e++) {
var i = t[e];
if ((i.totalContacts = 0) !== i.positionImpulse.x || 0 !== i.positionImpulse.y) {
for (var n = 0; n < i.parts.length; n++) {
var s = i.parts[n];
r.translate(s.vertices, i.positionImpulse), o.update(s.bounds, s.vertices, i.velocity), (s.position.x += i.positionImpulse.x), (s.position.y += i.positionImpulse.y);
}
(i.positionPrev.x += i.positionImpulse.x),
(i.positionPrev.y += i.positionImpulse.y),
Y.dot(i.positionImpulse, i.velocity) < 0 ? ((i.positionImpulse.x = 0), (i.positionImpulse.y = 0)) : ((i.positionImpulse.x *= U._positionWarming), (i.positionImpulse.y *= U._positionWarming));
}
}
}),
(U.preSolveVelocity = function (t) {
for (var e, i, n, s, r, o, a, h, l, u, c, d, f, p = Y._temp[0], g = Y._temp[1], v = 0; v < t.length; v++)
if ((i = t[v]).isActive && !i.isSensor)
for (n = i.activeContacts, r = (s = i.collision).parentA, o = s.parentB, a = s.normal, h = s.tangent, e = 0; e < n.length; e++)
(u = (l = n[e]).vertex),
(c = l.normalImpulse),
(d = l.tangentImpulse),
(0 === c && 0 === d) ||
((p.x = a.x * c + h.x * d),
(p.y = a.y * c + h.y * d),
r.isStatic ||
r.isSleeping ||
((f = Y.sub(u, r.position, g)), (r.positionPrev.x += p.x * r.inverseMass), (r.positionPrev.y += p.y * r.inverseMass), (r.anglePrev += Y.cross(f, p) * r.inverseInertia)),
o.isStatic ||
o.isSleeping ||
((f = Y.sub(u, o.position, g)), (o.positionPrev.x -= p.x * o.inverseMass), (o.positionPrev.y -= p.y * o.inverseMass), (o.anglePrev -= Y.cross(f, p) * o.inverseInertia)));
}),
(U.solveVelocity = function (t, e) {
for (var i = e * e, n = Y._temp[0], s = Y._temp[1], r = Y._temp[2], o = Y._temp[3], a = Y._temp[4], h = Y._temp[5], l = 0; l < t.length; l++) {
var u = t[l];
if (u.isActive && !u.isSensor) {
var c = u.collision,
d = c.parentA,
f = c.parentB,
p = c.normal,
g = c.tangent,
v = u.activeContacts,
y = 1 / v.length;
(d.velocity.x = d.position.x - d.positionPrev.x),
(d.velocity.y = d.position.y - d.positionPrev.y),
(f.velocity.x = f.position.x - f.positionPrev.x),
(f.velocity.y = f.position.y - f.positionPrev.y),
(d.angularVelocity = d.angle - d.anglePrev),
(f.angularVelocity = f.angle - f.anglePrev);
for (var m = 0; m < v.length; m++) {
var x = v[m],
b = x.vertex,
w = Y.sub(b, d.position, s),
T = Y.sub(b, f.position, r),
S = Y.add(d.velocity, Y.mult(Y.perp(w), d.angularVelocity), o),
_ = Y.add(f.velocity, Y.mult(Y.perp(T), f.angularVelocity), a),
E = Y.sub(S, _, h),
P = Y.dot(p, E),
A = Y.dot(g, E),
M = Math.abs(A),
C = z.sign(A),
O = (1 + u.restitution) * P,
k = z.clamp(u.separation + P, 0, 1) * U._frictionNormalMultiplier,
R = A,
L = 1 / 0;
M > u.friction * u.frictionStatic * k * i && ((L = M), (R = z.clamp(u.friction * C * i, -L, L)));
var I,
D,
F = Y.cross(w, p),
B = Y.cross(T, p),
N = y / (d.inverseMass + f.inverseMass + d.inverseInertia * F * F + f.inverseInertia * B * B);
(O *= N),
(R *= N),
P < 0 && P * P > U._restingThresh * i ? (x.normalImpulse = 0) : ((I = x.normalImpulse), (x.normalImpulse = Math.min(x.normalImpulse + O, 0)), (O = x.normalImpulse - I)),
A * A > U._restingThreshTangent * i ? (x.tangentImpulse = 0) : ((D = x.tangentImpulse), (x.tangentImpulse = z.clamp(x.tangentImpulse + R, -L, L)), (R = x.tangentImpulse - D)),
(n.x = p.x * O + g.x * R),
(n.y = p.y * O + g.y * R),
d.isStatic || d.isSleeping || ((d.positionPrev.x += n.x * d.inverseMass), (d.positionPrev.y += n.y * d.inverseMass), (d.anglePrev += Y.cross(w, n) * d.inverseInertia)),
f.isStatic || f.isSleeping || ((f.positionPrev.x -= n.x * f.inverseMass), (f.positionPrev.y -= n.y * f.inverseMass), (f.anglePrev -= Y.cross(T, n) * f.inverseInertia));
}
}
}
});
},
function (t, e) {
var i = (function () {
return this;
})();
try {
i = i || new Function("return this")();
} catch (t) {
"object" == typeof window && (i = window);
}
t.exports = i;
},
function (t, e, i) {
var a = i(276);
t.exports = function (t, e, i, n) {
for (var s = t[0], r = 1; r < t.length; r++) {
var o = t[r];
a(o, s, e, i, n), (s = o);
}
return t;
};
},
function (t, e, i) {
var r = i(46);
t.exports = function (t, e, i, n, s) {
return r(t, "angle", e, i, n, s);
};
},
function (t, e) {
t.exports = function (t, e, i) {
for (var n = 0; n < t.length; n++) {
var s = t[n];
e.call(i, s);
}
return t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
void 0 === i && (i = 0);
for (var n = i; n < t.length; n++) {
var s = t[n],
r = !0;
for (var o in e) s[o] !== e[o] && (r = !1);
if (r) return s;
}
return null;
};
},
function (t, e) {
t.exports = function (t, e, i) {
void 0 === i && (i = 0);
for (var n = i; n < t.length; n++) {
var s = t[n],
r = !0;
for (var o in e) s[o] !== e[o] && (r = !1);
if (r) return s;
}
return null;
};
},
function (t, e, i) {
var v = i(289),
y = i(123),
m = i(2),
n = i(1),
x = new (i(129))({ sys: { queueDepthSort: n, events: { once: n } } }, 0, 0, 1, 1);
t.exports = function (t, e) {
void 0 === e && (e = {});
var i = e.hasOwnProperty("width"),
n = e.hasOwnProperty("height"),
s = m(e, "width", -1),
r = m(e, "height", -1),
o = m(e, "cellWidth", 1),
a = m(e, "cellHeight", o),
h = m(e, "position", y.TOP_LEFT),
l = m(e, "x", 0),
u = m(e, "y", 0),
c = 0,
d = 0,
f = s * o,
p = r * a;
x.setPosition(l, u), x.setSize(o, a);
for (var g = 0; g < t.length; g++)
if ((v(t[g], x, h), i && -1 === s)) x.x += o;
else if (n && -1 === r) x.y += a;
else if (n && !i) {
if (((d += a), (x.y += a), d === p && ((d = 0), (c += o), (x.y = u), (x.x += o), c === f))) break;
} else if (((c += o), (x.x += o), c === f && ((c = 0), (d += a), (x.x = l), (x.y += a), d === p))) break;
return t;
};
},
function (t, e, i) {
var s = i(18),
n = {
_alpha: 1,
_alphaTL: 1,
_alphaTR: 1,
_alphaBL: 1,
_alphaBR: 1,
clearAlpha: function () {
return this.setAlpha(1);
},
setAlpha: function (t, e, i, n) {
return void 0 === t && (t = 1), void 0 === e ? (this.alpha = t) : ((this._alphaTL = s(t, 0, 1)), (this._alphaTR = s(e, 0, 1)), (this._alphaBL = s(i, 0, 1)), (this._alphaBR = s(n, 0, 1))), this;
},
alpha: {
get: function () {
return this._alpha;
},
set: function (t) {
var e = s(t, 0, 1);
(this._alpha = e), (this._alphaTL = e), (this._alphaTR = e), (this._alphaBL = e), 0 === (this._alphaBR = e) ? (this.renderFlags &= -3) : (this.renderFlags |= 2);
},
},
alphaTopLeft: {
get: function () {
return this._alphaTL;
},
set: function (t) {
var e = s(t, 0, 1);
0 !== (this._alphaTL = e) && (this.renderFlags |= 2);
},
},
alphaTopRight: {
get: function () {
return this._alphaTR;
},
set: function (t) {
var e = s(t, 0, 1);
0 !== (this._alphaTR = e) && (this.renderFlags |= 2);
},
},
alphaBottomLeft: {
get: function () {
return this._alphaBL;
},
set: function (t) {
var e = s(t, 0, 1);
0 !== (this._alphaBL = e) && (this.renderFlags |= 2);
},
},
alphaBottomRight: {
get: function () {
return this._alphaBR;
},
set: function (t) {
var e = s(t, 0, 1);
0 !== (this._alphaBR = e) && (this.renderFlags |= 2);
},
},
};
t.exports = n;
},
function (t, e) {
t.exports = {
width: 0,
height: 0,
displayWidth: {
get: function () {
return this.scaleX * this.width;
},
set: function (t) {
this.scaleX = t / this.width;
},
},
displayHeight: {
get: function () {
return this.scaleY * this.height;
},
set: function (t) {
this.scaleY = t / this.height;
},
},
setSize: function (t, e) {
return (this.width = t), (this.height = e), this;
},
setDisplaySize: function (t, e) {
return (this.displayWidth = t), (this.displayHeight = e), this;
},
};
},
function (t, e) {
t.exports = {
texture: null,
frame: null,
isCropped: !1,
setCrop: function (t, e, i, n) {
return (
void 0 === t
? (this.isCropped = !1)
: this.frame &&
("number" == typeof t ? this.frame.setCropUVs(this._crop, t, e, i, n, this.flipX, this.flipY) : this.frame.setCropUVs(this._crop, t.x, t.y, t.width, t.height, this.flipX, this.flipY),
(this.isCropped = !0)),
this
);
},
resetCropObject: function () {
return { u0: 0, v0: 0, u1: 0, v1: 0, width: 0, height: 0, x: 0, y: 0, flipX: !1, flipY: !1, cx: 0, cy: 0, cw: 0, ch: 0 };
},
};
},
function (t, e) {
t.exports = {
flipX: !1,
flipY: !1,
toggleFlipX: function () {
return (this.flipX = !this.flipX), this;
},
toggleFlipY: function () {
return (this.flipY = !this.flipY), this;
},
setFlipX: function (t) {
return (this.flipX = t), this;
},
setFlipY: function (t) {
return (this.flipY = t), this;
},
setFlip: function (t, e) {
return (this.flipX = t), (this.flipY = e), this;
},
resetFlip: function () {
return (this.flipX = !1), (this.flipY = !1), this;
},
};
},
function (t, e, i) {
var u = i(10),
n = i(308),
s = i(3),
r = {
prepareBoundsOutput: function (t, e) {
return (
void 0 === e && (e = !1), 0 !== this.rotation && n(t, this.x, this.y, this.rotation), e && this.parentContainer && this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x, t.y, t), t
);
},
getCenter: function (t) {
return void 0 === t && (t = new s()), (t.x = this.x - this.displayWidth * this.originX + this.displayWidth / 2), (t.y = this.y - this.displayHeight * this.originY + this.displayHeight / 2), t;
},
getTopLeft: function (t, e) {
return ((t = t || new s()).x = this.x - this.displayWidth * this.originX), (t.y = this.y - this.displayHeight * this.originY), this.prepareBoundsOutput(t, e);
},
getTopCenter: function (t, e) {
return ((t = t || new s()).x = this.x - this.displayWidth * this.originX + this.displayWidth / 2), (t.y = this.y - this.displayHeight * this.originY), this.prepareBoundsOutput(t, e);
},
getTopRight: function (t, e) {
return ((t = t || new s()).x = this.x - this.displayWidth * this.originX + this.displayWidth), (t.y = this.y - this.displayHeight * this.originY), this.prepareBoundsOutput(t, e);
},
getLeftCenter: function (t, e) {
return ((t = t || new s()).x = this.x - this.displayWidth * this.originX), (t.y = this.y - this.displayHeight * this.originY + this.displayHeight / 2), this.prepareBoundsOutput(t, e);
},
getRightCenter: function (t, e) {
return (
((t = t || new s()).x = this.x - this.displayWidth * this.originX + this.displayWidth), (t.y = this.y - this.displayHeight * this.originY + this.displayHeight / 2), this.prepareBoundsOutput(t, e)
);
},
getBottomLeft: function (t, e) {
return ((t = t || new s()).x = this.x - this.displayWidth * this.originX), (t.y = this.y - this.displayHeight * this.originY + this.displayHeight), this.prepareBoundsOutput(t, e);
},
getBottomCenter: function (t, e) {
return (
((t = t || new s()).x = this.x - this.displayWidth * this.originX + this.displayWidth / 2), (t.y = this.y - this.displayHeight * this.originY + this.displayHeight), this.prepareBoundsOutput(t, e)
);
},
getBottomRight: function (t, e) {
return ((t = t || new s()).x = this.x - this.displayWidth * this.originX + this.displayWidth), (t.y = this.y - this.displayHeight * this.originY + this.displayHeight), this.prepareBoundsOutput(t, e);
},
getBounds: function (t) {
var e, i, n, s, r, o, a, h, l;
return (
void 0 === t && (t = new u()),
this.parentContainer
? ((l = this.parentContainer.getBoundsTransformMatrix()),
this.getTopLeft(t),
l.transformPoint(t.x, t.y, t),
(e = t.x),
(i = t.y),
this.getTopRight(t),
l.transformPoint(t.x, t.y, t),
(n = t.x),
(s = t.y),
this.getBottomLeft(t),
l.transformPoint(t.x, t.y, t),
(r = t.x),
(o = t.y),
this.getBottomRight(t),
l.transformPoint(t.x, t.y, t))
: (this.getTopLeft(t), (e = t.x), (i = t.y), this.getTopRight(t), (n = t.x), (s = t.y), this.getBottomLeft(t), (r = t.x), (o = t.y), this.getBottomRight(t)),
(a = t.x),
(h = t.y),
(t.x = Math.min(e, n, r, a)),
(t.y = Math.min(i, s, o, h)),
(t.width = Math.max(e, n, r, a) - t.x),
(t.height = Math.max(i, s, o, h) - t.y),
t
);
},
};
t.exports = r;
},
function (t, e) {
t.exports = "blur";
},
function (t, e) {
t.exports = "boot";
},
function (t, e) {
t.exports = "contextlost";
},
function (t, e) {
t.exports = "contextrestored";
},
function (t, e) {
t.exports = "destroy";
},
function (t, e) {
t.exports = "focus";
},
function (t, e) {
t.exports = "hidden";
},
function (t, e) {
t.exports = "pause";
},
function (t, e) {
t.exports = "postrender";
},
function (t, e) {
t.exports = "poststep";
},
function (t, e) {
t.exports = "prerender";
},
function (t, e) {
t.exports = "prestep";
},
function (t, e) {
t.exports = "ready";
},
function (t, e) {
t.exports = "resume";
},
function (t, e) {
t.exports = "step";
},
function (t, e) {
t.exports = "visible";
},
function (t, e) {
t.exports = "postrender";
},
function (t, e) {
t.exports = "prerender";
},
function (t, e) {
t.exports = "render";
},
function (t, e) {
t.exports = "resize";
},
function (t, e) {
t.exports = {
_originComponent: !0,
originX: 0.5,
originY: 0.5,
_displayOriginX: 0,
_displayOriginY: 0,
displayOriginX: {
get: function () {
return this._displayOriginX;
},
set: function (t) {
(this._displayOriginX = t), (this.originX = t / this.width);
},
},
displayOriginY: {
get: function () {
return this._displayOriginY;
},
set: function (t) {
(this._displayOriginY = t), (this.originY = t / this.height);
},
},
setOrigin: function (t, e) {
return void 0 === t && (t = 0.5), void 0 === e && (e = t), (this.originX = t), (this.originY = e), this.updateDisplayOrigin();
},
setOriginFromFrame: function () {
return this.frame && this.frame.customPivot ? ((this.originX = this.frame.pivotX), (this.originY = this.frame.pivotY), this.updateDisplayOrigin()) : this.setOrigin();
},
setDisplayOrigin: function (t, e) {
return void 0 === t && (t = 0), void 0 === e && (e = t), (this.displayOriginX = t), (this.displayOriginY = e), this;
},
updateDisplayOrigin: function () {
return (this._displayOriginX = this.originX * this.width), (this._displayOriginY = this.originY * this.height), this;
},
};
},
function (t, e, i) {
var h = i(36),
o = i(99),
a = i(6),
l = i(100),
u = i(3),
n = {
path: null,
rotateToPath: !1,
pathRotationOffset: 0,
pathOffset: null,
pathVector: null,
pathDelta: null,
pathTween: null,
pathConfig: null,
_prevDirection: l.PLAYING_FORWARD,
setPath: function (t, e) {
void 0 === e && (e = this.pathConfig);
var i = this.pathTween;
return i && i.isPlaying() && i.stop(), (this.path = t), e && this.startFollow(e), this;
},
setRotateToPath: function (t, e) {
return void 0 === e && (e = 0), (this.rotateToPath = t), (this.pathRotationOffset = e), this;
},
isFollowing: function () {
var t = this.pathTween;
return t && t.isPlaying();
},
startFollow: function (t, e) {
void 0 === t && (t = {}), void 0 === e && (e = 0);
var i = this.pathTween;
i && i.isPlaying() && i.stop(), "number" == typeof t && (t = { duration: t }), (t.from = a(t, "from", 0)), (t.to = a(t, "to", 1));
var n = o(t, "positionOnPath", !1);
(this.rotateToPath = o(t, "rotateToPath", !1)), (this.pathRotationOffset = a(t, "rotationOffset", 0));
var s,
r = a(t, "startAt", e);
return (
r &&
(t.onStart = function (t) {
var e = t.data[0];
(e.progress = r), (e.elapsed = e.duration * r);
var i = e.ease(e.progress);
(e.current = e.start + (e.end - e.start) * i), (e.target[e.key] = e.current);
}),
this.pathOffset || (this.pathOffset = new u(this.x, this.y)),
this.pathVector || (this.pathVector = new u()),
this.pathDelta || (this.pathDelta = new u()),
this.pathDelta.reset(),
(this.pathTween = this.scene.sys.tweens.addCounter(t)),
this.path.getStartPoint(this.pathOffset),
n && ((this.x = this.pathOffset.x), (this.y = this.pathOffset.y)),
(this.pathOffset.x = this.x - this.pathOffset.x),
(this.pathOffset.y = this.y - this.pathOffset.y),
(this._prevDirection = l.PLAYING_FORWARD),
this.rotateToPath && ((s = this.path.getPoint(0.1)), (this.rotation = Math.atan2(s.y - this.y, s.x - this.x) + h(this.pathRotationOffset))),
(this.pathConfig = t),
this
);
},
pauseFollow: function () {
var t = this.pathTween;
return t && t.isPlaying() && t.pause(), this;
},
resumeFollow: function () {
var t = this.pathTween;
return t && t.isPaused() && t.resume(), this;
},
stopFollow: function () {
var t = this.pathTween;
return t && t.isPlaying() && t.stop(), this;
},
pathUpdate: function () {
var t = this.pathTween;
if (t) {
var e = t.data[0],
i = this.pathDelta,
n = this.pathVector;
if ((i.copy(n).negate(), e.state === l.COMPLETE)) return this.path.getPoint(1, n), i.add(n), n.add(this.pathOffset), void this.setPosition(n.x, n.y);
if (e.state !== l.PLAYING_FORWARD && e.state !== l.PLAYING_BACKWARD) return;
this.path.getPoint(t.getValue(), n), i.add(n), n.add(this.pathOffset);
var s = this.x,
r = this.y;
this.setPosition(n.x, n.y);
var o = this.x - s,
a = this.y - r;
if (0 == o && 0 == a) return;
if (e.state !== this._prevDirection) return void (this._prevDirection = e.state);
this.rotateToPath && (this.rotation = Math.atan2(a, o) + h(this.pathRotationOffset));
}
},
};
t.exports = n;
},
function (t, e) {
var i = {
_sizeComponent: !0,
width: 0,
height: 0,
displayWidth: {
get: function () {
return Math.abs(this.scaleX * this.frame.realWidth);
},
set: function (t) {
this.scaleX = t / this.frame.realWidth;
},
},
displayHeight: {
get: function () {
return Math.abs(this.scaleY * this.frame.realHeight);
},
set: function (t) {
this.scaleY = t / this.frame.realHeight;
},
},
setSizeToFrame: function (t) {
return void 0 === t && (t = this.frame), (this.width = t.realWidth), (this.height = t.realHeight), this;
},
setSize: function (t, e) {
return (this.width = t), (this.height = e), this;
},
setDisplaySize: function (t, e) {
return (this.displayWidth = t), (this.displayHeight = e), this;
},
};
t.exports = i;
},
function (t, e) {
t.exports = {
texture: null,
frame: null,
isCropped: !1,
setTexture: function (t, e) {
return (this.texture = this.scene.sys.textures.get(t)), this.setFrame(e);
},
setFrame: function (t, e, i) {
return (
void 0 === e && (e = !0),
void 0 === i && (i = !0),
(this.frame = this.texture.get(t)),
this.frame.cutWidth && this.frame.cutHeight ? (this.renderFlags |= 8) : (this.renderFlags &= -9),
this._sizeComponent && e && this.setSizeToFrame(),
this._originComponent && i && (this.frame.customPivot ? this.setOrigin(this.frame.pivotX, this.frame.pivotY) : this.updateDisplayOrigin()),
this
);
},
};
},
function (t, e) {
t.exports = {
texture: null,
frame: null,
isCropped: !1,
setCrop: function (t, e, i, n) {
return (
void 0 === t
? (this.isCropped = !1)
: this.frame &&
("number" == typeof t ? this.frame.setCropUVs(this._crop, t, e, i, n, this.flipX, this.flipY) : this.frame.setCropUVs(this._crop, t.x, t.y, t.width, t.height, this.flipX, this.flipY),
(this.isCropped = !0)),
this
);
},
setTexture: function (t, e) {
return (this.texture = this.scene.sys.textures.get(t)), this.setFrame(e);
},
setFrame: function (t, e, i) {
return (
void 0 === e && (e = !0),
void 0 === i && (i = !0),
(this.frame = this.texture.get(t)),
this.frame.cutWidth && this.frame.cutHeight ? (this.renderFlags |= 8) : (this.renderFlags &= -9),
this._sizeComponent && e && this.setSizeToFrame(),
this._originComponent && i && (this.frame.customPivot ? this.setOrigin(this.frame.pivotX, this.frame.pivotY) : this.updateDisplayOrigin()),
this.isCropped && this.frame.updateCropUVs(this._crop, this.flipX, this.flipY),
this
);
},
resetCropObject: function () {
return { u0: 0, v0: 0, u1: 0, v1: 0, width: 0, height: 0, x: 0, y: 0, flipX: !1, flipY: !1, cx: 0, cy: 0, cw: 0, ch: 0 };
},
};
},
function (t, e) {
t.exports = {
tintTopLeft: 16777215,
tintTopRight: 16777215,
tintBottomLeft: 16777215,
tintBottomRight: 16777215,
tintFill: !1,
clearTint: function () {
return this.setTint(16777215), this;
},
setTint: function (t, e, i, n) {
return void 0 === t && (t = 16777215), void 0 === e && (n = i = e = t), (this.tintTopLeft = t), (this.tintTopRight = e), (this.tintBottomLeft = i), (this.tintBottomRight = n), (this.tintFill = !1), this;
},
setTintFill: function (t, e, i, n) {
return this.setTint(t, e, i, n), (this.tintFill = !0), this;
},
tint: {
set: function (t) {
this.setTint(t, t, t, t);
},
},
isTinted: {
get: function () {
var t = 16777215;
return this.tintFill || this.tintTopLeft !== t || this.tintTopRight !== t || this.tintBottomLeft !== t || this.tintBottomRight !== t;
},
},
};
},
function (t, e) {
t.exports = "changedata";
},
function (t, e) {
t.exports = "changedata-";
},
function (t, e) {
t.exports = "destroy";
},
function (t, e) {
t.exports = "removedata";
},
function (t, e) {
t.exports = "setdata";
},
function (t, e) {
t.exports = "addedtoscene";
},
function (t, e) {
t.exports = "destroy";
},
function (t, e) {
t.exports = "removedfromscene";
},
function (t, e) {
t.exports = "complete";
},
function (t, e) {
t.exports = "created";
},
function (t, e) {
t.exports = "error";
},
function (t, e) {
t.exports = "loop";
},
function (t, e) {
t.exports = "play";
},
function (t, e) {
t.exports = "seeked";
},
function (t, e) {
t.exports = "seeking";
},
function (t, e) {
t.exports = "stop";
},
function (t, e) {
t.exports = "timeout";
},
function (t, e) {
t.exports = "unlocked";
},
function (t, e) {
t.exports = "addedtoscene";
},
function (t, e) {
t.exports = "boot";
},
function (t, e) {
t.exports = "create";
},
function (t, e) {
t.exports = "destroy";
},
function (t, e) {
t.exports = "pause";
},
function (t, e) {
t.exports = "postupdate";
},
function (t, e) {
t.exports = "prerender";
},
function (t, e) {
t.exports = "preupdate";
},
function (t, e) {
t.exports = "ready";
},
function (t, e) {
t.exports = "removedfromscene";
},
function (t, e) {
t.exports = "render";
},
function (t, e) {
t.exports = "resume";
},
function (t, e) {
t.exports = "shutdown";
},
function (t, e) {
t.exports = "sleep";
},
function (t, e) {
t.exports = "start";
},
function (t, e) {
t.exports = "transitioncomplete";
},
function (t, e) {
t.exports = "transitioninit";
},
function (t, e) {
t.exports = "transitionout";
},
function (t, e) {
t.exports = "transitionstart";
},
function (t, e) {
t.exports = "transitionwake";
},
function (t, e) {
t.exports = "update";
},
function (t, e) {
t.exports = "wake";
},
function (t, e, i) {
var r = i(46);
t.exports = function (t, e, i, n, s) {
return r(t, "alpha", e, i, n, s);
};
},
function (t, e, i) {
var r = i(46);
t.exports = function (t, e, i, n, s) {
return r(t, "x", e, i, n, s);
};
},
function (t, e, i) {
var a = i(46);
t.exports = function (t, e, i, n, s, r, o) {
return null == i && (i = e), a(t, "x", e, n, r, o), a(t, "y", i, s, r, o);
};
},
function (t, e, i) {
var r = i(46);
t.exports = function (t, e, i, n, s) {
return r(t, "y", e, i, n, s);
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
void 0 === i && (i = 0), void 0 === n && (n = 6.28);
for (var s = i, r = (n - i) / t.length, o = 0; o < t.length; o++) (t[o].x = e.x + e.radius * Math.cos(s)), (t[o].y = e.y + e.radius * Math.sin(s)), (s += r);
return t;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
void 0 === i && (i = 0), void 0 === n && (n = 6.28);
for (var s = i, r = (n - i) / t.length, o = e.width / 2, a = e.height / 2, h = 0; h < t.length; h++) (t[h].x = e.x + o * Math.cos(s)), (t[h].y = e.y + a * Math.sin(s)), (s += r);
return t;
};
},
function (t, e, i) {
var o = i(172);
t.exports = function (t, e) {
for (var i = o(e, t.length), n = 0; n < t.length; n++) {
var s = t[n],
r = i[n];
(s.x = r.x), (s.y = r.y);
}
return t;
};
},
function (t, e, i) {
var r = i(316),
o = i(178),
a = i(179);
t.exports = function (t, e, i) {
void 0 === i && (i = 0);
var n = r(e, !1, t.length);
0 < i ? o(n, i) : i < 0 && a(n, Math.abs(i));
for (var s = 0; s < t.length; s++) (t[s].x = n[s].x), (t[s].y = n[s].y);
return t;
};
},
function (t, e, i) {
var c = i(317);
t.exports = function (t, e, i) {
var n = c({ x1: e.x1, y1: e.y1, x2: e.x2, y2: e.y2 }, i),
s = c({ x1: e.x2, y1: e.y2, x2: e.x3, y2: e.y3 }, i),
r = c({ x1: e.x3, y1: e.y3, x2: e.x1, y2: e.y1 }, i);
n.pop(), s.pop(), r.pop();
for (var o = (n = n.concat(s, r)).length / t.length, a = 0, h = 0; h < t.length; h++) {
var l = t[h],
u = n[Math.floor(a)];
(l.x = u.x), (l.y = u.y), (a += o);
}
return t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
for (var n = 0; n < t.length; n++) {
var s = t[n];
s.anims && s.anims.play(e, i);
}
return t;
};
},
function (t, e, i) {
var n = i(170);
t.exports = function (t, e) {
for (var i = 0; i < t.length; i++) n(e, t[i]);
return t;
};
},
function (t, e, i) {
var n = i(180);
t.exports = function (t, e) {
for (var i = 0; i < t.length; i++) n(e, t[i]);
return t;
};
},
function (t, e, i) {
var n = i(173);
t.exports = function (t, e) {
for (var i = 0; i < t.length; i++) n(e, t[i]);
return t;
};
},
function (t, e, i) {
var n = i(174);
t.exports = function (t, e) {
for (var i = 0; i < t.length; i++) n(e, t[i]);
return t;
};
},
function (t, e, i) {
var n = i(181);
t.exports = function (t, e) {
for (var i = 0; i < t.length; i++) n(e, t[i]);
return t;
};
},
function (t, e, i) {
var r = i(46);
t.exports = function (t, e, i, n, s) {
return r(t, "rotation", e, i, n, s);
};
},
function (t, e, i) {
var a = i(182),
h = i(50);
t.exports = function (t, e, i) {
for (var n = e.x, s = e.y, r = 0; r < t.length; r++) {
var o = t[r];
a(o, n, s, i, Math.max(1, h(o.x, o.y, n, s)));
}
return t;
};
},
function (t, e, i) {
var a = i(182);
t.exports = function (t, e, i, n) {
var s = e.x,
r = e.y;
if (0 === n) return t;
for (var o = 0; o < t.length; o++) a(t[o], s, r, i, n);
return t;
};
},
function (t, e, i) {
var r = i(46);
t.exports = function (t, e, i, n, s) {
return r(t, "scaleX", e, i, n, s);
};
},
function (t, e, i) {
var a = i(46);
t.exports = function (t, e, i, n, s, r, o) {
return null == i && (i = e), a(t, "scaleX", e, n, r, o), a(t, "scaleY", i, s, r, o);
};
},
function (t, e, i) {
var r = i(46);
t.exports = function (t, e, i, n, s) {
return r(t, "scaleY", e, i, n, s);
};
},
function (t, e, i) {
var r = i(27);
t.exports = function (t, e, i, n, s) {
return r(t, "alpha", e, i, n, s);
};
},
function (t, e, i) {
var s = i(27);
t.exports = function (t, e, i, n) {
return s(t, "blendMode", e, 0, i, n);
};
},
function (t, e, i) {
var r = i(27);
t.exports = function (t, e, i, n, s) {
return r(t, "depth", e, i, n, s);
};
},
function (t, e) {
t.exports = function (t, e, i) {
for (var n = 0; n < t.length; n++) t[n].setInteractive(e, i);
return t;
};
},
function (t, e, i) {
var a = i(27);
t.exports = function (t, e, i, n, s, r, o) {
return (
null == i && (i = e),
a(t, "originX", e, n, r, o),
a(t, "originY", i, s, r, o),
t.forEach(function (t) {
t.updateDisplayOrigin();
}),
t
);
};
},
function (t, e, i) {
var r = i(27);
t.exports = function (t, e, i, n, s) {
return r(t, "rotation", e, i, n, s);
};
},
function (t, e, i) {
var a = i(27);
t.exports = function (t, e, i, n, s, r, o) {
return null == i && (i = e), a(t, "scaleX", e, n, r, o), a(t, "scaleY", i, s, r, o);
};
},
function (t, e, i) {
var r = i(27);
t.exports = function (t, e, i, n, s) {
return r(t, "scaleX", e, i, n, s);
};
},
function (t, e, i) {
var r = i(27);
t.exports = function (t, e, i, n, s) {
return r(t, "scaleY", e, i, n, s);
};
},
function (t, e, i) {
var a = i(27);
t.exports = function (t, e, i, n, s, r, o) {
return null == i && (i = e), a(t, "scrollFactorX", e, n, r, o), a(t, "scrollFactorY", i, s, r, o);
};
},
function (t, e, i) {
var r = i(27);
t.exports = function (t, e, i, n, s) {
return r(t, "scrollFactorX", e, i, n, s);
};
},
function (t, e, i) {
var r = i(27);
t.exports = function (t, e, i, n, s) {
return r(t, "scrollFactorY", e, i, n, s);
};
},
function (t, e) {
t.exports = function (t, e, i, n, s) {
for (var r = 0; r < t.length; r++) t[r].setTint(e, i, n, s);
return t;
};
},
function (t, e, i) {
var s = i(27);
t.exports = function (t, e, i, n) {
return s(t, "visible", e, 0, i, n);
};
},
function (t, e, i) {
var r = i(27);
t.exports = function (t, e, i, n, s) {
return r(t, "x", e, i, n, s);
};
},
function (t, e, i) {
var a = i(27);
t.exports = function (t, e, i, n, s, r, o) {
return null == i && (i = e), a(t, "x", e, n, r, o), a(t, "y", i, s, r, o);
};
},
function (t, e, i) {
var r = i(27);
t.exports = function (t, e, i, n, s) {
return r(t, "y", e, i, n, s);
};
},
function (t, e, i) {
var d = i(3);
t.exports = function (t, e, i, n, s) {
var r, o, a;
if ((void 0 === n && (n = 0), void 0 === s && (s = new d()), 1 < t.length))
if (0 === n) {
for (var h = t.length - 1, l = t[h].x, u = t[h].y, c = h - 1; 0 <= c; c--) (r = (a = t[c]).x), (o = a.y), (a.x = l), (a.y = u), (l = r), (u = o);
(t[h].x = e), (t[h].y = i);
} else {
for (l = t[0].x, u = t[0].y, c = 1; c < t.length; c++) (r = (a = t[c]).x), (o = a.y), (a.x = l), (a.y = u), (l = r), (u = o);
(t[0].x = e), (t[0].y = i);
}
else (l = t[0].x), (u = t[0].y), (t[0].x = e), (t[0].y = i);
return (s.x = l), (s.y = u), s;
};
},
function (t, e, i) {
var n = i(131);
t.exports = function (t) {
return n(t);
};
},
function (t, e, i) {
var a = i(183);
t.exports = function (t, e, i, n, s) {
void 0 === s && (s = !1);
var r,
o = Math.abs(n - i) / t.length;
if (s) for (r = 0; r < t.length; r++) t[r][e] += a(r * o, i, n);
else for (r = 0; r < t.length; r++) t[r][e] = a(r * o, i, n);
return t;
};
},
function (t, e, i) {
var a = i(184);
t.exports = function (t, e, i, n, s) {
void 0 === s && (s = !1);
var r,
o = Math.abs(n - i) / t.length;
if (s) for (r = 0; r < t.length; r++) t[r][e] += a(r * o, i, n);
else for (r = 0; r < t.length; r++) t[r][e] = a(r * o, i, n);
return t;
};
},
function (t, e) {
t.exports = function (t, e, i, n, s) {
void 0 === s && (s = !1);
var r,
o = Math.abs(n - i) / t.length;
if (s) for (r = 0; r < t.length; r++) t[r][e] += r * o + i;
else for (r = 0; r < t.length; r++) t[r][e] = r * o + i;
return t;
};
},
function (t, e) {
t.exports = function (t) {
for (var e = 0; e < t.length; e++) t[e].visible = !t[e].visible;
return t;
};
},
function (t, e, i) {
var r = i(68);
t.exports = function (t, e, i) {
void 0 === i && (i = 0);
for (var n = 0; n < t.length; n++) {
var s = t[n];
(s.x = r(s.x, e.left - i, e.right + i)), (s.y = r(s.y, e.top - i, e.bottom + i));
}
return t;
};
},
function (t, e, i) {
t.exports = { Animation: i(185), AnimationFrame: i(319), AnimationManager: i(321), AnimationState: i(164), Events: i(132) };
},
function (t, e) {
t.exports = "add";
},
function (t, e) {
t.exports = "animationcomplete";
},
function (t, e) {
t.exports = "animationcomplete-";
},
function (t, e) {
t.exports = "animationrepeat";
},
function (t, e) {
t.exports = "animationrestart";
},
function (t, e) {
t.exports = "animationstart";
},
function (t, e) {
t.exports = "animationstop";
},
function (t, e) {
t.exports = "animationupdate";
},
function (t, e) {
t.exports = "pauseall";
},
function (t, e) {
t.exports = "remove";
},
function (t, e) {
t.exports = "resumeall";
},
function (t, e, i) {
t.exports = { BaseCache: i(323), CacheManager: i(325), Events: i(324) };
},
function (t, e) {
t.exports = "add";
},
function (t, e) {
t.exports = "remove";
},
function (t, e, i) {
t.exports = { Controls: i(739), Scene2D: i(742) };
},
function (t, e, i) {
t.exports = { FixedKeyControl: i(740), SmoothedKeyControl: i(741) };
},
function (t, e, i) {
var n = i(0),
s = i(6),
r = new n({
initialize: function (t) {
(this.camera = s(t, "camera", null)),
(this.left = s(t, "left", null)),
(this.right = s(t, "right", null)),
(this.up = s(t, "up", null)),
(this.down = s(t, "down", null)),
(this.zoomIn = s(t, "zoomIn", null)),
(this.zoomOut = s(t, "zoomOut", null)),
(this.zoomSpeed = s(t, "zoomSpeed", 0.01)),
(this.minZoom = s(t, "minZoom", 0.001)),
(this.maxZoom = s(t, "maxZoom", 1e3)),
(this.speedX = 0),
(this.speedY = 0);
var e = s(t, "speed", null);
"number" == typeof e ? ((this.speedX = e), (this.speedY = e)) : ((this.speedX = s(t, "speed.x", 0)), (this.speedY = s(t, "speed.y", 0))), (this._zoom = 0), (this.active = null !== this.camera);
},
start: function () {
return (this.active = null !== this.camera), this;
},
stop: function () {
return (this.active = !1), this;
},
setCamera: function (t) {
return (this.camera = t), this;
},
update: function (t) {
var e;
this.active &&
(void 0 === t && (t = 1),
(e = this.camera),
this.up && this.up.isDown ? (e.scrollY -= (this.speedY * t) | 0) : this.down && this.down.isDown && (e.scrollY += (this.speedY * t) | 0),
this.left && this.left.isDown ? (e.scrollX -= (this.speedX * t) | 0) : this.right && this.right.isDown && (e.scrollX += (this.speedX * t) | 0),
this.zoomIn && this.zoomIn.isDown
? ((e.zoom -= this.zoomSpeed), e.zoom < this.minZoom && (e.zoom = this.minZoom))
: this.zoomOut && this.zoomOut.isDown && ((e.zoom += this.zoomSpeed), e.zoom > this.maxZoom && (e.zoom = this.maxZoom)));
},
destroy: function () {
(this.camera = null), (this.left = null), (this.right = null), (this.up = null), (this.down = null), (this.zoomIn = null), (this.zoomOut = null);
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(0),
s = i(6),
r = new n({
initialize: function (t) {
(this.camera = s(t, "camera", null)),
(this.left = s(t, "left", null)),
(this.right = s(t, "right", null)),
(this.up = s(t, "up", null)),
(this.down = s(t, "down", null)),
(this.zoomIn = s(t, "zoomIn", null)),
(this.zoomOut = s(t, "zoomOut", null)),
(this.zoomSpeed = s(t, "zoomSpeed", 0.01)),
(this.minZoom = s(t, "minZoom", 0.001)),
(this.maxZoom = s(t, "maxZoom", 1e3)),
(this.accelX = 0),
(this.accelY = 0);
var e = s(t, "acceleration", null);
"number" == typeof e ? ((this.accelX = e), (this.accelY = e)) : ((this.accelX = s(t, "acceleration.x", 0)), (this.accelY = s(t, "acceleration.y", 0))), (this.dragX = 0), (this.dragY = 0);
var i = s(t, "drag", null);
"number" == typeof i ? ((this.dragX = i), (this.dragY = i)) : ((this.dragX = s(t, "drag.x", 0)), (this.dragY = s(t, "drag.y", 0))), (this.maxSpeedX = 0), (this.maxSpeedY = 0);
var n = s(t, "maxSpeed", null);
"number" == typeof n ? ((this.maxSpeedX = n), (this.maxSpeedY = n)) : ((this.maxSpeedX = s(t, "maxSpeed.x", 0)), (this.maxSpeedY = s(t, "maxSpeed.y", 0))),
(this._speedX = 0),
(this._speedY = 0),
(this._zoom = 0),
(this.active = null !== this.camera);
},
start: function () {
return (this.active = null !== this.camera), this;
},
stop: function () {
return (this.active = !1), this;
},
setCamera: function (t) {
return (this.camera = t), this;
},
update: function (t) {
var e;
this.active &&
(void 0 === t && (t = 1),
(e = this.camera),
0 < this._speedX ? ((this._speedX -= this.dragX * t), this._speedX < 0 && (this._speedX = 0)) : this._speedX < 0 && ((this._speedX += this.dragX * t), 0 < this._speedX && (this._speedX = 0)),
0 < this._speedY ? ((this._speedY -= this.dragY * t), this._speedY < 0 && (this._speedY = 0)) : this._speedY < 0 && ((this._speedY += this.dragY * t), 0 < this._speedY && (this._speedY = 0)),
this.up && this.up.isDown
? ((this._speedY += this.accelY), this._speedY > this.maxSpeedY && (this._speedY = this.maxSpeedY))
: this.down && this.down.isDown && ((this._speedY -= this.accelY), this._speedY < -this.maxSpeedY && (this._speedY = -this.maxSpeedY)),
this.left && this.left.isDown
? ((this._speedX += this.accelX), this._speedX > this.maxSpeedX && (this._speedX = this.maxSpeedX))
: this.right && this.right.isDown && ((this._speedX -= this.accelX), this._speedX < -this.maxSpeedX && (this._speedX = -this.maxSpeedX)),
this.zoomIn && this.zoomIn.isDown ? (this._zoom = -this.zoomSpeed) : this.zoomOut && this.zoomOut.isDown ? (this._zoom = this.zoomSpeed) : (this._zoom = 0),
0 !== this._speedX && (e.scrollX -= (this._speedX * t) | 0),
0 !== this._speedY && (e.scrollY -= (this._speedY * t) | 0),
0 !== this._zoom && ((e.zoom += this._zoom), e.zoom < this.minZoom ? (e.zoom = this.minZoom) : e.zoom > this.maxZoom && (e.zoom = this.maxZoom)));
},
destroy: function () {
(this.camera = null), (this.left = null), (this.right = null), (this.up = null), (this.down = null), (this.zoomIn = null), (this.zoomOut = null);
},
});
t.exports = r;
},
function (t, e, i) {
t.exports = { Camera: i(326), BaseCamera: i(133), CameraManager: i(799), Effects: i(333), Events: i(37) };
},
function (t, e) {
t.exports = "cameradestroy";
},
function (t, e) {
t.exports = "camerafadeincomplete";
},
function (t, e) {
t.exports = "camerafadeinstart";
},
function (t, e) {
t.exports = "camerafadeoutcomplete";
},
function (t, e) {
t.exports = "camerafadeoutstart";
},
function (t, e) {
t.exports = "cameraflashcomplete";
},
function (t, e) {
t.exports = "cameraflashstart";
},
function (t, e) {
t.exports = "followupdate";
},
function (t, e) {
t.exports = "camerapancomplete";
},
function (t, e) {
t.exports = "camerapanstart";
},
function (t, e) {
t.exports = "postrender";
},
function (t, e) {
t.exports = "prerender";
},
function (t, e) {
t.exports = "camerarotatecomplete";
},
function (t, e) {
t.exports = "camerarotatestart";
},
function (t, e) {
t.exports = "camerashakecomplete";
},
function (t, e) {
t.exports = "camerashakestart";
},
function (t, e) {
t.exports = "camerazoomcomplete";
},
function (t, e) {
t.exports = "camerazoomstart";
},
function (t, e, i) {
var n = i(18),
s = i(0),
l = i(37),
r = new s({
initialize: function (t) {
(this.camera = t),
(this.isRunning = !1),
(this.isComplete = !1),
(this.direction = !0),
(this.duration = 0),
(this.red = 0),
(this.green = 0),
(this.blue = 0),
(this.alpha = 0),
(this.progress = 0),
(this._elapsed = 0),
this._onUpdate,
this._onUpdateScope;
},
start: function (t, e, i, n, s, r, o, a) {
if (
(void 0 === t && (t = !0),
void 0 === e && (e = 1e3),
void 0 === i && (i = 0),
void 0 === n && (n = 0),
void 0 === s && (s = 0),
void 0 === r && (r = !1),
void 0 === o && (o = null),
void 0 === a && (a = this.camera.scene),
!r && this.isRunning)
)
return this.camera;
(this.isRunning = !0),
(this.isComplete = !1),
(this.duration = e),
(this.direction = t),
(this.progress = 0),
(this.red = i),
(this.green = n),
(this.blue = s),
(this.alpha = t ? Number.MIN_VALUE : 1),
(this._elapsed = 0),
(this._onUpdate = o),
(this._onUpdateScope = a);
var h = t ? l.FADE_OUT_START : l.FADE_IN_START;
return this.camera.emit(h, this.camera, this, e, i, n, s), this.camera;
},
update: function (t, e) {
this.isRunning &&
((this._elapsed += e),
(this.progress = n(this._elapsed / this.duration, 0, 1)),
this._onUpdate && this._onUpdate.call(this._onUpdateScope, this.camera, this.progress),
this._elapsed < this.duration ? (this.alpha = this.direction ? this.progress : 1 - this.progress) : ((this.alpha = this.direction ? 1 : 0), this.effectComplete()));
},
postRenderCanvas: function (t) {
if (!this.isRunning && !this.isComplete) return !1;
var e = this.camera;
return (t.fillStyle = "rgba(" + this.red + "," + this.green + "," + this.blue + "," + this.alpha + ")"), t.fillRect(e.x, e.y, e.width, e.height), !0;
},
postRenderWebGL: function (t, e) {
if (!this.isRunning && !this.isComplete) return !1;
var i = this.camera,
n = this.red / 255,
s = this.green / 255,
r = this.blue / 255;
return t.drawFillRect(i.x, i.y, i.width, i.height, e(r, s, n, 1), this.alpha), !0;
},
effectComplete: function () {
(this._onUpdate = null), (this._onUpdateScope = null), (this.isRunning = !1), (this.isComplete = !0);
var t = this.direction ? l.FADE_OUT_COMPLETE : l.FADE_IN_COMPLETE;
this.camera.emit(t, this.camera, this);
},
reset: function () {
(this.isRunning = !1), (this.isComplete = !1), (this._onUpdate = null), (this._onUpdateScope = null);
},
destroy: function () {
this.reset(), (this.camera = null);
},
});
t.exports = r;
},
function (t, e, i) {
var n = i(18),
s = i(0),
a = i(37),
r = new s({
initialize: function (t) {
(this.camera = t),
(this.isRunning = !1),
(this.duration = 0),
(this.red = 0),
(this.green = 0),
(this.blue = 0),
(this.alpha = 0),
(this.progress = 0),
(this._elapsed = 0),
this._onUpdate,
this._onUpdateScope;
},
start: function (t, e, i, n, s, r, o) {
return (
void 0 === t && (t = 250),
void 0 === e && (e = 255),
void 0 === i && (i = 255),
void 0 === n && (n = 255),
void 0 === s && (s = !1),
void 0 === r && (r = null),
void 0 === o && (o = this.camera.scene),
(!s && this.isRunning) ||
((this.isRunning = !0),
(this.duration = t),
(this.progress = 0),
(this.red = e),
(this.green = i),
(this.blue = n),
(this.alpha = 1),
(this._elapsed = 0),
(this._onUpdate = r),
(this._onUpdateScope = o),
this.camera.emit(a.FLASH_START, this.camera, this, t, e, i, n)),
this.camera
);
},
update: function (t, e) {
this.isRunning &&
((this._elapsed += e),
(this.progress = n(this._elapsed / this.duration, 0, 1)),
this._onUpdate && this._onUpdate.call(this._onUpdateScope, this.camera, this.progress),
this._elapsed < this.duration ? (this.alpha = 1 - this.progress) : this.effectComplete());
},
postRenderCanvas: function (t) {
if (!this.isRunning) return !1;
var e = this.camera;
return (t.fillStyle = "rgba(" + this.red + "," + this.green + "," + this.blue + "," + this.alpha + ")"), t.fillRect(e.x, e.y, e.width, e.height), !0;
},
postRenderWebGL: function (t, e) {
if (!this.isRunning) return !1;
var i = this.camera,
n = this.red / 255,
s = this.green / 255,
r = this.blue / 255;
return t.drawFillRect(i.x, i.y, i.width, i.height, e(r, s, n, 1), this.alpha), !0;
},
effectComplete: function () {
(this._onUpdate = null), (this._onUpdateScope = null), (this.isRunning = !1), this.camera.emit(a.FLASH_COMPLETE, this.camera, this);
},
reset: function () {
(this.isRunning = !1), (this._onUpdate = null), (this._onUpdateScope = null);
},
destroy: function () {
this.reset(), (this.camera = null);
},
});
t.exports = r;
},
function (t, e, i) {
var a = i(18),
n = i(0),
h = i(134),
l = i(37),
s = i(3),
r = new n({
initialize: function (t) {
(this.camera = t),
(this.isRunning = !1),
(this.duration = 0),
(this.source = new s()),
(this.current = new s()),
(this.destination = new s()),
this.ease,
(this.progress = 0),
(this._elapsed = 0),
this._onUpdate,
this._onUpdateScope;
},
start: function (t, e, i, n, s, r, o) {
void 0 === i && (i = 1e3), void 0 === n && (n = h.Linear), void 0 === s && (s = !1), void 0 === r && (r = null), void 0 === o && (o = this.camera.scene);
var a = this.camera;
return (
(!s && this.isRunning) ||
((this.isRunning = !0),
(this.duration = i),
(this.progress = 0),
this.source.set(a.scrollX, a.scrollY),
this.destination.set(t, e),
a.getScroll(t, e, this.current),
"string" == typeof n && h.hasOwnProperty(n) ? (this.ease = h[n]) : "function" == typeof n && (this.ease = n),
(this._elapsed = 0),
(this._onUpdate = r),
(this._onUpdateScope = o),
this.camera.emit(l.PAN_START, this.camera, this, i, t, e)),
a
);
},
update: function (t, e) {
var i, n, s, r, o;
this.isRunning &&
((this._elapsed += e),
(i = a(this._elapsed / this.duration, 0, 1)),
(this.progress = i),
(n = this.camera),
this._elapsed < this.duration
? ((s = this.ease(i)),
n.getScroll(this.destination.x, this.destination.y, this.current),
(r = this.source.x + (this.current.x - this.source.x) * s),
(o = this.source.y + (this.current.y - this.source.y) * s),
n.setScroll(r, o),
this._onUpdate && this._onUpdate.call(this._onUpdateScope, n, i, r, o))
: (n.centerOn(this.destination.x, this.destination.y), this._onUpdate && this._onUpdate.call(this._onUpdateScope, n, i, n.scrollX, n.scrollY), this.effectComplete()));
},
effectComplete: function () {
(this._onUpdate = null), (this._onUpdateScope = null), (this.isRunning = !1), this.camera.emit(l.PAN_COMPLETE, this.camera, this);
},
reset: function () {
(this.isRunning = !1), (this._onUpdate = null), (this._onUpdateScope = null);
},
destroy: function () {
this.reset(), (this.camera = null), (this.source = null), (this.destination = null);
},
});
t.exports = r;
},
function (t, e) {
t.exports = function (t, e) {
return void 0 === e && (e = 1.70158), t * t * ((e + 1) * t - e);
};
},
function (t, e) {
t.exports = function (t, e) {
return void 0 === e && (e = 1.70158), --t * t * ((e + 1) * t + e) + 1;
};
},
function (t, e) {
t.exports = function (t, e) {
void 0 === e && (e = 1.70158);
var i = 1.525 * e;
return (t *= 2) < 1 ? t * t * ((1 + i) * t - i) * 0.5 : 0.5 * ((t -= 2) * t * ((1 + i) * t + i) + 2);
};
},
function (t, e) {
t.exports = function (t) {
return (t = 1 - t) < 1 / 2.75
? 1 - 7.5625 * t * t
: t < 2 / 2.75
? 1 - (7.5625 * (t -= 1.5 / 2.75) * t + 0.75)
: t < 2.5 / 2.75
? 1 - (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375)
: 1 - (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375);
};
},
function (t, e) {
t.exports = function (t) {
return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + 0.75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375 : 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375;
};
},
function (t, e) {
t.exports = function (t) {
var e = !1;
return (
t < 0.5 ? ((t = 1 - 2 * t), (e = !0)) : (t = 2 * t - 1),
t < 1 / 2.75 ? (t *= 7.5625 * t) : (t = t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + 0.75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375 : 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375),
e ? 0.5 * (1 - t) : 0.5 * t + 0.5
);
};
},
function (t, e) {
t.exports = function (t) {
return 1 - Math.sqrt(1 - t * t);
};
},
function (t, e) {
t.exports = function (t) {
return Math.sqrt(1 - --t * t);
};
},
function (t, e) {
t.exports = function (t) {
return (t *= 2) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);
};
},
function (t, e) {
t.exports = function (t) {
return t * t * t;
};
},
function (t, e) {
t.exports = function (t) {
return --t * t * t + 1;
};
},
function (t, e) {
t.exports = function (t) {
return (t *= 2) < 1 ? 0.5 * t * t * t : 0.5 * ((t -= 2) * t * t + 2);
};
},
function (t, e) {
t.exports = function (t, e, i) {
if ((void 0 === e && (e = 0.1), void 0 === i && (i = 0.1), 0 === t)) return 0;
if (1 === t) return 1;
var n = i / 4;
return e < 1 ? (e = 1) : (n = (i * Math.asin(1 / e)) / (2 * Math.PI)), -e * Math.pow(2, 10 * --t) * Math.sin(((t - n) * (2 * Math.PI)) / i);
};
},
function (t, e) {
t.exports = function (t, e, i) {
if ((void 0 === e && (e = 0.1), void 0 === i && (i = 0.1), 0 === t)) return 0;
if (1 === t) return 1;
var n = i / 4;
return e < 1 ? (e = 1) : (n = (i * Math.asin(1 / e)) / (2 * Math.PI)), e * Math.pow(2, -10 * t) * Math.sin(((t - n) * (2 * Math.PI)) / i) + 1;
};
},
function (t, e) {
t.exports = function (t, e, i) {
if ((void 0 === e && (e = 0.1), void 0 === i && (i = 0.1), 0 === t)) return 0;
if (1 === t) return 1;
var n = i / 4;
return (
e < 1 ? (e = 1) : (n = (i * Math.asin(1 / e)) / (2 * Math.PI)),
(t *= 2) < 1 ? e * Math.pow(2, 10 * --t) * Math.sin(((t - n) * (2 * Math.PI)) / i) * -0.5 : e * Math.pow(2, -10 * --t) * Math.sin(((t - n) * (2 * Math.PI)) / i) * 0.5 + 1
);
};
},
function (t, e) {
t.exports = function (t) {
return Math.pow(2, 10 * (t - 1)) - 0.001;
};
},
function (t, e) {
t.exports = function (t) {
return 1 - Math.pow(2, -10 * t);
};
},
function (t, e) {
t.exports = function (t) {
return (t *= 2) < 1 ? 0.5 * Math.pow(2, 10 * (t - 1)) : 0.5 * (2 - Math.pow(2, -10 * (t - 1)));
};
},
function (t, e) {
t.exports = function (t) {
return t;
};
},
function (t, e) {
t.exports = function (t) {
return t * t;
};
},
function (t, e) {
t.exports = function (t) {
return t * (2 - t);
};
},
function (t, e) {
t.exports = function (t) {
return (t *= 2) < 1 ? 0.5 * t * t : -0.5 * (--t * (t - 2) - 1);
};
},
function (t, e) {
t.exports = function (t) {
return t * t * t * t;
};
},
function (t, e) {
t.exports = function (t) {
return 1 - --t * t * t * t;
};
},
function (t, e) {
t.exports = function (t) {
return (t *= 2) < 1 ? 0.5 * t * t * t * t : -0.5 * ((t -= 2) * t * t * t - 2);
};
},
function (t, e) {
t.exports = function (t) {
return t * t * t * t * t;
};
},
function (t, e) {
t.exports = function (t) {
return --t * t * t * t * t + 1;
};
},
function (t, e) {
t.exports = function (t) {
return (t *= 2) < 1 ? 0.5 * t * t * t * t * t : 0.5 * ((t -= 2) * t * t * t * t + 2);
};
},
function (t, e) {
t.exports = function (t) {
return 0 === t ? 0 : 1 === t ? 1 : 1 - Math.cos((t * Math.PI) / 2);
};
},
function (t, e) {
t.exports = function (t) {
return 0 === t ? 0 : 1 === t ? 1 : Math.sin((t * Math.PI) / 2);
};
},
function (t, e) {
t.exports = function (t) {
return 0 === t ? 0 : 1 === t ? 1 : 0.5 * (1 - Math.cos(Math.PI * t));
};
},
function (t, e) {
t.exports = function (t, e) {
return void 0 === e && (e = 1), t <= 0 ? 0 : 1 <= t ? 1 : (1 / e) * (1 + ((e * t) | 0));
};
},
function (t, e, i) {
var o = i(18),
n = i(0),
r = i(37),
s = i(3),
a = new n({
initialize: function (t) {
(this.camera = t),
(this.isRunning = !1),
(this.duration = 0),
(this.intensity = new s()),
(this.progress = 0),
(this._elapsed = 0),
(this._offsetX = 0),
(this._offsetY = 0),
this._onUpdate,
this._onUpdateScope;
},
start: function (t, e, i, n, s) {
return (
void 0 === t && (t = 100),
void 0 === e && (e = 0.05),
void 0 === i && (i = !1),
void 0 === n && (n = null),
void 0 === s && (s = this.camera.scene),
(!i && this.isRunning) ||
((this.isRunning = !0),
(this.duration = t),
(this.progress = 0),
"number" == typeof e ? this.intensity.set(e) : this.intensity.set(e.x, e.y),
(this._elapsed = 0),
(this._offsetX = 0),
(this._offsetY = 0),
(this._onUpdate = n),
(this._onUpdateScope = s),
this.camera.emit(r.SHAKE_START, this.camera, this, t, e)),
this.camera
);
},
preRender: function () {
this.isRunning && this.camera.matrix.translate(this._offsetX, this._offsetY);
},
update: function (t, e) {
var i, n, s, r;
this.isRunning &&
((this._elapsed += e),
(this.progress = o(this._elapsed / this.duration, 0, 1)),
this._onUpdate && this._onUpdate.call(this._onUpdateScope, this.camera, this.progress),
this._elapsed < this.duration
? ((i = this.intensity),
(n = this.camera.width),
(s = this.camera.height),
(r = this.camera.zoom),
(this._offsetX = (Math.random() * i.x * n * 2 - i.x * n) * r),
(this._offsetY = (Math.random() * i.y * s * 2 - i.y * s) * r),
this.camera.roundPixels && ((this._offsetX = Math.round(this._offsetX)), (this._offsetY = Math.round(this._offsetY))))
: this.effectComplete());
},
effectComplete: function () {
(this._offsetX = 0), (this._offsetY = 0), (this._onUpdate = null), (this._onUpdateScope = null), (this.isRunning = !1), this.camera.emit(r.SHAKE_COMPLETE, this.camera, this);
},
reset: function () {
(this.isRunning = !1), (this._offsetX = 0), (this._offsetY = 0), (this._onUpdate = null), (this._onUpdateScope = null);
},
destroy: function () {
this.reset(), (this.camera = null), (this.intensity = null);
},
});
t.exports = a;
},
function (t, e, i) {
var u = i(18),
n = i(0),
d = i(37),
f = i(134),
s = new n({
initialize: function (t) {
(this.camera = t),
(this.isRunning = !1),
(this.duration = 0),
(this.source = 0),
(this.current = 0),
(this.destination = 0),
this.ease,
(this.progress = 0),
(this._elapsed = 0),
this._onUpdate,
this._onUpdateScope,
(this.clockwise = !0),
(this.shortestPath = !1);
},
start: function (t, e, i, n, s, r, o) {
void 0 === i && (i = 1e3),
void 0 === n && (n = f.Linear),
void 0 === s && (s = !1),
void 0 === r && (r = null),
void 0 === o && (o = this.camera.scene),
void 0 === e && (e = !1),
(this.shortestPath = e);
var a = t;
this.clockwise = !(t < 0) || ((a = -1 * t), !1);
var h = (360 * Math.PI) / 180;
a -= Math.floor(a / h) * h;
var l,
u,
c = this.camera;
return (
(!s && this.isRunning) ||
((this.isRunning = !0),
(this.duration = i),
(this.progress = 0),
(this.source = c.rotation),
(this.destination = a),
"string" == typeof n && f.hasOwnProperty(n) ? (this.ease = f[n]) : "function" == typeof n && (this.ease = n),
(this._elapsed = 0),
(this._onUpdate = r),
(this._onUpdateScope = o),
this.shortestPath &&
((l = this.destination > this.source ? Math.abs(this.destination - this.source) : Math.abs(this.destination + h) - this.source) <
(u = this.source > this.destination ? Math.abs(this.source - this.destination) : Math.abs(this.source + h) - this.destination)
? (this.clockwise = !0)
: u < l && (this.clockwise = !1)),
this.camera.emit(d.ROTATE_START, this.camera, this, i, a)),
c
);
},
update: function (t, e) {
var i, n, s, r, o, a, h, l;
this.isRunning &&
((this._elapsed += e),
(i = u(this._elapsed / this.duration, 0, 1)),
(this.progress = i),
(n = this.camera),
this._elapsed < this.duration
? ((s = this.ease(i)),
(this.current = n.rotation),
(o = (360 * Math.PI) / 180),
(a = this.destination),
(h = this.current),
!1 === this.clockwise && ((a = this.current), (h = this.destination)),
(r = h <= a ? Math.abs(a - h) : Math.abs(a + o) - h),
(l = this.clockwise ? n.rotation + r * s : n.rotation - r * s),
(n.rotation = l),
this._onUpdate && this._onUpdate.call(this._onUpdateScope, n, i, l))
: ((n.rotation = this.destination), this._onUpdate && this._onUpdate.call(this._onUpdateScope, n, i, this.destination), this.effectComplete()));
},
effectComplete: function () {
(this._onUpdate = null), (this._onUpdateScope = null), (this.isRunning = !1), this.camera.emit(d.ROTATE_COMPLETE, this.camera, this);
},
reset: function () {
(this.isRunning = !1), (this._onUpdate = null), (this._onUpdateScope = null);
},
destroy: function () {
this.reset(), (this.camera = null), (this.source = null), (this.destination = null);
},
});
t.exports = s;
},
function (t, e, i) {
var n = i(18),
s = i(0),
a = i(134),
h = i(37),
r = new s({
initialize: function (t) {
(this.camera = t), (this.isRunning = !1), (this.duration = 0), (this.source = 1), (this.destination = 1), this.ease, (this.progress = 0), (this._elapsed = 0), this._onUpdate, this._onUpdateScope;
},
start: function (t, e, i, n, s, r) {
void 0 === e && (e = 1e3), void 0 === i && (i = a.Linear), void 0 === n && (n = !1), void 0 === s && (s = null), void 0 === r && (r = this.camera.scene);
var o = this.camera;
return (
(!n && this.isRunning) ||
((this.isRunning = !0),
(this.duration = e),
(this.progress = 0),
(this.source = o.zoom),
(this.destination = t),
"string" == typeof i && a.hasOwnProperty(i) ? (this.ease = a[i]) : "function" == typeof i && (this.ease = i),
(this._elapsed = 0),
(this._onUpdate = s),
(this._onUpdateScope = r),
this.camera.emit(h.ZOOM_START, this.camera, this, e, t)),
o
);
},
update: function (t, e) {
this.isRunning &&
((this._elapsed += e),
(this.progress = n(this._elapsed / this.duration, 0, 1)),
this._elapsed < this.duration
? ((this.camera.zoom = this.source + (this.destination - this.source) * this.ease(this.progress)),
this._onUpdate && this._onUpdate.call(this._onUpdateScope, this.camera, this.progress, this.camera.zoom))
: ((this.camera.zoom = this.destination), this._onUpdate && this._onUpdate.call(this._onUpdateScope, this.camera, this.progress, this.destination), this.effectComplete()));
},
effectComplete: function () {
(this._onUpdate = null), (this._onUpdateScope = null), (this.isRunning = !1), this.camera.emit(h.ZOOM_COMPLETE, this.camera, this);
},
reset: function () {
(this.isRunning = !1), (this._onUpdate = null), (this._onUpdateScope = null);
},
destroy: function () {
this.reset(), (this.camera = null);
},
});
t.exports = r;
},
function (t, e, i) {
var a = i(326),
n = i(0),
v = i(2),
s = i(24),
h = i(57),
r = i(104),
o = i(20),
l = new n({
initialize: function (t) {
(this.scene = t),
(this.systems = t.sys),
(this.roundPixels = t.sys.game.config.roundPixels),
(this.cameras = []),
this.main,
this.default,
t.sys.events.once(o.BOOT, this.boot, this),
t.sys.events.on(o.START, this.start, this);
},
boot: function () {
var t = this.systems;
t.settings.cameras ? this.fromJSON(t.settings.cameras) : this.add(),
(this.main = this.cameras[0]),
(this.default = new a(0, 0, t.scale.width, t.scale.height).setScene(this.scene)),
t.game.scale.on(r.RESIZE, this.onResize, this),
this.systems.events.once(o.DESTROY, this.destroy, this);
},
start: function () {
var t;
this.main || ((t = this.systems).settings.cameras ? this.fromJSON(t.settings.cameras) : this.add(), (this.main = this.cameras[0]));
var e = this.systems.events;
e.on(o.UPDATE, this.update, this), e.once(o.SHUTDOWN, this.shutdown, this);
},
add: function (t, e, i, n, s, r) {
void 0 === t && (t = 0),
void 0 === e && (e = 0),
void 0 === i && (i = this.scene.sys.scale.width),
void 0 === n && (n = this.scene.sys.scale.height),
void 0 === s && (s = !1),
void 0 === r && (r = "");
var o = new a(t, e, i, n);
return o.setName(r), o.setScene(this.scene), o.setRoundPixels(this.roundPixels), (o.id = this.getNextID()), this.cameras.push(o), s && (this.main = o), o;
},
addExisting: function (t, e) {
return void 0 === e && (e = !1), -1 === this.cameras.indexOf(t) ? ((t.id = this.getNextID()), t.setRoundPixels(this.roundPixels), this.cameras.push(t), e && (this.main = t), t) : null;
},
getNextID: function () {
for (var t = this.cameras, e = 1, i = 0; i < 32; i++) {
for (var n = !1, s = 0; s < t.length; s++) {
var r = t[s];
r && r.id === e && (n = !0);
}
if (!n) return e;
e <<= 1;
}
return 0;
},
getTotal: function (t) {
void 0 === t && (t = !1);
for (var e = 0, i = this.cameras, n = 0; n < i.length; n++) {
var s = i[n];
(!t || (t && s.visible)) && e++;
}
return e;
},
fromJSON: function (t) {
Array.isArray(t) || (t = [t]);
for (var e = this.scene.sys.scale.width, i = this.scene.sys.scale.height, n = 0; n < t.length; n++) {
var s = t[n],
r = v(s, "x", 0),
o = v(s, "y", 0),
a = v(s, "width", e),
h = v(s, "height", i),
l = this.add(r, o, a, h);
(l.name = v(s, "name", "")),
(l.zoom = v(s, "zoom", 1)),
(l.rotation = v(s, "rotation", 0)),
(l.scrollX = v(s, "scrollX", 0)),
(l.scrollY = v(s, "scrollY", 0)),
(l.roundPixels = v(s, "roundPixels", !1)),
(l.visible = v(s, "visible", !0));
var u = v(s, "backgroundColor", !1);
u && l.setBackgroundColor(u);
var c,
d,
f,
p,
g = v(s, "bounds", null);
g && ((c = v(g, "x", 0)), (d = v(g, "y", 0)), (f = v(g, "width", e)), (p = v(g, "height", i)), l.setBounds(c, d, f, p));
}
return this;
},
getCamera: function (t) {
for (var e = this.cameras, i = 0; i < e.length; i++) if (e[i].name === t) return e[i];
return null;
},
getCamerasBelowPointer: function (t) {
for (var e = this.cameras, i = t.x, n = t.y, s = [], r = 0; r < e.length; r++) {
var o = e[r];
o.visible && o.inputEnabled && h(o, i, n) && s.unshift(o);
}
return s;
},
remove: function (t, e) {
void 0 === e && (e = !0), Array.isArray(t) || (t = [t]);
for (var i = 0, n = this.cameras, s = 0; s < t.length; s++) {
var r = n.indexOf(t[s]);
-1 !== r && (e ? n[r].destroy() : (n[r].renderList = []), n.splice(r, 1), i++);
}
return !this.main && n[0] && (this.main = n[0]), i;
},
render: function (t, e) {
for (var i = this.scene, n = this.cameras, s = 0; s < this.cameras.length; s++) {
var r,
o = n[s];
o.visible && 0 < o.alpha && (o.preRender(), (r = this.getVisibleChildren(e.getChildren(), o)), t.render(i, r, o));
}
},
getVisibleChildren: function (t, e) {
for (var i = [], n = 0; n < t.length; n++) {
var s = t[n];
s.willRender(e) && i.push(s);
}
return i;
},
resetAll: function () {
for (var t = 0; t < this.cameras.length; t++) this.cameras[t].destroy();
return (this.cameras = []), (this.main = this.add()), this.main;
},
update: function (t, e) {
for (var i = 0; i < this.cameras.length; i++) this.cameras[i].update(t, e);
},
onResize: function (t, e, i, n, s) {
for (var r = 0; r < this.cameras.length; r++) {
var o = this.cameras[r];
0 === o._x && 0 === o._y && o._width === n && o._height === s && o.setSize(e.width, e.height);
}
},
resize: function (t, e) {
for (var i = 0; i < this.cameras.length; i++) this.cameras[i].setSize(t, e);
},
shutdown: function () {
this.main = void 0;
for (var t = 0; t < this.cameras.length; t++) this.cameras[t].destroy();
this.cameras = [];
var e = this.systems.events;
e.off(o.UPDATE, this.update, this), e.off(o.SHUTDOWN, this.shutdown, this);
},
destroy: function () {
this.shutdown(), this.default.destroy(), this.scene.sys.events.off(o.START, this.start, this), (this.scene = null), (this.systems = null);
},
});
s.register("CameraManager", l, "cameras"), (t.exports = l);
},
function (t, e) {
t.exports = "enterfullscreen";
},
function (t, e) {
t.exports = "fullscreenfailed";
},
function (t, e) {
t.exports = "fullscreenunsupported";
},
function (t, e) {
t.exports = "leavefullscreen";
},
function (t, e) {
t.exports = "orientationchange";
},
function (t, e) {
t.exports = "resize";
},
function (t, e, i) {
t.exports = { Config: i(346), CreateRenderer: i(366), DebugHeader: i(384), Events: i(22), TimeStep: i(385), VisibilityHandler: i(387) };
},
function (t, e) {
var i,
n,
s = (t.exports = {});
function r() {
throw new Error("setTimeout has not been defined");
}
function o() {
throw new Error("clearTimeout has not been defined");
}
function a(e) {
if (i === setTimeout) return setTimeout(e, 0);
if ((i === r || !i) && setTimeout) return (i = setTimeout), setTimeout(e, 0);
try {
return i(e, 0);
} catch (t) {
try {
return i.call(null, e, 0);
} catch (t) {
return i.call(this, e, 0);
}
}
}
!(function () {
try {
i = "function" == typeof setTimeout ? setTimeout : r;
} catch (t) {
i = r;
}
try {
n = "function" == typeof clearTimeout ? clearTimeout : o;
} catch (t) {
n = o;
}
})();
var h,
l = [],
u = !1,
c = -1;
function d() {
u && h && ((u = !1), h.length ? (l = h.concat(l)) : (c = -1), l.length && f());
}
function f() {
if (!u) {
var t = a(d);
u = !0;
for (var e = l.length; e; ) {
for (h = l, l = []; ++c < e; ) h && h[c].run();
(c = -1), (e = l.length);
}
(h = null),
(u = !1),
(function (e) {
if (n === clearTimeout) return clearTimeout(e);
if ((n === o || !n) && clearTimeout) return (n = clearTimeout), clearTimeout(e);
try {
n(e);
} catch (t) {
try {
return n.call(null, e);
} catch (t) {
return n.call(this, e);
}
}
})(t);
}
}
function p(t, e) {
(this.fun = t), (this.array = e);
}
function g() {}
(s.nextTick = function (t) {
var e = new Array(arguments.length - 1);
if (1 < arguments.length) for (var i = 1; i < arguments.length; i++) e[i - 1] = arguments[i];
l.push(new p(t, e)), 1 !== l.length || u || a(f);
}),
(p.prototype.run = function () {
this.fun.apply(null, this.array);
}),
(s.title = "browser"),
(s.browser = !0),
(s.env = {}),
(s.argv = []),
(s.version = ""),
(s.versions = {}),
(s.on = g),
(s.addListener = g),
(s.once = g),
(s.off = g),
(s.removeListener = g),
(s.removeAllListeners = g),
(s.emit = g),
(s.prependListener = g),
(s.prependOnceListener = g),
(s.listeners = function (t) {
return [];
}),
(s.binding = function (t) {
throw new Error("process.binding is not supported");
}),
(s.cwd = function () {
return "/";
}),
(s.chdir = function (t) {
throw new Error("process.chdir is not supported");
}),
(s.umask = function () {
return 0;
});
},
function (t, e, i) {
var n = i(136),
s = { gamepads: !1, mspointer: !1, touch: !1, wheelEvent: null };
t.exports =
("function" == typeof importScripts ||
(("ontouchstart" in document.documentElement || (navigator.maxTouchPoints && 1 <= navigator.maxTouchPoints)) && (s.touch = !0),
(navigator.msPointerEnabled || navigator.pointerEnabled) && (s.mspointer = !0),
navigator.getGamepads && (s.gamepads = !0),
"onwheel" in window || (n.ie && "WheelEvent" in window)
? (s.wheelEvent = "wheel")
: "onmousewheel" in window
? (s.wheelEvent = "mousewheel")
: n.firefox && "MouseScrollEvent" in window && (s.wheelEvent = "DOMMouseScroll")),
s);
},
function (t, e, i) {
var s = i(136),
r = { audioData: !1, dolby: !1, m4a: !1, mp3: !1, ogg: !1, opus: !1, wav: !1, webAudio: !1, webm: !1 };
t.exports = (function () {
if ("function" == typeof importScripts) return r;
(r.audioData = !!window.Audio), (r.webAudio = !(!window.AudioContext && !window.webkitAudioContext));
var t,
e,
i = document.createElement("audio"),
n = !!i.canPlayType;
try {
n &&
(i.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, "") && (r.ogg = !0),
(i.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/, "") || i.canPlayType("audio/opus;").replace(/^no$/, "")) && (r.opus = !0),
i.canPlayType("audio/mpeg;").replace(/^no$/, "") && (r.mp3 = !0),
i.canPlayType("audio/wav").replace(/^no$/, "") && (r.wav = !0),
(i.canPlayType("audio/x-m4a;") || i.canPlayType("audio/aac;").replace(/^no$/, "")) && (r.m4a = !0),
i.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, "") && (r.webm = !0),
"" !== i.canPlayType('audio/mp4;codecs="ec-3"') &&
(s.edge
? (r.dolby = !0)
: s.safari &&
9 <= s.safariVersion &&
/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent) &&
((t = parseInt(RegExp.$1, 10)), (e = parseInt(RegExp.$2, 10)), ((10 === t && 11 <= e) || 10 < t) && (r.dolby = !0))));
} catch (t) {}
return r;
})();
},
function (t, e) {
var i = { h264: !1, hls: !1, mp4: !1, ogg: !1, vp9: !1, webm: !1 };
t.exports = (function () {
if ("function" == typeof importScripts) return i;
var t = document.createElement("video"),
e = !!t.canPlayType;
try {
e &&
(t.canPlayType('video/ogg; codecs="theora"').replace(/^no$/, "") && (i.ogg = !0),
t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/, "") && ((i.h264 = !0), (i.mp4 = !0)),
t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/, "") && (i.webm = !0),
t.canPlayType('video/webm; codecs="vp9"').replace(/^no$/, "") && (i.vp9 = !0),
t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/, "") && (i.hls = !0));
} catch (t) {}
return i;
})();
},
function (t, e) {
var r = { available: !1, cancel: "", keyboard: !1, request: "" };
t.exports = (function () {
if ("function" == typeof importScripts) return r;
for (
var t = "Fullscreen", e = "FullScreen", i = ["request" + t, "request" + e, "webkitRequest" + t, "webkitRequest" + e, "msRequest" + t, "msRequest" + e, "mozRequest" + e, "mozRequest" + t], n = 0;
n < i.length;
n++
)
if (document.documentElement[i[n]]) {
(r.available = !0), (r.request = i[n]);
break;
}
var s = ["cancel" + e, "exit" + t, "webkitCancel" + e, "webkitExit" + t, "msCancel" + e, "msExit" + t, "mozCancel" + e, "mozExit" + t];
if (r.available)
for (n = 0; n < s.length; n++)
if (document[s[n]]) {
r.cancel = s[n];
break;
}
return (
window.Element && Element.ALLOW_KEYBOARD_INPUT && !/ Version\/5\.1(?:\.\d+)? Safari\//.test(navigator.userAgent) && (r.keyboard = !0),
Object.defineProperty(r, "active", {
get: function () {
return !!(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement);
},
}),
r
);
})();
},
function (t, e, i) {
t.exports = {
Between: i(349),
BetweenPoints: i(350),
BetweenPointsY: i(813),
BetweenY: i(814),
CounterClockwise: i(815),
Normalize: i(351),
Random: i(816),
RandomDegrees: i(817),
Reverse: i(818),
RotateTo: i(819),
ShortestBetween: i(820),
Wrap: i(269),
WrapDegrees: i(270),
};
},
function (t, e) {
t.exports = function (t, e) {
return Math.atan2(e.x - t.x, e.y - t.y);
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
return Math.atan2(i - t, n - e);
};
},
function (t, e, i) {
var n = i(14);
t.exports = function (t) {
return t > Math.PI && (t -= n.PI2), Math.abs((((t + n.TAU) % n.PI2) - n.PI2) % n.PI2);
};
},
function (t, e, i) {
var n = i(137);
t.exports = function () {
return n(-Math.PI, Math.PI);
};
},
function (t, e, i) {
var n = i(137);
t.exports = function () {
return n(-180, 180);
};
},
function (t, e, i) {
var n = i(351);
t.exports = function (t) {
return n(t + Math.PI);
};
},
function (t, e, i) {
var n = i(14);
t.exports = function (t, e, i) {
return (
void 0 === i && (i = 0.05),
t === e || (Math.abs(e - t) <= i || Math.abs(e - t) >= n.PI2 - i ? (t = e) : (Math.abs(e - t) > Math.PI && (e < t ? (e += n.PI2) : (e -= n.PI2)), t < e ? (t += i) : e < t && (t -= i))),
t
);
};
},
function (t, e) {
t.exports = function (t, e) {
var i = e - t;
return 0 == i ? 0 : i - 360 * Math.floor((i + 180) / 360);
};
},
function (t, e, i) {
t.exports = { Between: i(50), BetweenPoints: i(352), BetweenPointsSquared: i(822), Chebyshev: i(823), Power: i(824), Snake: i(825), Squared: i(353) };
},
function (t, e) {
t.exports = function (t, e) {
var i = t.x - e.x,
n = t.y - e.y;
return i * i + n * n;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
return Math.max(Math.abs(t - i), Math.abs(e - n));
};
},
function (t, e) {
t.exports = function (t, e, i, n, s) {
return void 0 === s && (s = 2), Math.sqrt(Math.pow(i - t, s) + Math.pow(n - e, s));
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
return Math.abs(t - i) + Math.abs(e - n);
};
},
function (t, e, i) {
t.exports = { Back: i(334), Bounce: i(335), Circular: i(336), Cubic: i(337), Elastic: i(338), Expo: i(339), Linear: i(340), Quadratic: i(341), Quartic: i(342), Quintic: i(343), Sine: i(344), Stepped: i(345) };
},
function (t, e, i) {
t.exports = { Ceil: i(828), Equal: i(124), Floor: i(829), GreaterThan: i(354), LessThan: i(355) };
},
function (t, e) {
t.exports = function (t, e) {
return void 0 === e && (e = 1e-4), Math.ceil(t - e);
};
},
function (t, e) {
t.exports = function (t, e) {
return void 0 === e && (e = 1e-4), Math.floor(t + e);
};
},
function (t, e, i) {
t.exports = { Bezier: i(831), CatmullRom: i(832), CubicBezier: i(358), Linear: i(833), QuadraticBezier: i(359), SmoothStep: i(360), SmootherStep: i(834) };
},
function (t, e, i) {
var r = i(356);
t.exports = function (t, e) {
for (var i = 0, n = t.length - 1, s = 0; s <= n; s++) i += Math.pow(1 - e, n - s) * Math.pow(e, s) * t[s] * r(n, s);
return i;
};
},
function (t, e, i) {
var r = i(194);
t.exports = function (t, e) {
var i = t.length - 1,
n = i * e,
s = Math.floor(n);
return t[0] === t[i]
? (e < 0 && (s = Math.floor((n = i * (1 + e)))), r(n - s, t[(s - 1 + i) % i], t[s], t[(s + 1) % i], t[(s + 2) % i]))
: e < 0
? t[0] - (r(-n, t[0], t[0], t[1], t[1]) - t[0])
: 1 < e
? t[i] - (r(n - i, t[i], t[i], t[i - 1], t[i - 1]) - t[i])
: r(n - s, t[s ? s - 1 : 0], t[s], t[i < s + 1 ? i : s + 1], t[i < s + 2 ? i : s + 2]);
};
},
function (t, e, i) {
var r = i(135);
t.exports = function (t, e) {
var i = t.length - 1,
n = i * e,
s = Math.floor(n);
return e < 0 ? r(t[0], t[1], n) : 1 < e ? r(t[i], t[i - 1], i - n) : r(t[s], t[i < s + 1 ? i : s + 1], n - s);
};
},
function (t, e, i) {
var n = i(183);
t.exports = function (t, e, i) {
return e + (i - e) * n(t, 0, 1);
};
},
function (t, e, i) {
t.exports = { GetNext: i(361), IsSize: i(138), IsValue: i(836) };
},
function (t, e) {
t.exports = function (t) {
return 0 < t && 0 == (t & (t - 1));
};
},
function (t, e, i) {
t.exports = { Ceil: i(139), Floor: i(76), To: i(838) };
},
function (t, e) {
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), 0 === e ? t : ((t -= i), (t = e * Math.round(t / e)), n ? (i + t) / e : i + t);
};
},
function (t, e, i) {
var n = new (i(0))({
initialize: function (t) {
void 0 === t && (t = [(Date.now() * Math.random()).toString()]), (this.c = 1), (this.s0 = 0), (this.s1 = 0), (this.s2 = 0), (this.n = 0), (this.signs = [-1, 1]), t && this.init(t);
},
rnd: function () {
var t = 2091639 * this.s0 + 2.3283064365386963e-10 * this.c;
return (this.c = 0 | t), (this.s0 = this.s1), (this.s1 = this.s2), (this.s2 = t - this.c), this.s2;
},
hash: function (t) {
var e,
i = this.n;
t = t.toString();
for (var n = 0; n < t.length; n++) (e = 0.02519603282416938 * (i += t.charCodeAt(n))), (e -= i = e >>> 0), (i = (e *= i) >>> 0), (i += 4294967296 * (e -= i));
return 2.3283064365386963e-10 * ((this.n = i) >>> 0);
},
init: function (t) {
"string" == typeof t ? this.state(t) : this.sow(t);
},
sow: function (t) {
if (((this.n = 4022871197), (this.s0 = this.hash(" ")), (this.s1 = this.hash(" ")), (this.s2 = this.hash(" ")), (this.c = 1), t))
for (var e = 0; e < t.length && null != t[e]; e++) {
var i = t[e];
(this.s0 -= this.hash(i)), (this.s0 += ~~(this.s0 < 0)), (this.s1 -= this.hash(i)), (this.s1 += ~~(this.s1 < 0)), (this.s2 -= this.hash(i)), (this.s2 += ~~(this.s2 < 0));
}
},
integer: function () {
return 4294967296 * this.rnd();
},
frac: function () {
return this.rnd() + 11102230246251565e-32 * ((2097152 * this.rnd()) | 0);
},
real: function () {
return this.integer() + this.frac();
},
integerInRange: function (t, e) {
return Math.floor(this.realInRange(0, e - t + 1) + t);
},
between: function (t, e) {
return Math.floor(this.realInRange(0, e - t + 1) + t);
},
realInRange: function (t, e) {
return this.frac() * (e - t) + t;
},
normal: function () {
return 1 - 2 * this.frac();
},
uuid: function () {
var t = "",
e = "";
for (e = t = ""; t++ < 36; e += ~t % 5 | ((3 * t) & 4) ? (15 ^ t ? 8 ^ (this.frac() * (20 ^ t ? 16 : 4)) : 4).toString(16) : "-");
return e;
},
pick: function (t) {
return t[this.integerInRange(0, t.length - 1)];
},
sign: function () {
return this.pick(this.signs);
},
weightedPick: function (t) {
return t[~~(Math.pow(this.frac(), 2) * (t.length - 1) + 0.5)];
},
timestamp: function (t, e) {
return this.realInRange(t || 9466848e5, e || 1577862e6);
},
angle: function () {
return this.integerInRange(-180, 180);
},
rotation: function () {
return this.realInRange(-3.1415926, 3.1415926);
},
state: function (t) {
return (
"string" == typeof t && t.match(/^!rnd/) && ((t = t.split(",")), (this.c = parseFloat(t[1])), (this.s0 = parseFloat(t[2])), (this.s1 = parseFloat(t[3])), (this.s2 = parseFloat(t[4]))),
["!rnd", this.c, this.s0, this.s1, this.s2].join(",")
);
},
shuffle: function (t) {
for (var e = t.length - 1; 0 < e; e--) {
var i = Math.floor(this.frac() * (e + 1)),
n = t[i];
(t[i] = t[e]), (t[e] = n);
}
return t;
},
});
t.exports = n;
},
function (t, e) {
t.exports = function (t) {
for (var e = 0, i = 0; i < t.length; i++) e += +t[i];
return e / t.length;
};
},
function (t, e) {
t.exports = function (t, e, i) {
void 0 === e && (e = 0), void 0 === i && (i = 10);
var n = Math.pow(i, -e);
return Math.ceil(t * n) / n;
};
},
function (t, e) {
t.exports = function (t, e) {
return Math.abs(t - e);
};
},
function (t, e, i) {
var y = i(18),
n = i(0),
s = i(69),
r = i(1),
o = new s(),
a = new n({
initialize: function t(e, i, n, s) {
void 0 === e && (e = 0),
void 0 === i && (i = 0),
void 0 === n && (n = 0),
void 0 === s && (s = t.DefaultOrder),
(this._x = e),
(this._y = i),
(this._z = n),
(this._order = s),
(this.onChangeCallback = r);
},
x: {
get: function () {
return this._x;
},
set: function (t) {
(this._x = t), this.onChangeCallback(this);
},
},
y: {
get: function () {
return this._y;
},
set: function (t) {
(this._y = t), this.onChangeCallback(this);
},
},
z: {
get: function () {
return this._z;
},
set: function (t) {
(this._z = t), this.onChangeCallback(this);
},
},
order: {
get: function () {
return this._order;
},
set: function (t) {
(this._order = t), this.onChangeCallback(this);
},
},
set: function (t, e, i, n) {
return void 0 === n && (n = this._order), (this._x = t), (this._y = e), (this._z = i), (this._order = n), this.onChangeCallback(this), this;
},
copy: function (t) {
return this.set(t.x, t.y, t.z, t.order);
},
setFromQuaternion: function (t, e, i) {
return void 0 === e && (e = this._order), void 0 === i && (i = !1), o.fromQuat(t), this.setFromRotationMatrix(o, e, i);
},
setFromRotationMatrix: function (t, e, i) {
void 0 === e && (e = this._order), void 0 === i && (i = !1);
var n = t.val,
s = n[0],
r = n[4],
o = n[8],
a = n[1],
h = n[5],
l = n[9],
u = n[2],
c = n[6],
d = n[10],
f = 0,
p = 0,
g = 0,
v = 0.99999;
switch (e) {
case "XYZ":
(p = Math.asin(y(o, -1, 1))), Math.abs(o) < v ? ((f = Math.atan2(-l, d)), (g = Math.atan2(-r, s))) : (f = Math.atan2(c, h));
break;
case "YXZ":
(f = Math.asin(-y(l, -1, 1))), Math.abs(l) < v ? ((p = Math.atan2(o, d)), (g = Math.atan2(a, h))) : (p = Math.atan2(-u, s));
break;
case "ZXY":
(f = Math.asin(y(c, -1, 1))), (g = Math.abs(c) < v ? ((p = Math.atan2(-u, d)), Math.atan2(-r, h)) : Math.atan2(a, s));
break;
case "ZYX":
(p = Math.asin(-y(u, -1, 1))), (g = Math.abs(u) < v ? ((f = Math.atan2(c, d)), Math.atan2(a, s)) : Math.atan2(-r, h));
break;
case "YZX":
(g = Math.asin(y(a, -1, 1))), (p = Math.abs(a) < v ? ((f = Math.atan2(-l, h)), Math.atan2(-u, s)) : Math.atan2(o, d));
break;
case "XZY":
(g = Math.asin(-y(r, -1, 1))), Math.abs(r) < v ? ((f = Math.atan2(c, h)), (p = Math.atan2(o, s))) : (f = Math.atan2(-l, d));
}
return (this._x = f), (this._y = p), (this._z = g), (this._order = e), i && this.onChangeCallback(this), this;
},
});
(a.RotationOrders = ["XYZ", "YXZ", "ZXY", "ZYX", "YZX", "XZY"]), (a.DefaultOrder = "XYZ"), (t.exports = a);
},
function (t, e) {
t.exports = function (t, e, i) {
void 0 === e && (e = 0), void 0 === i && (i = 10);
var n = Math.pow(i, -e);
return Math.floor(t * n) / n;
};
},
function (t, e) {
t.exports = function (t, e) {
return t / e / 1e3;
};
},
function (t, e) {
t.exports = function (t) {
return t == parseFloat(t) ? !(t % 2) : void 0;
};
},
function (t, e) {
t.exports = function (t) {
return t === parseFloat(t) ? !(t % 2) : void 0;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return Math.min(t + e, i);
};
},
function (t, e) {
t.exports = function (t) {
var e = t.length;
if (0 === e) return 0;
t.sort(function (t, e) {
return t - e;
});
var i = Math.floor(e / 2);
return e % 2 == 0 ? (t[i] + t[i - 1]) / 2 : t[i];
};
},
function (t, e) {
t.exports = function (t, e, i) {
return Math.max(t - e, i);
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
void 0 === i && (i = e + 1);
var s = (t - e) / (i - e);
return 1 < s ? (void 0 !== n ? (s = (n - t) / (n - i)) < 0 && (s = 0) : (s = 1)) : s < 0 && (s = 0), s;
};
},
function (t, e) {
t.exports = function (t, e) {
void 0 === e && (e = 1);
var i = 2 * Math.random() * Math.PI;
return (t.x = Math.cos(i) * e), (t.y = Math.sin(i) * e), t;
};
},
function (t, e) {
t.exports = function (t, e) {
void 0 === e && (e = 1);
var i = 2 * Math.random() * Math.PI,
n = 2 * Math.random() - 1,
s = Math.sqrt(1 - n * n) * e;
return (t.x = Math.cos(i) * s), (t.y = Math.sin(i) * s), (t.z = n * e), t;
};
},
function (t, e) {
t.exports = function (t, e) {
return void 0 === e && (e = 1), (t.x = (2 * Math.random() - 1) * e), (t.y = (2 * Math.random() - 1) * e), (t.z = (2 * Math.random() - 1) * e), (t.w = (2 * Math.random() - 1) * e), t;
};
},
function (t, e) {
t.exports = function (t, e, i, n, s) {
return (t.x = e + s * Math.cos(n)), (t.y = i + s * Math.sin(n)), t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
void 0 === e && (e = 0), void 0 === i && (i = 10);
var n = Math.pow(i, -e);
return Math.round(t * n) / n;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
void 0 === e && (e = 1), void 0 === i && (i = 1), void 0 === n && (n = 1), (n *= Math.PI / t);
for (var s = [], r = [], o = 0; o < t; o++) (e += (i -= e * n) * n), (s[o] = i), (r[o] = e);
return { sin: r, cos: s, length: t };
};
},
function (t, e, i) {
var o = i(3);
t.exports = function (t, e, i, n) {
void 0 === n && (n = new o());
var s = 0,
r = 0;
return 0 < t && t <= e * i && (s = e - 1 < t ? t - (r = Math.floor(t / e)) * e : t), n.set(s, r);
};
},
function (t, e) {
t.exports = function (t, e, i) {
return Math.abs(t - e) <= i;
};
},
function (t, e, i) {
var n = i(39),
s = i(69),
r = i(365),
o = new s(),
a = new r(),
h = new n();
t.exports = function (t, e, i) {
return a.setAxisAngle(e, i), o.fromRotationTranslation(a, h.set(0, 0, 0)), t.transformMat4(o);
};
},
function (t, e) {
t.exports = "addtexture";
},
function (t, e) {
t.exports = "onerror";
},
function (t, e) {
t.exports = "onload";
},
function (t, e) {
t.exports = "ready";
},
function (t, e) {
t.exports = "removetexture";
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_BITMAP_MASK_FS",
"",
"precision mediump float;",
"",
"uniform vec2 uResolution;",
"uniform sampler2D uMainSampler;",
"uniform sampler2D uMaskSampler;",
"uniform bool uInvertMaskAlpha;",
"",
"void main ()",
"{",
" vec2 uv = gl_FragCoord.xy / uResolution;",
" vec4 mainColor = texture2D(uMainSampler, uv);",
" vec4 maskColor = texture2D(uMaskSampler, uv);",
" float alpha = mainColor.a;",
"",
" if (!uInvertMaskAlpha)",
" {",
" alpha *= (maskColor.a);",
" }",
" else",
" {",
" alpha *= (1.0 - maskColor.a);",
" }",
"",
" gl_FragColor = vec4(mainColor.rgb * alpha, alpha);",
"}",
"",
].join("\n");
},
function (t, e) {
t.exports = ["#define SHADER_NAME PHASER_BITMAP_MASK_VS", "", "precision mediump float;", "", "attribute vec2 inPosition;", "", "void main ()", "{", " gl_Position = vec4(inPosition, 0.0, 1.0);", "}", ""].join(
"\n"
);
},
function (t, e) {
t.exports = "pipelineafterflush";
},
function (t, e) {
t.exports = "pipelinebeforeflush";
},
function (t, e) {
t.exports = "pipelinebind";
},
function (t, e) {
t.exports = "pipelineboot";
},
function (t, e) {
t.exports = "pipelinedestroy";
},
function (t, e) {
t.exports = "pipelinerebind";
},
function (t, e) {
t.exports = "pipelineresize";
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_GRAPHICS_FS",
"",
"precision mediump float;",
"",
"varying vec4 outColor;",
"",
"void main ()",
"{",
" gl_FragColor = vec4(outColor.bgr * outColor.a, outColor.a);",
"}",
"",
].join("\n");
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_GRAPHICS_VS",
"",
"precision mediump float;",
"",
"uniform mat4 uProjectionMatrix;",
"",
"attribute vec2 inPosition;",
"attribute vec4 inColor;",
"",
"varying vec4 outColor;",
"",
"void main ()",
"{",
" gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",
"",
" outColor = inColor;",
"}",
"",
].join("\n");
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_LIGHT_FS",
"",
"precision mediump float;",
"",
"struct Light",
"{",
" vec2 position;",
" vec3 color;",
" float intensity;",
" float radius;",
"};",
"",
"const int kMaxLights = %LIGHT_COUNT%;",
"",
"uniform vec4 uCamera; /* x, y, rotation, zoom */",
"uniform vec2 uResolution;",
"uniform sampler2D uMainSampler;",
"uniform sampler2D uNormSampler;",
"uniform vec3 uAmbientLightColor;",
"uniform Light uLights[kMaxLights];",
"uniform mat3 uInverseRotationMatrix;",
"",
"varying vec2 outTexCoord;",
"varying vec4 outTint;",
"",
"void main()",
"{",
" vec3 finalColor = vec3(0.0, 0.0, 0.0);",
" vec4 color = texture2D(uMainSampler, outTexCoord) * vec4(outTint.bgr * outTint.a, outTint.a);",
" vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;",
" vec3 normal = normalize(uInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));",
" vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;",
"",
" for (int index = 0; index < kMaxLights; ++index)",
" {",
" Light light = uLights[index];",
" vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), 0.1);",
" vec3 lightNormal = normalize(lightDir);",
" float distToSurf = length(lightDir) * uCamera.w;",
" float diffuseFactor = max(dot(normal, lightNormal), 0.0);",
" float radius = (light.radius / res.x * uCamera.w) * uCamera.w;",
" float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);",
" vec3 diffuse = light.color * diffuseFactor;",
" finalColor += (attenuation * diffuse) * light.intensity;",
" }",
"",
" vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);",
"",
" gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);",
"}",
"",
].join("\n");
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_MULTI_FS",
"",
"precision mediump float;",
"",
"uniform sampler2D uMainSampler[%count%];",
"",
"varying vec2 outTexCoord;",
"varying float outTexId;",
"varying float outTintEffect;",
"varying vec4 outTint;",
"",
"void main ()",
"{",
" vec4 texture;",
"",
" %forloop%",
"",
" vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);",
"",
" // Multiply texture tint",
" vec4 color = texture * texel;",
"",
" if (outTintEffect == 1.0)",
" {",
" // Solid color + texture alpha",
" color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);",
" }",
" else if (outTintEffect == 2.0)",
" {",
" // Solid color, no texture",
" color = texel;",
" }",
"",
" gl_FragColor = color;",
"}",
"",
].join("\n");
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_MULTI_VS",
"",
"precision mediump float;",
"",
"uniform mat4 uProjectionMatrix;",
"",
"attribute vec2 inPosition;",
"attribute vec2 inTexCoord;",
"attribute float inTexId;",
"attribute float inTintEffect;",
"attribute vec4 inTint;",
"",
"varying vec2 outTexCoord;",
"varying float outTexId;",
"varying float outTintEffect;",
"varying vec4 outTint;",
"",
"void main ()",
"{",
" gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",
"",
" outTexCoord = inTexCoord;",
" outTexId = inTexId;",
" outTint = inTint;",
" outTintEffect = inTintEffect;",
"}",
"",
].join("\n");
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_POINTLIGHT_FS",
"",
"precision mediump float;",
"",
"uniform vec2 uResolution;",
"uniform float uCameraZoom;",
"",
"varying vec4 lightPosition;",
"varying vec4 lightColor;",
"varying float lightRadius;",
"varying float lightAttenuation;",
"",
"void main ()",
"{",
" vec2 center = (lightPosition.xy + 1.0) * (uResolution.xy * 0.5);",
"",
" float distToSurf = length(center - gl_FragCoord.xy);",
"",
" float radius = 1.0 - distToSurf / (lightRadius * uCameraZoom);",
"",
" float intensity = smoothstep(0.0, 1.0, radius * lightAttenuation);",
"",
" vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor;",
"",
" gl_FragColor = vec4(color.rgb * lightColor.a, color.a);",
"}",
"",
].join("\n");
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_POINTLIGHT_VS",
"",
"precision mediump float;",
"",
"uniform mat4 uProjectionMatrix;",
"",
"attribute vec2 inPosition;",
"attribute vec2 inLightPosition;",
"attribute vec4 inLightColor;",
"attribute float inLightRadius;",
"attribute float inLightAttenuation;",
"",
"varying vec4 lightPosition;",
"varying vec4 lightColor;",
"varying float lightRadius;",
"varying float lightAttenuation;",
"",
"void main ()",
"{",
" lightColor = inLightColor;",
" lightRadius = inLightRadius;",
" lightAttenuation = inLightAttenuation;",
" lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);",
"",
" gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",
"}",
"",
].join("\n");
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_SINGLE_FS",
"",
"precision mediump float;",
"",
"uniform sampler2D uMainSampler;",
"",
"varying vec2 outTexCoord;",
"varying float outTintEffect;",
"varying vec4 outTint;",
"",
"void main ()",
"{",
" vec4 texture = texture2D(uMainSampler, outTexCoord);",
" vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);",
"",
" // Multiply texture tint",
" vec4 color = texture * texel;",
"",
" if (outTintEffect == 1.0)",
" {",
" // Solid color + texture alpha",
" color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);",
" }",
" else if (outTintEffect == 2.0)",
" {",
" // Solid color, no texture",
" color = texel;",
" }",
"",
" gl_FragColor = color;",
"}",
"",
].join("\n");
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_SINGLE_VS",
"",
"precision mediump float;",
"",
"uniform mat4 uProjectionMatrix;",
"",
"attribute vec2 inPosition;",
"attribute vec2 inTexCoord;",
"attribute float inTexId;",
"attribute float inTintEffect;",
"attribute vec4 inTint;",
"",
"varying vec2 outTexCoord;",
"varying float outTintEffect;",
"varying vec4 outTint;",
"",
"void main ()",
"{",
" gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",
"",
" outTexCoord = inTexCoord;",
" outTint = inTint;",
" outTintEffect = inTintEffect;",
"}",
"",
].join("\n");
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_ADD_BLEND_FS",
"",
"precision mediump float;",
"",
"uniform sampler2D uMainSampler1;",
"uniform sampler2D uMainSampler2;",
"uniform float uStrength;",
"",
"varying vec2 outTexCoord;",
"",
"void main ()",
"{",
" vec4 frame1 = texture2D(uMainSampler1, outTexCoord);",
" vec4 frame2 = texture2D(uMainSampler2, outTexCoord);",
"",
" gl_FragColor = frame1 + frame2 * uStrength;",
"}",
"",
].join("\n");
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_COLORMATRIX_FS",
"",
"precision mediump float;",
"",
"uniform sampler2D uMainSampler;",
"uniform float uColorMatrix[20];",
"uniform float uAlpha;",
"",
"varying vec2 outTexCoord;",
"",
"void main ()",
"{",
" vec4 c = texture2D(uMainSampler, outTexCoord);",
"",
" if (uAlpha == 0.0)",
" {",
" gl_FragColor = c;",
"",
" return;",
" }",
"",
" if (c.a > 0.0)",
" {",
" c.rgb /= c.a;",
" }",
"",
" vec4 result;",
"",
" result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];",
" result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];",
" result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];",
" result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];",
"",
" vec3 rgb = mix(c.rgb, result.rgb, uAlpha);",
"",
" rgb *= result.a;",
"",
" gl_FragColor = vec4(rgb, result.a);",
"}",
"",
].join("\n");
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_COPY_FS",
"",
"precision mediump float;",
"",
"uniform sampler2D uMainSampler;",
"uniform float uBrightness;",
"",
"varying vec2 outTexCoord;",
"",
"void main ()",
"{",
" gl_FragColor = texture2D(uMainSampler, outTexCoord) * uBrightness;",
"}",
"",
].join("\n");
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_LINEAR_BLEND_FS",
"",
"precision mediump float;",
"",
"uniform sampler2D uMainSampler1;",
"uniform sampler2D uMainSampler2;",
"uniform float uStrength;",
"",
"varying vec2 outTexCoord;",
"",
"void main ()",
"{",
" vec4 frame1 = texture2D(uMainSampler1, outTexCoord);",
" vec4 frame2 = texture2D(uMainSampler2, outTexCoord);",
"",
" gl_FragColor = mix(frame1, frame2 * uStrength, 0.5);",
"}",
"",
].join("\n");
},
function (t, e, i) {
t.exports = { GenerateTexture: i(388), Palettes: i(889) };
},
function (t, e, i) {
t.exports = { ARNE16: i(389), C64: i(890), CGA: i(891), JMP: i(892), MSX: i(893) };
},
function (t, e) {
t.exports = {
0: "#000",
1: "#fff",
2: "#8b4131",
3: "#7bbdc5",
4: "#8b41ac",
5: "#6aac41",
6: "#3931a4",
7: "#d5de73",
8: "#945a20",
9: "#5a4100",
A: "#bd736a",
B: "#525252",
C: "#838383",
D: "#acee8b",
E: "#7b73de",
F: "#acacac",
};
},
function (t, e) {
t.exports = {
0: "#000",
1: "#2234d1",
2: "#0c7e45",
3: "#44aacc",
4: "#8a3622",
5: "#5c2e78",
6: "#aa5c3d",
7: "#b5b5b5",
8: "#5e606e",
9: "#4c81fb",
A: "#6cd947",
B: "#7be2f9",
C: "#eb8a60",
D: "#e23d69",
E: "#ffd93f",
F: "#fff",
};
},
function (t, e) {
t.exports = {
0: "#000",
1: "#191028",
2: "#46af45",
3: "#a1d685",
4: "#453e78",
5: "#7664fe",
6: "#833129",
7: "#9ec2e8",
8: "#dc534b",
9: "#e18d79",
A: "#d6b97b",
B: "#e9d8a1",
C: "#216c4b",
D: "#d365c8",
E: "#afaab9",
F: "#f5f4eb",
};
},
function (t, e) {
t.exports = {
0: "#000",
1: "#191028",
2: "#46af45",
3: "#a1d685",
4: "#453e78",
5: "#7664fe",
6: "#833129",
7: "#9ec2e8",
8: "#dc534b",
9: "#e18d79",
A: "#d6b97b",
B: "#e9d8a1",
C: "#216c4b",
D: "#d365c8",
E: "#afaab9",
F: "#fff",
};
},
function (t, e, i) {
t.exports = { Path: i(895), MoveTo: i(393), CubicBezier: i(390), Curve: i(94), Ellipse: i(391), Line: i(392), QuadraticBezier: i(394), Spline: i(395) };
},
function (t, e, i) {
var n = i(0),
u = i(390),
l = i(391),
s = i(5),
r = i(392),
o = i(393),
a = i(394),
h = i(10),
c = i(395),
d = i(3),
f = i(14),
p = new n({
initialize: function (t, e) {
void 0 === t && (t = 0),
void 0 === e && (e = 0),
(this.name = ""),
(this.curves = []),
(this.cacheLengths = []),
(this.autoClose = !1),
(this.startPoint = new d()),
(this._tmpVec2A = new d()),
(this._tmpVec2B = new d()),
"object" == typeof t ? this.fromJSON(t) : this.startPoint.set(t, e);
},
add: function (t) {
return this.curves.push(t), this;
},
circleTo: function (t, e, i) {
return void 0 === e && (e = !1), this.ellipseTo(t, t, 0, 360, e, i);
},
closePath: function () {
var t = this.curves[0].getPoint(0),
e = this.curves[this.curves.length - 1].getPoint(1);
return t.equals(e) || this.curves.push(new r(e, t)), this;
},
cubicBezierTo: function (t, e, i, n, s, r) {
var o,
a,
h = this.getEndPoint(),
l = t instanceof d ? ((o = t), (a = e), i) : ((o = new d(i, n)), (a = new d(s, r)), new d(t, e));
return this.add(new u(h, o, a, l));
},
quadraticBezierTo: function (t, e, i, n) {
var s,
r = this.getEndPoint(),
o = t instanceof d ? ((s = t), e) : ((s = new d(i, n)), new d(t, e));
return this.add(new a(r, s, o));
},
draw: function (t, e) {
for (var i = 0; i < this.curves.length; i++) {
var n = this.curves[i];
n.active && n.draw(t, e);
}
return t;
},
ellipseTo: function (t, e, i, n, s, r) {
var o = new l(0, 0, t, e, i, n, s, r),
a = this.getEndPoint(this._tmpVec2A),
h = o.getStartPoint(this._tmpVec2B);
return a.subtract(h), (o.x = a.x), (o.y = a.y), this.add(o);
},
fromJSON: function (t) {
(this.curves = []), (this.cacheLengths = []), this.startPoint.set(t.x, t.y), (this.autoClose = t.autoClose);
for (var e = 0; e < t.curves.length; e++) {
var i = t.curves[e];
switch (i.type) {
case "LineCurve":
this.add(r.fromJSON(i));
break;
case "EllipseCurve":
this.add(l.fromJSON(i));
break;
case "SplineCurve":
this.add(c.fromJSON(i));
break;
case "CubicBezierCurve":
this.add(u.fromJSON(i));
break;
case "QuadraticBezierCurve":
this.add(a.fromJSON(i));
}
}
return this;
},
getBounds: function (t, e) {
void 0 === t && (t = new h()), void 0 === e && (e = 16), (t.x = Number.MAX_VALUE), (t.y = Number.MAX_VALUE);
for (var i = new h(), n = f.MIN_SAFE_INTEGER, s = f.MIN_SAFE_INTEGER, r = 0; r < this.curves.length; r++) {
var o = this.curves[r];
o.active && (o.getBounds(i, e), (t.x = Math.min(t.x, i.x)), (t.y = Math.min(t.y, i.y)), (n = Math.max(n, i.right)), (s = Math.max(s, i.bottom)));
}
return (t.right = n), (t.bottom = s), t;
},
getCurveLengths: function () {
if (this.cacheLengths.length === this.curves.length) return this.cacheLengths;
for (var t = [], e = 0, i = 0; i < this.curves.length; i++) (e += this.curves[i].getLength()), t.push(e);
return (this.cacheLengths = t);
},
getEndPoint: function (t) {
return void 0 === t && (t = new d()), 0 < this.curves.length ? this.curves[this.curves.length - 1].getPoint(1, t) : t.copy(this.startPoint), t;
},
getLength: function () {
var t = this.getCurveLengths();
return t[t.length - 1];
},
getPoint: function (t, e) {
void 0 === e && (e = new d());
for (var i = t * this.getLength(), n = this.getCurveLengths(), s = 0; s < n.length; ) {
if (n[s] >= i) {
var r = n[s] - i,
o = this.curves[s],
a = o.getLength(),
h = 0 === a ? 0 : 1 - r / a;
return o.getPointAt(h, e);
}
s++;
}
return null;
},
getPoints: function (t) {
void 0 === t && (t = 12);
for (var e, i = [], n = 0; n < this.curves.length; n++) {
var s = this.curves[n];
if (s.active)
for (var r = s.getResolution(t), o = s.getPoints(r), a = 0; a < o.length; a++) {
var h = o[a];
(e && e.equals(h)) || (i.push(h), (e = h));
}
}
return this.autoClose && 1 < i.length && !i[i.length - 1].equals(i[0]) && i.push(i[0]), i;
},
getRandomPoint: function (t) {
return void 0 === t && (t = new d()), this.getPoint(Math.random(), t);
},
getSpacedPoints: function (t) {
void 0 === t && (t = 40);
for (var e = [], i = 0; i <= t; i++) e.push(this.getPoint(i / t));
return this.autoClose && e.push(e[0]), e;
},
getStartPoint: function (t) {
return void 0 === t && (t = new d()), t.copy(this.startPoint);
},
getTangent: function (t, e) {
void 0 === e && (e = new d());
for (var i = t * this.getLength(), n = this.getCurveLengths(), s = 0; s < n.length; ) {
if (n[s] >= i) {
var r = n[s] - i,
o = this.curves[s],
a = o.getLength(),
h = 0 === a ? 0 : 1 - r / a;
return o.getTangentAt(h, e);
}
s++;
}
return null;
},
lineTo: function (t, e) {
t instanceof d ? this._tmpVec2B.copy(t) : this._tmpVec2B.set(t, e);
var i = this.getEndPoint(this._tmpVec2A);
return this.add(new r([i.x, i.y, this._tmpVec2B.x, this._tmpVec2B.y]));
},
splineTo: function (t) {
return t.unshift(this.getEndPoint()), this.add(new c(t));
},
moveTo: function (t, e) {
return t instanceof d ? this.add(new o(t.x, t.y)) : this.add(new o(t, e));
},
toJSON: function () {
for (var t = [], e = 0; e < this.curves.length; e++) t.push(this.curves[e].toJSON());
return { type: "Path", x: this.startPoint.x, y: this.startPoint.y, autoClose: this.autoClose, curves: t };
},
updateArcLengths: function () {
(this.cacheLengths = []), this.getCurveLengths();
},
destroy: function () {
(this.curves.length = 0), (this.cacheLengths.length = 0), (this.startPoint = void 0);
},
});
s.register("path", function (t, e) {
return new p(t, e);
}),
(t.exports = p);
},
function (t, e, i) {
t.exports = { DataManager: i(101), DataManagerPlugin: i(897), Events: i(315) };
},
function (t, e, i) {
var n = i(0),
s = i(101),
r = i(24),
o = i(20),
a = new n({
Extends: s,
initialize: function (t) {
s.call(this, t, t.sys.events), (this.scene = t), (this.systems = t.sys), t.sys.events.once(o.BOOT, this.boot, this), t.sys.events.on(o.START, this.start, this);
},
boot: function () {
(this.events = this.systems.events), this.events.once(o.DESTROY, this.destroy, this);
},
start: function () {
this.events.once(o.SHUTDOWN, this.shutdown, this);
},
shutdown: function () {
this.systems.events.off(o.SHUTDOWN, this.shutdown, this);
},
destroy: function () {
s.prototype.destroy.call(this), this.events.off(o.START, this.start, this), (this.scene = null), (this.systems = null);
},
});
r.register("DataManagerPlugin", a, "data"), (t.exports = a);
},
function (t, e, i) {
t.exports = { Align: i(899), BaseShader: i(396), Bounds: i(902), Canvas: i(906), Color: i(397), ColorMatrix: i(198), Masks: i(916), RGB: i(200) };
},
function (t, e, i) {
var n = i(123),
s = i(17)(!1, (s = { In: i(900), To: i(901) }), n);
t.exports = s;
},
function (t, e, i) {
t.exports = { BottomCenter: i(290), BottomLeft: i(291), BottomRight: i(292), Center: i(293), LeftCenter: i(295), QuickSet: i(289), RightCenter: i(296), TopCenter: i(297), TopLeft: i(298), TopRight: i(299) };
},
function (t, e, i) {
t.exports = {
BottomCenter: i(277),
BottomLeft: i(278),
BottomRight: i(279),
LeftBottom: i(280),
LeftCenter: i(281),
LeftTop: i(282),
QuickSet: i(276),
RightBottom: i(283),
RightCenter: i(284),
RightTop: i(285),
TopCenter: i(286),
TopLeft: i(287),
TopRight: i(288),
};
},
function (t, e, i) {
t.exports = {
CenterOn: i(294),
GetBottom: i(42),
GetBounds: i(903),
GetCenterX: i(87),
GetCenterY: i(89),
GetLeft: i(43),
GetOffsetX: i(904),
GetOffsetY: i(905),
GetRight: i(44),
GetTop: i(45),
SetBottom: i(55),
SetCenterX: i(88),
SetCenterY: i(90),
SetLeft: i(53),
SetRight: i(54),
SetTop: i(52),
};
},
function (t, e, i) {
var s = i(42),
r = i(43),
o = i(44),
a = i(45);
t.exports = function (t, e) {
void 0 === e && (e = {});
var i = r(t),
n = a(t);
return (e.x = i), (e.y = n), (e.width = o(t) - i), (e.height = s(t) - n), e;
};
},
function (t, e) {
t.exports = function (t) {
return t.width * t.originX;
};
},
function (t, e) {
t.exports = function (t) {
return t.height * t.originY;
};
},
function (t, e, i) {
t.exports = { CanvasInterpolation: i(367), CanvasPool: i(31), Smoothing: i(192), TouchAction: i(907), UserSelect: i(908) };
},
function (t, e) {
t.exports = function (t, e) {
return void 0 === e && (e = "none"), (t.style.msTouchAction = e), (t.style["ms-touch-action"] = e), (t.style["touch-action"] = e), t;
};
},
function (t, e) {
t.exports = function (e, i) {
return (
void 0 === i && (i = "none"),
["-webkit-", "-khtml-", "-moz-", "-ms-", ""].forEach(function (t) {
e.style[t + "user-select"] = i;
}),
(e.style["-webkit-touch-callout"] = i),
(e.style["-webkit-tap-highlight-color"] = "rgba(0, 0, 0, 0)"),
e
);
};
},
function (t, e, i) {
var l = i(103);
t.exports = function (t) {
void 0 === t && (t = 1024);
var e = [],
i = 255,
n = 0,
s = 0;
for (h = 0; h <= 255; h++) e.push({ r: i, g: h, b: s, color: l(i, h, s) });
for (h = n = 255; 0 <= h; h--) e.push({ r: h, g: n, b: s, color: l(h, n, s) });
for (h = i = 0; h <= 255; h++, n--) e.push({ r: i, g: n, b: h, color: l(i, n, h) });
for (s = 255, h = n = 0; h <= 255; h++, s--, i++) e.push({ r: i, g: n, b: s, color: l(i, n, s) });
if (1024 === t) return e;
for (var r = [], o = 0, a = 1024 / t, h = 0; h < t; h++) r.push(e[Math.floor(o)]), (o += a);
return r;
};
},
function (t, e) {
t.exports = function (t) {
var e = { r: (t >> 16) & 255, g: (t >> 8) & 255, b: 255 & t, a: 255 };
return 16777215 < t && (e.a = t >>> 24), e;
};
},
function (t, e, i) {
var h = i(38),
l = i(399);
t.exports = function (t, e, i) {
var n,
s,
r = i,
o = i,
a = i;
return 0 !== e && ((r = l((s = 2 * i - (n = i < 0.5 ? i * (1 + e) : i + e - i * e)), n, t + 1 / 3)), (o = l(s, n, t)), (a = l(s, n, t - 1 / 3))), new h().setGLTo(r, o, a, 1);
};
},
function (t, e, i) {
var s = i(188);
t.exports = function (t, e) {
void 0 === t && (t = 1), void 0 === e && (e = 1);
for (var i = [], n = 0; n <= 359; n++) i.push(s(n / 359, t, e));
return i;
};
},
function (t, e, i) {
function o(t, e, i, n, s, r, o, a) {
void 0 === o && (o = 100), void 0 === a && (a = 0);
var h = a / o;
return { r: l(t, n, h), g: l(e, s, h), b: l(i, r, h) };
}
var l = i(135);
t.exports = {
RGBWithRGB: o,
ColorWithRGB: function (t, e, i, n, s, r) {
return void 0 === s && (s = 100), void 0 === r && (r = 0), o(t.r, t.g, t.b, e, i, n, s, r);
},
ColorWithColor: function (t, e, i, n) {
return void 0 === i && (i = 100), void 0 === n && (n = 0), o(t.r, t.g, t.b, e.r, e.g, e.b, i, n);
},
};
},
function (t, e, i) {
var n = i(195),
s = i(38);
t.exports = function (t, e) {
return void 0 === t && (t = 0), void 0 === e && (e = 255), new s(n(t, e), n(t, e), n(t, e));
};
},
function (t, e, i) {
var r = i(398);
t.exports = function (t, e, i, n, s) {
return void 0 === n && (n = 255), void 0 === s && (s = "#"), "#" === s ? "#" + ((1 << 24) + (t << 16) + (e << 8) + i).toString(16).slice(1, 7) : "0x" + r(n) + r(t) + r(e) + r(i);
};
},
function (t, e, i) {
t.exports = { BitmapMask: i(310), GeometryMask: i(311) };
},
function (t, e, i) {
var n = { AddToDOM: i(142), DOMContentLoaded: i(400), GetInnerHeight: i(401), GetScreenOrientation: i(402), GetTarget: i(407), ParseXML: i(408), RemoveFromDOM: i(202), RequestAnimationFrame: i(386) };
t.exports = n;
},
function (t, e, i) {
t.exports = { EventEmitter: i(919) };
},
function (t, e, i) {
var n = i(0),
s = i(9),
r = i(24),
o = new n({
Extends: s,
initialize: function () {
s.call(this);
},
shutdown: function () {
this.removeAllListeners();
},
destroy: function () {
this.removeAllListeners();
},
});
r.register("EventEmitter", o, "events"), (t.exports = o);
},
function (t, e, i) {
var n = i(142),
s = i(321),
r = i(325),
o = i(31),
a = i(0),
h = i(346),
l = i(921),
u = i(366),
c = i(101),
d = i(384),
f = i(347),
p = i(400),
g = i(9),
v = i(22),
y = i(409),
m = i(24),
x = i(414),
b = i(415),
w = i(417),
T = i(106),
S = i(422),
_ = i(385),
E = i(387),
P = i(426),
A = new a({
initialize: function (t) {
(this.config = new h(t)),
(this.renderer = null),
(this.domContainer = null),
(this.canvas = null),
(this.context = null),
(this.isBooted = !1),
(this.isRunning = !1),
(this.events = new g()),
(this.anims = new s(this)),
(this.textures = new S(this)),
(this.cache = new r(this)),
(this.registry = new c(this)),
(this.input = new y(this, this.config)),
(this.scene = new w(this, this.config.sceneConfig)),
(this.device = f),
(this.scale = new b(this, this.config)),
(this.sound = null),
(this.sound = P.create(this)),
(this.loop = new _(this, this.config.fps)),
(this.plugins = new x(this, this.config)),
(this.pendingDestroy = !1),
(this.removeCanvas = !1),
(this.noReturn = !1),
(this.hasFocus = !1),
p(this.boot.bind(this));
},
boot: function () {
m.hasCore("EventEmitter") &&
((this.isBooted = !0),
this.config.preBoot(this),
this.scale.preBoot(),
u(this),
l(this),
d(this),
n(this.canvas, this.config.parent),
this.textures.once(T.READY, this.texturesReady, this),
this.events.emit(v.BOOT));
},
texturesReady: function () {
this.events.emit(v.READY), this.start();
},
start: function () {
(this.isRunning = !0), this.config.postBoot(this), this.renderer ? this.loop.start(this.step.bind(this)) : this.loop.start(this.headlessStep.bind(this)), E(this);
var t = this.events;
t.on(v.HIDDEN, this.onHidden, this), t.on(v.VISIBLE, this.onVisible, this), t.on(v.BLUR, this.onBlur, this), t.on(v.FOCUS, this.onFocus, this);
},
step: function (t, e) {
if (this.pendingDestroy) return this.runDestroy();
var i = this.events;
i.emit(v.PRE_STEP, t, e), i.emit(v.STEP, t, e), this.scene.update(t, e), i.emit(v.POST_STEP, t, e);
var n = this.renderer;
n.preRender(), i.emit(v.PRE_RENDER, n, t, e), this.scene.render(n), n.postRender(), i.emit(v.POST_RENDER, n, t, e);
},
headlessStep: function (t, e) {
if (this.pendingDestroy) return this.runDestroy();
var i = this.events;
i.emit(v.PRE_STEP, t, e), i.emit(v.STEP, t, e), this.scene.update(t, e), i.emit(v.POST_STEP, t, e), i.emit(v.PRE_RENDER), i.emit(v.POST_RENDER);
},
onHidden: function () {
this.loop.pause(), this.events.emit(v.PAUSE);
},
onVisible: function () {
this.loop.resume(), this.events.emit(v.RESUME);
},
onBlur: function () {
(this.hasFocus = !1), this.loop.blur();
},
onFocus: function () {
(this.hasFocus = !0), this.loop.focus();
},
getFrame: function () {
return this.loop.frame;
},
getTime: function () {
return this.loop.now;
},
destroy: function (t, e) {
void 0 === e && (e = !1), (this.pendingDestroy = !0), (this.removeCanvas = t), (this.noReturn = e);
},
runDestroy: function () {
this.scene.destroy(),
this.events.emit(v.DESTROY),
this.events.removeAllListeners(),
this.renderer && this.renderer.destroy(),
this.removeCanvas && this.canvas && (o.remove(this.canvas), this.canvas.parentNode && this.canvas.parentNode.removeChild(this.canvas)),
this.domContainer && this.domContainer.parentNode.removeChild(this.domContainer),
this.loop.destroy(),
(this.pendingDestroy = !1);
},
});
t.exports = A;
},
function (t, e, i) {
var n = i(142);
t.exports = function (t) {
var e,
i = t.config;
i.parent &&
i.domCreateContainer &&
(((e = document.createElement("div")).style.cssText = [
"display: block;",
"width: " + t.scale.width + "px;",
"height: " + t.scale.height + "px;",
"padding: 0; margin: 0;",
"position: absolute;",
"overflow: hidden;",
"pointer-events: " + i.domPointerEvents + ";",
"transform: scale(1);",
"transform-origin: left top;",
].join(" ")),
(t.domContainer = e),
n(e, i.parent));
};
},
function (t, e) {
t.exports = "boot";
},
function (t, e) {
t.exports = "destroy";
},
function (t, e) {
t.exports = "dragend";
},
function (t, e) {
t.exports = "dragenter";
},
function (t, e) {
t.exports = "drag";
},
function (t, e) {
t.exports = "dragleave";
},
function (t, e) {
t.exports = "dragover";
},
function (t, e) {
t.exports = "dragstart";
},
function (t, e) {
t.exports = "drop";
},
function (t, e) {
t.exports = "gameout";
},
function (t, e) {
t.exports = "gameover";
},
function (t, e) {
t.exports = "gameobjectdown";
},
function (t, e) {
t.exports = "dragend";
},
function (t, e) {
t.exports = "dragenter";
},
function (t, e) {
t.exports = "drag";
},
function (t, e) {
t.exports = "dragleave";
},
function (t, e) {
t.exports = "dragover";
},
function (t, e) {
t.exports = "dragstart";
},
function (t, e) {
t.exports = "drop";
},
function (t, e) {
t.exports = "gameobjectmove";
},
function (t, e) {
t.exports = "gameobjectout";
},
function (t, e) {
t.exports = "gameobjectover";
},
function (t, e) {
t.exports = "pointerdown";
},
function (t, e) {
t.exports = "pointermove";
},
function (t, e) {
t.exports = "pointerout";
},
function (t, e) {
t.exports = "pointerover";
},
function (t, e) {
t.exports = "pointerup";
},
function (t, e) {
t.exports = "wheel";
},
function (t, e) {
t.exports = "gameobjectup";
},
function (t, e) {
t.exports = "gameobjectwheel";
},
function (t, e) {
t.exports = "boot";
},
function (t, e) {
t.exports = "process";
},
function (t, e) {
t.exports = "update";
},
function (t, e) {
t.exports = "pointerdown";
},
function (t, e) {
t.exports = "pointerdownoutside";
},
function (t, e) {
t.exports = "pointermove";
},
function (t, e) {
t.exports = "pointerout";
},
function (t, e) {
t.exports = "pointerover";
},
function (t, e) {
t.exports = "pointerup";
},
function (t, e) {
t.exports = "pointerupoutside";
},
function (t, e) {
t.exports = "wheel";
},
function (t, e) {
t.exports = "pointerlockchange";
},
function (t, e) {
t.exports = "preupdate";
},
function (t, e) {
t.exports = "shutdown";
},
function (t, e) {
t.exports = "start";
},
function (t, e) {
t.exports = "update";
},
function (t, e) {
t.exports = "addfile";
},
function (t, e) {
t.exports = "complete";
},
function (t, e) {
t.exports = "filecomplete";
},
function (t, e) {
t.exports = "filecomplete-";
},
function (t, e) {
t.exports = "loaderror";
},
function (t, e) {
t.exports = "load";
},
function (t, e) {
t.exports = "fileprogress";
},
function (t, e) {
t.exports = "postprocess";
},
function (t, e) {
t.exports = "progress";
},
function (t, e) {
t.exports = "start";
},
function (t, e, i) {
t.exports = {
game: "game",
renderer: "renderer",
anims: "anims",
cache: "cache",
plugins: "plugins",
registry: "registry",
scale: "scale",
sound: "sound",
textures: "textures",
events: "events",
cameras: "cameras",
add: "add",
make: "make",
scenePlugin: "scene",
displayList: "children",
lights: "lights",
data: "data",
input: "input",
load: "load",
time: "time",
tweens: "tweens",
arcadePhysics: "physics",
impactPhysics: "impact",
matterPhysics: "matter",
};
},
function (t, e) {
t.exports = function (t, e, i) {
if (i.getElementsByTagName("TextureAtlas")) {
var n = t.source[e];
t.add("__BASE", e, 0, 0, n.width, n.height);
for (var s = i.getElementsByTagName("SubTexture"), r = 0; r < s.length; r++) {
var o,
a,
h,
l,
u = s[r].attributes,
c = u.name.value,
d = parseInt(u.x.value, 10),
f = parseInt(u.y.value, 10),
p = parseInt(u.width.value, 10),
g = parseInt(u.height.value, 10),
v = t.add(c, e, d, f, p, g);
u.frameX &&
((o = Math.abs(parseInt(u.frameX.value, 10))),
(a = Math.abs(parseInt(u.frameY.value, 10))),
(h = parseInt(u.frameWidth.value, 10)),
(l = parseInt(u.frameHeight.value, 10)),
v.setTrim(p, g, o, a, h, l));
}
return t;
}
};
},
function (t, e) {
t.exports = function (t, e) {
var i = t.source[e];
return t.add("__BASE", e, 0, 0, i.width, i.height), t;
};
},
function (t, e) {
t.exports = function (t, e) {
var i = t.source[e];
return t.add("__BASE", e, 0, 0, i.width, i.height), t;
};
},
function (t, e, i) {
var u = i(77);
t.exports = function (t, e, i) {
if (i.frames || i.textures) {
var n = t.source[e];
t.add("__BASE", e, 0, 0, n.width, n.height);
for (var s = Array.isArray(i.textures) ? i.textures[e].frames : i.frames, r = 0; r < s.length; r++) {
var o = s[r],
a = t.add(o.filename, e, o.frame.x, o.frame.y, o.frame.w, o.frame.h);
o.trimmed && a.setTrim(o.sourceSize.w, o.sourceSize.h, o.spriteSourceSize.x, o.spriteSourceSize.y, o.spriteSourceSize.w, o.spriteSourceSize.h), o.rotated && ((a.rotated = !0), a.updateUVsInverted());
var h = o.anchor || o.pivot;
h && ((a.customPivot = !0), (a.pivotX = h.x), (a.pivotY = h.y)), (a.customData = u(o));
}
for (var l in i) "frames" !== l && (Array.isArray(i[l]) ? (t.customData[l] = i[l].slice(0)) : (t.customData[l] = i[l]));
return t;
}
};
},
function (t, e, i) {
var u = i(77);
t.exports = function (t, e, i) {
if (i.frames) {
var n = t.source[e];
t.add("__BASE", e, 0, 0, n.width, n.height);
var s,
r,
o,
a = i.frames;
for (var h in a)
a.hasOwnProperty(h) &&
((s = a[h]),
(r = t.add(h, e, s.frame.x, s.frame.y, s.frame.w, s.frame.h)),
s.trimmed && r.setTrim(s.sourceSize.w, s.sourceSize.h, s.spriteSourceSize.x, s.spriteSourceSize.y, s.spriteSourceSize.w, s.spriteSourceSize.h),
s.rotated && ((r.rotated = !0), r.updateUVsInverted()),
(o = s.anchor || s.pivot) && ((r.customPivot = !0), (r.pivotX = o.x), (r.pivotY = o.y)),
(r.customData = u(s)));
for (var l in i) "frames" !== l && (Array.isArray(i[l]) ? (t.customData[l] = i[l].slice(0)) : (t.customData[l] = i[l]));
return t;
}
};
},
function (t, e, i) {
var T = i(2);
t.exports = function (t, e, i, n, s, r, o) {
var a = T(o, "frameWidth", null),
h = T(o, "frameHeight", a);
if (null === a) throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");
var l = t.source[e];
t.add("__BASE", e, 0, 0, l.width, l.height);
var u = T(o, "startFrame", 0),
c = T(o, "endFrame", -1),
d = T(o, "margin", 0),
f = T(o, "spacing", 0),
p = Math.floor((s - d + f) / (a + f)) * Math.floor((r - d + f) / (h + f));
(p < u || u < -p) && (u = 0), u < 0 && (u = p + u), -1 !== c && (p = u + (c + 1));
for (var g = d, v = d, y = 0, m = 0, x = 0; x < p; x++) {
m = y = 0;
var b = g + a,
w = v + h;
s < b && (y = b - s), r < w && (m = w - r), t.add(x, e, i + g, n + v, a - y, h - m), s < (g += a + f) + a && ((g = d), (v += h + f));
}
return t;
};
},
function (t, e, i) {
var X = i(2);
t.exports = function (t, e, i) {
var n = X(i, "frameWidth", null),
s = X(i, "frameHeight", n);
if (!n) throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");
var r = t.source[0];
t.add("__BASE", 0, 0, 0, r.width, r.height);
var o = X(i, "startFrame", 0),
a = X(i, "endFrame", -1),
h = X(i, "margin", 0),
l = X(i, "spacing", 0),
u = e.cutX,
c = e.cutY,
d = e.cutWidth,
f = e.cutHeight,
p = e.realWidth,
g = e.realHeight,
v = Math.floor((p - h + l) / (n + l)),
y = Math.floor((g - h + l) / (s + l)),
m = v * y,
x = e.x,
b = n - x,
w = n - (p - d - x),
T = e.y,
S = s - T,
_ = s - (g - f - T);
(m < o || o < -m) && (o = 0), o < 0 && (o = m + o), -1 !== a && (m = o + (a + 1));
for (var E = h, P = h, A = 0, M = e.sourceIndex, C = 0; C < y; C++) {
for (var O = 0 === C, k = C === y - 1, R = 0; R < v; R++) {
var L,
I,
D,
F,
B,
N,
U = 0 === R,
Y = R === v - 1,
z = t.add(A, M, u + E, c + P, n, s);
(U || O || Y || k) &&
((L = U ? x : 0),
(I = O ? T : 0),
(F = D = 0),
U && (D += n - b),
Y && (D += n - w),
O && (F += s - S),
k && (F += s - _),
(B = n - D),
(N = s - F),
(z.cutWidth = B),
(z.cutHeight = N),
z.setTrim(n, s, L, I, B, N)),
(E += l),
(E += U ? b : Y ? w : n),
A++;
}
(E = h), (P += l), (P += O ? S : k ? _ : s);
}
return t;
};
},
function (t, e) {
function p(t, e, i, n) {
var s = g - n.y - n.height;
t.add(i, e, n.x, s, n.width, n.height);
}
var g = 0;
t.exports = function (t, e, i) {
var n = t.source[e];
t.add("__BASE", e, 0, 0, n.width, n.height), (g = n.height);
for (var s = i.split("\n"), r = /^[ ]*(- )*(\w+)+[: ]+(.*)/, o = "", a = "", h = { x: 0, y: 0, width: 0, height: 0 }, l = 0; l < s.length; l++) {
var u = s[l].match(r);
if (u) {
var c = "- " === u[1],
d = u[2],
f = u[3];
if ((c && (a !== o && (p(t, e, a, h), (o = a)), (h = { x: 0, y: 0, width: 0, height: 0 })), "name" !== d))
switch (d) {
case "x":
case "y":
case "width":
case "height":
h[d] = parseInt(f, 10);
}
else a = f;
}
}
return a !== o && p(t, e, a, h), t;
};
},
function (t, e) {
t.exports = "complete";
},
function (t, e) {
t.exports = "decoded";
},
function (t, e) {
t.exports = "decodedall";
},
function (t, e) {
t.exports = "destroy";
},
function (t, e) {
t.exports = "detune";
},
function (t, e) {
t.exports = "detune";
},
function (t, e) {
t.exports = "mute";
},
function (t, e) {
t.exports = "rate";
},
function (t, e) {
t.exports = "volume";
},
function (t, e) {
t.exports = "loop";
},
function (t, e) {
t.exports = "looped";
},
function (t, e) {
t.exports = "mute";
},
function (t, e) {
t.exports = "pan";
},
function (t, e) {
t.exports = "pauseall";
},
function (t, e) {
t.exports = "pause";
},
function (t, e) {
t.exports = "play";
},
function (t, e) {
t.exports = "rate";
},
function (t, e) {
t.exports = "resumeall";
},
function (t, e) {
t.exports = "resume";
},
function (t, e) {
t.exports = "seek";
},
function (t, e) {
t.exports = "stopall";
},
function (t, e) {
t.exports = "stop";
},
function (t, e) {
t.exports = "unlocked";
},
function (t, e) {
t.exports = "volume";
},
function (t, e, i) {
var n = {
Events: i(75),
DisplayList: i(1012),
GameObjectCreator: i(16),
GameObjectFactory: i(5),
UpdateList: i(1040),
Components: i(11),
GetCalcMatrix: i(19),
BuildGameObject: i(28),
BuildGameObjectAnimation: i(439),
GameObject: i(15),
BitmapText: i(148),
Blitter: i(213),
Bob: i(440),
Container: i(214),
DOMElement: i(442),
DynamicBitmapText: i(215),
Extern: i(444),
Graphics: i(216),
Group: i(113),
Image: i(125),
Layer: i(219),
Particles: i(1074),
PathFollower: i(457),
RenderTexture: i(221),
RetroFont: i(1082),
Rope: i(223),
Sprite: i(73),
Text: i(224),
GetTextSize: i(458),
MeasureText: i(460),
TextStyle: i(459),
TileSprite: i(225),
Zone: i(129),
Video: i(226),
Shape: i(34),
Arc: i(461),
Curve: i(462),
Ellipse: i(463),
Grid: i(464),
IsoBox: i(465),
IsoTriangle: i(466),
Line: i(467),
Polygon: i(468),
Rectangle: i(473),
Star: i(474),
Triangle: i(475),
Factories: {
Blitter: i(1130),
Container: i(1131),
DOMElement: i(1132),
DynamicBitmapText: i(1133),
Extern: i(1134),
Graphics: i(1135),
Group: i(1136),
Image: i(1137),
Layer: i(1138),
Particles: i(1139),
PathFollower: i(1140),
RenderTexture: i(1141),
Rope: i(1142),
Sprite: i(1143),
StaticBitmapText: i(1144),
Text: i(1145),
TileSprite: i(1146),
Zone: i(1147),
Video: i(1148),
Arc: i(1149),
Curve: i(1150),
Ellipse: i(1151),
Grid: i(1152),
IsoBox: i(1153),
IsoTriangle: i(1154),
Line: i(1155),
Polygon: i(1156),
Rectangle: i(1157),
Star: i(1158),
Triangle: i(1159),
},
Creators: {
Blitter: i(1160),
Container: i(1161),
DynamicBitmapText: i(1162),
Graphics: i(1163),
Group: i(1164),
Image: i(1165),
Layer: i(1166),
Particles: i(1167),
RenderTexture: i(1168),
Rope: i(1169),
Sprite: i(1170),
StaticBitmapText: i(1171),
Text: i(1172),
TileSprite: i(1173),
Zone: i(1174),
Video: i(1175),
},
};
(n.Shader = i(229)),
(n.Mesh = i(230)),
(n.PointLight = i(150)),
(n.Factories.Shader = i(1184)),
(n.Factories.Mesh = i(1185)),
(n.Factories.PointLight = i(1186)),
(n.Creators.Shader = i(1187)),
(n.Creators.Mesh = i(1188)),
(n.Creators.PointLight = i(1189)),
(n.Light = i(481)),
(n.LightsManager = i(482)),
(n.LightsPlugin = i(1190)),
(t.exports = n);
},
function (t, e, i) {
var n = i(0),
s = i(110),
r = i(24),
o = i(75),
a = i(20),
h = i(79),
l = new n({
Extends: s,
initialize: function (t) {
s.call(this, t),
(this.sortChildrenFlag = !1),
(this.scene = t),
(this.systems = t.sys),
(this.events = t.sys.events),
(this.addCallback = this.addChildCallback),
(this.removeCallback = this.removeChildCallback),
this.events.once(a.BOOT, this.boot, this),
this.events.on(a.START, this.start, this);
},
boot: function () {
this.events.once(a.DESTROY, this.destroy, this);
},
addChildCallback: function (t) {
t.displayList && t.displayList !== this && t.removeFromDisplayList(),
t.displayList || (this.queueDepthSort(), (t.displayList = this), t.emit(o.ADDED_TO_SCENE, t, this.scene), this.events.emit(a.ADDED_TO_SCENE, t, this.scene));
},
removeChildCallback: function (t) {
this.queueDepthSort(), (t.displayList = null), t.emit(o.REMOVED_FROM_SCENE, t, this.scene), this.events.emit(a.REMOVED_FROM_SCENE, t, this.scene);
},
start: function () {
this.events.once(a.SHUTDOWN, this.shutdown, this);
},
queueDepthSort: function () {
this.sortChildrenFlag = !0;
},
depthSort: function () {
this.sortChildrenFlag && (h(this.list, this.sortByDepth), (this.sortChildrenFlag = !1));
},
sortByDepth: function (t, e) {
return t._depth - e._depth;
},
getChildren: function () {
return this.list;
},
shutdown: function () {
for (var t = this.list, e = t.length; e--; ) t[e].destroy(!0);
(t.length = 0), this.events.off(a.SHUTDOWN, this.shutdown, this);
},
destroy: function () {
this.shutdown(), this.events.off(a.START, this.start, this), (this.scene = null), (this.systems = null), (this.events = null);
},
});
r.register("DisplayList", l, "displayList"), (t.exports = l);
},
function (t, e, i) {
t.exports = {
CheckMatrix: i(209),
MatrixToString: i(1014),
ReverseColumns: i(1015),
ReverseRows: i(1016),
Rotate180: i(1017),
RotateLeft: i(1018),
RotateMatrix: i(147),
RotateRight: i(1019),
Translate: i(1020),
TransposeMatrix: i(435),
};
},
function (t, e, i) {
var o = i(186),
a = i(209);
t.exports = function (t) {
var e = "";
if (!a(t)) return e;
for (var i = 0; i < t.length; i++) {
for (var n = 0; n < t[i].length; n++) {
var s = t[i][n].toString();
(e += "undefined" !== s ? o(s, 2) : "?"), n < t[i].length - 1 && (e += " |");
}
if (i < t.length - 1) {
e += "\n";
for (var r = 0; r < t[i].length; r++) (e += "---"), r < t[i].length - 1 && (e += "+");
e += "\n";
}
}
return e;
};
},
function (t, e) {
t.exports = function (t) {
return t.reverse();
};
},
function (t, e) {
t.exports = function (t) {
for (var e = 0; e < t.length; e++) t[e].reverse();
return t;
};
},
function (t, e, i) {
var n = i(147);
t.exports = function (t) {
return n(t, 180);
};
},
function (t, e, i) {
var n = i(147);
t.exports = function (t) {
return n(t, 90);
};
},
function (t, e, i) {
var n = i(147);
t.exports = function (t) {
return n(t, -90);
};
},
function (t, e, i) {
var r = i(178),
o = i(179);
t.exports = function (t, e, i) {
if ((void 0 === e && (e = 0), void 0 === i && (i = 0), 0 !== i && (i < 0 ? r(t, Math.abs(i)) : o(t, i)), 0 !== e))
for (var n = 0; n < t.length; n++) {
var s = t[n];
e < 0 ? r(s, Math.abs(e)) : o(s, e);
}
return t;
};
},
function (t, e) {
t.exports = function (t, e, i, n, s) {
if ((void 0 === s && (s = t), 0 < i)) {
var r = i - t.length;
if (r <= 0) return null;
}
if (!Array.isArray(e)) return -1 === t.indexOf(e) ? (t.push(e), n && n.call(s, e), e) : null;
for (var o = e.length - 1; 0 <= o; ) -1 !== t.indexOf(e[o]) && e.splice(o, 1), o--;
if (0 === (o = e.length)) return null;
0 < i && r < o && (e.splice(r), (o = r));
for (var a = 0; a < o; a++) {
var h = e[a];
t.push(h), n && n.call(s, h);
}
return e;
};
},
function (t, e) {
t.exports = function (t, e, i, n, s, r) {
if ((void 0 === i && (i = 0), void 0 === r && (r = t), 0 < n)) {
var o = n - t.length;
if (o <= 0) return null;
}
if (!Array.isArray(e)) return -1 === t.indexOf(e) ? (t.splice(i, 0, e), s && s.call(r, e), e) : null;
for (var a = e.length - 1; 0 <= a; ) -1 !== t.indexOf(e[a]) && e.pop(), a--;
if (0 === (a = e.length)) return null;
0 < n && o < a && (e.splice(o), (a = o));
for (var h = a - 1; 0 <= h; h--) {
var l = e[h];
t.splice(i, 0, l), s && s.call(r, l);
}
return e;
};
},
function (t, e) {
t.exports = function (t, e) {
var i = t.indexOf(e);
return -1 !== i && i < t.length && (t.splice(i, 1), t.push(e)), e;
};
},
function (t, e, i) {
var a = i(78);
t.exports = function (t, e, i, n, s) {
void 0 === n && (n = 0), void 0 === s && (s = t.length);
var r = 0;
if (a(t, n, s)) for (var o = n; o < s; o++) t[o][e] === i && r++;
return r;
};
},
function (t, e) {
t.exports = function (t, e, i) {
for (var n = [null], s = 3; s < arguments.length; s++) n.push(arguments[s]);
for (s = 0; s < t.length; s++) (n[0] = t[s]), e.apply(i, n);
return t;
};
},
function (t, e, i) {
var a = i(78);
t.exports = function (t, e, i, n, s) {
if ((void 0 === n && (n = 0), void 0 === s && (s = t.length), a(t, n, s))) {
for (var r = [null], o = 5; o < arguments.length; o++) r.push(arguments[o]);
for (o = n; o < s; o++) (r[0] = t[o]), e.apply(i, r);
}
return t;
};
},
function (t, e) {
t.exports = function (t, e) {
var i,
n,
s = t.indexOf(e);
return 0 < s && ((i = t[s - 1]), (n = t.indexOf(i)), (t[s] = i), (t[n] = e)), t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = t.indexOf(e);
if (-1 === n || i < 0 || i >= t.length) throw new Error("Supplied index out of bounds");
return n !== i && (t.splice(n, 1), t.splice(i, 0, e)), e;
};
},
function (t, e) {
t.exports = function (t, e) {
var i,
n,
s = t.indexOf(e);
return -1 !== s && s < t.length - 1 && ((i = t[s + 1]), (n = t.indexOf(i)), (t[s] = i), (t[n] = e)), t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
if (e === i) return t;
var n = t.indexOf(e),
s = t.indexOf(i);
if (n < 0 || s < 0) throw new Error("Supplied items must be elements of the same array");
return s < n || (t.splice(n, 1), s === t.length - 1 ? t.push(e) : t.splice(s, 0, e)), t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
if (e === i) return t;
var n = t.indexOf(e),
s = t.indexOf(i);
if (n < 0 || s < 0) throw new Error("Supplied items must be elements of the same array");
return n < s || (t.splice(n, 1), 0 === s ? t.unshift(e) : t.splice(s, 0, e)), t;
};
},
function (t, e, i) {
var o = i(363);
t.exports = function (t, e, i) {
void 0 === t && (t = 0), void 0 === e && (e = null), void 0 === i && (i = 1), null === e && ((e = t), (t = 0));
for (var n = [], s = Math.max(o((e - t) / (i || 1)), 0), r = 0; r < s; r++) n.push(t), (t += i);
return n;
};
},
function (t, e, i) {
var r = i(74);
t.exports = function (t, e, i, n) {
if ((void 0 === n && (n = t), e < 0 || e > t.length - 1)) throw new Error("Index out of bounds");
var s = r(t, e);
return i && i.call(n, s), s;
};
},
function (t, e, i) {
var l = i(78);
t.exports = function (t, e, i, n, s) {
if ((void 0 === e && (e = 0), void 0 === i && (i = t.length), void 0 === s && (s = t), l(t, e, i))) {
var r = i - e,
o = t.splice(e, r);
if (n)
for (var a = 0; a < o.length; a++) {
var h = o[a];
n.call(s, h);
}
return o;
}
return [];
};
},
function (t, e, i) {
var s = i(74);
t.exports = function (t, e, i) {
void 0 === e && (e = 0), void 0 === i && (i = t.length);
var n = e + Math.floor(Math.random() * i);
return s(t, n);
};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = t.indexOf(e),
s = t.indexOf(i);
return -1 !== n && -1 === s && ((t[n] = i), !0);
};
},
function (t, e) {
t.exports = function (t, e) {
var i = t.indexOf(e);
return -1 !== i && 0 < i && (t.splice(i, 1), t.unshift(e)), e;
};
},
function (t, e, i) {
var a = i(78);
t.exports = function (t, e, i, n, s) {
if ((void 0 === n && (n = 0), void 0 === s && (s = t.length), a(t, n, s)))
for (var r = n; r < s; r++) {
var o = t[r];
o.hasOwnProperty(e) && (o[e] = i);
}
return t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
if (e === i) return t;
var n = t.indexOf(e),
s = t.indexOf(i);
if (n < 0 || s < 0) throw new Error("Supplied items must be elements of the same array");
return (t[n] = i), (t[s] = e), t;
};
},
function (t, e, i) {
var n = i(0),
s = i(211),
r = i(24),
o = i(20),
a = new n({
Extends: s,
initialize: function (t) {
s.call(this), (this.checkQueue = !0), (this.scene = t), (this.systems = t.sys), t.sys.events.once(o.BOOT, this.boot, this), t.sys.events.on(o.START, this.start, this);
},
boot: function () {
this.systems.events.once(o.DESTROY, this.destroy, this);
},
start: function () {
var t = this.systems.events;
t.on(o.PRE_UPDATE, this.update, this), t.on(o.UPDATE, this.sceneUpdate, this), t.once(o.SHUTDOWN, this.shutdown, this);
},
sceneUpdate: function (t, e) {
for (var i = this._active, n = i.length, s = 0; s < n; s++) {
var r = i[s];
r.active && r.preUpdate.call(r, t, e);
}
},
shutdown: function () {
for (var t = this._active.length; t--; ) this._active[t].destroy(!0);
for (t = this._pending.length; t--; ) this._pending[t].destroy(!0);
for (t = this._destroy.length; t--; ) this._destroy[t].destroy(!0);
(this._toProcess = 0), (this._pending = []), (this._active = []), (this._destroy = []), this.removeAllListeners();
var e = this.systems.events;
e.off(o.PRE_UPDATE, this.update, this), e.off(o.UPDATE, this.sceneUpdate, this), e.off(o.SHUTDOWN, this.shutdown, this);
},
destroy: function () {
this.shutdown(), this.systems.events.off(o.START, this.start, this), (this.scene = null), (this.systems = null);
},
});
r.register("UpdateList", a, "updateList"), (t.exports = a);
},
function (t, e) {
t.exports = "add";
},
function (t, e) {
t.exports = "remove";
},
function (t, e) {
t.exports = function (t, e, i, n) {
if ((void 0 === i && (i = !1), void 0 === n))
return {
local: { x: 0, y: 0, width: 0, height: 0 },
global: { x: 0, y: 0, width: 0, height: 0 },
lines: { shortest: 0, longest: 0, lengths: null, height: 0 },
wrappedText: "",
words: [],
characters: [],
scaleX: 0,
scaleY: 0,
};
var s,
r,
o,
a = t.text,
h = a.length,
l = t.maxWidth,
u = t.wordWrapCharCode,
c = Number.MAX_VALUE,
d = Number.MAX_VALUE,
f = 0,
p = 0,
g = t.fontData.chars,
v = t.fontData.lineHeight,
y = t.letterSpacing,
m = 0,
x = 0,
b = 0,
w = null,
T = t._align,
S = 0,
_ = t.fontSize / t.fontData.size,
E = _ * t.scaleX,
P = _ * t.scaleY,
A = null,
M = 0,
C = [],
O = Number.MAX_VALUE,
k = 0,
R = 0,
L = 0,
I = [],
D = [],
F = null;
if (0 < l) {
for (U = 0; U < h; U++)
10 !== (b = a.charCodeAt(U))
? (w = g[b]) &&
(null !== A && (s = w.kerning[M]),
b === u
? null !== F && (I.push({ word: F.word, i: F.i, x: F.x * E, y: F.y * P, w: F.w * E, h: F.h * P, cr: !1 }), (F = null))
: (null === F && (F = { word: "", i: U, x: m, y: x, w: 0, h: v, cr: !1 }), (F.word = F.word.concat(a[U])), (F.w += w.xOffset + w.xAdvance + (void 0 !== s ? s : 0))),
(m += w.xAdvance + y),
(A = w),
(M = b))
: (null !== F && (I.push({ word: F.word, i: F.i, x: F.x * E, y: F.y * P, w: F.w * E, h: F.h * P, cr: !0 }), (F = null)), (m = 0), (x += v), (A = null));
null !== F && I.push({ word: F.word, i: F.i, x: F.x * E, y: F.y * P, w: F.w * E, h: F.h * P, cr: !1 }), (A = null);
for (var B = (M = x = m = 0), N = [], U = 0; U < I.length; U++) {
var Y,
z = I[U],
X = z.x,
V = z.x + z.w;
Y && ((B = X - (X - (Y.x + Y.w) + Y.w)), (Y = null)),
l < X - B || l < V - B ? (N.push(z.i - 1), (Y = z.cr ? (N.push(z.i + z.word.length), (B = 0), null) : z)) : z.cr && (N.push(z.i + z.word.length), (B = 0), (Y = null));
}
for (U = N.length - 1; 0 <= U; U--) (r = a), (o = N[U]), (a = r.substr(0, o) + "\n" + r.substr(o + 1));
(h = (n.wrappedText = a).length), (I = []), (F = null);
}
var G,
j,
H,
W,
K = 0;
for (U = 0; U < h; U++)
10 !== (b = a.charCodeAt(U))
? (w = g[b]) &&
((S = m),
null !== A && (S += void 0 !== (G = w.kerning[M]) ? G : 0),
S < c && (c = S),
x < d && (d = x),
f < (j = S + w.xAdvance) && (f = j),
p < (H = x + v) && (p = H),
(W = w.xOffset + w.xAdvance + (void 0 !== G ? G : 0)),
b === u
? null !== F && (I.push({ word: F.word, i: F.i, x: F.x * E, y: F.y * P, w: F.w * E, h: F.h * P }), (F = null))
: (null === F && (F = { word: "", i: K, x: m, y: x, w: 0, h: v }), (F.word = F.word.concat(a[U])), (F.w += W)),
D.push({ i: K, char: a[U], code: b, x: (w.xOffset + m) * _, y: (w.yOffset + x) * _, w: w.width * _, h: w.height * _, t: x * _, r: j * _, b: v * _, line: R, glyph: w }),
(m += w.xAdvance + y),
(A = w),
(M = b),
(L = j * _),
K++)
: (null !== F && (I.push({ word: F.word, i: F.i, x: F.x * E, y: F.y * P, w: F.w * E, h: F.h * P }), (F = null)),
(m = 0),
(x += v),
(A = null),
k < (C[R] = L) && (k = L),
L < O && (O = L),
R++,
(L = 0));
if ((null !== F && I.push({ word: F.word, i: F.i, x: F.x * E, y: F.y * P, w: F.w * E, h: F.h * P }), k < (C[R] = L) && (k = L), L < O && (O = L), 0 < T))
for (var q = 0; q < D.length; q++) {
var Z,
J,
Q = D[q];
1 === T ? ((Z = (k - C[Q.line]) / 2), (Q.x += Z), (Q.r += Z)) : 2 === T && ((J = k - C[Q.line]), (Q.x += J), (Q.r += J));
}
var $ = n.local,
tt = n.global,
et = n.lines;
return (
($.x = c * _),
($.y = d * _),
($.width = f * _),
($.height = p * _),
(tt.x = t.x - t._displayOriginX + c * E),
(tt.y = t.y - t._displayOriginY + d * P),
(tt.width = f * E),
(tt.height = p * P),
(et.shortest = O),
(et.longest = k),
(et.lengths = C),
e &&
(($.x = Math.ceil($.x)),
($.y = Math.ceil($.y)),
($.width = Math.ceil($.width)),
($.height = Math.ceil($.height)),
(tt.x = Math.ceil(tt.x)),
(tt.y = Math.ceil(tt.y)),
(tt.width = Math.ceil(tt.width)),
(tt.height = Math.ceil(tt.height)),
(et.shortest = Math.ceil(O)),
(et.longest = Math.ceil(k))),
i &&
((t._displayOriginX = t.originX * $.width),
(t._displayOriginY = t.originY * $.height),
(tt.x = t.x - t._displayOriginX * t.scaleX),
(tt.y = t.y - t._displayOriginY * t.scaleY),
e && ((tt.x = Math.ceil(tt.x)), (tt.y = Math.ceil(tt.y)))),
(n.words = I),
(n.characters = D),
(n.lines.height = v),
(n.scale = _),
(n.scaleX = t.scaleX),
(n.scaleY = t.scaleY),
n
);
};
},
function (t, e, i) {
var c = i(212);
t.exports = function (t, e, i, n, s, r, o) {
var a = t.sys.textures.get(i),
h = a.get(n),
l = t.sys.cache.xml.get(s);
if (h && l) {
var u = c(l, h, r, o, a);
return t.sys.cache.bitmapFont.add(e, { data: u, texture: i, frame: n, fromAtlas: !0 }), !0;
}
return !1;
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1046)), (s = i(1048)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e, i) {
var F = i(1047),
B = i(19),
N = i(12);
t.exports = function (t, e, i, n) {
if (0 !== e._text.length) {
i.addToRenderList(e);
var s,
r = t.pipelines.set(e.pipeline, e),
o = B(e, i, n).calc,
a = i.roundPixels,
h = i.alpha,
l = e.charColors,
u = e.tintFill,
c = N.getTintAppendFloatAlpha,
d = c(e.tintTopLeft, h * e._alphaTL),
f = c(e.tintTopRight, h * e._alphaTR),
p = c(e.tintBottomLeft, h * e._alphaBL),
g = c(e.tintBottomRight, h * e._alphaBR),
v = e.frame.glTexture,
y = r.setGameObject(e),
m = e.getTextBounds(!1).characters,
x = e.dropShadowX,
b = e.dropShadowY,
w = 0 !== x || 0 !== b;
if ((t.pipelines.preBatch(e), w))
for (var T = e.dropShadowColor, S = e.dropShadowAlpha, _ = c(T, h * S * e._alphaTL), E = c(T, h * S * e._alphaTR), P = c(T, h * S * e._alphaBL), A = c(T, h * S * e._alphaBR), M = 0; M < m.length; M++)
(D = (s = m[M]).glyph), 32 !== s.code && 0 !== D.width && 0 !== D.height && F(r, e, s, D, x, b, o, a, _, E, P, A, 1, v, y);
for (M = 0; M < m.length; M++) {
var C,
O,
k,
R,
L,
I,
D = (s = m[M]).glyph;
32 !== s.code &&
0 !== D.width &&
0 !== D.height &&
(l[s.i]
? ((O = (C = l[s.i]).tintEffect),
(k = c(C.tintTL, h * e._alphaTL)),
(R = c(C.tintTR, h * e._alphaTR)),
(L = c(C.tintBL, h * e._alphaBL)),
(I = c(C.tintBR, h * e._alphaBR)),
F(r, e, s, D, 0, 0, o, a, k, R, L, I, O, v, y))
: F(r, e, s, D, 0, 0, o, a, d, f, p, g, u, v, y));
}
t.pipelines.postBatch(e);
}
};
},
function (t, e) {
t.exports = function (t, e, i, n, s, r, o, a, h, l, u, c, d, f, p) {
var g = i.x - e.displayOriginX + s,
v = i.y - e.displayOriginY + r,
y = g + i.w,
m = v + i.h,
x = o.getXRound(g, v, a),
b = o.getYRound(g, v, a),
w = o.getXRound(g, m, a),
T = o.getYRound(g, m, a),
S = o.getXRound(y, m, a),
_ = o.getYRound(y, m, a),
E = o.getXRound(y, v, a),
P = o.getYRound(y, v, a);
t.batchQuad(e, x, b, w, T, S, _, E, P, n.u0, n.v0, n.u1, n.v1, h, l, u, c, d, f, p);
};
},
function (t, e, i) {
var D = i(30);
t.exports = function (t, e, i, n) {
var s = e._text,
r = s.length,
o = t.currentContext;
if (0 !== r && D(t, o, e, i, n)) {
i.addToRenderList(e);
var a,
h = e.fromAtlas ? e.frame : e.texture.frames.__BASE,
l = e.fontData.chars,
u = e.fontData.lineHeight,
c = e._letterSpacing,
d = 0,
f = 0,
p = null,
g = 0,
v = 0,
y = 0,
m = 0,
x = 0,
b = 0,
w = null,
T = 0,
S = h.source.image,
_ = h.cutX,
E = h.cutY,
P = e._fontSize / e.fontData.size,
A = e._align,
M = 0,
C = 0,
O = e.getTextBounds(!1);
0 < e.maxWidth && (r = (s = O.wrappedText).length);
var k = e._bounds.lines;
1 === A ? (C = (k.longest - k.lengths[0]) / 2) : 2 === A && (C = k.longest - k.lengths[0]), o.translate(-e.displayOriginX, -e.displayOriginY);
for (var R, L = i.roundPixels, I = 0; I < r; I++)
10 !== (a = s.charCodeAt(I))
? (p = l[a]) &&
((g = _ + p.x),
(v = E + p.y),
(y = p.width),
(m = p.height),
(x = p.xOffset + d),
(b = p.yOffset + f),
null !== w && (x += void 0 !== (R = p.kerning[T]) ? R : 0),
(x *= P),
(b *= P),
(x += C),
(d += p.xAdvance + c),
(w = p),
(T = a),
0 !== y && 0 !== m && 32 !== a && (L && ((x = Math.round(x)), (b = Math.round(b))), o.save(), o.translate(x, b), o.scale(P, P), o.drawImage(S, g, v, y, m, 0, 0, y, m), o.restore()))
: (M++, 1 === A ? (C = (k.longest - k.lengths[M]) / 2) : 2 === A && (C = k.longest - k.lengths[M]), (d = 0), (f += u), (w = null));
o.restore();
}
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1050)), (s = i(1051)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e, i) {
var n = i(25),
O = i(12),
k = new n();
t.exports = function (t, e, i, n) {
var s = e.getRenderList();
if (0 !== s.length) {
var r = i.alpha * e.alpha;
if (0 != r) {
i.addToRenderList(e);
var o = t.pipelines.set(this.pipeline, e),
a = i.scrollX * e.scrollFactorX,
h = i.scrollY * e.scrollFactorY,
l = k.copyFrom(i.matrix);
n && (l.multiplyWithOffset(n, -a, -h), (h = a = 0));
var u = e.x - a,
c = e.y - h,
d = -1,
f = i.roundPixels;
t.pipelines.preBatch(e);
for (var p = 0; p < s.length; p++) {
var g,
v,
y,
m,
x,
b,
w,
T,
S,
_,
E,
P,
A = s[p],
M = A.frame,
C = A.alpha * r;
0 != C &&
((g = M.width),
(v = M.height),
(y = u + A.x + M.x),
(m = c + A.y + M.y),
A.flipX && ((g *= -1), (y += M.width)),
A.flipY && ((v *= -1), (m += M.height)),
(x = y + g),
(b = m + v),
(w = l.getX(y, m)),
(T = l.getY(y, m)),
(S = l.getX(x, b)),
(_ = l.getY(x, b)),
(E = O.getTintAppendFloatAlpha(A.tint, C)),
M.sourceIndex !== d && ((P = o.setGameObject(e, M)), (d = M.sourceIndex)),
f && ((w = Math.round(w)), (T = Math.round(T)), (S = Math.round(S)), (_ = Math.round(_))),
o.batchQuad(e, w, T, w, _, S, _, S, T, M.u0, M.v0, M.u1, M.v1, E, E, E, E, !1, M.glTexture, P) && (d = -1));
}
t.pipelines.postBatch(e);
}
}
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s = e.getRenderList();
if (0 !== s.length) {
var r = t.currentContext,
o = i.alpha * e.alpha;
if (0 != o) {
i.addToRenderList(e), (r.globalCompositeOperation = t.blendModes[e.blendMode]), (r.imageSmoothingEnabled = !(!t.antialias || e.frame.source.scaleMode));
var a = e.x - i.scrollX * e.scrollFactorX,
h = e.y - i.scrollY * e.scrollFactorY;
r.save(), n && n.copyToContext(r);
for (var l = i.roundPixels, u = 0; u < s.length; u++) {
var c = s[u],
d = c.flipX || c.flipY,
f = c.frame,
p = f.canvasData,
g = f.x,
v = f.y,
y = 1,
m = 1,
x = c.alpha * o;
0 != x &&
((r.globalAlpha = x),
d
? (c.flipX && ((y = -1), (g -= p.width)),
c.flipY && ((m = -1), (v -= p.height)),
r.save(),
r.translate(c.x + a, c.y + h),
r.scale(y, m),
r.drawImage(f.source.image, p.x, p.y, p.width, p.height, g, v, p.width, p.height),
r.restore())
: (l && ((g = Math.round(g)), (v = Math.round(v))), r.drawImage(f.source.image, p.x, p.y, p.width, p.height, g + c.x + a, v + c.y + h, p.width, p.height)));
}
r.restore();
}
}
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1053)), (s = i(1054)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e) {
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = e.list,
r = s.length;
if (0 !== r) {
var o = e.localTransform;
n ? (o.loadIdentity(), o.multiply(n), o.translate(e.x, e.y), o.rotate(e.rotation), o.scale(e.scaleX, e.scaleY)) : o.applyITRS(e.x, e.y, e.rotation, e.scaleX, e.scaleY), t.pipelines.preBatch(e);
var a = -1 !== e.blendMode;
a || t.setBlendMode(0);
for (var h = e.alpha, l = e.scrollFactorX, u = e.scrollFactorY, c = 0; c < r; c++) {
var d,
f,
p,
g,
v,
y,
m,
x,
b = s[c];
b.willRender(i) &&
((g = void 0 !== b.alphaTopLeft ? ((d = b.alphaTopLeft), (f = b.alphaTopRight), (p = b.alphaBottomLeft), b.alphaBottomRight) : (p = f = d = b.alpha)),
(v = b.scrollFactorX),
(y = b.scrollFactorY),
a || b.blendMode === t.currentBlendMode || t.setBlendMode(b.blendMode),
(m = b.mask) && m.preRenderWebGL(t, b, i),
(x = b.type) !== t.currentType && ((t.newType = !0), (t.currentType = x)),
(t.nextTypeMatch = c < r - 1 && s[c + 1].type === t.currentType),
b.setScrollFactor(v * l, y * u),
b.setAlpha(d * h, f * h, p * h, g * h),
b.renderWebGL(t, b, i, o),
b.setAlpha(d, f, p, g),
b.setScrollFactor(v, y),
m && m.postRenderWebGL(t, i),
(t.newType = !1));
}
t.pipelines.postBatch(e);
}
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = e.list;
if (0 !== s.length) {
var r = e.localTransform;
n ? (r.loadIdentity(), r.multiply(n), r.translate(e.x, e.y), r.rotate(e.rotation), r.scale(e.scaleX, e.scaleY)) : r.applyITRS(e.x, e.y, e.rotation, e.scaleX, e.scaleY);
var o = -1 !== e.blendMode;
o || t.setBlendMode(0);
var a = e._alpha,
h = e.scrollFactorX,
l = e.scrollFactorY;
e.mask && e.mask.preRenderCanvas(t, null, i);
for (var u = 0; u < s.length; u++) {
var c,
d,
f,
p = s[u];
p.willRender(i) &&
((c = p.alpha),
(d = p.scrollFactorX),
(f = p.scrollFactorY),
o || p.blendMode === t.currentBlendMode || t.setBlendMode(p.blendMode),
p.setScrollFactor(d * h, f * l),
p.setAlpha(c * a),
p.renderCanvas(t, p, i, r),
p.setAlpha(c),
p.setScrollFactor(d, f));
}
e.mask && e.mask.postRenderCanvas(t);
}
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(443)), (s = i(443)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e) {
t.exports = [
"normal",
"multiply",
"multiply",
"screen",
"overlay",
"darken",
"lighten",
"color-dodge",
"color-burn",
"hard-light",
"soft-light",
"difference",
"exclusion",
"hue",
"saturation",
"color",
"luminosity",
];
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1058)), (s = i(1059)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e, i) {
var ot = i(19),
n = i(25),
at = i(12),
ht = new n();
t.exports = function (t, e, i, n) {
var s = e.text,
r = s.length;
if (0 !== r) {
i.addToRenderList(e);
var o = t.pipelines.set(e.pipeline, e),
a = ot(e, i, n),
h = a.sprite,
l = a.calc,
u = ht,
c = 0 < e.cropWidth || 0 < e.cropHeight;
c && (o.flush(), t.pushScissor(l.tx, l.ty, e.cropWidth * l.scaleX, e.cropHeight * l.scaleY));
var d,
f,
p,
g,
v = e.frame.glTexture,
y = e.tintFill,
m = at.getTintAppendFloatAlpha(e.tintTopLeft, i.alpha * e._alphaTL),
x = at.getTintAppendFloatAlpha(e.tintTopRight, i.alpha * e._alphaTR),
b = at.getTintAppendFloatAlpha(e.tintBottomLeft, i.alpha * e._alphaBL),
w = at.getTintAppendFloatAlpha(e.tintBottomRight, i.alpha * e._alphaBR),
T = o.setGameObject(e),
S = 0,
_ = 0,
E = 0,
P = e.letterSpacing,
A = e.scrollX,
M = e.scrollY,
C = e.fontData,
O = C.chars,
k = C.lineHeight,
R = e.fontSize / C.size,
L = 0,
I = e._align,
D = 0,
F = 0,
B = e.getTextBounds(!1);
0 < e.maxWidth && (r = (s = B.wrappedText).length);
var N = e._bounds.lines;
1 === I ? (F = (N.longest - N.lengths[0]) / 2) : 2 === I && (F = N.longest - N.lengths[0]);
var U = i.roundPixels,
Y = e.displayCallback,
z = e.callbackData;
t.pipelines.preBatch(e);
for (var X, V, G, j, H, W, K, q, Z, J, Q, $, tt, et, it, nt, st, rt = 0; rt < r; rt++)
10 !== (d = s.charCodeAt(rt))
? (st = O[d]) &&
((f = st.width),
(p = st.height),
(G = st.xOffset + S - A),
(j = st.yOffset + _ - M),
null !== g && (G += void 0 !== (X = st.kerning[E]) ? X : 0),
(S += st.xAdvance + P),
(g = st),
(E = d),
0 !== f &&
0 !== p &&
32 !== d &&
((R = e.fontSize / e.fontData.size),
(L = 0),
Y &&
((z.color = 0),
(z.tint.topLeft = m),
(z.tint.topRight = x),
(z.tint.bottomLeft = b),
(z.tint.bottomRight = w),
(z.index = rt),
(z.charCode = d),
(z.x = G),
(z.y = j),
(z.scale = R),
(z.rotation = L),
(z.data = st.data),
(G = (V = Y(z)).x),
(j = V.y),
(R = V.scale),
(L = V.rotation),
(w = V.color ? ((m = V.color), (x = V.color), (b = V.color), V.color) : ((m = V.tint.topLeft), (x = V.tint.topRight), (b = V.tint.bottomLeft), V.tint.bottomRight)),
(m = at.getTintAppendFloatAlpha(m, i.alpha * e._alphaTL)),
(x = at.getTintAppendFloatAlpha(x, i.alpha * e._alphaTR)),
(b = at.getTintAppendFloatAlpha(b, i.alpha * e._alphaBL)),
(w = at.getTintAppendFloatAlpha(w, i.alpha * e._alphaBR))),
(G *= R),
(j *= R),
(G -= e.displayOriginX),
(j -= e.displayOriginY),
(G += F),
u.applyITRS(G, j, L, R, R),
l.multiply(u, h),
(H = st.u0),
(W = st.v0),
(K = st.u1),
(q = st.v1),
(Z = h.e),
(J = h.f),
(Q = p * h.c + h.e),
($ = p * h.d + h.f),
(tt = f * h.a + p * h.c + h.e),
(et = f * h.b + p * h.d + h.f),
(it = f * h.a + h.e),
(nt = f * h.b + h.f),
U && ((Z = Math.round(Z)), (J = Math.round(J)), (Q = Math.round(Q)), ($ = Math.round($)), (tt = Math.round(tt)), (et = Math.round(et)), (it = Math.round(it)), (nt = Math.round(nt))),
o.batchQuad(e, Z, J, Q, $, tt, et, it, nt, H, W, K, q, m, x, b, w, y, v, T)))
: (D++, 1 === I ? (F = (N.longest - N.lengths[D]) / 2) : 2 === I && (F = N.longest - N.lengths[D]), (S = 0), (_ += k), (g = null));
c && (o.flush(), t.popScissor()), t.pipelines.postBatch(e);
}
};
},
function (t, e, i) {
var U = i(30);
t.exports = function (t, e, i, n) {
var s = e._text,
r = s.length,
o = t.currentContext;
if (0 !== r && U(t, o, e, i, n)) {
i.addToRenderList(e);
var a,
h = e.fromAtlas ? e.frame : e.texture.frames.__BASE,
l = e.displayCallback,
u = e.callbackData,
c = e.fontData.chars,
d = e.fontData.lineHeight,
f = e._letterSpacing,
p = 0,
g = 0,
v = null,
y = 0,
m = 0,
x = 0,
b = 0,
w = 0,
T = 0,
S = null,
_ = 0,
E = e.frame.source.image,
P = h.cutX,
A = h.cutY,
M = 0,
C = 0,
O = e._fontSize / e.fontData.size,
k = e._align,
R = 0,
L = 0;
e.getTextBounds(!1);
var I = e._bounds.lines;
1 === k ? (L = (I.longest - I.lengths[0]) / 2) : 2 === k && (L = I.longest - I.lengths[0]), o.translate(-e.displayOriginX, -e.displayOriginY);
var D = i.roundPixels;
0 < e.cropWidth && 0 < e.cropHeight && (o.beginPath(), o.rect(0, 0, e.cropWidth, e.cropHeight), o.clip());
for (var F, B, N = 0; N < r; N++)
(C = O),
(M = 0),
10 !== (a = s.charCodeAt(N))
? (v = c[a]) &&
((y = P + v.x),
(m = A + v.y),
(x = v.width),
(b = v.height),
(w = v.xOffset + p - e.scrollX),
(T = v.yOffset + g - e.scrollY),
null !== S && (w += void 0 !== (F = v.kerning[_]) ? F : 0),
l && ((u.index = N), (u.charCode = a), (u.x = w), (u.y = T), (u.scale = C), (u.rotation = M), (u.data = v.data), (w = (B = l(u)).x), (T = B.y), (C = B.scale), (M = B.rotation)),
(w *= C),
(T *= C),
(w += L),
(p += v.xAdvance + f),
(S = v),
(_ = a),
0 !== x &&
0 !== b &&
32 !== a &&
(D && ((w = Math.round(w)), (T = Math.round(T))), o.save(), o.translate(w, T), o.rotate(M), o.scale(C, C), o.drawImage(E, y, m, x, b, 0, 0, x, b), o.restore()))
: (R++, 1 === k ? (L = (I.longest - I.lengths[R]) / 2) : 2 === k && (L = I.longest - I.lengths[R]), (p = 0), (g += d), (S = null));
o.restore();
}
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1061)), (s = i(1062)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e, i) {
var r = i(19);
t.exports = function (t, e, i, n) {
t.pipelines.clear();
var s = r(e, i, n).calc;
e.render.call(e, t, i, s), t.pipelines.rebind();
};
},
function (t, e) {},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1064)), i(448), (s = i(448)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e, i) {
function B(t, e, i) {
(this.x = t), (this.y = e), (this.width = i);
}
function N(t, e, i) {
(this.points = []), (this.pointsLength = 1), (this.points[0] = new B(t, e, i));
}
var U = i(217),
Y = i(19),
n = i(25),
z = i(12),
X = [],
V = new n();
t.exports = function (t, e, i, n) {
if (0 !== e.commandBuffer.length) {
i.addToRenderList(e);
var s = t.pipelines.set(e.pipeline, e);
t.pipelines.preBatch(e);
for (
var r = Y(e, i, n).calc,
o = V.loadIdentity(),
a = e.commandBuffer,
h = i.alpha * e.alpha,
l = 1,
u = s.fillTint,
c = s.strokeTint,
d = 0,
f = 0,
p = 0,
g = 2 * Math.PI,
v = [],
y = 0,
m = !0,
x = null,
b = z.getTintAppendFloatAlpha,
w = 0;
w < a.length;
w++
)
switch (a[w]) {
case U.BEGIN_PATH:
(v.length = 0), (m = !(x = null));
break;
case U.CLOSE_PATH:
(m = !1), x && x.points.length && x.points.push(x.points[0]);
break;
case U.FILL_PATH:
for (y = 0; y < v.length; y++) s.batchFillPath(v[y].points, o, r);
break;
case U.STROKE_PATH:
for (y = 0; y < v.length; y++) s.batchStrokePath(v[y].points, l, m, o, r);
break;
case U.LINE_STYLE:
l = a[++w];
var T = b(a[++w], a[++w] * h);
(c.TL = T), (c.TR = T), (c.BL = T), (c.BR = T);
break;
case U.FILL_STYLE:
var S = b(a[++w], a[++w] * h);
(u.TL = S), (u.TR = S), (u.BL = S), (u.BR = S);
break;
case U.GRADIENT_FILL_STYLE:
var _ = a[++w] * h,
E = a[++w] * h,
P = a[++w] * h,
A = a[++w] * h;
(u.TL = b(a[++w], _)), (u.TR = b(a[++w], E)), (u.BL = b(a[++w], P)), (u.BR = b(a[++w], A));
break;
case U.GRADIENT_LINE_STYLE:
l = a[++w];
var M = a[++w] * h;
(c.TL = b(a[++w], M)), (c.TR = b(a[++w], M)), (c.BL = b(a[++w], M)), (c.BR = b(a[++w], M));
break;
case U.ARC:
var C = 0,
O = a[++w],
k = a[++w],
R = a[++w],
L = a[++w],
I = a[++w],
D = a[++w],
F = a[++w];
for (
I -= L,
D ? (I < -g ? (I = -g) : 0 < I && (I = (I % g) - g)) : g < I ? (I = g) : I < 0 && (I = g + (I % g)),
null === x && ((x = new N(O + Math.cos(L) * R, k + Math.sin(L) * R, l)), v.push(x), (C += 0.01));
C < 1 + F;
)
(p = I * C + L), (d = O + Math.cos(p) * R), (f = k + Math.sin(p) * R), x.points.push(new B(d, f, l)), (C += 0.01);
(p = I + L), (d = O + Math.cos(p) * R), (f = k + Math.sin(p) * R), x.points.push(new B(d, f, l));
break;
case U.FILL_RECT:
s.batchFillRect(a[++w], a[++w], a[++w], a[++w], o, r);
break;
case U.FILL_TRIANGLE:
s.batchFillTriangle(a[++w], a[++w], a[++w], a[++w], a[++w], a[++w], o, r);
break;
case U.STROKE_TRIANGLE:
s.batchStrokeTriangle(a[++w], a[++w], a[++w], a[++w], a[++w], a[++w], l, o, r);
break;
case U.LINE_TO:
null !== x ? x.points.push(new B(a[++w], a[++w], l)) : ((x = new N(a[++w], a[++w], l)), v.push(x));
break;
case U.MOVE_TO:
(x = new N(a[++w], a[++w], l)), v.push(x);
break;
case U.SAVE:
X.push(o.copyToArray());
break;
case U.RESTORE:
o.copyFromArray(X.pop());
break;
case U.TRANSLATE:
(O = a[++w]), (k = a[++w]), o.translate(O, k);
break;
case U.SCALE:
(O = a[++w]), (k = a[++w]), o.scale(O, k);
break;
case U.ROTATE:
o.rotate(a[++w]);
}
t.pipelines.postBatch(e);
}
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1066)), (s = i(1067)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e) {
t.exports = function (t, e, i, n) {
i.addToRenderList(e), e.pipeline.batchSprite(e, i, n);
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
i.addToRenderList(e), t.batchSprite(e, e.frame, i, n);
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1069)), (s = i(1070)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e) {
t.exports = function (t, e, i, n) {
i.addToRenderList(e), this.pipeline.batchSprite(e, i, n);
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
i.addToRenderList(e), t.batchSprite(e, e.frame, i, n);
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1072)), (s = i(1073)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e) {
t.exports = function (t, e, i) {
var n = e.list,
s = n.length;
if (0 !== s) {
e.depthSort(), t.pipelines.preBatch(e);
var r = -1 !== e.blendMode;
r || t.setBlendMode(0);
for (var o = e.alpha, a = 0; a < s; a++) {
var h,
l,
u,
c,
d,
f,
p = n[a];
p.willRender(i) &&
((c = void 0 !== p.alphaTopLeft ? ((h = p.alphaTopLeft), (l = p.alphaTopRight), (u = p.alphaBottomLeft), p.alphaBottomRight) : (u = l = h = p.alpha)),
r || p.blendMode === t.currentBlendMode || t.setBlendMode(p.blendMode),
(d = p.mask) && d.preRenderWebGL(t, p, i),
(f = p.type) !== t.currentType && ((t.newType = !0), (t.currentType = f)),
(t.nextTypeMatch = a < s - 1 && n[a + 1].type === t.currentType),
p.setAlpha(h * o, l * o, u * o, c * o),
p.renderWebGL(t, p, i),
p.setAlpha(h, l, u, c),
d && d.postRenderWebGL(t, i),
(t.newType = !1));
}
t.pipelines.postBatch(e);
}
};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = e.list;
if (0 !== n.length) {
e.depthSort();
var s = -1 !== e.blendMode;
s || t.setBlendMode(0);
var r = e._alpha;
e.mask && e.mask.preRenderCanvas(t, null, i);
for (var o = 0; o < n.length; o++) {
var a,
h = n[o];
h.willRender(i) && ((a = h.alpha), s || h.blendMode === t.currentBlendMode || t.setBlendMode(h.blendMode), h.setAlpha(a * r), h.renderCanvas(t, h, i), h.setAlpha(a));
}
e.mask && e.mask.postRenderCanvas(t);
}
};
},
function (t, e, i) {
t.exports = { EmitterOp: i(449), GravityWell: i(450), Particle: i(451), ParticleEmitter: i(452), ParticleEmitterManager: i(220), Zones: i(1078) };
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1076)), (s = i(1077)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e, i) {
var n = i(25),
N = i(12),
U = new n(),
Y = new n(),
z = new n(),
X = new n();
t.exports = function (t, e, i, n) {
var s = e.emitters.list,
r = s.length;
if (0 !== r) {
var o = t.pipelines.set(e.pipeline),
a = U,
h = Y,
l = z,
u = X;
n ? (u.loadIdentity(), u.multiply(n), u.translate(e.x, e.y), u.rotate(e.rotation), u.scale(e.scaleX, e.scaleY)) : u.applyITRS(e.x, e.y, e.rotation, e.scaleX, e.scaleY);
var c = i.roundPixels,
d = e.defaultFrame.glTexture,
f = N.getTintAppendFloatAlpha,
p = o.setGameObject(e, e.defaultFrame);
t.pipelines.preBatch(e);
for (var g = 0; g < r; g++) {
var v = s[g],
y = v.alive,
m = y.length;
if (v.visible && 0 !== m) {
i.addToRenderList(v);
var x = v.scrollFactorX,
b = v.scrollFactorY;
t.setBlendMode(v.blendMode), v.mask && (v.mask.preRenderWebGL(t, v, i), t.pipelines.set(e.pipeline));
for (var w = 0; w < m; w++) {
var T,
S,
_,
E,
P,
A,
M,
C,
O,
k,
R,
L,
I,
D,
F = y[w],
B = F.alpha * i.alpha;
B <= 0 ||
(l.applyITRS(F.x, F.y, F.rotation, F.scaleX, F.scaleY),
a.copyFrom(i.matrix),
a.multiplyWithOffset(u, -i.scrollX * x, -i.scrollY * b),
(l.e = F.x),
(l.f = F.y),
a.multiply(l, h),
(S = -(T = F.frame).halfWidth),
(_ = -T.halfHeight),
(E = S + T.width),
(P = _ + T.height),
(A = h.getXRound(S, _, c)),
(M = h.getYRound(S, _, c)),
(C = h.getXRound(S, P, c)),
(O = h.getYRound(S, P, c)),
(k = h.getXRound(E, P, c)),
(R = h.getYRound(E, P, c)),
(L = h.getXRound(E, _, c)),
(I = h.getYRound(E, _, c)),
(D = f(F.tint, B)),
o.batchQuad(v, A, M, C, O, k, R, L, I, T.u0, T.v0, T.u1, T.v1, D, D, D, D, 0, d, p));
}
v.mask && v.mask.postRenderWebGL(t, i);
}
}
t.pipelines.postBatch(e);
}
};
},
function (t, e, i) {
var n = i(25),
E = new n(),
P = new n(),
A = new n(),
M = new n();
t.exports = function (t, e, i, n) {
var s = e.emitters.list,
r = s.length;
if (0 !== r) {
var o = E.copyFrom(i.matrix),
a = P,
h = A,
l = M;
n ? (l.loadIdentity(), l.multiply(n), l.translate(e.x, e.y), l.rotate(e.rotation), l.scale(e.scaleX, e.scaleY)) : l.applyITRS(e.x, e.y, e.rotation, e.scaleX, e.scaleY);
for (var u = t.currentContext, c = i.roundPixels, d = 0; d < r; d++) {
var f = s[d],
p = f.alive,
g = p.length;
if (f.visible && 0 !== g) {
i.addToRenderList(f);
var v = f.scrollFactorX,
y = f.scrollFactorY;
u.save(), (u.globalCompositeOperation = t.blendModes[f.blendMode]);
for (var m = 0; m < g; m++) {
var x,
b,
w,
T,
S = p[m],
_ = S.alpha * i.alpha;
_ <= 0 ||
(h.applyITRS(S.x, S.y, S.rotation, S.scaleX, S.scaleY),
o.copyFrom(i.matrix),
o.multiplyWithOffset(l, -i.scrollX * v, -i.scrollY * y),
(h.e = S.x),
(h.f = S.y),
o.multiply(h, a),
(b = (x = S.frame).canvasData),
(w = -x.halfWidth),
(T = -x.halfHeight),
(u.globalAlpha = _),
u.save(),
a.setToContext(u),
c && ((w = Math.round(w)), (T = Math.round(T))),
(u.imageSmoothingEnabled = !(!t.antialias || x.source.scaleMode)),
u.drawImage(x.source.image, b.x, b.y, b.width, b.height, w, T, b.width, b.height),
u.restore());
}
u.restore();
}
}
}
};
},
function (t, e, i) {
t.exports = { DeathZone: i(453), EdgeZone: i(454), RandomZone: i(456) };
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1080)), (s = i(1081)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e, i) {
var c = i(12);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = i.alpha,
r = e.renderTarget,
o = r.width,
a = r.height,
h = c.getTintAppendFloatAlpha,
l = t.pipelines.set(e.pipeline),
u = l.setTexture2D(r.texture);
t.pipelines.preBatch(e),
l.batchTexture(
e,
r.texture,
o,
a,
e.x,
e.y,
o,
a,
e.scaleX,
e.scaleY,
e.rotation,
e.flipX,
!e.flipY,
e.scrollFactorX,
e.scrollFactorY,
e.displayOriginX,
e.displayOriginY,
0,
0,
o,
a,
h(e.tintTopLeft, s * e._alphaTL),
h(e.tintTopRight, s * e._alphaTR),
h(e.tintBottomLeft, s * e._alphaBL),
h(e.tintBottomRight, s * e._alphaBR),
e.tintFill,
0,
0,
i,
n,
!0,
u
),
t.resetTextures(),
t.pipelines.postBatch(e);
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
i.addToRenderList(e), t.batchSprite(e, e.frame, i, n);
};
},
function (t, e, i) {
var n = i(1083),
s = i(17)(!1, (s = { Parse: i(1084) }), n);
t.exports = s;
},
function (t, e) {
t.exports = {
TEXT_SET1: " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",
TEXT_SET2: " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",
TEXT_SET3: "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",
TEXT_SET4: "ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",
TEXT_SET5: "ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",
TEXT_SET6: "ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",
TEXT_SET7: "AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",
TEXT_SET8: "0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",
TEXT_SET9: "ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",
TEXT_SET10: "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
TEXT_SET11: "ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789",
};
},
function (t, e, i) {
var C = i(6);
t.exports = function (t, e) {
var i = e.width,
n = e.height,
s = Math.floor(i / 2),
r = Math.floor(n / 2),
o = C(e, "chars", "");
if ("" !== o) {
var a = C(e, "image", ""),
h = t.sys.textures.getFrame(a),
l = h.cutX,
u = h.cutY,
c = h.source.width,
d = h.source.height,
f = C(e, "offset.x", 0),
p = C(e, "offset.y", 0),
g = C(e, "spacing.x", 0),
v = C(e, "spacing.y", 0),
y = C(e, "lineSpacing", 0),
m = C(e, "charsPerRow", null);
null === m && (m = c / i) > o.length && (m = o.length);
for (var x = f, b = p, w = { retroFont: !0, font: a, size: i, lineHeight: n + y, chars: {} }, T = 0, S = 0; S < o.length; S++) {
var _ = o.charCodeAt(S),
E = (l + x) / c,
P = (u + b) / d,
A = (l + x + i) / c,
M = (u + b + n) / d;
(w.chars[_] = { x: x, y: b, width: i, height: n, centerX: s, centerY: r, xOffset: 0, yOffset: 0, xAdvance: i, data: {}, kerning: {}, u0: E, v0: P, u1: A, v1: M }),
++T === m ? ((T = 0), (x = f), (b += n + v)) : (x += i + g);
}
return { data: w, frame: null, texture: a };
}
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1086)), (s = i(1087)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e, i) {
var M = i(19),
C = i(12);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.pipelines.set(e.pipeline, e),
r = M(e, i, n).calc,
o = e.vertices,
a = e.uv,
h = e.colors,
l = e.alphas,
u = e.alpha,
c = C.getTintAppendFloatAlpha,
d = i.roundPixels,
f = o.length,
p = Math.floor(0.5 * f);
s.flush(), t.pipelines.preBatch(e);
var g = s.setGameObject(e),
v = s.vertexViewF32,
y = s.vertexViewU32,
m = s.vertexCount * s.currentShader.vertexComponentCount - 1,
x = 0,
b = e.tintFill;
e.dirty && e.updateVertices();
for (var w = e.debugCallback, T = [], S = 0; S < f; S += 2) {
var _ = o[S + 0],
E = o[S + 1],
P = _ * r.a + E * r.c + r.e,
A = _ * r.b + E * r.d + r.f;
d && ((P = Math.round(P)), (A = Math.round(A))),
(v[++m] = P),
(v[++m] = A),
(v[++m] = a[S + 0]),
(v[++m] = a[S + 1]),
(v[++m] = g),
(v[++m] = b),
(y[++m] = c(h[x], i.alpha * (l[x] * u))),
x++,
w && ((T[S + 0] = P), (T[S + 1] = A));
}
w && w.call(e, e, f, T), (s.vertexCount += p), t.pipelines.postBatch(e);
};
},
function (t, e) {
t.exports = function () {};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1089)), (s = i(1090)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e, i) {
var u = i(12);
t.exports = function (t, e, i, n) {
var s, r, o, a, h, l;
0 !== e.width &&
0 !== e.height &&
(i.addToRenderList(e),
(r = (s = e.frame).width),
(o = s.height),
(a = u.getTintAppendFloatAlpha),
(l = (h = t.pipelines.set(e.pipeline, e)).setTexture2D(s.glTexture, e)),
t.pipelines.preBatch(e),
h.batchTexture(
e,
s.glTexture,
r,
o,
e.x,
e.y,
r / e.style.resolution,
o / e.style.resolution,
e.scaleX,
e.scaleY,
e.rotation,
e.flipX,
e.flipY,
e.scrollFactorX,
e.scrollFactorY,
e.displayOriginX,
e.displayOriginY,
0,
0,
r,
o,
a(e.tintTopLeft, i.alpha * e._alphaTL),
a(e.tintTopRight, i.alpha * e._alphaTR),
a(e.tintBottomLeft, i.alpha * e._alphaBL),
a(e.tintBottomRight, i.alpha * e._alphaBR),
e.tintFill,
0,
0,
i,
n,
!1,
l
),
t.pipelines.postBatch(e));
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
0 !== e.width && 0 !== e.height && (i.addToRenderList(e), t.batchSprite(e, e.frame, i, n));
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1092)), (s = i(1093)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e, i) {
var l = i(12);
t.exports = function (t, e, i, n) {
e.updateCanvas();
var s,
r,
o,
a = e.width,
h = e.height;
0 !== a &&
0 !== h &&
(i.addToRenderList(e),
t.pipelines.preBatch(e),
(s = l.getTintAppendFloatAlpha),
(o = (r = t.pipelines.set(e.pipeline, e)).setTexture2D(e.fillPattern, e)),
r.batchTexture(
e,
e.fillPattern,
e.displayFrame.width * e.tileScaleX,
e.displayFrame.height * e.tileScaleY,
e.x,
e.y,
a,
h,
e.scaleX,
e.scaleY,
e.rotation,
e.flipX,
e.flipY,
e.scrollFactorX,
e.scrollFactorY,
e.originX * a,
e.originY * h,
0,
0,
a,
h,
s(e.tintTopLeft, i.alpha * e._alphaTL),
s(e.tintTopRight, i.alpha * e._alphaTR),
s(e.tintBottomLeft, i.alpha * e._alphaBL),
s(e.tintBottomRight, i.alpha * e._alphaBR),
e.tintFill,
(e.tilePositionX % e.displayFrame.width) / e.displayFrame.width,
(e.tilePositionY % e.displayFrame.height) / e.displayFrame.height,
i,
n,
!1,
o
),
t.pipelines.postBatch(e));
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
e.updateCanvas(), i.addToRenderList(e), t.batchSprite(e, e.frame, i, n);
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1095)), (s = i(1096)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e) {
t.exports = function (t, e, i, n) {
e.videoTexture && (i.addToRenderList(e), e.pipeline.batchSprite(e, i, n));
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
e.videoTexture && (i.addToRenderList(e), t.batchSprite(e, e.frame, i, n));
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1098)), (s = i(1099)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e, i) {
var u = i(19),
c = i(114),
d = i(81);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.pipelines.set(e.pipeline),
r = u(e, i, n),
o = s.calcMatrix.copyFrom(r.calc),
a = e._displayOriginX,
h = e._displayOriginY,
l = i.alpha * e.alpha;
t.pipelines.preBatch(e), e.isFilled && c(s, o, e, l, a, h), e.isStroked && d(s, e, l, a, h), t.pipelines.postBatch(e);
};
},
function (t, e, i) {
var o = i(36),
a = i(48),
h = i(60),
l = i(30);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s,
r = t.currentContext;
l(t, r, e, i, n) &&
((s = e.radius),
r.beginPath(),
r.arc(s - e.originX * (2 * s), s - e.originY * (2 * s), s, o(e._startAngle), o(e._endAngle), e.anticlockwise),
e.closePath && r.closePath(),
e.isFilled && (a(r, e), r.fill()),
e.isStroked && (h(r, e), r.stroke()),
r.restore());
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1101)), (s = i(1102)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e, i) {
var u = i(114),
c = i(19),
d = i(81);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.pipelines.set(e.pipeline),
r = c(e, i, n),
o = s.calcMatrix.copyFrom(r.calc),
a = e._displayOriginX + e._curveBounds.x,
h = e._displayOriginY + e._curveBounds.y,
l = i.alpha * e.alpha;
t.pipelines.preBatch(e), e.isFilled && u(s, o, e, l, a, h), e.isStroked && d(s, e, l, a, h), t.pipelines.postBatch(e);
};
},
function (t, e, i) {
var p = i(48),
g = i(60),
v = i(30);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.currentContext;
if (v(t, s, e, i, n)) {
var r = e._displayOriginX + e._curveBounds.x,
o = e._displayOriginY + e._curveBounds.y,
a = e.pathData,
h = a.length - 1,
l = a[0] - r,
u = a[1] - o;
s.beginPath(), s.moveTo(l, u), e.closePath || (h -= 2);
for (var c = 2; c < h; c += 2) {
var d = a[c] - r,
f = a[c + 1] - o;
s.lineTo(d, f);
}
e.closePath && s.closePath(), e.isFilled && (p(s, e), s.fill()), e.isStroked && (g(s, e), s.stroke()), s.restore();
}
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1104)), (s = i(1105)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e, i) {
var u = i(114),
c = i(19),
d = i(81);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.pipelines.set(e.pipeline),
r = c(e, i, n),
o = s.calcMatrix.copyFrom(r.calc),
a = e._displayOriginX,
h = e._displayOriginY,
l = i.alpha * e.alpha;
t.pipelines.preBatch(e), e.isFilled && u(s, o, e, l, a, h), e.isStroked && d(s, e, l, a, h), t.pipelines.postBatch(e);
};
},
function (t, e, i) {
var p = i(48),
g = i(60),
v = i(30);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.currentContext;
if (v(t, s, e, i, n)) {
var r = e._displayOriginX,
o = e._displayOriginY,
a = e.pathData,
h = a.length - 1,
l = a[0] - r,
u = a[1] - o;
s.beginPath(), s.moveTo(l, u), e.closePath || (h -= 2);
for (var c = 2; c < h; c += 2) {
var d = a[c] - r,
f = a[c + 1] - o;
s.lineTo(d, f);
}
s.closePath(), e.isFilled && (p(s, e), s.fill()), e.isStroked && (g(s, e), s.stroke()), s.restore();
}
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1107)), (s = i(1108)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e, i) {
var k = i(19),
R = i(12);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.pipelines.set(e.pipeline),
r = k(e, i, n);
s.calcMatrix.copyFrom(r.calc).translate(-e._displayOriginX, -e._displayOriginY);
var o,
a,
h = i.alpha * e.alpha,
l = e.width,
u = e.height,
c = e.cellWidth,
d = e.cellHeight,
f = Math.ceil(l / c),
p = Math.ceil(u / d),
g = c,
v = d,
y = c - (f * c - l),
m = d - (p * d - u),
x = e.showCells,
b = e.showAltCells,
w = e.showOutline,
T = 0,
S = 0,
_ = 0,
E = 0,
P = 0;
if ((w && (g--, v--, y === c && y--, m === d && m--), t.pipelines.preBatch(e), x && 0 < e.fillAlpha))
for (o = s.fillTint, a = R.getTintAppendFloatAlpha(e.fillColor, e.fillAlpha * h), o.TL = a, o.TR = a, o.BL = a, o.BR = a, S = 0; S < p; S++)
for (b && (_ = S % 2), T = 0; T < f; T++) b && _ ? (_ = 0) : (_++, (E = T < f - 1 ? g : y), (P = S < p - 1 ? v : m), s.batchFillRect(T * c, S * d, E, P));
if (b && 0 < e.altFillAlpha)
for (o = s.fillTint, a = R.getTintAppendFloatAlpha(e.altFillColor, e.altFillAlpha * h), o.TL = a, o.TR = a, o.BL = a, o.BR = a, S = 0; S < p; S++)
for (b && (_ = S % 2), T = 0; T < f; T++) !b || _ ? ((_ = 0), (E = T < f - 1 ? g : y), (P = S < p - 1 ? v : m), s.batchFillRect(T * c, S * d, E, P)) : (_ = 1);
if (w && 0 < e.outlineFillAlpha) {
var A = s.strokeTint,
M = R.getTintAppendFloatAlpha(e.outlineFillColor, e.outlineFillAlpha * h);
for (A.TL = M, A.TR = M, A.BL = M, A.BR = M, T = 1; T < f; T++) {
var C = T * c;
s.batchLine(C, 0, C, u, 1, 1, 1, 0, !1);
}
for (S = 1; S < p; S++) {
var O = S * d;
s.batchLine(0, O, l, O, 1, 1, 1, 0, !1);
}
}
t.pipelines.postBatch(e);
};
},
function (t, e, i) {
var M = i(48),
C = i(60),
O = i(30);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.currentContext;
if (O(t, s, e, i, n)) {
var r = -e._displayOriginX,
o = -e._displayOriginY,
a = i.alpha * e.alpha,
h = e.width,
l = e.height,
u = e.cellWidth,
c = e.cellHeight,
d = Math.ceil(h / u),
f = Math.ceil(l / c),
p = u,
g = c,
v = u - (d * u - h),
y = c - (f * c - l),
m = e.showCells,
x = e.showAltCells,
b = e.showOutline,
w = 0,
T = 0,
S = 0,
_ = 0,
E = 0;
if ((b && (p--, g--, v === u && v--, y === c && y--), m && 0 < e.fillAlpha))
for (M(s, e), T = 0; T < f; T++) for (x && (S = T % 2), w = 0; w < d; w++) x && S ? (S = 0) : (S++, (_ = w < d - 1 ? p : v), (E = T < f - 1 ? g : y), s.fillRect(r + w * u, o + T * c, _, E));
if (x && 0 < e.altFillAlpha)
for (M(s, e, e.altFillColor, e.altFillAlpha * a), T = 0; T < f; T++)
for (x && (S = T % 2), w = 0; w < d; w++) !x || S ? ((S = 0), (_ = w < d - 1 ? p : v), (E = T < f - 1 ? g : y), s.fillRect(r + w * u, o + T * c, _, E)) : (S = 1);
if (b && 0 < e.outlineFillAlpha) {
for (C(s, e, e.outlineFillColor, e.outlineFillAlpha * a), w = 1; w < d; w++) {
var P = w * u;
s.beginPath(), s.moveTo(P + r, o), s.lineTo(P + r, l + o), s.stroke();
}
for (T = 1; T < f; T++) {
var A = T * c;
s.beginPath(), s.moveTo(r, A + o), s.lineTo(r + h, A + o), s.stroke();
}
}
s.restore();
}
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1110)), (s = i(1111)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e, i) {
var w = i(19),
T = i(12);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s,
r,
o,
a,
h,
l,
u,
c,
d,
f = t.pipelines.set(e.pipeline),
p = w(e, i, n),
g = f.calcMatrix.copyFrom(p.calc),
v = e.width,
y = e.height,
m = v / 2,
x = v / e.projection,
b = i.alpha * e.alpha;
e.isFilled &&
(t.pipelines.preBatch(e),
e.showTop &&
((s = T.getTintAppendFloatAlpha(e.fillTop, b)),
(r = g.getX(-m, -y)),
(o = g.getY(-m, -y)),
(a = g.getX(0, -x - y)),
(h = g.getY(0, -x - y)),
(l = g.getX(m, -y)),
(u = g.getY(m, -y)),
(c = g.getX(0, x - y)),
(d = g.getY(0, x - y)),
f.batchQuad(e, r, o, a, h, l, u, c, d, 0, 0, 1, 1, s, s, s, s, 2)),
e.showLeft &&
((s = T.getTintAppendFloatAlpha(e.fillLeft, b)),
(r = g.getX(-m, 0)),
(o = g.getY(-m, 0)),
(a = g.getX(0, x)),
(h = g.getY(0, x)),
(l = g.getX(0, x - y)),
(u = g.getY(0, x - y)),
(c = g.getX(-m, -y)),
(d = g.getY(-m, -y)),
f.batchQuad(e, r, o, a, h, l, u, c, d, 0, 0, 1, 1, s, s, s, s, 2)),
e.showRight &&
((s = T.getTintAppendFloatAlpha(e.fillRight, b)),
(r = g.getX(m, 0)),
(o = g.getY(m, 0)),
(a = g.getX(0, x)),
(h = g.getY(0, x)),
(l = g.getX(0, x - y)),
(u = g.getY(0, x - y)),
(c = g.getX(m, -y)),
(d = g.getY(m, -y)),
f.batchQuad(e, r, o, a, h, l, u, c, d, 0, 0, 1, 1, s, s, s, s, 2)),
t.pipelines.postBatch(e));
};
},
function (t, e, i) {
var l = i(48),
u = i(30);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s,
r,
o,
a,
h = t.currentContext;
u(t, h, e, i, n) &&
e.isFilled &&
((s = e.width),
(r = e.height),
(o = s / 2),
(a = s / e.projection),
e.showTop && (l(h, e, e.fillTop), h.beginPath(), h.moveTo(-o, -r), h.lineTo(0, -a - r), h.lineTo(o, -r), h.lineTo(o, -1), h.lineTo(0, a - 1), h.lineTo(-o, -1), h.lineTo(-o, -r), h.fill()),
e.showLeft && (l(h, e, e.fillLeft), h.beginPath(), h.moveTo(-o, 0), h.lineTo(0, a), h.lineTo(0, a - r), h.lineTo(-o, -r), h.lineTo(-o, 0), h.fill()),
e.showRight && (l(h, e, e.fillRight), h.beginPath(), h.moveTo(o, 0), h.lineTo(0, a), h.lineTo(0, a - r), h.lineTo(o, -r), h.lineTo(o, 0), h.fill()),
h.restore());
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1113)), (s = i(1114)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e, i) {
var T = i(19),
S = i(12);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s,
r,
o,
a,
h,
l,
u,
c,
d,
f = t.pipelines.set(e.pipeline),
p = T(e, i, n),
g = f.calcMatrix.copyFrom(p.calc),
v = e.width,
y = e.height,
m = v / 2,
x = v / e.projection,
b = e.isReversed,
w = i.alpha * e.alpha;
e.isFilled &&
(t.pipelines.preBatch(e),
e.showTop &&
b &&
((s = S.getTintAppendFloatAlpha(e.fillTop, w)),
(r = g.getX(-m, -y)),
(o = g.getY(-m, -y)),
(a = g.getX(0, -x - y)),
(h = g.getY(0, -x - y)),
(l = g.getX(m, -y)),
(u = g.getY(m, -y)),
(c = g.getX(0, x - y)),
(d = g.getY(0, x - y)),
f.batchQuad(e, r, o, a, h, l, u, c, d, 0, 0, 1, 1, s, s, s, s, 2)),
e.showLeft &&
((s = S.getTintAppendFloatAlpha(e.fillLeft, w)),
(o = b ? ((r = g.getX(-m, -y)), g.getY(-m, -y)) : ((r = g.getX(-m, 0)), g.getY(-m, 0))),
(a = g.getX(0, x)),
(h = g.getY(0, x)),
(l = g.getX(0, x - y)),
(u = g.getY(0, x - y)),
f.batchTri(e, r, o, a, h, l, u, 0, 0, 1, 1, s, s, s, 2)),
e.showRight &&
((s = S.getTintAppendFloatAlpha(e.fillRight, w)),
(o = b ? ((r = g.getX(m, -y)), g.getY(m, -y)) : ((r = g.getX(m, 0)), g.getY(m, 0))),
(a = g.getX(0, x)),
(h = g.getY(0, x)),
(l = g.getX(0, x - y)),
(u = g.getY(0, x - y)),
f.batchTri(e, r, o, a, h, l, u, 0, 0, 1, 1, s, s, s, 2)),
t.pipelines.postBatch(e));
};
},
function (t, e, i) {
var u = i(48),
c = i(30);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s,
r,
o,
a,
h,
l = t.currentContext;
c(t, l, e, i, n) &&
e.isFilled &&
((s = e.width),
(r = e.height),
(o = s / 2),
(a = s / e.projection),
(h = e.isReversed),
e.showTop && h && (u(l, e, e.fillTop), l.beginPath(), l.moveTo(-o, -r), l.lineTo(0, -a - r), l.lineTo(o, -r), l.lineTo(0, a - r), l.fill()),
e.showLeft && (u(l, e, e.fillLeft), l.beginPath(), h ? l.moveTo(-o, -r) : l.moveTo(-o, 0), l.lineTo(0, a), l.lineTo(0, a - r), l.fill()),
e.showRight && (u(l, e, e.fillRight), l.beginPath(), h ? l.moveTo(o, -r) : l.moveTo(o, 0), l.lineTo(0, a), l.lineTo(0, a - r), l.fill()),
l.restore());
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1116)), (s = i(1117)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e, i) {
var f = i(19),
p = i(12);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.pipelines.set(e.pipeline),
r = f(e, i, n);
s.calcMatrix.copyFrom(r.calc);
var o,
a,
h,
l,
u = e._displayOriginX,
c = e._displayOriginY,
d = i.alpha * e.alpha;
t.pipelines.preBatch(e),
e.isStroked &&
((o = s.strokeTint),
(a = p.getTintAppendFloatAlpha(e.strokeColor, e.strokeAlpha * d)),
(o.TL = a),
(o.TR = a),
(o.BL = a),
(o.BR = a),
(h = e._startWidth),
(l = e._endWidth),
s.batchLine(e.geom.x1 - u, e.geom.y1 - c, e.geom.x2 - u, e.geom.y2 - c, h, l, 1, 0, !1, r.sprite, r.camera)),
t.pipelines.postBatch(e);
};
},
function (t, e, i) {
var a = i(60),
h = i(30);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s,
r,
o = t.currentContext;
h(t, o, e, i, n) &&
((s = e._displayOriginX), (r = e._displayOriginY), e.isStroked && (a(o, e), o.beginPath(), o.moveTo(e.geom.x1 - s, e.geom.y1 - r), o.lineTo(e.geom.x2 - s, e.geom.y2 - r), o.stroke()), o.restore());
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1119)), (s = i(1120)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e, i) {
var u = i(114),
c = i(19),
d = i(81);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.pipelines.set(e.pipeline),
r = c(e, i, n),
o = s.calcMatrix.copyFrom(r.calc),
a = e._displayOriginX,
h = e._displayOriginY,
l = i.alpha * e.alpha;
t.pipelines.preBatch(e), e.isFilled && u(s, o, e, l, a, h), e.isStroked && d(s, e, l, a, h), t.pipelines.postBatch(e);
};
},
function (t, e, i) {
var p = i(48),
g = i(60),
v = i(30);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.currentContext;
if (v(t, s, e, i, n)) {
var r = e._displayOriginX,
o = e._displayOriginY,
a = e.pathData,
h = a.length - 1,
l = a[0] - r,
u = a[1] - o;
s.beginPath(), s.moveTo(l, u), e.closePath || (h -= 2);
for (var c = 2; c < h; c += 2) {
var d = a[c] - r,
f = a[c + 1] - o;
s.lineTo(d, f);
}
s.closePath(), e.isFilled && (p(s, e), s.fill()), e.isStroked && (g(s, e), s.stroke()), s.restore();
}
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1122)), (s = i(1123)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e, i) {
var c = i(19),
d = i(81),
f = i(12);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.pipelines.set(e.pipeline),
r = c(e, i, n);
s.calcMatrix.copyFrom(r.calc);
var o,
a,
h = e._displayOriginX,
l = e._displayOriginY,
u = i.alpha * e.alpha;
t.pipelines.preBatch(e),
e.isFilled && ((o = s.fillTint), (a = f.getTintAppendFloatAlpha(e.fillColor, e.fillAlpha * u)), (o.TL = a), (o.TR = a), (o.BL = a), (o.BR = a), s.batchFillRect(-h, -l, e.width, e.height)),
e.isStroked && d(s, e, u, h, l),
t.pipelines.postBatch(e);
};
},
function (t, e, i) {
var a = i(48),
h = i(60),
l = i(30);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s,
r,
o = t.currentContext;
l(t, o, e, i, n) &&
((s = e._displayOriginX),
(r = e._displayOriginY),
e.isFilled && (a(o, e), o.fillRect(-s, -r, e.width, e.height)),
e.isStroked && (h(o, e), o.beginPath(), o.rect(-s, -r, e.width, e.height), o.stroke()),
o.restore());
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1125)), (s = i(1126)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e, i) {
var u = i(114),
c = i(19),
d = i(81);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.pipelines.set(e.pipeline),
r = c(e, i, n),
o = s.calcMatrix.copyFrom(r.calc),
a = e._displayOriginX,
h = e._displayOriginY,
l = i.alpha * e.alpha;
t.pipelines.preBatch(e), e.isFilled && u(s, o, e, l, a, h), e.isStroked && d(s, e, l, a, h), t.pipelines.postBatch(e);
};
},
function (t, e, i) {
var p = i(48),
g = i(60),
v = i(30);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.currentContext;
if (v(t, s, e, i, n)) {
var r = e._displayOriginX,
o = e._displayOriginY,
a = e.pathData,
h = a.length - 1,
l = a[0] - r,
u = a[1] - o;
s.beginPath(), s.moveTo(l, u), e.closePath || (h -= 2);
for (var c = 2; c < h; c += 2) {
var d = a[c] - r,
f = a[c + 1] - o;
s.lineTo(d, f);
}
s.closePath(), e.isFilled && (p(s, e), s.fill()), e.isStroked && (g(s, e), s.stroke()), s.restore();
}
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1128)), (s = i(1129)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e, i) {
var y = i(19),
m = i(81),
x = i(12);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.pipelines.set(e.pipeline),
r = y(e, i, n);
s.calcMatrix.copyFrom(r.calc);
var o,
a,
h,
l,
u,
c,
d,
f,
p = e._displayOriginX,
g = e._displayOriginY,
v = i.alpha * e.alpha;
t.pipelines.preBatch(e),
e.isFilled &&
((o = s.fillTint),
(a = x.getTintAppendFloatAlpha(e.fillColor, e.fillAlpha * v)),
(o.TL = a),
(o.TR = a),
(o.BL = a),
(o.BR = a),
(h = e.geom.x1 - p),
(l = e.geom.y1 - g),
(u = e.geom.x2 - p),
(c = e.geom.y2 - g),
(d = e.geom.x3 - p),
(f = e.geom.y3 - g),
s.batchFillTriangle(h, l, u, c, d, f, r.sprite, r.camera)),
e.isStroked && m(s, e, v, p, g),
t.pipelines.postBatch(e);
};
},
function (t, e, i) {
var f = i(48),
p = i(60),
g = i(30);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s,
r,
o,
a,
h,
l,
u,
c,
d = t.currentContext;
g(t, d, e, i, n) &&
((s = e._displayOriginX),
(r = e._displayOriginY),
(o = e.geom.x1 - s),
(a = e.geom.y1 - r),
(h = e.geom.x2 - s),
(l = e.geom.y2 - r),
(u = e.geom.x3 - s),
(c = e.geom.y3 - r),
d.beginPath(),
d.moveTo(o, a),
d.lineTo(h, l),
d.lineTo(u, c),
d.closePath(),
e.isFilled && (f(d, e), d.fill()),
e.isStroked && (p(d, e), d.stroke()),
d.restore());
};
},
function (t, e, i) {
var s = i(213);
i(5).register("blitter", function (t, e, i, n) {
return this.displayList.add(new s(this.scene, t, e, i, n));
});
},
function (t, e, i) {
var n = i(214);
i(5).register("container", function (t, e, i) {
return this.displayList.add(new n(this.scene, t, e, i));
});
},
function (t, e, i) {
var o = i(442);
i(5).register("dom", function (t, e, i, n, s) {
var r = new o(this.scene, t, e, i, n, s);
return this.displayList.add(r), r;
});
},
function (t, e, i) {
var r = i(215);
i(5).register("dynamicBitmapText", function (t, e, i, n, s) {
return this.displayList.add(new r(this.scene, t, e, i, n, s));
});
},
function (t, e, i) {
var n = i(444);
i(5).register("extern", function () {
var t = new n(this.scene);
return this.displayList.add(t), t;
});
},
function (t, e, i) {
var n = i(216);
i(5).register("graphics", function (t) {
return this.displayList.add(new n(this.scene, t));
});
},
function (t, e, i) {
var n = i(113);
i(5).register("group", function (t, e) {
return this.updateList.add(new n(this.scene, t, e));
});
},
function (t, e, i) {
var s = i(125);
i(5).register("image", function (t, e, i, n) {
return this.displayList.add(new s(this.scene, t, e, i, n));
});
},
function (t, e, i) {
var n = i(219);
i(5).register("layer", function (t) {
return this.displayList.add(new n(this.scene, t));
});
},
function (t, e, i) {
var n = i(5),
s = i(220);
n.register("particles", function (t, e, i) {
return this.displayList.add(new s(this.scene, t, e, i));
});
},
function (t, e, i) {
var n = i(5),
o = i(457);
n.register("follower", function (t, e, i, n, s) {
var r = new o(this.scene, t, e, i, n, s);
return this.displayList.add(r), this.updateList.add(r), r;
});
},
function (t, e, i) {
var n = i(5),
o = i(221);
n.register("renderTexture", function (t, e, i, n, s, r) {
return this.displayList.add(new o(this.scene, t, e, i, n, s, r));
});
},
function (t, e, i) {
var h = i(223);
i(5).register("rope", function (t, e, i, n, s, r, o, a) {
return this.displayList.add(new h(this.scene, t, e, i, n, s, r, o, a));
});
},
function (t, e, i) {
var n = i(5),
r = i(73);
n.register("sprite", function (t, e, i, n) {
var s = new r(this.scene, t, e, i, n);
return this.displayList.add(s), s;
});
},
function (t, e, i) {
var o = i(148);
i(5).register("bitmapText", function (t, e, i, n, s, r) {
return this.displayList.add(new o(this.scene, t, e, i, n, s, r));
});
},
function (t, e, i) {
var s = i(224);
i(5).register("text", function (t, e, i, n) {
return this.displayList.add(new s(this.scene, t, e, i, n));
});
},
function (t, e, i) {
var o = i(225);
i(5).register("tileSprite", function (t, e, i, n, s, r) {
return this.displayList.add(new o(this.scene, t, e, i, n, s, r));
});
},
function (t, e, i) {
var s = i(129);
i(5).register("zone", function (t, e, i, n) {
return this.displayList.add(new s(this.scene, t, e, i, n));
});
},
function (t, e, i) {
var n = i(226);
i(5).register("video", function (t, e, i) {
return this.displayList.add(new n(this.scene, t, e, i));
});
},
function (t, e, i) {
var h = i(461),
n = i(5);
n.register("arc", function (t, e, i, n, s, r, o, a) {
return this.displayList.add(new h(this.scene, t, e, i, n, s, r, o, a));
}),
n.register("circle", function (t, e, i, n, s) {
return this.displayList.add(new h(this.scene, t, e, i, 0, 360, !1, n, s));
});
},
function (t, e, i) {
var n = i(5),
r = i(462);
n.register("curve", function (t, e, i, n, s) {
return this.displayList.add(new r(this.scene, t, e, i, n, s));
});
},
function (t, e, i) {
var o = i(463);
i(5).register("ellipse", function (t, e, i, n, s, r) {
return this.displayList.add(new o(this.scene, t, e, i, n, s, r));
});
},
function (t, e, i) {
var n = i(5),
u = i(464);
n.register("grid", function (t, e, i, n, s, r, o, a, h, l) {
return this.displayList.add(new u(this.scene, t, e, i, n, s, r, o, a, h, l));
});
},
function (t, e, i) {
var n = i(5),
a = i(465);
n.register("isobox", function (t, e, i, n, s, r, o) {
return this.displayList.add(new a(this.scene, t, e, i, n, s, r, o));
});
},
function (t, e, i) {
var n = i(5),
h = i(466);
n.register("isotriangle", function (t, e, i, n, s, r, o, a) {
return this.displayList.add(new h(this.scene, t, e, i, n, s, r, o, a));
});
},
function (t, e, i) {
var n = i(5),
h = i(467);
n.register("line", function (t, e, i, n, s, r, o, a) {
return this.displayList.add(new h(this.scene, t, e, i, n, s, r, o, a));
});
},
function (t, e, i) {
var n = i(5),
r = i(468);
n.register("polygon", function (t, e, i, n, s) {
return this.displayList.add(new r(this.scene, t, e, i, n, s));
});
},
function (t, e, i) {
var n = i(5),
o = i(473);
n.register("rectangle", function (t, e, i, n, s, r) {
return this.displayList.add(new o(this.scene, t, e, i, n, s, r));
});
},
function (t, e, i) {
var a = i(474);
i(5).register("star", function (t, e, i, n, s, r, o) {
return this.displayList.add(new a(this.scene, t, e, i, n, s, r, o));
});
},
function (t, e, i) {
var n = i(5),
u = i(475);
n.register("triangle", function (t, e, i, n, s, r, o, a, h, l) {
return this.displayList.add(new u(this.scene, t, e, i, n, s, r, o, a, h, l));
});
},
function (t, e, i) {
var r = i(213),
o = i(28),
n = i(16),
a = i(13);
n.register("blitter", function (t, e) {
void 0 === t && (t = {});
var i = a(t, "key", null),
n = a(t, "frame", null),
s = new r(this.scene, 0, 0, i, n);
return void 0 !== e && (t.add = e), o(this.scene, s, t), s;
});
},
function (t, e, i) {
var o = i(28),
a = i(214),
n = i(16),
h = i(13);
n.register("container", function (t, e) {
void 0 === t && (t = {});
var i = h(t, "x", 0),
n = h(t, "y", 0),
s = h(t, "children", null),
r = new a(this.scene, i, n, s);
return void 0 !== e && (t.add = e), o(this.scene, r, t), r;
});
},
function (t, e, i) {
var o = i(215),
a = i(28),
n = i(16),
h = i(13);
n.register("dynamicBitmapText", function (t, e) {
void 0 === t && (t = {});
var i = h(t, "font", ""),
n = h(t, "text", ""),
s = h(t, "size", !1),
r = new o(this.scene, 0, 0, i, n, s);
return void 0 !== e && (t.add = e), a(this.scene, r, t), r;
});
},
function (t, e, i) {
var n = i(16),
s = i(216);
n.register("graphics", function (t, e) {
void 0 === t && (t = {}), void 0 !== e && (t.add = e);
var i = new s(this.scene, t);
return t.add && this.scene.sys.displayList.add(i), i;
});
},
function (t, e, i) {
var n = i(16),
s = i(113);
n.register("group", function (t) {
return new s(this.scene, null, t);
});
},
function (t, e, i) {
var r = i(28),
n = i(16),
o = i(13),
a = i(125);
n.register("image", function (t, e) {
void 0 === t && (t = {});
var i = o(t, "key", null),
n = o(t, "frame", null),
s = new a(this.scene, 0, 0, i, n);
return void 0 !== e && (t.add = e), r(this.scene, s, t), s;
});
},
function (t, e, i) {
var s = i(28),
r = i(219),
n = i(16),
o = i(13);
n.register("layer", function (t, e) {
void 0 === t && (t = {});
var i = o(t, "children", null),
n = new r(this.scene, i);
return void 0 !== e && (t.add = e), s(this.scene, n, t), n;
});
},
function (t, e, i) {
var n = i(16),
o = i(13),
a = i(2),
h = i(220);
n.register("particles", function (t, e) {
void 0 === t && (t = {});
var i = o(t, "key", null),
n = o(t, "frame", null),
s = a(t, "emitters", null),
r = new h(this.scene, i, n, s);
return void 0 !== e && (t.add = e), a(t, "add", !1) ? this.displayList.add(r) : this.updateList.add(r), r;
});
},
function (t, e, i) {
var l = i(28),
n = i(16),
u = i(13),
c = i(221);
n.register("renderTexture", function (t, e) {
void 0 === t && (t = {});
var i = u(t, "x", 0),
n = u(t, "y", 0),
s = u(t, "width", 32),
r = u(t, "height", 32),
o = u(t, "key", void 0),
a = u(t, "frame", void 0),
h = new c(this.scene, i, n, s, r, o, a);
return void 0 !== e && (t.add = e), l(this.scene, h, t), h;
});
},
function (t, e, i) {
var l = i(28),
n = i(16),
u = i(13),
c = i(6),
d = i(223);
n.register("rope", function (t, e) {
void 0 === t && (t = {});
var i = u(t, "key", null),
n = u(t, "frame", null),
s = u(t, "horizontal", !0),
r = c(t, "points", void 0),
o = c(t, "colors", void 0),
a = c(t, "alphas", void 0),
h = new d(this.scene, 0, 0, i, n, r, s, o, a);
return void 0 !== e && (t.add = e), l(this.scene, h, t), t.add || this.updateList.add(h), h;
});
},
function (t, e, i) {
var r = i(28),
o = i(439),
n = i(16),
a = i(13),
h = i(73);
n.register("sprite", function (t, e) {
void 0 === t && (t = {});
var i = a(t, "key", null),
n = a(t, "frame", null),
s = new h(this.scene, 0, 0, i, n);
return void 0 !== e && (t.add = e), r(this.scene, s, t), o(s, t), s;
});
},
function (t, e, i) {
var a = i(148),
h = i(28),
n = i(16),
l = i(13),
u = i(6);
n.register("bitmapText", function (t, e) {
void 0 === t && (t = {});
var i = u(t, "font", ""),
n = l(t, "text", ""),
s = l(t, "size", !1),
r = u(t, "align", 0),
o = new a(this.scene, 0, 0, i, n, s, r);
return void 0 !== e && (t.add = e), h(this.scene, o, t), o;
});
},
function (t, e, i) {
var o = i(28),
n = i(16),
a = i(13),
h = i(224);
n.register("text", function (t, e) {
void 0 === t && (t = {});
var i = a(t, "text", ""),
n = a(t, "style", null),
s = a(t, "padding", null);
null !== s && (n.padding = s);
var r = new h(this.scene, 0, 0, i, n);
return void 0 !== e && (t.add = e), o(this.scene, r, t), (r.autoRound = a(t, "autoRound", !0)), (r.resolution = a(t, "resolution", 1)), r;
});
},
function (t, e, i) {
var l = i(28),
n = i(16),
u = i(13),
c = i(225);
n.register("tileSprite", function (t, e) {
void 0 === t && (t = {});
var i = u(t, "x", 0),
n = u(t, "y", 0),
s = u(t, "width", 512),
r = u(t, "height", 512),
o = u(t, "key", ""),
a = u(t, "frame", ""),
h = new c(this.scene, i, n, s, r, o, a);
return void 0 !== e && (t.add = e), l(this.scene, h, t), h;
});
},
function (t, e, i) {
var n = i(16),
r = i(13),
o = i(129);
n.register("zone", function (t) {
var e = r(t, "x", 0),
i = r(t, "y", 0),
n = r(t, "width", 1),
s = r(t, "height", n);
return new o(this.scene, e, i, n, s);
});
},
function (t, e, i) {
var s = i(28),
n = i(16),
r = i(13),
o = i(226);
n.register("video", function (t, e) {
void 0 === t && (t = {});
var i = r(t, "key", null),
n = new o(this.scene, 0, 0, i);
return void 0 !== e && (t.add = e), s(this.scene, n, t), t.add || this.updateList.add(n), n;
});
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1177)), (s = i(1178)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e, i) {
var r = i(19);
t.exports = function (t, e, i, n) {
var s;
e.shader &&
(i.addToRenderList(e),
t.pipelines.clear(),
e.renderToTexture ? e.load() : ((s = r(e, i, n).calc), (t.width === e._rendererWidth && t.height === e._rendererHeight) || e.projOrtho(0, t.width, t.height, 0), e.load(s.matrix)),
e.flush(),
t.pipelines.rebind());
};
},
function (t, e) {
t.exports = function () {};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1180)), (s = i(1181)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e, i) {
var M = i(19);
t.exports = function (t, e, i, n) {
var s = e.faces,
r = s.length;
if (0 !== r) {
i.addToRenderList(e);
var o = t.pipelines.set(e.pipeline, e),
a = M(e, i, n).calc,
h = o.setGameObject(e),
l = o.vertexViewF32,
u = o.vertexViewU32,
c = o.vertexCount * o.currentShader.vertexComponentCount - 1,
d = e.tintFill,
f = [],
p = e.debugCallback,
g = a.a,
v = a.b,
y = a.c,
m = a.d,
x = a.e,
b = a.f,
w = e.viewPosition.z,
T = e.hideCCW,
S = i.roundPixels,
_ = i.alpha * e.alpha,
E = 0;
t.pipelines.preBatch(e);
for (var P = 0; P < r; P++) {
var A = s[P];
A.isInView(i, T, w, _, g, v, y, m, x, b, S) && (o.shouldFlush(3) && (o.flush(), (c = 0)), (c = A.load(l, u, c, h, d)), E++, (o.vertexCount += 3), p && f.push(A));
}
(e.totalFrame += E), p && p.call(e, e, f), t.pipelines.postBatch(e);
}
};
},
function (t, e) {
t.exports = function () {};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1183)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e, i) {
var T = i(19);
t.exports = function (t, e, i, n) {
i.addToRenderList(e);
var s = t.pipelines.set(e.pipeline),
r = T(e, i, n).calc,
o = e.width,
a = e.height,
h = -e._radius,
l = -e._radius,
u = h + o,
c = l + a,
d = r.getX(0, 0),
f = r.getY(0, 0),
p = r.getX(h, l),
g = r.getY(h, l),
v = r.getX(h, c),
y = r.getY(h, c),
m = r.getX(u, c),
x = r.getY(u, c),
b = r.getX(u, l),
w = r.getY(u, l);
t.pipelines.preBatch(e), s.batchPointLight(e, i, p, g, v, y, m, x, b, w, d, f), t.pipelines.postBatch(e);
};
},
function (t, e, i) {
var a = i(229);
i(5).register("shader", function (t, e, i, n, s, r, o) {
return this.displayList.add(new a(this.scene, t, e, i, n, s, r, o));
});
},
function (t, e, i) {
var c = i(230);
i(5).register("mesh", function (t, e, i, n, s, r, o, a, h, l, u) {
return this.displayList.add(new c(this.scene, t, e, i, n, s, r, o, a, h, l, u));
});
},
function (t, e, i) {
var n = i(5),
o = i(150);
n.register("pointlight", function (t, e, i, n, s, r) {
return this.displayList.add(new o(this.scene, t, e, i, n, s, r));
});
},
function (t, e, i) {
var h = i(28),
n = i(16),
l = i(13),
u = i(229);
n.register("shader", function (t, e) {
void 0 === t && (t = {});
var i = l(t, "key", null),
n = l(t, "x", 0),
s = l(t, "y", 0),
r = l(t, "width", 128),
o = l(t, "height", 128),
a = new u(this.scene, i, n, s, r, o);
return void 0 !== e && (t.add = e), h(this.scene, a, t), a;
});
},
function (t, e, i) {
var d = i(28),
n = i(16),
f = i(13),
p = i(6),
g = i(230);
n.register("mesh", function (t, e) {
void 0 === t && (t = {});
var i = f(t, "key", null),
n = f(t, "frame", null),
s = p(t, "vertices", []),
r = p(t, "uvs", []),
o = p(t, "indicies", []),
a = p(t, "containsZ", !1),
h = p(t, "normals", []),
l = p(t, "colors", 16777215),
u = p(t, "alphas", 1),
c = new g(this.scene, 0, 0, i, n, s, r, o, a, h, l, u);
return void 0 !== e && (t.add = e), d(this.scene, c, t), c;
});
},
function (t, e, i) {
var a = i(28),
n = i(16),
h = i(13),
l = i(150);
n.register("pointlight", function (t, e) {
void 0 === t && (t = {});
var i = h(t, "color", 16777215),
n = h(t, "radius", 128),
s = h(t, "intensity", 1),
r = h(t, "attenuation", 0.1),
o = new l(this.scene, 0, 0, i, n, s, r);
return void 0 !== e && (t.add = e), a(this.scene, o, t), o;
});
},
function (t, e, i) {
var n = i(0),
s = i(482),
r = i(24),
o = i(20),
a = new n({
Extends: s,
initialize: function (t) {
(this.scene = t), (this.systems = t.sys), t.sys.settings.isBooted || t.sys.events.once(o.BOOT, this.boot, this), s.call(this);
},
boot: function () {
var t = this.systems.events;
t.on(o.SHUTDOWN, this.shutdown, this), t.on(o.DESTROY, this.destroy, this);
},
destroy: function () {
this.shutdown(), (this.scene = void 0), (this.systems = void 0);
},
});
r.register("LightsPlugin", a, "lights"), (t.exports = a);
},
function (t, e, i) {
var n = i(65);
(n.Area = i(1192)),
(n.Circumference = i(302)),
(n.CircumferencePoint = i(169)),
(n.Clone = i(1193)),
(n.Contains = i(66)),
(n.ContainsPoint = i(1194)),
(n.ContainsRect = i(1195)),
(n.CopyFrom = i(1196)),
(n.Equals = i(1197)),
(n.GetBounds = i(1198)),
(n.GetPoint = i(300)),
(n.GetPoints = i(301)),
(n.Offset = i(1199)),
(n.OffsetPoint = i(1200)),
(n.Random = i(170)),
(t.exports = n);
},
function (t, e) {
t.exports = function (t) {
return 0 < t.radius ? Math.PI * t.radius * t.radius : 0;
};
},
function (t, e, i) {
var n = i(65);
t.exports = function (t) {
return new n(t.x, t.y, t.radius);
};
},
function (t, e, i) {
var n = i(66);
t.exports = function (t, e) {
return n(t, e.x, e.y);
};
},
function (t, e, i) {
var n = i(66);
t.exports = function (t, e) {
return n(t, e.x, e.y) && n(t, e.right, e.y) && n(t, e.x, e.bottom) && n(t, e.right, e.bottom);
};
},
function (t, e) {
t.exports = function (t, e) {
return e.setTo(t.x, t.y, t.radius);
};
},
function (t, e) {
t.exports = function (t, e) {
return t.x === e.x && t.y === e.y && t.radius === e.radius;
};
},
function (t, e, i) {
var n = i(10);
t.exports = function (t, e) {
return void 0 === e && (e = new n()), (e.x = t.left), (e.y = t.top), (e.width = t.diameter), (e.height = t.diameter), e;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return (t.x += e), (t.y += i), t;
};
},
function (t, e) {
t.exports = function (t, e) {
return (t.x += e.x), (t.y += e.y), t;
};
},
function (t, e, i) {
var n = i(111);
(n.Area = i(1202)),
(n.Circumference = i(447)),
(n.CircumferencePoint = i(218)),
(n.Clone = i(1203)),
(n.Contains = i(112)),
(n.ContainsPoint = i(1204)),
(n.ContainsRect = i(1205)),
(n.CopyFrom = i(1206)),
(n.Equals = i(1207)),
(n.GetBounds = i(1208)),
(n.GetPoint = i(445)),
(n.GetPoints = i(446)),
(n.Offset = i(1209)),
(n.OffsetPoint = i(1210)),
(n.Random = i(180)),
(t.exports = n);
},
function (t, e) {
t.exports = function (t) {
return t.isEmpty() ? 0 : t.getMajorRadius() * t.getMinorRadius() * Math.PI;
};
},
function (t, e, i) {
var n = i(111);
t.exports = function (t) {
return new n(t.x, t.y, t.width, t.height);
};
},
function (t, e, i) {
var n = i(112);
t.exports = function (t, e) {
return n(t, e.x, e.y);
};
},
function (t, e, i) {
var n = i(112);
t.exports = function (t, e) {
return n(t, e.x, e.y) && n(t, e.right, e.y) && n(t, e.x, e.bottom) && n(t, e.right, e.bottom);
};
},
function (t, e) {
t.exports = function (t, e) {
return e.setTo(t.x, t.y, t.width, t.height);
};
},
function (t, e) {
t.exports = function (t, e) {
return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
};
},
function (t, e, i) {
var n = i(10);
t.exports = function (t, e) {
return void 0 === e && (e = new n()), (e.x = t.left), (e.y = t.top), (e.width = t.width), (e.height = t.height), e;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return (t.x += e), (t.y += i), t;
};
},
function (t, e) {
t.exports = function (t, e) {
return (t.x += e.x), (t.y += e.y), t;
};
},
function (t, e, i) {
var g = i(4),
v = i(231);
t.exports = function (t, e, i) {
var n, s, r, o, a, h, l, u, c, d, f, p;
return (
void 0 === i && (i = []),
v(t, e) &&
((n = t.x),
(s = t.y),
(r = t.radius),
(o = e.x),
(a = e.y),
(h = e.radius),
s === a
? 0 == (p = (f = -2 * a) * f - 4 * (d = 1) * (o * o + (l = (h * h - r * r - o * o + n * n) / (2 * (n - o))) * l - 2 * o * l + a * a - h * h))
? i.push(new g(l, -f / (2 * d)))
: 0 < p && (i.push(new g(l, (-f + Math.sqrt(p)) / (2 * d))), i.push(new g(l, (-f - Math.sqrt(p)) / (2 * d))))
: 0 ==
(p =
(f = 2 * s * (u = (n - o) / (s - a)) - 2 * (c = (h * h - r * r - o * o + n * n - a * a + s * s) / (2 * (s - a))) * u - 2 * n) * f -
4 * (d = u * u + 1) * (n * n + s * s + c * c - r * r - 2 * s * c))
? ((l = -f / (2 * d)), i.push(new g(l, c - l * u)))
: 0 < p && ((l = (-f + Math.sqrt(p)) / (2 * d)), i.push(new g(l, c - l * u)), (l = (-f - Math.sqrt(p)) / (2 * d)), i.push(new g(l, c - l * u)))),
i
);
};
},
function (t, e, i) {
var a = i(232),
h = i(151);
t.exports = function (t, e, i) {
var n, s, r, o;
return void 0 === i && (i = []), h(t, e) && ((n = e.getLineA()), (s = e.getLineB()), (r = e.getLineC()), (o = e.getLineD()), a(n, t, i), a(s, t, i), a(r, t, i), a(o, t, i)), i;
};
},
function (t, e, i) {
var h = i(140),
l = i(487),
u = new (i(47))();
function c(t, e, i, n, s) {
var r = Math.cos(t),
o = Math.sin(t);
u.setTo(e, i, e + r, i + o);
var a = l(u, n);
a && s.push(new h(a.x, a.y, t, a.w));
}
function d(t, e) {
return t.z - e.z;
}
t.exports = function (t, e, i) {
Array.isArray(i) || (i = [i]);
for (var n = [], s = [], r = 0; r < i.length; r++)
for (var o = i[r].points, a = 0; a < o.length; a++) {
var h = Math.atan2(o[a].y - e, o[a].x - t);
-1 === s.indexOf(h) && (c(h, t, e, i, n), c(h - 1e-5, t, e, i, n), c(h + 1e-5, t, e, i, n), s.push(h));
}
return n.sort(d);
};
},
function (t, e, i) {
var n = i(10),
s = i(152);
t.exports = function (t, e, i) {
return void 0 === i && (i = new n()), s(t, e) && ((i.x = Math.max(t.x, e.x)), (i.y = Math.max(t.y, e.y)), (i.width = Math.min(t.right, e.right) - i.x), (i.height = Math.min(t.bottom, e.bottom) - i.y)), i;
};
},
function (t, e, i) {
var a = i(234),
h = i(152);
t.exports = function (t, e, i) {
var n, s, r, o;
return void 0 === i && (i = []), h(t, e) && ((n = t.getLineA()), (s = t.getLineB()), (r = t.getLineC()), (o = t.getLineD()), a(n, e, i), a(s, e, i), a(r, e, i), a(o, e, i)), i;
};
},
function (t, e, i) {
var o = i(489),
a = i(234);
t.exports = function (t, e, i) {
var n, s, r;
return void 0 === i && (i = []), o(t, e) && ((n = e.getLineA()), (s = e.getLineB()), (r = e.getLineC()), a(n, t, i), a(s, t, i), a(r, t, i)), i;
};
},
function (t, e, i) {
var o = i(232),
a = i(491);
t.exports = function (t, e, i) {
var n, s, r;
return void 0 === i && (i = []), a(t, e) && ((n = t.getLineA()), (s = t.getLineB()), (r = t.getLineC()), o(n, e, i), o(s, e, i), o(r, e, i)), i;
};
},
function (t, e, i) {
var o = i(494),
a = i(492);
t.exports = function (t, e, i) {
var n, s, r;
return void 0 === i && (i = []), o(t, e) && ((n = e.getLineA()), (s = e.getLineB()), (r = e.getLineC()), a(t, n, i), a(t, s, i), a(t, r, i)), i;
};
},
function (t, e, i) {
var o = i(496);
t.exports = function (t, e) {
if (!o(t, e)) return !1;
var i = Math.min(e.x1, e.x2),
n = Math.max(e.x1, e.x2),
s = Math.min(e.y1, e.y2),
r = Math.max(e.y1, e.y2);
return t.x >= i && t.x <= n && t.y >= s && t.y <= r;
};
},
function (t, e) {
t.exports = function (t, e, i, n, s, r) {
return void 0 === r && (r = 0), !(e > t.right + r || i < t.left - r || n > t.bottom + r || s < t.top - r);
};
},
function (t, e, i) {
var n = i(47);
(n.Angle = i(97)),
(n.BresenhamPoints = i(317)),
(n.CenterOn = i(1222)),
(n.Clone = i(1223)),
(n.CopyFrom = i(1224)),
(n.Equals = i(1225)),
(n.Extend = i(1226)),
(n.GetEasedPoints = i(1227)),
(n.GetMidPoint = i(1228)),
(n.GetNearestPoint = i(1229)),
(n.GetNormal = i(1230)),
(n.GetPoint = i(307)),
(n.GetPoints = i(172)),
(n.GetShortestDistance = i(1231)),
(n.Height = i(1232)),
(n.Length = i(67)),
(n.NormalAngle = i(497)),
(n.NormalX = i(1233)),
(n.NormalY = i(1234)),
(n.Offset = i(1235)),
(n.PerpSlope = i(1236)),
(n.Random = i(173)),
(n.ReflectAngle = i(1237)),
(n.Rotate = i(1238)),
(n.RotateAroundPoint = i(1239)),
(n.RotateAroundXY = i(236)),
(n.SetToAngle = i(1240)),
(n.Slope = i(1241)),
(n.Width = i(1242)),
(t.exports = n);
},
function (t, e) {
t.exports = function (t, e, i) {
var n = e - (t.x1 + t.x2) / 2,
s = i - (t.y1 + t.y2) / 2;
return (t.x1 += n), (t.y1 += s), (t.x2 += n), (t.y2 += s), t;
};
},
function (t, e, i) {
var n = i(47);
t.exports = function (t) {
return new n(t.x1, t.y1, t.x2, t.y2);
};
},
function (t, e) {
t.exports = function (t, e) {
return e.setTo(t.x1, t.y1, t.x2, t.y2);
};
},
function (t, e) {
t.exports = function (t, e) {
return t.x1 === e.x1 && t.y1 === e.y1 && t.x2 === e.x2 && t.y2 === e.y2;
};
},
function (t, e, i) {
var o = i(67);
t.exports = function (t, e, i) {
void 0 === i && (i = e);
var n = o(t),
s = t.x2 - t.x1,
r = t.y2 - t.y1;
return e && ((t.x1 = t.x1 - (s / n) * e), (t.y1 = t.y1 - (r / n) * e)), i && ((t.x2 = t.x2 + (s / n) * i), (t.y2 = t.y2 + (r / n) * i)), t;
};
},
function (t, e, i) {
var m = i(352),
x = i(80),
b = i(4);
t.exports = function (t, e, i, n, s) {
void 0 === n && (n = 0), void 0 === s && (s = []);
var r,
o = [],
a = t.x1,
h = t.y1,
l = t.x2 - a,
u = t.y2 - h,
c = x(e, s),
d = i - 1;
for (g = 0; g < d; g++) (r = c(g / d)), o.push(new b(a + l * r, h + u * r));
if (((r = c(1)), o.push(new b(a + l * r, h + u * r)), 0 < n)) {
for (var f = o[0], p = [f], g = 1; g < o.length - 1; g++) {
var v = o[g];
m(f, v) >= n && (p.push(v), (f = v));
}
var y = o[o.length - 1];
return m(f, y) < n && p.pop(), p.push(y), p;
}
return o;
};
},
function (t, e, i) {
var n = i(4);
t.exports = function (t, e) {
return void 0 === e && (e = new n()), (e.x = (t.x1 + t.x2) / 2), (e.y = (t.y1 + t.y2) / 2), e;
};
},
function (t, e, i) {
var l = i(4);
t.exports = function (t, e, i) {
void 0 === i && (i = new l());
var n = t.x1,
s = t.y1,
r = t.x2,
o = t.y2,
a = (r - n) * (r - n) + (o - s) * (o - s);
if (0 == a) return i;
var h = ((e.x - n) * (r - n) + (e.y - s) * (o - s)) / a;
return (i.x = n + h * (r - n)), (i.y = s + h * (o - s)), i;
};
},
function (t, e, i) {
var n = i(14),
s = i(97),
r = i(4);
t.exports = function (t, e) {
void 0 === e && (e = new r());
var i = s(t) - n.TAU;
return (e.x = Math.cos(i)), (e.y = Math.sin(i)), e;
};
},
function (t, e) {
t.exports = function (t, e) {
var i = t.x1,
n = t.y1,
s = t.x2,
r = t.y2,
o = (s - i) * (s - i) + (r - n) * (r - n);
if (0 == o) return !1;
var a = ((n - e.y) * (s - i) - (i - e.x) * (r - n)) / o;
return Math.abs(a) * Math.sqrt(o);
};
},
function (t, e) {
t.exports = function (t) {
return Math.abs(t.y1 - t.y2);
};
},
function (t, e, i) {
var n = i(14),
s = i(97);
t.exports = function (t) {
return Math.cos(s(t) - n.TAU);
};
},
function (t, e, i) {
var n = i(14),
s = i(97);
t.exports = function (t) {
return Math.sin(s(t) - n.TAU);
};
},
function (t, e) {
t.exports = function (t, e, i) {
return (t.x1 += e), (t.y1 += i), (t.x2 += e), (t.y2 += i), t;
};
},
function (t, e) {
t.exports = function (t) {
return -(t.x2 - t.x1) / (t.y2 - t.y1);
};
},
function (t, e, i) {
var n = i(97),
s = i(497);
t.exports = function (t, e) {
return 2 * s(e) - Math.PI - n(t);
};
},
function (t, e, i) {
var s = i(236);
t.exports = function (t, e) {
var i = (t.x1 + t.x2) / 2,
n = (t.y1 + t.y2) / 2;
return s(t, i, n, e);
};
},
function (t, e, i) {
var n = i(236);
t.exports = function (t, e, i) {
return n(t, e.x, e.y, i);
};
},
function (t, e) {
t.exports = function (t, e, i, n, s) {
return (t.x1 = e), (t.y1 = i), (t.x2 = e + Math.cos(n) * s), (t.y2 = i + Math.sin(n) * s), t;
};
},
function (t, e) {
t.exports = function (t) {
return (t.y2 - t.y1) / (t.x2 - t.x1);
};
},
function (t, e) {
t.exports = function (t) {
return Math.abs(t.x1 - t.x2);
};
},
function (t, e, i) {
var n = { Face: i(116), GenerateGridVerts: i(1244), GenerateObjVerts: i(480), GenerateVerts: i(479), ParseObj: i(498), ParseObjMaterial: i(499), RotateFace: i(1245), Vertex: i(117) };
t.exports = n;
},
function (t, e, i) {
var rt = i(116),
ot = i(2),
n = i(69),
s = i(39),
at = i(117),
ht = new s(),
lt = new s(),
ut = new n();
t.exports = function (t) {
var e = ot(t, "mesh"),
i = ot(t, "texture", null),
n = ot(t, "frame"),
s = ot(t, "width", 1),
r = ot(t, "height", s),
o = ot(t, "widthSegments", 1),
a = ot(t, "heightSegments", o),
h = ot(t, "x", 0),
l = ot(t, "y", 0),
u = ot(t, "z", 0),
c = ot(t, "rotateX", 0),
d = ot(t, "rotateY", 0),
f = ot(t, "rotateZ", 0),
p = ot(t, "zIsUp", !0),
g = ot(t, "isOrtho", !!e && e.dirtyCache[11]),
v = ot(t, "colors", [16777215]),
y = ot(t, "alphas", [1]),
m = ot(t, "tile", !1),
x = ot(t, "flipY", !1),
b = ot(t, "width", null),
w = { faces: [], verts: [] };
if ((ht.set(h, l, u), lt.set(c, d, f), ut.fromRotationXYTranslation(lt, ht, p), !i && e)) i = e.texture;
else {
if (!e || "string" != typeof i) return w;
i = e.scene.sys.textures.get(i);
}
var T = i.get(n);
!b && g && i && e && ((s = T.width / e.height), (r = T.height / e.height));
var S = s / 2,
_ = r / 2,
E = Math.floor(o),
P = Math.floor(a),
A = E + 1,
M = P + 1,
C = s / E,
O = r / P,
k = [],
R = [],
L = 0,
I = 1,
D = 0,
F = 1;
T && ((L = T.u0), (I = T.u1), (F = x ? ((D = T.v1), T.v0) : ((D = T.v0), T.v1)));
for (var B = I - L, N = F - D, U = 0; U < M; U++)
for (var Y = U * O - _, z = 0; z < A; z++) {
var X = z * C - S;
R.push(X, -Y);
var V = L + (z / E) * B,
G = D + (U / P) * N;
k.push(V, G);
}
Array.isArray(v) || (v = [v]), Array.isArray(y) || (y = [y]);
var j = 0,
H = 0;
for (U = 0; U < P; U++)
for (z = 0; z < E; z++) {
var W = 2 * (z + A * U),
K = 2 * (z + A * (U + 1)),
q = 2 * (z + 1 + A * (U + 1)),
Z = 2 * (z + 1 + A * U),
J = v[H],
Q = y[j],
$ = new at(R[W], R[1 + W], 0, k[W], k[1 + W], J, Q).transformMat4(ut),
tt = new at(R[K], R[1 + K], 0, k[K], k[1 + K], J, Q).transformMat4(ut),
et = new at(R[Z], R[1 + Z], 0, k[Z], k[1 + Z], J, Q).transformMat4(ut),
it = new at(R[K], R[1 + K], 0, k[K], k[1 + K], J, Q).transformMat4(ut),
nt = new at(R[q], R[1 + q], 0, k[q], k[1 + q], J, Q).transformMat4(ut),
st = new at(R[Z], R[1 + Z], 0, k[Z], k[1 + Z], J, Q).transformMat4(ut);
m && ($.setUVs(L, F), tt.setUVs(L, D), et.setUVs(I, F), it.setUVs(L, D), nt.setUVs(I, D), st.setUVs(I, F)),
++H === v.length && (H = 0),
++j === y.length && (j = 0),
w.verts.push($, tt, et, it, nt, st),
w.faces.push(new rt($, tt, et), new rt(it, nt, st));
}
return e && ((e.faces = e.faces.concat(w.faces)), (e.vertices = e.vertices.concat(w.verts))), w;
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
var s, r, o;
void 0 === i && void 0 === n && ((r = (s = t.getInCenter()).x), (o = s.y));
var a = Math.cos(e),
h = Math.sin(e),
l = t.vertex1,
u = t.vertex2,
c = t.vertex3,
d = l.x - r,
f = l.y - o;
l.set(d * a - f * h + r, d * h + f * a + o), (d = u.x - r), (f = u.y - o), u.set(d * a - f * h + r, d * h + f * a + o), (d = c.x - r), (f = c.y - o), c.set(d * a - f * h + r, d * h + f * a + o);
};
},
function (t, e, i) {
var n = i(4);
(n.Ceil = i(1247)),
(n.Clone = i(1248)),
(n.CopyFrom = i(1249)),
(n.Equals = i(1250)),
(n.Floor = i(1251)),
(n.GetCentroid = i(1252)),
(n.GetMagnitude = i(500)),
(n.GetMagnitudeSq = i(501)),
(n.GetRectangleFromPoints = i(1253)),
(n.Interpolate = i(1254)),
(n.Invert = i(1255)),
(n.Negative = i(1256)),
(n.Project = i(1257)),
(n.ProjectUnit = i(1258)),
(n.SetMagnitude = i(1259)),
(t.exports = n);
},
function (t, e) {
t.exports = function (t) {
return t.setTo(Math.ceil(t.x), Math.ceil(t.y));
};
},
function (t, e, i) {
var n = i(4);
t.exports = function (t) {
return new n(t.x, t.y);
};
},
function (t, e) {
t.exports = function (t, e) {
return e.setTo(t.x, t.y);
};
},
function (t, e) {
t.exports = function (t, e) {
return t.x === e.x && t.y === e.y;
};
},
function (t, e) {
t.exports = function (t) {
return t.setTo(Math.floor(t.x), Math.floor(t.y));
};
},
function (t, e, i) {
var s = i(4);
t.exports = function (t, e) {
if ((void 0 === e && (e = new s()), !Array.isArray(t))) throw new Error("GetCentroid points argument must be an array");
var i = t.length;
if (i < 1) throw new Error("GetCentroid points array must not be empty");
if (1 === i) (e.x = t[0].x), (e.y = t[0].y);
else {
for (var n = 0; n < i; n++) (e.x += t[n].x), (e.y += t[n].y);
(e.x /= i), (e.y /= i);
}
return e;
};
},
function (t, e, i) {
var h = i(10);
t.exports = function (t, e) {
void 0 === e && (e = new h());
for (var i = Number.NEGATIVE_INFINITY, n = Number.POSITIVE_INFINITY, s = Number.NEGATIVE_INFINITY, r = Number.POSITIVE_INFINITY, o = 0; o < t.length; o++) {
var a = t[o];
a.x > i && (i = a.x), a.x < n && (n = a.x), a.y > s && (s = a.y), a.y < r && (r = a.y);
}
return (e.x = n), (e.y = r), (e.width = i - n), (e.height = s - r), e;
};
},
function (t, e, i) {
var s = i(4);
t.exports = function (t, e, i, n) {
return void 0 === i && (i = 0), void 0 === n && (n = new s()), (n.x = t.x + (e.x - t.x) * i), (n.y = t.y + (e.y - t.y) * i), n;
};
},
function (t, e) {
t.exports = function (t) {
return t.setTo(t.y, t.x);
};
},
function (t, e, i) {
var n = i(4);
t.exports = function (t, e) {
return void 0 === e && (e = new n()), e.setTo(-t.x, -t.y);
};
},
function (t, e, i) {
var s = i(4),
r = i(501);
t.exports = function (t, e, i) {
void 0 === i && (i = new s());
var n = (t.x * e.x + t.y * e.y) / r(e);
return 0 != n && ((i.x = n * e.x), (i.y = n * e.y)), i;
};
},
function (t, e, i) {
var s = i(4);
t.exports = function (t, e, i) {
void 0 === i && (i = new s());
var n = t.x * e.x + t.y * e.y;
return 0 != n && ((i.x = n * e.x), (i.y = n * e.y)), i;
};
},
function (t, e, i) {
var n = i(500);
t.exports = function (t, e) {
var i;
return (0 === t.x && 0 === t.y) || ((i = n(t)), (t.x /= i), (t.y /= i)), (t.x *= e), (t.y *= e), t;
};
},
function (t, e, i) {
var n = i(227);
(n.Clone = i(1261)),
(n.Contains = i(228)),
(n.ContainsPoint = i(1262)),
(n.Earcut = i(59)),
(n.GetAABB = i(469)),
(n.GetNumberArray = i(1263)),
(n.GetPoints = i(470)),
(n.Perimeter = i(471)),
(n.Reverse = i(1264)),
(n.Simplify = i(1265)),
(n.Smooth = i(472)),
(n.Translate = i(1266)),
(t.exports = n);
},
function (t, e, i) {
var n = i(227);
t.exports = function (t) {
return new n(t.points);
};
},
function (t, e, i) {
var n = i(228);
t.exports = function (t, e) {
return n(t, e.x, e.y);
};
},
function (t, e) {
t.exports = function (t, e) {
void 0 === e && (e = []);
for (var i = 0; i < t.points.length; i++) e.push(t.points[i].x), e.push(t.points[i].y);
return e;
};
},
function (t, e) {
t.exports = function (t) {
return t.points.reverse(), t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
void 0 === e && (e = 1), void 0 === i && (i = !1);
var n,
s,
r,
o,
a,
h = t.points;
return (
2 < h.length &&
((n = e * e),
i ||
(h = (function (t, e) {
for (var i, n, s, r, o, a = t[0], h = [a], l = 1, u = t.length; l < u; l++) (s = a), e < (r = (n = i = t[l]).x - s.x) * r + (o = n.y - s.y) * o && (h.push(i), (a = i));
return a !== i && h.push(i), h;
})(h, n)),
t.setTo(
((r = n),
(o = (s = h).length - 1),
(a = [s[0]]),
(function t(e, i, n, s, r) {
for (var o, a, h, l, u, c, d, f, p, g = s, v = i + 1; v < n; v++) {
var y =
((a = e[v]),
(h = e[i]),
(l = e[n]),
(p = f = d = c = u = void 0),
(c = h.x),
(d = h.y),
(f = l.x - c),
(p = l.y - d),
(0 === f && 0 === p) || (1 < (u = ((a.x - c) * f + (a.y - d) * p) / (f * f + p * p)) ? ((c = l.x), (d = l.y)) : 0 < u && ((c += f * u), (d += p * u))),
(f = a.x - c) * f + (p = a.y - d) * p);
g < y && ((o = v), (g = y));
}
s < g && (1 < o - i && t(e, i, o, s, r), r.push(e[o]), 1 < n - o && t(e, o, n, s, r));
})(s, 0, o, r, a),
a.push(s[o]),
a)
)),
t
);
};
},
function (t, e) {
t.exports = function (t, e, i) {
for (var n = t.points, s = 0; s < n.length; s++) (n[s].x += e), (n[s].y += i);
return t;
};
},
function (t, e) {
t.exports = function (t) {
return t.width * t.height;
};
},
function (t, e) {
t.exports = function (t) {
return (t.x = Math.ceil(t.x)), (t.y = Math.ceil(t.y)), t;
};
},
function (t, e) {
t.exports = function (t) {
return (t.x = Math.ceil(t.x)), (t.y = Math.ceil(t.y)), (t.width = Math.ceil(t.width)), (t.height = Math.ceil(t.height)), t;
};
},
function (t, e, i) {
var n = i(10);
t.exports = function (t) {
return new n(t.x, t.y, t.width, t.height);
};
},
function (t, e, i) {
var n = i(57);
t.exports = function (t, e) {
return n(t, e.x, e.y);
};
},
function (t, e) {
t.exports = function (t, e) {
return e.setTo(t.x, t.y, t.width, t.height);
};
},
function (t, e) {
t.exports = function (t, e) {
return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
};
},
function (t, e, i) {
var n = i(237);
t.exports = function (t, e) {
var i = n(t);
return i < n(e) ? t.setSize(e.height * i, e.height) : t.setSize(e.width, e.width / i), t.setPosition(e.centerX - t.width / 2, e.centerY - t.height / 2);
};
},
function (t, e, i) {
var n = i(237);
t.exports = function (t, e) {
var i = n(t);
return i > n(e) ? t.setSize(e.height * i, e.height) : t.setSize(e.width, e.width / i), t.setPosition(e.centerX - t.width / 2, e.centerY - t.height / 2);
};
},
function (t, e) {
t.exports = function (t) {
return (t.x = Math.floor(t.x)), (t.y = Math.floor(t.y)), t;
};
},
function (t, e) {
t.exports = function (t) {
return (t.x = Math.floor(t.x)), (t.y = Math.floor(t.y)), (t.width = Math.floor(t.width)), (t.height = Math.floor(t.height)), t;
};
},
function (t, e, i) {
var r = i(10);
t.exports = function (t, e, i, n, s) {
return void 0 === s && (s = new r()), s.setTo(Math.min(t, i), Math.min(e, n), Math.abs(t - i), Math.abs(e - n));
};
},
function (t, e, i) {
var n = i(4);
t.exports = function (t, e) {
return void 0 === e && (e = new n()), (e.x = t.centerX), (e.y = t.centerY), e;
};
},
function (t, e, i) {
var n = i(4);
t.exports = function (t, e) {
return void 0 === e && (e = new n()), (e.x = t.width), (e.y = t.height), e;
};
},
function (t, e, i) {
var r = i(190);
t.exports = function (t, e, i) {
var n = t.centerX,
s = t.centerY;
return t.setSize(t.width + 2 * e, t.height + 2 * i), r(t, n, s);
};
},
function (t, e, i) {
var n = i(10),
s = i(152);
t.exports = function (t, e, i) {
return (
void 0 === i && (i = new n()),
s(t, e) ? ((i.x = Math.max(t.x, e.x)), (i.y = Math.max(t.y, e.y)), (i.width = Math.min(t.right, e.right) - i.x), (i.height = Math.min(t.bottom, e.bottom) - i.y)) : i.setEmpty(),
i
);
};
},
function (t, e) {
t.exports = function (t, e) {
for (var i = t.x, n = t.right, s = t.y, r = t.bottom, o = 0; o < e.length; o++) (i = Math.min(i, e[o].x)), (n = Math.max(n, e[o].x)), (s = Math.min(s, e[o].y)), (r = Math.max(r, e[o].y));
return (t.x = i), (t.y = s), (t.width = n - i), (t.height = r - s), t;
};
},
function (t, e) {
t.exports = function (t, e) {
var i = Math.min(t.x, e.x),
n = Math.max(t.right, e.right);
(t.x = i), (t.width = n - i);
var s = Math.min(t.y, e.y),
r = Math.max(t.bottom, e.bottom);
return (t.y = s), (t.height = r - s), t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
var n = Math.min(t.x, e),
s = Math.max(t.right, e);
(t.x = n), (t.width = s - n);
var r = Math.min(t.y, i),
o = Math.max(t.bottom, i);
return (t.y = r), (t.height = o - r), t;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return (t.x += e), (t.y += i), t;
};
},
function (t, e) {
t.exports = function (t, e) {
return (t.x += e.x), (t.y += e.y), t;
};
},
function (t, e) {
t.exports = function (t, e) {
return t.x < e.right && t.right > e.x && t.y < e.bottom && t.bottom > e.y;
};
},
function (t, e, i) {
var a = i(4),
h = i(36);
t.exports = function (t, e, i) {
void 0 === i && (i = new a()), (e = h(e));
var n = Math.sin(e),
s = Math.cos(e),
r = 0 < s ? t.width / 2 : t.width / -2,
o = 0 < n ? t.height / 2 : t.height / -2;
return Math.abs(r * n) < Math.abs(o * s) ? (o = (r * n) / s) : (r = (o * s) / n), (i.x = r + t.centerX), (i.y = o + t.centerY), i;
};
},
function (t, e, i) {
var n = i(195),
s = i(503),
r = i(4);
t.exports = function (t, e, i) {
if ((void 0 === i && (i = new r()), s(t, e)))
switch (n(0, 3)) {
case 0:
(i.x = t.x + Math.random() * (e.right - t.x)), (i.y = t.y + Math.random() * (e.top - t.y));
break;
case 1:
(i.x = e.x + Math.random() * (t.right - e.x)), (i.y = e.bottom + Math.random() * (t.bottom - e.bottom));
break;
case 2:
(i.x = t.x + Math.random() * (e.x - t.x)), (i.y = e.y + Math.random() * (t.bottom - e.y));
break;
case 3:
(i.x = e.right + Math.random() * (t.right - e.right)), (i.y = t.y + Math.random() * (e.bottom - t.y));
}
return i;
};
},
function (t, e) {
t.exports = function (t, e) {
return t.width === e.width && t.height === e.height;
};
},
function (t, e) {
t.exports = function (t, e, i) {
return void 0 === i && (i = e), (t.width *= e), (t.height *= i), t;
};
},
function (t, e, i) {
var n = i(82);
(n.Area = i(1294)),
(n.BuildEquilateral = i(1295)),
(n.BuildFromPolygon = i(1296)),
(n.BuildRight = i(1297)),
(n.CenterOn = i(1298)),
(n.Centroid = i(504)),
(n.CircumCenter = i(1299)),
(n.CircumCircle = i(1300)),
(n.Clone = i(1301)),
(n.Contains = i(115)),
(n.ContainsArray = i(235)),
(n.ContainsPoint = i(1302)),
(n.CopyFrom = i(1303)),
(n.Decompose = i(495)),
(n.Equals = i(1304)),
(n.GetPoint = i(476)),
(n.GetPoints = i(477)),
(n.InCenter = i(506)),
(n.Perimeter = i(1305)),
(n.Offset = i(505)),
(n.Random = i(181)),
(n.Rotate = i(1306)),
(n.RotateAroundPoint = i(1307)),
(n.RotateAroundXY = i(238)),
(t.exports = n);
},
function (t, e) {
t.exports = function (t) {
var e = t.x1,
i = t.y1,
n = t.x2,
s = t.y2,
r = t.x3,
o = t.y3;
return Math.abs(((r - e) * (s - i) - (n - e) * (o - i)) / 2);
};
},
function (t, e, i) {
var s = i(82);
t.exports = function (t, e, i) {
var n = i * (Math.sqrt(3) / 2);
return new s(t, e, t + i / 2, e + n, t - i / 2, e + n);
};
},
function (t, e, i) {
var v = i(59),
y = i(82);
t.exports = function (t, e, i, n, s) {
void 0 === e && (e = null), void 0 === i && (i = 1), void 0 === n && (n = 1), void 0 === s && (s = []);
for (var r, o, a, h, l, u, c, d, f, p = v(t, e), g = 0; g < p.length; g += 3)
(r = p[g]),
(o = p[g + 1]),
(a = p[g + 2]),
(h = t[2 * r] * i),
(l = t[2 * r + 1] * n),
(u = t[2 * o] * i),
(c = t[2 * o + 1] * n),
(d = t[2 * a] * i),
(f = t[2 * a + 1] * n),
s.push(new y(h, l, u, c, d, f));
return s;
};
},
function (t, e, i) {
var s = i(82);
t.exports = function (t, e, i, n) {
return void 0 === n && (n = i), new s(t, e, t, e - n, t + i, e);
};
},
function (t, e, i) {
var a = i(504),
h = i(505);
t.exports = function (t, e, i, n) {
void 0 === n && (n = a);
var s = n(t),
r = e - s.x,
o = i - s.y;
return h(t, r, o);
};
},
function (t, e, i) {
var c = i(3);
t.exports = function (t, e) {
void 0 === e && (e = new c());
var i = t.x3,
n = t.y3,
s = t.x1 - i,
r = t.y1 - n,
o = t.x2 - i,
a = t.y2 - n,
h = 2 * (s * a - r * o),
l = r * (o * o + a * a) - (s * s + r * r) * a,
u = s * (o * o + a * a) - (s * s + r * r) * o;
return (e.x = i - l / h), (e.y = n + u / h), e;
};
},
function (t, e, i) {
var x = i(65);
t.exports = function (t, e) {
void 0 === e && (e = new x());
var i,
n,
s,
r,
o = t.x1,
a = t.y1,
h = t.x2,
l = t.y2,
u = t.x3,
c = t.y3,
d = h - o,
f = l - a,
p = u - o,
g = c - a,
v = d * (o + h) + f * (a + l),
y = p * (o + u) + g * (a + c),
m = 2 * (d * (c - l) - f * (u - h));
return (
Math.abs(m) < 1e-6
? ((i = Math.min(o, h, u)), (n = Math.min(a, l, c)), (s = 0.5 * (Math.max(o, h, u) - i)), (r = 0.5 * (Math.max(a, l, c) - n)), (e.x = i + s), (e.y = n + r))
: ((e.x = (g * v - f * y) / m), (e.y = (d * y - p * v) / m), (s = e.x - o), (r = e.y - a)),
(e.radius = Math.sqrt(s * s + r * r)),
e
);
};
},
function (t, e, i) {
var n = i(82);
t.exports = function (t) {
return new n(t.x1, t.y1, t.x2, t.y2, t.x3, t.y3);
};
},
function (t, e, i) {
var n = i(115);
t.exports = function (t, e) {
return n(t, e.x, e.y);
};
},
function (t, e) {
t.exports = function (t, e) {
return e.setTo(t.x1, t.y1, t.x2, t.y2, t.x3, t.y3);
};
},
function (t, e) {
t.exports = function (t, e) {
return t.x1 === e.x1 && t.y1 === e.y1 && t.x2 === e.x2 && t.y2 === e.y2 && t.x3 === e.x3 && t.y3 === e.y3;
};
},
function (t, e, i) {
var s = i(67);
t.exports = function (t) {
var e = t.getLineA(),
i = t.getLineB(),
n = t.getLineC();
return s(e) + s(i) + s(n);
};
},
function (t, e, i) {
var n = i(238),
s = i(506);
t.exports = function (t, e) {
var i = s(t);
return n(t, i.x, i.y, e);
};
},
function (t, e, i) {
var n = i(238);
t.exports = function (t, e, i) {
return n(t, e.x, e.y, i);
};
},
function (t, e, i) {
var n = i(203),
s = i(17)(
!1,
(s = {
CreatePixelPerfectHandler: i(507),
CreateInteractiveObject: i(508),
Events: i(51),
Gamepad: i(1309),
InputManager: i(409),
InputPlugin: i(1321),
InputPluginCache: i(153),
Keyboard: i(1322),
Mouse: i(1336),
Pointer: i(412),
Touch: i(1337),
}),
n
);
t.exports = s;
},
function (t, e, i) {
t.exports = { Axis: i(509), Button: i(510), Events: i(239), Gamepad: i(511), GamepadPlugin: i(1316), Configs: i(1317) };
},
function (t, e) {
t.exports = "down";
},
function (t, e) {
t.exports = "up";
},
function (t, e) {
t.exports = "connected";
},
function (t, e) {
t.exports = "disconnected";
},
function (t, e) {
t.exports = "down";
},
function (t, e) {
t.exports = "up";
},
function (t, e, i) {
var n = i(0),
s = i(9),
r = i(239),
h = i(511),
o = i(6),
a = i(153),
l = i(51),
u = new n({
Extends: s,
initialize: function (t) {
s.call(this),
(this.scene = t.scene),
(this.settings = this.scene.sys.settings),
(this.sceneInputPlugin = t),
(this.enabled = !0),
this.target,
(this.gamepads = []),
(this.queue = []),
this.onGamepadHandler,
this._pad1,
this._pad2,
this._pad3,
this._pad4,
t.pluginEvents.once(l.BOOT, this.boot, this),
t.pluginEvents.on(l.START, this.start, this);
},
boot: function () {
var t = this.scene.sys.game,
e = this.settings.input,
i = t.config;
(this.enabled = o(e, "gamepad", i.inputGamepad) && t.device.input.gamepads),
(this.target = o(e, "gamepad.target", i.inputGamepadEventTarget)),
this.sceneInputPlugin.pluginEvents.once(l.DESTROY, this.destroy, this);
},
start: function () {
this.enabled && (this.startListeners(), this.refreshPads()), this.sceneInputPlugin.pluginEvents.once(l.SHUTDOWN, this.shutdown, this);
},
isActive: function () {
return this.enabled && this.scene.sys.isActive();
},
startListeners: function () {
function t(t) {
!t.defaultPrevented && e.isActive() && (e.refreshPads(), e.queue.push(t));
}
var e = this,
i = this.target;
(this.onGamepadHandler = t), i.addEventListener("gamepadconnected", t, !1), i.addEventListener("gamepaddisconnected", t, !1), this.sceneInputPlugin.pluginEvents.on(l.UPDATE, this.update, this);
},
stopListeners: function () {
this.target.removeEventListener("gamepadconnected", this.onGamepadHandler),
this.target.removeEventListener("gamepaddisconnected", this.onGamepadHandler),
this.sceneInputPlugin.pluginEvents.off(l.UPDATE, this.update);
for (var t = 0; t < this.gamepads.length; t++) this.gamepads[t].removeAllListeners();
},
disconnectAll: function () {
for (var t = 0; t < this.gamepads.length; t++) this.gamepads[t].pad.connected = !1;
},
refreshPads: function () {
var t = navigator.getGamepads();
if (t)
for (var e = this.gamepads, i = 0; i < t.length; i++) {
var n,
s,
r,
o,
a = t[i];
a &&
((n = a.id),
(r = e[(s = a.index)])
? r.id !== n
? (r.destroy(), (e[s] = new h(this, a)))
: r.update(a)
: ((o = new h(this, a)), (e[s] = o), this._pad1 ? (this._pad2 ? (this._pad3 ? this._pad4 || (this._pad4 = o) : (this._pad3 = o)) : (this._pad2 = o)) : (this._pad1 = o)));
}
else this.disconnectAll();
},
getAll: function () {
for (var t = [], e = this.gamepads, i = 0; i < e.length; i++) e[i] && t.push(e[i]);
return t;
},
getPad: function (t) {
for (var e = this.gamepads, i = 0; i < e.length; i++) if (e[i] && e[i].index === t) return e[i];
},
update: function () {
if (this.enabled) {
this.refreshPads();
var t = this.queue.length;
if (0 !== t)
for (var e = this.queue.splice(0, t), i = 0; i < t; i++) {
var n = e[i],
s = this.getPad(n.gamepad.index);
"gamepadconnected" === n.type ? this.emit(r.CONNECTED, s, n) : "gamepaddisconnected" === n.type && this.emit(r.DISCONNECTED, s, n);
}
}
},
shutdown: function () {
this.stopListeners(), this.removeAllListeners();
},
destroy: function () {
this.shutdown();
for (var t = 0; t < this.gamepads.length; t++) this.gamepads[t] && this.gamepads[t].destroy();
(this.gamepads = []), (this.scene = null), (this.settings = null), (this.sceneInputPlugin = null), (this.target = null);
},
total: {
get: function () {
return this.gamepads.length;
},
},
pad1: {
get: function () {
return this._pad1;
},
},
pad2: {
get: function () {
return this._pad2;
},
},
pad3: {
get: function () {
return this._pad3;
},
},
pad4: {
get: function () {
return this._pad4;
},
},
});
a.register("GamepadPlugin", u, "gamepad", "gamepad", "inputGamepad"), (t.exports = u);
},
function (t, e, i) {
t.exports = { DUALSHOCK_4: i(1318), SNES_USB: i(1319), XBOX_360: i(1320) };
},
function (t, e) {
t.exports = {
UP: 12,
DOWN: 13,
LEFT: 14,
RIGHT: 15,
SHARE: 8,
OPTIONS: 9,
PS: 16,
TOUCHBAR: 17,
X: 0,
CIRCLE: 1,
SQUARE: 2,
TRIANGLE: 3,
L1: 4,
R1: 5,
L2: 6,
R2: 7,
L3: 10,
R3: 11,
LEFT_STICK_H: 0,
LEFT_STICK_V: 1,
RIGHT_STICK_H: 2,
RIGHT_STICK_V: 3,
};
},
function (t, e) {
t.exports = { UP: 12, DOWN: 13, LEFT: 14, RIGHT: 15, SELECT: 8, START: 9, B: 0, A: 1, Y: 2, X: 3, LEFT_SHOULDER: 4, RIGHT_SHOULDER: 5 };
},
function (t, e) {
t.exports = {
UP: 12,
DOWN: 13,
LEFT: 14,
RIGHT: 15,
MENU: 16,
A: 0,
B: 1,
X: 2,
Y: 3,
LB: 4,
RB: 5,
LT: 6,
RT: 7,
BACK: 8,
START: 9,
LS: 10,
RS: 11,
LEFT_STICK_H: 0,
LEFT_STICK_V: 1,
RIGHT_STICK_H: 2,
RIGHT_STICK_V: 3,
};
},
function (t, e, i) {
var o = i(65),
a = i(66),
n = i(0),
h = i(203),
p = i(508),
s = i(507),
r = i(50),
l = i(111),
u = i(112),
g = i(51),
c = i(9),
v = i(2),
d = i(56),
f = i(153),
y = i(7),
m = i(24),
x = i(10),
b = i(57),
w = i(20),
T = i(82),
S = i(115),
_ = new n({
Extends: c,
initialize: function (t) {
c.call(this),
(this.scene = t),
(this.systems = t.sys),
(this.settings = t.sys.settings),
(this.manager = t.sys.game.input),
(this.pluginEvents = new c()),
(this.enabled = !0),
this.displayList,
this.cameras,
f.install(this),
(this.mouse = this.manager.mouse),
(this.topOnly = !0),
(this.pollRate = -1),
(this._pollTimer = 0);
var e = { cancelled: !1 };
(this._eventContainer = {
stopPropagation: function () {
e.cancelled = !0;
},
}),
(this._eventData = e),
(this.dragDistanceThreshold = 0),
(this.dragTimeThreshold = 0),
(this._temp = []),
(this._tempZones = []),
(this._list = []),
(this._pendingInsertion = []),
(this._pendingRemoval = []),
(this._draggable = []),
(this._drag = { 0: [], 1: [], 2: [], 3: [], 4: [], 5: [], 6: [], 7: [], 8: [], 9: [], 10: [] }),
(this._dragState = []),
(this._over = { 0: [], 1: [], 2: [], 3: [], 4: [], 5: [], 6: [], 7: [], 8: [], 9: [], 10: [] }),
(this._validTypes = ["onDown", "onUp", "onOver", "onOut", "onMove", "onDragStart", "onDrag", "onDragEnd", "onDragEnter", "onDragLeave", "onDragOver", "onDrop"]),
(this._updatedThisFrame = !1),
t.sys.events.once(w.BOOT, this.boot, this),
t.sys.events.on(w.START, this.start, this);
},
boot: function () {
(this.cameras = this.systems.cameras), (this.displayList = this.systems.displayList), this.systems.events.once(w.DESTROY, this.destroy, this), this.pluginEvents.emit(g.BOOT);
},
start: function () {
var t = this.systems.events;
t.on(w.TRANSITION_START, this.transitionIn, this),
t.on(w.TRANSITION_OUT, this.transitionOut, this),
t.on(w.TRANSITION_COMPLETE, this.transitionComplete, this),
t.on(w.PRE_UPDATE, this.preUpdate, this),
t.once(w.SHUTDOWN, this.shutdown, this),
this.manager.events.on(g.GAME_OUT, this.onGameOut, this),
this.manager.events.on(g.GAME_OVER, this.onGameOver, this),
(this.enabled = !0),
(this._dragState = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]),
this.pluginEvents.emit(g.START);
},
onGameOver: function (t) {
this.isActive() && this.emit(g.GAME_OVER, t.timeStamp, t);
},
onGameOut: function (t) {
this.isActive() && this.emit(g.GAME_OUT, t.timeStamp, t);
},
preUpdate: function () {
this.pluginEvents.emit(g.PRE_UPDATE);
var t = this._pendingRemoval,
e = this._pendingInsertion,
i = t.length,
n = e.length;
if (0 !== i || 0 !== n) {
for (var s = this._list, r = 0; r < i; r++) {
var o = t[r],
a = s.indexOf(o);
-1 < a && (s.splice(a, 1), this.clear(o, !0));
}
(t.length = 0), (this._pendingRemoval.length = 0), (this._list = s.concat(e.splice(0)));
}
},
isActive: function () {
return this.enabled && this.scene.sys.isActive();
},
updatePoll: function (t, e) {
if (!this.isActive()) return !1;
if ((this.pluginEvents.emit(g.UPDATE, t, e), this._updatedThisFrame)) return (this._updatedThisFrame = !1);
for (var i = this.manager, n = i.pointers, s = i.pointersTotal, r = 0; r < s; r++) n[r].updateMotion();
if (0 === this._list.length) return !1;
var o = this.pollRate;
if (-1 === o) return !1;
if (0 < o) {
if (((this._pollTimer -= e), !(this._pollTimer < 0))) return !1;
this._pollTimer = this.pollRate;
}
var a = !1;
for (r = 0; r < s; r++) {
var h = 0,
l = n[r];
(this._tempZones = []),
(this._temp = this.hitTestPointer(l)),
this.sortGameObjects(this._temp, l),
this.sortDropZones(this._tempZones),
this.topOnly && (this._temp.length && this._temp.splice(1), this._tempZones.length && this._tempZones.splice(1)),
(h += this.processOverOutEvents(l)),
2 === this.getDragState(l) && this.processDragThresholdEvent(l, t),
0 < h && (a = !0);
}
return a;
},
update: function (t, e) {
if (!this.isActive()) return !1;
for (var i = e.length, n = !1, s = 0; s < i; s++) {
var r = 0,
o = e[s];
switch (
((this._tempZones = []),
(this._temp = this.hitTestPointer(o)),
this.sortGameObjects(this._temp, o),
this.sortDropZones(this._tempZones),
this.topOnly && (this._temp.length && this._temp.splice(1), this._tempZones.length && this._tempZones.splice(1)),
t)
) {
case h.MOUSE_DOWN:
(r += this.processDragDownEvent(o)), (r += this.processDownEvents(o)), (r += this.processOverOutEvents(o));
break;
case h.MOUSE_UP:
(r += this.processDragUpEvent(o)), (r += this.processUpEvents(o)), (r += this.processOverOutEvents(o));
break;
case h.TOUCH_START:
(r += this.processDragDownEvent(o)), (r += this.processDownEvents(o)), (r += this.processOverEvents(o));
break;
case h.TOUCH_END:
case h.TOUCH_CANCEL:
(r += this.processDragUpEvent(o)), (r += this.processUpEvents(o)), (r += this.processOutEvents(o));
break;
case h.MOUSE_MOVE:
case h.TOUCH_MOVE:
(r += this.processDragMoveEvent(o)), (r += this.processMoveEvents(o)), (r += this.processOverOutEvents(o));
break;
case h.MOUSE_WHEEL:
r += this.processWheelEvent(o);
}
0 < r && (n = !0);
}
return (this._updatedThisFrame = !0), n;
},
clear: function (t, e) {
void 0 === e && (e = !1);
var i = t.input;
if (i) {
e || this.queueForRemoval(t), (i.gameObject = void 0), (i.target = void 0), (i.hitArea = void 0), (i.hitAreaCallback = void 0), (i.callbackContext = void 0), (t.input = null);
var n = this._draggable.indexOf(t);
return (
-1 < n && this._draggable.splice(n, 1),
-1 < (n = this._drag[0].indexOf(t)) && this._drag[0].splice(n, 1),
-1 < (n = this._over[0].indexOf(t)) && (this._over[0].splice(n, 1), this.manager.resetCursor(i)),
t
);
}
},
disable: function (t) {
t.input.enabled = !1;
},
enable: function (t, e, i, n) {
return void 0 === n && (n = !1), t.input ? (t.input.enabled = !0) : this.setHitArea(t, e, i), t.input && n && !t.input.dropZone && (t.input.dropZone = n), this;
},
hitTestPointer: function (t) {
for (var e = this.cameras.getCamerasBelowPointer(t), i = 0; i < e.length; i++) {
for (var n = e[i], s = this.manager.hitTest(t, this._list, n), r = 0; r < s.length; r++) {
var o = s[r];
o.input.dropZone && this._tempZones.push(o);
}
if (0 < s.length) return (t.camera = n), s;
}
return (t.camera = e[0]), [];
},
processDownEvents: function (t) {
for (var e = 0, i = this._temp, n = this._eventData, s = this._eventContainer, r = (n.cancelled = !1), o = 0; o < i.length; o++) {
var a = i[o];
if (a.input) {
if ((e++, a.emit(g.GAMEOBJECT_POINTER_DOWN, t, a.input.localX, a.input.localY, s), n.cancelled || !a.input)) {
r = !0;
break;
}
if ((this.emit(g.GAMEOBJECT_DOWN, t, a, s), n.cancelled || !a.input)) {
r = !0;
break;
}
}
}
return !r && this.manager && (t.downElement === this.manager.game.canvas ? this.emit(g.POINTER_DOWN, t, i) : this.emit(g.POINTER_DOWN_OUTSIDE, t)), e;
},
getDragState: function (t) {
return this._dragState[t.id];
},
setDragState: function (t, e) {
this._dragState[t.id] = e;
},
processDragThresholdEvent: function (t, e) {
var i = !1,
n = this.dragTimeThreshold,
s = this.dragDistanceThreshold;
if ((((0 < s && r(t.x, t.y, t.downX, t.downY) >= s) || (0 < n && e >= t.downTime + n)) && (i = !0), i)) return this.setDragState(t, 3), this.processDragStartList(t);
},
processDragStartList: function (t) {
if (3 !== this.getDragState(t)) return 0;
for (var e = this._drag[t.id], i = 0; i < e.length; i++) {
var n = e[i],
s = n.input;
(s.dragState = 2),
(s.dragStartX = n.x),
(s.dragStartY = n.y),
(s.dragStartXGlobal = t.worldX),
(s.dragStartYGlobal = t.worldY),
(s.dragX = s.dragStartXGlobal - s.dragStartX),
(s.dragY = s.dragStartYGlobal - s.dragStartY),
n.emit(g.GAMEOBJECT_DRAG_START, t, s.dragX, s.dragY),
this.emit(g.DRAG_START, t, n);
}
return this.setDragState(t, 4), e.length;
},
processDragDownEvent: function (t) {
var e = this._temp;
if (0 === this._draggable.length || 0 === e.length || !t.primaryDown || 0 !== this.getDragState(t)) return 0;
this.setDragState(t, 1);
for (var i = [], n = 0; n < e.length; n++) {
var s = e[n];
s.input.draggable && 0 === s.input.dragState && i.push(s);
}
return 0 === i.length
? (this.setDragState(t, 0), 0)
: (1 < i.length && (this.sortGameObjects(i, t), this.topOnly && i.splice(1)),
(this._drag[t.id] = i),
0 === this.dragDistanceThreshold && 0 === this.dragTimeThreshold ? (this.setDragState(t, 3), this.processDragStartList(t)) : (this.setDragState(t, 2), 0));
},
processDragMoveEvent: function (t) {
if ((2 === this.getDragState(t) && this.processDragThresholdEvent(t, this.manager.game.loop.now), 4 !== this.getDragState(t))) return 0;
for (var e = this._tempZones, i = this._drag[t.id], n = 0; n < i.length; n++) {
var s,
r,
o,
a,
h,
l,
u,
c,
d = i[n],
f = d.input,
p = f.target;
p
? 0 === (s = e.indexOf(p))
? (d.emit(g.GAMEOBJECT_DRAG_OVER, t, p), this.emit(g.DRAG_OVER, t, d, p))
: 0 < s
? (d.emit(g.GAMEOBJECT_DRAG_LEAVE, t, p), this.emit(g.DRAG_LEAVE, t, d, p), (f.target = e[0]), (p = f.target), d.emit(g.GAMEOBJECT_DRAG_ENTER, t, p), this.emit(g.DRAG_ENTER, t, d, p))
: (d.emit(g.GAMEOBJECT_DRAG_LEAVE, t, p),
this.emit(g.DRAG_LEAVE, t, d, p),
e[0] ? ((f.target = e[0]), (p = f.target), d.emit(g.GAMEOBJECT_DRAG_ENTER, t, p), this.emit(g.DRAG_ENTER, t, d, p)) : (f.target = null))
: !p && e[0] && ((f.target = e[0]), (p = f.target), d.emit(g.GAMEOBJECT_DRAG_ENTER, t, p), this.emit(g.DRAG_ENTER, t, d, p)),
(o = d.parentContainer
? ((a = t.worldX - f.dragStartXGlobal),
(h = t.worldY - f.dragStartYGlobal),
(l = d.getParentRotation()),
(u = a * Math.cos(l) + h * Math.sin(l)),
(c = h * Math.cos(l) - a * Math.sin(l)),
(u *= 1 / d.parentContainer.scaleX),
(c *= 1 / d.parentContainer.scaleY),
(r = u + f.dragStartX),
c + f.dragStartY)
: ((r = t.worldX - f.dragX), t.worldY - f.dragY)),
d.emit(g.GAMEOBJECT_DRAG, t, r, o),
this.emit(g.DRAG, t, d, r, o);
}
return i.length;
},
processDragUpEvent: function (t) {
for (var e = this._drag[t.id], i = 0; i < e.length; i++) {
var n,
s,
r = e[i],
o = r.input;
o &&
2 === o.dragState &&
((o.dragState = 0),
(o.dragX = o.localX - r.displayOriginX),
(o.dragY = o.localY - r.displayOriginY),
(n = !1),
(s = o.target) && (r.emit(g.GAMEOBJECT_DROP, t, s), this.emit(g.DROP, t, r, s), (n = !(o.target = null))),
r.input && (r.emit(g.GAMEOBJECT_DRAG_END, t, o.dragX, o.dragY, n), this.emit(g.DRAG_END, t, r, n)));
}
return this.setDragState(t, 0), e.splice(0), 0;
},
processMoveEvents: function (t) {
for (var e = 0, i = this._temp, n = this._eventData, s = this._eventContainer, r = (n.cancelled = !1), o = 0; o < i.length; o++) {
var a = i[o];
if (a.input) {
if ((e++, a.emit(g.GAMEOBJECT_POINTER_MOVE, t, a.input.localX, a.input.localY, s), n.cancelled || !a.input)) {
r = !0;
break;
}
if ((this.emit(g.GAMEOBJECT_MOVE, t, a, s), n.cancelled || !a.input)) {
r = !0;
break;
}
if (this.topOnly) break;
}
}
return r || this.emit(g.POINTER_MOVE, t, i), e;
},
processWheelEvent: function (t) {
for (var e = 0, i = this._temp, n = this._eventData, s = this._eventContainer, r = (n.cancelled = !1), o = t.deltaX, a = t.deltaY, h = t.deltaZ, l = 0; l < i.length; l++) {
var u = i[l];
if (u.input) {
if ((e++, u.emit(g.GAMEOBJECT_POINTER_WHEEL, t, o, a, h, s), n.cancelled || !u.input)) {
r = !0;
break;
}
if ((this.emit(g.GAMEOBJECT_WHEEL, t, u, o, a, h, s), n.cancelled || !u.input)) {
r = !0;
break;
}
}
}
return r || this.emit(g.POINTER_WHEEL, t, i, o, a, h), e;
},
processOverEvents: function (t) {
var e = this._temp,
i = 0,
n = e.length,
s = [];
if (0 < n) {
for (var r = this.manager, o = this._eventData, a = this._eventContainer, h = (o.cancelled = !1), l = 0; l < n; l++) {
var u = e[l];
if (u.input) {
if ((s.push(u), r.setCursor(u.input), u.emit(g.GAMEOBJECT_POINTER_OVER, t, u.input.localX, u.input.localY, a), i++, o.cancelled || !u.input)) {
h = !0;
break;
}
if ((this.emit(g.GAMEOBJECT_OVER, t, u, a), o.cancelled || !u.input)) {
h = !0;
break;
}
}
}
h || this.emit(g.POINTER_OVER, t, s);
}
return (this._over[t.id] = s), i;
},
processOutEvents: function (t) {
var e = this._over[t.id],
i = 0,
n = e.length;
if (0 < n) {
var s = this.manager,
r = this._eventData,
o = this._eventContainer,
a = (r.cancelled = !1);
this.sortGameObjects(e, t);
for (var h = 0; h < n; h++) {
var l = e[h];
if ((l = e[h]).input) {
if ((s.resetCursor(l.input), l.emit(g.GAMEOBJECT_POINTER_OUT, t, o), i++, r.cancelled || !l.input)) {
a = !0;
break;
}
if ((this.emit(g.GAMEOBJECT_OUT, t, l, o), r.cancelled || !l.input)) {
a = !0;
break;
}
a || this.emit(g.POINTER_OUT, t, e);
}
}
this._over[t.id] = [];
}
return i;
},
processOverOutEvents: function (t) {
for (var e, i = this._temp, n = [], s = [], r = [], o = this._over[t.id], a = this._drag[t.id], h = this.manager, l = 0; l < o.length; l++)
(e = o[l]), -1 === i.indexOf(e) && -1 === a.indexOf(e) ? n.push(e) : r.push(e);
for (l = 0; l < i.length; l++) (e = i[l]), -1 === o.indexOf(e) && s.push(e);
var u = n.length,
c = 0,
d = this._eventData,
f = this._eventContainer,
p = (d.cancelled = !1);
if (0 < u) {
for (this.sortGameObjects(n, t), l = 0; l < u; l++)
if ((e = n[l]).input) {
if ((h.resetCursor(e.input), e.emit(g.GAMEOBJECT_POINTER_OUT, t, f), c++, d.cancelled || !e.input)) {
p = !0;
break;
}
if ((this.emit(g.GAMEOBJECT_OUT, t, e, f), d.cancelled || !e.input)) {
p = !0;
break;
}
}
p || this.emit(g.POINTER_OUT, t, n);
}
if (((u = s.length), (p = d.cancelled = !1), 0 < u)) {
for (this.sortGameObjects(s, t), l = 0; l < u; l++)
if ((e = s[l]).input) {
if ((h.setCursor(e.input), e.emit(g.GAMEOBJECT_POINTER_OVER, t, e.input.localX, e.input.localY, f), c++, d.cancelled || !e.input)) {
p = !0;
break;
}
if ((this.emit(g.GAMEOBJECT_OVER, t, e, f), d.cancelled || !e.input)) {
p = !0;
break;
}
}
p || this.emit(g.POINTER_OVER, t, s);
}
return (o = r.concat(s)), (this._over[t.id] = this.sortGameObjects(o, t)), c;
},
processUpEvents: function (t) {
for (var e = this._temp, i = this._eventData, n = this._eventContainer, s = (i.cancelled = !1), r = 0; r < e.length; r++) {
var o = e[r];
if (o.input) {
if ((o.emit(g.GAMEOBJECT_POINTER_UP, t, o.input.localX, o.input.localY, n), i.cancelled || !o.input)) {
s = !0;
break;
}
if ((this.emit(g.GAMEOBJECT_UP, t, o, n), i.cancelled || !o.input)) {
s = !0;
break;
}
}
}
return !s && this.manager && (t.upElement === this.manager.game.canvas ? this.emit(g.POINTER_UP, t, e) : this.emit(g.POINTER_UP_OUTSIDE, t)), e.length;
},
queueForInsertion: function (t) {
return -1 === this._pendingInsertion.indexOf(t) && -1 === this._list.indexOf(t) && this._pendingInsertion.push(t), this;
},
queueForRemoval: function (t) {
return this._pendingRemoval.push(t), this;
},
setDraggable: function (t, e) {
void 0 === e && (e = !0), Array.isArray(t) || (t = [t]);
for (var i = 0; i < t.length; i++) {
var n = t[i];
n.input.draggable = e;
var s = this._draggable.indexOf(n);
e && -1 === s ? this._draggable.push(n) : !e && -1 < s && this._draggable.splice(s, 1);
}
return this;
},
makePixelPerfect: function (t) {
void 0 === t && (t = 1);
var e = this.systems.textures;
return s(e, t);
},
setHitArea: function (t, e, i) {
if (void 0 === e) return this.setHitAreaFromTexture(t);
Array.isArray(t) || (t = [t]);
var n,
s,
r = !1,
o = !1,
a = !1,
h = !1,
l = !1,
u = !0;
y(e)
? ((e = v((n = e), "hitArea", null)),
(i = v(n, "hitAreaCallback", null)),
(r = v(n, "draggable", !1)),
(o = v(n, "dropZone", !1)),
(a = v(n, "cursor", !1)),
(h = v(n, "useHandCursor", !1)),
(l = v(n, "pixelPerfect", !1)),
(s = v(n, "alphaTolerance", 1)),
l && ((e = {}), (i = this.makePixelPerfect(s))),
(e && i) || (this.setHitAreaFromTexture(t), (u = !1)))
: "function" != typeof e || i || ((i = e), (e = {}));
for (var c = 0; c < t.length; c++) {
var d,
f = t[c];
(l && "Container" === f.type) ||
(((d = f.input ? f.input : p(f, e, i)).customHitArea = u), (d.dropZone = o), (d.cursor = h ? "pointer" : a), (f.input = d), r && this.setDraggable(f), this.queueForInsertion(f));
}
return this;
},
setHitAreaCircle: function (t, e, i, n, s) {
void 0 === s && (s = a);
var r = new o(e, i, n);
return this.setHitArea(t, r, s);
},
setHitAreaEllipse: function (t, e, i, n, s, r) {
void 0 === r && (r = u);
var o = new l(e, i, n, s);
return this.setHitArea(t, o, r);
},
setHitAreaFromTexture: function (t, e) {
void 0 === e && (e = b), Array.isArray(t) || (t = [t]);
for (var i = 0; i < t.length; i++) {
var n = t[i],
s = n.frame,
r = 0,
o = 0;
n.width ? ((r = n.width), (o = n.height)) : s && ((r = s.realWidth), (o = s.realHeight)),
("Container" !== n.type || (0 !== r && 0 !== o)) && 0 !== r && 0 !== o && ((n.input = p(n, new x(0, 0, r, o), e)), this.queueForInsertion(n));
}
return this;
},
setHitAreaRectangle: function (t, e, i, n, s, r) {
void 0 === r && (r = b);
var o = new x(e, i, n, s);
return this.setHitArea(t, o, r);
},
setHitAreaTriangle: function (t, e, i, n, s, r, o, a) {
void 0 === a && (a = S);
var h = new T(e, i, n, s, r, o);
return this.setHitArea(t, h, a);
},
enableDebug: function (o, a) {
void 0 === a && (a = 65280);
var t = o.input;
if (!t || !t.hitArea) return this;
var e = t.hitArea,
i = e.type,
h = t.hitAreaDebug,
n = this.systems.add,
s = this.systems.updateList;
h && (s.remove(h), h.destroy(), (h = null));
var l = 0,
u = 0;
switch (i) {
case d.CIRCLE:
(h = n.arc(0, 0, e.radius)), (l = e.x - e.radius), (u = e.y - e.radius);
break;
case d.ELLIPSE:
(h = n.ellipse(0, 0, e.width, e.height)), (l = e.x - e.width / 2), (u = e.y - e.height / 2);
break;
case d.LINE:
h = n.line(0, 0, e.x1, e.y1, e.x2, e.y2);
break;
case d.POLYGON:
h = n.polygon(0, 0, e.points);
break;
case d.RECTANGLE:
(h = n.rectangle(0, 0, e.width, e.height)), (l = e.x), (u = e.y);
break;
case d.TRIANGLE:
h = n.triangle(0, 0, e.x1, e.y1, e.x2, e.y2, e.x3, e.y3);
}
return (
h &&
((h.isFilled = !1),
(h.preUpdate = function () {
h.setStrokeStyle(1 / o.scale, a), h.setDisplayOrigin(o.displayOriginX, o.displayOriginY);
var t,
e = o.x,
i = o.y,
n = o.rotation,
s = o.scaleX,
r = o.scaleY;
o.parentContainer && ((e = (t = o.getWorldTransformMatrix()).tx), (i = t.ty), (n = t.rotation), (s = t.scaleX), (r = t.scaleY)),
h.setRotation(n),
h.setScale(s, r),
h.setPosition(e + l, i + u),
h.setScrollFactor(o.scrollFactorX, o.scrollFactorY),
h.setDepth(o.depth);
}),
s.add(h),
(t.hitAreaDebug = h)),
this
);
},
removeDebug: function (t) {
var e,
i = t.input;
return i && i.hitAreaDebug && ((e = i.hitAreaDebug), this.systems.updateList.remove(e), e.destroy(), (i.hitAreaDebug = null)), this;
},
setPollAlways: function () {
return this.setPollRate(0);
},
setPollOnMove: function () {
return this.setPollRate(-1);
},
setPollRate: function (t) {
return (this.pollRate = t), (this._pollTimer = 0), this;
},
setGlobalTopOnly: function (t) {
return (this.manager.globalTopOnly = t), this;
},
setTopOnly: function (t) {
return (this.topOnly = t), this;
},
sortGameObjects: function (t, e) {
if (t.length < 2) return t;
var i = e.camera.renderList;
return t.sort(function (t, e) {
return i.indexOf(e) - i.indexOf(t);
});
},
sortDropZones: function (t) {
return t.length < 2 ? t : (this.scene.sys.depthSort(), t.sort(this.sortDropZoneHandler.bind(this)));
},
sortDropZoneHandler: function (t, e) {
if (t.parentContainer || e.parentContainer) {
if (t.parentContainer === e.parentContainer) return e.parentContainer.getIndex(e) - t.parentContainer.getIndex(t);
if (t.parentContainer === e) return -1;
if (e.parentContainer === t) return 1;
for (var i = t.getIndexList(), n = e.getIndexList(), s = Math.min(i.length, n.length), r = 0; r < s; r++) {
var o = i[r],
a = n[r];
if (o !== a) return a - o;
}
return n.length - i.length;
}
return this.displayList.getIndex(e) - this.displayList.getIndex(t);
},
stopPropagation: function () {
return (this.manager._tempSkip = !0), this;
},
addPointer: function (t) {
return this.manager.addPointer(t);
},
setDefaultCursor: function (t) {
return this.manager.setDefaultCursor(t), this;
},
transitionIn: function () {
this.enabled = this.settings.transitionAllowInput;
},
transitionComplete: function () {
this.settings.transitionAllowInput || (this.enabled = !0);
},
transitionOut: function () {
this.enabled = this.settings.transitionAllowInput;
},
shutdown: function () {
this.pluginEvents.emit(g.SHUTDOWN), (this._temp.length = 0), (this._list.length = 0), (this._draggable.length = 0), (this._pendingRemoval.length = 0), (this._pendingInsertion.length = 0);
for (var t = (this._dragState.length = 0); t < 10; t++) (this._drag[t] = []), (this._over[t] = []);
this.removeAllListeners();
var e = this.manager;
e.canvas.style.cursor = e.defaultCursor;
var i = this.systems.events;
i.off(w.TRANSITION_START, this.transitionIn, this),
i.off(w.TRANSITION_OUT, this.transitionOut, this),
i.off(w.TRANSITION_COMPLETE, this.transitionComplete, this),
i.off(w.PRE_UPDATE, this.preUpdate, this),
e.events.off(g.GAME_OUT, this.onGameOut, this),
e.events.off(g.GAME_OVER, this.onGameOver, this),
i.off(w.SHUTDOWN, this.shutdown, this);
},
destroy: function () {
this.shutdown(),
this.pluginEvents.emit(g.DESTROY),
this.pluginEvents.removeAllListeners(),
this.scene.sys.events.off(w.START, this.start, this),
(this.scene = null),
(this.cameras = null),
(this.manager = null),
(this.events = null),
(this.mouse = null);
},
x: {
get: function () {
return this.manager.activePointer.x;
},
},
y: {
get: function () {
return this.manager.activePointer.y;
},
},
isOver: {
get: function () {
return this.manager.isOver;
},
},
mousePointer: {
get: function () {
return this.manager.mousePointer;
},
},
activePointer: {
get: function () {
return this.manager.activePointer;
},
},
pointer1: {
get: function () {
return this.manager.pointers[1];
},
},
pointer2: {
get: function () {
return this.manager.pointers[2];
},
},
pointer3: {
get: function () {
return this.manager.pointers[3];
},
},
pointer4: {
get: function () {
return this.manager.pointers[4];
},
},
pointer5: {
get: function () {
return this.manager.pointers[5];
},
},
pointer6: {
get: function () {
return this.manager.pointers[6];
},
},
pointer7: {
get: function () {
return this.manager.pointers[7];
},
},
pointer8: {
get: function () {
return this.manager.pointers[8];
},
},
pointer9: {
get: function () {
return this.manager.pointers[9];
},
},
pointer10: {
get: function () {
return this.manager.pointers[10];
},
},
});
m.register("InputPlugin", _, "input"), (t.exports = _);
},
function (t, e, i) {
t.exports = {
Events: i(154),
KeyboardManager: i(410),
KeyboardPlugin: i(1330),
Key: i(512),
KeyCodes: i(143),
KeyCombo: i(513),
AdvanceKeyCombo: i(515),
ProcessKeyCombo: i(514),
ResetKeyCombo: i(516),
JustDown: i(1332),
JustUp: i(1333),
DownDuration: i(1334),
UpDuration: i(1335),
};
},
function (t, e) {
t.exports = "keydown";
},
function (t, e) {
t.exports = "keyup";
},
function (t, e) {
t.exports = "keycombomatch";
},
function (t, e) {
t.exports = "down";
},
function (t, e) {
t.exports = "keydown-";
},
function (t, e) {
t.exports = "keyup-";
},
function (t, e) {
t.exports = "up";
},
function (t, e, i) {
var n = i(0),
s = i(9),
h = i(154),
r = i(22),
o = i(6),
a = i(51),
l = i(153),
u = i(512),
c = i(143),
d = i(513),
f = i(1331),
p = i(20),
g = i(76),
v = new n({
Extends: s,
initialize: function (t) {
s.call(this),
(this.game = t.systems.game),
(this.scene = t.scene),
(this.settings = this.scene.sys.settings),
(this.sceneInputPlugin = t),
(this.manager = t.manager.keyboard),
(this.enabled = !0),
(this.keys = []),
(this.combos = []),
(this.prevCode = null),
(this.prevTime = 0),
(this.prevType = null),
t.pluginEvents.once(a.BOOT, this.boot, this),
t.pluginEvents.on(a.START, this.start, this);
},
boot: function () {
var t = this.settings.input;
this.enabled = o(t, "keyboard", !0);
var e = o(t, "keyboard.capture", null);
e && this.addCaptures(e), this.sceneInputPlugin.pluginEvents.once(a.DESTROY, this.destroy, this);
},
start: function () {
this.sceneInputPlugin.manager.events.on(a.MANAGER_PROCESS, this.update, this),
this.sceneInputPlugin.pluginEvents.once(a.SHUTDOWN, this.shutdown, this),
this.game.events.on(r.BLUR, this.resetKeys, this),
this.scene.sys.events.on(p.PAUSE, this.resetKeys, this),
this.scene.sys.events.on(p.SLEEP, this.resetKeys, this);
},
isActive: function () {
return this.enabled && this.scene.sys.isActive();
},
addCapture: function (t) {
return this.manager.addCapture(t), this;
},
removeCapture: function (t) {
return this.manager.removeCapture(t), this;
},
getCaptures: function () {
return this.manager.captures;
},
enableGlobalCapture: function () {
return (this.manager.preventDefault = !0), this;
},
disableGlobalCapture: function () {
return (this.manager.preventDefault = !1), this;
},
clearCaptures: function () {
return this.manager.clearCaptures(), this;
},
createCursorKeys: function () {
return this.addKeys({ up: c.UP, down: c.DOWN, left: c.LEFT, right: c.RIGHT, space: c.SPACE, shift: c.SHIFT });
},
addKeys: function (t, e, i) {
void 0 === e && (e = !0), void 0 === i && (i = !1);
var n = {};
if ("string" == typeof t) {
t = t.split(",");
for (var s = 0; s < t.length; s++) {
var r = t[s].trim();
r && (n[r] = this.addKey(r, e, i));
}
} else for (var o in t) n[o] = this.addKey(t[o], e, i);
return n;
},
addKey: function (t, e, i) {
void 0 === e && (e = !0), void 0 === i && (i = !1);
var n = this.keys;
if (t instanceof u) {
var s = n.indexOf(t);
return -1 < s ? (n[s] = t) : (n[t.keyCode] = t), e && this.addCapture(t.keyCode), t.setEmitOnRepeat(i), t;
}
return "string" == typeof t && (t = c[t.toUpperCase()]), n[t] || ((n[t] = new u(this, t)), e && this.addCapture(t), n[t].setEmitOnRepeat(i)), n[t];
},
removeKey: function (t, e) {
void 0 === e && (e = !1);
var i,
n,
s = this.keys;
return (
t instanceof u ? -1 < (n = s.indexOf(t)) && ((i = this.keys[n]), (this.keys[n] = void 0)) : "string" == typeof t && (t = c[t.toUpperCase()]),
s[t] && ((i = s[t]), (s[t] = void 0)),
i && ((i.plugin = null), e && i.destroy()),
this
);
},
removeAllKeys: function (t) {
for (var e = this.keys, i = 0; i < e.length; i++) {
var n = e[i];
n && ((e[i] = void 0), t && n.destroy());
}
return this;
},
createCombo: function (t, e) {
return new d(this, t, e);
},
checkDown: function (t, e) {
if ((void 0 === e && (e = 0), this.enabled && t.isDown)) {
var i = g(this.time - t.timeDown, e);
if (i > t._tick) return (t._tick = i), !0;
}
return !1;
},
update: function () {
var t = this.manager.queue,
e = t.length;
if (this.isActive() && 0 !== e)
for (var i = this.keys, n = 0; n < e; n++) {
var s = t[n],
r = s.keyCode,
o = i[r],
a = !1;
void 0 === s.cancelled &&
((s.cancelled = 0),
(s.stopImmediatePropagation = function () {
s.cancelled = 1;
}),
(s.stopPropagation = function () {
s.cancelled = -1;
})),
-1 !== s.cancelled &&
((r === this.prevCode && s.timeStamp === this.prevTime && s.type === this.prevType) ||
((this.prevCode = r),
(this.prevTime = s.timeStamp),
(this.prevType = s.type),
"keydown" === s.type
? (o && ((a = o.isDown), o.onDown(s)), s.cancelled || (o && a) || (f[r] && this.emit(h.KEY_DOWN + f[r], s), s.cancelled || this.emit(h.ANY_KEY_DOWN, s)))
: (o && o.onUp(s), s.cancelled || (f[r] && this.emit(h.KEY_UP + f[r], s), s.cancelled || this.emit(h.ANY_KEY_UP, s))),
1 === s.cancelled && (s.cancelled = 0)));
}
},
resetKeys: function () {
for (var t = this.keys, e = 0; e < t.length; e++) t[e] && t[e].reset();
return this;
},
shutdown: function () {
this.removeAllKeys(!0),
this.removeAllListeners(),
this.sceneInputPlugin.manager.events.off(a.MANAGER_PROCESS, this.update, this),
this.game.events.off(r.BLUR, this.resetKeys),
this.scene.sys.events.off(p.PAUSE, this.resetKeys, this),
this.scene.sys.events.off(p.SLEEP, this.resetKeys, this),
(this.queue = []);
},
destroy: function () {
this.shutdown();
for (var t = this.keys, e = 0; e < t.length; e++) t[e] && t[e].destroy();
(this.keys = []), (this.combos = []), (this.queue = []), (this.scene = null), (this.settings = null), (this.sceneInputPlugin = null), (this.manager = null);
},
time: {
get: function () {
return this.sceneInputPlugin.manager.time;
},
},
});
l.register("KeyboardPlugin", v, "keyboard", "keyboard", "inputKeyboard"), (t.exports = v);
},
function (t, e, i) {
var n = i(143),
s = {};
for (var r in n) s[n[r]] = r;
t.exports = s;
},
function (t, e) {
t.exports = function (t) {
return !!t._justDown && !(t._justDown = !1);
};
},
function (t, e) {
t.exports = function (t) {
return !!t._justUp && !(t._justUp = !1);
};
},
function (t, e) {
t.exports = function (t, e) {
void 0 === e && (e = 50);
var i = t.plugin.game.loop.time - t.timeDown;
return t.isDown && i < e;
};
},
function (t, e) {
t.exports = function (t, e) {
void 0 === e && (e = 50);
var i = t.plugin.game.loop.time - t.timeUp;
return t.isUp && i < e;
};
},
function (t, e, i) {
t.exports = { MouseManager: i(411) };
},
function (t, e, i) {
t.exports = { TouchManager: i(413) };
},
function (t, e, i) {
var n = i(21),
s = i(17)(
!1,
(s = { Events: i(95), FileTypes: i(1339), File: i(23), FileTypesManager: i(8), GetURL: i(155), LoaderPlugin: i(1365), MergeXHRSettings: i(240), MultiFile: i(49), XHRLoader: i(517), XHRSettings: i(156) }),
n
);
t.exports = s;
},
function (t, e, i) {
t.exports = {
AnimationJSONFile: i(1340),
AsepriteFile: i(1341),
AtlasJSONFile: i(1342),
AtlasXMLFile: i(1343),
AudioFile: i(518),
AudioSpriteFile: i(1344),
BinaryFile: i(1345),
BitmapFontFile: i(1346),
CSSFile: i(1347),
GLSLFile: i(1348),
HTML5AudioFile: i(519),
HTMLFile: i(1349),
HTMLTextureFile: i(1350),
ImageFile: i(71),
JSONFile: i(61),
MultiAtlasFile: i(1351),
MultiScriptFile: i(1352),
OBJFile: i(1353),
PackFile: i(1354),
PluginFile: i(1355),
SceneFile: i(1356),
ScenePluginFile: i(1357),
ScriptFile: i(520),
SpriteSheetFile: i(1358),
SVGFile: i(1359),
TextFile: i(242),
TilemapCSVFile: i(1360),
TilemapImpactFile: i(1361),
TilemapJSONFile: i(1362),
UnityAtlasFile: i(1363),
VideoFile: i(1364),
XMLFile: i(241),
};
},
function (t, e, i) {
var n = i(0),
s = i(8),
r = i(61),
o = i(95),
a = new n({
Extends: r,
initialize: function (t, e, i, n, s) {
r.call(this, t, e, i, n, s), (this.type = "animationJSON");
},
onProcess: function () {
this.loader.once(o.POST_PROCESS, this.onLoadComplete, this), r.prototype.onProcess.call(this);
},
onLoadComplete: function () {
this.loader.systems.anims.fromJSON(this.data);
},
});
s.register("animation", function (t, e, i, n) {
if (Array.isArray(t)) for (var s = 0; s < t.length; s++) this.addFile(new a(this, t[s]));
else this.addFile(new a(this, t, e, n, i));
return this;
}),
(t.exports = a);
},
function (t, e, i) {
var n = i(0),
s = i(8),
l = i(2),
u = i(71),
c = i(7),
d = i(61),
f = i(49),
a = new n({
Extends: f,
initialize: function (t, e, i, n, s, r) {
var o,
a,
h = c(e)
? ((e = l((a = e), "key")),
(o = new u(t, { key: e, url: l(a, "textureURL"), extension: l(a, "textureExtension", "png"), normalMap: l(a, "normalMap"), xhrSettings: l(a, "textureXhrSettings") })),
new d(t, { key: e, url: l(a, "atlasURL"), extension: l(a, "atlasExtension", "json"), xhrSettings: l(a, "atlasXhrSettings") }))
: ((o = new u(t, e, i, s)), new d(t, e, n, r));
o.linkFile ? f.call(this, t, "atlasjson", e, [o, h, o.linkFile]) : f.call(this, t, "atlasjson", e, [o, h]);
},
addToCache: function () {
var t, e, i;
this.isReadyToProcess() &&
((t = this.files[0]), (e = this.files[1]), (i = this.files[2] ? this.files[2].data : null), this.loader.textureManager.addAtlas(t.key, t.data, e.data, i), e.addToCache(), (this.complete = !0));
},
});
s.register("aseprite", function (t, e, i, n, s) {
var r;
if (Array.isArray(t)) for (var o = 0; o < t.length; o++) (r = new a(this, t[o])), this.addFile(r.files);
else (r = new a(this, t, e, i, n, s)), this.addFile(r.files);
return this;
}),
(t.exports = a);
},
function (t, e, i) {
var n = i(0),
s = i(8),
l = i(2),
u = i(71),
c = i(7),
d = i(61),
f = i(49),
a = new n({
Extends: f,
initialize: function (t, e, i, n, s, r) {
var o,
a,
h = c(e)
? ((e = l((a = e), "key")),
(o = new u(t, { key: e, url: l(a, "textureURL"), extension: l(a, "textureExtension", "png"), normalMap: l(a, "normalMap"), xhrSettings: l(a, "textureXhrSettings") })),
new d(t, { key: e, url: l(a, "atlasURL"), extension: l(a, "atlasExtension", "json"), xhrSettings: l(a, "atlasXhrSettings") }))
: ((o = new u(t, e, i, s)), new d(t, e, n, r));
o.linkFile ? f.call(this, t, "atlasjson", e, [o, h, o.linkFile]) : f.call(this, t, "atlasjson", e, [o, h]);
},
addToCache: function () {
var t, e, i;
this.isReadyToProcess() &&
((t = this.files[0]),
(e = this.files[1]),
(i = this.files[2] ? this.files[2].data : null),
this.loader.textureManager.addAtlas(t.key, t.data, e.data, i),
e.pendingDestroy(),
(this.complete = !0));
},
});
s.register("atlas", function (t, e, i, n, s) {
var r;
if (Array.isArray(t)) for (var o = 0; o < t.length; o++) (r = new a(this, t[o])), this.addFile(r.files);
else (r = new a(this, t, e, i, n, s)), this.addFile(r.files);
return this;
}),
(t.exports = a);
},
function (t, e, i) {
var n = i(0),
s = i(8),
l = i(2),
u = i(71),
c = i(7),
d = i(49),
f = i(241),
a = new n({
Extends: d,
initialize: function (t, e, i, n, s, r) {
var o,
a,
h = c(e)
? ((e = l((a = e), "key")),
(o = new u(t, { key: e, url: l(a, "textureURL"), extension: l(a, "textureExtension", "png"), normalMap: l(a, "normalMap"), xhrSettings: l(a, "textureXhrSettings") })),
new f(t, { key: e, url: l(a, "atlasURL"), extension: l(a, "atlasExtension", "xml"), xhrSettings: l(a, "atlasXhrSettings") }))
: ((o = new u(t, e, i, s)), new f(t, e, n, r));
o.linkFile ? d.call(this, t, "atlasxml", e, [o, h, o.linkFile]) : d.call(this, t, "atlasxml", e, [o, h]);
},
addToCache: function () {
var t, e, i;
this.isReadyToProcess() &&
((t = this.files[0]),
(e = this.files[1]),
(i = this.files[2] ? this.files[2].data : null),
this.loader.textureManager.addAtlasXML(t.key, t.data, e.data, i),
e.pendingDestroy(),
(this.complete = !0));
},
});
s.register("atlasXML", function (t, e, i, n, s) {
var r;
if (Array.isArray(t)) for (var o = 0; o < t.length; o++) (r = new a(this, t[o])), this.addFile(r.files);
else (r = new a(this, t, e, i, n, s)), this.addFile(r.files);
return this;
}),
(t.exports = a);
},
function (t, e, i) {
var u = i(518),
n = i(0),
s = i(8),
c = i(2),
d = i(7),
f = i(61),
p = i(49),
g = new n({
Extends: p,
initialize: function (t, e, i, n, s, r, o) {
var a, h, l;
d(e) && ((e = c((a = e), "key")), (i = c(a, "jsonURL")), (n = c(a, "audioURL")), (s = c(a, "audioConfig")), (r = c(a, "audioXhrSettings")), (o = c(a, "jsonXhrSettings"))),
n
? (l = u.create(t, e, n, s, r)) && ((h = new f(t, e, i, o)), p.call(this, t, "audiosprite", e, [l, h]), (this.config.resourceLoad = !1))
: ((h = new f(t, e, i, o)), p.call(this, t, "audiosprite", e, [h]), (this.config.resourceLoad = !0), (this.config.audioConfig = s), (this.config.audioXhrSettings = r));
},
onFileComplete: function (t) {
var e, i, n, s;
-1 !== this.files.indexOf(t) &&
(this.pending--,
this.config.resourceLoad &&
"json" === t.type &&
t.data.hasOwnProperty("resources") &&
((e = t.data.resources),
(i = c(this.config, "audioConfig")),
(n = c(this.config, "audioXhrSettings")),
(s = u.create(this.loader, t.key, e, i, n)) && (this.addToMultiFile(s), this.loader.addFile(s))));
},
addToCache: function () {
var t, e;
this.isReadyToProcess() && ((t = this.files[0]), (e = this.files[1]), t.addToCache(), e.addToCache(), (this.complete = !0));
},
});
s.register("audioSprite", function (t, e, i, n, s, r) {
var o,
a = this.systems.game,
h = a.config.audio,
l = a.device.audio;
if ((h && h.noAudio) || (!l.webAudio && !l.audioData)) return this;
if (Array.isArray(t)) for (var u = 0; u < t.length; u++) (o = new g(this, t[u])).files && this.addFile(o.files);
else (o = new g(this, t, e, i, n, s, r)).files && this.addFile(o.files);
return this;
});
},
function (t, e, i) {
var n = i(0),
s = i(21),
h = i(23),
r = i(8),
l = i(2),
u = i(7),
o = new n({
Extends: h,
initialize: function (t, e, i, n, s) {
var r,
o = "bin";
u(e) && ((e = l((r = e), "key")), (i = l(r, "url")), (n = l(r, "xhrSettings")), (o = l(r, "extension", o)), (s = l(r, "dataType", s)));
var a = { type: "binary", cache: t.cacheManager.binary, extension: o, responseType: "arraybuffer", key: e, url: i, xhrSettings: n, config: { dataType: s } };
h.call(this, t, a);
},
onProcess: function () {
this.state = s.FILE_PROCESSING;
var t = this.config.dataType;
(this.data = t ? new t(this.xhrLoader.response) : this.xhrLoader.response), this.onProcessComplete();
},
});
r.register("binary", function (t, e, i, n) {
if (Array.isArray(t)) for (var s = 0; s < t.length; s++) this.addFile(new o(this, t[s]));
else this.addFile(new o(this, t, e, n, i));
return this;
}),
(t.exports = o);
},
function (t, e, i) {
var n = i(0),
s = i(8),
l = i(2),
u = i(71),
c = i(7),
d = i(49),
r = i(212),
f = i(241),
a = new n({
Extends: d,
initialize: function (t, e, i, n, s, r) {
var o,
a,
h = c(e)
? ((e = l((a = e), "key")),
(o = new u(t, { key: e, url: l(a, "textureURL"), extension: l(a, "textureExtension", "png"), normalMap: l(a, "normalMap"), xhrSettings: l(a, "textureXhrSettings") })),
new f(t, { key: e, url: l(a, "fontDataURL"), extension: l(a, "fontDataExtension", "xml"), xhrSettings: l(a, "fontDataXhrSettings") }))
: ((o = new u(t, e, i, s)), new f(t, e, n, r));
o.linkFile ? d.call(this, t, "bitmapfont", e, [o, h, o.linkFile]) : d.call(this, t, "bitmapfont", e, [o, h]);
},
addToCache: function () {
var t, e, i, n;
this.isReadyToProcess() &&
((t = this.files[0]),
(e = this.files[1]),
t.addToCache(),
e.pendingDestroy(),
(i = t.cache.get(t.key)),
(n = r(e.data, t.cache.getFrame(t.key), 0, 0, i)),
this.loader.cacheManager.bitmapFont.add(t.key, { data: n, texture: t.key, frame: null }),
(this.complete = !0));
},
});
s.register("bitmapFont", function (t, e, i, n, s) {
var r;
if (Array.isArray(t)) for (var o = 0; o < t.length; o++) (r = new a(this, t[o])), this.addFile(r.files);
else (r = new a(this, t, e, i, n, s)), this.addFile(r.files);
return this;
}),
(t.exports = a);
},
function (t, e, i) {
var n = i(0),
s = i(21),
a = i(23),
r = i(8),
h = i(2),
l = i(7),
o = new n({
Extends: a,
initialize: function (t, e, i, n) {
var s,
r = "css";
l(e) && ((e = h((s = e), "key")), (i = h(s, "url")), (n = h(s, "xhrSettings")), (r = h(s, "extension", r)));
var o = { type: "script", cache: !1, extension: r, responseType: "text", key: e, url: i, xhrSettings: n };
a.call(this, t, o);
},
onProcess: function () {
(this.state = s.FILE_PROCESSING),
(this.data = document.createElement("style")),
(this.data.defer = !1),
(this.data.innerHTML = this.xhrLoader.responseText),
document.head.appendChild(this.data),
this.onProcessComplete();
},
});
r.register("css", function (t, e, i) {
if (Array.isArray(t)) for (var n = 0; n < t.length; n++) this.addFile(new o(this, t[n]));
else this.addFile(new o(this, t, e, i));
return this;
}),
(t.exports = o);
},
function (t, e, i) {
var n = i(0),
s = i(21),
h = i(23),
r = i(8),
l = i(2),
u = i(7),
a = i(396),
o = new n({
Extends: h,
initialize: function (t, e, i, n, s) {
var r,
o = "glsl";
u(e) ? ((e = l((r = e), "key")), (i = l(r, "url")), (n = l(r, "shaderType", "fragment")), (s = l(r, "xhrSettings")), (o = l(r, "extension", o))) : void 0 === n && (n = "fragment");
var a = { type: "glsl", cache: t.cacheManager.shader, extension: o, responseType: "text", key: e, url: i, config: { shaderType: n }, xhrSettings: s };
h.call(this, t, a);
},
onProcess: function () {
(this.state = s.FILE_PROCESSING), (this.data = this.xhrLoader.responseText), this.onProcessComplete();
},
addToCache: function () {
var t = this.data.split("\n"),
e = this.extractBlock(t, 0);
if (e)
for (; e; ) {
var i,
n = this.getShaderName(e.header),
s = this.getShaderType(e.header),
r = this.getShaderUniforms(e.header),
o = e.shader;
this.cache.has(n)
? ((i = this.cache.get(n)), "fragment" === s ? (i.fragmentSrc = o) : (i.vertexSrc = o), i.uniforms || (i.uniforms = r))
: "fragment" === s
? this.cache.add(n, new a(n, o, "", r))
: this.cache.add(n, new a(n, "", o, r)),
(e = this.extractBlock(t, e.offset));
}
else "fragment" === this.config.shaderType ? this.cache.add(this.key, new a(this.key, this.data)) : this.cache.add(this.key, new a(this.key, "", this.data));
this.pendingDestroy();
},
getShaderName: function (t) {
for (var e = 0; e < t.length; e++) {
var i = t[e].trim();
if ("name:" === i.substring(0, 5)) return i.substring(5).trim();
}
return this.key;
},
getShaderType: function (t) {
for (var e = 0; e < t.length; e++) {
var i = t[e].trim();
if ("type:" === i.substring(0, 5)) return i.substring(5).trim();
}
return this.config.shaderType;
},
getShaderUniforms: function (t) {
for (var e = {}, i = 0; i < t.length; i++) {
var n = t[i].trim();
if ("uniform." === n.substring(0, 8)) {
var s = n.indexOf(":");
if (s) {
var r = n.substring(8, s);
try {
e[r] = JSON.parse(n.substring(s + 1));
} catch (t) {}
}
}
}
return e;
},
extractBlock: function (t, e) {
for (var i = -1, n = -1, s = -1, r = !1, o = !1, a = [], h = [], l = e; l < t.length; l++) {
var u = t[l].trim();
if ("---" === u)
if (-1 === i) (i = l), (r = !0);
else {
if (!r) {
o = !1;
break;
}
(n = l), (o = !(r = !1));
}
else r ? a.push(u) : o && (h.push(u), (s = l));
}
return r || -1 === n ? null : { header: a, shader: h.join("\n"), offset: s };
},
});
r.register("glsl", function (t, e, i, n) {
if (Array.isArray(t)) for (var s = 0; s < t.length; s++) this.addFile(new o(this, t[s]));
else this.addFile(new o(this, t, e, i, n));
return this;
}),
(t.exports = o);
},
function (t, e, i) {
var n = i(0),
s = i(21),
a = i(23),
r = i(8),
h = i(2),
l = i(7),
o = new n({
Extends: a,
initialize: function (t, e, i, n) {
var s,
r = "html";
l(e) && ((e = h((s = e), "key")), (i = h(s, "url")), (n = h(s, "xhrSettings")), (r = h(s, "extension", r)));
var o = { type: "text", cache: t.cacheManager.html, extension: r, responseType: "text", key: e, url: i, xhrSettings: n };
a.call(this, t, o);
},
onProcess: function () {
(this.state = s.FILE_PROCESSING), (this.data = this.xhrLoader.responseText), this.onProcessComplete();
},
});
r.register("html", function (t, e, i) {
if (Array.isArray(t)) for (var n = 0; n < t.length; n++) this.addFile(new o(this, t[n]));
else this.addFile(new o(this, t, e, i));
return this;
}),
(t.exports = o);
},
function (t, e, i) {
var n = i(0),
o = i(21),
l = i(23),
s = i(8),
u = i(2),
c = i(7),
a = new n({
Extends: l,
initialize: function (t, e, i, n, s, r) {
void 0 === n && (n = 512), void 0 === s && (s = 512);
var o,
a = "html";
c(e) && ((e = u((o = e), "key")), (i = u(o, "url")), (r = u(o, "xhrSettings")), (a = u(o, "extension", a)), (n = u(o, "width", n)), (s = u(o, "height", s)));
var h = { type: "html", cache: t.textureManager, extension: a, responseType: "text", key: e, url: i, xhrSettings: r, config: { width: n, height: s } };
l.call(this, t, h);
},
onProcess: function () {
this.state = o.FILE_PROCESSING;
var t = this.config.width,
e = this.config.height,
i = [];
i.push('");
var n = [i.join("\n")],
s = this;
try {
var r = new window.Blob(n, { type: "image/svg+xml;charset=utf-8" });
} catch (t) {
return (s.state = o.FILE_ERRORED), void s.onProcessComplete();
}
(this.data = new Image()),
(this.data.crossOrigin = this.crossOrigin),
(this.data.onload = function () {
l.revokeObjectURL(s.data), s.onProcessComplete();
}),
(this.data.onerror = function () {
l.revokeObjectURL(s.data), s.onProcessError();
}),
l.createObjectURL(this.data, r, "image/svg+xml");
},
addToCache: function () {
var t = this.cache.addImage(this.key, this.data);
this.pendingDestroy(t);
},
});
s.register("htmlTexture", function (t, e, i, n, s) {
if (Array.isArray(t)) for (var r = 0; r < t.length; r++) this.addFile(new a(this, t[r]));
else this.addFile(new a(this, t, e, i, n, s));
return this;
}),
(t.exports = a);
},
function (t, e, i) {
var n = i(0),
s = i(8),
v = i(2),
y = i(71),
l = i(7),
u = i(61),
c = i(49),
a = new n({
Extends: c,
initialize: function (t, e, i, n, s, r, o) {
var a;
l(e) && ((e = v((a = e), "key")), (i = v(a, "url", !1) ? v(a, "url") : v(a, "atlasURL")), (r = v(a, "xhrSettings")), (n = v(a, "path")), (s = v(a, "baseURL")), (o = v(a, "textureXhrSettings")));
var h = new u(t, e, i, r);
c.call(this, t, "multiatlas", e, [h]), (this.config.path = n), (this.config.baseURL = s), (this.config.textureXhrSettings = o);
},
onFileComplete: function (t) {
if (-1 !== this.files.indexOf(t) && (this.pending--, "json" === t.type && t.data.hasOwnProperty("textures"))) {
var e = t.data.textures,
i = this.config,
n = this.loader,
s = n.baseURL,
r = n.path,
o = n.prefix,
a = v(i, "baseURL", this.baseURL),
h = v(i, "path", this.path),
l = v(i, "prefix", this.prefix),
u = v(i, "textureXhrSettings");
n.setBaseURL(a), n.setPath(h), n.setPrefix(l);
for (var c = 0; c < e.length; c++) {
var d,
f = e[c].image,
p = "MA" + this.multiKeyIndex + "_" + f,
g = new y(n, p, f, u);
this.addToMultiFile(g), n.addFile(g), e[c].normalMap && (((d = new y(n, p, e[c].normalMap, u)).type = "normalMap"), g.setLink(d), this.addToMultiFile(d), n.addFile(d));
}
n.setBaseURL(s), n.setPath(r), n.setPrefix(o);
}
},
addToCache: function () {
if (this.isReadyToProcess()) {
for (var t = this.files[0], e = [], i = [], n = [], s = 1; s < this.files.length; s++) {
var r = this.files[s];
if ("normalMap" !== r.type)
for (var o = r.key.indexOf("_"), a = r.key.substr(o + 1), h = r.data, l = 0; l < t.data.textures.length; l++) {
var u = t.data.textures[l];
if (u.image === a) {
i.push(h), e.push(u), r.linkFile && n.push(r.linkFile.data);
break;
}
}
}
for (0 === n.length && (n = void 0), this.loader.textureManager.addAtlasJSONArray(this.key, i, e, n), this.complete = !0, s = 0; s < this.files.length; s++) this.files[s].pendingDestroy();
}
},
});
s.register("multiatlas", function (t, e, i, n, s) {
var r;
if (Array.isArray(t)) for (var o = 0; o < t.length; o++) (r = new a(this, t[o])), this.addFile(r.files);
else (r = new a(this, t, e, i, n, s)), this.addFile(r.files);
return this;
}),
(t.exports = a);
},
function (t, e, i) {
var n = i(0),
s = i(8),
l = i(2),
u = i(7),
c = i(49),
d = i(520),
r = new n({
Extends: c,
initialize: function (t, e, i, n) {
var s,
r = "js",
o = [];
u(e) && ((e = l((s = e), "key")), (i = l(s, "url")), (n = l(s, "xhrSettings")), (r = l(s, "extension", r))), Array.isArray(i) || (i = [i]);
for (var a = 0; a < i.length; a++) {
var h = new d(t, { key: e + "_" + a.toString(), url: i[a], extension: r, xhrSettings: n });
(h.onProcess = function () {
this.onProcessComplete();
}),
o.push(h);
}
c.call(this, t, "scripts", e, o);
},
addToCache: function () {
if (this.isReadyToProcess()) {
for (var t = 0; t < this.files.length; t++) {
var e = this.files[t];
(e.data = document.createElement("script")),
(e.data.language = "javascript"),
(e.data.type = "text/javascript"),
(e.data.defer = !1),
(e.data.text = e.xhrLoader.responseText),
document.head.appendChild(e.data);
}
this.complete = !0;
}
},
});
s.register("scripts", function (t, e, i) {
var n;
if (Array.isArray(t)) for (var s = 0; s < t.length; s++) (n = new r(this, t[s])), this.addFile(n.files);
else (n = new r(this, t, e, i)), this.addFile(n.files);
return this;
}),
(t.exports = r);
},
function (t, e, i) {
var n = i(0),
s = i(8),
u = i(2),
c = i(7),
d = i(49),
r = i(498),
o = i(499),
f = i(242),
a = new n({
Extends: d,
initialize: function (t, e, i, n, s, r) {
var o,
a,
h,
l = t.cacheManager.obj;
c(e)
? ((e = u((h = e), "key")),
(o = new f(t, { key: e, type: "obj", cache: l, url: u(h, "url"), extension: u(h, "extension", "obj"), xhrSettings: u(h, "xhrSettings"), config: { flipUV: u(h, "flipUV", s) } })),
(n = u(h, "matURL")) && (a = new f(t, { key: e, type: "mat", cache: l, url: n, extension: u(h, "matExtension", "mat"), xhrSettings: u(h, "xhrSettings") })))
: ((o = new f(t, { key: e, url: i, type: "obj", cache: l, extension: "obj", xhrSettings: r, config: { flipUV: s } })),
n && (a = new f(t, { key: e, url: n, type: "mat", cache: l, extension: "mat", xhrSettings: r }))),
d.call(this, t, "obj", e, [o, a]);
},
addToCache: function () {
var t, e, i;
this.isReadyToProcess() && ((t = this.files[0]), (e = this.files[1]), (i = r(t.data, t.config.flipUV)), e && (i.materials = o(e.data)), t.cache.add(t.key, i), (this.complete = !0));
},
});
s.register("obj", function (t, e, i, n, s) {
var r;
if (Array.isArray(t)) for (var o = 0; o < t.length; o++) (r = new a(this, t[o])), this.addFile(r.files);
else (r = new a(this, t, e, i, n, s)), this.addFile(r.files);
return this;
}),
(t.exports = a);
},
function (t, e, i) {
var n = i(0),
s = i(21),
r = i(8),
o = i(61),
a = new n({
Extends: o,
initialize: function (t, e, i, n, s) {
o.call(this, t, e, i, n, s), (this.type = "packfile");
},
onProcess: function () {
this.state !== s.FILE_POPULATED && ((this.state = s.FILE_PROCESSING), (this.data = JSON.parse(this.xhrLoader.responseText))), this.loader.addPack(this.data, this.config), this.onProcessComplete();
},
});
r.register("pack", function (t, e, i, n) {
if (Array.isArray(t)) for (var s = 0; s < t.length; s++) this.addFile(new a(this, t[s]));
else this.addFile(new a(this, t, e, n, i));
return this;
}),
(t.exports = a);
},
function (t, e, i) {
var n = i(0),
l = i(21),
u = i(23),
s = i(8),
c = i(2),
d = i(7),
o = new n({
Extends: u,
initialize: function (t, e, i, n, s, r) {
var o,
a = "js";
d(e) && ((e = c((o = e), "key")), (i = c(o, "url")), (r = c(o, "xhrSettings")), (a = c(o, "extension", a)), (n = c(o, "start")), (s = c(o, "mapping")));
var h = { type: "plugin", cache: !1, extension: a, responseType: "text", key: e, url: i, xhrSettings: r, config: { start: n, mapping: s } };
u.call(this, t, h), "function" == typeof i && ((this.data = i), (this.state = l.FILE_POPULATED));
},
onProcess: function () {
var t,
e = this.loader.systems.plugins,
i = this.config,
n = c(i, "start", !1),
s = c(i, "mapping", null);
this.state === l.FILE_POPULATED
? e.install(this.key, this.data, n, s)
: ((this.state = l.FILE_PROCESSING),
(this.data = document.createElement("script")),
(this.data.language = "javascript"),
(this.data.type = "text/javascript"),
(this.data.defer = !1),
(this.data.text = this.xhrLoader.responseText),
document.head.appendChild(this.data),
(t = e.install(this.key, window[this.key], n, s)),
(n || s) && ((this.loader.systems[s] = t), (this.loader.scene[s] = t))),
this.onProcessComplete();
},
});
s.register("plugin", function (t, e, i, n, s) {
if (Array.isArray(t)) for (var r = 0; r < t.length; r++) this.addFile(new o(this, t[r]));
else this.addFile(new o(this, t, e, i, n, s));
return this;
}),
(t.exports = o);
},
function (t, e, i) {
var n = i(0),
s = i(21),
a = i(23),
r = i(8),
h = i(2),
l = i(7),
o = new n({
Extends: a,
initialize: function (t, e, i, n) {
var s,
r = "js";
l(e) && ((e = h((s = e), "key")), (i = h(s, "url")), (n = h(s, "xhrSettings")), (r = h(s, "extension", r)));
var o = { type: "text", extension: r, responseType: "text", key: e, url: i, xhrSettings: n };
a.call(this, t, o);
},
onProcess: function () {
(this.state = s.FILE_PROCESSING), (this.data = this.xhrLoader.responseText), this.onProcessComplete();
},
addToCache: function () {
var t = this.data.concat("(function(){\nreturn new " + this.key + "();\n}).call(this);"),
e = eval;
this.loader.sceneManager.add(this.key, e(t)), (this.complete = !0);
},
});
r.register("sceneFile", function (t, e, i) {
if (Array.isArray(t)) for (var n = 0; n < t.length; n++) this.addFile(new o(this, t[n]));
else this.addFile(new o(this, t, e, i));
return this;
}),
(t.exports = o);
},
function (t, e, i) {
var n = i(0),
l = i(21),
u = i(23),
s = i(8),
c = i(2),
d = i(7),
o = new n({
Extends: u,
initialize: function (t, e, i, n, s, r) {
var o,
a = "js";
d(e) && ((e = c((o = e), "key")), (i = c(o, "url")), (r = c(o, "xhrSettings")), (a = c(o, "extension", a)), (n = c(o, "systemKey")), (s = c(o, "sceneKey")));
var h = { type: "scenePlugin", cache: !1, extension: a, responseType: "text", key: e, url: i, xhrSettings: r, config: { systemKey: n, sceneKey: s } };
u.call(this, t, h), "function" == typeof i && ((this.data = i), (this.state = l.FILE_POPULATED));
},
onProcess: function () {
var t = this.loader.systems.plugins,
e = this.config,
i = this.key,
n = c(e, "systemKey", i),
s = c(e, "sceneKey", i);
this.state === l.FILE_POPULATED
? t.installScenePlugin(n, this.data, s, this.loader.scene, !0)
: ((this.state = l.FILE_PROCESSING),
(this.data = document.createElement("script")),
(this.data.language = "javascript"),
(this.data.type = "text/javascript"),
(this.data.defer = !1),
(this.data.text = this.xhrLoader.responseText),
document.head.appendChild(this.data),
t.installScenePlugin(n, window[this.key], s, this.loader.scene, !0)),
this.onProcessComplete();
},
});
s.register("scenePlugin", function (t, e, i, n, s) {
if (Array.isArray(t)) for (var r = 0; r < t.length; r++) this.addFile(new o(this, t[r]));
else this.addFile(new o(this, t, e, i, n, s));
return this;
}),
(t.exports = o);
},
function (t, e, i) {
var n = i(0),
s = i(8),
r = i(71),
o = new n({
Extends: r,
initialize: function (t, e, i, n, s) {
r.call(this, t, e, i, s, n), (this.type = "spritesheet");
},
addToCache: function () {
var t = this.cache.addSpriteSheet(this.key, this.data, this.config);
this.pendingDestroy(t);
},
});
s.register("spritesheet", function (t, e, i, n) {
if (Array.isArray(t)) for (var s = 0; s < t.length; s++) this.addFile(new o(this, t[s]));
else this.addFile(new o(this, t, e, i, n));
return this;
}),
(t.exports = o);
},
function (t, e, i) {
var n = i(0),
f = i(21),
p = i(23),
s = i(8),
h = i(2),
l = i(7),
r = new n({
Extends: p,
initialize: function (t, e, i, n, s) {
var r,
o = "svg";
l(e) && ((e = h((r = e), "key")), (i = h(r, "url")), (n = h(r, "svgConfig", {})), (s = h(r, "xhrSettings")), (o = h(r, "extension", o)));
var a = { type: "svg", cache: t.textureManager, extension: o, responseType: "text", key: e, url: i, xhrSettings: s, config: { width: h(n, "width"), height: h(n, "height"), scale: h(n, "scale") } };
p.call(this, t, a);
},
onProcess: function () {
this.state = f.FILE_PROCESSING;
var t = this.xhrLoader.responseText,
e = [t],
i = this.config.width,
n = this.config.height,
s = this.config.scale;
t: if ((i && n) || s) {
var r,
o = new DOMParser().parseFromString(t, "text/xml").getElementsByTagName("svg")[0],
a = o.hasAttribute("viewBox"),
h = parseFloat(o.getAttribute("width")),
l = parseFloat(o.getAttribute("height"));
if ((!a && h && l ? o.setAttribute("viewBox", "0 0 " + h + " " + l) : !a || h || l || ((h = (r = o.getAttribute("viewBox").split(/\s+|,/))[2]), (l = r[3])), s)) {
if (!h || !l) break t;
(i = h * s), (n = l * s);
}
o.setAttribute("width", i.toString() + "px"), o.setAttribute("height", n.toString() + "px"), (e = [new XMLSerializer().serializeToString(o)]);
}
try {
var u = new window.Blob(e, { type: "image/svg+xml;charset=utf-8" });
} catch (t) {
return void this.onProcessError();
}
(this.data = new Image()), (this.data.crossOrigin = this.crossOrigin);
var c = this,
d = !1;
(this.data.onload = function () {
d || p.revokeObjectURL(c.data), c.onProcessComplete();
}),
(this.data.onerror = function () {
d ? c.onProcessError() : ((d = !0), p.revokeObjectURL(c.data), (c.data.src = "data:image/svg+xml," + encodeURIComponent(e.join(""))));
}),
p.createObjectURL(this.data, u, "image/svg+xml");
},
addToCache: function () {
var t = this.cache.addImage(this.key, this.data);
this.pendingDestroy(t);
},
});
s.register("svg", function (t, e, i, n) {
if (Array.isArray(t)) for (var s = 0; s < t.length; s++) this.addFile(new r(this, t[s]));
else this.addFile(new r(this, t, e, i, n));
return this;
}),
(t.exports = r);
},
function (t, e, i) {
var n = i(0),
s = i(21),
a = i(23),
r = i(8),
h = i(2),
l = i(7),
u = i(40),
o = new n({
Extends: a,
initialize: function (t, e, i, n) {
var s,
r = "csv";
l(e) && ((e = h((s = e), "key")), (i = h(s, "url")), (n = h(s, "xhrSettings")), (r = h(s, "extension", r)));
var o = { type: "tilemapCSV", cache: t.cacheManager.tilemap, extension: r, responseType: "text", key: e, url: i, xhrSettings: n };
a.call(this, t, o), (this.tilemapFormat = u.CSV);
},
onProcess: function () {
(this.state = s.FILE_PROCESSING), (this.data = this.xhrLoader.responseText), this.onProcessComplete();
},
addToCache: function () {
var t = { format: this.tilemapFormat, data: this.data };
this.cache.add(this.key, t), this.pendingDestroy(t);
},
});
r.register("tilemapCSV", function (t, e, i) {
if (Array.isArray(t)) for (var n = 0; n < t.length; n++) this.addFile(new o(this, t[n]));
else this.addFile(new o(this, t, e, i));
return this;
}),
(t.exports = o);
},
function (t, e, i) {
var n = i(0),
s = i(8),
r = i(61),
o = i(40),
a = new n({
Extends: r,
initialize: function (t, e, i, n) {
r.call(this, t, e, i, n), (this.type = "tilemapJSON"), (this.cache = t.cacheManager.tilemap);
},
addToCache: function () {
var t = { format: o.WELTMEISTER, data: this.data };
this.cache.add(this.key, t), this.pendingDestroy(t);
},
});
s.register("tilemapImpact", function (t, e, i) {
if (Array.isArray(t)) for (var n = 0; n < t.length; n++) this.addFile(new a(this, t[n]));
else this.addFile(new a(this, t, e, i));
return this;
}),
(t.exports = a);
},
function (t, e, i) {
var n = i(0),
s = i(8),
r = i(61),
o = i(40),
a = new n({
Extends: r,
initialize: function (t, e, i, n) {
r.call(this, t, e, i, n), (this.type = "tilemapJSON"), (this.cache = t.cacheManager.tilemap);
},
addToCache: function () {
var t = { format: o.TILED_JSON, data: this.data };
this.cache.add(this.key, t), this.pendingDestroy(t);
},
});
s.register("tilemapTiledJSON", function (t, e, i) {
if (Array.isArray(t)) for (var n = 0; n < t.length; n++) this.addFile(new a(this, t[n]));
else this.addFile(new a(this, t, e, i));
return this;
}),
(t.exports = a);
},
function (t, e, i) {
var n = i(0),
s = i(8),
l = i(2),
u = i(71),
c = i(7),
d = i(49),
f = i(242),
a = new n({
Extends: d,
initialize: function (t, e, i, n, s, r) {
var o,
a,
h = c(e)
? ((e = l((a = e), "key")),
(o = new u(t, { key: e, url: l(a, "textureURL"), extension: l(a, "textureExtension", "png"), normalMap: l(a, "normalMap"), xhrSettings: l(a, "textureXhrSettings") })),
new f(t, { key: e, url: l(a, "atlasURL"), extension: l(a, "atlasExtension", "txt"), xhrSettings: l(a, "atlasXhrSettings") }))
: ((o = new u(t, e, i, s)), new f(t, e, n, r));
o.linkFile ? d.call(this, t, "unityatlas", e, [o, h, o.linkFile]) : d.call(this, t, "unityatlas", e, [o, h]);
},
addToCache: function () {
var t, e, i;
this.isReadyToProcess() &&
((t = this.files[0]),
(e = this.files[1]),
(i = this.files[2] ? this.files[2].data : null),
this.loader.textureManager.addUnityAtlas(t.key, t.data, e.data, i),
e.pendingDestroy(),
(this.complete = !0));
},
});
s.register("unityAtlas", function (t, e, i, n, s) {
var r;
if (Array.isArray(t)) for (var o = 0; o < t.length; o++) (r = new a(this, t[o])), this.addFile(r.files);
else (r = new a(this, t, e, i, n, s)), this.addFile(r.files);
return this;
}),
(t.exports = a);
},
function (t, e, i) {
var n = i(0),
s = i(21),
h = i(23),
r = i(8),
o = i(155),
l = i(2),
u = i(7),
c = new n({
Extends: h,
initialize: function (t, e, i, n, s, r, o) {
void 0 === n && (n = "loadeddata"), void 0 === s && (s = !1), void 0 === r && (r = !1), "loadeddata" !== n && "canplay" !== n && "canplaythrough" !== n && (n = "loadeddata");
var a = { type: "video", cache: t.cacheManager.video, extension: i.type, responseType: "blob", key: e, url: i.url, xhrSettings: o, config: { loadEvent: n, asBlob: s, noAudio: r } };
(this.onLoadCallback = this.onVideoLoadHandler.bind(this)), (this.onErrorCallback = this.onVideoErrorHandler.bind(this)), h.call(this, t, a);
},
onProcess: function () {
var t, e;
(this.state = s.FILE_PROCESSING),
this.config.asBlob
? ((t = this.createVideoElement()),
(this.data = t),
((e = this).data.onloadeddata = function () {
e.onProcessComplete();
}),
(this.data.onerror = function () {
h.revokeObjectURL(e.data), e.onProcessError();
}),
h.createObjectURL(t, this.xhrLoader.response, ""),
t.load())
: this.onProcessComplete();
},
createVideoElement: function () {
var t = document.createElement("video");
return (
(t.controls = !1),
(t.crossOrigin = this.loader.crossOrigin),
this.config.noAudio && ((t.muted = !0), (t.defaultMuted = !0), t.setAttribute("autoplay", "autoplay")),
t.setAttribute("playsinline", "playsinline"),
t.setAttribute("preload", "auto"),
t
);
},
onVideoLoadHandler: function (t) {
var e = t.target;
e.removeEventListener(this.config.loadEvent, this.onLoadCallback, !0), e.removeEventListener("error", this.onErrorCallback, !0), (this.data = e), this.resetXHR(), this.loader.nextFile(this, !0);
},
onVideoErrorHandler: function (t) {
var e = t.target;
e && (e.removeEventListener(this.config.loadEvent, this.onLoadCallback, !0), e.removeEventListener("error", this.onErrorCallback, !0)), this.resetXHR(), this.loader.nextFile(this, !1);
},
load: function () {
var t,
e = this.config.loadEvent;
this.config.asBlob
? h.prototype.load.call(this)
: ((this.percentComplete = 0),
(t = this.createVideoElement()).addEventListener(e, this.onLoadCallback, !0),
t.addEventListener("error", this.onErrorCallback, !0),
(t.src = o(this, this.loader.baseURL)),
t.load());
},
});
(c.create = function (t, e, i, n, s, r, o) {
var a = t.systems.game;
u(e) && ((i = l(e, "url", [])), (n = l(e, "loadEvent", "loadeddata")), (s = l(e, "asBlob", !1)), (r = l(e, "noAudio", !1)), (o = l(e, "xhrSettings")), (e = l(e, "key")));
var h = c.getVideoURL(a, i);
if (h) return new c(t, e, h, n, s, r, o);
}),
(c.getVideoURL = function (t, e) {
Array.isArray(e) || (e = [e]);
for (var i = 0; i < e.length; i++) {
var n,
s = l(e[i], "url", e[i]);
if (0 === s.indexOf("blob:")) return { url: s, type: "" };
if (((n = 0 === s.indexOf("data:") ? s.split(",")[0].match(/\/(.*?);/) : s.match(/\.([a-zA-Z0-9]+)($|\?)/)), (n = l(e[i], "type", n ? n[1] : "").toLowerCase()), t.device.video[n]))
return { url: s, type: n };
}
return null;
}),
r.register("video", function (t, e, i, n, s, r) {
var o;
if (Array.isArray(t)) for (var a = 0; a < t.length; a++) (o = c.create(this, t[a])) && this.addFile(o);
else (o = c.create(this, t, e, i, n, s, r)) && this.addFile(o);
return this;
}),
(t.exports = c);
},
function (t, e, i) {
var n = i(0),
s = i(21),
r = i(149),
o = i(9),
a = i(95),
h = i(8),
v = i(2),
l = i(24),
u = i(20),
c = i(156),
d = new n({
Extends: o,
initialize: function (t) {
o.call(this);
var e = t.sys.game.config,
i = t.sys.settings.loader;
(this.scene = t),
(this.systems = t.sys),
(this.cacheManager = t.sys.cache),
(this.textureManager = t.sys.textures),
(this.sceneManager = t.sys.game.scene),
h.install(this),
(this.prefix = ""),
(this.path = ""),
(this.baseURL = ""),
this.setBaseURL(v(i, "baseURL", e.loaderBaseURL)),
this.setPath(v(i, "path", e.loaderPath)),
this.setPrefix(v(i, "prefix", e.loaderPrefix)),
(this.maxParallelDownloads = v(i, "maxParallelDownloads", e.loaderMaxParallelDownloads)),
(this.xhr = c(
v(i, "responseType", e.loaderResponseType),
v(i, "async", e.loaderAsync),
v(i, "user", e.loaderUser),
v(i, "password", e.loaderPassword),
v(i, "timeout", e.loaderTimeout),
v(i, "withCredentials", e.loaderWithCredentials)
)),
(this.crossOrigin = v(i, "crossOrigin", e.loaderCrossOrigin)),
(this.totalToLoad = 0),
(this.progress = 0),
(this.list = new r()),
(this.inflight = new r()),
(this.queue = new r()),
(this._deleteQueue = new r()),
(this.totalFailed = 0),
(this.totalComplete = 0),
(this.state = s.LOADER_IDLE),
(this.multiKeyIndex = 0),
t.sys.events.once(u.BOOT, this.boot, this),
t.sys.events.on(u.START, this.pluginStart, this);
},
boot: function () {
this.systems.events.once(u.DESTROY, this.destroy, this);
},
pluginStart: function () {
this.systems.events.once(u.SHUTDOWN, this.shutdown, this);
},
setBaseURL: function (t) {
return void 0 === t && (t = ""), "" !== t && "/" !== t.substr(-1) && (t = t.concat("/")), (this.baseURL = t), this;
},
setPath: function (t) {
return void 0 === t && (t = ""), "" !== t && "/" !== t.substr(-1) && (t = t.concat("/")), (this.path = t), this;
},
setPrefix: function (t) {
return void 0 === t && (t = ""), (this.prefix = t), this;
},
setCORS: function (t) {
return (this.crossOrigin = t), this;
},
addFile: function (t) {
Array.isArray(t) || (t = [t]);
for (var e = 0; e < t.length; e++) {
var i = t[e];
this.keyExists(i) || (this.list.set(i), this.emit(a.ADD, i.key, i.type, this, i), this.isLoading() && (this.totalToLoad++, this.updateProgress()));
}
},
keyExists: function (e) {
var i = e.hasCacheConflict();
return (
i ||
this.list.iterate(function (t) {
if (t.type === e.type && t.key === e.key) return !(i = !0);
}),
!i &&
this.isLoading() &&
(this.inflight.iterate(function (t) {
if (t.type === e.type && t.key === e.key) return !(i = !0);
}),
this.queue.iterate(function (t) {
if (t.type === e.type && t.key === e.key) return !(i = !0);
})),
i
);
},
addPack: function (t, e) {
e && t.hasOwnProperty(e) && (t = { packKey: t[e] });
var i = 0,
n = this.baseURL,
s = this.path,
r = this.prefix;
for (var o in t)
if (Object.prototype.hasOwnProperty.call(t, o)) {
var a = t[o],
h = v(a, "baseURL", n),
l = v(a, "path", s),
u = v(a, "prefix", r),
c = v(a, "files", null),
d = v(a, "defaultType", "void");
if (Array.isArray(c)) {
this.setBaseURL(h), this.setPath(l), this.setPrefix(u);
for (var f = 0; f < c.length; f++) {
var p = c[f],
g = p.hasOwnProperty("type") ? p.type : d;
this[g] && (this[g](p), i++);
}
}
}
return this.setBaseURL(n), this.setPath(s), this.setPrefix(r), 0 < i;
},
isLoading: function () {
return this.state === s.LOADER_LOADING || this.state === s.LOADER_PROCESSING;
},
isReady: function () {
return this.state === s.LOADER_IDLE || this.state === s.LOADER_COMPLETE;
},
start: function () {
this.isReady() &&
((this.progress = 0),
(this.totalFailed = 0),
(this.totalComplete = 0),
(this.totalToLoad = this.list.size),
this.emit(a.START, this),
0 === this.list.size
? this.loadComplete()
: ((this.state = s.LOADER_LOADING), this.inflight.clear(), this.queue.clear(), this.updateProgress(), this.checkLoadQueue(), this.systems.events.on(u.UPDATE, this.update, this)));
},
updateProgress: function () {
(this.progress = 1 - (this.list.size + this.inflight.size) / this.totalToLoad), this.emit(a.PROGRESS, this.progress);
},
update: function () {
this.state === s.LOADER_LOADING && 0 < this.list.size && this.inflight.size < this.maxParallelDownloads && this.checkLoadQueue();
},
checkLoadQueue: function () {
this.list.each(function (t) {
if (
((t.state === s.FILE_POPULATED || (t.state === s.FILE_PENDING && this.inflight.size < this.maxParallelDownloads)) &&
(this.inflight.set(t), this.list.delete(t), t.crossOrigin || (t.crossOrigin = this.crossOrigin), t.load()),
this.inflight.size === this.maxParallelDownloads)
)
return !1;
}, this);
},
nextFile: function (t, e) {
this.inflight &&
(this.inflight.delete(t),
this.updateProgress(),
e
? (this.totalComplete++, this.queue.set(t), this.emit(a.FILE_LOAD, t), t.onProcess())
: (this.totalFailed++, this._deleteQueue.set(t), this.emit(a.FILE_LOAD_ERROR, t), this.fileProcessComplete(t)));
},
fileProcessComplete: function (t) {
this.scene &&
this.systems &&
this.systems.game &&
!this.systems.game.pendingDestroy &&
(t.state === s.FILE_ERRORED
? t.multiFile && t.multiFile.onFileFailed(t)
: t.state === s.FILE_COMPLETE && (t.multiFile ? t.multiFile.isReadyToProcess() && t.multiFile.addToCache() : t.addToCache()),
this.queue.delete(t),
0 === this.list.size && 0 === this.inflight.size && 0 === this.queue.size && this.loadComplete());
},
loadComplete: function () {
this.emit(a.POST_PROCESS, this),
this.list.clear(),
this.inflight.clear(),
this.queue.clear(),
(this.progress = 1),
(this.state = s.LOADER_COMPLETE),
this.systems.events.off(u.UPDATE, this.update, this),
this._deleteQueue.iterateLocal("destroy"),
this._deleteQueue.clear(),
this.emit(a.COMPLETE, this, this.totalComplete, this.totalFailed);
},
flagForRemoval: function (t) {
this._deleteQueue.set(t);
},
saveJSON: function (t, e) {
return this.save(JSON.stringify(t), e);
},
save: function (t, e, i) {
void 0 === e && (e = "file.json"), void 0 === i && (i = "application/json");
var n = new Blob([t], { type: i }),
s = URL.createObjectURL(n),
r = document.createElement("a");
return (r.download = e), (r.textContent = "Download " + e), (r.href = s), r.click(), this;
},
reset: function () {
this.list.clear(), this.inflight.clear(), this.queue.clear();
var t = this.systems.game.config,
e = this.systems.settings.loader;
this.setBaseURL(v(e, "baseURL", t.loaderBaseURL)), this.setPath(v(e, "path", t.loaderPath)), this.setPrefix(v(e, "prefix", t.loaderPrefix)), (this.state = s.LOADER_IDLE);
},
shutdown: function () {
this.reset(), (this.state = s.LOADER_SHUTDOWN), this.systems.events.off(u.UPDATE, this.update, this), this.systems.events.off(u.SHUTDOWN, this.shutdown, this);
},
destroy: function () {
this.shutdown(),
(this.state = s.LOADER_DESTROYED),
this.systems.events.off(u.UPDATE, this.update, this),
this.systems.events.off(u.START, this.pluginStart, this),
(this.list = null),
(this.inflight = null),
(this.queue = null),
(this.scene = null),
(this.systems = null),
(this.textureManager = null),
(this.cacheManager = null),
(this.sceneManager = null);
},
});
l.register("Loader", d, "load"), (t.exports = d);
},
function (t, e, i) {
var n = i(62),
s = i(17)(
!1,
(s = {
ArcadePhysics: i(1367),
Body: i(527),
Collider: i(528),
Components: i(243),
Events: i(245),
Factory: i(521),
GetOverlapX: i(246),
GetOverlapY: i(247),
SeparateX: i(537),
SeparateY: i(538),
Group: i(524),
Image: i(522),
Sprite: i(157),
StaticBody: i(539),
StaticGroup: i(525),
Tilemap: i(1391),
World: i(526),
}),
n
);
t.exports = s;
},
function (t, e, i) {
var n = i(0),
s = i(36),
o = i(50),
c = i(353),
r = i(521),
a = i(2),
h = i(127),
l = i(523),
u = i(244),
d = i(24),
f = i(20),
p = i(3),
g = i(526),
v = new n({
initialize: function (t) {
(this.scene = t), (this.systems = t.sys), (this.config = this.getConfig()), this.world, this.add, t.sys.events.once(f.BOOT, this.boot, this), t.sys.events.on(f.START, this.start, this);
},
boot: function () {
(this.world = new g(this.scene, this.config)), (this.add = new r(this.world)), this.systems.events.once(f.DESTROY, this.destroy, this);
},
start: function () {
this.world || ((this.world = new g(this.scene, this.config)), (this.add = new r(this.world)));
var t = this.systems.events;
a(this.config, "customUpdate", !1) || t.on(f.UPDATE, this.world.update, this.world), t.on(f.POST_UPDATE, this.world.postUpdate, this.world), t.once(f.SHUTDOWN, this.shutdown, this);
},
enableUpdate: function () {
this.systems.events.on(f.UPDATE, this.world.update, this.world);
},
disableUpdate: function () {
this.systems.events.off(f.UPDATE, this.world.update, this.world);
},
getConfig: function () {
var t = this.systems.game.config.physics,
e = this.systems.settings.physics;
return h(a(e, "arcade", {}), a(t, "arcade", {}));
},
overlap: function (t, e, i, n, s) {
return void 0 === i && (i = null), void 0 === n && (n = null), void 0 === s && (s = i), this.world.collideObjects(t, e, i, n, s, !0);
},
collide: function (t, e, i, n, s) {
return void 0 === i && (i = null), void 0 === n && (n = null), void 0 === s && (s = i), this.world.collideObjects(t, e, i, n, s, !1);
},
collideTiles: function (t, e, i, n, s) {
return this.world.collideTiles(t, e, i, n, s);
},
overlapTiles: function (t, e, i, n, s) {
return this.world.overlapTiles(t, e, i, n, s);
},
pause: function () {
return this.world.pause();
},
resume: function () {
return this.world.resume();
},
accelerateTo: function (t, e, i, n, s, r) {
void 0 === n && (n = 60);
var o = Math.atan2(i - t.y, e - t.x);
return t.body.acceleration.setToPolar(o, n), void 0 !== s && void 0 !== r && t.body.maxVelocity.set(s, r), o;
},
accelerateToObject: function (t, e, i, n, s) {
return this.accelerateTo(t, e.x, e.y, i, n, s);
},
closest: function (t, e) {
e = e || this.world.bodies.entries;
for (var i = Number.MAX_VALUE, n = null, s = t.x, r = t.y, o = e.length, a = 0; a < o; a++) {
var h,
l = e[a],
u = l.body || l;
t !== l && t !== u && t !== u.gameObject && t !== u.center && (h = c(s, r, u.center.x, u.center.y)) < i && ((n = l), (i = h));
}
return n;
},
furthest: function (t, e) {
e = e || this.world.bodies.entries;
for (var i = -1, n = null, s = t.x, r = t.y, o = e.length, a = 0; a < o; a++) {
var h,
l = e[a],
u = l.body || l;
t !== l && t !== u && t !== u.gameObject && t !== u.center && i < (h = c(s, r, u.center.x, u.center.y)) && ((n = l), (i = h));
}
return n;
},
moveTo: function (t, e, i, n, s) {
void 0 === n && (n = 60), void 0 === s && (s = 0);
var r = Math.atan2(i - t.y, e - t.x);
return 0 < s && (n = o(t.x, t.y, e, i) / (s / 1e3)), t.body.velocity.setToPolar(r, n), r;
},
moveToObject: function (t, e, i, n) {
return this.moveTo(t, e.x, e.y, i, n);
},
velocityFromAngle: function (t, e, i) {
return void 0 === e && (e = 60), void 0 === i && (i = new p()), i.setToPolar(s(t), e);
},
velocityFromRotation: function (t, e, i) {
return void 0 === e && (e = 60), void 0 === i && (i = new p()), i.setToPolar(t, e);
},
overlapRect: function (t, e, i, n, s, r) {
return u(this.world, t, e, i, n, s, r);
},
overlapCirc: function (t, e, i, n, s) {
return l(this.world, t, e, i, n, s);
},
shutdown: function () {
var t;
this.world &&
((t = this.systems.events).off(f.UPDATE, this.world.update, this.world),
t.off(f.POST_UPDATE, this.world.postUpdate, this.world),
t.off(f.SHUTDOWN, this.shutdown, this),
this.add.destroy(),
this.world.destroy(),
(this.add = null),
(this.world = null));
},
destroy: function () {
this.shutdown(), this.scene.sys.events.off(f.START, this.start, this), (this.scene = null), (this.systems = null);
},
});
d.register("ArcadePhysics", v, "arcadePhysics"), (t.exports = v);
},
function (t, e) {
t.exports = {
setAcceleration: function (t, e) {
return this.body.acceleration.set(t, e), this;
},
setAccelerationX: function (t) {
return (this.body.acceleration.x = t), this;
},
setAccelerationY: function (t) {
return (this.body.acceleration.y = t), this;
},
};
},
function (t, e) {
t.exports = {
setAngularVelocity: function (t) {
return (this.body.angularVelocity = t), this;
},
setAngularAcceleration: function (t) {
return (this.body.angularAcceleration = t), this;
},
setAngularDrag: function (t) {
return (this.body.angularDrag = t), this;
},
};
},
function (t, e) {
t.exports = {
setBounce: function (t, e) {
return this.body.bounce.set(t, e), this;
},
setBounceX: function (t) {
return (this.body.bounce.x = t), this;
},
setBounceY: function (t) {
return (this.body.bounce.y = t), this;
},
setCollideWorldBounds: function (t, e, i) {
return this.body.setCollideWorldBounds(t, e, i), this;
},
};
},
function (t, e) {
t.exports = {
setDebug: function (t, e, i) {
return (this.debugShowBody = t), (this.debugShowVelocity = e), (this.debugBodyColor = i), this;
},
setDebugBodyColor: function (t) {
return (this.body.debugBodyColor = t), this;
},
debugShowBody: {
get: function () {
return this.body.debugShowBody;
},
set: function (t) {
this.body.debugShowBody = t;
},
},
debugShowVelocity: {
get: function () {
return this.body.debugShowVelocity;
},
set: function (t) {
this.body.debugShowVelocity = t;
},
},
debugBodyColor: {
get: function () {
return this.body.debugBodyColor;
},
set: function (t) {
this.body.debugBodyColor = t;
},
},
};
},
function (t, e) {
t.exports = {
setDrag: function (t, e) {
return this.body.drag.set(t, e), this;
},
setDragX: function (t) {
return (this.body.drag.x = t), this;
},
setDragY: function (t) {
return (this.body.drag.y = t), this;
},
setDamping: function (t) {
return (this.body.useDamping = t), this;
},
};
},
function (t, e) {
t.exports = {
enableBody: function (t, e, i, n, s) {
return t && this.body.reset(e, i), n && (this.body.gameObject.active = !0), s && (this.body.gameObject.visible = !0), (this.body.enable = !0), this;
},
disableBody: function (t, e) {
return void 0 === t && (t = !1), void 0 === e && (e = !1), this.body.stop(), (this.body.enable = !1), t && (this.body.gameObject.active = !1), e && (this.body.gameObject.visible = !1), this;
},
refreshBody: function () {
return this.body.updateFromGameObject(), this;
},
};
},
function (t, e) {
t.exports = {
setFriction: function (t, e) {
return this.body.friction.set(t, e), this;
},
setFrictionX: function (t) {
return (this.body.friction.x = t), this;
},
setFrictionY: function (t) {
return (this.body.friction.y = t), this;
},
};
},
function (t, e) {
t.exports = {
setGravity: function (t, e) {
return this.body.gravity.set(t, e), this;
},
setGravityX: function (t) {
return (this.body.gravity.x = t), this;
},
setGravityY: function (t) {
return (this.body.gravity.y = t), this;
},
};
},
function (t, e) {
t.exports = {
setImmovable: function (t) {
return void 0 === t && (t = !0), (this.body.immovable = t), this;
},
};
},
function (t, e) {
t.exports = {
setMass: function (t) {
return (this.body.mass = t), this;
},
};
},
function (t, e) {
t.exports = {
setPushable: function (t) {
return void 0 === t && (t = !0), (this.body.pushable = t), this;
},
};
},
function (t, e) {
t.exports = {
setOffset: function (t, e) {
return this.body.setOffset(t, e), this;
},
setSize: function (t, e, i) {
return this.body.setSize(t, e, i), this;
},
setBodySize: function (t, e, i) {
return this.body.setSize(t, e, i), this;
},
setCircle: function (t, e, i) {
return this.body.setCircle(t, e, i), this;
},
};
},
function (t, e) {
t.exports = {
setVelocity: function (t, e) {
return this.body.setVelocity(t, e), this;
},
setVelocityX: function (t) {
return this.body.setVelocityX(t), this;
},
setVelocityY: function (t) {
return this.body.setVelocityY(t), this;
},
setMaxVelocity: function (t, e) {
return this.body.maxVelocity.set(t, e), this;
},
};
},
function (t, e) {
t.exports = "collide";
},
function (t, e) {
t.exports = "overlap";
},
function (t, e) {
t.exports = "pause";
},
function (t, e) {
t.exports = "resume";
},
function (t, e) {
t.exports = "tilecollide";
},
function (t, e) {
t.exports = "tileoverlap";
},
function (t, e) {
t.exports = "worldbounds";
},
function (t, e) {
t.exports = "worldstep";
},
function (t, e) {
var r,
o,
a,
h,
l,
u,
c,
d,
f,
p,
g,
v,
y,
m,
x,
b,
w,
T = function () {
return p && x && o.blocked.right
? (r.processX(-w, c, !1, !0), 1)
: f && b && o.blocked.left
? (r.processX(w, c, !0), 1)
: y && b && r.blocked.right
? (o.processX(-w, d, !1, !0), 2)
: v && x && r.blocked.left
? (o.processX(w, d, !0), 2)
: 0;
},
S = function (t) {
var e;
return (
a && h
? ((w *= 0.5), 0 === t || 3 === t ? (r.processX(w, l), o.processX(-w, u)) : (r.processX(-w, l), o.processX(w, u)))
: a && !h
? 0 === t || 3 === t
? r.processX(w, c, !0)
: r.processX(-w, c, !1, !0)
: !a && h
? 0 === t || 3 === t
? o.processX(-w, d, !1, !0)
: o.processX(w, d, !0)
: ((e = 0.5 * w),
0 === t
? m
? (r.processX(w, 0, !0), o.processX(0, null, !1, !0))
: y
? (r.processX(e, 0, !0), o.processX(-e, 0, !1, !0))
: (r.processX(e, o.velocity.x, !0), o.processX(-e, null, !1, !0))
: 1 === t
? g
? (r.processX(0, null, !1, !0), o.processX(w, 0, !0))
: p
? (r.processX(-e, 0, !1, !0), o.processX(e, 0, !0))
: (r.processX(-e, null, !1, !0), o.processX(e, r.velocity.x, !0))
: 2 === t
? m
? (r.processX(-w, 0, !1, !0), o.processX(0, null, !0))
: v
? (r.processX(-e, 0, !1, !0), o.processX(e, 0, !0))
: (r.processX(-e, o.velocity.x, !1, !0), o.processX(e, null, !0))
: 3 === t &&
(g ? (r.processX(0, null, !0), o.processX(-w, 0, !1, !0)) : f ? (r.processX(e, 0, !0), o.processX(-e, 0, !1, !0)) : (r.processX(e, o.velocity.y, !0), o.processX(-e, null, !1, !0)))),
!0
);
};
t.exports = {
BlockCheck: T,
Check: function () {
var t = r.velocity.x,
e = o.velocity.x,
i = Math.sqrt((e * e * o.mass) / r.mass) * (0 < e ? 1 : -1),
n = Math.sqrt((t * t * r.mass) / o.mass) * (0 < t ? 1 : -1),
s = 0.5 * (i + n);
return (n -= s), (l = s + (i -= s) * r.bounce.x), (u = s + n * o.bounce.x), f && b ? S(0) : v && x ? S(1) : p && x ? S(2) : !(!y || !b) && S(3);
},
Set: function (t, e, i) {
o = e;
var n = (r = t).velocity.x,
s = o.velocity.x;
return (
(a = r.pushable),
(f = r._dx < 0),
(p = 0 < r._dx),
(g = 0 === r._dx),
(x = Math.abs(r.right - o.x) <= Math.abs(o.right - r.x)),
(c = s - n * r.bounce.x),
(h = o.pushable),
(v = o._dx < 0),
(y = 0 < o._dx),
(m = 0 === o._dx),
(b = !x),
(d = n - s * o.bounce.x),
(w = Math.abs(i)),
T()
);
},
Run: S,
RunImmovableBody1: function (t) {
1 === t ? (o.velocity.x = 0) : x ? o.processX(w, d, !0) : o.processX(-w, d, !1, !0), r.moves && ((o.y += (r.y - r.prev.y) * r.friction.y), (o._dy = o.y - o.prev.y));
},
RunImmovableBody2: function (t) {
2 === t ? (r.velocity.x = 0) : b ? r.processX(w, c, !0) : r.processX(-w, c, !1, !0), o.moves && ((r.y += (o.y - o.prev.y) * o.friction.y), (r._dy = r.y - r.prev.y));
},
};
},
function (t, e) {
var r,
o,
a,
h,
l,
u,
c,
d,
f,
p,
g,
v,
y,
m,
x,
b,
w,
T = function () {
return p && x && o.blocked.down
? (r.processY(-w, c, !1, !0), 1)
: f && b && o.blocked.up
? (r.processY(w, c, !0), 1)
: y && b && r.blocked.down
? (o.processY(-w, d, !1, !0), 2)
: v && x && r.blocked.up
? (o.processY(w, d, !0), 2)
: 0;
},
S = function (t) {
var e;
return (
a && h
? ((w *= 0.5), 0 === t || 3 === t ? (r.processY(w, l), o.processY(-w, u)) : (r.processY(-w, l), o.processY(w, u)))
: a && !h
? 0 === t || 3 === t
? r.processY(w, c, !0)
: r.processY(-w, c, !1, !0)
: !a && h
? 0 === t || 3 === t
? o.processY(-w, d, !1, !0)
: o.processY(w, d, !0)
: ((e = 0.5 * w),
0 === t
? m
? (r.processY(w, 0, !0), o.processY(0, null, !1, !0))
: y
? (r.processY(e, 0, !0), o.processY(-e, 0, !1, !0))
: (r.processY(e, o.velocity.y, !0), o.processY(-e, null, !1, !0))
: 1 === t
? g
? (r.processY(0, null, !1, !0), o.processY(w, 0, !0))
: p
? (r.processY(-e, 0, !1, !0), o.processY(e, 0, !0))
: (r.processY(-e, null, !1, !0), o.processY(e, r.velocity.y, !0))
: 2 === t
? m
? (r.processY(-w, 0, !1, !0), o.processY(0, null, !0))
: v
? (r.processY(-e, 0, !1, !0), o.processY(e, 0, !0))
: (r.processY(-e, o.velocity.y, !1, !0), o.processY(e, null, !0))
: 3 === t &&
(g ? (r.processY(0, null, !0), o.processY(-w, 0, !1, !0)) : f ? (r.processY(e, 0, !0), o.processY(-e, 0, !1, !0)) : (r.processY(e, o.velocity.y, !0), o.processY(-e, null, !1, !0)))),
!0
);
};
t.exports = {
BlockCheck: T,
Check: function () {
var t = r.velocity.y,
e = o.velocity.y,
i = Math.sqrt((e * e * o.mass) / r.mass) * (0 < e ? 1 : -1),
n = Math.sqrt((t * t * r.mass) / o.mass) * (0 < t ? 1 : -1),
s = 0.5 * (i + n);
return (n -= s), (l = s + (i -= s) * r.bounce.y), (u = s + n * o.bounce.y), f && b ? S(0) : v && x ? S(1) : p && x ? S(2) : !(!y || !b) && S(3);
},
Set: function (t, e, i) {
o = e;
var n = (r = t).velocity.y,
s = o.velocity.y;
return (
(a = r.pushable),
(f = r._dy < 0),
(p = 0 < r._dy),
(g = 0 === r._dy),
(x = Math.abs(r.bottom - o.y) <= Math.abs(o.bottom - r.y)),
(c = s - n * r.bounce.y),
(h = o.pushable),
(v = o._dy < 0),
(y = 0 < o._dy),
(m = 0 === o._dy),
(b = !x),
(d = n - s * o.bounce.y),
(w = Math.abs(i)),
T()
);
},
Run: S,
RunImmovableBody1: function (t) {
1 === t ? (o.velocity.y = 0) : x ? o.processY(w, d, !0) : o.processY(-w, d, !1, !0), r.moves && ((o.x += (r.x - r.prev.x) * r.friction.x), (o._dx = o.x - o.prev.x));
},
RunImmovableBody2: function (t) {
2 === t ? (r.velocity.y = 0) : b ? r.processY(w, c, !0) : r.processY(-w, c, !1, !0), o.moves && ((r.x += (o.x - o.prev.x) * o.friction.x), (r._dx = r.x - r.prev.x));
},
};
},
function (t, e, i) {
var n = { ProcessTileCallbacks: i(530), ProcessTileSeparationX: i(534), ProcessTileSeparationY: i(536), SeparateTile: i(532), TileCheckX: i(533), TileCheckY: i(535), TileIntersectsBody: i(248) };
t.exports = n;
},
function (t, e, i) {
var n = i(0),
r = i(3),
s = new n({
initialize: function () {
(this.boundsCenter = new r()), (this.centerDiff = new r());
},
parseBody: function (t) {
if (!(t = t.hasOwnProperty("body") ? t.body : t).hasOwnProperty("bounds") || !t.hasOwnProperty("centerOfMass")) return !1;
var e = this.boundsCenter,
i = this.centerDiff,
n = t.bounds.max.x - t.bounds.min.x,
s = t.bounds.max.y - t.bounds.min.y,
r = n * t.centerOfMass.x,
o = s * t.centerOfMass.y;
return e.set(n / 2, s / 2), i.set(r - e.x, o - e.y), !0;
},
getTopLeft: function (t, e, i) {
if ((void 0 === e && (e = 0), void 0 === i && (i = 0), this.parseBody(t))) {
var n = this.boundsCenter,
s = this.centerDiff;
return new r(e + n.x + s.x, i + n.y + s.y);
}
return !1;
},
getTopCenter: function (t, e, i) {
if ((void 0 === e && (e = 0), void 0 === i && (i = 0), this.parseBody(t))) {
var n = this.boundsCenter,
s = this.centerDiff;
return new r(e + s.x, i + n.y + s.y);
}
return !1;
},
getTopRight: function (t, e, i) {
if ((void 0 === e && (e = 0), void 0 === i && (i = 0), this.parseBody(t))) {
var n = this.boundsCenter,
s = this.centerDiff;
return new r(e - (n.x - s.x), i + n.y + s.y);
}
return !1;
},
getLeftCenter: function (t, e, i) {
if ((void 0 === e && (e = 0), void 0 === i && (i = 0), this.parseBody(t))) {
var n = this.boundsCenter,
s = this.centerDiff;
return new r(e + n.x + s.x, i + s.y);
}
return !1;
},
getCenter: function (t, e, i) {
if ((void 0 === e && (e = 0), void 0 === i && (i = 0), this.parseBody(t))) {
var n = this.centerDiff;
return new r(e + n.x, i + n.y);
}
return !1;
},
getRightCenter: function (t, e, i) {
if ((void 0 === e && (e = 0), void 0 === i && (i = 0), this.parseBody(t))) {
var n = this.boundsCenter,
s = this.centerDiff;
return new r(e - (n.x - s.x), i + s.y);
}
return !1;
},
getBottomLeft: function (t, e, i) {
if ((void 0 === e && (e = 0), void 0 === i && (i = 0), this.parseBody(t))) {
var n = this.boundsCenter,
s = this.centerDiff;
return new r(e + n.x + s.x, i - (n.y - s.y));
}
return !1;
},
getBottomCenter: function (t, e, i) {
if ((void 0 === e && (e = 0), void 0 === i && (i = 0), this.parseBody(t))) {
var n = this.boundsCenter,
s = this.centerDiff;
return new r(e + s.x, i - (n.y - s.y));
}
return !1;
},
getBottomRight: function (t, e, i) {
if ((void 0 === e && (e = 0), void 0 === i && (i = 0), this.parseBody(t))) {
var n = this.boundsCenter,
s = this.centerDiff;
return new r(e - (n.x - s.x), i - (n.y - s.y));
}
return !1;
},
});
t.exports = s;
},
function (t, e) {
function s(t, e, i, n) {
var s = e[0] - t[0],
r = e[1] - t[1],
o = n[0] - i[0],
a = n[1] - i[1];
if (o * r - a * s != 0) {
var h = (s * (i[1] - t[1]) + r * (t[0] - i[0])) / (o * r - a * s),
l = (o * (t[1] - i[1]) + a * (i[0] - t[0])) / (a * s - o * r);
return 0 <= h && h <= 1 && 0 <= l && l <= 1;
}
}
function l(t, e, i) {
return (e[0] - t[0]) * (i[1] - t[1]) - (i[0] - t[0]) * (e[1] - t[1]);
}
function _(t, e, i) {
return 0 < l(t, e, i);
}
function E(t, e, i) {
return 0 <= l(t, e, i);
}
function P(t, e, i) {
return l(t, e, i) < 0;
}
function A(t, e, i) {
return l(t, e, i) <= 0;
}
t.exports = {
decomp: function (t) {
var e = (function t(e) {
for (var i = [], n = [], s = [], r = [], o = Number.MAX_VALUE, a = 0; a < e.length; ++a)
if (k(e, a))
for (var h = 0; h < e.length; ++h)
if (f(e, a, h)) {
(n = t(p(e, a, h, r))), (s = t(p(e, h, a, r)));
for (var l = 0; l < s.length; l++) n.push(s[l]);
n.length < o && ((o = (i = n).length), i.push([C(e, a), C(e, h)]));
}
return i;
})(t);
return 0 < e.length
? (function t(e, i) {
if (0 === i.length) return [e];
if (i instanceof Array && i.length && i[0] instanceof Array && 2 === i[0].length && i[0][0] instanceof Array) {
for (var n = [e], s = 0; s < i.length; s++)
for (var r = i[s], o = 0; o < n.length; o++) {
var a = t(n[o], r);
if (a) {
n.splice(o, 1), n.push(a[0], a[1]);
break;
}
}
return n;
}
return (r = i), (s = e.indexOf(r[0])), (o = e.indexOf(r[1])), -1 !== s && -1 !== o && [p(e, s, o), p(e, o, s)];
})(t, e)
: [t];
},
quickDecomp: function t(e, i, n, s, r, o, a) {
(o = o || 100), (a = a || 0), (r = r || 25), (i = void 0 !== i ? i : []), (n = n || []), (s = s || []);
var h = [0, 0],
l = [0, 0],
u = [0, 0],
c = 0,
d = 0,
f = 0,
p = 0,
g = 0,
v = 0,
y = 0,
m = [],
x = [],
b = e,
w = e;
if (w.length < 3) return i;
if (o < ++a) return i;
for (var T = 0; T < e.length; ++T)
if (k(b, T)) {
n.push(b[T]), (c = d = Number.MAX_VALUE);
for (var S = 0; S < e.length; ++S)
_(C(b, T - 1), C(b, T), C(b, S)) &&
A(C(b, T - 1), C(b, T), C(b, S - 1)) &&
((u = L(C(b, T - 1), C(b, T), C(b, S), C(b, S - 1))), P(C(b, T + 1), C(b, T), u) && (f = M(b[T], u)) < d && ((d = f), (l = u), (v = S))),
_(C(b, T + 1), C(b, T), C(b, S + 1)) &&
A(C(b, T + 1), C(b, T), C(b, S)) &&
((u = L(C(b, T + 1), C(b, T), C(b, S), C(b, S + 1))), _(C(b, T - 1), C(b, T), u) && (f = M(b[T], u)) < c && ((c = f), (h = u), (g = S)));
if (v === (g + 1) % e.length)
(u[0] = (l[0] + h[0]) / 2),
(u[1] = (l[1] + h[1]) / 2),
s.push(u),
T < g
? (O(m, b, T, g + 1), m.push(u), x.push(u), 0 !== v && O(x, b, v, b.length), O(x, b, 0, T + 1))
: (0 !== T && O(m, b, T, b.length), O(m, b, 0, g + 1), m.push(u), x.push(u), O(x, b, v, T + 1));
else {
if ((g < v && (g += e.length), (p = Number.MAX_VALUE), g < v)) return i;
for (S = v; S <= g; ++S) E(C(b, T - 1), C(b, T), C(b, S)) && A(C(b, T + 1), C(b, T), C(b, S)) && (f = M(C(b, T), C(b, S))) < p && R(b, T, S) && ((p = f), (y = S % e.length));
T < y ? (O(m, b, T, y + 1), 0 !== y && O(x, b, y, w.length), O(x, b, 0, T + 1)) : (0 !== T && O(m, b, T, w.length), O(m, b, 0, y + 1), O(x, b, y, T + 1));
}
return m.length < x.length ? (t(m, i, n, s, r, o, a), t(x, i, n, s, r, o, a)) : (t(x, i, n, s, r, o, a), t(m, i, n, s, r, o, a)), i;
}
return i.push(e), i;
},
isSimple: function (t) {
var e,
i = t;
for (e = 0; e < i.length - 1; e++) for (var n = 0; n < e - 1; n++) if (s(i[e], i[e + 1], i[n], i[n + 1])) return !1;
for (e = 1; e < i.length - 2; e++) if (s(i[0], i[i.length - 1], i[e], i[e + 1])) return !1;
return !0;
},
removeCollinearPoints: function (t, e) {
for (var i = 0, n = t.length - 1; 3 < t.length && 0 <= n; --n)
!(function (t, e, i, n) {
if (n) {
var s = u,
r = c;
(s[0] = e[0] - t[0]), (s[1] = e[1] - t[1]), (r[0] = i[0] - e[0]), (r[1] = i[1] - e[1]);
var o = s[0] * r[0] + s[1] * r[1],
a = Math.sqrt(s[0] * s[0] + s[1] * s[1]),
h = Math.sqrt(r[0] * r[0] + r[1] * r[1]);
return Math.acos(o / (a * h)) < n;
}
return 0 === l(t, e, i);
})(C(t, n - 1), C(t, n), C(t, n + 1), e) || (t.splice(n % t.length, 1), i++);
return i;
},
removeDuplicatePoints: function (t, e) {
for (var i = t.length - 1; 1 <= i; --i) for (var n = t[i], s = i - 1; 0 <= s; --s) (r = n), (o = t[s]), (a = e), !g(r[0], o[0], a) || !g(r[1], o[1], a) || t.splice(i, 1);
var r, o, a;
},
makeCCW: function (t) {
for (var e = 0, i = t, n = 1; n < t.length; ++n) (i[n][1] < i[e][1] || (i[n][1] === i[e][1] && i[n][0] > i[e][0])) && (e = n);
return (
!_(C(t, e - 1), C(t, e), C(t, e + 1)) &&
((function (t) {
for (var e = [], i = t.length, n = 0; n !== i; n++) e.push(t.pop());
for (n = 0; n !== i; n++) t[n] = e[n];
})(t),
!0)
);
},
};
var u = [],
c = [];
function M(t, e) {
var i = e[0] - t[0],
n = e[1] - t[1];
return i * i + n * n;
}
function C(t, e) {
var i = t.length;
return t[e < 0 ? (e % i) + i : e % i];
}
function O(t, e, i, n) {
for (var s = i; s < n; s++) t.push(e[s]);
}
function k(t, e) {
return P(C(t, e - 1), C(t, e), C(t, e + 1));
}
var h = [],
d = [];
function f(t, e, i) {
var n,
s,
r = h,
o = d;
if (!E(C(t, e + 1), C(t, e), C(t, i)) || !A(C(t, e - 1), C(t, e), C(t, i))) {
s = M(C(t, e), C(t, i));
for (var a = 0; a !== t.length; ++a)
if (
(a + 1) % t.length !== e &&
a !== e &&
E(C(t, e), C(t, i), C(t, a + 1)) &&
A(C(t, e), C(t, i), C(t, a)) &&
((r[0] = C(t, e)),
(r[1] = C(t, i)),
(o[0] = C(t, a)),
(o[1] = C(t, a + 1)),
(n = (function (t, e, i) {
i = i || 0;
var n = [0, 0],
s = t[1][1] - t[0][1],
r = t[0][0] - t[1][0],
o = s * t[0][0] + r * t[0][1],
a = e[1][1] - e[0][1],
h = e[0][0] - e[1][0],
l = a * e[0][0] + h * e[0][1],
u = s * h - a * r;
return g(u, 0, i) || ((n[0] = (h * o - r * l) / u), (n[1] = (s * l - a * o) / u)), n;
})(r, o)),
M(C(t, e), n) < s)
)
return;
return 1;
}
}
function R(t, e, i) {
for (var n = 0; n !== t.length; ++n) if (n !== e && n !== i && (n + 1) % t.length !== e && (n + 1) % t.length !== i && s(C(t, e), C(t, i), C(t, n), C(t, n + 1))) return;
return 1;
}
function p(t, e, i, n) {
var s = n || [];
if (((s.length = 0), e < i)) for (var r = e; r <= i; r++) s.push(t[r]);
else {
for (r = 0; r <= i; r++) s.push(t[r]);
for (r = e; r < t.length; r++) s.push(t[r]);
}
return s;
}
function L(t, e, i, n, s) {
s = s || 0;
var r = e[1] - t[1],
o = t[0] - e[0],
a = r * t[0] + o * t[1],
h = n[1] - i[1],
l = i[0] - n[0],
u = h * i[0] + l * i[1],
c = r * l - h * o;
return g(c, 0, s) ? [0, 0] : [(l * a - o * u) / c, (r * u - h * a) / c];
}
function g(t, e, i) {
return (i = i || 0), Math.abs(t - e) <= i;
}
},
function (t, e, i) {
var c = i(86),
n = i(0),
d = i(591),
o = i(128),
f = i(592),
s = i(1395),
p = i(1396),
a = i(1397),
r = i(593),
h = i(589),
l = i(590),
u = i(1398),
g = i(64),
v = new n({
initialize: function (t) {
(this.world = t), (this.scene = t.scene), (this.sys = t.scene.sys);
},
rectangle: function (t, e, i, n, s) {
var r = c.rectangle(t, e, i, n, s);
return this.world.add(r), r;
},
trapezoid: function (t, e, i, n, s, r) {
var o = c.trapezoid(t, e, i, n, s, r);
return this.world.add(o), o;
},
circle: function (t, e, i, n, s) {
var r = c.circle(t, e, i, n, s);
return this.world.add(r), r;
},
polygon: function (t, e, i, n, s) {
var r = c.polygon(t, e, i, n, s);
return this.world.add(r), r;
},
fromVertices: function (t, e, i, n, s, r, o) {
"string" == typeof i && (i = g.fromPath(i));
var a = c.fromVertices(t, e, i, n, s, r, o);
return this.world.add(a), a;
},
fromPhysicsEditor: function (t, e, i, n, s) {
void 0 === s && (s = !0);
var r = h.parseBody(t, e, i, n);
return s && !this.world.has(r) && this.world.add(r), r;
},
fromSVG: function (t, e, i, n, s, r) {
void 0 === n && (n = 1), void 0 === s && (s = {}), void 0 === r && (r = !0);
for (var o = i.getElementsByTagName("path"), a = [], h = 0; h < o.length; h++) {
var l = f.pathToVertices(o[h], 30);
1 !== n && g.scale(l, n, n), a.push(l);
}
var u = c.fromVertices(t, e, a, s);
return r && this.world.add(u), u;
},
fromJSON: function (t, e, i, n, s) {
void 0 === n && (n = {}), void 0 === s && (s = !0);
var r = l.parseBody(t, e, i, n);
return r && s && this.world.add(r), r;
},
imageStack: function (n, s, t, e, i, r, o, a, h) {
void 0 === o && (o = 0), void 0 === a && (a = 0), void 0 === h && (h = {});
var l = this.world,
u = this.sys.displayList;
h.addToWorld = !1;
var c = d.stack(t, e, i, r, o, a, function (t, e) {
var i = new p(l, t, e, n, s, h);
return u.add(i), i.body;
});
return l.add(c), c;
},
stack: function (t, e, i, n, s, r, o) {
var a = d.stack(t, e, i, n, s, r, o);
return this.world.add(a), a;
},
pyramid: function (t, e, i, n, s, r, o) {
var a = d.pyramid(t, e, i, n, s, r, o);
return this.world.add(a), a;
},
chain: function (t, e, i, n, s, r) {
return d.chain(t, e, i, n, s, r);
},
mesh: function (t, e, i, n, s) {
return d.mesh(t, e, i, n, s);
},
newtonsCradle: function (t, e, i, n, s) {
var r = d.newtonsCradle(t, e, i, n, s);
return this.world.add(r), r;
},
car: function (t, e, i, n, s) {
var r = d.car(t, e, i, n, s);
return this.world.add(r), r;
},
softBody: function (t, e, i, n, s, r, o, a, h, l) {
var u = d.softBody(t, e, i, n, s, r, o, a, h, l);
return this.world.add(u), u;
},
joint: function (t, e, i, n, s) {
return this.constraint(t, e, i, n, s);
},
spring: function (t, e, i, n, s) {
return this.constraint(t, e, i, n, s);
},
constraint: function (t, e, i, n, s) {
void 0 === n && (n = 1), void 0 === s && (s = {}), (s.bodyA = "body" === t.type ? t : t.body), (s.bodyB = "body" === e.type ? e : e.body), isNaN(i) || (s.length = i), (s.stiffness = n);
var r = o.create(s);
return this.world.add(r), r;
},
worldConstraint: function (t, e, i, n) {
void 0 === i && (i = 1), void 0 === n && (n = {}), (n.bodyB = "body" === t.type ? t : t.body), isNaN(e) || (n.length = e), (n.stiffness = i);
var s = o.create(n);
return this.world.add(s), s;
},
mouseSpring: function (t) {
return this.pointerConstraint(t);
},
pointerConstraint: function (t) {
void 0 === t && (t = {}), t.hasOwnProperty("render") || (t.render = { visible: !1 });
var e = new u(this.scene, this.world, t);
return this.world.add(e.constraint), e;
},
image: function (t, e, i, n, s) {
var r = new p(this.world, t, e, i, n, s);
return this.sys.displayList.add(r), r;
},
tileBody: function (t, e) {
return new r(this.world, t, e);
},
sprite: function (t, e, i, n, s) {
var r = new a(this.world, t, e, i, n, s);
return this.sys.displayList.add(r), this.sys.updateList.add(r), r;
},
gameObject: function (t, e, i) {
return s(this.world, t, e, i);
},
destroy: function () {
(this.world = null), (this.scene = null), (this.sys = null);
},
});
t.exports = v;
},
function (t, e, i) {
var a = i(249),
h = i(2),
l = i(3);
t.exports = function (t, n, e, i) {
void 0 === e && (e = {}), void 0 === i && (i = !0);
var s,
r = n.x,
o = n.y;
return (
(n.body = { temp: !0, position: { x: r, y: o } }),
[a.Bounce, a.Collision, a.Force, a.Friction, a.Gravity, a.Mass, a.Sensor, a.SetBody, a.Sleep, a.Static, a.Transform, a.Velocity].forEach(function (t) {
for (var e in t)
((i = t[e]).get && "function" == typeof i.get) || (i.set && "function" == typeof i.set)
? Object.defineProperty(n, e, { get: t[e].get, set: t[e].set })
: Object.defineProperty(n, e, { value: t[e] });
var i;
}),
(n.world = t),
(n._tempVec2 = new l(r, o)),
e.hasOwnProperty("type") && "body" === e.type ? n.setExistingBody(e, i) : ((s = (s = h(e, "shape", null)) || "rectangle"), (e.addToWorld = i), n.setBody(s, e)),
n
);
};
},
function (t, e, i) {
var n = i(0),
s = i(249),
a = i(15),
h = i(2),
r = i(125),
o = i(167),
l = i(3),
u = new n({
Extends: r,
Mixins: [s.Bounce, s.Collision, s.Force, s.Friction, s.Gravity, s.Mass, s.Sensor, s.SetBody, s.Sleep, s.Static, s.Transform, s.Velocity, o],
initialize: function (t, e, i, n, s, r) {
a.call(this, t.scene, "Image"), (this._crop = this.resetCropObject()), this.setTexture(n, s), this.setSizeToFrame(), this.setOrigin(), (this.world = t), (this._tempVec2 = new l(e, i));
var o = h(r, "shape", null);
o ? this.setBody(o, r) : this.setRectangle(this.width, this.height, r), this.setPosition(e, i), this.initPipeline();
},
});
t.exports = u;
},
function (t, e, i) {
var a = i(164),
n = i(0),
s = i(249),
h = i(15),
l = i(2),
r = i(167),
o = i(73),
u = i(3),
c = new n({
Extends: o,
Mixins: [s.Bounce, s.Collision, s.Force, s.Friction, s.Gravity, s.Mass, s.Sensor, s.SetBody, s.Sleep, s.Static, s.Transform, s.Velocity, r],
initialize: function (t, e, i, n, s, r) {
h.call(this, t.scene, "Sprite"),
(this._crop = this.resetCropObject()),
(this.anims = new a(this)),
this.setTexture(n, s),
this.setSizeToFrame(),
this.setOrigin(),
(this.world = t),
(this._tempVec2 = new u(e, i));
var o = l(r, "shape", null);
o ? this.setBody(o, r) : this.setRectangle(this.width, this.height, r), this.setPosition(e, i), this.initPipeline();
},
});
t.exports = c;
},
function (t, e, i) {
var o = i(84),
n = i(0),
a = i(118),
s = i(128),
h = i(273),
l = i(272),
r = i(51),
u = i(127),
c = i(165),
d = i(3),
f = i(64),
p = new n({
initialize: function (t, e, i) {
void 0 === i && (i = {}),
(this.scene = t),
(this.world = e),
(this.camera = null),
(this.pointer = null),
(this.active = !0),
(this.position = new d()),
(this.body = null),
(this.part = null),
(this.constraint = s.create(
u(i, {
label: "Pointer Constraint",
pointA: { x: 0, y: 0 },
pointB: { x: 0, y: 0 },
length: 0.01,
stiffness: 0.1,
angularStiffness: 1,
collisionFilter: { category: 1, mask: 4294967295, group: 0 },
})
)),
this.world.on(l.BEFORE_UPDATE, this.update, this),
t.sys.input.on(r.POINTER_DOWN, this.onDown, this),
t.sys.input.on(r.POINTER_UP, this.onUp, this);
},
onDown: function (t) {
this.pointer || ((this.pointer = t), (this.camera = t.camera));
},
onUp: function (t) {
t === this.pointer && (this.pointer = null);
},
getBody: function (t) {
var e = this.position,
i = this.constraint;
this.camera.getWorldPoint(t.x, t.y, e);
for (var n = a.allBodies(this.world.localWorld), s = 0; s < n.length; s++) {
var r = n[s];
if (!r.ignorePointer && o.contains(r.bounds, e) && h.canCollide(r.collisionFilter, i.collisionFilter) && this.hitTestBody(r, e)) return this.world.emit(l.DRAG_START, r, this.part, this), !0;
}
return !1;
},
hitTestBody: function (t, e) {
for (var i = this.constraint, n = t.parts.length, s = 1 < n ? 1 : 0; s < n; s++) {
var r = t.parts[s];
if (f.contains(r.vertices, e))
return (i.pointA = e), (i.pointB = { x: e.x - t.position.x, y: e.y - t.position.y }), (i.bodyB = t), (i.angleB = t.angle), c.set(t, !1), (this.part = r), (this.body = t), !0;
}
return !1;
},
update: function () {
var t = this.pointer,
e = this.body;
if (this.active && t)
if (t.isDown || !e) {
if (t.isDown) {
if (!e && !this.getBody(t)) return;
e = this.body;
var i = this.position,
n = this.constraint;
this.camera.getWorldPoint(t.x, t.y, i), (n.pointA.x = i.x), (n.pointA.y = i.y), c.set(e, !1), this.world.emit(l.DRAG, e, this);
}
} else this.stopDrag();
else e && this.stopDrag();
},
stopDrag: function () {
var t = this.body,
e = this.constraint;
(e.bodyB = null), (e.pointB = null), (this.pointer = null), (this.body = null), (this.part = null), t && this.world.emit(l.DRAG_END, t, this);
},
destroy: function () {
this.world.removeConstraint(this.constraint),
(this.pointer = null),
(this.constraint = null),
(this.body = null),
(this.part = null),
this.world.off(l.BEFORE_UPDATE, this.update),
this.scene.sys.input.off(r.POINTER_DOWN, this.onDown, this),
this.scene.sys.input.off(r.POINTER_UP, this.onUp, this);
},
});
t.exports = p;
},
function (t, e, i) {
var n = {};
t.exports = n;
var s = i(595),
r = i(32);
(n.name = "matter-js"),
(n.version = "0.14.2"),
(n.uses = []),
(n.used = []),
(n.use = function () {
s.use(n, Array.prototype.slice.call(arguments));
}),
(n.before = function (t, e) {
return (t = t.replace(/^Matter./, "")), r.chainPathBefore(n, t, e);
}),
(n.after = function (t, e) {
return (t = t.replace(/^Matter./, "")), r.chainPathAfter(n, t, e);
});
},
function (t, e, i) {
var d = {};
t.exports = d;
var f = i(83),
h = i(274),
l = i(84),
p = i(86),
a = i(64);
(d.collides = function (t, e) {
for (var i = [], n = 0; n < e.length; n++) {
var s = e[n];
if (t !== s && l.overlaps(s.bounds, t.bounds))
for (var r = 1 === s.parts.length ? 0 : 1; r < s.parts.length; r++) {
var o = s.parts[r];
if (l.overlaps(o.bounds, t.bounds)) {
var a = h.collides(o, t);
if (a.collided) {
i.push(a);
break;
}
}
}
}
return i;
}),
(d.ray = function (t, e, i, n) {
n = n || 1e-100;
for (var s = f.angle(e, i), r = f.magnitude(f.sub(e, i)), o = 0.5 * (i.x + e.x), a = 0.5 * (i.y + e.y), h = p.rectangle(o, a, r, n, { angle: s }), l = d.collides(h, t), u = 0; u < l.length; u += 1) {
var c = l[u];
c.body = c.bodyB = c.bodyA;
}
return l;
}),
(d.region = function (t, e, i) {
for (var n = [], s = 0; s < t.length; s++) {
var r = t[s],
o = l.overlaps(r.bounds, e);
((o && !i) || (!o && i)) && n.push(r);
}
return n;
}),
(d.point = function (t, e) {
for (var i = [], n = 0; n < t.length; n++) {
var s = t[n];
if (l.contains(s.bounds, e))
for (var r = 1 === s.parts.length ? 0 : 1; r < s.parts.length; r++) {
var o = s.parts[r];
if (l.contains(o.bounds, e) && a.contains(o.vertices, e)) {
i.push(s);
break;
}
}
}
return i;
});
},
function (t, e, i) {
var p = {};
t.exports = p;
var s = i(596),
g = i(165),
v = i(599),
y = i(598),
m = i(1523),
r = i(597),
x = i(166),
b = i(118),
w = i(128),
o = i(32),
a = i(41);
(p.create = function (t, e) {
(e = (e = o.isElement(t) ? e : t) || {}), ((t = o.isElement(t) ? t : null) || e.render) && o.warn("Engine.create: engine.render is deprecated (see docs)");
var i = { positionIterations: 6, velocityIterations: 4, constraintIterations: 2, enableSleeping: !1, events: [], plugin: {}, timing: { timestamp: 0, timeScale: 1 }, broadphase: { controller: r } },
n = o.extend(i, e);
return (
(n.world = e.world || s.create(n.world)),
(n.pairs = y.create()),
(n.broadphase = n.broadphase.controller.create(n.broadphase)),
(n.metrics = n.metrics || { extended: !1 }),
(n.metrics = m.create(n.metrics)),
n
);
}),
(p.update = function (t, e, i) {
(e = e || 1e3 / 60), (i = i || 1);
var n,
s,
r = t.world,
o = t.timing,
a = t.broadphase;
o.timestamp += e * o.timeScale;
var h = { timestamp: o.timestamp };
x.trigger(t, "beforeUpdate", h);
var l = b.allBodies(r),
u = b.allConstraints(r);
for (
m.reset(t.metrics), t.enableSleeping && g.update(l, o.timeScale), p._bodiesApplyGravity(l, r.gravity), p._bodiesUpdate(l, e, o.timeScale, i, r.bounds), w.preSolveAll(l), n = 0;
n < t.constraintIterations;
n++
)
w.solveAll(u, o.timeScale);
w.postSolveAll(l), (s = a.controller ? (r.isModified && a.controller.clear(a), a.controller.update(a, l, t, r.isModified), a.pairsList) : l), r.isModified && b.setModified(r, !1, !1, !0);
var c = a.detector(s, t),
d = t.pairs,
f = o.timestamp;
for (
y.update(d, c, f),
y.removeOld(d, f),
t.enableSleeping && g.afterCollisions(d.list, o.timeScale),
0 < d.collisionStart.length && x.trigger(t, "collisionStart", { pairs: d.collisionStart }),
v.preSolvePosition(d.list),
n = 0;
n < t.positionIterations;
n++
)
v.solvePosition(d.list, l, o.timeScale);
for (v.postSolvePosition(l), w.preSolveAll(l), n = 0; n < t.constraintIterations; n++) w.solveAll(u, o.timeScale);
for (w.postSolveAll(l), v.preSolveVelocity(d.list), n = 0; n < t.velocityIterations; n++) v.solveVelocity(d.list, o.timeScale);
return (
0 < d.collisionActive.length && x.trigger(t, "collisionActive", { pairs: d.collisionActive }),
0 < d.collisionEnd.length && x.trigger(t, "collisionEnd", { pairs: d.collisionEnd }),
m.update(t.metrics, t),
p._bodiesClearForces(l),
x.trigger(t, "afterUpdate", h),
t
);
}),
(p.merge = function (t, e) {
if ((o.extend(t, e), e.world)) {
(t.world = e.world), p.clear(t);
for (var i = b.allBodies(t.world), n = 0; n < i.length; n++) {
var s = i[n];
g.set(s, !1), (s.id = o.nextId());
}
}
}),
(p.clear = function (t) {
var e = t.world;
y.clear(t.pairs);
var i,
n = t.broadphase;
n.controller && ((i = b.allBodies(e)), n.controller.clear(n), n.controller.update(n, i, t, !0));
}),
(p._bodiesClearForces = function (t) {
for (var e = 0; e < t.length; e++) {
var i = t[e];
(i.force.x = 0), (i.force.y = 0), (i.torque = 0);
}
}),
(p._bodiesApplyGravity = function (t, e) {
var i = void 0 !== e.scale ? e.scale : 0.001;
if ((0 !== e.x || 0 !== e.y) && 0 !== i)
for (var n = 0; n < t.length; n++) {
var s = t[n];
s.ignoreGravity || s.isStatic || s.isSleeping || ((s.force.x += s.mass * e.x * i * s.gravityScale.x), (s.force.y += s.mass * e.y * i * s.gravityScale.y));
}
}),
(p._bodiesUpdate = function (t, e, i, n, s) {
for (var r = 0; r < t.length; r++) {
var o = t[r];
o.isStatic || o.isSleeping || a.update(o, e, i, n);
}
});
},
function (t, e, i) {
var o = i(86),
n = i(41),
s = i(0),
m = i(32),
u = i(118),
b = i(1401),
w = i(9),
a = i(272),
T = i(2),
S = i(6),
r = i(41),
h = i(166),
l = i(593),
c = i(596),
x = i(83),
d = new s({
Extends: w,
initialize: function (t, e) {
w.call(this), (this.scene = t), (this.engine = b.create(e)), (this.localWorld = this.engine.world);
var i = S(e, "gravity", null);
i ? this.setGravity(i.x, i.y, i.scale) : !1 === i && this.setGravity(0, 0, 0),
(this.walls = { left: null, right: null, top: null, bottom: null }),
(this.enabled = S(e, "enabled", !0)),
(this.correction = S(e, "correction", 1)),
(this.getDelta = S(e, "getDelta", this.update60Hz));
var n = T(e, "runner", {}),
s = T(n, "fps", !1),
r = T(n, "fps", 60),
o = T(n, "delta", 1e3 / r),
a = T(n, "deltaMin", 1e3 / r),
h = T(n, "deltaMax", 1e3 / (0.5 * r));
s || (r = 1e3 / o),
(this.runner = {
fps: r,
correction: T(n, "correction", 1),
deltaSampleSize: T(n, "deltaSampleSize", 60),
counterTimestamp: 0,
frameCounter: 0,
deltaHistory: [],
timePrev: null,
timeScalePrev: 1,
frameRequestId: null,
isFixed: T(n, "isFixed", !1),
delta: o,
deltaMin: a,
deltaMax: h,
}),
(this.autoUpdate = S(e, "autoUpdate", !0));
var l,
u,
c,
d,
f,
p,
g,
v,
y,
m,
x = S(e, "debug", !1);
(this.drawDebug = "object" == typeof x || x),
this.debugGraphic,
(this.debugConfig = {
showAxes: T(x, "showAxes", !1),
showAngleIndicator: T(x, "showAngleIndicator", !1),
angleColor: T(x, "angleColor", 15208787),
showBroadphase: T(x, "showBroadphase", !1),
broadphaseColor: T(x, "broadphaseColor", 16757760),
showBounds: T(x, "showBounds", !1),
boundsColor: T(x, "boundsColor", 16777215),
showVelocity: T(x, "showVelocity", !1),
velocityColor: T(x, "velocityColor", 44783),
showCollisions: T(x, "showCollisions", !1),
collisionColor: T(x, "collisionColor", 16094476),
showSeparations: T(x, "showSeparations", !1),
separationColor: T(x, "separationColor", 16753920),
showBody: T(x, "showBody", !0),
showStaticBody: T(x, "showStaticBody", !0),
showInternalEdges: T(x, "showInternalEdges", !1),
renderFill: T(x, "renderFill", !1),
renderLine: T(x, "renderLine", !0),
fillColor: T(x, "fillColor", 1075465),
fillOpacity: T(x, "fillOpacity", 1),
lineColor: T(x, "lineColor", 2678297),
lineOpacity: T(x, "lineOpacity", 1),
lineThickness: T(x, "lineThickness", 1),
staticFillColor: T(x, "staticFillColor", 857979),
staticLineColor: T(x, "staticLineColor", 1255396),
showSleeping: T(x, "showSleeping", !1),
staticBodySleepOpacity: T(x, "staticBodySleepOpacity", 0.7),
sleepFillColor: T(x, "sleepFillColor", 4605510),
sleepLineColor: T(x, "sleepLineColor", 10066585),
showSensors: T(x, "showSensors", !0),
sensorFillColor: T(x, "sensorFillColor", 857979),
sensorLineColor: T(x, "sensorLineColor", 1255396),
showPositions: T(x, "showPositions", !0),
positionSize: T(x, "positionSize", 4),
positionColor: T(x, "positionColor", 14697178),
showJoint: T(x, "showJoint", !0),
jointColor: T(x, "jointColor", 14737474),
jointLineOpacity: T(x, "jointLineOpacity", 1),
jointLineThickness: T(x, "jointLineThickness", 2),
pinSize: T(x, "pinSize", 4),
pinColor: T(x, "pinColor", 4382944),
springColor: T(x, "springColor", 14697184),
anchorColor: T(x, "anchorColor", 15724527),
anchorSize: T(x, "anchorSize", 4),
showConvexHulls: T(x, "showConvexHulls", !1),
hullColor: T(x, "hullColor", 14091216),
}),
this.drawDebug && this.createDebugGraphic(),
this.setEventsProxy(),
T(e, "setBounds", !1) &&
("boolean" == typeof (l = e.setBounds)
? this.setBounds()
: ((u = T(l, "x", 0)),
(c = T(l, "y", 0)),
(d = T(l, "width", t.sys.scale.width)),
(f = T(l, "height", t.sys.scale.height)),
(p = T(l, "thickness", 64)),
(g = T(l, "left", !0)),
(v = T(l, "right", !0)),
(y = T(l, "top", !0)),
(m = T(l, "bottom", !0)),
this.setBounds(u, c, d, f, p, g, v, y, m)));
},
setCompositeRenderStyle: function (t) {
for (var e, i, n = t.bodies, s = t.constraints, r = t.composites, o = 0; o < n.length; o++)
(i = (e = n[o]).render), this.setBodyRenderStyle(e, i.lineColor, i.lineOpacity, i.lineThickness, i.fillColor, i.fillOpacity);
for (o = 0; o < s.length; o++) (i = (e = s[o]).render), this.setConstraintRenderStyle(e, i.lineColor, i.lineOpacity, i.lineThickness, i.pinSize, i.anchorColor, i.anchorSize);
for (o = 0; o < r.length; o++) (e = r[o]), this.setCompositeRenderStyle(e);
return this;
},
setBodyRenderStyle: function (t, e, i, n, s, r) {
var o = t.render,
a = this.debugConfig;
return (
o &&
(null == e && (e = t.isStatic ? a.staticLineColor : a.lineColor),
null == i && (i = a.lineOpacity),
null == n && (n = a.lineThickness),
null == s && (s = t.isStatic ? a.staticFillColor : a.fillColor),
null == r && (r = a.fillOpacity),
!1 !== e && (o.lineColor = e),
!1 !== i && (o.lineOpacity = i),
!1 !== n && (o.lineThickness = n),
!1 !== s && (o.fillColor = s),
!1 !== r && (o.fillOpacity = r)),
this
);
},
setConstraintRenderStyle: function (t, e, i, n, s, r, o) {
var a,
h = t.render,
l = this.debugConfig;
return (
h &&
(null == e && ("line" === (a = h.type) ? (e = l.jointColor) : "pin" === a ? (e = l.pinColor) : "spring" === a && (e = l.springColor)),
null == i && (i = l.jointLineOpacity),
null == n && (n = l.jointLineThickness),
null == s && (s = l.pinSize),
null == r && (r = l.anchorColor),
null == o && (o = l.anchorSize),
!1 !== e && (h.lineColor = e),
!1 !== i && (h.lineOpacity = i),
!1 !== n && (h.lineThickness = n),
!1 !== s && (h.pinSize = s),
!1 !== r && (h.anchorColor = r),
!1 !== o && (h.anchorSize = o)),
this
);
},
setEventsProxy: function () {
var r = this,
t = this.engine,
e = this.localWorld;
this.drawDebug &&
(h.on(e, "compositeModified", function (t) {
r.setCompositeRenderStyle(t);
}),
h.on(e, "beforeAdd", function (t) {
for (var e = [].concat(t.object), i = 0; i < e.length; i++) {
var n = e[i],
s = n.render;
"body" === n.type
? r.setBodyRenderStyle(n, s.lineColor, s.lineOpacity, s.lineThickness, s.fillColor, s.fillOpacity)
: "composite" === n.type
? r.setCompositeRenderStyle(n)
: "constraint" === n.type && r.setConstraintRenderStyle(n, s.lineColor, s.lineOpacity, s.lineThickness, s.pinSize, s.anchorColor, s.anchorSize);
}
})),
h.on(e, "beforeAdd", function (t) {
r.emit(a.BEFORE_ADD, t);
}),
h.on(e, "afterAdd", function (t) {
r.emit(a.AFTER_ADD, t);
}),
h.on(e, "beforeRemove", function (t) {
r.emit(a.BEFORE_REMOVE, t);
}),
h.on(e, "afterRemove", function (t) {
r.emit(a.AFTER_REMOVE, t);
}),
h.on(t, "beforeUpdate", function (t) {
r.emit(a.BEFORE_UPDATE, t);
}),
h.on(t, "afterUpdate", function (t) {
r.emit(a.AFTER_UPDATE, t);
}),
h.on(t, "collisionStart", function (t) {
var e,
i,
n = t.pairs;
0 < n.length && ((e = n[0].bodyA), (i = n[0].bodyB)), r.emit(a.COLLISION_START, t, e, i);
}),
h.on(t, "collisionActive", function (t) {
var e,
i,
n = t.pairs;
0 < n.length && ((e = n[0].bodyA), (i = n[0].bodyB)), r.emit(a.COLLISION_ACTIVE, t, e, i);
}),
h.on(t, "collisionEnd", function (t) {
var e,
i,
n = t.pairs;
0 < n.length && ((e = n[0].bodyA), (i = n[0].bodyB)), r.emit(a.COLLISION_END, t, e, i);
});
},
setBounds: function (t, e, i, n, s, r, o, a, h) {
return (
void 0 === t && (t = 0),
void 0 === e && (e = 0),
void 0 === i && (i = this.scene.sys.scale.width),
void 0 === n && (n = this.scene.sys.scale.height),
void 0 === s && (s = 64),
void 0 === r && (r = !0),
void 0 === o && (o = !0),
void 0 === a && (a = !0),
void 0 === h && (h = !0),
this.updateWall(r, "left", t - s, e - s, s, n + 2 * s),
this.updateWall(o, "right", t + i, e - s, s, n + 2 * s),
this.updateWall(a, "top", t, e - s, i, s),
this.updateWall(h, "bottom", t, e + n, i, s),
this
);
},
updateWall: function (t, e, i, n, s, r) {
var o = this.walls[e];
t
? (o && c.remove(this.localWorld, o), (i += s / 2), (n += r / 2), (this.walls[e] = this.create(i, n, s, r, { isStatic: !0, friction: 0, frictionStatic: 0 })))
: (o && c.remove(this.localWorld, o), (this.walls[e] = null));
},
createDebugGraphic: function () {
var t = this.scene.sys.add.graphics({ x: 0, y: 0 });
return t.setDepth(Number.MAX_VALUE), (this.debugGraphic = t), (this.drawDebug = !0), t;
},
disableGravity: function () {
return (this.localWorld.gravity.x = 0), (this.localWorld.gravity.y = 0), (this.localWorld.gravity.scale = 0), this;
},
setGravity: function (t, e, i) {
return void 0 === t && (t = 0), void 0 === e && (e = 1), (this.localWorld.gravity.x = t), (this.localWorld.gravity.y = e), void 0 !== i && (this.localWorld.gravity.scale = i), this;
},
create: function (t, e, i, n, s) {
var r = o.rectangle(t, e, i, n, s);
return c.add(this.localWorld, r), r;
},
add: function (t) {
return c.add(this.localWorld, t), this;
},
remove: function (t, e) {
Array.isArray(t) || (t = [t]);
for (var i = 0; i < t.length; i++) {
var n = t[i],
s = n.body ? n.body : n;
u.remove(this.localWorld, s, e);
}
return this;
},
removeConstraint: function (t, e) {
return u.remove(this.localWorld, t, e), this;
},
convertTilemapLayer: function (t, e) {
var i = t.layer,
n = t.getTilesWithin(0, 0, i.width, i.height, { isColliding: !0 });
return this.convertTiles(n, e), this;
},
convertTiles: function (t, e) {
if (0 === t.length) return this;
for (var i = 0; i < t.length; i++) new l(this, t[i], e);
return this;
},
nextGroup: function (t) {
return r.nextGroup(t);
},
nextCategory: function () {
return r.nextCategory();
},
pause: function () {
return (this.enabled = !1), this.emit(a.PAUSE), this;
},
resume: function () {
return (this.enabled = !0), this.emit(a.RESUME), this;
},
update: function (t, e) {
var i, n, s, r;
this.enabled &&
this.autoUpdate &&
((i = this.engine),
(n = this.runner),
(s = i.timing),
(r = this.correction),
n.isFixed
? (e = this.getDelta(t, e))
: ((e = t - n.timePrev || n.delta),
(n.timePrev = t),
n.deltaHistory.push(e),
(n.deltaHistory = n.deltaHistory.slice(-n.deltaSampleSize)),
(r = (e = (e = (e = Math.min.apply(null, n.deltaHistory)) < n.deltaMin ? n.deltaMin : e) > n.deltaMax ? n.deltaMax : e) / n.delta),
(n.delta = e)),
0 !== n.timeScalePrev && (r *= s.timeScale / n.timeScalePrev),
0 === s.timeScale && (r = 0),
(n.timeScalePrev = s.timeScale),
(n.correction = r),
(n.frameCounter += 1),
1e3 <= t - n.counterTimestamp && ((n.fps = n.frameCounter * ((t - n.counterTimestamp) / 1e3)), (n.counterTimestamp = t), (n.frameCounter = 0)),
b.update(i, e, r));
},
step: function (t, e) {
b.update(this.engine, t, e);
},
update60Hz: function () {
return 1e3 / 60;
},
update30Hz: function () {
return 1e3 / 30;
},
has: function (t) {
var e = t.hasOwnProperty("body") ? t.body : t;
return null !== u.get(this.localWorld, e.id, e.type);
},
getAllBodies: function () {
return u.allBodies(this.localWorld);
},
getAllConstraints: function () {
return u.allConstraints(this.localWorld);
},
getAllComposites: function () {
return u.allComposites(this.localWorld);
},
postUpdate: function () {
var t, e, i, n;
this.drawDebug &&
((t = this.debugConfig),
(e = this.engine),
(i = this.debugGraphic),
(n = u.allBodies(this.localWorld)),
this.debugGraphic.clear(),
t.showBroadphase && e.broadphase.controller && this.renderGrid(e.broadphase, i, t.broadphaseColor, 0.5),
t.showBounds && this.renderBodyBounds(n, i, t.boundsColor, 0.5),
(t.showBody || t.showStaticBody) && this.renderBodies(n),
t.showJoint && this.renderJoints(),
(t.showAxes || t.showAngleIndicator) && this.renderBodyAxes(n, i, t.showAxes, t.angleColor, 0.5),
t.showVelocity && this.renderBodyVelocity(n, i, t.velocityColor, 1, 2),
t.showSeparations && this.renderSeparations(e.pairs.list, i, t.separationColor),
t.showCollisions && this.renderCollisions(e.pairs.list, i, t.collisionColor));
},
renderGrid: function (t, e, i, n) {
e.lineStyle(1, i, n);
for (var s = m.keys(t.buckets), r = 0; r < s.length; r++) {
var o,
a = s[r];
t.buckets[a].length < 2 || ((o = a.split(/C|R/)), e.strokeRect(parseInt(o[1], 10) * t.bucketWidth, parseInt(o[2], 10) * t.bucketHeight, t.bucketWidth, t.bucketHeight));
}
return this;
},
renderSeparations: function (t, e, i) {
e.lineStyle(1, i, 1);
for (var n = 0; n < t.length; n++) {
var s,
r,
o,
a,
h,
l,
u,
c = t[n];
c.isActive &&
((r = (s = c.collision).bodyA),
(o = s.bodyB),
(a = r.position),
(h = o.position),
(l = s.penetration),
(u = r.isStatic || o.isStatic ? 1 : 4),
o.isStatic && (u = 0),
e.lineBetween(h.x, h.y, h.x - l.x * u, h.y - l.y * u),
(u = r.isStatic || o.isStatic ? 1 : 4),
r.isStatic && (u = 0),
e.lineBetween(a.x, a.y, a.x - l.x * u, a.y - l.y * u));
}
return this;
},
renderCollisions: function (t, e, i) {
var n, s, r, o, a, h;
for (e.lineStyle(1, i, 0.5), e.fillStyle(i, 1), n = 0; n < t.length; n++)
if ((s = t[n]).isActive)
for (var l = 0; l < s.activeContacts.length; l++) {
var u = s.activeContacts[l].vertex;
e.fillRect(u.x - 2, u.y - 2, 5, 5);
}
for (n = 0; n < t.length; n++)
(s = t[n]).isActive &&
((r = s.collision),
0 < (o = s.activeContacts).length &&
((a = o[0].vertex.x),
(h = o[0].vertex.y),
2 === o.length && ((a = (o[0].vertex.x + o[1].vertex.x) / 2), (h = (o[0].vertex.y + o[1].vertex.y) / 2)),
r.bodyB === r.supports[0].body || r.bodyA.isStatic ? e.lineBetween(a - 8 * r.normal.x, h - 8 * r.normal.y, a, h) : e.lineBetween(a + 8 * r.normal.x, h + 8 * r.normal.y, a, h)));
return this;
},
renderBodyBounds: function (t, e, i, n) {
e.lineStyle(1, i, n);
for (var s = 0; s < t.length; s++) {
var r = t[s];
if (r.render.visible) {
var o = r.bounds;
if (o) e.strokeRect(o.min.x, o.min.y, o.max.x - o.min.x, o.max.y - o.min.y);
else
for (var a = r.parts, h = 1 < a.length ? 1 : 0; h < a.length; h++) {
var l = a[h];
e.strokeRect(l.bounds.min.x, l.bounds.min.y, l.bounds.max.x - l.bounds.min.x, l.bounds.max.y - l.bounds.min.y);
}
}
}
return this;
},
renderBodyAxes: function (t, e, i, n, s) {
e.lineStyle(1, n, s);
for (var r = 0; r < t.length; r++) {
var o,
a,
h,
l = t[r],
u = l.parts;
if (l.render.visible)
if (i)
for (a = 1 < u.length ? 1 : 0; a < u.length; a++)
for (o = u[a], h = 0; h < o.axes.length; h++) {
var c = o.axes[h];
e.lineBetween(o.position.x, o.position.y, o.position.x + 20 * c.x, o.position.y + 20 * c.y);
}
else
for (a = 1 < u.length ? 1 : 0; a < u.length; a++)
for (o = u[a], h = 0; h < o.axes.length; h++)
e.lineBetween(o.position.x, o.position.y, (o.vertices[0].x + o.vertices[o.vertices.length - 1].x) / 2, (o.vertices[0].y + o.vertices[o.vertices.length - 1].y) / 2);
}
return this;
},
renderBodyVelocity: function (t, e, i, n, s) {
e.lineStyle(s, i, n);
for (var r = 0; r < t.length; r++) {
var o = t[r];
o.render.visible && e.lineBetween(o.position.x, o.position.y, o.position.x + 2 * (o.position.x - o.positionPrev.x), o.position.y + 2 * (o.position.y - o.positionPrev.y));
}
return this;
},
renderBodies: function (t) {
for (
var e = this.debugGraphic,
i = this.debugConfig,
n = i.showBody,
s = i.showStaticBody,
r = i.showSleeping,
o = i.showInternalEdges,
a = i.showConvexHulls,
h = i.renderFill,
l = i.renderLine,
u = i.staticBodySleepOpacity,
c = i.sleepFillColor,
d = i.sleepLineColor,
f = i.hullColor,
p = 0;
p < t.length;
p++
) {
var g,
v,
y,
m,
x,
b,
w = t[p];
w.render.visible &&
((!s && w.isStatic) ||
(!n && !w.isStatic) ||
((g = w.render.lineColor),
(v = w.render.lineOpacity),
(y = w.render.lineThickness),
(m = w.render.fillColor),
(x = w.render.fillOpacity),
r && w.isSleeping && (w.isStatic ? ((v *= u), (x *= u)) : ((g = d), (m = c))),
h || (m = null),
l || (g = null),
this.renderBody(w, e, o, g, v, y, m, x),
(b = w.parts.length),
a && 1 < b && this.renderConvexHull(w, e, f, y)));
}
},
renderBody: function (t, e, i, n, s, r, o, a) {
void 0 === n && (n = null), void 0 === s && (s = null), void 0 === r && (r = 1), void 0 === o && (o = null), void 0 === a && (a = null);
for (var h, l, u, c = this.debugConfig, d = c.sensorFillColor, f = c.sensorLineColor, p = t.parts, g = p.length, v = 1 < g ? 1 : 0; v < g; v++) {
var y = p[v],
m = y.render,
x = m.opacity;
if (m.visible && 0 !== x && (!y.isSensor || c.showSensors)) {
var b = y.circleRadius;
if (
(e.beginPath(),
y.isSensor ? (null !== o && e.fillStyle(d, a * x), null !== n && e.lineStyle(r, f, s * x)) : (null !== o && e.fillStyle(o, a * x), null !== n && e.lineStyle(r, n, s * x)),
b)
)
e.arc(y.position.x, y.position.y, b, 0, 2 * Math.PI);
else {
var w = y.vertices,
T = w.length;
e.moveTo(w[0].x, w[0].y);
for (var S = 1; S < T; S++) {
var _,
E = w[S];
!w[S - 1].isInternal || i ? e.lineTo(E.x, E.y) : e.moveTo(E.x, E.y), S < T && E.isInternal && !i && ((_ = (S + 1) % T), e.moveTo(w[_].x, w[_].y));
}
e.closePath();
}
null !== o && e.fillPath(), null !== n && e.strokePath();
}
}
return (
c.showPositions &&
!t.isStatic &&
((h = t.position.x), (l = t.position.y), (u = Math.ceil(c.positionSize / 2)), e.fillStyle(c.positionColor, 1), e.fillRect(h - u, l - u, c.positionSize, c.positionSize)),
this
);
},
renderConvexHull: function (t, e, i, n) {
if ((void 0 === n && (n = 1), 1 < t.parts.length)) {
var s = t.vertices;
e.lineStyle(n, i), e.beginPath(), e.moveTo(s[0].x, s[0].y);
for (var r = 1; r < s.length; r++) e.lineTo(s[r].x, s[r].y);
e.lineTo(s[0].x, s[0].y), e.strokePath();
}
return this;
},
renderJoints: function () {
for (var t = this.debugGraphic, e = u.allConstraints(this.localWorld), i = 0; i < e.length; i++) {
var n = e[i].render,
s = n.lineColor,
r = n.lineOpacity,
o = n.lineThickness,
a = n.pinSize,
h = n.anchorColor,
l = n.anchorSize;
this.renderConstraint(e[i], t, s, r, o, a, h, l);
}
},
renderConstraint: function (t, e, i, n, s, r, o, a) {
var h = t.render;
if (!h.visible || !t.pointA || !t.pointB) return this;
e.lineStyle(s, i, n);
var l,
u = t.bodyA,
c = t.bodyB,
d = u ? x.add(u.position, t.pointA) : t.pointA;
if ("pin" === h.type) e.strokeCircle(d.x, d.y, r);
else {
if (((l = c ? x.add(c.position, t.pointB) : t.pointB), e.beginPath(), e.moveTo(d.x, d.y), "spring" === h.type))
for (var f, p = x.sub(l, d), g = x.perp(x.normalise(p)), v = Math.ceil(m.clamp(t.length / 5, 12, 20)), y = 1; y < v; y += 1)
(f = y % 2 == 0 ? 1 : -1), e.lineTo(d.x + p.x * (y / v) + g.x * f * 4, d.y + p.y * (y / v) + g.y * f * 4);
e.lineTo(l.x, l.y);
}
return e.strokePath(), h.anchors && 0 < a && (e.fillStyle(o), e.fillCircle(d.x, d.y, a), e.fillCircle(l.x, l.y, a)), this;
},
resetCollisionIDs: function () {
return (n._nextCollidingGroupId = 1), (n._nextNonCollidingGroupId = -1), (n._nextCategory = 1), this;
},
shutdown: function () {
h.off(this.engine), this.removeAllListeners(), c.clear(this.localWorld, !1), b.clear(this.engine), this.drawDebug && this.debugGraphic.destroy();
},
destroy: function () {
this.shutdown();
},
});
t.exports = d;
},
function (t, e, i) {
t.exports = { BasePlugin: i(540), DefaultPlugins: i(197), PluginCache: i(24), PluginManager: i(414), ScenePlugin: i(1404) };
},
function (t, e, i) {
var n = i(540),
s = i(0),
r = i(20),
o = new s({
Extends: n,
initialize: function (t, e, i) {
n.call(this, e), (this.scene = t), (this.systems = t.sys), (this.pluginKey = i), t.sys.events.once(r.BOOT, this.boot, this);
},
boot: function () {},
destroy: function () {
(this.pluginManager = null), (this.game = null), (this.scene = null), (this.systems = null);
},
});
t.exports = o;
},
function (t, e, i) {
t.exports = { Canvas: i(1406), Events: i(91), Snapshot: i(1407), WebGL: i(1408) };
},
function (t, e, i) {
t.exports = { CanvasRenderer: i(368), GetBlendModes: i(370), SetTransform: i(30) };
},
function (t, e, i) {
t.exports = { Canvas: i(369), WebGL: i(383) };
},
function (t, e, i) {
var n = i(107),
s = i(17)(!1, (s = { PipelineManager: i(372), Pipelines: i(1409), RenderTarget: i(141), Utils: i(12), WebGLPipeline: i(58), WebGLRenderer: i(371), WebGLShader: i(375) }), n);
t.exports = s;
},
function (t, e, i) {
var n = i(92),
s = i(17)(
!1,
(s = {
BitmapMaskPipeline: i(373),
Events: i(374),
GraphicsPipeline: i(376),
LightPipeline: i(377),
MultiPipeline: i(108),
PointLightPipeline: i(378),
PostFXPipeline: i(1410),
RopePipeline: i(379),
SinglePipeline: i(380),
UtilityPipeline: i(381),
}),
n
);
t.exports = s;
},
function (t, e, i) {
var n = i(0),
s = i(198),
r = i(2),
o = i(1411),
a = i(382),
h = i(58),
l = new n({
Extends: h,
initialize: function (t) {
(t.renderTarget = r(t, "renderTarget", 1)),
(t.fragShader = r(t, "fragShader", o)),
(t.vertShader = r(t, "vertShader", a)),
(t.attributes = r(t, "attributes", [
{ name: "inPosition", size: 2 },
{ name: "inTexCoord", size: 2 },
])),
(t.batchSize = 1),
(t.vertices = [-1, -1, 0, 0, -1, 1, 0, 1, 1, 1, 1, 1, -1, -1, 0, 0, 1, 1, 1, 1, 1, -1, 1, 0]),
h.call(this, t),
(this.isPostFX = !0),
this.gameObject,
(this.colorMatrix = new s()),
this.fullFrame1,
this.fullFrame2,
this.halfFrame1,
this.halfFrame2,
this.renderer.isBooted && ((this.manager = this.renderer.pipelines), this.boot());
},
boot: function () {
h.prototype.boot.call(this);
var t = this.manager.UTILITY_PIPELINE;
(this.fullFrame1 = t.fullFrame1), (this.fullFrame2 = t.fullFrame2), (this.halfFrame1 = t.halfFrame1), (this.halfFrame2 = t.halfFrame2), this.set1i("uMainSampler", 0);
},
onDraw: function (t) {
this.bindAndDraw(t);
},
copyFrame: function (t, e, i, n, s) {
this.manager.copyFrame(t, e, i, n, s);
},
copyToGame: function (t) {
this.manager.copyToGame(t);
},
drawFrame: function (t, e, i) {
this.manager.drawFrame(t, e, i, this.colorMatrix);
},
blendFrames: function (t, e, i, n, s) {
this.manager.blendFrames(t, e, i, n, s);
},
blendFramesAdditive: function (t, e, i, n, s) {
this.manager.blendFramesAdditive(t, e, i, n, s);
},
clearFrame: function (t, e) {
this.manager.clearFrame(t, e);
},
blitFrame: function (t, e, i, n, s, r) {
this.manager.blitFrame(t, e, i, n, s, r);
},
copyFrameRect: function (t, e, i, n, s, r, o, a) {
this.manager.copyFrameRect(t, e, i, n, s, r, o, a);
},
bindAndDraw: function (t, e, i, n, s) {
void 0 === i && (i = !0), void 0 === n && (n = !0);
var r = this.gl,
o = this.renderer;
this.bind(s),
this.set1i("uMainSampler", 0),
e
? (r.viewport(0, 0, e.width, e.height),
r.bindFramebuffer(r.FRAMEBUFFER, e.framebuffer),
r.framebufferTexture2D(r.FRAMEBUFFER, r.COLOR_ATTACHMENT0, r.TEXTURE_2D, e.texture, 0),
i && (n ? r.clearColor(0, 0, 0, 0) : r.clearColor(0, 0, 0, 1), r.clear(r.COLOR_BUFFER_BIT)))
: (o.popFramebuffer(!1, !1, !1), o.currentFramebuffer || r.viewport(0, 0, o.width, o.height)),
r.activeTexture(r.TEXTURE0),
r.bindTexture(r.TEXTURE_2D, t.texture),
r.bufferData(r.ARRAY_BUFFER, this.vertexData, r.STATIC_DRAW),
r.drawArrays(r.TRIANGLES, 0, 6),
e ? (r.bindTexture(r.TEXTURE_2D, null), r.bindFramebuffer(r.FRAMEBUFFER, null)) : o.resetTextures();
},
});
t.exports = l;
},
function (t, e) {
t.exports = [
"#define SHADER_NAME PHASER_POSTFX_FS",
"",
"precision mediump float;",
"",
"uniform sampler2D uMainSampler;",
"",
"varying vec2 outTexCoord;",
"",
"void main ()",
"{",
" gl_FragColor = texture2D(uMainSampler, outTexCoord);",
"}",
"",
].join("\n");
},
function (t, e, i) {
var n = i(17),
s = i(201),
r = n(!1, (r = { Center: i(403), Events: i(104), Orientation: i(404), ScaleManager: i(415), ScaleModes: i(405), Zoom: i(406) }), s.CENTER);
(r = n(!1, (r = n(!1, (r = n(!1, r, s.ORIENTATION)), s.SCALE_MODE)), s.ZOOM)), (t.exports = r);
},
function (t, e, i) {
var n = i(144),
s = i(17)(!1, (s = { Events: i(20), GetPhysicsPlugins: i(419), GetScenePlugins: i(420), SceneManager: i(417), ScenePlugin: i(1414), Settings: i(421), Systems: i(204) }), n);
t.exports = s;
},
function (t, e, i) {
var n = i(18),
s = i(0),
a = i(20),
h = i(2),
r = i(24),
o = new s({
initialize: function (t) {
(this.scene = t),
(this.systems = t.sys),
(this.settings = t.sys.settings),
(this.key = t.sys.settings.key),
(this.manager = t.sys.game.scene),
(this.transitionProgress = 0),
(this._elapsed = 0),
(this._target = null),
(this._duration = 0),
this._onUpdate,
this._onUpdateScope,
(this._willSleep = !1),
(this._willRemove = !1),
t.sys.events.once(a.BOOT, this.boot, this),
t.sys.events.on(a.START, this.pluginStart, this);
},
boot: function () {
this.systems.events.once(a.DESTROY, this.destroy, this);
},
pluginStart: function () {
(this._target = null), this.systems.events.once(a.SHUTDOWN, this.shutdown, this);
},
start: function (t, e) {
return void 0 === t && (t = this.key), this.manager.queueOp("stop", this.key), this.manager.queueOp("start", t, e), this;
},
restart: function (t) {
var e = this.key;
return this.manager.queueOp("stop", e), this.manager.queueOp("start", e, t), this;
},
transition: function (t) {
void 0 === t && (t = {});
var e = h(t, "target", !1),
i = this.manager.getScene(e);
if (!e || !this.checkValidTransition(i)) return !1;
var n = h(t, "duration", 1e3);
(this._elapsed = 0), (this._target = i), (this._duration = n), (this._willSleep = h(t, "sleep", !1)), (this._willRemove = h(t, "remove", !1));
var s = h(t, "onUpdate", null);
s && ((this._onUpdate = s), (this._onUpdateScope = h(t, "onUpdateScope", this.scene)));
var r = h(t, "allowInput", !1);
this.settings.transitionAllowInput = r;
var o = i.sys.settings;
return (
(o.isTransition = !0),
(o.transitionFrom = this.scene),
(o.transitionDuration = n),
(o.transitionAllowInput = r),
h(t, "moveAbove", !1) ? this.manager.moveAbove(this.key, e) : h(t, "moveBelow", !1) && this.manager.moveBelow(this.key, e),
i.sys.isSleeping() ? i.sys.wake(h(t, "data")) : this.manager.start(e, h(t, "data")),
this.systems.events.emit(a.TRANSITION_OUT, i, n),
this.systems.events.on(a.UPDATE, this.step, this),
!0
);
},
checkValidTransition: function (t) {
return !(!t || t.sys.isActive() || t.sys.isTransitioning() || t === this.scene || this.systems.isTransitioning());
},
step: function (t, e) {
(this._elapsed += e),
(this.transitionProgress = n(this._elapsed / this._duration, 0, 1)),
this._onUpdate && this._onUpdate.call(this._onUpdateScope, this.transitionProgress),
this._elapsed >= this._duration && this.transitionComplete();
},
transitionComplete: function () {
var t = this._target.sys,
e = this._target.sys.settings;
this.systems.events.off(a.UPDATE, this.step, this),
t.events.emit(a.TRANSITION_COMPLETE, this.scene),
(e.isTransition = !1),
(e.transitionFrom = null),
(this._duration = 0),
(this._target = null),
(this._onUpdate = null),
(this._onUpdateScope = null),
this._willRemove ? this.manager.remove(this.key) : this._willSleep ? this.systems.sleep() : this.manager.stop(this.key);
},
add: function (t, e, i, n) {
return this.manager.add(t, e, i, n);
},
launch: function (t, e) {
return t && t !== this.key && this.manager.queueOp("start", t, e), this;
},
run: function (t, e) {
return t && t !== this.key && this.manager.queueOp("run", t, e), this;
},
pause: function (t, e) {
return void 0 === t && (t = this.key), this.manager.queueOp("pause", t, e), this;
},
resume: function (t, e) {
return void 0 === t && (t = this.key), this.manager.queueOp("resume", t, e), this;
},
sleep: function (t, e) {
return void 0 === t && (t = this.key), this.manager.queueOp("sleep", t, e), this;
},
wake: function (t, e) {
return void 0 === t && (t = this.key), this.manager.queueOp("wake", t, e), this;
},
switch: function (t) {
return t !== this.key && this.manager.queueOp("switch", this.key, t), this;
},
stop: function (t, e) {
return void 0 === t && (t = this.key), this.manager.queueOp("stop", t, e), this;
},
setActive: function (t, e, i) {
void 0 === e && (e = this.key);
var n = this.manager.getScene(e);
return n && n.sys.setActive(t, i), this;
},
setVisible: function (t, e) {
void 0 === e && (e = this.key);
var i = this.manager.getScene(e);
return i && i.sys.setVisible(t), this;
},
isSleeping: function (t) {
return void 0 === t && (t = this.key), this.manager.isSleeping(t);
},
isActive: function (t) {
return void 0 === t && (t = this.key), this.manager.isActive(t);
},
isPaused: function (t) {
return void 0 === t && (t = this.key), this.manager.isPaused(t);
},
isVisible: function (t) {
return void 0 === t && (t = this.key), this.manager.isVisible(t);
},
swapPosition: function (t, e) {
return void 0 === e && (e = this.key), t !== e && this.manager.swapPosition(t, e), this;
},
moveAbove: function (t, e) {
return void 0 === e && (e = this.key), t !== e && this.manager.moveAbove(t, e), this;
},
moveBelow: function (t, e) {
return void 0 === e && (e = this.key), t !== e && this.manager.moveBelow(t, e), this;
},
remove: function (t) {
return void 0 === t && (t = this.key), this.manager.remove(t), this;
},
moveUp: function (t) {
return void 0 === t && (t = this.key), this.manager.moveUp(t), this;
},
moveDown: function (t) {
return void 0 === t && (t = this.key), this.manager.moveDown(t), this;
},
bringToTop: function (t) {
return void 0 === t && (t = this.key), this.manager.bringToTop(t), this;
},
sendToBack: function (t) {
return void 0 === t && (t = this.key), this.manager.sendToBack(t), this;
},
get: function (t) {
return this.manager.getScene(t);
},
getIndex: function (t) {
return void 0 === t && (t = this.key), this.manager.getIndex(t);
},
shutdown: function () {
var t = this.systems.events;
t.off(a.SHUTDOWN, this.shutdown, this), t.off(a.POST_UPDATE, this.step, this), t.off(a.TRANSITION_OUT);
},
destroy: function () {
this.shutdown(), this.scene.sys.events.off(a.START, this.start, this), (this.scene = null), (this.systems = null), (this.settings = null), (this.manager = null);
},
});
r.register("ScenePlugin", o, "scenePlugin"), (t.exports = o);
},
function (t, e, i) {
t.exports = { Events: i(438), List: i(110), Map: i(102), ProcessQueue: i(211), RTree: i(531), Set: i(149), Size: i(416) };
},
function (t, e, i) {
var n = i(17),
s = i(1417),
r = n(!1, (r = { CanvasTexture: i(423), Events: i(106), FilterMode: s, Frame: i(109), Parsers: i(425), Texture: i(206), TextureManager: i(422), TextureSource: i(424) }), s);
t.exports = r;
},
function (t, e) {
t.exports = { LINEAR: 0, NEAREST: 1 };
},
function (t, e, i) {
var n = i(17),
s = i(1419),
r = n(
!1,
(r = {
Components: i(251),
Parsers: i(1452),
Formats: i(40),
ImageCollection: i(576),
ParseToTilemap: i(262),
Tile: i(85),
Tilemap: i(580),
TilemapCreator: i(1459),
TilemapFactory: i(1460),
Tileset: i(122),
TilemapLayer: i(581),
Orientation: i(29),
LayerData: i(120),
MapData: i(121),
ObjectLayer: i(572),
}),
s.ORIENTATION
);
t.exports = r;
},
function (t, e, i) {
var n = { ORIENTATION: i(29) };
t.exports = n;
},
function (t, e, i) {
var p = i(26),
g = i(63);
t.exports = function (t, e, i, n, s, r, o, a) {
void 0 === o && (o = !0), t < 0 && (t = 0), e < 0 && (e = 0);
for (var h = p(t, e, i, n, null, a), l = s - t, u = r - e, c = 0; c < h.length; c++) {
var d = h[c].x + l,
f = h[c].y + u;
0 <= d && d < a.width && 0 <= f && f < a.height && a.data[f][d] && a.data[f][d].copy(h[c]);
}
o && g(s - 1, r - 1, i + 2, n + 2, a);
};
},
function (t, e, i) {
var d = i(26),
f = i(542);
t.exports = function (t, e, i, n, s, r) {
(i = i || {}), Array.isArray(t) || (t = [t]);
var o = r.tilemapLayer;
(n = n || o.scene), (s = s || n.cameras.main);
for (var a = d(0, 0, r.width, r.height, null, r), h = [], l = 0; l < a.length; l++) {
var u,
c = a[l];
-1 !== t.indexOf(c.index) && ((u = o.tileToWorldXY(c.x, c.y, void 0, s, r)), (i.x = u.x), (i.y = u.y), h.push(n.make.sprite(i)));
}
if ("number" == typeof e) for (l = 0; l < t.length; l++) f(t[l], e, 0, 0, r.width, r.height, r);
else if (Array.isArray(e)) for (l = 0; l < t.length; l++) f(t[l], e[l], 0, 0, r.width, r.height, r);
return h;
};
},
function (t, e, i) {
var u = i(26),
c = i(63),
d = i(72);
t.exports = function (t, e, i, n, s, r, o) {
for (var a = -1 !== o.collideIndexes.indexOf(t), h = u(e, i, n, s, null, o), l = 0; l < h.length; l++) (h[l].index = t), d(h[l], a);
r && c(e - 1, i - 1, n + 2, s + 2, o);
};
},
function (t, e, i) {
var h = i(26);
t.exports = function (t, e, i, n, s, r, o, a) {
return h(i, n, s, r, o, a).filter(t, e);
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
void 0 === e && (e = 0), void 0 === i && (i = !1);
var s,
r,
o,
a = 0;
if (i) {
for (r = n.height - 1; 0 <= r; r--)
for (s = n.width - 1; 0 <= s; s--)
if ((o = n.data[r][s]) && o.index === t) {
if (a === e) return o;
a += 1;
}
} else
for (r = 0; r < n.height; r++)
for (s = 0; s < n.width; s++)
if ((o = n.data[r][s]) && o.index === t) {
if (a === e) return o;
a += 1;
}
return null;
};
},
function (t, e, i) {
var h = i(26);
t.exports = function (t, e, i, n, s, r, o, a) {
return h(i, n, s, r, o, a).find(t, e) || null;
};
},
function (t, e, i) {
var h = i(26);
t.exports = function (t, e, i, n, s, r, o, a) {
h(i, n, s, r, o, a).forEach(t, e);
};
},
function (t, e, i) {
var n = i(29),
s = i(544),
r = i(545),
o = i(547),
a = i(1),
h = i(548);
t.exports = function (t) {
return t === n.ORTHOGONAL ? s : t === n.HEXAGONAL ? r : t === n.STAGGERED ? h : t === n.ISOMETRIC ? o : a;
};
},
function (t, e, i) {
var r = i(158),
o = new (i(3))();
t.exports = function (t, e, i, n, s) {
return s.tilemapLayer.worldToTileXY(t, e, !0, o, n), r(o.x, o.y, i, s);
};
},
function (t, e, i) {
function m(t, e) {
return w.RectangleToTriangle(e, t);
}
var x = i(483),
b = i(26),
w = i(484),
T = i(1),
n = i(3),
S = new n(),
_ = new n(),
E = new n();
t.exports = function (t, e, i, n) {
if (void 0 === t) return [];
var s = T;
t instanceof x.Circle ? (s = w.CircleToRectangle) : t instanceof x.Rectangle ? (s = w.RectangleToRectangle) : t instanceof x.Triangle ? (s = m) : t instanceof x.Line && (s = w.LineToRectangle),
n.tilemapLayer.worldToTileXY(t.left, t.top, !0, _, i);
var r = _.x,
o = _.y;
n.tilemapLayer.worldToTileXY(t.right, t.bottom, !0, E, i);
var a = Math.ceil(E.x),
h = Math.ceil(E.y),
l = Math.max(a - r, 1),
u = Math.max(h - o, 1),
c = b(r, o, l, u, e, n),
d = n.tileWidth,
f = n.tileHeight;
n.tilemapLayer && ((d *= n.tilemapLayer.scaleX), (f *= n.tilemapLayer.scaleY));
for (var p = [], g = new x.Rectangle(0, 0, d, f), v = 0; v < c.length; v++) {
var y = c[v];
n.tilemapLayer.tileToWorldXY(y.x, y.y, S, i), (g.x = S.x), (g.y = S.y), s(t, g) && p.push(y);
}
return p;
};
},
function (t, e, i) {
var n = i(29),
s = i(1),
r = i(253);
t.exports = function (t) {
return t === n.ORTHOGONAL ? r : s;
};
},
function (t, e, i) {
var n = i(29),
s = i(550),
r = i(551),
o = i(1),
a = i(552),
h = i(553);
t.exports = function (t) {
return t === n.ORTHOGONAL ? h : t === n.ISOMETRIC ? r : t === n.HEXAGONAL ? s : t === n.STAGGERED ? a : o;
};
},
function (t, e, i) {
var n = i(29),
s = i(554),
r = i(1),
o = i(555),
a = i(254);
t.exports = function (t) {
return t === n.ORTHOGONAL ? a : t === n.HEXAGONAL ? s : t === n.STAGGERED ? o : r;
};
},
function (t, e, i) {
var n = i(29),
s = i(1),
r = i(255);
t.exports = function (t) {
return t === n.ORTHOGONAL ? r : s;
};
},
function (t, e, i) {
var n = i(29),
s = i(556),
r = i(557),
o = i(1),
a = i(558),
h = i(559);
t.exports = function (t) {
return t === n.ORTHOGONAL ? h : t === n.ISOMETRIC ? r : t === n.HEXAGONAL ? s : t === n.STAGGERED ? a : o;
};
},
function (t, e, i) {
var n = i(29),
s = i(560),
r = i(1),
o = i(561),
a = i(256);
t.exports = function (t) {
return t === n.ORTHOGONAL ? a : t === n.HEXAGONAL ? s : t === n.STAGGERED ? o : r;
};
},
function (t, e, i) {
var o = i(562),
a = new (i(3))();
t.exports = function (t, e, i, n) {
n.tilemapLayer.worldToTileXY(t, e, !0, a, i);
var s = a.x,
r = a.y;
return o(s, r, n);
};
},
function (t, e, i) {
var o = i(257),
a = new (i(3))();
t.exports = function (t, e, i, n, s, r) {
return r.tilemapLayer.worldToTileXY(e, i, !0, a, s, r), o(t, a.x, a.y, n, r);
};
},
function (t, e, i) {
var u = i(63),
c = i(257);
t.exports = function (t, e, i, n, s) {
if ((void 0 === n && (n = !0), !Array.isArray(t))) return null;
Array.isArray(t[0]) || (t = [t]);
for (var r = t.length, o = t[0].length, a = 0; a < r; a++)
for (var h = 0; h < o; h++) {
var l = t[a][h];
c(l, e + h, i + a, !1, s);
}
n && u(e - 1, i - 1, o + 2, r + 2, s);
};
},
function (t, e, i) {
var h = i(26),
l = i(210);
t.exports = function (t, e, i, n, s, r) {
var o,
a = h(t, e, i, n, {}, r);
if (!s) for (s = [], o = 0; o < a.length; o++) -1 === s.indexOf(a[o].index) && s.push(a[o].index);
for (o = 0; o < a.length; o++) a[o].index = l(s);
};
},
function (t, e, i) {
var o = i(563),
a = new (i(3))();
t.exports = function (t, e, i, n, s, r) {
return r.tilemapLayer.worldToTileXY(t, e, !0, a, s, r), o(a.x, a.y, i, n, r);
};
},
function (t, e, i) {
var p = i(26),
n = i(397),
g = new n(105, 210, 231, 150),
v = new n(243, 134, 48, 200),
y = new n(40, 39, 37, 150);
t.exports = function (t, e, i) {
void 0 === e && (e = {});
var n = void 0 !== e.tileColor ? e.tileColor : g,
s = void 0 !== e.collidingTileColor ? e.collidingTileColor : v,
r = void 0 !== e.faceColor ? e.faceColor : y,
o = p(0, 0, i.width, i.height, null, i);
t.translateCanvas(i.tilemapLayer.x, i.tilemapLayer.y), t.scaleCanvas(i.tilemapLayer.scaleX, i.tilemapLayer.scaleY);
for (var a = 0; a < o.length; a++) {
var h = o[a],
l = h.width,
u = h.height,
c = h.pixelX,
d = h.pixelY,
f = h.collides ? s : n;
null !== f && (t.fillStyle(f.color, f.alpha / 255), t.fillRect(c, d, l, u)),
(c += 1),
(d += 1),
(l -= 2),
(u -= 2),
null !== r &&
(t.lineStyle(1, r.color, r.alpha / 255),
h.faceTop && t.lineBetween(c, d, c + l, d),
h.faceRight && t.lineBetween(c + l, d, c + l, d + u),
h.faceBottom && t.lineBetween(c, d + u, c + l, d + u),
h.faceLeft && t.lineBetween(c, d, c, d + u));
}
};
},
function (t, e, i) {
var l = i(72),
u = i(63),
c = i(160);
t.exports = function (t, e, i, n, s) {
void 0 === e && (e = !0), void 0 === i && (i = !0), void 0 === s && (s = !0), Array.isArray(t) || (t = [t]);
for (var r = 0; r < t.length; r++) c(t[r], e, n);
if (s)
for (var o = 0; o < n.height; o++)
for (var a = 0; a < n.width; a++) {
var h = n.data[o][a];
h && -1 !== t.indexOf(h.index) && l(h, e);
}
i && u(0, 0, n.width, n.height, n);
};
},
function (t, e, i) {
var u = i(72),
c = i(63),
d = i(160);
t.exports = function (t, e, i, n, s, r) {
if ((void 0 === i && (i = !0), void 0 === n && (n = !0), void 0 === r && (r = !0), !(e < t))) {
for (var o = t; o <= e; o++) d(o, i, s);
if (r)
for (var a = 0; a < s.height; a++)
for (var h = 0; h < s.width; h++) {
var l = s.data[a][h];
l && l.index >= t && l.index <= e && u(l, i);
}
n && c(0, 0, s.width, s.height, s);
}
};
},
function (t, e, i) {
var a = i(72),
h = i(63),
l = i(160);
t.exports = function (t, e, i, n) {
void 0 === e && (e = !0), void 0 === i && (i = !0), Array.isArray(t) || (t = [t]);
for (var s = 0; s < n.height; s++)
for (var r = 0; r < n.width; r++) {
var o = n.data[s][r];
o && -1 === t.indexOf(o.index) && (a(o, e), l(o.index, e, n));
}
i && h(0, 0, n.width, n.height, n);
};
},
function (t, e, i) {
var u = i(72),
c = i(63),
d = i(126);
t.exports = function (t, e, i, n) {
void 0 === e && (e = !0), void 0 === i && (i = !0);
for (var s = 0; s < n.height; s++)
for (var r = 0; r < n.width; r++) {
var o = n.data[s][r];
if (o)
for (var a in t)
if (d(o.properties, a)) {
var h = t[a];
Array.isArray(h) || (h = [h]);
for (var l = 0; l < h.length; l++) o.properties[a] === h[l] && u(o, e);
}
}
i && c(0, 0, n.width, n.height, n);
};
},
function (t, e, i) {
var a = i(72),
h = i(63);
t.exports = function (t, e, i) {
void 0 === t && (t = !0), void 0 === e && (e = !0);
for (var n = 0; n < i.height; n++)
for (var s = 0; s < i.width; s++) {
var r,
o = i.data[n][s];
o && (r = o.getCollisionGroup()) && r.objects && 0 < r.objects.length && a(o, t);
}
e && h(0, 0, i.width, i.height, i);
};
},
function (t, e) {
t.exports = function (t, e, i, n) {
if ("number" == typeof t) n.callbacks[t] = null !== e ? { callback: e, callbackContext: i } : void 0;
else for (var s = 0, r = t.length; s < r; s++) n.callbacks[t[s]] = null !== e ? { callback: e, callbackContext: i } : void 0;
};
},
function (t, e, i) {
var l = i(26);
t.exports = function (t, e, i, n, s, r, o) {
for (var a = l(t, e, i, n, null, o), h = 0; h < a.length; h++) a[h].setCollisionCallback(s, r);
};
},
function (t, e, i) {
var h = i(26),
l = i(131);
t.exports = function (t, e, i, n, s) {
var r = h(t, e, i, n, null, s),
o = r.map(function (t) {
return t.index;
});
l(o);
for (var a = 0; a < r.length; a++) r[a].index = o[a];
};
},
function (t, e, i) {
var l = i(26);
t.exports = function (t, e, i, n, s, r, o) {
for (var a = l(i, n, s, r, null, o), h = 0; h < a.length; h++) a[h] && (a[h].index === t ? (a[h].index = e) : a[h].index === e && (a[h].index = t));
};
},
function (t, e, i) {
var p = i(26);
t.exports = function (t, e, i, n, s, r) {
if (s) {
for (var o = p(t, e, i, n, null, r), a = 0, h = 0; h < s.length; h++) a += s[h].weight;
if (!(a <= 0))
for (h = 0; h < o.length; h++) {
for (var l = Math.random() * a, u = 0, c = -1, d = 0; d < s.length; d++)
if (l <= (u += s[d].weight)) {
var f = s[d].index;
c = Array.isArray(f) ? f[Math.floor(Math.random() * f.length)] : f;
break;
}
o[h].index = c;
}
}
};
},
function (t, e, i) {
t.exports = { FromOrientationString: i(258), Parse: i(564), Parse2DArray: i(259), ParseCSV: i(565), Impact: i(1454), Tiled: i(1455) };
},
function (t, e) {
t.exports = function (t, e) {
for (var i = 0; i < t.length; i++) {
var n = t[i],
s = i;
if ((n.name && "" !== n.name && (s = n.name), Array.isArray(n.wangtiles) && 0 < n.wangtiles.length)) {
var r,
o,
a,
h = {},
l = {};
if (Array.isArray(n.edgecolors)) for (r = 0; r < n.edgecolors.length; r++) (a = 1 + r), "" !== (o = n.edgecolors[r]).name && (h[a] = o.name);
if (Array.isArray(n.cornercolors)) for (r = 0; r < n.cornercolors.length; r++) (a = 1 + r), "" !== (o = n.cornercolors[r]).name && (l[a] = o.name);
if (Array.isArray(n.colors)) for (r = 0; r < n.colors.length; r++) (a = 1 + r), "" !== (o = n.colors[r]).name && (h[a] = l[a] = o.name);
for (var u = [h, l, h, l, h, l, h, l], c = 0; c < n.wangtiles.length; c++) {
for (var d, f = n.wangtiles[c], p = (p = e[f.tileid] || (e[f.tileid] = {})).wangid || (p.wangid = {}), g = [], v = 0; v < Math.min(u.length, f.wangid.length); v++)
0 !== (o = f.wangid[v]) ? (void 0 === (d = u[v][o]) ? g.push(o) : g.push(d)) : g.push(void 0);
p[s] = g;
}
}
}
};
},
function (t, e, i) {
t.exports = { ParseTileLayers: i(578), ParseTilesets: i(579), ParseWeltmeister: i(577) };
},
function (t, e, i) {
t.exports = {
AssignTileProperties: i(567),
Base64Decode: i(574),
BuildTilesetIndex: i(568),
CreateGroupLayer: i(161),
ParseGID: i(261),
ParseImageLayers: i(569),
ParseJSONTiled: i(566),
ParseObject: i(260),
ParseObjectLayers: i(570),
ParseTileLayers: i(573),
ParseTilesets: i(575),
};
},
function (t, e, i) {
var n = i(1),
s = i(1);
(n = i(1457)), (s = i(1458)), (t.exports = { renderWebGL: n, renderCanvas: s });
},
function (t, e, i) {
var M = i(12);
t.exports = function (t, e, i) {
var n = e.cull(i),
s = n.length,
r = i.alpha * e.alpha;
if (!(0 === s || r <= 0)) {
var o = e.gidMap,
a = t.pipelines.set(e.pipeline, e),
h = M.getTintAppendFloatAlpha,
l = e.scrollFactorX,
u = e.scrollFactorY,
c = e.x,
d = e.y,
f = e.scaleX,
p = e.scaleY;
t.pipelines.preBatch(e);
for (var g = 0; g < s; g++) {
var v,
y,
m,
x,
b,
w,
T,
S,
_,
E,
P = n[g],
A = o[P.index];
A &&
null !== (v = A.getTileTextureCoordinates(P.index)) &&
((y = A.glTexture),
(m = a.setTexture2D(y, e)),
(x = A.tileWidth),
(b = A.tileHeight),
(w = v.x),
(T = v.y),
(S = 0.5 * A.tileWidth),
(_ = 0.5 * A.tileHeight),
(E = h(P.tint, r * P.alpha)),
a.batchTexture(
e,
y,
y.width,
y.height,
c + (S + P.pixelX) * f,
d + (_ + P.pixelY) * p,
P.width,
P.height,
f,
p,
P.rotation,
P.flipX,
P.flipY,
l,
u,
S,
_,
w,
T,
x,
b,
E,
E,
E,
E,
!1,
0,
0,
i,
null,
!0,
m
));
}
t.pipelines.postBatch(e);
}
};
},
function (t, e, i) {
var n = i(25),
w = new n(),
T = new n(),
S = new n();
t.exports = function (t, e, i, n) {
var s = e.cull(i),
r = s.length,
o = i.alpha * e.alpha;
if (!(0 === r || o <= 0)) {
var a = w,
h = T,
l = S;
h.applyITRS(e.x, e.y, e.rotation, e.scaleX, e.scaleY), a.copyFrom(i.matrix);
var u = t.currentContext,
c = e.gidMap;
u.save(),
n
? (a.multiplyWithOffset(n, -i.scrollX * e.scrollFactorX, -i.scrollY * e.scrollFactorY), (h.e = e.x), (h.f = e.y), a.multiply(h, l), l.copyToContext(u))
: ((h.e -= i.scrollX * e.scrollFactorX), (h.f -= i.scrollY * e.scrollFactorY), h.copyToContext(u)),
(!t.antialias || 1 < e.scaleX || 1 < e.scaleY) && (u.imageSmoothingEnabled = !1);
for (var d = 0; d < r; d++) {
var f,
p,
g,
v,
y,
m,
x = s[d],
b = c[x.index];
b &&
((f = b.image.getSourceImage()),
null !== (p = b.getTileTextureCoordinates(x.index)) &&
((y = 0.5 * (g = b.tileWidth)),
(m = 0.5 * (v = b.tileHeight)),
u.save(),
u.translate(x.pixelX + y, x.pixelY + m),
0 !== x.rotation && u.rotate(x.rotation),
(x.flipX || x.flipY) && u.scale(x.flipX ? -1 : 1, x.flipY ? -1 : 1),
(u.globalAlpha = o * x.alpha),
u.drawImage(f, p.x, p.y, g, v, -y, -m, g, v),
u.restore()));
}
u.restore();
}
};
},
function (t, e, i) {
var n = i(16),
s = i(262);
n.register("tilemap", function (t) {
var e = void 0 !== t ? t : {};
return s(this.scene, e.key, e.tileWidth, e.tileHeight, e.width, e.height, e.data, e.insertNull);
});
},
function (t, e, i) {
var n = i(5),
a = i(262);
n.register("tilemap", function (t, e, i, n, s, r, o) {
return null === t && (t = void 0), null === e && (e = void 0), null === i && (i = void 0), null === n && (n = void 0), null === s && (s = void 0), a(this.scene, t, e, i, n, s, r, o);
});
},
function (t, e, i) {
t.exports = { Clock: i(1462), TimerEvent: i(582) };
},
function (t, e, i) {
var n = i(0),
s = i(24),
r = i(20),
o = i(582),
a = i(93),
h = new n({
initialize: function (t) {
(this.scene = t),
(this.systems = t.sys),
(this.now = 0),
(this.timeScale = 1),
(this.paused = !1),
(this._active = []),
(this._pendingInsertion = []),
(this._pendingRemoval = []),
t.sys.events.once(r.BOOT, this.boot, this),
t.sys.events.on(r.START, this.start, this);
},
boot: function () {
(this.now = this.systems.game.loop.time), this.systems.events.once(r.DESTROY, this.destroy, this);
},
start: function () {
var t = this.systems.events;
t.on(r.PRE_UPDATE, this.preUpdate, this), t.on(r.UPDATE, this.update, this), t.once(r.SHUTDOWN, this.shutdown, this);
},
addEvent: function (t) {
var e;
return (
t instanceof o ? ((e = t), this.removeEvent(e), (e.elapsed = e.startAt), (e.hasDispatched = !1), (e.repeatCount = -1 === e.repeat || e.loop ? 999999999999 : e.repeat)) : (e = new o(t)),
this._pendingInsertion.push(e),
e
);
},
delayedCall: function (t, e, i, n) {
return this.addEvent({ delay: t, callback: e, args: i, callbackScope: n });
},
clearPendingEvents: function () {
return (this._pendingInsertion = []), this;
},
removeEvent: function (t) {
Array.isArray(t) || (t = [t]);
for (var e = 0; e < t.length; e++) {
var i = t[e];
a(this._pendingRemoval, i), a(this._pendingInsertion, i), a(this._active, i);
}
return this;
},
removeAllEvents: function () {
return (this._pendingRemoval = this._pendingRemoval.concat(this._active)), this;
},
preUpdate: function () {
var t = this._pendingRemoval.length,
e = this._pendingInsertion.length;
if (0 !== t || 0 !== e) {
for (var i, n = 0; n < t; n++) {
i = this._pendingRemoval[n];
var s = this._active.indexOf(i);
-1 < s && this._active.splice(s, 1), i.destroy();
}
for (n = 0; n < e; n++) (i = this._pendingInsertion[n]), this._active.push(i);
(this._pendingRemoval.length = 0), (this._pendingInsertion.length = 0);
}
},
update: function (t, e) {
if (((this.now = t), !this.paused)) {
e *= this.timeScale;
for (var i = 0; i < this._active.length; i++) {
var n,
s = this._active[i];
s.paused ||
((s.elapsed += e * s.timeScale),
s.elapsed >= s.delay &&
((n = s.elapsed - s.delay),
(s.elapsed = s.delay),
!s.hasDispatched && s.callback && ((s.hasDispatched = !0), s.callback.apply(s.callbackScope, s.args)),
0 < s.repeatCount ? (s.repeatCount--, (s.elapsed = n), (s.hasDispatched = !1)) : this._pendingRemoval.push(s)));
}
}
},
shutdown: function () {
for (var t = 0; t < this._pendingInsertion.length; t++) this._pendingInsertion[t].destroy();
for (t = 0; t < this._active.length; t++) this._active[t].destroy();
for (t = 0; t < this._pendingRemoval.length; t++) this._pendingRemoval[t].destroy();
(this._active.length = 0), (this._pendingRemoval.length = 0), (this._pendingInsertion.length = 0);
var e = this.systems.events;
e.off(r.PRE_UPDATE, this.preUpdate, this), e.off(r.UPDATE, this.update, this), e.off(r.SHUTDOWN, this.shutdown, this);
},
destroy: function () {
this.shutdown(), this.scene.sys.events.off(r.START, this.start, this), (this.scene = null), (this.systems = null);
},
});
s.register("Clock", h, "time"), (t.exports = h);
},
function (t, e, i) {
var n = i(100),
s = i(17)(!1, (s = { Builders: i(1464), Events: i(267), TweenManager: i(1480), Tween: i(266), TweenData: i(268), Timeline: i(588) }), n);
t.exports = s;
},
function (t, e, i) {
t.exports = {
GetBoolean: i(99),
GetEaseFunction: i(80),
GetNewValue: i(162),
GetProps: i(583),
GetTargets: i(263),
GetTweens: i(584),
GetValueOp: i(264),
NumberTweenBuilder: i(585),
StaggerBuilder: i(586),
TimelineBuilder: i(587),
TweenBuilder: i(163),
};
},
function (t, e) {
t.exports = [
"callbackScope",
"completeDelay",
"delay",
"duration",
"ease",
"easeParams",
"flipX",
"flipY",
"hold",
"loop",
"loopDelay",
"offset",
"onActive",
"onActiveParams",
"onActiveScope",
"onComplete",
"onCompleteParams",
"onCompleteScope",
"onLoop",
"onLoopParams",
"onLoopScope",
"onRepeat",
"onRepeatParams",
"onRepeatScope",
"onStart",
"onStartParams",
"onStartScope",
"onStop",
"onStopParams",
"onStopScope",
"onUpdate",
"onUpdateParams",
"onUpdateScope",
"onYoyo",
"onYoyoParams",
"onYoyoScope",
"paused",
"props",
"repeat",
"repeatDelay",
"targets",
"useFrames",
"yoyo",
];
},
function (t, e) {
t.exports = "complete";
},
function (t, e) {
t.exports = "loop";
},
function (t, e) {
t.exports = "pause";
},
function (t, e) {
t.exports = "resume";
},
function (t, e) {
t.exports = "start";
},
function (t, e) {
t.exports = "update";
},
function (t, e) {
t.exports = "active";
},
function (t, e) {
t.exports = "complete";
},
function (t, e) {
t.exports = "loop";
},
function (t, e) {
t.exports = "repeat";
},
function (t, e) {
t.exports = "start";
},
function (t, e) {
t.exports = "stop";
},
function (t, e) {
t.exports = "update";
},
function (t, e) {
t.exports = "yoyo";
},
function (t, e, i) {
var n = i(93),
s = i(0),
r = i(585),
o = i(24),
a = i(20),
h = i(586),
l = i(587),
u = i(100),
c = i(163),
d = new s({
initialize: function (t) {
(this.scene = t),
(this.systems = t.sys),
(this.timeScale = 1),
(this._add = []),
(this._pending = []),
(this._active = []),
(this._destroy = []),
(this._toProcess = 0),
t.sys.events.once(a.BOOT, this.boot, this),
t.sys.events.on(a.START, this.start, this);
},
boot: function () {
this.systems.events.once(a.DESTROY, this.destroy, this);
},
start: function () {
var t = this.systems.events;
t.on(a.PRE_UPDATE, this.preUpdate, this), t.on(a.UPDATE, this.update, this), t.once(a.SHUTDOWN, this.shutdown, this), (this.timeScale = 1);
},
createTimeline: function (t) {
return l(this, t);
},
timeline: function (t) {
var e = l(this, t);
return e.paused || (this._add.push(e), this._toProcess++), e;
},
create: function (t) {
return c(this, t);
},
add: function (t) {
var e = c(this, t);
return this._add.push(e), this._toProcess++, e;
},
existing: function (t) {
return this._add.push(t), this._toProcess++, this;
},
addCounter: function (t) {
var e = r(this, t);
return this._add.push(e), this._toProcess++, e;
},
stagger: function (t, e) {
return h(t, e);
},
preUpdate: function () {
if (0 !== this._toProcess) {
for (var t, e = this._destroy, i = this._active, n = this._pending, s = 0; s < e.length; s++) {
t = e[s];
var r = i.indexOf(t);
-1 === r ? -1 < (r = n.indexOf(t)) && ((t.state = u.REMOVED), n.splice(r, 1)) : ((t.state = u.REMOVED), i.splice(r, 1));
}
for (e.length = 0, e = this._add, s = 0; s < e.length; s++) (t = e[s]).state === u.PENDING_ADD && (t.init() ? (t.play(), this._active.push(t)) : this._pending.push(t));
(e.length = 0), (this._toProcess = 0);
}
},
update: function (t, e) {
var i,
n = this._active;
e *= this.timeScale;
for (var s = 0; s < n.length; s++) (i = n[s]).update(t, e) && (this._destroy.push(i), this._toProcess++);
},
remove: function (t) {
return n(this._add, t), n(this._pending, t), n(this._active, t), n(this._destroy, t), (t.state = u.REMOVED), this;
},
makeActive: function (t) {
if (-1 !== this._add.indexOf(t) || -1 !== this._active.indexOf(t)) return this;
var e = this._pending.indexOf(t);
return -1 !== e && this._pending.splice(e, 1), this._add.push(t), (t.state = u.PENDING_ADD), this._toProcess++, this;
},
each: function (t, e) {
for (var i = [null], n = 1; n < arguments.length; n++) i.push(arguments[n]);
for (var s in this.list) (i[0] = this.list[s]), t.apply(e, i);
},
getAllTweens: function () {
for (var t = this._active, e = [], i = 0; i < t.length; i++) e.push(t[i]);
return e;
},
getGlobalTimeScale: function () {
return this.timeScale;
},
getTweensOf: function (t, e) {
void 0 === e && (e = !1);
var i,
n,
s,
r = this._active,
o = [];
for (Array.isArray(t) || (t = [t]), n = 0; n < r.length; n++) for (i = r[n], s = 0; s < t.length; s++) i.hasTarget(t[s]) && o.push(i);
if (e) for (r = this._pending, n = 0; n < r.length; n++) for (i = r[n], s = 0; s < t.length; s++) i.hasTarget(t[s]) && o.push(i);
return o;
},
isTweening: function (t) {
for (var e, i = this._active, n = 0; n < i.length; n++) if ((e = i[n]).hasTarget(t) && e.isPlaying()) return !0;
return !1;
},
killAll: function () {
for (var t = this.getAllTweens(), e = 0; e < t.length; e++) t[e].stop();
return this;
},
killTweensOf: function (t) {
for (var e = this.getTweensOf(t), i = 0; i < e.length; i++) e[i].stop();
return this;
},
pauseAll: function () {
for (var t = this._active, e = 0; e < t.length; e++) t[e].pause();
return this;
},
resumeAll: function () {
for (var t = this._active, e = 0; e < t.length; e++) t[e].resume();
return this;
},
setGlobalTimeScale: function (t) {
return (this.timeScale = t), this;
},
shutdown: function () {
this.killAll(), (this._add = []), (this._pending = []), (this._active = []), (this._destroy = []), (this._toProcess = 0);
var t = this.systems.events;
t.off(a.PRE_UPDATE, this.preUpdate, this), t.off(a.UPDATE, this.update, this), t.off(a.SHUTDOWN, this.shutdown, this);
},
destroy: function () {
this.shutdown(), this.scene.sys.events.off(a.START, this.start, this), (this.scene = null), (this.systems = null);
},
});
o.register("TweenManager", d, "tweens"), (t.exports = d);
},
function (t, e, i) {
t.exports = { Array: i(208), Base64: i(1482), Objects: i(1484), String: i(1488), NOOP: i(1) };
},
function (t, e, i) {
t.exports = { ArrayBufferToBase64: i(1483), Base64ToArrayBuffer: i(433) };
},
function (t, e) {
var o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
t.exports = function (t, e) {
for (var i = new Uint8Array(t), n = i.length, s = e ? "data:" + e + ";base64," : "", r = 0; r < n; r += 3)
(s += o[i[r] >> 2]), (s += o[((3 & i[r]) << 4) | (i[r + 1] >> 4)]), (s += o[((15 & i[r + 1]) << 2) | (i[r + 2] >> 6)]), (s += o[63 & i[r + 2]]);
return n % 3 == 2 ? (s = s.substring(0, s.length - 1) + "=") : n % 3 == 1 && (s = s.substring(0, s.length - 2) + "=="), s;
};
},
function (t, e, i) {
t.exports = {
Clone: i(77),
DeepCopy: i(175),
Extend: i(17),
GetAdvancedValue: i(13),
GetFastValue: i(2),
GetMinMaxValue: i(1485),
GetValue: i(6),
HasAll: i(1486),
HasAny: i(455),
HasValue: i(126),
IsPlainObject: i(7),
Merge: i(127),
MergeRight: i(1487),
Pick: i(571),
SetValue: i(478),
};
},
function (t, e, i) {
var o = i(6),
a = i(18);
t.exports = function (t, e, i, n, s) {
void 0 === s && (s = i);
var r = o(t, e, s);
return a(r, i, n);
};
},
function (t, e) {
t.exports = function (t, e) {
for (var i = 0; i < e.length; i++) if (!t.hasOwnProperty(e[i])) return !1;
return !0;
};
},
function (t, e, i) {
var s = i(77);
t.exports = function (t, e) {
var i = s(t);
for (var n in e) i.hasOwnProperty(n) && (i[n] = e[n]);
return i;
};
},
function (t, e, i) {
t.exports = { Format: i(1489), Pad: i(186), RemoveAt: i(1490), Reverse: i(1491), UppercaseFirst: i(205), UUID: i(222) };
},
function (t, e) {
t.exports = function (t, i) {
return t.replace(/%([0-9]+)/g, function (t, e) {
return i[Number(e) - 1];
});
};
},
function (t, e) {
t.exports = function (t, e) {
return 0 === e ? t.slice(1) : t.slice(0, e - 1) + t.slice(e);
};
},
function (t, e) {
t.exports = function (t) {
return t.split("").reverse().join("");
};
},
function (t, e, i) {
t.exports = {
SoundManagerCreator: i(426),
Events: i(70),
BaseSound: i(146),
BaseSoundManager: i(145),
WebAudioSound: i(434),
WebAudioSoundManager: i(432),
HTML5AudioSound: i(429),
HTML5AudioSoundManager: i(427),
NoAudioSound: i(431),
NoAudioSoundManager: i(430),
};
},
function (t, e, i) {
t.exports = { Arcade: i(1366), Matter: i(1494) };
},
function (t, e, i) {
t.exports = {
BodyBounds: i(1392),
Components: i(249),
Events: i(272),
Factory: i(1394),
MatterGameObject: i(1395),
Image: i(1396),
Matter: i(594),
MatterPhysics: i(1524),
PolyDecomp: i(1393),
Sprite: i(1397),
TileBody: i(593),
PhysicsEditorParser: i(589),
PhysicsJSONParser: i(590),
PointerConstraint: i(1398),
World: i(1402),
};
},
function (t, e) {
t.exports = {
setBounce: function (t) {
return (this.body.restitution = t), this;
},
};
},
function (t, e) {
var i = {
setCollisionCategory: function (t) {
return (this.body.collisionFilter.category = t), this;
},
setCollisionGroup: function (t) {
return (this.body.collisionFilter.group = t), this;
},
setCollidesWith: function (t) {
var e = 0;
if (Array.isArray(t)) for (var i = 0; i < t.length; i++) e |= t[i];
else e = t;
return (this.body.collisionFilter.mask = e), this;
},
setOnCollide: function (t) {
return (this.body.onCollideCallback = t), this;
},
setOnCollideEnd: function (t) {
return (this.body.onCollideEndCallback = t), this;
},
setOnCollideActive: function (t) {
return (this.body.onCollideActiveCallback = t), this;
},
setOnCollideWith: function (t, e) {
Array.isArray(t) || (t = [t]);
for (var i = 0; i < t.length; i++) {
var n = t[i].hasOwnProperty("body") ? t[i].body : t[i];
this.body.setOnCollideWith(n, e);
}
return this;
},
};
t.exports = i;
},
function (t, e, i) {
var n = i(41),
s = {
applyForce: function (t) {
return this._tempVec2.set(this.body.position.x, this.body.position.y), n.applyForce(this.body, this._tempVec2, t), this;
},
applyForceFrom: function (t, e) {
return n.applyForce(this.body, t, e), this;
},
thrust: function (t) {
var e = this.body.angle;
return this._tempVec2.set(t * Math.cos(e), t * Math.sin(e)), n.applyForce(this.body, { x: this.body.position.x, y: this.body.position.y }, this._tempVec2), this;
},
thrustLeft: function (t) {
var e = this.body.angle - Math.PI / 2;
return this._tempVec2.set(t * Math.cos(e), t * Math.sin(e)), n.applyForce(this.body, { x: this.body.position.x, y: this.body.position.y }, this._tempVec2), this;
},
thrustRight: function (t) {
var e = this.body.angle + Math.PI / 2;
return this._tempVec2.set(t * Math.cos(e), t * Math.sin(e)), n.applyForce(this.body, { x: this.body.position.x, y: this.body.position.y }, this._tempVec2), this;
},
thrustBack: function (t) {
var e = this.body.angle - Math.PI;
return this._tempVec2.set(t * Math.cos(e), t * Math.sin(e)), n.applyForce(this.body, { x: this.body.position.x, y: this.body.position.y }, this._tempVec2), this;
},
};
t.exports = s;
},
function (t, e) {
t.exports = {
setFriction: function (t, e, i) {
return (this.body.friction = t), void 0 !== e && (this.body.frictionAir = e), void 0 !== i && (this.body.frictionStatic = i), this;
},
setFrictionAir: function (t) {
return (this.body.frictionAir = t), this;
},
setFrictionStatic: function (t) {
return (this.body.frictionStatic = t), this;
},
};
},
function (t, e) {
t.exports = {
setIgnoreGravity: function (t) {
return (this.body.ignoreGravity = t), this;
},
};
},
function (t, e, i) {
var n = i(41),
s = i(3),
r = {
setMass: function (t) {
return n.setMass(this.body, t), this;
},
setDensity: function (t) {
return n.setDensity(this.body, t), this;
},
centerOfMass: {
get: function () {
return new s(this.body.centerOfMass.x, this.body.centerOfMass.y);
},
},
};
t.exports = r;
},
function (t, e) {
t.exports = {
setSensor: function (t) {
return (this.body.isSensor = t), this;
},
isSensor: function () {
return this.body.isSensor;
},
};
},
function (t, e, i) {
var y = i(86),
m = i(41),
u = i(124),
x = i(2),
b = i(589),
w = i(590),
T = i(64),
n = {
setRectangle: function (t, e, i) {
return this.setBody({ type: "rectangle", width: t, height: e }, i);
},
setCircle: function (t, e) {
return this.setBody({ type: "circle", radius: t }, e);
},
setPolygon: function (t, e, i) {
return this.setBody({ type: "polygon", sides: e, radius: t }, i);
},
setTrapezoid: function (t, e, i, n) {
return this.setBody({ type: "trapezoid", width: t, height: e, slope: i }, n);
},
setExistingBody: function (t, e) {
void 0 === e && (e = !0), this.body && this.world.remove(this.body, !0), (this.body = t);
for (var i = 0; i < t.parts.length; i++) t.parts[i].gameObject = this;
var n,
s,
r,
o,
a,
h,
l = this;
return (
(t.destroy = function () {
l.world.remove(l.body, !0), (l.body.gameObject = null);
}),
e && (this.world.has(t) && this.world.remove(t, !0), this.world.add(t)),
this._originComponent &&
((n = t.render.sprite.xOffset),
(s = t.render.sprite.yOffset),
(r = t.centerOfMass.x),
(o = t.centerOfMass.y),
u(r, 0.5) && u(o, 0.5) ? this.setOrigin(n + 0.5, s + 0.5) : ((a = t.centerOffset.x), (h = t.centerOffset.y), this.setOrigin(n + a / this.displayWidth, s + h / this.displayHeight))),
this
);
},
setBody: function (t, e) {
if (!t) return this;
"string" == typeof t && (t = { type: t });
var i = x(t, "type", "rectangle"),
n = x(t, "x", this._tempVec2.x),
s = x(t, "y", this._tempVec2.y),
r = x(t, "width", this.width),
o = x(t, "height", this.height);
switch (i) {
case "rectangle":
l = y.rectangle(n, s, r, o, e);
break;
case "circle":
var a = x(t, "radius", Math.max(r, o) / 2),
h = x(t, "maxSides", 25),
l = y.circle(n, s, a, e, h);
break;
case "trapezoid":
var u = x(t, "slope", 0.5);
l = y.trapezoid(n, s, r, o, u, e);
break;
case "polygon":
var c = x(t, "sides", 5),
d = x(t, "radius", Math.max(r, o) / 2);
l = y.polygon(n, s, c, d, e);
break;
case "fromVertices":
case "fromVerts":
var f,
p,
g,
v = x(t, "verts", null);
v &&
("string" == typeof v && (v = T.fromPath(v)),
(l =
this.body && !this.body.hasOwnProperty("temp")
? (m.setVertices(this.body, v), this.body)
: ((f = x(t, "flagInternal", !1)), (p = x(t, "removeCollinear", 0.01)), (g = x(t, "minimumArea", 10)), y.fromVertices(n, s, v, e, f, p, g))));
break;
case "fromPhysicsEditor":
l = b.parseBody(n, s, t, e);
break;
case "fromPhysicsTracer":
l = w.parseBody(n, s, t, e);
}
return l && this.setExistingBody(l, t.addToWorld), this;
},
};
t.exports = n;
},
function (t, e, i) {
var n = i(272),
s = i(165),
r = i(166),
o = {
setToSleep: function () {
return s.set(this.body, !0), this;
},
setAwake: function () {
return s.set(this.body, !1), this;
},
setSleepThreshold: function (t) {
return void 0 === t && (t = 60), (this.body.sleepThreshold = t), this;
},
setSleepEvents: function (t, e) {
return this.setSleepStartEvent(t), this.setSleepEndEvent(e), this;
},
setSleepStartEvent: function (t) {
var e;
return (
t
? ((e = this.world),
r.on(this.body, "sleepStart", function (t) {
e.emit(n.SLEEP_START, t, this);
}))
: r.off(this.body, "sleepStart"),
this
);
},
setSleepEndEvent: function (t) {
var e;
return (
t
? ((e = this.world),
r.on(this.body, "sleepEnd", function (t) {
e.emit(n.SLEEP_END, t, this);
}))
: r.off(this.body, "sleepEnd"),
this
);
},
};
t.exports = o;
},
function (t, e) {
t.exports = "afteradd";
},
function (t, e) {
t.exports = "afterremove";
},
function (t, e) {
t.exports = "afterupdate";
},
function (t, e) {
t.exports = "beforeadd";
},
function (t, e) {
t.exports = "beforeremove";
},
function (t, e) {
t.exports = "beforeupdate";
},
function (t, e) {
t.exports = "collisionactive";
},
function (t, e) {
t.exports = "collisionend";
},
function (t, e) {
t.exports = "collisionstart";
},
function (t, e) {
t.exports = "dragend";
},
function (t, e) {
t.exports = "drag";
},
function (t, e) {
t.exports = "dragstart";
},
function (t, e) {
t.exports = "pause";
},
function (t, e) {
t.exports = "resume";
},
function (t, e) {
t.exports = "sleepend";
},
function (t, e) {
t.exports = "sleepstart";
},
function (t, e, i) {
var n = i(41),
s = {
setStatic: function (t) {
return n.setStatic(this.body, t), this;
},
isStatic: function () {
return this.body.isStatic;
},
};
t.exports = s;
},
function (t, e, i) {
var r = i(41),
n = i(14),
s = i(269),
o = i(270),
a = {
x: {
get: function () {
return this.body.position.x;
},
set: function (t) {
this._tempVec2.set(t, this.y), r.setPosition(this.body, this._tempVec2);
},
},
y: {
get: function () {
return this.body.position.y;
},
set: function (t) {
this._tempVec2.set(this.x, t), r.setPosition(this.body, this._tempVec2);
},
},
scaleX: {
get: function () {
return this._scaleX;
},
set: function (t) {
var e = 1 / this._scaleX,
i = 1 / this._scaleY;
(this._scaleX = t), 0 === this._scaleX ? (this.renderFlags &= -5) : (this.renderFlags |= 4), r.scale(this.body, e, i), r.scale(this.body, t, this._scaleY);
},
},
scaleY: {
get: function () {
return this._scaleY;
},
set: function (t) {
var e = 1 / this._scaleX,
i = 1 / this._scaleY;
(this._scaleY = t), 0 === this._scaleY ? (this.renderFlags &= -5) : (this.renderFlags |= 4), r.scale(this.body, e, i), r.scale(this.body, this._scaleX, t);
},
},
angle: {
get: function () {
return o(this.body.angle * n.RAD_TO_DEG);
},
set: function (t) {
this.rotation = o(t) * n.DEG_TO_RAD;
},
},
rotation: {
get: function () {
return this.body.angle;
},
set: function (t) {
(this._rotation = s(t)), r.setAngle(this.body, this._rotation);
},
},
setPosition: function (t, e) {
return void 0 === t && (t = 0), void 0 === e && (e = t), this._tempVec2.set(t, e), r.setPosition(this.body, this._tempVec2), this;
},
setRotation: function (t) {
return void 0 === t && (t = 0), (this._rotation = s(t)), r.setAngle(this.body, t), this;
},
setFixedRotation: function () {
return r.setInertia(this.body, 1 / 0), this;
},
setAngle: function (t) {
return void 0 === t && (t = 0), (this.angle = t), r.setAngle(this.body, this.rotation), this;
},
setScale: function (t, e, i) {
void 0 === t && (t = 1), void 0 === e && (e = t);
var n = 1 / this._scaleX,
s = 1 / this._scaleY;
return (this._scaleX = t), (this._scaleY = e), r.scale(this.body, n, s, i), r.scale(this.body, t, e, i), this;
},
};
t.exports = a;
},
function (t, e, i) {
var n = i(41),
s = {
setAngularVelocity: function (t) {
return n.setAngularVelocity(this.body, t), this;
},
setVelocityX: function (t) {
return this._tempVec2.set(t, this.body.velocity.y), n.setVelocity(this.body, this._tempVec2), this;
},
setVelocityY: function (t) {
return this._tempVec2.set(this.body.velocity.x, t), n.setVelocity(this.body, this._tempVec2), this;
},
setVelocity: function (t, e) {
return this._tempVec2.set(t, e), n.setVelocity(this.body, this._tempVec2), this;
},
};
t.exports = s;
},
function (t, e, i) {
var n = {};
t.exports = n;
var s = i(118),
r = i(32);
(n.create = function (t) {
return r.extend(
{
extended: !1,
narrowDetections: 0,
narrowphaseTests: 0,
narrowReuse: 0,
narrowReuseCount: 0,
midphaseTests: 0,
broadphaseTests: 0,
narrowEff: 1e-4,
midEff: 1e-4,
broadEff: 1e-4,
collisions: 0,
buckets: 0,
bodies: 0,
pairs: 0,
},
!1,
t
);
}),
(n.reset = function (t) {
t.extended &&
((t.narrowDetections = 0),
(t.narrowphaseTests = 0),
(t.narrowReuse = 0),
(t.narrowReuseCount = 0),
(t.midphaseTests = 0),
(t.broadphaseTests = 0),
(t.narrowEff = 0),
(t.midEff = 0),
(t.broadEff = 0),
(t.collisions = 0),
(t.buckets = 0),
(t.pairs = 0),
(t.bodies = 0));
}),
(n.update = function (t, e) {
var i, n;
t.extended &&
((i = e.world),
(n = s.allBodies(i)),
(t.collisions = t.narrowDetections),
(t.pairs = e.pairs.list.length),
(t.bodies = n.length),
(t.midEff = (t.narrowDetections / (t.midphaseTests || 1)).toFixed(2)),
(t.narrowEff = (t.narrowDetections / (t.narrowphaseTests || 1)).toFixed(2)),
(t.broadEff = (1 - t.broadphaseTests / (n.length || 1)).toFixed(2)),
(t.narrowReuse = (t.narrowReuseCount / (t.narrowphaseTests || 1)).toFixed(2)));
});
},
function (t, e, i) {
var r = i(123),
n = i(271),
s = i(86),
o = i(41),
a = i(1392),
h = i(84),
l = i(0),
u = i(118),
c = i(591),
d = i(128),
f = i(273),
p = i(50),
g = i(1394),
v = i(2),
y = i(6),
m = i(597),
x = i(1525),
b = i(1526),
w = i(1399),
T = i(1527),
S = i(127),
_ = i(250),
E = i(598),
P = i(595),
A = i(24),
M = i(1400),
C = i(599),
O = i(274),
k = i(20),
R = i(592),
L = i(83),
I = i(64),
D = i(1402),
F = new l({
initialize: function (t) {
(this.scene = t),
(this.systems = t.sys),
(this.config = this.getConfig()),
this.world,
this.add,
this.bodyBounds,
(this.body = o),
(this.composite = u),
(this.detector = f),
(this.grid = m),
(this.pair = _),
(this.pairs = E),
(this.query = M),
(this.resolver = C),
(this.sat = O),
(this.constraint = d),
(this.bodies = s),
(this.composites = c),
(this.axes = n),
(this.bounds = h),
(this.svg = R),
(this.vector = L),
(this.vertices = I),
(this.verts = I),
(this._tempVec2 = L.create()),
y(this.config, "plugins.collisionevents", !0) && this.enableCollisionEventsPlugin(),
y(this.config, "plugins.attractors", !1) && this.enableAttractorPlugin(),
y(this.config, "plugins.wrap", !1) && this.enableWrapPlugin(),
(C._restingThresh = y(this.config, "restingThresh", 4)),
(C._restingThreshTangent = y(this.config, "restingThreshTangent", 6)),
(C._positionDampen = y(this.config, "positionDampen", 0.9)),
(C._positionWarming = y(this.config, "positionWarming", 0.8)),
(C._frictionNormalMultiplier = y(this.config, "frictionNormalMultiplier", 5)),
t.sys.events.once(k.BOOT, this.boot, this),
t.sys.events.on(k.START, this.start, this);
},
boot: function () {
(this.world = new D(this.scene, this.config)), (this.add = new g(this.world)), (this.bodyBounds = new a()), this.systems.events.once(k.DESTROY, this.destroy, this);
},
start: function () {
this.world || ((this.world = new D(this.scene, this.config)), (this.add = new g(this.world)));
var t = this.systems.events;
t.on(k.UPDATE, this.world.update, this.world), t.on(k.POST_UPDATE, this.world.postUpdate, this.world), t.once(k.SHUTDOWN, this.shutdown, this);
},
getConfig: function () {
var t = this.systems.game.config.physics,
e = this.systems.settings.physics;
return S(v(e, "matter", {}), v(t, "matter", {}));
},
enableAttractorPlugin: function () {
return P.register(x), P.use(w, x), this;
},
enableWrapPlugin: function () {
return P.register(T), P.use(w, T), this;
},
enableCollisionEventsPlugin: function () {
return P.register(b), P.use(w, b), this;
},
pause: function () {
return this.world.pause();
},
resume: function () {
return this.world.resume();
},
set60Hz: function () {
return (this.world.getDelta = this.world.update60Hz), (this.world.autoUpdate = !0), this;
},
set30Hz: function () {
return (this.world.getDelta = this.world.update30Hz), (this.world.autoUpdate = !0), this;
},
step: function (t, e) {
this.world.step(t, e);
},
containsPoint: function (t, e, i) {
t = this.getMatterBodies(t);
var n = L.create(e, i);
return 0 < M.point(t, n).length;
},
intersectPoint: function (t, e, i) {
i = this.getMatterBodies(i);
var n = L.create(t, e),
s = [];
return (
M.point(i, n).forEach(function (t) {
-1 === s.indexOf(t) && s.push(t);
}),
s
);
},
intersectRect: function (t, e, i, n, s, r) {
void 0 === s && (s = !1), (r = this.getMatterBodies(r));
var o = { min: { x: t, y: e }, max: { x: t + i, y: e + n } },
a = [];
return (
M.region(r, o, s).forEach(function (t) {
-1 === a.indexOf(t) && a.push(t);
}),
a
);
},
intersectRay: function (t, e, i, n, s, r) {
void 0 === s && (s = 1), (r = this.getMatterBodies(r));
for (var o = [], a = M.ray(r, L.create(t, e), L.create(i, n), s), h = 0; h < a.length; h++) o.push(a[h].body);
return o;
},
intersectBody: function (t, e) {
e = this.getMatterBodies(e);
for (var i = [], n = M.collides(t, e), s = 0; s < n.length; s++) {
var r = n[s];
r.bodyA === t ? i.push(r.bodyB) : i.push(r.bodyA);
}
return i;
},
overlap: function (t, e, i, n, s) {
void 0 === i && (i = null), void 0 === n && (n = null), void 0 === s && (s = i), Array.isArray(t) || (t = [t]), (t = this.getMatterBodies(t)), (e = this.getMatterBodies(e));
for (var r = !1, o = 0; o < t.length; o++)
for (var a = t[o], h = M.collides(a, e), l = 0; l < h.length; l++) {
var u = h[l],
c = u.bodyA.id === a.id ? u.bodyB : u.bodyA;
if (!n || n.call(s, a, c, u))
if (((r = !0), i)) i.call(s, a, c, u);
else if (!n) return !0;
}
return r;
},
setCollisionCategory: function (t, e) {
return (
(t = this.getMatterBodies(t)).forEach(function (t) {
t.collisionFilter.category = e;
}),
this
);
},
setCollisionGroup: function (t, e) {
return (
(t = this.getMatterBodies(t)).forEach(function (t) {
t.collisionFilter.group = e;
}),
this
);
},
setCollidesWith: function (t, e) {
t = this.getMatterBodies(t);
var i = 0;
if (Array.isArray(e)) for (var n = 0; n < e.length; n++) i |= e[n];
else i = e;
return (
t.forEach(function (t) {
t.collisionFilter.mask = i;
}),
this
);
},
getMatterBodies: function (t) {
if (!t) return this.world.getAllBodies();
Array.isArray(t) || (t = [t]);
for (var e = [], i = 0; i < t.length; i++) {
var n = t[i].hasOwnProperty("body") ? t[i].body : t[i];
e.push(n);
}
return e;
},
setVelocity: function (t, e, i) {
t = this.getMatterBodies(t);
var n = this._tempVec2;
return (
(n.x = e),
(n.y = i),
t.forEach(function (t) {
o.setVelocity(t, n);
}),
this
);
},
setVelocityX: function (t, e) {
t = this.getMatterBodies(t);
var i = this._tempVec2;
return (
(i.x = e),
t.forEach(function (t) {
(i.y = t.velocity.y), o.setVelocity(t, i);
}),
this
);
},
setVelocityY: function (t, e) {
t = this.getMatterBodies(t);
var i = this._tempVec2;
return (
(i.y = e),
t.forEach(function (t) {
(i.x = t.velocity.x), o.setVelocity(t, i);
}),
this
);
},
setAngularVelocity: function (t, e) {
return (
(t = this.getMatterBodies(t)).forEach(function (t) {
o.setAngularVelocity(t, e);
}),
this
);
},
applyForce: function (t, e) {
t = this.getMatterBodies(t);
var i = this._tempVec2;
return (
t.forEach(function (t) {
(i.x = t.position.x), (i.y = t.position.y), o.applyForce(t, i, e);
}),
this
);
},
applyForceFromPosition: function (t, e, i, n) {
t = this.getMatterBodies(t);
var s = this._tempVec2;
return (
t.forEach(function (t) {
void 0 === n && (n = t.angle), (s.x = i * Math.cos(n)), (s.y = i * Math.sin(n)), o.applyForce(t, e, s);
}),
this
);
},
applyForceFromAngle: function (t, e, i) {
t = this.getMatterBodies(t);
var n = this._tempVec2;
return (
t.forEach(function (t) {
void 0 === i && (i = t.angle), (n.x = e * Math.cos(i)), (n.y = e * Math.sin(i)), o.applyForce(t, { x: t.position.x, y: t.position.y }, n);
}),
this
);
},
getConstraintLength: function (t) {
var e = t.pointA.x,
i = t.pointA.y,
n = t.pointB.x,
s = t.pointB.y;
return t.bodyA && ((e += t.bodyA.position.x), (i += t.bodyA.position.y)), t.bodyB && ((n += t.bodyB.position.x), (s += t.bodyB.position.y)), p(e, i, n, s);
},
alignBody: function (t, e, i, n) {
var s;
switch (((t = t.hasOwnProperty("body") ? t.body : t), n)) {
case r.TOP_LEFT:
case r.LEFT_TOP:
s = this.bodyBounds.getTopLeft(t, e, i);
break;
case r.TOP_CENTER:
s = this.bodyBounds.getTopCenter(t, e, i);
break;
case r.TOP_RIGHT:
case r.RIGHT_TOP:
s = this.bodyBounds.getTopRight(t, e, i);
break;
case r.LEFT_CENTER:
s = this.bodyBounds.getLeftCenter(t, e, i);
break;
case r.CENTER:
s = this.bodyBounds.getCenter(t, e, i);
break;
case r.RIGHT_CENTER:
s = this.bodyBounds.getRightCenter(t, e, i);
break;
case r.LEFT_BOTTOM:
case r.BOTTOM_LEFT:
s = this.bodyBounds.getBottomLeft(t, e, i);
break;
case r.BOTTOM_CENTER:
s = this.bodyBounds.getBottomCenter(t, e, i);
break;
case r.BOTTOM_RIGHT:
case r.RIGHT_BOTTOM:
s = this.bodyBounds.getBottomRight(t, e, i);
}
return s && o.setPosition(t, s), this;
},
shutdown: function () {
var t = this.systems.events;
this.world && (t.off(k.UPDATE, this.world.update, this.world), t.off(k.POST_UPDATE, this.world.postUpdate, this.world)),
t.off(k.SHUTDOWN, this.shutdown, this),
this.add && this.add.destroy(),
this.world && this.world.destroy(),
(this.add = null),
(this.world = null);
},
destroy: function () {
this.shutdown(), this.scene.sys.events.off(k.START, this.start, this), (this.scene = null), (this.systems = null);
},
});
A.register("MatterPhysics", F, "matterPhysics"), (t.exports = F);
},
function (t, e, i) {
var u = i(594),
a = {
name: "matter-attractors",
version: "0.1.7",
for: "matter-js@^0.14.2",
silent: !0,
install: function (t) {
t.after("Body.create", function () {
a.Body.init(this);
}),
t.before("Engine.update", function (t) {
a.Engine.update(t);
});
},
Body: {
init: function (t) {
t.plugin.attractors = t.plugin.attractors || [];
},
},
Engine: {
update: function (t) {
for (var e = u.Composite.allBodies(t.world), i = 0; i < e.length; i++) {
var n = e[i],
s = n.plugin.attractors;
if (s && 0 < s.length)
for (var r = 0; r < e.length; r++) {
var o = e[r];
if (i !== r)
for (var a = 0; a < s.length; a++) {
var h = s[a],
l = h;
u.Common.isFunction(h) && (l = h(n, o)), l && u.Body.applyForce(o, o.position, l);
}
}
}
},
},
Attractors: {
gravityConstant: 0.001,
gravity: function (t, e) {
var i = u.Vector.sub(e.position, t.position),
n = u.Vector.magnitudeSquared(i) || 1e-4,
s = u.Vector.normalise(i),
r = -a.Attractors.gravityConstant * ((t.mass * e.mass) / n),
o = u.Vector.mult(s, r);
u.Body.applyForce(t, t.position, u.Vector.neg(o)), u.Body.applyForce(e, e.position, o);
},
},
};
t.exports = a;
},
function (t, e) {
t.exports = {
name: "matter-collision-events",
version: "0.1.6",
for: "matter-js@^0.14.2",
silent: !0,
install: function (n) {
n.after("Engine.create", function () {
n.Events.on(this, "collisionStart", function (t) {
t.pairs.map(function (t) {
var e = t.bodyA,
i = t.bodyB;
e.gameObject && e.gameObject.emit("collide", e, i, t),
i.gameObject && i.gameObject.emit("collide", i, e, t),
n.Events.trigger(e, "onCollide", { pair: t }),
n.Events.trigger(i, "onCollide", { pair: t }),
e.onCollideCallback && e.onCollideCallback(t),
i.onCollideCallback && i.onCollideCallback(t),
e.onCollideWith[i.id] && e.onCollideWith[i.id](i, t),
i.onCollideWith[e.id] && i.onCollideWith[e.id](e, t);
});
}),
n.Events.on(this, "collisionActive", function (t) {
t.pairs.map(function (t) {
var e = t.bodyA,
i = t.bodyB;
e.gameObject && e.gameObject.emit("collideActive", e, i, t),
i.gameObject && i.gameObject.emit("collideActive", i, e, t),
n.Events.trigger(e, "onCollideActive", { pair: t }),
n.Events.trigger(i, "onCollideActive", { pair: t }),
e.onCollideActiveCallback && e.onCollideActiveCallback(t),
i.onCollideActiveCallback && i.onCollideActiveCallback(t);
});
}),
n.Events.on(this, "collisionEnd", function (t) {
t.pairs.map(function (t) {
var e = t.bodyA,
i = t.bodyB;
e.gameObject && e.gameObject.emit("collideEnd", e, i, t),
i.gameObject && i.gameObject.emit("collideEnd", i, e, t),
n.Events.trigger(e, "onCollideEnd", { pair: t }),
n.Events.trigger(i, "onCollideEnd", { pair: t }),
e.onCollideEndCallback && e.onCollideEndCallback(t),
i.onCollideEndCallback && i.onCollideEndCallback(t);
});
});
});
},
};
},
function (t, e, i) {
var a = i(594),
h = {
name: "matter-wrap",
version: "0.1.4",
for: "matter-js@^0.14.2",
silent: !0,
install: function (t) {
t.after("Engine.update", function () {
h.Engine.update(this);
});
},
Engine: {
update: function (t) {
for (var e = t.world, i = a.Composite.allBodies(e), n = a.Composite.allComposites(e), s = 0; s < i.length; s += 1) {
var r = i[s];
r.plugin.wrap && h.Body.wrap(r, r.plugin.wrap);
}
for (s = 0; s < n.length; s += 1) {
var o = n[s];
o.plugin.wrap && h.Composite.wrap(o, o.plugin.wrap);
}
},
},
Bounds: {
wrap: function (t, e) {
var i = null,
n = null;
if (
(void 0 !== e.min.x && void 0 !== e.max.x && (t.min.x > e.max.x ? (i = e.min.x - t.max.x) : t.max.x < e.min.x && (i = e.max.x - t.min.x)),
void 0 !== e.min.y && void 0 !== e.max.y && (t.min.y > e.max.y ? (n = e.min.y - t.max.y) : t.max.y < e.min.y && (n = e.max.y - t.min.y)),
null !== i || null !== n)
)
return { x: i || 0, y: n || 0 };
},
},
Body: {
wrap: function (t, e) {
var i = h.Bounds.wrap(t.bounds, e);
return i && a.Body.translate(t, i), i;
},
},
Composite: {
bounds: function (t) {
for (var e = a.Composite.allBodies(t), i = [], n = 0; n < e.length; n += 1) {
var s = e[n];
i.push(s.bounds.min, s.bounds.max);
}
return a.Bounds.create(i);
},
wrap: function (t, e) {
var i = h.Bounds.wrap(h.Composite.bounds(t), e);
return i && a.Composite.translate(t, i), i;
},
},
};
t.exports = h;
},
function (s, t, r) {
(function (t) {
var e = r(33),
i = r(17),
n = {
Actions: r(275),
Animations: r(723),
BlendModes: r(35),
Cache: r(735),
Cameras: r(738),
Core: r(806),
Class: r(0),
Create: r(888),
Curves: r(894),
Data: r(896),
Display: r(898),
DOM: r(917),
Events: r(918),
Game: r(920),
GameObjects: r(1011),
Geom: r(483),
Input: r(1308),
Loader: r(1338),
Math: r(193),
Physics: r(1493),
Plugins: r(1403),
Renderer: r(1405),
Scale: r(1412),
ScaleModes: r(168),
Scene: r(418),
Scenes: r(1413),
Structs: r(1415),
Textures: r(1416),
Tilemaps: r(1418),
Time: r(1461),
Tweens: r(1463),
Utils: r(1481),
};
(n.Sound = r(1492)), (n = i(!1, n, e)), (s.exports = n), (t.Phaser = n);
}.call(this, r(600)));
},
]),
(s.c = n),
(s.d = function (t, e, i) {
s.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: i });
}),
(s.r = function (t) {
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 });
}),
(s.t = function (e, t) {
if ((1 & t && (e = s(e)), 8 & t)) return e;
if (4 & t && "object" == typeof e && e && e.__esModule) return e;
var i = Object.create(null);
if ((s.r(i), Object.defineProperty(i, "default", { enumerable: !0, value: e }), 2 & t && "string" != typeof e))
for (var n in e)
s.d(
i,
n,
function (t) {
return e[t];
}.bind(null, n)
);
return i;
}),
(s.n = function (t) {
var e =
t && t.__esModule
? function () {
return t.default;
}
: function () {
return t;
};
return s.d(e, "a", e), e;
}),
(s.o = function (t, e) {
return Object.prototype.hasOwnProperty.call(t, e);
}),
(s.p = ""),
s((s.s = 1528))
);
function s(t) {
if (n[t]) return n[t].exports;
var e = (n[t] = { i: t, l: !1, exports: {} });
return i[t].call(e.exports, e, e.exports, s), (e.l = !0), e.exports;
}
var i, n;
})();
},
function (t, e, i) {
var n;
void 0 ===
(n = function (t, e) {
"use strict";
Object.defineProperty(e, "__esModule", { value: !0 });
var i = (function () {
function l() {}
return (
(l.addDelay = function (t, e) {
(this.currMS = e),
(t.loop.step = function () {
var t = window.performance.now(),
e = (this.now = t) - this.lastTime;
if ((e < 0 && (e = 0), !(e < l.currMS))) {
this.rawDelta = e;
var i = this.deltaIndex,
n = this.deltaHistory,
s = this.deltaSmoothingMax,
r = e;
(0 < this._coolDown || !this.inFocus) && (this._coolDown--, (r = Math.min(r, this._target))),
r > this._min && ((r = n[i]), (r = Math.min(r, this._min))),
(n[i] = r),
this.deltaIndex++,
this.deltaIndex > s && (this.deltaIndex = 0);
for (var o = 0, a = 0; a < s; a++) o += n[a];
(o /= s),
(this.delta = o),
(this.time += this.rawDelta),
t > this.nextFpsUpdate && ((this.actualFps = 0.25 * this.framesThisSecond + 0.75 * this.actualFps), (this.nextFpsUpdate = t + 1e3), (this.framesThisSecond = 0)),
this.framesThisSecond++;
var h = o / this._target;
this.callback(t, o, h), (this.lastTime = t), this.frame++;
}
});
}),
(l.enableTJSDepthTesting = function (p) {
void 0 === p && (p = !1),
(Phaser.Renderer.WebGL.WebGLRenderer.prototype.init = function (t) {
var e,
i = this.game,
n = this.canvas,
s = t.backgroundColor;
if (
!(e = i.config.context
? i.config.context
: ((t.contextCreation.depth = p), n.getContext("webgl2", t.contextCreation) || n.getContext("webgl", t.contextCreation) || n.getContext("experimental-webgl", t.contextCreation))) ||
e.isContextLost()
)
throw ((this.contextLost = !0), new Error("WebGL unsupported"));
this.gl = e;
var r = this;
(this.contextLostHandler = function (t) {
(r.contextLost = !0), r.game.events.emit(Phaser.Core.Events.CONTEXT_LOST, r), t.preventDefault();
}),
(this.contextRestoredHandler = function () {
(r.contextLost = !1), r.init(r.config), r.game.events.emit(Phaser.Core.Events.CONTEXT_RESTORED, r);
}),
n.addEventListener("webglcontextlost", this.contextLostHandler, !1),
n.addEventListener("webglcontextrestored", this.contextRestoredHandler, !1),
(i.context = e);
for (var o = 0; o <= 27; o++) this.blendModes.push({ func: [e.ONE, e.ONE_MINUS_SRC_ALPHA], equation: e.FUNC_ADD });
(this.blendModes[1].func = [e.ONE, e.DST_ALPHA]),
(this.blendModes[2].func = [e.DST_COLOR, e.ONE_MINUS_SRC_ALPHA]),
(this.blendModes[3].func = [e.ONE, e.ONE_MINUS_SRC_COLOR]),
(this.blendModes[17] = { func: [e.ZERO, e.ONE_MINUS_SRC_ALPHA], equation: e.FUNC_REVERSE_SUBTRACT }),
(this.glFormats[0] = e.BYTE),
(this.glFormats[1] = e.SHORT),
(this.glFormats[2] = e.UNSIGNED_BYTE),
(this.glFormats[3] = e.UNSIGNED_SHORT),
(this.glFormats[4] = e.FLOAT),
(this.glFuncMap = {
mat2: { func: e.uniformMatrix2fv, length: 1, matrix: !0 },
mat3: { func: e.uniformMatrix3fv, length: 1, matrix: !0 },
mat4: { func: e.uniformMatrix4fv, length: 1, matrix: !0 },
"1f": { func: e.uniform1f, length: 1 },
"1fv": { func: e.uniform1fv, length: 1 },
"1i": { func: e.uniform1i, length: 1 },
"1iv": { func: e.uniform1iv, length: 1 },
"2f": { func: e.uniform2f, length: 2 },
"2fv": { func: e.uniform2fv, length: 1 },
"2i": { func: e.uniform2i, length: 2 },
"2iv": { func: e.uniform2iv, length: 1 },
"3f": { func: e.uniform3f, length: 3 },
"3fv": { func: e.uniform3fv, length: 1 },
"3i": { func: e.uniform3i, length: 3 },
"3iv": { func: e.uniform3iv, length: 1 },
"4f": { func: e.uniform4f, length: 4 },
"4fv": { func: e.uniform4fv, length: 1 },
"4i": { func: e.uniform4i, length: 4 },
"4iv": { func: e.uniform4iv, length: 1 },
});
var a = e.getSupportedExtensions();
(t.maxTextures && -1 !== t.maxTextures) || (t.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)), t.maxTextureSize || (t.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE));
var h = "WEBGL_compressed_texture_",
l = "WEBKIT_" + h;
(this.compression.ETC1 = e.getExtension(h + "etc1") || e.getExtension(l + "etc1")),
(this.compression.PVRTC = e.getExtension(h + "pvrtc") || e.getExtension(l + "pvrtc")),
(this.compression.S3TC = e.getExtension(h + "s3tc") || e.getExtension(l + "s3tc")),
(this.supportedExtensions = a),
(this.instancedArraysExtension = -1 < a.indexOf("ANGLE_instanced_arrays") ? e.getExtension("ANGLE_instanced_arrays") : null),
(this.vaoExtension = -1 < a.indexOf("OES_vertex_array_object") ? e.getExtension("OES_vertex_array_object") : null),
e.disable(e.DEPTH_TEST),
e.disable(e.CULL_FACE),
e.enable(e.BLEND),
e.clearColor(s.redGL, s.greenGL, s.blueGL, s.alphaGL),
(this.mipmapFilter = e[t.mipmapFilter]),
(this.maxTextures = Phaser.Renderer.WebGL.Utils.checkShaderMax(e, t.maxTextures)),
(this.textureIndexes = []);
var u = this.tempTextures;
if (Array.isArray(u)) for (var c = 0; c < this.maxTextures; c++) e.deleteTexture(u[c]);
else u = new Array(this.maxTextures);
for (var d = 0; d < this.maxTextures; d++) {
var f = e.createTexture();
e.activeTexture(e.TEXTURE0 + d),
e.bindTexture(e.TEXTURE_2D, f),
e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, 1, 1, 0, e.RGBA, e.UNSIGNED_BYTE, new Uint8Array([0, 0, 255, 255])),
(u[d] = f),
this.textureIndexes.push(d);
}
return (
(this.tempTextures = u),
(this.currentActiveTexture = 1),
this.startActiveTexture++,
e.activeTexture(e.TEXTURE1),
(this.pipelines = new Phaser.Renderer.WebGL.PipelineManager(this)),
this.setBlendMode(Phaser.BlendModes.NORMAL),
(this.projectionMatrix = new Phaser.Math.Matrix4().identity()),
i.textures.once(Phaser.Textures.Events.READY, this.boot, this),
this
);
});
}),
(l.updateText = function (T, S) {
Phaser.GameObjects.Text.prototype.updateText = function () {
var t = this.canvas,
e = this.context,
i = this.style,
n = i.resolution,
s = i.metrics;
i.syncFont(t, e);
var r = this._text;
(i.wordWrapWidth || i.wordWrapCallback) && (r = this.runWordWrap(this._text));
var o = r.split(this.splitRegExp),
a = Phaser.GameObjects.GetTextSize(this, s, o);
this.lineSpacing = T * (Number(i.fontSize.replace("px", "")) / S);
var h,
l = this.padding;
0 === i.fixedWidth ? ((this.width = a.width + l.left + l.right), (h = a.width)) : ((this.width = i.fixedWidth), (h = this.width - l.left - l.right) < a.width && (h = a.width)),
0 === i.fixedHeight ? (this.height = a.height + l.top + l.bottom) : (this.height = i.fixedHeight);
var u,
c,
d = this.width,
f = this.height;
this.updateDisplayOrigin(),
(d *= n),
(f *= n),
(d = Math.max(d, 1)),
(f = Math.max(f, 1)),
t.width !== d || t.height !== f ? ((t.width = d), (t.height = f), this.frame.setSize(d, f), i.syncFont(t, e)) : e.clearRect(0, 0, d, f),
e.save(),
e.scale(n, n),
i.backgroundColor && ((e.fillStyle = i.backgroundColor), e.fillRect(0, 0, d, f)),
i.syncStyle(t, e),
(e.textBaseline = "alphabetic"),
e.translate(l.left, l.top);
for (var p = 0; p < a.lines; p++) {
if (((u = i.strokeThickness / 2), (c = i.strokeThickness / 2 + p * a.lineHeight + s.ascent), 0 < p && (c += a.lineSpacing * p), i.rtl)) u = d - u;
else if ("right" === i.align) u += h - a.lineWidths[p];
else if ("center" === i.align) u += (h - a.lineWidths[p]) / 2;
else if ("justify" === i.align && 0.85 <= a.lineWidths[p] / a.width) {
var g = a.width - a.lineWidths[p],
v = e.measureText(" ").width,
y = o[p].trim(),
m = y.split(" ");
g += (o[p].length - y.length) * v;
for (var x = Math.floor(g / v), b = 0; 0 < x; ) (m[b] += " "), (b = (b + 1) % (m.length - 1 || 1)), --x;
o[p] = m.join(" ");
}
this.autoRound && ((u = Math.round(u)), (c = Math.round(c))),
i.strokeThickness && (this.style.syncShadow(e, i.shadowStroke), e.strokeText(o[p], u, c)),
i.color && (this.style.syncShadow(e, i.shadowFill), e.fillText(o[p], u, c));
}
e.restore(),
this.renderer && this.renderer.gl && ((this.frame.source.glTexture = this.renderer.canvasToTexture(t, this.frame.source.glTexture, !0)), (this.frame.glTexture = this.frame.source.glTexture)),
(this.dirty = !0);
var w = this.input;
return w && !w.customHitArea && ((w.hitArea.width = this.width), (w.hitArea.height = this.height)), this;
};
}),
l
);
})();
e.default = i;
}.apply(e, [i, e])) || (t.exports = n);
},
function (t, e, i) {
t.exports = (function () {
"use strict";
function l(t) {
return (l =
"function" == typeof Symbol && "symbol" == typeof Symbol.iterator
? function (t) {
return typeof t;
}
: function (t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
})(t);
}
function d(t, e) {
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
}
function n(t, e) {
for (var i = 0; i < e.length; i++) {
var n = e[i];
(n.enumerable = n.enumerable || !1), (n.configurable = !0), "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n);
}
}
function s(t, e, i) {
return e && n(t.prototype, e), i && n(t, i), t;
}
function t(t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
var i, n;
(t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } })),
e &&
((i = t),
(n = e),
(
Object.setPrototypeOf ||
function (t, e) {
return (t.__proto__ = e), t;
}
)(i, n));
}
function o(t) {
return (o = Object.setPrototypeOf
? Object.getPrototypeOf
: function (t) {
return t.__proto__ || Object.getPrototypeOf(t);
})(t);
}
function f(t) {
if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return t;
}
function e(s) {
var r = (function () {
if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
if (Reflect.construct.sham) return !1;
if ("function" == typeof Proxy) return !0;
try {
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), !0;
} catch (t) {
return !1;
}
})();
return function () {
var t,
e,
i = o(s);
if (r) {
var n = o(this).constructor;
t = Reflect.construct(i, arguments, n);
} else t = i.apply(this, arguments);
return this, !(e = t) || ("object" != typeof e && "function" != typeof e) ? f(this) : e;
};
}
function r(t) {
var e = y.create(this),
i = e.getContext("2d");
t.syncFont(e, i);
var n = i.measureText(t.testString);
if (n.hasOwnProperty("actualBoundingBoxAscent") && n.hasOwnProperty("actualBoundingBoxDescent")) {
var s = n.actualBoundingBoxAscent,
r = n.actualBoundingBoxDescent,
o = { ascent: s, descent: r, fontSize: s + r };
return y.remove(e), o;
}
var a = Math.ceil(n.width * t.baselineX),
h = a,
l = 2 * h;
if (
((h = (h * t.baselineY) | 0),
(e.width = a),
(e.height = l),
(i.fillStyle = "#f00"),
i.fillRect(0, 0, a, l),
(i.font = t._font),
(i.textBaseline = "alphabetic"),
(i.fillStyle = "#000"),
i.fillText(t.testString, 0, h),
(o = { ascent: 0, descent: 0, fontSize: 0 }),
!i.getImageData(0, 0, a, l))
)
return (o.ascent = h), (o.descent = h + 6), (o.fontSize = o.ascent + o.descent), y.remove(e), o;
var u,
c,
d = i.getImageData(0, 0, a, l).data,
f = d.length,
p = 4 * a,
g = 0,
v = !1;
for (u = 0; u < h; u++) {
for (c = 0; c < p; c += 4)
if (255 !== d[g + c]) {
v = !0;
break;
}
if (v) break;
g += p;
}
for (o.ascent = h - u, g = f - p, v = !1, u = l; h < u; u--) {
for (c = 0; c < p; c += 4)
if (255 !== d[g + c]) {
v = !0;
break;
}
if (v) break;
g -= p;
}
return (o.descent = u - h), (o.fontSize = o.ascent + o.descent), y.remove(e), o;
}
function a(t, e, i) {
if (null == t) return t;
switch (l(t)) {
case "string":
return t;
case "number":
return "#".concat(p(Math.floor(t).toString(16), 6, "0", 1));
case "function":
return t(e, i);
case "object":
return t.hasOwnProperty("r")
? t.hasOwnProperty("a")
? "rgba(".concat(t.r, ",").concat(t.g, ",").concat(t.b, ",").concat(t.a, ")")
: "rgb(".concat(t.r, ",").concat(t.g, ",").concat(t.b, ")")
: t.hasOwnProperty("h")
? t.hasOwnProperty("a")
? "hsla(".concat(t.h, ",").concat(t.s, ",").concat(t.l, ",").concat(t.a, ")")
: "hsl(".concat(t.h, ",").concat(t.s, ",").concat(t.l, ")")
: t;
default:
return t;
}
}
function T(t, e) {
var i = Array.isArray(t);
if (
(void 0 === e
? (e = i ? [] : {})
: (function (t) {
if (Array.isArray(t)) t.length = 0;
else for (var e in t) delete t[e];
})(e),
i)
) {
e.length = t.length;
for (var n = 0, s = t.length; n < s; n++) e[n] = t[n];
} else for (var r in t) e[r] = t[r];
return e;
}
function i() {}
function S(t, e, i, n, s) {
n <= 0 && (i = K);
var r = J;
if ((Q.pushMultiple(r), !t || !t.length)) return r;
for (var o, a, h, l = t.split(Z), u = 0, c = l.length; u < c; u++)
if (((o = l[u]), (h = u === c - 1 ? j : H), i !== K)) {
var d, f;
if (((a = 0 === u ? n - s : n), o.length <= 100 && (b = e(o)) <= a)) {
r.push(Q.newline(o, b, h));
continue;
}
for (var p, g = "", v = "", y = 0, m = 0, x = (d = i === q ? o.split(" ") : o).length; m < x; m++)
(f = d[m]),
i === q ? ((g += f), m < x - 1 && (g += " ")) : (g += f),
a < (p = e(g)) && (0 === m ? r.push(Q.newline("", 0, W)) : (r.push(Q.newline(v, y, W)), (g = f), i === q && m < x - 1 && (g += " "), (p = e(g))), (a = n)),
(v = g),
(y = p);
r.push(Q.newline(v, y, h));
} else {
var b = e(o);
r.push(Q.newline(o, b, h));
}
return r;
}
var u = Phaser.Renderer.WebGL.Utils,
h = {
renderWebGL: function (t, e, i, n) {
if (0 !== e.width && 0 !== e.height) {
i.addToRenderList(e);
var s = e.frame,
r = s.width,
o = s.height,
a = u.getTintAppendFloatAlpha,
h = t.pipelines.set(e.pipeline, e),
l = h.setTexture2D(s.glTexture, e);
t.pipelines.preBatch(e),
h.batchTexture(
e,
s.glTexture,
r,
o,
e.x,
e.y,
r / e.style.resolution,
o / e.style.resolution,
e.scaleX,
e.scaleY,
e.rotation,
e.flipX,
e.flipY,
e.scrollFactorX,
e.scrollFactorY,
e.displayOriginX,
e.displayOriginY,
0,
0,
r,
o,
a(e.tintTopLeft, i.alpha * e._alphaTL),
a(e.tintTopRight, i.alpha * e._alphaTR),
a(e.tintBottomLeft, i.alpha * e._alphaBL),
a(e.tintBottomRight, i.alpha * e._alphaBR),
e.tintFill,
0,
0,
i,
n,
!1,
l
),
t.pipelines.postBatch(e);
}
},
renderCanvas: function (t, e, i, n) {
0 !== e.width && 0 !== e.height && (i.addToRenderList(e), t.batchSprite(e, e.frame, i, n));
},
},
y = Phaser.Display.Canvas.CanvasPool,
c = /(?:\r\n|\r|\n)/,
p = Phaser.Utils.String.Pad,
g = Phaser.Utils.Objects.GetAdvancedValue,
v = Phaser.Utils.Objects.GetValue,
m = {
backgroundColor: ["backgroundColor", null, a],
backgroundColor2: ["backgroundColor2", null, a],
backgroundHorizontalGradient: ["backgroundHorizontalGradient", !0, null],
backgroundStrokeColor: ["backgroundStrokeColor", null, a],
backgroundStrokeLineWidth: ["backgroundStrokeLineWidth", 2, null],
backgroundCornerRadius: ["backgroundCornerRadius", 0, null],
backgroundCornerIteration: ["backgroundCornerIteration", null, null],
fontFamily: ["fontFamily", "Courier", null],
fontSize: ["fontSize", "16px", null],
fontStyle: ["fontStyle", "", null],
color: ["color", "#fff", a],
stroke: ["stroke", "#fff", a],
strokeThickness: ["strokeThickness", 0, null],
shadowOffsetX: ["shadow.offsetX", 0, null],
shadowOffsetY: ["shadow.offsetY", 0, null],
shadowColor: ["shadow.color", "#000", a],
shadowBlur: ["shadow.blur", 0, null],
shadowStroke: ["shadow.stroke", !1, null],
shadowFill: ["shadow.fill", !1, null],
underlineColor: ["underline.color", "#000", a],
underlineThickness: ["underline.thickness", 0, null],
underlineOffset: ["underline.offset", 0, null],
halign: ["halign", "left", null],
valign: ["valign", "top", null],
maxLines: ["maxLines", 0, null],
fixedWidth: ["fixedWidth", 0, null],
fixedHeight: ["fixedHeight", 0, null],
resolution: ["resolution", 0, null],
lineSpacing: ["lineSpacing", 0, null],
rtl: ["rtl", !1, null],
testString: ["testString", "|MÉqgy", null],
baselineX: ["baselineX", 1.2, null],
baselineY: ["baselineY", 1.4, null],
wrapMode: ["wrap.mode", 0, null],
wrapWidth: ["wrap.width", 0, null],
},
x = (function () {
function n(t, e) {
d(this, n),
(this.parent = t),
this.backgroundColor,
this.backgroundColor2,
this.backgroundHorizontalGradient,
this.backgroundStrokeColor,
this.backgroundStrokeLineWidth,
this.backgroundCornerRadius,
this.backgroundCornerIteration,
this.fontFamily,
this.fontSize,
this.fontStyle,
this.color,
this.stroke,
this.strokeThickness,
this.shadowOffsetX,
this.shadowOffsetY,
this.shadowColor,
this.shadowBlur,
this.shadowStroke,
this.shadowFill,
this.underlineColor,
this.underlineThickness,
this.underlineOffset,
this.halign,
this.valign,
this.maxLines,
this.fixedWidth,
this.fixedHeight,
this.resolution,
this.lineSpacing,
this.rtl,
this.testString,
this.baselineX,
this.baselineY,
this._font,
this.setStyle(e, !1);
var i = v(e, "metrics", !1);
this.metrics = i ? { ascent: v(i, "ascent", 0), descent: v(i, "descent", 0), fontSize: v(i, "fontSize", 0) } : r(this);
}
return (
s(n, [
{
key: "canvas",
get: function () {
return this.parent.canvasText.canvas;
},
},
{
key: "context",
get: function () {
return this.parent.canvasText.context;
},
},
{
key: "isWrapFitMode",
get: function () {
return 0 < this.fixedWidth && 0 !== this.wrapMode && 0 === this.wrapWidth;
},
},
{
key: "setStyle",
value: function (t, e) {
if ((void 0 === e && (e = !0), t && t.hasOwnProperty("wrap"))) {
var i = t.wrap;
if (i.hasOwnProperty("mode")) {
var n = i.mode;
"string" == typeof n && (i.mode = b[n]);
} else i.hasOwnProperty("width") && (i.mode = 1);
}
for (var s in (t && t.hasOwnProperty("fontSize") && "number" == typeof t.fontSize && (t.fontSize = t.fontSize.toString() + "px"), m)) {
var r = m[s],
o = r[0],
a = r[1],
h = r[2],
l = g(t, o, a);
h && (l = h(l)), (this[s] = l);
}
var u = v(t, "font", null);
this._font = null === u ? this.fontStyle + " " + this.fontSize + " " + this.fontFamily : u;
var c = v(t, "fill", null);
return null !== c && (this.color = c), e ? this.update(!0) : this.parent;
},
},
{
key: "syncFont",
value: function (t, e) {
e.font = this._font;
},
},
{
key: "syncStyle",
value: function (t, e) {
(e.textBaseline = "alphabetic"), (e.fillStyle = this.color), (e.strokeStyle = this.stroke), (e.lineWidth = this.strokeThickness), (e.lineCap = "round"), (e.lineJoin = "round");
},
},
{
key: "syncShadow",
value: function (t, e) {
e
? ((t.shadowOffsetX = this.shadowOffsetX), (t.shadowOffsetY = this.shadowOffsetY), (t.shadowColor = this.shadowColor), (t.shadowBlur = this.shadowBlur))
: ((t.shadowOffsetX = 0), (t.shadowOffsetY = 0), (t.shadowColor = 0), (t.shadowBlur = 0));
},
},
{
key: "update",
value: function (t) {
return t && ((this._font = this.fontStyle + " " + this.fontSize + " " + this.fontFamily), (this.metrics = r(this))), this.parent.updateText(t);
},
},
{
key: "buildFont",
value: function () {
var t = this.fontStyle + " " + this.fontSize + " " + this.fontFamily;
return t !== this._font && (this._font = t), this;
},
},
{
key: "setFont",
value: function (t) {
return (
"string" == typeof t
? ((this.fontFamily = t), (this.fontSize = ""), (this.fontStyle = ""))
: ((this.fontFamily = v(t, "fontFamily", "Courier")), (this.fontSize = v(t, "fontSize", "16px")), (this.fontStyle = v(t, "fontStyle", ""))),
this.update(!0)
);
},
},
{
key: "setFontFamily",
value: function (t) {
return (this.fontFamily = t), this.update(!0);
},
},
{
key: "setFontStyle",
value: function (t) {
return (this.fontStyle = t), this.update(!0);
},
},
{
key: "setFontSize",
value: function (t) {
return "number" == typeof t && (t = t.toString() + "px"), (this.fontSize = t), this.update(!0);
},
},
{
key: "setTestString",
value: function (t) {
return (this.testString = t), this.update(!0);
},
},
{
key: "setFixedSize",
value: function (t, e) {
return (this.fixedWidth = t), (this.fixedHeight = e), t && (this.parent.width = t), e && (this.parent.height = e), this.update(this.isWrapFitMode);
},
},
{
key: "setResolution",
value: function (t) {
return (this.resolution = t), this.update(!1);
},
},
{
key: "setLineSpacing",
value: function (t) {
return (this.lineSpacing = t), this.update(!1);
},
},
{
key: "setBackgroundColor",
value: function (t, e, i) {
return (
void 0 === i && (i = !0),
(this.backgroundColor = a(t, this.canvas, this.context)),
(this.backgroundColor2 = a(e, this.canvas, this.context)),
(this.backgroundHorizontalGradient = i),
this.update(!1)
);
},
},
{
key: "setBackgroundStrokeColor",
value: function (t, e) {
return (this.backgroundStrokeColor = a(t, this.canvas, this.context)), (this.backgroundStrokeLineWidth = e), this.update(!1);
},
},
{
key: "setBackgroundCornerRadius",
value: function (t, e) {
return (this.backgroundCornerRadius = t), (this.backgroundCornerIteration = e), this.update(!1);
},
},
{
key: "setFill",
value: function (t) {
return (this.color = a(t, this.canvas, this.context)), this.update(!1);
},
},
{
key: "setColor",
value: function (t) {
return (this.color = a(t, this.canvas, this.context)), this.update(!1);
},
},
{
key: "setStroke",
value: function (t, e) {
return void 0 === t ? (this.strokeThickness = 0) : (void 0 === e && (e = this.strokeThickness), (this.stroke = a(t, this.canvas, this.context)), (this.strokeThickness = e)), this.update(!0);
},
},
{
key: "setShadow",
value: function (t, e, i, n, s, r) {
return (
void 0 === t && (t = 0),
void 0 === e && (e = 0),
void 0 === i && (i = "#000"),
void 0 === n && (n = 0),
void 0 === s && (s = !1),
void 0 === r && (r = !0),
(this.shadowOffsetX = t),
(this.shadowOffsetY = e),
(this.shadowColor = a(i, this.canvas, this.context)),
(this.shadowBlur = n),
(this.shadowStroke = s),
(this.shadowFill = r),
this.update(!1)
);
},
},
{
key: "setShadowOffset",
value: function (t, e) {
return void 0 === t && (t = 0), void 0 === e && (e = t), (this.shadowOffsetX = t), (this.shadowOffsetY = e), this.update(!1);
},
},
{
key: "setShadowColor",
value: function (t) {
return void 0 === t && (t = "#000"), (this.shadowColor = a(t, this.canvas, this.context)), this.update(!1);
},
},
{
key: "setShadowBlur",
value: function (t) {
return void 0 === t && (t = 0), (this.shadowBlur = t), this.update(!1);
},
},
{
key: "setShadowStroke",
value: function (t) {
return (this.shadowStroke = t), this.update(!1);
},
},
{
key: "setShadowFill",
value: function (t) {
return (this.shadowFill = t), this.update(!1);
},
},
{
key: "setUnderline",
value: function (t, e, i) {
return (
void 0 === t && (t = "#000"),
void 0 === e && (e = 0),
void 0 === i && (i = 0),
(this.underlineColor = a(t, this.canvas, this.context)),
(this.underlineThickness = e),
(this.underlineOffset = i),
this.update(!1)
);
},
},
{
key: "setUnderlineColor",
value: function (t) {
return void 0 === t && (t = "#000"), (this.underlineColor = a(t, this.canvas, this.context)), this.update(!1);
},
},
{
key: "setUnderlineThickness",
value: function (t) {
return void 0 === t && (t = 0), (this.underlineThickness = t), this.update(!1);
},
},
{
key: "setUnderlineOffset",
value: function (t) {
return void 0 === t && (t = 0), (this.underlineOffset = t), this.update(!1);
},
},
{
key: "setWrapMode",
value: function (t) {
return "string" == typeof t && (t = b[t.toLowerCase()] || 0), (this.wrapMode = t), this.update(!0);
},
},
{
key: "setWrapWidth",
value: function (t) {
return (this.wrapWidth = t), this.update(!1);
},
},
{
key: "setAlign",
value: function (t, e) {
return void 0 === t && (t = "left"), void 0 === e && (e = "top"), (this.halign = t), (this.valign = e), this.update(!1);
},
},
{
key: "setHAlign",
value: function (t) {
return void 0 === t && (t = "left"), (this.halign = t), this.update(!1);
},
},
{
key: "setVAlign",
value: function (t) {
return void 0 === t && (t = "top"), (this.valign = t), this.update(!1);
},
},
{
key: "setMaxLines",
value: function (t) {
return void 0 === t && (t = 0), (this.maxLines = t), this.update(!1);
},
},
{
key: "getTextMetrics",
value: function () {
var t = this.metrics;
return { ascent: t.ascent, descent: t.descent, fontSize: t.fontSize };
},
},
{
key: "lineHeight",
get: function () {
return this.metrics.fontSize + this.strokeThickness + this.lineSpacing;
},
},
{
key: "toJSON",
value: function () {
var t = {};
for (var e in m) t[e] = this[e];
return (t.metrics = this.getTextMetrics()), t;
},
},
{
key: "destroy",
value: function () {
this.parent = void 0;
},
},
]),
n
);
})(),
b = { none: 0, word: 1, char: 2, character: 2 },
w = Phaser.Utils.Objects.GetValue,
B = (function () {
function r(t, e, i, n, s) {
d(this, r), (this.cornerRadius = {}), (this._width = 0), (this._height = 0), this.setTo(t, e, i, n, s);
}
return (
s(r, [
{
key: "setTo",
value: function (t, e, i, n, s) {
return this.setPosition(t, e), this.setRadius(s), this.setSize(i, n), this;
},
},
{
key: "setPosition",
value: function (t, e) {
return void 0 === t && (t = 0), void 0 === e && (e = t), (this.x = t), (this.y = e), this;
},
},
{
key: "setRadius",
value: function (t) {
var e, i;
void 0 === t && (t = 0), (i = "number" == typeof t ? (e = t) : ((e = w(t, "x", 0)), w(t, "y", 0)));
var n = this.cornerRadius;
return (n.tl = _(w(t, "tl", void 0), e, i)), (n.tr = _(w(t, "tr", void 0), e, i)), (n.bl = _(w(t, "bl", void 0), e, i)), (n.br = _(w(t, "br", void 0), e, i)), this;
},
},
{
key: "setSize",
value: function (t, e) {
return (this.width = t), (this.height = e), this;
},
},
{
key: "minWidth",
get: function () {
var t = this.cornerRadius;
return Math.max(t.tl.x + t.tr.x, t.bl.x + t.br.x);
},
},
{
key: "minHeight",
get: function () {
var t = this.cornerRadius;
return Math.max(t.tl.y + t.bl.y, t.tr.y + t.br.y);
},
},
{
key: "width",
get: function () {
return this._width;
},
set: function (t) {
null == t && (t = 0), (this._width = Math.max(t, this.minWidth));
},
},
{
key: "height",
get: function () {
return this._height;
},
set: function (t) {
null == t && (t = 0), (this._height = Math.max(t, this.minHeight));
},
},
{
key: "radius",
get: function () {
var t = this.cornerRadius;
return Math.max(t.tl.x, t.tl.y, t.tr.x, t.tr.y, t.bl.x, t.bl.y, t.br.x, t.br.y);
},
},
]),
r
);
})(),
_ = function (t, e, i) {
return void 0 === t ? { x: e, y: i } : "number" == typeof t ? { x: t, y: t } : t;
},
E = Phaser.Math.DegToRad,
N = E(0),
U = E(90),
Y = E(180),
z = E(270),
X = function (t, e, i, n, s, r, o, a) {
if (null == a) t.ellipse(e, i, n, s, 0, r, o);
else for (var h, l, u, c = (o - r) / (a += 1), d = 0; d <= a; d++) (u = r + c * d), (h = e + n * Math.cos(u)), (l = i + s * Math.sin(u)), t.lineTo(h, l);
},
P = {
draw: function (t, e, i, n) {
var s = this.penManager;
this.hitAreaManager.clear();
var r = this.context;
r.save();
var o = this.defaultStyle;
this.clear(),
(function (t, e, i, n, s, r, o, a) {
if (null != e || null != i) {
var h = t.canvas.width,
l = t.canvas.height;
null == i && (n = 0);
var u = n / 2;
(h -= n),
(l -= n),
t.canvas,
(c = t.context),
(p = e),
(g = i),
(v = n),
(y = r),
(m = o),
(x = c),
(_ = a),
(L = (k = (O = new B((b = u), (w = u), (T = d = h), (S = f = l), s)).minWidth) <= T ? 1 : T / k),
(I = (R = O.minHeight) <= S ? 1 : S / R),
(D = O.cornerRadius),
x.save(),
x.beginPath(),
x.translate(b, w),
(M = T - (P = (E = D.br).x * L)),
(C = S - (A = E.y * I)),
x.moveTo(T, C),
0 < P && 0 < A ? X(x, M, C, P, A, N, U, _) : (x.lineTo(T, S), x.lineTo(M, S)),
(M = P = (E = D.bl).x * L),
(C = S - (A = E.y * I)),
x.lineTo(P, S),
0 < P && 0 < A ? X(x, M, C, P, A, U, Y, _) : (x.lineTo(0, S), x.lineTo(0, C)),
(M = P = (E = D.tl).x * L),
(C = A = E.y * I),
x.lineTo(0, C),
0 < P && 0 < A ? X(x, M, C, P, A, Y, z, _) : (x.lineTo(0, 0), x.lineTo(M, 0)),
(M = T - (P = (E = D.tr).x * L)),
(C = A = E.y * I),
x.lineTo(M, 0),
0 < P && 0 < A ? X(x, M, C, P, A, z, N, _) : (x.lineTo(T, 0), x.lineTo(T, C)),
x.closePath(),
x.restore(),
null != p && (null != y && ((F = m ? c.createLinearGradient(0, 0, d, 0) : c.createLinearGradient(0, 0, 0, f)).addColorStop(0, p), F.addColorStop(1, y), (p = F)), (c.fillStyle = p), c.fill()),
null != g && 0 < v && ((c.strokeStyle = g), (c.lineWidth = v), c.stroke());
}
var c, d, f, p, g, v, y, m, x, b, w, T, S, _, E, P, A, M, C, O, k, R, L, I, D, F;
})(this, o.backgroundColor, o.backgroundStrokeColor, o.backgroundStrokeLineWidth, o.backgroundCornerRadius, o.backgroundColor2, o.backgroundHorizontalGradient, o.backgroundCornerIteration),
(t += this.startXOffset),
(e += this.startYOffset);
var a,
h,
l,
u,
c,
d,
f = o.halign,
p = o.valign,
g = o.lineHeight,
v = s.lines,
y = v.length,
m = o.maxLines;
(u = (l = 0 < m && m < y ? ((h = m), "center" === p ? Math.floor((y - h) / 2) : "bottom" === p ? y - h : 0) : ((h = y), 0)) + h),
(d = "center" === p ? Math.max((n - h * g) / 2, 0) : "bottom" === p ? Math.max(n - h * g - 2, 0) : 0),
(d += e);
for (var x = l; x < u; x++)
if (0 !== (a = s.getLineWidth(x))) {
(c = "center" === f ? (i - a) / 2 : "right" === f ? i - a : 0), (c += t);
for (var b = v[x], w = 0, T = b.length; w < T; w++) this.drawPen(b[w], c, d);
}
r.restore();
},
drawPen: function (t, e, i) {
(e += t.x), (i += t.y + (t.prop.y || 0));
var n = this.canvas,
s = this.context;
s.save();
var r = this.parser.propToContextStyle(this.defaultStyle, t.prop);
r.buildFont(),
r.syncFont(n, s),
r.syncStyle(n, s),
0 < r.underlineThickness && 0 < t.width && this.drawUnderline(e, i, t.width, r),
t.isTextPen && this.drawText(e, i, t.text, r),
t.isImagePen && this.drawImage(e, i, t.prop.img, r),
s.restore(),
t.hasAreaMarker && 0 < t.width && this.hitAreaManager.add(t.prop.area, e, i - this.startYOffset, t.width, this.defaultStyle.lineHeight);
},
clear: function () {
var t = this.canvas;
this.context.clearRect(0, 0, t.width, t.height);
},
drawUnderline: function (t, e, i, n) {
(e += n.underlineOffset - n.underlineThickness / 2), this.autoRound && ((t = Math.round(t)), (e = Math.round(e)));
var s = this.context,
r = s.lineCap;
(s.lineCap = "butt"), (s.strokeStyle = n.underlineColor), (s.lineWidth = n.underlineThickness), s.beginPath(), s.moveTo(t, e), s.lineTo(t + i, e), s.stroke(), (s.lineCap = r);
},
drawText: function (t, e, i, n) {
this.autoRound && ((t = Math.round(t)), (e = Math.round(e)));
var s = this.context;
n.strokeThickness && (n.syncShadow(s, n.shadowStroke), s.strokeText(i, t, e)), n.color && "none" !== n.color && (n.syncShadow(s, n.shadowFill), s.fillText(i, t, e));
},
drawImage: function (t, e, i) {
(e -= this.startYOffset), this.parent.imageManager.draw(i, this.context, t, e, this.autoRound);
},
},
A = (function () {
function t() {
d(this, t), (this.items = []);
}
return (
s(t, [
{
key: "destroy",
value: function () {
this.clear(), (this.items = void 0);
},
},
{
key: "pop",
value: function () {
return 0 < this.items.length ? this.items.pop() : null;
},
},
{
key: "push",
value: function (t) {
return this.items.push(t), this;
},
},
{
key: "pushMultiple",
value: function (t) {
return this.items.push.apply(this.items, t), (t.length = 0), this;
},
},
{
key: "clear",
value: function () {
return (this.items.length = 0), this;
},
},
]),
t
);
})(),
M = Phaser.Utils.Objects.GetValue,
C = (function () {
function e(t) {
d(this, e), (this.prop = {}), this.resetFromJSON(t);
}
return (
s(e, [
{
key: "resetFromJSON",
value: function (t) {
(this.text = M(t, "text", "")), (this.x = M(t, "x", 0)), (this.y = M(t, "y", 0)), (this.width = M(t, "width", 0));
var e = M(t, "prop", null);
null === e && (e = {}), (this.prop = e), (this.newLineMode = M(t, "newLineMode", 0)), (this.startIndex = M(t, "startIndex", 0));
},
},
{
key: "plainText",
get: function () {
var t = this.text;
return 1 === this.newLineMode && (t += "\n"), t;
},
},
{
key: "wrapText",
get: function () {
var t = this.text;
return 0 !== this.newLineMode && (t += "\n"), t;
},
},
{
key: "rawTextLength",
get: function () {
var t = this.text.length;
return 1 === this.newLineMode && (t += 1), t;
},
},
{
key: "endIndex",
get: function () {
return this.startIndex + this.rawTextLength;
},
},
{
key: "lastX",
get: function () {
return this.x + this.width;
},
},
{
key: "isTextPen",
get: function () {
return "" !== this.text;
},
},
{
key: "isImagePen",
get: function () {
return !!this.prop.img;
},
},
{
key: "hasAreaMarker",
get: function () {
return !!this.prop.area;
},
},
]),
e
);
})(),
O = Phaser.Utils.Objects.GetFastValue,
k = new A(),
R = new A(),
L = (function () {
function a(t) {
d(this, a),
(this.pens = []),
(this.lines = []),
(this.maxLinesWidth = void 0),
(this.PensPool = O(t, "pensPool", k)),
(this.LinesPool = O(t, "linesPool", R)),
(this.tagToText = O(t, "tagToText", i)),
(this.tagToTextScope = O(t, "tagToTextScope", void 0));
}
return (
s(a, [
{
key: "destroy",
value: function () {
this.freePens(), (this.tagToText = void 0), (this.tagToTextScope = void 0);
},
},
{
key: "freePens",
value: function () {
for (var t = 0, e = this.lines.length; t < e; t++) this.lines[t].length = 0;
this.PensPool.pushMultiple(this.pens), this.LinesPool.pushMultiple(this.lines), (this.maxLinesWidth = void 0);
},
},
{
key: "addTextPen",
value: function (t, e, i, n, s, r) {
var o = this.PensPool.pop();
return null == o && (o = new C()), (I.text = t), (I.x = e), (I.y = i), (I.width = n), (I.prop = s), (I.newLineMode = r), o.resetFromJSON(I), this.addPen(o), this;
},
},
{
key: "addImagePen",
value: function (t, e, i, n) {
return this.addTextPen("", t, e, i, n, 0), this;
},
},
{
key: "addNewLinePen",
value: function () {
var t = this.lastPen,
e = t ? t.lastX : 0,
i = t ? t.y : 0,
n = t ? T(t.prop) : null;
return this.addTextPen("", e, i, 0, n, 2), this;
},
},
{
key: "addPen",
value: function (t) {
var e = this.lastPen;
(t.startIndex = null == e ? 0 : e.endIndex), this.pens.push(t);
var i = this.lastLine;
null == i && ((i = this.LinesPool.pop() || []), this.lines.push(i)), i.push(t), 0 !== t.newLineMode && ((i = this.LinesPool.pop() || []), this.lines.push(i)), (this.maxLinesWidth = void 0);
},
},
{
key: "clone",
value: function (t) {
null == t && (t = new a()), t.freePens();
for (var e = 0, i = this.lines.length; e < i; e++)
for (var n = this.lines[e], s = 0, r = n.length; s < r; s++) {
var o = n[s];
t.addPen(o.text, o.x, o.y, o.width, T(o.prop), o.newLineMode);
}
return t;
},
},
{
key: "lastPen",
get: function () {
return this.pens[this.pens.length - 1];
},
},
{
key: "lastLine",
get: function () {
return this.lines[this.lines.length - 1];
},
},
{
key: "getLineStartIndex",
value: function (t) {
if (t >= this.lines.length) return this.getLineEndIndex(t);
var e = this.lines[t];
return e && e[0] ? e[0].startIndex : 0;
},
},
{
key: "getLineEndIndex",
value: function (t) {
t >= this.lines.length && (t = this.lines.length - 1);
var e,
i,
n = !1;
for (e = t; 0 <= e && !(n = null != (i = this.lines[e]) && 0 < i.length); e--);
return n ? i[i.length - 1].endIndex : 0;
},
},
{
key: "getLineWidth",
value: function (t) {
var e = this.lines[t];
if (!e) return 0;
var i = e[e.length - 1];
return null == i ? 0 : i.lastX;
},
},
{
key: "getMaxLineWidth",
value: function () {
if (void 0 !== this.maxLinesWidth) return this.maxLinesWidth;
for (var t, e = 0, i = 0, n = this.lines.length; i < n; i++) e < (t = this.getLineWidth(i)) && (e = t);
return (this.maxLinesWidth = e);
},
},
{
key: "getLineWidths",
value: function () {
for (var t = [], e = 0, i = this.lines.length; e < i; e++) t.push(this.getLineWidth(e));
return t;
},
},
{
key: "linesCount",
get: function () {
return this.lines.length;
},
},
{
key: "plainText",
get: function () {
for (var t = "", e = this.pens, i = 0, n = e.length; i < n; i++) t += e[i].plainText;
return t;
},
},
{
key: "rawTextLength",
get: function () {
for (var t = 0, e = this.pens, i = 0, n = this.pens.length; i < n; i++) t += e[i].rawTextLength;
return t;
},
},
{
key: "getSliceTagText",
value: function (t, e, i) {
if ((void 0 === t && (t = 0), void 0 === e)) {
var n = this.lastPen;
if (null == n) return "";
e = n.endIndex;
}
void 0 === i && (i = !1);
for (
var s, r, o, a, h, l, u = "", c = 0, d = this.pens.length;
c < d &&
((a = (s = this.pens[c]).endIndex) <= t ||
((s = this.pens[c]),
(r = i ? s.wrapText : s.plainText),
(h = s.prop),
(t <= (o = s.startIndex) && a <= e) || (r = r.substring(t - o, e - o)),
this.tagToTextScope ? (u += this.tagToText.call(this.tagToTextScope, r, h, l)) : (u += this.tagToText(r, h, l)),
(l = h),
!(e <= a)));
c++
);
return u;
},
},
]),
a
);
})(),
I = {},
D = Phaser.Geom.Rectangle,
F = new A(),
V = (function () {
function t() {
d(this, t), (this.hitAreas = []);
}
return (
s(t, [
{
key: "destroy",
value: function () {
this.clear();
},
},
{
key: "clear",
value: function () {
return F.pushMultiple(this.hitAreas), this;
},
},
{
key: "add",
value: function (t, e, i, n, s) {
var r = F.pop();
return null === r ? (r = new D(e, i, n, s)) : r.setTo(e, i, n, s), (r.key = t), this.hitAreas.push(r), this;
},
},
{
key: "getFirstHitArea",
value: function (t, e) {
for (var i, n = this.hitAreas, s = 0, r = n.length; s < r; s++) if ((i = n[s]).contains(t, e)) return i;
return null;
},
},
{
key: "drawBounds",
value: function (t, e, i) {
void 0 === e && (e = 16777215), i && t.save().scaleCanvas(i.scaleX, i.scaleY).rotateCanvas(i.rotation).translateCanvas(i.x, i.y);
for (var n, s = this.hitAreas, r = 0, o = s.length; r < o; r++) (n = s[r]), t.lineStyle(1, e).strokeRect(n.x, n.y, n.width, n.height);
return i && t.restore(), this;
},
},
]),
t
);
})(),
G = function (t, e, i, n) {
var s = this.hitAreaManager.getFirstHitArea(i, n);
if (null !== s) {
var r = s.key;
this.parent.emit("".concat(t, "-").concat(r), e, i, n), this.parent.emit(t, r, e, i, n);
}
},
j = 0,
H = 1,
W = 2,
K = 0,
q = 1,
Z = c,
J = [],
Q = new A();
Q.newline = function (t, e, i) {
var n = this.pop();
return null === n && (n = {}), (n.text = t), (n.width = e), (n.newLineMode = i), n;
};
var $ = Phaser.Utils.Objects.GetValue,
tt = (function () {
function i(t) {
d(this, i),
(this.parent = t.parent),
(this.context = $(t, "context", null)),
(this.canvas = this.context.canvas),
(this.parser = $(t, "parser", null)),
(this.defaultStyle = $(t, "style", null)),
(this.autoRound = !0),
(this.pensPool = $(t, "pensPool", null)),
(this.penManager = this.newPenManager()),
(this._tmpPenManager = null),
(this.hitAreaManager = new V());
var e = this.context;
this.getTextWidth = function (t) {
return e.measureText(t).width;
};
}
return (
s(i, [
{
key: "destroy",
value: function () {
(this.context = void 0),
(this.canvas = void 0),
(this.parser = void 0),
(this.defaultStyle = void 0),
this.penManager && (this.penManager.destroy(), (this.penManager = void 0)),
this._tmpPenManager && (this._tmpPenManager.destroy(), (this._tmpPenManager = void 0)),
this.hitAreaManager && (this.hitAreaManager.destroy(), (this.hitAreaManager = void 0));
},
},
{
key: "updatePenManager",
value: function (t, e, i, n, s) {
if ((void 0 === s && (s = this.penManager), s.freePens(), "" === t)) return s;
if (this.parent.style.isWrapFitMode) {
var r = this.parent.padding;
i = this.parent.style.fixedWidth - r.left - r.right;
}
for (var o, a, h, l, u, c = this.canvas, d = this.context, f = 0, p = 0, g = this.parser.splitText(t), v = 0, y = g.length; v < y; v++)
if (((o = (l = this.parser.tagTextToProp(g[v], a)).plainText), (a = l.prop).img)) {
var m = this.imageManager.getOuterWidth(a.img);
0 < i && 0 !== e && i < f + m && (s.addNewLinePen(), (p += n), (f = 0)), s.addImagePen(f, p, m, T(a)), (f += m);
} else if ("" !== o) {
d.save(), (h = this.parser.propToContextStyle(this.defaultStyle, a)).buildFont(), h.syncFont(c, d), h.syncStyle(c, d);
for (
var x,
b = 0,
w = (u = S(
o,
function (t) {
return d.measureText(t).width;
},
e,
i,
f
)).length;
b < w;
b++
)
(x = u[b]), s.addTextPen(x.text, f, p, x.width, T(a), x.newLineMode), 0 !== x.newLineMode ? ((f = 0), (p += n)) : (f += x.width);
d.restore();
}
return s;
},
},
{
key: "startXOffset",
get: function () {
return this.defaultStyle.strokeThickness / 2;
},
},
{
key: "startYOffset",
get: function () {
var t = this.defaultStyle;
return t.strokeThickness / 2 + t.metrics.ascent;
},
},
{
key: "lines",
get: function () {
return this.penManager.lines;
},
},
{
key: "desplayLinesCount",
get: function () {
var t = this.penManager.linesCount,
e = this.defaultStyle.maxLines;
return 0 < e && e < t && (t = e), t;
},
},
{
key: "linesWidth",
get: function () {
return this.penManager.getMaxLineWidth();
},
},
{
key: "linesHeight",
get: function () {
var t = this.desplayLinesCount,
e = this.defaultStyle.lineHeight * t;
return 0 < t && (e -= this.defaultStyle.lineSpacing), e;
},
},
{
key: "imageManager",
get: function () {
return this.parent.imageManager;
},
},
{
key: "newPenManager",
value: function () {
return new L({ pensPool: this.pensPool, tagToText: this.parser.propToTagText, tagToTextScope: this.parser });
},
},
{
key: "tmpPenManager",
get: function () {
return null === this._tmpPenManager && (this._tmpPenManager = this.newPenManager()), this._tmpPenManager;
},
},
{
key: "getPlainText",
value: function (t, e, i) {
var n;
if (null == t) n = this.penManager.plainText;
else {
var s = this.parser.splitText(t, 1);
n = "";
for (var r = 0, o = s.length; r < o; r++) n += s[r];
}
return (null == e && null == i) || (null == e && (e = 0), null == i && (i = n.length), (n = n.substring(e, i))), n;
},
},
{
key: "getPenManager",
value: function (t, e) {
if (void 0 === t) return this.copyPenManager(e, this.penManager);
void 0 === e && (e = this.newPenManager());
var i = this.defaultStyle;
return this.updatePenManager(t, i.wrapMode, i.wrapWidth, i.lineHeight, e), e;
},
},
{
key: "getText",
value: function (t, e, i, n) {
if (null == t) return this.penManager.getSliceTagText(e, i, n);
var s = this.tmpPenManager,
r = this.defaultStyle;
return this.updatePenManager(t, r.wrapMode, r.wrapWidth, r.lineHeight, s), s.getSliceTagText(e, i, n);
},
},
{
key: "copyPenManager",
value: function (t, e) {
return void 0 === e && (e = this.penManager), e.copy(t);
},
},
{
key: "getTextWidth",
value: function (t) {
return void 0 === t && (t = this.penManager), t.getMaxLineWidth();
},
},
{
key: "getLastPen",
value: function (t) {
return void 0 === t && (t = this.penManager), t.lastPen;
},
},
]),
i
);
})(),
et = {
setInteractive: function () {
this.parent
.on(
"pointerdown",
function (t, e, i, n) {
G.call(this, "areadown", t, e, i);
},
this
)
.on(
"pointerup",
function (t, e, i, n) {
G.call(this, "areaup", t, e, i);
},
this
);
},
};
function it(t, e) {
void 0 === e && (e = { key: t }), e.hasOwnProperty("key") || (e.key = t);
var i = e.key,
n = e.frame,
s = e.width,
r = e.height;
if (void 0 === s || void 0 === r) {
var o = this.textureManager.getFrame(i, n),
a = o ? o.cutWidth : 0,
h = o ? o.cutHeight : 0;
void 0 === s && void 0 === r ? ((s = a), (r = h)) : void 0 === s ? (s = a * (r / h)) : void 0 === r && (r = h * (s / a));
}
this.images[t] = { key: i, frame: n, width: s, height: r, y: nt(e, "y", 0), left: nt(e, "left", 0), right: nt(e, "right", 0) };
}
Object.assign(tt.prototype, P, et);
var nt = Phaser.Utils.Objects.GetValue,
st = (function () {
function e(t) {
d(this, e), (this.textureManager = t.textures), (this.images = {});
}
return (
s(e, [
{
key: "destroy",
value: function () {
(this.textureManager = void 0), (this.images = void 0);
},
},
{
key: "add",
value: function (t, e) {
if ("string" == typeof t) it.call(this, t, e);
else if (Array.isArray(t)) for (var i = 0, n = (s = t).length; i < n; i++) it.call(this, s[i]);
else {
var s = t;
for (var t in s) it.call(this, t, s[t]);
}
return this;
},
},
{
key: "has",
value: function (t) {
return this.images.hasOwnProperty(t);
},
},
{
key: "remove",
value: function (t) {
return this.has(t) && delete this.images[t], this;
},
},
{
key: "get",
value: function (t) {
return this.images.hasOwnProperty(t) || (this.textureManager.exists(t) && this.add(t)), this.images[t];
},
},
{
key: "getOuterWidth",
value: function (t) {
var e = this.get(t);
return e ? e.width + e.left + e.right : 0;
},
},
{
key: "getFrame",
value: function (t) {
var e = this.get(t);
return e ? this.textureManager.getFrame(e.key, e.frame) : void 0;
},
},
{
key: "hasTexture",
value: function (t) {
return !!this.getFrame(t);
},
},
]),
e
);
})(),
rt = {
draw: function (t, e, i, n, s) {
var r = this.get(t);
(i += r.left), (n += r.y), s && ((i = Math.round(i)), (n = Math.round(n)));
var o = this.textureManager.getFrame(r.key, r.frame);
e.drawImage(o.source.image, o.cutX, o.cutY, o.cutWidth, o.cutHeight, i, n, r.width, r.height);
},
};
Object.assign(st.prototype, rt);
var ot = Phaser.Utils.Objects.IsPlainObject,
at = Phaser.DOM.AddToDOM,
ht = Phaser.Display.Canvas.CanvasPool,
lt = Phaser.GameObjects.GameObject,
ut = Phaser.Utils.Objects.GetValue,
ct = Phaser.DOM.RemoveFromDOM,
dt = c,
ft = {},
pt = (function () {
t(c, lt);
var u = e(c);
function c(t, e, i, n, s, r, o) {
var a;
if ((d(this, c), ot(e))) {
var h = e;
(e = ut(h, "x", 0)), (i = ut(h, "y", 0)), (n = ut(h, "text", "")), (s = ut(h, "style", ""));
}
if (
(void 0 === e && (e = 0),
void 0 === i && (i = 0),
((a = u.call(this, t, r)).renderer = t.sys.game.renderer),
a.setPosition(e, i),
a.setOrigin(0, 0),
a.initPipeline(),
(a.canvas = ht.create(f(a))),
(a.context = a.canvas.getContext("2d")),
s)
) {
if (s.hasOwnProperty("align")) {
var l = s.align;
delete s.align, (s.halign = l);
}
s.hasOwnProperty("stroke") && !s.hasOwnProperty("strokeThickness") && (s.strokeThickness = 1);
}
return (
(a.style = new x(f(a), s)),
(a.autoRound = !0),
(a._text = void 0),
(a.padding = { left: 0, right: 0, top: 0, bottom: 0 }),
(a.width = 1),
(a.height = 1),
(a.dirty = !1),
0 === a.style.resolution && (a.style.resolution = 1),
(a._crop = a.resetCropObject()),
(a.texture = t.sys.textures.addCanvas(null, a.canvas, !0)),
(a.frame = a.texture.get()),
(a.frame.source.resolution = a.style.resolution),
a.renderer.gl && (a.renderer.deleteTexture(a.frame.source.glTexture), (a.frame.source.glTexture = null)),
ft.hasOwnProperty(r) || (ft[r] = new A()),
(a.canvasText = new tt({ parent: f(a), context: a.context, parser: o, style: a.style, pensPool: ft[r] })),
s && s.padding && a.setPadding(s.padding),
(a._imageManager = void 0),
a.setText(n),
t.sys.game.events.on(
"contextrestored",
function () {
this.dirty = !0;
},
f(a)
),
a
);
}
return (
s(c, [
{
key: "text",
get: function () {
return this._text;
},
set: function (t) {
this.setText(t);
},
},
{
key: "initRTL",
value: function () {
this.style.rtl && ((this.canvas.dir = "rtl"), (this.context.direction = "rtl"), (this.canvas.style.display = "none"), at(this.canvas, this.scene.sys.canvas), (this.originX = 1));
},
},
{
key: "setText",
value: function (t) {
return t || 0 === t || (t = ""), Array.isArray(t) && (t = t.join("\n")), t !== this._text && ((this._text = t.toString()), this.updateText()), this;
},
},
{
key: "setStyle",
value: function (t) {
return this.style.setStyle(t);
},
},
{
key: "setFont",
value: function (t) {
return this.style.setFont(t);
},
},
{
key: "setFontFamily",
value: function (t) {
return this.style.setFontFamily(t);
},
},
{
key: "setFontSize",
value: function (t) {
return this.style.setFontSize(t);
},
},
{
key: "setFontStyle",
value: function (t) {
return this.style.setFontStyle(t);
},
},
{
key: "setFixedSize",
value: function (t, e) {
return this.style.setFixedSize(t, e);
},
},
{
key: "setBackgroundColor",
value: function (t, e, i) {
return this.style.setBackgroundColor(t, e, i);
},
},
{
key: "setBackgroundStrokeColor",
value: function (t, e) {
return this.style.setBackgroundStrokeColor(t, e);
},
},
{
key: "setBackgroundCornerRadius",
value: function (t, e) {
return this.style.setBackgroundCornerRadius(t, e);
},
},
{
key: "setFill",
value: function (t) {
return this.style.setFill(t);
},
},
{
key: "setColor",
value: function (t) {
return this.style.setColor(t);
},
},
{
key: "setStroke",
value: function (t, e) {
return this.style.setStroke(t, e);
},
},
{
key: "setShadow",
value: function (t, e, i, n, s, r) {
return this.style.setShadow(t, e, i, n, s, r);
},
},
{
key: "setShadowOffset",
value: function (t, e) {
return this.style.setShadowOffset(t, e);
},
},
{
key: "setShadowColor",
value: function (t) {
return this.style.setShadowColor(t);
},
},
{
key: "setShadowBlur",
value: function (t) {
return this.style.setShadowBlur(t);
},
},
{
key: "setShadowStroke",
value: function (t) {
return this.style.setShadowStroke(t);
},
},
{
key: "setShadowFill",
value: function (t) {
return this.style.setShadowFill(t);
},
},
{
key: "setWrapMode",
value: function (t) {
return this.style.setWrapMode(t);
},
},
{
key: "setWrapWidth",
value: function (t) {
return this.style.setWrapWidth(t);
},
},
{
key: "setAlign",
value: function (t) {
return this.style.setHAlign(t);
},
},
{
key: "setLineSpacing",
value: function (t) {
return this.style.setLineSpacing(t);
},
},
{
key: "setPadding",
value: function (t, e, i, n) {
if ("object" === l(t)) {
var s = t,
r = ut(s, "x", null);
i = null !== r ? (t = r) : ((t = ut(s, "left", 0)), ut(s, "right", t));
var o = ut(s, "y", null);
n = null !== o ? (e = o) : ((e = ut(s, "top", 0)), ut(s, "bottom", e));
} else void 0 === t && (t = 0), void 0 === e && (e = t), void 0 === i && (i = t), void 0 === n && (n = e);
return (this.padding.left = t), (this.padding.top = e), (this.padding.right = i), (this.padding.bottom = n), this.updateText(!1);
},
},
{
key: "setResolution",
value: function (t) {
return this.style.setResolution(t);
},
},
{
key: "setMaxLines",
value: function (t) {
return this.style.setMaxLines(t);
},
},
{
key: "updateText",
value: function (t) {
void 0 === t && (t = !0);
var e = this.canvasText,
i = this.style;
t && e.updatePenManager(this._text, i.wrapMode, i.wrapWidth, i.lineHeight);
var n,
s,
r = this.padding;
0 === i.fixedWidth ? ((this.width = e.linesWidth + r.left + r.right), (n = e.linesWidth)) : ((this.width = i.fixedWidth), (n = this.width - r.left - r.right) < e.linesWidth && (n = e.linesWidth)),
0 === i.fixedHeight
? ((this.height = e.linesHeight + r.top + r.bottom), (s = e.linesHeight))
: ((this.height = i.fixedHeight), (s = this.height - r.top - r.bottom) < e.linesHeight && (s = e.linesHeight));
var o = this.width,
a = this.height;
this.updateDisplayOrigin();
var h = i.resolution;
(o *= h), (a *= h), (o = Math.max(Math.ceil(o), 1)), (a = Math.max(Math.ceil(a), 1));
var l = this.canvas,
u = this.context;
l.width !== o || l.height !== a ? ((l.width = o), (l.height = a), this.frame.setSize(o, a)) : u.clearRect(0, 0, o, a),
u.save(),
u.scale(h, h),
e.draw(r.left, r.top, n, s),
u.restore(),
this.renderer.gl && ((this.frame.source.glTexture = this.renderer.canvasToTexture(l, this.frame.source.glTexture, !0)), (this.frame.glTexture = this.frame.source.glTexture)),
(this.dirty = !0);
var c = this.input;
return c && !c.customHitArea && ((c.hitArea.width = this.width), (c.hitArea.height = this.height)), this;
},
},
{
key: "getTextMetrics",
value: function () {
return this.style.getTextMetrics();
},
},
{
key: "toJSON",
value: function () {
var t = gt.ToJSON(this),
e = {
autoRound: this.autoRound,
text: this._text,
style: this.style.toJSON(),
resolution: this.resolution,
padding: { left: this.padding.left, right: this.padding.right, top: this.padding.top, bottom: this.padding.bottom },
};
return (t.data = e), t;
},
},
{
key: "preDestroy",
value: function () {
this.style.rtl && ct(this.canvas), ht.remove(this.canvas), this.canvasText.destroy(), (this.canvasText = void 0), this._imageManager && (this._imageManager.destroy(), (this._imageManager = void 0));
},
},
{
key: "setInteractive",
value: function (t, e, i) {
return lt.prototype.setInteractive.call(this, t, e, i), this.canvasText.setInteractive(), this;
},
},
{
key: "getWrappedText",
value: function (t, e, i) {
return (t = this.canvasText.getText(t, e, i, !0)).split(dt);
},
},
{
key: "getPlainText",
value: function (t, e, i) {
return this.canvasText.getPlainText(t, e, i);
},
},
{
key: "getText",
value: function (t, e, i) {
return this.canvasText.getText(t, e, i, !1);
},
},
{
key: "getSubString",
value: function (t, e, i) {
return this.getText(t, e, i);
},
},
{
key: "copyPenManager",
value: function (t) {
return this.canvasText.copyPenManager(t);
},
},
{
key: "getPenManager",
value: function (t, e) {
return this.canvasText.getPenManager(t, e);
},
},
{
key: "setSize",
value: function (t, e) {
return this.setFixedSize(t, e);
},
},
{
key: "resize",
value: function (t, e) {
return this.setFixedSize(t, e);
},
},
{
key: "lineSpacing",
get: function () {
return this.style.lineSpacing;
},
set: function (t) {
this.setLineSpacing(t);
},
},
{
key: "imageManager",
get: function () {
return this._imageManager || (this._imageManager = new st(this.scene)), this._imageManager;
},
},
{
key: "addImage",
value: function (t, e) {
return this.imageManager.add(t, e), this;
},
},
{
key: "drawAreaBounds",
value: function (t, e) {
return this.canvasText.hitAreaManager.drawBounds(t, e, this), this;
},
},
]),
c
);
})(),
gt = Phaser.GameObjects.Components;
Phaser.Class.mixin(pt, [gt.Alpha, gt.BlendMode, gt.ComputedSize, gt.Crop, gt.Depth, gt.Flip, gt.GetBounds, gt.Mask, gt.Origin, gt.Pipeline, gt.ScrollFactor, gt.Tint, gt.Transform, gt.Visible, h]);
var vt = { plainText: null, prevProp: null },
yt = new x(),
mt = {},
xt = {
splitText: function (t, e) {
for (var i = [], n = 0; ; ) {
var s = Tt.exec(t);
if (!s) {
var r = t.length;
return n < r && i.push(t.substring(n, r)), i;
}
var o = s[0],
a = Tt.lastIndex - o.length;
n < a && i.push(t.substring(n, a)), void 0 === e && i.push(o), (n = Tt.lastIndex);
}
},
tagTextToProp: function (t, e) {
var i, n;
null == e && (e = {}),
e.img && bt(e, jt, "img"),
(i = St.test(t)
? (bt(e, Ht, "b", !0), "")
: _t.test(t)
? (bt(e, jt, "b"), "")
: Et.test(t)
? (bt(e, Ht, "i", !0), "")
: Pt.test(t)
? (bt(e, jt, "i"), "")
: At.test(t)
? ((n = t.match(At)), bt(e, Ht, "size", "".concat(n[1], "px")), "")
: Mt.test(t)
? (bt(e, jt, "size"), "")
: Ct.test(t)
? ((n = t.match(Ct)), bt(e, Ht, "color", n[1]), "")
: Ot.test(t)
? (bt(e, jt, "color"), "")
: kt.test(t)
? ((n = t.match(kt)), bt(e, Ht, "u", !0), "")
: Rt.test(t)
? ((n = t.match(Rt)), bt(e, Ht, "u", n[1]), "")
: Lt.test(t)
? (bt(e, jt, "u"), "")
: It.test(t)
? (bt(e, Ht, "shadow", !0), "")
: Dt.test(t)
? (bt(e, jt, "shadow"), "")
: Ft.test(t)
? (bt(e, Ht, "stroke", !0), "")
: Bt.test(t)
? ((n = t.match(Bt)), bt(e, Ht, "stroke", n[1]), "")
: Nt.test(t)
? (bt(e, jt, "stroke"), "")
: Ut.test(t)
? ((n = t.match(Ut)), bt(e, Ht, "y", parseFloat(n[1])), "")
: Yt.test(t)
? (bt(e, jt, "y"), "")
: zt.test(t)
? ((n = t.match(zt)), bt(e, Ht, "img", n[1]), "")
: Xt.test(t)
? (bt(e, jt, "img"), "")
: Vt.test(t)
? ((n = t.match(Vt)), bt(e, Ht, "area", n[1]), "")
: Gt.test(t)
? (bt(e, jt, "area"), "")
: t);
var s = vt;
return (s.plainText = i), (s.prop = e), s;
},
propToContextStyle: function (t, e) {
var i = yt;
if (e.hasOwnProperty("img")) i.image = e.img;
else {
if (((i.image = null), e.hasOwnProperty("family") ? (i.fontFamily = e.family) : (i.fontFamily = t.fontFamily), e.hasOwnProperty("size"))) {
var n = e.size;
"number" == typeof n && (n = "".concat(n, "px")), (i.fontSize = n);
} else i.fontSize = t.fontSize;
(i.fontStyle = wt(e.b, e.i)),
e.hasOwnProperty("color") ? (i.color = e.color) : (i.color = t.color),
e.hasOwnProperty("stroke") ? (!0 === e.stroke ? (i.stroke = t.stroke) : (i.stroke = e.stroke), (i.strokeThickness = t.strokeThickness)) : ((i.stroke = t.stroke), (i.strokeThickness = 0));
}
return (
e.hasOwnProperty("shadow")
? (!0 === e.shadow ? (i.shadowColor = t.shadowColor) : (i.shadowColor = e.shadow),
(i.shadowOffsetX = t.shadowOffsetX),
(i.shadowOffsetY = t.shadowOffsetY),
(i.shadowBlur = t.shadowBlur),
(i.shadowStroke = !0),
(i.shadowFill = !0))
: ((i.shadowColor = "#000"), (i.shadowOffsetX = 0), (i.shadowOffsetY = 0), (i.shadowBlur = 0), (i.shadowStroke = !1), (i.shadowFill = !1)),
e.hasOwnProperty("u")
? (!0 === e.u ? (i.underlineColor = t.underlineColor) : (i.underlineColor = e.u), (i.underlineThickness = t.underlineThickness), (i.underlineOffset = t.underlineOffset))
: ((i.underlineColor = "#000"), (i.underlineThickness = 0), (i.underlineOffset = 0)),
i
);
},
propToTagText: function (t, e, i) {
null == i && (i = mt);
var n = [];
for (var s in i) e.hasOwnProperty(s) || n.push("[/".concat(s, "]"));
for (var s in e) {
var r = e[s];
if (i[s] !== r)
switch (s) {
case "size":
n.push("[size=".concat(r.replace("px", ""), "]"));
break;
case "color":
case "stroke":
case "img":
case "y":
n.push("[".concat(s, "=").concat(r, "]"));
break;
case "u":
!0 === r ? n.push("[u]") : n.push("[u=".concat(r, "]"));
break;
default:
n.push("[".concat(s, "]"));
}
}
return n.push(t), n.join("");
},
},
bt = function (t, e, i, n) {
return e === Ht ? (t[i] = n) : t.hasOwnProperty(i) && delete t[i], t;
},
wt = function (t, e) {
return t && e ? "bold italic" : t ? "bold" : e ? "italic" : "";
},
Tt = /\[b\]|\[\/b\]|\[i\]|\[\/i\]|\[size=(\d+)\]|\[\/size\]|\[color=([a-z]+|#[0-9abcdef]+)\]|\[\/color\]|\[u\]|\[u=([a-z]+|#[0-9abcdef]+)\]|\[\/u\]|\[shadow\]|\[\/shadow\]|\[stroke\]|\[stroke=([a-z]+|#[0-9abcdef]+)\]|\[\/stroke\]|\[img=([^\]]+)\]|\[\/img\]|\[area=([^\]]+)\]|\[\/area\]|\[y=([-.0-9]+)\]|\[\/y\]/gi,
St = /\[b\]/i,
_t = /\[\/b\]/i,
Et = /\[i\]/i,
Pt = /\[\/i\]/i,
At = /\[size=(\d+)\]/i,
Mt = /\[\/size\]/i,
Ct = /\[color=([a-z]+|#[0-9abcdef]+)\]/i,
Ot = /\[\/color\]/i,
kt = /\[u\]/i,
Rt = /\[u=([a-z]+|#[0-9abcdef]+)\]/i,
Lt = /\[\/u\]/i,
It = /\[shadow\]/i,
Dt = /\[\/shadow\]/i,
Ft = /\[stroke\]/i,
Bt = /\[stroke=([a-z]+|#[0-9abcdef]+)\]/i,
Nt = /\[\/stroke\]/i,
Ut = /\[y=([-.0-9]+)\]/i,
Yt = /\[\/y\]/i,
zt = /\[img=([^\]]+)\]/i,
Xt = /\[\/img\]/i,
Vt = /\[area=([^\]]+)\]/i,
Gt = /\[\/area\]/i,
jt = !1,
Ht = !0,
Wt = (function () {
t(o, pt);
var r = e(o);
function o(t, e, i, n, s) {
return d(this, o), r.call(this, t, e, i, n, s, "rexBBCodeText", xt);
}
return o;
})();
function Kt(t, e, i, n) {
var s = new Wt(this.scene, t, e, i, n);
return this.scene.add.existing(s), s;
}
var qt = Phaser.Utils.Objects.GetAdvancedValue,
Zt = Phaser.GameObjects.BuildGameObject;
function Jt(t, e) {
void 0 === t && (t = {}), void 0 !== e && (t.add = e);
var i = qt(t, "text", ""),
n = qt(t, "style", null),
s = qt(t, "padding", null);
null !== s && (n.padding = s);
var r = new Wt(this.scene, 0, 0, i, n);
return Zt(this.scene, r, t), (r.autoRound = qt(t, "autoRound", !0)), r;
}
function Qt(t) {
return null == t || "" === t || 0 === t.length;
}
var $t = (function () {
t(n, Phaser.Plugins.BasePlugin);
var i = e(n);
function n(t) {
var e;
return d(this, n), (e = i.call(this, t)), t.registerGameObject("rexBBCodeText", Kt, Jt), e;
}
return (
s(n, [
{
key: "start",
value: function () {
this.game.events.on("destroy", this.destroy, this);
},
},
]),
n
);
})();
return (
(function (h, t, e) {
if ("object" === l(h))
if (Qt(t)) {
if (null == e) return;
"object" === l(e) && (h = e);
} else {
"string" == typeof t && (t = t.split("."));
var i = t.pop();
(function (t, e, i) {
var n = h;
if (!Qt(e)) {
var s;
"string" == typeof e && (e = e.split("."));
for (var r = 0, o = e.length; r < o; r++) {
var a;
(null != n[(s = e[r])] && "object" === l(n[s])) || ((a = {}), (n[s] = a)), (n = n[s]);
}
}
return n;
})(0, t)[i] = e;
}
})(window, "RexPlugins.GameObjects.BBCodeText", Wt),
$t
);
})();
},
]);
var YandexAdProvider = (function () {
function t(t) {
var e,
i,
n,
s,
r,
o,
a,
h,
l = this;
(this.adsEnabled = !1),
(e = document),
(i = "yandex-jssdk"),
(s = e.getElementsByTagName("script")[0]),
e.getElementById(i) ||
((n = e.createElement("script")).addEventListener("load", function () {
l.initialize();
}),
(n.id = i),
(n.src = "/projects/vex6/assets/js/v2"),
s.parentNode.insertBefore(n, s)),
(r = document),
(o = "gamedistribution-jssdk"),
(h = r.getElementsByTagName("script")[0]),
r.getElementById(o) || (((a = r.createElement("script")).id = o), (a.src = "//3kh0.github.io/projects/vex6/assets/js/html5.js"), h.parentNode.insertBefore(a, h));
}
return (
(t.prototype.setManager = function (t) {
this.adManager = t;
}),
(t.prototype.showAd = function (t) {
var e,
i,
n,
s,
r,
o,
a,
h,
l = this;
void 0 === t && (t = h5ads.AdType.interstitial),
this.adsEnabled && window.hasOwnProperty("_YaSDK")
? (t === h5ads.AdType.interstitial && null !== (i = null === (e = window._YaSDK) || void 0 === e ? void 0 : e.adv) && void 0 !== i && i.adOpened) ||
(t === h5ads.AdType.rewarded
? null === (r = null === (s = null === (n = window._YaSDK) || void 0 === n ? void 0 : n.adv) || void 0 === s ? void 0 : s.showRewardedVideo) ||
void 0 === r ||
r.call(s, {
callbacks: {
onOpen: function () {},
onRewarded: function () {
l.adManager.emit(h5ads.AdEvents.AD_REWARDED);
},
onClose: function () {
l.resumeGameplay();
},
onError: function (t) {
l.resumeGameplay();
},
},
})
: null === (h = null === (a = null === (o = window._YaSDK) || void 0 === o ? void 0 : o.adv) || void 0 === a ? void 0 : a.showFullscreenAdv) ||
void 0 === h ||
h.call(a, {
callbacks: {
onClose: function () {
l.resumeGameplay();
},
onError: function () {
l.resumeGameplay();
},
},
}))
: this.resumeGameplay();
}),
(t.prototype.initialize = function () {
var e = this;
YaGames.init().then(function (t) {
(window._YaSDK = t), (e.adsEnabled = !0);
});
}),
(t.prototype.resumeGameplay = function () {
this.adManager.emit(h5ads.AdEvents.CONTENT_RESUMED);
}),
(t.prototype.preloadAd = function (t) {
void 0 === t && (t = h5ads.AdType.interstitial);
}),
(t.prototype.destroyAd = function () {}),
(t.prototype.hideAd = function () {}),
(t.prototype.adAvailable = function (t) {
return !0;
}),
t
);
})();