diff --git a/config.jsonc b/config.jsonc index 62a3f56c..ac56d773 100644 --- a/config.jsonc +++ b/config.jsonc @@ -320,6 +320,11 @@ "aliases": [], "categories": [] }, + "Eggy Car": { + "path": "eggy-car", + "aliases": [], + "categories": [] + }, "EvoWars": { "path": "evowars", "aliases": [], diff --git a/games/eggy-car/.index.html.swp b/games/eggy-car/.index.html.swp new file mode 100644 index 00000000..ba3d1f40 Binary files /dev/null and b/games/eggy-car/.index.html.swp differ diff --git a/games/eggy-car/appmanifest.json b/games/eggy-car/appmanifest.json new file mode 100644 index 00000000..dc83f311 --- /dev/null +++ b/games/eggy-car/appmanifest.json @@ -0,0 +1,28 @@ +{ + "name": "Eggy Car", + "short_name": "Eggy Car", + "start_url": "index.html", + "display": "fullscreen", + "orientation": "landscape", + "icons": [{ + "src": "icon-16.png", + "sizes": "16x16", + "type": "image/png" + }, { + "src": "icon-32.png", + "sizes": "32x32", + "type": "image/png" + }, { + "src": "icon-128.png", + "sizes": "128x128", + "type": "image/png" + }, { + "src": "icon-256.png", + "sizes": "144x144", + "type": "image/png" + }, { + "src": "icon-256.png", + "sizes": "256x256", + "type": "image/png" + }] +} diff --git a/games/eggy-car/c2runtime.js b/games/eggy-car/c2runtime.js new file mode 100644 index 00000000..0562c05e --- /dev/null +++ b/games/eggy-car/c2runtime.js @@ -0,0 +1,25522 @@ +var cr = { + plugins_: {}, + behaviors: {} +}; +"function" != typeof Object.getPrototypeOf && (Object.getPrototypeOf = "object" == typeof "test".__proto__ ? function(t) { + return t.__proto__ +} +: function(t) { + return t.constructor.prototype +} +), +function() { + function t(t, e) { + this.x = t, + this.y = e, + cr.seal(this) + } + function e(t, e, i, s) { + this.set(t, e, i, s), + cr.seal(this) + } + function i() { + this.tlx = 0, + this.tly = 0, + this.trx = 0, + this.try_ = 0, + this.brx = 0, + this.bry = 0, + this.blx = 0, + this.bly = 0, + cr.seal(this) + } + cr.logexport = function(t) { + window.console && window.console.log && window.console.log(t) + } + , + cr.logerror = function(t) { + window.console && window.console.error && window.console.error(t) + } + , + cr.seal = function(t) { + return t + } + , + cr.freeze = function(t) { + return t + } + , + cr.is_undefined = function(t) { + return void 0 === t + } + , + cr.is_number = function(t) { + return "number" == typeof t + } + , + cr.is_string = function(t) { + return "string" == typeof t + } + , + cr.isPOT = function(t) { + return 0 < t && 0 == (t - 1 & t) + } + , + cr.nextHighestPowerOfTwo = function(t) { + --t; + for (var e = 1; e < 32; e <<= 1) + t |= t >> e; + return t + 1 + } + , + cr.abs = function(t) { + return t < 0 ? -t : t + } + , + cr.max = function(t, e) { + return e < t ? t : e + } + , + cr.min = function(t, e) { + return t < e ? t : e + } + , + cr.PI = Math.PI, + cr.round = function(t) { + return t + .5 | 0 + } + , + cr.floor = function(t) { + return 0 <= t ? 0 | t : (0 | t) - 1 + } + , + cr.ceil = function(t) { + var e = 0 | t; + return e === t ? e : 1 + e + } + , + t.prototype.offset = function(t, e) { + return this.x += t, + this.y += e, + this + } + , + t.prototype.mul = function(t, e) { + return this.x *= t, + this.y *= e, + this + } + , + cr.vector2 = t, + cr.segments_intersect = function(t, e, i, s, n, r, o, a) { + var h, c, l = t < i ? (p = t, + i) : (p = i, + t), u = n < o ? (h = n, + o) : (h = o, + n); + if (l < h || u < p) + return !1; + if (p = r < a ? (c = r, + a) : (c = a, + r), + (e < s ? (d = e, + s) : (d = s, + e)) < c || p < d) + return !1; + var p = n - t + o - i + , d = r - e + a - s + , t = i - t + , e = s - e + , n = o - n + , a = a - r + , r = cr.abs(e * n - a * t) + , a = n * d - a * p; + if (cr.abs(a) > r) + return !1; + p = t * d - e * p; + return cr.abs(p) <= r + } + , + e.prototype.set = function(t, e, i, s) { + this.left = t, + this.top = e, + this.right = i, + this.bottom = s + } + , + e.prototype.copy = function(t) { + this.left = t.left, + this.top = t.top, + this.right = t.right, + this.bottom = t.bottom + } + , + e.prototype.width = function() { + return this.right - this.left + } + , + e.prototype.height = function() { + return this.bottom - this.top + } + , + e.prototype.offset = function(t, e) { + return this.left += t, + this.top += e, + this.right += t, + this.bottom += e, + this + } + , + e.prototype.normalize = function() { + var t = 0; + this.left > this.right && (t = this.left, + this.left = this.right, + this.right = t), + this.top > this.bottom && (t = this.top, + this.top = this.bottom, + this.bottom = t) + } + , + e.prototype.intersects_rect = function(t) { + return !(t.right < this.left || t.bottom < this.top || t.left > this.right || t.top > this.bottom) + } + , + e.prototype.intersects_rect_off = function(t, e, i) { + return !(t.right + e < this.left || t.bottom + i < this.top || t.left + e > this.right || t.top + i > this.bottom) + } + , + e.prototype.contains_pt = function(t, e) { + return t >= this.left && t <= this.right && e >= this.top && e <= this.bottom + } + , + e.prototype.equals = function(t) { + return this.left === t.left && this.top === t.top && this.right === t.right && this.bottom === t.bottom + } + , + cr.rect = e, + i.prototype.set_from_rect = function(t) { + this.tlx = t.left, + this.tly = t.top, + this.trx = t.right, + this.try_ = t.top, + this.brx = t.right, + this.bry = t.bottom, + this.blx = t.left, + this.bly = t.bottom + } + , + i.prototype.set_from_rotated_rect = function(t, e) { + var i, s, n, r, o, a, h; + 0 === e ? this.set_from_rect(t) : (a = Math.sin(e), + h = Math.cos(e), + i = t.left * a, + s = t.top * a, + n = t.right * a, + r = t.bottom * a, + o = t.left * h, + e = t.top * h, + a = t.right * h, + h = t.bottom * h, + this.tlx = o - s, + this.tly = e + i, + this.trx = a - s, + this.try_ = e + n, + this.brx = a - r, + this.bry = h + n, + this.blx = o - r, + this.bly = h + i) + } + , + i.prototype.offset = function(t, e) { + return this.tlx += t, + this.tly += e, + this.trx += t, + this.try_ += e, + this.brx += t, + this.bry += e, + this.blx += t, + this.bly += e, + this + } + ; + var n = 0 + , r = 0; + function s(t, e, i, s) { + r = t < e ? i < s ? (n = t < i ? t : i, + s < e ? e : s) : (n = t < s ? t : s, + i < e ? e : i) : i < s ? (n = e < i ? e : i, + s < t ? t : s) : (n = e < s ? e : s, + i < t ? t : i) + } + i.prototype.bounding_box = function(t) { + s(this.tlx, this.trx, this.brx, this.blx), + t.left = n, + t.right = r, + s(this.tly, this.try_, this.bry, this.bly), + t.top = n, + t.bottom = r + } + , + i.prototype.contains_pt = function(t, e) { + var i = this.tlx + , s = this.tly + , n = this.trx - i + , r = this.try_ - s + , o = this.brx - i + , a = this.bry - s + , h = t - i + , c = e - s + , l = n * n + r * r + , u = n * o + r * a + , p = n * h + r * c + , d = o * o + a * a + , f = o * h + a * c + , y = 1 / (l * d - u * u) + , t = (d * p - u * f) * y + , e = (l * f - u * p) * y; + if (0 <= t && 0 < e && t + e < 1) + return !0; + e = ((l = (n = this.blx - i) * n + (r = this.bly - s) * r) * f - (u = n * o + r * a) * (p = n * h + r * c)) * (y = 1 / (l * d - u * u)); + return 0 <= (t = (d * p - u * f) * y) && 0 < e && t + e < 1 + } + , + i.prototype.at = function(t, e) { + if (e) + switch (t) { + case 0: + return this.tlx; + case 1: + return this.trx; + case 2: + return this.brx; + case 3: + return this.blx; + case 4: + default: + return this.tlx + } + else + switch (t) { + case 0: + return this.tly; + case 1: + return this.try_; + case 2: + return this.bry; + case 3: + return this.bly; + case 4: + default: + return this.tly + } + } + , + i.prototype.midX = function() { + return (this.tlx + this.trx + this.brx + this.blx) / 4 + } + , + i.prototype.midY = function() { + return (this.tly + this.try_ + this.bry + this.bly) / 4 + } + , + i.prototype.intersects_segment = function(t, e, i, s) { + if (this.contains_pt(t, e) || this.contains_pt(i, s)) + return !0; + for (var n, r, o, a, h = 0; h < 4; h++) + if (n = this.at(h, !0), + r = this.at(h, !1), + o = this.at(h + 1, !0), + a = this.at(h + 1, !1), + cr.segments_intersect(t, e, i, s, n, r, o, a)) + return !0; + return !1 + } + , + i.prototype.intersects_quad = function(t) { + var e, i, s, n, r, o, a, h, c, l, u = t.midX(), p = t.midY(); + if (this.contains_pt(u, p)) + return !0; + if (u = this.midX(), + p = this.midY(), + t.contains_pt(u, p)) + return !0; + for (c = 0; c < 4; c++) + for (l = 0; l < 4; l++) + if (e = this.at(c, !0), + i = this.at(c, !1), + s = this.at(c + 1, !0), + n = this.at(c + 1, !1), + r = t.at(l, !0), + o = t.at(l, !1), + a = t.at(l + 1, !0), + h = t.at(l + 1, !1), + cr.segments_intersect(e, i, s, n, r, o, a, h)) + return !0; + return !1 + } + , + cr.quad = i, + cr.RGB = function(t, e, i) { + return Math.max(Math.min(t, 255), 0) | Math.max(Math.min(e, 255), 0) << 8 | Math.max(Math.min(i, 255), 0) << 16 + } + , + cr.GetRValue = function(t) { + return 255 & t + } + , + cr.GetGValue = function(t) { + return (65280 & t) >> 8 + } + , + cr.GetBValue = function(t) { + return (16711680 & t) >> 16 + } + , + cr.shallowCopy = function(t, e, i) { + for (var s in e) + e.hasOwnProperty(s) && (t[s] = e[s]); + return t + } + , + cr.arrayRemove = function(t, e) { + var i, s; + if (!((e = cr.floor(e)) < 0 || e >= t.length)) { + for (i = e, + s = t.length - 1; i < s; i++) + t[i] = t[i + 1]; + cr.truncateArray(t, s) + } + } + , + cr.truncateArray = function(t, e) { + t.length = e + } + , + cr.clearArray = function(t) { + cr.truncateArray(t, 0) + } + , + cr.shallowAssignArray = function(t, e) { + var i, s; + for (cr.clearArray(t), + i = 0, + s = e.length; i < s; ++i) + t[i] = e[i] + } + , + cr.appendArray = function(t, e) { + t.push.apply(t, e) + } + , + cr.fastIndexOf = function(t, e) { + for (var i = 0, s = t.length; i < s; ++i) + if (t[i] === e) + return i; + return -1 + } + , + cr.arrayFindRemove = function(t, e) { + e = cr.fastIndexOf(t, e); + -1 !== e && cr.arrayRemove(t, e) + } + , + cr.clamp = function(t, e, i) { + return t < e ? e : i < t ? i : t + } + , + cr.to_radians = function(t) { + return t / (180 / cr.PI) + } + , + cr.to_degrees = function(t) { + return t * (180 / cr.PI) + } + , + cr.clamp_angle_degrees = function(t) { + return (t %= 360) < 0 && (t += 360), + t + } + , + cr.clamp_angle = function(t) { + return (t %= 2 * cr.PI) < 0 && (t += 2 * cr.PI), + t + } + , + cr.to_clamped_degrees = function(t) { + return cr.clamp_angle_degrees(cr.to_degrees(t)) + } + , + cr.to_clamped_radians = function(t) { + return cr.clamp_angle(cr.to_radians(t)) + } + , + cr.angleTo = function(t, e, i, s) { + t = i - t, + e = s - e; + return Math.atan2(e, t) + } + , + cr.angleDiff = function(t, e) { + if (t === e) + return 0; + var i = Math.sin(t) + , t = Math.cos(t) + , e = i * Math.sin(e) + t * Math.cos(e); + return 1 <= e ? 0 : e <= -1 ? cr.PI : Math.acos(e) + } + , + cr.angleRotate = function(t, e, i) { + var s = Math.sin(t) + , n = Math.cos(t) + , r = Math.sin(e) + , o = Math.cos(e); + return Math.acos(s * r + n * o) > i ? 0 < n * r - s * o ? cr.clamp_angle(t + i) : cr.clamp_angle(t - i) : cr.clamp_angle(e) + } + , + cr.angleClockwise = function(t, e) { + var i = Math.sin(t); + return Math.cos(t) * Math.sin(e) - i * Math.cos(e) <= 0 + } + , + cr.rotatePtAround = function(t, e, i, s, n, r) { + if (0 === i) + return r ? t : e; + var o = Math.sin(i) + , a = Math.cos(i) + , i = (t -= s) * o; + return t = t * a - (e -= n) * o, + e = e * a + i, + t += s, + e += n, + r ? t : e + } + , + cr.distanceTo = function(t, e, i, s) { + t = i - t, + e = s - e; + return Math.sqrt(t * t + e * e) + } + , + cr.xor = function(t, e) { + return !t != !e + } + , + cr.lerp = function(t, e, i) { + return t + (e - t) * i + } + , + cr.unlerp = function(t, e, i) { + return t === e ? 0 : (i - t) / (e - t) + } + , + cr.anglelerp = function(t, e, i) { + var s = cr.angleDiff(t, e); + return cr.angleClockwise(e, t) ? t + s * i : t - s * i + } + , + cr.qarp = function(t, e, i, s) { + return cr.lerp(cr.lerp(t, e, s), cr.lerp(e, i, s), s) + } + , + cr.cubic = function(t, e, i, s, n) { + return cr.lerp(cr.qarp(t, e, i, n), cr.qarp(e, i, s, n), n) + } + , + cr.cosp = function(t, e, i) { + return (t + e + (t - e) * Math.cos(i * Math.PI)) / 2 + } + , + cr.hasAnyOwnProperty = function(t) { + for (var e in t) + if (t.hasOwnProperty(e)) + return !0; + return !1 + } + , + cr.wipe = function(t) { + for (var e in t) + t.hasOwnProperty(e) && delete t[e] + } + ; + var o = +new Date + , a = !(cr.performance_now = function() { + if (void 0 !== window.performance) { + var t = window.performance; + if (void 0 !== t.now) + return t.now(); + if (void 0 !== t.webkitNow) + return t.webkitNow(); + if (void 0 !== t.mozNow) + return t.mozNow(); + if (void 0 !== t.msNow) + return t.msNow() + } + return Date.now() - o + } + ) + , h = !1 + , c = !1; + "undefined" != typeof window && (a = !(/chrome/i.test(navigator.userAgent) || /chromium/i.test(navigator.userAgent)) && /safari/i.test(navigator.userAgent), + h = /(iphone|ipod|ipad)/i.test(navigator.userAgent), + c = window.c2ejecta); + var l = !a && !c && !h && "undefined" != typeof Set && void 0 !== Set.prototype.forEach; + function u() { + this.s = null, + this.items = null, + this.item_count = 0, + l && (this.s = new Set), + this.values_cache = [], + this.cache_valid = !0, + cr.seal(this) + } + u.prototype.contains = function(t) { + return !this.isEmpty() && (l ? this.s.has(t) : this.items && this.items.hasOwnProperty(t)) + } + , + u.prototype.add = function(t) { + var e, i; + l ? this.s.has(t) || (this.s.add(t), + this.cache_valid = !1) : (e = t.toString(), + (i = this.items) ? i.hasOwnProperty(e) || (i[e] = t, + this.item_count++, + this.cache_valid = !1) : (this.items = {}, + this.items[e] = t, + this.item_count = 1, + this.cache_valid = !1)) + } + , + u.prototype.remove = function(t) { + var e; + this.isEmpty() || (l ? this.s.has(t) && (this.s.delete(t), + this.cache_valid = !1) : this.items && (e = t.toString(), + (t = this.items).hasOwnProperty(e) && (delete t[e], + this.item_count--, + this.cache_valid = !1))) + } + , + u.prototype.clear = function() { + this.isEmpty() || (l ? this.s.clear() : (this.items = null, + this.item_count = 0), + cr.clearArray(this.values_cache), + this.cache_valid = !0) + } + , + u.prototype.isEmpty = function() { + return 0 === this.count() + } + , + u.prototype.count = function() { + return l ? this.s.size : this.item_count + } + ; + var p = null + , d = 0; + function f(t) { + p[d++] = t + } + u.prototype.update_cache = function() { + if (!this.cache_valid) { + if (l) + cr.clearArray(this.values_cache), + p = this.values_cache, + d = 0, + this.s.forEach(f), + p = null, + d = 0; + else { + var t = this.values_cache; + cr.clearArray(t); + var e, i = 0, s = this.items; + if (s) + for (e in s) + s.hasOwnProperty(e) && (t[i++] = s[e]) + } + this.cache_valid = !0 + } + } + , + u.prototype.valuesRef = function() { + return this.update_cache(), + this.values_cache + } + , + cr.ObjectSet = u; + var y = new cr.ObjectSet; + function g() { + this.c = 0, + this.y = 0, + this.t = 0, + this.sum = 0, + cr.seal(this) + } + function m(t) { + this.pts_cache = [], + this.bboxLeft = 0, + this.bboxTop = 0, + this.bboxRight = 0, + this.bboxBottom = 0, + this.convexpolys = null, + this.set_pts(t), + cr.seal(this) + } + function _(t, e) { + this.cellwidth = t, + this.cellheight = e, + this.cells = {} + } + function v(t, e) { + this.cellwidth = t, + this.cellheight = e, + this.cells = {} + } + cr.removeArrayDuplicates = function(t) { + for (var e = 0, i = t.length; e < i; ++e) + y.add(t[e]); + cr.shallowAssignArray(t, y.valuesRef()), + y.clear() + } + , + cr.arrayRemoveAllFromObjectSet = function(t, e) { + l ? cr.arrayRemoveAll_set(t, e.s) : cr.arrayRemoveAll_arr(t, e.valuesRef()) + } + , + cr.arrayRemoveAll_set = function(t, e) { + for (var i, s = 0, n = 0, r = t.length; s < r; ++s) + i = t[s], + e.has(i) || (t[n++] = i); + cr.truncateArray(t, n) + } + , + cr.arrayRemoveAll_arr = function(t, e) { + for (var i, s = 0, n = 0, r = t.length; s < r; ++s) + i = t[s], + -1 === cr.fastIndexOf(e, i) && (t[n++] = i); + cr.truncateArray(t, n) + } + , + g.prototype.add = function(t) { + this.y = t - this.c, + this.t = this.sum + this.y, + this.c = this.t - this.sum - this.y, + this.sum = this.t + } + , + g.prototype.reset = function() { + this.c = 0, + this.y = 0, + this.t = 0, + this.sum = 0 + } + , + cr.KahanAdder = g, + cr.regexp_escape = function(t) { + return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") + } + , + m.prototype.set_pts = function(t) { + this.pts_array = t, + this.pts_count = t.length / 2, + this.pts_cache.length = t.length, + this.cache_width = -1, + this.cache_height = -1, + this.cache_angle = 0 + } + , + m.prototype.is_empty = function() { + return !this.pts_array.length + } + , + m.prototype.update_bbox = function() { + for (var t, e, i = this.pts_cache, s = i[0], n = s, r = i[1], o = r, a = 1, h = this.pts_count; a < h; ++a) + (t = i[e = 2 * a]) < s && (s = t), + n < t && (n = t), + (e = i[1 + e]) < r && (r = e), + o < e && (o = e); + this.bboxLeft = s, + this.bboxRight = n, + this.bboxTop = r, + this.bboxBottom = o + } + , + m.prototype.set_from_rect = function(t, e, i) { + this.pts_cache.length = 8, + this.pts_count = 4; + var s = this.pts_cache; + s[0] = t.left - e, + s[1] = t.top - i, + s[2] = t.right - e, + s[3] = t.top - i, + s[4] = t.right - e, + s[5] = t.bottom - i, + s[6] = t.left - e, + s[7] = t.bottom - i, + this.cache_width = t.right - t.left, + this.cache_height = t.bottom - t.top, + this.update_bbox() + } + , + m.prototype.set_from_quad = function(t, e, i, s, n) { + this.pts_cache.length = 8, + this.pts_count = 4; + var r = this.pts_cache; + r[0] = t.tlx - e, + r[1] = t.tly - i, + r[2] = t.trx - e, + r[3] = t.try_ - i, + r[4] = t.brx - e, + r[5] = t.bry - i, + r[6] = t.blx - e, + r[7] = t.bly - i, + this.cache_width = s, + this.cache_height = n, + this.update_bbox() + } + , + m.prototype.set_from_poly = function(t) { + this.pts_count = t.pts_count, + cr.shallowAssignArray(this.pts_cache, t.pts_cache), + this.bboxLeft = t.bboxLeft, + this.bboxTop, + t.bboxTop, + this.bboxRight = t.bboxRight, + this.bboxBottom = t.bboxBottom + } + , + m.prototype.cache_poly = function(t, e, i) { + if (this.cache_width !== t || this.cache_height !== e || this.cache_angle !== i) { + var s, n, r, o, a, h; + this.cache_width = t, + this.cache_height = e, + this.cache_angle = i; + var c = 0 + , l = 1 + , u = this.pts_array + , p = this.pts_cache; + for (0 !== i && (c = Math.sin(i), + l = Math.cos(i)), + s = 0, + o = this.pts_count; s < o; s++) + r = 1 + (n = 2 * s), + a = u[n] * t, + h = u[r] * e, + p[n] = a * l - h * c, + p[r] = h * l + a * c; + this.update_bbox() + } + } + , + m.prototype.contains_pt = function(t, e) { + var i = this.pts_cache; + if (t === i[0] && e === i[1]) + return !0; + for (var s, n, r, o, a = this.pts_count, h = this.bboxLeft - 110, c = this.bboxTop - 101, l = this.bboxRight + 131, u = this.bboxBottom + 120, p = 0, d = 0, f = 0; f < a; f++) + o = (f + 1) % a * 2, + s = i[r = 2 * f], + n = i[1 + r], + r = i[o], + o = i[1 + o], + cr.segments_intersect(h, c, t, e, s, n, r, o) && p++, + cr.segments_intersect(l, u, t, e, s, n, r, o) && d++; + return p % 2 == 1 || d % 2 == 1 + } + , + m.prototype.intersects_poly = function(t, e, i) { + var s, n, r, o, a, h, c, l, u, p, d, f, y, g, m = t.pts_cache, _ = this.pts_cache; + if (this.contains_pt(m[0] + e, m[1] + i)) + return !0; + if (t.contains_pt(_[0] - e, _[1] - i)) + return !0; + for (s = 0, + o = this.pts_count; s < o; s++) + for (r = (s + 1) % o * 2, + c = _[n = 2 * s], + l = _[1 + n], + u = _[r], + p = _[1 + r], + a = 0, + h = t.pts_count; a < h; a++) + if (g = (a + 1) % h * 2, + d = m[y = 2 * a] + e, + f = m[1 + y] + i, + y = m[g] + e, + g = m[1 + g] + i, + cr.segments_intersect(c, l, u, p, d, f, y, g)) + return !0; + return !1 + } + , + m.prototype.intersects_segment = function(t, e, i, s, n, r) { + var o, a, h, c, l, u, p = this.pts_cache; + if (this.contains_pt(i - t, s - e)) + return !0; + for (o = 0, + a = this.pts_count; o < a; o++) + if (u = (o + 1) % a * 2, + h = p[l = 2 * o] + t, + c = p[1 + l] + e, + l = p[u] + t, + u = p[1 + u] + e, + cr.segments_intersect(i, s, n, r, h, c, l, u)) + return !0; + return !1 + } + , + m.prototype.mirror = function(t) { + for (var e, i = 0, s = this.pts_count; i < s; ++i) + e = 2 * i, + this.pts_cache[e] = 2 * t - this.pts_cache[e] + } + , + m.prototype.flip = function(t) { + for (var e, i = 0, s = this.pts_count; i < s; ++i) + e = 2 * i + 1, + this.pts_cache[e] = 2 * t - this.pts_cache[e] + } + , + m.prototype.diag = function() { + for (var t, e, i, s = 0, n = this.pts_count; s < n; ++s) + e = 1 + (t = 2 * s), + i = this.pts_cache[t], + this.pts_cache[t] = this.pts_cache[e], + this.pts_cache[e] = i + } + , + cr.CollisionPoly = m, + _.prototype.totalCellCount = 0, + _.prototype.getCell = function(t, e, i) { + var s, n = this.cells[t]; + return n ? (s = n[e]) || (i ? (s = w(this, t, e), + this.cells[t][e] = s) : null) : i ? (s = w(this, t, e), + this.cells[t] = {}, + this.cells[t][e] = s) : null + } + , + _.prototype.XToCell = function(t) { + return cr.floor(t / this.cellwidth) + } + , + _.prototype.YToCell = function(t) { + return cr.floor(t / this.cellheight) + } + , + _.prototype.update = function(t, e, i) { + var s, n, r, o, a; + if (e) + for (s = e.left, + n = e.right; s <= n; ++s) + for (r = e.top, + o = e.bottom; r <= o; ++r) + i && i.contains_pt(s, r) || (a = this.getCell(s, r, !1)) && (a.remove(t), + a.isEmpty() && (a = a, + _.prototype.totalCellCount--, + a.objects.clear(), + b.length < 1e3 && b.push(a), + this.cells[s][r] = null)); + if (i) + for (s = i.left, + n = i.right; s <= n; ++s) + for (r = i.top, + o = i.bottom; r <= o; ++r) + e && e.contains_pt(s, r) || this.getCell(s, r, !0).insert(t) + } + , + _.prototype.queryRange = function(t, e) { + for (var i, s, n = this.XToCell(t.left), r = this.YToCell(t.top), o = this.XToCell(t.right), a = this.YToCell(t.bottom); n <= o; ++n) + for (i = r; i <= a; ++i) + (s = this.getCell(n, i, !1)) && s.dump(e) + } + , + cr.SparseGrid = _, + v.prototype.totalCellCount = 0, + v.prototype.getCell = function(t, e, i) { + var s, n = this.cells[t]; + return n ? (s = n[e]) || (i ? (s = T(this, t, e), + this.cells[t][e] = s) : null) : i ? (s = T(this, t, e), + this.cells[t] = {}, + this.cells[t][e] = s) : null + } + , + v.prototype.XToCell = function(t) { + return cr.floor(t / this.cellwidth) + } + , + v.prototype.YToCell = function(t) { + return cr.floor(t / this.cellheight) + } + , + v.prototype.update = function(t, e, i) { + var s, n, r, o, a; + if (e) + for (s = e.left, + n = e.right; s <= n; ++s) + for (r = e.top, + o = e.bottom; r <= o; ++r) + i && i.contains_pt(s, r) || (a = this.getCell(s, r, !1)) && (a.remove(t), + a.isEmpty() && (a = a, + v.prototype.totalCellCount--, + a.reset(), + S.length < 1e3 && S.push(a), + this.cells[s][r] = null)); + if (i) + for (s = i.left, + n = i.right; s <= n; ++s) + for (r = i.top, + o = i.bottom; r <= o; ++r) + e && e.contains_pt(s, r) || this.getCell(s, r, !0).insert(t) + } + , + v.prototype.queryRange = function(t, e, i, s, n) { + for (var r, o, a = this.XToCell(t), h = this.YToCell(e), c = this.XToCell(i), l = this.YToCell(s); a <= c; ++a) + for (r = h; r <= l; ++r) + (o = this.getCell(a, r, !1)) && o.dump(n) + } + , + v.prototype.markRangeChanged = function(t) { + for (var e, i, s = t.left, n = t.top, r = t.right, o = t.bottom; s <= r; ++s) + for (e = n; e <= o; ++e) + (i = this.getCell(s, e, !1)) && (i.is_sorted = !1) + } + , + cr.RenderGrid = v; + var b = []; + function w(t, e, i) { + var s; + return _.prototype.totalCellCount++, + b.length ? ((s = b.pop()).grid = t, + s.x = e, + s.y = i, + s) : new cr.GridCell(t,e,i) + } + function x(t, e, i) { + this.grid = t, + this.x = e, + this.y = i, + this.objects = new cr.ObjectSet + } + x.prototype.isEmpty = function() { + return this.objects.isEmpty() + } + , + x.prototype.insert = function(t) { + this.objects.add(t) + } + , + x.prototype.remove = function(t) { + this.objects.remove(t) + } + , + x.prototype.dump = function(t) { + cr.appendArray(t, this.objects.valuesRef()) + } + , + cr.GridCell = x; + var S = []; + function T(t, e, i) { + var s; + return v.prototype.totalCellCount++, + S.length ? ((s = S.pop()).grid = t, + s.x = e, + s.y = i, + s) : new cr.RenderCell(t,e,i) + } + function A(t, e, i) { + this.grid = t, + this.x = e, + this.y = i, + this.objects = [], + this.is_sorted = !0, + this.pending_removal = new cr.ObjectSet, + this.any_pending_removal = !1 + } + function C(t, e) { + return t.zindex - e.zindex + } + A.prototype.isEmpty = function() { + return !this.objects.length || !(this.objects.length > this.pending_removal.count()) && (this.flush_pending(), + !0) + } + , + A.prototype.insert = function(t) { + if (this.pending_removal.contains(t)) + return this.pending_removal.remove(t), + void (this.pending_removal.isEmpty() && (this.any_pending_removal = !1)); + this.objects.length ? (this.objects[this.objects.length - 1].get_zindex() > t.get_zindex() && (this.is_sorted = !1), + this.objects.push(t)) : (this.objects.push(t), + this.is_sorted = !0) + } + , + A.prototype.remove = function(t) { + this.pending_removal.add(t), + this.any_pending_removal = !0, + 30 <= this.pending_removal.count() && this.flush_pending() + } + , + A.prototype.flush_pending = function() { + this.any_pending_removal && (this.pending_removal.count() !== this.objects.length ? (cr.arrayRemoveAllFromObjectSet(this.objects, this.pending_removal), + this.pending_removal.clear(), + this.any_pending_removal = !1) : this.reset()) + } + , + A.prototype.ensure_sorted = function() { + this.is_sorted || (this.objects.sort(C), + this.is_sorted = !0) + } + , + A.prototype.reset = function() { + cr.clearArray(this.objects), + this.is_sorted = !0, + this.pending_removal.clear(), + this.any_pending_removal = !1 + } + , + A.prototype.dump = function(t) { + this.flush_pending(), + this.ensure_sorted(), + this.objects.length && t.push(this.objects) + } + , + cr.RenderCell = A; + var k = ["lighter", "xor", "copy", "destination-over", "source-in", "destination-in", "source-out", "destination-out", "source-atop", "destination-atop"]; + cr.effectToCompositeOp = function(t) { + return t <= 0 || 11 <= t ? "source-over" : k[t - 1] + } + , + cr.setGLBlend = function(t, e, i) { + if (i) + switch (t.srcBlend = i.ONE, + t.destBlend = i.ONE_MINUS_SRC_ALPHA, + e) { + case 1: + t.srcBlend = i.ONE, + t.destBlend = i.ONE; + break; + case 2: + break; + case 3: + t.srcBlend = i.ONE, + t.destBlend = i.ZERO; + break; + case 4: + t.srcBlend = i.ONE_MINUS_DST_ALPHA, + t.destBlend = i.ONE; + break; + case 5: + t.srcBlend = i.DST_ALPHA, + t.destBlend = i.ZERO; + break; + case 6: + t.srcBlend = i.ZERO, + t.destBlend = i.SRC_ALPHA; + break; + case 7: + t.srcBlend = i.ONE_MINUS_DST_ALPHA, + t.destBlend = i.ZERO; + break; + case 8: + t.srcBlend = i.ZERO, + t.destBlend = i.ONE_MINUS_SRC_ALPHA; + break; + case 9: + t.srcBlend = i.DST_ALPHA, + t.destBlend = i.ONE_MINUS_SRC_ALPHA; + break; + case 10: + t.srcBlend = i.ONE_MINUS_DST_ALPHA, + t.destBlend = i.SRC_ALPHA + } + } + , + cr.round6dp = function(t) { + return Math.round(1e6 * t) / 1e6 + } + , + cr.equals_nocase = function(t, e) { + return "string" == typeof t && "string" == typeof e && (t.length === e.length && (t === e || t.toLowerCase() === e.toLowerCase())) + } + , + cr.isCanvasInputEvent = function(t) { + t = t.target; + return !t || (t === document || t === window || (!(!document || !document.body || t !== document.body) || !!cr.equals_nocase(t.tagName, "canvas"))) + } +}(); +var MatrixArray = "undefined" != typeof Float32Array ? Float32Array : Array + , glMatrixArrayType = MatrixArray + , vec3 = {} + , mat3 = {} + , mat4 = {} + , quat4 = {}; +vec3.create = function(t) { + var e = new MatrixArray(3); + return t && (e[0] = t[0], + e[1] = t[1], + e[2] = t[2]), + e +} +, +vec3.set = function(t, e) { + return e[0] = t[0], + e[1] = t[1], + e[2] = t[2], + e +} +, +vec3.add = function(t, e, i) { + return i && t !== i ? (i[0] = t[0] + e[0], + i[1] = t[1] + e[1], + i[2] = t[2] + e[2], + i) : (t[0] += e[0], + t[1] += e[1], + t[2] += e[2], + t) +} +, +vec3.subtract = function(t, e, i) { + return i && t !== i ? (i[0] = t[0] - e[0], + i[1] = t[1] - e[1], + i[2] = t[2] - e[2], + i) : (t[0] -= e[0], + t[1] -= e[1], + t[2] -= e[2], + t) +} +, +vec3.negate = function(t, e) { + return (e = e || t)[0] = -t[0], + e[1] = -t[1], + e[2] = -t[2], + e +} +, +vec3.scale = function(t, e, i) { + return i && t !== i ? (i[0] = t[0] * e, + i[1] = t[1] * e, + i[2] = t[2] * e, + i) : (t[0] *= e, + t[1] *= e, + t[2] *= e, + t) +} +, +vec3.normalize = function(t, e) { + e = e || t; + var i = t[0] + , s = t[1] + , n = t[2] + , t = Math.sqrt(i * i + s * s + n * n); + return t ? 1 === t ? (e[0] = i, + e[1] = s, + e[2] = n) : (t = 1 / t, + e[0] = i * t, + e[1] = s * t, + e[2] = n * t) : (e[0] = 0, + e[1] = 0, + e[2] = 0), + e +} +, +vec3.cross = function(t, e, i) { + i = i || t; + var s = t[0] + , n = t[1] + , t = t[2] + , r = e[0] + , o = e[1] + , e = e[2]; + return i[0] = n * e - t * o, + i[1] = t * r - s * e, + i[2] = s * o - n * r, + i +} +, +vec3.length = function(t) { + var e = t[0] + , i = t[1] + , t = t[2]; + return Math.sqrt(e * e + i * i + t * t) +} +, +vec3.dot = function(t, e) { + return t[0] * e[0] + t[1] * e[1] + t[2] * e[2] +} +, +vec3.direction = function(t, e, i) { + i = i || t; + var s = t[0] - e[0] + , n = t[1] - e[1] + , t = t[2] - e[2]; + return (e = Math.sqrt(s * s + n * n + t * t)) ? (e = 1 / e, + i[0] = s * e, + i[1] = n * e, + i[2] = t * e) : (i[0] = 0, + i[1] = 0, + i[2] = 0), + i +} +, +vec3.lerp = function(t, e, i, s) { + return (s = s || t)[0] = t[0] + i * (e[0] - t[0]), + s[1] = t[1] + i * (e[1] - t[1]), + s[2] = t[2] + i * (e[2] - t[2]), + s +} +, +vec3.str = function(t) { + return "[" + t[0] + ", " + t[1] + ", " + t[2] + "]" +} +, +mat3.create = function(t) { + var e = new MatrixArray(9); + return t && (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]), + e +} +, +mat3.set = function(t, e) { + 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], + e +} +, +mat3.identity = function(t) { + 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, + t +} +, +mat3.transpose = function(t, e) { + if (e && t !== e) + return e[0] = t[0], + e[1] = t[3], + e[2] = t[6], + e[3] = t[1], + e[4] = t[4], + e[5] = t[7], + e[6] = t[2], + e[7] = t[5], + e[8] = t[8], + e; + var i = t[1] + , s = t[2] + , e = t[5]; + return t[1] = t[3], + t[2] = t[6], + t[3] = i, + t[5] = t[7], + t[6] = s, + t[7] = e, + t +} +, +mat3.toMat4 = function(t, e) { + return (e = e || mat4.create())[15] = 1, + e[14] = 0, + e[13] = 0, + e[12] = 0, + e[11] = 0, + e[10] = t[8], + e[9] = t[7], + e[8] = t[6], + e[7] = 0, + e[6] = t[5], + e[5] = t[4], + e[4] = t[3], + e[3] = 0, + e[2] = t[2], + e[1] = t[1], + e[0] = t[0], + e +} +, +mat3.str = function(t) { + return "[" + t[0] + ", " + t[1] + ", " + t[2] + ", " + t[3] + ", " + t[4] + ", " + t[5] + ", " + t[6] + ", " + t[7] + ", " + t[8] + "]" +} +, +mat4.create = function(t) { + var e = new MatrixArray(16); + return t && (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], + e[9] = t[9], + e[10] = t[10], + e[11] = t[11], + e[12] = t[12], + e[13] = t[13], + e[14] = t[14], + e[15] = t[15]), + e +} +, +mat4.set = function(t, e) { + 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], + e[9] = t[9], + e[10] = t[10], + e[11] = t[11], + e[12] = t[12], + e[13] = t[13], + e[14] = t[14], + e[15] = t[15], + e +} +, +mat4.identity = function(t) { + return t[0] = 1, + t[1] = 0, + t[2] = 0, + t[3] = 0, + t[4] = 0, + t[5] = 1, + t[6] = 0, + t[7] = 0, + t[8] = 0, + t[9] = 0, + t[10] = 1, + t[11] = 0, + t[12] = 0, + t[13] = 0, + t[14] = 0, + t[15] = 1, + t +} +, +mat4.transpose = function(t, e) { + if (e && t !== e) + return e[0] = t[0], + e[1] = t[4], + e[2] = t[8], + e[3] = t[12], + e[4] = t[1], + e[5] = t[5], + e[6] = t[9], + e[7] = t[13], + e[8] = t[2], + e[9] = t[6], + e[10] = t[10], + e[11] = t[14], + e[12] = t[3], + e[13] = t[7], + e[14] = t[11], + e[15] = t[15], + e; + var i = t[1] + , s = t[2] + , n = t[3] + , r = t[6] + , o = t[7] + , e = t[11]; + return t[1] = t[4], + t[2] = t[8], + t[3] = t[12], + t[4] = i, + t[6] = t[9], + t[7] = t[13], + t[8] = s, + t[9] = r, + t[11] = t[14], + t[12] = n, + t[13] = o, + t[14] = e, + t +} +, +mat4.determinant = function(t) { + var e = t[0] + , i = t[1] + , s = t[2] + , n = t[3] + , r = t[4] + , o = t[5] + , a = t[6] + , h = t[7] + , c = t[8] + , l = t[9] + , u = t[10] + , p = t[11] + , d = t[12] + , f = t[13] + , y = t[14]; + return d * l * a * n - c * f * a * n - d * o * u * n + r * f * u * n + c * o * y * n - r * l * y * n - d * l * s * h + c * f * s * h + d * i * u * h - e * f * u * h - c * i * y * h + e * l * y * h + d * o * s * p - r * f * s * p - d * i * a * p + e * f * a * p + r * i * y * p - e * o * y * p - c * o * s * (t = t[15]) + r * l * s * t + c * i * a * t - e * l * a * t - r * i * u * t + e * o * u * t +} +, +mat4.inverse = function(t, e) { + e = e || t; + var i = t[0] + , s = t[1] + , n = t[2] + , r = t[3] + , o = t[4] + , a = t[5] + , h = t[6] + , c = t[7] + , l = t[8] + , u = t[9] + , p = t[10] + , d = t[11] + , f = t[12] + , y = t[13] + , g = t[14] + , m = t[15] + , _ = i * a - s * o + , v = i * h - n * o + , b = i * c - r * o + , w = s * h - n * a + , x = s * c - r * a + , S = n * c - r * h + , T = l * y - u * f + , A = l * g - p * f + , C = l * m - d * f + , k = u * g - p * y + , O = u * m - d * y + , I = p * m - d * g + , t = 1 / (_ * I - v * O + b * k + w * C - x * A + S * T); + return e[0] = (a * I - h * O + c * k) * t, + e[1] = (-s * I + n * O - r * k) * t, + e[2] = (y * S - g * x + m * w) * t, + e[3] = (-u * S + p * x - d * w) * t, + e[4] = (-o * I + h * C - c * A) * t, + e[5] = (i * I - n * C + r * A) * t, + e[6] = (-f * S + g * b - m * v) * t, + e[7] = (l * S - p * b + d * v) * t, + e[8] = (o * O - a * C + c * T) * t, + e[9] = (-i * O + s * C - r * T) * t, + e[10] = (f * x - y * b + m * _) * t, + e[11] = (-l * x + u * b - d * _) * t, + e[12] = (-o * k + a * A - h * T) * t, + e[13] = (i * k - s * A + n * T) * t, + e[14] = (-f * w + y * v - g * _) * t, + e[15] = (l * w - u * v + p * _) * t, + e +} +, +mat4.toRotationMat = function(t, e) { + return (e = e || mat4.create())[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], + e[9] = t[9], + e[10] = t[10], + e[11] = t[11], + e[12] = 0, + e[13] = 0, + e[14] = 0, + e[15] = 1, + e +} +, +mat4.toMat3 = function(t, e) { + return (e = e || mat3.create())[0] = t[0], + e[1] = t[1], + e[2] = t[2], + e[3] = t[4], + e[4] = t[5], + e[5] = t[6], + e[6] = t[8], + e[7] = t[9], + e[8] = t[10], + e +} +, +mat4.toInverseMat3 = function(t, e) { + var i = t[0] + , s = t[1] + , n = t[2] + , r = t[4] + , o = t[5] + , a = t[6] + , h = t[8] + , c = t[9] + , l = t[10] + , u = l * o - a * c + , p = -l * r + a * h + , d = c * r - o * h + , t = i * u + s * p + n * d; + return t ? (t = 1 / t, + (e = e || mat3.create())[0] = u * t, + e[1] = (-l * s + n * c) * t, + e[2] = (a * s - n * o) * t, + e[3] = p * t, + e[4] = (l * i - n * h) * t, + e[5] = (-a * i + n * r) * t, + e[6] = d * t, + e[7] = (-c * i + s * h) * t, + e[8] = (o * i - s * r) * t, + e) : null +} +, +mat4.multiply = function(t, e, i) { + i = i || t; + var s = t[0] + , n = t[1] + , r = t[2] + , o = t[3] + , a = t[4] + , h = t[5] + , c = t[6] + , l = t[7] + , u = t[8] + , p = t[9] + , d = t[10] + , f = t[11] + , y = t[12] + , g = t[13] + , m = t[14] + , t = t[15] + , _ = e[0] + , v = e[1] + , b = e[2] + , w = e[3] + , x = e[4] + , S = e[5] + , T = e[6] + , A = e[7] + , C = e[8] + , k = e[9] + , O = e[10] + , I = e[11] + , P = e[12] + , E = e[13] + , B = e[14] + , e = e[15]; + return i[0] = _ * s + v * a + b * u + w * y, + i[1] = _ * n + v * h + b * p + w * g, + i[2] = _ * r + v * c + b * d + w * m, + i[3] = _ * o + v * l + b * f + w * t, + i[4] = x * s + S * a + T * u + A * y, + i[5] = x * n + S * h + T * p + A * g, + i[6] = x * r + S * c + T * d + A * m, + i[7] = x * o + S * l + T * f + A * t, + i[8] = C * s + k * a + O * u + I * y, + i[9] = C * n + k * h + O * p + I * g, + i[10] = C * r + k * c + O * d + I * m, + i[11] = C * o + k * l + O * f + I * t, + i[12] = P * s + E * a + B * u + e * y, + i[13] = P * n + E * h + B * p + e * g, + i[14] = P * r + E * c + B * d + e * m, + i[15] = P * o + E * l + B * f + e * t, + i +} +, +mat4.multiplyVec3 = function(t, e, i) { + i = i || e; + var s = e[0] + , n = e[1] + , e = e[2]; + return i[0] = t[0] * s + t[4] * n + t[8] * e + t[12], + i[1] = t[1] * s + t[5] * n + t[9] * e + t[13], + i[2] = t[2] * s + t[6] * n + t[10] * e + t[14], + i +} +, +mat4.multiplyVec4 = function(t, e, i) { + i = i || e; + var s = e[0] + , n = e[1] + , r = e[2] + , e = e[3]; + return i[0] = t[0] * s + t[4] * n + t[8] * r + t[12] * e, + i[1] = t[1] * s + t[5] * n + t[9] * r + t[13] * e, + i[2] = t[2] * s + t[6] * n + t[10] * r + t[14] * e, + i[3] = t[3] * s + t[7] * n + t[11] * r + t[15] * e, + i +} +, +mat4.translate = function(t, e, i) { + var s, n, r, o, a, h, c, l, u, p, d, f, y = e[0], g = e[1], e = e[2]; + return i && t !== i ? (s = t[0], + n = t[1], + r = t[2], + o = t[3], + a = t[4], + h = t[5], + c = t[6], + l = t[7], + u = t[8], + p = t[9], + d = t[10], + f = t[11], + i[0] = s, + i[1] = n, + i[2] = r, + i[3] = o, + i[4] = a, + i[5] = h, + i[6] = c, + i[7] = l, + i[8] = u, + i[9] = p, + i[10] = d, + i[11] = f, + i[12] = s * y + a * g + u * e + t[12], + i[13] = n * y + h * g + p * e + t[13], + i[14] = r * y + c * g + d * e + t[14], + i[15] = o * y + l * g + f * e + t[15], + i) : (t[12] = t[0] * y + t[4] * g + t[8] * e + t[12], + t[13] = t[1] * y + t[5] * g + t[9] * e + t[13], + t[14] = t[2] * y + t[6] * g + t[10] * e + t[14], + t[15] = t[3] * y + t[7] * g + t[11] * e + t[15], + t) +} +, +mat4.scale = function(t, e, i) { + var s = e[0] + , n = e[1] + , e = e[2]; + return i && t !== i ? (i[0] = t[0] * s, + i[1] = t[1] * s, + i[2] = t[2] * s, + i[3] = t[3] * s, + i[4] = t[4] * n, + i[5] = t[5] * n, + i[6] = t[6] * n, + i[7] = t[7] * n, + i[8] = t[8] * e, + i[9] = t[9] * e, + i[10] = t[10] * e, + i[11] = t[11] * e, + i[12] = t[12], + i[13] = t[13], + i[14] = t[14], + i[15] = t[15], + i) : (t[0] *= s, + t[1] *= s, + t[2] *= s, + t[3] *= s, + t[4] *= n, + t[5] *= n, + t[6] *= n, + t[7] *= n, + t[8] *= e, + t[9] *= e, + t[10] *= e, + t[11] *= e, + t) +} +, +mat4.rotate = function(t, e, i, s) { + var n, r, o, a, h, c, l, u, p, d, f, y, g, m, _, v, b, w, x, S, T = i[0], A = i[1], i = i[2], C = Math.sqrt(T * T + A * A + i * i); + return C ? (1 !== C && (T *= C = 1 / C, + A *= C, + i *= C), + n = Math.sin(e), + o = 1 - (r = Math.cos(e)), + e = t[0], + C = t[1], + a = t[2], + h = t[3], + c = t[4], + l = t[5], + u = t[6], + p = t[7], + d = t[8], + f = t[9], + y = t[10], + g = t[11], + m = T * T * o + r, + _ = A * T * o + i * n, + v = i * T * o - A * n, + b = T * A * o - i * n, + w = A * A * o + r, + x = i * A * o + T * n, + S = T * i * o + A * n, + T = A * i * o - T * n, + A = i * i * o + r, + s ? t !== s && (s[12] = t[12], + s[13] = t[13], + s[14] = t[14], + s[15] = t[15]) : s = t, + s[0] = e * m + c * _ + d * v, + s[1] = C * m + l * _ + f * v, + s[2] = a * m + u * _ + y * v, + s[3] = h * m + p * _ + g * v, + s[4] = e * b + c * w + d * x, + s[5] = C * b + l * w + f * x, + s[6] = a * b + u * w + y * x, + s[7] = h * b + p * w + g * x, + s[8] = e * S + c * T + d * A, + s[9] = C * S + l * T + f * A, + s[10] = a * S + u * T + y * A, + s[11] = h * S + p * T + g * A, + s) : null +} +, +mat4.rotateX = function(t, e, i) { + var s = Math.sin(e) + , e = Math.cos(e) + , n = t[4] + , r = t[5] + , o = t[6] + , a = t[7] + , h = t[8] + , c = t[9] + , l = t[10] + , u = t[11]; + return i ? t !== i && (i[0] = t[0], + i[1] = t[1], + i[2] = t[2], + i[3] = t[3], + i[12] = t[12], + i[13] = t[13], + i[14] = t[14], + i[15] = t[15]) : i = t, + i[4] = n * e + h * s, + i[5] = r * e + c * s, + i[6] = o * e + l * s, + i[7] = a * e + u * s, + i[8] = n * -s + h * e, + i[9] = r * -s + c * e, + i[10] = o * -s + l * e, + i[11] = a * -s + u * e, + i +} +, +mat4.rotateY = function(t, e, i) { + var s = Math.sin(e) + , e = Math.cos(e) + , n = t[0] + , r = t[1] + , o = t[2] + , a = t[3] + , h = t[8] + , c = t[9] + , l = t[10] + , u = t[11]; + return i ? t !== i && (i[4] = t[4], + i[5] = t[5], + i[6] = t[6], + i[7] = t[7], + i[12] = t[12], + i[13] = t[13], + i[14] = t[14], + i[15] = t[15]) : i = t, + i[0] = n * e + h * -s, + i[1] = r * e + c * -s, + i[2] = o * e + l * -s, + i[3] = a * e + u * -s, + i[8] = n * s + h * e, + i[9] = r * s + c * e, + i[10] = o * s + l * e, + i[11] = a * s + u * e, + i +} +, +mat4.rotateZ = function(t, e, i) { + var s = Math.sin(e) + , e = Math.cos(e) + , n = t[0] + , r = t[1] + , o = t[2] + , a = t[3] + , h = t[4] + , c = t[5] + , l = t[6] + , u = t[7]; + return i ? t !== i && (i[8] = t[8], + i[9] = t[9], + i[10] = t[10], + i[11] = t[11], + i[12] = t[12], + i[13] = t[13], + i[14] = t[14], + i[15] = t[15]) : i = t, + i[0] = n * e + h * s, + i[1] = r * e + c * s, + i[2] = o * e + l * s, + i[3] = a * e + u * s, + i[4] = n * -s + h * e, + i[5] = r * -s + c * e, + i[6] = o * -s + l * e, + i[7] = a * -s + u * e, + i +} +, +mat4.frustum = function(t, e, i, s, n, r, o) { + var a = e - t + , h = s - i + , c = r - n; + return (o = o || mat4.create())[0] = 2 * n / a, + o[1] = 0, + o[2] = 0, + o[3] = 0, + o[4] = 0, + o[5] = 2 * n / h, + o[6] = 0, + o[7] = 0, + o[8] = (e + t) / a, + o[9] = (s + i) / h, + o[10] = -(r + n) / c, + o[11] = -1, + o[12] = 0, + o[13] = 0, + o[14] = -r * n * 2 / c, + o[15] = 0, + o +} +, +mat4.perspective = function(t, e, i, s, n) { + return e *= t = i * Math.tan(t * Math.PI / 360), + mat4.frustum(-e, e, -t, t, i, s, n) +} +, +mat4.ortho = function(t, e, i, s, n, r, o) { + var a = e - t + , h = s - i + , c = r - n; + return (o = o || mat4.create())[0] = 2 / a, + o[1] = 0, + o[2] = 0, + o[3] = 0, + o[4] = 0, + o[5] = 2 / h, + o[6] = 0, + o[7] = 0, + o[8] = 0, + o[9] = 0, + o[10] = -2 / c, + o[11] = 0, + o[12] = -(t + e) / a, + o[13] = -(s + i) / h, + o[14] = -(r + n) / c, + o[15] = 1, + o +} +, +mat4.lookAt = function(t, e, i, s) { + s = s || mat4.create(); + var n, r, o, a, h, c = t[0], l = t[1], t = t[2], u = i[0], p = i[1], d = i[2]; + return i = e[1], + o = e[2], + c === e[0] && l === i && t === o ? mat4.identity(s) : (i = c - e[0], + o = l - e[1], + a = t - e[2], + e = p * (a *= h = 1 / Math.sqrt(i * i + o * o + a * a)) - d * (o *= h), + d = d * (i *= h) - u * a, + u = u * o - p * i, + (h = Math.sqrt(e * e + d * d + u * u)) ? (e *= h = 1 / h, + d *= h, + u *= h) : u = d = e = 0, + p = o * u - a * d, + n = a * e - i * u, + r = i * d - o * e, + (h = Math.sqrt(p * p + n * n + r * r)) ? (p *= h = 1 / h, + n *= h, + r *= h) : r = n = p = 0, + s[0] = e, + s[1] = p, + s[2] = i, + s[3] = 0, + s[4] = d, + s[5] = n, + s[6] = o, + s[7] = 0, + s[8] = u, + s[9] = r, + s[10] = a, + s[11] = 0, + s[12] = -(e * c + d * l + u * t), + s[13] = -(p * c + n * l + r * t), + s[14] = -(i * c + o * l + a * t), + s[15] = 1, + s) +} +, +mat4.fromRotationTranslation = function(t, e, i) { + i = i || mat4.create(); + var s = t[0] + , n = t[1] + , r = t[2] + , o = t[3] + , a = s + s + , h = n + n + , c = r + r + , t = s * a + , l = s * h; + s *= c; + var u = n * h; + return n *= c, + r *= c, + a *= o, + h *= o, + o *= c, + i[0] = 1 - (u + r), + i[1] = l + o, + i[2] = s - h, + i[3] = 0, + i[4] = l - o, + i[5] = 1 - (t + r), + i[6] = n + a, + i[7] = 0, + i[8] = s + h, + i[9] = n - a, + i[10] = 1 - (t + u), + i[11] = 0, + i[12] = e[0], + i[13] = e[1], + i[14] = e[2], + i[15] = 1, + i +} +, +mat4.str = function(t) { + return "[" + 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] + "]" +} +, +quat4.create = function(t) { + var e = new MatrixArray(4); + return t && (e[0] = t[0], + e[1] = t[1], + e[2] = t[2], + e[3] = t[3]), + e +} +, +quat4.set = function(t, e) { + return e[0] = t[0], + e[1] = t[1], + e[2] = t[2], + e[3] = t[3], + e +} +, +quat4.calculateW = function(t, e) { + var i = t[0] + , s = t[1] + , n = t[2]; + return e && t !== e ? (e[0] = i, + e[1] = s, + e[2] = n, + e[3] = -Math.sqrt(Math.abs(1 - i * i - s * s - n * n)), + e) : (t[3] = -Math.sqrt(Math.abs(1 - i * i - s * s - n * n)), + t) +} +, +quat4.inverse = function(t, e) { + return e && t !== e ? (e[0] = -t[0], + e[1] = -t[1], + e[2] = -t[2], + e[3] = t[3], + e) : (t[0] *= -1, + t[1] *= -1, + t[2] *= -1, + t) +} +, +quat4.length = function(t) { + var e = t[0] + , i = t[1] + , s = t[2] + , t = t[3]; + return Math.sqrt(e * e + i * i + s * s + t * t) +} +, +quat4.normalize = function(t, e) { + e = e || t; + var i = t[0] + , s = t[1] + , n = t[2] + , r = t[3] + , t = Math.sqrt(i * i + s * s + n * n + r * r); + return 0 === t ? (e[0] = 0, + e[1] = 0, + e[2] = 0, + e[3] = 0) : (t = 1 / t, + e[0] = i * t, + e[1] = s * t, + e[2] = n * t, + e[3] = r * t), + e +} +, +quat4.multiply = function(t, e, i) { + i = i || t; + var s = t[0] + , n = t[1] + , r = t[2] + , t = t[3] + , o = e[0] + , a = e[1] + , h = e[2] + , e = e[3]; + return i[0] = s * e + t * o + n * h - r * a, + i[1] = n * e + t * a + r * o - s * h, + i[2] = r * e + t * h + s * a - n * o, + i[3] = t * e - s * o - n * a - r * h, + i +} +, +quat4.multiplyVec3 = function(t, e, i) { + i = i || e; + var s = e[0] + , n = e[1] + , r = e[2] + , e = t[0] + , o = t[1] + , a = t[2] + , h = (t = t[3]) * s + o * r - a * n + , c = t * n + a * s - e * r + , l = t * r + e * n - o * s + , s = -e * s - o * n - a * r; + return i[0] = h * t + s * -e + c * -a - l * -o, + i[1] = c * t + s * -o + l * -e - h * -a, + i[2] = l * t + s * -a + h * -o - c * -e, + i +} +, +quat4.toMat3 = function(t, e) { + e = e || mat3.create(); + var i = t[0] + , s = t[1] + , n = t[2] + , r = t[3] + , o = i + i + , a = s + s + , h = n + n + , c = i * o + , l = i * a; + i *= h; + t = s * a; + return s *= h, + n *= h, + o *= r, + a *= r, + r *= h, + e[0] = 1 - (t + n), + e[1] = l + r, + e[2] = i - a, + e[3] = l - r, + e[4] = 1 - (c + n), + e[5] = s + o, + e[6] = i + a, + e[7] = s - o, + e[8] = 1 - (c + t), + e +} +, +quat4.toMat4 = function(t, e) { + e = e || mat4.create(); + var i = t[0] + , s = t[1] + , n = t[2] + , r = t[3] + , o = i + i + , a = s + s + , h = n + n + , c = i * o + , l = i * a; + i *= h; + t = s * a; + return s *= h, + n *= h, + o *= r, + a *= r, + r *= h, + e[0] = 1 - (t + n), + e[1] = l + r, + e[2] = i - a, + e[3] = 0, + e[4] = l - r, + e[5] = 1 - (c + n), + e[6] = s + o, + e[7] = 0, + e[8] = i + a, + e[9] = s - o, + e[10] = 1 - (c + t), + e[11] = 0, + e[12] = 0, + e[13] = 0, + e[14] = 0, + e[15] = 1, + e +} +, +quat4.slerp = function(t, e, i, s) { + s = s || t; + var n, r, o = t[0] * e[0] + t[1] * e[1] + t[2] * e[2] + t[3] * e[3]; + return 1 <= Math.abs(o) ? (s !== t && (s[0] = t[0], + s[1] = t[1], + s[2] = t[2], + s[3] = t[3]), + s) : (n = Math.acos(o), + r = Math.sqrt(1 - o * o), + Math.abs(r) < .001 ? (s[0] = .5 * t[0] + .5 * e[0], + s[1] = .5 * t[1] + .5 * e[1], + s[2] = .5 * t[2] + .5 * e[2], + s[3] = .5 * t[3] + .5 * e[3]) : (o = Math.sin((1 - i) * n) / r, + i = Math.sin(i * n) / r, + s[0] = t[0] * o + e[0] * i, + s[1] = t[1] * o + e[1] * i, + s[2] = t[2] * o + e[2] * i, + s[3] = t[3] * o + e[3] * i), + s) +} +, +quat4.str = function(t) { + return "[" + t[0] + ", " + t[1] + ", " + t[2] + ", " + t[3] + "]" +} +, +function() { + var i = mat4.create(); + function t(t, e, i) { + this.isIE = /msie/i.test(navigator.userAgent) || /trident/i.test(navigator.userAgent), + this.width = 0, + this.height = 0, + this.enableFrontToBack = !!i, + this.isEarlyZPass = !1, + this.isBatchInEarlyZPass = !1, + this.currentZ = 0, + this.zNear = 1, + this.zFar = 1e3, + this.zIncrement = (this.zFar - this.zNear) / 32768, + this.zA = this.zFar / (this.zFar - this.zNear), + this.zB = this.zFar * this.zNear / (this.zNear - this.zFar), + this.kzA = 65536 * this.zA, + this.kzB = 65536 * this.zB, + this.cam = vec3.create([0, 0, 100]), + this.look = vec3.create([0, 0, 0]), + this.up = vec3.create([0, 1, 0]), + this.worldScale = vec3.create([1, 1, 1]), + this.enable_mipmaps = !0, + this.matP = mat4.create(), + this.matMV = mat4.create(), + this.lastMV = mat4.create(), + this.currentMV = mat4.create(), + this.gl = t, + this.version = 0 === this.gl.getParameter(this.gl.VERSION).indexOf("WebGL 2") ? 2 : 1, + this.initState() + } + function u(t, e, i) { + this.gl = t, + this.shaderProgram = e, + this.name = i, + this.locAPos = t.getAttribLocation(e, "aPos"), + this.locATex = t.getAttribLocation(e, "aTex"), + this.locMatP = t.getUniformLocation(e, "matP"), + this.locMatMV = t.getUniformLocation(e, "matMV"), + this.locOpacity = t.getUniformLocation(e, "opacity"), + this.locColorFill = t.getUniformLocation(e, "colorFill"), + this.locSamplerFront = t.getUniformLocation(e, "samplerFront"), + this.locSamplerBack = t.getUniformLocation(e, "samplerBack"), + this.locDestStart = t.getUniformLocation(e, "destStart"), + this.locDestEnd = t.getUniformLocation(e, "destEnd"), + this.locSeconds = t.getUniformLocation(e, "seconds"), + this.locPixelWidth = t.getUniformLocation(e, "pixelWidth"), + this.locPixelHeight = t.getUniformLocation(e, "pixelHeight"), + this.locLayerScale = t.getUniformLocation(e, "layerScale"), + this.locLayerAngle = t.getUniformLocation(e, "layerAngle"), + this.locViewOrigin = t.getUniformLocation(e, "viewOrigin"), + this.locScrollPos = t.getUniformLocation(e, "scrollPos"), + this.hasAnyOptionalUniforms = !!(this.locPixelWidth || this.locPixelHeight || this.locSeconds || this.locSamplerBack || this.locDestStart || this.locDestEnd || this.locLayerScale || this.locLayerAngle || this.locViewOrigin || this.locScrollPos), + this.lpPixelWidth = -999, + this.lpPixelHeight = -999, + this.lpOpacity = 1, + this.lpDestStartX = 0, + this.lpDestStartY = 0, + this.lpDestEndX = 1, + this.lpDestEndY = 1, + this.lpLayerScale = 1, + this.lpLayerAngle = 0, + this.lpViewOriginX = 0, + this.lpViewOriginY = 0, + this.lpScrollPosX = 0, + this.lpScrollPosY = 0, + this.lpSeconds = 0, + this.lastCustomParams = [], + this.lpMatMV = mat4.create(), + this.locOpacity && t.uniform1f(this.locOpacity, 1), + this.locColorFill && t.uniform4f(this.locColorFill, 1, 1, 1, 1), + this.locSamplerFront && t.uniform1i(this.locSamplerFront, 0), + this.locSamplerBack && t.uniform1i(this.locSamplerBack, 1), + this.locDestStart && t.uniform2f(this.locDestStart, 0, 0), + this.locDestEnd && t.uniform2f(this.locDestEnd, 1, 1), + this.locLayerScale && t.uniform1f(this.locLayerScale, 1), + this.locLayerAngle && t.uniform1f(this.locLayerAngle, 0), + this.locViewOrigin && t.uniform2f(this.locViewOrigin, 0, 0), + this.locScrollPos && t.uniform2f(this.locScrollPos, 0, 0), + this.locSeconds && t.uniform1f(this.locSeconds, 0), + this.hasCurrentMatMV = !1 + } + function e(t, e) { + return 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[6] === e[6] && t[7] === e[7] && t[8] === e[8] && t[9] === e[9] && t[10] === e[10] && t[11] === e[11] && t[12] === e[12] && t[13] === e[13] && t[14] === e[14] && t[15] === e[15] + } + function s(t, e) { + this.type = t, + this.glwrap = e, + this.gl = e.gl, + this.opacityParam = 0, + this.startIndex = 0, + this.indexCount = 0, + this.texParam = null, + this.mat4param = null, + this.shaderParams = [], + cr.seal(this) + } + t.prototype.initState = function() { + var t = this.gl; + for (this.lastOpacity = 1, + this.lastTexture0 = null, + this.lastTexture1 = null, + this.currentOpacity = 1, + t.clearColor(0, 0, 0, 0), + t.clear(t.COLOR_BUFFER_BIT), + t.enable(t.BLEND), + t.blendFunc(t.ONE, t.ONE_MINUS_SRC_ALPHA), + t.disable(t.CULL_FACE), + t.disable(t.STENCIL_TEST), + t.disable(t.DITHER), + this.enableFrontToBack ? (t.enable(t.DEPTH_TEST), + t.depthFunc(t.LEQUAL)) : t.disable(t.DEPTH_TEST), + this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE), + this.lastSrcBlend = t.ONE, + this.lastDestBlend = t.ONE_MINUS_SRC_ALPHA, + this.vertexData = new Float32Array(8e3 * (this.enableFrontToBack ? 3 : 2)), + this.texcoordData = new Float32Array(16e3), + this.pointData = new Float32Array(32e3), + this.pointBuffer = t.createBuffer(), + t.bindBuffer(t.ARRAY_BUFFER, this.pointBuffer), + t.bufferData(t.ARRAY_BUFFER, this.pointData.byteLength, t.DYNAMIC_DRAW), + this.vertexBuffers = new Array(4), + this.texcoordBuffers = new Array(4), + n = 0; n < 4; n++) + this.vertexBuffers[n] = t.createBuffer(), + t.bindBuffer(t.ARRAY_BUFFER, this.vertexBuffers[n]), + t.bufferData(t.ARRAY_BUFFER, this.vertexData.byteLength, t.DYNAMIC_DRAW), + this.texcoordBuffers[n] = t.createBuffer(), + t.bindBuffer(t.ARRAY_BUFFER, this.texcoordBuffers[n]), + t.bufferData(t.ARRAY_BUFFER, this.texcoordData.byteLength, t.DYNAMIC_DRAW); + this.curBuffer = 0, + this.indexBuffer = t.createBuffer(), + t.bindBuffer(t.ELEMENT_ARRAY_BUFFER, this.indexBuffer); + for (var e, i, s = new Uint16Array(12e3), n = 0, r = 0; n < 12e3; ) + s[n++] = r, + s[n++] = r + 1, + s[n++] = r + 2, + s[n++] = r, + s[n++] = r + 2, + s[n++] = r + 3, + r += 4; + t.bufferData(t.ELEMENT_ARRAY_BUFFER, s, t.STATIC_DRAW), + this.vertexPtr = 0, + this.texPtr = 0, + this.pointPtr = 0, + this.shaderPrograms = [], + e = ["varying mediump vec2 vTex;", "uniform lowp float opacity;", "uniform lowp sampler2D samplerFront;", "void main(void) {", "\tgl_FragColor = texture2D(samplerFront, vTex);", "\tgl_FragColor *= opacity;", "}"].join("\n"), + i = (this.enableFrontToBack ? ["attribute highp vec3 aPos;", "attribute mediump vec2 aTex;", "varying mediump vec2 vTex;", "uniform highp mat4 matP;", "uniform highp mat4 matMV;", "void main(void) {", "\tgl_Position = matP * matMV * vec4(aPos.x, aPos.y, aPos.z, 1.0);", "\tvTex = aTex;", "}"] : ["attribute highp vec2 aPos;", "attribute mediump vec2 aTex;", "varying mediump vec2 vTex;", "uniform highp mat4 matP;", "uniform highp mat4 matMV;", "void main(void) {", "\tgl_Position = matP * matMV * vec4(aPos.x, aPos.y, 0.0, 1.0);", "\tvTex = aTex;", "}"]).join("\n"); + var o = this.createShaderProgram({ + src: e + }, i, ""); + this.shaderPrograms.push(o), + e = ["uniform mediump sampler2D samplerFront;", "varying lowp float opacity;", "void main(void) {", "\tgl_FragColor = texture2D(samplerFront, gl_PointCoord);", "\tgl_FragColor *= opacity;", "}"].join("\n"); + var a = ["attribute vec4 aPos;", "varying float opacity;", "uniform mat4 matP;", "uniform mat4 matMV;", "void main(void) {", "\tgl_Position = matP * matMV * vec4(aPos.x, aPos.y, 0.0, 1.0);", "\tgl_PointSize = aPos.z;", "\topacity = aPos.w;", "}"].join("\n"); + o = this.createShaderProgram({ + src: e + }, a, ""), + this.shaderPrograms.push(o), + e = ["varying mediump vec2 vTex;", "uniform lowp sampler2D samplerFront;", "void main(void) {", "\tif (texture2D(samplerFront, vTex).a < 1.0)", "\t\tdiscard;", "}"].join("\n"); + o = this.createShaderProgram({ + src: e + }, i, ""); + this.shaderPrograms.push(o), + e = ["uniform lowp vec4 colorFill;", "void main(void) {", "\tgl_FragColor = colorFill;", "}"].join("\n"); + var h, o = this.createShaderProgram({ + src: e + }, i, ""); + for (h in this.shaderPrograms.push(o), + cr.shaders) + cr.shaders.hasOwnProperty(h) && this.shaderPrograms.push(this.createShaderProgram(cr.shaders[h], i, h)); + t.activeTexture(t.TEXTURE0), + t.bindTexture(t.TEXTURE_2D, null), + this.batch = [], + this.batchPtr = 0, + this.hasQuadBatchTop = !1, + this.hasPointBatchTop = !1, + this.lastProgram = -1, + this.currentProgram = -1, + this.currentShader = null, + this.fbo = t.createFramebuffer(), + this.renderToTex = null, + this.depthBuffer = null, + this.attachedDepthBuffer = !1, + this.enableFrontToBack && (this.depthBuffer = t.createRenderbuffer()), + this.tmpVec3 = vec3.create([0, 0, 0]); + o = t.getParameter(t.ALIASED_POINT_SIZE_RANGE); + this.minPointSize = o[0], + this.maxPointSize = o[1], + 2048 < this.maxPointSize && (this.maxPointSize = 2048), + this.switchProgram(0), + cr.seal(this) + } + , + u.prototype.updateMatMV = function(t) { + e(this.lpMatMV, t) || (mat4.set(t, this.lpMatMV), + this.gl.uniformMatrix4fv(this.locMatMV, !1, t)) + } + , + t.prototype.createShaderProgram = function(t, e, i) { + var s = this.gl + , n = s.createShader(s.FRAGMENT_SHADER); + if (s.shaderSource(n, t.src), + s.compileShader(n), + !s.getShaderParameter(n, s.COMPILE_STATUS)) { + var r = s.getShaderInfoLog(n); + throw s.deleteShader(n), + new Error("error compiling fragment shader: " + r) + } + var o = s.createShader(s.VERTEX_SHADER); + if (s.shaderSource(o, e), + s.compileShader(o), + !s.getShaderParameter(o, s.COMPILE_STATUS)) { + r = s.getShaderInfoLog(o); + throw s.deleteShader(n), + s.deleteShader(o), + new Error("error compiling vertex shader: " + r) + } + var a = s.createProgram(); + if (s.attachShader(a, n), + s.attachShader(a, o), + s.linkProgram(a), + !s.getProgramParameter(a, s.LINK_STATUS)) { + r = s.getProgramInfoLog(a); + throw s.deleteShader(n), + s.deleteShader(o), + s.deleteProgram(a), + new Error("error linking shader program: " + r) + } + s.useProgram(a), + s.deleteShader(n), + s.deleteShader(o); + var h, c, l = new u(s,a,i); + for (l.extendBoxHorizontal = t.extendBoxHorizontal || 0, + l.extendBoxVertical = t.extendBoxVertical || 0, + l.crossSampling = !!t.crossSampling, + l.preservesOpaqueness = !!t.preservesOpaqueness, + l.animated = !!t.animated, + l.parameters = t.parameters || [], + h = 0, + c = l.parameters.length; h < c; h++) + l.parameters[h][1] = s.getUniformLocation(a, l.parameters[h][0]), + l.lastCustomParams.push(0), + s.uniform1f(l.parameters[h][1], 0); + return cr.seal(l), + l + } + , + t.prototype.getShaderIndex = function(t) { + for (var e = 0, i = this.shaderPrograms.length; e < i; e++) + if (this.shaderPrograms[e].name === t) + return e; + return -1 + } + , + t.prototype.project = function(t, e, i) { + var s = this.matMV + , n = this.matP + , r = [0, 0, 0, 0, 0, 0, 0, 0]; + r[0] = s[0] * t + s[4] * e + s[12], + r[1] = s[1] * t + s[5] * e + s[13], + r[2] = s[2] * t + s[6] * e + s[14], + r[3] = s[3] * t + s[7] * e + s[15], + r[4] = n[0] * r[0] + n[4] * r[1] + n[8] * r[2] + n[12] * r[3], + r[5] = n[1] * r[0] + n[5] * r[1] + n[9] * r[2] + n[13] * r[3], + r[6] = n[2] * r[0] + n[6] * r[1] + n[10] * r[2] + n[14] * r[3], + r[7] = -r[2], + 0 !== r[7] && (r[7] = 1 / r[7], + r[4] *= r[7], + r[5] *= r[7], + r[6] *= r[7], + i[0] = (.5 * r[4] + .5) * this.width, + i[1] = (.5 * r[5] + .5) * this.height) + } + , + t.prototype.setSize = function(t, e, i) { + if (this.width !== t || this.height !== e || i) { + this.endBatch(); + var s, n, r, o = this.gl; + for (this.width = t, + this.height = e, + o.viewport(0, 0, t, e), + mat4.lookAt(this.cam, this.look, this.up, this.matMV), + this.enableFrontToBack ? (mat4.ortho(-t / 2, t / 2, e / 2, -e / 2, this.zNear, this.zFar, this.matP), + this.worldScale[0] = 1, + this.worldScale[1] = 1) : (mat4.perspective(45, t / e, this.zNear, this.zFar, this.matP), + t = [0, 0], + e = [0, 0], + this.project(0, 0, t), + this.project(1, 1, e), + this.worldScale[0] = 1 / (e[0] - t[0]), + this.worldScale[1] = -1 / (e[1] - t[1])), + s = 0, + n = this.shaderPrograms.length; s < n; s++) + (r = this.shaderPrograms[s]).hasCurrentMatMV = !1, + r.locMatP && (o.useProgram(r.shaderProgram), + o.uniformMatrix4fv(r.locMatP, !1, this.matP)); + o.useProgram(this.shaderPrograms[this.lastProgram].shaderProgram), + o.bindTexture(o.TEXTURE_2D, null), + o.activeTexture(o.TEXTURE1), + o.bindTexture(o.TEXTURE_2D, null), + o.activeTexture(o.TEXTURE0), + this.lastTexture0 = null, + this.lastTexture1 = null, + this.depthBuffer && (o.bindFramebuffer(o.FRAMEBUFFER, this.fbo), + o.bindRenderbuffer(o.RENDERBUFFER, this.depthBuffer), + o.renderbufferStorage(o.RENDERBUFFER, o.DEPTH_COMPONENT16, this.width, this.height), + this.attachedDepthBuffer || (o.framebufferRenderbuffer(o.FRAMEBUFFER, o.DEPTH_ATTACHMENT, o.RENDERBUFFER, this.depthBuffer), + this.attachedDepthBuffer = !0), + o.bindRenderbuffer(o.RENDERBUFFER, null), + o.bindFramebuffer(o.FRAMEBUFFER, null), + this.renderToTex = null) + } + } + , + t.prototype.resetModelView = function() { + mat4.lookAt(this.cam, this.look, this.up, this.matMV), + mat4.scale(this.matMV, this.worldScale) + } + , + t.prototype.translate = function(t, e) { + 0 === t && 0 === e || (this.tmpVec3[0] = t, + this.tmpVec3[1] = e, + this.tmpVec3[2] = 0, + mat4.translate(this.matMV, this.tmpVec3)) + } + , + t.prototype.scale = function(t, e) { + 1 === t && 1 === e || (this.tmpVec3[0] = t, + this.tmpVec3[1] = e, + this.tmpVec3[2] = 1, + mat4.scale(this.matMV, this.tmpVec3)) + } + , + t.prototype.rotateZ = function(t) { + 0 !== t && mat4.rotateZ(this.matMV, t) + } + , + t.prototype.updateModelView = function() { + var t; + e(this.lastMV, this.matMV) || ((t = this.pushBatch()).type = 5, + t.mat4param ? mat4.set(this.matMV, t.mat4param) : t.mat4param = mat4.create(this.matMV), + mat4.set(this.matMV, this.lastMV), + this.hasQuadBatchTop = !1, + this.hasPointBatchTop = !1) + } + , + t.prototype.setEarlyZIndex = function(t) { + this.enableFrontToBack && (32760 < t && (t = 32760), + this.currentZ = this.cam[2] - this.zNear - t * this.zIncrement) + } + , + s.prototype.doSetEarlyZPass = function() { + var t = this.gl + , e = this.glwrap; + 0 !== this.startIndex ? (t.depthMask(!0), + t.colorMask(!1, !1, !1, !1), + t.disable(t.BLEND), + t.bindFramebuffer(t.FRAMEBUFFER, e.fbo), + t.framebufferTexture2D(t.FRAMEBUFFER, t.COLOR_ATTACHMENT0, t.TEXTURE_2D, null, 0), + t.clear(t.DEPTH_BUFFER_BIT), + t.bindFramebuffer(t.FRAMEBUFFER, null), + e.isBatchInEarlyZPass = !0) : (t.depthMask(!1), + t.colorMask(!0, !0, !0, !0), + t.enable(t.BLEND), + e.isBatchInEarlyZPass = !1) + } + , + s.prototype.doSetTexture = function() { + this.gl.bindTexture(this.gl.TEXTURE_2D, this.texParam) + } + , + s.prototype.doSetTexture1 = function() { + var t = this.gl; + t.activeTexture(t.TEXTURE1), + t.bindTexture(t.TEXTURE_2D, this.texParam), + t.activeTexture(t.TEXTURE0) + } + , + s.prototype.doSetOpacity = function() { + var t = this.opacityParam + , e = this.glwrap; + e.currentOpacity = t; + e = e.currentShader; + e.locOpacity && e.lpOpacity !== t && (e.lpOpacity = t, + this.gl.uniform1f(e.locOpacity, t)) + } + , + s.prototype.doQuad = function() { + this.gl.drawElements(this.gl.TRIANGLES, this.indexCount, this.gl.UNSIGNED_SHORT, this.startIndex) + } + , + s.prototype.doSetBlend = function() { + this.gl.blendFunc(this.startIndex, this.indexCount) + } + , + s.prototype.doUpdateModelView = function() { + for (var t, e = this.glwrap.shaderPrograms, i = this.glwrap.currentProgram, s = 0, n = e.length; s < n; s++) + t = e[s], + s === i && t.locMatMV ? (t.updateMatMV(this.mat4param), + t.hasCurrentMatMV = !0) : t.hasCurrentMatMV = !1; + mat4.set(this.mat4param, this.glwrap.currentMV) + } + , + s.prototype.doRenderToTexture = function() { + var t = this.gl + , e = this.glwrap; + this.texParam ? (e.lastTexture1 === this.texParam && (t.activeTexture(t.TEXTURE1), + t.bindTexture(t.TEXTURE_2D, null), + e.lastTexture1 = null, + t.activeTexture(t.TEXTURE0)), + t.bindFramebuffer(t.FRAMEBUFFER, e.fbo), + e.isBatchInEarlyZPass || t.framebufferTexture2D(t.FRAMEBUFFER, t.COLOR_ATTACHMENT0, t.TEXTURE_2D, this.texParam, 0)) : (e.enableFrontToBack || t.framebufferTexture2D(t.FRAMEBUFFER, t.COLOR_ATTACHMENT0, t.TEXTURE_2D, null, 0), + t.bindFramebuffer(t.FRAMEBUFFER, null)) + } + , + s.prototype.doClear = function() { + var t = this.gl + , e = this.startIndex; + 0 === e ? (t.clearColor(this.mat4param[0], this.mat4param[1], this.mat4param[2], this.mat4param[3]), + t.clear(t.COLOR_BUFFER_BIT)) : 1 === e ? (t.enable(t.SCISSOR_TEST), + t.scissor(this.mat4param[0], this.mat4param[1], this.mat4param[2], this.mat4param[3]), + t.clearColor(0, 0, 0, 0), + t.clear(t.COLOR_BUFFER_BIT), + t.disable(t.SCISSOR_TEST)) : t.clear(t.DEPTH_BUFFER_BIT) + } + , + s.prototype.doSetDepthTestEnabled = function() { + var t = this.gl; + 0 !== this.startIndex ? t.enable(t.DEPTH_TEST) : t.disable(t.DEPTH_TEST) + } + , + s.prototype.doPoints = function() { + var t = this.gl + , e = this.glwrap; + e.enableFrontToBack && t.disable(t.DEPTH_TEST); + var i = e.shaderPrograms[1]; + t.useProgram(i.shaderProgram), + !i.hasCurrentMatMV && i.locMatMV && (i.updateMatMV(e.currentMV), + i.hasCurrentMatMV = !0), + t.enableVertexAttribArray(i.locAPos), + t.bindBuffer(t.ARRAY_BUFFER, e.pointBuffer), + t.vertexAttribPointer(i.locAPos, 4, t.FLOAT, !1, 0, 0), + t.drawArrays(t.POINTS, this.startIndex / 4, this.indexCount), + i = e.currentShader, + t.useProgram(i.shaderProgram), + 0 <= i.locAPos && (t.enableVertexAttribArray(i.locAPos), + t.bindBuffer(t.ARRAY_BUFFER, e.vertexBuffers[e.curBuffer]), + t.vertexAttribPointer(i.locAPos, e.enableFrontToBack ? 3 : 2, t.FLOAT, !1, 0, 0)), + 0 <= i.locATex && (t.enableVertexAttribArray(i.locATex), + t.bindBuffer(t.ARRAY_BUFFER, e.texcoordBuffers[e.curBuffer]), + t.vertexAttribPointer(i.locATex, 2, t.FLOAT, !1, 0, 0)), + e.enableFrontToBack && t.enable(t.DEPTH_TEST) + } + , + s.prototype.doSetProgram = function() { + var t = this.gl + , e = this.glwrap + , i = e.shaderPrograms[this.startIndex]; + e.currentProgram = this.startIndex, + e.currentShader = i, + t.useProgram(i.shaderProgram), + !i.hasCurrentMatMV && i.locMatMV && (i.updateMatMV(e.currentMV), + i.hasCurrentMatMV = !0), + i.locOpacity && i.lpOpacity !== e.currentOpacity && (i.lpOpacity = e.currentOpacity, + t.uniform1f(i.locOpacity, e.currentOpacity)), + 0 <= i.locAPos && (t.enableVertexAttribArray(i.locAPos), + t.bindBuffer(t.ARRAY_BUFFER, e.vertexBuffers[e.curBuffer]), + t.vertexAttribPointer(i.locAPos, e.enableFrontToBack ? 3 : 2, t.FLOAT, !1, 0, 0)), + 0 <= i.locATex && (t.enableVertexAttribArray(i.locATex), + t.bindBuffer(t.ARRAY_BUFFER, e.texcoordBuffers[e.curBuffer]), + t.vertexAttribPointer(i.locATex, 2, t.FLOAT, !1, 0, 0)) + } + , + s.prototype.doSetColor = function() { + var t = this.glwrap.currentShader + , e = this.mat4param; + this.gl.uniform4f(t.locColorFill, e[0], e[1], e[2], e[3]) + } + , + s.prototype.doSetProgramParameters = function() { + var t, e, i = this.glwrap.currentShader, s = this.gl, n = this.mat4param; + i.locSamplerBack && this.glwrap.lastTexture1 !== this.texParam && (s.activeTexture(s.TEXTURE1), + s.bindTexture(s.TEXTURE_2D, this.texParam), + this.glwrap.lastTexture1 = this.texParam, + s.activeTexture(s.TEXTURE0)); + var r, o = n[0]; + if (i.locPixelWidth && o !== i.lpPixelWidth && (i.lpPixelWidth = o, + s.uniform1f(i.locPixelWidth, o)), + o = n[1], + i.locPixelHeight && o !== i.lpPixelHeight && (i.lpPixelHeight = o, + s.uniform1f(i.locPixelHeight, o)), + o = n[2], + r = n[3], + !i.locDestStart || o === i.lpDestStartX && r === i.lpDestStartY || (i.lpDestStartX = o, + i.lpDestStartY = r, + s.uniform2f(i.locDestStart, o, r)), + o = n[4], + r = n[5], + !i.locDestEnd || o === i.lpDestEndX && r === i.lpDestEndY || (i.lpDestEndX = o, + i.lpDestEndY = r, + s.uniform2f(i.locDestEnd, o, r)), + o = n[6], + i.locLayerScale && o !== i.lpLayerScale && (i.lpLayerScale = o, + s.uniform1f(i.locLayerScale, o)), + o = n[7], + i.locLayerAngle && o !== i.lpLayerAngle && (i.lpLayerAngle = o, + s.uniform1f(i.locLayerAngle, o)), + o = n[8], + r = n[9], + !i.locViewOrigin || o === i.lpViewOriginX && r === i.lpViewOriginY || (i.lpViewOriginX = o, + i.lpViewOriginY = r, + s.uniform2f(i.locViewOrigin, o, r)), + o = n[10], + r = n[11], + !i.locScrollPos || o === i.lpScrollPosX && r === i.lpScrollPosY || (i.lpScrollPosX = o, + i.lpScrollPosY = r, + s.uniform2f(i.locScrollPos, o, r)), + o = n[12], + i.locSeconds && o !== i.lpSeconds && (i.lpSeconds = o, + s.uniform1f(i.locSeconds, o)), + i.parameters.length) + for (t = 0, + e = i.parameters.length; t < e; t++) + (o = this.shaderParams[t]) !== i.lastCustomParams[t] && (i.lastCustomParams[t] = o, + s.uniform1f(i.parameters[t][1], o)) + } + , + t.prototype.pushBatch = function() { + return this.batchPtr === this.batch.length && this.batch.push(new s(0,this)), + this.batch[this.batchPtr++] + } + , + t.prototype.endBatch = function() { + if (0 !== this.batchPtr && !this.gl.isContextLost()) { + var t, e, i, s, n = this.gl; + for (0 < this.pointPtr && (n.bindBuffer(n.ARRAY_BUFFER, this.pointBuffer), + n.bufferSubData(n.ARRAY_BUFFER, 0, this.pointData.subarray(0, this.pointPtr)), + t && 0 <= t.locAPos && "" === t.name && n.vertexAttribPointer(t.locAPos, 4, n.FLOAT, !1, 0, 0)), + 0 < this.vertexPtr && (t = this.currentShader, + n.bindBuffer(n.ARRAY_BUFFER, this.vertexBuffers[this.curBuffer]), + n.bufferSubData(n.ARRAY_BUFFER, 0, this.vertexData.subarray(0, this.vertexPtr)), + t && 0 <= t.locAPos && "" !== t.name && n.vertexAttribPointer(t.locAPos, this.enableFrontToBack ? 3 : 2, n.FLOAT, !1, 0, 0), + n.bindBuffer(n.ARRAY_BUFFER, this.texcoordBuffers[this.curBuffer]), + n.bufferSubData(n.ARRAY_BUFFER, 0, this.texcoordData.subarray(0, this.texPtr)), + t && 0 <= t.locATex && "" !== t.name && n.vertexAttribPointer(t.locATex, 2, n.FLOAT, !1, 0, 0)), + e = 0, + i = this.batchPtr; e < i; e++) + switch ((s = this.batch[e]).type) { + case 1: + s.doQuad(); + break; + case 2: + s.doSetTexture(); + break; + case 3: + s.doSetOpacity(); + break; + case 4: + s.doSetBlend(); + break; + case 5: + s.doUpdateModelView(); + break; + case 6: + s.doRenderToTexture(); + break; + case 7: + s.doClear(); + break; + case 8: + s.doPoints(); + break; + case 9: + s.doSetProgram(); + break; + case 10: + s.doSetProgramParameters(); + break; + case 11: + s.doSetTexture1(); + break; + case 12: + s.doSetColor(); + break; + case 13: + s.doSetDepthTestEnabled(); + break; + case 14: + s.doSetEarlyZPass() + } + this.batchPtr = 0, + this.vertexPtr = 0, + this.texPtr = 0, + this.pointPtr = 0, + this.hasQuadBatchTop = !1, + this.hasPointBatchTop = !1, + this.isBatchInEarlyZPass = !1, + this.curBuffer++, + 4 <= this.curBuffer && (this.curBuffer = 0) + } + } + , + t.prototype.setOpacity = function(t) { + var e; + t !== this.lastOpacity && (this.isEarlyZPass || ((e = this.pushBatch()).type = 3, + e.opacityParam = t, + this.lastOpacity = t, + this.hasQuadBatchTop = !1, + this.hasPointBatchTop = !1)) + } + , + t.prototype.setTexture = function(t) { + var e; + t !== this.lastTexture0 && ((e = this.pushBatch()).type = 2, + e.texParam = t, + this.lastTexture0 = t, + this.hasQuadBatchTop = !1, + this.hasPointBatchTop = !1) + } + , + t.prototype.setBlend = function(t, e) { + var i; + t === this.lastSrcBlend && e === this.lastDestBlend || this.isEarlyZPass || ((i = this.pushBatch()).type = 4, + i.startIndex = t, + i.indexCount = e, + this.lastSrcBlend = t, + this.lastDestBlend = e, + this.hasQuadBatchTop = !1, + this.hasPointBatchTop = !1) + } + , + t.prototype.isPremultipliedAlphaBlend = function() { + return this.lastSrcBlend === this.gl.ONE && this.lastDestBlend === this.gl.ONE_MINUS_SRC_ALPHA + } + , + t.prototype.setAlphaBlend = function() { + this.setBlend(this.gl.ONE, this.gl.ONE_MINUS_SRC_ALPHA) + } + , + t.prototype.setNoPremultiplyAlphaBlend = function() { + this.setBlend(this.gl.SRC_ALPHA, this.gl.ONE_MINUS_SRC_ALPHA) + } + , + t.prototype.quad = function(t, e, i, s, n, r, o, a) { + 15992 <= this.vertexPtr && this.endBatch(); + var h, c = this.vertexPtr, l = this.texPtr, u = this.vertexData, p = this.texcoordData, d = this.currentZ; + this.hasQuadBatchTop ? this.batch[this.batchPtr - 1].indexCount += 6 : ((h = this.pushBatch()).type = 1, + h.startIndex = this.enableFrontToBack ? c : c / 2 * 3, + h.indexCount = 6, + this.hasQuadBatchTop = !0, + this.hasPointBatchTop = !1), + this.enableFrontToBack ? (u[c++] = t, + u[c++] = e, + u[c++] = d, + u[c++] = i, + u[c++] = s, + u[c++] = d, + u[c++] = n, + u[c++] = r, + u[c++] = d, + u[c++] = o, + u[c++] = a, + u[c++] = d) : (u[c++] = t, + u[c++] = e, + u[c++] = i, + u[c++] = s, + u[c++] = n, + u[c++] = r, + u[c++] = o, + u[c++] = a), + p[l++] = 0, + p[l++] = 0, + p[l++] = 1, + p[l++] = 0, + p[l++] = 1, + p[l++] = 1, + p[l++] = 0, + p[l++] = 1, + this.vertexPtr = c, + this.texPtr = l + } + , + t.prototype.quadTex = function(t, e, i, s, n, r, o, a, h) { + 15992 <= this.vertexPtr && this.endBatch(); + var c = this.vertexPtr + , l = this.texPtr + , u = this.vertexData + , p = this.texcoordData + , d = this.currentZ; + this.hasQuadBatchTop ? this.batch[this.batchPtr - 1].indexCount += 6 : ((g = this.pushBatch()).type = 1, + g.startIndex = this.enableFrontToBack ? c : c / 2 * 3, + g.indexCount = 6, + this.hasQuadBatchTop = !0, + this.hasPointBatchTop = !1); + var f = h.left + , y = h.top + , g = h.right + , h = h.bottom; + this.enableFrontToBack ? (u[c++] = t, + u[c++] = e, + u[c++] = d, + u[c++] = i, + u[c++] = s, + u[c++] = d, + u[c++] = n, + u[c++] = r, + u[c++] = d, + u[c++] = o, + u[c++] = a, + u[c++] = d) : (u[c++] = t, + u[c++] = e, + u[c++] = i, + u[c++] = s, + u[c++] = n, + u[c++] = r, + u[c++] = o, + u[c++] = a), + p[l++] = f, + p[l++] = y, + p[l++] = g, + p[l++] = y, + p[l++] = g, + p[l++] = h, + p[l++] = f, + p[l++] = h, + this.vertexPtr = c, + this.texPtr = l + } + , + t.prototype.quadTexUV = function(t, e, i, s, n, r, o, a, h, c, l, u, p, d, f, y) { + 15992 <= this.vertexPtr && this.endBatch(); + var g, m = this.vertexPtr, _ = this.texPtr, v = this.vertexData, b = this.texcoordData, w = this.currentZ; + this.hasQuadBatchTop ? this.batch[this.batchPtr - 1].indexCount += 6 : ((g = this.pushBatch()).type = 1, + g.startIndex = this.enableFrontToBack ? m : m / 2 * 3, + g.indexCount = 6, + this.hasQuadBatchTop = !0, + this.hasPointBatchTop = !1), + this.enableFrontToBack ? (v[m++] = t, + v[m++] = e, + v[m++] = w, + v[m++] = i, + v[m++] = s, + v[m++] = w, + v[m++] = n, + v[m++] = r, + v[m++] = w, + v[m++] = o, + v[m++] = a, + v[m++] = w) : (v[m++] = t, + v[m++] = e, + v[m++] = i, + v[m++] = s, + v[m++] = n, + v[m++] = r, + v[m++] = o, + v[m++] = a), + b[_++] = h, + b[_++] = c, + b[_++] = l, + b[_++] = u, + b[_++] = p, + b[_++] = d, + b[_++] = f, + b[_++] = y, + this.vertexPtr = m, + this.texPtr = _ + } + , + t.prototype.convexPoly = function(t) { + for (var e, i, s, n, r, o, a = t.length / 2 - 2, h = a - 1, c = t[0], l = t[1], u = 0; u < a; u += 2) + e = t[2 + (o = 2 * u)], + i = t[3 + o], + s = t[4 + o], + n = t[5 + o], + u === h ? this.quad(c, l, e, i, s, n, s, n) : (r = t[6 + o], + o = t[7 + o], + this.quad(c, l, e, i, s, n, r, o)) + } + , + t.prototype.point = function(t, e, i, s) { + 7996 <= this.pointPtr && this.endBatch(); + var n, r = this.pointPtr, o = this.pointData; + this.hasPointBatchTop ? this.batch[this.batchPtr - 1].indexCount++ : ((n = this.pushBatch()).type = 8, + n.startIndex = r, + n.indexCount = 1, + this.hasPointBatchTop = !0, + this.hasQuadBatchTop = !1), + o[r++] = t, + o[r++] = e, + o[r++] = i, + o[r++] = s, + this.pointPtr = r + } + , + t.prototype.switchProgram = function(t) { + if (this.lastProgram !== t) { + var e = this.shaderPrograms[t]; + if (!e) { + if (0 === this.lastProgram) + return; + t = 0, + e = this.shaderPrograms[0] + } + e = this.pushBatch(); + e.type = 9, + e.startIndex = t, + this.lastProgram = t, + this.hasQuadBatchTop = !1, + this.hasPointBatchTop = !1 + } + } + , + t.prototype.programUsesDest = function(t) { + t = this.shaderPrograms[t]; + return !(!t.locDestStart && !t.locDestEnd) + } + , + t.prototype.programUsesCrossSampling = function(t) { + t = this.shaderPrograms[t]; + return !!(t.locDestStart || t.locDestEnd || t.crossSampling) + } + , + t.prototype.programPreservesOpaqueness = function(t) { + return this.shaderPrograms[t].preservesOpaqueness + } + , + t.prototype.programExtendsBox = function(t) { + t = this.shaderPrograms[t]; + return 0 !== t.extendBoxHorizontal || 0 !== t.extendBoxVertical + } + , + t.prototype.getProgramBoxExtendHorizontal = function(t) { + return this.shaderPrograms[t].extendBoxHorizontal + } + , + t.prototype.getProgramBoxExtendVertical = function(t) { + return this.shaderPrograms[t].extendBoxVertical + } + , + t.prototype.getProgramParameterType = function(t, e) { + return this.shaderPrograms[t].parameters[e][2] + } + , + t.prototype.programIsAnimated = function(t) { + return this.shaderPrograms[t].animated + } + , + t.prototype.setProgramParameters = function(t, e, i, s, n, r, o, a, h, c, l, u, p, d, f) { + var y, g, m, _, v, b = this.shaderPrograms[this.lastProgram]; + if (b.hasAnyOptionalUniforms || f.length) { + if ((m = this.pushBatch()).type = 10, + m.mat4param ? mat4.set(this.matMV, m.mat4param) : m.mat4param = mat4.create(), + (_ = m.mat4param)[0] = e, + _[1] = i, + _[2] = s, + _[3] = n, + _[4] = r, + _[5] = o, + _[6] = a, + _[7] = h, + _[8] = c, + _[9] = l, + _[10] = u, + _[11] = p, + _[12] = d, + b.locSamplerBack ? m.texParam = t : m.texParam = null, + f.length) + for ((v = m.shaderParams).length = f.length, + y = 0, + g = f.length; y < g; y++) + v[y] = f[y]; + this.hasQuadBatchTop = !1, + this.hasPointBatchTop = !1 + } + } + , + t.prototype.clear = function(t, e, i, s) { + var n = this.pushBatch(); + n.type = 7, + n.startIndex = 0, + n.mat4param || (n.mat4param = mat4.create()), + n.mat4param[0] = t, + n.mat4param[1] = e, + n.mat4param[2] = i, + n.mat4param[3] = s, + this.hasQuadBatchTop = !1, + this.hasPointBatchTop = !1 + } + , + t.prototype.clearRect = function(t, e, i, s) { + var n; + i < 0 || s < 0 || ((n = this.pushBatch()).type = 7, + n.startIndex = 1, + n.mat4param || (n.mat4param = mat4.create()), + n.mat4param[0] = t, + n.mat4param[1] = e, + n.mat4param[2] = i, + n.mat4param[3] = s, + this.hasQuadBatchTop = !1, + this.hasPointBatchTop = !1) + } + , + t.prototype.clearDepth = function() { + var t = this.pushBatch(); + t.type = 7, + t.startIndex = 2, + this.hasQuadBatchTop = !1, + this.hasPointBatchTop = !1 + } + , + t.prototype.setEarlyZPass = function(t) { + var e; + this.enableFrontToBack && (t = !!t, + this.isEarlyZPass !== t && ((e = this.pushBatch()).type = 14, + e.startIndex = t ? 1 : 0, + this.hasQuadBatchTop = !1, + this.hasPointBatchTop = !1, + this.isEarlyZPass = t, + this.renderToTex = null, + this.isEarlyZPass ? this.switchProgram(2) : this.switchProgram(0))) + } + , + t.prototype.setDepthTestEnabled = function(t) { + var e; + this.enableFrontToBack && ((e = this.pushBatch()).type = 13, + e.startIndex = t ? 1 : 0, + this.hasQuadBatchTop = !1, + this.hasPointBatchTop = !1) + } + , + t.prototype.fullscreenQuad = function() { + mat4.set(this.lastMV, i), + this.resetModelView(), + this.updateModelView(); + var t = this.width / 2 + , e = this.height / 2; + this.quad(-t, e, t, e, t, -e, -t, -e), + mat4.set(i, this.matMV), + this.updateModelView() + } + , + t.prototype.setColorFillMode = function(t, e, i, s) { + this.switchProgram(3); + var n = this.pushBatch(); + n.type = 12, + n.mat4param || (n.mat4param = mat4.create()), + n.mat4param[0] = t, + n.mat4param[1] = e, + n.mat4param[2] = i, + n.mat4param[3] = s, + this.hasQuadBatchTop = !1, + this.hasPointBatchTop = !1 + } + , + t.prototype.setTextureFillMode = function() { + this.switchProgram(0) + } + , + t.prototype.restoreEarlyZMode = function() { + this.switchProgram(2) + } + , + t.prototype.present = function() { + this.endBatch(), + this.gl.flush() + } + ; + var f = [] + , y = {}; + t.prototype.contextLost = function() { + cr.clearArray(f), + y = {} + } + , + t.prototype.loadTexture = function(t, e, i, s, n, r) { + e = !!e, + i = !!i; + var o = t.src + "," + e + "," + i + (e ? "," + n : "") + , a = null; + if (void 0 !== t.src && y.hasOwnProperty(o)) + return (a = y[o]).c2refcount++, + a; + this.endBatch(); + var h = this.gl + , c = cr.isPOT(t.width) && cr.isPOT(t.height) + , a = h.createTexture(); + h.bindTexture(h.TEXTURE_2D, a), + h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0); + var l, u = h.RGBA, p = h.RGBA, d = h.UNSIGNED_BYTE; + if (s && !this.isIE) + switch (s) { + case 1: + u = h.RGB, + p = h.RGB; + break; + case 2: + d = h.UNSIGNED_SHORT_4_4_4_4; + break; + case 3: + d = h.UNSIGNED_SHORT_5_5_5_1; + break; + case 4: + u = h.RGB, + p = h.RGB, + d = h.UNSIGNED_SHORT_5_6_5 + } + return 1 === this.version && !c && e ? ((l = document.createElement("canvas")).width = cr.nextHighestPowerOfTwo(t.width), + l.height = cr.nextHighestPowerOfTwo(t.height), + void 0 !== (s = l.getContext("2d")).imageSmoothingEnabled ? s.imageSmoothingEnabled = i : (s.webkitImageSmoothingEnabled = i, + s.mozImageSmoothingEnabled = i, + s.msImageSmoothingEnabled = i), + s.drawImage(t, 0, 0, t.width, t.height, 0, 0, l.width, l.height), + h.texImage2D(h.TEXTURE_2D, 0, u, p, d, l)) : h.texImage2D(h.TEXTURE_2D, 0, u, p, d, t), + e ? "repeat-x" === n ? (h.texParameteri(h.TEXTURE_2D, h.TEXTURE_WRAP_S, h.REPEAT), + h.texParameteri(h.TEXTURE_2D, h.TEXTURE_WRAP_T, h.CLAMP_TO_EDGE)) : ("repeat-y" === n ? h.texParameteri(h.TEXTURE_2D, h.TEXTURE_WRAP_S, h.CLAMP_TO_EDGE) : h.texParameteri(h.TEXTURE_2D, h.TEXTURE_WRAP_S, h.REPEAT), + h.texParameteri(h.TEXTURE_2D, h.TEXTURE_WRAP_T, h.REPEAT)) : (h.texParameteri(h.TEXTURE_2D, h.TEXTURE_WRAP_S, h.CLAMP_TO_EDGE), + h.texParameteri(h.TEXTURE_2D, h.TEXTURE_WRAP_T, h.CLAMP_TO_EDGE)), + i ? (h.texParameteri(h.TEXTURE_2D, h.TEXTURE_MAG_FILTER, h.LINEAR), + (c || 2 <= this.version) && this.enable_mipmaps && !r ? (h.texParameteri(h.TEXTURE_2D, h.TEXTURE_MIN_FILTER, h.LINEAR_MIPMAP_LINEAR), + h.generateMipmap(h.TEXTURE_2D)) : h.texParameteri(h.TEXTURE_2D, h.TEXTURE_MIN_FILTER, h.LINEAR)) : (h.texParameteri(h.TEXTURE_2D, h.TEXTURE_MAG_FILTER, h.NEAREST), + h.texParameteri(h.TEXTURE_2D, h.TEXTURE_MIN_FILTER, h.NEAREST)), + h.bindTexture(h.TEXTURE_2D, null), + this.lastTexture0 = null, + a.c2width = t.width, + a.c2height = t.height, + a.c2refcount = 1, + a.c2texkey = o, + f.push(a), + y[o] = a + } + , + t.prototype.createEmptyTexture = function(t, e, i, s, n) { + this.endBatch(); + var r = this.gl; + this.isIE && (s = !1); + var o = r.createTexture(); + return r.bindTexture(r.TEXTURE_2D, o), + r.texImage2D(r.TEXTURE_2D, 0, r.RGBA, t, e, 0, r.RGBA, s ? r.UNSIGNED_SHORT_4_4_4_4 : r.UNSIGNED_BYTE, null), + n ? (r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, r.REPEAT), + r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, r.REPEAT)) : (r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, r.CLAMP_TO_EDGE), + r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, r.CLAMP_TO_EDGE)), + r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, i ? r.LINEAR : r.NEAREST), + r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, i ? r.LINEAR : r.NEAREST), + r.bindTexture(r.TEXTURE_2D, null), + this.lastTexture0 = null, + o.c2width = t, + o.c2height = e, + f.push(o), + o + } + , + t.prototype.videoToTexture = function(t, e, i) { + this.endBatch(); + var s = this.gl; + this.isIE && (i = !1), + s.bindTexture(s.TEXTURE_2D, e), + s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0); + try { + s.texImage2D(s.TEXTURE_2D, 0, s.RGBA, s.RGBA, i ? s.UNSIGNED_SHORT_4_4_4_4 : s.UNSIGNED_BYTE, t) + } catch (t) { + console && console.error && console.error("Error updating WebGL texture: ", t) + } + s.bindTexture(s.TEXTURE_2D, null), + this.lastTexture0 = null + } + , + t.prototype.deleteTexture = function(t) { + t && (void 0 !== t.c2refcount && 1 < t.c2refcount ? t.c2refcount-- : (this.endBatch(), + t === this.lastTexture0 && (this.gl.bindTexture(this.gl.TEXTURE_2D, null), + this.lastTexture0 = null), + t === this.lastTexture1 && (this.gl.activeTexture(this.gl.TEXTURE1), + this.gl.bindTexture(this.gl.TEXTURE_2D, null), + this.gl.activeTexture(this.gl.TEXTURE0), + this.lastTexture1 = null), + cr.arrayFindRemove(f, t), + void 0 !== t.c2texkey && delete y[t.c2texkey], + this.gl.deleteTexture(t))) + } + , + t.prototype.estimateVRAM = function() { + for (var t, e = this.width * this.height * 4 * 2, i = 0, s = f.length; i < s; i++) + e += (t = f[i]).c2width * t.c2height * 4; + return e + } + , + t.prototype.textureCount = function() { + return f.length + } + , + t.prototype.setRenderingToTexture = function(t) { + var e; + t !== this.renderToTex && ((e = this.pushBatch()).type = 6, + e.texParam = t, + this.renderToTex = t, + this.hasQuadBatchTop = !1, + this.hasPointBatchTop = !1) + } + , + cr.GLWrap = t +}(), +function() { + var u = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame; + function i(t) { + var e; + t && (t.getContext || t.dc) && (t.c2runtime || ((e = t.c2runtime = this).isCrosswalk = /crosswalk/i.test(navigator.userAgent) || /xwalk/i.test(navigator.userAgent) || !(void 0 === window.c2isCrosswalk || !window.c2isCrosswalk), + this.isCordova = this.isCrosswalk || void 0 !== window.device && (void 0 !== window.device.cordova || void 0 !== window.device.phonegap) || void 0 !== window.c2iscordova && window.c2iscordova, + this.isPhoneGap = this.isCordova, + this.isDirectCanvas = !!t.dc, + this.isAppMobi = void 0 !== window.AppMobi || this.isDirectCanvas, + this.isCocoonJs = !!window.c2cocoonjs, + this.isEjecta = !!window.c2ejecta, + this.isCocoonJs && (CocoonJS.App.onSuspended.addEventListener(function() { + e.setSuspended(!0) + }), + CocoonJS.App.onActivated.addEventListener(function() { + e.setSuspended(!1) + })), + this.isEjecta && (document.addEventListener("pagehide", function() { + e.setSuspended(!0) + }), + document.addEventListener("pageshow", function() { + e.setSuspended(!1) + }), + document.addEventListener("resize", function() { + e.setSize(window.innerWidth, window.innerHeight) + })), + this.isDomFree = this.isDirectCanvas || this.isCocoonJs || this.isEjecta, + this.isMicrosoftEdge = /edge\//i.test(navigator.userAgent), + this.isIE = (/msie/i.test(navigator.userAgent) || /trident/i.test(navigator.userAgent) || /iemobile/i.test(navigator.userAgent)) && !this.isMicrosoftEdge, + this.isTizen = /tizen/i.test(navigator.userAgent), + this.isAndroid = /android/i.test(navigator.userAgent) && !this.isTizen && !this.isIE && !this.isMicrosoftEdge, + this.isiPhone = (/iphone/i.test(navigator.userAgent) || /ipod/i.test(navigator.userAgent)) && !this.isIE && !this.isMicrosoftEdge, + this.isiPad = /ipad/i.test(navigator.userAgent), + this.isiOS = this.isiPhone || this.isiPad || this.isEjecta, + this.isiPhoneiOS6 = this.isiPhone && /os\s6/i.test(navigator.userAgent), + this.isChrome = (/chrome/i.test(navigator.userAgent) || /chromium/i.test(navigator.userAgent)) && !this.isIE && !this.isMicrosoftEdge, + this.isAmazonWebApp = /amazonwebappplatform/i.test(navigator.userAgent), + this.isFirefox = /firefox/i.test(navigator.userAgent), + this.isSafari = /safari/i.test(navigator.userAgent) && !this.isChrome && !this.isIE && !this.isMicrosoftEdge, + this.isWindows = /windows/i.test(navigator.userAgent), + this.isNWjs = void 0 !== window.c2nodewebkit || void 0 !== window.c2nwjs || /nodewebkit/i.test(navigator.userAgent) || /nwjs/i.test(navigator.userAgent), + this.isNodeWebkit = this.isNWjs, + this.isArcade = void 0 !== window.is_scirra_arcade, + this.isWindows8App = !(void 0 === window.c2isWindows8 || !window.c2isWindows8), + this.isWindows8Capable = !(void 0 === window.c2isWindows8Capable || !window.c2isWindows8Capable), + this.isWindowsPhone8 = !(void 0 === window.c2isWindowsPhone8 || !window.c2isWindowsPhone8), + this.isWindowsPhone81 = !(void 0 === window.c2isWindowsPhone81 || !window.c2isWindowsPhone81), + this.isWindows10 = !!window.cr_windows10, + this.isWinJS = this.isWindows8App || this.isWindows8Capable || this.isWindowsPhone81 || this.isWindows10, + this.isBlackberry10 = !(void 0 === window.c2isBlackberry10 || !window.c2isBlackberry10), + this.isAndroidStockBrowser = this.isAndroid && !this.isChrome && !this.isCrosswalk && !this.isFirefox && !this.isAmazonWebApp && !this.isDomFree, + this.devicePixelRatio = 1, + this.isMobile = this.isCordova || this.isCrosswalk || this.isAppMobi || this.isCocoonJs || this.isAndroid || this.isiOS || this.isWindowsPhone8 || this.isWindowsPhone81 || this.isBlackberry10 || this.isTizen || this.isEjecta, + this.isMobile || (this.isMobile = /(blackberry|bb10|playbook|palm|symbian|nokia|windows\s+ce|phone|mobile|tablet|kindle|silk)/i.test(navigator.userAgent)), + this.isWKWebView = !!(this.isiOS && this.isCordova && window.webkit), + "undefined" == typeof cr_is_preview || this.isNWjs || "?nw" !== window.location.search && !/nodewebkit/i.test(navigator.userAgent) && !/nwjs/i.test(navigator.userAgent) || (this.isNWjs = !0), + this.isDebug = "undefined" != typeof cr_is_preview && -1 < window.location.search.indexOf("debug"), + this.canvas = t, + this.canvasdiv = document.getElementById("c2canvasdiv"), + this.gl = null, + this.glwrap = null, + this.glUnmaskedRenderer = "(unavailable)", + this.enableFrontToBack = !1, + this.earlyz_index = 0, + this.ctx = null, + this.firstInFullscreen = !1, + this.oldWidth = 0, + this.oldHeight = 0, + this.canvas.oncontextmenu = function(t) { + return t.preventDefault && t.preventDefault(), + !1 + } + , + this.canvas.onselectstart = function(t) { + return t.preventDefault && t.preventDefault(), + !1 + } + , + this.canvas.ontouchstart = function(t) { + return t.preventDefault && t.preventDefault(), + !1 + } + , + this.isDirectCanvas && (window.c2runtime = this), + this.isNWjs && (window.ondragover = function(t) { + return t.preventDefault(), + !1 + } + , + window.ondrop = function(t) { + return t.preventDefault(), + !1 + } + , + window.nwgui && window.nwgui.App.clearCache && window.nwgui.App.clearCache()), + this.isAndroidStockBrowser && "undefined" != typeof jQuery && jQuery("canvas").parents("*").css("overflow", "visible"), + this.width = t.width, + this.height = t.height, + this.draw_width = this.width, + this.draw_height = this.height, + this.cssWidth = this.width, + this.cssHeight = this.height, + this.lastWindowWidth = window.innerWidth, + this.lastWindowHeight = window.innerHeight, + this.forceCanvasAlpha = !1, + this.redraw = !0, + this.isSuspended = !1, + Date.now || (Date.now = function() { + return +new Date + } + ), + this.plugins = [], + this.types = {}, + this.types_by_index = [], + this.behaviors = [], + this.layouts = {}, + this.layouts_by_index = [], + this.eventsheets = {}, + this.eventsheets_by_index = [], + this.wait_for_textures = [], + this.triggers_to_postinit = [], + this.all_global_vars = [], + this.all_local_vars = [], + this.solidBehavior = null, + this.jumpthruBehavior = null, + this.shadowcasterBehavior = null, + this.deathRow = {}, + this.hasPendingInstances = !1, + this.isInClearDeathRow = !1, + this.isInOnDestroy = 0, + this.isRunningEvents = !1, + this.isEndingLayout = !1, + this.createRow = [], + this.isLoadingState = !1, + this.saveToSlot = "", + this.loadFromSlot = "", + this.loadFromJson = null, + this.lastSaveJson = "", + this.signalledContinuousPreview = !1, + this.suspendDrawing = !1, + this.fireOnCreateAfterLoad = [], + this.dt = 0, + this.dt1 = 0, + this.minimumFramerate = 30, + this.logictime = 0, + this.cpuutilisation = 0, + this.timescale = 1, + this.kahanTime = new cr.KahanAdder, + this.wallTime = new cr.KahanAdder, + this.last_tick_time = 0, + this.fps = 0, + this.last_fps_time = 0, + this.tickcount = 0, + this.tickcount_nosave = 0, + this.execcount = 0, + this.framecount = 0, + this.objectcount = 0, + this.changelayout = null, + this.destroycallbacks = [], + this.event_stack = [], + this.event_stack_index = -1, + this.localvar_stack = [[]], + this.localvar_stack_index = 0, + this.trigger_depth = 0, + this.pushEventStack(null), + this.loop_stack = [], + this.loop_stack_index = -1, + this.next_uid = 0, + this.next_puid = 0, + this.layout_first_tick = !0, + this.family_count = 0, + this.suspend_events = [], + this.raf_id = -1, + this.timeout_id = -1, + this.isloading = !0, + this.loadingprogress = 0, + this.isNodeFullscreen = !1, + this.stackLocalCount = 0, + this.audioInstance = null, + this.had_a_click = !1, + this.isInUserInputEvent = !1, + this.objects_to_pretick = new cr.ObjectSet, + this.objects_to_tick = new cr.ObjectSet, + this.objects_to_tick2 = new cr.ObjectSet, + this.registered_collisions = [], + this.temp_poly = new cr.CollisionPoly([]), + this.temp_poly2 = new cr.CollisionPoly([]), + this.allGroups = [], + this.groups_by_name = {}, + this.cndsBySid = {}, + this.actsBySid = {}, + this.varsBySid = {}, + this.blocksBySid = {}, + this.running_layout = null, + this.layer_canvas = null, + this.layer_ctx = null, + this.layer_tex = null, + this.layout_tex = null, + this.layout_canvas = null, + this.layout_ctx = null, + this.is_WebGL_context_lost = !1, + this.uses_background_blending = !1, + this.fx_tex = [null, null], + this.fullscreen_scaling = 0, + this.files_subfolder = "", + this.objectsByUid = {}, + this.loaderlogos = null, + this.snapshotCanvas = null, + this.snapshotData = "", + this.objectRefTable = [], + this.requestProjectData())) + } + i.prototype.requestProjectData = function() { + var e = this; + if (this.isWKWebView) + this.fetchLocalFileViaCordovaAsText("data.js?v=1", function(t) { + e.loadProject(JSON.parse(t)) + }, function(t) { + alert("Error fetching data.js") + }); + else { + var i = this.isWindowsPhone8 ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest + , s = "data.js?v=1"; + (this.isWindows8App || this.isWindowsPhone8 || this.isWindowsPhone81 || this.isWindows10) && (s = "data.json?v=1"), + i.open("GET", s, !0); + var n = !1; + if (!this.isDomFree && "response"in i && "responseType"in i) + try { + i.responseType = "json", + n = "json" === i.responseType + } catch (t) { + n = !1 + } + if (!n && "responseType"in i) + try { + i.responseType = "text" + } catch (t) {} + if ("overrideMimeType"in i) + try { + i.overrideMimeType("application/json; charset=utf-8") + } catch (t) {} + this.isWindowsPhone8 ? i.onreadystatechange = function() { + 4 === i.readyState && e.loadProject(JSON.parse(i.responseText)) + } + : (i.onload = function() { + var t; + n ? e.loadProject(i.response) : e.isEjecta ? (t = (t = i.responseText).substr(t.indexOf("{")), + e.loadProject(JSON.parse(t))) : e.loadProject(JSON.parse(i.responseText)) + } + , + i.onerror = function(t) { + cr.logerror("Error requesting " + s + ":"), + cr.logerror(t) + } + ), + i.send() + } + } + , + i.prototype.initRendererAndLoader = function() { + var t, e, i, s, n, r, o, a, h, c, l, u = this; + this.isRetina = (!this.isDomFree || this.isEjecta || this.isCordova) && this.useHighDpi && !this.isAndroidStockBrowser, + 0 === this.fullscreen_mode && this.isiOS && (this.isRetina = !1), + this.devicePixelRatio = this.isRetina && (window.devicePixelRatio || window.webkitDevicePixelRatio || window.mozDevicePixelRatio || window.msDevicePixelRatio) || 1, + this.ClearDeathRow(), + 0 < this.fullscreen_mode && this.setSize(window.innerWidth, window.innerHeight, !0), + this.canvas.addEventListener("webglcontextlost", function(t) { + t.preventDefault(), + u.onContextLost(), + cr.logexport("[Construct 2] WebGL context lost"), + window.cr_setSuspended(!0) + }, !1), + this.canvas.addEventListener("webglcontextrestored", function(t) { + u.glwrap.initState(), + u.glwrap.setSize(u.glwrap.width, u.glwrap.height, !0), + u.layer_tex = null, + u.layout_tex = null, + u.fx_tex[0] = null, + u.fx_tex[1] = null, + u.onContextRestored(), + u.redraw = !0, + cr.logexport("[Construct 2] WebGL context restored"), + window.cr_setSuspended(!1) + }, !1); + try { + this.enableWebGL && (this.isCocoonJs || this.isEjecta || !this.isDomFree) && (l = { + alpha: !0, + depth: !1, + antialias: !1, + powerPreference: "high-performance", + failIfMajorPerformanceCaveat: !0 + }, + this.isAndroid || (this.gl = this.canvas.getContext("webgl2", l)), + this.gl || (this.gl = this.canvas.getContext("webgl", l) || this.canvas.getContext("experimental-webgl", l))) + } catch (t) {} + if (this.gl) { + this.gl.getParameter(this.gl.VERSION).indexOf("WebGL 2"); + var p, d = this.gl.getExtension("WEBGL_debug_renderer_info"); + for (d && (p = this.gl.getParameter(d.UNMASKED_VENDOR_WEBGL), + d = this.gl.getParameter(d.UNMASKED_RENDERER_WEBGL), + this.glUnmaskedRenderer = d + " [" + p + "]"), + this.enableFrontToBack && (this.glUnmaskedRenderer += " [front-to-back enabled]"), + this.isDomFree || (this.overlay_canvas = document.createElement("canvas"), + jQuery(this.overlay_canvas).appendTo(this.canvas.parentNode), + this.overlay_canvas.oncontextmenu = function(t) { + return !1 + } + , + this.overlay_canvas.onselectstart = function(t) { + return !1 + } + , + this.overlay_canvas.width = Math.round(this.cssWidth * this.devicePixelRatio), + this.overlay_canvas.height = Math.round(this.cssHeight * this.devicePixelRatio), + jQuery(this.overlay_canvas).css({ + width: this.cssWidth + "px", + height: this.cssHeight + "px" + }), + this.positionOverlayCanvas(), + this.overlay_ctx = this.overlay_canvas.getContext("2d")), + this.glwrap = new cr.GLWrap(this.gl,this.isMobile,this.enableFrontToBack), + this.glwrap.setSize(this.canvas.width, this.canvas.height), + this.glwrap.enable_mipmaps = 0 !== this.downscalingQuality, + this.ctx = null, + t = 0, + e = this.types_by_index.length; t < e; t++) + for (i = 0, + s = (o = this.types_by_index[t]).effect_types.length; i < s; i++) + (a = o.effect_types[i]).shaderindex = this.glwrap.getShaderIndex(a.id), + a.preservesOpaqueness = this.glwrap.programPreservesOpaqueness(a.shaderindex), + this.uses_background_blending = this.uses_background_blending || this.glwrap.programUsesDest(a.shaderindex); + for (t = 0, + e = this.layouts_by_index.length; t < e; t++) { + for (i = 0, + s = (h = this.layouts_by_index[t]).effect_types.length; i < s; i++) + (a = h.effect_types[i]).shaderindex = this.glwrap.getShaderIndex(a.id), + a.preservesOpaqueness = this.glwrap.programPreservesOpaqueness(a.shaderindex); + for (h.updateActiveEffects(), + i = 0, + s = h.layers.length; i < s; i++) { + for (n = 0, + r = (c = h.layers[i]).effect_types.length; n < r; n++) + (a = c.effect_types[n]).shaderindex = this.glwrap.getShaderIndex(a.id), + a.preservesOpaqueness = this.glwrap.programPreservesOpaqueness(a.shaderindex), + this.uses_background_blending = this.uses_background_blending || this.glwrap.programUsesDest(a.shaderindex); + c.updateActiveEffects() + } + } + } else { + if (0 < this.fullscreen_mode && this.isDirectCanvas) { + this.canvas = null, + document.oncontextmenu = function(t) { + return !1 + } + , + document.onselectstart = function(t) { + return !1 + } + , + this.ctx = AppMobi.canvas.getContext("2d"); + try { + this.ctx.samplingMode = this.linearSampling ? "smooth" : "sharp", + this.ctx.globalScale = 1, + this.ctx.HTML5CompatibilityMode = !0, + this.ctx.imageSmoothingEnabled = this.linearSampling + } catch (t) {} + 0 !== this.width && 0 !== this.height && (this.ctx.width = this.width, + this.ctx.height = this.height) + } + this.ctx || (l = this.isCocoonJs ? { + antialias: !!this.linearSampling, + alpha: !0 + } : { + alpha: !0 + }, + this.ctx = this.canvas.getContext("2d", l), + this.setCtxImageSmoothingEnabled(this.ctx, this.linearSampling)), + this.overlay_canvas = null, + this.overlay_ctx = null + } + this.tickFunc = function(t) { + u.tick(!1, t) + } + , + window == window.top || this.isDomFree || this.isWinJS || this.isWindowsPhone8 || (document.addEventListener("mousedown", function() { + window.focus() + }, !0), + document.addEventListener("touchstart", function() { + window.focus() + }, !0)), + "undefined" != typeof cr_is_preview && (this.isCocoonJs && console.log("[Construct 2] In preview-over-wifi via CocoonJS mode"), + -1 < window.location.search.indexOf("continuous") && (cr.logexport("Reloading for continuous preview"), + this.loadFromSlot = "__c2_continuouspreview", + this.suspendDrawing = !0), + this.pauseOnBlur && !this.isMobile && (jQuery(window).focus(function() { + u.setSuspended(!1) + }), + jQuery(window).blur(function() { + var t = window.parent; + t && t.document.hasFocus() || u.setSuspended(!0) + }))), + window.addEventListener("blur", function() { + u.onWindowBlur() + }), + this.isDomFree || (p = function(t) { + if (cr.isCanvasInputEvent(t) && document.activeElement && document.activeElement !== document.getElementsByTagName("body")[0] && document.activeElement.blur) + try { + document.activeElement.blur() + } catch (t) {} + } + , + "undefined" != typeof PointerEvent ? document.addEventListener("pointerdown", p) : window.navigator.msPointerEnabled ? document.addEventListener("MSPointerDown", p) : document.addEventListener("touchstart", p), + document.addEventListener("mousedown", p)), + 0 === this.fullscreen_mode && this.isRetina && 1 < this.devicePixelRatio && this.setSize(this.original_width, this.original_height, !0), + this.tryLockOrientation(), + this.getready(), + this.go(), + this.extra = {}, + cr.seal(this) + } + , + i.prototype.setSize = function(t, e, i) { + var s, n, r, o, a = 0, h = 0, c = 0, l = 0, u = 0; + this.lastWindowWidth === t && this.lastWindowHeight === e && !i || (this.lastWindowWidth = t, + this.lastWindowHeight = e, + s = this.fullscreen_mode, + ((o = (document.mozFullScreen || document.webkitIsFullScreen || !!document.msFullscreenElement || document.fullScreen || this.isNodeFullscreen) && !this.isCordova) || 0 !== this.fullscreen_mode || i) && (o && (s = this.fullscreen_scaling), + i = this.devicePixelRatio, + 4 <= s ? (n = this.original_width / this.original_height) < (r = t / e) ? (c = e * n, + 5 === s ? (1 < (u = c * i / this.original_width) ? u = Math.floor(u) : u < 1 && (u = 1 / Math.ceil(1 / u)), + a = (t - (c = this.original_width * u / i)) / 2, + h = (e - (l = this.original_height * u / i)) / 2, + t = c, + e = l) : (a = (t - c) / 2, + t = c)) : (l = t / n, + e = (5 === s ? (1 < (u = l * i / this.original_height) ? u = Math.floor(u) : u < 1 && (u = 1 / Math.ceil(1 / u)), + a = (t - (c = this.original_width * u / i)) / 2, + h = (e - (l = this.original_height * u / i)) / 2, + t = c) : h = (e - l) / 2, + l)) : o && 0 === s && (a = Math.floor((t - this.original_width) / 2), + h = Math.floor((e - this.original_height) / 2), + t = this.original_width, + e = this.original_height), + s < 2 && (this.aspect_scale = i), + this.cssWidth = Math.round(t), + this.cssHeight = Math.round(e), + this.width = Math.round(t * i), + this.height = Math.round(e * i), + this.redraw = !0, + this.wantFullscreenScalingQuality || this.width < this.original_width && this.height < this.original_height || 1 === s ? (this.draw_width = this.width, + this.draw_height = this.height, + this.fullscreenScalingQuality = !0) : (this.draw_width = this.original_width, + this.draw_height = this.original_height, + this.fullscreenScalingQuality = !1, + 2 === s ? (n = this.original_width / this.original_height, + (r = this.lastWindowWidth / this.lastWindowHeight) < n ? this.draw_width = this.draw_height * r : n < r && (this.draw_height = this.draw_width / r)) : 3 === s && ((n = this.original_width / this.original_height) < (r = this.lastWindowWidth / this.lastWindowHeight) ? this.draw_width = this.draw_height * r : r < n && (this.draw_height = this.draw_width / r))), + this.canvasdiv && !this.isDomFree && (jQuery(this.canvasdiv).css({ + width: Math.round(t) + "px", + height: Math.round(e) + "px", + "margin-left": Math.floor(a) + "px", + "margin-top": Math.floor(h) + "px" + }), + "undefined" != typeof cr_is_preview && jQuery("#borderwrap").css({ + width: Math.round(t) + "px", + height: Math.round(e) + "px" + })), + this.canvas && (this.canvas.width = Math.round(t * i), + this.canvas.height = Math.round(e * i), + this.isEjecta ? (this.canvas.style.left = Math.floor(a) + "px", + this.canvas.style.top = Math.floor(h) + "px", + this.canvas.style.width = Math.round(t) + "px", + this.canvas.style.height = Math.round(e) + "px") : this.isRetina && !this.isDomFree && (this.canvas.style.width = Math.round(t) + "px", + this.canvas.style.height = Math.round(e) + "px")), + this.overlay_canvas && (this.overlay_canvas.width = Math.round(t * i), + this.overlay_canvas.height = Math.round(e * i), + this.overlay_canvas.style.width = this.cssWidth + "px", + this.overlay_canvas.style.height = this.cssHeight + "px"), + this.glwrap && this.glwrap.setSize(Math.round(t * i), Math.round(e * i)), + this.isDirectCanvas && this.ctx && (this.ctx.width = Math.round(t), + this.ctx.height = Math.round(e)), + this.ctx && this.setCtxImageSmoothingEnabled(this.ctx, this.linearSampling), + this.tryLockOrientation(), + this.isiPhone && !this.isCordova && window.scrollTo(0, 0))) + } + , + i.prototype.tryLockOrientation = function() { + if (this.autoLockOrientation && 0 !== this.orientations) { + var t = "portrait"; + 2 === this.orientations && (t = "landscape"); + try { + screen.orientation && screen.orientation.lock ? screen.orientation.lock(t).catch(function() {}) : screen.lockOrientation ? screen.lockOrientation(t) : screen.webkitLockOrientation ? screen.webkitLockOrientation(t) : screen.mozLockOrientation ? screen.mozLockOrientation(t) : screen.msLockOrientation && screen.msLockOrientation(t) + } catch (t) { + console && console.warn && console.warn("Failed to lock orientation: ", t) + } + } + } + , + i.prototype.onContextLost = function() { + var t, e, i; + for (this.glwrap.contextLost(), + this.is_WebGL_context_lost = !0, + t = 0, + e = this.types_by_index.length; t < e; t++) + (i = this.types_by_index[t]).onLostWebGLContext && i.onLostWebGLContext() + } + , + i.prototype.onContextRestored = function() { + var t, e, i; + for (this.is_WebGL_context_lost = !1, + t = 0, + e = this.types_by_index.length; t < e; t++) + (i = this.types_by_index[t]).onRestoreWebGLContext && i.onRestoreWebGLContext() + } + , + i.prototype.positionOverlayCanvas = function() { + var t; + this.isDomFree || ((t = (document.mozFullScreen || document.webkitIsFullScreen || document.fullScreen || !!document.msFullscreenElement || this.isNodeFullscreen) && !this.isCordova ? jQuery(this.canvas).offset() : jQuery(this.canvas).position()).position = "absolute", + jQuery(this.overlay_canvas).css(t)) + } + ; + var s = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.msCancelAnimationFrame || window.oCancelAnimationFrame; + i.prototype.setSuspended = function(t) { + var e, i; + if (t && !this.isSuspended) + for (cr.logexport("[Construct 2] Suspending"), + this.isSuspended = !0, + -1 !== this.raf_id && s && s(this.raf_id), + -1 !== this.timeout_id && clearTimeout(this.timeout_id), + e = 0, + i = this.suspend_events.length; e < i; e++) + this.suspend_events[e](!0); + else if (!t && this.isSuspended) { + for (cr.logexport("[Construct 2] Resuming"), + this.isSuspended = !1, + this.last_tick_time = cr.performance_now(), + this.last_fps_time = cr.performance_now(), + this.framecount = 0, + e = this.logictime = 0, + i = this.suspend_events.length; e < i; e++) + this.suspend_events[e](!1); + this.tick(!1) + } + } + , + i.prototype.addSuspendCallback = function(t) { + this.suspend_events.push(t) + } + , + i.prototype.GetObjectReference = function(t) { + return this.objectRefTable[t] + } + ; + var f = !(i.prototype.loadProject = function(t) { + t && t.project || cr.logerror("Project model unavailable"); + var e, i, s, n, r, o, a, h, c, l, u, p, d, f, y, g, m, _, v, b, w = t.project; + for (this.name = w[0], + this.first_layout = w[1], + this.fullscreen_mode = w[12], + this.fullscreen_mode_set = w[12], + this.original_width = w[10], + this.original_height = w[11], + this.parallax_x_origin = this.original_width / 2, + this.parallax_y_origin = this.original_height / 2, + this.isDomFree && !this.isEjecta && (4 <= w[12] || 0 === w[12]) && (cr.logexport("[Construct 2] Letterbox scale fullscreen modes are not supported on this platform - falling back to 'Scale outer'"), + this.fullscreen_mode = 3, + this.fullscreen_mode_set = 3), + this.uses_loader_layout = w[18], + this.loaderstyle = w[19], + 0 === this.loaderstyle ? ((u = new Image).crossOrigin = "anonymous", + this.setImageSrc(u, "loading-logo.png"), + this.loaderlogos = { + logo: u + }) : 4 === this.loaderstyle && ((e = new Image).src = "", + (i = new Image).src = "", + (s = new Image).src = "", + (n = new Image).src = "", + (r = new Image).src = "", + (o = new Image).src = "", + (a = new Image).src = "", + (h = new Image).src = "", + (c = new Image).src = "", + (l = new Image).src = "", + (t = new Image).src = "", + (u = new Image).src = "", + this.loaderlogos = { + logo: [e, i, s, n], + powered: [r, o, a, h], + website: [c, l, t, u] + }), + this.next_uid = w[21], + this.objectRefTable = cr.getObjectRefTable(), + this.system = new cr.system_object(this), + p = 0, + d = w[2].length; p < d; p++) + f = w[2][p], + _ = this.GetObjectReference(f[0]), + cr.add_common_aces(f, _.prototype), + (v = new _(this)).singleglobal = f[1], + v.is_world = f[2], + v.is_rotatable = f[5], + v.must_predraw = f[9], + v.onCreate && v.onCreate(), + cr.seal(v), + this.plugins.push(v); + for (this.objectRefTable = cr.getObjectRefTable(), + p = 0, + d = w[3].length; p < d; p++) { + for (f = w[3][p], + b = this.GetObjectReference(f[1]), + v = null, + B = 0, + R = this.plugins.length; B < R; B++) + if (this.plugins[B]instanceof b) { + v = this.plugins[B]; + break + } + var x, S = new v.Type(v); + for (S.name = f[0], + S.is_family = f[2], + S.instvar_sids = f[3].slice(0), + S.vars_count = f[3].length, + S.behs_count = f[4], + S.fx_count = f[5], + S.sid = f[11], + S.is_family ? (S.members = [], + S.family_index = this.family_count++, + S.families = null) : (S.members = null, + S.family_index = -1, + S.families = []), + S.family_var_map = null, + S.family_beh_map = null, + S.family_fx_map = null, + S.is_contained = !1, + S.container = null, + f[6] ? (S.texture_file = f[6][0], + S.texture_filesize = f[6][1], + S.texture_pixelformat = f[6][2]) : (S.texture_file = null, + S.texture_filesize = 0, + S.texture_pixelformat = 0), + f[7] ? S.animations = f[7] : S.animations = null, + S.index = p, + S.instances = [], + S.deadCache = [], + S.solstack = [new cr.selection(S)], + S.cur_sol = 0, + S.default_instance = null, + S.default_layerindex = 0, + S.stale_iids = !0, + S.updateIIDs = cr.type_updateIIDs, + S.getFirstPicked = cr.type_getFirstPicked, + S.getPairedInstance = cr.type_getPairedInstance, + S.getCurrentSol = cr.type_getCurrentSol, + S.pushCleanSol = cr.type_pushCleanSol, + S.pushCopySol = cr.type_pushCopySol, + S.popSol = cr.type_popSol, + S.getBehaviorByName = cr.type_getBehaviorByName, + S.getBehaviorIndexByName = cr.type_getBehaviorIndexByName, + S.getEffectIndexByName = cr.type_getEffectIndexByName, + S.applySolToContainer = cr.type_applySolToContainer, + S.getInstanceByIID = cr.type_getInstanceByIID, + S.collision_grid = new cr.SparseGrid(this.original_width,this.original_height), + S.any_cell_changed = !0, + S.any_instance_parallaxed = !1, + S.extra = {}, + S.toString = cr.type_toString, + S.behaviors = [], + B = 0, + R = f[8].length; B < R; B++) { + y = f[8][B]; + for (var T = this.GetObjectReference(y[1]), A = null, C = 0, k = this.behaviors.length; C < k; C++) + if (this.behaviors[C]instanceof T) { + A = this.behaviors[C]; + break + } + A || ((A = new T(this)).my_types = [], + A.my_instances = new cr.ObjectSet, + A.onCreate && A.onCreate(), + cr.seal(A), + this.behaviors.push(A), + cr.behaviors.solid && A instanceof cr.behaviors.solid && (this.solidBehavior = A), + cr.behaviors.jumpthru && A instanceof cr.behaviors.jumpthru && (this.jumpthruBehavior = A), + cr.behaviors.shadowcaster && A instanceof cr.behaviors.shadowcaster && (this.shadowcasterBehavior = A)), + -1 === A.my_types.indexOf(S) && A.my_types.push(S); + var O = new A.Type(A,S); + O.name = y[0], + O.sid = y[2], + O.onCreate(), + cr.seal(O), + S.behaviors.push(O) + } + for (S.global = f[9], + S.isOnLoaderLayout = f[10], + S.effect_types = [], + B = 0, + R = f[12].length; B < R; B++) + S.effect_types.push({ + id: f[12][B][0], + name: f[12][B][1], + shaderindex: -1, + preservesOpaqueness: !1, + active: !0, + index: B + }); + S.tile_poly_data = f[13], + this.uses_loader_layout && !S.is_family && !S.isOnLoaderLayout && v.is_world || (S.onCreate(), + cr.seal(S)), + S.name && (this.types[S.name] = S), + this.types_by_index.push(S), + v.singleglobal && ((x = new v.Instance(S)).uid = this.next_uid++, + x.puid = this.next_puid++, + x.iid = 0, + x.get_iid = cr.inst_get_iid, + x.toString = cr.inst_toString, + x.properties = f[14], + x.onCreate(), + cr.seal(x), + S.instances.push(x), + this.objectsByUid[x.uid.toString()] = x) + } + for (p = 0, + d = w[4].length; p < d; p++) + for (var I, P = w[4][p], E = this.types_by_index[P[0]], B = 1, R = P.length; B < R; B++) + (I = this.types_by_index[P[B]]).families.push(E), + E.members.push(I); + for (p = 0, + d = w[28].length; p < d; p++) { + var L = w[28][p] + , M = []; + for (B = 0, + R = L.length; B < R; B++) + M.push(this.types_by_index[L[B]]); + for (B = 0, + R = M.length; B < R; B++) + M[B].is_contained = !0, + M[B].container = M + } + if (0 < this.family_count) + for (p = 0, + d = this.types_by_index.length; p < d; p++) + if (!(g = this.types_by_index[p]).is_family && g.families.length) { + g.family_var_map = new Array(this.family_count), + g.family_beh_map = new Array(this.family_count), + g.family_fx_map = new Array(this.family_count); + var j = [] + , N = 0 + , F = 0 + , D = 0; + for (B = 0, + R = g.families.length; B < R; B++) + for (m = g.families[B], + g.family_var_map[m.family_index] = N, + N += m.vars_count, + g.family_beh_map[m.family_index] = F, + F += m.behs_count, + g.family_fx_map[m.family_index] = D, + D += m.fx_count, + C = 0, + k = m.effect_types.length; C < k; C++) + j.push(cr.shallowCopy({}, m.effect_types[C])); + for (g.effect_types = j.concat(g.effect_types), + B = 0, + R = g.effect_types.length; B < R; B++) + g.effect_types[B].index = B + } + for (p = 0, + d = w[5].length; p < d; p++) { + f = w[5][p]; + var V = new cr.layout(this,f); + cr.seal(V), + this.layouts[V.name] = V, + this.layouts_by_index.push(V) + } + for (p = 0, + d = w[6].length; p < d; p++) { + f = w[6][p]; + var W = new cr.eventsheet(this,f); + cr.seal(W), + this.eventsheets[W.name] = W, + this.eventsheets_by_index.push(W) + } + for (p = 0, + d = this.eventsheets_by_index.length; p < d; p++) + this.eventsheets_by_index[p].postInit(); + for (p = 0, + d = this.eventsheets_by_index.length; p < d; p++) + this.eventsheets_by_index[p].updateDeepIncludes(); + for (p = 0, + d = this.triggers_to_postinit.length; p < d; p++) + this.triggers_to_postinit[p].postInit(); + cr.clearArray(this.triggers_to_postinit), + this.audio_to_preload = w[7], + this.files_subfolder = w[8], + this.pixel_rounding = w[9], + this.aspect_scale = 1, + this.enableWebGL = w[13], + this.linearSampling = w[14], + this.clearBackground = w[15], + this.versionstr = w[16], + this.useHighDpi = w[17], + this.orientations = w[20], + this.autoLockOrientation = 0 < this.orientations, + this.pauseOnBlur = w[22], + this.wantFullscreenScalingQuality = w[23], + this.fullscreenScalingQuality = this.wantFullscreenScalingQuality, + this.downscalingQuality = w[24], + this.preloadSounds = w[25], + this.projectName = w[26], + this.enableFrontToBack = w[27] && !this.isIE, + this.start_time = Date.now(), + cr.clearArray(this.objectRefTable), + this.initRendererAndLoader() + } + ) + , n = 0 + , r = []; + i.prototype.queueImageLoad = function(t, e) { + function i() { + n--, + s.maybeLoadNextImages() + } + var s = this; + t.addEventListener("load", i), + t.addEventListener("error", i), + r.push([t, e]), + this.maybeLoadNextImages() + } + , + i.prototype.maybeLoadNextImages = function() { + for (var t; r.length && n < 100; ) + n++, + t = r.shift(), + this.setImageSrc(t[0], t[1]) + } + , + i.prototype.waitForImageLoad = function(e, i) { + e.cocoonLazyLoad = !0, + e.onerror = function(t) { + e.c2error = !0, + f = !0, + console && console.error && console.error("Error loading image '" + e.src + "': ", t) + } + , + this.isEjecta ? e.src = i : e.src || ("undefined" != typeof XAPKReader ? XAPKReader.get(i, function(t) { + e.src = t + }, function(t) { + e.c2error = !0, + f = !0, + console && console.error && console.error("Error extracting image '" + i + "' from expansion file: ", t) + }) : (e.crossOrigin = "anonymous", + this.queueImageLoad(e, i))), + this.wait_for_textures.push(e) + } + ; + var h = 0 + , c = !(i.prototype.findWaitingTexture = function(t) { + for (var e = 0, i = this.wait_for_textures.length; e < i; e++) + if (this.wait_for_textures[e].cr_src === t) + return this.wait_for_textures[e]; + return null + } + ); + i.prototype.getready = function() { + this.audioInstance && (h = this.audioInstance.setPreloadList(this.audio_to_preload)) + } + ; + var y = !(i.prototype.areAllTexturesAndSoundsLoaded = function() { + for (var t, e, i = h, s = 0, n = !0, r = 0, o = this.wait_for_textures.length; r < o; r++) { + var a = (e = this.wait_for_textures[r]).cr_filesize; + (!a || a <= 0) && (a = 5e4), + i += a, + e.src && (e.complete || e.loaded) && !e.c2error ? s += a : n = !1 + } + return n && this.preloadSounds && this.audioInstance && (c || (this.audioInstance.startPreloads(), + c = !0), + s += t = this.audioInstance.getPreloadedSize(), + t < h && (n = !1)), + this.progress = 0 == i ? 1 : s / i, + n + } + ); + i.prototype.go = function() { + if (this.ctx || this.glwrap) { + var t = this.ctx || this.overlay_ctx; + this.overlay_canvas && this.positionOverlayCanvas(); + var e = window.innerWidth + , i = window.innerHeight; + this.lastWindowWidth === e && this.lastWindowHeight === i || this.setSize(e, i), + this.progress = 0, + this.last_progress = -1; + var s = this; + if (this.areAllTexturesAndSoundsLoaded() && (4 !== this.loaderstyle || y)) + this.go_loading_finished(); + else { + var n = Date.now() - this.start_time; + if (t) { + var r = this.width + , o = this.height + , a = this.devicePixelRatio; + if (this.loaderstyle < 3 && (this.isCocoonJs || 500 <= n && this.last_progress != this.progress)) { + t.clearRect(0, 0, r, o); + var h = r / 2 + , c = o / 2 + , l = 0 === this.loaderstyle && this.loaderlogos.logo.complete + , e = 40 * a + , i = 0 + , n = 80 * a; + l && (e = (n = (r = this.loaderlogos.logo).width * a) / 2, + i = (o = r.height * a) / 2, + t.drawImage(r, cr.floor(h - e), cr.floor(c - i), n, o)), + this.loaderstyle <= 1 ? (c += i + (l ? 12 * a : 0), + h -= e, + h = cr.floor(h) + .5, + c = cr.floor(c) + .5, + t.fillStyle = f ? "red" : "DodgerBlue", + t.fillRect(h, c, Math.floor(n * this.progress), 6 * a), + t.strokeStyle = "black", + t.strokeRect(h, c, n, 6 * a), + t.strokeStyle = "white", + t.strokeRect(h - +a, c - +a, n + 2 * a, 8 * a)) : 2 === this.loaderstyle && (t.font = this.isEjecta ? "12pt ArialMT" : "12pt Arial", + t.fillStyle = f ? "#f00" : "#999", + t.textBaseLine = "middle", + n = Math.round(100 * this.progress) + "%", + a = (a = t.measureText ? t.measureText(n) : null) ? a.width : 0, + t.fillText(n, h - a / 2, c)), + this.last_progress = this.progress + } else if (4 === this.loaderstyle) + return this.draw_c2_splash_loader(t), + void (u ? u(function() { + s.go() + }) : setTimeout(function() { + s.go() + }, 16)) + } + setTimeout(function() { + s.go() + }, this.isCocoonJs ? 10 : 100) + } + } + } + ; + var g = -1 + , m = "undefined" == typeof cr_is_preview ? 200 : 0 + , _ = !0 + , v = !1 + , b = 0 + , w = 0 + , x = "undefined" == typeof cr_is_preview ? 3e3 : 0 + , S = null + , T = null + , A = 0; + function C(t, e) { + return e <= 128 ? t[3] : e <= 256 ? t[2] : e <= 512 ? t[1] : t[0] + } + i.prototype.draw_c2_splash_loader = function(t) { + if (!y) { + for (var e = Math.ceil(this.width), i = Math.ceil(this.height), s = (this.devicePixelRatio, + this.loaderlogos.logo), n = this.loaderlogos.powered, r = this.loaderlogos.website, o = 0; o < 4; ++o) + if (!s[o].complete || !n[o].complete || !r[o].complete) + return; + 0 === A && (g = Date.now()); + var a, h, c, l, u = Date.now(), p = !1, d = t; + _ || v ? (t.clearRect(0, 0, e, i), + c = e, + l = i, + S && S.width === c && S.height === l || ((S = document.createElement("canvas")).width = c, + S.height = l, + T = S.getContext("2d")), + d = T, + p = !0, + _ && 1 === A && (g = Date.now())) : t.globalAlpha = 1, + d.fillStyle = "#333333", + d.fillRect(0, 0, e, i), + 256 < this.cssHeight ? (h = .25 * (a = cr.clamp(.22 * i, 105, .6 * e)), + d.drawImage(C(n, a), .5 * e - a / 2, .2 * i - h / 2, a, h), + h = a = Math.min(.395 * i, .95 * e), + d.drawImage(C(s, a), .5 * e - a / 2, .485 * i - h / 2, a, h), + h = .25 * (a = cr.clamp(.22 * i, 105, .6 * e)), + d.drawImage(C(r, a), .5 * e - a / 2, .868 * i - h / 2, a, h), + d.fillStyle = "#3C3C3C", + a = e, + h = Math.max(.005 * i, 2), + d.fillRect(0, .8 * i - h / 2, a, h), + d.fillStyle = f ? "red" : "#E0FF65", + a = e * this.progress, + d.fillRect(.5 * e - a / 2, .8 * i - h / 2, a, h)) : (h = a = .55 * i, + d.drawImage(C(s, a), .5 * e - a / 2, .45 * i - h / 2, a, h), + d.fillStyle = "#3C3C3C", + a = e, + h = Math.max(.005 * i, 2), + d.fillRect(0, .85 * i - h / 2, a, h), + d.fillStyle = f ? "red" : "#E0FF65", + a = e * this.progress, + d.fillRect(.5 * e - a / 2, .85 * i - h / 2, a, h)), + p && (_ ? t.globalAlpha = 0 === A ? 0 : Math.min((u - g) / 300, 1) : v && (t.globalAlpha = Math.max(1 - (u - w) / 300, 0)), + t.drawImage(S, 0, 0, e, i)), + _ && 300 <= u - g && 2 <= A && (_ = !1, + b = u), + !_ && x <= u - b && !v && 1 <= this.progress && (v = !0, + w = u), + (v && 300 + m <= u - w || "undefined" != typeof cr_is_preview && 1 <= this.progress && Date.now() - g < 500) && (v = _ = !(y = !0), + T = S = null, + this.loaderlogos = null), + ++A + } + } + , + i.prototype.go_loading_finished = function() { + var t, e, i, s, n; + if (this.overlay_canvas && (this.canvas.parentNode.removeChild(this.overlay_canvas), + this.overlay_ctx = null, + this.overlay_canvas = null), + this.start_time = Date.now(), + this.last_fps_time = cr.performance_now(), + this.uses_loader_layout) + for (t = 0, + e = this.types_by_index.length; t < e; t++) + (i = this.types_by_index[t]).is_family || i.isOnLoaderLayout || !i.plugin.is_world || (i.onCreate(), + cr.seal(i)); + else + this.isloading = !1; + for (t = 0, + e = this.layouts_by_index.length; t < e; t++) + this.layouts_by_index[t].createGlobalNonWorlds(); + for (2 <= this.fullscreen_mode && (s = this.original_width / this.original_height, + n = this.width / this.height, + 2 !== this.fullscreen_mode && s < n || 2 === this.fullscreen_mode && n < s ? this.aspect_scale = this.height / this.original_height : this.aspect_scale = this.width / this.original_width), + (this.first_layout ? this.layouts[this.first_layout] : this.layouts_by_index[0]).startRunning(), + this.uses_loader_layout || (this.loadingprogress = 1, + this.trigger(cr.system_object.prototype.cnds.OnLoadFinished, null), + window.C2_RegisterSW && window.C2_RegisterSW()), + navigator.splashscreen && navigator.splashscreen.hide && navigator.splashscreen.hide(), + t = 0, + e = this.types_by_index.length; t < e; t++) + (i = this.types_by_index[t]).onAppBegin && i.onAppBegin(); + document.hidden || document.webkitHidden || document.mozHidden || document.msHidden ? window.cr_setSuspended(!0) : this.tick(!1), + this.isDirectCanvas && AppMobi.webview.execute("onGameReady();") + } + , + i.prototype.tick = function(t, e, i) { + var s, n, r; + this.running_layout && (s = r = cr.performance_now(), + !i && this.isSuspended && !t || (t || (u ? this.raf_id = u(this.tickFunc) : this.timeout_id = setTimeout(this.tickFunc, this.isMobile ? 1 : 16)), + n = e || r, + i = this.fullscreen_mode, + ((e = (document.mozFullScreen || document.webkitIsFullScreen || document.fullScreen || !!document.msFullscreenElement) && !this.isCordova) || this.isNodeFullscreen) && 0 < this.fullscreen_scaling && (i = this.fullscreen_scaling), + 0 < i && (r = window.innerWidth, + i = window.innerHeight, + this.lastWindowWidth === r && this.lastWindowHeight === i || this.setSize(r, i)), + this.isDomFree || (e ? this.firstInFullscreen || (this.firstInFullscreen = !0) : this.firstInFullscreen ? (this.firstInFullscreen = !1, + 0 === this.fullscreen_mode && this.setSize(Math.round(this.oldWidth / this.devicePixelRatio), Math.round(this.oldHeight / this.devicePixelRatio), !0)) : (this.oldWidth = this.width, + this.oldHeight = this.height)), + this.isloading && (e = this.areAllTexturesAndSoundsLoaded(), + this.loadingprogress = this.progress, + e && (this.isloading = !1, + this.progress = 1, + this.trigger(cr.system_object.prototype.cnds.OnLoadFinished, null), + window.C2_RegisterSW && window.C2_RegisterSW())), + this.logic(n), + !this.redraw && !this.isCocoonJs || this.is_WebGL_context_lost || this.suspendDrawing || t || (this.redraw = !1, + this.glwrap ? this.drawGL() : this.draw(), + this.snapshotCanvas && (this.canvas && this.canvas.toDataURL && (this.snapshotData = this.canvas.toDataURL(this.snapshotCanvas[0], this.snapshotCanvas[1]), + window.cr_onSnapshot && window.cr_onSnapshot(this.snapshotData), + this.trigger(cr.system_object.prototype.cnds.OnCanvasSnapshot, null)), + this.snapshotCanvas = null)), + this.hit_breakpoint || (this.tickcount++, + this.tickcount_nosave++, + this.execcount++, + this.framecount++), + this.logictime += cr.performance_now() - s)) + } + , + i.prototype.logic = function(t) { + var e, i, s, n; + 1e3 <= t - this.last_fps_time && (this.last_fps_time += 1e3, + 1e3 <= t - this.last_fps_time && (this.last_fps_time = t), + this.fps = this.framecount, + this.framecount = 0, + this.cpuutilisation = this.logictime, + this.logictime = 0); + var r = 0; + 0 !== this.last_tick_time && ((o = t - this.last_tick_time) < 0 && (o = 0), + r = o / 1e3, + this.dt1 = r, + .5 < this.dt1 ? this.dt1 = 0 : this.dt1 > 1 / this.minimumFramerate && (this.dt1 = 1 / this.minimumFramerate)), + this.last_tick_time = t, + this.dt = this.dt1 * this.timescale, + this.kahanTime.add(this.dt), + this.wallTime.add(r); + var o, a = (document.mozFullScreen || document.webkitIsFullScreen || document.fullScreen || !!document.msFullscreenElement || this.isNodeFullscreen) && !this.isCordova; + 2 <= this.fullscreen_mode || a && 0 < this.fullscreen_scaling ? (o = this.original_width / this.original_height, + t = this.width / this.height, + r = this.fullscreen_mode, + a && 0 < this.fullscreen_scaling && (r = this.fullscreen_scaling), + this.aspect_scale = 2 !== r && o < t || 2 === r && t < o ? this.height / this.original_height : this.width / this.original_width, + this.running_layout && (this.running_layout.scrollToX(this.running_layout.scrollX), + this.running_layout.scrollToY(this.running_layout.scrollY))) : this.aspect_scale = this.isRetina ? this.devicePixelRatio : 1, + this.ClearDeathRow(), + this.isInOnDestroy++, + this.system.runWaits(), + this.isInOnDestroy--, + this.ClearDeathRow(), + this.isInOnDestroy++; + for (var h = this.objects_to_pretick.valuesRef(), c = 0, l = h.length; c < l; c++) + h[c].pretick(); + for (c = 0, + l = this.types_by_index.length; c < l; c++) + if (!(s = this.types_by_index[c]).is_family && (s.behaviors.length || s.families.length)) + for (e = 0, + i = s.instances.length; e < i; e++) + for (p = 0, + d = (u = s.instances[e]).behavior_insts.length; p < d; p++) + u.behavior_insts[p].tick(); + for (c = 0, + l = this.types_by_index.length; c < l; c++) + if (!(s = this.types_by_index[c]).is_family && (s.behaviors.length || s.families.length)) + for (e = 0, + i = s.instances.length; e < i; e++) + for (p = 0, + d = (u = s.instances[e]).behavior_insts.length; p < d; p++) + (n = u.behavior_insts[p]).posttick && n.posttick(); + for (c = 0, + l = (h = this.objects_to_tick.valuesRef()).length; c < l; c++) + h[c].tick(); + for (this.isInOnDestroy--, + this.handleSaveLoad(), + c = 0; this.changelayout && c++ < 10; ) + this.doChangeLayout(this.changelayout); + for (c = 0, + l = this.eventsheets_by_index.length; c < l; c++) + this.eventsheets_by_index[c].hasRun = !1; + for (this.running_layout.event_sheet && this.running_layout.event_sheet.run(), + cr.clearArray(this.registered_collisions), + this.layout_first_tick = !1, + this.isInOnDestroy++, + c = 0, + l = this.types_by_index.length; c < l; c++) + if (!(s = this.types_by_index[c]).is_family && (s.behaviors.length || s.families.length)) + for (e = 0, + i = s.instances.length; e < i; e++) + for (var u, p = 0, d = (u = s.instances[e]).behavior_insts.length; p < d; p++) + (n = u.behavior_insts[p]).tick2 && n.tick2(); + for (c = 0, + l = (h = this.objects_to_tick2.valuesRef()).length; c < l; c++) + h[c].tick2(); + this.isInOnDestroy-- + } + , + i.prototype.onWindowBlur = function() { + for (var t, e, i, s, n, r, o, a = 0, h = this.types_by_index.length; a < h; a++) + if (!(n = this.types_by_index[a]).is_family) + for (t = 0, + e = n.instances.length; t < e; t++) + if ((r = n.instances[t]).onWindowBlur && r.onWindowBlur(), + r.behavior_insts) + for (i = 0, + s = r.behavior_insts.length; i < s; i++) + (o = r.behavior_insts[i]).onWindowBlur && o.onWindowBlur() + } + , + i.prototype.doChangeLayout = function(t) { + var e, i, s, n = this.running_layout; + if (this.running_layout.stopRunning(), + this.glwrap) + for (e = 0, + i = this.types_by_index.length; e < i; e++) + (s = this.types_by_index[e]).is_family || !s.unloadTextures || s.global && 0 !== s.instances.length || -1 !== t.initial_types.indexOf(s) || s.unloadTextures(); + n == t && cr.clearArray(this.system.waits), + cr.clearArray(this.registered_collisions), + this.runLayoutChangeMethods(!0), + t.startRunning(), + this.runLayoutChangeMethods(!1), + this.redraw = !0, + this.layout_first_tick = !0, + this.ClearDeathRow() + } + , + i.prototype.runLayoutChangeMethods = function(t) { + for (var e, i, s, n, r, o, a, h, c = 0, l = this.behaviors.length; c < l; c++) + e = this.behaviors[c], + t ? e.onBeforeLayoutChange && e.onBeforeLayoutChange() : e.onLayoutChange && e.onLayoutChange(); + for (c = 0, + l = this.types_by_index.length; c < l; c++) + if ((i = this.types_by_index[c]).global || i.plugin.singleglobal) + for (s = 0, + n = i.instances.length; s < n; s++) + if (r = i.instances[s], + t ? r.onBeforeLayoutChange && r.onBeforeLayoutChange() : r.onLayoutChange && r.onLayoutChange(), + r.behavior_insts) + for (o = 0, + a = r.behavior_insts.length; o < a; o++) + h = r.behavior_insts[o], + t ? h.onBeforeLayoutChange && h.onBeforeLayoutChange() : h.onLayoutChange && h.onLayoutChange() + } + , + i.prototype.pretickMe = function(t) { + this.objects_to_pretick.add(t) + } + , + i.prototype.unpretickMe = function(t) { + this.objects_to_pretick.remove(t) + } + , + i.prototype.tickMe = function(t) { + this.objects_to_tick.add(t) + } + , + i.prototype.untickMe = function(t) { + this.objects_to_tick.remove(t) + } + , + i.prototype.tick2Me = function(t) { + this.objects_to_tick2.add(t) + } + , + i.prototype.untick2Me = function(t) { + this.objects_to_tick2.remove(t) + } + , + i.prototype.getDt = function(t) { + return t && -1 !== t.my_timescale ? this.dt1 * t.my_timescale : this.dt + } + , + i.prototype.draw = function() { + this.running_layout.draw(this.ctx), + this.isDirectCanvas && this.ctx.present() + } + , + i.prototype.drawGL = function() { + this.enableFrontToBack && (this.earlyz_index = 1, + this.running_layout.drawGL_earlyZPass(this.glwrap)), + this.running_layout.drawGL(this.glwrap), + this.glwrap.present() + } + , + i.prototype.addDestroyCallback = function(t) { + t && this.destroycallbacks.push(t) + } + , + i.prototype.removeDestroyCallback = function(t) { + cr.arrayFindRemove(this.destroycallbacks, t) + } + , + i.prototype.getObjectByUID = function(t) { + t = t.toString(); + return this.objectsByUid.hasOwnProperty(t) ? this.objectsByUid[t] : null + } + ; + var d = []; + i.prototype.DestroyInstance = function(t) { + var e, i, s = t.type.name, n = null; + if (this.deathRow.hasOwnProperty(s)) { + if ((n = this.deathRow[s]).contains(t)) + return + } else + n = d.length ? d.pop() : new cr.ObjectSet, + this.deathRow[s] = n; + if (n.add(t), + this.hasPendingInstances = !0, + t.is_contained) + for (e = 0, + i = t.siblings.length; e < i; e++) + this.DestroyInstance(t.siblings[e]); + this.isInClearDeathRow && n.values_cache.push(t), + this.isEndingLayout || (this.isInOnDestroy++, + this.trigger(Object.getPrototypeOf(t.type.plugin).cnds.OnDestroyed, t), + this.isInOnDestroy--) + } + , + i.prototype.ClearDeathRow = function() { + if (this.hasPendingInstances) { + var t, e, i, s, n, r; + for (this.isInClearDeathRow = !0, + i = 0, + n = this.createRow.length; i < n; ++i) + for ((e = (t = this.createRow[i]).type).instances.push(t), + s = 0, + r = e.families.length; s < r; ++s) + e.families[s].instances.push(t), + e.families[s].stale_iids = !0; + cr.clearArray(this.createRow), + this.IterateDeathRow(), + cr.wipe(this.deathRow), + this.isInClearDeathRow = !1, + this.hasPendingInstances = !1 + } + } + , + i.prototype.IterateDeathRow = function() { + for (var t in this.deathRow) + this.deathRow.hasOwnProperty(t) && this.ClearDeathRowForType(this.deathRow[t]) + } + , + i.prototype.ClearDeathRowForType = function(t) { + var e, i, s, n, r, o, a, h, c = t.valuesRef(), l = c[0].type; + for (cr.arrayRemoveAllFromObjectSet(l.instances, t), + l.stale_iids = !0, + 0 === l.instances.length && (l.any_instance_parallaxed = !1), + e = 0, + i = l.families.length; e < i; ++e) + o = l.families[e], + cr.arrayRemoveAllFromObjectSet(o.instances, t), + o.stale_iids = !0; + for (e = 0, + i = this.system.waits.length; e < i; ++e) + if ((r = this.system.waits[e]).sols.hasOwnProperty(l.index) && cr.arrayRemoveAllFromObjectSet(r.sols[l.index].insts, t), + !l.is_family) + for (s = 0, + n = l.families.length; s < n; ++s) + o = l.families[s], + r.sols.hasOwnProperty(o.index) && cr.arrayRemoveAllFromObjectSet(r.sols[o.index].insts, t); + var u, p = c[0].layer; + if (p) { + if (p.useRenderCells) + for (e = 0, + i = (a = p.instances).length; e < i; ++e) + h = a[e], + t.contains(h) && (h.update_bbox(), + p.render_grid.update(h, h.rendercells, null), + h.rendercells.set(0, 0, -1, -1)); + cr.arrayRemoveAllFromObjectSet(p.instances, t), + p.setZIndicesStaleFrom(0) + } + for (e = 0; e < c.length; ++e) + this.ClearDeathRowForSingleInstance(c[e], l); + (u = t).clear(), + d.push(u), + this.redraw = !0 + } + , + i.prototype.ClearDeathRowForSingleInstance = function(t, e) { + for (var i, s = 0, n = this.destroycallbacks.length; s < n; ++s) + this.destroycallbacks[s](t); + t.collcells && e.collision_grid.update(t, t.collcells, null); + var r = t.layer; + if (r && r.removeFromInstanceList(t, !0), + t.behavior_insts) + for (s = 0, + n = t.behavior_insts.length; s < n; ++s) + (i = t.behavior_insts[s]).onDestroy && i.onDestroy(), + i.behavior.my_instances.remove(t); + this.objects_to_pretick.remove(t), + this.objects_to_tick.remove(t), + this.objects_to_tick2.remove(t), + t.onDestroy && t.onDestroy(), + this.objectsByUid.hasOwnProperty(t.uid.toString()) && delete this.objectsByUid[t.uid.toString()], + this.objectcount--, + e.deadCache.length < 100 && e.deadCache.push(t) + } + , + i.prototype.createInstance = function(t, e, i, s) { + if (t.is_family) { + var n = cr.floor(Math.random() * t.members.length); + return this.createInstance(t.members[n], e, i, s) + } + return t.default_instance ? this.createInstanceFromInit(t.default_instance, e, !1, i, s, !1) : null + } + ; + var k = []; + i.prototype.createInstanceFromInit = function(t, e, i, s, n, r) { + var o, a, h, c, l; + if (!t) + return null; + var u = this.types_by_index[t[1]] + , p = u.plugin.is_world; + if (this.isloading && p && !u.isOnLoaderLayout) + return null; + if (p && !this.glwrap && 11 === t[0][11]) + return null; + var d, f = e; + for (p || (e = null), + u.deadCache.length ? ((d = u.deadCache.pop()).recycled = !0, + u.plugin.Instance.call(d, u)) : (d = new u.plugin.Instance(u)).recycled = !1, + !i || r || this.objectsByUid.hasOwnProperty(t[2].toString()) ? d.uid = this.next_uid++ : d.uid = t[2], + (this.objectsByUid[d.uid.toString()] = d).puid = this.next_puid++, + d.iid = u.instances.length, + o = 0, + a = this.createRow.length; o < a; ++o) + this.createRow[o].type === u && d.iid++; + d.get_iid = cr.inst_get_iid, + d.toString = cr.inst_toString; + var y, g, m = t[3]; + if (d.recycled) + cr.wipe(d.extra); + else { + if (d.extra = {}, + "undefined" != typeof cr_is_preview) + for (d.instance_var_names = [], + d.instance_var_names.length = m.length, + o = 0, + a = m.length; o < a; o++) + d.instance_var_names[o] = m[o][1]; + d.instance_vars = [], + d.instance_vars.length = m.length + } + for (o = 0, + a = m.length; o < a; o++) + d.instance_vars[o] = m[o][0]; + if (p) { + var _ = t[0]; + if (d.x = cr.is_undefined(s) ? _[0] : s, + d.y = cr.is_undefined(n) ? _[1] : n, + d.z = _[2], + d.width = _[3], + d.height = _[4], + d.depth = _[5], + d.angle = _[6], + d.opacity = _[7], + d.hotspotX = _[8], + d.hotspotY = _[9], + d.blend_mode = _[10], + l = _[11], + !this.glwrap && u.effect_types.length && (d.blend_mode = l), + d.compositeOp = cr.effectToCompositeOp(d.blend_mode), + this.gl && cr.setGLBlend(d, d.blend_mode, this.gl), + d.recycled) { + for (o = 0, + a = _[12].length; o < a; o++) + for (h = 0, + c = _[12][o].length; h < c; h++) + d.effect_params[o][h] = _[12][o][h]; + d.bbox.set(0, 0, 0, 0), + d.collcells.set(0, 0, -1, -1), + d.rendercells.set(0, 0, -1, -1), + d.bquad.set_from_rect(d.bbox), + cr.clearArray(d.bbox_changed_callbacks) + } else { + for (d.effect_params = _[12].slice(0), + o = 0, + a = d.effect_params.length; o < a; o++) + d.effect_params[o] = _[12][o].slice(0); + d.active_effect_types = [], + d.active_effect_flags = [], + d.active_effect_flags.length = u.effect_types.length, + d.bbox = new cr.rect(0,0,0,0), + d.collcells = new cr.rect(0,0,-1,-1), + d.rendercells = new cr.rect(0,0,-1,-1), + d.bquad = new cr.quad, + d.bbox_changed_callbacks = [], + d.set_bbox_changed = cr.set_bbox_changed, + d.add_bbox_changed_callback = cr.add_bbox_changed_callback, + d.contains_pt = cr.inst_contains_pt, + d.update_bbox = cr.update_bbox, + d.update_render_cell = cr.update_render_cell, + d.update_collision_cell = cr.update_collision_cell, + d.get_zindex = cr.inst_get_zindex + } + for (d.tilemap_exists = !1, + d.tilemap_width = 0, + d.tilemap_height = 0, + d.tilemap_data = null, + 14 === _.length && (d.tilemap_exists = !0, + d.tilemap_width = _[13][0], + d.tilemap_height = _[13][1], + d.tilemap_data = _[13][2]), + o = 0, + a = u.effect_types.length; o < a; o++) + d.active_effect_flags[o] = !0; + d.shaders_preserve_opaqueness = !0, + d.updateActiveEffects = cr.inst_updateActiveEffects, + d.updateActiveEffects(), + d.uses_shaders = !!d.active_effect_types.length, + d.bbox_changed = !0, + d.cell_changed = !0, + u.any_cell_changed = !0, + d.visible = !0, + d.my_timescale = -1, + d.layer = e, + d.zindex = e.instances.length, + void (d.earlyz_index = 0) === d.collision_poly && (d.collision_poly = null), + d.collisionsEnabled = !0, + this.redraw = !0 + } + for (cr.clearArray(k), + o = 0, + a = u.families.length; o < a; o++) + k.push.apply(k, u.families[o].behaviors); + if (k.push.apply(k, u.behaviors), + d.recycled) + for (o = 0, + a = k.length; o < a; o++) { + var v = k[o]; + for ((g = d.behavior_insts[o]).recycled = !0, + v.behavior.Instance.call(g, v, d), + h = 0, + c = (y = t[4][o]).length; h < c; h++) + g.properties[h] = y[h]; + g.onCreate(), + v.behavior.my_instances.add(d) + } + else + for (d.behavior_insts = [], + o = 0, + a = k.length; o < a; o++) + (g = new (v = k[o]).behavior.Instance(v,d)).recycled = !1, + g.properties = t[4][o].slice(0), + g.onCreate(), + cr.seal(g), + d.behavior_insts.push(g), + v.behavior.my_instances.add(d); + if (y = t[5], + d.recycled) + for (o = 0, + a = y.length; o < a; o++) + d.properties[o] = y[o]; + else + d.properties = y.slice(0); + if (this.createRow.push(d), + this.hasPendingInstances = !0, + e && (e.appendToInstanceList(d, !0), + 1 === e.parallaxX && 1 === e.parallaxY || (u.any_instance_parallaxed = !0)), + this.objectcount++, + u.is_contained) { + if (d.is_contained = !0, + d.recycled ? cr.clearArray(d.siblings) : d.siblings = [], + !i && !r) { + for (o = 0, + a = u.container.length; o < a; o++) + if (u.container[o] !== u) { + if (!u.container[o].default_instance) + return null; + d.siblings.push(this.createInstanceFromInit(u.container[o].default_instance, f, !1, p ? d.x : s, p ? d.y : n, !0)) + } + for (o = 0, + a = d.siblings.length; o < a; o++) + for (d.siblings[o].siblings.push(d), + h = 0; h < a; h++) + o !== h && d.siblings[o].siblings.push(d.siblings[h]) + } + } else + d.is_contained = !1, + d.siblings = null; + for (d.onCreate(), + d.recycled || cr.seal(d), + o = 0, + a = d.behavior_insts.length; o < a; o++) + d.behavior_insts[o].postCreate && d.behavior_insts[o].postCreate(); + return d + } + , + i.prototype.getLayerByName = function(t) { + for (var e = 0, i = this.running_layout.layers.length; e < i; e++) { + var s = this.running_layout.layers[e]; + if (cr.equals_nocase(s.name, t)) + return s + } + return null + } + , + i.prototype.getLayerByNumber = function(t) { + return (t = cr.floor(t)) < 0 && (t = 0), + t >= this.running_layout.layers.length && (t = this.running_layout.layers.length - 1), + this.running_layout.layers[t] + } + , + i.prototype.getLayer = function(t) { + return cr.is_number(t) ? this.getLayerByNumber(t) : this.getLayerByName(t.toString()) + } + , + i.prototype.clearSol = function(t) { + for (var e = 0, i = t.length; e < i; e++) + t[e].getCurrentSol().select_all = !0 + } + , + i.prototype.pushCleanSol = function(t) { + for (var e = 0, i = t.length; e < i; e++) + t[e].pushCleanSol() + } + , + i.prototype.pushCopySol = function(t) { + for (var e = 0, i = t.length; e < i; e++) + t[e].pushCopySol() + } + , + i.prototype.popSol = function(t) { + for (var e = 0, i = t.length; e < i; e++) + t[e].popSol() + } + , + i.prototype.updateAllCells = function(t) { + if (t.any_cell_changed) { + for (var e = t.instances, i = 0, s = e.length; i < s; ++i) + e[i].update_collision_cell(); + var n = this.createRow; + for (i = 0, + s = n.length; i < s; ++i) + n[i].type === t && n[i].update_collision_cell(); + t.any_cell_changed = !1 + } + } + , + i.prototype.getCollisionCandidates = function(t, e, i, s) { + var n, r, o, a = !!t && (1 !== t.parallaxX || 1 !== t.parallaxY); + if (e.is_family) + for (n = 0, + r = e.members.length; n < r; ++n) + o = e.members[n], + a || o.any_instance_parallaxed ? cr.appendArray(s, o.instances) : (this.updateAllCells(o), + o.collision_grid.queryRange(i, s)); + else + a || e.any_instance_parallaxed ? cr.appendArray(s, e.instances) : (this.updateAllCells(e), + e.collision_grid.queryRange(i, s)) + } + , + i.prototype.getTypesCollisionCandidates = function(t, e, i, s) { + for (var n = 0, r = e.length; n < r; ++n) + this.getCollisionCandidates(t, e[n], i, s) + } + , + i.prototype.getSolidCollisionCandidates = function(t, e, i) { + var s = this.getSolidBehavior(); + if (!s) + return null; + this.getTypesCollisionCandidates(t, s.my_types, e, i) + } + , + i.prototype.getJumpthruCollisionCandidates = function(t, e, i) { + var s = this.getJumpthruBehavior(); + if (!s) + return null; + this.getTypesCollisionCandidates(t, s.my_types, e, i) + } + , + i.prototype.testAndSelectCanvasPointOverlap = function(t, e, i, s) { + var n, r, o, a, h, c, l, u = t.getCurrentSol(), p = this.getCurrentEventStack().current_event.orblock; + if (u.select_all) + for (s || (u.select_all = !1, + cr.clearArray(u.instances)), + n = 0, + a = t.instances.length; n < a; n++) + if ((o = t.instances[n]).update_bbox(), + h = o.layer.canvasToLayer(e, i, !0), + c = o.layer.canvasToLayer(e, i, !1), + o.contains_pt(h, c)) { + if (s) + return !1; + u.instances.push(o) + } else + p && u.else_instances.push(o); + else { + for (n = r = 0, + a = (l = p ? u.else_instances : u.instances).length; n < a; n++) + if ((o = l[n]).update_bbox(), + h = o.layer.canvasToLayer(e, i, !0), + c = o.layer.canvasToLayer(e, i, !1), + o.contains_pt(h, c)) { + if (s) + return !1; + p ? u.instances.push(o) : (u.instances[r] = u.instances[n], + r++) + } + s || (l.length = r) + } + return t.applySolToContainer(), + !!s || u.hasObjects() + } + , + i.prototype.testOverlap = function(t, e) { + if (!(t && e && t !== e && t.collisionsEnabled && e.collisionsEnabled)) + return !1; + t.update_bbox(), + e.update_bbox(); + var i, s, n, r, o, a, h, c, l, u, p = t.layer, d = e.layer; + if (p === d || p.parallaxX === d.parallaxX && d.parallaxY == d.parallaxY && p.scale === d.scale && p.angle === d.angle && p.zoomRate === d.zoomRate) + return !!t.bbox.intersects_rect(e.bbox) && (!!t.bquad.intersects_quad(e.bquad) && ((!t.tilemap_exists || !e.tilemap_exists) && (t.tilemap_exists ? this.testTilemapOverlap(t, e) : e.tilemap_exists ? this.testTilemapOverlap(e, t) : (h = t.collision_poly && !t.collision_poly.is_empty(), + c = e.collision_poly && !e.collision_poly.is_empty(), + !h && !c || (l = h ? (t.collision_poly.cache_poly(t.width, t.height, t.angle), + t.collision_poly) : (this.temp_poly.set_from_quad(t.bquad, t.x, t.y, t.width, t.height), + this.temp_poly), + u = c ? (e.collision_poly.cache_poly(e.width, e.height, e.angle), + e.collision_poly) : (this.temp_poly.set_from_quad(e.bquad, e.x, e.y, e.width, e.height), + this.temp_poly), + l.intersects_poly(u, e.x - t.x, e.y - t.y)))))); + for (h = t.collision_poly && !t.collision_poly.is_empty(), + c = e.collision_poly && !e.collision_poly.is_empty(), + h ? (t.collision_poly.cache_poly(t.width, t.height, t.angle), + this.temp_poly.set_from_poly(t.collision_poly)) : this.temp_poly.set_from_quad(t.bquad, t.x, t.y, t.width, t.height), + l = this.temp_poly, + c ? (e.collision_poly.cache_poly(e.width, e.height, e.angle), + this.temp_poly2.set_from_poly(e.collision_poly)) : this.temp_poly2.set_from_quad(e.bquad, e.x, e.y, e.width, e.height), + u = this.temp_poly2, + i = 0, + s = l.pts_count; i < s; i++) + r = (n = 2 * i) + 1, + o = l.pts_cache[n], + a = l.pts_cache[r], + l.pts_cache[n] = p.layerToCanvas(o + t.x, a + t.y, !0), + l.pts_cache[r] = p.layerToCanvas(o + t.x, a + t.y, !1); + for (l.update_bbox(), + i = 0, + s = u.pts_count; i < s; i++) + r = (n = 2 * i) + 1, + o = u.pts_cache[n], + a = u.pts_cache[r], + u.pts_cache[n] = d.layerToCanvas(o + e.x, a + e.y, !0), + u.pts_cache[r] = d.layerToCanvas(o + e.x, a + e.y, !1); + return u.update_bbox(), + l.intersects_poly(u, 0, 0) + } + ; + var p = new cr.quad + , O = new cr.rect(0,0,0,0) + , I = []; + i.prototype.testTilemapOverlap = function(t, e) { + var i, s, n = e.bbox, r = t.x, o = t.y; + t.getCollisionRectCandidates(n, I); + for (var a = I, h = e.collision_poly && !e.collision_poly.is_empty(), c = 0, l = a.length; c < l; ++c) + if (i = a[c], + s = i.rc, + n.intersects_rect_off(s, r, o) && (p.set_from_rect(s), + p.offset(r, o), + p.intersects_quad(e.bquad))) + if (h) { + if (e.collision_poly.cache_poly(e.width, e.height, e.angle), + i.poly) { + if (i.poly.intersects_poly(e.collision_poly, e.x - (r + s.left), e.y - (o + s.top))) + return cr.clearArray(I), + !0 + } else if (this.temp_poly.set_from_quad(p, 0, 0, s.right - s.left, s.bottom - s.top), + this.temp_poly.intersects_poly(e.collision_poly, e.x, e.y)) + return cr.clearArray(I), + !0 + } else { + if (!i.poly) + return cr.clearArray(I), + !0; + if (this.temp_poly.set_from_quad(e.bquad, 0, 0, e.width, e.height), + i.poly.intersects_poly(this.temp_poly, -(r + s.left), -(o + s.top))) + return cr.clearArray(I), + !0 + } + return cr.clearArray(I), + !1 + } + , + i.prototype.testRectOverlap = function(t, e) { + if (!e || !e.collisionsEnabled) + return !1; + e.update_bbox(); + e.layer; + if (!e.bbox.intersects_rect(t)) + return !1; + if (e.tilemap_exists) { + e.getCollisionRectCandidates(t, I); + for (var i, s, n = I, r = e.x, o = e.y, a = 0, h = n.length; a < h; ++a) + if (s = (i = n[a]).rc, + t.intersects_rect_off(s, r, o)) { + if (!i.poly) + return cr.clearArray(I), + !0; + if (this.temp_poly.set_from_rect(t, 0, 0), + i.poly.intersects_poly(this.temp_poly, -(r + s.left), -(o + s.top))) + return cr.clearArray(I), + !0 + } + return cr.clearArray(I), + !1 + } + return p.set_from_rect(t), + !!e.bquad.intersects_quad(p) && (!(e.collision_poly && !e.collision_poly.is_empty()) || (e.collision_poly.cache_poly(e.width, e.height, e.angle), + p.offset(-t.left, -t.top), + this.temp_poly.set_from_quad(p, 0, 0, 1, 1), + e.collision_poly.intersects_poly(this.temp_poly, t.left - e.x, t.top - e.y))) + } + , + i.prototype.testSegmentOverlap = function(t, e, i, s, n) { + if (!n || !n.collisionsEnabled) + return !1; + n.update_bbox(); + n.layer; + if (O.set(cr.min(t, i), cr.min(e, s), cr.max(t, i), cr.max(e, s)), + !n.bbox.intersects_rect(O)) + return !1; + if (n.tilemap_exists) { + n.getCollisionRectCandidates(O, I); + for (var r, o, a = I, h = n.x, c = n.y, l = 0, u = a.length; l < u; ++l) + if (r = a[l], + o = r.rc, + O.intersects_rect_off(o, h, c) && (p.set_from_rect(o), + p.offset(h, c), + p.intersects_segment(t, e, i, s))) { + if (!r.poly) + return cr.clearArray(I), + !0; + if (r.poly.intersects_segment(h + o.left, c + o.top, t, e, i, s)) + return cr.clearArray(I), + !0 + } + return cr.clearArray(I), + !1 + } + return !!n.bquad.intersects_segment(t, e, i, s) && (!(n.collision_poly && !n.collision_poly.is_empty()) || (n.collision_poly.cache_poly(n.width, n.height, n.angle), + n.collision_poly.intersects_segment(n.x, n.y, t, e, i, s))) + } + , + i.prototype.typeHasBehavior = function(t, e) { + if (!e) + return !1; + for (var i, s, n, r = 0, o = t.behaviors.length; r < o; r++) + if (t.behaviors[r].behavior instanceof e) + return !0; + if (!t.is_family) + for (r = 0, + o = t.families.length; r < o; r++) + for (i = 0, + s = (n = t.families[r]).behaviors.length; i < s; i++) + if (n.behaviors[i].behavior instanceof e) + return !0; + return !1 + } + , + i.prototype.typeHasNoSaveBehavior = function(t) { + return this.typeHasBehavior(t, cr.behaviors.NoSave) + } + , + i.prototype.typeHasPersistBehavior = function(t) { + return this.typeHasBehavior(t, cr.behaviors.Persist) + } + , + i.prototype.getSolidBehavior = function() { + return this.solidBehavior + } + , + i.prototype.getJumpthruBehavior = function() { + return this.jumpthruBehavior + } + ; + var o = []; + i.prototype.testOverlapSolid = function(t) { + var e, i, s; + for (t.update_bbox(), + this.getSolidCollisionCandidates(t.layer, t.bbox, o), + e = 0, + i = o.length; e < i; ++e) + if (s = o[e], + s.extra.solidEnabled && this.testOverlap(t, s)) + return cr.clearArray(o), + s; + return cr.clearArray(o), + null + } + , + i.prototype.testRectOverlapSolid = function(t) { + var e, i, s; + for (this.getSolidCollisionCandidates(null, t, o), + e = 0, + i = o.length; e < i; ++e) + if (s = o[e], + s.extra.solidEnabled && this.testRectOverlap(t, s)) + return cr.clearArray(o), + s; + return cr.clearArray(o), + null + } + ; + var a = []; + i.prototype.testOverlapJumpThru = function(t, e) { + var i, s, n, r = null; + for (e && (r = a, + cr.clearArray(r)), + t.update_bbox(), + this.getJumpthruCollisionCandidates(t.layer, t.bbox, o), + i = 0, + s = o.length; i < s; ++i) + if (n = o[i], + n.extra.jumpthruEnabled && this.testOverlap(t, n)) { + if (!e) + return cr.clearArray(o), + n; + r.push(n) + } + return cr.clearArray(o), + r + } + , + i.prototype.pushOutSolid = function(t, e, i, s, n, r) { + for (var o = s || 50, a = t.x, h = t.y, c = null, l = null, u = 0; u < o; u++) + if (t.x = a + e * u, + t.y = h + i * u, + t.set_bbox_changed(), + !this.testOverlap(t, c) && (c = this.testOverlapSolid(t), + c && (l = c), + !c && (n && (c = r ? this.testOverlap(t, r) ? r : null : this.testOverlapJumpThru(t)) && (l = c), + !c))) + return l && this.pushInFractional(t, e, i, l, 16), + !0; + return t.x = a, + t.y = h, + t.set_bbox_changed(), + !1 + } + , + i.prototype.pushOutSolidAxis = function(t, e, i, s) { + s = s || 50; + for (var n, r, o = t.x, a = t.y, h = null, c = null, l = 0; l < s; ++l) + for (n = 0; n < 2; ++n) + if (r = 2 * n - 1, + t.x = o + e * l * r, + t.y = a + i * l * r, + t.set_bbox_changed(), + !this.testOverlap(t, h)) { + if (!(h = this.testOverlapSolid(t))) + return c && this.pushInFractional(t, e * r, i * r, c, 16), + !0; + c = h + } + return t.x = o, + t.y = a, + t.set_bbox_changed(), + !1 + } + , + i.prototype.pushOut = function(t, e, i, s, n) { + for (var r = s || 50, o = t.x, a = t.y, h = 0; h < r; h++) + if (t.x = o + e * h, + t.y = a + i * h, + t.set_bbox_changed(), + !this.testOverlap(t, n)) + return !0; + return t.x = o, + t.y = a, + t.set_bbox_changed(), + !1 + } + , + i.prototype.pushInFractional = function(t, e, i, s, n) { + for (var r, o = 2, a = !1, h = !1, c = t.x, l = t.y; o <= n; ) + r = 1 / o, + o *= 2, + t.x += e * r * (a ? 1 : -1), + t.y += i * r * (a ? 1 : -1), + t.set_bbox_changed(), + this.testOverlap(t, s) ? h = a = !0 : (h = a = !1, + c = t.x, + l = t.y); + h && (t.x = c, + t.y = l, + t.set_bbox_changed()) + } + , + i.prototype.pushOutSolidNearest = function(t, e) { + var i = cr.is_undefined(e) ? 100 : e + , s = 0 + , n = t.x + , r = t.y + , o = 0 + , a = 0 + , h = 0 + , c = this.testOverlapSolid(t); + if (!c) + return !0; + for (; s <= i; ) { + switch (o) { + case 0: + a = 0, + h = -1, + s++; + break; + case 1: + h = -(a = 1); + break; + case 2: + a = 1, + h = 0; + break; + case 3: + h = a = 1; + break; + case 4: + a = 0, + h = 1; + break; + case 5: + a = -1, + h = 1; + break; + case 6: + a = -1, + h = 0; + break; + case 7: + h = a = -1 + } + if (o = (o + 1) % 8, + t.x = cr.floor(n + a * s), + t.y = cr.floor(r + h * s), + t.set_bbox_changed(), + !this.testOverlap(t, c) && !(c = this.testOverlapSolid(t))) + return !0 + } + return t.x = n, + t.y = r, + t.set_bbox_changed(), + !1 + } + , + i.prototype.registerCollision = function(t, e) { + t.collisionsEnabled && e.collisionsEnabled && this.registered_collisions.push([t, e]) + } + , + i.prototype.addRegisteredCollisionCandidates = function(t, e, i) { + for (var s, n, r = 0, o = this.registered_collisions.length; r < o; ++r) { + if ((s = this.registered_collisions[r])[0] === t) + n = s[1]; + else { + if (s[1] !== t) + continue; + n = s[0] + } + if (e.is_family) { + if (-1 === e.members.indexOf(e)) + continue + } else if (n.type !== e) + continue; + -1 === i.indexOf(n) && i.push(n) + } + } + , + i.prototype.checkRegisteredCollision = function(t, e) { + for (var i, s = 0, n = this.registered_collisions.length; s < n; s++) + if ((i = this.registered_collisions[s])[0] === t && i[1] === e || i[0] === e && i[1] === t) + return !0; + return !1 + } + , + i.prototype.calculateSolidBounceAngle = function(t, e, i, s) { + var n = t.x + , r = t.y + , o = cr.max(10, cr.distanceTo(e, i, n, r)) + , a = cr.angleTo(e, i, n, r) + , h = s || this.testOverlapSolid(t); + if (!h) + return cr.clamp_angle(a + cr.PI); + for (var c, l, u, p = h, d = cr.to_radians(5), f = 1; f < 36; f++) + if (c = a - f * d, + t.x = e + Math.cos(c) * o, + t.y = i + Math.sin(c) * o, + t.set_bbox_changed(), + !this.testOverlap(t, p) && !(p = s ? null : this.testOverlapSolid(t))) { + l = c; + break + } + 36 === f && (l = cr.clamp_angle(a + cr.PI)); + p = h; + for (f = 1; f < 36; f++) + if (c = a + f * d, + t.x = e + Math.cos(c) * o, + t.y = i + Math.sin(c) * o, + t.set_bbox_changed(), + !this.testOverlap(t, p) && !(p = s ? null : this.testOverlapSolid(t))) { + u = c; + break + } + if (36 === f && (u = cr.clamp_angle(a + cr.PI)), + t.x = n, + t.y = r, + t.set_bbox_changed(), + u === l) + return u; + var y = cr.angleDiff(u, l) / 2 + , g = cr.angleClockwise(u, l) ? cr.clamp_angle(l + y + cr.PI) : cr.clamp_angle(u + y) + , h = Math.cos(a) + , n = Math.sin(a) + , r = Math.cos(g) + , y = Math.sin(g) + , g = h * r + n * y + , r = h - 2 * g * r + , y = n - 2 * g * y; + return cr.angleTo(0, 0, r, y) + } + ; + var P = -1; + function l() { + try { + return window.indexedDB + } catch (t) { + return + } + } + function E(t) { + t.target.result.createObjectStore("saves", { + keyPath: "slot" + }) + } + function B() { + cr.logexport("Reloading for continuous preview"), + window.c2cocoonjs ? CocoonJS.App.reload() : -1 < window.location.search.indexOf("continuous") ? window.location.reload(!0) : window.location = window.location + "?continuous" + } + function R(t) { + var e, i = {}; + for (e in t) + t.hasOwnProperty(e) && (t[e]instanceof cr.ObjectSet || t[e] && void 0 !== t[e].c2userdata || "spriteCreatedDestroyCallback" !== e && (i[e] = t[e])); + return i + } + i.prototype.trigger = function(t, e, i) { + if (!this.running_layout) + return !1; + var s = this.running_layout.event_sheet; + if (!s) + return !1; + var n, r = !1; + P++; + for (var o = s.deep_includes, a = 0, h = o.length; a < h; ++a) + n = this.triggerOnSheet(t, e, o[a], i), + r = r || n; + return n = this.triggerOnSheet(t, e, s, i), + P--, + r = r || n + } + , + i.prototype.triggerOnSheet = function(t, e, i, s) { + var n, r, o, a, h = !1; + if (e) + for (o = this.triggerOnSheetForTypeName(t, e, e.type.name, i, s), + h = h || o, + n = 0, + r = (a = e.type.families).length; n < r; ++n) + o = this.triggerOnSheetForTypeName(t, e, a[n].name, i, s), + h = h || o; + else + o = this.triggerOnSheetForTypeName(t, e, "system", i, s), + h = h || o; + return h + } + , + i.prototype.triggerOnSheetForTypeName = function(t, e, i, s, n) { + var r, o, a, h = !1, c = void 0 !== n, l = (c ? s.fasttriggers : s.triggers)[i]; + if (!l) + return h; + for (var u, p = null, d = 0, f = l.length; d < f; ++d) + if (l[d].method == t) { + p = l[d].evs; + break + } + if (!p) + return h; + if (!(u = c ? p[n] : p)) + return null; + for (d = 0, + f = u.length; d < f; d++) + o = u[d][0], + a = u[d][1], + r = this.executeSingleTrigger(e, i, o, a), + h = h || r; + return h + } + , + i.prototype.executeSingleTrigger = function(t, e, i, s) { + var n, r, o = !1; + this.trigger_depth++; + var a = this.getCurrentEventStack().current_event; + a && this.pushCleanSol(a.solModifiersIncludingParents); + var h = 1 < this.trigger_depth; + this.pushCleanSol(i.solModifiersIncludingParents), + h && this.pushLocalVarStack(); + var c, l = this.pushEventStack(i); + l.current_event = i, + t && ((c = this.types[e].getCurrentSol()).select_all = !1, + cr.clearArray(c.instances), + c.instances[0] = t, + this.types[e].applySolToContainer()); + var u = !0; + if (i.parent) { + for (var p = l.temp_parents_arr, d = i.parent; d; ) + p.push(d), + d = d.parent; + for (p.reverse(), + n = 0, + r = p.length; n < r; n++) + if (!p[n].run_pretrigger()) { + u = !1; + break + } + } + return u && (this.execcount++, + i.orblock ? i.run_orblocktrigger(s) : i.run(), + o = o || l.last_event_true), + this.popEventStack(), + h && this.popLocalVarStack(), + this.popSol(i.solModifiersIncludingParents), + a && this.popSol(a.solModifiersIncludingParents), + this.hasPendingInstances && 0 === this.isInOnDestroy && 0 === P && !this.isRunningEvents && this.ClearDeathRow(), + this.trigger_depth--, + o + } + , + i.prototype.getCurrentCondition = function() { + var t = this.getCurrentEventStack(); + return t.current_event.conditions[t.cndindex] + } + , + i.prototype.getCurrentConditionObjectType = function() { + return this.getCurrentCondition().type + } + , + i.prototype.isCurrentConditionFirst = function() { + return 0 === this.getCurrentEventStack().cndindex + } + , + i.prototype.getCurrentAction = function() { + var t = this.getCurrentEventStack(); + return t.current_event.actions[t.actindex] + } + , + i.prototype.pushLocalVarStack = function() { + this.localvar_stack_index++, + this.localvar_stack_index >= this.localvar_stack.length && this.localvar_stack.push([]) + } + , + i.prototype.popLocalVarStack = function() { + this.localvar_stack_index-- + } + , + i.prototype.getCurrentLocalVarStack = function() { + return this.localvar_stack[this.localvar_stack_index] + } + , + i.prototype.pushEventStack = function(t) { + this.event_stack_index++, + this.event_stack_index >= this.event_stack.length && this.event_stack.push(new cr.eventStackFrame); + var e = this.getCurrentEventStack(); + return e.reset(t), + e + } + , + i.prototype.popEventStack = function() { + this.event_stack_index-- + } + , + i.prototype.getCurrentEventStack = function() { + return this.event_stack[this.event_stack_index] + } + , + i.prototype.pushLoopStack = function(t) { + this.loop_stack_index++, + this.loop_stack_index >= this.loop_stack.length && this.loop_stack.push(cr.seal({ + name: t, + index: 0, + stopped: !1 + })); + var e = this.getCurrentLoop(); + return e.name = t, + e.index = 0, + e.stopped = !1, + e + } + , + i.prototype.popLoopStack = function() { + this.loop_stack_index-- + } + , + i.prototype.getCurrentLoop = function() { + return this.loop_stack[this.loop_stack_index] + } + , + i.prototype.getEventVariableByName = function(t, e) { + for (var i, s, n, r, o, a; e; ) { + for (i = 0, + s = e.subevents.length; i < s; i++) + if ((a = e.subevents[i])instanceof cr.eventvariable && cr.equals_nocase(t, a.name)) + return a; + e = e.parent + } + for (i = 0, + s = this.eventsheets_by_index.length; i < s; i++) + for (n = 0, + r = (o = this.eventsheets_by_index[i]).events.length; n < r; n++) + if ((a = o.events[n])instanceof cr.eventvariable && cr.equals_nocase(t, a.name)) + return a; + return null + } + , + i.prototype.getLayoutBySid = function(t) { + for (var e = 0, i = this.layouts_by_index.length; e < i; e++) + if (this.layouts_by_index[e].sid === t) + return this.layouts_by_index[e]; + return null + } + , + i.prototype.getObjectTypeBySid = function(t) { + for (var e = 0, i = this.types_by_index.length; e < i; e++) + if (this.types_by_index[e].sid === t) + return this.types_by_index[e]; + return null + } + , + i.prototype.getGroupBySid = function(t) { + for (var e = 0, i = this.allGroups.length; e < i; e++) + if (this.allGroups[e].sid === t) + return this.allGroups[e]; + return null + } + , + i.prototype.doCanvasSnapshot = function(t, e) { + this.snapshotCanvas = [t, e], + this.redraw = !0 + } + , + i.prototype.signalContinuousPreview = function() { + this.signalledContinuousPreview = !0 + } + , + i.prototype.handleSaveLoad = function() { + var i = this + , t = this.saveToSlot + , s = this.lastSaveJson + , e = this.loadFromSlot + , n = !1; + if (this.signalledContinuousPreview && (n = !0, + t = "__c2_continuouspreview", + this.signalledContinuousPreview = !1), + t.length) { + if (this.ClearDeathRow(), + s = this.saveToJSONString(), + l() && !this.isCocoonJs) + !function(e, i, s, n) { + try { + var t = indexedDB.open("_C2SaveStates"); + t.onupgradeneeded = E, + t.onerror = n, + t.onsuccess = function(t) { + t = t.target.result; + t.onerror = n, + t.transaction(["saves"], "readwrite").objectStore("saves").put({ + slot: e, + data: i + }).onsuccess = s + } + } catch (t) { + n(t) + } + }(t, s, function() { + cr.logexport("Saved state to IndexedDB storage (" + s.length + " bytes)"), + i.lastSaveJson = s, + i.trigger(cr.system_object.prototype.cnds.OnSaveComplete, null), + i.lastSaveJson = "", + n && B() + }, function(e) { + try { + localStorage.setItem("__c2save_" + t, s), + cr.logexport("Saved state to WebStorage (" + s.length + " bytes)"), + i.lastSaveJson = s, + i.trigger(cr.system_object.prototype.cnds.OnSaveComplete, null), + i.lastSaveJson = "", + n && B() + } catch (t) { + cr.logexport("Failed to save game state: " + e + "; " + t), + i.trigger(cr.system_object.prototype.cnds.OnSaveFailed, null) + } + }); + else + try { + localStorage.setItem("__c2save_" + t, s), + cr.logexport("Saved state to WebStorage (" + s.length + " bytes)"), + i.lastSaveJson = s, + this.trigger(cr.system_object.prototype.cnds.OnSaveComplete, null), + i.lastSaveJson = "", + n && B() + } catch (t) { + cr.logexport("Error saving to WebStorage: " + t), + i.trigger(cr.system_object.prototype.cnds.OnSaveFailed, null) + } + this.saveToSlot = "", + this.loadFromSlot = "", + this.loadFromJson = null + } + if (e.length) { + if (l() && !this.isCocoonJs) + !function(i, s, n) { + try { + var t = indexedDB.open("_C2SaveStates"); + t.onupgradeneeded = E, + t.onerror = n, + t.onsuccess = function(t) { + t = t.target.result; + t.onerror = n; + var e = t.transaction(["saves"]).objectStore("saves").get(i); + e.onsuccess = function(t) { + e.result ? s(e.result.data) : s(null) + } + } + } catch (t) { + n(t) + } + }(e, function(t) { + t ? (i.loadFromJson = t, + cr.logexport("Loaded state from IndexedDB storage (" + i.loadFromJson.length + " bytes)")) : (i.loadFromJson = localStorage.getItem("__c2save_" + e) || "", + cr.logexport("Loaded state from WebStorage (" + i.loadFromJson.length + " bytes)")), + i.suspendDrawing = !1, + i.loadFromJson || (i.loadFromJson = null, + i.trigger(cr.system_object.prototype.cnds.OnLoadFailed, null)) + }, function(t) { + i.loadFromJson = localStorage.getItem("__c2save_" + e) || "", + cr.logexport("Loaded state from WebStorage (" + i.loadFromJson.length + " bytes)"), + i.suspendDrawing = !1, + i.loadFromJson || (i.loadFromJson = null, + i.trigger(cr.system_object.prototype.cnds.OnLoadFailed, null)) + }); + else { + try { + this.loadFromJson = localStorage.getItem("__c2save_" + e) || "", + cr.logexport("Loaded state from WebStorage (" + this.loadFromJson.length + " bytes)") + } catch (t) { + this.loadFromJson = null + } + this.suspendDrawing = !1, + i.loadFromJson || (i.loadFromJson = null, + i.trigger(cr.system_object.prototype.cnds.OnLoadFailed, null)) + } + this.loadFromSlot = "", + this.saveToSlot = "" + } + null !== this.loadFromJson && (this.ClearDeathRow(), + this.loadFromJSONString(this.loadFromJson) ? (this.lastSaveJson = this.loadFromJson, + this.trigger(cr.system_object.prototype.cnds.OnLoadComplete, null), + this.lastSaveJson = "") : i.trigger(cr.system_object.prototype.cnds.OnLoadFailed, null), + this.loadFromJson = null) + } + , + i.prototype.saveToJSONString = function() { + for (var t, e, i, s, n, r, o, a, h, c, l = { + c2save: !0, + version: 1, + rt: { + time: this.kahanTime.sum, + walltime: this.wallTime.sum, + timescale: this.timescale, + tickcount: this.tickcount, + execcount: this.execcount, + next_uid: this.next_uid, + running_layout: this.running_layout.sid, + start_time_offset: Date.now() - this.start_time + }, + types: {}, + layouts: {}, + events: { + groups: {}, + cnds: {}, + acts: {}, + vars: {} + } + }, u = 0, p = this.types_by_index.length; u < p; u++) + if (!(i = this.types_by_index[u]).is_family && !this.typeHasNoSaveBehavior(i)) { + for (n = { + instances: [] + }, + cr.hasAnyOwnProperty(i.extra) && (n.ex = R(i.extra)), + t = 0, + e = i.instances.length; t < e; t++) + n.instances.push(this.saveInstanceToJSON(i.instances[t])); + l.types[i.sid.toString()] = n + } + for (u = 0, + p = this.layouts_by_index.length; u < p; u++) + s = this.layouts_by_index[u], + l.layouts[s.sid.toString()] = s.saveToJSON(); + var d = l.events.groups; + for (u = 0, + p = this.allGroups.length; u < p; u++) + d[(r = this.allGroups[u]).sid.toString()] = this.groups_by_name[r.group_name].group_active; + var f = l.events.cnds; + for (c in this.cndsBySid) + this.cndsBySid.hasOwnProperty(c) && (o = this.cndsBySid[c], + cr.hasAnyOwnProperty(o.extra) && (f[c] = { + ex: R(o.extra) + })); + var y = l.events.acts; + for (c in this.actsBySid) + this.actsBySid.hasOwnProperty(c) && (a = this.actsBySid[c], + cr.hasAnyOwnProperty(a.extra) && (y[c] = { + ex: R(a.extra) + })); + var g = l.events.vars; + for (c in this.varsBySid) + this.varsBySid.hasOwnProperty(c) && ((h = this.varsBySid[c]).is_constant || h.parent && !h.is_static || (g[c] = h.data)); + return l.system = this.system.saveToJSON(), + JSON.stringify(l) + } + , + i.prototype.refreshUidMap = function() { + var t, e, i, s, n, r; + for (this.objectsByUid = {}, + t = 0, + e = this.types_by_index.length; t < e; t++) + if (!(i = this.types_by_index[t]).is_family) + for (s = 0, + n = i.instances.length; s < n; s++) + r = i.instances[s], + this.objectsByUid[r.uid.toString()] = r + } + , + i.prototype.loadFromJSONString = function(t) { + var e; + try { + e = JSON.parse(t) + } catch (t) { + return !1 + } + if (!e.c2save) + return !1; + if (1 < e.version) + return !1; + this.isLoadingState = !0; + var i = e.rt; + this.kahanTime.reset(), + this.kahanTime.sum = i.time, + this.wallTime.reset(), + this.wallTime.sum = i.walltime || 0, + this.timescale = i.timescale, + this.tickcount = i.tickcount, + this.execcount = i.execcount, + this.start_time = Date.now() - i.start_time_offset; + var s, n, r, o, a, h, c, l, u, p, d, f, y, g, m, _, v, b = i.running_layout; + if (b !== this.running_layout.sid) { + b = this.getLayoutBySid(b); + if (!b) + return; + this.doChangeLayout(b) + } + var w = e.types; + for (c in w) + if (w.hasOwnProperty(c) && (l = this.getObjectTypeBySid(parseInt(c, 10))) && !l.is_family && !this.typeHasNoSaveBehavior(l)) { + for (w[c].ex ? l.extra = w[c].ex : cr.wipe(l.extra), + u = l.instances, + p = w[c].instances, + s = 0, + n = cr.min(u.length, p.length); s < n; s++) + this.loadInstanceFromJSON(u[s], p[s]); + for (s = p.length, + n = u.length; s < n; s++) + this.DestroyInstance(u[s]); + for (s = u.length, + n = p.length; s < n; s++) + g = null, + l.plugin.is_world && !(g = this.running_layout.getLayerBySid(p[s].w.l)) || (d = this.createInstanceFromInit(l.default_instance, g, !1, 0, 0, !0), + this.loadInstanceFromJSON(d, p[s])); + l.stale_iids = !0 + } + this.ClearDeathRow(), + this.refreshUidMap(); + var x = e.layouts; + for (c in x) + x.hasOwnProperty(c) && (y = this.getLayoutBySid(parseInt(c, 10))) && y.loadFromJSON(x[c]); + var S = e.events.groups; + for (c in S) + S.hasOwnProperty(c) && (m = this.getGroupBySid(parseInt(c, 10))) && this.groups_by_name[m.group_name] && this.groups_by_name[m.group_name].setGroupActive(S[c]); + var T = e.events.cnds; + for (c in this.cndsBySid) + this.cndsBySid.hasOwnProperty(c) && (T.hasOwnProperty(c) ? this.cndsBySid[c].extra = T[c].ex : this.cndsBySid[c].extra = {}); + var A = e.events.acts; + for (c in this.actsBySid) + this.actsBySid.hasOwnProperty(c) && (A.hasOwnProperty(c) ? this.actsBySid[c].extra = A[c].ex : this.actsBySid[c].extra = {}); + var C = e.events.vars; + for (c in C) + C.hasOwnProperty(c) && this.varsBySid.hasOwnProperty(c) && (this.varsBySid[c].data = C[c]); + for (this.next_uid = i.next_uid, + this.isLoadingState = !1, + s = 0, + n = this.fireOnCreateAfterLoad.length; s < n; ++s) + d = this.fireOnCreateAfterLoad[s], + this.trigger(Object.getPrototypeOf(d.type.plugin).cnds.OnCreated, d); + for (cr.clearArray(this.fireOnCreateAfterLoad), + this.system.loadFromJSON(e.system), + s = 0, + n = this.types_by_index.length; s < n; s++) + if (!(l = this.types_by_index[s]).is_family && !this.typeHasNoSaveBehavior(l)) + for (r = 0, + o = l.instances.length; r < o; r++) { + if (d = l.instances[r], + l.is_contained) + for (_ = d.get_iid(), + cr.clearArray(d.siblings), + a = 0, + h = l.container.length; a < h; a++) + l !== (v = l.container[a]) && d.siblings.push(v.instances[_]); + if (d.afterLoad && d.afterLoad(), + d.behavior_insts) + for (a = 0, + h = d.behavior_insts.length; a < h; a++) + (f = d.behavior_insts[a]).afterLoad && f.afterLoad() + } + return this.redraw = !0 + } + , + i.prototype.saveInstanceToJSON = function(t, e) { + var i, s, n, r, o, a = t.type, h = a.plugin, c = {}; + if (e ? c.c2 = !0 : c.uid = t.uid, + cr.hasAnyOwnProperty(t.extra) && (c.ex = R(t.extra)), + t.instance_vars && t.instance_vars.length) + for (c.ivs = {}, + i = 0, + s = t.instance_vars.length; i < s; i++) + c.ivs[t.type.instvar_sids[i].toString()] = t.instance_vars[i]; + if (h.is_world) { + if (n = { + x: t.x, + y: t.y, + w: t.width, + h: t.height, + l: t.layer.sid, + zi: t.get_zindex() + }, + 0 !== t.angle && (n.a = t.angle), + 1 !== t.opacity && (n.o = t.opacity), + .5 !== t.hotspotX && (n.hX = t.hotspotX), + .5 !== t.hotspotY && (n.hY = t.hotspotY), + 0 !== t.blend_mode && (n.bm = t.blend_mode), + t.visible || (n.v = t.visible), + t.collisionsEnabled || (n.ce = t.collisionsEnabled), + -1 !== t.my_timescale && (n.mts = t.my_timescale), + a.effect_types.length) + for (n.fx = [], + i = 0, + s = a.effect_types.length; i < s; i++) + o = a.effect_types[i], + n.fx.push({ + name: o.name, + active: t.active_effect_flags[o.index], + params: t.effect_params[o.index] + }); + c.w = n + } + if (t.behavior_insts && t.behavior_insts.length) + for (c.behs = {}, + i = 0, + s = t.behavior_insts.length; i < s; i++) + (r = t.behavior_insts[i]).saveToJSON && (c.behs[r.type.sid.toString()] = r.saveToJSON()); + return t.saveToJSON && (c.data = t.saveToJSON()), + c + } + , + i.prototype.getInstanceVarIndexBySid = function(t, e) { + for (var i = 0, s = t.instvar_sids.length; i < s; i++) + if (t.instvar_sids[i] === e) + return i; + return -1 + } + , + i.prototype.getBehaviorIndexBySid = function(t, e) { + for (var i = 0, s = t.behavior_insts.length; i < s; i++) + if (t.behavior_insts[i].type.sid === e) + return i; + return -1 + } + , + i.prototype.loadInstanceFromJSON = function(t, e, i) { + var s, n, r, o, a, h, c, l, u, p, d = t.type, f = d.plugin; + if (i) { + if (!e.c2) + return + } else + t.uid = e.uid; + if (e.ex ? t.extra = e.ex : cr.wipe(t.extra), + a = e.ivs) + for (s in a) + a.hasOwnProperty(s) && ((o = this.getInstanceVarIndexBySid(d, parseInt(s, 10))) < 0 || o >= t.instance_vars.length || (null === (p = a[s]) && (p = NaN), + t.instance_vars[o] = p)); + if (f.is_world) { + if (h = e.w, + t.layer.sid !== h.l && (f = t.layer, + t.layer = this.running_layout.getLayerBySid(h.l), + t.layer ? (f.removeFromInstanceList(t, !0), + t.layer.appendToInstanceList(t, !0), + t.set_bbox_changed(), + t.layer.setZIndicesStaleFrom(0)) : (t.layer = f, + i || this.DestroyInstance(t))), + t.x = h.x, + t.y = h.y, + t.width = h.w, + t.height = h.h, + t.zindex = h.zi, + t.angle = h.hasOwnProperty("a") ? h.a : 0, + t.opacity = h.hasOwnProperty("o") ? h.o : 1, + t.hotspotX = h.hasOwnProperty("hX") ? h.hX : .5, + t.hotspotY = h.hasOwnProperty("hY") ? h.hY : .5, + t.visible = !h.hasOwnProperty("v") || h.v, + t.collisionsEnabled = !h.hasOwnProperty("ce") || h.ce, + t.my_timescale = h.hasOwnProperty("mts") ? h.mts : -1, + t.blend_mode = h.hasOwnProperty("bm") ? h.bm : 0, + t.compositeOp = cr.effectToCompositeOp(t.blend_mode), + this.gl && cr.setGLBlend(t, t.blend_mode, this.gl), + t.set_bbox_changed(), + h.hasOwnProperty("fx")) + for (n = 0, + r = h.fx.length; n < r; n++) + (c = d.getEffectIndexByName(h.fx[n].name)) < 0 || (t.active_effect_flags[c] = h.fx[n].active, + t.effect_params[c] = h.fx[n].params); + t.updateActiveEffects() + } + if (l = e.behs) + for (s in l) + l.hasOwnProperty(s) && ((u = this.getBehaviorIndexBySid(t, parseInt(s, 10))) < 0 || t.behavior_insts[u].loadFromJSON(l[s])); + e.data && t.loadFromJSON(e.data) + } + , + i.prototype.fetchLocalFileViaCordova = function(t, e, i) { + t = cordova.file.applicationDirectory + "www/" + t; + window.resolveLocalFileSystemURL(t, function(t) { + t.file(e, i) + }, i) + } + , + i.prototype.fetchLocalFileViaCordovaAsText = function(t, i, s) { + this.fetchLocalFileViaCordova(t, function(t) { + var e = new FileReader; + e.onload = function(t) { + i(t.target.result) + } + , + e.onerror = s, + e.readAsText(t) + }, s) + } + ; + var L = [] + , M = 0; + i.prototype.maybeStartNextArrayBufferRead = function() { + var t; + L.length && (8 <= M || (M++, + t = L.shift(), + this.doFetchLocalFileViaCordovaAsArrayBuffer(t.filename, t.successCallback, t.errorCallback))) + } + , + i.prototype.fetchLocalFileViaCordovaAsArrayBuffer = function(t, e, i) { + var s = this; + L.push({ + filename: t, + successCallback: function(t) { + M--, + s.maybeStartNextArrayBufferRead(), + e(t) + }, + errorCallback: function(t) { + M--, + s.maybeStartNextArrayBufferRead(), + i(t) + } + }), + this.maybeStartNextArrayBufferRead() + } + , + i.prototype.doFetchLocalFileViaCordovaAsArrayBuffer = function(t, i, e) { + this.fetchLocalFileViaCordova(t, function(t) { + var e = new FileReader; + e.onload = function(t) { + i(t.target.result) + } + , + e.readAsArrayBuffer(t) + }, e) + } + , + i.prototype.fetchLocalFileViaCordovaAsURL = function(t, e, i) { + var s = "" + , n = t.toLowerCase() + , r = n.substr(n.length - 4) + , n = n.substr(n.length - 5); + ".mp4" === r ? s = "video/mp4" : ".webm" === n ? s = "video/webm" : ".m4a" === r ? s = "audio/mp4" : ".mp3" === r && (s = "audio/mpeg"), + this.fetchLocalFileViaCordovaAsArrayBuffer(t, function(t) { + t = new Blob([t],{ + type: s + }), + t = URL.createObjectURL(t); + e(t) + }, i) + } + , + i.prototype.isAbsoluteUrl = function(t) { + return /^(?:[a-z]+:)?\/\//.test(t) || "data:" === t.substr(0, 5) || "blob:" === t.substr(0, 5) + } + , + i.prototype.setImageSrc = function(e, t) { + this.isWKWebView && !this.isAbsoluteUrl(t) ? this.fetchLocalFileViaCordovaAsURL(t, function(t) { + e.src = t + }, function(t) { + alert("Failed to load image: " + t) + }) : e.src = t + } + , + i.prototype.setCtxImageSmoothingEnabled = function(t, e) { + void 0 !== t.imageSmoothingEnabled ? t.imageSmoothingEnabled = e : (t.webkitImageSmoothingEnabled = e, + t.mozImageSmoothingEnabled = e, + t.msImageSmoothingEnabled = e) + } + , + cr.runtime = i, + cr.createRuntime = function(t) { + return new i(document.getElementById(t)) + } + , + cr.createDCRuntime = function(t, e) { + return new i({ + dc: !0, + width: t, + height: e + }) + } + , + window.cr_createRuntime = cr.createRuntime, + window.cr_createDCRuntime = cr.createDCRuntime, + window.createCocoonJSRuntime = function() { + window.c2cocoonjs = !0; + var t = document.createElement("screencanvas") || document.createElement("canvas"); + t.screencanvas = !0, + document.body.appendChild(t); + t = new i(t); + return window.c2runtime = t, + window.addEventListener("orientationchange", function() { + window.c2runtime.setSize(window.innerWidth, window.innerHeight) + }), + window.c2runtime.setSize(window.innerWidth, window.innerHeight), + t + } + , + window.createEjectaRuntime = function() { + var t = new i(document.getElementById("canvas")); + return window.c2runtime = t, + window.c2runtime.setSize(window.innerWidth, window.innerHeight), + t + } +}(), +window.cr_getC2Runtime = function() { + var t = document.getElementById("c2canvas"); + return t ? t.c2runtime : window.c2runtime || null +} +, +window.cr_getSnapshot = function(t, e) { + var i = window.cr_getC2Runtime(); + i && i.doCanvasSnapshot(t, e) +} +, +window.cr_sizeCanvas = function(t, e) { + var i; + 0 === t || 0 === e || (i = window.cr_getC2Runtime()) && i.setSize(t, e) +} +, +window.cr_setSuspended = function(t) { + var e = window.cr_getC2Runtime(); + e && e.setSuspended(t) +} +, +function() { + function t(t, e) { + this.runtime = t, + this.event_sheet = null, + this.scrollX = this.runtime.original_width / 2, + this.scrollY = this.runtime.original_height / 2, + this.scale = 1, + this.angle = 0, + this.first_visit = !0, + this.name = e[0], + this.originalWidth = e[1], + this.originalHeight = e[2], + this.width = e[1], + this.height = e[2], + this.unbounded_scrolling = e[3], + this.sheetname = e[4], + this.sid = e[5]; + var i, s, n = e[6]; + for (this.layers = [], + this.initial_types = [], + i = 0, + s = n.length; i < s; i++) { + var r = new cr.layer(this,n[i]); + r.number = i, + cr.seal(r), + this.layers.push(r) + } + var o = e[7]; + for (this.initial_nonworld = [], + i = 0, + s = o.length; i < s; i++) { + var a = o[i] + , h = this.runtime.types_by_index[a[1]]; + h.default_instance || (h.default_instance = a), + this.initial_nonworld.push(a), + -1 === this.initial_types.indexOf(h) && this.initial_types.push(h) + } + for (this.effect_types = [], + this.active_effect_types = [], + this.shaders_preserve_opaqueness = !0, + this.effect_params = [], + i = 0, + s = e[8].length; i < s; i++) + this.effect_types.push({ + id: e[8][i][0], + name: e[8][i][1], + shaderindex: -1, + preservesOpaqueness: !1, + active: !0, + index: i + }), + this.effect_params.push(e[8][i][2].slice(0)); + this.updateActiveEffects(), + this.rcTex = new cr.rect(0,0,1,1), + this.rcTex2 = new cr.rect(0,0,1,1), + this.persist_data = {} + } + t.prototype.saveObjectToPersist = function(t) { + var e = t.type.sid.toString(); + this.persist_data.hasOwnProperty(e) || (this.persist_data[e] = []), + this.persist_data[e].push(this.runtime.saveInstanceToJSON(t)) + } + , + t.prototype.hasOpaqueBottomLayer = function() { + var t = this.layers[0]; + return !t.transparent && 1 === t.opacity && !t.forceOwnTexture && t.visible + } + , + t.prototype.updateActiveEffects = function() { + var t, e, i; + for (cr.clearArray(this.active_effect_types), + this.shaders_preserve_opaqueness = !0, + t = 0, + e = this.effect_types.length; t < e; t++) + (i = this.effect_types[t]).active && (this.active_effect_types.push(i), + i.preservesOpaqueness || (this.shaders_preserve_opaqueness = !1)) + } + , + t.prototype.getEffectByName = function(t) { + for (var e, i = 0, s = this.effect_types.length; i < s; i++) + if ((e = this.effect_types[i]).name === t) + return e; + return null + } + ; + var g = []; + function m(t, e) { + return t.zindex - e.zindex + } + var _ = !0; + t.prototype.startRunning = function() { + var t, e, i, s, n, r, o, a, h, c, l, u, p, d, f; + for (this.sheetname && (this.event_sheet = this.runtime.eventsheets[this.sheetname], + this.event_sheet.updateDeepIncludes()), + (this.runtime.running_layout = this).width = this.originalWidth, + this.height = this.originalHeight, + this.scrollX = this.runtime.original_width / 2, + this.scrollY = this.runtime.original_height / 2, + t = 0, + i = this.runtime.types_by_index.length; t < i; t++) + if (!(n = this.runtime.types_by_index[t]).is_family) + for (e = 0, + s = (r = n.instances).length; e < s; e++) + (d = r[e]).layer && ((p = d.layer.number) >= this.layers.length && (p = this.layers.length - 1), + d.layer = this.layers[p], + -1 === d.layer.instances.indexOf(d) && d.layer.instances.push(d), + d.layer.zindices_stale = !0); + if (!_) + for (t = 0, + i = this.layers.length; t < i; ++t) + this.layers[t].instances.sort(m); + for (cr.clearArray(g), + this.boundScrolling(), + t = 0, + i = this.layers.length; t < i; t++) + (f = this.layers[t]).createInitialInstances(), + f.updateViewport(null); + var y = !1; + if (!this.first_visit) { + for (l in this.persist_data) + if (this.persist_data.hasOwnProperty(l) && (n = this.runtime.getObjectTypeBySid(parseInt(l, 10))) && !n.is_family && this.runtime.typeHasPersistBehavior(n)) { + for (t = 0, + i = (u = this.persist_data[l]).length; t < i; t++) + f = null, + n.plugin.is_world && !(f = this.getLayerBySid(u[t].w.l)) || (d = this.runtime.createInstanceFromInit(n.default_instance, f, !1, 0, 0, !0), + this.runtime.loadInstanceFromJSON(d, u[t]), + y = !0, + g.push(d)); + cr.clearArray(u) + } + for (t = 0, + i = this.layers.length; t < i; t++) + this.layers[t].instances.sort(m), + this.layers[t].zindices_stale = !0 + } + for (y && (this.runtime.ClearDeathRow(), + this.runtime.refreshUidMap()), + t = 0; t < g.length; t++) + if ((d = g[t]).type.is_contained) + for (a = d.get_iid(), + e = 0, + s = d.type.container.length; e < s; e++) + h = d.type.container[e], + d.type !== h && (h.instances.length > a ? d.siblings.push(h.instances[a]) : h.default_instance && (c = this.runtime.createInstanceFromInit(h.default_instance, d.layer, !0, d.x, d.y, !0), + this.runtime.ClearDeathRow(), + h.updateIIDs(), + d.siblings.push(c), + g.push(c))); + for (t = 0, + i = this.initial_nonworld.length; t < i; t++) + o = this.initial_nonworld[t], + (n = this.runtime.types_by_index[o[1]]).is_contained || (d = this.runtime.createInstanceFromInit(this.initial_nonworld[t], null, !0)); + if (this.runtime.changelayout = null, + this.runtime.ClearDeathRow(), + this.runtime.ctx && !this.runtime.isDomFree) + for (t = 0, + i = this.runtime.types_by_index.length; t < i; t++) + !(h = this.runtime.types_by_index[t]).is_family && h.instances.length && h.preloadCanvas2D && h.preloadCanvas2D(this.runtime.ctx); + if (this.runtime.isLoadingState) + cr.shallowAssignArray(this.runtime.fireOnCreateAfterLoad, g); + else + for (t = 0, + i = g.length; t < i; t++) + d = g[t], + this.runtime.trigger(Object.getPrototypeOf(d.type.plugin).cnds.OnCreated, d); + cr.clearArray(g), + this.runtime.isLoadingState || this.runtime.trigger(cr.system_object.prototype.cnds.OnLayoutStart, null), + this.first_visit = !1 + } + , + t.prototype.createGlobalNonWorlds = function() { + for (var t, e, i = 0, s = 0, n = this.initial_nonworld.length; i < n; i++) + t = this.initial_nonworld[i], + (e = this.runtime.types_by_index[t[1]]).global ? e.is_contained || this.runtime.createInstanceFromInit(t, null, !0) : (this.initial_nonworld[s] = t, + s++); + cr.truncateArray(this.initial_nonworld, s) + } + , + t.prototype.stopRunning = function() { + var t, e, i, s, n, r, o; + if (this.runtime.isLoadingState || this.runtime.trigger(cr.system_object.prototype.cnds.OnLayoutEnd, null), + this.runtime.isEndingLayout = !0, + cr.clearArray(this.runtime.system.waits), + !this.first_visit) + for (t = 0, + e = this.layers.length; t < e; t++) + for (this.layers[t].updateZIndices(), + i = 0, + s = (n = this.layers[t].instances).length; i < s; i++) + (r = n[i]).type.global || this.runtime.typeHasPersistBehavior(r.type) && this.saveObjectToPersist(r); + for (t = 0, + e = this.layers.length; t < e; t++) { + for (i = 0, + s = (n = this.layers[t].instances).length; i < s; i++) + (r = n[i]).type.global || this.runtime.DestroyInstance(r); + this.runtime.ClearDeathRow(), + cr.clearArray(n), + this.layers[t].zindices_stale = !0 + } + for (t = 0, + e = this.runtime.types_by_index.length; t < e; t++) + if (!((o = this.runtime.types_by_index[t]).global || o.plugin.is_world || o.plugin.singleglobal || o.is_family)) { + for (i = 0, + s = o.instances.length; i < s; i++) + this.runtime.DestroyInstance(o.instances[i]); + this.runtime.ClearDeathRow() + } + _ = !1, + this.runtime.isEndingLayout = !1 + } + ; + var a = new cr.rect(0,0,0,0); + function e(t, e) { + this.layout = t, + this.runtime = t.runtime, + this.instances = [], + this.scale = 1, + this.angle = 0, + this.disableAngle = !1, + this.tmprect = new cr.rect(0,0,0,0), + this.tmpquad = new cr.quad, + this.viewLeft = 0, + this.viewRight = 0, + this.viewTop = 0, + this.viewBottom = 0, + this.zindices_stale = !1, + this.zindices_stale_from = -1, + this.clear_earlyz_index = 0, + this.name = e[0], + this.index = e[1], + this.sid = e[2], + this.visible = e[3], + this.background_color = e[4], + this.transparent = e[5], + this.parallaxX = e[6], + this.parallaxY = e[7], + this.opacity = e[8], + this.forceOwnTexture = e[9], + this.useRenderCells = e[10], + this.zoomRate = e[11], + this.blend_mode = e[12], + this.effect_fallback = e[13], + this.compositeOp = "source-over", + this.srcBlend = 0, + this.destBlend = 0, + this.render_grid = null, + this.last_render_list = h(), + this.render_list_stale = !0, + this.last_render_cells = new cr.rect(0,0,-1,-1), + this.cur_render_cells = new cr.rect(0,0,-1,-1), + this.useRenderCells && (this.render_grid = new cr.RenderGrid(this.runtime.original_width,this.runtime.original_height)), + this.render_offscreen = !1; + var i, s, n = e[14]; + for (this.startup_initial_instances = [], + this.initial_instances = [], + this.created_globals = [], + i = 0, + s = n.length; i < s; i++) { + var r = n[i] + , o = this.runtime.types_by_index[r[1]]; + o.default_instance || (o.default_instance = r, + o.default_layerindex = this.index), + this.initial_instances.push(r), + -1 === this.layout.initial_types.indexOf(o) && this.layout.initial_types.push(o) + } + for (cr.shallowAssignArray(this.startup_initial_instances, this.initial_instances), + this.effect_types = [], + this.active_effect_types = [], + this.shaders_preserve_opaqueness = !0, + this.effect_params = [], + i = 0, + s = e[15].length; i < s; i++) + this.effect_types.push({ + id: e[15][i][0], + name: e[15][i][1], + shaderindex: -1, + preservesOpaqueness: !1, + active: !0, + index: i + }), + this.effect_params.push(e[15][i][2].slice(0)); + this.updateActiveEffects(), + this.rcTex = new cr.rect(0,0,1,1), + this.rcTex2 = new cr.rect(0,0,1,1) + } + t.prototype.recreateInitialObjects = function(t, e, i, s, n) { + var r, o; + for (a.set(e, i, s, n), + r = 0, + o = this.layers.length; r < o; r++) + this.layers[r].recreateInitialObjects(t, a) + } + , + t.prototype.draw = function(t) { + var e, i, s, n, r = t, o = !1, a = !this.runtime.fullscreenScalingQuality; + for (a && (this.runtime.layout_canvas || (this.runtime.layout_canvas = document.createElement("canvas"), + (e = this.runtime.layout_canvas).width = this.runtime.draw_width, + e.height = this.runtime.draw_height, + this.runtime.layout_ctx = e.getContext("2d"), + o = !0), + e = this.runtime.layout_canvas, + r = this.runtime.layout_ctx, + e.width !== this.runtime.draw_width && (e.width = this.runtime.draw_width, + o = !0), + e.height !== this.runtime.draw_height && (e.height = this.runtime.draw_height, + o = !0), + o && this.runtime.setCtxImageSmoothingEnabled(r, this.runtime.linearSampling)), + r.globalAlpha = 1, + r.globalCompositeOperation = "source-over", + this.runtime.clearBackground && !this.hasOpaqueBottomLayer() && r.clearRect(0, 0, this.runtime.draw_width, this.runtime.draw_height), + i = 0, + s = this.layers.length; i < s; i++) + (n = this.layers[i]).visible && 0 < n.opacity && 11 !== n.blend_mode && (n.instances.length || !n.transparent) ? n.draw(r) : n.updateViewport(null); + a && t.drawImage(e, 0, 0, this.runtime.width, this.runtime.height) + } + , + t.prototype.drawGL_earlyZPass = function(t) { + var e, i; + for (t.setEarlyZPass(!0), + this.runtime.layout_tex || (this.runtime.layout_tex = t.createEmptyTexture(this.runtime.draw_width, this.runtime.draw_height, this.runtime.linearSampling)), + this.runtime.layout_tex.c2width === this.runtime.draw_width && this.runtime.layout_tex.c2height === this.runtime.draw_height || (t.deleteTexture(this.runtime.layout_tex), + this.runtime.layout_tex = t.createEmptyTexture(this.runtime.draw_width, this.runtime.draw_height, this.runtime.linearSampling)), + t.setRenderingToTexture(this.runtime.layout_tex), + this.runtime.fullscreenScalingQuality || t.setSize(this.runtime.draw_width, this.runtime.draw_height), + e = this.layers.length - 1; 0 <= e; --e) + (i = this.layers[e]).visible && 1 === i.opacity && i.shaders_preserve_opaqueness && 0 === i.blend_mode && (i.instances.length || !i.transparent) ? i.drawGL_earlyZPass(t) : i.updateViewport(null); + t.setEarlyZPass(!1) + } + , + t.prototype.drawGL = function(t) { + var e, i, s, n, r = 0 < this.active_effect_types.length || this.runtime.uses_background_blending || !this.runtime.fullscreenScalingQuality || this.runtime.enableFrontToBack; + for (r ? (this.runtime.layout_tex || (this.runtime.layout_tex = t.createEmptyTexture(this.runtime.draw_width, this.runtime.draw_height, this.runtime.linearSampling)), + this.runtime.layout_tex.c2width === this.runtime.draw_width && this.runtime.layout_tex.c2height === this.runtime.draw_height || (t.deleteTexture(this.runtime.layout_tex), + this.runtime.layout_tex = t.createEmptyTexture(this.runtime.draw_width, this.runtime.draw_height, this.runtime.linearSampling)), + t.setRenderingToTexture(this.runtime.layout_tex), + this.runtime.fullscreenScalingQuality || t.setSize(this.runtime.draw_width, this.runtime.draw_height)) : this.runtime.layout_tex && (t.setRenderingToTexture(null), + t.deleteTexture(this.runtime.layout_tex), + this.runtime.layout_tex = null), + this.runtime.clearBackground && !this.hasOpaqueBottomLayer() && t.clear(0, 0, 0, 0), + e = 0, + i = this.layers.length; e < i; e++) + (s = this.layers[e]).visible && 0 < s.opacity && (s.instances.length || !s.transparent) ? s.drawGL(t) : s.updateViewport(null); + r && (0 === this.active_effect_types.length || 1 === this.active_effect_types.length && this.runtime.fullscreenScalingQuality ? (1 === this.active_effect_types.length ? (n = this.active_effect_types[0].index, + t.switchProgram(this.active_effect_types[0].shaderindex), + t.setProgramParameters(null, 1 / this.runtime.draw_width, 1 / this.runtime.draw_height, 0, 0, 1, 1, this.scale, this.angle, 0, 0, this.runtime.draw_width / 2, this.runtime.draw_height / 2, this.runtime.kahanTime.sum, this.effect_params[n]), + t.programIsAnimated(this.active_effect_types[0].shaderindex) && (this.runtime.redraw = !0)) : t.switchProgram(0), + this.runtime.fullscreenScalingQuality || t.setSize(this.runtime.width, this.runtime.height), + t.setRenderingToTexture(null), + t.setDepthTestEnabled(!1), + t.setOpacity(1), + t.setTexture(this.runtime.layout_tex), + t.setAlphaBlend(), + t.resetModelView(), + t.updateModelView(), + r = this.runtime.width / 2, + n = this.runtime.height / 2, + t.quad(-r, n, r, n, r, -n, -r, -n), + t.setTexture(null), + t.setDepthTestEnabled(!0)) : this.renderEffectChain(t, null, null, null)) + } + , + t.prototype.getRenderTarget = function() { + return 0 < this.active_effect_types.length || this.runtime.uses_background_blending || !this.runtime.fullscreenScalingQuality || this.runtime.enableFrontToBack ? this.runtime.layout_tex : null + } + , + t.prototype.getMinLayerScale = function() { + for (var t, e = this.layers[0].getScale(), i = 1, s = this.layers.length; i < s; i++) + 0 === (t = this.layers[i]).parallaxX && 0 === t.parallaxY || t.getScale() < e && (e = t.getScale()); + return e + } + , + t.prototype.scrollToX = function(t) { + var e; + this.unbounded_scrolling || (e = this.runtime.draw_width * (1 / this.getMinLayerScale()) / 2, + t > this.width - e && (t = this.width - e), + t < e && (t = e)), + this.scrollX !== t && (this.scrollX = t, + this.runtime.redraw = !0) + } + , + t.prototype.scrollToY = function(t) { + var e; + this.unbounded_scrolling || (e = this.runtime.draw_height * (1 / this.getMinLayerScale()) / 2, + t > this.height - e && (t = this.height - e), + t < e && (t = e)), + this.scrollY !== t && (this.scrollY = t, + this.runtime.redraw = !0) + } + , + t.prototype.boundScrolling = function() { + this.scrollToX(this.scrollX), + this.scrollToY(this.scrollY) + } + , + t.prototype.renderEffectChain = function(t, e, i, s) { + var n = (i || e || this).active_effect_types + , r = 1 + , o = 0 + , a = 0 + , h = 0 + , c = this.runtime.draw_width + , l = this.runtime.draw_height; + i ? (r = i.layer.getScale(), + o = i.layer.getAngle(), + a = i.layer.viewLeft, + h = i.layer.viewTop, + c = i.layer.viewRight, + l = i.layer.viewBottom) : e && (r = e.getScale(), + o = e.getAngle(), + a = e.viewLeft, + h = e.viewTop, + c = e.viewRight, + l = e.viewBottom); + var u, p, d = this.runtime.fx_tex, f = 0, y = 1, g = this.runtime.draw_width, m = this.runtime.draw_height, _ = g / 2, v = m / 2, b = (e || this).rcTex, w = (e || this).rcTex2, x = 0, S = 0, T = 0, A = 0, C = g, k = g, O = m, I = m, P = 0, E = 0, B = i ? i.layer.getAngle() : 0; + if (i) { + for (G = 0, + U = n.length; G < U; G++) + P += t.getProgramBoxExtendHorizontal(n[G].shaderindex), + E += t.getProgramBoxExtendVertical(n[G].shaderindex); + var R, L, M, j = i.bbox; + x = e.layerToCanvas(j.left, j.top, !0, !0), + T = e.layerToCanvas(j.left, j.top, !1, !0), + C = e.layerToCanvas(j.right, j.bottom, !0, !0), + O = e.layerToCanvas(j.right, j.bottom, !1, !0), + 0 !== B && (R = e.layerToCanvas(j.right, j.top, !0, !0), + L = e.layerToCanvas(j.right, j.top, !1, !0), + B = e.layerToCanvas(j.left, j.bottom, !0, !0), + j = e.layerToCanvas(j.left, j.bottom, !1, !0), + M = Math.min(x, C, R, B), + C = Math.max(x, C, R, B), + x = M, + M = Math.min(T, O, L, j), + O = Math.max(T, O, L, j), + T = M), + x -= P, + T -= E, + C += P, + O += E, + w.left = x / g, + w.top = 1 - T / m, + w.right = C / g, + w.bottom = 1 - O / m, + S = x = cr.floor(x), + A = T = cr.floor(T), + k = C = cr.ceil(C), + I = O = cr.ceil(O), + x < 0 && (x = 0), + T < 0 && (T = 0), + g < C && (C = g), + m < O && (O = m), + (S -= P) < 0 && (S = 0), + (A -= E) < 0 && (A = 0), + g < (k += P) && (k = g), + m < (I += E) && (I = m), + b.left = x / g, + b.top = 1 - T / m, + b.right = C / g, + b.bottom = 1 - O / m + } else + b.left = w.left = 0, + b.top = w.top = 0, + b.right = w.right = 1, + b.bottom = w.bottom = 1; + var N = i && (t.programUsesDest(n[0].shaderindex) || 0 !== P || 0 !== E || 1 !== i.opacity || i.type.plugin.must_predraw) || e && !i && 1 !== e.opacity; + t.setAlphaBlend(), + N && (d[f] || (d[f] = t.createEmptyTexture(g, m, this.runtime.linearSampling)), + d[f].c2width === g && d[f].c2height === m || (t.deleteTexture(d[f]), + d[f] = t.createEmptyTexture(g, m, this.runtime.linearSampling)), + t.switchProgram(0), + t.setRenderingToTexture(d[f]), + u = m - A - (p = I - A), + t.clearRect(S, u, k - S, p), + i ? i.drawGL(t) : (t.setTexture(this.runtime.layer_tex), + t.setOpacity(e.opacity), + t.resetModelView(), + t.translate(-_, -v), + t.updateModelView(), + t.quadTex(x, O, C, O, C, T, x, T, b)), + w.left = w.top = 0, + w.right = w.bottom = 1, + i && (M = b.top, + b.top = b.bottom, + b.bottom = M), + f = 1, + y = 0), + t.setOpacity(1); + for (var F, D, V, W = n.length - 1, z = t.programUsesCrossSampling(n[W].shaderindex) || !e && !i && !this.runtime.fullscreenScalingQuality, G = 0, U = n.length; G < U; G++) + d[f] || (d[f] = t.createEmptyTexture(g, m, this.runtime.linearSampling)), + d[f].c2width === g && d[f].c2height === m || (t.deleteTexture(d[f]), + d[f] = t.createEmptyTexture(g, m, this.runtime.linearSampling)), + t.switchProgram(n[G].shaderindex), + F = n[G].index, + t.programIsAnimated(n[G].shaderindex) && (this.runtime.redraw = !0), + 0 != G || N ? (t.setProgramParameters(s, 1 / g, 1 / m, w.left, w.top, w.right, w.bottom, r, o, a, h, (a + c) / 2, (h + l) / 2, this.runtime.kahanTime.sum, (i || e || this).effect_params[F]), + t.setTexture(null), + G !== W || z ? (t.setRenderingToTexture(d[f]), + u = m - A - (p = I - A), + t.clearRect(S, u, k - S, p)) : (i ? t.setBlend(i.srcBlend, i.destBlend) : e && t.setBlend(e.srcBlend, e.destBlend), + t.setRenderingToTexture(s)), + t.setTexture(d[y]), + t.resetModelView(), + t.translate(-_, -v), + t.updateModelView(), + t.quadTex(x, O, C, O, C, T, x, T, b), + G !== W || z || t.setTexture(null)) : (t.setRenderingToTexture(d[f]), + u = m - A - (p = I - A), + t.clearRect(S, u, k - S, p), + i ? (V = i.curFrame && i.curFrame.texture_img ? (D = 1 / (V = i.curFrame.texture_img).width, + 1 / V.height) : (D = 1 / i.width, + 1 / i.height), + t.setProgramParameters(s, D, V, w.left, w.top, w.right, w.bottom, r, o, a, h, (a + c) / 2, (h + l) / 2, this.runtime.kahanTime.sum, i.effect_params[F]), + i.drawGL(t)) : (t.setProgramParameters(s, 1 / g, 1 / m, 0, 0, 1, 1, r, o, a, h, (a + c) / 2, (h + l) / 2, this.runtime.kahanTime.sum, (e || this).effect_params[F]), + t.setTexture(e ? this.runtime.layer_tex : this.runtime.layout_tex), + t.resetModelView(), + t.translate(-_, -v), + t.updateModelView(), + t.quadTex(x, O, C, O, C, T, x, T, b)), + w.left = w.top = 0, + w.right = w.bottom = 1, + i && !z && (M = O, + O = T, + T = M)), + y = 0 === (f = 0 === f ? 1 : 0) ? 1 : 0; + z && (t.switchProgram(0), + i ? t.setBlend(i.srcBlend, i.destBlend) : e ? t.setBlend(e.srcBlend, e.destBlend) : this.runtime.fullscreenScalingQuality || (t.setSize(this.runtime.width, this.runtime.height), + _ = this.runtime.width / 2, + v = this.runtime.height / 2, + T = x = 0, + C = this.runtime.width, + O = this.runtime.height), + t.setRenderingToTexture(s), + t.setTexture(d[y]), + t.resetModelView(), + t.translate(-_, -v), + t.updateModelView(), + i && 1 === n.length && !N ? t.quadTex(x, T, C, T, C, O, x, O, b) : t.quadTex(x, O, C, O, C, T, x, T, b), + t.setTexture(null)) + } + , + t.prototype.getLayerBySid = function(t) { + for (var e = 0, i = this.layers.length; e < i; e++) + if (this.layers[e].sid === t) + return this.layers[e]; + return null + } + , + t.prototype.saveToJSON = function() { + for (var t, e, i = { + sx: this.scrollX, + sy: this.scrollY, + s: this.scale, + a: this.angle, + w: this.width, + h: this.height, + fv: this.first_visit, + persist: this.persist_data, + fx: [], + layers: {} + }, s = 0, n = this.effect_types.length; s < n; s++) + e = this.effect_types[s], + i.fx.push({ + name: e.name, + active: e.active, + params: this.effect_params[e.index] + }); + for (s = 0, + n = this.layers.length; s < n; s++) + t = this.layers[s], + i.layers[t.sid.toString()] = t.saveToJSON(); + return i + } + , + t.prototype.loadFromJSON = function(t) { + var e, i, s; + this.scrollX = t.sx, + this.scrollY = t.sy, + this.scale = t.s, + this.angle = t.a, + this.width = t.w, + this.height = t.h, + this.persist_data = t.persist, + void 0 !== t.fv && (this.first_visit = t.fv); + for (var n = t.fx, r = 0, o = n.length; r < o; r++) + (e = this.getEffectByName(n[r].name)) && (e.active = n[r].active, + this.effect_params[e.index] = n[r].params); + this.updateActiveEffects(); + var a = t.layers; + for (i in a) + a.hasOwnProperty(i) && (s = this.getLayerBySid(parseInt(i, 10))) && s.loadFromJSON(a[i]) + } + , + cr.layout = t, + e.prototype.updateActiveEffects = function() { + var t, e, i; + for (cr.clearArray(this.active_effect_types), + this.shaders_preserve_opaqueness = !0, + t = 0, + e = this.effect_types.length; t < e; t++) + (i = this.effect_types[t]).active && (this.active_effect_types.push(i), + i.preservesOpaqueness || (this.shaders_preserve_opaqueness = !1)) + } + , + e.prototype.getEffectByName = function(t) { + for (var e, i = 0, s = this.effect_types.length; i < s; i++) + if ((e = this.effect_types[i]).name === t) + return e; + return null + } + , + e.prototype.createInitialInstances = function() { + for (var t, e, i, s = 0, n = 0, r = this.initial_instances.length; s < r; s++) { + if (t = this.initial_instances[s], + e = this.runtime.types_by_index[t[1]], + i = !0, + !this.runtime.typeHasPersistBehavior(e) || this.layout.first_visit) { + if (!(t = this.runtime.createInstanceFromInit(t, this, !0))) + continue; + g.push(t), + t.type.global && (i = !1, + this.created_globals.push(t.uid)) + } + i && (this.initial_instances[n] = this.initial_instances[s], + n++) + } + this.initial_instances.length = n, + this.runtime.ClearDeathRow(), + !this.runtime.glwrap && this.effect_types.length && (this.blend_mode = this.effect_fallback), + this.compositeOp = cr.effectToCompositeOp(this.blend_mode), + this.runtime.gl && cr.setGLBlend(this, this.blend_mode, this.runtime.gl), + this.render_list_stale = !0 + } + , + e.prototype.recreateInitialObjects = function(t, e) { + for (var i, s, n, r, o, a, h, c = this.runtime.types_by_index, l = t.is_family, u = t.members, p = 0, d = this.initial_instances.length; p < d; ++p) + if (s = (n = (i = this.initial_instances[p])[0])[0], + n = n[1], + e.contains_pt(s, n)) { + if ((n = c[i[1]]) !== t) { + if (!l) + continue; + if (u.indexOf(n) < 0) + continue + } + if (r = this.runtime.createInstanceFromInit(i, this, !1), + this.runtime.isInOnDestroy++, + this.runtime.trigger(Object.getPrototypeOf(n.plugin).cnds.OnCreated, r), + r.is_contained) + for (o = 0, + a = r.siblings.length; o < a; o++) + h = r.siblings[p], + this.runtime.trigger(Object.getPrototypeOf(h.type.plugin).cnds.OnCreated, h); + this.runtime.isInOnDestroy-- + } + } + , + e.prototype.removeFromInstanceList = function(t, e) { + var i = cr.fastIndexOf(this.instances, t); + i < 0 || (e && this.useRenderCells && t.rendercells && t.rendercells.right >= t.rendercells.left && (t.update_bbox(), + this.render_grid.update(t, t.rendercells, null), + t.rendercells.set(0, 0, -1, -1)), + i === this.instances.length - 1 ? this.instances.pop() : (cr.arrayRemove(this.instances, i), + this.setZIndicesStaleFrom(i)), + this.render_list_stale = !0) + } + , + e.prototype.appendToInstanceList = function(t, e) { + t.zindex = this.instances.length, + this.instances.push(t), + e && this.useRenderCells && t.rendercells && t.set_bbox_changed(), + this.render_list_stale = !0 + } + , + e.prototype.prependToInstanceList = function(t, e) { + this.instances.unshift(t), + this.setZIndicesStaleFrom(0), + e && this.useRenderCells && t.rendercells && t.set_bbox_changed() + } + , + e.prototype.moveInstanceAdjacent = function(t, e, i) { + var s = t.get_zindex() + , e = e.get_zindex(); + cr.arrayRemove(this.instances, s), + s < e && e--, + i && e++, + e === this.instances.length ? this.instances.push(t) : this.instances.splice(e, 0, t), + this.setZIndicesStaleFrom(s < e ? s : e) + } + , + e.prototype.setZIndicesStaleFrom = function(t) { + (-1 === this.zindices_stale_from || t < this.zindices_stale_from) && (this.zindices_stale_from = t), + this.zindices_stale = !0, + this.render_list_stale = !0 + } + , + e.prototype.updateZIndices = function() { + if (this.zindices_stale) { + var t, e, i; + if (-1 === this.zindices_stale_from && (this.zindices_stale_from = 0), + this.useRenderCells) + for (t = this.zindices_stale_from, + e = this.instances.length; t < e; ++t) + (i = this.instances[t]).zindex = t, + this.render_grid.markRangeChanged(i.rendercells); + else + for (t = this.zindices_stale_from, + e = this.instances.length; t < e; ++t) + this.instances[t].zindex = t; + this.zindices_stale = !1, + this.zindices_stale_from = -1 + } + } + , + e.prototype.getScale = function(t) { + return this.getNormalScale() * (this.runtime.fullscreenScalingQuality || t ? this.runtime.aspect_scale : 1) + } + , + e.prototype.getNormalScale = function() { + return (this.scale * this.layout.scale - 1) * this.zoomRate + 1 + } + , + e.prototype.getAngle = function() { + return this.disableAngle ? 0 : cr.clamp_angle(this.layout.angle + this.angle) + } + ; + var i = []; + function h() { + return i.length ? i.pop() : [] + } + function u(t) { + cr.clearArray(t), + i.push(t) + } + var c = []; + function s(t, e) { + for (var i, s, n, r = 0, o = t.length; r < o - 1; r += 2) + (function(t, e, i) { + var s, n, r = 0, o = 0, a = 0, h = t.length, c = e.length; + for (i.length = h + c; r < h && o < c; ++a) + s = t[r], + n = e[o], + s.zindex < n.zindex ? (i[a] = s, + ++r) : (i[a] = n, + ++o); + for (; r < h; ++r, + ++a) + i[a] = t[r]; + for (; o < c; ++o, + ++a) + i[a] = e[o] + } + )(i = t[r], s = t[r + 1], n = h()), + e || (u(i), + u(s)), + c.push(n); + o % 2 == 1 && (e ? (i = h(), + cr.shallowAssignArray(i, t[o - 1]), + c.push(i)) : c.push(t[o - 1])), + cr.shallowAssignArray(t, c), + cr.clearArray(c) + } + var n = []; + e.prototype.getRenderCellInstancesToDraw = function() { + if (this.updateZIndices(), + this.render_grid.queryRange(this.viewLeft, this.viewTop, this.viewRight, this.viewBottom, n), + !n.length) + return h(); + if (1 === n.length) { + var t = h(); + return cr.shallowAssignArray(t, n[0]), + cr.clearArray(n), + t + } + t = function(t) { + for (var e = !0; 1 < t.length; ) + s(t, e), + e = !1; + return t[0] + }(n); + return cr.clearArray(n), + t + } + , + e.prototype.draw = function(t) { + this.render_offscreen = this.forceOwnTexture || 1 !== this.opacity || 0 !== this.blend_mode; + var e = this.runtime.canvas + , i = t + , s = !1; + this.render_offscreen && (this.runtime.layer_canvas || (this.runtime.layer_canvas = document.createElement("canvas"), + (e = this.runtime.layer_canvas).width = this.runtime.draw_width, + e.height = this.runtime.draw_height, + this.runtime.layer_ctx = e.getContext("2d"), + s = !0), + e = this.runtime.layer_canvas, + i = this.runtime.layer_ctx, + e.width !== this.runtime.draw_width && (e.width = this.runtime.draw_width, + s = !0), + e.height !== this.runtime.draw_height && (e.height = this.runtime.draw_height, + s = !0), + s && this.runtime.setCtxImageSmoothingEnabled(i, this.runtime.linearSampling), + this.transparent && i.clearRect(0, 0, this.runtime.draw_width, this.runtime.draw_height)), + i.globalAlpha = 1, + i.globalCompositeOperation = "source-over", + this.transparent || (i.fillStyle = "rgb(" + this.background_color[0] + "," + this.background_color[1] + "," + this.background_color[2] + ")", + i.fillRect(0, 0, this.runtime.draw_width, this.runtime.draw_height)), + i.save(), + this.disableAngle = !0; + var n = this.canvasToLayer(0, 0, !0, !0) + , r = this.canvasToLayer(0, 0, !1, !0); + this.disableAngle = !1, + this.runtime.pixel_rounding && (n = Math.round(n), + r = Math.round(r)), + this.rotateViewport(n, r, i); + var o, s = this.getScale(); + i.scale(s, s), + i.translate(-n, -r), + this.useRenderCells ? (this.cur_render_cells.left = this.render_grid.XToCell(this.viewLeft), + this.cur_render_cells.top = this.render_grid.YToCell(this.viewTop), + this.cur_render_cells.right = this.render_grid.XToCell(this.viewRight), + this.cur_render_cells.bottom = this.render_grid.YToCell(this.viewBottom), + this.render_list_stale || !this.cur_render_cells.equals(this.last_render_cells) ? (u(this.last_render_list), + o = this.getRenderCellInstancesToDraw(), + this.render_list_stale = !1, + this.last_render_cells.copy(this.cur_render_cells)) : o = this.last_render_list) : o = this.instances; + for (var a, h = null, c = 0, l = o.length; c < l; ++c) + (a = o[c]) !== h && (this.drawInstance(a, i), + h = a); + this.useRenderCells && (this.last_render_list = o), + i.restore(), + this.render_offscreen && (t.globalCompositeOperation = this.compositeOp, + t.globalAlpha = this.opacity, + t.drawImage(e, 0, 0)) + } + , + e.prototype.drawInstance = function(t, e) { + var i; + t.visible && 0 !== t.width && 0 !== t.height && (t.update_bbox(), + (i = t.bbox).right < this.viewLeft || i.bottom < this.viewTop || i.left > this.viewRight || i.top > this.viewBottom || (e.globalCompositeOperation = t.compositeOp, + t.draw(e))) + } + , + e.prototype.updateViewport = function(t) { + this.disableAngle = !0; + var e = this.canvasToLayer(0, 0, !0, !0) + , i = this.canvasToLayer(0, 0, !1, !0); + this.disableAngle = !1, + this.runtime.pixel_rounding && (e = Math.round(e), + i = Math.round(i)), + this.rotateViewport(e, i, t) + } + , + e.prototype.rotateViewport = function(t, e, i) { + var s = this.getScale(); + this.viewLeft = t, + this.viewTop = e, + this.viewRight = t + this.runtime.draw_width * (1 / s), + this.viewBottom = e + this.runtime.draw_height * (1 / s), + this.viewLeft > this.viewRight && (n = this.viewLeft, + this.viewLeft = this.viewRight, + this.viewRight = n), + this.viewTop > this.viewBottom && (n = this.viewTop, + this.viewTop = this.viewBottom, + this.viewBottom = n); + var n = this.getAngle(); + 0 !== n && (i && (i.translate(this.runtime.draw_width / 2, this.runtime.draw_height / 2), + i.rotate(-n), + i.translate(this.runtime.draw_width / -2, this.runtime.draw_height / -2)), + this.tmprect.set(this.viewLeft, this.viewTop, this.viewRight, this.viewBottom), + this.tmprect.offset((this.viewLeft + this.viewRight) / -2, (this.viewTop + this.viewBottom) / -2), + this.tmpquad.set_from_rotated_rect(this.tmprect, n), + this.tmpquad.bounding_box(this.tmprect), + this.tmprect.offset((this.viewLeft + this.viewRight) / 2, (this.viewTop + this.viewBottom) / 2), + this.viewLeft = this.tmprect.left, + this.viewTop = this.tmprect.top, + this.viewRight = this.tmprect.right, + this.viewBottom = this.tmprect.bottom) + } + , + e.prototype.drawGL_earlyZPass = function(t) { + this.runtime.draw_width, + this.runtime.draw_height; + this.render_offscreen = this.forceOwnTexture, + this.render_offscreen && (this.runtime.layer_tex || (this.runtime.layer_tex = t.createEmptyTexture(this.runtime.draw_width, this.runtime.draw_height, this.runtime.linearSampling)), + this.runtime.layer_tex.c2width === this.runtime.draw_width && this.runtime.layer_tex.c2height === this.runtime.draw_height || (t.deleteTexture(this.runtime.layer_tex), + this.runtime.layer_tex = t.createEmptyTexture(this.runtime.draw_width, this.runtime.draw_height, this.runtime.linearSampling)), + t.setRenderingToTexture(this.runtime.layer_tex)), + this.disableAngle = !0; + var e = this.canvasToLayer(0, 0, !0, !0) + , i = this.canvasToLayer(0, 0, !1, !0); + this.disableAngle = !1, + this.runtime.pixel_rounding && (e = Math.round(e), + i = Math.round(i)), + this.rotateViewport(e, i, null); + var s, i = this.getScale(); + t.resetModelView(), + t.scale(i, i), + t.rotateZ(-this.getAngle()), + t.translate((this.viewLeft + this.viewRight) / -2, (this.viewTop + this.viewBottom) / -2), + t.updateModelView(), + this.useRenderCells ? (this.cur_render_cells.left = this.render_grid.XToCell(this.viewLeft), + this.cur_render_cells.top = this.render_grid.YToCell(this.viewTop), + this.cur_render_cells.right = this.render_grid.XToCell(this.viewRight), + this.cur_render_cells.bottom = this.render_grid.YToCell(this.viewBottom), + this.render_list_stale || !this.cur_render_cells.equals(this.last_render_cells) ? (u(this.last_render_list), + s = this.getRenderCellInstancesToDraw(), + this.render_list_stale = !1, + this.last_render_cells.copy(this.cur_render_cells)) : s = this.last_render_list) : s = this.instances; + for (var n, r = null, o = s.length - 1; 0 <= o; --o) + (n = s[o]) !== r && (this.drawInstanceGL_earlyZPass(s[o], t), + r = n); + this.useRenderCells && (this.last_render_list = s), + this.transparent || (this.clear_earlyz_index = this.runtime.earlyz_index++, + t.setEarlyZIndex(this.clear_earlyz_index), + t.setColorFillMode(1, 1, 1, 1), + t.fullscreenQuad(), + t.restoreEarlyZMode()) + } + , + e.prototype.drawGL = function(t) { + this.runtime.draw_width, + this.runtime.draw_height; + var e = 0 + , i = 0; + this.render_offscreen = this.forceOwnTexture || 1 !== this.opacity || 0 < this.active_effect_types.length || 0 !== this.blend_mode, + this.render_offscreen && (this.runtime.layer_tex || (this.runtime.layer_tex = t.createEmptyTexture(this.runtime.draw_width, this.runtime.draw_height, this.runtime.linearSampling)), + this.runtime.layer_tex.c2width === this.runtime.draw_width && this.runtime.layer_tex.c2height === this.runtime.draw_height || (t.deleteTexture(this.runtime.layer_tex), + this.runtime.layer_tex = t.createEmptyTexture(this.runtime.draw_width, this.runtime.draw_height, this.runtime.linearSampling)), + t.setRenderingToTexture(this.runtime.layer_tex), + this.transparent && t.clear(0, 0, 0, 0)), + this.transparent || (this.runtime.enableFrontToBack ? (t.setEarlyZIndex(this.clear_earlyz_index), + t.setColorFillMode(this.background_color[0] / 255, this.background_color[1] / 255, this.background_color[2] / 255, 1), + t.fullscreenQuad(), + t.setTextureFillMode()) : t.clear(this.background_color[0] / 255, this.background_color[1] / 255, this.background_color[2] / 255, 1)), + this.disableAngle = !0; + var s = this.canvasToLayer(0, 0, !0, !0) + , n = this.canvasToLayer(0, 0, !1, !0); + this.disableAngle = !1, + this.runtime.pixel_rounding && (s = Math.round(s), + n = Math.round(n)), + this.rotateViewport(s, n, null); + var r, n = this.getScale(); + t.resetModelView(), + t.scale(n, n), + t.rotateZ(-this.getAngle()), + t.translate((this.viewLeft + this.viewRight) / -2, (this.viewTop + this.viewBottom) / -2), + t.updateModelView(), + this.useRenderCells ? (this.cur_render_cells.left = this.render_grid.XToCell(this.viewLeft), + this.cur_render_cells.top = this.render_grid.YToCell(this.viewTop), + this.cur_render_cells.right = this.render_grid.XToCell(this.viewRight), + this.cur_render_cells.bottom = this.render_grid.YToCell(this.viewBottom), + this.render_list_stale || !this.cur_render_cells.equals(this.last_render_cells) ? (u(this.last_render_list), + r = this.getRenderCellInstancesToDraw(), + this.render_list_stale = !1, + this.last_render_cells.copy(this.cur_render_cells)) : r = this.last_render_list) : r = this.instances; + for (var o, a = null, h = 0, c = r.length; h < c; ++h) + (o = r[h]) !== a && (this.drawInstanceGL(r[h], t), + a = o); + this.useRenderCells && (this.last_render_list = r), + this.render_offscreen && (e = this.active_effect_types.length ? this.active_effect_types[0].shaderindex : 0, + i = this.active_effect_types.length ? this.active_effect_types[0].index : 0, + 0 === this.active_effect_types.length || 1 === this.active_effect_types.length && !t.programUsesCrossSampling(e) && 1 === this.opacity ? (1 === this.active_effect_types.length ? (t.switchProgram(e), + t.setProgramParameters(this.layout.getRenderTarget(), 1 / this.runtime.draw_width, 1 / this.runtime.draw_height, 0, 0, 1, 1, n, this.getAngle(), this.viewLeft, this.viewTop, (this.viewLeft + this.viewRight) / 2, (this.viewTop + this.viewBottom) / 2, this.runtime.kahanTime.sum, this.effect_params[i]), + t.programIsAnimated(e) && (this.runtime.redraw = !0)) : t.switchProgram(0), + t.setRenderingToTexture(this.layout.getRenderTarget()), + t.setOpacity(this.opacity), + t.setTexture(this.runtime.layer_tex), + t.setBlend(this.srcBlend, this.destBlend), + t.resetModelView(), + t.updateModelView(), + i = this.runtime.draw_width / 2, + e = this.runtime.draw_height / 2, + t.quad(-i, e, i, e, i, -e, -i, -e), + t.setTexture(null)) : this.layout.renderEffectChain(t, this, null, this.layout.getRenderTarget())) + } + , + e.prototype.drawInstanceGL = function(t, e) { + var i; + t.visible && 0 !== t.width && 0 !== t.height && (t.update_bbox(), + (i = t.bbox).right < this.viewLeft || i.bottom < this.viewTop || i.left > this.viewRight || i.top > this.viewBottom || (e.setEarlyZIndex(t.earlyz_index), + t.uses_shaders ? this.drawInstanceWithShadersGL(t, e) : (e.switchProgram(0), + e.setBlend(t.srcBlend, t.destBlend), + t.drawGL(e)))) + } + , + e.prototype.drawInstanceGL_earlyZPass = function(t, e) { + var i; + t.visible && 0 !== t.width && 0 !== t.height && (t.update_bbox(), + (i = t.bbox).right < this.viewLeft || i.bottom < this.viewTop || i.left > this.viewRight || i.top > this.viewBottom || (t.earlyz_index = this.runtime.earlyz_index++, + 0 === t.blend_mode && 1 === t.opacity && t.shaders_preserve_opaqueness && t.drawGL_earlyZPass && (e.setEarlyZIndex(t.earlyz_index), + t.drawGL_earlyZPass(e)))) + } + , + e.prototype.drawInstanceWithShadersGL = function(t, e) { + var i, s, n, r, o, a, h, c, l, u = t.active_effect_types[0].shaderindex, p = t.active_effect_types[0].index, d = this.getScale(); + 1 !== t.active_effect_types.length || e.programUsesCrossSampling(u) || e.programExtendsBox(u) || (t.angle || t.layer.getAngle()) && e.programUsesDest(u) || 1 !== t.opacity || t.type.plugin.must_predraw ? (this.layout.renderEffectChain(e, this, t, this.render_offscreen ? this.runtime.layer_tex : this.layout.getRenderTarget()), + e.resetModelView(), + e.scale(d, d), + e.rotateZ(-this.getAngle()), + e.translate((this.viewLeft + this.viewRight) / -2, (this.viewTop + this.viewBottom) / -2), + e.updateModelView()) : (e.switchProgram(u), + e.setBlend(t.srcBlend, t.destBlend), + e.programIsAnimated(u) && (this.runtime.redraw = !0), + h = a = o = r = 0, + e.programUsesDest(u) && (n = t.bbox, + i = this.layerToCanvas(n.left, n.top, !0, !0), + s = this.layerToCanvas(n.left, n.top, !1, !0), + u = this.layerToCanvas(n.right, n.bottom, !0, !0), + n = this.layerToCanvas(n.right, n.bottom, !1, !0), + r = i / windowWidth, + o = 1 - s / windowHeight, + a = u / windowWidth, + h = 1 - n / windowHeight), + l = t.curFrame && t.curFrame.texture_img ? (c = 1 / (l = t.curFrame.texture_img).width, + 1 / l.height) : (c = 1 / t.width, + 1 / t.height), + e.setProgramParameters(this.render_offscreen ? this.runtime.layer_tex : this.layout.getRenderTarget(), c, l, r, o, a, h, d, this.getAngle(), this.viewLeft, this.viewTop, (this.viewLeft + this.viewRight) / 2, (this.viewTop + this.viewBottom) / 2, this.runtime.kahanTime.sum, t.effect_params[p]), + t.drawGL(e)) + } + , + e.prototype.canvasToLayer = function(t, e, i, s) { + var n = this.runtime.devicePixelRatio; + this.runtime.isRetina && (t *= n, + e *= n); + var r = this.runtime.parallax_x_origin + , o = this.runtime.parallax_y_origin + , a = (this.layout.scrollX - r) * this.parallaxX + r + , h = (this.layout.scrollY - o) * this.parallaxY + o + , n = a + , r = h + , o = 1 / this.getScale(!s); + s ? (n -= this.runtime.draw_width * o / 2, + r -= this.runtime.draw_height * o / 2) : (n -= this.runtime.width * o / 2, + r -= this.runtime.height * o / 2), + n += t * o, + r += e * o; + t = this.getAngle(); + return 0 !== t && (r -= h, + t = (n -= a) * (e = Math.cos(t)) - r * (o = Math.sin(t)), + r = r * e + n * o, + n = t, + n += a, + r += h), + i ? n : r + } + , + e.prototype.layerToCanvas = function(t, e, i, s) { + var n = this.runtime.parallax_x_origin + , r = this.runtime.parallax_y_origin + , o = (this.layout.scrollX - n) * this.parallaxX + n + , a = (this.layout.scrollY - r) * this.parallaxY + r + , h = o + , c = a + , l = this.getAngle(); + 0 !== l && (e -= a, + l = (t -= o) * (n = Math.cos(-l)) - e * (r = Math.sin(-l)), + e = e * n + t * r, + t = l, + t += o, + e += a); + a = 1 / this.getScale(!s); + s ? (h -= this.runtime.draw_width * a / 2, + c -= this.runtime.draw_height * a / 2) : (h -= this.runtime.width * a / 2, + c -= this.runtime.height * a / 2), + h = (t - h) / a, + c = (e - c) / a; + a = this.runtime.devicePixelRatio; + return this.runtime.isRetina && !s && (h /= a, + c /= a), + i ? h : c + } + , + e.prototype.rotatePt = function(t, e, i) { + if (0 === this.getAngle()) + return i ? t : e; + var s = this.layerToCanvas(t, e, !0) + , t = this.layerToCanvas(t, e, !1); + this.disableAngle = !0; + e = this.canvasToLayer(s, t, !0), + t = this.canvasToLayer(s, t, !0); + return this.disableAngle = !1, + i ? e : t + } + , + e.prototype.saveToJSON = function() { + for (var t, e = { + s: this.scale, + a: this.angle, + vl: this.viewLeft, + vt: this.viewTop, + vr: this.viewRight, + vb: this.viewBottom, + v: this.visible, + bc: this.background_color, + t: this.transparent, + px: this.parallaxX, + py: this.parallaxY, + o: this.opacity, + zr: this.zoomRate, + fx: [], + cg: this.created_globals, + instances: [] + }, i = 0, s = this.effect_types.length; i < s; i++) + t = this.effect_types[i], + e.fx.push({ + name: t.name, + active: t.active, + params: this.effect_params[t.index] + }); + return e + } + , + e.prototype.loadFromJSON = function(t) { + var e, i; + this.scale = t.s, + this.angle = t.a, + this.viewLeft = t.vl, + this.viewTop = t.vt, + this.viewRight = t.vr, + this.viewBottom = t.vb, + this.visible = t.v, + this.background_color = t.bc, + this.transparent = t.t, + this.parallaxX = t.px, + this.parallaxY = t.py, + this.opacity = t.o, + this.zoomRate = t.zr, + this.created_globals = t.cg || [], + cr.shallowAssignArray(this.initial_instances, this.startup_initial_instances); + for (var s = new cr.ObjectSet, n = 0, r = this.created_globals.length; n < r; ++n) + s.add(this.created_globals[n]); + for (e = n = 0, + r = this.initial_instances.length; n < r; ++n) + s.contains(this.initial_instances[n][2]) || (this.initial_instances[e] = this.initial_instances[n], + ++e); + cr.truncateArray(this.initial_instances, e); + var o = t.fx; + for (n = 0, + r = o.length; n < r; n++) + (i = this.getEffectByName(o[n].name)) && (i.active = o[n].active, + this.effect_params[i.index] = o[n].params); + this.updateActiveEffects(), + this.instances.sort(m), + this.zindices_stale = !0 + } + , + cr.layer = e +}(), +function() { + var o = []; + function a(t, e) { + return t.index - e.index + } + function n(t) { + var e, i, s, n, r; + for (2 === t.length ? t[0].index > t[1].index && (n = t[0], + t[0] = t[1], + t[1] = n) : 2 < t.length && t.sort(a), + t.length >= o.length && (o.length = t.length + 1), + o[t.length] || (o[t.length] = []), + e = 0, + i = (r = o[t.length]).length; e < i; e++) + if (function(t, e) { + var i, s = t.length; + switch (s) { + case 0: + return 1; + case 1: + return t[0] === e[0]; + case 2: + return t[0] === e[0] && t[1] === e[1]; + default: + for (i = 0; i < s; i++) + if (t[i] !== e[i]) + return; + return 1 + } + }(t, s = r[e])) + return s; + return r.push(t), + t + } + function t(t, e) { + this.runtime = t, + this.triggers = {}, + this.fasttriggers = {}, + this.hasRun = !1, + this.includes = new cr.ObjectSet, + this.deep_includes = [], + this.already_included_sheets = [], + this.name = e[0]; + var i, s, n = e[1]; + for (this.events = [], + i = 0, + s = n.length; i < s; i++) + this.init_event(n[i], null, this.events) + } + function e(t) { + this.type = t, + this.instances = [], + this.else_instances = [], + this.select_all = !0 + } + function i(t, e, i) { + this.sheet = t, + this.parent = e, + this.runtime = t.runtime, + this.solModifiers = [], + this.solModifiersIncludingParents = [], + this.solWriterAfterCnds = !1, + this.group = !1, + this.initially_activated = !1, + this.toplevelevent = !1, + this.toplevelgroup = !1, + this.has_else_block = !1, + this.conditions = [], + this.actions = [], + this.subevents = [], + this.group_name = "", + this.group = !1, + this.initially_activated = !1, + this.group_active = !1, + this.contained_includes = null, + i[1] && (this.group_name = i[1][1].toLowerCase(), + this.group = !0, + this.initially_activated = !!i[1][0], + this.contained_includes = [], + this.group_active = this.initially_activated, + this.runtime.allGroups.push(this), + this.runtime.groups_by_name[this.group_name] = this), + this.orblock = i[2], + this.sid = i[4], + this.group || (this.runtime.blocksBySid[this.sid.toString()] = this); + var s = i[5]; + for (h = 0, + c = s.length; h < c; h++) { + var n = new cr.condition(this,s[h]); + n.index = h, + cr.seal(n), + this.conditions.push(n), + this.addSolModifier(n.type) + } + var r = i[6]; + for (h = 0, + c = r.length; h < c; h++) { + var o = new cr.action(this,r[h]); + o.index = h, + cr.seal(o), + this.actions.push(o) + } + if (8 === i.length) + for (var a = i[7], h = 0, c = a.length; h < c; h++) + this.sheet.init_event(a[h], this, this.subevents); + this.is_else_block = !1, + this.conditions.length && (this.is_else_block = null == this.conditions[0].type && this.conditions[0].func == cr.system_object.prototype.cnds.Else) + } + function s(t, e) { + var i, s, n; + if (t && (-1 === e.indexOf(t) && e.push(t), + t.is_contained)) + for (i = 0, + s = t.container.length; i < s; i++) + t !== (n = t.container[i]) && -1 === e.indexOf(n) && e.push(n) + } + function r(t, e) { + if (this.block = t, + this.sheet = t.sheet, + this.runtime = t.runtime, + this.parameters = [], + this.results = [], + this.extra = {}, + this.index = -1, + this.anyParamVariesPerInstance = !1, + this.func = this.runtime.GetObjectReference(e[1]), + this.trigger = 0 < e[3], + this.fasttrigger = 2 === e[3], + this.looping = e[4], + this.inverted = e[5], + this.isstatic = e[6], + this.sid = e[7], + this.runtime.cndsBySid[this.sid.toString()] = this, + -1 === e[0] ? (this.type = null, + this.run = this.run_system, + this.behaviortype = null, + this.beh_index = -1) : (this.type = this.runtime.types_by_index[e[0]], + this.isstatic ? this.run = this.run_static : this.run = this.run_object, + e[2] ? (this.behaviortype = this.type.getBehaviorByName(e[2]), + this.beh_index = this.type.getBehaviorIndexByName(e[2])) : (this.behaviortype = null, + this.beh_index = -1), + this.block.parent && this.block.parent.setSolWriterAfterCnds()), + this.fasttrigger && (this.run = this.run_true), + 10 === e.length) { + for (var i = e[9], s = 0, n = i.length; s < n; s++) { + var r = new cr.parameter(this,i[s]); + cr.seal(r), + this.parameters.push(r) + } + this.results.length = i.length + } + } + function h(t, e) { + if (this.block = t, + this.sheet = t.sheet, + this.runtime = t.runtime, + this.parameters = [], + this.results = [], + this.extra = {}, + this.index = -1, + this.anyParamVariesPerInstance = !1, + this.func = this.runtime.GetObjectReference(e[1]), + -1 === e[0] ? (this.type = null, + this.run = this.run_system, + this.behaviortype = null, + this.beh_index = -1) : (this.type = this.runtime.types_by_index[e[0]], + this.run = this.run_object, + e[2] ? (this.behaviortype = this.type.getBehaviorByName(e[2]), + this.beh_index = this.type.getBehaviorIndexByName(e[2])) : (this.behaviortype = null, + this.beh_index = -1)), + this.sid = e[3], + this.runtime.actsBySid[this.sid.toString()] = this, + 6 === e.length) { + for (var i = e[5], s = 0, n = i.length; s < n; s++) { + var r = new cr.parameter(this,i[s]); + cr.seal(r), + this.parameters.push(r) + } + this.results.length = i.length + } + } + t.prototype.toString = function() { + return this.name + } + , + t.prototype.init_event = function(t, e, i) { + switch (t[0]) { + case 0: + var s, n, r = new cr.eventblock(this,e,t); + if (cr.seal(r), + r.orblock) + for (i.push(r), + s = 0, + n = r.conditions.length; s < n; s++) + r.conditions[s].trigger && this.init_trigger(r, s); + else + r.is_trigger() ? this.init_trigger(r, 0) : i.push(r); + break; + case 1: + var o = new cr.eventvariable(this,e,t); + cr.seal(o), + i.push(o); + break; + case 2: + o = new cr.eventinclude(this,e,t); + cr.seal(o), + i.push(o) + } + } + , + t.prototype.postInit = function() { + for (var t = 0, e = this.events.length; t < e; t++) + this.events[t].postInit(t < e - 1 && this.events[t + 1].is_else_block) + } + , + t.prototype.updateDeepIncludes = function() { + cr.clearArray(this.deep_includes), + cr.clearArray(this.already_included_sheets), + this.addDeepIncludes(this), + cr.clearArray(this.already_included_sheets) + } + , + t.prototype.addDeepIncludes = function(t) { + for (var e, i, s = t.deep_includes, n = t.already_included_sheets, r = this.includes.valuesRef(), o = 0, a = r.length; o < a; ++o) + i = (e = r[o]).include_sheet, + !e.isActive() || t === i || -1 < n.indexOf(i) || (n.push(i), + i.addDeepIncludes(t), + s.push(i)) + } + , + t.prototype.run = function(t) { + var e, i; + for (this.runtime.resuming_breakpoint || (this.hasRun = !0, + t || (this.runtime.isRunningEvents = !0)), + e = 0, + i = this.events.length; e < i; e++) { + var s = this.events[e]; + s.run(), + this.runtime.clearSol(s.solModifiers), + this.runtime.hasPendingInstances && this.runtime.ClearDeathRow() + } + t || (this.runtime.isRunningEvents = !1) + } + , + t.prototype.init_trigger = function(t, e) { + t.orblock || this.runtime.triggers_to_postinit.push(t); + var i = t.conditions[e] + , s = i.type ? i.type.name : "system" + , n = i.fasttrigger + , r = n ? this.fasttriggers : this.triggers; + r[s] || (r[s] = []); + var o = r[s] + , a = i.func; + if (n) { + if (i.parameters.length) { + var h = i.parameters[0]; + if (1 === h.type && 2 === h.expression.type) { + var c, l, u, p = h.expression.value.toLowerCase(); + for (l = 0, + u = o.length; l < u; l++) + if (o[l].method == a) + return void ((c = o[l].evs)[p] ? c[p].push([t, e]) : c[p] = [[t, e]]); + (c = {})[p] = [[t, e]], + o.push({ + method: a, + evs: c + }) + } + } + } else { + for (l = 0, + u = o.length; l < u; l++) + if (o[l].method == a) + return void o[l].evs.push([t, e]); + h = a, + cr.plugins_.Sprite && h === cr.plugins_.Sprite.prototype.cnds.OnFrameChanged ? o.unshift({ + method: a, + evs: [[t, e]] + }) : o.push({ + method: a, + evs: [[t, e]] + }) + } + } + , + cr.eventsheet = t, + e.prototype.hasObjects = function() { + return (this.select_all ? this.type : this).instances.length + } + , + e.prototype.getObjects = function() { + return (this.select_all ? this.type : this).instances + } + , + e.prototype.pick_one = function(t) { + var e; + t && (t.runtime.getCurrentEventStack().current_event.orblock ? (this.select_all && (cr.clearArray(this.instances), + cr.shallowAssignArray(this.else_instances, t.type.instances), + this.select_all = !1), + -1 !== (e = this.else_instances.indexOf(t)) && (this.instances.push(this.else_instances[e]), + this.else_instances.splice(e, 1))) : (this.select_all = !1, + cr.clearArray(this.instances), + this.instances[0] = t)) + } + , + cr.selection = e, + window._c2hh_ = "F16CEE99727F43335EF55B535BAAB46BD73A2816", + i.prototype.postInit = function(t) { + var e, i, s = this.parent; + if (this.group) + for (this.toplevelgroup = !0; s; ) { + if (!s.group) { + this.toplevelgroup = !1; + break + } + s = s.parent + } + for (this.toplevelevent = !this.is_trigger() && (!this.parent || this.parent.group && this.parent.toplevelgroup), + this.has_else_block = !!t, + this.solModifiersIncludingParents = this.solModifiers.slice(0), + s = this.parent; s; ) { + for (e = 0, + i = s.solModifiers.length; e < i; e++) + this.addParentSolModifier(s.solModifiers[e]); + s = s.parent + } + for (this.solModifiers = n(this.solModifiers), + this.solModifiersIncludingParents = n(this.solModifiersIncludingParents), + e = 0, + i = this.conditions.length; e < i; e++) + this.conditions[e].postInit(); + for (e = 0, + i = this.actions.length; e < i; e++) + this.actions[e].postInit(); + for (e = 0, + i = this.subevents.length; e < i; e++) + this.subevents[e].postInit(e < i - 1 && this.subevents[e + 1].is_else_block) + } + , + i.prototype.setGroupActive = function(t) { + if (this.group_active !== !!t) { + var e, i; + for (this.group_active = !!t, + e = 0, + i = this.contained_includes.length; e < i; ++e) + this.contained_includes[e].updateActive(); + 0 < i && this.runtime.running_layout.event_sheet && this.runtime.running_layout.event_sheet.updateDeepIncludes() + } + } + , + i.prototype.addSolModifier = function(t) { + s(t, this.solModifiers) + } + , + i.prototype.addParentSolModifier = function(t) { + s(t, this.solModifiersIncludingParents) + } + , + i.prototype.setSolWriterAfterCnds = function() { + this.solWriterAfterCnds = !0, + this.parent && this.parent.setSolWriterAfterCnds() + } + , + i.prototype.is_trigger = function() { + return !!this.conditions.length && this.conditions[0].trigger + } + , + i.prototype.run = function() { + var t, e, i = !1, s = this.runtime, n = this.runtime.getCurrentEventStack(), r = (n.current_event = this).conditions; + if (this.is_else_block || (n.else_branch_ran = !1), + this.orblock) { + for (0 === r.length && (i = !0), + n.cndindex = 0, + t = r.length; n.cndindex < t; n.cndindex++) + (e = r[n.cndindex]).trigger || e.run() && (i = !0); + (n.last_event_true = i) && this.run_actions_and_subevents() + } else { + for (n.cndindex = 0, + t = r.length; n.cndindex < t; n.cndindex++) + if (!r[n.cndindex].run()) + return n.last_event_true = !1, + void (this.toplevelevent && s.hasPendingInstances && s.ClearDeathRow()); + n.last_event_true = !0, + this.run_actions_and_subevents() + } + this.end_run(n) + } + , + i.prototype.end_run = function(t) { + t.last_event_true && this.has_else_block && (t.else_branch_ran = !0), + this.toplevelevent && this.runtime.hasPendingInstances && this.runtime.ClearDeathRow() + } + , + i.prototype.run_orblocktrigger = function(t) { + (this.runtime.getCurrentEventStack().current_event = this).conditions[t].run() && (this.run_actions_and_subevents(), + this.runtime.getCurrentEventStack().last_event_true = !0) + } + , + i.prototype.run_actions_and_subevents = function() { + var t, e = this.runtime.getCurrentEventStack(); + for (e.actindex = 0, + t = this.actions.length; e.actindex < t; e.actindex++) + if (this.actions[e.actindex].run()) + return; + this.run_subevents() + } + , + i.prototype.resume_actions_and_subevents = function() { + for (var t = this.runtime.getCurrentEventStack(), e = this.actions.length; t.actindex < e; t.actindex++) + if (this.actions[t.actindex].run()) + return; + this.run_subevents() + } + , + i.prototype.run_subevents = function() { + if (this.subevents.length) { + var t, e, i, s, n = this.subevents.length - 1; + if (this.runtime.pushEventStack(this), + this.solWriterAfterCnds) + for (t = 0, + e = this.subevents.length; t < e; t++) + i = this.subevents[t], + (s = !this.toplevelgroup || !this.group && t < n) && this.runtime.pushCopySol(i.solModifiers), + i.run(), + s ? this.runtime.popSol(i.solModifiers) : this.runtime.clearSol(i.solModifiers); + else + for (t = 0, + e = this.subevents.length; t < e; t++) + this.subevents[t].run(); + this.runtime.popEventStack() + } + } + , + i.prototype.run_pretrigger = function() { + var t = this.runtime.getCurrentEventStack(); + t.current_event = this; + var e, i = !1; + for (t.cndindex = 0, + e = this.conditions.length; t.cndindex < e; t.cndindex++) + if (this.conditions[t.cndindex].run()) + i = !0; + else if (!this.orblock) + return !1; + return !this.orblock || i + } + , + i.prototype.retrigger = function() { + this.runtime.execcount++; + var t, e = this.runtime.getCurrentEventStack().cndindex, i = this.runtime.pushEventStack(this); + if (!this.orblock) + for (i.cndindex = e + 1, + t = this.conditions.length; i.cndindex < t; i.cndindex++) + if (!this.conditions[i.cndindex].run()) + return this.runtime.popEventStack(), + !1; + return this.run_actions_and_subevents(), + this.runtime.popEventStack(), + !0 + } + , + i.prototype.isFirstConditionOfType = function(t) { + var e = t.index; + if (0 === e) + return !0; + for (--e; 0 <= e; --e) + if (this.conditions[e].type === t.type) + return !1; + return !0 + } + , + cr.eventblock = i, + r.prototype.postInit = function() { + for (var t, e = 0, i = this.parameters.length; e < i; e++) + (t = this.parameters[e]).postInit(), + t.variesPerInstance && (this.anyParamVariesPerInstance = !0) + } + , + r.prototype.run_true = function() { + return !0 + } + , + r.prototype.run_system = function() { + for (var t = 0, e = this.parameters.length; t < e; t++) + this.results[t] = this.parameters[t].get(); + return cr.xor(this.func.apply(this.runtime.system, this.results), this.inverted) + } + , + r.prototype.run_static = function() { + for (var t = 0, e = this.parameters.length; t < e; t++) + this.results[t] = this.parameters[t].get(); + var i = this.func.apply(this.behaviortype || this.type, this.results); + return this.type.applySolToContainer(), + i + } + , + r.prototype.run_object = function() { + var t, e, i, s, n, r, o, a, h, c = this.type, l = c.getCurrentSol(), u = this.block.orblock && !this.trigger, p = 0, d = c.is_contained, f = c.is_family, y = c.family_index, g = this.beh_index, m = -1 < g, _ = this.anyParamVariesPerInstance, v = this.parameters, b = this.results, w = this.inverted, x = this.func; + if (_) + for (t = 0, + i = v.length; t < i; ++t) + (s = v[t]).variesPerInstance || (b[t] = s.get(0)); + else + for (t = 0, + i = v.length; t < i; ++t) + b[t] = v[t].get(0); + if (l.select_all) { + for (cr.clearArray(l.instances), + cr.clearArray(l.else_instances), + C = 0, + k = (S = c.instances).length; C < k; ++C) { + if (r = S[C], + _) + for (t = 0, + i = v.length; t < i; ++t) + (s = v[t]).variesPerInstance && (b[t] = s.get(C)); + n = m ? (p = 0, + f && (p = r.type.family_beh_map[y]), + x.apply(r.behavior_insts[g + p], b)) : x.apply(r, b), + cr.xor(n, w) ? l.instances.push(r) : u && l.else_instances.push(r) + } + return c.finish && c.finish(!0), + l.select_all = !1, + c.applySolToContainer(), + l.hasObjects() + } + e = 0; + for (var S, T = u && !this.block.isFirstConditionOfType(this), A = !1, C = 0, k = (S = T ? l.else_instances : l.instances).length; C < k; ++C) { + if (r = S[C], + _) + for (t = 0, + i = v.length; t < i; ++t) + (s = v[t]).variesPerInstance && (b[t] = s.get(C)); + if (n = m ? (p = 0, + f && (p = r.type.family_beh_map[y]), + x.apply(r.behavior_insts[g + p], b)) : x.apply(r, b), + cr.xor(n, w)) + if (A = !0, + T) { + if (l.instances.push(r), + d) + for (t = 0, + i = r.siblings.length; t < i; t++) + (o = r.siblings[t]).type.getCurrentSol().instances.push(o) + } else { + if (S[e] = r, + d) + for (t = 0, + i = r.siblings.length; t < i; t++) + (o = r.siblings[t]).type.getCurrentSol().instances[e] = o; + e++ + } + else if (T) { + if (S[e] = r, + d) + for (t = 0, + i = r.siblings.length; t < i; t++) + (o = r.siblings[t]).type.getCurrentSol().else_instances[e] = o; + e++ + } else if (u && (l.else_instances.push(r), + d)) + for (t = 0, + i = r.siblings.length; t < i; t++) + (o = r.siblings[t]).type.getCurrentSol().else_instances.push(o) + } + if (cr.truncateArray(S, e), + d) + for (C = 0, + k = (h = c.container).length; C < k; C++) + a = h[C].getCurrentSol(), + T ? cr.truncateArray(a.else_instances, e) : cr.truncateArray(a.instances, e); + var O = A; + if (T && !A) + for (C = 0, + k = l.instances.length; C < k; C++) { + if (r = l.instances[C], + _) + for (t = 0, + i = v.length; t < i; t++) + (s = v[t]).variesPerInstance && (b[t] = s.get(C)); + if (n = m ? x.apply(r.behavior_insts[g], b) : x.apply(r, b), + cr.xor(n, w)) { + A = !0; + break + } + } + return c.finish && c.finish(O || u), + u ? A : l.hasObjects() + } + , + cr.condition = r, + h.prototype.postInit = function() { + for (var t, e = 0, i = this.parameters.length; e < i; e++) + (t = this.parameters[e]).postInit(), + t.variesPerInstance && (this.anyParamVariesPerInstance = !0) + } + , + h.prototype.run_system = function() { + for (var t = this.runtime, e = this.parameters, i = this.results, s = 0, n = e.length; s < n; ++s) + i[s] = e[s].get(); + return this.func.apply(t.system, i) + } + , + h.prototype.run_object = function() { + var t, e, i, s, n, r, o, a = this.type, h = this.beh_index, c = a.family_index, l = this.anyParamVariesPerInstance, u = this.parameters, p = this.results, d = this.func, f = a.getCurrentSol().getObjects(), y = a.is_family, g = -1 < h; + if (l) + for (e = 0, + s = u.length; e < s; ++e) + (n = u[e]).variesPerInstance || (p[e] = n.get(0)); + else + for (e = 0, + s = u.length; e < s; ++e) + p[e] = u[e].get(0); + for (t = 0, + i = f.length; t < i; ++t) { + if (r = f[t], + l) + for (e = 0, + s = u.length; e < s; ++e) + (n = u[e]).variesPerInstance && (p[e] = n.get(t)); + g ? (o = 0, + y && (o = r.type.family_beh_map[c]), + d.apply(r.behavior_insts[h + o], p)) : d.apply(r, p) + } + return !1 + } + , + cr.action = h; + var c = [] + , l = -1; + function u() { + return l++, + c.length === l && c.push(new cr.expvalue), + c[l] + } + function p() { + l-- + } + function d(t, e) { + var i, s, n; + switch (this.owner = t, + this.block = t.block, + this.sheet = t.sheet, + this.runtime = t.runtime, + this.type = e[0], + this.expression = null, + this.solindex = 0, + this.get = null, + this.combosel = 0, + this.layout = null, + this.key = 0, + this.object = null, + this.index = 0, + this.varname = null, + this.eventvar = null, + this.fileinfo = null, + this.subparams = null, + this.variadicret = null, + this.subparams = null, + this.variadicret = null, + this.variesPerInstance = !1, + e[0]) { + case 0: + case 7: + this.expression = new cr.expNode(this,e[1]), + this.solindex = 0, + this.get = this.get_exp; + break; + case 1: + this.expression = new cr.expNode(this,e[1]), + this.solindex = 0, + this.get = this.get_exp_str; + break; + case 5: + this.expression = new cr.expNode(this,e[1]), + this.solindex = 0, + this.get = this.get_layer; + break; + case 3: + case 8: + this.combosel = e[1], + this.get = this.get_combosel; + break; + case 6: + this.layout = this.runtime.layouts[e[1]], + this.get = this.get_layout; + break; + case 9: + this.key = e[1], + this.get = this.get_key; + break; + case 4: + this.object = this.runtime.types_by_index[e[1]], + this.get = this.get_object, + this.block.addSolModifier(this.object), + this.owner instanceof cr.action ? this.block.setSolWriterAfterCnds() : this.block.parent && this.block.parent.setSolWriterAfterCnds(); + break; + case 10: + this.index = e[1], + t.type && t.type.is_family ? (this.get = this.get_familyvar, + this.variesPerInstance = !0) : this.get = this.get_instvar; + break; + case 11: + this.varname = e[1], + this.eventvar = null, + this.get = this.get_eventvar; + break; + case 2: + case 12: + this.fileinfo = e[1], + this.get = this.get_audiofile; + break; + case 13: + for (this.get = this.get_variadic, + this.subparams = [], + this.variadicret = [], + i = 1, + s = e.length; i < s; i++) + n = new cr.parameter(this.owner,e[i]), + cr.seal(n), + this.subparams.push(n), + this.variadicret.push(0) + } + } + function f(t, e, i) { + this.sheet = t, + this.parent = e, + this.runtime = t.runtime, + this.solModifiers = [], + this.name = i[1], + this.vartype = i[2], + this.initial = i[3], + this.is_static = !!i[4], + this.is_constant = !!i[5], + this.sid = i[6], + (this.runtime.varsBySid[this.sid.toString()] = this).data = this.initial, + this.parent ? (this.is_static || this.is_constant ? this.localIndex = -1 : this.localIndex = this.runtime.stackLocalCount++, + this.runtime.all_local_vars.push(this)) : (this.localIndex = -1, + this.runtime.all_global_vars.push(this)) + } + function y(t, e, i) { + this.sheet = t, + this.parent = e, + this.runtime = t.runtime, + this.solModifiers = [], + this.include_sheet = null, + this.include_sheet_name = i[1], + this.active = !0 + } + function g() { + this.temp_parents_arr = [], + this.reset(null), + cr.seal(this) + } + d.prototype.postInit = function() { + var t, e; + if (11 === this.type) + this.eventvar = this.runtime.getEventVariableByName(this.varname, this.block.parent); + else if (13 === this.type) + for (t = 0, + e = this.subparams.length; t < e; t++) + this.subparams[t].postInit(); + this.expression && this.expression.postInit() + } + , + d.prototype.maybeVaryForType = function(t) { + this.variesPerInstance || t && (t.plugin.singleglobal || (this.variesPerInstance = !0)) + } + , + d.prototype.setVaries = function() { + this.variesPerInstance = !0 + } + , + d.prototype.get_exp = function(t) { + this.solindex = t || 0; + t = u(); + return this.expression.get(t), + p(), + t.data + } + , + d.prototype.get_exp_str = function(t) { + this.solindex = t || 0; + t = u(); + return this.expression.get(t), + p(), + cr.is_string(t.data) ? t.data : "" + } + , + d.prototype.get_object = function() { + return this.object + } + , + d.prototype.get_combosel = function() { + return this.combosel + } + , + d.prototype.get_layer = function(t) { + this.solindex = t || 0; + t = u(); + return this.expression.get(t), + p(), + t.is_number() ? this.runtime.getLayerByNumber(t.data) : this.runtime.getLayerByName(t.data) + } + , + d.prototype.get_layout = function() { + return this.layout + } + , + d.prototype.get_key = function() { + return this.key + } + , + d.prototype.get_instvar = function() { + return this.index + } + , + d.prototype.get_familyvar = function(t) { + var e = t || 0 + , i = this.owner.type + , s = null + , n = i.getCurrentSol() + , t = n.getObjects(); + if (t.length) + s = t[e % t.length].type; + else if (n.else_instances.length) + s = n.else_instances[e % n.else_instances.length].type; + else { + if (!i.instances.length) + return 0; + s = i.instances[e % i.instances.length].type + } + return this.index + s.family_var_map[i.family_index] + } + , + d.prototype.get_eventvar = function() { + return this.eventvar + } + , + d.prototype.get_audiofile = function() { + return this.fileinfo + } + , + d.prototype.get_variadic = function() { + for (var t = 0, e = this.subparams.length; t < e; t++) + this.variadicret[t] = this.subparams[t].get(); + return this.variadicret + } + , + cr.parameter = d, + f.prototype.postInit = function() { + this.solModifiers = n(this.solModifiers) + } + , + f.prototype.setValue = function(t) { + var e = this.runtime.getCurrentLocalVarStack(); + this.parent && !this.is_static && e ? (this.localIndex >= e.length && (e.length = this.localIndex + 1), + e[this.localIndex] = t) : this.data = t + } + , + f.prototype.getValue = function() { + var t = this.runtime.getCurrentLocalVarStack(); + return !this.parent || this.is_static || !t || this.is_constant ? this.data : this.localIndex >= t.length || void 0 === t[this.localIndex] ? this.initial : t[this.localIndex] + } + , + f.prototype.run = function() { + !this.parent || this.is_static || this.is_constant || this.setValue(this.initial) + } + , + cr.eventvariable = f, + y.prototype.toString = function() { + return "include:" + this.include_sheet.toString() + } + , + y.prototype.postInit = function() { + this.include_sheet = this.runtime.eventsheets[this.include_sheet_name], + this.sheet.includes.add(this), + this.solModifiers = n(this.solModifiers); + for (var t = this.parent; t; ) + t.group && t.contained_includes.push(this), + t = t.parent; + this.updateActive() + } + , + y.prototype.run = function() { + this.parent && this.runtime.pushCleanSol(this.runtime.types_by_index), + this.include_sheet.hasRun || this.include_sheet.run(!0), + this.parent && this.runtime.popSol(this.runtime.types_by_index) + } + , + y.prototype.updateActive = function() { + for (var t = this.parent; t; ) { + if (t.group && !t.group_active) + return void (this.active = !1); + t = t.parent + } + this.active = !0 + } + , + y.prototype.isActive = function() { + return this.active + } + , + cr.eventinclude = y, + g.prototype.reset = function(t) { + this.current_event = t, + this.cndindex = 0, + this.actindex = 0, + cr.clearArray(this.temp_parents_arr), + this.last_event_true = !1, + this.else_branch_ran = !1, + this.any_true_state = !1 + } + , + g.prototype.isModifierAfterCnds = function() { + return !!this.current_event.solWriterAfterCnds || this.cndindex < this.current_event.conditions.length - 1 && !!this.current_event.solModifiers.length + } + , + cr.eventStackFrame = g +}(), +function() { + function t(t, e) { + this.owner = t, + this.runtime = t.runtime, + this.type = e[0], + this.get = [this.eval_int, this.eval_float, this.eval_string, this.eval_unaryminus, this.eval_add, this.eval_subtract, this.eval_multiply, this.eval_divide, this.eval_mod, this.eval_power, this.eval_and, this.eval_or, this.eval_equal, this.eval_notequal, this.eval_less, this.eval_lessequal, this.eval_greater, this.eval_greaterequal, this.eval_conditional, this.eval_system_exp, this.eval_object_exp, this.eval_instvar_exp, this.eval_behavior_exp, this.eval_eventvar_exp][this.type]; + var i = null; + switch (this.value = null, + this.first = null, + this.second = null, + this.third = null, + this.func = null, + this.results = null, + this.parameters = null, + this.object_type = null, + this.beh_index = -1, + this.instance_expr = null, + this.varindex = -1, + this.behavior_type = null, + this.varname = null, + this.eventvar = null, + this.return_string = !1, + this.type) { + case 0: + case 1: + case 2: + this.value = e[1]; + break; + case 3: + this.first = new cr.expNode(t,e[1]); + break; + case 18: + this.first = new cr.expNode(t,e[1]), + this.second = new cr.expNode(t,e[2]), + this.third = new cr.expNode(t,e[3]); + break; + case 19: + this.func = this.runtime.GetObjectReference(e[1]), + this.func !== cr.system_object.prototype.exps.random && this.func !== cr.system_object.prototype.exps.choose || this.owner.setVaries(), + this.results = [], + this.parameters = [], + 3 === e.length ? (i = e[2], + this.results.length = i.length + 1) : this.results.length = 1; + break; + case 20: + this.object_type = this.runtime.types_by_index[e[1]], + this.beh_index = -1, + this.func = this.runtime.GetObjectReference(e[2]), + this.return_string = e[3], + cr.plugins_.Function && this.func === cr.plugins_.Function.prototype.exps.Call && this.owner.setVaries(), + e[4] ? this.instance_expr = new cr.expNode(t,e[4]) : this.instance_expr = null, + this.results = [], + this.parameters = [], + 6 === e.length ? (i = e[5], + this.results.length = i.length + 1) : this.results.length = 1; + break; + case 21: + this.object_type = this.runtime.types_by_index[e[1]], + this.return_string = e[2], + e[3] ? this.instance_expr = new cr.expNode(t,e[3]) : this.instance_expr = null, + this.varindex = e[4]; + break; + case 22: + this.object_type = this.runtime.types_by_index[e[1]], + this.behavior_type = this.object_type.getBehaviorByName(e[2]), + this.beh_index = this.object_type.getBehaviorIndexByName(e[2]), + this.func = this.runtime.GetObjectReference(e[3]), + this.return_string = e[4], + e[5] ? this.instance_expr = new cr.expNode(t,e[5]) : this.instance_expr = null, + this.results = [], + this.parameters = [], + 7 === e.length ? (i = e[6], + this.results.length = i.length + 1) : this.results.length = 1; + break; + case 23: + this.varname = e[1], + this.eventvar = null + } + if (this.owner.maybeVaryForType(this.object_type), + 4 <= this.type && this.type <= 17 && (this.first = new cr.expNode(t,e[1]), + this.second = new cr.expNode(t,e[2])), + i) + for (var s = 0, n = i.length; s < n; s++) + this.parameters.push(new cr.expNode(t,i[s])); + cr.seal(this) + } + t.prototype.postInit = function() { + if (23 === this.type && (this.eventvar = this.owner.runtime.getEventVariableByName(this.varname, this.owner.block.parent)), + this.first && this.first.postInit(), + this.second && this.second.postInit(), + this.third && this.third.postInit(), + this.instance_expr && this.instance_expr.postInit(), + this.parameters) + for (var t = 0, e = this.parameters.length; t < e; t++) + this.parameters[t].postInit() + } + ; + var e = [] + , i = -1; + function l() { + return ++i, + e.length === i && e.push(new cr.expvalue), + e[i] + } + function u() { + --i + } + function p(t, e, i) { + for (var s = 0, n = t.length; s < n; ++s) + t[s].get(i), + e[s + 1] = i.data + } + function s(t, e) { + this.type = t || cr.exptype.Integer, + this.data = e || 0, + this.object_class = null, + this.type == cr.exptype.Integer && (this.data = Math.floor(this.data)), + cr.seal(this) + } + t.prototype.eval_system_exp = function(t) { + var e = this.parameters + , i = this.results; + i[0] = t, + p(e, i, l()), + u(), + this.func.apply(this.runtime.system, i) + } + , + t.prototype.eval_object_exp = function(t) { + var e = this.object_type + , i = this.results + , s = this.parameters + , n = this.instance_expr + , r = this.func + , o = this.owner.solindex + , a = e.getCurrentSol() + , h = a.getObjects(); + if (!h.length) { + if (!a.else_instances.length) + return void (this.return_string ? t.set_string("") : t.set_int(0)); + h = a.else_instances + } + (i[0] = t).object_class = e; + t = l(); + p(s, i, t), + n && (n.get(t), + t.is_number() && (o = t.data, + h = e.instances)), + u(); + e = h.length; + (e <= o || o <= -e) && (o %= e), + o < 0 && (o += e); + r.apply(h[o], i) + } + , + t.prototype.eval_behavior_exp = function(t) { + var e = this.object_type + , i = this.results + , s = this.parameters + , n = this.instance_expr + , r = this.beh_index + , o = this.func + , a = this.owner.solindex + , h = e.getCurrentSol() + , c = h.getObjects(); + if (!c.length) { + if (!h.else_instances.length) + return void (this.return_string ? t.set_string("") : t.set_int(0)); + c = h.else_instances + } + (i[0] = t).object_class = e; + t = l(); + p(s, i, t), + n && (n.get(t), + t.is_number() && (a = t.data, + c = e.instances)), + u(); + t = c.length; + (t <= a || a <= -t) && (a %= t), + a < 0 && (a += t); + c = c[a], + a = 0; + e.is_family && (a = c.type.family_beh_map[e.family_index]); + o.apply(c.behavior_insts[r + a], i) + } + , + t.prototype.eval_instvar_exp = function(t) { + var e, i = this.instance_expr, s = this.object_type, n = this.varindex, r = this.owner.solindex, o = s.getCurrentSol(), a = o.getObjects(); + if (!a.length) { + if (!o.else_instances.length) + return void (this.return_string ? t.set_string("") : t.set_int(0)); + a = o.else_instances + } + if (i) { + o = l(); + if (i.get(o), + o.is_number()) { + r = o.data; + var h = s.instances; + 0 !== h.length && (r %= h.length) < 0 && (r += h.length); + var c = (e = s.getInstanceByIID(r)).instance_vars[n]; + return cr.is_string(c) ? t.set_string(c) : t.set_float(c), + void u() + } + u() + } + h = a.length; + (h <= r || r <= -h) && (r %= h), + r < 0 && (r += h), + e = a[r]; + r = 0; + s.is_family && (r = e.type.family_var_map[s.family_index]); + c = e.instance_vars[n + r]; + cr.is_string(c) ? t.set_string(c) : t.set_float(c) + } + , + t.prototype.eval_int = function(t) { + t.type = cr.exptype.Integer, + t.data = this.value + } + , + t.prototype.eval_float = function(t) { + t.type = cr.exptype.Float, + t.data = this.value + } + , + t.prototype.eval_string = function(t) { + t.type = cr.exptype.String, + t.data = this.value + } + , + t.prototype.eval_unaryminus = function(t) { + this.first.get(t), + t.is_number() && (t.data = -t.data) + } + , + t.prototype.eval_add = function(t) { + this.first.get(t); + var e = l(); + this.second.get(e), + t.is_number() && e.is_number() && (t.data += e.data, + e.is_float() && t.make_float()), + u() + } + , + t.prototype.eval_subtract = function(t) { + this.first.get(t); + var e = l(); + this.second.get(e), + t.is_number() && e.is_number() && (t.data -= e.data, + e.is_float() && t.make_float()), + u() + } + , + t.prototype.eval_multiply = function(t) { + this.first.get(t); + var e = l(); + this.second.get(e), + t.is_number() && e.is_number() && (t.data *= e.data, + e.is_float() && t.make_float()), + u() + } + , + t.prototype.eval_divide = function(t) { + this.first.get(t); + var e = l(); + this.second.get(e), + t.is_number() && e.is_number() && (t.data /= e.data, + t.make_float()), + u() + } + , + t.prototype.eval_mod = function(t) { + this.first.get(t); + var e = l(); + this.second.get(e), + t.is_number() && e.is_number() && (t.data %= e.data, + e.is_float() && t.make_float()), + u() + } + , + t.prototype.eval_power = function(t) { + this.first.get(t); + var e = l(); + this.second.get(e), + t.is_number() && e.is_number() && (t.data = Math.pow(t.data, e.data), + e.is_float() && t.make_float()), + u() + } + , + t.prototype.eval_and = function(t) { + this.first.get(t); + var e = l(); + this.second.get(e), + e.is_string() || t.is_string() ? this.eval_and_stringconcat(t, e) : this.eval_and_logical(t, e), + u() + } + , + t.prototype.eval_and_stringconcat = function(t, e) { + t.is_string() && e.is_string() ? this.eval_and_stringconcat_str_str(t, e) : this.eval_and_stringconcat_num(t, e) + } + , + t.prototype.eval_and_stringconcat_str_str = function(t, e) { + t.data += e.data + } + , + t.prototype.eval_and_stringconcat_num = function(t, e) { + t.is_string() ? t.data += (Math.round(1e10 * e.data) / 1e10).toString() : t.set_string(t.data.toString() + e.data) + } + , + t.prototype.eval_and_logical = function(t, e) { + t.set_int(t.data && e.data ? 1 : 0) + } + , + t.prototype.eval_or = function(t) { + this.first.get(t); + var e = l(); + this.second.get(e), + t.is_number() && e.is_number() && (t.data || e.data ? t.set_int(1) : t.set_int(0)), + u() + } + , + t.prototype.eval_conditional = function(t) { + this.first.get(t), + (t.data ? this.second : this.third).get(t) + } + , + t.prototype.eval_equal = function(t) { + this.first.get(t); + var e = l(); + this.second.get(e), + t.set_int(t.data === e.data ? 1 : 0), + u() + } + , + t.prototype.eval_notequal = function(t) { + this.first.get(t); + var e = l(); + this.second.get(e), + t.set_int(t.data !== e.data ? 1 : 0), + u() + } + , + t.prototype.eval_less = function(t) { + this.first.get(t); + var e = l(); + this.second.get(e), + t.set_int(t.data < e.data ? 1 : 0), + u() + } + , + t.prototype.eval_lessequal = function(t) { + this.first.get(t); + var e = l(); + this.second.get(e), + t.set_int(t.data <= e.data ? 1 : 0), + u() + } + , + t.prototype.eval_greater = function(t) { + this.first.get(t); + var e = l(); + this.second.get(e), + t.set_int(t.data > e.data ? 1 : 0), + u() + } + , + t.prototype.eval_greaterequal = function(t) { + this.first.get(t); + var e = l(); + this.second.get(e), + t.set_int(t.data >= e.data ? 1 : 0), + u() + } + , + t.prototype.eval_eventvar_exp = function(t) { + var e = this.eventvar.getValue(); + cr.is_number(e) ? t.set_float(e) : t.set_string(e) + } + , + cr.expNode = t, + s.prototype.is_int = function() { + return this.type === cr.exptype.Integer + } + , + s.prototype.is_float = function() { + return this.type === cr.exptype.Float + } + , + s.prototype.is_number = function() { + return this.type === cr.exptype.Integer || this.type === cr.exptype.Float + } + , + s.prototype.is_string = function() { + return this.type === cr.exptype.String + } + , + s.prototype.make_int = function() { + this.is_int() || (this.is_float() ? this.data = Math.floor(this.data) : this.is_string() && (this.data = parseInt(this.data, 10)), + this.type = cr.exptype.Integer) + } + , + s.prototype.make_float = function() { + this.is_float() || (this.is_string() && (this.data = parseFloat(this.data)), + this.type = cr.exptype.Float) + } + , + s.prototype.make_string = function() { + this.is_string() || (this.data = this.data.toString(), + this.type = cr.exptype.String) + } + , + s.prototype.set_int = function(t) { + this.type = cr.exptype.Integer, + this.data = Math.floor(t) + } + , + s.prototype.set_float = function(t) { + this.type = cr.exptype.Float, + this.data = t + } + , + s.prototype.set_string = function(t) { + this.type = cr.exptype.String, + this.data = t + } + , + s.prototype.set_any = function(t) { + cr.is_number(t) ? (this.type = cr.exptype.Float, + this.data = t) : cr.is_string(t) ? (this.type = cr.exptype.String, + this.data = t.toString()) : (this.type = cr.exptype.Integer, + this.data = 0) + } + , + cr.expvalue = s, + cr.exptype = { + Integer: 0, + Float: 1, + String: 2 + } +}(), +cr.system_object = function(t) { + this.runtime = t, + this.waits = [] +} +, +cr.system_object.prototype.saveToJSON = function() { + for (var t, e, i, s, n, r, o, a = { + waits: [] + }, h = a.waits, c = 0, l = this.waits.length; c < l; c++) { + for (o = { + t: (s = this.waits[c]).time, + st: s.signaltag, + s: s.signalled, + ev: s.ev.sid, + sm: [], + sols: {} + }, + s.ev.actions[s.actindex] && (o.act = s.ev.actions[s.actindex].sid), + t = 0, + e = s.solModifiers.length; t < e; t++) + o.sm.push(s.solModifiers[t].sid); + for (i in s.sols) + if (s.sols.hasOwnProperty(i)) { + for (n = this.runtime.types_by_index[parseInt(i, 10)], + r = { + sa: s.sols[i].sa, + insts: [] + }, + t = 0, + e = s.sols[i].insts.length; t < e; t++) + r.insts.push(s.sols[i].insts[t].uid); + o.sols[n.sid.toString()] = r + } + h.push(o) + } + return a +} +, +cr.system_object.prototype.loadFromJSON = function(t) { + var e, i, s, n, r, o, a, h, c, l, u, p, d, f = t.waits; + for (cr.clearArray(this.waits), + e = 0, + i = f.length; e < i; e++) + if (o = f[e], + h = this.runtime.blocksBySid[o.ev.toString()]) { + for (c = -1, + s = 0, + n = h.actions.length; s < n; s++) + if (h.actions[s].sid === o.act) { + c = s; + break + } + if (-1 !== c) { + for ((a = { + sols: {}, + solModifiers: [], + deleteme: !1 + }).time = o.t, + a.signaltag = o.st || "", + a.signalled = !!o.s, + a.ev = h, + a.actindex = c, + s = 0, + n = o.sm.length; s < n; s++) + (l = this.runtime.getObjectTypeBySid(o.sm[s])) && a.solModifiers.push(l); + for (r in o.sols) + if (o.sols.hasOwnProperty(r) && (l = this.runtime.getObjectTypeBySid(parseInt(r, 10)))) { + for (p = { + sa: (u = o.sols[r]).sa, + insts: [] + }, + s = 0, + n = u.insts.length; s < n; s++) + (d = this.runtime.getObjectByUID(u.insts[s])) && p.insts.push(d); + a.sols[l.index.toString()] = p + } + this.waits.push(a) + } + } +} +, +function() { + var t = cr.system_object.prototype; + function e() {} + e.prototype.EveryTick = function() { + return !0 + } + , + e.prototype.OnLayoutStart = function() { + return !0 + } + , + e.prototype.OnLayoutEnd = function() { + return !0 + } + , + e.prototype.Compare = function(t, e, i) { + return cr.do_cmp(t, e, i) + } + , + e.prototype.CompareTime = function(t, e) { + var i = this.runtime.kahanTime.sum; + if (0 !== t) + return cr.do_cmp(i, t, e); + t = this.runtime.getCurrentCondition(); + return !t.extra.CompareTime_executed && e <= i && (t.extra.CompareTime_executed = !0) + } + , + e.prototype.LayerVisible = function(t) { + return !!t && t.visible + } + , + e.prototype.LayerEmpty = function(t) { + return !!t && !t.instances.length + } + , + e.prototype.LayerCmpOpacity = function(t, e, i) { + return !!t && cr.do_cmp(100 * t.opacity, e, i) + } + , + e.prototype.Repeat = function(t) { + var e, i = this.runtime.getCurrentEventStack(), s = i.current_event, i = i.isModifierAfterCnds(), n = this.runtime.pushLoopStack(); + if (i) + for (e = 0; e < t && !n.stopped; e++) + this.runtime.pushCopySol(s.solModifiers), + n.index = e, + s.retrigger(), + this.runtime.popSol(s.solModifiers); + else + for (e = 0; e < t && !n.stopped; e++) + n.index = e, + s.retrigger(); + return this.runtime.popLoopStack(), + !1 + } + , + e.prototype.While = function(t) { + var e, i = this.runtime.getCurrentEventStack(), s = i.current_event, i = i.isModifierAfterCnds(), n = this.runtime.pushLoopStack(); + if (i) + for (e = 0; !n.stopped; e++) + this.runtime.pushCopySol(s.solModifiers), + n.index = e, + s.retrigger() || (n.stopped = !0), + this.runtime.popSol(s.solModifiers); + else + for (e = 0; !n.stopped; e++) + n.index = e, + s.retrigger() || (n.stopped = !0); + return this.runtime.popLoopStack(), + !1 + } + , + e.prototype.For = function(t, e, i) { + var s, n = this.runtime.getCurrentEventStack(), r = n.current_event, n = n.isModifierAfterCnds(), o = this.runtime.pushLoopStack(t); + if (i < e) + if (n) + for (s = e; i <= s && !o.stopped; --s) + this.runtime.pushCopySol(r.solModifiers), + o.index = s, + r.retrigger(), + this.runtime.popSol(r.solModifiers); + else + for (s = e; i <= s && !o.stopped; --s) + o.index = s, + r.retrigger(); + else if (n) + for (s = e; s <= i && !o.stopped; ++s) + this.runtime.pushCopySol(r.solModifiers), + o.index = s, + r.retrigger(), + this.runtime.popSol(r.solModifiers); + else + for (s = e; s <= i && !o.stopped; ++s) + o.index = s, + r.retrigger(); + return this.runtime.popLoopStack(), + !1 + } + ; + var m = [] + , _ = -1; + function v(t, e) { + t = t.extra.c2_feo_val, + e = e.extra.c2_feo_val; + return cr.is_number(t) && cr.is_number(e) ? t - e : (t = "" + t) < (e = "" + e) ? -1 : e < t ? 1 : 0 + } + e.prototype.ForEach = function(t) { + var e = t.getCurrentSol(); + _++, + m.length === _ && m.push([]); + var i = m[_]; + cr.shallowAssignArray(i, e.getObjects()); + var s, n, r, o, a, h, c, l = this.runtime.getCurrentEventStack(), u = l.current_event, l = l.isModifierAfterCnds(), p = this.runtime.pushLoopStack(), d = t.is_contained; + if (l) + for (s = 0, + n = i.length; s < n && !p.stopped; s++) { + if (this.runtime.pushCopySol(u.solModifiers), + a = i[s], + (e = t.getCurrentSol()).select_all = !1, + cr.clearArray(e.instances), + e.instances[0] = a, + d) + for (r = 0, + o = a.siblings.length; r < o; r++) + (c = (h = a.siblings[r]).type.getCurrentSol()).select_all = !1, + cr.clearArray(c.instances), + c.instances[0] = h; + p.index = s, + u.retrigger(), + this.runtime.popSol(u.solModifiers) + } + else + for (e.select_all = !1, + cr.clearArray(e.instances), + s = 0, + n = i.length; s < n && !p.stopped; s++) { + if (a = i[s], + e.instances[0] = a, + d) + for (r = 0, + o = a.siblings.length; r < o; r++) + (c = (h = a.siblings[r]).type.getCurrentSol()).select_all = !1, + cr.clearArray(c.instances), + c.instances[0] = h; + p.index = s, + u.retrigger() + } + return cr.clearArray(i), + this.runtime.popLoopStack(), + _--, + !1 + } + , + e.prototype.ForEachOrdered = function(t, e, i) { + var s = t.getCurrentSol(); + _++, + m.length === _ && m.push([]); + var n = m[_]; + cr.shallowAssignArray(n, s.getObjects()); + for (var r, o, a, h, c, l = this.runtime.getCurrentEventStack(), u = l.current_event, p = this.runtime.getCurrentCondition(), l = l.isModifierAfterCnds(), d = this.runtime.pushLoopStack(), f = 0, y = n.length; f < y; f++) + n[f].extra.c2_feo_val = p.parameters[1].get(f); + n.sort(v), + 1 === i && n.reverse(); + var g = t.is_contained; + if (l) + for (f = 0, + y = n.length; f < y && !d.stopped; f++) { + if (this.runtime.pushCopySol(u.solModifiers), + a = n[f], + (s = t.getCurrentSol()).select_all = !1, + cr.clearArray(s.instances), + s.instances[0] = a, + g) + for (r = 0, + o = a.siblings.length; r < o; r++) + (c = (h = a.siblings[r]).type.getCurrentSol()).select_all = !1, + cr.clearArray(c.instances), + c.instances[0] = h; + d.index = f, + u.retrigger(), + this.runtime.popSol(u.solModifiers) + } + else + for (s.select_all = !1, + cr.clearArray(s.instances), + f = 0, + y = n.length; f < y && !d.stopped; f++) { + if (a = n[f], + s.instances[0] = a, + g) + for (r = 0, + o = a.siblings.length; r < o; r++) + (c = (h = a.siblings[r]).type.getCurrentSol()).select_all = !1, + cr.clearArray(c.instances), + c.instances[0] = h; + d.index = f, + u.retrigger() + } + return cr.clearArray(n), + this.runtime.popLoopStack(), + _--, + !1 + } + , + e.prototype.PickByComparison = function(t, e, i, s) { + var n; + if (t) { + _++, + m.length === _ && m.push([]); + var r = m[_] + , o = t.getCurrentSol(); + cr.shallowAssignArray(r, o.getObjects()), + o.select_all && cr.clearArray(o.else_instances); + for (var a = this.runtime.getCurrentCondition(), h = 0, c = 0, l = r.length; h < l; h++) + n = r[h], + r[c] = n, + e = a.parameters[1].get(h), + s = a.parameters[3].get(h), + cr.do_cmp(e, i, s) ? c++ : o.else_instances.push(n); + return cr.truncateArray(r, c), + o.select_all = !1, + cr.shallowAssignArray(o.instances, r), + cr.clearArray(r), + _--, + t.applySolToContainer(), + !!o.instances.length + } + } + , + e.prototype.PickByEvaluate = function(t, e) { + var i; + if (t) { + _++, + m.length === _ && m.push([]); + var s = m[_] + , n = t.getCurrentSol(); + cr.shallowAssignArray(s, n.getObjects()), + n.select_all && cr.clearArray(n.else_instances); + for (var r = this.runtime.getCurrentCondition(), o = 0, a = 0, h = s.length; o < h; o++) + i = s[o], + s[a] = i, + r.parameters[1].get(o) ? a++ : n.else_instances.push(i); + return cr.truncateArray(s, a), + n.select_all = !1, + cr.shallowAssignArray(n.instances, s), + cr.clearArray(s), + _--, + t.applySolToContainer(), + !!n.instances.length + } + } + , + e.prototype.TriggerOnce = function() { + var t = this.runtime.getCurrentCondition().extra; + void 0 === t.TriggerOnce_lastTick && (t.TriggerOnce_lastTick = -1); + var e = t.TriggerOnce_lastTick + , i = this.runtime.tickcount; + return t.TriggerOnce_lastTick = i, + this.runtime.layout_first_tick || e !== i - 1 + } + , + e.prototype.Every = function(t) { + var e = this.runtime.getCurrentCondition() + , i = e.extra.Every_lastTime || 0 + , s = this.runtime.kahanTime.sum; + void 0 === e.extra.Every_seconds && (e.extra.Every_seconds = t); + var n = e.extra.Every_seconds; + return i + n <= s ? (e.extra.Every_lastTime = i + n, + s >= e.extra.Every_lastTime + .04 && (e.extra.Every_lastTime = s), + e.extra.Every_seconds = t, + !0) : (s < i - .1 && (e.extra.Every_lastTime = s), + !1) + } + , + e.prototype.PickNth = function(t, e) { + if (!t) + return !1; + var i = t.getCurrentSol() + , s = i.getObjects(); + if ((e = cr.floor(e)) < 0 || e >= s.length) + return !1; + e = s[e]; + return i.pick_one(e), + t.applySolToContainer(), + !0 + } + , + e.prototype.PickRandom = function(t) { + if (!t) + return !1; + var e = t.getCurrentSol() + , i = e.getObjects() + , s = cr.floor(Math.random() * i.length); + if (s >= i.length) + return !1; + s = i[s]; + return e.pick_one(s), + t.applySolToContainer(), + !0 + } + , + e.prototype.CompareVar = function(t, e, i) { + return cr.do_cmp(t.getValue(), e, i) + } + , + e.prototype.IsGroupActive = function(t) { + t = this.runtime.groups_by_name[t.toLowerCase()]; + return t && t.group_active + } + , + e.prototype.IsPreview = function() { + return "undefined" != typeof cr_is_preview + } + , + e.prototype.PickAll = function(t) { + return !!t && (!!t.instances.length && (t.getCurrentSol().select_all = !0, + t.applySolToContainer(), + !0)) + } + , + e.prototype.IsMobile = function() { + return this.runtime.isMobile + } + , + e.prototype.CompareBetween = function(t, e, i) { + return e <= t && t <= i + } + , + e.prototype.Else = function() { + var t = this.runtime.getCurrentEventStack(); + return !t.else_branch_ran && !t.last_event_true + } + , + e.prototype.OnLoadFinished = function() { + return !0 + } + , + e.prototype.OnCanvasSnapshot = function() { + return !0 + } + , + e.prototype.EffectsSupported = function() { + return !!this.runtime.glwrap + } + , + e.prototype.OnSaveComplete = function() { + return !0 + } + , + e.prototype.OnSaveFailed = function() { + return !0 + } + , + e.prototype.OnLoadComplete = function() { + return !0 + } + , + e.prototype.OnLoadFailed = function() { + return !0 + } + , + e.prototype.ObjectUIDExists = function(t) { + return !!this.runtime.getObjectByUID(t) + } + , + e.prototype.IsOnPlatform = function(t) { + var e = this.runtime; + switch (t) { + case 0: + return !(e.isDomFree || e.isNodeWebkit || e.isCordova || e.isWinJS || e.isWindowsPhone8 || e.isBlackberry10 || e.isAmazonWebApp); + case 1: + return e.isiOS; + case 2: + return e.isAndroid; + case 3: + return e.isWindows8App; + case 4: + return e.isWindowsPhone8; + case 5: + return e.isBlackberry10; + case 6: + return e.isTizen; + case 7: + return e.isCocoonJs; + case 8: + return e.isCordova; + case 9: + return e.isArcade; + case 10: + return e.isNodeWebkit; + case 11: + return e.isCrosswalk; + case 12: + return e.isAmazonWebApp; + case 13: + return e.isWindows10; + default: + return !1 + } + } + ; + var i = null + , s = "" + , n = ""; + function r(t, e) { + return i && t === s && e === n || (i = new RegExp(t,e), + s = t, + n = e), + i.lastIndex = 0, + i + } + e.prototype.RegexTest = function(t, e, i) { + return r(e, i).test(t) + } + ; + var l = []; + function o() {} + e.prototype.PickOverlappingPoint = function(t, e, i) { + if (!t) + return !1; + var s, n, r, o = t.getCurrentSol(), a = o.getObjects(), h = this.runtime.getCurrentEventStack().current_event.orblock, c = this.runtime.getCurrentCondition(); + for (o.select_all ? (cr.shallowAssignArray(l, a), + cr.clearArray(o.else_instances), + o.select_all = !1, + cr.clearArray(o.instances)) : h ? (cr.shallowAssignArray(l, o.else_instances), + cr.clearArray(o.else_instances)) : (cr.shallowAssignArray(l, a), + cr.clearArray(o.instances)), + s = 0, + n = l.length; s < n; ++s) + (r = l[s]).update_bbox(), + (cr.xor(r.contains_pt(e, i), c.inverted) ? o.instances : o.else_instances).push(r); + return t.applySolToContainer(), + cr.xor(!!o.instances.length, c.inverted) + } + , + e.prototype.IsNaN = function(t) { + return !!isNaN(t) + } + , + e.prototype.AngleWithin = function(t, e, i) { + return cr.angleDiff(cr.to_radians(t), cr.to_radians(i)) <= cr.to_radians(e) + } + , + e.prototype.IsClockwiseFrom = function(t, e) { + return cr.angleClockwise(cr.to_radians(t), cr.to_radians(e)) + } + , + e.prototype.IsBetweenAngles = function(t, e, i) { + t = cr.to_clamped_radians(t), + e = cr.to_clamped_radians(e), + i = cr.to_clamped_radians(i); + return !cr.angleClockwise(i, e) ? !(!cr.angleClockwise(t, e) && cr.angleClockwise(t, i)) : cr.angleClockwise(t, e) && !cr.angleClockwise(t, i) + } + , + e.prototype.IsValueType = function(t, e) { + return "number" == typeof t ? 0 === e : 1 === e + } + , + t.cnds = new e, + o.prototype.GoToLayout = function(t) { + this.runtime.isloading || this.runtime.changelayout || (this.runtime.changelayout = t) + } + , + o.prototype.NextPrevLayout = function(t) { + var e; + this.runtime.isloading || this.runtime.changelayout || (e = this.runtime.layouts_by_index.indexOf(this.runtime.running_layout), + t && 0 === e || !t && e === this.runtime.layouts_by_index.length - 1 || (t = this.runtime.layouts_by_index[e + (t ? -1 : 1)], + this.runtime.changelayout = t)) + } + , + o.prototype.CreateObject = function(t, e, i, s) { + if (e && t) { + var n, r, o, a = this.runtime.createInstance(t, e, i, s); + if (a) { + if (this.runtime.isInOnDestroy++, + this.runtime.trigger(Object.getPrototypeOf(t.plugin).cnds.OnCreated, a), + a.is_contained) + for (n = 0, + r = a.siblings.length; n < r; n++) + o = a.siblings[n], + this.runtime.trigger(Object.getPrototypeOf(o.type.plugin).cnds.OnCreated, o); + this.runtime.isInOnDestroy--; + var h = t.getCurrentSol(); + if (h.select_all = !1, + cr.clearArray(h.instances), + (h.instances[0] = a).is_contained) + for (n = 0, + r = a.siblings.length; n < r; n++) + (h = (o = a.siblings[n]).type.getCurrentSol()).select_all = !1, + cr.clearArray(h.instances), + h.instances[0] = o + } + } + } + , + o.prototype.SetLayerVisible = function(t, e) { + t && t.visible !== e && (t.visible = e, + this.runtime.redraw = !0) + } + , + o.prototype.SetLayerOpacity = function(t, e) { + t && (e = cr.clamp(e / 100, 0, 1), + t.opacity !== e && (t.opacity = e, + this.runtime.redraw = !0)) + } + , + o.prototype.SetLayerScaleRate = function(t, e) { + t && t.zoomRate !== e && (t.zoomRate = e, + this.runtime.redraw = !0) + } + , + o.prototype.SetLayerForceOwnTexture = function(t, e) { + t && (e = !!e, + t.forceOwnTexture !== e && (t.forceOwnTexture = e, + this.runtime.redraw = !0)) + } + , + o.prototype.SetLayoutScale = function(t) { + this.runtime.running_layout && this.runtime.running_layout.scale !== t && (this.runtime.running_layout.scale = t, + this.runtime.running_layout.boundScrolling(), + this.runtime.redraw = !0) + } + , + o.prototype.ScrollX = function(t) { + this.runtime.running_layout.scrollToX(t) + } + , + o.prototype.ScrollY = function(t) { + this.runtime.running_layout.scrollToY(t) + } + , + o.prototype.Scroll = function(t, e) { + this.runtime.running_layout.scrollToX(t), + this.runtime.running_layout.scrollToY(e) + } + , + o.prototype.ScrollToObject = function(t) { + t = t.getFirstPicked(); + t && (this.runtime.running_layout.scrollToX(t.x), + this.runtime.running_layout.scrollToY(t.y)) + } + , + o.prototype.SetVar = function(t, e) { + 0 === t.vartype ? cr.is_number(e) ? t.setValue(e) : t.setValue(parseFloat(e)) : 1 === t.vartype && t.setValue(e.toString()) + } + , + o.prototype.AddVar = function(t, e) { + 0 === t.vartype ? cr.is_number(e) ? t.setValue(t.getValue() + e) : t.setValue(t.getValue() + parseFloat(e)) : 1 === t.vartype && t.setValue(t.getValue() + e.toString()) + } + , + o.prototype.SubVar = function(t, e) { + 0 === t.vartype && (cr.is_number(e) ? t.setValue(t.getValue() - e) : t.setValue(t.getValue() - parseFloat(e))) + } + , + o.prototype.SetGroupActive = function(t, e) { + var i = this.runtime.groups_by_name[t.toLowerCase()]; + if (i) + switch (e) { + case 0: + i.setGroupActive(!1); + break; + case 1: + i.setGroupActive(!0); + break; + case 2: + i.setGroupActive(!i.group_active) + } + } + , + o.prototype.SetTimescale = function(t) { + t < 0 && (t = 0), + this.runtime.timescale = t + } + , + o.prototype.SetObjectTimescale = function(t, e) { + var i = e; + if (i < 0 && (i = 0), + t) + for (var s = t.getCurrentSol().getObjects(), n = 0, r = s.length; n < r; n++) + s[n].my_timescale = i + } + , + o.prototype.RestoreObjectTimescale = function(t) { + if (!t) + return !1; + for (var e = t.getCurrentSol().getObjects(), i = 0, s = e.length; i < s; i++) + e[i].my_timescale = -1 + } + ; + var c = []; + function a() { + var t = c.length ? c.pop() : { + sols: {}, + solModifiers: [] + }; + return t.deleteme = !1, + t + } + var u = []; + function h() { + var t = u.length ? u.pop() : { + insts: [] + }; + return t.sa = !1, + t + } + function f(t, e) { + var i = t[0] - e[0]; + return 0 != i ? i : t[1] - e[1] + } + function y(t, e) { + return t[1] - e[1] + } + function p() {} + o.prototype.Wait = function(t) { + if (!(t < 0)) { + var e, i, s, n, r = this.runtime.getCurrentEventStack(), o = a(); + for (o.time = this.runtime.kahanTime.sum + t, + o.signaltag = "", + o.signalled = !1, + o.ev = r.current_event, + o.actindex = r.actindex + 1, + e = 0, + i = this.runtime.types_by_index.length; e < i; e++) + (s = (n = this.runtime.types_by_index[e]).getCurrentSol()).select_all && -1 === r.current_event.solModifiers.indexOf(n) || (o.solModifiers.push(n), + (n = h()).sa = s.select_all, + cr.shallowAssignArray(n.insts, s.instances), + o.sols[e.toString()] = n); + return this.waits.push(o), + !0 + } + } + , + o.prototype.WaitForSignal = function(t) { + var e, i, s, n, r = this.runtime.getCurrentEventStack(), o = a(); + for (o.time = -1, + o.signaltag = t.toLowerCase(), + o.signalled = !1, + o.ev = r.current_event, + o.actindex = r.actindex + 1, + e = 0, + i = this.runtime.types_by_index.length; e < i; e++) + (s = (n = this.runtime.types_by_index[e]).getCurrentSol()).select_all && -1 === r.current_event.solModifiers.indexOf(n) || (o.solModifiers.push(n), + (n = h()).sa = s.select_all, + cr.shallowAssignArray(n.insts, s.instances), + o.sols[e.toString()] = n); + return this.waits.push(o), + !0 + } + , + o.prototype.Signal = function(t) { + for (var e, i = t.toLowerCase(), s = 0, n = this.waits.length; s < n; ++s) + -1 === (e = this.waits[s]).time && e.signaltag === i && (e.signalled = !0) + } + , + o.prototype.SetLayerScale = function(t, e) { + t && t.scale !== e && (t.scale = e, + this.runtime.redraw = !0) + } + , + o.prototype.ResetGlobals = function() { + for (var t, e = 0, i = this.runtime.all_global_vars.length; e < i; e++) + (t = this.runtime.all_global_vars[e]).data = t.initial + } + , + o.prototype.SetLayoutAngle = function(t) { + t = cr.to_radians(t), + t = cr.clamp_angle(t), + this.runtime.running_layout && this.runtime.running_layout.angle !== t && (this.runtime.running_layout.angle = t, + this.runtime.redraw = !0) + } + , + o.prototype.SetLayerAngle = function(t, e) { + t && (e = cr.to_radians(e), + e = cr.clamp_angle(e), + t.angle !== e && (t.angle = e, + this.runtime.redraw = !0)) + } + , + o.prototype.SetLayerParallax = function(t, e, i) { + if (t && (t.parallaxX !== e / 100 || t.parallaxY !== i / 100)) { + if (t.parallaxX = e / 100, + t.parallaxY = i / 100, + 1 !== t.parallaxX || 1 !== t.parallaxY) + for (var s = t.instances, n = 0, r = s.length; n < r; ++n) + s[n].type.any_instance_parallaxed = !0; + this.runtime.redraw = !0 + } + } + , + o.prototype.SetLayerBackground = function(t, e) { + var i, s; + t && (i = cr.GetRValue(e), + s = cr.GetGValue(e), + e = cr.GetBValue(e), + t.background_color[0] === i && t.background_color[1] === s && t.background_color[2] === e || (t.background_color[0] = i, + t.background_color[1] = s, + t.background_color[2] = e, + this.runtime.redraw = !0)) + } + , + o.prototype.SetLayerTransparent = function(t, e) { + t && !!e != !!t.transparent && (t.transparent = !!e, + this.runtime.redraw = !0) + } + , + o.prototype.SetLayerBlendMode = function(t, e) { + t && t.blend_mode !== e && (t.blend_mode = e, + t.compositeOp = cr.effectToCompositeOp(t.blend_mode), + this.runtime.gl && cr.setGLBlend(t, t.blend_mode, this.runtime.gl), + this.runtime.redraw = !0) + } + , + o.prototype.StopLoop = function() { + this.runtime.loop_stack_index < 0 || (this.runtime.getCurrentLoop().stopped = !0) + } + , + o.prototype.GoToLayoutByName = function(t) { + if (!this.runtime.isloading && !this.runtime.changelayout) + for (var e in this.runtime.layouts) + if (this.runtime.layouts.hasOwnProperty(e) && cr.equals_nocase(e, t)) + return void (this.runtime.changelayout = this.runtime.layouts[e]) + } + , + o.prototype.RestartLayout = function(t) { + var e, i, s; + if (!this.runtime.isloading && (!this.runtime.changelayout && this.runtime.running_layout)) + for (this.runtime.changelayout = this.runtime.running_layout, + e = 0, + i = this.runtime.allGroups.length; e < i; e++) + (s = this.runtime.allGroups[e]).setGroupActive(s.initially_activated) + } + , + o.prototype.SnapshotCanvas = function(t, e) { + this.runtime.doCanvasSnapshot(0 === t ? "image/png" : "image/jpeg", e / 100) + } + , + o.prototype.SetCanvasSize = function(t, e) { + var i; + t <= 0 || e <= 0 || (i = this.runtime.fullscreen_mode, + (document.mozFullScreen || document.webkitIsFullScreen || !!document.msFullscreenElement || document.fullScreen || this.runtime.isNodeFullscreen) && 0 < this.runtime.fullscreen_scaling && (i = this.runtime.fullscreen_scaling), + 0 === i ? this.runtime.setSize(t, e, !0) : (this.runtime.original_width = t, + this.runtime.original_height = e, + this.runtime.setSize(this.runtime.lastWindowWidth, this.runtime.lastWindowHeight, !0))) + } + , + o.prototype.SetLayoutEffectEnabled = function(t, e) { + this.runtime.running_layout && this.runtime.glwrap && ((e = this.runtime.running_layout.getEffectByName(e)) && (t = 1 === t, + e.active != t && (e.active = t, + this.runtime.running_layout.updateActiveEffects(), + this.runtime.redraw = !0))) + } + , + o.prototype.SetLayerEffectEnabled = function(t, e, i) { + t && this.runtime.glwrap && ((i = t.getEffectByName(i)) && (e = 1 === e, + i.active != e && (i.active = e, + t.updateActiveEffects(), + this.runtime.redraw = !0))) + } + , + o.prototype.SetLayoutEffectParam = function(t, e, i) { + var s; + this.runtime.running_layout && this.runtime.glwrap && ((s = this.runtime.running_layout.getEffectByName(t)) && (t = this.runtime.running_layout.effect_params[s.index], + (e = Math.floor(e)) < 0 || e >= t.length || (1 === this.runtime.glwrap.getProgramParameterType(s.shaderindex, e) && (i /= 100), + t[e] !== i && (t[e] = i, + s.active && (this.runtime.redraw = !0))))) + } + , + o.prototype.SetLayerEffectParam = function(t, e, i, s) { + t && this.runtime.glwrap && ((e = t.getEffectByName(e)) && (t = t.effect_params[e.index], + (i = Math.floor(i)) < 0 || i >= t.length || (1 === this.runtime.glwrap.getProgramParameterType(e.shaderindex, i) && (s /= 100), + t[i] !== s && (t[i] = s, + e.active && (this.runtime.redraw = !0))))) + } + , + o.prototype.SaveState = function(t) { + this.runtime.saveToSlot = t + } + , + o.prototype.LoadState = function(t) { + this.runtime.loadFromSlot = t + } + , + o.prototype.LoadStateJSON = function(t) { + this.runtime.loadFromJson = t + } + , + o.prototype.SetHalfFramerateMode = function(t) { + this.runtime.halfFramerateMode = 0 !== t + } + , + o.prototype.SetFullscreenQuality = function(t) { + (document.mozFullScreen || document.webkitIsFullScreen || !!document.msFullscreenElement || document.fullScreen || this.isNodeFullscreen || 0 !== this.runtime.fullscreen_mode) && (this.runtime.wantFullscreenScalingQuality = 0 !== t, + this.runtime.setSize(this.runtime.lastWindowWidth, this.runtime.lastWindowHeight, !0)) + } + , + o.prototype.ResetPersisted = function() { + for (var t = 0, e = this.runtime.layouts_by_index.length; t < e; ++t) + this.runtime.layouts_by_index[t].persist_data = {}, + this.runtime.layouts_by_index[t].first_visit = !0 + } + , + o.prototype.RecreateInitialObjects = function(t, e, i, s, n) { + t && this.runtime.running_layout.recreateInitialObjects(t, e, i, s, n) + } + , + o.prototype.SetPixelRounding = function(t) { + this.runtime.pixel_rounding = 0 !== t, + this.runtime.redraw = !0 + } + , + o.prototype.SetMinimumFramerate = function(t) { + t < 1 && (t = 1), + 120 < t && (t = 120), + this.runtime.minimumFramerate = t + } + , + o.prototype.SortZOrderByInstVar = function(t, e) { + if (t) { + for (var i, s, n, r, o = t.getCurrentSol().getObjects(), a = [], h = [], c = this.runtime.running_layout, l = t.is_family, u = t.family_index, p = 0, d = o.length; p < d; ++p) + (i = o[p]).layer && (s = l ? i.instance_vars[e + i.type.family_var_map[u]] : i.instance_vars[e], + a.push([i.layer.index, i.get_zindex()]), + h.push([i, s])); + if (a.length) + for (a.sort(f), + h.sort(y), + p = 0, + d = a.length; p < d; ++p) + i = h[p][0], + n = c.layers[a[p][0]], + r = a[p][1], + n.instances[r] !== i && ((n.instances[r] = i).layer = n).setZIndicesStaleFrom(r) + } + } + , + t.acts = new o, + p.prototype.int = function(t, e) { + cr.is_string(e) ? (t.set_int(parseInt(e, 10)), + isNaN(t.data) && (t.data = 0)) : t.set_int(e) + } + , + p.prototype.float = function(t, e) { + cr.is_string(e) ? (t.set_float(parseFloat(e)), + isNaN(t.data) && (t.data = 0)) : t.set_float(e) + } + , + p.prototype.str = function(t, e) { + cr.is_string(e) ? t.set_string(e) : t.set_string(e.toString()) + } + , + p.prototype.len = function(t, e) { + t.set_int(e.length || 0) + } + , + p.prototype.random = function(t, e, i) { + void 0 === i ? t.set_float(Math.random() * e) : t.set_float(Math.random() * (i - e) + e) + } + , + p.prototype.sqrt = function(t, e) { + t.set_float(Math.sqrt(e)) + } + , + p.prototype.abs = function(t, e) { + t.set_float(Math.abs(e)) + } + , + p.prototype.round = function(t, e) { + t.set_int(Math.round(e)) + } + , + p.prototype.floor = function(t, e) { + t.set_int(Math.floor(e)) + } + , + p.prototype.ceil = function(t, e) { + t.set_int(Math.ceil(e)) + } + , + p.prototype.sin = function(t, e) { + t.set_float(Math.sin(cr.to_radians(e))) + } + , + p.prototype.cos = function(t, e) { + t.set_float(Math.cos(cr.to_radians(e))) + } + , + p.prototype.tan = function(t, e) { + t.set_float(Math.tan(cr.to_radians(e))) + } + , + p.prototype.asin = function(t, e) { + t.set_float(cr.to_degrees(Math.asin(e))) + } + , + p.prototype.acos = function(t, e) { + t.set_float(cr.to_degrees(Math.acos(e))) + } + , + p.prototype.atan = function(t, e) { + t.set_float(cr.to_degrees(Math.atan(e))) + } + , + p.prototype.exp = function(t, e) { + t.set_float(Math.exp(e)) + } + , + p.prototype.ln = function(t, e) { + t.set_float(Math.log(e)) + } + , + p.prototype.log10 = function(t, e) { + t.set_float(Math.log(e) / Math.LN10) + } + , + p.prototype.max = function(t) { + var e, i, s, n = arguments[1]; + for ("number" != typeof n && (n = 0), + e = 2, + i = arguments.length; e < i; e++) + "number" == typeof (s = arguments[e]) && n < s && (n = s); + t.set_float(n) + } + , + p.prototype.min = function(t) { + var e, i, s, n = arguments[1]; + for ("number" != typeof n && (n = 0), + e = 2, + i = arguments.length; e < i; e++) + "number" == typeof (s = arguments[e]) && s < n && (n = s); + t.set_float(n) + } + , + p.prototype.dt = function(t) { + t.set_float(this.runtime.dt) + } + , + p.prototype.timescale = function(t) { + t.set_float(this.runtime.timescale) + } + , + p.prototype.wallclocktime = function(t) { + t.set_float((Date.now() - this.runtime.start_time) / 1e3) + } + , + p.prototype.time = function(t) { + t.set_float(this.runtime.kahanTime.sum) + } + , + p.prototype.tickcount = function(t) { + t.set_int(this.runtime.tickcount) + } + , + p.prototype.objectcount = function(t) { + t.set_int(this.runtime.objectcount) + } + , + p.prototype.fps = function(t) { + t.set_int(this.runtime.fps) + } + , + p.prototype.loopindex = function(t, e) { + var i, s; + if (this.runtime.loop_stack.length) + if (e) { + for (s = this.runtime.loop_stack_index; 0 <= s; --s) + if ((i = this.runtime.loop_stack[s]).name === e) + return void t.set_int(i.index); + t.set_int(0) + } else + i = this.runtime.getCurrentLoop(), + t.set_int(i ? i.index : -1); + else + t.set_int(0) + } + , + p.prototype.distance = function(t, e, i, s, n) { + t.set_float(cr.distanceTo(e, i, s, n)) + } + , + p.prototype.angle = function(t, e, i, s, n) { + t.set_float(cr.to_degrees(cr.angleTo(e, i, s, n))) + } + , + p.prototype.scrollx = function(t) { + t.set_float(this.runtime.running_layout.scrollX) + } + , + p.prototype.scrolly = function(t) { + t.set_float(this.runtime.running_layout.scrollY) + } + , + p.prototype.newline = function(t) { + t.set_string("\n") + } + , + p.prototype.lerp = function(t, e, i, s) { + t.set_float(cr.lerp(e, i, s)) + } + , + p.prototype.qarp = function(t, e, i, s, n) { + t.set_float(cr.qarp(e, i, s, n)) + } + , + p.prototype.cubic = function(t, e, i, s, n, r) { + t.set_float(cr.cubic(e, i, s, n, r)) + } + , + p.prototype.cosp = function(t, e, i, s) { + t.set_float(cr.cosp(e, i, s)) + } + , + p.prototype.windowwidth = function(t) { + t.set_int(this.runtime.width) + } + , + p.prototype.windowheight = function(t) { + t.set_int(this.runtime.height) + } + , + p.prototype.uppercase = function(t, e) { + t.set_string(cr.is_string(e) ? e.toUpperCase() : "") + } + , + p.prototype.lowercase = function(t, e) { + t.set_string(cr.is_string(e) ? e.toLowerCase() : "") + } + , + p.prototype.clamp = function(t, e, i, s) { + e < i ? t.set_float(i) : s < e ? t.set_float(s) : t.set_float(e) + } + , + p.prototype.layerscale = function(t, e) { + e = this.runtime.getLayer(e); + e ? t.set_float(e.scale) : t.set_float(0) + } + , + p.prototype.layeropacity = function(t, e) { + e = this.runtime.getLayer(e); + e ? t.set_float(100 * e.opacity) : t.set_float(0) + } + , + p.prototype.layerscalerate = function(t, e) { + e = this.runtime.getLayer(e); + e ? t.set_float(e.zoomRate) : t.set_float(0) + } + , + p.prototype.layerparallaxx = function(t, e) { + e = this.runtime.getLayer(e); + e ? t.set_float(100 * e.parallaxX) : t.set_float(0) + } + , + p.prototype.layerparallaxy = function(t, e) { + e = this.runtime.getLayer(e); + e ? t.set_float(100 * e.parallaxY) : t.set_float(0) + } + , + p.prototype.layerindex = function(t, e) { + e = this.runtime.getLayer(e); + e ? t.set_int(e.index) : t.set_int(-1) + } + , + p.prototype.layoutscale = function(t) { + this.runtime.running_layout ? t.set_float(this.runtime.running_layout.scale) : t.set_float(0) + } + , + p.prototype.layoutangle = function(t) { + t.set_float(cr.to_degrees(this.runtime.running_layout.angle)) + } + , + p.prototype.layerangle = function(t, e) { + e = this.runtime.getLayer(e); + e ? t.set_float(cr.to_degrees(e.angle)) : t.set_float(0) + } + , + p.prototype.layoutwidth = function(t) { + t.set_int(this.runtime.running_layout.width) + } + , + p.prototype.layoutheight = function(t) { + t.set_int(this.runtime.running_layout.height) + } + , + p.prototype.find = function(t, e, i) { + cr.is_string(e) && cr.is_string(i) ? t.set_int(e.search(new RegExp(cr.regexp_escape(i),"i"))) : t.set_int(-1) + } + , + p.prototype.findcase = function(t, e, i) { + cr.is_string(e) && cr.is_string(i) ? t.set_int(e.search(new RegExp(cr.regexp_escape(i),""))) : t.set_int(-1) + } + , + p.prototype.left = function(t, e, i) { + t.set_string(cr.is_string(e) ? e.substr(0, i) : "") + } + , + p.prototype.right = function(t, e, i) { + t.set_string(cr.is_string(e) ? e.substr(e.length - i) : "") + } + , + p.prototype.mid = function(t, e, i, s) { + t.set_string(cr.is_string(e) ? e.substr(i, s) : "") + } + , + p.prototype.tokenat = function(t, e, i, s) { + cr.is_string(e) && cr.is_string(s) ? (s = e.split(s), + (i = cr.floor(i)) < 0 || i >= s.length ? t.set_string("") : t.set_string(s[i])) : t.set_string("") + } + , + p.prototype.tokencount = function(t, e, i) { + cr.is_string(e) && e.length ? t.set_int(e.split(i).length) : t.set_int(0) + } + , + p.prototype.replace = function(t, e, i, s) { + cr.is_string(e) && cr.is_string(i) && cr.is_string(s) ? t.set_string(e.replace(new RegExp(cr.regexp_escape(i),"gi"), s)) : t.set_string(cr.is_string(e) ? e : "") + } + , + p.prototype.trim = function(t, e) { + t.set_string(cr.is_string(e) ? e.trim() : "") + } + , + p.prototype.pi = function(t) { + t.set_float(cr.PI) + } + , + p.prototype.layoutname = function(t) { + this.runtime.running_layout ? t.set_string(this.runtime.running_layout.name) : t.set_string("") + } + , + p.prototype.renderer = function(t) { + t.set_string(this.runtime.gl ? "webgl" : "canvas2d") + } + , + p.prototype.rendererdetail = function(t) { + t.set_string(this.runtime.glUnmaskedRenderer) + } + , + p.prototype.anglediff = function(t, e, i) { + t.set_float(cr.to_degrees(cr.angleDiff(cr.to_radians(e), cr.to_radians(i)))) + } + , + p.prototype.choose = function(t) { + var e = cr.floor(Math.random() * (arguments.length - 1)); + t.set_any(arguments[e + 1]) + } + , + p.prototype.rgb = function(t, e, i, s) { + t.set_int(cr.RGB(e, i, s)) + } + , + p.prototype.projectversion = function(t) { + t.set_string(this.runtime.versionstr) + } + , + p.prototype.projectname = function(t) { + t.set_string(this.runtime.projectName) + } + , + p.prototype.anglelerp = function(t, e, i, s) { + e = cr.to_radians(e), + i = cr.to_radians(i); + var n = cr.angleDiff(e, i); + cr.angleClockwise(i, e) ? t.set_float(cr.to_clamped_degrees(e + n * s)) : t.set_float(cr.to_clamped_degrees(e - n * s)) + } + , + p.prototype.anglerotate = function(t, e, i, s) { + e = cr.to_radians(e), + i = cr.to_radians(i), + s = cr.to_radians(s), + t.set_float(cr.to_clamped_degrees(cr.angleRotate(e, i, s))) + } + , + p.prototype.zeropad = function(t, e, i) { + var s = e < 0 ? "-" : ""; + e < 0 && (e = -e); + for (var n = i - e.toString().length, r = 0; r < n; r++) + s += "0"; + t.set_string(s + e.toString()) + } + , + p.prototype.cpuutilisation = function(t) { + t.set_float(this.runtime.cpuutilisation / 1e3) + } + , + p.prototype.viewportleft = function(t, e) { + e = this.runtime.getLayer(e); + t.set_float(e ? e.viewLeft : 0) + } + , + p.prototype.viewporttop = function(t, e) { + e = this.runtime.getLayer(e); + t.set_float(e ? e.viewTop : 0) + } + , + p.prototype.viewportright = function(t, e) { + e = this.runtime.getLayer(e); + t.set_float(e ? e.viewRight : 0) + } + , + p.prototype.viewportbottom = function(t, e) { + e = this.runtime.getLayer(e); + t.set_float(e ? e.viewBottom : 0) + } + , + p.prototype.loadingprogress = function(t) { + t.set_float(this.runtime.loadingprogress) + } + , + p.prototype.unlerp = function(t, e, i, s) { + t.set_float(cr.unlerp(e, i, s)) + } + , + p.prototype.canvassnapshot = function(t) { + t.set_string(this.runtime.snapshotData) + } + , + p.prototype.urlencode = function(t, e) { + t.set_string(encodeURIComponent(e)) + } + , + p.prototype.urldecode = function(t, e) { + t.set_string(decodeURIComponent(e)) + } + , + p.prototype.canvastolayerx = function(t, e, i, s) { + e = this.runtime.getLayer(e); + t.set_float(e ? e.canvasToLayer(i, s, !0) : 0) + } + , + p.prototype.canvastolayery = function(t, e, i, s) { + e = this.runtime.getLayer(e); + t.set_float(e ? e.canvasToLayer(i, s, !1) : 0) + } + , + p.prototype.layertocanvasx = function(t, e, i, s) { + e = this.runtime.getLayer(e); + t.set_float(e ? e.layerToCanvas(i, s, !0) : 0) + } + , + p.prototype.layertocanvasy = function(t, e, i, s) { + e = this.runtime.getLayer(e); + t.set_float(e ? e.layerToCanvas(i, s, !1) : 0) + } + , + p.prototype.savestatejson = function(t) { + t.set_string(this.runtime.lastSaveJson) + } + , + p.prototype.imagememoryusage = function(t) { + this.runtime.glwrap ? t.set_float(Math.round(100 * this.runtime.glwrap.estimateVRAM() / 1048576) / 100) : t.set_float(0) + } + , + p.prototype.regexsearch = function(t, e, i, s) { + s = r(i, s); + t.set_int(e ? e.search(s) : -1) + } + , + p.prototype.regexreplace = function(t, e, i, s, n) { + s = r(i, s); + t.set_string(e ? e.replace(s, n) : "") + } + ; + var d = [] + , g = "" + , b = "" + , w = ""; + function x(t, e, i) { + var s; + t === g && e === b && i === w || (s = r(e, i), + d = t.match(s), + g = t, + b = e, + w = i) + } + p.prototype.regexmatchcount = function(t, e, i, s) { + r(i, s); + x(e.toString(), i, s), + t.set_int(d ? d.length : 0) + } + , + p.prototype.regexmatchat = function(t, e, i, s, n) { + n = Math.floor(n); + r(i, s); + x(e.toString(), i, s), + !d || n < 0 || n >= d.length ? t.set_string("") : t.set_string(d[n]) + } + , + p.prototype.infinity = function(t) { + t.set_float(1 / 0) + } + , + p.prototype.setbit = function(t, e, i, s) { + e |= 0, + i |= 0, + s = 0 !== s ? 1 : 0, + t.set_int(e & ~(1 << i) | s << i) + } + , + p.prototype.togglebit = function(t, e, i) { + e |= 0, + i |= 0, + t.set_int(e ^ 1 << i) + } + , + p.prototype.getbit = function(t, e, i) { + e |= 0, + i |= 0, + t.set_int(e & 1 << i ? 1 : 0) + } + , + p.prototype.originalwindowwidth = function(t) { + t.set_int(this.runtime.original_width) + } + , + p.prototype.originalwindowheight = function(t) { + t.set_int(this.runtime.original_height) + } + , + t.exps = new p, + t.runWaits = function() { + for (var t, e, i, s, n, r, o = this.runtime.getCurrentEventStack(), a = 0, h = this.waits.length; a < h; a++) { + if (-1 === (e = this.waits[a]).time) { + if (!e.signalled) + continue + } else if (e.time > this.runtime.kahanTime.sum) + continue; + for (i in o.current_event = e.ev, + o.actindex = e.actindex, + o.cndindex = 0, + e.sols) + e.sols.hasOwnProperty(i) && (s = this.runtime.types_by_index[parseInt(i, 10)].getCurrentSol(), + n = e.sols[i], + s.select_all = n.sa, + cr.shallowAssignArray(s.instances, n.insts), + n = n, + cr.clearArray(n.insts), + u.push(n)); + e.ev.resume_actions_and_subevents(), + this.runtime.clearSol(e.solModifiers), + e.deleteme = !0 + } + for (t = a = 0, + h = this.waits.length; a < h; a++) + e = this.waits[a], + (this.waits[t] = e).deleteme ? (r = e, + cr.wipe(r.sols), + cr.clearArray(r.solModifiers), + c.push(r)) : t++; + cr.truncateArray(this.waits, t) + } +}(), +function() { + cr.add_common_aces = function(t, e) { + var i = t[1] + , s = t[3] + , n = t[4] + , r = t[5] + , o = t[6] + , a = t[7] + , h = t[8]; + e.cnds || (e.cnds = {}), + e.acts || (e.acts = {}), + e.exps || (e.exps = {}); + var c = e.cnds + , t = e.acts + , e = e.exps; + s && (c.CompareX = function(t, e) { + return cr.do_cmp(this.x, t, e) + } + , + c.CompareY = function(t, e) { + return cr.do_cmp(this.y, t, e) + } + , + c.IsOnScreen = function() { + var t = this.layer; + this.update_bbox(); + var e = this.bbox; + return !(e.right < t.viewLeft || e.bottom < t.viewTop || e.left > t.viewRight || e.top > t.viewBottom) + } + , + c.IsOutsideLayout = function() { + this.update_bbox(); + var t = this.bbox + , e = this.runtime.running_layout; + return t.right < 0 || t.bottom < 0 || t.left > e.width || t.top > e.height + } + , + c.PickDistance = function(t, e, i) { + var s = this.getCurrentSol() + , n = s.getObjects(); + if (!n.length) + return !1; + for (var r, o = n[0], a = o, h = cr.distanceTo(o.x, o.y, e, i), c = 1, l = n.length; c < l; c++) + o = n[c], + r = cr.distanceTo(o.x, o.y, e, i), + (0 === t && r < h || 1 === t && h < r) && (h = r, + a = o); + return s.pick_one(a), + !0 + } + , + t.SetX = function(t) { + this.x !== t && (this.x = t, + this.set_bbox_changed()) + } + , + t.SetY = function(t) { + this.y !== t && (this.y = t, + this.set_bbox_changed()) + } + , + t.SetPos = function(t, e) { + this.x === t && this.y === e || (this.x = t, + this.y = e, + this.set_bbox_changed()) + } + , + t.SetPosToObject = function(t, e) { + var i, t = t.getPairedInstance(this); + t && (t = t.getImagePoint ? (i = t.getImagePoint(e, !0), + t.getImagePoint(e, !1)) : (i = t.x, + t.y), + this.x === i && this.y === t || (this.x = i, + this.y = t, + this.set_bbox_changed())) + } + , + t.MoveForward = function(t) { + 0 !== t && (this.x += Math.cos(this.angle) * t, + this.y += Math.sin(this.angle) * t, + this.set_bbox_changed()) + } + , + t.MoveAtAngle = function(t, e) { + 0 !== e && (this.x += Math.cos(cr.to_radians(t)) * e, + this.y += Math.sin(cr.to_radians(t)) * e, + this.set_bbox_changed()) + } + , + e.X = function(t) { + t.set_float(this.x) + } + , + e.Y = function(t) { + t.set_float(this.y) + } + , + e.dt = function(t) { + t.set_float(this.runtime.getDt(this)) + } + ), + n && (c.CompareWidth = function(t, e) { + return cr.do_cmp(this.width, t, e) + } + , + c.CompareHeight = function(t, e) { + return cr.do_cmp(this.height, t, e) + } + , + t.SetWidth = function(t) { + this.width !== t && (this.width = t, + this.set_bbox_changed()) + } + , + t.SetHeight = function(t) { + this.height !== t && (this.height = t, + this.set_bbox_changed()) + } + , + t.SetSize = function(t, e) { + this.width === t && this.height === e || (this.width = t, + this.height = e, + this.set_bbox_changed()) + } + , + e.Width = function(t) { + t.set_float(this.width) + } + , + e.Height = function(t) { + t.set_float(this.height) + } + , + e.BBoxLeft = function(t) { + this.update_bbox(), + t.set_float(this.bbox.left) + } + , + e.BBoxTop = function(t) { + this.update_bbox(), + t.set_float(this.bbox.top) + } + , + e.BBoxRight = function(t) { + this.update_bbox(), + t.set_float(this.bbox.right) + } + , + e.BBoxBottom = function(t) { + this.update_bbox(), + t.set_float(this.bbox.bottom) + } + ), + r && (c.AngleWithin = function(t, e) { + return cr.angleDiff(this.angle, cr.to_radians(e)) <= cr.to_radians(t) + } + , + c.IsClockwiseFrom = function(t) { + return cr.angleClockwise(this.angle, cr.to_radians(t)) + } + , + c.IsBetweenAngles = function(t, e) { + var i = cr.to_clamped_radians(t) + , t = cr.to_clamped_radians(e) + , e = cr.clamp_angle(this.angle); + return !cr.angleClockwise(t, i) ? !(!cr.angleClockwise(e, i) && cr.angleClockwise(e, t)) : cr.angleClockwise(e, i) && !cr.angleClockwise(e, t) + } + , + t.SetAngle = function(t) { + t = cr.to_radians(cr.clamp_angle_degrees(t)); + isNaN(t) || this.angle !== t && (this.angle = t, + this.set_bbox_changed()) + } + , + t.RotateClockwise = function(t) { + 0 === t || isNaN(t) || (this.angle += cr.to_radians(t), + this.angle = cr.clamp_angle(this.angle), + this.set_bbox_changed()) + } + , + t.RotateCounterclockwise = function(t) { + 0 === t || isNaN(t) || (this.angle -= cr.to_radians(t), + this.angle = cr.clamp_angle(this.angle), + this.set_bbox_changed()) + } + , + t.RotateTowardAngle = function(t, e) { + t = cr.angleRotate(this.angle, cr.to_radians(e), cr.to_radians(t)); + isNaN(t) || this.angle !== t && (this.angle = t, + this.set_bbox_changed()) + } + , + t.RotateTowardPosition = function(t, e, i) { + e -= this.x, + i -= this.y, + e = Math.atan2(i, e), + t = cr.angleRotate(this.angle, e, cr.to_radians(t)); + isNaN(t) || this.angle !== t && (this.angle = t, + this.set_bbox_changed()) + } + , + t.SetTowardPosition = function(t, e) { + t -= this.x, + e -= this.y, + t = Math.atan2(e, t); + isNaN(t) || this.angle !== t && (this.angle = t, + this.set_bbox_changed()) + } + , + e.Angle = function(t) { + t.set_float(cr.to_clamped_degrees(this.angle)) + } + ), + i || (c.CompareInstanceVar = function(t, e, i) { + return cr.do_cmp(this.instance_vars[t], e, i) + } + , + c.IsBoolInstanceVarSet = function(t) { + return this.instance_vars[t] + } + , + c.PickInstVarHiLow = function(t, e) { + var i = this.getCurrentSol() + , s = i.getObjects(); + if (!s.length) + return !1; + for (var n, r = s[0], o = r, a = r.instance_vars[e], h = 1, c = s.length; h < c; h++) + n = (r = s[h]).instance_vars[e], + (0 === t && n < a || 1 === t && a < n) && (a = n, + o = r); + return i.pick_one(o), + !0 + } + , + c.PickByUID = function(t) { + var e, i, s, n, r, o, a; + if (this.runtime.getCurrentCondition().inverted) { + if ((a = this.getCurrentSol()).select_all) { + for (a.select_all = !1, + cr.clearArray(a.instances), + cr.clearArray(a.else_instances), + e = 0, + i = (o = this.instances).length; e < i; e++) + ((n = o[e]).uid === t ? a.else_instances : a.instances).push(n); + return this.applySolToContainer(), + !!a.instances.length + } + for (s = e = 0, + i = a.instances.length; e < i; e++) + n = a.instances[e], + (a.instances[s] = n).uid === t ? a.else_instances.push(n) : s++; + return cr.truncateArray(a.instances, s), + this.applySolToContainer(), + !!a.instances.length + } + if (!(n = this.runtime.getObjectByUID(t))) + return !1; + if (!(a = this.getCurrentSol()).select_all && -1 === a.instances.indexOf(n)) + return !1; + if (this.is_family) { + for (e = 0, + i = (r = n.type.families).length; e < i; e++) + if (r[e] === this) + return a.pick_one(n), + this.applySolToContainer(), + !0 + } else if (n.type === this) + return a.pick_one(n), + this.applySolToContainer(), + !0; + return !1 + } + , + c.OnCreated = function() { + return !0 + } + , + c.OnDestroyed = function() { + return !0 + } + , + t.SetInstanceVar = function(t, e) { + var i = this.instance_vars; + cr.is_number(i[t]) ? cr.is_number(e) ? i[t] = e : i[t] = parseFloat(e) : cr.is_string(i[t]) && (cr.is_string(e) ? i[t] = e : i[t] = e.toString()) + } + , + t.AddInstanceVar = function(t, e) { + var i = this.instance_vars; + cr.is_number(i[t]) ? cr.is_number(e) ? i[t] += e : i[t] += parseFloat(e) : cr.is_string(i[t]) && (cr.is_string(e) ? i[t] += e : i[t] += e.toString()) + } + , + t.SubInstanceVar = function(t, e) { + var i = this.instance_vars; + cr.is_number(i[t]) && (cr.is_number(e) ? i[t] -= e : i[t] -= parseFloat(e)) + } + , + t.SetBoolInstanceVar = function(t, e) { + this.instance_vars[t] = e ? 1 : 0 + } + , + t.ToggleBoolInstanceVar = function(t) { + this.instance_vars[t] = 1 - this.instance_vars[t] + } + , + t.Destroy = function() { + this.runtime.DestroyInstance(this) + } + , + t.LoadFromJsonString || (t.LoadFromJsonString = function(t) { + var e, i, s, n; + try { + e = JSON.parse(t) + } catch (t) { + return + } + if (this.runtime.loadInstanceFromJSON(this, e, !0), + this.afterLoad && this.afterLoad(), + this.behavior_insts) + for (i = 0, + s = this.behavior_insts.length; i < s; ++i) + (n = this.behavior_insts[i]).afterLoad && n.afterLoad() + } + ), + e.Count = function(t) { + for (var e, i = t.object_class.instances.length, s = 0, n = this.runtime.createRow.length; s < n; s++) + e = this.runtime.createRow[s], + t.object_class.is_family ? 0 <= e.type.families.indexOf(t.object_class) && i++ : e.type === t.object_class && i++; + t.set_int(i) + } + , + e.PickedCount = function(t) { + t.set_int(t.object_class.getCurrentSol().getObjects().length) + } + , + e.UID = function(t) { + t.set_int(this.uid) + } + , + e.IID = function(t) { + t.set_int(this.get_iid()) + } + , + e.AsJSON || (e.AsJSON = function(t) { + t.set_string(JSON.stringify(this.runtime.saveInstanceToJSON(this, !0))) + } + )), + o && (c.IsVisible = function() { + return this.visible + } + , + t.SetVisible = function(t) { + !t != !this.visible && (this.visible = !!t, + this.runtime.redraw = !0) + } + , + c.CompareOpacity = function(t, e) { + return cr.do_cmp(cr.round6dp(100 * this.opacity), t, e) + } + , + t.SetOpacity = function(t) { + t /= 100; + t < 0 ? t = 0 : 1 < t && (t = 1), + t !== this.opacity && (this.opacity = t, + this.runtime.redraw = !0) + } + , + e.Opacity = function(t) { + t.set_float(cr.round6dp(100 * this.opacity)) + } + ), + a && (c.IsOnLayer = function(t) { + return !!t && this.layer === t + } + , + c.PickTopBottom = function(t) { + var e = this.getCurrentSol() + , i = e.getObjects(); + if (!i.length) + return !1; + for (var s = i[0], n = s, r = 1, o = i.length; r < o; r++) + s = i[r], + 0 === t ? (s.layer.index > n.layer.index || s.layer.index === n.layer.index && s.get_zindex() > n.get_zindex()) && (n = s) : (s.layer.index < n.layer.index || s.layer.index === n.layer.index && s.get_zindex() < n.get_zindex()) && (n = s); + return e.pick_one(n), + !0 + } + , + t.MoveToTop = function() { + var t = this.layer + , e = t.instances; + e.length && e[e.length - 1] === this || (t.removeFromInstanceList(this, !1), + t.appendToInstanceList(this, !1), + this.runtime.redraw = !0) + } + , + t.MoveToBottom = function() { + var t = this.layer + , e = t.instances; + e.length && e[0] === this || (t.removeFromInstanceList(this, !1), + t.prependToInstanceList(this, !1), + this.runtime.redraw = !0) + } + , + t.MoveToLayer = function(t) { + t && t != this.layer && (this.layer.removeFromInstanceList(this, !0), + (this.layer = t).appendToInstanceList(this, !0), + this.runtime.redraw = !0) + } + , + t.ZMoveToObject = function(t, e) { + t = 0 === t; + !e || (e = e.getFirstPicked(this)) && e.uid !== this.uid && (this.layer.index !== e.layer.index && (this.layer.removeFromInstanceList(this, !0), + this.layer = e.layer, + e.layer.appendToInstanceList(this, !0)), + this.layer.moveInstanceAdjacent(this, e, t), + this.runtime.redraw = !0) + } + , + e.LayerNumber = function(t) { + t.set_int(this.layer.number) + } + , + e.LayerName = function(t) { + t.set_string(this.layer.name) + } + , + e.ZIndex = function(t) { + t.set_int(this.get_zindex()) + } + ), + h && (t.SetEffectEnabled = function(t, e) { + this.runtime.glwrap && ((e = this.type.getEffectIndexByName(e)) < 0 || (t = 1 === t, + this.active_effect_flags[e] !== t && (this.active_effect_flags[e] = t, + this.updateActiveEffects(), + this.runtime.redraw = !0))) + } + , + t.SetEffectParam = function(t, e, i) { + var s; + this.runtime.glwrap && ((s = this.type.getEffectIndexByName(t)) < 0 || (t = this.type.effect_types[s], + s = this.effect_params[s], + (e = Math.floor(e)) < 0 || e >= s.length || (1 === this.runtime.glwrap.getProgramParameterType(t.shaderindex, e) && (i /= 100), + s[e] !== i && (s[e] = i, + t.active && (this.runtime.redraw = !0))))) + } + ) + } + , + cr.set_bbox_changed = function() { + this.bbox_changed = !0, + this.cell_changed = !0, + this.type.any_cell_changed = !0, + this.runtime.redraw = !0; + for (var t = this.bbox_changed_callbacks, e = 0, i = t.length; e < i; ++e) + t[e](this); + this.layer.useRenderCells && this.update_bbox() + } + , + cr.add_bbox_changed_callback = function(t) { + t && this.bbox_changed_callbacks.push(t) + } + , + cr.update_bbox = function() { + var t, e; + this.bbox_changed && (t = this.bbox, + e = this.bquad, + t.set(this.x, this.y, this.x + this.width, this.y + this.height), + t.offset(-this.hotspotX * this.width, -this.hotspotY * this.height), + this.angle ? (t.offset(-this.x, -this.y), + e.set_from_rotated_rect(t, this.angle), + e.offset(this.x, this.y), + e.bounding_box(t)) : e.set_from_rect(t), + t.normalize(), + this.bbox_changed = !1, + this.update_render_cell()) + } + ; + var i = new cr.rect(0,0,0,0); + cr.update_render_cell = function() { + var t, e; + this.layer.useRenderCells && (t = this.layer.render_grid, + e = this.bbox, + i.set(t.XToCell(e.left), t.YToCell(e.top), t.XToCell(e.right), t.YToCell(e.bottom)), + this.rendercells.equals(i) || (this.rendercells.right < this.rendercells.left ? t.update(this, null, i) : t.update(this, this.rendercells, i), + this.rendercells.copy(i), + this.layer.render_list_stale = !0)) + } + , + cr.update_collision_cell = function() { + var t, e; + this.cell_changed && this.collisionsEnabled && (this.update_bbox(), + t = this.type.collision_grid, + e = this.bbox, + i.set(t.XToCell(e.left), t.YToCell(e.top), t.XToCell(e.right), t.YToCell(e.bottom)), + this.collcells.equals(i) || (this.collcells.right < this.collcells.left ? t.update(this, null, i) : t.update(this, this.collcells, i), + this.collcells.copy(i), + this.cell_changed = !1)) + } + , + cr.inst_contains_pt = function(t, e) { + return !!this.bbox.contains_pt(t, e) && (!!this.bquad.contains_pt(t, e) && (this.tilemap_exists ? this.testPointOverlapTile(t, e) : !(this.collision_poly && !this.collision_poly.is_empty()) || (this.collision_poly.cache_poly(this.width, this.height, this.angle), + this.collision_poly.contains_pt(t - this.x, e - this.y)))) + } + , + cr.inst_get_iid = function() { + return this.type.updateIIDs(), + this.iid + } + , + cr.inst_get_zindex = function() { + return this.layer.updateZIndices(), + this.zindex + } + , + cr.inst_updateActiveEffects = function() { + var t; + cr.clearArray(this.active_effect_types); + for (var e = !0, i = 0, s = this.active_effect_flags.length; i < s; i++) + this.active_effect_flags[i] && (t = this.type.effect_types[i], + this.active_effect_types.push(t), + t.preservesOpaqueness || (e = !1)); + this.uses_shaders = !!this.active_effect_types.length, + this.shaders_preserve_opaqueness = e + } + , + cr.inst_toString = function() { + return "Inst" + this.puid + } + , + cr.type_getFirstPicked = function(t) { + if (t && t.is_contained && t.type != this) + for (var e, i = 0, s = t.siblings.length; i < s; i++) + if ((e = t.siblings[i]).type == this) + return e; + var n = this.getCurrentSol().getObjects(); + return n.length ? n[0] : null + } + , + cr.type_getPairedInstance = function(t) { + var e = this.getCurrentSol().getObjects(); + return e.length ? e[t.get_iid() % e.length] : null + } + , + cr.type_updateIIDs = function() { + if (this.stale_iids && !this.is_family) { + for (var t = 0, e = this.instances.length; t < e; t++) + this.instances[t].iid = t; + var i = t + , s = this.runtime.createRow; + for (t = 0, + e = s.length; t < e; ++t) + s[t].type === this && (s[t].iid = i++); + this.stale_iids = !1 + } + } + , + cr.type_getInstanceByIID = function(t) { + if (t < this.instances.length) + return this.instances[t]; + t -= this.instances.length; + for (var e = this.runtime.createRow, i = 0, s = e.length; i < s; ++i) + if (e[i].type === this) { + if (0 === t) + return e[i]; + --t + } + return null + } + , + cr.type_getCurrentSol = function() { + return this.solstack[this.cur_sol] + } + , + cr.type_pushCleanSol = function() { + this.cur_sol++, + this.cur_sol === this.solstack.length ? this.solstack.push(new cr.selection(this)) : (this.solstack[this.cur_sol].select_all = !0, + cr.clearArray(this.solstack[this.cur_sol].else_instances)) + } + , + cr.type_pushCopySol = function() { + this.cur_sol++, + this.cur_sol === this.solstack.length && this.solstack.push(new cr.selection(this)); + var t = this.solstack[this.cur_sol] + , e = this.solstack[this.cur_sol - 1]; + e.select_all ? t.select_all = !0 : (t.select_all = !1, + cr.shallowAssignArray(t.instances, e.instances)), + cr.clearArray(t.else_instances) + } + , + cr.type_popSol = function() { + this.cur_sol-- + } + , + cr.type_getBehaviorByName = function(t) { + var e, i, s, n, r, o = 0; + if (!this.is_family) + for (e = 0, + i = this.families.length; e < i; e++) + for (s = 0, + n = (r = this.families[e]).behaviors.length; s < n; s++) { + if (t === r.behaviors[s].name) + return this.extra.lastBehIndex = o, + r.behaviors[s]; + o++ + } + for (e = 0, + i = this.behaviors.length; e < i; e++) { + if (t === this.behaviors[e].name) + return this.extra.lastBehIndex = o, + this.behaviors[e]; + o++ + } + return null + } + , + cr.type_getBehaviorIndexByName = function(t) { + return this.getBehaviorByName(t) ? this.extra.lastBehIndex : -1 + } + , + cr.type_getEffectIndexByName = function(t) { + for (var e = 0, i = this.effect_types.length; e < i; e++) + if (this.effect_types[e].name === t) + return e; + return -1 + } + , + cr.type_applySolToContainer = function() { + if (this.is_contained && !this.is_family) { + var t, e, i, s, n; + this.updateIIDs(); + for (var r = (s = this.getCurrentSol()).select_all, o = this.runtime.getCurrentEventStack(), a = o && o.current_event && o.current_event.orblock, h = 0, c = this.container.length; h < c; h++) + if (i = this.container[h], + i !== this && (i.updateIIDs(), + !((n = i.getCurrentSol()).select_all = r))) { + for (cr.clearArray(n.instances), + t = 0, + e = s.instances.length; t < e; ++t) + n.instances[t] = i.getInstanceByIID(s.instances[t].iid); + if (a) + for (cr.clearArray(n.else_instances), + t = 0, + e = s.else_instances.length; t < e; ++t) + n.else_instances[t] = i.getInstanceByIID(s.else_instances[t].iid) + } + } + } + , + cr.type_toString = function() { + return "Type" + this.sid + } + , + cr.do_cmp = function(t, e, i) { + if (void 0 === t || void 0 === i) + return !1; + switch (e) { + case 0: + return t === i; + case 1: + return t !== i; + case 2: + return t < i; + case 3: + return t <= i; + case 4: + return i < t; + case 5: + return i <= t; + default: + return !1 + } + } +}(), +cr.shaders = {}, +cr.shaders.brightness = { + src: ["varying mediump vec2 vTex;", "uniform lowp sampler2D samplerFront;", "uniform lowp float brightness;", "void main(void)", "{", "lowp vec4 front = texture2D(samplerFront, vTex);", "lowp float a = front.a;", "if (a != 0.0)", "front.rgb /= front.a;", "front.rgb += (brightness - 1.0);", "front.rgb *= a;", "gl_FragColor = front;", "}"].join("\n"), + extendBoxHorizontal: 0, + extendBoxVertical: 0, + crossSampling: !1, + preservesOpaqueness: !0, + animated: !1, + parameters: [["brightness", 0, 1]] +}, +cr.shaders.outline = { + src: ["varying mediump vec2 vTex;", "uniform lowp sampler2D samplerFront;", "precision highp float;", "uniform highp float pixelWidth;", "uniform highp float pixelHeight;", "uniform highp float red;", "uniform highp float green;", "uniform highp float blue;", "uniform highp float width;", "uniform highp float justoutline;", "void main(void)", "{", "vec4 front = texture2D(samplerFront, vTex);", "float dx = pixelWidth*width;", "float dy = pixelHeight*width;", "float diag = 0.7071;", "float a0 = texture2D(samplerFront, vTex + vec2(-dx*diag, dy*diag)).a;", "float a1 = texture2D(samplerFront, vTex + vec2(dx*diag, -dy*diag)).a;", "float a2 = texture2D(samplerFront, vTex + vec2(-dx*diag, -dy*diag)).a;", "float a3 = texture2D(samplerFront, vTex + vec2(dx*diag, dy*diag)).a;", "float a4 = texture2D(samplerFront, vTex + vec2(-dx, 0.0)).a;", "float a5 = texture2D(samplerFront, vTex + vec2(dx, 0.0)).a;", "float a6 = texture2D(samplerFront, vTex + vec2(0.0, dy)).a;", "float a7 = texture2D(samplerFront, vTex + vec2(0.0, -dy)).a;", "float ina=max(max(max(max(max(max(max(a0,a1),a2),a3),a4),a5),a6),a7)-front.a;", "if(justoutline!=1.0)", "{", "float outa = ina + front.a*(1.0-ina);", "vec3 outrgb = (vec3(red/255.0, green/255.0, blue/255.0)*ina + front.rgb*front.a*(1.0-ina));", "gl_FragColor = vec4(outrgb, outa);", "}", "else if(ina>0.0)", "{", "gl_FragColor = vec4(vec3(red/255.0, green/255.0, blue/255.0)*ina, ina);", "}", "}"].join("\n"), + extendBoxHorizontal: 0, + extendBoxVertical: 0, + crossSampling: !1, + preservesOpaqueness: !1, + animated: !1, + parameters: [["red", 0, 0], ["green", 0, 0], ["blue", 0, 0], ["width", 0, 0], ["justoutline", 0, 0]] +}, +cr.shaders.tint = { + src: ["varying mediump vec2 vTex;", "uniform lowp sampler2D samplerFront;", "uniform lowp float red;", "uniform lowp float green;", "uniform lowp float blue;", "void main(void)", "{", "lowp vec4 front = texture2D(samplerFront, vTex);", "gl_FragColor = front * vec4(red, green, blue, 1.0);", "}"].join("\n"), + extendBoxHorizontal: 0, + extendBoxVertical: 0, + crossSampling: !1, + preservesOpaqueness: !0, + animated: !1, + parameters: [["red", 0, 1], ["green", 0, 1], ["blue", 0, 1]] +}, +cr.plugins_.Arr = function(t) { + this.runtime = t +} +, +function() { + var t = cr.plugins_.Arr.prototype; + t.Type = function(t) { + this.plugin = t, + this.runtime = t.runtime + } + , + t.Type.prototype.onCreate = function() {} + , + t.Instance = function(t) { + this.type = t, + this.runtime = t.runtime + } + ; + var e = t.Instance.prototype + , s = []; + function a() { + return s.length ? s.pop() : [] + } + function r(t) { + for (var e = 0, i = t.length; e < i; e++) + Array.isArray(t[e]) && r(t[e]); + cr.clearArray(t), + s.push(t) + } + function i() {} + function n() {} + function o(t, e) { + if (cr.is_number(t) && cr.is_number(e)) + return t - e; + t = "" + t, + e = "" + e; + return t < e ? -1 : e < t ? 1 : 0 + } + function h() {} + Array.isArray || (Array.isArray = function(t) { + return "[object Array]" === Object.prototype.toString.call(t) + } + ), + e.onCreate = function() { + this.cx = this.properties[0], + this.cy = this.properties[1], + this.cz = this.properties[2], + this.recycled || (this.arr = a()); + var t, e, i, s = this.arr; + for (s.length = this.cx, + t = 0; t < this.cx; t++) + for (s[t] || (s[t] = a()), + s[t].length = this.cy, + e = 0; e < this.cy; e++) + for (s[t][e] || (s[t][e] = a()), + s[t][e].length = this.cz, + i = 0; i < this.cz; i++) + s[t][e][i] = 0; + this.forX = [], + this.forY = [], + this.forZ = [], + this.forDepth = -1 + } + , + e.onDestroy = function() { + for (var t = 0; t < this.cx; t++) + r(this.arr[t]); + cr.clearArray(this.arr) + } + , + e.at = function(t, e, i) { + return t = Math.floor(t), + e = Math.floor(e), + i = Math.floor(i), + isNaN(t) || t < 0 || t > this.cx - 1 || isNaN(e) || e < 0 || e > this.cy - 1 || isNaN(i) || i < 0 || i > this.cz - 1 ? 0 : this.arr[t][e][i] + } + , + e.set = function(t, e, i, s) { + t = Math.floor(t), + e = Math.floor(e), + i = Math.floor(i), + isNaN(t) || t < 0 || t > this.cx - 1 || isNaN(e) || e < 0 || e > this.cy - 1 || isNaN(i) || i < 0 || i > this.cz - 1 || (this.arr[t][e][i] = s) + } + , + e.getAsJSON = function() { + return JSON.stringify({ + c2array: !0, + size: [this.cx, this.cy, this.cz], + data: this.arr + }) + } + , + e.saveToJSON = function() { + return { + size: [this.cx, this.cy, this.cz], + data: this.arr + } + } + , + e.loadFromJSON = function(t) { + var e = t.size; + this.cx = e[0], + this.cy = e[1], + this.cz = e[2], + this.arr = t.data + } + , + e.setSize = function(t, e, i) { + if (t < 0 && (t = 0), + e < 0 && (e = 0), + i < 0 && (i = 0), + this.cx !== t || this.cy !== e || this.cz !== i) { + var s, n, r; + this.cx = t, + this.cy = e, + this.cz = i; + var o = this.arr; + for (o.length = t, + s = 0; s < this.cx; s++) + for (cr.is_undefined(o[s]) && (o[s] = a()), + o[s].length = e, + n = 0; n < this.cy; n++) + for (cr.is_undefined(o[s][n]) && (o[s][n] = a()), + o[s][n].length = i, + r = 0; r < this.cz; r++) + cr.is_undefined(o[s][n][r]) && (o[s][n][r] = 0) + } + } + , + e.getForX = function() { + return 0 <= this.forDepth && this.forDepth < this.forX.length ? this.forX[this.forDepth] : 0 + } + , + e.getForY = function() { + return 0 <= this.forDepth && this.forDepth < this.forY.length ? this.forY[this.forDepth] : 0 + } + , + e.getForZ = function() { + return 0 <= this.forDepth && this.forDepth < this.forZ.length ? this.forZ[this.forDepth] : 0 + } + , + i.prototype.CompareX = function(t, e, i) { + return cr.do_cmp(this.at(t, 0, 0), e, i) + } + , + i.prototype.CompareXY = function(t, e, i, s) { + return cr.do_cmp(this.at(t, e, 0), i, s) + } + , + i.prototype.CompareXYZ = function(t, e, i, s, n) { + return cr.do_cmp(this.at(t, e, i), s, n) + } + , + e.doForEachTrigger = function(t) { + this.runtime.pushCopySol(t.solModifiers), + t.retrigger(), + this.runtime.popSol(t.solModifiers) + } + , + i.prototype.ArrForEach = function(t) { + var e = this.runtime.getCurrentEventStack().current_event; + this.forDepth++; + var i = this.forDepth; + switch (i === this.forX.length ? (this.forX.push(0), + this.forY.push(0), + this.forZ.push(0)) : (this.forX[i] = 0, + this.forY[i] = 0, + this.forZ[i] = 0), + t) { + case 0: + for (this.forX[i] = 0; this.forX[i] < this.cx; this.forX[i]++) + for (this.forY[i] = 0; this.forY[i] < this.cy; this.forY[i]++) + for (this.forZ[i] = 0; this.forZ[i] < this.cz; this.forZ[i]++) + this.doForEachTrigger(e); + break; + case 1: + for (this.forX[i] = 0; this.forX[i] < this.cx; this.forX[i]++) + for (this.forY[i] = 0; this.forY[i] < this.cy; this.forY[i]++) + this.doForEachTrigger(e); + break; + case 2: + for (this.forX[i] = 0; this.forX[i] < this.cx; this.forX[i]++) + this.doForEachTrigger(e) + } + return this.forDepth--, + !1 + } + , + i.prototype.CompareCurrent = function(t, e) { + return cr.do_cmp(this.at(this.getForX(), this.getForY(), this.getForZ()), t, e) + } + , + i.prototype.Contains = function(t) { + for (var e, i, s = 0; s < this.cx; s++) + for (e = 0; e < this.cy; e++) + for (i = 0; i < this.cz; i++) + if (this.arr[s][e][i] === t) + return !0; + return !1 + } + , + i.prototype.IsEmpty = function() { + return 0 === this.cx || 0 === this.cy || 0 === this.cz + } + , + i.prototype.CompareSize = function(t, e, i) { + var s = 0; + switch (t) { + case 0: + s = this.cx; + break; + case 1: + s = this.cy; + break; + case 2: + s = this.cz + } + return cr.do_cmp(s, e, i) + } + , + t.cnds = new i, + n.prototype.Clear = function() { + for (var t, e, i = 0; i < this.cx; i++) + for (t = 0; t < this.cy; t++) + for (e = 0; e < this.cz; e++) + this.arr[i][t][e] = 0 + } + , + n.prototype.SetSize = function(t, e, i) { + this.setSize(t, e, i) + } + , + n.prototype.SetX = function(t, e) { + this.set(t, 0, 0, e) + } + , + n.prototype.SetXY = function(t, e, i) { + this.set(t, e, 0, i) + } + , + n.prototype.SetXYZ = function(t, e, i, s) { + this.set(t, e, i, s) + } + , + n.prototype.Push = function(t, e, i) { + var s = 0 + , n = 0 + , r = 0 + , o = this.arr; + switch (i) { + case 0: + for (0 === t ? (s = o.length, + o.push(a())) : (s = 0, + o.unshift(a())), + o[s].length = this.cy; n < this.cy; n++) + for (o[s][n] = a(), + o[s][n].length = this.cz, + r = 0; r < this.cz; r++) + o[s][n][r] = e; + this.cx++; + break; + case 1: + for (; s < this.cx; s++) + for (0 === t ? (n = o[s].length, + o[s].push(a())) : (n = 0, + o[s].unshift(a())), + o[s][n].length = this.cz, + r = 0; r < this.cz; r++) + o[s][n][r] = e; + this.cy++; + break; + case 2: + for (; s < this.cx; s++) + for (n = 0; n < this.cy; n++) + 0 === t ? o[s][n].push(e) : o[s][n].unshift(e); + this.cz++ + } + } + , + n.prototype.Pop = function(t, e) { + var i = 0 + , s = 0 + , n = this.arr; + switch (e) { + case 0: + if (0 === this.cx) + break; + r(0 === t ? n.pop() : n.shift()), + this.cx--; + break; + case 1: + if (0 === this.cy) + break; + for (; i < this.cx; i++) + r(0 === t ? n[i].pop() : n[i].shift()); + this.cy--; + break; + case 2: + if (0 === this.cz) + break; + for (; i < this.cx; i++) + for (s = 0; s < this.cy; s++) + 0 === t ? n[i][s].pop() : n[i][s].shift(); + this.cz-- + } + } + , + n.prototype.Reverse = function(t) { + var e = 0 + , i = 0 + , s = this.arr; + if (0 !== this.cx && 0 !== this.cy && 0 !== this.cz) + switch (t) { + case 0: + s.reverse(); + break; + case 1: + for (; e < this.cx; e++) + s[e].reverse(); + break; + case 2: + for (; e < this.cx; e++) + for (i = 0; i < this.cy; i++) + s[e][i].reverse() + } + } + , + n.prototype.Sort = function(t) { + var e = 0 + , i = 0 + , s = this.arr; + if (0 !== this.cx && 0 !== this.cy && 0 !== this.cz) + switch (t) { + case 0: + s.sort(function(t, e) { + return o(t[0][0], e[0][0]) + }); + break; + case 1: + for (; e < this.cx; e++) + s[e].sort(function(t, e) { + return o(t[0], e[0]) + }); + break; + case 2: + for (; e < this.cx; e++) + for (i = 0; i < this.cy; i++) + s[e][i].sort(o) + } + } + , + n.prototype.Delete = function(t, e) { + var i = 0 + , s = 0; + t = Math.floor(t); + var n = this.arr; + if (!(t < 0)) + switch (e) { + case 0: + if (t >= this.cx) + break; + r(n[t]), + n.splice(t, 1), + this.cx--; + break; + case 1: + if (t >= this.cy) + break; + for (; i < this.cx; i++) + r(n[i][t]), + n[i].splice(t, 1); + this.cy--; + break; + case 2: + if (t >= this.cz) + break; + for (; i < this.cx; i++) + for (s = 0; s < this.cy; s++) + n[i][s].splice(t, 1); + this.cz-- + } + } + , + n.prototype.Insert = function(t, e, i) { + var s = 0 + , n = 0 + , r = 0; + e = Math.floor(e); + var o = this.arr; + if (!(e < 0)) + switch (i) { + case 0: + if (e > this.cx) + return; + for (s = e, + o.splice(s, 0, a()), + o[s].length = this.cy; n < this.cy; n++) + for (o[s][n] = a(), + o[s][n].length = this.cz, + r = 0; r < this.cz; r++) + o[s][n][r] = t; + this.cx++; + break; + case 1: + if (e > this.cy) + return; + for (; s < this.cx; s++) + for (n = e, + o[s].splice(n, 0, a()), + o[s][n].length = this.cz, + r = 0; r < this.cz; r++) + o[s][n][r] = t; + this.cy++; + break; + case 2: + if (e > this.cz) + return; + for (; s < this.cx; s++) + for (n = 0; n < this.cy; n++) + o[s][n].splice(e, 0, t); + this.cz++ + } + } + , + n.prototype.JSONLoad = function(t) { + var e, i; + try { + e = JSON.parse(t) + } catch (t) { + return + } + e.c2array && (i = e.size, + this.cx = i[0], + this.cy = i[1], + this.cz = i[2], + this.arr = e.data) + } + , + n.prototype.JSONDownload = function(t) { + var e, i = document.createElement("a"); + void 0 === i.download ? (e = "data:text/html," + encodeURIComponent("

Download link

'), + window.open(e)) : (e = document.getElementsByTagName("body")[0], + i.textContent = t, + i.href = "data:application/json," + encodeURIComponent(this.getAsJSON()), + i.download = t, + e.appendChild(i), + (t = document.createEvent("MouseEvent")).initMouseEvent("click", !0, !0, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), + i.dispatchEvent(t), + e.removeChild(i)) + } + , + t.acts = new n, + h.prototype.At = function(t, e, i, s) { + i = i || 0, + s = s || 0; + t.set_any(this.at(e, i, s)) + } + , + h.prototype.Width = function(t) { + t.set_int(this.cx) + } + , + h.prototype.Height = function(t) { + t.set_int(this.cy) + } + , + h.prototype.Depth = function(t) { + t.set_int(this.cz) + } + , + h.prototype.CurX = function(t) { + t.set_int(this.getForX()) + } + , + h.prototype.CurY = function(t) { + t.set_int(this.getForY()) + } + , + h.prototype.CurZ = function(t) { + t.set_int(this.getForZ()) + } + , + h.prototype.CurValue = function(t) { + t.set_any(this.at(this.getForX(), this.getForY(), this.getForZ())) + } + , + h.prototype.Front = function(t) { + t.set_any(this.at(0, 0, 0)) + } + , + h.prototype.Back = function(t) { + t.set_any(this.at(this.cx - 1, 0, 0)) + } + , + h.prototype.IndexOf = function(t, e) { + for (var i = 0; i < this.cx; i++) + if (this.arr[i][0][0] === e) + return void t.set_int(i); + t.set_int(-1) + } + , + h.prototype.LastIndexOf = function(t, e) { + for (var i = this.cx - 1; 0 <= i; i--) + if (this.arr[i][0][0] === e) + return void t.set_int(i); + t.set_int(-1) + } + , + h.prototype.AsJSON = function(t) { + t.set_string(this.getAsJSON()) + } + , + t.exps = new h +}(), +cr.plugins_.Audio = function(t) { + this.runtime = t +} +, +function() { + var t = cr.plugins_.Audio.prototype; + t.Type = function(t) { + this.plugin = t, + this.runtime = t.runtime + } + , + t.Type.prototype.onCreate = function() {} + ; + var c = null + , n = null + , r = "" + , o = "" + , a = 0 + , h = 1 + , l = 2 + , u = 3 + , p = a + , d = null + , f = [] + , x = [] + , y = null + , g = !1 + , m = 0 + , S = !1 + , T = 1 + , _ = 0 + , v = 0 + , b = !1 + , s = 1 + , w = 1 + , A = 10 + , C = 1e4 + , k = 1 + , O = null + , I = "" + , P = !1 + , E = [] + , B = !1 + , R = !1; + function L(t) { + -1 === E.indexOf(t) && E.push(t) + } + function M(e) { + var t, i = e.instanceObject; + try { + t = i.play() + } catch (t) { + return void L(e) + } + t ? t.catch(function(t) { + L(e) + }) : P && !c.isInUserInputEvent && L(e) + } + function e() { + var t, e, i, s, n, r; + R || b || !d || ("suspended" === d.state && d.resume && d.resume(), + d.createBuffer && (n = d.createBuffer(1, 220, 22050), + (r = d.createBufferSource()).buffer = n, + r.connect(d.destination), + G(r)), + "running" === d.state && (R = !0)); + var o = E.slice(0); + if (cr.clearArray(E), + !S) + for (t = 0, + e = o.length; t < e; ++t) + (i = o[t]).stopped || i.is_paused || (s = i.instanceObject.play()) && s.catch(function(t) { + L(i) + }) + } + function j(t) { + t = F(t); + return isFinite(t) || (t = 0), + t < 0 && (t = 0), + 1 < t && (t = 1), + t + } + function N(t) { + return t < 0 && (t = 0), + 1 < t && (t = 1), + t = t, + Math.log(t) / Math.log(10) * 20 + } + function F(t) { + return Math.pow(10, t / 20) + } + document.addEventListener("pointerup", e, !0), + document.addEventListener("touchend", e, !0), + document.addEventListener("click", e, !0), + document.addEventListener("keydown", e, !0), + document.addEventListener("gamepadconnected", e, !0); + var D = {}; + function V(t) { + return t = t.toLowerCase(), + D.hasOwnProperty(t) && D[t].length ? D[t][0].getInputNode() : d.destination + } + function W() { + return d.createGain ? d.createGain() : d.createGainNode() + } + function z(t) { + return d.createDelay ? d.createDelay(t) : d.createDelayNode(t) + } + function G(t, e) { + t.start ? t.start(e || 0) : t.noteOn(e || 0) + } + function U(t, e, i, s) { + t.start ? t.start(s || 0, e) : t.noteGrainOn(s || 0, e, i - e) + } + function i(t) { + try { + t.stop ? t.stop(0) : t.noteOff(0) + } catch (t) {} + } + function q(t, e, i, s) { + if (t) + if (t.cancelScheduledValues(0), + 0 !== s) { + var n = d.currentTime; + switch (s += n, + i) { + case 0: + t.setValueAtTime(e, s); + break; + case 1: + t.setValueAtTime(t.value, n), + t.linearRampToValueAtTime(e, s); + break; + case 2: + t.setValueAtTime(t.value, n), + t.exponentialRampToValueAtTime(e, s) + } + } else + t.value = e + } + var X = ["lowpass", "highpass", "bandpass", "lowshelf", "highshelf", "peaking", "notch", "allpass"]; + function H(t, e, i, s, n, r) { + this.type = "filter", + this.params = [t, e, i, s, n, r], + this.inputNode = W(), + this.wetNode = W(), + this.wetNode.gain.value = r, + this.dryNode = W(), + this.dryNode.gain.value = 1 - r, + this.filterNode = d.createBiquadFilter(), + "number" == typeof this.filterNode.type ? this.filterNode.type = t : this.filterNode.type = X[t], + this.filterNode.frequency.value = e, + this.filterNode.detune && (this.filterNode.detune.value = i), + this.filterNode.Q.value = s, + this.filterNode.gain.value = n, + this.inputNode.connect(this.filterNode), + this.inputNode.connect(this.dryNode), + this.filterNode.connect(this.wetNode) + } + function Y(t, e, i) { + this.type = "delay", + this.params = [t, e, i], + this.inputNode = W(), + this.wetNode = W(), + this.wetNode.gain.value = i, + this.dryNode = W(), + this.dryNode.gain.value = 1 - i, + this.mainNode = W(), + this.delayNode = z(t), + this.delayNode.delayTime.value = t, + this.delayGainNode = W(), + this.delayGainNode.gain.value = e, + this.inputNode.connect(this.mainNode), + this.inputNode.connect(this.dryNode), + this.mainNode.connect(this.wetNode), + this.mainNode.connect(this.delayNode), + this.delayNode.connect(this.delayGainNode), + this.delayGainNode.connect(this.mainNode) + } + function J(t, e, i, s) { + this.type = "convolve", + this.params = [e, i, s], + this.inputNode = W(), + this.wetNode = W(), + this.wetNode.gain.value = i, + this.dryNode = W(), + this.dryNode.gain.value = 1 - i, + this.convolveNode = d.createConvolver(), + t && (this.convolveNode.normalize = e, + this.convolveNode.buffer = t), + this.inputNode.connect(this.convolveNode), + this.inputNode.connect(this.dryNode), + this.convolveNode.connect(this.wetNode) + } + function K(t, e, i, s, n) { + this.type = "flanger", + this.params = [t, e, i, s, n], + this.inputNode = W(), + this.dryNode = W(), + this.dryNode.gain.value = 1 - n / 2, + this.wetNode = W(), + this.wetNode.gain.value = n / 2, + this.feedbackNode = W(), + this.feedbackNode.gain.value = s, + this.delayNode = z(t + e), + this.delayNode.delayTime.value = t, + this.oscNode = d.createOscillator(), + this.oscNode.frequency.value = i, + this.oscGainNode = W(), + this.oscGainNode.gain.value = e, + this.inputNode.connect(this.delayNode), + this.inputNode.connect(this.dryNode), + this.delayNode.connect(this.wetNode), + this.delayNode.connect(this.feedbackNode), + this.feedbackNode.connect(this.delayNode), + this.oscNode.connect(this.oscGainNode), + this.oscGainNode.connect(this.delayNode.delayTime), + G(this.oscNode) + } + function Q(t, e, i, s, n, r) { + this.type = "phaser", + this.params = [t, e, i, s, n, r], + this.inputNode = W(), + this.dryNode = W(), + this.dryNode.gain.value = 1 - r / 2, + this.wetNode = W(), + this.wetNode.gain.value = r / 2, + this.filterNode = d.createBiquadFilter(), + "number" == typeof this.filterNode.type ? this.filterNode.type = 7 : this.filterNode.type = "allpass", + this.filterNode.frequency.value = t, + this.filterNode.detune && (this.filterNode.detune.value = e), + this.filterNode.Q.value = i, + this.oscNode = d.createOscillator(), + this.oscNode.frequency.value = n, + this.oscGainNode = W(), + this.oscGainNode.gain.value = s, + this.inputNode.connect(this.filterNode), + this.inputNode.connect(this.dryNode), + this.filterNode.connect(this.wetNode), + this.oscNode.connect(this.oscGainNode), + this.oscGainNode.connect(this.filterNode.frequency), + G(this.oscNode) + } + function Z(t) { + this.type = "gain", + this.params = [t], + this.node = W(), + this.node.gain.value = t + } + function $(t, e) { + this.type = "tremolo", + this.params = [t, e], + this.node = W(), + this.node.gain.value = 1 - e / 2, + this.oscNode = d.createOscillator(), + this.oscNode.frequency.value = t, + this.oscGainNode = W(), + this.oscGainNode.gain.value = e / 2, + this.oscNode.connect(this.oscGainNode), + this.oscGainNode.connect(this.node.gain), + G(this.oscNode) + } + function tt(t, e) { + this.type = "ringmod", + this.params = [t, e], + this.inputNode = W(), + this.wetNode = W(), + this.wetNode.gain.value = e, + this.dryNode = W(), + this.dryNode.gain.value = 1 - e, + this.ringNode = W(), + this.ringNode.gain.value = 0, + this.oscNode = d.createOscillator(), + this.oscNode.frequency.value = t, + this.oscNode.connect(this.ringNode.gain), + G(this.oscNode), + this.inputNode.connect(this.ringNode), + this.inputNode.connect(this.dryNode), + this.ringNode.connect(this.wetNode) + } + function et(t, e, i, s, n) { + this.type = "distortion", + this.params = [t, e, i, s, n], + this.inputNode = W(), + this.preGain = W(), + this.postGain = W(), + this.setDrive(i, F(s)), + this.wetNode = W(), + this.wetNode.gain.value = n, + this.dryNode = W(), + this.dryNode.gain.value = 1 - n, + this.waveShaper = d.createWaveShaper(), + this.curve = new Float32Array(65536), + this.generateColortouchCurve(t, e), + this.waveShaper.curve = this.curve, + this.inputNode.connect(this.preGain), + this.inputNode.connect(this.dryNode), + this.preGain.connect(this.waveShaper), + this.waveShaper.connect(this.postGain), + this.postGain.connect(this.wetNode) + } + function it(t, e, i, s, n) { + this.type = "compressor", + this.params = [t, e, i, s, n], + this.node = d.createDynamicsCompressor(); + try { + this.node.threshold.value = t, + this.node.knee.value = e, + this.node.ratio.value = i, + this.node.attack.value = s, + this.node.release.value = n + } catch (t) {} + } + function st(t, e) { + this.type = "analyser", + this.params = [t, e], + this.node = d.createAnalyser(), + this.node.fftSize = t, + this.node.smoothingTimeConstant = e, + this.freqBins = new Float32Array(this.node.frequencyBinCount), + this.signal = new Uint8Array(t), + this.peak = 0, + this.rms = 0 + } + function nt() { + this.obj = null, + this.loadUid = 0 + } + function rt(t, e) { + this.src = t, + this.myapi = p, + this.is_music = e, + this.added_end_listener = !1; + var i, s = this; + switch (this.outNode = null, + this.mediaSourceNode = null, + this.panWhenReady = [], + this.seekWhenReady = 0, + this.pauseWhenReady = !1, + this.supportWebAudioAPI = !1, + this.failedToLoad = !1, + this.wasEverReady = !1, + p === h && e && !B && (this.myapi = a, + this.outNode = W()), + this.bufferObject = null, + this.audioData = null, + this.myapi) { + case a: + this.bufferObject = new Audio, + this.bufferObject.crossOrigin = "anonymous", + this.bufferObject.addEventListener("canplaythrough", function() { + s.wasEverReady = !0 + }), + p === h && d.createMediaElementSource && !/wiiu/i.test(navigator.userAgent) && (this.supportWebAudioAPI = !0, + this.bufferObject.addEventListener("canplay", function() { + !s.mediaSourceNode && s.bufferObject && (s.mediaSourceNode = d.createMediaElementSource(s.bufferObject), + s.mediaSourceNode.connect(s.outNode)) + })), + this.bufferObject.autoplay = !1, + this.bufferObject.preload = "auto", + this.bufferObject.src = t; + break; + case h: + c.isWKWebView ? c.fetchLocalFileViaCordovaAsArrayBuffer(t, function(t) { + s.audioData = t, + s.decodeAudioBuffer() + }, function(t) { + s.failedToLoad = !0 + }) : ((i = new XMLHttpRequest).open("GET", t, !0), + i.responseType = "arraybuffer", + i.onload = function() { + s.audioData = i.response, + s.decodeAudioBuffer() + } + , + i.onerror = function() { + s.failedToLoad = !0 + } + , + i.send()); + break; + case l: + case u: + this.bufferObject = !0 + } + } + function ot(t, e) { + var i = this; + this.tag = e, + this.fresh = !0, + this.stopped = !0, + this.src = t.src, + this.buffer = t, + this.myapi = p, + this.is_music = t.is_music, + this.playbackRate = 1, + this.hasPlaybackEnded = !0, + this.resume_me = !1, + this.is_paused = !1, + this.resume_position = 0, + this.looping = !1, + this.is_muted = !1, + this.is_silent = !1, + this.volume = 1, + this.onended_handler = function(t) { + i.is_paused || i.resume_me || (this || t.target) === i.active_buffer && (i.hasPlaybackEnded = !0, + i.stopped = !0, + r = i.tag, + c.trigger(cr.plugins_.Audio.prototype.cnds.OnEnded, n)) + } + , + this.active_buffer = null, + this.isTimescaled = 1 === m && !this.is_music || 2 === m, + this.mutevol = 1, + this.startTime = (this.isTimescaled ? c.kahanTime : c.wallTime).sum, + this.gainNode = null, + this.pannerNode = null, + this.pannerEnabled = !1, + this.objectTracker = null, + this.panX = 0, + this.panY = 0, + this.panAngle = 0, + this.panConeInner = 0, + this.panConeOuter = 0, + this.panConeOuterGain = 0, + this.instanceObject = null; + var s = !1; + switch (this.myapi !== h || this.buffer.myapi !== a || this.buffer.supportWebAudioAPI || (this.myapi = a), + this.myapi) { + case a: + this.is_music ? (this.instanceObject = t.bufferObject, + s = !t.added_end_listener, + t.added_end_listener = !0) : (this.instanceObject = new Audio, + this.instanceObject.crossOrigin = "anonymous", + this.instanceObject.autoplay = !1, + this.instanceObject.src = t.bufferObject.src, + s = !0), + s && this.instanceObject.addEventListener("ended", function() { + r = i.tag, + i.stopped = !0, + c.trigger(cr.plugins_.Audio.prototype.cnds.OnEnded, n) + }); + break; + case h: + this.gainNode = W(), + this.gainNode.connect(V(e)), + this.buffer.myapi === h ? t.bufferObject && (this.instanceObject = d.createBufferSource(), + this.instanceObject.buffer = t.bufferObject, + this.instanceObject.connect(this.gainNode)) : (this.instanceObject = this.buffer.bufferObject, + this.buffer.outNode.connect(this.gainNode), + this.buffer.added_end_listener || (this.buffer.added_end_listener = !0, + this.buffer.bufferObject.addEventListener("ended", function() { + r = i.tag, + i.stopped = !0, + c.trigger(cr.plugins_.Audio.prototype.cnds.OnEnded, n) + }))); + break; + case l: + this.instanceObject = new window.Media(o + this.src,null,null,function(t) { + t === window.Media.MEDIA_STOPPED && (i.hasPlaybackEnded = !0, + i.stopped = !0, + r = i.tag, + c.trigger(cr.plugins_.Audio.prototype.cnds.OnEnded, n)) + } + ); + break; + case u: + this.instanceObject = !0 + } + } + H.prototype.connectTo = function(t) { + this.wetNode.disconnect(), + this.wetNode.connect(t), + this.dryNode.disconnect(), + this.dryNode.connect(t) + } + , + H.prototype.remove = function() { + this.inputNode.disconnect(), + this.filterNode.disconnect(), + this.wetNode.disconnect(), + this.dryNode.disconnect() + } + , + H.prototype.getInputNode = function() { + return this.inputNode + } + , + H.prototype.setParam = function(t, e, i, s) { + switch (t) { + case 0: + (e /= 100) < 0 && (e = 0), + 1 < e && (e = 1), + this.params[5] = e, + q(this.wetNode.gain, e, i, s), + q(this.dryNode.gain, 1 - e, i, s); + break; + case 1: + this.params[1] = e, + q(this.filterNode.frequency, e, i, s); + break; + case 2: + this.params[2] = e, + q(this.filterNode.detune, e, i, s); + break; + case 3: + this.params[3] = e, + q(this.filterNode.Q, e, i, s); + break; + case 4: + this.params[4] = e, + q(this.filterNode.gain, e, i, s) + } + } + , + Y.prototype.connectTo = function(t) { + this.wetNode.disconnect(), + this.wetNode.connect(t), + this.dryNode.disconnect(), + this.dryNode.connect(t) + } + , + Y.prototype.remove = function() { + this.inputNode.disconnect(), + this.mainNode.disconnect(), + this.delayNode.disconnect(), + this.delayGainNode.disconnect(), + this.wetNode.disconnect(), + this.dryNode.disconnect() + } + , + Y.prototype.getInputNode = function() { + return this.inputNode + } + , + Y.prototype.setParam = function(t, e, i, s) { + switch (t) { + case 0: + (e /= 100) < 0 && (e = 0), + 1 < e && (e = 1), + this.params[2] = e, + q(this.wetNode.gain, e, i, s), + q(this.dryNode.gain, 1 - e, i, s); + break; + case 4: + this.params[1] = j(e), + q(this.delayGainNode.gain, j(e), i, s); + break; + case 5: + this.params[0] = e, + q(this.delayNode.delayTime, e, i, s) + } + } + , + J.prototype.connectTo = function(t) { + this.wetNode.disconnect(), + this.wetNode.connect(t), + this.dryNode.disconnect(), + this.dryNode.connect(t) + } + , + J.prototype.remove = function() { + this.inputNode.disconnect(), + this.convolveNode.disconnect(), + this.wetNode.disconnect(), + this.dryNode.disconnect() + } + , + J.prototype.getInputNode = function() { + return this.inputNode + } + , + J.prototype.setParam = function(t, e, i, s) { + 0 === t && ((e /= 100) < 0 && (e = 0), + 1 < e && (e = 1), + this.params[1] = e, + q(this.wetNode.gain, e, i, s), + q(this.dryNode.gain, 1 - e, i, s)) + } + , + K.prototype.connectTo = function(t) { + this.dryNode.disconnect(), + this.dryNode.connect(t), + this.wetNode.disconnect(), + this.wetNode.connect(t) + } + , + K.prototype.remove = function() { + this.inputNode.disconnect(), + this.delayNode.disconnect(), + this.oscNode.disconnect(), + this.oscGainNode.disconnect(), + this.dryNode.disconnect(), + this.wetNode.disconnect(), + this.feedbackNode.disconnect() + } + , + K.prototype.getInputNode = function() { + return this.inputNode + } + , + K.prototype.setParam = function(t, e, i, s) { + switch (t) { + case 0: + (e /= 100) < 0 && (e = 0), + 1 < e && (e = 1), + this.params[4] = e, + q(this.wetNode.gain, e / 2, i, s), + q(this.dryNode.gain, 1 - e / 2, i, s); + break; + case 6: + this.params[1] = e / 1e3, + q(this.oscGainNode.gain, e / 1e3, i, s); + break; + case 7: + this.params[2] = e, + q(this.oscNode.frequency, e, i, s); + break; + case 8: + this.params[3] = e / 100, + q(this.feedbackNode.gain, e / 100, i, s) + } + } + , + Q.prototype.connectTo = function(t) { + this.dryNode.disconnect(), + this.dryNode.connect(t), + this.wetNode.disconnect(), + this.wetNode.connect(t) + } + , + Q.prototype.remove = function() { + this.inputNode.disconnect(), + this.filterNode.disconnect(), + this.oscNode.disconnect(), + this.oscGainNode.disconnect(), + this.dryNode.disconnect(), + this.wetNode.disconnect() + } + , + Q.prototype.getInputNode = function() { + return this.inputNode + } + , + Q.prototype.setParam = function(t, e, i, s) { + switch (t) { + case 0: + (e /= 100) < 0 && (e = 0), + 1 < e && (e = 1), + this.params[5] = e, + q(this.wetNode.gain, e / 2, i, s), + q(this.dryNode.gain, 1 - e / 2, i, s); + break; + case 1: + this.params[0] = e, + q(this.filterNode.frequency, e, i, s); + break; + case 2: + this.params[1] = e, + q(this.filterNode.detune, e, i, s); + break; + case 3: + this.params[2] = e, + q(this.filterNode.Q, e, i, s); + break; + case 6: + this.params[3] = e, + q(this.oscGainNode.gain, e, i, s); + break; + case 7: + this.params[4] = e, + q(this.oscNode.frequency, e, i, s) + } + } + , + Z.prototype.connectTo = function(t) { + this.node.disconnect(), + this.node.connect(t) + } + , + Z.prototype.remove = function() { + this.node.disconnect() + } + , + Z.prototype.getInputNode = function() { + return this.node + } + , + Z.prototype.setParam = function(t, e, i, s) { + 4 === t && (this.params[0] = j(e), + q(this.node.gain, j(e), i, s)) + } + , + $.prototype.connectTo = function(t) { + this.node.disconnect(), + this.node.connect(t) + } + , + $.prototype.remove = function() { + this.oscNode.disconnect(), + this.oscGainNode.disconnect(), + this.node.disconnect() + } + , + $.prototype.getInputNode = function() { + return this.node + } + , + $.prototype.setParam = function(t, e, i, s) { + switch (t) { + case 0: + (e /= 100) < 0 && (e = 0), + 1 < e && (e = 1), + this.params[1] = e, + q(this.node.gain.value, 1 - e / 2, i, s), + q(this.oscGainNode.gain.value, e / 2, i, s); + break; + case 7: + this.params[0] = e, + q(this.oscNode.frequency, e, i, s) + } + } + , + tt.prototype.connectTo = function(t) { + this.wetNode.disconnect(), + this.wetNode.connect(t), + this.dryNode.disconnect(), + this.dryNode.connect(t) + } + , + tt.prototype.remove = function() { + this.oscNode.disconnect(), + this.ringNode.disconnect(), + this.inputNode.disconnect(), + this.wetNode.disconnect(), + this.dryNode.disconnect() + } + , + tt.prototype.getInputNode = function() { + return this.inputNode + } + , + tt.prototype.setParam = function(t, e, i, s) { + switch (t) { + case 0: + (e /= 100) < 0 && (e = 0), + 1 < e && (e = 1), + this.params[1] = e, + q(this.wetNode.gain, e, i, s), + q(this.dryNode.gain, 1 - e, i, s); + break; + case 7: + this.params[0] = e, + q(this.oscNode.frequency, e, i, s) + } + } + , + et.prototype.setDrive = function(t, e) { + t < .01 && (t = .01), + this.preGain.gain.value = t, + this.postGain.gain.value = Math.pow(1 / t, .6) * e + } + , + et.prototype.shape = function(t, e, i) { + var s, n = 1.05 * i * e - e, i = t < 0 ? -1 : 1, t = t < 0 ? -t : t, s = t < e ? t : e + n * (s = t - e, + n = 1 / n, + 1 - Math.exp(-n * s)); + return s *= i + } + , + et.prototype.generateColortouchCurve = function(t, e) { + for (var i, s = F(t), n = F(e), r = 0; r < 32768; ++r) + i = r / 32768, + i = this.shape(i, s, n), + this.curve[32768 + r] = i, + this.curve[32768 - r - 1] = -i + } + , + et.prototype.connectTo = function(t) { + this.wetNode.disconnect(), + this.wetNode.connect(t), + this.dryNode.disconnect(), + this.dryNode.connect(t) + } + , + et.prototype.remove = function() { + this.inputNode.disconnect(), + this.preGain.disconnect(), + this.waveShaper.disconnect(), + this.postGain.disconnect(), + this.wetNode.disconnect(), + this.dryNode.disconnect() + } + , + et.prototype.getInputNode = function() { + return this.inputNode + } + , + et.prototype.setParam = function(t, e, i, s) { + 0 === t && ((e /= 100) < 0 && (e = 0), + 1 < e && (e = 1), + this.params[4] = e, + q(this.wetNode.gain, e, i, s), + q(this.dryNode.gain, 1 - e, i, s)) + } + , + it.prototype.connectTo = function(t) { + this.node.disconnect(), + this.node.connect(t) + } + , + it.prototype.remove = function() { + this.node.disconnect() + } + , + it.prototype.getInputNode = function() { + return this.node + } + , + it.prototype.setParam = function(t, e, i, s) {} + , + st.prototype.tick = function() { + this.node.getFloatFrequencyData(this.freqBins), + this.node.getByteTimeDomainData(this.signal); + for (var t = this.node.fftSize, e = 0, i = this.peak = 0, s = 0; e < t; e++) + (s = (this.signal[e] - 128) / 128) < 0 && (s = -s), + this.peak < s && (this.peak = s), + i += s * s; + this.peak = N(this.peak), + this.rms = N(Math.sqrt(i / t)) + } + , + st.prototype.connectTo = function(t) { + this.node.disconnect(), + this.node.connect(t) + } + , + st.prototype.remove = function() { + this.node.disconnect() + } + , + st.prototype.getInputNode = function() { + return this.node + } + , + st.prototype.setParam = function(t, e, i, s) {} + , + nt.prototype.setObject = function(t) { + this.obj = t + } + , + nt.prototype.hasObject = function() { + return !!this.obj + } + , + nt.prototype.tick = function(t) {} + , + rt.prototype.release = function() { + for (var t, e = 0, i = 0, s = x.length; e < s; ++e) + t = x[e], + (x[i] = t).buffer === this ? t.stop() : ++i; + x.length = i, + this.mediaSourceNode && (this.mediaSourceNode.disconnect(), + this.mediaSourceNode = null), + this.outNode && (this.outNode.disconnect(), + this.outNode = null), + this.bufferObject = null, + this.audioData = null + } + , + rt.prototype.decodeAudioBuffer = function() { + var h, t; + !this.bufferObject && this.audioData && (h = this, + d.decodeAudioData ? d.decodeAudioData(this.audioData, function(t) { + var e, i, s, n; + if (h.bufferObject = t, + h.audioData = null, + cr.is_undefined(h.playTagWhenReady) || S) + cr.is_undefined(h.convolveWhenReady) || ((n = h.convolveWhenReady.convolveNode).normalize = h.normalizeWhenReady, + n.buffer = t); + else if (h.panWhenReady.length) { + for (e = 0, + i = h.panWhenReady.length; e < i; e++) { + var r, o, a = h.panWhenReady[e]; + (s = new ot(h,a.thistag)).setPannerEnabled(!0), + void 0 !== a.objUid && (a.obj = c.getObjectByUID(a.objUid), + !a.obj) || (a.obj ? (r = cr.rotatePtAround(a.obj.x, a.obj.y, -a.obj.layer.getAngle(), _, v, !0), + o = cr.rotatePtAround(a.obj.x, a.obj.y, -a.obj.layer.getAngle(), _, v, !1), + s.setPan(r, o, cr.to_degrees(a.obj.angle - a.obj.layer.getAngle()), a.ia, a.oa, a.og), + s.setObject(a.obj)) : s.setPan(a.x, a.y, a.a, a.ia, a.oa, a.og), + s.play(h.loopWhenReady, h.volumeWhenReady, h.seekWhenReady), + h.pauseWhenReady && s.pause(), + x.push(s)) + } + cr.clearArray(h.panWhenReady) + } else + (s = new ot(h,h.playTagWhenReady || "")).play(h.loopWhenReady, h.volumeWhenReady, h.seekWhenReady), + h.pauseWhenReady && s.pause(), + x.push(s) + }, function(t) { + h.failedToLoad = !0 + }) : (this.bufferObject = d.createBuffer(this.audioData, !1), + this.audioData = null, + cr.is_undefined(this.playTagWhenReady) || S ? cr.is_undefined(this.convolveWhenReady) || ((t = this.convolveWhenReady.convolveNode).normalize = this.normalizeWhenReady, + t.buffer = this.bufferObject) : ((t = new ot(this,this.playTagWhenReady)).play(this.loopWhenReady, this.volumeWhenReady, this.seekWhenReady), + this.pauseWhenReady && t.pause(), + x.push(t)))) + } + , + rt.prototype.isLoaded = function() { + switch (this.myapi) { + case a: + var t = 4 <= this.bufferObject.readyState; + return t && (this.wasEverReady = !0), + t || this.wasEverReady; + case h: + return !!this.audioData || !!this.bufferObject; + case l: + case u: + return !0 + } + return !1 + } + , + rt.prototype.isLoadedAndDecoded = function() { + switch (this.myapi) { + case a: + return this.isLoaded(); + case h: + return !!this.bufferObject; + case l: + case u: + return !0 + } + return !1 + } + , + rt.prototype.hasFailedToLoad = function() { + switch (this.myapi) { + case a: + return !!this.bufferObject.error; + case h: + return this.failedToLoad + } + return !1 + } + , + ot.prototype.hasEnded = function() { + switch (this.myapi) { + case a: + return this.instanceObject.ended; + case h: + return this.buffer.myapi === h ? !(!this.fresh && !this.stopped && this.instanceObject.loop) && (!this.is_paused && this.hasPlaybackEnded) : this.instanceObject.ended; + case l: + return this.hasPlaybackEnded + } + return !0 + } + , + ot.prototype.canBeRecycled = function() { + return !(!this.fresh && !this.stopped) || this.hasEnded() + } + , + ot.prototype.setPannerEnabled = function(t) { + p === h && (!this.pannerEnabled && t ? this.gainNode && (this.pannerNode || (this.pannerNode = d.createPanner(), + "number" == typeof this.pannerNode.panningModel ? this.pannerNode.panningModel = s : this.pannerNode.panningModel = ["equalpower", "HRTF", "soundfield"][s], + "number" == typeof this.pannerNode.distanceModel ? this.pannerNode.distanceModel = w : this.pannerNode.distanceModel = ["linear", "inverse", "exponential"][w], + this.pannerNode.refDistance = A, + this.pannerNode.maxDistance = C, + this.pannerNode.rolloffFactor = k), + this.gainNode.disconnect(), + this.gainNode.connect(this.pannerNode), + this.pannerNode.connect(V(this.tag)), + this.pannerEnabled = !0) : this.pannerEnabled && !t && this.gainNode && (this.pannerNode.disconnect(), + this.gainNode.disconnect(), + this.gainNode.connect(V(this.tag)), + this.pannerEnabled = !1)) + } + , + ot.prototype.setPan = function(t, e, i, s, n, r) { + this.pannerEnabled && p === h && (this.pannerNode.setPosition(t, e, 0), + this.pannerNode.setOrientation(Math.cos(cr.to_radians(i)), Math.sin(cr.to_radians(i)), 0), + this.pannerNode.coneInnerAngle = s, + this.pannerNode.coneOuterAngle = n, + this.pannerNode.coneOuterGain = r, + this.panX = t, + this.panY = e, + this.panAngle = i, + this.panConeInner = s, + this.panConeOuter = n, + this.panConeOuterGain = r) + } + , + ot.prototype.setObject = function(t) { + this.pannerEnabled && p === h && (this.objectTracker || (this.objectTracker = new nt), + this.objectTracker.setObject(t)) + } + , + ot.prototype.tick = function(t) { + var e, i; + this.pannerEnabled && p === h && this.objectTracker && this.objectTracker.hasObject() && this.isPlaying() && (this.objectTracker.tick(t), + e = this.objectTracker.obj, + i = cr.rotatePtAround(e.x, e.y, -e.layer.getAngle(), _, v, !0), + t = cr.rotatePtAround(e.x, e.y, -e.layer.getAngle(), _, v, !1), + this.pannerNode.setPosition(i, t, 0), + void (t = 0) !== this.objectTracker.obj.angle && (t = e.angle - e.layer.getAngle(), + this.pannerNode.setOrientation(Math.cos(t), Math.sin(t), 0))) + } + , + ot.prototype.play = function(t, e, i, s) { + var n = this.instanceObject; + this.looping = t, + this.volume = e; + var r = i || 0; + switch (s = s || 0, + this.myapi) { + case a: + if (1 !== n.playbackRate && (n.playbackRate = 1), + n.volume !== e * T && (n.volume = e * T), + n.loop !== t && (n.loop = t), + n.muted && (n.muted = !1), + n.currentTime !== r) + try { + n.currentTime = r + } catch (t) {} + M(this); + break; + case h: + if (this.muted = !1, + this.mutevol = 1, + this.buffer.myapi === h) + this.gainNode.gain.value = e * T, + this.fresh || (this.instanceObject = d.createBufferSource(), + this.instanceObject.buffer = this.buffer.bufferObject, + this.instanceObject.connect(this.gainNode)), + this.instanceObject.onended = this.onended_handler, + this.active_buffer = this.instanceObject, + this.instanceObject.loop = t, + this.hasPlaybackEnded = !1, + 0 === r ? G(this.instanceObject, s) : U(this.instanceObject, r, this.getDuration(), s); + else { + if (1 !== n.playbackRate && (n.playbackRate = 1), + n.loop !== t && (n.loop = t), + n.volume = e * T, + n.currentTime !== r) + try { + n.currentTime = r + } catch (t) {} + M(this) + } + break; + case l: + (!this.fresh && this.stopped || 0 !== r) && n.seekTo(r), + n.play(), + this.hasPlaybackEnded = !1; + break; + case u: + (c.isDirectCanvas ? AppMobi.context : AppMobi.player).playSound(this.src, t) + } + this.playbackRate = 1, + this.startTime = (this.isTimescaled ? c.kahanTime : c.wallTime).sum - r, + this.fresh = !1, + this.stopped = !1, + this.is_paused = !1 + } + , + ot.prototype.stop = function() { + switch (this.myapi) { + case a: + this.instanceObject.paused || this.instanceObject.pause(); + break; + case h: + this.buffer.myapi === h ? i(this.instanceObject) : this.instanceObject.paused || this.instanceObject.pause(); + break; + case l: + this.instanceObject.stop(); + break; + case u: + c.isDirectCanvas && AppMobi.context.stopSound(this.src) + } + this.stopped = !0, + this.is_paused = !1 + } + , + ot.prototype.pause = function() { + if (!(this.fresh || this.stopped || this.hasEnded() || this.is_paused)) { + switch (this.myapi) { + case a: + this.instanceObject.paused || this.instanceObject.pause(); + break; + case h: + this.buffer.myapi === h ? (this.resume_position = this.getPlaybackTime(!0), + this.looping && (this.resume_position = this.resume_position % this.getDuration()), + this.is_paused = !0, + i(this.instanceObject)) : this.instanceObject.paused || this.instanceObject.pause(); + break; + case l: + this.instanceObject.pause(); + break; + case u: + c.isDirectCanvas && AppMobi.context.stopSound(this.src) + } + this.is_paused = !0 + } + } + , + ot.prototype.resume = function() { + if (!(this.fresh || this.stopped || this.hasEnded()) && this.is_paused) { + switch (this.myapi) { + case a: + M(this); + break; + case h: + this.buffer.myapi === h ? (this.instanceObject = d.createBufferSource(), + this.instanceObject.buffer = this.buffer.bufferObject, + this.instanceObject.connect(this.gainNode), + this.instanceObject.onended = this.onended_handler, + this.active_buffer = this.instanceObject, + this.instanceObject.loop = this.looping, + this.gainNode.gain.value = T * this.volume * this.mutevol, + this.updatePlaybackRate(), + this.startTime = (this.isTimescaled ? c.kahanTime : c.wallTime).sum - this.resume_position / (this.playbackRate || .001), + U(this.instanceObject, this.resume_position, this.getDuration())) : M(this); + break; + case l: + this.instanceObject.play(); + break; + case u: + c.isDirectCanvas && AppMobi.context.resumeSound(this.src) + } + this.is_paused = !1 + } + } + , + ot.prototype.seek = function(t) { + if (!(this.fresh || this.stopped || this.hasEnded())) + switch (this.myapi) { + case a: + try { + this.instanceObject.currentTime = t + } catch (t) {} + break; + case h: + if (this.buffer.myapi === h) + this.is_paused ? this.resume_position = t : (this.pause(), + this.resume_position = t, + this.resume()); + else + try { + this.instanceObject.currentTime = t + } catch (t) {} + break; + case l: + break; + case u: + c.isDirectCanvas && AppMobi.context.seekSound(this.src, t) + } + } + , + ot.prototype.reconnect = function(t) { + this.myapi === h && (this.pannerEnabled ? (this.pannerNode.disconnect(), + this.pannerNode.connect(t)) : (this.gainNode.disconnect(), + this.gainNode.connect(t))) + } + , + ot.prototype.getDuration = function(t) { + var e = 0; + switch (this.myapi) { + case a: + void 0 !== this.instanceObject.duration && (e = this.instanceObject.duration); + break; + case h: + e = this.buffer.bufferObject.duration; + break; + case l: + e = this.instanceObject.getDuration(); + break; + case u: + c.isDirectCanvas && (e = AppMobi.context.getDurationSound(this.src)) + } + return t && (e /= this.playbackRate || .001), + e + } + , + ot.prototype.getPlaybackTime = function(t) { + var e = this.getDuration() + , i = 0; + switch (this.myapi) { + case a: + void 0 !== this.instanceObject.currentTime && (i = this.instanceObject.currentTime); + break; + case h: + if (this.buffer.myapi === h) { + if (this.is_paused) + return this.resume_position; + i = (this.isTimescaled ? c.kahanTime : c.wallTime).sum - this.startTime + } else + void 0 !== this.instanceObject.currentTime && (i = this.instanceObject.currentTime); + break; + case l: + break; + case u: + c.isDirectCanvas && (i = AppMobi.context.getPlaybackTimeSound(this.src)) + } + return t && (i *= this.playbackRate), + !this.looping && e < i && (i = e), + i + } + , + ot.prototype.isPlaying = function() { + return !(this.is_paused || this.fresh || this.stopped || this.hasEnded()) + } + , + ot.prototype.shouldSave = function() { + return !this.fresh && !this.stopped && !this.hasEnded() + } + , + ot.prototype.setVolume = function(t) { + this.volume = t, + this.updateVolume() + } + , + ot.prototype.updateVolume = function() { + var t = this.volume * T; + switch (isFinite(t) || (t = 0), + this.myapi) { + case a: + void 0 !== this.instanceObject.volume && this.instanceObject.volume !== t && (this.instanceObject.volume = t); + break; + case h: + this.buffer.myapi === h ? this.gainNode.gain.value = t * this.mutevol : void 0 !== this.instanceObject.volume && this.instanceObject.volume !== t && (this.instanceObject.volume = t) + } + } + , + ot.prototype.getVolume = function() { + return this.volume + } + , + ot.prototype.doSetMuted = function(t) { + switch (this.myapi) { + case a: + this.instanceObject.muted !== !!t && (this.instanceObject.muted = !!t); + break; + case h: + this.buffer.myapi === h ? (this.mutevol = t ? 0 : 1, + this.gainNode.gain.value = T * this.volume * this.mutevol) : this.instanceObject.muted !== !!t && (this.instanceObject.muted = !!t) + } + } + , + ot.prototype.setMuted = function(t) { + this.is_muted = !!t, + this.doSetMuted(this.is_muted || this.is_silent) + } + , + ot.prototype.setSilent = function(t) { + this.is_silent = !!t, + this.doSetMuted(this.is_muted || this.is_silent) + } + , + ot.prototype.setLooping = function(t) { + switch (this.looping = t, + this.myapi) { + case a: + case h: + this.instanceObject.loop !== !!t && (this.instanceObject.loop = !!t); + break; + case l: + break; + case u: + c.isDirectCanvas && AppMobi.context.setLoopingSound(this.src, t) + } + } + , + ot.prototype.setPlaybackRate = function(t) { + this.playbackRate = t, + this.updatePlaybackRate() + } + , + ot.prototype.updatePlaybackRate = function() { + var t = this.playbackRate; + switch (this.isTimescaled && (t *= c.timescale), + this.myapi) { + case a: + this.instanceObject.playbackRate !== t && (this.instanceObject.playbackRate = t); + break; + case h: + this.buffer.myapi === h ? this.instanceObject.playbackRate.value !== t && (this.instanceObject.playbackRate.value = t) : this.instanceObject.playbackRate !== t && (this.instanceObject.playbackRate = t) + } + } + , + ot.prototype.setSuspended = function(t) { + switch (this.myapi) { + case a: + t ? this.isPlaying() ? (this.resume_me = !0, + this.instanceObject.pause()) : this.resume_me = !1 : this.resume_me && (this.instanceObject.play(), + this.resume_me = !1); + break; + case h: + t ? this.isPlaying() ? (this.resume_me = !0, + this.buffer.myapi === h ? (this.resume_position = this.getPlaybackTime(!0), + this.looping && (this.resume_position = this.resume_position % this.getDuration()), + i(this.instanceObject)) : this.instanceObject.pause()) : this.resume_me = !1 : this.resume_me && (this.buffer.myapi === h ? (this.instanceObject = d.createBufferSource(), + this.instanceObject.buffer = this.buffer.bufferObject, + this.instanceObject.connect(this.gainNode), + this.instanceObject.onended = this.onended_handler, + this.active_buffer = this.instanceObject, + this.instanceObject.loop = this.looping, + this.gainNode.gain.value = T * this.volume * this.mutevol, + this.updatePlaybackRate(), + this.startTime = (this.isTimescaled ? c.kahanTime : c.wallTime).sum - this.resume_position / (this.playbackRate || .001), + U(this.instanceObject, this.resume_position, this.getDuration())) : this.instanceObject.play(), + this.resume_me = !1); + break; + case l: + t ? this.isPlaying() ? (this.instanceObject.pause(), + this.resume_me = !0) : this.resume_me = !1 : this.resume_me && (this.resume_me = !1, + this.instanceObject.play()) + } + } + , + t.Instance = function(t) { + if (this.type = t, + this.runtime = t.runtime, + c = this.runtime, + (n = this).listenerTracker = null, + this.listenerZ = -600, + this.runtime.isWKWebView && (B = !0), + !(this.runtime.isiOS || this.runtime.isAndroid && (this.runtime.isChrome || this.runtime.isAndroidStockBrowser)) || this.runtime.isCrosswalk || this.runtime.isDomFree || this.runtime.isAmazonWebApp || B || (P = !0), + d = null, + "undefined" != typeof AudioContext ? (p = h, + d = new AudioContext) : "undefined" != typeof webkitAudioContext && (p = h, + d = new webkitAudioContext), + this.runtime.isiOS && d && (d.close && d.close(), + "undefined" != typeof AudioContext ? d = new AudioContext : "undefined" != typeof webkitAudioContext && (d = new webkitAudioContext)), + p !== h && (this.runtime.isCordova && void 0 !== window.Media ? p = l : this.runtime.isAppMobi && (p = u)), + p === l && (-1 < (t = (o = location.href).lastIndexOf("/")) && (o = o.substr(0, t + 1)), + o = o.replace("file://", "")), + this.runtime.isSafari && this.runtime.isWindows && "undefined" == typeof Audio) + alert("It looks like you're using Safari for Windows without Quicktime. Audio cannot be played until Quicktime is installed."), + this.runtime.DestroyInstance(this); + else { + if (this.runtime.isDirectCanvas) + g = this.runtime.isAndroid; + else + try { + g = !!(new Audio).canPlayType('audio/ogg; codecs="vorbis"') && !this.runtime.isWindows10 + } catch (t) { + g = !1 + } + p, + this.runtime.tickMe(this) + } + } + ; + var at = t.Instance.prototype; + at.onCreate = function() { + this.runtime.audioInstance = this, + m = this.properties[0], + this.saveload = this.properties[1], + this.playinbackground = 0 !== this.properties[2], + this.nextPlayTime = 0, + s = this.properties[3], + w = this.properties[4], + this.listenerZ = -this.properties[5], + A = this.properties[6], + C = this.properties[7], + k = this.properties[8], + this.listenerTracker = new nt; + var t = this.runtime.draw_width || this.runtime.width + , e = this.runtime.draw_height || this.runtime.height; + p === h && (d.listener.setPosition(t / 2, e / 2, this.listenerZ), + d.listener.setOrientation(0, 0, 1, 0, -1, 0), + window.c2OnAudioMicStream = function(t, e) { + O && O.disconnect(), + I = e.toLowerCase(), + (O = d.createMediaStreamSource(t)).connect(V(I)) + } + ), + this.runtime.addSuspendCallback(function(t) { + n.onSuspend(t) + }); + var i = this; + this.runtime.addDestroyCallback(function(t) { + i.onInstanceDestroyed(t) + }) + } + , + at.onInstanceDestroyed = function(t) { + for (var e, i = 0, s = x.length; i < s; i++) + (e = x[i]).objectTracker && e.objectTracker.obj === t && (e.objectTracker.obj = null, + e.pannerEnabled && e.isPlaying() && e.looping && e.stop()); + this.listenerTracker.obj === t && (this.listenerTracker.obj = null) + } + , + at.saveToJSON = function() { + for (var t, e, i, s, n = { + silent: S, + masterVolume: T, + listenerZ: this.listenerZ, + listenerUid: this.listenerTracker.hasObject() ? this.listenerTracker.obj.uid : -1, + playing: [], + effects: {} + }, r = n.playing, o = 0, a = x.length; o < a; o++) + (t = x[o]).shouldSave() && 3 !== this.saveload && (t.is_music && 1 === this.saveload || !t.is_music && 2 === this.saveload || (s = t.getPlaybackTime(), + t.looping && (s %= t.getDuration()), + e = { + tag: t.tag, + buffersrc: t.buffer.src, + is_music: t.is_music, + playbackTime: s, + volume: t.volume, + looping: t.looping, + muted: t.is_muted, + playbackRate: t.playbackRate, + paused: t.is_paused, + resume_position: t.resume_position + }, + t.pannerEnabled && (e.pan = {}, + s = e.pan, + t.objectTracker && t.objectTracker.hasObject() ? s.objUid = t.objectTracker.obj.uid : (s.x = t.panX, + s.y = t.panY, + s.a = t.panAngle), + s.ia = t.panConeInner, + s.oa = t.panConeOuter, + s.og = t.panConeOuterGain), + r.push(e))); + var h, c = n.effects; + for (i in D) + if (D.hasOwnProperty(i)) { + for (h = [], + o = 0, + a = D[i].length; o < a; o++) + h.push({ + type: D[i][o].type, + params: D[i][o].params + }); + c[i] = h + } + return n + } + ; + var ht = []; + at.loadFromJSON = function(t) { + var e = t.silent; + T = t.masterVolume, + this.listenerZ = t.listenerZ, + this.listenerTracker.setObject(null); + var i = t.listenerUid; + -1 !== i && (this.listenerTracker.loadUid = i, + ht.push(this.listenerTracker)); + var s, n, r, o, a, h, c, l, u, p, d, f, y, g, m, _, v, b, w = t.playing; + if (3 !== this.saveload) + for (s = 0, + n = x.length; s < n; s++) + (d = x[s]).is_music && 1 === this.saveload || !d.is_music && 2 === this.saveload || d.stop(); + for (f in D) + if (D.hasOwnProperty(f)) + for (s = 0, + n = D[f].length; s < n; s++) + D[f][s].remove(); + for (f in cr.wipe(D), + t.effects) + if (t.effects.hasOwnProperty(f)) + for (s = 0, + n = (m = t.effects[f]).length; s < n; s++) + switch (_ = m[s].type, + v = m[s].params, + _) { + case "filter": + ft(f, new H(v[0],v[1],v[2],v[3],v[4],v[5])); + break; + case "delay": + ft(f, new Y(v[0],v[1],v[2])); + break; + case "convolve": + o = v[2], + (p = this.getAudioBuffer(o, !1)).bufferObject ? b = new J(p.bufferObject,v[0],v[1],o) : (b = new J(null,v[0],v[1],o), + p.normalizeWhenReady = v[0], + p.convolveWhenReady = b), + ft(f, b); + break; + case "flanger": + ft(f, new K(v[0],v[1],v[2],v[3],v[4])); + break; + case "phaser": + ft(f, new Q(v[0],v[1],v[2],v[3],v[4],v[5])); + break; + case "gain": + ft(f, new Z(v[0])); + break; + case "tremolo": + ft(f, new $(v[0],v[1])); + break; + case "ringmod": + ft(f, new tt(v[0],v[1])); + break; + case "distortion": + ft(f, new et(v[0],v[1],v[2],v[3],v[4])); + break; + case "compressor": + ft(f, new it(v[0],v[1],v[2],v[3],v[4])); + break; + case "analyser": + ft(f, new st(v[0],v[1])) + } + for (s = 0, + n = w.length; s < n; s++) + 3 !== this.saveload && (o = (r = w[s]).buffersrc, + a = r.is_music, + h = r.tag, + c = r.playbackTime, + l = r.looping, + u = r.volume, + g = (y = r.pan) && y.hasOwnProperty("objUid") ? y.objUid : -1, + a && 1 === this.saveload || !a && 2 === this.saveload || ((d = this.getAudioInstance(o, h, a, l, u)) ? (d.resume_position = r.resume_position, + d.setPannerEnabled(!!y), + d.play(l, u, c), + d.updatePlaybackRate(), + d.updateVolume(), + d.doSetMuted(d.is_muted || d.is_silent), + r.paused && d.pause(), + r.muted && d.setMuted(!0), + d.doSetMuted(d.is_muted || d.is_silent), + y && (-1 !== g ? (d.objectTracker = d.objectTracker || new nt, + d.objectTracker.loadUid = g, + ht.push(d.objectTracker)) : d.setPan(y.x, y.y, y.a, y.ia, y.oa, y.og))) : ((p = this.getAudioBuffer(o, a)).seekWhenReady = c, + p.pauseWhenReady = r.paused, + y && (-1 !== g ? p.panWhenReady.push({ + objUid: g, + ia: y.ia, + oa: y.oa, + og: y.og, + thistag: h + }) : p.panWhenReady.push({ + x: y.x, + y: y.y, + a: y.a, + ia: y.ia, + oa: y.oa, + og: y.og, + thistag: h + }))))); + if (e && !S) { + for (s = 0, + n = x.length; s < n; s++) + x[s].setSilent(!0); + S = !0 + } else if (!e && S) { + for (s = 0, + n = x.length; s < n; s++) + x[s].setSilent(!1); + S = !1 + } + } + , + at.afterLoad = function() { + for (var t, e, i = 0, s = ht.length; i < s; i++) + t = ht[i], + e = this.runtime.getObjectByUID(t.loadUid), + t.setObject(e), + t.loadUid = -1, + e && (_ = e.x, + v = e.y); + cr.clearArray(ht) + } + , + at.onSuspend = function(t) { + if (!this.playinbackground) { + var e, i; + for (!t && d && d.resume && (d.resume(), + b = !1), + e = 0, + i = x.length; e < i; e++) + x[e].setSuspended(t); + t && d && d.suspend && (d.suspend(), + b = !0) + } + } + , + at.tick = function() { + for (var t, e, i, s, n = this.runtime.dt, r = 0, o = x.length; r < o; r++) + (t = x[r]).tick(n), + 0 !== m && t.updatePlaybackRate(); + for (e in D) + if (D.hasOwnProperty(e)) + for (r = 0, + o = (i = D[e]).length; r < o; r++) + (s = i[r]).tick && s.tick(); + p === h && this.listenerTracker.hasObject() && (this.listenerTracker.tick(n), + _ = this.listenerTracker.obj.x, + v = this.listenerTracker.obj.y, + d.listener.setPosition(this.listenerTracker.obj.x, this.listenerTracker.obj.y, this.listenerZ)) + } + ; + var ct = []; + at.setPreloadList = function(t) { + for (var e, i, s, n = 0, r = 0, o = t.length; r < o; ++r) + e = (s = t[r])[0], + i = 2 * s[1], + ((s = 4 < e.length && ".ogg" === e.substr(e.length - 4)) && g || !s && !g) && (ct.push({ + filename: e, + size: i, + obj: null + }), + n += i); + return n + } + , + at.startPreloads = function() { + for (var t, e, i = 0, s = ct.length; i < s; ++i) + t = ct[i], + e = this.runtime.files_subfolder + t.filename, + t.obj = this.getAudioBuffer(e, !1) + } + , + at.getPreloadedSize = function() { + for (var t, e = 0, i = 0, s = ct.length; i < s; ++i) + (t = ct[i]).obj.isLoadedAndDecoded() || t.obj.hasFailedToLoad() || this.runtime.isDomFree || this.runtime.isAndroidStockBrowser ? e += t.size : t.obj.isLoaded() && (e += Math.floor(t.size / 2)); + return e + } + , + at.releaseAllMusicBuffers = function() { + for (var t, e = 0, i = 0, s = f.length; e < s; ++e) + t = f[e], + (f[i] = t).is_music ? t.release() : ++i; + f.length = i + } + , + at.getAudioBuffer = function(t, e, i) { + for (var s, n = null, r = 0, o = f.length; r < o; r++) + if ((s = f[r]).src === t) { + n = s; + break + } + return n || i || (B && e && this.releaseAllMusicBuffers(), + n = new rt(t,e), + f.push(n)), + n + } + , + at.getAudioInstance = function(t, e, i, s, n) { + for (var r, o = 0, a = x.length; o < a; o++) + if ((r = x[o]).src === t && (r.canBeRecycled() || i)) + return r.tag = e, + r; + var h = this.getAudioBuffer(t, i); + return h.bufferObject ? (r = new ot(h,e), + x.push(r), + r) : ("" !== e && (h.playTagWhenReady = e, + h.loopWhenReady = s, + h.volumeWhenReady = n), + null) + } + ; + var lt = []; + function ut(t, e) { + t = t.isPlaying() ? 1 : 0, + e = e.isPlaying() ? 1 : 0; + return t == e ? 0 : t < e ? 1 : -1 + } + function pt(t, e) { + if (cr.clearArray(lt), + !t.length) + return y && !y.hasEnded() && (cr.clearArray(lt), + void (lt[0] = y)); + for (var i, s = 0, n = x.length; s < n; s++) + i = x[s], + cr.equals_nocase(t, i.tag) && lt.push(i); + e && lt.sort(ut) + } + function dt(t) { + var e, i, s, n, r = d.destination; + if (D.hasOwnProperty(t) && (s = D[t]).length) + for (r = s[0].getInputNode(), + e = 0, + i = s.length; e < i; e++) + n = s[e], + e + 1 === i ? n.connectTo(d.destination) : n.connectTo(s[e + 1].getInputNode()); + for (pt(t), + e = 0, + i = lt.length; e < i; e++) + lt[e].reconnect(r); + O && I === t && (O.disconnect(), + O.connect(r)) + } + function ft(t, e) { + D.hasOwnProperty(t) ? D[t].push(e) : D[t] = [e], + dt(t) + } + function yt() {} + function gt() {} + function mt() {} + function _t(t, e) { + var i = null; + return D.hasOwnProperty(t) && (i = D[t]), + i && 0 <= e && e < i.length && i[e].freqBins ? i[e] : null + } + yt.prototype.OnEnded = function(t) { + return cr.equals_nocase(r, t) + } + , + yt.prototype.PreloadsComplete = function() { + for (var t = 0, e = f.length; t < e; t++) + if (!f[t].isLoadedAndDecoded() && !f[t].hasFailedToLoad()) + return !1; + return !0 + } + , + yt.prototype.AdvancedAudioSupported = function() { + return p === h + } + , + yt.prototype.IsSilent = function() { + return S + } + , + yt.prototype.IsAnyPlaying = function() { + for (var t = 0, e = x.length; t < e; t++) + if (x[t].isPlaying()) + return !0; + return !1 + } + , + yt.prototype.IsTagPlaying = function(t) { + var e, i; + for (pt(t), + e = 0, + i = lt.length; e < i; e++) + if (lt[e].isPlaying()) + return !0; + return !1 + } + , + t.cnds = new yt, + gt.prototype.Play = function(t, e, i, s) { + var n; + S || (n = j(i), + i = t[1], + t = this.runtime.files_subfolder + t[0] + (g ? ".ogg" : ".m4a"), + (y = this.getAudioInstance(t, s, i, 0 !== e, n)) && (y.setPannerEnabled(!1), + y.play(0 !== e, n, 0, this.nextPlayTime), + this.nextPlayTime = 0)) + } + , + gt.prototype.PlayAtPosition = function(t, e, i, s, n, r, o, a, h, c) { + var l; + S || (l = j(i), + i = t[1], + t = this.runtime.files_subfolder + t[0] + (g ? ".ogg" : ".m4a"), + (y = this.getAudioInstance(t, c, i, 0 !== e, l)) ? (y.setPannerEnabled(!0), + y.setPan(s, n, r, o, a, j(h)), + y.play(0 !== e, l, 0, this.nextPlayTime), + this.nextPlayTime = 0) : this.getAudioBuffer(t, i).panWhenReady.push({ + x: s, + y: n, + a: r, + ia: o, + oa: a, + og: j(h), + thistag: c + })) + } + , + gt.prototype.PlayAtObject = function(t, e, i, s, n, r, o, a) { + var h, c, l; + S || !s || (h = s.getFirstPicked()) && (c = j(i), + l = t[1], + s = this.runtime.files_subfolder + t[0] + (g ? ".ogg" : ".m4a"), + (y = this.getAudioInstance(s, a, l, 0 !== e, c)) ? (y.setPannerEnabled(!0), + i = cr.rotatePtAround(h.x, h.y, -h.layer.getAngle(), _, v, !0), + t = cr.rotatePtAround(h.x, h.y, -h.layer.getAngle(), _, v, !1), + y.setPan(i, t, cr.to_degrees(h.angle - h.layer.getAngle()), n, r, j(o)), + y.setObject(h), + y.play(0 !== e, c, 0, this.nextPlayTime), + this.nextPlayTime = 0) : this.getAudioBuffer(s, l).panWhenReady.push({ + obj: h, + ia: n, + oa: r, + og: j(o), + thistag: a + })) + } + , + gt.prototype.PlayByName = function(t, e, i, s, n) { + S || (s = j(s), + t = 1 === t, + e = this.runtime.files_subfolder + e.toLowerCase() + (g ? ".ogg" : ".m4a"), + (y = this.getAudioInstance(e, n, t, 0 !== i, s)) && (y.setPannerEnabled(!1), + y.play(0 !== i, s, 0, this.nextPlayTime), + this.nextPlayTime = 0)) + } + , + gt.prototype.PlayAtPositionByName = function(t, e, i, s, n, r, o, a, h, c, l) { + S || (s = j(s), + t = 1 === t, + e = this.runtime.files_subfolder + e.toLowerCase() + (g ? ".ogg" : ".m4a"), + (y = this.getAudioInstance(e, l, t, 0 !== i, s)) ? (y.setPannerEnabled(!0), + y.setPan(n, r, o, a, h, j(c)), + y.play(0 !== i, s, 0, this.nextPlayTime), + this.nextPlayTime = 0) : this.getAudioBuffer(e, t).panWhenReady.push({ + x: n, + y: r, + a: o, + ia: a, + oa: h, + og: j(c), + thistag: l + })) + } + , + gt.prototype.PlayAtObjectByName = function(t, e, i, s, n, r, o, a, h) { + var c, l; + S || !n || (c = n.getFirstPicked()) && (l = j(s), + n = 1 === t, + s = this.runtime.files_subfolder + e.toLowerCase() + (g ? ".ogg" : ".m4a"), + (y = this.getAudioInstance(s, h, n, 0 !== i, l)) ? (y.setPannerEnabled(!0), + t = cr.rotatePtAround(c.x, c.y, -c.layer.getAngle(), _, v, !0), + e = cr.rotatePtAround(c.x, c.y, -c.layer.getAngle(), _, v, !1), + y.setPan(t, e, cr.to_degrees(c.angle - c.layer.getAngle()), r, o, j(a)), + y.setObject(c), + y.play(0 !== i, l, 0, this.nextPlayTime), + this.nextPlayTime = 0) : this.getAudioBuffer(s, n).panWhenReady.push({ + obj: c, + ia: r, + oa: o, + og: j(a), + thistag: h + })) + } + , + gt.prototype.SetLooping = function(t, e) { + var i, s; + for (pt(t), + i = 0, + s = lt.length; i < s; i++) + lt[i].setLooping(0 === e) + } + , + gt.prototype.SetMuted = function(t, e) { + var i, s; + for (pt(t), + i = 0, + s = lt.length; i < s; i++) + lt[i].setMuted(0 === e) + } + , + gt.prototype.SetVolume = function(t, e) { + pt(t); + for (var i = j(e), s = 0, n = lt.length; s < n; s++) + lt[s].setVolume(i) + } + , + gt.prototype.Preload = function(t) { + var e; + S || (e = t[1], + t = this.runtime.files_subfolder + t[0] + (g ? ".ogg" : ".m4a"), + p !== u ? p !== l && this.getAudioInstance(t, "", e, !1) : (this.runtime.isDirectCanvas ? AppMobi.context : AppMobi.player).loadSound(t)) + } + , + gt.prototype.PreloadByName = function(t, e) { + S || (t = 1 === t, + e = this.runtime.files_subfolder + e.toLowerCase() + (g ? ".ogg" : ".m4a"), + p !== u ? p !== l && this.getAudioInstance(e, "", t, !1) : (this.runtime.isDirectCanvas ? AppMobi.context : AppMobi.player).loadSound(e)) + } + , + gt.prototype.SetPlaybackRate = function(t, e) { + var i, s; + for (pt(t), + e < 0 && (e = 0), + i = 0, + s = lt.length; i < s; i++) + lt[i].setPlaybackRate(e) + } + , + gt.prototype.Stop = function(t) { + var e, i; + for (pt(t), + e = 0, + i = lt.length; e < i; e++) + lt[e].stop() + } + , + gt.prototype.StopAll = function() { + for (var t = 0, e = x.length; t < e; t++) + x[t].stop() + } + , + gt.prototype.SetPaused = function(t, e) { + var i, s; + for (pt(t), + i = 0, + s = lt.length; i < s; i++) + 0 === e ? lt[i].pause() : lt[i].resume() + } + , + gt.prototype.Seek = function(t, e) { + var i, s; + for (pt(t), + i = 0, + s = lt.length; i < s; i++) + lt[i].seek(e) + } + , + gt.prototype.SetSilent = function(t) { + var e, i; + if (2 === t && (t = S ? 1 : 0), + 0 !== t || S) { + if (1 === t && S) { + for (e = 0, + i = x.length; e < i; e++) + x[e].setSilent(!1); + S = !1 + } + } else { + for (e = 0, + i = x.length; e < i; e++) + x[e].setSilent(!0); + S = !0 + } + } + , + gt.prototype.SetMasterVolume = function(t) { + var e, i; + for (T = j(t), + e = 0, + i = x.length; e < i; e++) + x[e].updateVolume() + } + , + gt.prototype.AddFilterEffect = function(t, e, i, s, n, r, o) { + p !== h || e < 0 || X.length <= e || !d.createBiquadFilter || ((o /= 100) < 0 && (o = 0), + 1 < o && (o = 1), + ft(t = t.toLowerCase(), new H(e,i,s,n,r,o))) + } + , + gt.prototype.AddDelayEffect = function(t, e, i, s) { + p === h && ((s /= 100) < 0 && (s = 0), + 1 < s && (s = 1), + ft(t = t.toLowerCase(), new Y(e,j(i),s))) + } + , + gt.prototype.AddFlangerEffect = function(t, e, i, s, n, r) { + p === h && d.createOscillator && ((r /= 100) < 0 && (r = 0), + 1 < r && (r = 1), + ft(t = t.toLowerCase(), new K(e / 1e3,i / 1e3,s,n / 100,r))) + } + , + gt.prototype.AddPhaserEffect = function(t, e, i, s, n, r, o) { + p === h && d.createOscillator && ((o /= 100) < 0 && (o = 0), + 1 < o && (o = 1), + ft(t = t.toLowerCase(), new Q(e,i,s,n,r,o))) + } + , + gt.prototype.AddConvolutionEffect = function(t, e, i, s) { + var n, r; + p === h && d.createConvolver && (n = 0 === i, + i = this.runtime.files_subfolder + e[0] + (g ? ".ogg" : ".m4a"), + e = this.getAudioBuffer(i, !1), + t = t.toLowerCase(), + (s /= 100) < 0 && (s = 0), + 1 < s && (s = 1), + e.bufferObject ? r = new J(e.bufferObject,n,s,i) : (r = new J(null,n,s,i), + e.normalizeWhenReady = n, + e.convolveWhenReady = r), + ft(t, r)) + } + , + gt.prototype.AddGainEffect = function(t, e) { + p === h && ft(t = t.toLowerCase(), new Z(j(e))) + } + , + gt.prototype.AddMuteEffect = function(t) { + p === h && ft(t = t.toLowerCase(), new Z(0)) + } + , + gt.prototype.AddTremoloEffect = function(t, e, i) { + p === h && d.createOscillator && ((i /= 100) < 0 && (i = 0), + 1 < i && (i = 1), + ft(t = t.toLowerCase(), new $(e,i))) + } + , + gt.prototype.AddRingModEffect = function(t, e, i) { + p === h && d.createOscillator && ((i /= 100) < 0 && (i = 0), + 1 < i && (i = 1), + ft(t = t.toLowerCase(), new tt(e,i))) + } + , + gt.prototype.AddDistortionEffect = function(t, e, i, s, n, r) { + p === h && d.createWaveShaper && ((r /= 100) < 0 && (r = 0), + 1 < r && (r = 1), + ft(t = t.toLowerCase(), new et(e,i,s,n,r))) + } + , + gt.prototype.AddCompressorEffect = function(t, e, i, s, n, r) { + p === h && d.createDynamicsCompressor && ft(t = t.toLowerCase(), new it(e,i,s,n / 1e3,r / 1e3)) + } + , + gt.prototype.AddAnalyserEffect = function(t, e, i) { + p === h && ft(t = t.toLowerCase(), new st(e,i)) + } + , + gt.prototype.RemoveEffects = function(t) { + var e, i, s; + if (p === h && (t = t.toLowerCase(), + D.hasOwnProperty(t) && (s = D[t]).length)) { + for (e = 0, + i = s.length; e < i; e++) + s[e].remove(); + cr.clearArray(s), + dt(t) + } + } + , + gt.prototype.SetEffectParameter = function(t, e, i, s, n, r) { + p === h && (t = t.toLowerCase(), + e = Math.floor(e), + D.hasOwnProperty(t) && (t = D[t], + e < 0 || e >= t.length || t[e].setParam(i, s, n, r))) + } + , + gt.prototype.SetListenerObject = function(t) { + !t || p !== h || (t = t.getFirstPicked()) && (this.listenerTracker.setObject(t), + _ = t.x, + v = t.y) + } + , + gt.prototype.SetListenerZ = function(t) { + this.listenerZ = t + } + , + gt.prototype.ScheduleNextPlay = function(t) { + d && (this.nextPlayTime = t) + } + , + gt.prototype.UnloadAudio = function(t) { + var e = t[1] + , t = this.runtime.files_subfolder + t[0] + (g ? ".ogg" : ".m4a") + , e = this.getAudioBuffer(t, e, !0); + e && (e.release(), + cr.arrayFindRemove(f, e)) + } + , + gt.prototype.UnloadAudioByName = function(t, e) { + t = 1 === t, + e = this.runtime.files_subfolder + e.toLowerCase() + (g ? ".ogg" : ".m4a"), + t = this.getAudioBuffer(e, t, !0); + t && (t.release(), + cr.arrayFindRemove(f, t)) + } + , + gt.prototype.UnloadAll = function() { + for (var t = 0, e = f.length; t < e; ++t) + f[t].release(); + cr.clearArray(f) + } + , + t.acts = new gt, + mt.prototype.Duration = function(t, e) { + pt(e, !0), + lt.length ? t.set_float(lt[0].getDuration()) : t.set_float(0) + } + , + mt.prototype.PlaybackTime = function(t, e) { + pt(e, !0), + lt.length ? t.set_float(lt[0].getPlaybackTime(!0)) : t.set_float(0) + } + , + mt.prototype.Volume = function(t, e) { + pt(e, !0), + lt.length ? (e = lt[0].getVolume(), + t.set_float(N(e))) : t.set_float(0) + } + , + mt.prototype.MasterVolume = function(t) { + t.set_float(N(T)) + } + , + mt.prototype.EffectCount = function(t, e) { + e = e.toLowerCase(); + var i = null; + D.hasOwnProperty(e) && (i = D[e]), + t.set_int(i ? i.length : 0) + } + , + mt.prototype.AnalyserFreqBinCount = function(t, e, i) { + i = _t(e = e.toLowerCase(), i = Math.floor(i)); + t.set_int(i ? i.node.frequencyBinCount : 0) + } + , + mt.prototype.AnalyserFreqBinAt = function(t, e, i, s) { + e = e.toLowerCase(), + i = Math.floor(i), + s = Math.floor(s); + i = _t(e, i); + !i || s < 0 || s >= i.node.frequencyBinCount ? t.set_float(0) : t.set_float(i.freqBins[s]) + } + , + mt.prototype.AnalyserPeakLevel = function(t, e, i) { + i = _t(e = e.toLowerCase(), i = Math.floor(i)); + i ? t.set_float(i.peak) : t.set_float(0) + } + , + mt.prototype.AnalyserRMSLevel = function(t, e, i) { + i = _t(e = e.toLowerCase(), i = Math.floor(i)); + i ? t.set_float(i.rms) : t.set_float(0) + } + , + mt.prototype.SampleRate = function(t) { + t.set_int(d ? d.sampleRate : 0) + } + , + mt.prototype.CurrentTime = function(t) { + t.set_float(d ? d.currentTime : cr.performance_now()) + } + , + t.exps = new mt +}(), +cr.plugins_.Browser = function(t) { + this.runtime = t +} +, +function() { + var pluginProto = cr.plugins_.Browser.prototype; + pluginProto.Type = function(t) { + this.plugin = t, + this.runtime = t.runtime + } + ; + var typeProto = pluginProto.Type.prototype; + typeProto.onCreate = function() {} + ; + var offlineScriptReady = !1 + , browserPluginReady = !1; + document.addEventListener("DOMContentLoaded", function() { + var t; + window.C2_RegisterSW && navigator.serviceWorker && ((t = document.createElement("script")).onload = function() { + offlineScriptReady = !0, + checkReady() + } + , + t.src = "offlineClient.js", + document.head.appendChild(t)) + }); + var browserInstance = null; + function checkReady() { + offlineScriptReady && browserPluginReady && window.OfflineClientInfo && window.OfflineClientInfo.SetMessageCallback(function(t) { + browserInstance.onSWMessage(t) + }) + } + typeProto.onAppBegin = function() { + browserPluginReady = !0, + checkReady() + } + , + pluginProto.Instance = function(t) { + this.type = t, + this.runtime = t.runtime + } + ; + var instanceProto = pluginProto.Instance.prototype; + instanceProto.onCreate = function() { + var e = this; + window.addEventListener("resize", function() { + e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnResize, e) + }), + browserInstance = this, + void 0 !== navigator.onLine && (window.addEventListener("online", function() { + e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnOnline, e) + }), + window.addEventListener("offline", function() { + e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnOffline, e) + })), + this.runtime.isDirectCanvas || (document.addEventListener("appMobi.device.update.available", function() { + e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnUpdateReady, e) + }), + document.addEventListener("backbutton", function() { + e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnBackButton, e) + }), + document.addEventListener("menubutton", function() { + e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnMenuButton, e) + }), + document.addEventListener("searchbutton", function() { + e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnSearchButton, e) + }), + document.addEventListener("tizenhwkey", function(t) { + switch (t.keyName) { + case "back": + e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnBackButton, e) || window.tizen && window.tizen.application.getCurrentApplication().exit(); + break; + case "menu": + e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnMenuButton, e) || t.preventDefault() + } + })), + this.runtime.isWindows10 && "undefined" != typeof Windows ? Windows.UI.Core.SystemNavigationManager.getForCurrentView().addEventListener("backrequested", function(t) { + e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnBackButton, e) && (t.handled = !0) + }) : this.runtime.isWinJS && WinJS.Application && (WinJS.Application.onbackclick = function(t) { + return !!e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnBackButton, e) + } + ), + this.runtime.addSuspendCallback(function(t) { + t ? e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnPageHidden, e) : e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnPageVisible, e) + }), + this.is_arcade = void 0 !== window.is_scirra_arcade + } + , + instanceProto.onSWMessage = function(t) { + t = t.data.type; + "downloading-update" === t ? this.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnUpdateFound, this) : "update-ready" === t || "update-pending" === t ? this.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnUpdateReady, this) : "offline-ready" === t && this.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnOfflineReady, this) + } + ; + var batteryManager = null + , loadedBatteryManager = !1; + function maybeLoadBatteryManager() { + var t; + loadedBatteryManager || navigator.getBattery && (t = navigator.getBattery(), + loadedBatteryManager = !0, + t && t.then(function(t) { + batteryManager = t + })) + } + function Cnds() {} + function Acts() {} + Cnds.prototype.CookiesEnabled = function() { + return !!navigator && navigator.cookieEnabled + } + , + Cnds.prototype.IsOnline = function() { + return !!navigator && navigator.onLine + } + , + Cnds.prototype.HasJava = function() { + return !!navigator && navigator.javaEnabled() + } + , + Cnds.prototype.OnOnline = function() { + return !0 + } + , + Cnds.prototype.OnOffline = function() { + return !0 + } + , + Cnds.prototype.IsDownloadingUpdate = function() { + return !1 + } + , + Cnds.prototype.OnUpdateReady = function() { + return !0 + } + , + Cnds.prototype.PageVisible = function() { + return !this.runtime.isSuspended + } + , + Cnds.prototype.OnPageVisible = function() { + return !0 + } + , + Cnds.prototype.OnPageHidden = function() { + return !0 + } + , + Cnds.prototype.OnResize = function() { + return !0 + } + , + Cnds.prototype.IsFullscreen = function() { + return !!(document.mozFullScreen || document.webkitIsFullScreen || document.fullScreen || this.runtime.isNodeFullscreen) + } + , + Cnds.prototype.OnBackButton = function() { + return !0 + } + , + Cnds.prototype.OnMenuButton = function() { + return !0 + } + , + Cnds.prototype.OnSearchButton = function() { + return !0 + } + , + Cnds.prototype.IsMetered = function() { + var t = navigator.connection || navigator.mozConnection || navigator.webkitConnection; + return !!t && !!t.metered + } + , + Cnds.prototype.IsCharging = function() { + var t = navigator.battery || navigator.mozBattery || navigator.webkitBattery; + return t ? !!t.charging : (maybeLoadBatteryManager(), + !batteryManager || !!batteryManager.charging) + } + , + Cnds.prototype.IsPortraitLandscape = function(t) { + return (window.innerWidth <= window.innerHeight ? 0 : 1) === t + } + , + Cnds.prototype.SupportsFullscreen = function() { + if (this.runtime.isNodeWebkit) + return !0; + var t = this.runtime.canvasdiv || this.runtime.canvas; + return !!(t.requestFullscreen || t.mozRequestFullScreen || t.msRequestFullscreen || t.webkitRequestFullScreen) + } + , + Cnds.prototype.OnUpdateFound = function() { + return !0 + } + , + Cnds.prototype.OnUpdateReady = function() { + return !0 + } + , + Cnds.prototype.OnOfflineReady = function() { + return !0 + } + , + pluginProto.cnds = new Cnds, + Acts.prototype.Alert = function(t) { + this.runtime.isDomFree || alert(t.toString()) + } + , + Acts.prototype.Close = function() { + this.runtime.isCocoonJs ? CocoonJS.App.forceToFinish() : window.tizen ? window.tizen.application.getCurrentApplication().exit() : navigator.app && navigator.app.exitApp ? navigator.app.exitApp() : navigator.device && navigator.device.exitApp ? navigator.device.exitApp() : this.is_arcade || this.runtime.isDomFree || window.close() + } + , + Acts.prototype.Focus = function() { + this.runtime.isNodeWebkit ? window.nwgui.Window.get().focus() : this.is_arcade || this.runtime.isDomFree || window.focus() + } + , + Acts.prototype.Blur = function() { + this.runtime.isNodeWebkit ? window.nwgui.Window.get().blur() : this.is_arcade || this.runtime.isDomFree || window.blur() + } + , + Acts.prototype.GoBack = function() { + navigator.app && navigator.app.backHistory ? navigator.app.backHistory() : this.is_arcade || this.runtime.isDomFree || !window.back || window.back() + } + , + Acts.prototype.GoForward = function() { + this.is_arcade || this.runtime.isDomFree || !window.forward || window.forward() + } + , + Acts.prototype.GoHome = function() { + this.is_arcade || this.runtime.isDomFree || !window.home || window.home() + } + , + Acts.prototype.GoToURL = function(t, e) { + this.runtime.isCocoonJs ? CocoonJS.App.openURL(t) : this.runtime.isEjecta ? ejecta.openURL(t) : this.runtime.isWinJS ? Windows.System.Launcher.launchUriAsync(new Windows.Foundation.Uri(t)) : navigator.app && navigator.app.loadUrl ? navigator.app.loadUrl(t, { + openExternal: !0 + }) : this.runtime.isCordova ? window.open(t, "_system") : this.is_arcade || this.runtime.isDomFree || (2 !== e || this.is_arcade ? 1 !== e || this.is_arcade ? window.location = t : window.parent.location = t : window.top.location = t) + } + , + Acts.prototype.GoToURLWindow = function(t, e) { + this.runtime.isCocoonJs ? CocoonJS.App.openURL(t) : this.runtime.isEjecta ? ejecta.openURL(t) : this.runtime.isWinJS ? Windows.System.Launcher.launchUriAsync(new Windows.Foundation.Uri(t)) : navigator.app && navigator.app.loadUrl ? navigator.app.loadUrl(t, { + openExternal: !0 + }) : this.runtime.isCordova ? window.open(t, "_system") : this.is_arcade || this.runtime.isDomFree || window.open(t, e) + } + , + Acts.prototype.Reload = function() { + this.is_arcade || this.runtime.isDomFree || window.location.reload() + } + ; + var firstRequestFullscreen = !0 + , crruntime = null; + function onFullscreenError(t) { + console && console.warn && console.warn("Fullscreen request failed: ", t), + crruntime.setSize(window.innerWidth, window.innerHeight) + } + Acts.prototype.RequestFullScreen = function(t) { + this.runtime.isDomFree ? cr.logexport("[Construct 2] Requesting fullscreen is not supported on this platform - the request has been ignored") : (2 <= t && (t += 1), + 6 === t && (t = 2), + this.runtime.isNodeWebkit ? this.runtime.isDebug ? debuggerFullscreen(!0) : !this.runtime.isNodeFullscreen && window.nwgui && (window.nwgui.Window.get().enterFullscreen(), + this.runtime.isNodeFullscreen = !0, + this.runtime.fullscreen_scaling = 2 <= t ? t : 0) : document.mozFullScreen || document.webkitIsFullScreen || document.msFullscreenElement || document.fullScreen || document.fullScreenElement || (this.runtime.fullscreen_scaling = 2 <= t ? t : 0, + t = document.documentElement, + firstRequestFullscreen && (firstRequestFullscreen = !1, + crruntime = this.runtime, + t.addEventListener("mozfullscreenerror", onFullscreenError), + t.addEventListener("webkitfullscreenerror", onFullscreenError), + t.addEventListener("MSFullscreenError", onFullscreenError), + t.addEventListener("fullscreenerror", onFullscreenError)), + t.requestFullscreen ? t.requestFullscreen() : t.mozRequestFullScreen ? t.mozRequestFullScreen() : t.msRequestFullscreen ? t.msRequestFullscreen() : t.webkitRequestFullScreen && ("undefined" != typeof Element && void 0 !== Element.ALLOW_KEYBOARD_INPUT ? t.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT) : t.webkitRequestFullScreen()))) + } + , + Acts.prototype.CancelFullScreen = function() { + this.runtime.isDomFree ? cr.logexport("[Construct 2] Exiting fullscreen is not supported on this platform - the request has been ignored") : this.runtime.isNodeWebkit ? this.runtime.isDebug ? debuggerFullscreen(!1) : this.runtime.isNodeFullscreen && window.nwgui && (window.nwgui.Window.get().leaveFullscreen(), + this.runtime.isNodeFullscreen = !1) : document.exitFullscreen ? document.exitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.webkitCancelFullScreen && document.webkitCancelFullScreen() + } + , + Acts.prototype.Vibrate = function(t) { + try { + for (var e = t.split(","), i = 0, s = e.length; i < s; i++) + e[i] = parseInt(e[i], 10); + navigator.vibrate ? navigator.vibrate(e) : navigator.mozVibrate ? navigator.mozVibrate(e) : navigator.webkitVibrate ? navigator.webkitVibrate(e) : navigator.msVibrate && navigator.msVibrate(e) + } catch (t) {} + } + , + Acts.prototype.InvokeDownload = function(t, e) { + var i, s = document.createElement("a"); + void 0 === s.download ? window.open(t) : (i = document.getElementsByTagName("body")[0], + s.textContent = e, + s.href = t, + s.download = e, + i.appendChild(s), + e = new MouseEvent("click"), + s.dispatchEvent(e), + i.removeChild(s)) + } + , + Acts.prototype.InvokeDownloadString = function(t, e, i) { + var s = "data:" + e + "," + encodeURIComponent(t) + , e = document.createElement("a"); + void 0 === e.download ? window.open(s) : (t = document.getElementsByTagName("body")[0], + e.textContent = i, + e.href = s, + e.download = i, + t.appendChild(e), + i = new MouseEvent("click"), + e.dispatchEvent(i), + t.removeChild(e)) + } + , + Acts.prototype.ConsoleLog = function(t, e) { + "undefined" != typeof console && (0 === t && console.log && console.log(e.toString()), + 1 === t && console.warn && console.warn(e.toString()), + 2 === t && console.error && console.error(e.toString())) + } + , + Acts.prototype.ConsoleGroup = function(t) { + console && console.group && console.group(t) + } + , + Acts.prototype.ConsoleGroupEnd = function() { + console && console.groupEnd && console.groupEnd() + } + , + Acts.prototype.ExecJs = function(js_) { + try { + eval && eval(js_) + } catch (e) { + console && console.error && console.error("Error executing Javascript: ", e) + } + } + ; + var orientations = ["portrait", "landscape", "portrait-primary", "portrait-secondary", "landscape-primary", "landscape-secondary"]; + function Exps() {} + Acts.prototype.LockOrientation = function(t) { + (t = Math.floor(t)) < 0 || t >= orientations.length || (this.runtime.autoLockOrientation = !1, + t = orientations[t], + screen.orientation && screen.orientation.lock ? screen.orientation.lock(t) : screen.lockOrientation ? screen.lockOrientation(t) : screen.webkitLockOrientation ? screen.webkitLockOrientation(t) : screen.mozLockOrientation ? screen.mozLockOrientation(t) : screen.msLockOrientation && screen.msLockOrientation(t)) + } + , + Acts.prototype.UnlockOrientation = function() { + this.runtime.autoLockOrientation = !1, + screen.orientation && screen.orientation.unlock ? screen.orientation.unlock() : screen.unlockOrientation ? screen.unlockOrientation() : screen.webkitUnlockOrientation ? screen.webkitUnlockOrientation() : screen.mozUnlockOrientation ? screen.mozUnlockOrientation() : screen.msUnlockOrientation && screen.msUnlockOrientation() + } + , + pluginProto.acts = new Acts, + Exps.prototype.URL = function(t) { + t.set_string(this.runtime.isDomFree ? "" : window.location.toString()) + } + , + Exps.prototype.Protocol = function(t) { + t.set_string(this.runtime.isDomFree ? "" : window.location.protocol) + } + , + Exps.prototype.Domain = function(t) { + t.set_string(this.runtime.isDomFree ? "" : window.location.hostname) + } + , + Exps.prototype.PathName = function(t) { + t.set_string(this.runtime.isDomFree ? "" : window.location.pathname) + } + , + Exps.prototype.Hash = function(t) { + t.set_string(this.runtime.isDomFree ? "" : window.location.hash) + } + , + Exps.prototype.Referrer = function(t) { + t.set_string(this.runtime.isDomFree ? "" : document.referrer) + } + , + Exps.prototype.Title = function(t) { + t.set_string(this.runtime.isDomFree ? "" : document.title) + } + , + Exps.prototype.Name = function(t) { + t.set_string(this.runtime.isDomFree ? "" : navigator.appName) + } + , + Exps.prototype.Version = function(t) { + t.set_string(this.runtime.isDomFree ? "" : navigator.appVersion) + } + , + Exps.prototype.Language = function(t) { + navigator && navigator.language ? t.set_string(navigator.language) : t.set_string("") + } + , + Exps.prototype.Platform = function(t) { + t.set_string(this.runtime.isDomFree ? "" : navigator.platform) + } + , + Exps.prototype.Product = function(t) { + navigator && navigator.product ? t.set_string(navigator.product) : t.set_string("") + } + , + Exps.prototype.Vendor = function(t) { + navigator && navigator.vendor ? t.set_string(navigator.vendor) : t.set_string("") + } + , + Exps.prototype.UserAgent = function(t) { + t.set_string(this.runtime.isDomFree ? "" : navigator.userAgent) + } + , + Exps.prototype.QueryString = function(t) { + t.set_string(this.runtime.isDomFree ? "" : window.location.search) + } + , + Exps.prototype.QueryParam = function(t, e) { + !this.runtime.isDomFree && (e = RegExp("[?&]" + e + "=([^&]*)").exec(window.location.search)) ? t.set_string(decodeURIComponent(e[1].replace(/\+/g, " "))) : t.set_string("") + } + , + Exps.prototype.Bandwidth = function(t) { + var e = navigator.connection || navigator.mozConnection || navigator.webkitConnection; + e ? void 0 !== e.bandwidth ? t.set_float(e.bandwidth) : void 0 !== e.downlinkMax ? t.set_float(e.downlinkMax) : t.set_float(Number.POSITIVE_INFINITY) : t.set_float(Number.POSITIVE_INFINITY) + } + , + Exps.prototype.ConnectionType = function(t) { + var e = navigator.connection || navigator.mozConnection || navigator.webkitConnection; + e ? t.set_string(e.type || "unknown") : t.set_string("unknown") + } + , + Exps.prototype.BatteryLevel = function(t) { + var e = navigator.battery || navigator.mozBattery || navigator.webkitBattery; + e ? t.set_float(e.level) : (maybeLoadBatteryManager(), + batteryManager ? t.set_float(batteryManager.level) : t.set_float(1)) + } + , + Exps.prototype.BatteryTimeLeft = function(t) { + var e = navigator.battery || navigator.mozBattery || navigator.webkitBattery; + e ? t.set_float(e.dischargingTime) : (maybeLoadBatteryManager(), + batteryManager ? t.set_float(batteryManager.dischargingTime) : t.set_float(Number.POSITIVE_INFINITY)) + } + , + Exps.prototype.ExecJS = function(ret, js_) { + if (eval) { + var result = 0; + try { + result = eval(js_) + } catch (e) { + console && console.error && console.error("Error executing Javascript: ", e) + } + "number" == typeof result || "string" == typeof result ? ret.set_any(result) : "boolean" == typeof result ? ret.set_any(result ? 1 : 0) : ret.set_any(0) + } else + ret.set_any(0) + } + , + Exps.prototype.ScreenWidth = function(t) { + t.set_int(screen.width) + } + , + Exps.prototype.ScreenHeight = function(t) { + t.set_int(screen.height) + } + , + Exps.prototype.DevicePixelRatio = function(t) { + t.set_float(this.runtime.devicePixelRatio) + } + , + Exps.prototype.WindowInnerWidth = function(t) { + t.set_int(window.innerWidth) + } + , + Exps.prototype.WindowInnerHeight = function(t) { + t.set_int(window.innerHeight) + } + , + Exps.prototype.WindowOuterWidth = function(t) { + t.set_int(window.outerWidth) + } + , + Exps.prototype.WindowOuterHeight = function(t) { + t.set_int(window.outerHeight) + } + , + pluginProto.exps = new Exps +}(), +cr.plugins_.Function = function(t) { + this.runtime = t +} +, +function() { + var t = cr.plugins_.Function.prototype; + t.Type = function(t) { + this.plugin = t, + this.runtime = t.runtime + } + , + t.Type.prototype.onCreate = function() {} + , + t.Instance = function(t) { + this.type = t, + this.runtime = t.runtime + } + ; + var e = t.Instance.prototype + , i = [] + , s = -1; + function n() { + this.name = "", + this.retVal = 0, + this.params = [] + } + function a() { + return ++s === i.length && i.push(new n), + i[s] + } + function r() { + return s < 0 ? null : i[s] + } + function h() { + s-- + } + function o() {} + function c() {} + function l() {} + e.onCreate = function() { + 0; + var o = this; + window.c2_callFunction = function(t, e) { + var i, s, n, r = a(); + if (r.name = t.toLowerCase(), + r.retVal = 0, + e) + for (r.params.length = e.length, + i = 0, + s = e.length; i < s; ++i) + n = e[i], + r.params[i] = "number" == typeof n || "string" == typeof n ? n : "boolean" == typeof n && n ? 1 : 0; + else + cr.clearArray(r.params); + return o.runtime.trigger(cr.plugins_.Function.prototype.cnds.OnFunction, o, r.name), + h(), + r.retVal + } + } + , + o.prototype.OnFunction = function(t) { + var e = r(); + return !!e && cr.equals_nocase(t, e.name) + } + , + o.prototype.CompareParam = function(t, e, i) { + var s = r(); + return !!s && (!((t = cr.floor(t)) < 0 || t >= s.params.length) && cr.do_cmp(s.params[t], e, i)) + } + , + t.cnds = new o, + c.prototype.CallFunction = function(t, e) { + var i = a(); + i.name = t.toLowerCase(), + i.retVal = 0, + cr.shallowAssignArray(i.params, e); + this.runtime.trigger(cr.plugins_.Function.prototype.cnds.OnFunction, this, i.name); + h() + } + , + c.prototype.SetReturnValue = function(t) { + var e = r(); + e && (e.retVal = t) + } + , + c.prototype.CallExpression = function(t) {} + , + t.acts = new c, + l.prototype.ReturnValue = function(t) { + var e = function() { + if (!i.length) + return null; + var t = s + 1; + return t >= i.length && (t = i.length - 1), + i[t] + }(); + e ? t.set_any(e.retVal) : t.set_int(0) + } + , + l.prototype.ParamCount = function(t) { + var e = r(); + e ? t.set_int(e.params.length) : t.set_int(0) + } + , + l.prototype.Param = function(t, e) { + e = cr.floor(e); + var i = r(); + i && 0 <= e && e < i.params.length ? t.set_any(i.params[e]) : t.set_int(0) + } + , + l.prototype.Call = function(t, e) { + var i, s, n = a(); + for (n.name = e.toLowerCase(), + n.retVal = 0, + cr.clearArray(n.params), + i = 2, + s = arguments.length; i < s; i++) + n.params.push(arguments[i]); + this.runtime.trigger(cr.plugins_.Function.prototype.cnds.OnFunction, this, n.name); + h(), + t.set_any(n.retVal) + } + , + t.exps = new l +}(), +cr.plugins_.Keyboard = function(t) { + this.runtime = t +} +, +function() { + var t = cr.plugins_.Keyboard.prototype; + t.Type = function(t) { + this.plugin = t, + this.runtime = t.runtime + } + , + t.Type.prototype.onCreate = function() {} + , + t.Instance = function(t) { + this.type = t, + this.runtime = t.runtime, + this.keyMap = new Array(256), + this.usedKeys = new Array(256), + this.triggerKey = 0 + } + ; + var e = t.Instance.prototype; + e.onCreate = function() { + var e = this; + this.runtime.isDomFree || (jQuery(document).keydown(function(t) { + e.onKeyDown(t) + }), + jQuery(document).keyup(function(t) { + e.onKeyUp(t) + })) + } + ; + var n = [32, 33, 34, 35, 36, 37, 38, 39, 40, 44]; + function i() {} + function s() {} + e.onKeyDown = function(t) { + var e, i, s = !1; + window != window.top && -1 < n.indexOf(t.which) && (t.preventDefault(), + s = !0, + t.stopPropagation()), + this.keyMap[t.which] ? this.usedKeys[t.which] && !s && t.preventDefault() : (this.keyMap[t.which] = !0, + this.triggerKey = t.which, + this.runtime.isInUserInputEvent = !0, + this.runtime.trigger(cr.plugins_.Keyboard.prototype.cnds.OnAnyKey, this), + e = this.runtime.trigger(cr.plugins_.Keyboard.prototype.cnds.OnKey, this), + i = this.runtime.trigger(cr.plugins_.Keyboard.prototype.cnds.OnKeyCode, this), + this.runtime.isInUserInputEvent = !1, + (e || i) && (this.usedKeys[t.which] = !0, + s || t.preventDefault())) + } + , + e.onKeyUp = function(t) { + this.keyMap[t.which] = !1, + this.triggerKey = t.which, + this.runtime.isInUserInputEvent = !0, + this.runtime.trigger(cr.plugins_.Keyboard.prototype.cnds.OnAnyKeyReleased, this); + var e = this.runtime.trigger(cr.plugins_.Keyboard.prototype.cnds.OnKeyReleased, this) + , i = this.runtime.trigger(cr.plugins_.Keyboard.prototype.cnds.OnKeyCodeReleased, this); + this.runtime.isInUserInputEvent = !1, + (e || i || this.usedKeys[t.which]) && (this.usedKeys[t.which] = !0, + t.preventDefault()) + } + , + e.onWindowBlur = function() { + for (var t, e, i = 0; i < 256; ++i) + this.keyMap[i] && (this.keyMap[i] = !1, + this.triggerKey = i, + this.runtime.trigger(cr.plugins_.Keyboard.prototype.cnds.OnAnyKeyReleased, this), + t = this.runtime.trigger(cr.plugins_.Keyboard.prototype.cnds.OnKeyReleased, this), + e = this.runtime.trigger(cr.plugins_.Keyboard.prototype.cnds.OnKeyCodeReleased, this), + (t || e) && (this.usedKeys[i] = !0)) + } + , + e.saveToJSON = function() { + return { + triggerKey: this.triggerKey + } + } + , + e.loadFromJSON = function(t) { + this.triggerKey = t.triggerKey + } + , + i.prototype.IsKeyDown = function(t) { + return this.keyMap[t] + } + , + i.prototype.OnKey = function(t) { + return t === this.triggerKey + } + , + i.prototype.OnAnyKey = function(t) { + return !0 + } + , + i.prototype.OnAnyKeyReleased = function(t) { + return !0 + } + , + i.prototype.OnKeyReleased = function(t) { + return t === this.triggerKey + } + , + i.prototype.IsKeyCodeDown = function(t) { + return !((t = Math.floor(t)) < 0 || t >= this.keyMap.length) && this.keyMap[t] + } + , + i.prototype.OnKeyCode = function(t) { + return t === this.triggerKey + } + , + i.prototype.OnKeyCodeReleased = function(t) { + return t === this.triggerKey + } + , + t.cnds = new i, + t.acts = new function() {} + , + s.prototype.LastKeyCode = function(t) { + t.set_int(this.triggerKey) + } + , + s.prototype.StringFromKeyCode = function(t, e) { + t.set_string(function(t) { + switch (t = Math.floor(t)) { + case 8: + return "backspace"; + case 9: + return "tab"; + case 13: + return "enter"; + case 16: + return "shift"; + case 17: + return "control"; + case 18: + return "alt"; + case 19: + return "pause"; + case 20: + return "capslock"; + case 27: + return "esc"; + case 33: + return "pageup"; + case 34: + return "pagedown"; + case 35: + return "end"; + case 36: + return "home"; + case 37: + return "←"; + case 38: + return "↑"; + case 39: + return "→"; + case 40: + return "↓"; + case 45: + return "insert"; + case 46: + return "del"; + case 91: + return "left window key"; + case 92: + return "right window key"; + case 93: + return "select"; + case 96: + return "numpad 0"; + case 97: + return "numpad 1"; + case 98: + return "numpad 2"; + case 99: + return "numpad 3"; + case 100: + return "numpad 4"; + case 101: + return "numpad 5"; + case 102: + return "numpad 6"; + case 103: + return "numpad 7"; + case 104: + return "numpad 8"; + case 105: + return "numpad 9"; + case 106: + return "numpad *"; + case 107: + return "numpad +"; + case 109: + return "numpad -"; + case 110: + return "numpad ."; + case 111: + return "numpad /"; + case 112: + return "F1"; + case 113: + return "F2"; + case 114: + return "F3"; + case 115: + return "F4"; + case 116: + return "F5"; + case 117: + return "F6"; + case 118: + return "F7"; + case 119: + return "F8"; + case 120: + return "F9"; + case 121: + return "F10"; + case 122: + return "F11"; + case 123: + return "F12"; + case 144: + return "numlock"; + case 145: + return "scroll lock"; + case 186: + return ";"; + case 187: + return "="; + case 188: + return ","; + case 189: + return "-"; + case 190: + return "."; + case 191: + return "/"; + case 192: + return "'"; + case 219: + return "["; + case 220: + return "\\"; + case 221: + return "]"; + case 222: + return "#"; + case 223: + return "`"; + default: + return String.fromCharCode(t) + } + }(e)) + } + , + t.exps = new s +}(); +var localForageInitFailed = !1; +try { + !function() { + var t, a, h, c, l; + c = {}, + l = {}, + h = a = function(o) { + if (h._eak_seen = c, + l[o]) + return l[o]; + if (l[o] = {}, + !c[o]) + throw new Error("Could not find module " + o); + for (var t, e = c[o], i = e.deps, e = e.callback, s = [], n = 0, r = i.length; n < r; n++) + "exports" === i[n] ? s.push(t = {}) : s.push(a(function(t) { + if ("." !== t.charAt(0)) + return t; + for (var e = t.split("/"), i = o.split("/").slice(0, -1), s = 0, n = e.length; s < n; s++) { + var r = e[s]; + ".." === r ? i.pop() : "." !== r && i.push(r) + } + return i.join("/") + }(i[n]))); + e = e.apply(this, s); + return l[o] = t || e + } + , + (t = function(t, e, i) { + c[t] = { + deps: e, + callback: i + } + } + )("promise/all", ["./utils", "exports"], function(t, e) { + "use strict"; + var i = t.isArray + , h = t.isFunction; + e.all = function(a) { + if (!i(a)) + throw new TypeError("You must pass an array to all."); + return new this(function(i, t) { + function s(t, e) { + n[t] = e, + 0 == --r && i(n) + } + var e, n = [], r = a.length; + 0 === r && i([]); + for (var o = 0; o < a.length; o++) + (e = a[o]) && h(e.then) ? e.then(function(e) { + return function(t) { + s(e, t) + } + }(o), t) : s(o, e) + } + ) + } + }), + t("promise/asap", ["exports"], function(t) { + "use strict"; + function e() { + for (var t = 0; t < h.length; t++) { + var e = h[t]; + (0, + e[0])(e[1]) + } + h = [] + } + var i, s, n, r = "undefined" != typeof window ? window : {}, o = r.MutationObserver || r.WebKitMutationObserver, a = "undefined" != typeof global ? global : void 0 === this ? window : this, h = [], c = "undefined" != typeof process && "[object process]" === {}.toString.call(process) ? function() { + process.nextTick(e) + } + : o ? (i = 0, + s = new o(e), + n = document.createTextNode(""), + s.observe(n, { + characterData: !0 + }), + function() { + n.data = i = ++i % 2 + } + ) : function() { + a.setTimeout(e, 1) + } + ; + t.asap = function(t, e) { + 1 === h.push([t, e]) && c() + } + }), + t("promise/config", ["exports"], function(t) { + "use strict"; + var i = { + instrument: !1 + }; + t.config = i, + t.configure = function(t, e) { + return 2 !== arguments.length ? i[t] : void (i[t] = e) + } + }), + t("promise/polyfill", ["./promise", "./utils", "exports"], function(t, e, i) { + "use strict"; + var s = t.Promise + , n = e.isFunction; + i.polyfill = function() { + var e, t = "undefined" != typeof global ? global : "undefined" != typeof window && window.document ? window : self; + "Promise"in t && "resolve"in t.Promise && "reject"in t.Promise && "all"in t.Promise && "race"in t.Promise && (new t.Promise(function(t) { + e = t + } + ), + n(e)) || (t.Promise = s) + } + }), + t("promise/promise", ["./config", "./utils", "./all", "./race", "./resolve", "./reject", "./asap", "exports"], function(t, e, i, s, n, r, o, a) { + "use strict"; + function h(t) { + if (!v(t)) + throw new TypeError("You must pass a resolver function as the first argument to the promise constructor"); + if (!(this instanceof h)) + throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); + this._subscribers = [], + function(t, e) { + function i(t) { + f(e, t) + } + try { + t(function(t) { + p(e, t) + }, i) + } catch (t) { + i(t) + } + }(t, this) + } + function c(t, e, i, s) { + var n, r, o, a, h = v(i); + if (h) + try { + n = i(s), + o = !0 + } catch (t) { + a = !0, + r = t + } + else + n = s, + o = !0; + u(e, n) || (h && o ? p(e, n) : a ? f(e, r) : t === x ? p(e, n) : t === S && f(e, n)) + } + function l(t, e) { + for (var i = t._subscribers, s = t._detail, n = 0; n < i.length; n += 3) + c(e, i[n], i[n + e], s); + t._subscribers = null + } + function u(e, i) { + var s, t = null; + try { + if (e === i) + throw new TypeError("A promises callback cannot return that same promise."); + if (_(i) && (t = i.then, + v(t))) + return t.call(i, function(t) { + return !!s || (s = !0, + void (i !== t ? p : d)(e, t)) + }, function(t) { + return !!s || (s = !0, + void f(e, t)) + }), + 1 + } catch (t) { + return s || f(e, t), + 1 + } + } + function p(t, e) { + t !== e && u(t, e) || d(t, e) + } + function d(t, e) { + t._state === b && (t._state = w, + t._detail = e, + m.async(y, t)) + } + function f(t, e) { + t._state === b && (t._state = w, + t._detail = e, + m.async(g, t)) + } + function y(t) { + l(t, t._state = x) + } + function g(t) { + l(t, t._state = S) + } + var m = t.config + , _ = (t.configure, + e.objectOrFunction) + , v = e.isFunction + , i = (e.now, + i.all) + , s = s.race + , n = n.resolve + , r = r.reject + , o = o.asap; + m.async = o; + var b = void 0 + , w = 0 + , x = 1 + , S = 2; + h.prototype = { + constructor: h, + _state: void 0, + _detail: void 0, + _subscribers: void 0, + then: function(t, e) { + var i, s, n, r, o = this, a = new this.constructor(function() {} + ); + return this._state ? (i = arguments, + m.async(function() { + c(o._state, a, i[o._state - 1], o._detail) + })) : (s = a, + n = t, + r = e, + t = (e = (t = this)._subscribers).length, + e[t] = s, + e[t + x] = n, + e[t + S] = r), + a + }, + catch: function(t) { + return this.then(null, t) + } + }, + h.all = i, + h.race = s, + h.resolve = n, + h.reject = r, + a.Promise = h + }), + t("promise/race", ["./utils", "exports"], function(t, e) { + "use strict"; + var i = t.isArray; + e.race = function(n) { + if (!i(n)) + throw new TypeError("You must pass an array to race."); + return new this(function(t, e) { + for (var i, s = 0; s < n.length; s++) + (i = n[s]) && "function" == typeof i.then ? i.then(t, e) : t(i) + } + ) + } + }), + t("promise/reject", ["exports"], function(t) { + "use strict"; + t.reject = function(i) { + return new this(function(t, e) { + e(i) + } + ) + } + }), + t("promise/resolve", ["exports"], function(t) { + "use strict"; + t.resolve = function(e) { + return e && "object" == typeof e && e.constructor === this ? e : new this(function(t) { + t(e) + } + ) + } + }), + t("promise/utils", ["exports"], function(t) { + "use strict"; + function e(t) { + return "function" == typeof t + } + var i = Date.now || function() { + return (new Date).getTime() + } + ; + t.objectOrFunction = function(t) { + return e(t) || "object" == typeof t && null !== t + } + , + t.isFunction = e, + t.isArray = function(t) { + return "[object Array]" === Object.prototype.toString.call(t) + } + , + t.now = i + }), + a("promise/polyfill").polyfill() + }(), + function(t, e) { + "object" == typeof exports && "object" == typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? exports.localforage = e() : t.localforage = e() + }(this, function() { + return n = {}, + i.m = s = [function(t, e, r) { + "use strict"; + e.__esModule = !0; + var i, s, c, n, o, l, a, u, h, i = (i = "undefined" != typeof window ? window : self, + c = {}, + o = [(n = { + INDEXEDDB: "asyncStorage", + LOCALSTORAGE: "localStorageWrapper", + WEBSQL: "webSQLStorage" + }).INDEXEDDB, n.WEBSQL, n.LOCALSTORAGE], + l = ["clear", "getItem", "iterate", "key", "keys", "length", "removeItem", "setItem"], + a = { + description: "", + driver: o.slice(), + name: "localforage", + size: 4980736, + storeName: "keyvaluepairs", + version: 1 + }, + s = i, + (i = {})[n.INDEXEDDB] = !!function() { + try { + var t = s.indexedDB || s.webkitIndexedDB || s.mozIndexedDB || s.OIndexedDB || s.msIndexedDB; + return (!(void 0 !== s.openDatabase && s.navigator && s.navigator.userAgent && /Safari/.test(s.navigator.userAgent)) || /Chrome/.test(s.navigator.userAgent)) && (t && "function" == typeof t.open && void 0 !== s.IDBKeyRange) + } catch (t) { + return + } + }(), + i[n.WEBSQL] = !!function() { + try { + return s.openDatabase + } catch (t) { + return + } + }(), + i[n.LOCALSTORAGE] = !!function() { + try { + return s.localStorage && "setItem"in s.localStorage && s.localStorage.setItem + } catch (t) { + return + } + }(), + u = i, + h = Array.isArray || function(t) { + return "[object Array]" === Object.prototype.toString.call(t) + } + , + new (f.prototype.config = function(t) { + if ("object" != typeof t) + return "string" == typeof t ? this._config[t] : this._config; + if (this._ready) + return new Error("Can't call config() after localforage has been used."); + for (var e in t) + "storeName" === e && (t[e] = t[e].replace(/\W/g, "_")), + this._config[e] = t[e]; + return "driver"in t && t.driver && this.setDriver(this._config.driver), + !0 + } + , + f.prototype.defineDriver = function(h, t, e) { + var i = new Promise(function(e, i) { + try { + var s = h._driver + , t = new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver") + , n = new Error("Custom driver name already in use: " + h._driver); + if (!h._driver) + return void i(t); + if (d(h._driver)) + return void i(n); + for (var r = l.concat("_initStorage"), o = 0; o < r.length; o++) { + var a = r[o]; + if (!a || !h[a] || "function" != typeof h[a]) + return void i(t) + } + n = Promise.resolve(!0); + "_support"in h && (n = h._support && "function" == typeof h._support ? h._support() : Promise.resolve(!!h._support)), + n.then(function(t) { + u[s] = t, + c[s] = h, + e() + }, i) + } catch (t) { + i(t) + } + } + ); + return i.then(t, e), + i + } + , + f.prototype.driver = function() { + return this._driver || null + } + , + f.prototype.getDriver = function(t, e, i) { + var s = this + , n = function() { + if (d(t)) + switch (t) { + case s.INDEXEDDB: + return new Promise(function(t, e) { + t(r(1)) + } + ); + case s.LOCALSTORAGE: + return new Promise(function(t, e) { + t(r(2)) + } + ); + case s.WEBSQL: + return new Promise(function(t, e) { + t(r(4)) + } + ) + } + else if (c[t]) + return Promise.resolve(c[t]); + return Promise.reject(new Error("Driver not found.")) + }(); + return n.then(e, i), + n + } + , + f.prototype.getSerializer = function(e) { + var t = new Promise(function(t, e) { + t(r(3)) + } + ); + return e && "function" == typeof e && t.then(function(t) { + e(t) + }), + t + } + , + f.prototype.ready = function(t) { + var e = this + , i = e._driverSet.then(function() { + return null === e._ready && (e._ready = e._initDriver()), + e._ready + }); + return i.then(t, t), + i + } + , + f.prototype.setDriver = function(t, e, i) { + function r() { + o._config.driver = o.driver() + } + function s(n) { + return function() { + var s = 0; + return function t() { + for (; s < n.length; ) { + var e = n[s]; + return s++, + o._dbInfo = null, + o._ready = null, + o.getDriver(e).then(function(t) { + return o._extend(t), + r(), + o._ready = o._initStorage(o._config), + o._ready + }).catch(t) + } + r(); + var i = new Error("No available storage method found."); + return o._driverSet = Promise.reject(i), + o._driverSet + }() + } + } + var o = this; + h(t) || (t = [t]); + var n = this._getSupportedDrivers(t) + , t = null !== this._driverSet ? this._driverSet.catch(function() { + return Promise.resolve() + }) : Promise.resolve(); + return this._driverSet = t.then(function() { + var t = n[0]; + return o._dbInfo = null, + o._ready = null, + o.getDriver(t).then(function(t) { + o._driver = t._driver, + r(), + o._wrapLibraryMethodsWithReady(), + o._initDriver = s(n) + }) + }).catch(function() { + r(); + var t = new Error("No available storage method found."); + return o._driverSet = Promise.reject(t), + o._driverSet + }), + this._driverSet.then(e, i), + this._driverSet + } + , + f.prototype.supports = function(t) { + return !!u[t] + } + , + f.prototype._extend = function(t) { + p(this, t) + } + , + f.prototype._getSupportedDrivers = function(t) { + for (var e = [], i = 0, s = t.length; i < s; i++) { + var n = t[i]; + this.supports(n) && e.push(n) + } + return e + } + , + f.prototype._wrapLibraryMethodsWithReady = function() { + for (var t = 0; t < l.length; t++) + !function(e, i) { + e[i] = function() { + var t = arguments; + return e.ready().then(function() { + return e[i].apply(e, t) + }) + } + }(this, l[t]) + } + , + f.prototype.createInstance = function(t) { + return new f(t) + } + , + f)); + function p(t) { + for (var e = 1; e < arguments.length; e++) { + var i = arguments[e]; + if (i) + for (var s in i) + i.hasOwnProperty(s) && (h(i[s]) ? t[s] = i[s].slice() : t[s] = i[s]) + } + return t + } + function d(t) { + for (var e in n) + if (n.hasOwnProperty(e) && n[e] === t) + return 1 + } + function f(t) { + (function(t) { + if (!(t instanceof f)) + throw new TypeError("Cannot call a class as a function") + } + )(this), + this.INDEXEDDB = n.INDEXEDDB, + this.LOCALSTORAGE = n.LOCALSTORAGE, + this.WEBSQL = n.WEBSQL, + this._defaultConfig = p({}, a), + this._config = p({}, this._defaultConfig, t), + this._driverSet = null, + this._initDriver = null, + this._ready = !1, + this._dbInfo = null, + this._wrapLibraryMethodsWithReady(), + this.setDriver(this._config.driver) + } + e.default = i, + t.exports = e.default + } + , function(t, e) { + "use strict"; + e.__esModule = !0; + var i = function(l) { + function r(e, i) { + e = e || [], + i = i || {}; + try { + return new Blob(e,i) + } catch (t) { + if ("TypeError" !== t.name) + throw t; + for (var s = new (l.BlobBuilder || l.MSBlobBuilder || l.MozBlobBuilder || l.WebKitBlobBuilder), n = 0; n < e.length; n += 1) + s.append(e[n]); + return s.getBlob(i.type) + } + } + function h(n) { + return new Promise(function(i, e) { + var t = r([""], { + type: "image/png" + }) + , s = n.transaction([m], "readwrite"); + s.objectStore(m).put(t, "key"), + s.oncomplete = function() { + var t = n.transaction([m], "readwrite").objectStore(m).get("key"); + t.onerror = e, + t.onsuccess = function(t) { + var s, t = t.target.result, e = URL.createObjectURL(t); + s = e, + new Promise(function(t, e) { + var i = new XMLHttpRequest; + i.open("GET", s), + i.withCredentials = !0, + i.responseType = "arraybuffer", + i.onreadystatechange = function() { + return 4 === i.readyState ? 200 === i.status ? t({ + response: i.response, + type: i.getResponseHeader("Content-Type") + }) : void e({ + status: i.status, + response: i.response + }) : void 0 + } + , + i.send() + } + ).then(function(t) { + i(!(!t || "image/png" !== t.type)) + }, function() { + i(!1) + }).then(function() { + URL.revokeObjectURL(e) + }) + } + } + , + s.onerror = s.onabort = e + } + ).catch(function() { + return !1 + }) + } + function a(t) { + return r([function(t) { + for (var e = t.length, i = new ArrayBuffer(e), s = new Uint8Array(i), n = 0; n < e; n++) + s[n] = t.charCodeAt(n); + return i + }(atob(t.data))], { + type: t.type + }) + } + function c(t) { + return t && t.__local_forage_encoded_blob + } + function u(t) { + var e = this + , i = e._initReady().then(function() { + var t = g[e._dbInfo.name]; + return t && t.dbReady ? t.dbReady : void 0 + }); + return i.then(t, t), + i + } + function p(r, o) { + return new Promise(function(e, t) { + if (r.db) { + if (!o) + return e(r.db); + s = g[(s = r).name], + (i = {}).promise = new Promise(function(t) { + i.resolve = t + } + ), + s.deferredOperations.push(i), + s.dbReady ? s.dbReady = s.dbReady.then(function() { + return i.promise + }) : s.dbReady = i.promise, + r.db.close() + } + var i, s = [r.name]; + o && s.push(r.version); + var n = f.open.apply(f, s); + o && (n.onupgradeneeded = function(e) { + var t = n.result; + try { + t.createObjectStore(r.storeName), + e.oldVersion <= 1 && t.createObjectStore(m) + } catch (t) { + if ("ConstraintError" !== t.name) + throw t; + l.console.warn('The database "' + r.name + '" has been upgraded from version ' + e.oldVersion + " to version " + e.newVersion + ', but the storage "' + r.storeName + '" already exists.') + } + } + ), + n.onerror = function() { + t(n.error) + } + , + n.onsuccess = function() { + var t; + e(n.result), + (t = g[(t = r).name].deferredOperations.pop()) && t.resolve() + } + } + ) + } + function d(t, e) { + e && t.then(function(t) { + e(null, t) + }, function(t) { + e(t) + }) + } + var f = f || l.indexedDB || l.webkitIndexedDB || l.mozIndexedDB || l.OIndexedDB || l.msIndexedDB; + if (f) { + var y, g, m = "local-forage-detect-blob-support"; + return { + _driver: "asyncStorage", + _initStorage: function(t) { + function e() { + return Promise.resolve() + } + var s = this + , n = { + db: null + }; + if (t) + for (var i in t) + n[i] = t[i]; + var r = (g = g || {})[n.name]; + r || (r = { + forages: [], + db: null, + dbReady: null, + deferredOperations: [] + }, + g[n.name] = r), + r.forages.push(s), + s._initReady || (s._initReady = s.ready, + s.ready = u); + for (var o = [], a = 0; a < r.forages.length; a++) { + var h = r.forages[a]; + h !== s && o.push(h._initReady().catch(e)) + } + var c = r.forages.slice(0); + return Promise.all(o).then(function() { + return n.db = r.db, + p(n, !1) + }).then(function(t) { + return n.db = t, + function(t, e) { + if (!t.db) + return !0; + var i = !t.db.objectStoreNames.contains(t.storeName) + , s = t.version < t.db.version + , n = t.version > t.db.version; + if (s && (t.version !== e && l.console.warn('The database "' + t.name + "\" can't be downgraded from version " + t.db.version + " to version " + t.version + "."), + t.version = t.db.version), + n || i) + return !i || (i = t.db.version + 1) > t.version && (t.version = i), + !0; + return !1 + }(n, s._defaultConfig.version) ? p(n, !0) : t + }).then(function(t) { + n.db = r.db = t, + s._dbInfo = n; + for (var e = 0; e < c.length; e++) { + var i = c[e]; + i !== s && (i._dbInfo.db = n.db, + i._dbInfo.version = n.version) + } + }) + }, + iterate: function(r, t) { + var o = this + , e = new Promise(function(n, e) { + o.ready().then(function() { + var t = o._dbInfo + , i = t.db.transaction(t.storeName, "readonly").objectStore(t.storeName).openCursor() + , s = 1; + i.onsuccess = function() { + var t, e = i.result; + e ? (c(t = e.value) && (t = a(t)), + void 0 !== (t = r(t, e.key, s++)) ? n(t) : e.continue()) : n() + } + , + i.onerror = function() { + e(i.error) + } + }).catch(e) + } + ); + return d(e, t), + e + }, + getItem: function(n, t) { + var r = this; + "string" != typeof n && (l.console.warn(n + " used as a key, but it is not a string."), + n = String(n)); + var e = new Promise(function(i, s) { + r.ready().then(function() { + var t = r._dbInfo + , e = t.db.transaction(t.storeName, "readonly").objectStore(t.storeName).get(n); + e.onsuccess = function() { + var t = e.result; + void 0 === t && (t = null), + c(t) && (t = a(t)), + i(t) + } + , + e.onerror = function() { + s(e.error) + } + }).catch(s) + } + ); + return d(e, t), + e + }, + setItem: function(a, e, t) { + var i = this; + "string" != typeof a && (l.console.warn(a + " used as a key, but it is not a string."), + a = String(a)); + var s = new Promise(function(n, r) { + var o; + i.ready().then(function() { + return o = i._dbInfo, + e instanceof Blob ? (t = o.db, + ("boolean" == typeof y ? Promise.resolve(y) : h(t).then(function(t) { + return y = t + })).then(function(t) { + return t ? e : (s = e, + new Promise(function(e, t) { + var i = new FileReader; + i.onerror = t, + i.onloadend = function(t) { + t = btoa(t.target.result || ""); + e({ + __local_forage_encoded_blob: !0, + data: t, + type: s.type + }) + } + , + i.readAsBinaryString(s) + } + )); + var s + })) : e; + var t + }).then(function(t) { + var e = o.db.transaction(o.storeName, "readwrite") + , i = e.objectStore(o.storeName); + null === t && (t = void 0), + e.oncomplete = function() { + void 0 === t && (t = null), + n(t) + } + , + e.onabort = e.onerror = function() { + var t = s.error || s.transaction.error; + r(t) + } + ; + var s = i.put(t, a) + }).catch(r) + } + ); + return d(s, t), + s + }, + removeItem: function(r, t) { + var o = this; + "string" != typeof r && (l.console.warn(r + " used as a key, but it is not a string."), + r = String(r)); + var e = new Promise(function(s, n) { + o.ready().then(function() { + var t = o._dbInfo + , e = t.db.transaction(t.storeName, "readwrite") + , i = e.objectStore(t.storeName).delete(r); + e.oncomplete = function() { + s() + } + , + e.onerror = function() { + n(i.error) + } + , + e.onabort = function() { + var t = i.error || i.transaction.error; + n(t) + } + }).catch(n) + } + ); + return d(e, t), + e + }, + clear: function(t) { + var r = this + , e = new Promise(function(s, n) { + r.ready().then(function() { + var t = r._dbInfo + , e = t.db.transaction(t.storeName, "readwrite") + , i = e.objectStore(t.storeName).clear(); + e.oncomplete = function() { + s() + } + , + e.onabort = e.onerror = function() { + var t = i.error || i.transaction.error; + n(t) + } + }).catch(n) + } + ); + return d(e, t), + e + }, + length: function(t) { + var n = this + , e = new Promise(function(i, s) { + n.ready().then(function() { + var t = n._dbInfo + , e = t.db.transaction(t.storeName, "readonly").objectStore(t.storeName).count(); + e.onsuccess = function() { + i(e.result) + } + , + e.onerror = function() { + s(e.error) + } + }).catch(s) + } + ); + return d(e, t), + e + }, + key: function(r, t) { + var o = this + , e = new Promise(function(s, n) { + return r < 0 ? void s(null) : void o.ready().then(function() { + var t = o._dbInfo + , t = t.db.transaction(t.storeName, "readonly").objectStore(t.storeName) + , e = !1 + , i = t.openCursor(); + i.onsuccess = function() { + var t = i.result; + return t ? void (0 === r || e ? s(t.key) : (e = !0, + t.advance(r))) : void s(null) + } + , + i.onerror = function() { + n(i.error) + } + }).catch(n) + } + ); + return d(e, t), + e + }, + keys: function(t) { + var r = this + , e = new Promise(function(s, n) { + r.ready().then(function() { + var t = r._dbInfo + , e = t.db.transaction(t.storeName, "readonly").objectStore(t.storeName).openCursor() + , i = []; + e.onsuccess = function() { + var t = e.result; + return t ? (i.push(t.key), + void t.continue()) : void s(i) + } + , + e.onerror = function() { + n(e.error) + } + }).catch(n) + } + ); + return d(e, t), + e + } + } + } + }("undefined" != typeof window ? window : self); + e.default = i, + t.exports = e.default + } + , function(t, e, s) { + "use strict"; + e.__esModule = !0; + var i = function(n) { + function r(t, e) { + e && t.then(function(t) { + e(null, t) + }, function(t) { + e(t) + }) + } + var l = null; + try { + if (!(n.localStorage && "setItem"in n.localStorage)) + return; + l = n.localStorage + } catch (t) { + return + } + return { + _driver: "localStorageWrapper", + _initStorage: function(t) { + var e = {}; + if (t) + for (var i in t) + e[i] = t[i]; + return e.keyPrefix = e.name + "/", + e.storeName !== this._defaultConfig.storeName && (e.keyPrefix += e.storeName + "/"), + this._dbInfo = e, + new Promise(function(t, e) { + t(s(3)) + } + ).then(function(t) { + return e.serializer = t, + Promise.resolve() + }) + }, + iterate: function(h, t) { + var c = this + , e = c.ready().then(function() { + for (var t = c._dbInfo, e = t.keyPrefix, i = e.length, s = l.length, n = 1, r = 0; r < s; r++) { + var o = l.key(r); + if (0 === o.indexOf(e)) { + var a = (a = l.getItem(o)) && t.serializer.deserialize(a); + if (void 0 !== (a = h(a, o.substring(i), n++))) + return a + } + } + }); + return r(e, t), + e + }, + getItem: function(i, t) { + var s = this; + "string" != typeof i && (n.console.warn(i + " used as a key, but it is not a string."), + i = String(i)); + var e = s.ready().then(function() { + var t = s._dbInfo + , e = l.getItem(t.keyPrefix + i); + return e = e && t.serializer.deserialize(e) + }); + return r(e, t), + e + }, + setItem: function(o, t, e) { + var a = this; + "string" != typeof o && (n.console.warn(o + " used as a key, but it is not a string."), + o = String(o)); + var i = a.ready().then(function() { + void 0 === t && (t = null); + var r = t; + return new Promise(function(i, s) { + var n = a._dbInfo; + n.serializer.serialize(t, function(t, e) { + if (e) + s(e); + else + try { + l.setItem(n.keyPrefix + o, t), + i(r) + } catch (t) { + "QuotaExceededError" !== t.name && "NS_ERROR_DOM_QUOTA_REACHED" !== t.name || s(t), + s(t) + } + }) + } + ) + }); + return r(i, e), + i + }, + removeItem: function(e, t) { + var i = this; + "string" != typeof e && (n.console.warn(e + " used as a key, but it is not a string."), + e = String(e)); + var s = i.ready().then(function() { + var t = i._dbInfo; + l.removeItem(t.keyPrefix + e) + }); + return r(s, t), + s + }, + clear: function(t) { + var s = this + , e = s.ready().then(function() { + for (var t = s._dbInfo.keyPrefix, e = l.length - 1; 0 <= e; e--) { + var i = l.key(e); + 0 === i.indexOf(t) && l.removeItem(i) + } + }); + return r(e, t), + e + }, + length: function(t) { + var e = this.keys().then(function(t) { + return t.length + }); + return r(e, t), + e + }, + key: function(i, t) { + var s = this + , e = s.ready().then(function() { + var e, t = s._dbInfo; + try { + e = l.key(i) + } catch (t) { + e = null + } + return e = e && e.substring(t.keyPrefix.length) + }); + return r(e, t), + e + }, + keys: function(t) { + var n = this + , e = n.ready().then(function() { + for (var t = n._dbInfo, e = l.length, i = [], s = 0; s < e; s++) + 0 === l.key(s).indexOf(t.keyPrefix) && i.push(l.key(s).substring(t.keyPrefix.length)); + return i + }); + return r(e, t), + e + } + } + }("undefined" != typeof window ? window : self); + e.default = i, + t.exports = e.default + } + , function(t, e) { + "use strict"; + e.__esModule = !0; + var r, l, o, a, h, c, i = (r = "undefined" != typeof window ? window : self, + l = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", + o = /^~~local_forage_type~([^~]+)~/, + c = (h = (a = "__lfsc__:").length) + "arbf".length, + { + serialize: function(e, i) { + var t = ""; + if (e && (t = e.toString()), + e && ("[object ArrayBuffer]" === e.toString() || e.buffer && "[object ArrayBuffer]" === e.buffer.toString())) { + var s, n = a; + e instanceof ArrayBuffer ? (s = e, + n += "arbf") : (s = e.buffer, + "[object Int8Array]" === t ? n += "si08" : "[object Uint8Array]" === t ? n += "ui08" : "[object Uint8ClampedArray]" === t ? n += "uic8" : "[object Int16Array]" === t ? n += "si16" : "[object Uint16Array]" === t ? n += "ur16" : "[object Int32Array]" === t ? n += "si32" : "[object Uint32Array]" === t ? n += "ui32" : "[object Float32Array]" === t ? n += "fl32" : "[object Float64Array]" === t ? n += "fl64" : i(new Error("Failed to get type for BinaryArray"))), + i(n + p(s)) + } else if ("[object Blob]" === t) { + t = new FileReader; + t.onload = function() { + var t = "~~local_forage_type~" + e.type + "~" + p(this.result); + i(a + "blob" + t) + } + , + t.readAsArrayBuffer(e) + } else + try { + i(JSON.stringify(e)) + } catch (t) { + console.error("Couldn't convert value into a JSON string: ", e), + i(null, t) + } + }, + deserialize: function(t) { + if (t.substring(0, h) !== a) + return JSON.parse(t); + var e, i = t.substring(c), s = t.substring(h, c); + "blob" === s && o.test(i) && (e = (t = i.match(o))[1], + i = i.substring(t[0].length)); + var n = u(i); + switch (s) { + case "arbf": + return n; + case "blob": + return function(e, i) { + e = e || [], + i = i || {}; + try { + return new Blob(e,i) + } catch (t) { + if ("TypeError" !== t.name) + throw t; + for (var s = new (r.BlobBuilder || r.MSBlobBuilder || r.MozBlobBuilder || r.WebKitBlobBuilder), n = 0; n < e.length; n += 1) + s.append(e[n]); + return s.getBlob(i.type) + } + }([n], { + type: e + }); + case "si08": + return new Int8Array(n); + case "ui08": + return new Uint8Array(n); + case "uic8": + return new Uint8ClampedArray(n); + case "si16": + return new Int16Array(n); + case "ur16": + return new Uint16Array(n); + case "si32": + return new Int32Array(n); + case "ui32": + return new Uint32Array(n); + case "fl32": + return new Float32Array(n); + case "fl64": + return new Float64Array(n); + default: + throw new Error("Unkown type: " + s) + } + }, + stringToBuffer: u, + bufferToString: p + }); + function u(t) { + var e, i, s, n, r = .75 * t.length, o = t.length, a = 0; + "=" === t[t.length - 1] && (r--, + "=" === t[t.length - 2] && r--); + for (var r = new ArrayBuffer(r), h = new Uint8Array(r), c = 0; c < o; c += 4) + e = l.indexOf(t[c]), + i = l.indexOf(t[c + 1]), + s = l.indexOf(t[c + 2]), + n = l.indexOf(t[c + 3]), + h[a++] = e << 2 | i >> 4, + h[a++] = (15 & i) << 4 | s >> 2, + h[a++] = (3 & s) << 6 | 63 & n; + return r + } + function p(t) { + for (var e = new Uint8Array(t), i = "", s = 0; s < e.length; s += 3) + i += l[e[s] >> 2], + i += l[(3 & e[s]) << 4 | e[s + 1] >> 4], + i += l[(15 & e[s + 1]) << 2 | e[s + 2] >> 6], + i += l[63 & e[s + 2]]; + return e.length % 3 == 2 ? i = i.substring(0, i.length - 1) + "=" : e.length % 3 == 1 && (i = i.substring(0, i.length - 2) + "=="), + i + } + e.default = i, + t.exports = e.default + } + , function(t, e, o) { + "use strict"; + e.__esModule = !0; + var i = function(s) { + function h(t, e) { + e && t.then(function(t) { + e(null, t) + }, function(t) { + e(t) + }) + } + var r = s.openDatabase; + if (r) + return { + _driver: "webSQLStorage", + _initStorage: function(t) { + var s = this + , n = { + db: null + }; + if (t) + for (var e in t) + n[e] = "string" != typeof t[e] ? t[e].toString() : t[e]; + var i = new Promise(function(e, i) { + try { + n.db = r(n.name, String(n.version), n.description, n.size) + } catch (t) { + return i(t) + } + n.db.transaction(function(t) { + t.executeSql("CREATE TABLE IF NOT EXISTS " + n.storeName + " (id INTEGER PRIMARY KEY, key unique, value)", [], function() { + s._dbInfo = n, + e() + }, function(t, e) { + i(e) + }) + }) + } + ); + return new Promise(function(t, e) { + t(o(3)) + } + ).then(function(t) { + return n.serializer = t, + i + }) + }, + iterate: function(c, t) { + var e = this + , i = new Promise(function(h, i) { + e.ready().then(function() { + var a = e._dbInfo; + a.db.transaction(function(t) { + t.executeSql("SELECT * FROM " + a.storeName, [], function(t, e) { + for (var i = e.rows, s = i.length, n = 0; n < s; n++) { + var r = i.item(n) + , o = (o = r.value) && a.serializer.deserialize(o); + if (void 0 !== (o = c(o, r.key, n + 1))) + return void h(o) + } + h() + }, function(t, e) { + i(e) + }) + }) + }).catch(i) + } + ); + return h(i, t), + i + }, + getItem: function(e, t) { + var r = this; + "string" != typeof e && (s.console.warn(e + " used as a key, but it is not a string."), + e = String(e)); + var i = new Promise(function(s, n) { + r.ready().then(function() { + var i = r._dbInfo; + i.db.transaction(function(t) { + t.executeSql("SELECT * FROM " + i.storeName + " WHERE key = ? LIMIT 1", [e], function(t, e) { + e = (e = e.rows.length ? e.rows.item(0).value : null) && i.serializer.deserialize(e); + s(e) + }, function(t, e) { + n(e) + }) + }) + }).catch(n) + } + ); + return h(i, t), + i + }, + setItem: function(o, t, e) { + var a = this; + "string" != typeof o && (s.console.warn(o + " used as a key, but it is not a string."), + o = String(o)); + var i = new Promise(function(n, r) { + a.ready().then(function() { + void 0 === t && (t = null); + var i = t + , s = a._dbInfo; + s.serializer.serialize(t, function(e, t) { + t ? r(t) : s.db.transaction(function(t) { + t.executeSql("INSERT OR REPLACE INTO " + s.storeName + " (key, value) VALUES (?, ?)", [o, e], function() { + n(i) + }, function(t, e) { + r(e) + }) + }, function(t) { + t.code === t.QUOTA_ERR && r(t) + }) + }) + }).catch(r) + } + ); + return h(i, e), + i + }, + removeItem: function(n, t) { + var r = this; + "string" != typeof n && (s.console.warn(n + " used as a key, but it is not a string."), + n = String(n)); + var e = new Promise(function(i, s) { + r.ready().then(function() { + var e = r._dbInfo; + e.db.transaction(function(t) { + t.executeSql("DELETE FROM " + e.storeName + " WHERE key = ?", [n], function() { + i() + }, function(t, e) { + s(e) + }) + }) + }).catch(s) + } + ); + return h(e, t), + e + }, + clear: function(t) { + var n = this + , e = new Promise(function(i, s) { + n.ready().then(function() { + var e = n._dbInfo; + e.db.transaction(function(t) { + t.executeSql("DELETE FROM " + e.storeName, [], function() { + i() + }, function(t, e) { + s(e) + }) + }) + }).catch(s) + } + ); + return h(e, t), + e + }, + length: function(t) { + var n = this + , e = new Promise(function(i, s) { + n.ready().then(function() { + var e = n._dbInfo; + e.db.transaction(function(t) { + t.executeSql("SELECT COUNT(key) as c FROM " + e.storeName, [], function(t, e) { + e = e.rows.item(0).c; + i(e) + }, function(t, e) { + s(e) + }) + }) + }).catch(s) + } + ); + return h(e, t), + e + }, + key: function(n, t) { + var r = this + , e = new Promise(function(i, s) { + r.ready().then(function() { + var e = r._dbInfo; + e.db.transaction(function(t) { + t.executeSql("SELECT key FROM " + e.storeName + " WHERE id = ? LIMIT 1", [n + 1], function(t, e) { + e = e.rows.length ? e.rows.item(0).key : null; + i(e) + }, function(t, e) { + s(e) + }) + }) + }).catch(s) + } + ); + return h(e, t), + e + }, + keys: function(t) { + var s = this + , e = new Promise(function(n, i) { + s.ready().then(function() { + var e = s._dbInfo; + e.db.transaction(function(t) { + t.executeSql("SELECT key FROM " + e.storeName, [], function(t, e) { + for (var i = [], s = 0; s < e.rows.length; s++) + i.push(e.rows.item(s).key); + n(i) + }, function(t, e) { + i(e) + }) + }) + }).catch(i) + } + ); + return h(e, t), + e + } + } + }("undefined" != typeof window ? window : self); + e.default = i, + t.exports = e.default + } + ], + i.c = n, + i.p = "", + i(0); + function i(t) { + if (n[t]) + return n[t].exports; + var e = n[t] = { + exports: {}, + id: t, + loaded: !1 + }; + return s[t].call(e.exports, e, e.exports, i), + e.loaded = !0, + e.exports + } + var s, n + }) +} catch (e) { + localForageInitFailed = !0 +} +cr.plugins_.LocalStorage = function(t) { + this.runtime = t +} +, +function() { + var n = "" + , r = "" + , o = [] + , a = ""; + function h(t) { + return t ? "string" == typeof t ? t : "string" == typeof t.message ? t.message : "string" == typeof t.name ? t.name : "string" == typeof t.data ? t.data : "unknown error" : "unknown error" + } + function c(t, e) { + a = e, + t.runtime.trigger(cr.plugins_.LocalStorage.prototype.cnds.OnError, t) + } + var l = "" + , t = void 0 !== window.is_scirra_arcade; + function u(t) { + return !l || t.substr(0, l.length) === l + } + t && (l = "sa" + window.scirra_arcade_id + "_"); + var e = cr.plugins_.LocalStorage.prototype; + e.Type = function(t) { + this.plugin = t, + this.runtime = t.runtime + } + , + e.Type.prototype.onCreate = function() {} + , + e.Instance = function(t) { + this.type = t, + this.runtime = t.runtime + } + ; + var i = e.Instance.prototype; + function s() {} + function p() {} + function d() {} + i.onCreate = function() { + this.pendingSets = 0, + this.pendingGets = 0 + } + , + i.onDestroy = function() {} + , + i.saveToJSON = function() { + return {} + } + , + i.loadFromJSON = function(t) {} + , + s.prototype.OnItemSet = function(t) { + return n === t + } + , + s.prototype.OnAnyItemSet = function() { + return !0 + } + , + s.prototype.OnItemGet = function(t) { + return n === t + } + , + s.prototype.OnAnyItemGet = function() { + return !0 + } + , + s.prototype.OnItemRemoved = function(t) { + return n === t + } + , + s.prototype.OnAnyItemRemoved = function() { + return !0 + } + , + s.prototype.OnCleared = function() { + return !0 + } + , + s.prototype.OnAllKeyNamesLoaded = function() { + return !0 + } + , + s.prototype.OnError = function() { + return !0 + } + , + s.prototype.OnItemExists = function(t) { + return n === t + } + , + s.prototype.OnItemMissing = function(t) { + return n === t + } + , + s.prototype.CompareKey = function(t, e) { + return cr.do_cmp(n, t, e) + } + , + s.prototype.CompareValue = function(t, e) { + return cr.do_cmp(r, t, e) + } + , + s.prototype.IsProcessingSets = function() { + return 0 < this.pendingSets + } + , + s.prototype.IsProcessingGets = function() { + return 0 < this.pendingGets + } + , + s.prototype.OnAllSetsComplete = function() { + return !0 + } + , + s.prototype.OnAllGetsComplete = function() { + return !0 + } + , + e.cnds = new s, + p.prototype.SetItem = function(i, t) { + var e, s; + localForageInitFailed ? c(this, "storage failed to initialise - may be disabled in browser settings") : (e = l + i, + this.pendingSets++, + s = this, + localforage.setItem(e, t, function(t, e) { + s.pendingSets--, + t ? (a = h(t), + s.runtime.trigger(cr.plugins_.LocalStorage.prototype.cnds.OnError, s)) : (n = i, + r = e, + s.runtime.trigger(cr.plugins_.LocalStorage.prototype.cnds.OnAnyItemSet, s), + s.runtime.trigger(cr.plugins_.LocalStorage.prototype.cnds.OnItemSet, s), + r = n = ""), + 0 === s.pendingSets && s.runtime.trigger(cr.plugins_.LocalStorage.prototype.cnds.OnAllSetsComplete, s) + })) + } + , + p.prototype.GetItem = function(i) { + var t, s; + localForageInitFailed ? c(this, "storage failed to initialise - may be disabled in browser settings") : (t = l + i, + this.pendingGets++, + s = this, + localforage.getItem(t, function(t, e) { + s.pendingGets--, + t ? (a = h(t), + s.runtime.trigger(cr.plugins_.LocalStorage.prototype.cnds.OnError, s)) : (n = i, + null == (r = e) && (r = ""), + s.runtime.trigger(cr.plugins_.LocalStorage.prototype.cnds.OnAnyItemGet, s), + s.runtime.trigger(cr.plugins_.LocalStorage.prototype.cnds.OnItemGet, s), + r = n = ""), + 0 === s.pendingGets && s.runtime.trigger(cr.plugins_.LocalStorage.prototype.cnds.OnAllGetsComplete, s) + })) + } + , + p.prototype.CheckItemExists = function(i) { + var t, s; + localForageInitFailed ? c(this, "storage failed to initialise - may be disabled in browser settings") : (t = l + i, + s = this, + localforage.getItem(t, function(t, e) { + t ? (a = h(t), + s.runtime.trigger(cr.plugins_.LocalStorage.prototype.cnds.OnError, s)) : (n = i, + null === e ? (r = "", + s.runtime.trigger(cr.plugins_.LocalStorage.prototype.cnds.OnItemMissing, s)) : (r = e, + s.runtime.trigger(cr.plugins_.LocalStorage.prototype.cnds.OnItemExists, s)), + r = n = "") + })) + } + , + p.prototype.RemoveItem = function(e) { + var t, i; + localForageInitFailed ? c(this, "storage failed to initialise - may be disabled in browser settings") : (t = l + e, + i = this, + localforage.removeItem(t, function(t) { + t ? (a = h(t), + i.runtime.trigger(cr.plugins_.LocalStorage.prototype.cnds.OnError, i)) : (n = e, + r = "", + i.runtime.trigger(cr.plugins_.LocalStorage.prototype.cnds.OnAnyItemRemoved, i), + i.runtime.trigger(cr.plugins_.LocalStorage.prototype.cnds.OnItemRemoved, i), + n = "") + })) + } + , + p.prototype.ClearStorage = function() { + var e; + localForageInitFailed ? c(this, "storage failed to initialise - may be disabled in browser settings") : t || (e = this, + localforage.clear(function(t) { + t ? (a = h(t), + e.runtime.trigger(cr.plugins_.LocalStorage.prototype.cnds.OnError, e)) : (r = n = "", + cr.clearArray(o), + e.runtime.trigger(cr.plugins_.LocalStorage.prototype.cnds.OnCleared, e)) + })) + } + , + p.prototype.GetAllKeyNames = function() { + var r; + localForageInitFailed ? c(this, "storage failed to initialise - may be disabled in browser settings") : (r = this, + localforage.keys(function(t, e) { + var i, s, n; + if (t) + a = h(t), + r.runtime.trigger(cr.plugins_.LocalStorage.prototype.cnds.OnError, r); + else { + for (cr.clearArray(o), + i = 0, + s = e.length; i < s; ++i) + u(n = e[i]) && o.push((n = n, + l ? u(n) ? n.substr(l.length) : void 0 : n)); + r.runtime.trigger(cr.plugins_.LocalStorage.prototype.cnds.OnAllKeyNamesLoaded, r) + } + })) + } + , + e.acts = new p, + d.prototype.ItemValue = function(t) { + t.set_any(r) + } + , + d.prototype.Key = function(t) { + t.set_string(n) + } + , + d.prototype.KeyCount = function(t) { + t.set_int(o.length) + } + , + d.prototype.KeyAt = function(t, e) { + (e = Math.floor(e)) < 0 || e >= o.length ? t.set_string("") : t.set_string(o[e]) + } + , + d.prototype.ErrorMessage = function(t) { + t.set_string(a) + } + , + e.exps = new d +}(), +cr.plugins_.Mouse = function(t) { + this.runtime = t +} +, +function() { + var t = cr.plugins_.Mouse.prototype; + t.Type = function(t) { + this.plugin = t, + this.runtime = t.runtime + } + , + t.Type.prototype.onCreate = function() {} + , + t.Instance = function(t) { + this.type = t, + this.runtime = t.runtime, + this.buttonMap = new Array(4), + this.mouseXcanvas = 0, + this.mouseYcanvas = 0, + this.triggerButton = 0, + this.triggerType = 0, + this.triggerDir = 0, + this.handled = !1 + } + ; + var e = t.Instance.prototype; + e.onCreate = function() { + var t, e = this; + this.runtime.isDomFree || (jQuery(document).mousemove(function(t) { + e.onMouseMove(t) + }), + jQuery(document).mousedown(function(t) { + e.onMouseDown(t) + }), + jQuery(document).mouseup(function(t) { + e.onMouseUp(t) + }), + jQuery(document).dblclick(function(t) { + e.onDoubleClick(t) + }), + t = function(t) { + e.onWheel(t) + } + , + document.addEventListener("mousewheel", t, !1), + document.addEventListener("DOMMouseScroll", t, !1)) + } + ; + var i = { + left: 0, + top: 0 + }; + function s() {} + function n() {} + e.onMouseMove = function(t) { + var e = this.runtime.isDomFree ? i : jQuery(this.runtime.canvas).offset(); + this.mouseXcanvas = t.pageX - e.left, + this.mouseYcanvas = t.pageY - e.top + } + , + e.mouseInGame = function() { + return 0 < this.runtime.fullscreen_mode || 0 <= this.mouseXcanvas && 0 <= this.mouseYcanvas && this.mouseXcanvas < this.runtime.width && this.mouseYcanvas < this.runtime.height + } + , + e.onMouseDown = function(t) { + this.mouseInGame() && (this.buttonMap[t.which] = !0, + this.runtime.isInUserInputEvent = !0, + this.runtime.trigger(cr.plugins_.Mouse.prototype.cnds.OnAnyClick, this), + this.triggerButton = t.which - 1, + this.triggerType = 0, + this.runtime.trigger(cr.plugins_.Mouse.prototype.cnds.OnClick, this), + this.runtime.trigger(cr.plugins_.Mouse.prototype.cnds.OnObjectClicked, this), + this.runtime.isInUserInputEvent = !1) + } + , + e.onMouseUp = function(t) { + this.buttonMap[t.which] && (this.runtime.had_a_click && !this.runtime.isMobile && t.preventDefault(), + this.runtime.had_a_click = !0, + this.buttonMap[t.which] = !1, + this.runtime.isInUserInputEvent = !0, + this.triggerButton = t.which - 1, + this.runtime.trigger(cr.plugins_.Mouse.prototype.cnds.OnRelease, this), + this.runtime.isInUserInputEvent = !1) + } + , + e.onDoubleClick = function(t) { + this.mouseInGame() && (t.preventDefault(), + this.runtime.isInUserInputEvent = !0, + this.triggerButton = t.which - 1, + this.triggerType = 1, + this.runtime.trigger(cr.plugins_.Mouse.prototype.cnds.OnClick, this), + this.runtime.trigger(cr.plugins_.Mouse.prototype.cnds.OnObjectClicked, this), + this.runtime.isInUserInputEvent = !1) + } + , + e.onWheel = function(t) { + var e = t.wheelDelta || (t.detail ? -t.detail : 0); + this.triggerDir = e < 0 ? 0 : 1, + this.handled = !1, + this.runtime.isInUserInputEvent = !0, + this.runtime.trigger(cr.plugins_.Mouse.prototype.cnds.OnWheel, this), + this.runtime.isInUserInputEvent = !1, + this.handled && cr.isCanvasInputEvent(t) && t.preventDefault() + } + , + e.onWindowBlur = function() { + for (var t = 0, e = this.buttonMap.length; t < e; ++t) + this.buttonMap[t] && (this.buttonMap[t] = !1, + this.triggerButton = t - 1, + this.runtime.trigger(cr.plugins_.Mouse.prototype.cnds.OnRelease, this)) + } + , + s.prototype.OnClick = function(t, e) { + return t === this.triggerButton && e === this.triggerType + } + , + s.prototype.OnAnyClick = function() { + return !0 + } + , + s.prototype.IsButtonDown = function(t) { + return this.buttonMap[t + 1] + } + , + s.prototype.OnRelease = function(t) { + return t === this.triggerButton + } + , + s.prototype.IsOverObject = function(t) { + var e = this.runtime.getCurrentCondition() + , i = this.mouseXcanvas + , s = this.mouseYcanvas; + return cr.xor(this.runtime.testAndSelectCanvasPointOverlap(t, i, s, e.inverted), e.inverted) + } + , + s.prototype.OnObjectClicked = function(t, e, i) { + return t === this.triggerButton && e === this.triggerType && this.runtime.testAndSelectCanvasPointOverlap(i, this.mouseXcanvas, this.mouseYcanvas, !1) + } + , + s.prototype.OnWheel = function(t) { + return this.handled = !0, + t === this.triggerDir + } + , + t.cnds = new s; + var r = null; + function o() {} + n.prototype.SetCursor = function(t) { + this.runtime.isDomFree || r !== (t = ["auto", "pointer", "text", "crosshair", "move", "help", "wait", "none"][t]) && (r = t, + document.body.style.cursor = t) + } + , + n.prototype.SetCursorSprite = function(t) { + this.runtime.isDomFree || this.runtime.isMobile || !t || (t = t.getFirstPicked()) && t.curFrame && (t = t.curFrame, + r !== t && (t = "url(" + (r = t).getDataUri() + ") " + Math.round(t.hotspotX * t.width) + " " + Math.round(t.hotspotY * t.height) + ", auto", + document.body.style.cursor = "", + document.body.style.cursor = t)) + } + , + t.acts = new n, + o.prototype.X = function(t, e) { + var i, s, n, r, o; + cr.is_undefined(e) ? (s = (i = this.runtime.getLayerByNumber(0)).scale, + n = i.zoomRate, + r = i.parallaxX, + o = i.angle, + i.scale = 1, + i.zoomRate = 1, + i.parallaxX = 1, + i.angle = 0, + t.set_float(i.canvasToLayer(this.mouseXcanvas, this.mouseYcanvas, !0)), + i.scale = s, + i.zoomRate = n, + i.parallaxX = r, + i.angle = o) : (i = cr.is_number(e) ? this.runtime.getLayerByNumber(e) : this.runtime.getLayerByName(e)) ? t.set_float(i.canvasToLayer(this.mouseXcanvas, this.mouseYcanvas, !0)) : t.set_float(0) + } + , + o.prototype.Y = function(t, e) { + var i, s, n, r, o; + cr.is_undefined(e) ? (s = (i = this.runtime.getLayerByNumber(0)).scale, + n = i.zoomRate, + r = i.parallaxY, + o = i.angle, + i.scale = 1, + i.zoomRate = 1, + i.parallaxY = 1, + i.angle = 0, + t.set_float(i.canvasToLayer(this.mouseXcanvas, this.mouseYcanvas, !1)), + i.scale = s, + i.zoomRate = n, + i.parallaxY = r, + i.angle = o) : (i = cr.is_number(e) ? this.runtime.getLayerByNumber(e) : this.runtime.getLayerByName(e)) ? t.set_float(i.canvasToLayer(this.mouseXcanvas, this.mouseYcanvas, !1)) : t.set_float(0) + } + , + o.prototype.AbsoluteX = function(t) { + t.set_float(this.mouseXcanvas) + } + , + o.prototype.AbsoluteY = function(t) { + t.set_float(this.mouseYcanvas) + } + , + t.exps = new o +}(), +cr.plugins_.Particles = function(t) { + this.runtime = t +} +, +function() { + var t = cr.plugins_.Particles.prototype; + function e(t) { + this.owner = t, + this.active = !1, + this.x = 0, + this.y = 0, + this.speed = 0, + this.angle = 0, + this.opacity = 1, + this.grow = 0, + this.size = 0, + this.gs = 0, + this.age = 0, + cr.seal(this) + } + t.Type = function(t) { + this.plugin = t, + this.runtime = t.runtime + } + , + (i = t.Type.prototype).onCreate = function() { + this.is_family || (this.texture_img = new Image, + this.texture_img.crossOrigin = "anonymous", + this.texture_img.cr_filesize = this.texture_filesize, + this.webGL_texture = null, + this.runtime.waitForImageLoad(this.texture_img, this.texture_file)) + } + , + i.onLostWebGLContext = function() { + this.is_family || (this.webGL_texture = null) + } + , + i.onRestoreWebGLContext = function() { + !this.is_family && this.instances.length && (this.webGL_texture || (this.webGL_texture = this.runtime.glwrap.loadTexture(this.texture_img, !0, this.runtime.linearSampling, this.texture_pixelformat))) + } + , + i.loadTextures = function() { + this.is_family || this.webGL_texture || !this.runtime.glwrap || (this.webGL_texture = this.runtime.glwrap.loadTexture(this.texture_img, !0, this.runtime.linearSampling, this.texture_pixelformat)) + } + , + i.unloadTextures = function() { + this.is_family || this.instances.length || !this.webGL_texture || (this.runtime.glwrap.deleteTexture(this.webGL_texture), + this.webGL_texture = null) + } + , + i.preloadCanvas2D = function(t) { + t.drawImage(this.texture_img, 0, 0) + } + , + e.prototype.init = function() { + var t = this.owner; + this.x = t.x - t.xrandom / 2 + Math.random() * t.xrandom, + this.y = t.y - t.yrandom / 2 + Math.random() * t.yrandom, + this.speed = t.initspeed - t.speedrandom / 2 + Math.random() * t.speedrandom, + this.angle = t.angle - t.spraycone / 2 + Math.random() * t.spraycone, + this.opacity = t.initopacity, + this.size = t.initsize - t.sizerandom / 2 + Math.random() * t.sizerandom, + this.grow = t.growrate - t.growrandom / 2 + Math.random() * t.growrandom, + this.gs = 0, + this.age = 0 + } + , + e.prototype.tick = function(t) { + var e = this.owner; + this.x += Math.cos(this.angle) * this.speed * t, + this.y += Math.sin(this.angle) * this.speed * t, + this.y += this.gs * t, + this.speed += e.acc * t, + this.size += this.grow * t, + this.gs += e.g * t, + this.age += t, + this.size < 1 ? this.active = !1 : (0 !== e.lifeanglerandom && (this.angle += Math.random() * e.lifeanglerandom * t - e.lifeanglerandom * t / 2), + 0 !== e.lifespeedrandom && (this.speed += Math.random() * e.lifespeedrandom * t - e.lifespeedrandom * t / 2), + 0 !== e.lifeopacityrandom && (this.opacity += Math.random() * e.lifeopacityrandom * t - e.lifeopacityrandom * t / 2, + this.opacity < 0 ? this.opacity = 0 : 1 < this.opacity && (this.opacity = 1)), + e.destroymode <= 1 && this.age >= e.timeout && (this.active = !1), + 2 === e.destroymode && this.speed <= 0 && (this.active = !1)) + } + , + e.prototype.draw = function(t) { + var e, i = this.owner.opacity * this.opacity; + 0 !== i && (0 === this.owner.destroymode && (i *= 1 - this.age / this.owner.timeout), + t.globalAlpha = i, + e = this.x - this.size / 2, + i = this.y - this.size / 2, + this.owner.runtime.pixel_rounding && (e = e + .5 | 0, + i = i + .5 | 0), + t.drawImage(this.owner.type.texture_img, e, i, this.size, this.size)) + } + , + e.prototype.drawGL = function(t) { + var e = this.owner.opacity * this.opacity; + 0 === this.owner.destroymode && (e *= 1 - this.age / this.owner.timeout); + var i = this.size + , s = i * this.owner.particlescale + , n = this.x - i / 2 + , r = this.y - i / 2; + this.owner.runtime.pixel_rounding && (n = n + .5 | 0, + r = r + .5 | 0), + s < 1 || 0 === e || (s < t.minPointSize || s > t.maxPointSize ? (t.setOpacity(e), + t.quad(n, r, n + i, r, n + i, r + i, n, r + i)) : t.point(this.x, this.y, s, e)) + } + , + e.prototype.left = function() { + return this.x - this.size / 2 + } + , + e.prototype.right = function() { + return this.x + this.size / 2 + } + , + e.prototype.top = function() { + return this.y - this.size / 2 + } + , + e.prototype.bottom = function() { + return this.y + this.size / 2 + } + , + t.Instance = function(t) { + this.type = t, + this.runtime = t.runtime + } + ; + var i = t.Instance.prototype + , o = []; + function s() {} + function n() {} + function r() {} + i.onCreate = function() { + var t = this.properties; + if (this.rate = t[0], + this.spraycone = cr.to_radians(t[1]), + this.spraytype = t[2], + this.spraying = !0, + this.initspeed = t[3], + this.initsize = t[4], + this.initopacity = t[5] / 100, + this.growrate = t[6], + this.xrandom = t[7], + this.yrandom = t[8], + this.speedrandom = t[9], + this.sizerandom = t[10], + this.growrandom = t[11], + this.acc = t[12], + this.g = t[13], + this.lifeanglerandom = t[14], + this.lifespeedrandom = t[15], + this.lifeopacityrandom = t[16], + this.destroymode = t[17], + this.timeout = t[18], + this.particleCreateCounter = 0, + this.particlescale = 1, + this.particleBoxLeft = this.x, + this.particleBoxTop = this.y, + this.particleBoxRight = this.x, + this.particleBoxBottom = this.y, + this.add_bbox_changed_callback(function(t) { + t.bbox.set(t.particleBoxLeft, t.particleBoxTop, t.particleBoxRight, t.particleBoxBottom), + t.bquad.set_from_rect(t.bbox), + t.bbox_changed = !1, + t.update_collision_cell(), + t.update_render_cell() + }), + this.recycled || (this.particles = []), + this.runtime.tickMe(this), + this.type.loadTextures(), + 1 === this.spraytype) + for (var e = 0; e < this.rate; e++) + this.allocateParticle().opacity = 0; + this.first_tick = !0 + } + , + i.saveToJSON = function() { + for (var t, e = { + r: this.rate, + sc: this.spraycone, + st: this.spraytype, + s: this.spraying, + isp: this.initspeed, + isz: this.initsize, + io: this.initopacity, + gr: this.growrate, + xr: this.xrandom, + yr: this.yrandom, + spr: this.speedrandom, + szr: this.sizerandom, + grnd: this.growrandom, + acc: this.acc, + g: this.g, + lar: this.lifeanglerandom, + lsr: this.lifespeedrandom, + lor: this.lifeopacityrandom, + dm: this.destroymode, + to: this.timeout, + pcc: this.particleCreateCounter, + ft: this.first_tick, + p: [] + }, i = e.p, s = 0, n = this.particles.length; s < n; s++) + t = this.particles[s], + i.push([t.x, t.y, t.speed, t.angle, t.opacity, t.grow, t.size, t.gs, t.age]); + return e + } + , + i.loadFromJSON = function(t) { + var e, i; + this.rate = t.r, + this.spraycone = t.sc, + this.spraytype = t.st, + this.spraying = t.s, + this.initspeed = t.isp, + this.initsize = t.isz, + this.initopacity = t.io, + this.growrate = t.gr, + this.xrandom = t.xr, + this.yrandom = t.yr, + this.speedrandom = t.spr, + this.sizerandom = t.szr, + this.growrandom = t.grnd, + this.acc = t.acc, + this.g = t.g, + this.lifeanglerandom = t.lar, + this.lifespeedrandom = t.lsr, + this.lifeopacityrandom = t.lor, + this.destroymode = t.dm, + this.timeout = t.to, + this.particleCreateCounter = t.pcc, + this.first_tick = t.ft, + o.push.apply(o, this.particles), + cr.clearArray(this.particles); + for (var s = t.p, n = 0, r = s.length; n < r; n++) + e = this.allocateParticle(), + i = s[n], + e.x = i[0], + e.y = i[1], + e.speed = i[2], + e.angle = i[3], + e.opacity = i[4], + e.grow = i[5], + e.size = i[6], + e.gs = i[7], + e.age = i[8] + } + , + i.onDestroy = function() { + o.push.apply(o, this.particles), + cr.clearArray(this.particles) + } + , + i.allocateParticle = function() { + var t; + return o.length ? (t = o.pop()).owner = this : t = new e(this), + this.particles.push(t), + t.active = !0, + t + } + , + i.tick = function() { + var t, e, i, s, n, r = this.runtime.getDt(this); + if (0 === this.spraytype && this.spraying) + for (this.particleCreateCounter += r * this.rate, + s = cr.floor(this.particleCreateCounter), + this.particleCreateCounter -= s, + t = 0; t < s; t++) + (i = this.allocateParticle()).init(); + for (this.particleBoxLeft = this.x, + this.particleBoxTop = this.y, + this.particleBoxRight = this.x, + this.particleBoxBottom = this.y, + n = t = 0, + e = this.particles.length; t < e; t++) + i = this.particles[t], + this.particles[n] = i, + this.runtime.redraw = !0, + 1 === this.spraytype && this.first_tick && i.init(), + i.tick(r), + i.active ? (i.left() < this.particleBoxLeft && (this.particleBoxLeft = i.left()), + i.right() > this.particleBoxRight && (this.particleBoxRight = i.right()), + i.top() < this.particleBoxTop && (this.particleBoxTop = i.top()), + i.bottom() > this.particleBoxBottom && (this.particleBoxBottom = i.bottom()), + n++) : o.push(i); + cr.truncateArray(this.particles, n), + this.set_bbox_changed(), + this.first_tick = !1, + 1 === this.spraytype && 0 === this.particles.length && this.runtime.DestroyInstance(this) + } + , + i.draw = function(t) { + for (var e, i = this.layer, s = 0, n = this.particles.length; s < n; s++) + (e = this.particles[s]).right() >= i.viewLeft && e.bottom() >= i.viewTop && e.left() <= i.viewRight && e.top() <= i.viewBottom && e.draw(t) + } + , + i.drawGL = function(t) { + this.particlescale = this.layer.getScale(), + t.setTexture(this.type.webGL_texture); + for (var e, i = this.layer, s = 0, n = this.particles.length; s < n; s++) + (e = this.particles[s]).right() >= i.viewLeft && e.bottom() >= i.viewTop && e.left() <= i.viewRight && e.top() <= i.viewBottom && e.drawGL(t) + } + , + s.prototype.IsSpraying = function() { + return this.spraying + } + , + t.cnds = new s, + n.prototype.SetSpraying = function(t) { + this.spraying = 0 !== t + } + , + n.prototype.SetEffect = function(t) { + this.blend_mode = t, + this.compositeOp = cr.effectToCompositeOp(t), + cr.setGLBlend(this, t, this.runtime.gl), + this.runtime.redraw = !0 + } + , + n.prototype.SetRate = function(t) { + var e, i; + if (this.rate = t, + 1 === this.spraytype && this.first_tick) + if (t < this.particles.length) + for (e = this.particles.length - t, + i = 0; i < e; i++) + o.push(this.particles.pop()); + else if (t > this.particles.length) + for (e = t - this.particles.length, + i = 0; i < e; i++) + this.allocateParticle().opacity = 0 + } + , + n.prototype.SetSprayCone = function(t) { + this.spraycone = cr.to_radians(t) + } + , + n.prototype.SetInitSpeed = function(t) { + this.initspeed = t + } + , + n.prototype.SetInitSize = function(t) { + this.initsize = t + } + , + n.prototype.SetInitOpacity = function(t) { + this.initopacity = t / 100 + } + , + n.prototype.SetGrowRate = function(t) { + this.growrate = t + } + , + n.prototype.SetXRandomiser = function(t) { + this.xrandom = t + } + , + n.prototype.SetYRandomiser = function(t) { + this.yrandom = t + } + , + n.prototype.SetSpeedRandomiser = function(t) { + this.speedrandom = t + } + , + n.prototype.SetSizeRandomiser = function(t) { + this.sizerandom = t + } + , + n.prototype.SetGrowRateRandomiser = function(t) { + this.growrandom = t + } + , + n.prototype.SetParticleAcc = function(t) { + this.acc = t + } + , + n.prototype.SetGravity = function(t) { + this.g = t + } + , + n.prototype.SetAngleRandomiser = function(t) { + this.lifeanglerandom = t + } + , + n.prototype.SetLifeSpeedRandomiser = function(t) { + this.lifespeedrandom = t + } + , + n.prototype.SetOpacityRandomiser = function(t) { + this.lifeopacityrandom = t + } + , + n.prototype.SetTimeout = function(t) { + this.timeout = t + } + , + t.acts = new n, + r.prototype.ParticleCount = function(t) { + t.set_int(this.particles.length) + } + , + r.prototype.Rate = function(t) { + t.set_float(this.rate) + } + , + r.prototype.SprayCone = function(t) { + t.set_float(cr.to_degrees(this.spraycone)) + } + , + r.prototype.InitSpeed = function(t) { + t.set_float(this.initspeed) + } + , + r.prototype.InitSize = function(t) { + t.set_float(this.initsize) + } + , + r.prototype.InitOpacity = function(t) { + t.set_float(100 * this.initopacity) + } + , + r.prototype.InitGrowRate = function(t) { + t.set_float(this.growrate) + } + , + r.prototype.XRandom = function(t) { + t.set_float(this.xrandom) + } + , + r.prototype.YRandom = function(t) { + t.set_float(this.yrandom) + } + , + r.prototype.InitSpeedRandom = function(t) { + t.set_float(this.speedrandom) + } + , + r.prototype.InitSizeRandom = function(t) { + t.set_float(this.sizerandom) + } + , + r.prototype.InitGrowRandom = function(t) { + t.set_float(this.growrandom) + } + , + r.prototype.ParticleAcceleration = function(t) { + t.set_float(this.acc) + } + , + r.prototype.Gravity = function(t) { + t.set_float(this.g) + } + , + r.prototype.ParticleAngleRandom = function(t) { + t.set_float(this.lifeanglerandom) + } + , + r.prototype.ParticleSpeedRandom = function(t) { + t.set_float(this.lifespeedrandom) + } + , + r.prototype.ParticleOpacityRandom = function(t) { + t.set_float(this.lifeopacityrandom) + } + , + r.prototype.Timeout = function(t) { + t.set_float(this.timeout) + } + , + t.exps = new r +}(), +cr.plugins_.Sprite = function(t) { + this.runtime = t +} +, +function() { + var t = cr.plugins_.Sprite.prototype; + t.Type = function(t) { + this.plugin = t, + this.runtime = t.runtime + } + ; + var e = t.Type.prototype; + function c() { + var t, e; + return 0 === this.datauri.length && ((t = document.createElement("canvas")).width = this.width, + t.height = this.height, + e = t.getContext("2d"), + this.spritesheeted ? e.drawImage(this.texture_img, this.offx, this.offy, this.width, this.height, 0, 0, this.width, this.height) : e.drawImage(this.texture_img, 0, 0, this.width, this.height), + this.datauri = t.toDataURL("image/png")), + this.datauri + } + e.onCreate = function() { + var t, e, i, s, n, r, o, a, h; + if (!this.is_family) + for (this.all_frames = [], + this.has_loaded_textures = !1, + t = 0, + e = this.animations.length; t < e; t++) { + for (n = this.animations[t], + (o = {}).name = n[0], + o.speed = n[1], + o.loop = n[2], + o.repeatcount = n[3], + o.repeatto = n[4], + o.pingpong = n[5], + o.sid = n[6], + o.frames = [], + i = 0, + s = n[7].length; i < s; i++) + r = n[7][i], + (a = {}).texture_file = r[0], + a.texture_filesize = r[1], + a.offx = r[2], + a.offy = r[3], + a.width = r[4], + a.height = r[5], + a.duration = r[6], + a.hotspotX = r[7], + a.hotspotY = r[8], + a.image_points = r[9], + a.poly_pts = r[10], + a.pixelformat = r[11], + a.spritesheeted = 0 !== a.width, + a.datauri = "", + a.getDataUri = c, + h = { + left: 0, + top: 0, + right: 1, + bottom: 1 + }, + a.sheetTex = h, + a.webGL_texture = null, + (h = this.runtime.findWaitingTexture(r[0])) ? a.texture_img = h : (a.texture_img = new Image, + a.texture_img.cr_src = r[0], + a.texture_img.cr_filesize = r[1], + a.texture_img.c2webGL_texture = null, + this.runtime.waitForImageLoad(a.texture_img, r[0])), + cr.seal(a), + o.frames.push(a), + this.all_frames.push(a); + cr.seal(o), + this.animations[t] = o + } + } + , + e.updateAllCurrentTexture = function() { + for (var t, e = 0, i = this.instances.length; e < i; e++) + (t = this.instances[e]).curWebGLTexture = t.curFrame.webGL_texture + } + , + e.onLostWebGLContext = function() { + if (!this.is_family) { + for (var t, e = 0, i = this.all_frames.length; e < i; ++e) + (t = this.all_frames[e]).texture_img.c2webGL_texture = null, + t.webGL_texture = null; + this.has_loaded_textures = !1, + this.updateAllCurrentTexture() + } + } + , + e.onRestoreWebGLContext = function() { + if (!this.is_family && this.instances.length) { + for (var t, e = 0, i = this.all_frames.length; e < i; ++e) + (t = this.all_frames[e]).webGL_texture = this.runtime.glwrap.loadTexture(t.texture_img, !1, this.runtime.linearSampling, t.pixelformat); + this.updateAllCurrentTexture() + } + } + , + e.loadTextures = function() { + if (!this.is_family && !this.has_loaded_textures && this.runtime.glwrap) { + for (var t, e = 0, i = this.all_frames.length; e < i; ++e) + (t = this.all_frames[e]).webGL_texture = this.runtime.glwrap.loadTexture(t.texture_img, !1, this.runtime.linearSampling, t.pixelformat); + this.has_loaded_textures = !0 + } + } + , + e.unloadTextures = function() { + if (!this.is_family && !this.instances.length && this.has_loaded_textures) { + for (var t, e = 0, i = this.all_frames.length; e < i; ++e) + t = this.all_frames[e], + this.runtime.glwrap.deleteTexture(t.webGL_texture), + t.webGL_texture = null; + this.has_loaded_textures = !1 + } + } + ; + var n = []; + e.preloadCanvas2D = function(t) { + var e, i, s; + for (cr.clearArray(n), + e = 0, + i = this.all_frames.length; e < i; ++e) + s = this.all_frames[e].texture_img, + -1 === n.indexOf(s) && (t.drawImage(s, 0, 0), + n.push(s)) + } + , + t.Instance = function(t) { + this.type = t, + this.runtime = t.runtime; + t = this.type.animations[0].frames[0].poly_pts; + this.recycled ? this.collision_poly.set_pts(t) : this.collision_poly = new cr.CollisionPoly(t) + } + ; + var i = t.Instance.prototype; + function s() {} + i.onCreate = function() { + this.visible = 0 === this.properties[0], + this.isTicking = !1, + this.inAnimTrigger = !1, + this.collisionsEnabled = 0 !== this.properties[3], + this.cur_animation = this.getAnimationByName(this.properties[1]) || this.type.animations[0], + this.cur_frame = this.properties[2], + this.cur_frame < 0 && (this.cur_frame = 0), + this.cur_frame >= this.cur_animation.frames.length && (this.cur_frame = this.cur_animation.frames.length - 1); + var t, e, i, s, n, r, o, a, h = this.cur_animation.frames[this.cur_frame]; + for (this.collision_poly.set_pts(h.poly_pts), + this.hotspotX = h.hotspotX, + this.hotspotY = h.hotspotY, + this.cur_anim_speed = this.cur_animation.speed, + this.cur_anim_repeatto = this.cur_animation.repeatto, + 1 === this.type.animations.length && 1 === this.type.animations[0].frames.length || 0 === this.cur_anim_speed || (this.runtime.tickMe(this), + this.isTicking = !0), + this.recycled ? this.animTimer.reset() : this.animTimer = new cr.KahanAdder, + this.frameStart = this.getNowTime(), + this.animPlaying = !0, + this.animRepeats = 0, + this.animForwards = !0, + this.animTriggerName = "", + this.changeAnimName = "", + this.changeAnimFrom = 0, + this.changeAnimFrame = -1, + this.type.loadTextures(), + t = 0, + e = this.type.animations.length; t < e; t++) + for (i = 0, + s = (n = this.type.animations[t]).frames.length; i < s; i++) + 0 === (r = n.frames[i]).width && (r.width = r.texture_img.width, + r.height = r.texture_img.height), + r.spritesheeted && (a = r.texture_img, + (o = r.sheetTex).left = r.offx / a.width, + o.top = r.offy / a.height, + o.right = (r.offx + r.width) / a.width, + o.bottom = (r.offy + r.height) / a.height, + 0 === r.offx && 0 === r.offy && r.width === a.width && r.height === a.height && (r.spritesheeted = !1)); + this.curFrame = this.cur_animation.frames[this.cur_frame], + this.curWebGLTexture = this.curFrame.webGL_texture + } + , + i.saveToJSON = function() { + var t = { + a: this.cur_animation.sid, + f: this.cur_frame, + cas: this.cur_anim_speed, + fs: this.frameStart, + ar: this.animRepeats, + at: this.animTimer.sum, + rt: this.cur_anim_repeatto + }; + return this.animPlaying || (t.ap = this.animPlaying), + this.animForwards || (t.af = this.animForwards), + t + } + , + i.loadFromJSON = function(t) { + var e = this.getAnimationBySid(t.a); + e && (this.cur_animation = e), + this.cur_frame = t.f, + this.cur_frame < 0 && (this.cur_frame = 0), + this.cur_frame >= this.cur_animation.frames.length && (this.cur_frame = this.cur_animation.frames.length - 1), + this.cur_anim_speed = t.cas, + this.frameStart = t.fs, + this.animRepeats = t.ar, + this.animTimer.reset(), + this.animTimer.sum = t.at, + this.animPlaying = !t.hasOwnProperty("ap") || t.ap, + this.animForwards = !t.hasOwnProperty("af") || t.af, + t.hasOwnProperty("rt") ? this.cur_anim_repeatto = t.rt : this.cur_anim_repeatto = this.cur_animation.repeatto, + this.curFrame = this.cur_animation.frames[this.cur_frame], + this.curWebGLTexture = this.curFrame.webGL_texture, + this.collision_poly.set_pts(this.curFrame.poly_pts), + this.hotspotX = this.curFrame.hotspotX, + this.hotspotY = this.curFrame.hotspotY + } + , + i.animationFinish = function(t) { + this.cur_frame = t ? 0 : this.cur_animation.frames.length - 1, + this.animPlaying = !1, + this.animTriggerName = this.cur_animation.name, + this.inAnimTrigger = !0, + this.runtime.trigger(cr.plugins_.Sprite.prototype.cnds.OnAnyAnimFinished, this), + this.runtime.trigger(cr.plugins_.Sprite.prototype.cnds.OnAnimFinished, this), + this.inAnimTrigger = !1, + this.animRepeats = 0 + } + , + i.getNowTime = function() { + return this.animTimer.sum + } + , + i.tick = function() { + this.animTimer.add(this.runtime.getDt(this)), + this.changeAnimName.length && this.doChangeAnim(), + 0 <= this.changeAnimFrame && this.doChangeAnimFrame(); + var t = this.getNowTime() + , e = this.cur_animation + , i = e.frames[this.cur_frame] + , s = i.duration / this.cur_anim_speed; + this.animPlaying && t >= this.frameStart + s && (this.animForwards ? this.cur_frame++ : this.cur_frame--, + this.frameStart += s, + this.cur_frame >= e.frames.length && (e.pingpong ? (this.animForwards = !1, + this.cur_frame = e.frames.length - 2) : e.loop ? this.cur_frame = this.cur_anim_repeatto : (this.animRepeats++, + this.animRepeats >= e.repeatcount ? this.animationFinish(!1) : this.cur_frame = this.cur_anim_repeatto)), + this.cur_frame < 0 && (e.pingpong ? (this.cur_frame = 1, + this.animForwards = !0, + e.loop || (this.animRepeats++, + this.animRepeats >= e.repeatcount && this.animationFinish(!0))) : e.loop ? this.cur_frame = this.cur_anim_repeatto : (this.animRepeats++, + this.animRepeats >= e.repeatcount ? this.animationFinish(!0) : this.cur_frame = this.cur_anim_repeatto)), + this.cur_frame < 0 ? this.cur_frame = 0 : this.cur_frame >= e.frames.length && (this.cur_frame = e.frames.length - 1), + t > this.frameStart + e.frames[this.cur_frame].duration / this.cur_anim_speed && (this.frameStart = t), + e = e.frames[this.cur_frame], + this.OnFrameChanged(i, e), + this.runtime.redraw = !0) + } + , + i.getAnimationByName = function(t) { + for (var e, i = 0, s = this.type.animations.length; i < s; i++) + if (e = this.type.animations[i], + cr.equals_nocase(e.name, t)) + return e; + return null + } + , + i.getAnimationBySid = function(t) { + for (var e, i = 0, s = this.type.animations.length; i < s; i++) + if ((e = this.type.animations[i]).sid === t) + return e; + return null + } + , + i.doChangeAnim = function() { + var t = this.cur_animation.frames[this.cur_frame] + , e = this.getAnimationByName(this.changeAnimName); + this.changeAnimName = "", + e && (cr.equals_nocase(e.name, this.cur_animation.name) && this.animPlaying || (this.cur_animation = e, + this.cur_anim_speed = e.speed, + this.cur_anim_repeatto = e.repeatto, + this.cur_frame < 0 && (this.cur_frame = 0), + this.cur_frame >= this.cur_animation.frames.length && (this.cur_frame = this.cur_animation.frames.length - 1), + 1 === this.changeAnimFrom && (this.cur_frame = 0), + this.animPlaying = !0, + this.frameStart = this.getNowTime(), + this.animForwards = !0, + this.OnFrameChanged(t, this.cur_animation.frames[this.cur_frame]), + this.runtime.redraw = !0)) + } + , + i.doChangeAnimFrame = function() { + var t = this.cur_animation.frames[this.cur_frame] + , e = this.cur_frame; + this.cur_frame = cr.floor(this.changeAnimFrame), + this.cur_frame < 0 && (this.cur_frame = 0), + this.cur_frame >= this.cur_animation.frames.length && (this.cur_frame = this.cur_animation.frames.length - 1), + e !== this.cur_frame && (this.OnFrameChanged(t, this.cur_animation.frames[this.cur_frame]), + this.frameStart = this.getNowTime(), + this.runtime.redraw = !0), + this.changeAnimFrame = -1 + } + , + i.OnFrameChanged = function(t, e) { + var i, s, n, r = t.width, o = t.height, a = e.width, h = e.height; + for (r != a && (this.width *= a / r), + o != h && (this.height *= h / o), + this.hotspotX = e.hotspotX, + this.hotspotY = e.hotspotY, + this.collision_poly.set_pts(e.poly_pts), + this.set_bbox_changed(), + this.curFrame = e, + this.curWebGLTexture = e.webGL_texture, + i = 0, + s = this.behavior_insts.length; i < s; i++) + (n = this.behavior_insts[i]).onSpriteFrameChanged && n.onSpriteFrameChanged(t, e); + this.runtime.trigger(cr.plugins_.Sprite.prototype.cnds.OnFrameChanged, this) + } + , + i.draw = function(t) { + t.globalAlpha = this.opacity; + var e, i, s = this.curFrame, n = s.spritesheeted, r = s.texture_img, o = this.x, a = this.y, h = this.width, c = this.height; + 0 === this.angle && 0 <= h && 0 <= c ? (o -= this.hotspotX * h, + a -= this.hotspotY * c, + this.runtime.pixel_rounding && (o = Math.round(o), + a = Math.round(a)), + n ? t.drawImage(r, s.offx, s.offy, s.width, s.height, o, a, h, c) : t.drawImage(r, o, a, h, c)) : (this.runtime.pixel_rounding && (o = Math.round(o), + a = Math.round(a)), + t.save(), + e = 0 < h ? 1 : -1, + i = 0 < c ? 1 : -1, + t.translate(o, a), + 1 == e && 1 == i || t.scale(e, i), + t.rotate(this.angle * e * i), + e = 0 - this.hotspotX * cr.abs(h), + i = 0 - this.hotspotY * cr.abs(c), + n ? t.drawImage(r, s.offx, s.offy, s.width, s.height, e, i, cr.abs(h), cr.abs(c)) : t.drawImage(r, e, i, cr.abs(h), cr.abs(c)), + t.restore()) + } + , + i.drawGL_earlyZPass = function(t) { + this.drawGL(t) + } + , + i.drawGL = function(t) { + t.setTexture(this.curWebGLTexture), + t.setOpacity(this.opacity); + var e, i, s = this.curFrame, n = this.bquad; + this.runtime.pixel_rounding ? (e = Math.round(this.x) - this.x, + i = Math.round(this.y) - this.y, + s.spritesheeted ? t.quadTex(n.tlx + e, n.tly + i, n.trx + e, n.try_ + i, n.brx + e, n.bry + i, n.blx + e, n.bly + i, s.sheetTex) : t.quad(n.tlx + e, n.tly + i, n.trx + e, n.try_ + i, n.brx + e, n.bry + i, n.blx + e, n.bly + i)) : s.spritesheeted ? t.quadTex(n.tlx, n.tly, n.trx, n.try_, n.brx, n.bry, n.blx, n.bly, s.sheetTex) : t.quad(n.tlx, n.tly, n.trx, n.try_, n.brx, n.bry, n.blx, n.bly) + } + , + i.getImagePointIndexByName = function(t) { + for (var e = this.curFrame, i = 0, s = e.image_points.length; i < s; i++) + if (cr.equals_nocase(t, e.image_points[i][0])) + return i; + return -1 + } + , + i.getImagePoint = function(t, e) { + var i = this.curFrame + , s = i.image_points + , n = cr.is_string(t) ? this.getImagePointIndexByName(t) : t - 1; + if ((n = cr.floor(n)) < 0 || n >= s.length) + return e ? this.x : this.y; + var r = (s[n][1] - i.hotspotX) * this.width + , t = ((t = s[n][2]) - i.hotspotY) * this.height + , s = Math.cos(this.angle) + , n = Math.sin(this.angle) + , i = r * s - t * n; + return t = t * s + r * n, + r = i, + r += this.x, + t += this.y, + e ? r : t + } + ; + var o = []; + function v(t) { + t[0] = 0, + t[1] = 0, + t[2] = 0, + o.push(t) + } + function b(t, e) { + return t < e ? t + "," + e : e + "," + t + } + function w(t, e, i, s) { + var n = e.uid + , r = i.uid + , e = b(n, r); + t.hasOwnProperty(e) ? t[e][2] = s : ((i = o.length ? o.pop() : [0, 0, 0])[0] = n, + i[1] = r, + i[2] = s, + t[e] = i) + } + var x = -2 + , S = []; + s.prototype.OnCollision = function(t) { + if (!t) + return !1; + var e = this.runtime + , i = e.getCurrentCondition() + , s = i.type + , n = null; + i.extra.collmemory ? n = i.extra.collmemory : (n = {}, + i.extra.collmemory = n), + i.extra.spriteCreatedDestroyCallback || (i.extra.spriteCreatedDestroyCallback = !0, + e.addDestroyCallback(function(n) { + !function(t) { + var e, i, s = n.uid; + for (e in t) + t.hasOwnProperty(e) && ((i = t[e])[0] !== s && i[1] !== s || (v(t[e]), + delete t[e])) + }(i.extra.collmemory) + })); + for (var r, o, a, h, c, l, u, p = s.getCurrentSol(), d = t.getCurrentSol(), f = p.getObjects(), y = this.runtime.tickcount, g = y - 1, m = e.getCurrentEventStack().current_event, _ = (m.orblock, + 0); _ < f.length; _++) { + for (o = f[_], + d.select_all ? (o.update_bbox(), + this.runtime.getCollisionCandidates(o.layer, t, o.bbox, S), + r = S, + this.runtime.addRegisteredCollisionCandidates(o, t, r)) : r = d.getObjects(), + a = 0; a < r.length; a++) + c = r[a], + e.testOverlap(o, c) || e.checkRegisteredCollision(o, c) ? (l = n, + u = c, + u = b(o.uid, u.uid), + u = !(l.hasOwnProperty(u) ? (x = l[u][2], + !0) : !(x = -2)) || x < g, + w(n, o, c, y), + u && (e.pushCopySol(m.solModifiers), + u = s.getCurrentSol(), + h = t.getCurrentSol(), + u.select_all = !1, + h.select_all = !1, + s === t ? (u.instances.length = 2, + u.instances[0] = o, + u.instances[1] = c, + s.applySolToContainer()) : (u.instances.length = 1, + h.instances.length = 1, + u.instances[0] = o, + h.instances[0] = c, + s.applySolToContainer(), + t.applySolToContainer()), + m.retrigger(), + e.popSol(m.solModifiers))) : (h = n, + c = c, + c = b(o.uid, c.uid), + h.hasOwnProperty(c) && (v(h[c]), + delete h[c])); + cr.clearArray(S) + } + return !1 + } + ; + var y = null + , g = new cr.ObjectSet + , m = !1 + , _ = [] + , T = new cr.rect(0,0,0,0); + function r(t, e, i) { + if (!t) + return !1; + var s, n, r, o, a, h = 0 !== e || 0 !== i, c = !1, l = this.runtime.getCurrentCondition(), u = l.type, p = l.inverted, d = t.getCurrentSol(), l = this.runtime.getCurrentEventStack().current_event.orblock, f = d.select_all ? (this.update_bbox(), + T.copy(this.bbox), + T.offset(e, i), + this.runtime.getCollisionCandidates(this.layer, t, T, _), + _) : !l || this.runtime.isCurrentConditionFirst() && !d.else_instances.length && d.instances.length ? d.instances : d.else_instances; + for (m = u !== (y = t) && !p, + h && (s = this.x, + n = this.y, + this.x += e, + this.y += i, + this.set_bbox_changed()), + r = 0, + o = f.length; r < o; r++) + if (a = f[r], + this.runtime.testOverlap(this, a)) { + if (c = !0, + p) + break; + u !== t && g.add(a) + } + return h && (this.x = s, + this.y = n, + this.set_bbox_changed()), + cr.clearArray(_), + c + } + function a() {} + function h() {} + e.finish = function(t) { + if (m) { + if (t) { + var e, t = this.runtime.getCurrentEventStack().current_event.orblock, i = y.getCurrentSol(), s = g.valuesRef(); + if (i.select_all) { + for (i.select_all = !1, + cr.clearArray(i.instances), + r = 0, + o = s.length; r < o; ++r) + i.instances[r] = s[r]; + if (t) + for (cr.clearArray(i.else_instances), + r = 0, + o = y.instances.length; r < o; ++r) + e = y.instances[r], + g.contains(e) || i.else_instances.push(e) + } else if (t) + for (var n = i.instances.length, r = 0, o = s.length; r < o; ++r) + i.instances[n + r] = s[r], + cr.arrayFindRemove(i.else_instances, s[r]); + else + cr.shallowAssignArray(i.instances, s); + y.applySolToContainer() + } + g.clear(), + m = !1 + } + } + , + s.prototype.IsOverlapping = function(t) { + return r.call(this, t, 0, 0) + } + , + s.prototype.IsOverlappingOffset = function(t, e, i) { + return r.call(this, t, e, i) + } + , + s.prototype.IsAnimPlaying = function(t) { + return this.changeAnimName.length ? cr.equals_nocase(this.changeAnimName, t) : cr.equals_nocase(this.cur_animation.name, t) + } + , + s.prototype.CompareFrame = function(t, e) { + return cr.do_cmp(this.cur_frame, t, e) + } + , + s.prototype.CompareAnimSpeed = function(t, e) { + var i = this.animForwards ? this.cur_anim_speed : -this.cur_anim_speed; + return cr.do_cmp(i, t, e) + } + , + s.prototype.OnAnimFinished = function(t) { + return cr.equals_nocase(this.animTriggerName, t) + } + , + s.prototype.OnAnyAnimFinished = function() { + return !0 + } + , + s.prototype.OnFrameChanged = function() { + return !0 + } + , + s.prototype.IsMirrored = function() { + return this.width < 0 + } + , + s.prototype.IsFlipped = function() { + return this.height < 0 + } + , + s.prototype.OnURLLoaded = function() { + return !0 + } + , + s.prototype.IsCollisionEnabled = function() { + return this.collisionsEnabled + } + , + t.cnds = new s, + a.prototype.Spawn = function(t, e, i) { + if (t && e) { + var s, n, r, o = this.runtime.createInstance(t, e, this.getImagePoint(i, !0), this.getImagePoint(i, !1)); + if (o) { + if (void 0 !== o.angle && (o.angle = this.angle, + o.set_bbox_changed()), + this.runtime.isInOnDestroy++, + this.runtime.trigger(Object.getPrototypeOf(t.plugin).cnds.OnCreated, o), + o.is_contained) + for (s = 0, + n = o.siblings.length; s < n; s++) + r = o.siblings[s], + this.runtime.trigger(Object.getPrototypeOf(r.type.plugin).cnds.OnCreated, r); + this.runtime.isInOnDestroy--; + var a, i = this.runtime.getCurrentAction(), h = !1; + if ((cr.is_undefined(i.extra.Spawn_LastExec) || i.extra.Spawn_LastExec < this.runtime.execcount) && (h = !0, + i.extra.Spawn_LastExec = this.runtime.execcount), + t != this.type && ((a = t.getCurrentSol()).select_all = !1, + h ? (cr.clearArray(a.instances), + a.instances[0] = o) : a.instances.push(o), + o.is_contained)) + for (s = 0, + n = o.siblings.length; s < n; s++) + (a = (r = o.siblings[s]).type.getCurrentSol()).select_all = !1, + h ? (cr.clearArray(a.instances), + a.instances[0] = r) : a.instances.push(r) + } + } + } + , + a.prototype.SetEffect = function(t) { + this.blend_mode = t, + this.compositeOp = cr.effectToCompositeOp(t), + cr.setGLBlend(this, t, this.runtime.gl), + this.runtime.redraw = !0 + } + , + a.prototype.StopAnim = function() { + this.animPlaying = !1 + } + , + a.prototype.StartAnim = function(t) { + this.animPlaying = !0, + this.frameStart = this.getNowTime(), + 1 === t && 0 !== this.cur_frame && (this.changeAnimFrame = 0, + this.inAnimTrigger || this.doChangeAnimFrame()), + this.isTicking || (this.runtime.tickMe(this), + this.isTicking = !0) + } + , + a.prototype.SetAnim = function(t, e) { + this.changeAnimName = t, + this.changeAnimFrom = e, + this.isTicking || (this.runtime.tickMe(this), + this.isTicking = !0), + this.inAnimTrigger || this.doChangeAnim() + } + , + a.prototype.SetAnimFrame = function(t) { + this.changeAnimFrame = t, + this.isTicking || (this.runtime.tickMe(this), + this.isTicking = !0), + this.inAnimTrigger || this.doChangeAnimFrame() + } + , + a.prototype.SetAnimSpeed = function(t) { + this.cur_anim_speed = cr.abs(t), + this.animForwards = 0 <= t, + this.isTicking || (this.runtime.tickMe(this), + this.isTicking = !0) + } + , + a.prototype.SetAnimRepeatToFrame = function(t) { + (t = Math.floor(t)) < 0 && (t = 0), + t >= this.cur_animation.frames.length && (t = this.cur_animation.frames.length - 1), + this.cur_anim_repeatto = t + } + , + a.prototype.SetMirrored = function(t) { + t = cr.abs(this.width) * (0 === t ? -1 : 1); + this.width !== t && (this.width = t, + this.set_bbox_changed()) + } + , + a.prototype.SetFlipped = function(t) { + t = cr.abs(this.height) * (0 === t ? -1 : 1); + this.height !== t && (this.height = t, + this.set_bbox_changed()) + } + , + a.prototype.SetScale = function(t) { + var e = this.curFrame + , i = this.width < 0 ? -1 : 1 + , s = this.height < 0 ? -1 : 1 + , i = e.width * t * i + , s = e.height * t * s; + this.width === i && this.height === s || (this.width = i, + this.height = s, + this.set_bbox_changed()) + } + , + a.prototype.LoadURL = function(t, e, i) { + var s = new Image + , n = this + , r = this.curFrame; + s.onload = function() { + if (r.texture_img.src === s.src) + return n.runtime.glwrap && n.curFrame === r && (n.curWebGLTexture = r.webGL_texture), + 0 === e && (n.width = s.width, + n.height = s.height, + n.set_bbox_changed()), + n.runtime.redraw = !0, + void n.runtime.trigger(cr.plugins_.Sprite.prototype.cnds.OnURLLoaded, n); + r.texture_img = s, + r.offx = 0, + r.offy = 0, + r.width = s.width, + r.height = s.height, + r.spritesheeted = !1, + r.datauri = "", + r.pixelformat = 0, + n.runtime.glwrap && (r.webGL_texture && n.runtime.glwrap.deleteTexture(r.webGL_texture), + r.webGL_texture = n.runtime.glwrap.loadTexture(s, !1, n.runtime.linearSampling), + n.curFrame === r && (n.curWebGLTexture = r.webGL_texture), + n.type.updateAllCurrentTexture()), + 0 === e && (n.width = s.width, + n.height = s.height, + n.set_bbox_changed()), + n.runtime.redraw = !0, + n.runtime.trigger(cr.plugins_.Sprite.prototype.cnds.OnURLLoaded, n) + } + , + "data:" !== t.substr(0, 5) && 0 === i && (s.crossOrigin = "anonymous"), + this.runtime.setImageSrc(s, t) + } + , + a.prototype.SetCollisions = function(t) { + this.collisionsEnabled !== (0 !== t) && (this.collisionsEnabled = 0 !== t, + this.collisionsEnabled ? this.set_bbox_changed() : (this.collcells.right >= this.collcells.left && this.type.collision_grid.update(this, this.collcells, null), + this.collcells.set(0, 0, -1, -1))) + } + , + t.acts = new a, + h.prototype.AnimationFrame = function(t) { + t.set_int(this.cur_frame) + } + , + h.prototype.AnimationFrameCount = function(t) { + t.set_int(this.cur_animation.frames.length) + } + , + h.prototype.AnimationName = function(t) { + t.set_string(this.cur_animation.name) + } + , + h.prototype.AnimationSpeed = function(t) { + t.set_float(this.animForwards ? this.cur_anim_speed : -this.cur_anim_speed) + } + , + h.prototype.ImagePointX = function(t, e) { + t.set_float(this.getImagePoint(e, !0)) + } + , + h.prototype.ImagePointY = function(t, e) { + t.set_float(this.getImagePoint(e, !1)) + } + , + h.prototype.ImagePointCount = function(t) { + t.set_int(this.curFrame.image_points.length) + } + , + h.prototype.ImageWidth = function(t) { + t.set_float(this.curFrame.width) + } + , + h.prototype.ImageHeight = function(t) { + t.set_float(this.curFrame.height) + } + , + t.exps = new h +}(); +var jText = ""; +cr.plugins_.SpriteFontPlus = function(t) { + this.runtime = t +} +, +function() { + var t = cr.plugins_.SpriteFontPlus.prototype; + t.onCreate = function() {} + , + t.Type = function(t) { + this.plugin = t, + this.runtime = t.runtime + } + ; + var e = t.Type.prototype; + function p(t) { + return t.replace(/\s\s*$/, "") + } + e.onCreate = function() { + this.is_family || (this.texture_img = new Image, + this.texture_img.crossOrigin = "anonymous", + this.texture_img.idtkLoadDisposed = !0, + this.texture_img.src = this.texture_file, + this.runtime.wait_for_textures.push(this.texture_img), + this.webGL_texture = null) + } + , + e.onLostWebGLContext = function() { + this.is_family || (this.webGL_texture = null) + } + , + e.onRestoreWebGLContext = function() { + var t, e; + if (!this.is_family && this.instances.length) + for (this.webGL_texture || (this.webGL_texture = this.runtime.glwrap.loadTexture(this.texture_img, !1, this.runtime.linearSampling, this.texture_pixelformat)), + t = 0, + e = this.instances.length; t < e; t++) + this.instances[t].webGL_texture = this.webGL_texture + } + , + e.unloadTextures = function() { + this.is_family || this.instances.length || !this.webGL_texture || (this.runtime.glwrap.deleteTexture(this.webGL_texture), + this.webGL_texture = null) + } + , + e.preloadCanvas2D = function(t) { + t.drawImage(this.texture_img, 0, 0) + } + , + t.Instance = function(t) { + this.type = t, + this.runtime = t.runtime + } + , + (e = t.Instance.prototype).onDestroy = function() { + var t; + h(this.lines), + t = this.clipList, + s(b, t, !1), + t = this.clipUV, + s(w, t, !1), + cr.wipe(this.characterWidthList) + } + , + e.onCreate = function() { + this.texture_img = this.type.texture_img, + this.characterWidth = this.properties[0], + this.characterHeight = this.properties[1], + this.characterSet = this.properties[2], + this.text = this.properties[3], + this.characterScale = this.properties[4], + this.visible = 0 === this.properties[5], + this.halign = this.properties[6] / 2, + this.valign = this.properties[7] / 2, + this.wrapbyword = 0 === this.properties[9], + this.characterSpacing = this.properties[10], + this.lineHeight = this.properties[11], + this.textWidth = 0, + this.textHeight = 0, + this.charWidthJSON = this.properties[12], + this.spaceWidth = this.properties[13], + console.log(this.charWidthJSON), + jText = this.charWidthJSON, + this.recycled ? (this.lines.length = 0, + cr.wipe(this.clipList), + cr.wipe(this.clipUV), + cr.wipe(this.characterWidthList)) : (this.lines = [], + this.clipList = {}, + this.clipUV = {}, + this.characterWidthList = {}); + try { + if (this.charWidthJSON) + if (-1 !== this.charWidthJSON.indexOf('""c2array""')) + for (var t = (r = jQuery.parseJSON(this.charWidthJSON.replace(/""/g, '"'))).size[1], e = 0; e < t; e++) + for (var i = r.data[1][e][0], s = r.data[0][e][0], n = 0; n < i.length; n++) + this.characterWidthList[i.charAt(n)] = s; + else + for (var r, t = (r = jQuery.parseJSON(this.charWidthJSON)).length, e = 0; e < t; e++) + for (i = r[e][1], + s = r[e][0], + n = 0; n < i.length; n++) + this.characterWidthList[i.charAt(n)] = s; + -1 !== this.spaceWidth && (this.characterWidthList[" "] = this.spaceWidth) + } catch (t) { + window.console && window.console.log && window.console.log("SpriteFont+ Failure: " + t) + } + this.text_changed = !0, + this.lastwrapwidth = this.width, + this.runtime.glwrap && (this.type.webGL_texture || (this.type.webGL_texture = this.runtime.glwrap.loadTexture(this.type.texture_img, !1, this.runtime.linearSampling, this.type.texture_pixelformat)), + this.webGL_texture = this.type.webGL_texture), + this.SplitSheet() + } + , + e.saveToJSON = function() { + var t, e = { + t: this.text, + csc: this.characterScale, + csp: this.characterSpacing, + lh: this.lineHeight, + tw: this.textWidth, + th: this.textHeight, + lrt: this.last_render_tick, + cw: {} + }; + for (t in this.characterWidthList) + e.cw[t] = this.characterWidthList[t]; + return e + } + , + e.loadFromJSON = function(t) { + for (var e in this.text = t.t, + this.characterScale = t.csc, + this.characterSpacing = t.csp, + this.lineHeight = t.lh, + this.textWidth = t.tw, + this.textHeight = t.th, + this.last_render_tick = t.lrt, + t.cw) + this.characterWidthList[e] = t.cw[e]; + this.text_changed = !0, + this.lastwrapwidth = this.width + } + ; + var i = 1e3; + function v(t, e) { + return t.length ? t.pop() : new e + } + function d(t, e) { + t.length < i && t.push(e) + } + function s(t, e, i) { + if (i) { + for (var s = 0, n = e.length; s < n; s++) + d(t, e[s]); + e.length = 0 + } else + for (var r in e) + Object.prototype.hasOwnProperty.call(e, r) && (d(t, e[r]), + delete e[r]) + } + function f(t, e, i) { + var s = t.lines; + i = p(i), + e >= s.length && s.push(a()), + (e = s[e]).text = i, + e.width = t.measureWidth(i), + t.textWidth = cr.max(t.textWidth, e.width) + } + var y = []; + function a() { + return v(y, Object) + } + function h(t) { + s(y, t, !0) + } + var b = [] + , w = []; + e.SplitSheet = function() { + for (var t, e, i, s, n, r, o = this.texture_img, a = o.width, o = o.height, h = this.characterWidth, c = this.characterHeight, l = h / a, u = c / o, p = this.characterSet, d = Math.floor(a / h), f = Math.floor(o / c), y = 0; y < p.length && !(d * f <= y); y++) { + var g = y % d + , m = Math.floor(y / d) + , _ = p.charAt(y); + this.runtime.glwrap ? (t = this.clipUV, + i = g * l, + s = m * u, + n = (1 + g) * l, + r = (m + 1) * u, + void 0 === t[e = _] && (t[e] = v(w, cr.rect)), + t[e].left = i, + t[e].top = s, + t[e].right = n, + t[e].bottom = r) : (t = this.clipList, + e = g * h, + r = m * c, + g = h, + m = c, + void 0 === t[_ = _] && (t[_] = v(b, Object)), + t[_].x = e, + t[_].y = r, + t[_].w = g, + t[_].h = m) + } + } + ; + var g = []; + t.TokeniseWords = function(t) { + for (var e, i = "", s = g.length = 0; s < t.length; ) + if ("\n" === (e = t.charAt(s))) + i.length && (g.push(i), + i = ""), + g.push("\n"), + ++s; + else if (" " === e || "\t" === e || "-" === e) { + for (; i += t.charAt(s), + s++, + s < t.length && (" " === t.charAt(s) || "\t" === t.charAt(s)); ) + ; + g.push(i), + i = "" + } else + s < t.length && (i += e, + s++); + i.length && g.push(i) + } + , + t.WordWrap = function(t) { + var e = t.text + , i = t.lines; + if (e && e.length) { + var s = t.width; + if (s <= 2) + h(i); + else { + var n = t.characterWidth + , r = t.characterScale + , o = t.characterSpacing; + if (e.length * (n * r + o) - o <= s && -1 === e.indexOf("\n")) { + o = t.measureWidth(e); + if (o <= s) + return h(i), + i.push(a()), + i[0].text = e, + i[0].width = o, + t.textWidth = o, + void (t.textHeight = t.characterHeight * r + t.lineHeight) + } + t.wrapbyword; + this.WrapText(t), + t.textHeight = i.length * (t.characterHeight * r + t.lineHeight) + } + } else + h(i) + } + , + t.WrapText = function(t) { + for (var e, i, s = t.wrapbyword, n = t.text, r = t.lines, o = t.width, a = s ? (this.TokeniseWords(n), + g) : n, h = "", c = 0, l = !1, u = 0; u < a.length; u++) + "\n" !== a[u] ? (l = !1, + e = h, + h += a[u], + o < t.measureWidth(p(h)) && ("" === e ? (f(t, c, h), + l = !(h = "")) : (f(t, c, e), + h = a[u]), + c++, + s || " " !== h || (h = ""))) : (!0 === l ? l = !1 : (f(t, c, h), + c++), + h = ""); + for (p(h).length && (f(t, c, h), + c++), + u = c; u < r.length; u++) + i = r[u], + d(y, i); + r.length = c + } + , + e.measureWidth = function(t) { + for (var e = this.characterSpacing, i = t.length, s = 0, n = 0; n < i; n++) + s += this.getCharacterWidth(t.charAt(n)) * this.characterScale + e; + return s -= 0 < s ? e : 0 + } + , + e.getCharacterWidth = function(t) { + var e = this.characterWidthList; + return void 0 !== e[t] ? e[t] : this.characterWidth + } + , + e.rebuildText = function() { + !this.text_changed && this.width === this.lastwrapwidth || (this.textWidth = 0, + this.textHeight = 0, + this.type.plugin.WordWrap(this), + this.text_changed = !1, + this.lastwrapwidth = this.width) + } + , + e.draw = function(t, e) { + var i = this.texture_img; + if ("" !== this.text && null != i && (this.rebuildText(), + !(this.height < this.characterHeight * this.characterScale + this.lineHeight))) { + t.globalAlpha = this.opacity; + var s = this.x + , i = this.y; + this.runtime.pixel_rounding && (s = s + .5 | 0, + i = i + .5 | 0), + t.save(), + t.translate(s, i), + t.rotate(this.angle); + for (var n = this.halign, s = this.valign, r = this.characterScale, o = this.characterHeight * r, a = this.lineHeight, h = this.characterSpacing, c = this.lines, i = this.textHeight, s = s * cr.max(0, this.height - i), l = -(this.hotspotX * this.width), i = -(this.hotspotY * this.height), u = i += s, p = 0; p < c.length; p++) { + var d = c[p].text + , f = c[p].width + , y = l + n * cr.max(0, this.width - f); + u += a; + for (var g = 0; g < d.length; g++) { + var m = d.charAt(g) + , _ = this.clipList[m]; + if (y + this.getCharacterWidth(m) * r > this.width + 1e-5) + break; + void 0 !== _ && t.drawImage(this.texture_img, _.x, _.y, _.w, _.h, Math.round(y), Math.round(u), _.w * r, _.h * r), + y += this.getCharacterWidth(m) * r + h + } + if ((u += o) + o + a > this.height) + break + } + t.restore() + } + } + ; + var I = new cr.quad; + function n() {} + function r() {} + function o() {} + e.drawGL = function(t) { + if (t.setTexture(this.webGL_texture), + t.setOpacity(this.opacity), + "" !== this.text && (this.rebuildText(), + !(this.height < this.characterHeight * this.characterScale + this.lineHeight))) { + this.update_bbox(); + var e = this.bquad + , i = 0 + , s = 0; + this.runtime.pixel_rounding && (i = (this.x + .5 | 0) - this.x, + s = (this.y + .5 | 0) - this.y); + var n, r, o = this.angle, a = this.halign, h = this.valign, c = this.characterScale, l = this.characterHeight * c, u = this.lineHeight, p = this.characterSpacing, d = this.lines, f = this.textHeight; + 0 !== o && (n = Math.cos(o), + r = Math.sin(o)); + for (var f = h * cr.max(0, this.height - f), y = e.tlx + i, g = e.tly + s, m = f, _ = 0; _ < d.length; _++) { + var v = d[_].text + , b = d[_].width + , w = a * cr.max(0, this.width - b); + m += u; + for (var x = 0; x < v.length; x++) { + var S = v.charAt(x) + , T = this.clipUV[S]; + if (w + this.getCharacterWidth(S) * c > this.width + 1e-5) + break; + void 0 !== T && (O = this.characterWidth * c, + A = this.characterHeight * c, + I.tlx = w, + I.tly = m, + I.trx = w + O, + I.try_ = m, + I.blx = w, + I.bly = m + A, + I.brx = w + O, + I.bry = m + A, + 0 !== o && (C = n, + k = r, + O = void 0, + O = (A = I).tlx * C - A.tly * k, + A.tly = A.tly * C + A.tlx * k, + A.tlx = O, + O = A.trx * C - A.try_ * k, + A.try_ = A.try_ * C + A.trx * k, + A.trx = O, + O = A.blx * C - A.bly * k, + A.bly = A.bly * C + A.blx * k, + A.blx = O, + O = A.brx * C - A.bry * k, + A.bry = A.bry * C + A.brx * k, + A.brx = O), + I.offset(y, g), + t.quadTex(I.tlx, I.tly, I.trx, I.try_, I.brx, I.bry, I.blx, I.bly, T)), + w += this.getCharacterWidth(S) * c + p + } + if ((m += l) + l + u > this.height) + break + } + } + var A, C, k, O + } + , + n.prototype.CompareText = function(t, e) { + return e ? this.text == t : cr.equals_nocase(this.text, t) + } + , + t.cnds = new n, + r.prototype.SetText = function(t) { + cr.is_number(t) && t < 1e9 && (t = Math.round(1e10 * t) / 1e10); + t = t.toString(); + this.text !== t && (this.text = t, + this.text_changed = !0, + this.runtime.redraw = !0) + } + , + r.prototype.AppendText = function(t) { + cr.is_number(t) && (t = Math.round(1e10 * t) / 1e10); + t = t.toString(); + t && (this.text += t, + this.text_changed = !0, + this.runtime.redraw = !0) + } + , + r.prototype.SetScale = function(t) { + t !== this.characterScale && (this.characterScale = t, + this.text_changed = !0, + this.runtime.redraw = !0) + } + , + r.prototype.SetCharacterSpacing = function(t) { + t !== this.CharacterSpacing && (this.characterSpacing = t, + this.text_changed = !0, + this.runtime.redraw = !0) + } + , + r.prototype.SetLineHeight = function(t) { + t !== this.lineHeight && (this.lineHeight = t, + this.text_changed = !0, + this.runtime.redraw = !0) + } + , + e.SetCharWidth = function(t, e) { + e = parseInt(e, 10); + this.characterWidthList[t] !== e && (this.characterWidthList[t] = e, + this.text_changed = !0, + this.runtime.redraw = !0) + } + , + r.prototype.SetCharacterWidth = function(t, e) { + if ("" !== t) + for (var i = 0; i < t.length; i++) + this.SetCharWidth(t.charAt(i), e) + } + , + r.prototype.SetEffect = function(t) { + this.compositeOp = cr.effectToCompositeOp(t), + cr.setGLBlend(this, t, this.runtime.gl), + this.runtime.redraw = !0 + } + , + t.acts = new r, + o.prototype.CharacterWidth = function(t, e) { + t.set_int(this.getCharacterWidth(e)) + } + , + o.prototype.CharacterHeight = function(t) { + t.set_int(this.characterHeight) + } + , + o.prototype.CharacterScale = function(t) { + t.set_float(this.characterScale) + } + , + o.prototype.CharacterSpacing = function(t) { + t.set_int(this.characterSpacing) + } + , + o.prototype.LineHeight = function(t) { + t.set_int(this.lineHeight) + } + , + o.prototype.Text = function(t) { + t.set_string(this.text) + } + , + o.prototype.TextWidth = function(t) { + this.rebuildText(), + t.set_float(this.textWidth) + } + , + o.prototype.TextHeight = function(t) { + this.rebuildText(), + t.set_float(this.textHeight) + } + , + t.exps = new o +}(), +cr.plugins_.Text = function(t) { + this.runtime = t +} +, +function() { + var t = cr.plugins_.Text.prototype; + t.onCreate = function() { + t.acts.SetWidth = function(t) { + this.width !== t && (this.width = t, + this.text_changed = !0, + this.set_bbox_changed()) + } + } + , + t.Type = function(t) { + this.plugin = t, + this.runtime = t.runtime + } + , + (e = t.Type.prototype).onCreate = function() {} + , + e.onLostWebGLContext = function() { + if (!this.is_family) + for (var t, e = 0, i = this.instances.length; e < i; e++) + (t = this.instances[e]).mycanvas = null, + t.myctx = null, + t.mytex = null + } + , + t.Instance = function(t) { + this.type = t, + this.runtime = t.runtime, + this.recycled ? cr.clearArray(this.lines) : this.lines = [], + this.text_changed = !0 + } + ; + var e = t.Instance.prototype + , o = {}; + e.onCreate = function() { + this.text = this.properties[0], + this.visible = 0 === this.properties[1], + this.font = this.properties[2], + this.color = this.properties[3], + this.halign = this.properties[4], + this.valign = this.properties[5], + this.wrapbyword = 0 === this.properties[7], + this.lastwidth = this.width, + this.lastwrapwidth = this.width, + this.lastheight = this.height, + this.line_height_offset = this.properties[8], + this.facename = "", + this.fontstyle = "", + this.ptSize = 0, + this.textWidth = 0, + this.textHeight = 0, + this.parseFont(), + this.mycanvas = null, + this.myctx = null, + this.mytex = null, + this.need_text_redraw = !1, + this.last_render_tick = this.runtime.tickcount, + this.recycled ? this.rcTex.set(0, 0, 1, 1) : this.rcTex = new cr.rect(0,0,1,1), + this.runtime.glwrap && this.runtime.tickMe(this) + } + , + e.parseFont = function() { + for (var t = this.font.split(" "), e = 0; e < t.length; e++) + if ("pt" === t[e].substr(t[e].length - 2, 2)) { + for (this.ptSize = parseInt(t[e].substr(0, t[e].length - 2)), + this.pxHeight = Math.ceil(this.ptSize / 72 * 96) + 4, + 0 < e && (this.fontstyle = t[e - 1]), + this.facename = t[e + 1], + e += 2; e < t.length; e++) + this.facename += " " + t[e]; + break + } + } + , + e.saveToJSON = function() { + return { + t: this.text, + f: this.font, + c: this.color, + ha: this.halign, + va: this.valign, + wr: this.wrapbyword, + lho: this.line_height_offset, + fn: this.facename, + fs: this.fontstyle, + ps: this.ptSize, + pxh: this.pxHeight, + tw: this.textWidth, + th: this.textHeight, + lrt: this.last_render_tick + } + } + , + e.loadFromJSON = function(t) { + this.text = t.t, + this.font = t.f, + this.color = t.c, + this.halign = t.ha, + this.valign = t.va, + this.wrapbyword = t.wr, + this.line_height_offset = t.lho, + this.facename = t.fn, + this.fontstyle = t.fs, + this.ptSize = t.ps, + this.pxHeight = t.pxh, + this.textWidth = t.tw, + this.textHeight = t.th, + this.last_render_tick = t.lrt, + this.text_changed = !0, + this.lastwidth = this.width, + this.lastwrapwidth = this.width, + this.lastheight = this.height + } + , + e.tick = function() { + var t, e; + this.runtime.glwrap && this.mytex && 300 <= this.runtime.tickcount - this.last_render_tick && (t = this.layer, + this.update_bbox(), + ((e = this.bbox).right < t.viewLeft || e.bottom < t.viewTop || e.left > t.viewRight || e.top > t.viewBottom) && (this.runtime.glwrap.deleteTexture(this.mytex), + this.mytex = null, + this.myctx = null, + this.mycanvas = null)) + } + , + e.onDestroy = function() { + this.myctx = null, + this.mycanvas = null, + this.runtime.glwrap && this.mytex && this.runtime.glwrap.deleteTexture(this.mytex), + this.mytex = null + } + , + e.updateFont = function() { + this.font = this.fontstyle + " " + this.ptSize.toString() + "pt " + this.facename, + this.text_changed = !0, + this.runtime.redraw = !0 + } + , + e.draw = function(t, e) { + t.font = this.font, + t.textBaseline = "top", + t.fillStyle = this.color, + t.globalAlpha = e ? 1 : this.opacity; + var i; + e && (i = Math.abs(this.layer.getScale()), + t.save(), + t.scale(i, i)), + !this.text_changed && this.width === this.lastwrapwidth || (this.type.plugin.WordWrap(this.text, this.lines, t, this.width, this.wrapbyword), + this.text_changed = !1, + this.lastwrapwidth = this.width), + this.update_bbox(); + var s = e ? 0 : this.bquad.tlx + , n = e ? 0 : this.bquad.tly; + this.runtime.pixel_rounding && (s = s + .5 | 0, + n = n + .5 | 0), + 0 === this.angle || e || (t.save(), + t.translate(s, n), + t.rotate(this.angle), + n = s = 0); + var r, o, a = n + this.height, h = this.pxHeight; + for (h += this.line_height_offset, + 1 === this.valign ? n += Math.max(this.height / 2 - this.lines.length * h / 2, 0) : 2 === this.valign && (n += Math.max(this.height - this.lines.length * h - 2, 0)), + o = 0; o < this.lines.length && (r = s, + 1 === this.halign ? r = s + (this.width - this.lines[o].width) / 2 : 2 === this.halign && (r = s + (this.width - this.lines[o].width)), + t.fillText(this.lines[o].text, r, n), + !(a - h <= (n += h))); o++) + ; + 0 === this.angle && !e || t.restore(), + this.last_render_tick = this.runtime.tickcount + } + , + e.drawGL = function(t) { + var e, i, s, n, r, o, a, h, c, l, u, p, d, f, y, g, m; + this.width < 1 || this.height < 1 || (p = this.text_changed || this.need_text_redraw, + this.need_text_redraw = !1, + e = this.layer.getScale(), + i = this.layer.getAngle(), + s = this.rcTex, + n = e * this.width, + r = e * this.height, + o = Math.ceil(n), + a = Math.ceil(r), + d = Math.abs(o), + f = Math.abs(a), + y = this.runtime.draw_width / 2, + g = this.runtime.draw_height / 2, + this.myctx || (this.mycanvas = document.createElement("canvas"), + this.mycanvas.width = d, + this.mycanvas.height = f, + this.lastwidth = d, + this.lastheight = f, + p = !0, + this.myctx = this.mycanvas.getContext("2d")), + d === this.lastwidth && f === this.lastheight || (this.mycanvas.width = d, + this.mycanvas.height = f, + this.mytex && (t.deleteTexture(this.mytex), + this.mytex = null), + p = !0), + p && (this.myctx.clearRect(0, 0, d, f), + this.draw(this.myctx, !0), + this.mytex || (this.mytex = t.createEmptyTexture(d, f, this.runtime.linearSampling, this.runtime.isMobile)), + t.videoToTexture(this.mycanvas, this.mytex, this.runtime.isMobile)), + this.lastwidth = d, + this.lastheight = f, + t.setTexture(this.mytex), + t.setOpacity(this.opacity), + t.resetModelView(), + t.translate(-y, -g), + t.updateModelView(), + m = this.bquad, + h = this.layer.layerToCanvas(m.tlx, m.tly, !0, !0), + c = this.layer.layerToCanvas(m.tlx, m.tly, !1, !0), + l = this.layer.layerToCanvas(m.trx, m.try_, !0, !0), + u = this.layer.layerToCanvas(m.trx, m.try_, !1, !0), + p = this.layer.layerToCanvas(m.brx, m.bry, !0, !0), + d = this.layer.layerToCanvas(m.brx, m.bry, !1, !0), + f = this.layer.layerToCanvas(m.blx, m.bly, !0, !0), + y = this.layer.layerToCanvas(m.blx, m.bly, !1, !0), + (this.runtime.pixel_rounding || 0 === this.angle && 0 === i) && (h += g = (h + .5 | 0) - h, + c += m = (c + .5 | 0) - c, + l += g, + u += m, + p += g, + d += m, + f += g, + y += m), + 0 === this.angle && 0 === i ? (p = l = h + o, + f = h, + y = d = (u = c) + a, + s.right = 1, + s.bottom = 1) : (s.right = n / o, + s.bottom = r / a), + t.quadTex(h, c, l, u, p, d, f, y, s), + t.resetModelView(), + t.scale(e, e), + t.rotateZ(-this.layer.getAngle()), + t.translate((this.layer.viewLeft + this.layer.viewRight) / -2, (this.layer.viewTop + this.layer.viewBottom) / -2), + t.updateModelView(), + this.last_render_tick = this.runtime.tickcount) + } + ; + var u = []; + t.TokeniseWords = function(t) { + cr.clearArray(u); + for (var e, i = "", s = 0; s < t.length; ) + if ("\n" === (e = t.charAt(s))) + i.length && (u.push(i), + i = ""), + u.push("\n"), + ++s; + else if (" " === e || "\t" === e || "-" === e) { + for (; i += t.charAt(s), + s++, + s < t.length && (" " === t.charAt(s) || "\t" === t.charAt(s)); ) + ; + u.push(i), + i = "" + } else + s < t.length && (i += e, + s++); + i.length && u.push(i) + } + ; + var i = []; + function p() { + return i.length ? i.pop() : {} + } + function d(t) { + i.push(t) + } + function a(t) { + for (var e = 0, i = t.length; e < i; e++) + d(t[e]); + cr.clearArray(t) + } + function f(t) { + return t.length && " " === t.charAt(t.length - 1) ? t.substring(0, t.length - 1) : t + } + function s() {} + function n() {} + function r() {} + t.WordWrap = function(t, e, i, s, n) { + if (t && t.length) + if (s <= 2) + a(e); + else { + if (t.length <= 100 && -1 === t.indexOf("\n")) { + var r = i.measureText(t).width; + if (r <= s) + return a(e), + e.push(p()), + e[0].text = t, + void (e[0].width = r) + } + this.WrapText(t, e, i, s, n) + } + else + a(e) + } + , + t.WrapText = function(t, e, i, s, n) { + for (var r, o, a = n ? (this.TokeniseWords(t), + u) : t, h = "", c = 0, l = 0; l < a.length; l++) + "\n" !== a[l] ? (r = h, + h += a[l], + s <= i.measureText(h).width && (c >= e.length && e.push(p()), + r = f(r), + (o = e[c]).text = r, + o.width = i.measureText(r).width, + c++, + h = a[l], + n || " " !== h || (h = ""))) : (c >= e.length && e.push(p()), + h = f(h), + (o = e[c]).text = h, + o.width = i.measureText(h).width, + c++, + h = ""); + for (h.length && (c >= e.length && e.push(p()), + h = f(h), + (o = e[c]).text = h, + o.width = i.measureText(h).width, + c++), + l = c; l < e.length; l++) + d(e[l]); + e.length = c + } + , + s.prototype.CompareText = function(t, e) { + return e ? this.text == t : cr.equals_nocase(this.text, t) + } + , + t.cnds = new s, + n.prototype.SetText = function(t) { + cr.is_number(t) && t < 1e9 && (t = Math.round(1e10 * t) / 1e10); + t = t.toString(); + this.text !== t && (this.text = t, + this.text_changed = !0, + this.runtime.redraw = !0) + } + , + n.prototype.AppendText = function(t) { + cr.is_number(t) && (t = Math.round(1e10 * t) / 1e10); + t = t.toString(); + t && (this.text += t, + this.text_changed = !0, + this.runtime.redraw = !0) + } + , + n.prototype.SetFontFace = function(t, e) { + var i = ""; + switch (e) { + case 1: + i = "bold"; + break; + case 2: + i = "italic"; + break; + case 3: + i = "bold italic" + } + t === this.facename && i === this.fontstyle || (this.facename = t, + this.fontstyle = i, + this.updateFont()) + } + , + n.prototype.SetFontSize = function(t) { + this.ptSize !== t && (this.ptSize = t, + this.pxHeight = Math.ceil(this.ptSize / 72 * 96) + 4, + this.updateFont()) + } + , + n.prototype.SetFontColor = function(t) { + t = "rgb(" + cr.GetRValue(t).toString() + "," + cr.GetGValue(t).toString() + "," + cr.GetBValue(t).toString() + ")"; + t !== this.color && (this.color = t, + this.need_text_redraw = !0, + this.runtime.redraw = !0) + } + , + n.prototype.SetWebFont = function(t, e) { + if (this.runtime.isDomFree) + cr.logexport("[Construct 2] Text plugin: 'Set web font' not supported on this platform - the action has been ignored"); + else { + function i() { + s.runtime.redraw = !0, + s.text_changed = !0 + } + var s = this; + if (o.hasOwnProperty(e)) { + var n = "'" + t + "'"; + if (this.facename !== n) { + this.facename = n, + this.updateFont(); + for (var r = 1; r < 10; r++) + setTimeout(i, 100 * r), + setTimeout(i, 1e3 * r) + } + } else { + n = document.createElement("link"); + n.href = e, + n.rel = "stylesheet", + n.type = "text/css", + n.onload = i, + document.getElementsByTagName("head")[0].appendChild(n), + o[e] = !0, + this.facename = "'" + t + "'", + this.updateFont(); + for (r = 1; r < 10; r++) + setTimeout(i, 100 * r), + setTimeout(i, 1e3 * r) + } + } + } + , + n.prototype.SetEffect = function(t) { + this.blend_mode = t, + this.compositeOp = cr.effectToCompositeOp(t), + cr.setGLBlend(this, t, this.runtime.gl), + this.runtime.redraw = !0 + } + , + t.acts = new n, + r.prototype.Text = function(t) { + t.set_string(this.text) + } + , + r.prototype.FaceName = function(t) { + t.set_string(this.facename) + } + , + r.prototype.FaceSize = function(t) { + t.set_int(this.ptSize) + } + , + r.prototype.TextWidth = function(t) { + for (var e, i = 0, s = 0, n = this.lines.length; s < n; s++) + i < (e = this.lines[s].width) && (i = e); + t.set_int(i) + } + , + r.prototype.TextHeight = function(t) { + t.set_int(this.lines.length * (this.pxHeight + this.line_height_offset) - this.line_height_offset) + } + , + t.exps = new r +}(), +cr.plugins_.TiledBg = function(t) { + this.runtime = t +} +, +function() { + var t = cr.plugins_.TiledBg.prototype; + t.Type = function(t) { + this.plugin = t, + this.runtime = t.runtime + } + ; + var e = t.Type.prototype; + function i() {} + function s() {} + function n() {} + e.onCreate = function() { + this.is_family || (this.texture_img = new Image, + this.texture_img.crossOrigin = "anonymous", + this.texture_img.cr_filesize = this.texture_filesize, + this.runtime.waitForImageLoad(this.texture_img, this.texture_file), + this.pattern = null, + this.webGL_texture = null) + } + , + e.onLostWebGLContext = function() { + this.is_family || (this.webGL_texture = null) + } + , + e.onRestoreWebGLContext = function() { + var t, e; + if (!this.is_family && this.instances.length) + for (this.webGL_texture || (this.webGL_texture = this.runtime.glwrap.loadTexture(this.texture_img, !0, this.runtime.linearSampling, this.texture_pixelformat)), + t = 0, + e = this.instances.length; t < e; t++) + this.instances[t].webGL_texture = this.webGL_texture + } + , + e.loadTextures = function() { + this.is_family || this.webGL_texture || !this.runtime.glwrap || (this.webGL_texture = this.runtime.glwrap.loadTexture(this.texture_img, !0, this.runtime.linearSampling, this.texture_pixelformat)) + } + , + e.unloadTextures = function() { + this.is_family || this.instances.length || !this.webGL_texture || (this.runtime.glwrap.deleteTexture(this.webGL_texture), + this.webGL_texture = null) + } + , + e.preloadCanvas2D = function(t) { + t.drawImage(this.texture_img, 0, 0) + } + , + t.Instance = function(t) { + this.type = t, + this.runtime = t.runtime + } + , + (e = t.Instance.prototype).onCreate = function() { + this.visible = 0 === this.properties[0], + this.rcTex = new cr.rect(0,0,0,0), + this.has_own_texture = !1, + this.texture_img = this.type.texture_img, + this.runtime.glwrap ? (this.type.loadTextures(), + this.webGL_texture = this.type.webGL_texture) : (this.type.pattern || (this.type.pattern = this.runtime.ctx.createPattern(this.type.texture_img, "repeat")), + this.pattern = this.type.pattern) + } + , + e.afterLoad = function() { + this.has_own_texture = !1, + this.texture_img = this.type.texture_img + } + , + e.onDestroy = function() { + this.runtime.glwrap && this.has_own_texture && this.webGL_texture && (this.runtime.glwrap.deleteTexture(this.webGL_texture), + this.webGL_texture = null) + } + , + e.draw = function(t) { + t.globalAlpha = this.opacity, + t.save(), + t.fillStyle = this.pattern; + var e = this.x + , i = this.y; + this.runtime.pixel_rounding && (e = Math.round(e), + i = Math.round(i)); + var s = -(this.hotspotX * this.width) + , n = -(this.hotspotY * this.height) + , r = s % this.texture_img.width + , o = n % this.texture_img.height; + r < 0 && (r += this.texture_img.width), + o < 0 && (o += this.texture_img.height), + t.translate(e, i), + t.rotate(this.angle), + t.translate(r, o), + t.fillRect(s - r, n - o, this.width, this.height), + t.restore() + } + , + e.drawGL_earlyZPass = function(t) { + this.drawGL(t) + } + , + e.drawGL = function(t) { + t.setTexture(this.webGL_texture), + t.setOpacity(this.opacity); + var e = this.rcTex; + e.right = this.width / this.texture_img.width, + e.bottom = this.height / this.texture_img.height; + var i, s, n = this.bquad; + this.runtime.pixel_rounding ? (i = Math.round(this.x) - this.x, + s = Math.round(this.y) - this.y, + t.quadTex(n.tlx + i, n.tly + s, n.trx + i, n.try_ + s, n.brx + i, n.bry + s, n.blx + i, n.bly + s, e)) : t.quadTex(n.tlx, n.tly, n.trx, n.try_, n.brx, n.bry, n.blx, n.bly, e) + } + , + i.prototype.OnURLLoaded = function() { + return !0 + } + , + t.cnds = new i, + s.prototype.SetEffect = function(t) { + this.blend_mode = t, + this.compositeOp = cr.effectToCompositeOp(t), + cr.setGLBlend(this, t, this.runtime.gl), + this.runtime.redraw = !0 + } + , + s.prototype.LoadURL = function(t, e) { + var i = new Image + , s = this; + i.onload = function() { + s.texture_img = i, + s.runtime.glwrap ? (s.has_own_texture && s.webGL_texture && s.runtime.glwrap.deleteTexture(s.webGL_texture), + s.webGL_texture = s.runtime.glwrap.loadTexture(i, !0, s.runtime.linearSampling)) : s.pattern = s.runtime.ctx.createPattern(i, "repeat"), + s.has_own_texture = !0, + s.runtime.redraw = !0, + s.runtime.trigger(cr.plugins_.TiledBg.prototype.cnds.OnURLLoaded, s) + } + , + "data:" !== t.substr(0, 5) && 0 === e && (i.crossOrigin = "anonymous"), + this.runtime.setImageSrc(i, t) + } + , + t.acts = new s, + n.prototype.ImageWidth = function(t) { + t.set_float(this.texture_img.width) + } + , + n.prototype.ImageHeight = function(t) { + t.set_float(this.texture_img.height) + } + , + t.exps = new n +}(), +cr.plugins_.Touch = function(t) { + this.runtime = t +} +, +function() { + var t = cr.plugins_.Touch.prototype; + t.Type = function(t) { + this.plugin = t, + this.runtime = t.runtime + } + , + t.Type.prototype.onCreate = function() {} + , + t.Instance = function(t) { + this.type = t, + this.runtime = t.runtime, + this.touches = [], + this.mouseDown = !1 + } + ; + var e = t.Instance.prototype + , l = { + left: 0, + top: 0 + }; + e.findTouch = function(t) { + for (var e = 0, i = this.touches.length; e < i; e++) + if (this.touches[e].id === t) + return e; + return -1 + } + ; + var i = 0 + , s = 0 + , n = 0; + function a(t) { + i = t.x, + s = t.y, + n = t.z + } + var r = []; + function h(t, e, i, s) { + var n = r.length ? r.pop() : new c; + return n.init(t, e, i, s), + n + } + function o(t) { + r.length < 100 && r.push(t) + } + function c() { + this.starttime = 0, + this.time = 0, + this.lasttime = 0, + this.startx = 0, + this.starty = 0, + this.x = 0, + this.y = 0, + this.lastx = 0, + this.lasty = 0, + this.id = 0, + this.startindex = 0, + this.triggeredHold = !1, + this.tooFarForHold = !1 + } + c.prototype.init = function(t, e, i, s) { + var n = cr.performance_now(); + this.time = n, + this.lasttime = n, + this.starttime = n, + this.startx = t, + this.starty = e, + this.x = t, + this.y = e, + this.lastx = t, + this.lasty = e, + this.width = 0, + this.height = 0, + this.pressure = 0, + this.id = i, + this.startindex = s, + this.triggeredHold = !1, + this.tooFarForHold = !1 + } + , + c.prototype.update = function(t, e, i, s, n, r) { + this.lasttime = this.time, + this.time = t, + this.lastx = this.x, + this.lasty = this.y, + this.x = e, + this.y = i, + this.width = s, + this.height = n, + this.pressure = r, + !this.tooFarForHold && 15 <= cr.distanceTo(this.startx, this.starty, this.x, this.y) && (this.tooFarForHold = !0) + } + , + c.prototype.maybeTriggerHold = function(t, e) { + this.triggeredHold || 500 <= cr.performance_now() - this.starttime && !this.tooFarForHold && cr.distanceTo(this.startx, this.starty, this.x, this.y) < 15 && (this.triggeredHold = !0, + t.trigger_index = this.startindex, + t.trigger_id = this.id, + t.getTouchIndex = e, + t.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnHoldGesture, t), + t.curTouchX = this.x, + t.curTouchY = this.y, + t.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnHoldGestureObject, t), + t.getTouchIndex = 0) + } + ; + var u = -1e3 + , p = -1e3 + , d = -1e4; + function f(t) { + return t.sourceCapabilities && t.sourceCapabilities.firesTouchEvents || t.originalEvent && t.originalEvent.sourceCapabilities && t.originalEvent.sourceCapabilities.firesTouchEvents + } + function y() {} + c.prototype.maybeTriggerTap = function(t, e) { + var i; + this.triggeredHold || (i = cr.performance_now()) - this.starttime <= 333 && !this.tooFarForHold && cr.distanceTo(this.startx, this.starty, this.x, this.y) < 15 && (t.trigger_index = this.startindex, + t.trigger_id = this.id, + t.getTouchIndex = e, + d = i - d <= 666 && cr.distanceTo(u, p, this.x, this.y) < 25 ? (t.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnDoubleTapGesture, t), + t.curTouchX = this.x, + t.curTouchY = this.y, + t.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnDoubleTapGestureObject, t), + p = u = -1e3, + -1e4) : (t.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnTapGesture, t), + t.curTouchX = this.x, + t.curTouchY = this.y, + t.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnTapGestureObject, t), + u = this.x, + p = this.y, + i), + t.getTouchIndex = 0) + } + , + e.onCreate = function() { + this.isWindows8 = !(void 0 === window.c2isWindows8 || !window.c2isWindows8), + this.orient_alpha = 0, + this.orient_beta = 0, + this.orient_gamma = 0, + this.acc_g_x = 0, + this.acc_g_y = 0, + this.acc_g_z = 0, + this.acc_x = 0, + this.acc_y = 0, + this.acc_z = 0, + this.curTouchX = 0, + this.curTouchY = 0, + this.trigger_index = 0, + this.trigger_id = 0, + this.getTouchIndex = 0, + this.useMouseInput = 0 !== this.properties[0]; + var t = 0 < this.runtime.fullscreen_mode ? document : this.runtime.canvas + , e = document; + this.runtime.isDirectCanvas ? e = t = window.Canvas : this.runtime.isCocoonJs && (e = t = window); + var i, s, n, r, o = this; + "undefined" != typeof PointerEvent ? (t.addEventListener("pointerdown", function(t) { + o.onPointerStart(t) + }, !1), + t.addEventListener("pointermove", function(t) { + o.onPointerMove(t) + }, !1), + e.addEventListener("pointerup", function(t) { + o.onPointerEnd(t, !1) + }, !1), + e.addEventListener("pointercancel", function(t) { + o.onPointerEnd(t, !0) + }, !1), + this.runtime.canvas && (this.runtime.canvas.addEventListener("MSGestureHold", function(t) { + t.preventDefault() + }, !1), + document.addEventListener("MSGestureHold", function(t) { + t.preventDefault() + }, !1), + this.runtime.canvas.addEventListener("gesturehold", function(t) { + t.preventDefault() + }, !1), + document.addEventListener("gesturehold", function(t) { + t.preventDefault() + }, !1))) : window.navigator.msPointerEnabled ? (t.addEventListener("MSPointerDown", function(t) { + o.onPointerStart(t) + }, !1), + t.addEventListener("MSPointerMove", function(t) { + o.onPointerMove(t) + }, !1), + e.addEventListener("MSPointerUp", function(t) { + o.onPointerEnd(t, !1) + }, !1), + e.addEventListener("MSPointerCancel", function(t) { + o.onPointerEnd(t, !0) + }, !1), + this.runtime.canvas && (this.runtime.canvas.addEventListener("MSGestureHold", function(t) { + t.preventDefault() + }, !1), + document.addEventListener("MSGestureHold", function(t) { + t.preventDefault() + }, !1))) : (t.addEventListener("touchstart", function(t) { + o.onTouchStart(t) + }, !1), + t.addEventListener("touchmove", function(t) { + o.onTouchMove(t) + }, !1), + e.addEventListener("touchend", function(t) { + o.onTouchEnd(t, !1) + }, !1), + e.addEventListener("touchcancel", function(t) { + o.onTouchEnd(t, !0) + }, !1)), + this.isWindows8 ? (i = function(t) { + t = t.reading; + o.acc_x = t.accelerationX, + o.acc_y = t.accelerationY, + o.acc_z = t.accelerationZ + } + , + s = function(t) { + t = t.reading; + o.orient_alpha = t.yawDegrees, + o.orient_beta = t.pitchDegrees, + o.orient_gamma = t.rollDegrees + } + , + (n = Windows.Devices.Sensors.Accelerometer.getDefault()) && (n.reportInterval = Math.max(n.minimumReportInterval, 16), + n.addEventListener("readingchanged", i)), + (r = Windows.Devices.Sensors.Inclinometer.getDefault()) && (r.reportInterval = Math.max(r.minimumReportInterval, 16), + r.addEventListener("readingchanged", s)), + document.addEventListener("visibilitychange", function(t) { + document.hidden || document.msHidden ? (n && n.removeEventListener("readingchanged", i), + r && r.removeEventListener("readingchanged", s)) : (n && n.addEventListener("readingchanged", i), + r && r.addEventListener("readingchanged", s)) + }, !1)) : (window.addEventListener("deviceorientation", function(t) { + o.orient_alpha = t.alpha || 0, + o.orient_beta = t.beta || 0, + o.orient_gamma = t.gamma || 0 + }, !1), + window.addEventListener("devicemotion", function(t) { + t.accelerationIncludingGravity && (o.acc_g_x = t.accelerationIncludingGravity.x || 0, + o.acc_g_y = t.accelerationIncludingGravity.y || 0, + o.acc_g_z = t.accelerationIncludingGravity.z || 0), + t.acceleration && (o.acc_x = t.acceleration.x || 0, + o.acc_y = t.acceleration.y || 0, + o.acc_z = t.acceleration.z || 0) + }, !1)), + this.useMouseInput && !this.runtime.isDomFree && (jQuery(document).mousemove(function(t) { + o.onMouseMove(t) + }), + jQuery(document).mousedown(function(t) { + o.onMouseDown(t) + }), + jQuery(document).mouseup(function(t) { + o.onMouseUp(t) + })), + !this.runtime.isiOS && this.runtime.isCordova && navigator.accelerometer && navigator.accelerometer.watchAcceleration && navigator.accelerometer.watchAcceleration(a, null, { + frequency: 40 + }), + this.runtime.tick2Me(this) + } + , + e.onPointerMove = function(t) { + var e, i, s; + t.pointerType !== t.MSPOINTER_TYPE_MOUSE && "mouse" !== t.pointerType && (t.preventDefault && t.preventDefault(), + s = this.findTouch(t.pointerId), + e = cr.performance_now(), + 0 <= s && (i = this.runtime.isDomFree ? l : jQuery(this.runtime.canvas).offset(), + e - (s = this.touches[s]).time < 2 || s.update(e, t.pageX - i.left, t.pageY - i.top, t.width || 0, t.height || 0, t.pressure || 0))) + } + , + e.onPointerStart = function(t) { + var e, i; + t.pointerType !== t.MSPOINTER_TYPE_MOUSE && "mouse" !== t.pointerType && (t.preventDefault && cr.isCanvasInputEvent(t) && t.preventDefault(), + i = this.runtime.isDomFree ? l : jQuery(this.runtime.canvas).offset(), + e = t.pageX - i.left, + i = t.pageY - i.top, + cr.performance_now(), + this.trigger_index = this.touches.length, + this.trigger_id = t.pointerId, + this.touches.push(h(e, i, t.pointerId, this.trigger_index)), + this.runtime.isInUserInputEvent = !0, + this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnNthTouchStart, this), + this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnTouchStart, this), + this.curTouchX = e, + this.curTouchY = i, + this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnTouchObject, this), + this.runtime.isInUserInputEvent = !1) + } + , + e.onPointerEnd = function(t, e) { + t.pointerType !== t.MSPOINTER_TYPE_MOUSE && "mouse" !== t.pointerType && (t.preventDefault && cr.isCanvasInputEvent(t) && t.preventDefault(), + t = this.findTouch(t.pointerId), + this.trigger_index = 0 <= t ? this.touches[t].startindex : -1, + this.trigger_id = 0 <= t ? this.touches[t].id : -1, + this.runtime.isInUserInputEvent = !0, + this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnNthTouchEnd, this), + this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnTouchEnd, this), + 0 <= t && (e || this.touches[t].maybeTriggerTap(this, t), + o(this.touches[t]), + this.touches.splice(t, 1)), + this.runtime.isInUserInputEvent = !1) + } + , + e.onTouchMove = function(t) { + t.preventDefault && t.preventDefault(); + for (var e, i = cr.performance_now(), s = 0, n = t.changedTouches.length; s < n; s++) { + e = t.changedTouches[s]; + var r, o, a, h, c = this.findTouch(e.identifier); + 0 <= c && (r = this.runtime.isDomFree ? l : jQuery(this.runtime.canvas).offset(), + i - (o = this.touches[c]).time < 2 || (a = 2 * (e.radiusX || e.webkitRadiusX || e.mozRadiusX || e.msRadiusX || 0), + h = 2 * (e.radiusY || e.webkitRadiusY || e.mozRadiusY || e.msRadiusY || 0), + c = e.force || e.webkitForce || e.mozForce || e.msForce || 0, + o.update(i, e.pageX - r.left, e.pageY - r.top, a, h, c))) + } + } + , + e.onTouchStart = function(t) { + t.preventDefault && cr.isCanvasInputEvent(t) && t.preventDefault(); + var e, i, s = this.runtime.isDomFree ? l : jQuery(this.runtime.canvas).offset(); + cr.performance_now(); + for (this.runtime.isInUserInputEvent = !0, + e = 0, + i = t.changedTouches.length; e < i; e++) { + var n, r, o = t.changedTouches[e]; + -1 === this.findTouch(o.identifier) && (n = o.pageX - s.left, + r = o.pageY - s.top, + this.trigger_index = this.touches.length, + this.trigger_id = o.identifier, + this.touches.push(h(n, r, o.identifier, this.trigger_index)), + this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnNthTouchStart, this), + this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnTouchStart, this), + this.curTouchX = n, + this.curTouchY = r, + this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnTouchObject, this)) + } + this.runtime.isInUserInputEvent = !1 + } + , + e.onTouchEnd = function(t, e) { + var i, s, n; + for (t.preventDefault && cr.isCanvasInputEvent(t) && t.preventDefault(), + this.runtime.isInUserInputEvent = !0, + i = 0, + s = t.changedTouches.length; i < s; i++) + n = t.changedTouches[i], + 0 <= (n = this.findTouch(n.identifier)) && (this.trigger_index = this.touches[n].startindex, + this.trigger_id = this.touches[n].id, + this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnNthTouchEnd, this), + this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnTouchEnd, this), + e || this.touches[n].maybeTriggerTap(this, n), + o(this.touches[n]), + this.touches.splice(n, 1)); + this.runtime.isInUserInputEvent = !1 + } + , + e.getAlpha = function() { + return this.runtime.isCordova && 0 === this.orient_alpha && 0 !== n ? 90 * n : this.orient_alpha + } + , + e.getBeta = function() { + return this.runtime.isCordova && 0 === this.orient_beta && 0 !== s ? 90 * s : this.orient_beta + } + , + e.getGamma = function() { + return this.runtime.isCordova && 0 === this.orient_gamma && 0 !== i ? 90 * i : this.orient_gamma + } + , + e.onMouseDown = function(t) { + f(t) || (t = { + changedTouches: [{ + pageX: t.pageX, + pageY: t.pageY, + identifier: 0 + }] + }, + this.onTouchStart(t), + this.mouseDown = !0) + } + , + e.onMouseMove = function(t) { + this.mouseDown && (f(t) || (t = { + changedTouches: [{ + pageX: t.pageX, + pageY: t.pageY, + identifier: 0 + }] + }, + this.onTouchMove(t))) + } + , + e.onMouseUp = function(t) { + t.preventDefault && this.runtime.had_a_click && !this.runtime.isMobile && t.preventDefault(), + this.runtime.had_a_click = !0, + f(t) || (t = { + changedTouches: [{ + pageX: t.pageX, + pageY: t.pageY, + identifier: 0 + }] + }, + this.onTouchEnd(t), + this.mouseDown = !1) + } + , + e.tick2 = function() { + for (var t, e = cr.performance_now(), i = 0, s = this.touches.length; i < s; ++i) + (t = this.touches[i]).time <= e - 50 && (t.lasttime = e), + t.maybeTriggerHold(this, i) + } + , + y.prototype.OnTouchStart = function() { + return !0 + } + , + y.prototype.OnTouchEnd = function() { + return !0 + } + , + y.prototype.IsInTouch = function() { + return this.touches.length + } + , + y.prototype.OnTouchObject = function(t) { + return !!t && this.runtime.testAndSelectCanvasPointOverlap(t, this.curTouchX, this.curTouchY, !1) + } + ; + var g = []; + function m() {} + y.prototype.IsTouchingObject = function(t) { + if (!t) + return !1; + for (var e, i, s = t.getCurrentSol(), n = s.getObjects(), r = 0, o = n.length; r < o; r++) { + var a = n[r]; + for (a.update_bbox(), + e = 0, + i = this.touches.length; e < i; e++) { + var h = this.touches[e] + , c = a.layer.canvasToLayer(h.x, h.y, !0) + , h = a.layer.canvasToLayer(h.x, h.y, !1); + if (a.contains_pt(c, h)) { + g.push(a); + break + } + } + } + return !!g.length && (s.select_all = !1, + cr.shallowAssignArray(s.instances, g), + t.applySolToContainer(), + cr.clearArray(g), + !0) + } + , + y.prototype.CompareTouchSpeed = function(t, e, i) { + if ((t = Math.floor(t)) < 0 || t >= this.touches.length) + return !1; + var s = this.touches[t] + , t = cr.distanceTo(s.x, s.y, s.lastx, s.lasty) + , s = (s.time - s.lasttime) / 1e3 + , s = 0 < s ? t / s : 0; + return cr.do_cmp(s, e, i) + } + , + y.prototype.OrientationSupported = function() { + return void 0 !== window.DeviceOrientationEvent + } + , + y.prototype.MotionSupported = function() { + return void 0 !== window.DeviceMotionEvent + } + , + y.prototype.CompareOrientation = function(t, e, i) { + var s = 0 + , s = 0 === t ? this.getAlpha() : 1 === t ? this.getBeta() : this.getGamma(); + return cr.do_cmp(s, e, i) + } + , + y.prototype.CompareAcceleration = function(t, e, i) { + var s = 0; + return 0 === t ? s = this.acc_g_x : 1 === t ? s = this.acc_g_y : 2 === t ? s = this.acc_g_z : 3 === t ? s = this.acc_x : 4 === t ? s = this.acc_y : 5 === t && (s = this.acc_z), + cr.do_cmp(s, e, i) + } + , + y.prototype.OnNthTouchStart = function(t) { + return (t = Math.floor(t)) === this.trigger_index + } + , + y.prototype.OnNthTouchEnd = function(t) { + return (t = Math.floor(t)) === this.trigger_index + } + , + y.prototype.HasNthTouch = function(t) { + return t = Math.floor(t), + this.touches.length >= t + 1 + } + , + y.prototype.OnHoldGesture = function() { + return !0 + } + , + y.prototype.OnTapGesture = function() { + return !0 + } + , + y.prototype.OnDoubleTapGesture = function() { + return !0 + } + , + y.prototype.OnHoldGestureObject = function(t) { + return !!t && this.runtime.testAndSelectCanvasPointOverlap(t, this.curTouchX, this.curTouchY, !1) + } + , + y.prototype.OnTapGestureObject = function(t) { + return !!t && this.runtime.testAndSelectCanvasPointOverlap(t, this.curTouchX, this.curTouchY, !1) + } + , + y.prototype.OnDoubleTapGestureObject = function(t) { + return !!t && this.runtime.testAndSelectCanvasPointOverlap(t, this.curTouchX, this.curTouchY, !1) + } + , + t.cnds = new y, + m.prototype.TouchCount = function(t) { + t.set_int(this.touches.length) + } + , + m.prototype.X = function(t, e) { + var i, s, n, r, o, a = this.getTouchIndex; + a < 0 || a >= this.touches.length ? t.set_float(0) : cr.is_undefined(e) ? (s = (i = this.runtime.getLayerByNumber(0)).scale, + n = i.zoomRate, + r = i.parallaxX, + o = i.angle, + i.scale = 1, + i.zoomRate = 1, + i.parallaxX = 1, + i.angle = 0, + t.set_float(i.canvasToLayer(this.touches[a].x, this.touches[a].y, !0)), + i.scale = s, + i.zoomRate = n, + i.parallaxX = r, + i.angle = o) : (i = cr.is_number(e) ? this.runtime.getLayerByNumber(e) : this.runtime.getLayerByName(e)) ? t.set_float(i.canvasToLayer(this.touches[a].x, this.touches[a].y, !0)) : t.set_float(0) + } + , + m.prototype.XAt = function(t, e, i) { + var s, n, r, o, a; + (e = Math.floor(e)) < 0 || e >= this.touches.length ? t.set_float(0) : cr.is_undefined(i) ? (n = (s = this.runtime.getLayerByNumber(0)).scale, + r = s.zoomRate, + o = s.parallaxX, + a = s.angle, + s.scale = 1, + s.zoomRate = 1, + s.parallaxX = 1, + s.angle = 0, + t.set_float(s.canvasToLayer(this.touches[e].x, this.touches[e].y, !0)), + s.scale = n, + s.zoomRate = r, + s.parallaxX = o, + s.angle = a) : (s = cr.is_number(i) ? this.runtime.getLayerByNumber(i) : this.runtime.getLayerByName(i)) ? t.set_float(s.canvasToLayer(this.touches[e].x, this.touches[e].y, !0)) : t.set_float(0) + } + , + m.prototype.XForID = function(t, e, i) { + var s, n, r, o, a = this.findTouch(e); + a < 0 ? t.set_float(0) : (s = this.touches[a], + cr.is_undefined(i) ? (r = (n = this.runtime.getLayerByNumber(0)).scale, + o = n.zoomRate, + e = n.parallaxX, + a = n.angle, + n.scale = 1, + n.zoomRate = 1, + n.parallaxX = 1, + n.angle = 0, + t.set_float(n.canvasToLayer(s.x, s.y, !0)), + n.scale = r, + n.zoomRate = o, + n.parallaxX = e, + n.angle = a) : (n = cr.is_number(i) ? this.runtime.getLayerByNumber(i) : this.runtime.getLayerByName(i)) ? t.set_float(n.canvasToLayer(s.x, s.y, !0)) : t.set_float(0)) + } + , + m.prototype.Y = function(t, e) { + var i, s, n, r, o, a = this.getTouchIndex; + a < 0 || a >= this.touches.length ? t.set_float(0) : cr.is_undefined(e) ? (s = (i = this.runtime.getLayerByNumber(0)).scale, + n = i.zoomRate, + r = i.parallaxY, + o = i.angle, + i.scale = 1, + i.zoomRate = 1, + i.parallaxY = 1, + i.angle = 0, + t.set_float(i.canvasToLayer(this.touches[a].x, this.touches[a].y, !1)), + i.scale = s, + i.zoomRate = n, + i.parallaxY = r, + i.angle = o) : (i = cr.is_number(e) ? this.runtime.getLayerByNumber(e) : this.runtime.getLayerByName(e)) ? t.set_float(i.canvasToLayer(this.touches[a].x, this.touches[a].y, !1)) : t.set_float(0) + } + , + m.prototype.YAt = function(t, e, i) { + var s, n, r, o, a; + (e = Math.floor(e)) < 0 || e >= this.touches.length ? t.set_float(0) : cr.is_undefined(i) ? (n = (s = this.runtime.getLayerByNumber(0)).scale, + r = s.zoomRate, + o = s.parallaxY, + a = s.angle, + s.scale = 1, + s.zoomRate = 1, + s.parallaxY = 1, + s.angle = 0, + t.set_float(s.canvasToLayer(this.touches[e].x, this.touches[e].y, !1)), + s.scale = n, + s.zoomRate = r, + s.parallaxY = o, + s.angle = a) : (s = cr.is_number(i) ? this.runtime.getLayerByNumber(i) : this.runtime.getLayerByName(i)) ? t.set_float(s.canvasToLayer(this.touches[e].x, this.touches[e].y, !1)) : t.set_float(0) + } + , + m.prototype.YForID = function(t, e, i) { + var s, n, r, o, a = this.findTouch(e); + a < 0 ? t.set_float(0) : (s = this.touches[a], + cr.is_undefined(i) ? (r = (n = this.runtime.getLayerByNumber(0)).scale, + o = n.zoomRate, + e = n.parallaxY, + a = n.angle, + n.scale = 1, + n.zoomRate = 1, + n.parallaxY = 1, + n.angle = 0, + t.set_float(n.canvasToLayer(s.x, s.y, !1)), + n.scale = r, + n.zoomRate = o, + n.parallaxY = e, + n.angle = a) : (n = cr.is_number(i) ? this.runtime.getLayerByNumber(i) : this.runtime.getLayerByName(i)) ? t.set_float(n.canvasToLayer(s.x, s.y, !1)) : t.set_float(0)) + } + , + m.prototype.AbsoluteX = function(t) { + this.touches.length ? t.set_float(this.touches[0].x) : t.set_float(0) + } + , + m.prototype.AbsoluteXAt = function(t, e) { + (e = Math.floor(e)) < 0 || e >= this.touches.length ? t.set_float(0) : t.set_float(this.touches[e].x) + } + , + m.prototype.AbsoluteXForID = function(t, e) { + e = this.findTouch(e); + e < 0 ? t.set_float(0) : (e = this.touches[e], + t.set_float(e.x)) + } + , + m.prototype.AbsoluteY = function(t) { + this.touches.length ? t.set_float(this.touches[0].y) : t.set_float(0) + } + , + m.prototype.AbsoluteYAt = function(t, e) { + (e = Math.floor(e)) < 0 || e >= this.touches.length ? t.set_float(0) : t.set_float(this.touches[e].y) + } + , + m.prototype.AbsoluteYForID = function(t, e) { + e = this.findTouch(e); + e < 0 ? t.set_float(0) : (e = this.touches[e], + t.set_float(e.y)) + } + , + m.prototype.SpeedAt = function(t, e) { + var i; + (e = Math.floor(e)) < 0 || e >= this.touches.length ? t.set_float(0) : (i = this.touches[e], + e = cr.distanceTo(i.x, i.y, i.lastx, i.lasty), + (i = (i.time - i.lasttime) / 1e3) <= 0 ? t.set_float(0) : t.set_float(e / i)) + } + , + m.prototype.SpeedForID = function(t, e) { + var i = this.findTouch(e); + i < 0 ? t.set_float(0) : (e = this.touches[i], + i = cr.distanceTo(e.x, e.y, e.lastx, e.lasty), + (e = (e.time - e.lasttime) / 1e3) <= 0 ? t.set_float(0) : t.set_float(i / e)) + } + , + m.prototype.AngleAt = function(t, e) { + (e = Math.floor(e)) < 0 || e >= this.touches.length ? t.set_float(0) : (e = this.touches[e], + t.set_float(cr.to_degrees(cr.angleTo(e.lastx, e.lasty, e.x, e.y)))) + } + , + m.prototype.AngleForID = function(t, e) { + e = this.findTouch(e); + e < 0 ? t.set_float(0) : (e = this.touches[e], + t.set_float(cr.to_degrees(cr.angleTo(e.lastx, e.lasty, e.x, e.y)))) + } + , + m.prototype.Alpha = function(t) { + t.set_float(this.getAlpha()) + } + , + m.prototype.Beta = function(t) { + t.set_float(this.getBeta()) + } + , + m.prototype.Gamma = function(t) { + t.set_float(this.getGamma()) + } + , + m.prototype.AccelerationXWithG = function(t) { + t.set_float(this.acc_g_x) + } + , + m.prototype.AccelerationYWithG = function(t) { + t.set_float(this.acc_g_y) + } + , + m.prototype.AccelerationZWithG = function(t) { + t.set_float(this.acc_g_z) + } + , + m.prototype.AccelerationX = function(t) { + t.set_float(this.acc_x) + } + , + m.prototype.AccelerationY = function(t) { + t.set_float(this.acc_y) + } + , + m.prototype.AccelerationZ = function(t) { + t.set_float(this.acc_z) + } + , + m.prototype.TouchIndex = function(t) { + t.set_int(this.trigger_index) + } + , + m.prototype.TouchID = function(t) { + t.set_float(this.trigger_id) + } + , + m.prototype.WidthForID = function(t, e) { + e = this.findTouch(e); + e < 0 ? t.set_float(0) : (e = this.touches[e], + t.set_float(e.width)) + } + , + m.prototype.HeightForID = function(t, e) { + e = this.findTouch(e); + e < 0 ? t.set_float(0) : (e = this.touches[e], + t.set_float(e.height)) + } + , + m.prototype.PressureForID = function(t, e) { + e = this.findTouch(e); + e < 0 ? t.set_float(0) : (e = this.touches[e], + t.set_float(e.pressure)) + } + , + t.exps = new m +}(), +cr.plugins_.vooxe = function(t) { + this.runtime = t +} +, +function() { + var t = cr.plugins_.vooxe.prototype; + t.Type = function(t) { + this.plugin = t, + this.runtime = t.runtime + } + , + t.Type.prototype.onCreate = function() {} + , + t.Instance = function(t) { + this.type = t, + this.runtime = t.runtime, + window.vooxe = {}, + window.GD_OPTIONS = {} + } + ; + var e = t.Instance.prototype + , i = !1; + function s() {} + function n() {} + e.onCreate = function() { + var s; + window.vooxe || window.GD_OPTIONS ? (i = !0, + this.vooxe = window.vooxe, + (s = this).vooxe.onInit = function() { + cr.logexport("Gamedistribution.com SDK: onInit"), + s.isShowingBannerAd = !1, + s.runtime.trigger(cr.plugins_.vooxe.prototype.cnds.onInit, s) + } + , + this.vooxe.onError = function() { + cr.logexport("Gamedistribution.com SDK: onError"), + s.isShowingBannerAd = !0, + s.runtime.trigger(cr.plugins_.vooxe.prototype.cnds.onError, s) + } + , + this.vooxe.onResumeGame = function() { + cr.logexport("Gamedistribution.com SDK: onResume"), + s.isShowingBannerAd = !1, + s.runtime.trigger(cr.plugins_.vooxe.prototype.cnds.onResumeGame, s) + } + , + this.vooxe.onPauseGame = function() { + cr.logexport("Gamedistribution.com SDK: onPauseGame"), + s.isShowingBannerAd = !0, + s.runtime.trigger(cr.plugins_.vooxe.prototype.cnds.onPauseGame, s) + } + , + this.vooxe.InitAds = function() { + var t, e, i; + window.GD_OPTIONS = { + gameId: s.properties[0], + userId: s.properties[1], + advertisementSettings: { + autoplay: !1 + }, + onEvent: function(t) { + switch (t.name) { + case "SDK_GAME_START": + s.vooxe.onResumeGame(); + break; + case "SDK_GAME_PAUSE": + s.vooxe.onPauseGame(); + break; + case "SDK_READY": + s.vooxe.onInit(); + break; + case "SDK_ERROR": + s.vooxe.onError() + } + } + }, + t = document, + e = "gamedistribution-jssdk", + i = t.getElementsByTagName("script")[0], + t.getElementById(e) || ((t = t.createElement("script")).id = e, + t.src = "main.min.js", + i.parentNode.insertBefore(t, i)) + } + ) : cr.logexport("[Construct 2] Gamedistribution.com SDK is required to show advertisements within Cordova; other platforms are not supported.") + } + , + s.prototype.IsShowingBanner = function() { + return this.isShowingBannerAd + } + , + s.prototype.onInit = function() { + return !0 + } + , + s.prototype.onError = function(t) { + return !0 + } + , + s.prototype.onResumeGame = function(t) { + return !0 + } + , + s.prototype.onPauseGame = function(t) { + return !0 + } + , + t.cnds = new s, + n.prototype.ShowBanner = function() { + if (i) { + if (void 0 === window.gdsdk.showBanner) + return cr.logexport("Gamedistribution.com SDK is not loaded or an ad blocker is present."), + void this.vooxe.onResumeGame(); + window.gdsdk.showBanner(), + cr.logexport("ShowBanner"), + this.isShowingBannerAd = !0 + } + } + , + n.prototype.PlayLog = function() { + if (i) + return void 0 === window.gdsdk.play ? (cr.logexport("Gamedistribution.com SDK is not loaded."), + void this.vooxe.onResumeGame()) : void window.gdsdk.play() + } + , + n.prototype.CustomLog = function() { + if (i) + return void 0 === window.gdsdk.customLog ? (cr.logexport("Gamedistribution.com SDK is not loaded."), + void this.vooxe.onResumeGame()) : void window.gdsdk.customLog() + } + , + n.prototype.InitAds = function() { + i && this.vooxe.InitAds() + } + , + t.acts = new n, + t.exps = new function() {} +}(), +cr.behaviors.Fade = function(t) { + this.runtime = t +} +, +function() { + var t = cr.behaviors.Fade.prototype; + t.Type = function(t, e) { + this.behavior = t, + this.objtype = e, + this.runtime = t.runtime + } + , + t.Type.prototype.onCreate = function() {} + , + t.Instance = function(t, e) { + this.type = t, + this.behavior = t.behavior, + this.inst = e, + this.runtime = t.runtime + } + ; + var e = t.Instance.prototype; + function i() {} + function s() {} + function n() {} + e.onCreate = function() { + this.activeAtStart = 1 === this.properties[0], + this.setMaxOpacity = !1, + this.fadeInTime = this.properties[1], + this.waitTime = this.properties[2], + this.fadeOutTime = this.properties[3], + this.destroy = this.properties[4], + this.stage = this.activeAtStart ? 0 : 3, + this.recycled ? this.stageTime.reset() : this.stageTime = new cr.KahanAdder, + this.maxOpacity = this.inst.opacity || 1, + this.activeAtStart && (0 === this.fadeInTime ? (this.stage = 1, + 0 === this.waitTime && (this.stage = 2)) : (this.inst.opacity = 0, + this.runtime.redraw = !0)) + } + , + e.saveToJSON = function() { + return { + fit: this.fadeInTime, + wt: this.waitTime, + fot: this.fadeOutTime, + s: this.stage, + st: this.stageTime.sum, + mo: this.maxOpacity + } + } + , + e.loadFromJSON = function(t) { + this.fadeInTime = t.fit, + this.waitTime = t.wt, + this.fadeOutTime = t.fot, + this.stage = t.s, + this.stageTime.reset(), + this.stageTime.sum = t.st, + this.maxOpacity = t.mo + } + , + e.tick = function() { + this.stageTime.add(this.runtime.getDt(this.inst)), + 0 === this.stage && (this.inst.opacity = this.stageTime.sum / this.fadeInTime * this.maxOpacity, + this.runtime.redraw = !0, + this.inst.opacity >= this.maxOpacity && (this.inst.opacity = this.maxOpacity, + this.stage = 1, + this.stageTime.reset(), + this.runtime.trigger(cr.behaviors.Fade.prototype.cnds.OnFadeInEnd, this.inst))), + 1 === this.stage && this.stageTime.sum >= this.waitTime && (this.stage = 2, + this.stageTime.reset(), + this.runtime.trigger(cr.behaviors.Fade.prototype.cnds.OnWaitEnd, this.inst)), + 2 === this.stage && 0 !== this.fadeOutTime && (this.inst.opacity = this.maxOpacity - this.stageTime.sum / this.fadeOutTime * this.maxOpacity, + this.runtime.redraw = !0, + this.inst.opacity < 0 && (this.inst.opacity = 0, + this.stage = 3, + this.stageTime.reset(), + this.runtime.trigger(cr.behaviors.Fade.prototype.cnds.OnFadeOutEnd, this.inst), + 1 === this.destroy && this.runtime.DestroyInstance(this.inst))) + } + , + e.doStart = function() { + this.stage = 0, + this.stageTime.reset(), + 0 === this.fadeInTime ? (this.stage = 1, + 0 === this.waitTime && (this.stage = 2)) : (this.inst.opacity = 0, + this.runtime.redraw = !0) + } + , + i.prototype.OnFadeOutEnd = function() { + return !0 + } + , + i.prototype.OnFadeInEnd = function() { + return !0 + } + , + i.prototype.OnWaitEnd = function() { + return !0 + } + , + t.cnds = new i, + s.prototype.StartFade = function() { + this.activeAtStart || this.setMaxOpacity || (this.maxOpacity = this.inst.opacity || 1, + this.setMaxOpacity = !0), + 3 === this.stage && this.doStart() + } + , + s.prototype.RestartFade = function() { + this.doStart() + } + , + s.prototype.SetFadeInTime = function(t) { + t < 0 && (t = 0), + this.fadeInTime = t + } + , + s.prototype.SetWaitTime = function(t) { + t < 0 && (t = 0), + this.waitTime = t + } + , + s.prototype.SetFadeOutTime = function(t) { + t < 0 && (t = 0), + this.fadeOutTime = t + } + , + t.acts = new s, + n.prototype.FadeInTime = function(t) { + t.set_float(this.fadeInTime) + } + , + n.prototype.WaitTime = function(t) { + t.set_float(this.waitTime) + } + , + n.prototype.FadeOutTime = function(t) { + t.set_float(this.fadeOutTime) + } + , + t.exps = new n +}(), +cr.behaviors.Flash = function(t) { + this.runtime = t +} +, +function() { + var t = cr.behaviors.Flash.prototype; + t.Type = function(t, e) { + this.behavior = t, + this.objtype = e, + this.runtime = t.runtime + } + , + t.Type.prototype.onCreate = function() {} + , + t.Instance = function(t, e) { + this.type = t, + this.behavior = t.behavior, + this.inst = e, + this.runtime = t.runtime + } + ; + var e = t.Instance.prototype; + function i() {} + function s() {} + e.onCreate = function() { + this.ontime = 0, + this.offtime = 0, + this.stage = 0, + this.stagetimeleft = 0, + this.timeleft = 0 + } + , + e.saveToJSON = function() { + return { + ontime: this.ontime, + offtime: this.offtime, + stage: this.stage, + stagetimeleft: this.stagetimeleft, + timeleft: this.timeleft + } + } + , + e.loadFromJSON = function(t) { + this.ontime = t.ontime, + this.offtime = t.offtime, + this.stage = t.stage, + this.stagetimeleft = t.stagetimeleft, + this.timeleft = t.timeleft, + null === this.timeleft && (this.timeleft = 1 / 0) + } + , + e.tick = function() { + if (!(this.timeleft <= 0)) { + var t = this.runtime.getDt(this.inst); + if (this.timeleft -= t, + this.timeleft <= 0) + return this.timeleft = 0, + this.inst.visible = !0, + this.runtime.redraw = !0, + void this.runtime.trigger(cr.behaviors.Flash.prototype.cnds.OnFlashEnded, this.inst); + this.stagetimeleft -= t, + this.stagetimeleft <= 0 && (0 === this.stage ? (this.inst.visible = !1, + this.stage = 1, + this.stagetimeleft += this.offtime) : (this.inst.visible = !0, + this.stage = 0, + this.stagetimeleft += this.ontime), + this.runtime.redraw = !0) + } + } + , + i.prototype.IsFlashing = function() { + return 0 < this.timeleft + } + , + i.prototype.OnFlashEnded = function() { + return !0 + } + , + t.cnds = new i, + s.prototype.Flash = function(t, e, i) { + this.ontime = t, + this.offtime = e, + this.stage = 1, + this.stagetimeleft = e, + this.timeleft = i, + this.inst.visible = !1, + this.runtime.redraw = !0 + } + , + s.prototype.StopFlashing = function() { + this.timeleft = 0, + this.inst.visible = !0, + this.runtime.redraw = !0 + } + , + t.acts = new s, + t.exps = new function() {} +}(), +cr.behaviors.Pin = function(t) { + this.runtime = t +} +, +function() { + var t = cr.behaviors.Pin.prototype; + t.Type = function(t, e) { + this.behavior = t, + this.objtype = e, + this.runtime = t.runtime + } + , + t.Type.prototype.onCreate = function() {} + , + t.Instance = function(t, e) { + this.type = t, + this.behavior = t.behavior, + this.inst = e, + this.runtime = t.runtime + } + ; + var e = t.Instance.prototype; + function i() {} + function s() {} + function n() {} + e.onCreate = function() { + this.pinObject = null, + this.pinObjectUid = -1, + this.pinAngle = 0, + this.pinDist = 0, + this.myStartAngle = 0, + this.theirStartAngle = 0, + this.lastKnownAngle = 0, + this.mode = 0, + this.targetDist = -1, + this.pinObjectX = -1, + this.pinObjectY = -1, + this.pinObjectAngle = 0, + this.pinObjectValue_0 = 0; + var e = this; + this.recycled || (this.myDestroyCallback = function(t) { + e.onInstanceDestroyed(t) + } + ), + this.runtime.addDestroyCallback(this.myDestroyCallback) + } + , + e.saveToJSON = function() { + return { + uid: this.pinObject ? this.pinObject.uid : -1, + pa: this.pinAngle, + pd: this.pinDist, + msa: this.myStartAngle, + tsa: this.theirStartAngle, + lka: this.lastKnownAngle, + m: this.mode + } + } + , + e.loadFromJSON = function(t) { + this.pinObjectUid = t.uid, + this.pinAngle = t.pa, + this.pinDist = t.pd, + this.myStartAngle = t.msa, + this.theirStartAngle = t.tsa, + this.lastKnownAngle = t.lka, + this.mode = t.m + } + , + e.afterLoad = function() { + -1 === this.pinObjectUid ? this.pinObject = null : this.pinObject = this.runtime.getObjectByUID(this.pinObjectUid), + this.pinObjectUid = -1 + } + , + e.onInstanceDestroyed = function(t) { + this.pinObject == t && (this.pinObject = null) + } + , + e.onDestroy = function() { + this.pinObject = null, + this.runtime.removeDestroyCallback(this.myDestroyCallback) + } + , + e.tick = function() {} + , + e.tick2 = function() { + var t, e, i, s; + this.pinObject && (this.lastKnownAngle !== this.inst.angle && (this.myStartAngle = cr.clamp_angle(this.myStartAngle + (this.inst.angle - this.lastKnownAngle))), + i = this.inst.x, + s = this.inst.y, + 3 !== this.mode && 4 !== this.mode || ((t = cr.distanceTo(this.inst.x, this.inst.y, this.pinObject.x, this.pinObject.y)) > this.pinDist || 4 === this.mode && t < this.pinDist) && (e = cr.angleTo(this.pinObject.x, this.pinObject.y, this.inst.x, this.inst.y), + i = this.pinObject.x + Math.cos(e) * this.pinDist, + s = this.pinObject.y + Math.sin(e) * this.pinDist), + 0 !== this.mode && 1 !== this.mode && 2 !== this.mode || (i = this.pinObject.x + Math.cos(this.pinObject.angle + this.pinAngle) * this.pinDist, + s = this.pinObject.y + Math.sin(this.pinObject.angle + this.pinAngle) * this.pinDist), + 5 === this.mode && (this.targetDist = cr.distanceTo(this.inst.x, this.inst.y, this.pinObject.x, this.pinObject.y)), + 6 === this.mode && (this.pinObjectX = this.pinObject.x, + this.pinObjectY = this.pinObject.y, + this.pinObjectAngle = this.pinObject.angle, + this.pinObjectValue_0 = this.inst.instance_vars[this.inst.instance_var_names.indexOf("pinObjectValue_0")]), + e = cr.clamp_angle(this.myStartAngle + (this.pinObject.angle - this.theirStartAngle)), + this.lastKnownAngle = e, + 0 !== this.mode && 1 !== this.mode && 3 !== this.mode && 4 !== this.mode || this.inst.x === i && this.inst.y === s || (this.inst.x = i, + this.inst.y = s, + this.inst.set_bbox_changed()), + 0 !== this.mode && 2 !== this.mode || this.inst.angle !== e && (this.inst.angle = e, + this.inst.set_bbox_changed()), + 3 === this.mode && (e = cr.angleTo(this.inst.x, this.inst.y, this.pinObject.x, this.pinObject.y), + this.lastKnownAngle = e, + this.inst.angle !== e && (this.inst.angle = e, + this.inst.set_bbox_changed()))) + } + , + i.prototype.IsPinned = function() { + return !!this.pinObject + } + , + i.prototype.CompareTargetDistance = function(t, e) { + return cr.do_cmp(this.targetDist, t, e) + } + , + i.prototype.ComparePositionX = function(t, e) { + return cr.do_cmp(this.pinObjectX, t, e) + } + , + i.prototype.ComparePositionY = function(t, e) { + return cr.do_cmp(this.pinObjectY, t, e) + } + , + t.cnds = new i, + s.prototype.Pin = function(t, e) { + !t || (t = t.getFirstPicked(this.inst)) && (this.pinObject = t, + this.pinAngle = cr.angleTo(t.x, t.y, this.inst.x, this.inst.y) - t.angle, + this.pinDist = cr.distanceTo(t.x, t.y, this.inst.x, this.inst.y), + this.pinObjectX = this.pinObject.x, + this.pinObjectY = this.pinObject.y, + this.pinObjectAngle = this.pinObject.angle, + this.myStartAngle = this.inst.angle, + this.lastKnownAngle = this.inst.angle, + this.theirStartAngle = t.angle, + this.mode = e) + } + , + s.prototype.Unpin = function() { + this.pinObject = null + } + , + s.prototype.UpdatePinDistance = function(t) { + this.pinDist = t + } + , + t.acts = new s, + n.prototype.PinnedUID = function(t) { + t.set_int(this.pinObject ? this.pinObject.uid : -1) + } + , + n.prototype.PinnedDistance = function(t) { + t.set_int(this.pinDist) + } + , + n.prototype.TargetDistance = function(t) { + t.set_float(this.targetDist) + } + , + n.prototype.pinObjectX = function(t) { + t.set_float(this.pinObjectX) + } + , + n.prototype.pinObjectY = function(t) { + t.set_float(this.pinObjectY) + } + , + n.prototype.pinObjectAngle = function(t) { + t.set_float(this.pinObjectAngle) + } + , + n.prototype.pinObjectValue_0 = function(t) { + t.set_float(this.pinObjectValue_0) + } + , + t.exps = new n +}(), +cr.behaviors.Rex_Spline = function(t) { + this.runtime = t +} +, +function() { + var t = cr.behaviors.Rex_Spline.prototype; + t.Type = function(t, e) { + this.behavior = t, + this.objtype = e, + this.runtime = t.runtime + } + , + t.Type.prototype.onCreate = function() {} + , + t.Instance = function(t, e) { + this.type = t, + this.behavior = t.behavior, + this.inst = e, + this.runtime = t.runtime + } + ; + var e = t.Instance.prototype; + e.onCreate = function() { + this.enabled = 1 === this.properties[0], + this.speed = this.properties[1], + this.setAngle = 0 !== this.properties[2], + this.isLooping = 1 === this.properties[3], + this.tension = this.properties[4], + this.recycled || (this.points = [], + this.curSeg = { + ptr: -1, + t: 1, + p0: null, + p1: null, + p2: null, + p3: null, + dist: 0, + preX: 0, + preY: 0 + }), + this.traveledDist = 0, + this.movingAngle = 0, + this.is_moving = !1, + this.is_my_call = !1 + } + , + e.onDestroy = function() { + this.curSeg.p0 = null, + this.curSeg.p1 = null, + this.curSeg.p2 = null, + this.curSeg.p3 = null, + this.points.length = 0 + } + , + e.tick = function() { + this.enabled && this.is_moving && this.move() + } + , + e.move = function(t) { + if (null == t && (t = this.runtime.getDt(this.inst)), + 0 !== t && 0 != this.speed) { + for (var e, i, s, n, r, o, a, h, c, l, t = this.speed * t, u = t * t, p = t / 20, d = null, f = this.inst.x, y = this.inst.y; null != (i = this.getSeg()); ) + if (0 !== i.dist) { + if (d !== i.dist && .5 < (e = p / (d = i.dist)) && (e = .5), + i.t += e, + n = 1 <= i.t ? (i.t = 1, + s = i.p2[0], + i.p2[1]) : (s = m(i, 0, this.tension), + m(i, 1, this.tension)), + u <= (o = g(f, y, s, n))) { + Math.abs(c - u) < Math.abs(o - u) && (s = a, + n = h, + o = c, + i.t = l), + r = Math.sqrt(o), + this.traveledDist += r, + this.inst.x = s, + this.inst.y = n; + break + } + a = s, + h = n, + c = o, + l = 1 === i.t ? 0 : i.t + } + f === this.inst.x && y === this.inst.y ? this.movingAngle = this.inst.angle : this.movingAngle = cr.angleTo(f, y, this.inst.x, this.inst.y), + this.setAngle && (this.inst.angle = this.movingAngle), + 0 !== this.speed && (this.inst.set_bbox_changed(), + null == i ? this.onReachLastPoint() : (i.preX = s, + i.preY = n)) + } + } + ; + var l, u, p, g = function(t, e, i, s) { + t = i - t, + e = s - e; + return t * t + e * e + }; + e.start = function() { + this.curSeg.ptr = -1, + this.curSeg.t = 1, + this.traveledDist = 0, + this.is_moving = !0, + null === this.getSeg() && this.onReachLastPoint() + } + , + e.onReachLastPoint = function() { + this.is_moving && (this.is_moving = !1, + this.is_my_call = !0, + this.runtime.trigger(cr.behaviors.Rex_Spline.prototype.cnds.OnHitTarget, this.inst), + this.is_my_call = !1) + } + , + e.hitPoint = function() { + this.is_my_call = !0, + this.runtime.trigger(cr.behaviors.Rex_Spline.prototype.cnds.OnHitAnyPoint, this.inst), + this.is_my_call = !1 + } + , + e.wrapIndex = function(t) { + var e; + return !this.isLooping || (t %= e = this.points.length) < 0 && (t = e + t), + t + } + , + e.getSeg = function() { + if (1 === this.curSeg.t) { + this.curSeg.ptr = this.wrapIndex(this.curSeg.ptr + 1); + var t = this.curSeg.ptr + , e = this.wrapIndex(t + 1); + if (e >= this.points.length) + return null; + var i = this.wrapIndex(t - 1) + , s = this.wrapIndex(e + 1); + this.curSeg.p0 = this.points[i], + this.curSeg.p1 = this.points[t], + this.curSeg.p2 = this.points[e], + this.curSeg.p3 = this.points[s], + this.curSeg.dist = cr.distanceTo(this.curSeg.p1[0], this.curSeg.p1[1], this.curSeg.p2[0], this.curSeg.p2[1]), + this.curSeg.t = 0, + this.curSeg.preX = this.curSeg.p1[0], + this.curSeg.preY = this.curSeg.p1[1], + this.hitPoint() + } + return this.curSeg + } + ; + var m = function(t, e, i) { + var s, n, r, o = t.p1[e], a = t.p2[e], h = t.t, c = t.p0 ? t.p0[e] : o + (o - a), e = t.p3 ? t.p3[e] : a + (a - o); + return h === l ? (s = l, + n = u, + r = p) : (l = s = h, + u = n = s * s, + p = r = n * s), + (-i * s + 2 * i * n - i * r) * c + (1 + (i - 3) * n + (2 - i) * r) * o + (+i * s + (3 - 2 * i) * n + (i - 2) * r) * a + (-i * n + i * r) * e + }; + function i() {} + function s() {} + function n() {} + e.saveToJSON = function() { + var t = { + ptr: this.curSeg.ptr, + t: this.curSeg.t, + d: this.curSeg.dist, + pX: this.curSeg.preX, + pY: this.curSeg.preY + }; + return { + en: this.enabled, + spd: this.speed, + lop: this.isLooping, + ts: this.tension, + ps: this.points, + ptr: this.curSeg.ptr, + seg: t, + td: this.traveledDist, + ma: this.movingAngle, + mov: this.is_moving + } + } + , + e.loadFromJSON = function(t) { + this.enabled = t.en, + this.speed = t.spd, + this.isLooping = t.lop, + this.tension = t.ts, + this.points = t.ps, + this.curSeg = t.seg, + this.curSeg.ptr = t.seg.ptr, + this.curSeg.t = t.seg.t, + this.curSeg.dist = t.seg.d, + this.curSeg.preX = t.seg.pX, + this.curSeg.preY = t.seg.pY, + this.curSeg.p0 = this.points[this.wrapIndex(this.curSeg.ptr - 1)], + this.curSeg.p1 = this.points[this.wrapIndex(this.curSeg.ptr)], + this.curSeg.p2 = this.points[this.wrapIndex(this.curSeg.ptr + 1)], + this.curSeg.p3 = this.points[this.wrapIndex(this.curSeg.ptr + 2)], + this.traveledDist = t.td, + this.movingAngle = t.ma, + this.is_moving = t.mov + } + , + t.cnds = new i, + i.prototype.OnHitTarget = function() { + return this.is_my_call + } + , + i.prototype.OnHitAnyPoint = function() { + return this.is_my_call + } + , + i.prototype.IsMoving = function() { + return this.enabled && this.is_moving + } + , + t.acts = new s, + s.prototype.SetEnabled = function(t) { + this.enabled = 1 === t + } + , + s.prototype.SetAngleEnabled = function(t) { + this.setAngle = 1 === t + } + , + s.prototype.AddPoint = function(t, e) { + this.points.push([t, e]) + } + , + s.prototype.ResetPoint = function(t, e, i) { + if (this.is_moving) { + var s = this.curSeg.ptr + , n = this.curSeg.ptr + 1; + if (s === t || n === t) + return + } + t < 0 ? this.points.unshift([e, i]) : t < this.points.length ? ((t = this.points[t])[0] = e, + t[1] = i) : this.points.push([e, i]) + } + , + s.prototype.CleanAll = function() { + this.points.length = 0, + this.is_moving = !1 + } + , + s.prototype.Start = function() { + this.start() + } + , + s.prototype.Stop = function() { + this.is_moving = !1 + } + , + s.prototype.SetSpeed = function(t) { + this.speed = t + } + , + s.prototype.SetLooping = function(t) { + this.isLooping = 1 === t + } + , + s.prototype.SetTension = function(t) { + this.tension = t + } + , + t.exps = new n, + n.prototype.Speed = function(t) { + t.set_float(this.speed) + } + , + n.prototype.Tension = function(t) { + t.set_float(this.tension) + } + , + n.prototype.AngleOfMotion = function(t) { + t.set_float(cr.to_clamped_degrees(this.movingAngle)) + } + , + n.prototype.Point = function(t, e, i) { + var s = this.points; + null != e && (s = s[e]), + null != s && null != i && (0 === i || "x" === i || "X" === i ? s = s[0] : 1 !== i && "y" !== i && "Y" !== i || (s = s[1])), + t.set_any(function(t, e) { + t = !0 === t ? 1 : !1 === t ? 0 : null == t ? null != e ? e : 0 : "object" == typeof t ? JSON.stringify(t) : t; + return t + }(s)) + } + , + n.prototype.CurSegP0 = function(t, e) { + var i = this.curSeg.ptr; + null != e && (null != (i = this.points[i]) ? 0 === e || "x" === e || "X" === e ? i = i[0] : 1 !== e && "y" !== e && "Y" !== e || (i = i[1]) : i = 0), + t.set_int(i) + } + , + n.prototype.CurSegP1 = function(t, e) { + var i = this.wrapIndex(this.curSeg.ptr + 1); + null != e && (null != (i = this.points[i]) ? 0 === e || "x" === e || "X" === e ? i = i[0] : 1 !== e && "y" !== e && "Y" !== e || (i = i[1]) : i = 0), + t.set_int(i) + } + , + n.prototype.PointsCount = function(t) { + t.set_int(this.points.length) + } + , + n.prototype.TraveledDistance = function(t) { + t.set_float(this.traveledDist) + } +}(), +cr.behaviors.Rotate = function(t) { + this.runtime = t +} +, +function() { + var t = cr.behaviors.Rotate.prototype; + t.Type = function(t, e) { + this.behavior = t, + this.objtype = e, + this.runtime = t.runtime + } + , + t.Type.prototype.onCreate = function() {} + , + t.Instance = function(t, e) { + this.type = t, + this.behavior = t.behavior, + this.inst = e, + this.runtime = t.runtime + } + ; + var e = t.Instance.prototype; + function i() {} + function s() {} + e.onCreate = function() { + this.speed = cr.to_radians(this.properties[0]), + this.acc = cr.to_radians(this.properties[1]) + } + , + e.saveToJSON = function() { + return { + speed: this.speed, + acc: this.acc + } + } + , + e.loadFromJSON = function(t) { + this.speed = t.speed, + this.acc = t.acc + } + , + e.tick = function() { + var t = this.runtime.getDt(this.inst); + 0 !== t && (0 !== this.acc && (this.speed += this.acc * t), + 0 !== this.speed && (this.inst.angle = cr.clamp_angle(this.inst.angle + this.speed * t), + this.inst.set_bbox_changed())) + } + , + t.cnds = new function() {} + , + i.prototype.SetSpeed = function(t) { + this.speed = cr.to_radians(t) + } + , + i.prototype.SetAcceleration = function(t) { + this.acc = cr.to_radians(t) + } + , + t.acts = new i, + s.prototype.Speed = function(t) { + t.set_float(cr.to_degrees(this.speed)) + } + , + s.prototype.Acceleration = function(t) { + t.set_float(cr.to_degrees(this.acc)) + } + , + t.exps = new s +}(), +cr.behaviors.Sin = function(t) { + this.runtime = t +} +, +function() { + var t = cr.behaviors.Sin.prototype; + t.Type = function(t, e) { + this.behavior = t, + this.objtype = e, + this.runtime = t.runtime + } + , + t.Type.prototype.onCreate = function() {} + , + t.Instance = function(t, e) { + this.type = t, + this.behavior = t.behavior, + this.inst = e, + this.runtime = t.runtime, + this.i = 0 + } + ; + var e = t.Instance.prototype + , i = 2 * Math.PI + , s = Math.PI / 2 + , n = 3 * Math.PI / 2; + function r() {} + function o() {} + function a() {} + e.onCreate = function() { + this.active = 1 === this.properties[0], + this.movement = this.properties[1], + this.wave = this.properties[2], + this.period = this.properties[3], + this.period += Math.random() * this.properties[4], + 0 === this.period ? this.i = 0 : (this.i = this.properties[5] / this.period * i, + this.i += Math.random() * this.properties[6] / this.period * i), + this.mag = this.properties[7], + this.mag += Math.random() * this.properties[8], + this.initialValue = 0, + this.initialValue2 = 0, + this.ratio = 0, + 5 === this.movement && (this.mag = cr.to_radians(this.mag)), + this.init() + } + , + e.saveToJSON = function() { + return { + i: this.i, + a: this.active, + mv: this.movement, + w: this.wave, + p: this.period, + mag: this.mag, + iv: this.initialValue, + iv2: this.initialValue2, + r: this.ratio, + lkv: this.lastKnownValue, + lkv2: this.lastKnownValue2 + } + } + , + e.loadFromJSON = function(t) { + this.i = t.i, + this.active = t.a, + this.movement = t.mv, + this.wave = t.w, + this.period = t.p, + this.mag = t.mag, + this.initialValue = t.iv, + this.initialValue2 = t.iv2 || 0, + this.ratio = t.r, + this.lastKnownValue = t.lkv, + this.lastKnownValue2 = t.lkv2 || 0 + } + , + e.init = function() { + switch (this.movement) { + case 0: + this.initialValue = this.inst.x; + break; + case 1: + this.initialValue = this.inst.y; + break; + case 2: + this.initialValue = this.inst.width, + this.ratio = this.inst.height / this.inst.width; + break; + case 3: + this.initialValue = this.inst.width; + break; + case 4: + this.initialValue = this.inst.height; + break; + case 5: + this.initialValue = this.inst.angle; + break; + case 6: + this.initialValue = this.inst.opacity; + break; + case 7: + this.initialValue = 0; + break; + case 8: + this.initialValue = this.inst.x, + this.initialValue2 = this.inst.y + } + this.lastKnownValue = this.initialValue, + this.lastKnownValue2 = this.initialValue2 + } + , + e.waveFunc = function(t) { + switch (t %= i, + this.wave) { + case 0: + return Math.sin(t); + case 1: + return t <= s ? t / s : t <= n ? 1 - 2 * (t - s) / Math.PI : (t - n) / s - 1; + case 2: + return 2 * t / i - 1; + case 3: + return -2 * t / i + 1; + case 4: + return t < Math.PI ? -1 : 1 + } + return 0 + } + , + e.tick = function() { + var t = this.runtime.getDt(this.inst); + this.active && 0 !== t && (0 === this.period ? this.i = 0 : (this.i += t / this.period * i, + this.i = this.i % i), + this.updateFromPhase()) + } + , + e.updateFromPhase = function() { + switch (this.movement) { + case 0: + this.inst.x !== this.lastKnownValue && (this.initialValue += this.inst.x - this.lastKnownValue), + this.inst.x = this.initialValue + this.waveFunc(this.i) * this.mag, + this.lastKnownValue = this.inst.x; + break; + case 1: + this.inst.y !== this.lastKnownValue && (this.initialValue += this.inst.y - this.lastKnownValue), + this.inst.y = this.initialValue + this.waveFunc(this.i) * this.mag, + this.lastKnownValue = this.inst.y; + break; + case 2: + this.inst.width = this.initialValue + this.waveFunc(this.i) * this.mag, + this.inst.height = this.inst.width * this.ratio; + break; + case 3: + this.inst.width = this.initialValue + this.waveFunc(this.i) * this.mag; + break; + case 4: + this.inst.height = this.initialValue + this.waveFunc(this.i) * this.mag; + break; + case 5: + this.inst.angle !== this.lastKnownValue && (this.initialValue = cr.clamp_angle(this.initialValue + (this.inst.angle - this.lastKnownValue))), + this.inst.angle = cr.clamp_angle(this.initialValue + this.waveFunc(this.i) * this.mag), + this.lastKnownValue = this.inst.angle; + break; + case 6: + this.inst.opacity = this.initialValue + this.waveFunc(this.i) * this.mag / 100, + this.inst.opacity < 0 ? this.inst.opacity = 0 : 1 < this.inst.opacity && (this.inst.opacity = 1); + break; + case 8: + this.inst.x !== this.lastKnownValue && (this.initialValue += this.inst.x - this.lastKnownValue), + this.inst.y !== this.lastKnownValue2 && (this.initialValue2 += this.inst.y - this.lastKnownValue2), + this.inst.x = this.initialValue + Math.cos(this.inst.angle) * this.waveFunc(this.i) * this.mag, + this.inst.y = this.initialValue2 + Math.sin(this.inst.angle) * this.waveFunc(this.i) * this.mag, + this.lastKnownValue = this.inst.x, + this.lastKnownValue2 = this.inst.y + } + this.inst.set_bbox_changed() + } + , + e.onSpriteFrameChanged = function(t, e) { + switch (this.movement) { + case 2: + this.initialValue *= e.width / t.width, + this.ratio = e.height / e.width; + break; + case 3: + this.initialValue *= e.width / t.width; + break; + case 4: + this.initialValue *= e.height / t.height + } + } + , + r.prototype.IsActive = function() { + return this.active + } + , + r.prototype.CompareMovement = function(t) { + return this.movement === t + } + , + r.prototype.ComparePeriod = function(t, e) { + return cr.do_cmp(this.period, t, e) + } + , + r.prototype.CompareMagnitude = function(t, e) { + return 5 === this.movement ? cr.do_cmp(this.mag, t, cr.to_radians(e)) : cr.do_cmp(this.mag, t, e) + } + , + r.prototype.CompareWave = function(t) { + return this.wave === t + } + , + t.cnds = new r, + o.prototype.SetActive = function(t) { + this.active = 1 === t + } + , + o.prototype.SetPeriod = function(t) { + this.period = t + } + , + o.prototype.SetMagnitude = function(t) { + this.mag = t, + 5 === this.movement && (this.mag = cr.to_radians(this.mag)) + } + , + o.prototype.SetMovement = function(t) { + 5 === this.movement && 5 !== t && (this.mag = cr.to_degrees(this.mag)), + this.movement = t, + this.init() + } + , + o.prototype.SetWave = function(t) { + this.wave = t + } + , + o.prototype.SetPhase = function(t) { + this.i = t * i % i, + this.updateFromPhase() + } + , + o.prototype.UpdateInitialState = function() { + this.init() + } + , + t.acts = new o, + a.prototype.CyclePosition = function(t) { + t.set_float(this.i / i) + } + , + a.prototype.Period = function(t) { + t.set_float(this.period) + } + , + a.prototype.Magnitude = function(t) { + 5 === this.movement ? t.set_float(cr.to_degrees(this.mag)) : t.set_float(this.mag) + } + , + a.prototype.Value = function(t) { + t.set_float(this.waveFunc(this.i) * this.mag) + } + , + t.exps = new a +}(); +var easeOutBounceArray = [] + , easeInElasticArray = [] + , easeOutElasticArray = [] + , easeInOutElasticArray = [] + , easeInCircle = [] + , easeOutCircle = [] + , easeInOutCircle = [] + , easeInBack = [] + , easeOutBack = [] + , easeInOutBack = [] + , litetween_precision = 1e4 + , updateLimit = 0; +function easeOutBouncefunc(t) { + return result = (t /= 1) < 1 / 2.75 ? 7.5625 * t * t * 1 + 0 : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + .75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + .9375 : 7.5625 * (t -= 2.625 / 2.75) * t + .984375, + result +} +function integerize(t, e) { + return Math.round(t / e * litetween_precision) +} +function easeFunc(t, e, i, s, n, r, o) { + var a, h, c, l, u = 0; + switch (t) { + case 0: + u = s * e / n + i; + break; + case 1: + u = s * (e /= n) * e + i; + break; + case 2: + u = -s * (e /= n) * (e - 2) + i; + break; + case 3: + u = (e /= n / 2) < 1 ? s / 2 * e * e + i : -s / 2 * (--e * (e - 2) - 1) + i; + break; + case 4: + u = s * (e /= n) * e * e + i; + break; + case 5: + u = s * ((e = e / n - 1) * e * e + 1) + i; + break; + case 6: + u = (e /= n / 2) < 1 ? s / 2 * e * e * e + i : s / 2 * ((e -= 2) * e * e + 2) + i; + break; + case 7: + u = s * (e /= n) * e * e * e + i; + break; + case 8: + u = -s * ((e = e / n - 1) * e * e * e - 1) + i; + break; + case 9: + u = (e /= n / 2) < 1 ? s / 2 * e * e * e * e + i : -s / 2 * ((e -= 2) * e * e * e - 2) + i; + break; + case 10: + u = s * (e /= n) * e * e * e * e + i; + break; + case 11: + u = s * ((e = e / n - 1) * e * e * e * e + 1) + i; + break; + case 12: + u = (e /= n / 2) < 1 ? s / 2 * e * e * e * e * e + i : s / 2 * ((e -= 2) * e * e * e * e + 2) + i; + break; + case 13: + u = o.optimized ? easeInCircle[integerize(e, n)] : -(Math.sqrt(1 - e * e) - 1); + break; + case 14: + u = o.optimized ? easeOutCircle[integerize(e, n)] : Math.sqrt(1 - (e - 1) * (e - 1)); + break; + case 15: + u = o.optimized ? easeInOutCircle[integerize(e, n)] : (e /= n / 2) < 1 ? -s / 2 * (Math.sqrt(1 - e * e) - 1) + i : s / 2 * (Math.sqrt(1 - (e -= 2) * e) + 1) + i; + break; + case 16: + u = o.optimized ? easeInBack[integerize(e, n)] : s * (e /= n) * e * (((c = o.s) + 1) * e - c) + i; + break; + case 17: + u = o.optimized ? easeOutBack[integerize(e, n)] : s * ((e = e / n - 1) * e * (((c = o.s) + 1) * e + c) + 1) + i; + break; + case 18: + u = o.optimized ? easeInOutBack[integerize(e, n)] : (c = o.s, + (e /= n / 2) < 1 ? s / 2 * (e * e * ((1 + (c *= 1.525)) * e - c)) + i : s / 2 * ((e -= 2) * e * ((1 + (c *= 1.525)) * e + c) + 2) + i); + break; + case 19: + u = o.optimized ? easeInElasticArray[integerize(e, n)] : (a = o.a, + (c = 0) == e && (u = i), + 1 == (e /= n) && (u = i + s), + 0 == (h = o.p) && (h = .3 * n), + c = 0 == a || a < Math.abs(s) ? (a = s, + h / 4) : h / (2 * Math.PI) * Math.asin(s / a), + -(a * Math.pow(2, 10 * --e) * Math.sin((e * n - c) * (2 * Math.PI) / h)) + i); + break; + case 20: + u = o.optimized ? easeOutElasticArray[integerize(e, n)] : (a = o.a, + (c = 0) == e && (u = i), + 1 == (e /= n) && (u = i + s), + 0 == (h = o.p) && (h = .3 * n), + c = 0 == a || a < Math.abs(s) ? (a = s, + h / 4) : h / (2 * Math.PI) * Math.asin(s / a), + a * Math.pow(2, -10 * e) * Math.sin((e * n - c) * (2 * Math.PI) / h) + s + i); + break; + case 21: + u = o.optimized ? easeInOutElasticArray[integerize(e, n)] : (a = o.a, + (c = 0) == e && (u = i), + 2 == (e /= n / 2) && (u = i + s), + 0 == (h = o.p) && (h = n * (.3 * 1.5)), + c = 0 == a || a < Math.abs(s) ? (a = s, + h / 4) : h / (2 * Math.PI) * Math.asin(s / a), + e < 1 ? a * Math.pow(2, 10 * --e) * Math.sin((e * n - c) * (2 * Math.PI) / h) * -.5 + i : a * Math.pow(2, -10 * --e) * Math.sin((e * n - c) * (2 * Math.PI) / h) * .5 + s + i); + break; + case 22: + u = o.optimized ? s - easeOutBounceArray[integerize(n - e, n)] + i : s - easeOutBouncefunc(n - e / n) + i; + break; + case 23: + u = o.optimized ? easeOutBounceArray[integerize(e, n)] : easeOutBouncefunc(e / n); + break; + case 24: + u = o.optimized ? e < n / 2 ? .5 * (s - easeOutBounceArray[integerize(n - 2 * e, n)] + i) + i : .5 * easeOutBounceArray[integerize(2 * e - n, n)] + .5 * s + i : e < n / 2 ? .5 * (s - easeOutBouncefunc(n - 2 * e) + i) + i : .5 * easeOutBouncefunc((2 * e - n) / n) + .5 * s + i; + break; + case 25: + u = (l = e / n / 2) * l * (3 - 2 * l) * 2; + break; + case 26: + u = (l = (e / n + 1) / 2) * l * (3 - 2 * l) * 2 - 1; + break; + case 27: + u = (l = e / n) * l * (3 - 2 * l) + } + return r ? s - i - u : u +} +!function() { + for (var t = 0, e = 0, i = 0, s = 0, n = 0, r = 0; r <= litetween_precision; r++) { + s = r / litetween_precision, + t = (s /= 1) < 1 / 2.75 ? 7.5625 * s * s * 1 + 0 : s < 2 / 2.75 ? 7.5625 * (s -= 1.5 / 2.75) * s + .75 : s < 2.5 / 2.75 ? 7.5625 * (s -= 2.25 / 2.75) * s + .9375 : 7.5625 * (s -= 2.625 / 2.75) * s + .984375; + easeOutBounceArray[r] = t, + (i = e = 0) == (s = r / litetween_precision) && (t = 0), + 1 == (s /= 1) && (t = 1), + 0 == i && (i = .3), + n = 0 == e || e < Math.abs(1) ? (e = 1, + i / 4) : i / (2 * Math.PI) * Math.asin(1 / e), + t = 0 - e * Math.pow(2, 10 * --s) * Math.sin((+s - n) * (2 * Math.PI) / i), + easeInElasticArray[r] = t, + (i = e = 0) == (s = r / litetween_precision) && (t = 0), + 1 == (s /= 1) && (t = 1), + 0 == i && (i = .3), + n = 0 == e || e < Math.abs(1) ? (e = 1, + i / 4) : i / (2 * Math.PI) * Math.asin(1 / e), + t = e * Math.pow(2, -10 * s) * Math.sin((+s - n) * (2 * Math.PI) / i) + 1, + easeOutElasticArray[r] = t, + (i = e = 0) == (s = r / litetween_precision) && (t = 0), + 2 == (s /= .5) && (t = 1), + 0 == i && (i = .3 * 1.5 * 1), + n = 0 == e || e < Math.abs(1) ? (e = 1, + i / 4) : i / (2 * Math.PI) * Math.asin(1 / e), + t = s < 1 ? e * Math.pow(2, 10 * --s) * Math.sin((+s - n) * (2 * Math.PI) / i) * -.5 + 0 : e * Math.pow(2, -10 * --s) * Math.sin((+s - n) * (2 * Math.PI) / i) * .5 + 1, + easeInOutElasticArray[r] = t, + s = r / litetween_precision, + easeInCircle[r] = -(Math.sqrt(1 - s * s) - 1), + s = r / litetween_precision, + easeOutCircle[r] = Math.sqrt(1 - (s - 1) * (s - 1)), + s = r / litetween_precision, + t = (s /= .5) < 1 ? -.5 * (Math.sqrt(1 - s * s) - 1) + 0 : .5 * (Math.sqrt(1 - (s -= 2) * s) + 1) + 0, + easeInOutCircle[r] = t, + s = r / litetween_precision, + (n = 0) == n && (n = 1.70158), + t = (s /= 1) * s * ((n + 1) * s - n) + 0, + easeInBack[r] = t, + (n = 0) == n && (n = 1.70158), + t = (s = +(s = r / litetween_precision) - 1) * s * ((n + 1) * s + n) + 1, + easeOutBack[r] = t, + s = r / litetween_precision, + (n = 0) == n && (n = 1.70158), + t = (s /= .5) < 1 ? s * s * ((1 + (n *= 1.525)) * s - n) * .5 + 0 : .5 * ((s -= 2) * s * ((1 + (n *= 1.525)) * s + n) + 2) + 0, + easeInOutBack[r] = t + } +}(); +var TweenObject = function(t, e, i, s, n, r, o) { + this.name = t, + this.value = 0, + this.setInitial(s), + this.setTarget(n), + this.easefunc = i, + this.tweened = e, + this.duration = r, + this.progress = 0, + this.state = 0, + this.onStart = !1, + this.onEnd = !1, + this.onReverseStart = !1, + this.onReverseEnd = !1, + this.lastKnownValue = 0, + this.lastKnownValue2 = 0, + this.enforce = o, + this.pingpong = 1, + this.flipEase = !1, + this.easingparam = [], + this.lastState = 1; + for (var a = 0; a < 28; a++) + this.easingparam[a] = {}, + this.easingparam[a].a = 0, + this.easingparam[a].p = 0, + this.easingparam[a].t = 0, + this.easingparam[a].s = 0, + this.easingparam[a].optimized = !0 +}; +function trim(t) { + return t.replace(/^\s\s*/, "").replace(/\s\s*$/, "") +} +function isReversed(t) { + var e = t[0] + , i = t[1] + , t = t[2] + , e = cp.v.sub(i, e) + , i = cp.v.sub(t, i); + return cp.v.cross(e, i) < 0 +} +function pointsInTriangle(t, e) { + for (var i, s = 0; s < t.length; ++s) + if (i = t[s], + -1 == e.indexOf(i) && pointInTriangle(i, e)) + return !0; + return !1 +} +function pointInTriangle(t, e) { + var i = t + , s = e[0] + , n = e[1] + , r = e[2] + , t = cp.v.sub(r, s) + , e = cp.v.sub(n, s) + , r = cp.v.sub(i, s) + , n = cp.v.dot(t, t) + , i = cp.v.dot(t, e) + , s = cp.v.dot(t, r) + , t = cp.v.dot(e, e) + , e = cp.v.dot(e, r) + , r = 1 / (n * t - i * i) + , t = (t * s - i * e) * r + , r = (n * e - i * s) * r; + return 0 <= t && 0 <= r && t + r < 1 +} +function triangulate(t) { + for (var e, i = t.slice(0), s = [], n = 0; 3 <= i.length; ) + isReversed(e = [i[n], i[(n + 1) % i.length], i[(n + 2) % i.length]]) || pointsInTriangle(i, e) ? n++ : (i.splice((n + 1) % i.length, 1), + s.push(e)), + n %= i.length; + return s +} +function add_tri_2_poly(t, e) { + for (var i, s, n = 0, r = 0; r < 3; r++) + -1 == t.indexOf(e[r]) ? (i = e[r], + s = e[(r + 1) % 3]) : n++; + if (2 != n) + return !1; + r = t.indexOf(s); + var o = t.length; + return !isReversed([t[(r - 2 + o) % o], t[(r - 1 + o) % o], i]) && !isReversed([i, t[r], t[(r + 1) % o]]) && (t.splice(r, 0, i), + !0) +} +function triangles2convex(t) { + for (var e = t, i = []; 0 < e.length; ) { + var s = e[0]; + e.shift(); + for (var n = 0; n < e.length; n++) + add_tri_2_poly(s, e[n]) && (e.splice(n, 1), + n = -1); + i.push(s) + } + return i +} +TweenObject.prototype = {}, +TweenObject.prototype.flipTarget = function() { + var t = this.initialparam1 + , e = this.initialparam2; + this.initialparam1 = this.targetparam1, + this.initialparam2 = this.targetparam2, + this.targetparam1 = t, + this.targetparam2 = e, + this.lastKnownValue = 0, + this.lastKnownValue2 = 0 +} +, +TweenObject.prototype.setInitial = function(t) { + this.initialparam1 = parseFloat(t.split(",")[0]), + this.initialparam2 = parseFloat(t.split(",")[1]), + this.lastKnownValue = 0, + this.lastKnownValue2 = 0 +} +, +TweenObject.prototype.setTarget = function(t) { + this.targetparam1 = parseFloat(t.split(",")[0]), + this.targetparam2 = parseFloat(t.split(",")[1]), + isNaN(this.targetparam2) && (this.targetparam2 = this.targetparam1) +} +, +TweenObject.prototype.OnTick = function(t) { + return 0 === this.state ? -1 : (1 === this.state && (this.progress += t), + 2 === this.state && (this.progress -= t), + 3 === this.state && (this.state = 0), + 4 !== this.state && 6 !== this.state || (this.progress += t * this.pingpong), + 5 === this.state && (this.progress += t * this.pingpong), + this.progress < 0 ? (this.progress = 0, + 4 === this.state ? this.pingpong = 1 : 6 === this.state ? (this.pingpong = 1, + this.flipEase = !1) : this.state = 0, + this.onReverseEnd = !0, + 0) : this.progress > this.duration ? (this.progress = this.duration, + 4 === this.state ? this.pingpong = -1 : 6 === this.state ? (this.pingpong = -1, + this.flipEase = !0) : 5 === this.state ? this.progress = 0 : this.state = 0, + this.onEnd = !0, + 1) : this.flipEase ? easeFunc(this.easefunc, this.duration - this.progress, 0, 1, this.duration, this.flipEase, this.easingparam[this.easefunc]) : easeFunc(this.easefunc, this.progress, 0, 1, this.duration, this.flipEase, this.easingparam[this.easefunc])) +} +, +cr.behaviors.lunarray_LiteTween = function(t) { + this.runtime = t +} +, +function() { + var t = cr.behaviors.lunarray_LiteTween.prototype; + t.Type = function(t, e) { + this.behavior = t, + this.objtype = e, + this.runtime = t.runtime + } + , + t.Type.prototype.onCreate = function() {} + , + t.Instance = function(t, e) { + this.type = t, + this.behavior = t.behavior, + this.inst = e, + this.runtime = t.runtime, + this.i = 0 + } + ; + var e = t.Instance.prototype; + e.onCreate = function() { + this.playmode = this.properties[0], + this.active = 1 == this.playmode || 2 == this.playmode || 3 == this.playmode || 4 == this.playmode, + this.tweened = this.properties[1], + this.easing = this.properties[2], + this.target = this.properties[3], + this.targetmode = this.properties[4], + this.useCurrent = !1, + 1 === this.targetmode && (this.target = "relative(" + this.target + ")"), + this.duration = this.properties[5], + this.enforce = 1 === this.properties[6], + this.value = 0, + this.tween_list = {}, + this.addToTweenList("default", this.tweened, this.easing, "current", this.target, this.duration, this.enforce), + 1 === this.properties[0] && this.startTween(0), + 2 === this.properties[0] && this.startTween(2), + 3 === this.properties[0] && this.startTween(3), + 4 === this.properties[0] && this.startTween(4) + } + , + e.parseCurrent = function(t, e) { + void 0 === e && (e = "current"); + var i = trim(e); + e = trim(e); + var s = this.value; + if ("current" === e) + switch (t) { + case 0: + i = this.inst.x + "," + this.inst.y; + break; + case 1: + case 2: + case 3: + i = this.inst.width + "," + this.inst.height; + break; + case 4: + i = cr.to_degrees(this.inst.angle) + "," + cr.to_degrees(this.inst.angle); + break; + case 5: + i = 100 * this.inst.opacity + "," + 100 * this.inst.opacity; + break; + case 6: + i = s + "," + s; + break; + case 7: + case 8: + i = this.inst.x + "," + this.inst.y; + break; + case 9: + i = void 0 !== this.inst.curFrame ? this.inst.width / this.inst.curFrame.width + "," + this.inst.height / this.inst.curFrame.height : "1,1" + } + if ("relative" === e.substring(0, 8)) { + var n, r, e = e.match(/\((.*?)\)/); + switch (e && (n = parseFloat(e[1].split(",")[0]), + r = parseFloat(e[1].split(",")[1])), + isNaN(n) && (n = 0), + isNaN(r) && (r = 0), + t) { + case 0: + i = this.inst.x + n + "," + (this.inst.y + r); + break; + case 1: + case 2: + case 3: + i = this.inst.width + n + "," + (this.inst.height + r); + break; + case 4: + i = cr.to_degrees(this.inst.angle) + n + "," + (cr.to_degrees(this.inst.angle) + r); + break; + case 5: + i = 100 * this.inst.opacity + n + "," + (100 * this.inst.opacity + r); + break; + case 6: + i = s + n + "," + s + n; + break; + case 7: + i = this.inst.x + n + "," + this.inst.y; + break; + case 8: + i = this.inst.x + "," + (this.inst.y + n); + break; + case 9: + i = n + "," + r + } + } + return i + } + , + e.addToTweenList = function(t, e, i, s, n, r, o) { + s = this.parseCurrent(e, s), + n = this.parseCurrent(e, n), + void 0 !== this.tween_list[t] && delete this.tween_list[t], + this.tween_list[t] = new TweenObject(t,e,i,s,n,r,o), + this.tween_list[t].dt = 0 + } + , + e.saveToJSON = function() { + JSON.stringify(this.tween_list.default); + return { + playmode: this.playmode, + active: this.active, + tweened: this.tweened, + easing: this.easing, + target: this.target, + targetmode: this.targetmode, + useCurrent: this.useCurrent, + duration: this.duration, + enforce: this.enforce, + value: this.value, + tweenlist: JSON.stringify(this.tween_list.default) + } + } + , + TweenObject.Load = function(t, e, i, s, n, r, o, a) { + var h, c = new TweenObject(e,i,s,n,r,o,a); + for (h in t) + c[h] = t[h]; + return c + } + , + e.loadFromJSON = function(t) { + var e = JSON.parse(t.tweenlist) + , e = TweenObject.Load(e, e.name, e.tweened, e.easefunc, e.initialparam1 + "," + e.initialparam2, e.targetparam1 + "," + e.targetparam2, e.duration, e.enforce); + this.tween_list.default = e, + this.playmode = t.playmode, + this.active = t.active, + this.movement = t.tweened, + this.easing = t.easing, + this.target = t.target, + this.targetmode = t.targetmode, + this.useCurrent = t.useCurrent, + this.duration = t.duration, + this.enforce = t.enforce, + this.value = t.value + } + , + e.setProgressTo = function(t) { + for (var e in 1 < t && (t = 1), + t < 0 && (t = 0), + this.tween_list) { + var i = this.tween_list[e]; + i.lastKnownValue = 0, + i.lastKnownValue2 = 0, + i.state = 3, + i.progress = t * i.duration; + var s = i.OnTick(0); + this.updateTween(i, s) + } + } + , + e.startTween = function(t) { + for (var e in this.tween_list) { + var i, s, n = this.tween_list[e]; + this.useCurrent && (i = this.parseCurrent(n.tweened, "current"), + s = this.parseCurrent(n.tweened, this.target), + n.setInitial(i), + n.setTarget(s)), + 0 === t && (n.progress = 1e-6, + n.lastKnownValue = 0, + n.lastKnownValue2 = 0, + n.onStart = !0, + n.state = 1), + 1 === t && (n.state = n.lastState), + 2 !== t && 4 !== t || (n.progress = 1e-6, + n.lastKnownValue = 0, + n.lastKnownValue2 = 0, + n.onStart = !0, + 2 == t && (n.state = 4), + 4 == t && (n.state = 6)), + 3 === t && (n.progress = 1e-6, + n.lastKnownValue = 0, + n.lastKnownValue2 = 0, + n.onStart = !0, + n.state = 5) + } + } + , + e.stopTween = function(t) { + for (var e in this.tween_list) { + var i = this.tween_list[e]; + 3 != i.state && 0 != i.state && (i.lastState = i.state), + 1 === t && (i.progress = 0), + 2 === t && (i.progress = i.duration), + i.state = 3; + var s = i.OnTick(0); + this.updateTween(i, s) + } + } + , + e.reverseTween = function(t) { + for (var e in this.tween_list) { + var i = this.tween_list[e]; + 1 === t && (i.progress = i.duration, + i.lastKnownValue = 0, + i.lastKnownValue2 = 0, + i.onReverseStart = !0), + i.state = 2 + } + } + , + e.updateTween = function(t, e) { + var i, s; + 0 === t.tweened ? t.enforce ? (this.inst.x = t.initialparam1 + (t.targetparam1 - t.initialparam1) * e, + this.inst.y = t.initialparam2 + (t.targetparam2 - t.initialparam2) * e) : (this.inst.x += (t.targetparam1 - t.initialparam1) * e - t.lastKnownValue, + this.inst.y += (t.targetparam2 - t.initialparam2) * e - t.lastKnownValue2, + t.lastKnownValue = (t.targetparam1 - t.initialparam1) * e, + t.lastKnownValue2 = (t.targetparam2 - t.initialparam2) * e) : 1 === t.tweened ? t.enforce ? (this.inst.width = t.initialparam1 + (t.targetparam1 - t.initialparam1) * e, + this.inst.height = t.initialparam2 + (t.targetparam2 - t.initialparam2) * e) : (this.inst.width += (t.targetparam1 - t.initialparam1) * e - t.lastKnownValue, + this.inst.height += (t.targetparam2 - t.initialparam2) * e - t.lastKnownValue2, + t.lastKnownValue = (t.targetparam1 - t.initialparam1) * e, + t.lastKnownValue2 = (t.targetparam2 - t.initialparam2) * e) : 2 === t.tweened ? t.enforce ? this.inst.width = t.initialparam1 + (t.targetparam1 - t.initialparam1) * e : (this.inst.width += (t.targetparam1 - t.initialparam1) * e - t.lastKnownValue, + t.lastKnownValue = (t.targetparam1 - t.initialparam1) * e) : 3 === t.tweened ? t.enforce ? this.inst.height = t.initialparam2 + (t.targetparam2 - t.initialparam2) * e : (this.inst.height += (t.targetparam2 - t.initialparam2) * e - t.lastKnownValue2, + t.lastKnownValue2 = (t.targetparam2 - t.initialparam2) * e) : 4 === t.tweened ? t.enforce ? (s = t.initialparam1 + (t.targetparam1 - t.initialparam1) * e, + this.inst.angle = cr.clamp_angle(cr.to_radians(s))) : (s = (t.targetparam1 - t.initialparam1) * e - t.lastKnownValue, + this.inst.angle = cr.clamp_angle(this.inst.angle + cr.to_radians(s)), + t.lastKnownValue = (t.targetparam1 - t.initialparam1) * e) : 5 === t.tweened ? t.enforce ? this.inst.opacity = (t.initialparam1 + (t.targetparam1 - t.initialparam1) * e) / 100 : (this.inst.opacity += ((t.targetparam1 - t.initialparam1) * e - t.lastKnownValue) / 100, + t.lastKnownValue = (t.targetparam1 - t.initialparam1) * e) : 6 === t.tweened ? t.enforce ? this.value = t.initialparam1 + (t.targetparam1 - t.initialparam1) * e : (this.value += (t.targetparam1 - t.initialparam1) * e - t.lastKnownValue, + t.lastKnownValue = (t.targetparam1 - t.initialparam1) * e) : 7 === t.tweened ? t.enforce ? this.inst.x = t.initialparam1 + (t.targetparam1 - t.initialparam1) * e : (this.inst.x += (t.targetparam1 - t.initialparam1) * e - t.lastKnownValue, + t.lastKnownValue = (t.targetparam1 - t.initialparam1) * e) : 8 === t.tweened ? t.enforce ? this.inst.y = t.initialparam2 + (t.targetparam2 - t.initialparam2) * e : (this.inst.y += (t.targetparam2 - t.initialparam2) * e - t.lastKnownValue2, + t.lastKnownValue2 = (t.targetparam2 - t.initialparam2) * e) : 9 === t.tweened && (i = t.initialparam1 + (t.targetparam1 - t.initialparam1) * e, + s = t.initialparam2 + (t.targetparam2 - t.initialparam2) * e, + this.inst.width < 0 && (i = t.initialparam1 + (t.targetparam1 + t.initialparam1) * -e), + this.inst.height < 0 && (s = t.initialparam2 + (t.targetparam2 + t.initialparam2) * -e), + t.enforce ? (this.inst.width = this.inst.curFrame.width * i, + this.inst.height = this.inst.curFrame.height * s) : (this.inst.width < 0 ? (this.inst.width = i * (this.inst.width / (-1 + t.lastKnownValue)), + t.lastKnownValue = i + 1) : (this.inst.width = i * (this.inst.width / (1 + t.lastKnownValue)), + t.lastKnownValue = i - 1), + this.inst.height < 0 ? (this.inst.height = s * (this.inst.height / (-1 + t.lastKnownValue2)), + t.lastKnownValue2 = s + 1) : (this.inst.height = s * (this.inst.height / (1 + t.lastKnownValue2)), + t.lastKnownValue2 = s - 1))), + this.inst.set_bbox_changed() + } + , + e.tick = function() { + var t = this.runtime.getDt(this.inst) + , e = this.tween_list.default; + 0 !== e.state && (e.onStart && (this.runtime.trigger(cr.behaviors.lunarray_LiteTween.prototype.cnds.OnStart, this.inst), + e.onStart = !1), + e.onReverseStart && (this.runtime.trigger(cr.behaviors.lunarray_LiteTween.prototype.cnds.OnReverseStart, this.inst), + e.onReverseStart = !1), + this.active = 1 == e.state || 2 == e.state || 4 == e.state || 5 == e.state || 6 == e.state, + t = e.OnTick(t), + this.updateTween(e, t), + e.onEnd && (this.runtime.trigger(cr.behaviors.lunarray_LiteTween.prototype.cnds.OnEnd, this.inst), + e.onEnd = !1), + e.onReverseEnd && (this.runtime.trigger(cr.behaviors.lunarray_LiteTween.prototype.cnds.OnReverseEnd, this.inst), + e.onReverseEnd = !1)) + } + , + t.cnds = {}, + (e = t.cnds).IsActive = function() { + return 0 !== this.tween_list.default.state + } + , + e.IsReversing = function() { + return 2 == this.tween_list.default.state + } + , + e.CompareProgress = function(t, e) { + var i = this.tween_list.default; + return cr.do_cmp(i.progress / i.duration, t, e) + } + , + e.OnThreshold = function(t, e) { + var i = this.tween_list.default; + this.threshold = cr.do_cmp(i.progress / i.duration, t, e); + e = this.oldthreshold != this.threshold && this.threshold; + return e && (this.oldthreshold = this.threshold), + e + } + , + e.OnStart = function() { + return void 0 !== this.tween_list.default && this.tween_list.default.onStart + } + , + e.OnReverseStart = function() { + return void 0 !== this.tween_list.default && this.tween_list.default.onReverseStart + } + , + e.OnEnd = function() { + return void 0 !== this.tween_list.default && this.tween_list.default.onEnd + } + , + e.OnReverseEnd = function() { + return void 0 !== this.tween_list.default && this.tween_list.default.onReverseEnd + } + , + t.acts = {}, + (e = t.acts).Start = function(t, e) { + this.threshold = !1, + this.oldthreshold = !1, + this.useCurrent = 1 == e, + this.startTween(t) + } + , + e.Stop = function(t) { + this.stopTween(t) + } + , + e.Reverse = function(t) { + this.threshold = !1, + this.oldthreshold = !1, + this.reverseTween(t) + } + , + e.ProgressTo = function(t) { + this.setProgressTo(t) + } + , + e.SetDuration = function(t) { + isNaN(t) || t < 0 || void 0 !== this.tween_list.default && (this.tween_list.default.duration = t) + } + , + e.SetEnforce = function(t) { + void 0 !== this.tween_list.default && (this.tween_list.default.enforce = 1 === t) + } + , + e.SetInitial = function(t) { + void 0 !== this.tween_list.default && (t = this.parseCurrent(this.tween_list.default.tweened, t), + this.tween_list.default.setInitial(t)) + } + , + e.SetTarget = function(t, e, i) { + if (void 0 !== this.tween_list.default && !isNaN(i)) { + var s = this.tween_list.default + , n = i + "" + , r = "" + , o = ""; + if (1 === (this.targetmode = e)) { + switch (this.target = "relative(" + n + ")", + t) { + case 0: + r = this.inst.x + i, + o = s.targetparam2; + break; + case 1: + r = s.targetparam1, + o = this.inst.y + i; + break; + case 2: + o = r = "" + cr.to_degrees(this.inst.angle + cr.to_radians(i)); + break; + case 3: + o = r = "" + 100 * this.inst.opacity + i; + break; + case 4: + r = this.inst.width + i, + o = s.targetparam2; + break; + case 5: + r = s.targetparam1, + o = this.inst.height + i; + break; + case 6: + o = r = i + } + n = r + "," + o + } else { + switch (t) { + case 0: + r = i, + o = s.targetparam2; + break; + case 1: + r = s.targetparam1, + o = i; + break; + case 2: + case 3: + o = r = i; + break; + case 4: + r = i, + o = s.targetparam2; + break; + case 5: + r = s.targetparam1, + o = i; + break; + case 6: + o = r = i + } + n = r + "," + o, + this.target = n + } + t = this.parseCurrent(this.tween_list.default.tweened, "current"), + n = this.parseCurrent(this.tween_list.default.tweened, n); + s.setInitial(t), + s.setTarget(n) + } + } + , + e.SetTweenedProperty = function(t) { + void 0 !== this.tween_list.default && (this.tween_list.default.tweened = t) + } + , + e.SetEasing = function(t) { + void 0 !== this.tween_list.default && (this.tween_list.default.easefunc = t) + } + , + e.SetEasingParam = function(t, e, i, s, n) { + void 0 !== this.tween_list.default && (this.tween_list.default.easingparam[t].optimized = !1, + this.tween_list.default.easingparam[t].a = e, + this.tween_list.default.easingparam[t].p = i, + this.tween_list.default.easingparam[t].t = s, + this.tween_list.default.easingparam[t].s = n) + } + , + e.ResetEasingParam = function() { + void 0 !== this.tween_list.default && (this.tween_list.default.optimized = !0) + } + , + e.SetValue = function(t) { + var e = this.tween_list.default; + this.value = t, + 6 === e.tweened && e.setInitial(this.parseCurrent(e.tweened, "current")) + } + , + e.SetParameter = function(t, e, i, s, n) { + var r; + void 0 === this.tween_list.default ? this.addToTweenList("default", t, e, initial, i, s, n, 0) : ((r = this.tween_list.default).tweened = t, + r.easefunc = e, + r.setInitial(this.parseCurrent(t, "current")), + r.setTarget(this.parseCurrent(t, i)), + r.duration = s, + r.enforce = 1 === n) + } + , + t.exps = {}, + (t = t.exps).State = function(t) { + var e = "N/A"; + switch (this.tween_list.default.state) { + case 0: + e = "paused"; + break; + case 1: + e = "playing"; + break; + case 2: + e = "reversing"; + break; + case 3: + e = "seeking" + } + t.set_string(e) + } + , + t.Progress = function(t) { + var e = this.tween_list.default.progress / this.tween_list.default.duration; + t.set_float(e) + } + , + t.Duration = function(t) { + t.set_float(this.tween_list.default.duration) + } + , + t.Target = function(t) { + var e = this.tween_list.default + , i = "N/A"; + switch (e.tweened) { + case 0: + i = e.targetparam1; + break; + case 1: + i = e.targetparam2; + break; + case 2: + case 3: + case 4: + i = e.targetparam1; + break; + case 5: + i = e.targetparam2; + break; + case 6: + i = e.targetparam1 + } + t.set_float(i) + } + , + t.Value = function(t) { + var e = this.value; + t.set_float(e) + } + , + t.Tween = function(t, e, i, s, n) { + s = 1 < s ? 1 : s, + s = easeFunc(n, s < 0 ? 0 : s, 0, 1, 1, !1, !1); + t.set_float(e + s * (i - e)) + } +}(), +function() { + var n; + function y(t, e) { + if (!t) + throw new Error("Assertion failed: " + e) + } + function g(t, e) { + !t && console && console.warn && (console.warn("ASSERTION FAILED: " + e), + console.trace && console.trace()) + } + function f(t, e) { + return t < e ? t + " " + e : e + " " + t + } + function o(t, e) { + for (var i = 0; i < t.length; i++) + if (t[i] === e) + return t[i] = t[t.length - 1], + t.length--, + 0 + } + Object.create = Object.create || function(t) { + function e() {} + return e.prototype = t, + new e + } + , + "undefined" == typeof exports ? (n = {}, + "object" == typeof window && (window.cp = n)) : n = exports; + var T, A = "object" == typeof window && -1 < window.navigator.userAgent.indexOf("Firefox") ? (T = Math.min, + Math.max) : (T = function(t, e) { + return t < e ? t : e + } + , + function(t, e) { + return e < t ? t : e + } + ); + function d(t, e, i) { + var s = t[2 * e]; + t[2 * e] = t[2 * i], + t[2 * i] = s, + s = t[2 * e + 1], + t[2 * e + 1] = t[2 * i + 1], + t[2 * i + 1] = s + } + function l(t, e, i, s, n, r) { + if (0 === i) + return 0; + for (var o = 0, a = e, h = k(n, s), c = r * S(h), l = e, u = e + i - 1; l <= u; ) { + var p = new v(t[2 * l],t[2 * l + 1]) + , p = P(h, k(p, s)); + c < p ? (o < p && (o = p, + a = l), + l++) : (d(t, l, u), + u--) + } + return a != e && d(t, e, a), + l - e + } + n.momentForCircle = function(t, e, i, s) { + return t * (.5 * (e * e + i * i) + B(s)) + } + , + n.areaForCircle = function(t, e) { + return Math.PI * Math.abs(t * t - e * e) + } + , + n.momentForSegment = function(t, e, i) { + var s = I(C(e, i), .5); + return t * (F(i, e) / 12 + B(s)) + } + , + n.areaForSegment = function(t, e, i) { + return i * (Math.PI * i + 2 * N(t, e)) + } + , + n.momentForPoly = function(t, e, i) { + for (var s = 0, n = 0, r = e.length, o = 0; o < r; o += 2) { + var a = e[o] + i.x + , h = e[o + 1] + i.y + , c = e[(o + 2) % r] + i.x + , l = e[(o + 3) % r] + i.y + , u = E(c, l, a, h); + s += u * (x(a, h, a, h) + x(a, h, c, l) + x(c, l, c, l)), + n += u + } + return t * s / (6 * n) + } + , + n.areaForPoly = function(t) { + for (var e = 0, i = 0, s = t.length; i < s; i += 2) + e += P(new v(t[i],t[i + 1]), new v(t[(i + 2) % s],t[(i + 3) % s])); + return -e / 2 + } + , + n.centroidForPoly = function(t) { + for (var e = 0, i = new v(0,0), s = 0, n = t.length; s < n; s += 2) { + var r = new v(t[s],t[s + 1]) + , o = new v(t[(s + 2) % n],t[(s + 3) % n]) + , a = P(r, o); + e += a, + i = C(i, I(C(r, o), a)) + } + return I(i, 1 / (3 * e)) + } + , + n.recenterPoly = function(t) { + for (var e = n.centroidForPoly(t), i = 0; i < t.length; i += 2) + t[i] -= e.x, + t[i + 1] -= e.y + } + , + n.momentForBox = function(t, e, i) { + return t * (e * e + i * i) / 12 + } + , + n.momentForBox2 = function(t, e) { + var i = e.r - e.l + , s = e.t - e.b + , e = I([e.l + e.r, e.b + e.t], .5); + return n.momentForBox(t, i, s) + t * B(e) + } + ; + var a = n.loopIndexes = function(t) { + for (var e, i, s = 0, n = 0, r = e = t[0], o = i = t[1], a = t.length >> 1, h = 1; h < a; h++) { + var c = t[2 * h] + , l = t[2 * h + 1]; + c < r || c == r && l < o ? (r = c, + o = l, + s = h) : (e < c || c == e && i < l) && (e = c, + i = l, + n = h) + } + return [s, n] + } + , u = function(t, e, i, s, n, r, o, a) { + if (s < 0) + return 0; + if (0 == s) + return e[2 * a] = r.x, + e[2 * a + 1] = r.y, + 1; + var h = l(e, i, s, n, r, t) + , c = new v(e[2 * i],e[2 * i + 1]) + , n = u(t, e, i + 1, h - 1, n, c, r, a) + , c = a + n++; + e[2 * c] = r.x, + e[2 * c + 1] = r.y; + c = l(e, i + h, s - h, r, o, t), + s = new v(e[2 * (i + h)],e[2 * (i + h) + 1]); + return n + u(t, e, i + h + 1, c - 1, r, s, o, a + n) + }; + function m(t, e, i) { + return T(A(t, e), i) + } + n.convexHull = function(t, e, i) { + if (e) + for (var s = 0; s < t.length; s++) + e[s] = t[s]; + else + e = t; + var n = a(t) + , r = n[0] + , o = n[1]; + if (r == o) + return e.length = 2, + e; + d(e, 0, r), + d(e, 1, 0 == o ? r : o); + n = new v(e[0],e[1]), + r = new v(e[2],e[3]), + o = t.length >> 1, + n = u(i, e, 2, o - 2, n, r, n, 1) + 1; + return e.length = 2 * n, + g(H(e), "Internal error: cpConvexHull() and cpPolyValidate() did not agree.Please report this error with as much info as you can."), + e + } + ; + var _ = function(t) { + return A(0, T(t, 1)) + } + , v = n.Vect = function(t, e) { + this.x = t, + this.y = e + } + ; + n.v = function(t, e) { + return new v(t,e) + } + ; + var b = n.vzero = new v(0,0) + , w = n.v.dot = function(t, e) { + return t.x * e.x + t.y * e.y + } + , x = function(t, e, i, s) { + return t * i + e * s + } + , S = n.v.len = function(t) { + return Math.sqrt(w(t, t)) + } + , r = n.v.len2 = function(t, e) { + return Math.sqrt(t * t + e * e) + } + , C = (n.v.eql = function(t, e) { + return t.x === e.x && t.y === e.y + } + , + n.v.add = function(t, e) { + return new v(t.x + e.x,t.y + e.y) + } + ); + v.prototype.add = function(t) { + return this.x += t.x, + this.y += t.y, + this + } + ; + var k = n.v.sub = function(t, e) { + return new v(t.x - e.x,t.y - e.y) + } + ; + v.prototype.sub = function(t) { + return this.x -= t.x, + this.y -= t.y, + this + } + ; + var O = n.v.neg = function(t) { + return new v(-t.x,-t.y) + } + ; + v.prototype.neg = function() { + return this.x = -this.x, + this.y = -this.y, + this + } + ; + var I = n.v.mult = function(t, e) { + return new v(t.x * e,t.y * e) + } + ; + v.prototype.mult = function(t) { + return this.x *= t, + this.y *= t, + this + } + ; + var P = n.v.cross = function(t, e) { + return t.x * e.y - t.y * e.x + } + , E = function(t, e, i, s) { + return t * s - e * i + } + , c = n.v.perp = function(t) { + return new v(-t.y,t.x) + } + , i = (n.v.pvrperp = function(t) { + return new v(t.y,-t.x) + } + , + n.v.project = function(t, e) { + return I(e, w(t, e) / B(e)) + } + ); + v.prototype.project = function(t) { + return this.mult(w(this, t) / B(t)), + this + } + ; + var h = n.v.rotate = function(t, e) { + return new v(t.x * e.x - t.y * e.y,t.x * e.y + t.y * e.x) + } + ; + v.prototype.rotate = function(t) { + return this.x = this.x * t.x - this.y * t.y, + this.y = this.x * t.y + this.y * t.x, + this + } + ; + var e = n.v.unrotate = function(t, e) { + return new v(t.x * e.x + t.y * e.y,t.y * e.x - t.x * e.y) + } + , B = n.v.lengthsq = function(t) { + return w(t, t) + } + , R = n.v.lengthsq2 = function(t, e) { + return t * t + e * e + } + , p = n.v.lerp = function(t, e, i) { + return C(I(t, 1 - i), I(e, i)) + } + , L = n.v.normalize = function(t) { + return I(t, 1 / S(t)) + } + , M = n.v.normalize_safe = function(t) { + return 0 === t.x && 0 === t.y ? b : L(t) + } + , j = n.v.clamp = function(t, e) { + return w(t, t) > e * e ? I(L(t), e) : t + } + , N = (n.v.lerpconst = function(t, e, i) { + return C(t, j(k(e, t), i)) + } + , + n.v.dist = function(t, e) { + return S(k(t, e)) + } + ) + , F = n.v.distsq = function(t, e) { + return B(k(t, e)) + } + , D = (n.v.near = function(t, e, i) { + return F(t, e) < i * i + } + , + n.v.slerp = function(t, e, i) { + var s = Math.acos(w(t, e)); + if (s) { + var n = 1 / Math.sin(s); + return C(I(t, Math.sin((1 - i) * s) * n), I(e, Math.sin(i * s) * n)) + } + return t + } + ) + , V = (n.v.slerpconst = function(t, e, i) { + var s = Math.acos(w(t, e)); + return D(t, e, T(i, s) / s) + } + , + n.v.forangle = function(t) { + return new v(Math.cos(t),Math.sin(t)) + } + , + n.v.toangle = function(t) { + return Math.atan2(t.y, t.x) + } + , + n.v.str = function(t) { + return "(" + t.x.toFixed(3) + ", " + t.y.toFixed(3) + ")" + } + , + n.BB = function(t, e, i, s) { + this.l = t, + this.b = e, + this.r = i, + this.t = s, + 0 + } + ); + function W(t, e) { + return new V(t.x - e,t.y - e,t.x + e,t.y + e) + } + n.bb = function(t, e, i, s) { + return new V(t,e,i,s) + } + ; + var s = 0; + n.NO_GROUP = 0, + n.ALL_LAYERS = -1, + n.resetShapeIdCounter = function() { + s = 0 + } + ; + var z = n.Shape = function(t) { + this.body = t, + this.bb_l = this.bb_b = this.bb_r = this.bb_t = 0, + this.hashid = s++, + this.sensor = !1, + this.e = 0, + this.u = 0, + this.surface_v = b, + this.collision_type = 0, + this.group = 0, + this.layers = -1, + this.space = null, + this.isAdded = !1, + this.collisionCode = this.collisionCode + } + ; + z.prototype.setElasticity = function(t) { + this.e = t + } + , + z.prototype.setFriction = function(t) { + this.body.activate(), + this.u = t + } + , + z.prototype.setLayers = function(t) { + this.body.activate(), + this.layers = t + } + , + z.prototype.setSensor = function(t) { + this.body.activate(), + this.sensor = t + } + , + z.prototype.setCollisionType = function(t) { + this.body.activate(), + this.collision_type = t + } + , + z.prototype.getBody = function() { + return this.body + } + , + z.prototype.active = function() { + return this.body && -1 !== this.body.shapeList.indexOf(this) + } + , + z.prototype.setBody = function(t) { + y(!this.active(), "You cannot change the body on an active shape. You must remove the shape from the space before changing the body."), + this.body = t + } + , + z.prototype.cacheBB = function() { + return this.update(this.body.p, this.body.rot) + } + , + z.prototype.update = function(t, e) { + y(!isNaN(e.x), "Rotation is NaN"), + y(!isNaN(t.x), "Position is NaN"), + this.cacheData(t, e) + } + , + z.prototype.pointQuery = function(t) { + t = this.nearestPointQuery(t); + if (t.d < 0) + return t + } + , + z.prototype.getBB = function() { + return new V(this.bb_l,this.bb_b,this.bb_r,this.bb_t) + } + ; + var G = n.NearestPointQueryInfo = function(t, e, i) { + this.shape = t, + this.p = e, + this.d = i + } + , U = n.SegmentQueryInfo = function(t, e, i) { + this.shape = t, + this.t = e, + this.n = i + } + ; + U.prototype.hitPoint = function(t, e) { + return p(t, e, this.t) + } + , + U.prototype.hitDist = function(t, e) { + return N(t, e) * this.t + } + ; + var t = n.CircleShape = function(t, e, i) { + this.c = this.tc = i, + this.r = e, + this.type = "circle", + z.call(this, t) + } + ; + function q(t, e, i, s, n, r) { + s = k(s, e), + n = k(n, e); + var o = w(s, s) - 2 * w(s, n) + w(n, n) + , e = -2 * w(s, s) + 2 * w(s, n); + if (0 <= (i = e * e - 4 * o * (w(s, s) - i * i))) { + o = (-e - Math.sqrt(i)) / (2 * o); + if (0 <= o && o <= 1) + return new U(t,o,L(p(s, n, o))) + } + } + t.prototype = Object.create(z.prototype), + t.prototype.cacheData = function(t, e) { + e = this.tc = h(this.c, e).add(t), + t = this.r; + this.bb_l = e.x - t, + this.bb_b = e.y - t, + this.bb_r = e.x + t, + this.bb_t = e.y + t + } + , + t.prototype.nearestPointQuery = function(t) { + var e = t.x - this.tc.x + , i = t.y - this.tc.y + , s = r(e, i) + , t = this.r + , i = new v(this.tc.x + e * t / s,this.tc.y + i * t / s); + return new G(this,i,s - t) + } + , + t.prototype.segmentQuery = function(t, e) { + return q(this, this.tc, this.r, t, e) + } + ; + var X = n.SegmentShape = function(t, e, i, s) { + this.a = e, + this.b = i, + this.n = c(L(k(i, e))), + this.ta = this.tb = this.tn = null, + this.r = s, + this.a_tangent = b, + this.b_tangent = b, + this.type = "segment", + z.call(this, t) + } + ; + X.prototype = Object.create(z.prototype), + X.prototype.cacheData = function(t, e) { + var i, s, n; + this.ta = C(t, h(this.a, e)), + this.tb = C(t, h(this.b, e)), + this.tn = h(this.n, e), + s = this.ta.x < this.tb.x ? (i = this.ta.x, + this.tb.x) : (i = this.tb.x, + this.ta.x), + t = this.ta.y < this.tb.y ? (n = this.ta.y, + this.tb.y) : (n = this.tb.y, + this.ta.y); + e = this.r; + this.bb_l = i - e, + this.bb_b = n - e, + this.bb_r = s + e, + this.bb_t = t + e + } + , + X.prototype.nearestPointQuery = function(t) { + var e = function(t, e, i) { + e = k(e, i), + t = _(w(e, k(t, i)) / B(e)); + return C(i, I(e, t)) + }(t, this.ta, this.tb) + , i = t.x - e.x + , s = t.y - e.y + , n = r(i, s) + , t = this.r + , e = n ? C(e, I(new v(i,s), t / n)) : e; + return new G(this,e,n - t) + } + , + X.prototype.segmentQuery = function(t, e) { + var i = this.tn + , s = w(k(this.ta, t), i) + , n = this.r + , r = 0 < s ? O(i) : i + , o = k(I(r, n), t) + , a = C(this.ta, o) + , h = C(this.tb, o) + , o = k(e, t); + if (P(o, a) * P(o, h) <= 0) { + h = s + (0 < s ? -n : n), + s = -h, + h = w(o, i) - h; + if (s * h < 0) + return new U(this,s / (s - h),r) + } else if (0 !== n) { + n = q(this, this.ta, this.r, t, e), + e = q(this, this.tb, this.r, t, e); + return !n || e && e.t < n.t ? e : n + } + } + , + X.prototype.setNeighbors = function(t, e) { + this.a_tangent = k(t, this.a), + this.b_tangent = k(e, this.b) + } + , + X.prototype.setEndpoints = function(t, e) { + this.a = t, + this.b = e, + this.n = c(L(k(e, t))) + } + ; + var H = cr.polyValidate = function(t) { + for (var e = t.length, i = 0; i < e; i += 2) { + var s = t[i] + , n = t[i + 1] + , r = t[(i + 2) % e] + , o = t[(i + 3) % e] + , a = t[(i + 4) % e] + , h = t[(i + 5) % e]; + if (0 < E(r - s, o - n, a - r, h - o)) + return !1 + } + return !0 + } + , Y = n.PolyShape = function(t, e, i) { + this.setVerts(e, i), + this.type = "poly", + z.call(this, t) + } + ; + function J(t, e) { + this.n = t, + this.d = e + } + Y.prototype = Object.create(z.prototype), + J.prototype.compare = function(t) { + return w(this.n, t) - this.d + } + , + Y.prototype.setVerts = function(t, e) { + y(4 <= t.length, "Polygons require some verts"), + y("number" == typeof t[0], "Polygon verticies should be specified in a flattened list (eg [x1,y1,x2,y2,x3,y3,...])"), + y(H(t), "Polygon is concave or has a reversed winding. Consider using cpConvexHull()"); + var i = t.length + , s = i >> 1; + this.verts = new Array(i), + this.tVerts = new Array(i), + this.planes = new Array(s), + this.tPlanes = new Array(s); + for (var n = 0; n < i; n += 2) { + var r = t[n] + e.x + , o = t[n + 1] + e.y + , a = t[(n + 2) % i] + e.x + , h = t[(n + 3) % i] + e.y + , h = L(c(new v(a - r,h - o))); + this.verts[n] = r, + this.verts[n + 1] = o, + this.planes[n >> 1] = new J(h,x(h.x, h.y, r, o)), + this.tPlanes[n >> 1] = new J(new v(0,0),0) + } + } + , + n.BoxShape = function(t, e, i) { + e /= 2, + i /= 2; + return K(t, new V(-e,-i,e,i)) + } + ; + var K = n.BoxShape2 = function(t, e) { + e = [e.l, e.b, e.l, e.t, e.r, e.t, e.r, e.b]; + return new Y(t,e,b) + } + ; + Y.prototype.transformVerts = function(t, e) { + for (var i = this.verts, s = this.tVerts, n = 1 / 0, r = -1 / 0, o = 1 / 0, a = -1 / 0, h = 0; h < i.length; h += 2) { + var c = i[h] + , l = i[h + 1] + , u = t.x + c * e.x - l * e.y + , l = t.y + c * e.y + l * e.x; + s[h] = u, + s[h + 1] = l, + n = T(n, u), + r = A(r, u), + o = T(o, l), + a = A(a, l) + } + this.bb_l = n, + this.bb_b = o, + this.bb_r = r, + this.bb_t = a + } + , + Y.prototype.transformAxes = function(t, e) { + for (var i = this.planes, s = this.tPlanes, n = 0; n < i.length; n++) { + var r = h(i[n].n, e); + s[n].n = r, + s[n].d = w(t, r) + i[n].d + } + } + , + Y.prototype.cacheData = function(t, e) { + this.transformAxes(t, e), + this.transformVerts(t, e) + } + , + Y.prototype.nearestPointQuery = function(t) { + for (var e = this.tPlanes, i = this.tVerts, s = i[i.length - 2], n = i[i.length - 1], r = 1 / 0, o = b, a = !1, h = 0; h < e.length; h++) { + 0 < e[h].compare(t) && (a = !0); + var c = i[2 * h] + , l = i[2 * h + 1] + , u = function(t, e, i, s, n, r) { + i -= n, + s -= r, + e = _(x(i, s, t - n, e - r) / R(i, s)); + return new v(n + i * e,r + s * e) + }(t.x, t.y, s, n, c, l) + , p = N(t, u); + p < r && (r = p, + o = u), + s = c, + n = l + } + return new G(this,o,a ? r : -r) + } + , + Y.prototype.segmentQuery = function(t, e) { + for (var i = this.tPlanes, s = this.tVerts, n = i.length, r = 2 * n, o = 0; o < n; o++) { + var a = i[o].n + , h = w(t, a); + if (!(i[o].d > h)) { + var c = w(e, a) + , l = (i[o].d - h) / (c - h); + if (!(l < 0 || 1 < l)) { + var u = p(t, e, l) + , c = -P(a, u) + , h = -E(a.x, a.y, s[2 * o], s[2 * o + 1]) + , u = -E(a.x, a.y, s[(2 * o + 2) % r], s[(2 * o + 3) % r]); + if (h <= c && c <= u) + return new U(this,l,a) + } + } + } + } + , + Y.prototype.valueOnAxis = function(t, e) { + for (var i = this.tVerts, s = x(t.x, t.y, i[0], i[1]), n = 2; n < i.length; n += 2) + s = T(s, x(t.x, t.y, i[n], i[n + 1])); + return s - e + } + , + Y.prototype.containsVert = function(t, e) { + for (var i = this.tPlanes, s = 0; s < i.length; s++) { + var n = i[s].n; + if (0 < x(n.x, n.y, t, e) - i[s].d) + return !1 + } + return !0 + } + , + Y.prototype.containsVertPartial = function(t, e, i) { + for (var s = this.tPlanes, n = 0; n < s.length; n++) { + var r = s[n].n; + if (!(w(r, i) < 0)) + if (0 < x(r.x, r.y, t, e) - s[n].d) + return !1 + } + return !0 + } + , + Y.prototype.getNumVerts = function() { + return this.verts.length / 2 + } + , + Y.prototype.getVert = function(t) { + return new v(this.verts[2 * t],this.verts[2 * t + 1]) + } + ; + var Q, Z = n.Body = function(t, e) { + this.p = new v(0,0), + this.vx = this.vy = 0, + this.f = new v(0,0), + this.w = 0, + this.t = 0, + this.v_limit = 1 / 0, + this.w_limit = 1 / 0, + this.v_biasx = this.v_biasy = 0, + this.w_bias = 0, + this.space = null, + this.isAdded = !1, + this.shapeList = [], + this.arbiterList = null, + this.constraintList = null, + this.nodeRoot = null, + this.nodeNext = null, + this.nodeIdleTime = 0, + this.setMass(t), + this.setMoment(e), + this.rot = new v(0,0), + this.setAngle(0) + } + ; + "undefined" != typeof DEBUG && DEBUG ? (Q = function(t, e) { + var i, s; + s = e, + y((i = t).x == i.x && i.y == i.y, s), + t = t, + e = e, + y(Math.abs(t.x) !== 1 / 0 && Math.abs(t.y) !== 1 / 0, e) + } + , + Z.prototype.sanityCheck = function() { + y(this.m == this.m && this.m_inv == this.m_inv, "Body's mass is invalid."), + y(this.i == this.i && this.i_inv == this.i_inv, "Body's moment is invalid."), + Q(this.p, "Body's position is invalid."), + Q(this.f, "Body's force is invalid."), + y(this.vx == this.vx && Math.abs(this.vx) !== 1 / 0, "Body's velocity is invalid."), + y(this.vy == this.vy && Math.abs(this.vy) !== 1 / 0, "Body's velocity is invalid."), + y(this.a == this.a && Math.abs(this.a) !== 1 / 0, "Body's angle is invalid."), + y(this.w == this.w && Math.abs(this.w) !== 1 / 0, "Body's angular velocity is invalid."), + y(this.t == this.t && Math.abs(this.t) !== 1 / 0, "Body's torque is invalid."), + Q(this.rot, "Body's rotation vector is invalid."), + y(this.v_limit == this.v_limit, "Body's velocity limit is invalid."), + y(this.w_limit == this.w_limit, "Body's angular velocity limit is invalid.") + } + ) : Z.prototype.sanityCheck = function() {} + , + Z.prototype.getPos = function() { + return this.p + } + , + Z.prototype.getAngle = function() { + return n.v.toangle(this.rot) + } + , + Z.prototype.getVel = function() { + return new v(this.vx,this.vy) + } + , + Z.prototype.getAngVel = function() { + return this.w + } + , + Z.prototype.isSleeping = function() { + return null !== this.nodeRoot + } + , + Z.prototype.isStatic = function() { + return this.nodeIdleTime === 1 / 0 + } + , + Z.prototype.isRogue = function() { + return null === this.space + } + , + Z.prototype.setMass = function(t) { + y(0 < t, "Mass must be positive and non-zero."), + this.activate(), + this.m = t, + this.m_inv = 1 / t + } + , + Z.prototype.setMoment = function(t) { + y(0 < t, "Moment of Inertia must be positive and non-zero."), + this.activate(), + this.i = t, + this.i_inv = 1 / t + } + , + Z.prototype.addShape = function(t) { + this.shapeList.push(t) + } + , + Z.prototype.removeShape = function(t) { + o(this.shapeList, t) + } + ; + var $ = function(t, e, i) { + return t === i ? t.next(e) : (t.a === e ? t.next_a = $(t.next_a, e, i) : t.next_b = $(t.next_b, e, i), + t) + }; + Z.prototype.removeConstraint = function(t) { + this.constraintList = $(this.constraintList, this, t) + } + , + Z.prototype.setPos = function(t) { + this.activate(), + this.sanityCheck(), + t === b && (t = n.v(0, 0)), + this.p = t + } + , + Z.prototype.setVel = function(t) { + this.activate(), + this.vx = t.x, + this.vy = t.y + } + , + Z.prototype.setAngVel = function(t) { + this.activate(), + this.w = t + } + , + Z.prototype.setAngleInternal = function(t) { + y(!isNaN(t), "Internal Error: Attempting to set body's angle to NaN"), + this.a = t, + this.rot.x = Math.cos(t), + this.rot.y = Math.sin(t) + } + , + Z.prototype.setAngle = function(t) { + this.activate(), + this.sanityCheck(), + this.setAngleInternal(t) + } + , + Z.prototype.velocity_func = function(t, e, i) { + var s = this.vx * e + (t.x + this.f.x * this.m_inv) * i + , n = this.vy * e + (t.y + this.f.y * this.m_inv) * i + , r = this.v_limit + , t = s * s + n * n + , t = r * r < t ? r / Math.sqrt(t) : 1; + this.vx = s * t, + this.vy = n * t; + t = this.w_limit; + this.w = m(this.w * e + this.t * this.i_inv * i, -t, t), + this.sanityCheck() + } + , + Z.prototype.position_func = function(t) { + this.p.x += (this.vx + this.v_biasx) * t, + this.p.y += (this.vy + this.v_biasy) * t, + this.setAngleInternal(this.a + (this.w + this.w_bias) * t), + this.v_biasx = this.v_biasy = 0, + this.w_bias = 0, + this.sanityCheck() + } + , + Z.prototype.resetForces = function() { + this.activate(), + this.f = new v(0,0), + this.t = 0 + } + , + Z.prototype.applyForce = function(t, e) { + this.activate(), + this.f = C(this.f, t), + this.t += P(e, t) + } + , + Z.prototype.applyImpulse = function(t, e) { + this.activate(), + qt(this, t.x, t.y, e) + } + , + Z.prototype.getVelAtPoint = function(t) { + return C(new v(this.vx,this.vy), I(c(t), this.w)) + } + , + Z.prototype.getVelAtWorldPoint = function(t) { + return this.getVelAtPoint(k(t, this.p)) + } + , + Z.prototype.getVelAtLocalPoint = function(t) { + return this.getVelAtPoint(h(t, this.rot)) + } + , + Z.prototype.eachShape = function(t) { + for (var e = 0, i = this.shapeList.length; e < i; e++) + t(this.shapeList[e]) + } + , + Z.prototype.eachConstraint = function(t) { + for (var e = this.constraintList; e; ) { + var i = e.next(this); + t(e), + e = i + } + } + , + Z.prototype.eachArbiter = function(t) { + for (var e = this.arbiterList; e; ) { + var i = e.next(this); + e.swappedColl = this === e.body_b, + t.call(this, e), + e = i + } + } + , + Z.prototype.local2World = function(t) { + return C(this.p, h(t, this.rot)) + } + , + Z.prototype.world2Local = function(t) { + return e(k(t, this.p), this.rot) + } + , + Z.prototype.kineticEnergy = function() { + var t = this.vx * this.vx + this.vy * this.vy + , e = this.w * this.w; + return (t ? t * this.m : 0) + (e ? e * this.i : 0) + } + ; + var tt = n.SpatialIndex = function(t) { + if (this.staticIndex = t) { + if (t.dynamicIndex) + throw new Error("This static index is already associated with a dynamic index."); + t.dynamicIndex = this + } + } + ; + tt.prototype.collideStatic = function(t, e) { + var i; + 0 < t.count && (i = t.query, + this.each(function(t) { + i(t, new V(t.bb_l,t.bb_b,t.bb_r,t.bb_t), e) + })) + } + ; + var et = n.BBTree = function(t) { + tt.call(this, t), + this.velocityFunc = null, + this.leaves = {}, + this.count = 0, + this.root = null, + this.pooledNodes = null, + this.pooledPairs = null, + this.stamp = 0 + } + ; + function it(t, e, i) { + this.obj = null, + this.bb_l = T(e.bb_l, i.bb_l), + this.bb_b = T(e.bb_b, i.bb_b), + this.bb_r = A(e.bb_r, i.bb_r), + this.bb_t = A(e.bb_t, i.bb_t), + this.parent = null, + this.setA(e), + this.setB(i) + } + function st(t, e) { + this.obj = e, + t.getBB(e, this), + this.parent = null, + this.stamp = 1, + this.pairs = null + } + function nt(t, e, i, s) { + this.prevA = null, + this.leafA = t, + this.nextA = e, + this.prevB = null, + this.leafB = i, + this.nextB = s + } + function rt(t, e, i) { + i && (i.leafA === e ? i.prevA = t : i.prevB = t), + t ? t.leafA === e ? t.nextA = i : t.nextB = i : e.pairs = i + } + function ot(t, e, i) { + var s = t.pairs + , n = e.pairs + , i = i.makePair(t, s, e, n); + t.pairs = e.pairs = i, + s && (s.leafA === t ? s.prevA = i : s.prevB = i), + n && (n.leafA === e ? n.prevA = i : n.prevB = i) + } + function at(t, e) { + return (A(t.bb_r, e.bb_r) - T(t.bb_l, e.bb_l)) * (A(t.bb_t, e.bb_t) - T(t.bb_b, e.bb_b)) + } + function ht(t, e) { + return Math.abs(t.bb_l + t.bb_r - e.bb_l - e.bb_r) + Math.abs(t.bb_b + t.bb_t - e.bb_b - e.bb_t) + } + et.prototype = Object.create(tt.prototype), + et.prototype.makeNode = function(t, e) { + var i = this.pooledNodes; + return i ? (this.pooledNodes = i.parent, + i.constructor(this, t, e), + i) : new it(0,t,e) + } + , + et.prototype.getBB = function(t, e) { + var i, s, n = this.velocityFunc; + n ? (i = .1 * (t.bb_r - t.bb_l), + s = .1 * (t.bb_t - t.bb_b), + n = I(n(t), .1), + e.bb_l = t.bb_l + T(-i, n.x), + e.bb_b = t.bb_b + T(-s, n.y), + e.bb_r = t.bb_r + A(i, n.x), + e.bb_t = t.bb_t + A(s, n.y)) : (e.bb_l = t.bb_l, + e.bb_b = t.bb_b, + e.bb_r = t.bb_r, + e.bb_t = t.bb_t) + } + , + et.prototype.getStamp = function() { + var t = this.dynamicIndex; + return (t && t.stamp ? t : this).stamp + } + , + et.prototype.incrementStamp = function() { + this.dynamicIndex && this.dynamicIndex.stamp ? this.dynamicIndex.stamp++ : this.stamp++ + } + , + et.prototype.makePair = function(t, e, i, s) { + var n = this.pooledPairs; + return n ? (this.pooledPairs = n.prevA, + n.prevA = null, + n.leafA = t, + n.nextA = e, + n.prevB = null, + n.leafB = i, + n.nextB = s, + n) : new nt(t,e,i,s) + } + , + nt.prototype.recycle = function(t) { + this.prevA = t.pooledPairs, + t.pooledPairs = this + } + , + st.prototype.clearPairs = function(t) { + var e, i = this.pairs; + for (this.pairs = null; i; ) + i.leafA === this ? (e = i.nextA, + rt(i.prevB, i.leafB, i.nextB)) : (e = i.nextB, + rt(i.prevA, i.leafA, i.nextA)), + i.recycle(t), + i = e + } + , + it.prototype.recycle = function(t) { + this.parent = t.pooledNodes, + t.pooledNodes = this + } + , + st.prototype.recycle = function(t) {} + , + it.prototype.setA = function(t) { + (this.A = t).parent = this + } + , + it.prototype.setB = function(t) { + (this.B = t).parent = this + } + , + it.prototype.isLeaf = !(st.prototype.isLeaf = !0), + it.prototype.otherChild = function(t) { + return this.A == t ? this.B : this.A + } + , + it.prototype.replaceChild = function(t, e, i) { + g(t == this.A || t == this.B, "Node is not a child of parent."), + this.A == t ? (this.A.recycle(i), + this.setA(e)) : (this.B.recycle(i), + this.setB(e)); + for (var s = this; s; s = s.parent) { + var n = s.A + , r = s.B; + s.bb_l = T(n.bb_l, r.bb_l), + s.bb_b = T(n.bb_b, r.bb_b), + s.bb_r = A(n.bb_r, r.bb_r), + s.bb_t = A(n.bb_t, r.bb_t) + } + } + , + it.prototype.bbArea = st.prototype.bbArea = function() { + return (this.bb_r - this.bb_l) * (this.bb_t - this.bb_b) + } + ; + var ct = function(t, e, i) { + if (null == t) + return e; + if (t.isLeaf) + return i.makeNode(e, t); + var s = t.B.bbArea() + at(t.A, e) + , n = t.A.bbArea() + at(t.B, e); + return s === n && (s = ht(t.A, e), + n = ht(t.B, e)), + n < s ? t.setB(ct(t.B, e, i)) : t.setA(ct(t.A, e, i)), + t.bb_l = T(t.bb_l, e.bb_l), + t.bb_b = T(t.bb_b, e.bb_b), + t.bb_r = A(t.bb_r, e.bb_r), + t.bb_t = A(t.bb_t, e.bb_t), + t + }; + function lt(t, e, i) { + var s = 1 / (i.x - e.x) + , n = (t.bb_l - e.x) * s + , r = (t.bb_r - e.x) * s + , s = T(n, r) + , n = A(n, r) + , r = 1 / (i.y - e.y) + , i = (t.bb_b - e.y) * r + , e = (t.bb_t - e.y) * r + , r = T(i, e) + , e = A(i, e); + if (r <= n && s <= e) { + r = A(s, r); + if (0 <= T(n, e) && r <= 1) + return A(r, 0) + } + return 1 / 0 + } + it.prototype.intersectsBB = st.prototype.intersectsBB = function(t) { + return this.bb_l <= t.r && t.l <= this.bb_r && this.bb_b <= t.t && t.b <= this.bb_t + } + ; + var ut = function(t, e, i) { + t.intersectsBB(e) && (t.isLeaf ? i(t.obj) : (ut(t.A, e, i), + ut(t.B, e, i))) + } + , pt = function(t, e, i, s, n) { + if (t.isLeaf) + return n(t.obj); + var r = lt(t.A, e, i) + , o = lt(t.B, e, i); + return r < o ? (r < s && (s = T(s, pt(t.A, e, i, s, n))), + o < s && (s = T(s, pt(t.B, e, i, s, n)))) : (o < s && (s = T(s, pt(t.B, e, i, s, n))), + r < s && (s = T(s, pt(t.A, e, i, s, n)))), + s + }; + function dt(t, e, i) { + if (e == t) + return null; + var s = e.parent; + return s != t ? (s.parent.replaceChild(s, s.otherChild(e), i), + t) : ((e = t.otherChild(e)).parent = t.parent, + t.recycle(i), + e) + } + function ft(t, e) { + return t.bb_l <= e.bb_r && e.bb_l <= t.bb_r && t.bb_b <= e.bb_t && e.bb_b <= t.bb_t + } + function yt(t, e) {} + function gt(t, e, i, s, n) { + return (A(t.bb_r, s) - T(t.bb_l, e)) * (A(t.bb_t, n) - T(t.bb_b, i)) + } + et.prototype.subtreeRecycle = function(t) { + t.isLeaf && (this.subtreeRecycle(t.A), + this.subtreeRecycle(t.B), + t.recycle(this)) + } + , + st.prototype.markLeafQuery = function(t, e, i, s) { + ft(t, this) && (e ? ot(t, this, i) : (this.stamp < t.stamp && ot(this, t, i), + s && s(t.obj, this.obj))) + } + , + it.prototype.markLeafQuery = function(t, e, i, s) { + ft(t, this) && (this.A.markLeafQuery(t, e, i, s), + this.B.markLeafQuery(t, e, i, s)) + } + , + st.prototype.markSubtree = function(t, e, i) { + if (this.stamp == t.getStamp()) { + e && e.markLeafQuery(this, !1, t, i); + for (var s = this; s.parent; s = s.parent) + s == s.parent.A ? s.parent.B.markLeafQuery(this, !0, t, i) : s.parent.A.markLeafQuery(this, !1, t, i) + } else + for (var n = this.pairs; n; ) + n = this === n.leafB ? (i && i(n.leafA.obj, this.obj), + n.nextB) : n.nextA + } + , + it.prototype.markSubtree = function(t, e, i) { + this.A.markSubtree(t, e, i), + this.B.markSubtree(t, e, i) + } + , + st.prototype.containsObj = function(t) { + return this.bb_l <= t.bb_l && this.bb_r >= t.bb_r && this.bb_b <= t.bb_b && this.bb_t >= t.bb_t + } + , + st.prototype.update = function(t) { + var e = t.root + , i = this.obj; + return !this.containsObj(i) && (t.getBB(this.obj, this), + e = dt(e, this, t), + t.root = ct(e, this, t), + this.clearPairs(t), + this.stamp = t.getStamp(), + !0) + } + , + st.prototype.addPairs = function(t) { + var e, i = t.dynamicIndex; + i ? (e = i.root) && e.markLeafQuery(this, !0, i, null) : (i = t.staticIndex.root, + this.markSubtree(t, i, null)) + } + , + et.prototype.insert = function(t, e) { + t = new st(this,t); + this.leaves[e] = t, + this.root = ct(this.root, t, this), + this.count++, + t.stamp = this.getStamp(), + t.addPairs(this), + this.incrementStamp() + } + , + et.prototype.remove = function(t, e) { + var i = this.leaves[e]; + delete this.leaves[e], + this.root = dt(this.root, i, this), + this.count--, + i.clearPairs(this), + i.recycle(this) + } + , + et.prototype.contains = function(t, e) { + return null != this.leaves[e] + } + , + et.prototype.reindexQuery = function(t) { + if (this.root) { + var e, i = this.leaves; + for (e in i) + i[e].update(this); + var s = this.staticIndex + , n = s && s.root; + this.root.markSubtree(this, n, t), + s && !n && this.collideStatic(this, s, t), + this.incrementStamp() + } + } + , + et.prototype.reindex = function() { + this.reindexQuery(yt) + } + , + et.prototype.reindexObject = function(t, e) { + e = this.leaves[e]; + e && (e.update(this) && e.addPairs(this), + this.incrementStamp()) + } + , + et.prototype.pointQuery = function(t, e) { + this.query(new V(t.x,t.y,t.x,t.y), e) + } + , + et.prototype.segmentQuery = function(t, e, i, s) { + this.root && pt(this.root, t, e, i, s) + } + , + et.prototype.query = function(t, e) { + this && this.root && this instanceof n.BBTree && ut(this.root, t, e) + } + , + et.prototype.count = function() { + return this.count + } + , + et.prototype.each = function(t) { + for (var e in this.leaves) + t(this.leaves[e].obj) + } + ; + var mt = function(t, e, i, s) { + if (1 == s) + return e[i]; + if (2 == s) + return t.makeNode(e[i], e[i + 1]); + for (var n = (S = e[i]).bb_l, r = S.bb_b, o = S.bb_r, a = S.bb_t, h = i + s, c = i + 1; c < h; c++) + S = e[c], + n = T(n, S.bb_l), + r = T(r, S.bb_b), + o = A(o, S.bb_r), + a = A(a, S.bb_t); + var l = a - r < o - n + , u = new Array(2 * s); + if (l) + for (c = i; c < h; c++) + u[2 * c + 0] = e[c].bb_l, + u[2 * c + 1] = e[c].bb_r; + else + for (c = i; c < h; c++) + u[2 * c + 0] = e[c].bb_b, + u[2 * c + 1] = e[c].bb_t; + u.sort(function(t, e) { + return t - e + }); + var p = .5 * (u[s - 1] + u[s]) + , d = n + , f = r + , y = o + , g = a + , m = n + , _ = r + , v = o + , b = a; + l ? y = m = p : g = _ = p; + for (var w = h, x = i; x < w; ) { + var S = e[x]; + gt(S, m, _, v, b) < gt(S, d, f, y, g) ? (w--, + e[x] = e[w], + e[w] = S) : x++ + } + if (w != s) + return NodeNew(t, mt(t, e, i, w - i), mt(t, e, w, h - w)); + for (S = null, + c = i; c < h; c++) + S = ct(S, e[c], t); + return S + }; + et.prototype.optimize = function() { + var t, e = new Array(this.count), i = 0; + for (t in this.leaves) + e[i++] = this.nodes[t]; + tree.subtreeRecycle(root), + this.root = mt(tree, e, e.length) + } + ; + var _t = function(t, e) { + !t.isLeaf && e <= 10 && (_t(t.A, e + 1), + _t(t.B, e + 1)); + for (var i = "", s = 0; s < e; s++) + i += " "; + console.log(i + t.bb_b + " " + t.bb_t) + }; + et.prototype.log = function() { + this.root && _t(this.root, 0) + } + ; + var vt = n.CollisionHandler = function() { + this.a = this.b = 0 + } + ; + function bt(t, e) { + this.e = 0, + this.u = 0, + this.surface_vr = b, + this.a = t, + this.body_a = t.body, + this.b = e, + this.body_b = e.body, + this.thread_a_next = this.thread_a_prev = null, + this.thread_b_next = this.thread_b_prev = null, + this.contacts = null, + this.stamp = 0, + this.handler = null, + this.swappedColl = !1, + this.state = "first coll" + } + function wt(t, e, i) { + this.point = t, + this.normal = e, + this.dist = i + } + function xt(t, e, i, s) { + i ? i.body_a === e ? i.thread_a_next = s : i.thread_b_next = s : e.arbiterList = s, + s && (s.body_a === e ? s.thread_a_prev = i : s.thread_b_prev = i) + } + function St(t, e, i, s) { + this.p = t, + this.n = e, + this.dist = i, + this.r1 = this.r2 = b, + this.nMass = this.tMass = this.bounce = this.bias = 0, + this.jnAcc = this.jtAcc = this.jBias = 0, + this.hash = s, + 0 + } + function Tt(t, e, i, s) { + var n = i + s + , s = k(e, t) + , e = B(s); + if (!(n * n <= e)) { + e = Math.sqrt(e); + return new St(C(t, I(s, .5 + (i - .5 * n) / (e || 1 / 0))),e ? I(s, 1 / e) : new v(1,0),e - n,0) + } + } + function At(t, e) { + var i = 0 + , s = t.valueOnAxis(e[0].n, e[0].d); + if (0 < s) + return -1; + for (var n = 1; n < e.length; n++) { + var r = t.valueOnAxis(e[n].n, e[n].d); + if (0 < r) + return -1; + s < r && (s = r, + i = n) + } + return Pt = s, + i + } + function Ct(t, e, i, s) { + for (var n = [], r = t.tVerts, o = 0; o < r.length; o += 2) { + var a = r[o] + , h = r[o + 1]; + e.containsVert(a, h) && n.push(new St(new v(a,h),i,s,f(t.hashid, o >> 1))) + } + for (var c = e.tVerts, o = 0; o < c.length; o += 2) { + a = c[o], + h = c[o + 1]; + t.containsVert(a, h) && n.push(new St(new v(a,h),i,s,f(e.hashid, o >> 1))) + } + return n.length ? n : function(t, e, i, s) { + for (var n = [], r = t.tVerts, o = 0; o < r.length; o += 2) { + var a = r[o] + , h = r[o + 1]; + e.containsVertPartial(a, h, O(i)) && n.push(new St(new v(a,h),i,s,f(t.hashid, o))) + } + for (var c = e.tVerts, o = 0; o < c.length; o += 2) { + a = c[o], + h = c[o + 1]; + t.containsVertPartial(a, h, i) && n.push(new St(new v(a,h),i,s,f(e.hashid, o))) + } + return n + }(t, e, i, s) + } + function kt(t, e, i) { + var s = w(e, t.ta) - t.r + , t = w(e, t.tb) - t.r; + return T(s, t) - i + } + function Ot(t, e, i, s, n) { + for (var r = P(e.tn, e.ta), o = P(e.tn, e.tb), a = I(e.tn, n), h = i.tVerts, c = 0; c < h.length; c += 2) { + var l, u = h[c], p = h[c + 1]; + x(u, p, a.x, a.y) < w(e.tn, e.ta) * n + e.r && ((l = E(e.tn.x, e.tn.y, u, p)) <= r && o <= l && t.push(new St(new v(u,p),a,s,f(i.hashid, c)))) + } + } + vt.prototype.begin = function(t, e) { + return !0 + } + , + vt.prototype.preSolve = function(t, e) { + return !0 + } + , + vt.prototype.postSolve = function(t, e) {} + , + vt.prototype.separate = function(t, e) {} + , + bt.prototype.getShapes = function() { + return this.swappedColl ? [this.b, this.a] : [this.a, this.b] + } + , + bt.prototype.totalImpulse = function() { + for (var t = this.contacts, e = new v(0,0), i = 0, s = t.length; i < s; i++) { + var n = t[i]; + e.add(I(n.n, n.jnAcc)) + } + return this.swappedColl ? e : e.neg() + } + , + bt.prototype.totalImpulseWithFriction = function() { + for (var t = this.contacts, e = new v(0,0), i = 0, s = t.length; i < s; i++) { + var n = t[i]; + e.add(new v(n.jnAcc,n.jtAcc).rotate(n.n)) + } + return this.swappedColl ? e : e.neg() + } + , + bt.prototype.totalKE = function() { + for (var t = (1 - this.e) / (1 + this.e), e = 0, i = this.contacts, s = 0, n = i.length; s < n; s++) { + var r = i[s] + , o = r.jnAcc + , a = r.jtAcc; + e += t * o * o / r.nMass + a * a / r.tMass + } + return e + } + , + bt.prototype.ignore = function() { + this.state = "ignore" + } + , + bt.prototype.getA = function() { + return this.swappedColl ? this.b : this.a + } + , + bt.prototype.getB = function() { + return this.swappedColl ? this.a : this.b + } + , + bt.prototype.isFirstContact = function() { + return "first coll" === this.state + } + , + bt.prototype.getContactPointSet = function() { + for (var t = new Array(this.contacts.length), e = 0; e < t.length; e++) + t[e] = new wt(this.contacts[e].p,this.contacts[e].n,this.contacts[e].dist); + return t + } + , + bt.prototype.getNormal = function(t) { + t = this.contacts[t].n; + return this.swappedColl ? O(t) : t + } + , + bt.prototype.getPoint = function(t) { + return this.contacts[t].p + } + , + bt.prototype.getDepth = function(t) { + return this.contacts[t].dist + } + , + bt.prototype.unthread = function() { + xt(0, this.body_a, this.thread_a_prev, this.thread_a_next), + xt(0, this.body_b, this.thread_b_prev, this.thread_b_next), + this.thread_a_prev = this.thread_a_next = null, + this.thread_b_prev = this.thread_b_next = null + } + , + bt.prototype.update = function(t, e, i, s) { + if (this.contacts) + for (var n = 0; n < this.contacts.length; n++) + for (var r = this.contacts[n], o = 0; o < t.length; o++) { + var a = t[o]; + a.hash === r.hash && (a.jnAcc = r.jnAcc, + a.jtAcc = r.jtAcc) + } + this.contacts = t, + this.handler = e, + this.swappedColl = i.collision_type !== e.a, + this.e = i.e * s.e, + this.u = i.u * s.u, + this.surface_vr = k(i.surface_v, s.surface_v), + this.a = i, + this.body_a = i.body, + this.b = s, + this.body_b = s.body, + "cached" == this.state && (this.state = "first coll") + } + , + bt.prototype.preStep = function(t, e, i) { + for (var s = this.body_a, n = this.body_b, r = 0; r < this.contacts.length; r++) { + var o = this.contacts[r]; + o.r1 = k(o.p, s.p), + o.r2 = k(o.p, n.p), + o.nMass = 1 / Yt(s, n, o.r1, o.r2, o.n), + o.tMass = 1 / Yt(s, n, o.r1, o.r2, c(o.n)), + o.bias = -i * T(0, o.dist + e) / t, + o.jBias = 0, + o.bounce = Ut(s, n, o.r1, o.r2, o.n) * this.e + } + } + , + bt.prototype.applyCachedImpulse = function(t) { + if (!this.isFirstContact()) + for (var e = this.body_a, i = this.body_b, s = 0; s < this.contacts.length; s++) { + var n = this.contacts[s] + , r = n.n.x + , o = n.n.y + , a = r * n.jnAcc - o * n.jtAcc + , o = r * n.jtAcc + o * n.jnAcc; + Xt(e, i, n.r1, n.r2, a * t, o * t) + } + } + , + bt.prototype.applyImpulse = function() { + 0; + for (var t = this.body_a, e = this.body_b, i = this.surface_vr, s = this.u, n = 0; n < this.contacts.length; n++) { + 0; + var r = this.contacts[n] + , o = r.nMass + , a = r.n + , h = r.r1 + , c = r.r2 + , l = e.vx - c.y * e.w - (t.vx - h.y * t.w) + , u = e.vy + c.x * e.w - (t.vy + h.x * t.w) + , p = a.x * (e.v_biasx - c.y * e.w_bias - t.v_biasx + h.y * t.w_bias) + a.y * (c.x * e.w_bias + e.v_biasy - h.x * t.w_bias - t.v_biasy) + , d = x(l, u, a.x, a.y) + , l = x(l + i.x, u + i.y, -a.y, a.x) + , u = (r.bias - p) * o + , p = r.jBias; + r.jBias = A(p + u, 0); + u = -(r.bounce + d) * o, + d = r.jnAcc; + r.jnAcc = A(d + u, 0); + o = s * r.jnAcc, + u = -l * r.tMass, + l = r.jtAcc; + r.jtAcc = m(l + u, -o, o); + o = a.x * (r.jBias - p), + p = a.y * (r.jBias - p); + Ht(t, -o, -p, h), + Ht(e, o, p, c); + d = r.jnAcc - d, + l = r.jtAcc - l; + Xt(t, e, h, c, a.x * d - a.y * l, a.x * l + a.y * d) + } + } + , + bt.prototype.callSeparate = function(t) { + t.lookupHandler(this.a.collision_type, this.b.collision_type).separate(this, t) + } + , + bt.prototype.next = function(t) { + return this.body_a == t ? this.thread_a_next : this.thread_b_next + } + ; + var It = [] + , Pt = 0; + t.prototype.collisionCode = 0, + X.prototype.collisionCode = 1, + Y.prototype.collisionCode = 2, + t.prototype.collisionTable = [function(t, e) { + e = Tt(t.tc, e.tc, t.r, e.r); + return e ? [e] : It + } + , function(t, e) { + var i = e.ta + , s = e.tb + , n = t.tc + , r = k(s, i) + , s = _(w(r, k(n, i)) / B(r)) + , r = C(i, I(r, s)) + , r = Tt(n, r, t.r, e.r); + if (r) { + t = r.n; + return 0 === s && w(t, e.a_tangent) < 0 || 1 === s && w(t, e.b_tangent) < 0 ? It : [r] + } + return It + } + , function(t, e) { + for (var i = e.tPlanes, s = 0, n = w(i[0].n, t.tc) - i[0].d - t.r, r = 0; r < i.length; r++) { + var o = w(i[r].n, t.tc) - i[r].d - t.r; + if (0 < o) + return It; + n < o && (n = o, + s = r) + } + var a, h = i[s].n, c = e.tVerts, l = c.length, u = s << 1, p = c[u], d = c[1 + u], f = c[(2 + u) % l], e = c[(3 + u) % l], c = E(h.x, h.y, p, d), u = E(h.x, h.y, f, e), l = P(h, t.tc); + return l < u ? (a = Tt(t.tc, new v(f,e), t.r, 0)) ? [a] : It : l < c ? [new St(k(t.tc, I(h, t.r + n / 2)),O(h),n,0)] : (a = Tt(t.tc, new v(p,d), t.r, 0)) ? [a] : It + } + ], + X.prototype.collisionTable = [null, function(t, e) { + return It + } + , function(t, e) { + var i = [] + , s = e.tPlanes + , n = s.length + , r = w(t.tn, t.ta) + , o = e.valueOnAxis(t.tn, r) - t.r + , a = e.valueOnAxis(O(t.tn), -r) - t.r; + if (0 < a || 0 < o) + return It; + var h = 0 + , c = kt(t, s[0].n, s[0].d); + if (0 < c) + return It; + for (var l = 0; l < n; l++) { + var u = kt(t, s[l].n, s[l].d); + if (0 < u) + return It; + c < u && (c = u, + h = l) + } + var p = O(s[h].n) + , d = C(t.ta, I(p, t.r)) + , r = C(t.tb, I(p, t.r)); + if (e.containsVert(d.x, d.y) && i.push(new St(d,p,c,f(t.hashid, 0))), + e.containsVert(r.x, r.y) && i.push(new St(r,p,c,f(t.hashid, 1))), + (c <= o || c <= a) && (a < o ? Ot(i, t, e, o, 1) : Ot(i, t, e, a, -1)), + 0 === i.length) { + p = 2 * h, + o = e.tVerts, + a = new v(o[p],o[1 + p]); + if (e = Tt(t.ta, a, t.r, 0)) + return [e]; + if (e = Tt(t.tb, a, t.r, 0)) + return [e]; + a = 2 * n, + a = new v(o[(2 + p) % a],o[(3 + p) % a]); + if (e = Tt(t.ta, a, t.r, 0)) + return [e]; + if (e = Tt(t.tb, a, t.r, 0)) + return [e] + } + return i + } + ], + Y.prototype.collisionTable = [null, null, function(t, e) { + var i = At(e, t.tPlanes); + if (-1 == i) + return It; + var s = Pt + , n = At(t, e.tPlanes); + if (-1 == n) + return It; + var r = Pt; + return r < s ? Ct(t, e, t.tPlanes[i].n, s) : Ct(t, e, O(e.tPlanes[n].n), r) + } + ]; + var Et = n.collideShapes = function(t, e) { + return y(t.collisionCode <= e.collisionCode, "Collided shapes must be sorted by type"), + t.collisionTable[e.collisionCode](t, e) + } + , Bt = new vt; + function Rt(t) { + y(!t.locked, "This addition/removal cannot be done safely during a call to cpSpaceStep() or during a query. Put these calls into a post-step callback.") + } + function Lt(t) { + return t ? t.nodeRoot : null + } + (X = n.Space = function() { + this.stamp = 0, + this.curr_dt = 0, + this.bodies = [], + this.rousedBodies = [], + this.sleepingComponents = [], + this.staticShapes = new et(null), + this.activeShapes = new et(this.staticShapes), + this.arbiters = [], + this.contactBuffersHead = null, + this.cachedArbiters = {}, + this.constraints = [], + this.locked = 0, + this.collisionHandlers = {}, + this.defaultHandler = Bt, + this.postStepCallbacks = [], + this.delayedAddRemove = [], + this.iterations = 10, + this.gravity = b, + this.damping = 1, + this.idleSpeedThreshold = 0, + this.sleepTimeThreshold = 1 / 0, + this.collisionSlop = .1, + this.collisionBias = Math.pow(.9, 60), + this.collisionPersistence = 3, + this.enableContactGraph = !1, + this.staticBody = new Z(1 / 0,1 / 0), + this.staticBody.nodeIdleTime = 1 / 0, + this.collideShapes = this.makeCollideShapes() + } + ).prototype.getCurrentTimeStep = function() { + return this.curr_dt + } + , + X.prototype.setIterations = function(t) { + this.iterations = t + } + , + X.prototype.isLocked = function() { + return this.locked + } + , + X.prototype.addCollisionHandler = function(t, e, i, s, n, r) { + Rt(this), + this.removeCollisionHandler(t, e); + var o = new vt; + o.a = t, + o.b = e, + i && (o.begin = i), + s && (o.preSolve = s), + n && (o.postSolve = n), + r && (o.separate = r), + this.collisionHandlers[f(t, e)] = o + } + , + X.prototype.removeCollisionHandler = function(t, e) { + Rt(this), + delete this.collisionHandlers[f(t, e)] + } + , + X.prototype.setDefaultCollisionHandler = function(t, e, i, s) { + Rt(this); + var n = new vt; + t && (n.begin = t), + e && (n.preSolve = e), + i && (n.postSolve = i), + s && (n.separate = s), + this.defaultHandler = n + } + , + X.prototype.lookupHandler = function(t, e) { + return this.collisionHandlers[f(t, e)] || this.defaultHandler + } + , + X.prototype.addShape = function(t) { + var e = t.body; + return e.isStatic() ? this.addStaticShape(t) : (this.locked ? t.isAdded || (t.isAdded = !0, + this.delayedAddRemove.push(this.addShape), + this.delayedAddRemove.push(t)) : (t.isAdded = !0, + y(!t.space, "This shape is already added to a space and cannot be added to another."), + Rt(this), + e.activate(), + e.addShape(t), + t.update(e.p, e.rot), + this.activeShapes.insert(t, t.hashid), + t.space = this), + t) + } + , + X.prototype.addStaticShape = function(t) { + if (this.locked) + return t.isAdded || (t.isAdded = !0, + this.delayedAddRemove.push(this.addStaticShape), + this.delayedAddRemove.push(t)), + t; + t.isAdded = !0, + y(!t.space, "This shape is already added to a space and cannot be added to another."), + Rt(this); + var e = t.body; + return e.addShape(t), + t.update(e.p, e.rot), + this.staticShapes.insert(t, t.hashid), + t.space = this, + t + } + , + X.prototype.addBody = function(t) { + return y(!t.isStatic(), "Static bodies cannot be added to a space as they are not meant to be simulated."), + this.locked ? t.isAdded || (t.isAdded = !0, + this.delayedAddRemove.push(this.addBody), + this.delayedAddRemove.push(t)) : (t.isAdded = !0, + y(!t.space, "This body is already added to a space and cannot be added to another."), + Rt(this), + this.bodies.push(t), + t.space = this), + t + } + , + X.prototype.addConstraint = function(t) { + if (this.locked) + return t.isAdded || (t.isAdded = !0, + this.delayedAddRemove.push(this.addConstraint), + this.delayedAddRemove.push(t)), + t; + t.isAdded = !0, + y(!t.space, "This shape is already added to a space and cannot be added to another."), + Rt(this); + var e = t.a + , i = t.b; + return e.activate(), + i.activate(), + this.constraints.push(t), + t.next_a = e.constraintList, + (e.constraintList = t).next_b = i.constraintList, + (i.constraintList = t).space = this, + t + } + , + X.prototype.filterArbiters = function(t, e) { + for (var i in this.cachedArbiters) { + var s = this.cachedArbiters[i]; + (t !== s.body_a || e !== s.a && null !== e) && (t !== s.body_b || e !== s.b && null !== e) || (e && "cached" !== s.state && s.callSeparate(this), + s.unthread(), + o(this.arbiters, s), + delete this.cachedArbiters[i]) + } + } + , + X.prototype.removeShape = function(t) { + var e = t.body; + e.isStatic() ? this.removeStaticShape(t) : this.locked ? t.isAdded && (t.isAdded = !1, + this.delayedAddRemove.push(this.removeShape), + this.delayedAddRemove.push(t)) : (t.isAdded = !1, + y(this.containsShape(t), "Cannot remove a shape that was not added to the space. (Removed twice maybe?)"), + Rt(this), + e.activate(), + e.removeShape(t), + this.filterArbiters(e, t), + this.activeShapes.remove(t, t.hashid), + t.space = null) + } + , + X.prototype.removeStaticShape = function(t) { + var e; + this.locked ? t.isAdded && (t.isAdded = !1, + this.delayedAddRemove.push(this.removeStaticShape), + this.delayedAddRemove.push(t)) : (t.isAdded = !1, + y(this.containsShape(t), "Cannot remove a static or sleeping shape that was not added to the space. (Removed twice maybe?)"), + Rt(this), + (e = t.body).isStatic() && e.activateStatic(t), + e.removeShape(t), + this.filterArbiters(e, t), + this.staticShapes.remove(t, t.hashid), + t.space = null) + } + , + X.prototype.removeBody = function(t) { + this.locked ? t.isAdded && (t.isAdded = !1, + this.delayedAddRemove.push(this.removeBody), + this.delayedAddRemove.push(t)) : (t.isAdded = !1, + y(this.containsBody(t), "Cannot remove a body that was not added to the space. (Removed twice maybe?)"), + Rt(this), + t.activate(), + o(this.bodies, t), + t.space = null) + } + , + X.prototype.removeConstraint = function(t) { + this.locked ? t.isAdded && (t.isAdded = !1, + this.delayedAddRemove.push(this.removeConstraint), + this.delayedAddRemove.push(t)) : (t.isAdded = !1, + y(this.containsConstraint(t), "Cannot remove a constraint that was not added to the space. (Removed twice maybe?)"), + Rt(this), + t.a.activate(), + t.b.activate(), + o(this.constraints, t), + t.a.removeConstraint(t), + t.b.removeConstraint(t), + t.space = null) + } + , + X.prototype.containsShape = function(t) { + return t.space === this + } + , + X.prototype.containsBody = function(t) { + return t.space == this + } + , + X.prototype.containsConstraint = function(t) { + return t.space == this + } + , + X.prototype.uncacheArbiter = function(t) { + delete this.cachedArbiters[f(t.a.hashid, t.b.hashid)], + o(this.arbiters, t) + } + , + X.prototype.eachBody = function(t, e) { + this.lock(); + for (var i = this.bodies, s = 0; s < i.length; s++) + t.call(e, i[s]); + for (var n = this.sleepingComponents, s = 0; s < n.length; s++) + for (var r = n[s]; r; ) { + var o = r.nodeNext; + t.call(e, r), + r = o + } + this.unlock(!0) + } + , + X.prototype.eachShape = function(t) { + this.lock(), + this.activeShapes.each(t), + this.staticShapes.each(t), + this.unlock(!0) + } + , + X.prototype.eachConstraint = function(t) { + this.lock(); + for (var e = this.constraints, i = 0; i < e.length; i++) + t(e[i]); + this.unlock(!0) + } + , + X.prototype.reindexStatic = function() { + y(!this.locked, "You cannot manually reindex objects while the space is locked. Wait until the current query or step is complete."), + this.staticShapes.each(function(t) { + var e = t.body; + t.update(e.p, e.rot) + }), + this.staticShapes.reindex() + } + , + X.prototype.reindexShape = function(t) { + y(!this.locked, "You cannot manually reindex objects while the space is locked. Wait until the current query or step is complete."); + var e = t.body; + t.update(e.p, e.rot), + this.activeShapes.reindexObject(t, t.hashid), + this.staticShapes.reindexObject(t, t.hashid) + } + , + X.prototype.reindexShapesForBody = function(t) { + for (var e = t.shapeList; e; e = e.next) + this.reindexShape(e) + } + , + X.prototype.useSpatialHash = function(t, e) { + throw new Error("Spatial Hash not implemented.") + } + , + X.prototype.activateBody = function(t) { + if (y(!t.isRogue(), "Internal error: Attempting to activate a rogue body."), + this.locked) + -1 === this.rousedBodies.indexOf(t) && this.rousedBodies.push(t); + else { + this.bodies.push(t); + for (var e = 0; e < t.shapeList.length; e++) { + var i = t.shapeList[e]; + this.staticShapes.remove(i, i.hashid), + this.activeShapes.insert(i, i.hashid) + } + for (var s, n, r = t.arbiterList; r; r = r.next(t)) + t !== (o = r.body_a) && !o.isStatic() || (s = r.a, + n = r.b, + (this.cachedArbiters[f(s.hashid, n.hashid)] = r).stamp = this.stamp, + r.handler = this.lookupHandler(s.collision_type, n.collision_type), + this.arbiters.push(r)); + for (var o, a = t.constraintList; a; a = a.nodeNext) + t !== (o = a.a) && !o.isStatic() || this.constraints.push(a) + } + } + , + X.prototype.deactivateBody = function(t) { + y(!t.isRogue(), "Internal error: Attempting to deactivate a rogue body."), + o(this.bodies, t); + for (var e = 0; e < t.shapeList.length; e++) { + var i = t.shapeList[e]; + this.activeShapes.remove(i, i.hashid), + this.staticShapes.insert(i, i.hashid) + } + for (var s = t.arbiterList; s; s = s.next(t)) + t !== (n = s.body_a) && !n.isStatic() || this.uncacheArbiter(s); + for (var n, r = t.constraintList; r; r = r.nodeNext) + t !== (n = r.a) && !n.isStatic() || o(this.constraints, r) + } + , + Z.prototype.activate = function() { + this.isRogue() || (this.nodeIdleTime = 0, + function(t) { + if (t && t.isSleeping(t)) { + y(!t.isRogue(), "Internal Error: componentActivate() called on a rogue body."); + for (var e = t.space, i = t; i; ) { + var s = i.nodeNext; + i.nodeIdleTime = 0, + i.nodeRoot = null, + i.nodeNext = null, + e.activateBody(i), + i = s + } + o(e.sleepingComponents, t) + } + }(Lt(this))) + } + , + Z.prototype.activateStatic = function(t) { + y(this.isStatic(), "Body.activateStatic() called on a non-static body."); + for (var e = this.arbiterList; e; e = e.next(this)) + t && t != e.a && t != e.b || (e.body_a == this ? e.body_b : e.body_a).activate() + } + , + Z.prototype.pushArbiter = function(t) { + g(null === (t.body_a === this ? t.thread_a_next : t.thread_b_next), "Internal Error: Dangling contact graph pointers detected. (A)"), + g(null === (t.body_a === this ? t.thread_a_prev : t.thread_b_prev), "Internal Error: Dangling contact graph pointers detected. (B)"); + var e = this.arbiterList; + g(null === e || null === (e.body_a === this ? e.thread_a_prev : e.thread_b_prev), "Internal Error: Dangling contact graph pointers detected. (C)"), + t.body_a === this ? t.thread_a_next = e : t.thread_b_next = e, + e && (e.body_a === this ? e.thread_a_prev = t : e.thread_b_prev = t), + this.arbiterList = t + } + ; + var Mt, jt = function(t, e) { + if (!e.isRogue()) { + var i = Lt(e); + if (null == i) { + r = t, + (o = e).nodeRoot = r, + o !== r && (o.nodeNext = r.nodeNext, + r.nodeNext = o); + for (var s = e.arbiterList; s; s = s.next(e)) + jt(t, e == s.body_a ? s.body_b : s.body_a); + for (var n = e.constraintList; n; n = n.next(e)) + jt(t, e == n.a ? n.b : n.a) + } else + g(i === t, "Internal Error: Inconsistency detected in the contact graph.") + } + var r, o + }; + function Nt(t, e) { + var i, s, n, r, o, a = Mt; + t.bb_l <= e.bb_r && e.bb_l <= t.bb_r && t.bb_b <= e.bb_t && e.bb_b <= t.bb_t && t.body !== e.body && (!t.group || t.group !== e.group) && t.layers & e.layers && (i = a.lookupHandler(t.collision_type, e.collision_type), + (s = t.sensor || e.sensor) && i === Bt || (t.collisionCode > e.collisionCode && (o = t, + t = e, + e = o), + 0 !== (n = Et(t, e)).length && (r = f(t.hashid, e.hashid), + (o = (o = a.cachedArbiters[r]) || (a.cachedArbiters[r] = new bt(t,e))).update(n, i, t, e), + "first coll" != o.state || i.begin(o, a) || o.ignore(), + "ignore" !== o.state && i.preSolve(o, a) && !s ? a.arbiters.push(o) : (o.contacts = null, + "ignore" !== o.state && (o.state = "normal")), + o.stamp = a.stamp))) + } + function Ft(t) { + var e = t.body; + t.update(e.p, e.rot) + } + function Dt(t, e, i, s) { + var n = t.vx + -i.y * t.w + , i = t.vy + i.x * t.w + , t = e.vx + -s.y * e.w + , e = e.vy + s.x * e.w; + return new v(t - n,e - i) + } + function Vt(t, e, i) { + return i = P(e, i), + t.m_inv + t.i_inv * i * i + } + function Wt(t, e, i, s, n, r) { + var o = u = t.m_inv + e.m_inv + , a = 0 + , h = 0 + , c = u + , l = t.i_inv + , u = i.x * i.x * l + , t = i.y * i.y * l + , l = -i.x * i.y * l; + o += t, + a += l, + h += l, + c += u, + l = e.i_inv, + u = s.x * s.x * l, + e = s.y * s.y * l, + l = -s.x * s.y * l, + l = (o += e) * (c += u) - (a += l) * (h += l), + g(0 != l, "Unsolvable constraint."), + l = 1 / l, + n.x = c * l, + n.y = -a * l, + r.x = -h * l, + r.y = o * l + } + function zt(t, e, i) { + return new v(w(t, e),w(t, i)) + } + function Gt(t, e) { + return 1 - Math.pow(t, e) + } + X.prototype.processComponents = function(t) { + for (var e = this.sleepTimeThreshold !== 1 / 0, i = this.bodies, s = 0; s < i.length; s++) { + var n = i[s]; + g(null === n.nodeNext, "Internal Error: Dangling next pointer detected in contact graph."), + g(null === n.nodeRoot, "Internal Error: Dangling root pointer detected in contact graph.") + } + if (e) + for (var r, o = this.idleSpeedThreshold, a = o ? o * o : B(this.gravity) * t * t, s = 0; s < i.length; s++) + (n = i[s]).m !== 1 / 0 ? (r = a ? n.m * a : 0, + n.nodeIdleTime = n.kineticEnergy() > r ? 0 : n.nodeIdleTime + t) : n.nodeIdleTime = 1 / 0; + for (var h = this.arbiters, s = 0, c = h.length; s < c; s++) { + var l = h[s] + , u = l.body_a + , p = l.body_b; + e && ((p.isRogue() && !p.isStatic() || u.isSleeping()) && u.activate(), + (u.isRogue() && !u.isStatic() || p.isSleeping()) && p.activate()), + u.pushArbiter(l), + p.pushArbiter(l) + } + if (e) { + for (var d = this.constraints, s = 0; s < d.length; s++) { + var f = d[s] + , u = f.a; + (p = f.b).isRogue() && !p.isStatic() && u.activate(), + u.isRogue() && !u.isStatic() && p.activate() + } + for (s = 0; s < i.length; ) { + n = i[s]; + if (null !== Lt(n) || (jt(n, n), + function(t, e) { + for (var i = t; i; i = i.nodeNext) + if (i.nodeIdleTime < e) + return !0; + return !1 + }(n, this.sleepTimeThreshold))) + s++, + n.nodeRoot = null, + n.nodeNext = null; + else { + this.sleepingComponents.push(n); + for (var y = n; y; y = y.nodeNext) + this.deactivateBody(y) + } + } + } + } + , + Z.prototype.sleep = function() { + this.sleepWithGroup(null) + } + , + Z.prototype.sleepWithGroup = function(t) { + y(!this.isStatic() && !this.isRogue(), "Rogue and static bodies cannot be put to sleep."); + var e = this.space; + if (y(e, "Cannot put a rogue body to sleep."), + y(!e.locked, "Bodies cannot be put to sleep during a query or a call to cpSpaceStep(). Put these calls into a post-step callback."), + y(null === t || t.isSleeping(), "Cannot use a non-sleeping body as a group identifier."), + this.isSleeping()) + y(Lt(this) === Lt(t), "The body is already sleeping and it's group cannot be reassigned."); + else { + for (var i = 0; i < this.shapeList.length; i++) + this.shapeList[i].update(this.p, this.rot); + e.deactivateBody(this), + t ? (t = Lt(t), + this.nodeRoot = t, + this.nodeNext = t.nodeNext, + this.nodeIdleTime = 0, + t.nodeNext = this) : ((this.nodeRoot = this).nodeNext = null, + this.nodeIdleTime = 0, + e.sleepingComponents.push(this)), + o(e.bodies, this) + } + } + , + X.prototype.activateShapesTouchingShape = function(t) { + this.sleepTimeThreshold !== 1 / 0 && this.shapeQuery(t, function(t, e) { + t.body.activate() + }) + } + , + X.prototype.pointQuery = function(e, i, s, n) { + function t(t) { + (!t.group || s !== t.group) && i & t.layers && t.pointQuery(e) && n(t) + } + var r = new V(e.x,e.y,e.x,e.y); + this.lock(), + this.activeShapes.query(r, t), + this.staticShapes.query(r, t), + this.unlock(!0) + } + , + X.prototype.pointQueryFirst = function(t, e, i) { + var s = null; + return this.pointQuery(t, e, i, function(t) { + t.sensor || (s = t) + }), + s + } + , + X.prototype.nearestPointQuery = function(i, s, n, r, o) { + function t(t) { + var e; + t.group && r === t.group || !(n & t.layers) || (e = t.nearestPointQuery(i)).d < s && o(t, e.d, e.p) + } + var e = W(i, s); + this.lock(), + this.activeShapes.query(e, t), + this.staticShapes.query(e, t), + this.unlock(!0) + } + , + X.prototype.nearestPointQueryNearest = function(e, i, s, n) { + function t(t) { + t.group && n === t.group || !(s & t.layers) || t.sensor || (t = t.nearestPointQuery(e)).d < i && (!r || t.d < r.d) && (r = t) + } + var r, o = W(e, i); + return this.activeShapes.query(o, t), + this.staticShapes.query(o, t), + r + } + , + X.prototype.segmentQuery = function(i, s, n, r, o) { + function t(t) { + var e; + return (!t.group || r !== t.group) && n & t.layers && (e = t.segmentQuery(i, s)) && o(t, e.t, e.n), + 1 + } + this.lock(), + this.staticShapes.segmentQuery(i, s, 1, t), + this.activeShapes.segmentQuery(i, s, 1, t), + this.unlock(!0) + } + , + X.prototype.segmentQueryFirst = function(i, s, n, r) { + function t(t) { + var e; + return (!t.group || r !== t.group) && n & t.layers && !t.sensor && (e = t.segmentQuery(i, s)) && (null === o || e.t < o.t) && (o = e), + o ? o.t : 1 + } + var o = null; + return this.staticShapes.segmentQuery(i, s, 1, t), + this.activeShapes.segmentQuery(i, s, o ? o.t : 1, t), + o + } + , + X.prototype.bbQuery = function(o, a, h, c) { + function t(t) { + var e, i, s, n, r; + (!t.group || h !== t.group) && a & t.layers && (e = o, + i = t.bb_l, + s = t.bb_b, + n = t.bb_r, + r = t.bb_t, + e.l <= n && i <= e.r && e.b <= r && s <= e.t) && c(t) + } + this.lock(), + this.activeShapes.query(o, t), + this.staticShapes.query(o, t), + this.unlock(!0) + } + , + X.prototype.shapeQuery = function(r, o) { + var t = r.body; + t && r.update(t.p, t.rot); + var e = new V(r.bb_l,r.bb_b,r.bb_r,r.bb_t) + , a = !1 + , t = function(t) { + var e, i = r; + if ((!i.group || i.group !== t.group) && i.layers & t.layers && i !== t) { + if (i.collisionCode <= t.collisionCode) + e = Et(i, t); + else { + e = Et(t, i); + for (var s = 0; s < e.length; s++) + e[s].n = O(e[s].n) + } + if (e.length && (a = !(i.sensor || t.sensor), + o)) { + for (var n = new Array(e.length), s = 0; s < e.length; s++) + n[s] = new wt(e[s].p,e[s].n,e[s].dist); + o(t, n) + } + } + }; + return this.lock(), + this.activeShapes.query(e, t), + this.staticShapes.query(e, t), + this.unlock(!0), + a + } + , + X.prototype.addPostStepCallback = function(t) { + g(this.locked, "Adding a post-step callback when the space is not locked is unnecessary. Post-step callbacks will not called until the end of the next call to cpSpaceStep() or the next query."), + this.postStepCallbacks.push(t) + } + , + X.prototype.runPostStepCallbacks = function() { + for (var t = 0; t < this.postStepCallbacks.length; t++) + this.postStepCallbacks[t](); + this.postStepCallbacks.length = 0 + } + , + X.prototype.lock = function() { + this.locked++ + } + , + X.prototype.unlock = function(t) { + if (this.locked--, + y(0 <= this.locked, "Internal Error: Space lock underflow."), + 0 === this.locked && t) { + for (var e = this.rousedBodies, i = 0; i < e.length; i++) + this.activateBody(e[i]); + e.length = 0, + this.runPostStepCallbacks() + } + } + , + X.prototype.makeCollideShapes = function() { + return Mt = this, + Nt + } + , + X.prototype.arbiterSetFilter = function(t) { + var e = this.stamp - t.stamp + , i = t.body_a + , s = t.body_b; + return !(!i.isStatic() && !i.isSleeping() || !s.isStatic() && !s.isSleeping()) || (1 <= e && "cached" != t.state && (t.callSeparate(this), + t.state = "cached"), + !(e >= this.collisionPersistence) || (t.contacts = null, + !1)) + } + , + X.prototype.step = function(t) { + if (0 !== t) { + y(0 === b.x && 0 === b.y, "vzero is invalid"), + this.stamp++; + var e, i, s = this.curr_dt; + this.curr_dt = t; + var n = this.bodies + , r = this.constraints + , o = this.arbiters; + for (l = 0; l < o.length; l++) { + var a = o[l]; + a.state = "normal", + a.body_a.isSleeping() || a.body_b.isSleeping() || a.unthread() + } + for (o.length = 0, + this.lock(), + l = 0; l < n.length; l++) + n[l].position_func(t); + for (i in this.activeShapes.each(Ft), + this.activeShapes.reindexQuery(this.collideShapes), + this.unlock(!1), + this.processComponents(t), + this.lock(), + this.cachedArbiters) + this.arbiterSetFilter(this.cachedArbiters[i]) || delete this.cachedArbiters[i]; + for (var h = this.collisionSlop, c = 1 - Math.pow(this.collisionBias, t), l = 0; l < o.length; l++) + o[l].preStep(t, h, c); + for (l = 0; l < r.length; l++) { + var u = r[l]; + u.preSolve(this), + u.preStep(t) + } + var p = Math.pow(this.damping, t) + , d = this.gravity; + for (l = 0; l < n.length; l++) + n[l].velocity_func(d, p, t); + var f = 0 === s ? 0 : t / s; + for (l = 0; l < o.length; l++) + o[l].applyCachedImpulse(f); + for (l = 0; l < r.length; l++) + r[l].applyCachedImpulse(f); + for (l = 0; l < this.iterations; l++) { + for (e = 0; e < o.length; e++) + o[e].applyImpulse(); + for (e = 0; e < r.length; e++) + r[e].applyImpulse() + } + for (l = 0; l < r.length; l++) + r[l].postSolve(this); + for (l = 0; l < o.length; l++) + o[l].handler.postSolve(o[l], this); + this.unlock(!0) + } + } + ; + var Ut = function(t, e, i, s, n) { + var r = t.vx + -i.y * t.w + , i = t.vy + i.x * t.w + , t = e.vx + -s.y * e.w + , e = e.vy + s.x * e.w; + return x(t - r, e - i, n.x, n.y) + } + , qt = function(t, e, i, s) { + t.vx += e * t.m_inv, + t.vy += i * t.m_inv, + t.w += t.i_inv * (s.x * i - s.y * e) + } + , Xt = function(t, e, i, s, n, r) { + qt(t, -n, -r, i), + qt(e, n, r, s) + } + , Ht = function(t, e, i, s) { + t.v_biasx += e * t.m_inv, + t.v_biasy += i * t.m_inv, + t.w_bias += t.i_inv * E(s.x, s.y, e, i) + } + , Yt = function(t, e, i, s, n) { + n = Vt(t, i, n) + Vt(e, s, n); + return g(0 !== n, "Unsolvable collision or constraint."), + n + } + , Jt = n.Constraint = function(t, e) { + this.a = t, + this.b = e, + this.space = null, + this.isAdded = !1, + this.next_a = null, + this.next_b = null, + this.maxForce = 1 / 0, + this.errorBias = Math.pow(.9, 60), + this.maxBias = 1 / 0 + } + ; + function Kt(t, e) { + return (t.restLength - e) * t.stiffness + } + function Qt(t, e) { + return (e - t.restAngle) * t.stiffness + } + Jt.prototype.activateBodies = function() { + this.a && this.a.activate(), + this.b && this.b.activate() + } + , + Jt.prototype.preStep = function(t) {} + , + Jt.prototype.applyCachedImpulse = function(t) {} + , + Jt.prototype.applyImpulse = function() {} + , + Jt.prototype.getImpulse = function() { + return 0 + } + , + Jt.prototype.preSolve = function(t) {} + , + Jt.prototype.postSolve = function(t) {} + , + Jt.prototype.next = function(t) { + return this.a === t ? this.next_a : this.next_b + } + , + (X = n.PinJoint = function(t, e, i, s) { + Jt.call(this, t, e), + this.anchr1 = i, + this.anchr2 = s; + i = t ? C(t.p, h(i, t.rot)) : i, + s = e ? C(e.p, h(s, e.rot)) : s; + this.dist = S(k(s, i)), + g(0 < this.dist, "You created a 0 length pin joint. A pivot joint will be much more stable."), + this.r1 = this.r2 = null, + this.n = null, + this.nMass = 0, + this.jnAcc = this.jnMax = 0, + this.bias = 0 + } + ).prototype = Object.create(Jt.prototype), + X.prototype.preStep = function(t) { + var e, i, s = this.a, n = this.b; + s.isRogue() && n.isRogue() || (this.r1 = h(this.anchr1, s.rot), + this.r2 = h(this.anchr2, n.rot), + e = k(C(n.p, this.r2), C(s.p, this.r1)), + i = S(e), + this.n = I(e, 1 / (i || 1 / 0)), + this.nMass = 1 / Yt(s, n, this.r1, this.r2, this.n), + n = this.maxBias, + this.bias = m(-Gt(this.errorBias, t) * (i - this.dist) / t, -n, n), + this.jnMax = this.maxForce * t) + } + , + X.prototype.applyCachedImpulse = function(t) { + t = I(this.n, this.jnAcc * t); + Xt(this.a, this.b, this.r1, this.r2, t.x, t.y) + } + , + X.prototype.applyImpulse = function() { + var t = this.a + , e = this.b + , i = this.n + , s = Ut(t, e, this.r1, this.r2, i) + , n = (this.bias - s) * this.nMass + , s = this.jnAcc; + this.jnAcc = m(s + n, -this.jnMax, this.jnMax), + n = this.jnAcc - s, + Xt(t, e, this.r1, this.r2, i.x * n, i.y * n) + } + , + X.prototype.getImpulse = function() { + return Math.abs(this.jnAcc) + } + , + (X = n.SlideJoint = function(t, e, i, s, n, r) { + Jt.call(this, t, e), + this.anchr1 = i, + this.anchr2 = s, + this.min = n, + this.max = r, + this.r1 = this.r2 = this.n = null, + this.nMass = 0, + this.jnAcc = this.jnMax = 0, + this.bias = 0 + } + ).prototype = Object.create(Jt.prototype), + X.prototype.preStep = function(t) { + var e, i, s, n = this.a, r = this.b; + n.isRogue() && r.isRogue() || (this.r1 = h(this.anchr1, n.rot), + this.r2 = h(this.anchr2, r.rot), + e = k(C(r.p, this.r2), C(n.p, this.r1)), + s = 0, + (i = S(e)) > this.max ? (s = i - this.max, + this.n = M(e)) : i < this.min ? (s = this.min - i, + this.n = O(M(e))) : (this.n = b, + this.jnAcc = 0), + this.nMass = 1 / Yt(n, r, this.r1, this.r2, this.n), + r = this.maxBias, + this.bias = m(-Gt(this.errorBias, t) * s / t, -r, r), + this.jnMax = this.maxForce * t) + } + , + X.prototype.applyCachedImpulse = function(t) { + t = this.jnAcc * t; + Xt(this.a, this.b, this.r1, this.r2, this.n.x * t, this.n.y * t) + } + , + X.prototype.applyImpulse = function() { + var t, e, i, s, n; + 0 === this.n.x && 0 === this.n.y || (t = this.a, + e = this.b, + i = this.n, + s = this.r1, + n = this.r2, + s = Dt(t, e, s, n), + n = w(s, i), + s = (this.bias - n) * this.nMass, + n = this.jnAcc, + this.jnAcc = m(n + s, -this.jnMax, 0), + s = this.jnAcc - n, + Xt(t, e, this.r1, this.r2, i.x * s, i.y * s)) + } + , + X.prototype.getImpulse = function() { + return Math.abs(this.jnAcc) + } + , + (X = n.PivotJoint = function(t, e, i, s) { + var n; + Jt.call(this, t, e), + void 0 === s && (n = i, + i = t ? t.world2Local(n) : n, + s = e ? e.world2Local(n) : n), + this.anchr1 = i, + this.anchr2 = s, + this.r1 = this.r2 = b, + this.k1 = new v(0,0), + this.k2 = new v(0,0), + this.jAcc = b, + this.jMaxLen = 0, + this.bias = b + } + ).prototype = Object.create(Jt.prototype), + X.prototype.preStep = function(t) { + var e = this.a + , i = this.b; + e.isRogue() && i.isRogue() || (this.r1 = h(this.anchr1, e.rot), + this.r2 = h(this.anchr2, i.rot), + Wt(e, i, this.r1, this.r2, this.k1, this.k2), + this.jMaxLen = this.maxForce * t, + e = k(C(i.p, this.r2), C(e.p, this.r1)), + this.bias = j(I(e, -Gt(this.errorBias, t) / t), this.maxBias)) + } + , + X.prototype.applyCachedImpulse = function(t) { + Xt(this.a, this.b, this.r1, this.r2, this.jAcc.x * t, this.jAcc.y * t) + } + , + X.prototype.applyImpulse = function() { + var t = this.a + , e = this.b + , i = this.r1 + , s = this.r2 + , i = Dt(t, e, i, s) + , s = zt(k(this.bias, i), this.k1, this.k2) + , i = this.jAcc; + this.jAcc = j(C(this.jAcc, s), this.jMaxLen), + Xt(t, e, this.r1, this.r2, this.jAcc.x - i.x, this.jAcc.y - i.y) + } + , + X.prototype.getImpulse = function() { + return S(this.jAcc) + } + , + (X = n.GrooveJoint = function(t, e, i, s, n) { + Jt.call(this, t, e), + this.grv_a = i, + this.grv_b = s, + this.grv_n = c(L(k(s, i))), + this.anchr2 = n, + this.grv_tn = null, + this.clamp = 0, + this.r1 = this.r2 = null, + this.k1 = new v(0,0), + this.k2 = new v(0,0), + this.jAcc = b, + this.jMaxLen = 0, + this.bias = null + } + ).prototype = Object.create(Jt.prototype), + X.prototype.preStep = function(t) { + var e, i, s, n, r, o = this.a, a = this.b; + o.isRogue() && a.isRogue() || (e = o.local2World(this.grv_a), + i = o.local2World(this.grv_b), + s = h(this.grv_n, o.rot), + n = w(e, s), + this.grv_tn = s, + this.r2 = h(this.anchr2, a.rot), + (r = P(C(a.p, this.r2), s)) <= P(e, s) ? (this.clamp = 1, + this.r1 = k(e, o.p)) : r >= P(i, s) ? (this.clamp = -1, + this.r1 = k(i, o.p)) : (this.clamp = 0, + this.r1 = k(C(I(c(s), -r), I(s, n)), o.p)), + Wt(o, a, this.r1, this.r2, this.k1, this.k2), + this.jMaxLen = this.maxForce * t, + o = k(C(a.p, this.r2), C(o.p, this.r1)), + this.bias = j(I(o, -Gt(this.errorBias, t) / t), this.maxBias)) + } + , + X.prototype.applyCachedImpulse = function(t) { + Xt(this.a, this.b, this.r1, this.r2, this.jAcc.x * t, this.jAcc.y * t) + } + , + X.prototype.grooveConstrain = function(t) { + var e = this.grv_tn + , e = 0 < this.clamp * P(t, e) ? t : i(t, e); + return j(e, this.jMaxLen) + } + , + X.prototype.applyImpulse = function() { + var t = this.a + , e = this.b + , i = this.r1 + , s = this.r2 + , i = Dt(t, e, i, s) + , s = zt(k(this.bias, i), this.k1, this.k2) + , i = this.jAcc; + this.jAcc = this.grooveConstrain(C(i, s)), + Xt(t, e, this.r1, this.r2, this.jAcc.x - i.x, this.jAcc.y - i.y) + } + , + X.prototype.getImpulse = function() { + return S(this.jAcc) + } + , + X.prototype.setGrooveA = function(t) { + this.grv_a = t, + this.grv_n = c(L(k(this.grv_b, t))), + this.activateBodies() + } + , + X.prototype.setGrooveB = function(t) { + this.grv_b = t, + this.grv_n = c(L(k(t, this.grv_a))), + this.activateBodies() + } + , + (X = n.DampedSpring = function(t, e, i, s, n, r, o) { + Jt.call(this, t, e), + this.anchr1 = i, + this.anchr2 = s, + this.restLength = n, + this.stiffness = r, + this.damping = o, + this.springForceFunc = Kt, + this.target_vrn = this.v_coef = 0, + this.r1 = this.r2 = null, + this.nMass = 0, + this.n = null + } + ).prototype = Object.create(Jt.prototype), + X.prototype.preStep = function(t) { + var e, i, s = this.a, n = this.b; + s.isRogue() && n.isRogue() || (this.r1 = h(this.anchr1, s.rot), + this.r2 = h(this.anchr2, n.rot), + e = k(C(n.p, this.r2), C(s.p, this.r1)), + i = S(e), + this.n = I(e, 1 / (i || 1 / 0)), + e = Yt(s, n, this.r1, this.r2, this.n), + g(0 !== e, "Unsolvable this."), + this.nMass = 1 / e, + this.target_vrn = 0, + this.v_coef = 1 - Math.exp(-this.damping * t * e), + i = this.springForceFunc(this, i), + Xt(s, n, this.r1, this.r2, this.n.x * i * t, this.n.y * i * t)) + } + , + X.prototype.applyCachedImpulse = function(t) {} + , + X.prototype.applyImpulse = function() { + var t = this.a + , e = this.b + , i = this.n + , s = this.r1 + , n = this.r2 + , n = Ut(t, e, s, n, i) + , i = (this.target_vrn - n) * this.v_coef; + this.target_vrn = n + i, + i *= this.nMass, + Xt(t, e, this.r1, this.r2, this.n.x * i, this.n.y * i) + } + , + X.prototype.getImpulse = function() { + return 0 + } + , + (X = n.DampedRotarySpring = function(t, e, i, s, n) { + Jt.call(this, t, e), + this.restAngle = i, + this.stiffness = s, + this.damping = n, + this.springTorqueFunc = Qt, + this.target_wrn = 0, + this.w_coef = 0, + this.iSum = 0 + } + ).prototype = Object.create(Jt.prototype), + X.prototype.preStep = function(t) { + var e, i = this.a, s = this.b; + i.isRogue() && s.isRogue() || (e = i.i_inv + s.i_inv, + g(0 !== e, "Unsolvable spring."), + this.iSum = 1 / e, + this.w_coef = 1 - Math.exp(-this.damping * t * e), + this.target_wrn = 0, + t = this.springTorqueFunc(this, i.a - s.a) * t, + i.w -= t * i.i_inv, + s.w += t * s.i_inv) + } + , + X.prototype.applyImpulse = function() { + var t = this.a + , e = this.b + , i = t.w - e.w + , s = (this.target_wrn - i) * this.w_coef; + this.target_wrn = i + s; + s *= this.iSum; + t.w += s * t.i_inv, + e.w -= s * e.i_inv + } + , + (X = n.RotaryLimitJoint = function(t, e, i, s) { + Jt.call(this, t, e), + this.min = i, + this.max = s, + this.jAcc = 0, + this.iSum = this.bias = this.jMax = 0 + } + ).prototype = Object.create(Jt.prototype), + X.prototype.preStep = function(t) { + var e, i, s = this.a, n = this.b; + s.isRogue() && n.isRogue() || (i = 0, + (e = n.a - s.a) > this.max ? i = this.max - e : e < this.min && (i = this.min - e), + this.iSum = 1 / (1 / s.i + 1 / n.i), + n = this.maxBias, + this.bias = m(-Gt(this.errorBias, t) * i / t, -n, n), + this.jMax = this.maxForce * t, + this.bias || (this.jAcc = 0)) + } + , + X.prototype.applyCachedImpulse = function(t) { + var e = this.a + , i = this.b + , t = this.jAcc * t; + e.w -= t * e.i_inv, + i.w += t * i.i_inv + } + , + X.prototype.applyImpulse = function() { + var t, e, i, s; + this.bias && (t = this.a, + s = (e = this.b).w - t.w, + i = -(this.bias + s) * this.iSum, + s = this.jAcc, + this.bias < 0 ? this.jAcc = m(s + i, 0, this.jMax) : this.jAcc = m(s + i, -this.jMax, 0), + i = this.jAcc - s, + t.w -= i * t.i_inv, + e.w += i * e.i_inv) + } + , + X.prototype.getImpulse = function() { + return Math.abs(joint.jAcc) + } + , + (X = n.RatchetJoint = function(t, e, i, s) { + Jt.call(this, t, e), + this.angle = 0, + this.phase = i, + this.ratchet = s, + this.angle = (e ? e.a : 0) - (t ? t.a : 0), + this.iSum = this.bias = this.jAcc = this.jMax = 0 + } + ).prototype = Object.create(Jt.prototype), + X.prototype.preStep = function(t) { + var e, i, s, n, r, o = this.a, a = this.b; + o.isRogue() && a.isRogue() || (n = this.angle, + e = this.phase, + i = this.ratchet, + (r = 0) < (n = n - (s = a.a - o.a)) * i ? r = n : this.angle = Math.floor((s - e) / i) * i + e, + this.iSum = 1 / (o.i_inv + a.i_inv), + a = this.maxBias, + this.bias = m(-Gt(this.errorBias, t) * r / t, -a, a), + this.jMax = this.maxForce * t, + this.bias || (this.jAcc = 0)) + } + , + X.prototype.applyCachedImpulse = function(t) { + var e = this.a + , i = this.b + , t = this.jAcc * t; + e.w -= t * e.i_inv, + i.w += t * i.i_inv + } + , + X.prototype.applyImpulse = function() { + var t, e, i, s, n; + this.bias && (t = this.a, + n = (e = this.b).w - t.w, + i = this.ratchet, + s = -(this.bias + n) * this.iSum, + n = this.jAcc, + this.jAcc = m((n + s) * i, 0, this.jMax * Math.abs(i)) / i, + s = this.jAcc - n, + t.w -= s * t.i_inv, + e.w += s * e.i_inv) + } + , + X.prototype.getImpulse = function(t) { + return Math.abs(t.jAcc) + } + , + (X = n.GearJoint = function(t, e, i, s) { + Jt.call(this, t, e), + this.phase = i, + this.ratio = s, + this.ratio_inv = 1 / s, + this.jAcc = 0, + this.iSum = this.bias = this.jMax = 0 + } + ).prototype = Object.create(Jt.prototype), + X.prototype.preStep = function(t) { + var e, i = this.a, s = this.b; + i.isRogue() && s.isRogue() || (this.iSum = 1 / (i.i_inv * this.ratio_inv + this.ratio * s.i_inv), + e = this.maxBias, + this.bias = m(-Gt(this.errorBias, t) * (s.a * this.ratio - i.a - this.phase) / t, -e, e), + this.jMax = this.maxForce * t) + } + , + X.prototype.applyCachedImpulse = function(t) { + var e = this.a + , i = this.b + , t = this.jAcc * t; + e.w -= t * e.i_inv * this.ratio_inv, + i.w += t * i.i_inv + } + , + X.prototype.applyImpulse = function() { + var t = this.a + , e = this.b + , i = e.w * this.ratio - t.w + , s = (this.bias - i) * this.iSum + , i = this.jAcc; + this.jAcc = m(i + s, -this.jMax, this.jMax), + s = this.jAcc - i, + t.w -= s * t.i_inv * this.ratio_inv, + e.w += s * e.i_inv + } + , + X.prototype.getImpulse = function() { + return Math.abs(this.jAcc) + } + , + X.prototype.setRatio = function(t) { + this.ratio = t, + this.ratio_inv = 1 / t, + this.activateBodies() + } + , + (X = n.SimpleMotor = function(t, e, i) { + Jt.call(this, t, e), + this.rate = i, + this.jAcc = 0, + this.iSum = this.jMax = 0 + } + ).prototype = Object.create(Jt.prototype), + X.prototype.preStep = function(t) { + this.iSum = 1 / (this.a.i_inv + this.b.i_inv), + this.jMax = this.maxForce * t + } + , + X.prototype.applyCachedImpulse = function(t) { + var e = this.a + , i = this.b + , t = this.jAcc * t; + e.w -= t * e.i_inv, + i.w += t * i.i_inv + } + , + X.prototype.applyImpulse = function() { + var t = this.a + , e = this.b + , i = -(e.w - t.w + this.rate) * this.iSum + , s = this.jAcc; + this.jAcc = m(s + i, -this.jMax, this.jMax), + i = this.jAcc - s, + t.w -= i * t.i_inv, + e.w += i * e.i_inv + } + , + X.prototype.getImpulse = function() { + return Math.abs(this.jAcc) + } +}(), +cr.behaviors.rojoChipmunkBeta = function(n) { + this.runtime = n; + var t = this.space = new cp.Space; + t.addCollisionHandler(0, 0, null, function(t, e) { + var i, s; + return t.isFirstContact() && (i = t.getA().body.c2obj, + s = t.getB().body.c2obj, + i.Arbiter = t, + i.swapped = !1, + s.Arbiter = t, + s.swapped = !0, + n.trigger(cr.behaviors.rojoChipmunkBeta.prototype.cnds.onPreCollide, i.inst), + n.trigger(cr.behaviors.rojoChipmunkBeta.prototype.cnds.onPreCollide, s.inst), + i.Arbiter = null, + s.Arbiter = null), + "ignore" !== t.state + }, function(t, e) { + var i, s; + return t.isFirstContact() && (i = t.getA().body.c2obj, + s = t.getB().body.c2obj, + i.Arbiter = t, + i.swapped = !1, + s.Arbiter = t, + s.swapped = !0, + n.trigger(cr.behaviors.rojoChipmunkBeta.prototype.cnds.onPostCollide, i.inst), + n.trigger(cr.behaviors.rojoChipmunkBeta.prototype.cnds.onPostCollide, s.inst), + i.Arbiter = null, + s.Arbiter = null), + !0 + }, null), + t.gravity = cp.v(0, 100), + t.fixed_step = 1 / 30, + t.stepping_mode = 0, + t.sleepTimeThreshold = 1 +} +, +function() { + var t = cr.behaviors.rojoChipmunkBeta.prototype; + t.Type = function(t, e) { + this.behavior = t, + this.objtype = e, + this.runtime = t.runtime + } + , + t.Type.prototype.onCreate = function() { + this.behavior.lastUpdateTick = -1, + this.behavior.rogues = [] + } + , + t.Instance = function(t, e) { + this.type = t, + this.behavior = t.behavior, + this.inst = e, + this.runtime = t.runtime, + this.space = this.behavior.space + } + ; + var e = t.Instance.prototype; + function n(t) { + this.runtime.trigger(cr.behaviors.rojoChipmunkBeta.prototype.cnds.onPreStep, t.c2obj.inst) + } + function h(t) { + return "string" == typeof t ? (t = parseInt(t.slice(), 16), + isNaN(t) && (t = -1)) : t |= 0, + t + } + function i() {} + function s() {} + function r() {} + e.updateTileMap = function() { + if (0 !== this.col_shape && 2 !== this.col_shape && 4 !== this.col_shape) { + var t, e, i, s, n, r, o = this.inst, a = []; + for (o.update_bbox(), + o.getAllCollisionRects(a), + t = 0, + e = a.length; t < e; ++t) + if (l = (i = a[t]).rc, + i.poly && 3 === this.col_shape) { + i.poly.cp_convexpolys || (r = -2147483648 == (r = 3758096384 & i.id) || 1073741824 == r || 536870912 == r || -2147483648 & r && 1073741824 & r && 536870912 & r, + i.poly.cp_convexpolys = this.getConvexPolygons(i.poly, r)), + s = cp.v(l.left, l.top); + for (var h = i.poly.cp_convexpolys, c = 0; c < h.length; ++c) + this.shapes.push(new cp.PolyShape(this.body,h[c],s)) + } else { + s = cp.v(0, 0); + var l = [l.left, l.top, l.left, l.bottom, l.right, l.bottom, l.right, l.top]; + this.shapes.push(new cp.PolyShape(this.body,l,s)) + } + for (t = 0, + e = this.shapes.length; t < e; ++t) + (n = this.shapes[t]).group = this.col_group, + n.layers = this.col_layers, + n.setElasticity(this.elasticity), + n.setFriction(this.friction), + this.enabled && this.space.addShape(n) + } + } + , + e.getConvexPolygons = function(t, e) { + var i = t.pts_cache + , s = t.pts_count + , n = []; + for (n.length = s, + a = 0; a < s; a++) + n[a] = cp.v(i[2 * a], i[2 * a + 1]); + e && n.reverse(); + for (var r = triangles2convex(triangulate(n)), o = [], a = 0; a < r.length; ++a) { + var h = r[a].reverse() + , c = []; + c.length = 2 * h.length; + for (var l = 0; l < h.length; ++l) + c[2 * l] = h[l].x, + c[2 * l + 1] = h[l].y; + o.push(c) + } + return o + } + , + e.updateShape = function() { + var t = this.shapes; + if (this.enabled) + for (var e = 0, i = t.length; e < i; e++) + this.space.removeShape(t[e]); + if (t.length = 0, + this.updateCOM(this.body), + this.inst.tilemap_exists) + return this.total_poly_area = 0, + this.updateTileMap(), + this.no_rotation = !0, + void this.body.setMoment(1 / 0); + var s = this.col_shape; + 3 != s || this.inst.collision_poly && !this.inst.collision_poly.is_empty() || (s = 1); + var n, r = Math.abs(this.inst.width), o = Math.abs(this.inst.height); + switch (s) { + case 0: + this.inertia = 1; + break; + case 1: + this.inertia = cp.momentForBox(this.mass, r, o), + t.push(new cp.BoxShape(this.body,r,o)); + break; + case 2: + this.inertia = cp.momentForCircle(this.mass, r / 2, 0, cp.v(0, 0)), + t.push(new cp.CircleShape(this.body,o / 2,cp.v(0, 0))); + break; + case 3: + this.inst.collision_poly.cache_poly(this.inst.width, this.inst.height, 0); + var a = this.inst.width < 0 != this.inst.height < 0 + , h = this.getConvexPolygons(this.inst.collision_poly, a); + for (cp.centroidForPoly(this.inst.collision_poly), + e = this.total_poly_area = 0; e < h.length; ++e) + (n = new cp.PolyShape(this.body,h[e],this.offset)).area = cp.areaForPoly(h[e]), + this.total_poly_area += n.area, + t.push(n); + var c, l = 0; + for (e = 0; e < t.length; ++e) + c = t[e].area / this.total_poly_area, + l += cp.momentForPoly(c * this.mass, h[e], this.offset); + this.inertia = l; + break; + case 4: + var u = 0; + this.edgeRadius < 0 && (u = -this.edgeRadius); + a = cp.v(-r / 2 + u, 0), + u = cp.v(r / 2 - u, 0); + this.inertia = cp.momentForSegment(this.mass, a, u), + t.push(new cp.SegmentShape(this.body,a,u,Math.abs(this.edgeRadius))) + } + for (this.inertia <= 0 && (this.inertia = 1), + this.immovable || this.no_rotation ? this.body.setMoment(1 / 0) : this.body.setMoment(this.inertia), + this.body.isRogue() || this.body.activate(), + e = 0; e < t.length; ++e) + (n = t[e]).group = this.col_group, + n.layers = this.col_layers, + n.setElasticity(this.elasticity), + n.setFriction(this.friction), + this.enabled && this.space.addShape(n) + } + , + e.onCreate = function() { + var t; + this.immovable = 1 == this.properties[0], + this.col_shape = this.properties[1], + this.col_group = this.properties[2], + this.col_layers = parseInt(this.properties[3], 16), + this.mass = this.properties[4], + this.inertia = 1, + this.elasticity = this.properties[5], + this.friction = this.properties[6], + this.enabled = 0 == this.properties[7], + this.edgeRadius = this.properties[8], + this.no_rotation = 1 == this.properties[9], + this.invalidateShape = !0, + this.updateStatic = !1, + this.offset = cp.v(0, 0), + this.last_x = 0, + this.last_y = 0, + this.last_angle = 0, + this.last_hotspotX = 0, + this.last_hotspotY = 0, + this.last_width = 0, + this.last_height = 0, + this.last_anim = null, + this.last_anim_frame = -1, + this.queryInfo = null, + this.Arbiter = null, + this.swapped = !1, + this.total_poly_area = 0, + this.immovable ? (t = this.body = new cp.Body(1 / 0,1 / 0), + this.enabled && this.behavior.rogues.push(t), + t.nodeIdleTime = 1 / 0) : (t = this.body = new cp.Body(this.mass,1), + this.enabled && this.space.addBody(t)), + t.wasForceApplied = !1, + (t.c2obj = this).inst.chipmunkbetabody = t, + this.shapes = [] + } + , + e.postCreate = function() { + this.changeShapeCheck(this.body) + } + , + e.onDestroy = function() { + if (this.enabled) + for (var t = 0; t < this.shapes.length; t++) + this.space.removeShape(this.shapes[t]); + this.shapes.length = 0; + var e = this; + this.body.eachConstraint(function(t) { + e.space.removeConstraint(t) + }), + this.body.isRogue() ? cr.arrayFindRemove(this.behavior.rogues, this.body) : this.space.removeBody(this.body) + } + , + e.saveToJSON = function() { + return {} + } + , + e.loadFromJSON = function(t) {} + , + e.recalcOffset = function(t) { + var e = t.c2obj + , t = e.inst; + t.update_bbox(), + t.tilemap_exists ? e.offset = cp.v(0, 0) : e.offset = cp.v((t.hotspotX - .5) * t.width, (t.hotspotY - .5) * t.height) + } + , + e.updateCOM = function(t) { + var e = t.c2obj + , i = e.inst + , s = !1; + i.update_bbox(), + e.last_width === i.width && e.last_height === i.height || (s = !0, + e.invalidateShape = !0, + e.last_width = i.width, + e.last_height = i.height), + !s && e.last_x === i.x && e.last_y === i.y && e.last_angle === i.angle && e.last_hotspotX === i.hotspotX && e.last_hotspotY === i.hotspotY || (i.tilemap_exists ? t.setPos(cp.v(i.x, i.y)) : (e.offset = cp.v((i.hotspotX - .5) * i.width, (i.hotspotY - .5) * i.height), + t.setAngle(i.angle), + t.setPos(cp.v.sub(cp.v(i.x, i.y), cp.v.rotate(e.offset, t.rot)))), + t.isStatic() && (e.updateStatic = !0, + t.activateStatic()), + e.last_x = i.x, + e.last_y = i.y, + e.last_angle = i.angle, + e.last_hotspotX = i.hotspotX, + e.last_hotspotY = i.hotspotY) + } + , + e.updateC2 = function(t) { + var e, i = t.c2obj, s = i.inst; + t.wasForceApplied && (t.resetForces(), + t.wasForceApplied = !1), + t.isRogue() || (i.updateCOM(t), + e = cp.v.add(t.getPos(), cp.v.rotate(i.offset, t.rot)), + i.last_x = s.x = e.x, + i.last_y = s.y = e.y, + i.last_angle = s.angle = t.getAngle(), + s.set_bbox_changed()) + } + , + e.changeShapeCheck = function(t) { + var e = t.c2obj; + if (e.enabled && ((e.invalidateShape || e.inst.tilemap_exists && e.inst.physics_changed || e.last_width !== e.inst.width || 4 !== e.col_shape && e.last_height !== e.inst.height || 3 === e.col_shape && (e.last_anim !== e.inst.cur_animation || e.last_anim_frame !== e.inst.cur_frame)) && (e.updateShape(), + e.inst.tilemap_exists && (e.inst.physics_changed = !1), + e.last_width = e.inst.width, + e.last_height = e.inst.height, + e.last_anim = e.inst.cur_animation, + e.last_anim_frame = e.inst.cur_frame, + e.invalidateShape = !1, + e.updateStatic = !1), + e.updateStatic)) { + for (var i = 0, s = e.shapes.length; i < s; i++) + e.space.reindexShape(e.shapes[i]); + e.updateStatic = !1 + } + } + , + e.tick = function() { + var t = this.runtime.timescale; + if (this.runtime.tickcount > this.behavior.lastUpdateTick && 0 < t) { + this.space.eachBody(n, this), + this.behavior.rogues.forEach(this.updateCOM), + this.space.eachBody(this.updateCOM), + this.behavior.rogues.forEach(this.changeShapeCheck), + this.space.bodies.forEach(this.changeShapeCheck), + this.space.stepping_mode ? this.space.step(this.runtime.getDt(this.inst)) : this.space.step(this.space.fixed_step * t); + for (var e = this.space.delayedAddRemove, i = 0, s = e.length / 2; i < s; i++) + e[2 * i].call(this.space, e[2 * i + 1]); + e.length = 0, + this.space.eachBody(this.updateC2), + this.behavior.rogues.forEach(this.updateC2), + this.behavior.lastUpdateTick = this.runtime.tickcount + } + } + , + e.getJointHelper = function(e) { + var i = null + , s = 0; + return "string" == typeof e ? this.body.eachConstraint(function(t) { + t.tag === e && (i = t) + }) : this.body.eachConstraint(function(t) { + e == s && (i = t), + s++ + }), + i + } + , + i.prototype.isSleeping = function() { + return this.body.isSleeping() + } + , + i.prototype.isDisabled = function() { + return !this.enabled + } + , + i.prototype.isImmovable = function() { + return this.immovable + } + , + i.prototype.isUnrotatable = function() { + return this.no_rotation + } + , + i.prototype.compareCollisionShape = function(t) { + return this.col_shape == t + } + , + i.prototype.compareSteppingMode = function(t) { + return this.behavior.space.stepping_mode == t + } + , + i.prototype.queryPoint = function(t, e) { + for (var i, s, n = 0; n < this.shapes.length; n++) + s = this.shapes[n].nearestPointQuery(cp.v(t, e)), + (!i || s.d < i.d) && (i = s); + return !!i && (this.queryInfo = i, + !0) + } + , + i.prototype.nearestQueryPoint = function(t, e, i, s, n) { + var r = this.runtime.getCurrentCondition().type + , o = new cp.NearestPointQueryInfo(null,0,0); + if (this.behavior.space.nearestPointQuery(cp.v(t, e), i, h(n), s, function(t, e, i) { + var s = t.body.c2obj.inst; + (s.type == r || r.is_family && -1 != r.members.indexOf(s.type)) && (!o.shape || e < o.d) && (o.shape = t, + o.d = e, + o.p = i) + }), + !o.shape) + return !1; + n = o.shape.body.c2obj; + n.queryInfo = o; + s = n.inst, + n = r.getCurrentSol(); + return n.select_all = !0, + n.pick_one(s), + r.applySolToContainer(), + !0 + } + , + i.prototype.querySegment = function(t, e, i, s) { + for (var n, r, o = cp.v(t, e), a = cp.v(i, s), h = 0; h < this.shapes.length; h++) + (r = this.shapes[h].segmentQuery(o, a)) && (!n || r.t < n.t) && (n = r); + return !!n && (this.queryInfo = n, + this.queryInfo.p1 = o, + this.queryInfo.p2 = a, + !0) + } + , + i.prototype.nearestQuerySegment = function(t, e, i, s, n, r) { + var o = this.runtime.getCurrentCondition().type + , e = cp.v(t, e) + , s = cp.v(i, s) + , a = new cp.SegmentQueryInfo(null,0,0); + if (this.behavior.space.segmentQuery(e, s, h(r), n, function(t, e, i) { + var s = t.body.c2obj.inst; + (s.type == o || o.is_family && -1 != o.members.indexOf(s.type)) && (!a.shape || e < a.t) && (a.shape = t, + a.t = e, + a.n = i) + }), + !a.shape) + return !1; + n = a.shape.body.c2obj; + (n.queryInfo = a).p1 = e, + a.p2 = s; + s = n.inst, + n = o.getCurrentSol(); + return n.select_all = !0, + n.pick_one(s), + o.applySolToContainer(), + !0 + } + , + i.prototype.onPreStep = function() { + return !0 + } + , + i.prototype.onPostCollide = function() { + return this.updateC2(this.body), + !0 + } + , + i.prototype.onPreCollide = function() { + return this.updateC2(this.body), + !0 + } + , + i.prototype.forEachCollisionPair = function() { + var s = this.runtime.getCurrentEventStack().current_event; + return this.body.eachArbiter(function(t) { + var e = this.c2obj; + e.Arbiter = t, + e.swapped = !1; + var i = t.swappedColl; + t.swappedColl = !1, + e.swapped = e.inst.uid == t.getB().body.c2obj.inst.uid, + t.swappedColl = i, + e.runtime.pushCopySol(s.solModifiers), + s.retrigger(), + e.runtime.popSol(s.solModifiers), + e.Arbiter = null + }), + !1 + } + , + t.cnds = new i, + e.getVector = function(t, e, i, s) { + switch (t) { + case 0: + o = cp.v(e, i); + break; + case 1: + e = cr.to_radians(e), + o = cp.v(i * Math.cos(e), i * Math.sin(e)); + break; + case 2: + o = s.world2Local(cp.v(e, i)); + break; + case 3: + if (!s.c2obj) { + o = cp.v(0, 0); + break + } + var n = s.c2obj.inst; + n.update_bbox(); + var r = e + , o = n.getImagePoint && -1 !== r ? (e = n.getImagePoint(r, !0), + i = n.getImagePoint(r, !1), + s.world2Local(cp.v(e, i))) : cp.v(0, 0) + } + return o + } + , + s.prototype.setVelocity = function(t, e, i) { + this.body.setVel(this.getVector(t, e, i)) + } + , + s.prototype.setAngularVelocity = function(t) { + this.body.setAngVel(cr.to_radians(t)) + } + , + s.prototype.applyForceAt = function(t, e, i, s, n, r) { + this.body.applyForce(this.getVector(t, e, i), this.getVector(s, n, r)), + this.body.wasForceApplied = !0 + } + , + s.prototype.applyImpulseAt = function(t, e, i, s, n, r) { + this.body.applyImpulse(this.getVector(t, e, i), this.getVector(s, n, r)), + this.body.wasForceApplied = !0 + } + , + s.prototype.setTorque = function(t) { + this.body.activate(), + this.body.t = cr.to_radians(t), + this.body.wasForceApplied = !0 + } + , + s.prototype.setMaxSpeed = function(t) { + this.body.v_limit = t + } + , + s.prototype.setMaxAngularSpeed = function(t) { + this.body.w_limit = cr.to_radians(t) + } + , + s.prototype.setImmovable = function(t) { + var e, i; + if (0 == t && this.immovable) { + if (this.immovable = !1, + this.enabled) { + for (this.body.activateStatic(), + e = 0, + i = this.shapes.length; e < i; e++) + this.space.removeShape(this.shapes[e]); + for (cr.arrayFindRemove(this.behavior.rogues, this.body), + this.body.setMass(this.mass), + this.no_rotation || this.body.setMoment(this.inertia), + this.body.nodeIdleTime = 0, + this.space.addBody(this.body), + e = 0, + i = this.shapes.length; e < i; e++) + this.space.addShape(this.shapes[e]) + } + } else if (1 == t && !this.immovable && (this.immovable = !0, + this.enabled)) { + for (e = 0, + i = this.shapes.length; e < i; e++) + this.space.removeShape(this.shapes[e]); + for (this.space.removeBody(this.body), + this.body.setMass(1 / 0), + this.body.setMoment(1 / 0), + this.body.nodeIdleTime = 1 / 0, + this.behavior.rogues.push(this.body), + this.body.vx = 0, + this.body.vy = 0, + e = this.body.w = 0, + i = this.shapes.length; e < i; e++) + this.space.addShape(this.shapes[e]) + } + } + , + s.prototype.setNoRotation = function(t) { + this.inst.tilemap_exists || (0 == t && this.no_rotation ? (this.no_rotation = !1, + this.immovable || this.body.setMoment(this.inertia)) : 1 != t || this.no_rotation || (this.no_rotation = !0, + this.body.w = 0, + this.body.setMoment(1 / 0))) + } + , + s.prototype.setCollisionShape = function(t, e) { + this.col_shape == t && 4 == t && this.edgeRadius == e || (this.col_shape = t, + this.edgeRadius = e, + this.invalidateShape = !0) + } + , + s.prototype.setCollisionGroup = function(t) { + this.body.activate(), + this.col_group = t; + for (var e = 0; e < this.shapes.length; e++) + this.shapes[e].group = t + } + , + s.prototype.setCollisionLayers = function(t) { + this.body.activate(), + t = h(t), + this.col_layers = t; + for (var e = 0; e < this.shapes.length; e++) + this.shapes[e].layers = t + } + , + s.prototype.setMass = function(t) { + if (this.mass = t, + this.inst.tilemap_exists) + this.immovable || this.body.setMass(this.mass); + else { + var e = this.shapes[0]; + switch (this.col_shape) { + case 0: + this.inertia = 1; + break; + case 1: + this.inertia = cp.momentForPoly(this.mass, e.verts, cp.v(0, 0)); + break; + case 2: + this.inertia = cp.momentForCircle(this.mass, e.r, 0, cp.v(0, 0)); + break; + case 3: + for (var i, s = 0, n = 0; n < this.shapes.length; ++n) + i = shapes[n].area / this.total_poly_area, + s += cp.momentForPoly(i * this.mass, polys[n], this.offset); + this.inertia = s; + break; + case 4: + this.inertia = cp.momentForSegment(this.mass, e.a, e.b) + } + this.inertia <= 0 && (this.inertia = 1), + this.immovable || (this.body.setMass(this.mass), + this.no_rotation || this.body.setMoment(this.inertia)) + } + } + , + s.prototype.setFriction = function(t) { + this.friction = t; + for (var e = 0; e < this.shapes.length; e++) + this.shapes[e].setFriction(t) + } + , + s.prototype.setElasticity = function(t) { + this.elasticity = t; + for (var e = 0; e < this.shapes.length; e++) + this.shapes[e].setElasticity(t) + } + , + s.prototype.disablePhysics = function(t) { + if (!t && this.enabled) { + this.enabled = !1, + this.immovable ? cr.arrayFindRemove(this.behavior.rogues, this.body) : this.space.removeBody(this.body); + for (var e = 0; e < this.shapes.length; e++) + this.space.removeShape(this.shapes[e]) + } else if (t && !this.enabled) { + this.enabled = !0, + this.immovable ? this.behavior.rogues.push(this.body) : this.space.addBody(this.body); + for (e = 0; e < this.shapes.length; e++) + this.space.addShape(this.shapes[e]) + } + } + , + s.prototype.setGravity = function(t, e, i) { + this.space.gravity = this.getVector(t, e, i) + } + , + s.prototype.setIterations = function(t) { + this.space.iterations = t + } + , + s.prototype.setDamping = function(t) { + this.space.damping = t + } + , + s.prototype.setSteppingMode = function(t) { + this.space.stepping_mode = t + } + , + s.prototype.setFixedTimestep = function(t) { + this.space.fixed_step = t + } + , + s.prototype.setSleepTimeThreshold = function(t) { + this.space.sleepTimeThreshold = t + } + , + s.prototype.setIdleSpeedThreshold = function(t) { + this.space.idleSpeedThreshold = t + } + , + e.getBody2 = function(t, e) { + var i; + if (this.updateCOM(t), + -1 == e) + i = this.space.staticBody; + else { + e = this.runtime.getObjectByUID(e); + if (!e) + return null; + i = e.chipmunkbetabody, + this.updateCOM(i) + } + return i && t != i ? i : null + } + , + s.prototype.addPinJoint = function(t, e, i, s, n, r, o, a) { + s = this.getBody2(this.body, s); + s && (i = this.getVector(t, e, i, this.body), + o = this.getVector(n, r, o, s), + (o = this.space.addConstraint(new cp.PinJoint(this.body,s,i,o))).typeName = "pin", + o.tag = a) + } + , + s.prototype.addPivotJoint = function(t, e, i, s, n, r, o, a) { + s = this.getBody2(this.body, s); + s && (i = this.getVector(t, e, i, this.body), + o = this.getVector(n, r, o, s), + (o = this.space.addConstraint(new cp.PivotJoint(this.body,s,i,o))).typeName = "pivot", + o.tag = a) + } + , + s.prototype.addPivotJointAtXY = function(t, e, i, s) { + t = this.getBody2(this.body, t); + t && ((i = this.space.addConstraint(new cp.PivotJoint(this.body,t,cp.v(e, i)))).typeName = "pivot", + i.tag = s) + } + , + s.prototype.addGrooveJoint = function(t, e, i, s, n, r, o, a, h, c, l) { + o = this.getBody2(this.body, o); + o && (i = this.getVector(t, e, i, this.body), + r = this.getVector(s, n, r, this.body), + c = this.getVector(a, h, c, o), + (c = this.space.addConstraint(new cp.GrooveJoint(this.body,o,i,r,c))).typeName = "groove", + c.tag = l) + } + , + s.prototype.addSlideJoint = function(t, e, i, s, n, r, o, a, h, c) { + s = this.getBody2(this.body, s); + s && (i = this.getVector(t, e, i, this.body), + o = this.getVector(n, r, o, s), + (h = this.space.addConstraint(new cp.SlideJoint(this.body,s,i,o,a,h))).typeName = "slide", + h.tag = c) + } + , + s.prototype.addDampedSpring = function(t, e, i, s, n, r, o, a, h, c, l) { + s = this.getBody2(this.body, s); + s && (i = this.getVector(t, e, i, this.body), + o = this.getVector(n, r, o, s), + (c = this.space.addConstraint(new cp.DampedSpring(this.body,s,i,o,a,h,c))).typeName = "spring", + c.tag = l) + } + , + s.prototype.addDampedRotarySpring = function(t, e, i, s, n) { + t = this.getBody2(this.body, t); + t && ((s = this.space.addConstraint(new cp.DampedRotarySpring(this.body,t,cr.to_radians(e),i,s))).typeName = "rotarySpring", + s.tag = n) + } + , + s.prototype.addRatchetJoint = function(t, e, i, s) { + t = this.getBody2(this.body, t); + t && ((i = this.space.addConstraint(new cp.RatchetJoint(this.body,t,cr.to_radians(e),cr.to_radians(i)))).typeName = "ratchet", + i.tag = s) + } + , + s.prototype.addGearJoint = function(t, e, i, s) { + t = this.getBody2(this.body, t); + t && ((i = this.space.addConstraint(new cp.GearJoint(this.body,t,cr.to_radians(e),i))).typeName = "gear", + i.tag = s) + } + , + s.prototype.addRotaryLimitJoint = function(t, e, i, s) { + t = this.getBody2(this.body, t); + t && ((i = this.space.addConstraint(new cp.RotaryLimitJoint(this.body,t,cr.to_radians(e),cr.to_radians(i)))).typeName = "rotaryLimit", + i.tag = s) + } + , + s.prototype.addSimpleMotor = function(t, e, i) { + t = this.getBody2(this.body, t); + t && ((e = this.space.addConstraint(new cp.SimpleMotor(this.body,t,cr.to_radians(e)))).typeName = "motor", + e.tag = i) + } + , + s.prototype.destroyConnectedJoints = function() { + var e = this; + this.body.eachConstraint(function(t) { + e.space.removeConstraint(t) + }) + } + , + s.prototype.destroyJointAtTag = function(t) { + t = this.getJointHelper(t); + t && this.space.removeConstraint(t) + } + , + s.prototype.setMaxJointForceAtTag = function(t, e) { + e = this.getJointHelper(e); + e && (e.maxForce = t) + } + , + s.prototype.setJointProperty = function(t, e, i) { + var s = this.getJointHelper(i); + if (s) + switch (t) { + case 0: + "pin" === s.typeName && (s.dist = e); + break; + case 1: + "slide" === s.typeName && (s.min = e); + break; + case 2: + "slide" === s.typeName && (s.max = e); + break; + case 3: + "spring" === s.typeName ? s.restLength = e : "rotarySpring" === s.typeName && (s.restAngle = cr.to_radians(e)); + break; + case 4: + "spring" !== s.typeName && "rotarySpring" !== s.typeName || (s.stiffness = e); + break; + case 5: + "spring" !== s.typeName && "rotarySpring" !== s.typeName || (s.damping = e); + break; + case 6: + "rotaryLimit" === s.typeName && (s.min = cr.to_radians(e)); + break; + case 7: + "rotaryLimit" === s.typeName && (s.max = cr.to_radians(e)); + break; + case 8: + "ratchet" === s.typeName && (s.angle = cr.to_radians(e)); + break; + case 9: + "ratchet" === s.typeName && (s.phase = cr.to_radians(e)); + break; + case 10: + "ratchet" === s.typeName && (s.ratchet = cr.to_radians(e)); + break; + case 11: + "gear" === s.typeName && (s.phase = cr.to_radians(e)); + break; + case 12: + "gear" === s.typeName && (s.ratio = e); + break; + case 13: + "motor" === s.typeName && (s.rate = cr.to_radians(e)) + } + } + , + s.prototype.sleepWake = function(t) { + this.body.isRogue() || (t ? this.body.activate() : this.body.nodeIdleTime = 1 / 0) + } + , + s.prototype.ignoreCollision = function() { + this.Arbiter && this.Arbiter.ignore() + } + , + t.acts = new s, + r.prototype.velocityX = function(t) { + t.set_float(this.body.vx) + } + , + r.prototype.velocityY = function(t) { + t.set_float(this.body.vy) + } + , + r.prototype.speed = function(t) { + var e = this.body.vx + , i = this.body.vy; + t.set_float(Math.sqrt(e * e + i * i)) + } + , + r.prototype.angleOfMotion = function(t) { + t.set_float(cr.to_degrees(Math.atan2(this.body.vy, this.body.vx))) + } + , + r.prototype.angVel = function(t) { + t.set_float(cr.to_degrees(this.body.getAngVel())) + } + , + r.prototype.torque = function(t) { + t.set_float(cr.to_degrees(this.body.t)) + } + , + r.prototype.forceX = function(t) { + t.set_float(this.body.f.x) + } + , + r.prototype.forceY = function(t) { + t.set_float(this.body.f.y) + } + , + r.prototype.maxSpeed = function(t) { + t.set_float(this.body.v_limit) + } + , + r.prototype.maxAngSpeed = function(t) { + t.set_float(cr.to_degrees(this.body.w_limit)) + } + , + r.prototype.group = function(t) { + t.set_int(this.col_group) + } + , + r.prototype.layers = function(t) { + t.set_int(this.col_layers) + } + , + r.prototype.mass = function(t) { + this.immovable ? t.set_float(1 / 0) : t.set_float(this.body.m) + } + , + r.prototype.inertia = function(t) { + this.immovable || this.no_rotation ? t.set_float(1 / 0) : t.set_float(this.body.i) + } + , + r.prototype.elasticity = function(t) { + t.set_float(this.elasticity) + } + , + r.prototype.friction = function(t) { + t.set_float(this.friction) + } + , + r.prototype.segmentRadius = function(t) { + t.set_float(this.edgeRadius) + } + , + r.prototype.area = function(t) { + if (this.inst.tilemap_exists || 3 === this.col_shape) { + if (!this.total_poly_area) + for (var e = 0; e < this.shapes.length; ++e) + this.total_poly_area += cp.areaForPoly(this.shapes[e].verts); + t.set_float(this.total_poly_area) + } else { + var i; + if (0 != this.shapes.length) { + var s = this.shapes[0]; + switch (this.col_shape) { + case 0: + i = 0; + break; + case 1: + i = cp.areaForPoly(s.verts); + break; + case 3: + i = this.total_poly_area; + break; + case 2: + i = cp.areaForCircle(s.r, 0); + break; + case 4: + i = cp.areaForSegment(s.a, s.b, s.r) + } + t.set_float(i) + } else + t.set_float(0) + } + } + , + r.prototype.CoMx = function(t) { + t.set_float(this.body.getPos().x) + } + , + r.prototype.CoMy = function(t) { + t.set_float(this.body.getPos().y) + } + , + r.prototype.SpaceIterations = function(t) { + t.set_int(this.space.iterations) + } + , + r.prototype.SpaceDamping = function(t) { + t.set_float(this.space.damping) + } + , + r.prototype.SpaceTimestep = function(t) { + this.space.stepping_mode ? t.set_float(this.runtime.getDt(this.inst)) : t.set_float(this.space.fixed_step) + } + , + r.prototype.sleepTimeThreshold = function(t) { + t.set_float(this.space.sleepTimeThreshold) + } + , + r.prototype.idleSpeedThreshold = function(t) { + t.set_float(this.space.idleSpeedThreshold) + } + , + r.prototype.gravityX = function(t) { + t.set_float(this.space.gravity.x) + } + , + r.prototype.gravityY = function(t) { + t.set_float(this.space.gravity.y) + } + , + r.prototype.queryX = function(t) { + var e, i; + this.queryInfo ? (this.queryInfo.p || (e = this.queryInfo.p1, + i = this.queryInfo.p2, + this.queryInfo.p = this.queryInfo.hitPoint(e, i)), + t.set_float(this.queryInfo.p.x)) : t.set_float(0) + } + , + r.prototype.queryY = function(t) { + var e, i; + this.queryInfo ? (this.queryInfo.p || (e = this.queryInfo.p1, + i = this.queryInfo.p2, + this.queryInfo.p = this.queryInfo.hitPoint(e, i)), + t.set_float(this.queryInfo.p.y)) : t.set_float(0) + } + , + r.prototype.queryDist = function(t) { + var e, i; + this.queryInfo ? (this.queryInfo.d || (e = this.queryInfo.p1, + i = this.queryInfo.p2, + this.queryInfo.d = this.queryInfo.hitDist(e, i)), + t.set_float(this.queryInfo.d)) : t.set_float(0) + } + , + r.prototype.queryT = function(t) { + this.queryInfo && this.queryInfo.t ? t.set_float(this.queryInfo.t) : t.set_float(0) + } + , + r.prototype.queryNormX = function(t) { + this.queryInfo && this.queryInfo.n ? t.set_float(this.queryInfo.n.x) : t.set_float(0) + } + , + r.prototype.queryNormY = function(t) { + this.queryInfo && this.queryInfo.n ? t.set_float(this.queryInfo.n.y) : t.set_float(0) + } + , + r.prototype.jointCount = function(t) { + var e = 0; + this.body.eachConstraint(function(t) { + ++e + }), + t.set_int(e) + } + , + r.prototype.jointMaxForce = function(t, e) { + e = this.getJointHelper(e); + e ? t.set_float(e.maxForce) : t.set_float(0) + } + , + r.prototype.jointImpulse = function(t, e) { + e = this.getJointHelper(e); + e ? t.set_float(e.getImpulse()) : t.set_float(0) + } + , + r.prototype.jointOtherUID = function(t, e) { + e = this.getJointHelper(e); + e ? null == (e = e.a === this.body ? e.b : e.a).c2obj ? t.set_int(-1) : t.set_int(e.c2obj.inst.uid) : t.set_int(-2) + } + , + r.prototype.jointType = function(t, e) { + e = this.getJointHelper(e); + e ? t.set_string(e.typeName) : t.set_string("") + } + , + r.prototype.jointAnchorX = function(t, e) { + e = this.getJointHelper(e); + e && e.anchr2 ? this.body === e.a && "groove" != e.typeName ? (this.updateCOM(e.a), + t.set_float(e.a.local2World(e.anchr1).x)) : (e.b.c2obj && this.updateCOM(e.b), + t.set_float(e.b.local2World(e.anchr2).x)) : t.set_float(0) + } + , + r.prototype.jointAnchorY = function(t, e) { + e = this.getJointHelper(e); + e && e.anchr2 ? this.body === e.a && "groove" != e.typeName ? (this.updateCOM(e.a), + t.set_float(e.a.local2World(e.anchr1).y)) : (e.b.c2obj && this.updateCOM(e.b), + t.set_float(e.b.local2World(e.anchr2).y)) : t.set_float(0) + } + , + r.prototype.jointOtherAnchorX = function(t, e) { + e = this.getJointHelper(e); + e && e.anchr2 ? this.body === e.b && "groove" != e.typeName ? (this.updateCOM(e.a), + t.set_float(e.a.local2World(e.anchr1).x)) : (e.b.c2obj && this.updateCOM(e.b), + t.set_float(e.b.local2World(e.anchr2).x)) : t.set_float(0) + } + , + r.prototype.jointOtherAnchorY = function(t, e) { + e = this.getJointHelper(e); + e && e.anchr2 ? this.body === e.b && "groove" != e.typeName ? (this.updateCOM(e.a), + t.set_float(e.a.local2World(e.anchr1).y)) : (e.b.c2obj && this.updateCOM(e.b), + t.set_float(e.b.local2World(e.anchr2).y)) : t.set_float(0) + } + , + r.prototype.joint_PinDist = function(t, e) { + e = this.getJointHelper(e); + e && "pin" == e.typeName ? t.set_float(e.dist) : t.set_float(0) + } + , + r.prototype.joint_SlideMin = function(t, e) { + e = this.getJointHelper(e); + e && "slide" == e.typeName ? t.set_float(e.min) : t.set_float(0) + } + , + r.prototype.joint_SlideMax = function(t, e) { + e = this.getJointHelper(e); + e && "slide" == e.typeName ? t.set_float(e.max) : t.set_float(0) + } + , + r.prototype.joint_SpringRest = function(t, e) { + e = this.getJointHelper(e); + e ? "spring" == e.typeName ? t.set_float(e.restLength) : "rotarySpring" == e.typeName && t.set_float(cr.to_degrees(e.restAngle)) : t.set_float(0) + } + , + r.prototype.joint_SpringStiff = function(t, e) { + e = this.getJointHelper(e); + !e || "spring" != e.typeName && "rotarySpring" != e.typeName ? t.set_float(0) : t.set_float(e.stiffness) + } + , + r.prototype.joint_SpringDamp = function(t, e) { + e = this.getJointHelper(e); + !e || "spring" != e.typeName && "rotarySpring" != e.typeName ? t.set_float(0) : t.set_float(e.damping) + } + , + r.prototype.joint_RotaryLimitMin = function(t, e) { + e = this.getJointHelper(e); + e && "rotaryLimit" == e.typeName ? t.set_float(cr.to_degrees(e.min)) : t.set_float(0) + } + , + r.prototype.joint_RotaryLimitMax = function(t, e) { + e = this.getJointHelper(e); + e && "rotaryLimit" == e.typeName ? t.set_float(cr.to_degrees(e.max)) : t.set_float(0) + } + , + r.prototype.joint_RatchetAngle = function(t, e) { + e = this.getJointHelper(e); + e && "ratchet" == e.typeName ? t.set_float(cr.to_degrees(e.angle)) : t.set_float(0) + } + , + r.prototype.joint_RatchetPhase = function(t, e) { + e = this.getJointHelper(e); + e && "ratchet" == e.typeName ? t.set_float(cr.to_degrees(e.phase)) : t.set_float(0) + } + , + r.prototype.joint_RatchetRatchet = function(t, e) { + e = this.getJointHelper(e); + e && "ratchet" == e.typeName ? t.set_float(cr.to_degrees(e.ratchet)) : t.set_float(0) + } + , + r.prototype.joint_GearPhase = function(t, e) { + e = this.getJointHelper(e); + e && "gear" == e.typeName ? t.set_float(cr.to_degrees(e.phase)) : t.set_float(0) + } + , + r.prototype.joint_GearRatio = function(t, e) { + e = this.getJointHelper(e); + e && "gear" == e.typeName ? t.set_float(e.ratio) : t.set_float(0) + } + , + r.prototype.joint_MotorRate = function(t, e) { + e = this.getJointHelper(e); + e && "motor" == e.typeName ? t.set_float(cr.to_degrees(e.rate)) : t.set_float(0) + } + , + r.prototype.CollisionImpactX = function(t) { + var e; + this.Arbiter ? (e = this.Arbiter.swappedColl, + this.Arbiter.swappedColl = this.swapped, + t.set_float(this.Arbiter.totalImpulseWithFriction().x), + this.Arbiter.swappedColl = e) : t.set_float(0) + } + , + r.prototype.CollisionImpactY = function(t) { + var e; + this.Arbiter ? (e = this.Arbiter.swappedColl, + this.Arbiter.swappedColl = this.swapped, + t.set_float(this.Arbiter.totalImpulseWithFriction().y), + this.Arbiter.swappedColl = e) : t.set_float(0) + } + , + r.prototype.CollisionKE = function(t) { + this.Arbiter ? t.set_float(this.Arbiter.totalKE()) : t.set_float(0) + } + , + r.prototype.CollisionOtherObj = function(t) { + var e; + this.Arbiter ? (e = this.Arbiter.swappedColl, + this.Arbiter.swappedColl = this.swapped, + t.set_float(this.Arbiter.getB().body.c2obj.inst.uid), + this.Arbiter.swappedColl = e) : t.set_float(-1) + } + , + r.prototype.ContactCount = function(t) { + this.Arbiter ? t.set_float(this.Arbiter.contacts.length) : t.set_float(0) + } + , + r.prototype.ContactPointX = function(t, e) { + this.Arbiter && 0 <= e && e < this.Arbiter.contacts.length ? t.set_float(this.Arbiter.getPoint(e).x) : t.set_float(0) + } + , + r.prototype.ContactPointY = function(t, e) { + this.Arbiter && 0 <= e && e < this.Arbiter.contacts.length ? t.set_float(this.Arbiter.getPoint(e).y) : t.set_float(0) + } + , + r.prototype.ContactNormX = function(t, e) { + var i; + this.Arbiter && 0 <= e && e < this.Arbiter.contacts.length ? (i = this.Arbiter.swappedColl, + this.Arbiter.swappedColl = this.swapped, + t.set_float(this.Arbiter.getNormal(e).x), + this.Arbiter.swappedColl = i) : t.set_float(0) + } + , + r.prototype.ContactNormY = function(t, e) { + var i; + this.Arbiter && 0 <= e && e < this.Arbiter.contacts.length ? (i = this.Arbiter.swappedColl, + this.Arbiter.swappedColl = this.swapped, + t.set_float(this.Arbiter.getNormal(e).y), + this.Arbiter.swappedColl = i) : t.set_float(0) + } + , + r.prototype.ContactDepth = function(t, e) { + this.Arbiter && 0 <= e && e < this.Arbiter.contacts.length ? t.set_float(this.Arbiter.getDepth(e)) : t.set_float(0) + } + , + r.prototype.world2LocalX = function(t, e, i) { + t.set_float(this.body.world2Local(cp.v(e, i)).x) + } + , + r.prototype.world2LocalY = function(t, e, i) { + t.set_float(this.body.world2Local(cp.v(e, i)).y) + } + , + r.prototype.local2WorldX = function(t, e, i) { + t.set_float(this.body.local2World(cp.v(e, i)).x) + } + , + r.prototype.local2WorldY = function(t, e, i) { + t.set_float(this.body.local2World(cp.v(e, i)).y) + } + , + t.exps = new r +}(), +cr.behaviors.scrollto = function(t) { + this.runtime = t, + this.shakeMag = 0, + this.shakeStart = 0, + this.shakeEnd = 0, + this.shakeMode = 0 +} +, +function() { + var t = cr.behaviors.scrollto.prototype; + t.Type = function(t, e) { + this.behavior = t, + this.objtype = e, + this.runtime = t.runtime + } + , + t.Type.prototype.onCreate = function() {} + , + t.Instance = function(t, e) { + this.type = t, + this.behavior = t.behavior, + this.inst = e, + this.runtime = t.runtime + } + ; + var e = t.Instance.prototype; + function i() {} + e.onCreate = function() { + this.enabled = 0 !== this.properties[0] + } + , + e.saveToJSON = function() { + return { + smg: this.behavior.shakeMag, + ss: this.behavior.shakeStart, + se: this.behavior.shakeEnd, + smd: this.behavior.shakeMode + } + } + , + e.loadFromJSON = function(t) { + this.behavior.shakeMag = t.smg, + this.behavior.shakeStart = t.ss, + this.behavior.shakeEnd = t.se, + this.behavior.shakeMode = t.smd + } + , + e.tick = function() {} + , + e.tick2 = function() { + if (this.enabled) { + for (var t, e = this.behavior.my_instances.valuesRef(), i = 0, s = 0, n = 0, r = 0, o = e.length; r < o; r++) + (t = function(t) { + for (var e, i = 0, s = t.behavior_insts.length; i < s; ++i) + if ((e = t.behavior_insts[i]).behavior instanceof cr.behaviors.scrollto) + return e; + return null + }(e[r])) && t.enabled && (i += e[r].x, + s += e[r].y, + ++n); + var a, h = this.inst.layer.layout, c = this.runtime.kahanTime.sum, l = 0, u = 0; + c >= this.behavior.shakeStart && c < this.behavior.shakeEnd && (a = this.behavior.shakeMag * Math.min(this.runtime.timescale, 1), + 0 === this.behavior.shakeMode && (a *= 1 - (c - this.behavior.shakeStart) / (this.behavior.shakeEnd - this.behavior.shakeStart)), + c = Math.random() * Math.PI * 2, + a = Math.random() * a, + l = Math.cos(c) * a, + u = Math.sin(c) * a), + h.scrollToX(i / n + l), + h.scrollToY(s / n + u) + } + } + , + i.prototype.Shake = function(t, e, i) { + this.behavior.shakeMag = t, + this.behavior.shakeStart = this.runtime.kahanTime.sum, + this.behavior.shakeEnd = this.behavior.shakeStart + e, + this.behavior.shakeMode = i + } + , + i.prototype.SetEnabled = function(t) { + this.enabled = 0 !== t + } + , + t.acts = new i +}(), +cr.getObjectRefTable = function() { + return [cr.plugins_.Arr, cr.plugins_.Audio, cr.plugins_.Browser, cr.plugins_.Function, cr.plugins_.Keyboard, cr.plugins_.vooxe, cr.plugins_.Particles, cr.plugins_.LocalStorage, cr.plugins_.Mouse, cr.plugins_.Sprite, cr.plugins_.SpriteFontPlus, cr.plugins_.Text, cr.plugins_.Touch, cr.plugins_.TiledBg, cr.behaviors.Pin, cr.behaviors.Rotate, cr.behaviors.Sin, cr.behaviors.Flash, cr.behaviors.scrollto, cr.behaviors.rojoChipmunkBeta, cr.behaviors.Fade, cr.behaviors.Rex_Spline, cr.behaviors.lunarray_LiteTween, cr.system_object.prototype.cnds.IsGroupActive, cr.system_object.prototype.cnds.OnLayoutStart, cr.plugins_.Sprite.prototype.acts.Destroy, cr.plugins_.Function.prototype.acts.CallFunction, cr.system_object.prototype.cnds.CompareVar, cr.plugins_.vooxe.prototype.acts.InitAds, cr.system_object.prototype.acts.SetVar, cr.plugins_.Function.prototype.cnds.OnFunction, cr.plugins_.LocalStorage.prototype.acts.GetItem, cr.plugins_.LocalStorage.prototype.cnds.OnAnyItemGet, cr.system_object.prototype.cnds.Compare, cr.plugins_.LocalStorage.prototype.exps.Key, cr.plugins_.LocalStorage.prototype.exps.ItemValue, cr.system_object.prototype.exps.int, cr.system_object.prototype.cnds.Else, cr.plugins_.Function.prototype.exps.Param, cr.system_object.prototype.cnds.Repeat, cr.plugins_.Arr.prototype.acts.SetX, cr.system_object.prototype.exps.loopindex, cr.system_object.prototype.exps.tokenat, cr.plugins_.Arr.prototype.exps.At, cr.plugins_.LocalStorage.prototype.acts.SetItem, cr.plugins_.Text.prototype.acts.SetText, cr.system_object.prototype.exps.clamp, cr.system_object.prototype.exps.infinity, cr.system_object.prototype.exps.layoutname, cr.system_object.prototype.exps.viewportright, cr.system_object.prototype.exps.viewportleft, cr.system_object.prototype.exps.viewportbottom, cr.system_object.prototype.exps.viewporttop, cr.plugins_.Sprite.prototype.acts.SetPos, cr.plugins_.Arr.prototype.acts.SetSize, cr.plugins_.Arr.prototype.acts.Push, cr.system_object.prototype.cnds.For, cr.system_object.prototype.exps.random, cr.plugins_.Arr.prototype.exps.Width, cr.plugins_.Arr.prototype.acts.Delete, cr.system_object.prototype.acts.AddVar, cr.system_object.prototype.acts.CreateObject, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, cr.plugins_.Sprite.prototype.acts.SetInstanceVar, cr.plugins_.Sprite.prototype.cnds.CompareFrame, cr.plugins_.Sprite.prototype.exps.ImagePointX, cr.plugins_.Sprite.prototype.exps.ImagePointY, cr.plugins_.Sprite.prototype.cnds.CompareInstanceVar, cr.system_object.prototype.exps.choose, cr.plugins_.Browser.prototype.acts.ConsoleLog, cr.plugins_.Sprite.prototype.exps.UID, cr.plugins_.Function.prototype.cnds.CompareParam, cr.plugins_.Sprite.prototype.acts.SetScale, cr.plugins_.Sprite.prototype.exps.Width, cr.plugins_.Sprite.prototype.exps.Height, cr.behaviors.Sin.prototype.acts.UpdateInitialState, cr.behaviors.Pin.prototype.acts.Pin, cr.plugins_.Sprite.prototype.cnds.PickByUID, cr.plugins_.Sprite.prototype.acts.SetBoolInstanceVar, cr.plugins_.Sprite.prototype.cnds.IsBoolInstanceVarSet, cr.behaviors.rojoChipmunkBeta.prototype.cnds.isDisabled, cr.behaviors.rojoChipmunkBeta.prototype.acts.disablePhysics, cr.plugins_.Sprite.prototype.acts.Spawn, cr.plugins_.Sprite.prototype.acts.SetAngle, cr.plugins_.Sprite.prototype.exps.Angle, cr.plugins_.Sprite.prototype.acts.SetY, cr.plugins_.Sprite.prototype.exps.Y, cr.system_object.prototype.exps.dt, cr.plugins_.Sprite.prototype.acts.SetOpacity, cr.plugins_.Sprite.prototype.exps.Opacity, cr.plugins_.Sprite.prototype.cnds.CompareOpacity, cr.plugins_.Sprite.prototype.acts.MoveToLayer, cr.plugins_.Sprite.prototype.acts.MoveToBottom, cr.plugins_.Sprite.prototype.exps.X, cr.system_object.prototype.exps.scrollx, cr.system_object.prototype.exps.scrolly, cr.system_object.prototype.exps.distance, cr.system_object.prototype.exps.angle, cr.plugins_.Sprite.prototype.acts.StopAnim, cr.behaviors.Rex_Spline.prototype.acts.CleanAll, cr.behaviors.Rex_Spline.prototype.acts.AddPoint, cr.system_object.prototype.exps.cos, cr.system_object.prototype.exps.sin, cr.behaviors.Rex_Spline.prototype.acts.Start, cr.behaviors.Fade.prototype.acts.StartFade, cr.behaviors.Rex_Spline.prototype.cnds.OnHitTarget, cr.system_object.prototype.cnds.ForEach, cr.plugins_.Sprite.prototype.acts.MoveAtAngle, cr.plugins_.Sprite.prototype.cnds.IsOverlappingOffset, cr.system_object.prototype.acts.Scroll, cr.system_object.prototype.exps.layoutheight, cr.plugins_.Browser.prototype.acts.ExecJs, cr.system_object.prototype.acts.Wait, cr.plugins_.Text.prototype.acts.Destroy, cr.plugins_.TiledBg.prototype.acts.Destroy, cr.plugins_.TiledBg.prototype.acts.SetInstanceVar, cr.plugins_.TiledBg.prototype.acts.SetSize, cr.plugins_.TiledBg.prototype.acts.SetAngle, cr.plugins_.Text.prototype.acts.SetInstanceVar, cr.plugins_.TiledBg.prototype.cnds.CompareInstanceVar, cr.plugins_.Text.prototype.cnds.CompareInstanceVar, cr.plugins_.Sprite.prototype.acts.SetSize, cr.plugins_.Text.prototype.acts.SetFontSize, cr.system_object.prototype.cnds.Every, cr.system_object.prototype.acts.SubVar, cr.system_object.prototype.acts.SetLayerEffectParam, cr.plugins_.Audio.prototype.acts.Play, cr.plugins_.Audio.prototype.acts.SetPaused, cr.plugins_.Audio.prototype.acts.PlayByName, cr.plugins_.Particles.prototype.acts.Destroy, cr.behaviors.lunarray_LiteTween.prototype.acts.SetTarget, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, cr.behaviors.lunarray_LiteTween.prototype.acts.Reverse, cr.plugins_.Sprite.prototype.acts.AddInstanceVar, cr.system_object.prototype.exps.lerp, cr.plugins_.Sprite.prototype.cnds.CompareWidth, cr.behaviors.lunarray_LiteTween.prototype.cnds.OnEnd, cr.system_object.prototype.acts.SetLayerOpacity, cr.system_object.prototype.exps.layeropacity, cr.system_object.prototype.acts.SetLayerScale, cr.system_object.prototype.cnds.LayerCmpOpacity, cr.system_object.prototype.acts.SetLayerVisible, cr.plugins_.Sprite.prototype.acts.SetVisible, cr.plugins_.Mouse.prototype.cnds.IsOverObject, cr.plugins_.Mouse.prototype.acts.SetCursor, cr.plugins_.Touch.prototype.cnds.OnTouchObject, cr.plugins_.Touch.prototype.cnds.OnTouchEnd, cr.system_object.prototype.exps.ceil, cr.plugins_.Text.prototype.acts.SetFontColor, cr.system_object.prototype.exps.rgb, cr.plugins_.Text.prototype.acts.SetEffectParam, cr.plugins_.Sprite.prototype.acts.SetMirrored, cr.plugins_.TiledBg.prototype.exps.Count, cr.behaviors.Sin.prototype.acts.SetActive, cr.plugins_.TiledBg.prototype.acts.SetBoolInstanceVar, cr.plugins_.TiledBg.prototype.acts.SetEffectParam, cr.plugins_.Sprite.prototype.acts.SetX, cr.plugins_.TiledBg.prototype.cnds.PickByUID, cr.behaviors.Pin.prototype.acts.Unpin, cr.behaviors.rojoChipmunkBeta.prototype.acts.setVelocity, cr.plugins_.TiledBg.prototype.cnds.IsBoolInstanceVarSet, cr.plugins_.TiledBg.prototype.acts.SubInstanceVar, cr.plugins_.TiledBg.prototype.acts.SetWidth, cr.system_object.prototype.cnds.TriggerOnce, cr.behaviors.Flash.prototype.acts.Flash, cr.plugins_.TiledBg.prototype.exps.UID, cr.plugins_.Sprite.prototype.acts.SetAnim, cr.plugins_.Arr.prototype.cnds.CompareX, cr.plugins_.Text.prototype.exps.UID, cr.plugins_.Text.prototype.cnds.PickByUID, cr.behaviors.rojoChipmunkBeta.prototype.acts.setFixedTimestep, cr.behaviors.rojoChipmunkBeta.prototype.acts.setGravity, cr.plugins_.Arr.prototype.acts.SetXY, cr.behaviors.rojoChipmunkBeta.prototype.acts.setCollisionShape, cr.behaviors.rojoChipmunkBeta.prototype.acts.addGrooveJoint, cr.behaviors.rojoChipmunkBeta.prototype.acts.addDampedSpring, cr.plugins_.Sprite.prototype.acts.SetHeight, cr.behaviors.rojoChipmunkBeta.prototype.acts.applyForceAt, cr.system_object.prototype.cnds.IsMobile, cr.plugins_.Keyboard.prototype.cnds.IsKeyDown, cr.system_object.prototype.exps.abs, cr.behaviors.rojoChipmunkBeta.prototype.exps.speed, cr.plugins_.Sprite.prototype.cnds.PickDistance, cr.plugins_.Sprite.prototype.cnds.IsOverlapping, cr.plugins_.Sprite.prototype.cnds.IsBetweenAngles, cr.behaviors.rojoChipmunkBeta.prototype.exps.velocityY, cr.behaviors.rojoChipmunkBeta.prototype.exps.velocityX, cr.plugins_.Sprite.prototype.cnds.IsVisible, cr.plugins_.Sprite.prototype.cnds.CompareX, cr.plugins_.Sprite.prototype.cnds.IsOnScreen, cr.plugins_.Sprite.prototype.cnds.OnCollision, cr.behaviors.rojoChipmunkBeta.prototype.cnds.onPostCollide, cr.behaviors.rojoChipmunkBeta.prototype.exps.CollisionOtherObj, cr.behaviors.rojoChipmunkBeta.prototype.acts.setImmovable, cr.behaviors.rojoChipmunkBeta.prototype.acts.applyImpulseAt, cr.system_object.prototype.exps.max, cr.behaviors.rojoChipmunkBeta.prototype.exps.CollisionKE, cr.behaviors.rojoChipmunkBeta.prototype.exps.ContactPointX, cr.behaviors.rojoChipmunkBeta.prototype.exps.ContactCount, cr.behaviors.rojoChipmunkBeta.prototype.exps.ContactPointY, cr.system_object.prototype.cnds.EveryTick, cr.plugins_.Sprite.prototype.acts.SubInstanceVar, cr.plugins_.Particles.prototype.acts.SetAngle, cr.plugins_.Touch.prototype.cnds.OnTouchStart, cr.plugins_.Text.prototype.exps.X, cr.plugins_.Text.prototype.exps.Y, cr.plugins_.Text.prototype.acts.MoveToBottom, cr.system_object.prototype.exps.loadingprogress, cr.system_object.prototype.acts.GoToLayout, cr.plugins_.vooxe.prototype.cnds.onInit, cr.plugins_.vooxe.prototype.acts.ShowBanner, cr.plugins_.vooxe.prototype.cnds.onError, cr.plugins_.vooxe.prototype.cnds.onResumeGame, cr.system_object.prototype.acts.SetTimescale, cr.plugins_.Audio.prototype.acts.SetSilent, cr.system_object.prototype.exps.uppercase, cr.plugins_.Arr.prototype.cnds.CompareXY, cr.system_object.prototype.cnds.IsPreview, cr.plugins_.Sprite.prototype.acts.LoadURL, cr.plugins_.Sprite.prototype.cnds.OnURLLoaded] +} +; diff --git a/games/eggy-car/changaone_regular.ttf b/games/eggy-car/changaone_regular.ttf new file mode 100644 index 00000000..360397f8 --- /dev/null +++ b/games/eggy-car/changaone_regular.ttf @@ -0,0 +1 @@ +No Content: https://webglmath.github.io/eggy-car/changaone_regular.ttf \ No newline at end of file diff --git a/games/eggy-car/data.js b/games/eggy-car/data.js new file mode 100644 index 00000000..f617ee49 --- /dev/null +++ b/games/eggy-car/data.js @@ -0,0 +1 @@ +{"project": [null,"loaderlayout",[[0,false,false,false,false,false,false,false,false,false],[1,true,false,false,false,false,false,false,false,false],[2,true,false,false,false,false,false,false,false,false],[3,true,false,false,false,false,false,false,false,false],[4,true,false,false,false,false,false,false,false,false],[5,true,false,false,false,false,false,false,false,false],[6,false,true,true,false,true,true,true,true,true],[7,true,false,false,false,false,false,false,false,false],[8,true,false,false,false,false,false,false,false,false],[9,false,true,true,true,true,true,true,true,false],[10,false,true,true,true,true,true,true,true,true],[11,false,true,true,true,true,true,true,true,false],[12,true,false,false,false,false,false,false,false,false],[13,false,true,true,true,true,true,true,true,true]],[["t0",3,false,[],0,0,null,null,[],false,false,466165392372602,[],null,[]],["t1",12,false,[],0,0,null,null,[],false,false,517596698340237,[],null,[1]],["t2",4,false,[],0,0,null,null,[],false,false,154371745714877,[],null,[]],["t3",9,false,[939242505359876,678048934722792,990849584957206,680912114542905,138851308707390,688209092685894,787263476954717,848333068193907,682272672483769,851819424728570,392347966618527,498921876391339,482364165404074,518136694416169,496055965916613,451409918651197],0,0,null,[["Default",0,false,0,0,false,618043342441650,[["images/car_0-sheet0.png",15299,236,222,209,103,1,0.5023923516273499,0.7281553149223328,[["tyre_0",0.7655502557754517,1.019417524337769],["tyre_1",0.2392344474792481,1.019417524337769],["shaft_0",0.7655502557754517,0.8252426981925964],["shaft_1",0.2392344474792481,0.8252426981925964]],[-0.368421345949173,-0.7281553149223328,-0.3110043406486511,-0.7281553149223328,-0.3110043406486511,-0.4466023147106171,0.2057416439056397,-0.4466023147106171,0.2057416439056397,-0.7281553149223328,0.2631576657295227,-0.7281553149223328,0.2631576657295227,-0.3398053050041199,0.4593296647071838,-0.1990293264389038,0.3361246585845947,-0.1262133121490479,0.1955746412277222,-0.1237863302230835,0.1291866302490234,-0.04611629247665405,0.08821767568588257,0.03883469104766846,0.04485666751861572,0.2014566659927368,-0.09008634090423584,0.1990286707878113,-0.1113933622837067,0.02351367473602295,-0.1552033424377441,-0.08100730180740356,-0.2547853589057922,-0.1347083449363709,-0.3564593493938446,-0.1067953109741211,-0.4055025577545166,0.0142596960067749,-0.4712920486927033,-0.04915028810501099,-0.368421345949173,-0.3398053050041199],0],["images/car_0-sheet0.png",15299,1,181,233,95,1,0.5021459460258484,0.7263157963752747,[["tyre_0",0.7381974458694458,1.073684215545654],["tyre_1",0.2575107216835022,1.073684215545654],["shaft_0",0.7381974458694458,0.8736842274665833],["shaft_1",0.2575107216835022,0.8736842274665833]],[-0.3004289269447327,-0.7263157963752747,-0.2403429448604584,-0.7263157963752747,-0.2403429448604584,-0.4631578028202057,0.2188840508460999,-0.4631578028202057,0.2188840508460999,-0.7263157963752747,0.2789700627326965,-0.7263157963752747,0.2789700627326965,-0.3578948080539703,0.306954026222229,-0.3098238110542297,0.4229210615158081,-0.3091208040714264,0.4595760703086853,-0.1971898078918457,0.3685600757598877,0.0598372220993042,0.3090150356292725,-0.08894979953765869,0.2301560640335083,-0.1193147897720337,0.1594760417938232,-0.060066819190979,0.1099230647087097,0.04067420959472656,0.09338706731796265,0.1690852046012878,-0.09842395782470703,0.1771841645240784,-0.1637219488620758,-0.06412076950073242,-0.2332829535007477,-0.123904824256897,-0.3114059567451477,-0.08286881446838379,-0.3744529485702515,0.03188717365264893,-0.4943119287490845,0.02136319875717163,-0.4940860569477081,-0.1618927717208862,-0.4573794603347778,-0.1662008166313171,-0.433322548866272,-0.3116587996482849,-0.3347799479961395,-0.3104687929153442,-0.3004289269447327,-0.3578948080539703],0],["images/car_0-sheet0.png",15299,1,1,326,84,1,0.5030674934387207,0.726190447807312,[["tyre_0",0.7668711543083191,1.071428537368774],["tyre_1",0.3680981695652008,1.071428537368774],["shaft_0",0.7668711543083191,0.8333333134651184],["shaft_1",0.3680981695652008,0.8333333134651184]],[-0.3506914973258972,-0.726190447807312,-0.3159505128860474,-0.7232142686843872,-0.3159505128860474,-0.3809524476528168,0.09815949201583862,-0.3809524476528168,0.09815949201583862,-0.499999463558197,0.1380364894866943,-0.5000004768371582,0.1380364894866943,-0.4285714626312256,0.2838075160980225,-0.3399214446544647,0.4213395118713379,-0.0617484450340271,0.3926374912261963,0.05675053596496582,0.3631734848022461,-0.03571343421936035,0.3176044821739197,-0.05146247148513794,0.2400025129318237,-0.2483964562416077,0.1662344932556152,-0.2578304409980774,0.09845453500747681,-0.09217542409896851,0.06105250120162964,0.1558025479316711,-0.001804471015930176,0.1503985524177551,-0.02924647927284241,-0.06380742788314819,-0.08872750401496887,-0.2276744544506073,-0.1896204948425293,-0.2367804348468781,-0.2401784956455231,-0.09547644853591919,-0.2784664928913117,0.1321375370025635,-0.3116654753684998,0.1312125325202942,-0.3118894994258881,-0.04530644416809082,-0.4906837940216065,-0.08001744747161865,-0.5023006200790405,-0.1177034378051758,-0.5030674934387207,-0.5531374216079712,-0.4520221054553986,-0.5915754437446594,-0.4255164861679077,-0.7014415264129639,-0.3575934767723084,-0.6295071244239807],0],["images/car_0-sheet0.png",15299,1,87,290,92,1,0.5034482479095459,0.72826087474823,[["tyre_0",0.7931034564971924,1.08695650100708],["tyre_1",0.1724137961864471,1.08695650100708],["shaft_0",0.7931034564971924,0.8695651888847351],["shaft_1",0.1724137961864471,0.8695651888847351]],[-0.4862068593502045,-0.5652178525924683,-0.4448275566101074,-0.5733698606491089,-0.4448275566101074,-0.2608698606491089,0.1172417402267456,-0.2608698606491089,0.1172417402267456,-0.5652178525924683,0.1586207747459412,-0.5652178525924683,0.1586207747459412,-0.72826087474823,0.4724137783050537,-0.72826087474823,0.4741377234458923,-0.2663048803806305,0.4720957279205322,-0.07065290212631226,0.4475067257881165,0.03872913122177124,0.4090157747268677,-0.1625688672065735,0.3013327717781067,-0.3270238637924194,0.1936497688293457,-0.2088698744773865,0.1635527610778809,-0.02142184972763062,0.1162147521972656,0.1198291182518005,-0.07648724317550659,0.1168481111526489,-0.111587256193161,-0.04452687501907349,-0.1743622422218323,-0.1870908737182617,-0.2834272384643555,-0.2000318765640259,-0.3738942444324493,-0.1911398768424988,-0.4272481501102448,-0.04834586381912231,-0.4473479390144348,0.2010871171951294,-0.4862068593502045,0.1956521272659302],0],["images/car_0-sheet0.png",15299,293,87,198,133,1,0.5,0.7293233275413513,[["tyre_0",0.7676767706871033,1.052631616592407],["tyre_1",0.2373737394809723,1.052631616592407],["shaft_0",0.7676767706871033,0.902255654335022],["shaft_1",0.2373737394809723,0.902255654335022]],[-0.4292929172515869,-0.7293233275413513,-0.3636360168457031,-0.7293233275413513,-0.3636360168457031,-0.5187973380088806,0.3585860133171082,-0.5187973380088806,0.3585860133171082,-0.7293233275413513,0.4242420196533203,-0.7293233275413513,0.4242420196533203,-0.4360903203487396,0.4646459817886353,-0.4370303153991699,0.4635159969329834,-0.3379073143005371,0.4132279753684998,-0.3354213237762451,0.4677370190620422,-0.1722203493118286,0.3719930052757263,-0.10958331823349,0.197966992855072,-0.1249543428421021,0.1315789818763733,-0.04728430509567261,0.09061002731323242,0.0376666784286499,0.04346102476119995,0.1589356660842896,-0.04476499557495117,0.1621466875076294,-0.09006199240684509,0.01858669519424439,-0.1528109908103943,-0.08217531442642212,-0.2523930072784424,-0.1358763575553894,-0.3540669977664948,-0.1079633235931397,-0.4712919890880585,0.04316669702529907,-0.4651117920875549,-0.441295325756073,-0.4278976917266846,-0.4387173354625702],0]]]],[],false,false,471903250143268,[],null],["t4",9,false,[758674793871285,931473615217218,407429057905417],0,0,null,[["Default",0,false,0,0,false,911625296707744,[["images/car_0_tyre-sheet1.png",1196,0,0,60,60,1,0.5,0.5,[["Imagepoint 1",0.5,0.5]],[-0.3499999940395355,-0.3499999940395355,0,-0.5,0.3500000238418579,-0.3499999940395355,0.5,0,0.3500000238418579,0.3500000238418579,0,0.5,-0.3499999940395355,0.3500000238418579,-0.5,0],0],["images/car_0_tyre-sheet0.png",1651,0,0,62,62,1,0.5,0.5,[],[-0.29032301902771,-0.29032301902771,0,-0.5,0.29032301902771,-0.29032301902771,0.5,0,0.29032301902771,0.29032301902771,0,0.5,-0.29032301902771,0.29032301902771,-0.5,0],0]]]],[],false,false,942833713890079,[],null],["t5",9,false,[254599962372085,173788934016196,952153190905389],0,0,null,[["Default",0,false,0,0,false,911252239720661,[["images/a_egg-sheet0.png",5602,0,0,100,130,1,0.5099999904632568,0.5076923370361328,[],[-0.3224999904632568,-0.3631143569946289,-0.2092189788818359,-0.4594995379447937,-0.009999990463256836,-0.4956441521644592,0.1774999499320984,-0.4474513530731201,0.2868750095367432,-0.3510653376579285,0.4196879863739014,-0.2004633247852325,0.4743750095367432,-0.01371634006500244,0.4509379863739014,0.2302596569061279,0.3337500095367432,0.371825635433197,0.1540629863739014,0.4651986360549927,-0.04320299625396729,0.4892956614494324,-0.2170310020446777,0.4501396417617798,-0.3771869838237763,0.3658016920089722,-0.4787499904632568,0.2272476553916931,-0.4943749904632568,-0.01371634006500244,-0.4357811808586121,-0.1974513232707977],0]]]],[],false,false,571818538741793,[],null],["t6",9,false,[640929515728473,731547919224874,109213957815732],0,0,null,[["Default",0,false,0,0,false,243396524536528,[["images/a_track-sheet5.png",133012,1,456,1536,452,1,0,1,[["right",1,0],["power_up",0.9674479365348816,0.1526548713445664],["coin_p0",0.4329427182674408,-0.008849557489156723],["coin_p1",0.4778645932674408,-0.06194690242409706],["coin_p2",0.5240885615348816,-0.09292035549879074],["coin_p3",0.5794270634651184,-0.1194690242409706],["coin_p4",0.0846354141831398,0.6703540086746216],["coin_p5",0.6861979365348816,-0.08407079428434372]],[],0],["images/a_track-sheet1.png",251838,1,1269,1536,603,1,0,1,[["right",1,0.2470978498458862],["coin_p0",0.4329427182674408,-0.008291874080896378],["coin_p1",0.4778645932674408,-0.06135986745357513],["coin_p2",0.5240885615348816,-0.09286899119615555],["coin_p3",0.5794270634651184,-0.1194029822945595],["coin_p4",0.63671875,-0.1028192341327667],["coin_p5",0.6861979365348816,-0.08457711338996887],["coin_p6",0.73046875,-0.05804311856627464],["power_up",0.9674479365348816,0.1525704860687256]],[0,-0.7512440085411072,0.303386002779007,-0.7512440085411072,0.3417159914970398,-0.7684490084648132,0.3735350072383881,-0.8005800247192383,0.406576007604599,-0.8615260124206543,0.4394530057907105,-0.9170812964439392,0.4788410067558289,-0.9552239179611206,0.5258790254592896,-0.9842454195022583,0.5734869837760925,-1,0.6226810216903687,-1,0.6655070185661316,-0.9842454195022583,0.7084400057792664,-0.9568822979927063,0.7565810084342957,-0.9063019156455994,0.8203480243682861,-0.8316749930381775,0.8725759983062744,-0.7815089821815491,0.9167569875717163,-0.7572550177574158,0.9362429976463318,-0.7525910139083862,1,-0.7512440085411072,1,0,0,0],0],["images/a_track-sheet3.png",208604,1,1,1536,580,1,0,1,[["right",1,0.2172413766384125],["power_up",0.912109375,0.1275862008333206],["coin_p0",0.255859375,-0.105172410607338],["coin_p1",0.2981770932674408,-0.1258620619773865],["coin_p2",0.3430989682674408,-0.1293103396892548],["coin_p3",0.3860677182674408,-0.1034482792019844],["coin_p4",0.4264322817325592,-0.07068965584039688]],[0,-0.7793099880218506,0.02311190031468868,-0.7775859832763672,0.05631500110030174,-0.7898709774017334,0.09033189713954926,-0.8197200298309326,0.1206870004534721,-0.8691270351409912,0.1679690033197403,-0.9288793206214905,0.2109380066394806,-0.9644396305084229,0.2439779937267304,-0.9849677085876465,0.2792969942092896,-0.9994611740112305,0.3178710043430328,-1,0.3450930118560791,-0.9961207509040833,0.3749389946460724,-0.9862070083618164,0.4023540019989014,-0.971336305141449,0.4234670102596283,-0.954525887966156,0.4460450112819672,-0.9250000715255737,0.483927994966507,-0.8534480333328247,0.5262349843978882,-0.7721980214118958,0.5510510206222534,-0.741055965423584,0.5704960227012634,-0.7288789749145508,0.5854889750480652,-0.727774977684021,0.6025059819221497,-0.7354120016098023,0.6195600032806397,-0.7523770332336426,0.6378530263900757,-0.7811189889907837,0.6622989773750305,-0.8327739834785461,0.6815369725227356,-0.8844289779663086,0.6947389841079712,-0.9259967803955078,0.7087460160255432,-0.9416083097457886,0.7300770282745361,-0.9524784088134766,0.7631940245628357,-0.9553878903388977,0.7910209894180298,-0.9464439749717712,0.8101019859313965,-0.934967577457428,0.8239150047302246,-0.919638991355896,0.8357909917831421,-0.8964099884033203,0.855804979801178,-0.8214570283889771,0.8702849745750427,-0.7900390028953552,0.8859890103340149,-0.7777780294418335,0.9491789937019348,-0.7750959992408752,1,-0.7793099880218506,1,0,0,0],0],["images/a_track-sheet1.png",251838,1,657,1536,610,1,0,1,[["right",1,0.2606557309627533],["power_up",0.9322916865348816,0.1426229476928711],["coin_p0",0.4329427182674408,-0.08360655605792999],["coin_p1",0.4811197817325592,-0.07704918086528778],["coin_p2",0.5240885615348816,-0.03934426233172417],["coin_p3",0.5690104365348816,0.0114754093810916],["coin_p4",0.6061198115348816,0.07704918086528778],["coin_p5",0.6861979365348816,-0.08524589985609055]],[0.1126300022006035,-0.7450820207595825,0.1542969942092896,-0.7733609676361084,0.2029619961977005,-0.8133199810981751,0.2333170026540756,-0.8460040092468262,0.2683509886264801,-0.899232029914856,0.2870079874992371,-0.9360911846160889,0.3039860129356384,-0.9596439003944397,0.3243559896945953,-0.9785925149917603,0.350492000579834,-0.9897060990333557,0.3946470022201538,-0.9969022274017334,0.4178639948368073,-0.9984511137008667,0.4573040008544922,-1,0.4793030023574829,-0.987704873085022,0.5104169845581055,-0.9602459073066711,0.5447589755058289,-0.9180328249931335,0.5871580243110657,-0.8418030142784119,0.6106359958648682,-0.7864750027656555,0.6350709795951843,-0.7465159893035889,0.6603090167045593,-0.7207989692687988,0.6825309991836548,-0.7103999853134155,0.6958469748497009,-0.7093049883842468,0.7120940089225769,-0.7151769995689392,0.7270380258560181,-0.7261719703674316,0.7488330006599426,-0.7468340396881104,0.7859339714050293,-0.7620819807052612,0.8272680044174194,-0.7752820253372192,0.8678169846534729,-0.767969012260437,0.9422199726104736,-0.7467210292816162,1,-0.7393440008163452,1,0,0,0,0,-0.7393440008163452],0],["images/a_track-sheet4.png",281708,1,486,1536,460,1,0,1,[["right",1,0.01739130355417728],["power_up",0.31640625,0.1304347813129425],["coin_p0",0.564453125,0.4000000059604645],["coin_p1",0.5970051884651184,0.332608699798584],["coin_p2",0.626953125,0.258695662021637],["coin_p3",0.6555989384651184,0.176086962223053],["coin_p4",0.6868489384651184,0.1086956486105919],["coin_p5",0.7174479365348816,0.04347826167941093]],[0,-0.9826086759567261,0.04833979904651642,-0.9885869026184082,0.06770829856395721,-0.9967391490936279,0.09488929808139801,-0.988043487071991,0.1321620047092438,-0.9853261113166809,0.1503860056400299,-0.97605299949646,0.1740649938583374,-0.9442424774169922,0.2003480046987534,-0.8917800188064575,0.2173510044813156,-0.8528870344161987,0.2905069887638092,-0.7335599660873413,0.3104430139064789,-0.7101730108261108,0.3456780016422272,-0.6829830408096314,0.3632510006427765,-0.6655570268630981,0.3821209967136383,-0.6366850137710571,0.4176329970359802,-0.5727579593658447,0.456400990486145,-0.5207880139350891,0.4855499863624573,-0.4896399974822998,0.5137969851493835,-0.4708049893379211,0.5384989976882935,-0.4646480083465576,0.5607789754867554,-0.4691789746284485,0.5794060230255127,-0.4855750203132629,0.5942530035972595,-0.5111640095710754,0.6124190092086792,-0.5652619600296021,0.6343280076980591,-0.6242530345916748,0.6671730279922485,-0.7009339928627014,0.7080100178718567,-0.7838400006294251,0.7612149715423584,-0.8732680082321167,0.8041179776191711,-0.9288042783737183,0.8450930118560791,-0.9720109105110169,0.8847860097885132,-0.997826099395752,0.9052839875221252,-0.997826099395752,0.9405980110168457,-0.9869564771652222,1,-0.9826086759567261,1,0,0,0],0],["images/a_track-sheet1.png",251838,1,1,1536,654,1,0,1,[["right",1,0.3088684976100922],["power_up",0.9674479365348816,0.1529051959514618],["coin_p0",0.4348958432674408,-0.03975535184144974],["coin_p1",0.4759114682674408,-0.05198776721954346],["coin_p2",0.515625,-0.06574923545122147],["coin_p3",0.5618489384651184,-0.07798165082931519]],[0.07226569950580597,-0.6934249997138977,0.1166990026831627,-0.6808099746704102,0.1617020070552826,-0.6561540365219116,0.2084549963474274,-0.6671440005302429,0.2322030067443848,-0.6842870116233826,0.2611590027809143,-0.7236000299453735,0.3005169928073883,-0.7976399660110474,0.3439429998397827,-0.8690029978752136,0.3803049921989441,-0.9184466004371643,0.4098789989948273,-0.9462264180183411,0.4667969942092896,-0.9495413303375244,0.5944010019302368,-0.98050457239151,0.6731770038604736,-1,0.7356770038604736,-1,0.7600910067558289,-0.9923547506332398,0.7735999822616577,-0.9839450120925903,0.7919920086860657,-0.9633027911186218,0.808023989200592,-0.9348242282867432,0.8280839920043945,-0.8840789794921875,0.8518880009651184,-0.8371559977531433,0.881184995174408,-0.790136992931366,0.9117019772529602,-0.7485660314559937,0.9409589767456055,-0.7189890146255493,0.9658409953117371,-0.7003769874572754,0.9808859825134277,-0.694130003452301,1,-0.6911320090293884,1,0,0,0,0,-0.6911320090293884],0],["images/a_track-sheet3.png",208604,1,583,1536,515,1,0,1,[["right",1,0.124271847307682],["power_up",0.7760416865348816,-0.1145631074905396],["coin_p0",0.5579426884651184,0.2737863957881928],["coin_p1",0.59375,0.231067955493927],["coin_p2",0.6263020634651184,0.1572815477848053],["coin_p3",0.6536458134651184,0.08349514752626419],["coin_p4",0.6829426884651184,-0.003883495228365064],["coin_p5",0.6861979365348816,-0.08543689548969269]],[0.1363929957151413,-0.8766989707946777,0.1806640028953552,-0.8669899702072144,0.2191160023212433,-0.8486649990081787,0.2525230050086975,-0.8220869898796082,0.2890830039978027,-0.7807639837265015,0.3308509886264801,-0.7253639698028565,0.3769530057907105,-0.6504850387573242,0.392659991979599,-0.6346479654312134,0.4210610091686249,-0.6168689727783203,0.4506840109825134,-0.6060680150985718,0.4877929985523224,-0.6029130220413208,0.5313929915428162,-0.6149269938468933,0.5579109787940979,-0.6277300119400024,0.5867109894752502,-0.6492719650268555,0.6173809766769409,-0.7004250288009644,0.6450859904289246,-0.7590110301971436,0.6736040115356445,-0.8341020345687866,0.7070419788360596,-0.9381675124168396,0.7204239964485169,-0.9596177935600281,0.7445480227470398,-0.9791262149810791,0.7710270285606384,-0.9902306199073792,0.8018999695777893,-0.9959951639175415,0.828948974609375,-0.9995145797729492,0.8388919830322266,-0.9858009815216065,0.8516770005226135,-0.9575849771499634,0.8680419921875,-0.9182038903236389,0.8812050223350525,-0.8972089886665344,0.8941400051116943,-0.8850420117378235,0.9077249765396118,-0.8714200258255005,0.9162650108337402,-0.8711470365524292,0.9244409799575806,-0.8768360018730164,1,-0.8776699900627136,1,0,0,0,0,-0.8776699900627136],0],["images/a_track-sheet4.png",281708,1,1404,1536,453,1,0,1,[["right",1,0],["power_up",0.2434895783662796,-0.04856512323021889],["coin_p0",0.693359375,0.3090507686138153],["coin_p1",0.720703125,0.2295805811882019],["coin_p2",0.7532551884651184,0.1456953585147858],["coin_p3",0.7825520634651184,0.06843267381191254],["coin_p4",0.8157551884651184,0.01545253861695528],["coin_p5",0.6861979365348816,-0.08388520777225494]],[0.0006510419771075249,-0.9977924823760986,0.06054690107703209,-0.9977925419807434,0.1020099967718124,-0.9921358227729797,0.1328019946813583,-0.981477677822113,0.1531780064105988,-0.9647489786148071,0.1726070046424866,-0.9174944758415222,0.1938270032405853,-0.8834850192070007,0.21390800178051,-0.8599610328674316,0.2377019971609116,-0.8444740176200867,0.2707720100879669,-0.843887984752655,0.2904160022735596,-0.8548910021781921,0.307779997587204,-0.8636869788169861,0.3401950001716614,-0.8620139956474304,0.3716199994087219,-0.8484839797019959,0.3978370130062103,-0.8266760110855103,0.4193469882011414,-0.7940980195999146,0.470317006111145,-0.6958470344543457,0.5012919902801514,-0.6301389932632446,0.5604249835014343,-0.5097960233688355,0.5900880098342896,-0.4787529706954956,0.6111760139465332,-0.4667840003967285,0.6372280120849609,-0.4644730091094971,0.6618099808692932,-0.4776660203933716,0.6811019778251648,-0.5010690093040466,0.6993740200996399,-0.538985013961792,0.7197620272636414,-0.6050460338592529,0.7378910183906555,-0.6600140333175659,0.7586240172386169,-0.7149820327758789,0.7748810052871704,-0.7727090120315552,0.7870050072669983,-0.8024140000343323,0.8238670229911804,-0.8586090207099915,0.8578789830207825,-0.9053254127502441,0.903203010559082,-0.9630793929100037,0.9306229948997498,-0.9871690273284912,0.9542639851570129,-0.9972406029701233,0.9993489980697632,-0.9977924823760986,1,0,0,0],0],["images/a_track-sheet5.png",133012,1,1,1536,453,1,0,1,[["right",1,0],["power_up",0.0598958320915699,-0.1545253843069077],["coin_p0",0.455078125,0.3245033025741577],["coin_p1",0.4876302182674408,0.2671081721782684],["coin_p2",0.521484375,0.2141280323266983],["coin_p3",0.5520833134651184,0.1589404046535492],["coin_p4",0.5846354365348816,0.1081677675247192],["coin_p5",0.6184895634651184,0.07064017653465271]],[0.0006510419771075249,-0.9977924823760986,0.06144209951162338,-1,0.09147139638662338,-0.990618109703064,0.1222739964723587,-0.9670253992080689,0.1547040045261383,-0.9230132102966309,0.1834719926118851,-0.8679640293121338,0.2159730046987534,-0.7809399962425232,0.2815139889717102,-0.5907149910926819,0.3050130009651184,-0.5209710001945496,0.3232829868793488,-0.4890999794006348,0.3438310027122498,-0.4671630263328552,0.3738609850406647,-0.4586089849472046,0.3979899883270264,-0.4664729833602905,0.4191890060901642,-0.4826160073280335,0.4375199973583221,-0.5028280019760132,0.4581300020217896,-0.5429080128669739,0.4824019968509674,-0.5956820249557495,0.5058599710464478,-0.6412799954414368,0.5718590021133423,-0.7546910047531128,0.6152750253677368,-0.8191230297088623,0.6526690125465393,-0.8592720031738281,0.6754559874534607,-0.8744480013847351,0.6949869990348816,-0.8796910047531128,0.7049869894981384,-0.8778629899024963,0.7424920201301575,-0.8600299954414368,0.7828369736671448,-0.8563740253448486,0.8024290204048157,-0.8712059855461121,0.8210449814796448,-0.9092162847518921,0.8366900086402893,-0.9469509124755859,0.8533120155334473,-0.9725440740585327,0.8715819716453552,-0.9845473766326904,0.8946120142936707,-0.99227374792099,0.950357973575592,-1,0.9993489980697632,-0.9977924823760986,1,0,0,0],0],["images/a_track-sheet0.png",210395,1,929,1536,665,1,0,1,[["right",1,0.3187969923019409],["power_up",0.2552083432674408,0.1503759324550629],["coin_p0",0.52734375,0.03157894685864449],["coin_p1",0.56640625,-0.01052631624042988],["coin_p2",0.6041666865348816,-0.04661654308438301],["coin_p3",0.640625,-0.0736842080950737],["coin_p4",0.6829426884651184,-0.07669173181056976],["coin_p5",0.7272135615348816,-0.06165413558483124]],[0.04101559892296791,-0.6796990036964417,0.09969069808721542,-0.7214289903640747,0.145345002412796,-0.7466169595718384,0.1874189972877502,-0.7484959959983826,0.2307939976453781,-0.726315975189209,0.2636309862136841,-0.7240599989891052,0.2893069982528687,-0.7421050071716309,0.3195390105247498,-0.7785719633102417,0.3523760139942169,-0.7992479801177979,0.3915610015392304,-0.8114659786224365,0.4220579862594605,-0.8130639791488648,0.4603680074214935,-0.8056390285491943,0.4831140041351318,-0.8065789937973023,0.504252016544342,-0.825469970703125,0.5333759784698486,-0.8672460317611694,0.5784509778022766,-0.9421052932739258,0.6075040102005005,-0.9674811959266663,0.6461179852485657,-0.995958685874939,0.6729130148887634,-1,0.6950989961624146,-0.9949248433113098,0.7198650240898132,-0.9826127886772156,0.755033016204834,-0.9546523094177246,0.783519983291626,-0.9207823872566223,0.836745023727417,-0.8395439982414246,0.872232973575592,-0.768796980381012,0.9003909826278687,-0.7142859697341919,0.9178869724273682,-0.6909779906272888,0.9399409890174866,-0.6796990036964417,1,-0.6781949996948242,1,0,0,0,0,-0.6781960129737854],0],["images/a_track-sheet2.png",266220,1,1181,1536,585,1,0,1,[["right",1,0.2256410270929337],["power_up",0.212890625,-0.1111111119389534],["coin_p0",0.3020833432674408,-0.02393162436783314],["coin_p1",0.333984375,0.02051282115280628],["coin_p2",0.3658854067325592,0.06837607175111771],["coin_p3",0.39453125,0.121367521584034],["coin_p4",0.4283854067325592,0.1726495772600174]],[0.09505210071802139,-0.7777780294418335,0.1214189976453781,-0.8217949867248535,0.1554359942674637,-0.9711537957191467,0.1893720030784607,-1,0.2502849996089935,-0.9927350282669067,0.3884890079498291,-0.768589973449707,0.4752599895000458,-0.6418800354003906,0.5397130250930786,-0.5841879844665527,0.5846350193023682,-0.5846149921417236,0.6233720183372498,-0.6324790120124817,0.6625980138778687,-0.698291003704071,0.6988120079040527,-0.7217949628829956,0.8834630250930786,-0.7692310214042664,1,-0.7794870138168335,1,0,0,0,0,-0.7658119797706604],0],["images/a_track-sheet4.png",281708,1,1,1536,483,1,0,1,[["right",1,0.06418219208717346],["power_up",0.7747395634651184,0.1759834438562393],["coin_p0",0.439453125,0.02484472095966339],["coin_p1",0.474609375,-0.02898550778627396],["coin_p2",0.51171875,-0.07246376574039459],["coin_p3",0.5579426884651184,-0.1035196706652641],["coin_p4",0.6015625,-0.1200828179717064],["coin_p5",0.6861979365348816,-0.08488612622022629]],[0,-0.9358177781105042,0.05989589914679527,-0.9315475821495056,0.1290690004825592,-0.9164078831672669,0.1488039940595627,-0.9003300070762634,0.1729329973459244,-0.8749350309371948,0.1971029937267304,-0.843297004699707,0.229654997587204,-0.7857140302658081,0.2644859850406647,-0.718878984451294,0.2949219942092896,-0.6867240071296692,0.3216150104999542,-0.6794120073318481,0.3468419909477234,-0.6861090064048767,0.3761389851570129,-0.7101609706878662,0.4125980138778687,-0.7637159824371338,0.4434410035610199,-0.8286100029945374,0.4678960144519806,-0.8934069871902466,0.5,-0.9318063855171204,0.5327960252761841,-0.967714786529541,0.5469970107078552,-0.9812694191932678,0.5734050273895264,-0.9984471797943115,0.5933629870414734,-0.9984471797943115,0.6055960059165955,-0.9964738488197327,0.6185479760169983,-0.9846175909042358,0.6268140077590942,-0.971960723400116,0.6757709980010986,-0.8314570188522339,0.6956400275230408,-0.7753459811210632,0.7132319808006287,-0.7451150417327881,0.7356240153312683,-0.7143670320510864,0.7624109983444214,-0.6919000148773193,0.7755990028381348,-0.6892310380935669,0.7918810248374939,-0.6907030344009399,0.8050690293312073,-0.7025269865989685,0.8167089819908142,-0.7218959927558899,0.8346959948539734,-0.769216001033783,0.8560389876365662,-0.8190990090370178,0.8843989968299866,-0.8671070337295532,0.9098820090293884,-0.8972240090370178,0.9374799728393555,-0.9185429811477661,0.9594619870185852,-0.9297683835029602,1,-0.9358177781105042,1,0,0,0],0],["images/a_track-sheet4.png",281708,1,948,1536,454,1,0,1,[["right",1,0],["power_up",0.2024739533662796,0.147577092051506],["coin_p0",0.5208333134651184,-0.00440528616309166],["coin_p1",0.5559895634651184,0.07268722355365753],["coin_p2",0.6002604365348816,0.1167400851845741],["coin_p3",0.6458333134651184,0.1343612372875214],["coin_p4",0.6868489384651184,0.1255506575107575],["coin_p5",0.6861979365348816,-0.08370044082403183]],[0.001302079996094108,-0.9955947399139404,0.02115890011191368,-0.9933921098709106,0.04671230167150497,-0.9829983711242676,0.06563320010900497,-0.9638801217079163,0.08683270215988159,-0.9315459728240967,0.1134029999375343,-0.8650709986686707,0.146809995174408,-0.757847011089325,0.1723629981279373,-0.7083560228347778,0.1906740069389343,-0.6924220323562622,0.2170819938182831,-0.6987709999084473,0.2410279959440231,-0.7206690311431885,0.2738339900970459,-0.7822780013084412,0.3004559874534607,-0.8549010157585144,0.3717449903488159,-0.982929527759552,0.390951007604599,-1,0.4231770038604736,-0.9994493722915649,0.4659830033779144,-0.9936674237251282,0.4784339964389801,-0.9668226838111877,0.4955649971961975,-0.9079707860946655,0.5131840109825134,-0.8557270169258118,0.5362039804458618,-0.8209660053253174,0.5733850002288818,-0.7862060070037842,0.6018220186233521,-0.7674490213394165,0.6320499777793884,-0.7541990280151367,0.6655960083007813,-0.7449580430984497,0.6883999705314636,-0.7511360049247742,0.7106260061264038,-0.7718459963798523,0.7271549701690674,-0.7975119948387146,0.7417309880256653,-0.8289600014686585,0.7532140016555786,-0.8620589971542358,0.7724909782409668,-0.8936539888381958,0.7955120205879211,-0.9241464138031006,0.8269140124320984,-0.9546393156051636,0.8618980050086975,-0.9719163179397583,0.9036049842834473,-0.9815528988838196,0.9593709707260132,-0.9918777346611023,0.9986979961395264,-0.9955947399139404,1,0,0,0],0],["images/a_track-sheet3.png",208604,1,583,1536,515,1,0,1,[["right",1,0.1184466034173966],["power_up",0.2415364533662796,0.04660193994641304],["coin_p0",0.541015625,0.269902914762497],["coin_p1",0.583984375,0.2407767027616501],["coin_p2",0.619140625,0.1553398072719574],["coin_p3",0.650390625,0.07184465974569321],["coin_p4",0.6796875,-0.009708737954497337],["coin_p5",0.6861979365348816,-0.08543689548969269]],[0,-0.8776699900627136,0.1053870022296906,-0.8774269819259644,0.1545410007238388,-0.873058021068573,0.2049970030784607,-0.8553400039672852,0.2375690042972565,-0.8356789946556091,0.2909750044345856,-0.7800970077514648,0.3329870104789734,-0.7201449871063232,0.3795570135116577,-0.6485440135002136,0.4049479961395264,-0.6259709596633911,0.4550780057907105,-0.6049759984016419,0.5040689706802368,-0.6058250069618225,0.5408530235290527,-0.6186890006065369,0.5826820135116577,-0.645630955696106,0.6105960011482239,-0.6881070137023926,0.6450200080871582,-0.7592229843139648,0.6757000088691711,-0.8398060202598572,0.7063800096511841,-0.9378640055656433,0.7216799855232239,-0.9604368805885315,0.7431640028953552,-0.9775484800338745,0.7672529816627502,-0.9878640174865723,0.7957350015640259,-0.9953883290290833,0.8269039988517761,-1,0.8351650238037109,-0.9936892986297607,0.8715819716453552,-0.9101940989494324,0.8911129832267761,-0.8847090005874634,0.9117839932441711,-0.8713589906692505,0.9324949979782105,-0.8773059844970703,0.9647619724273682,-0.8764560222625732,1,-0.8776699900627136,1,0,0,0],0],["images/a_track-sheet2.png",266220,1,1,1536,588,1,0,1,[["right",1,0.2278911620378494],["power_up",0.818359375,0.005102040711790323],["coin_p0",0.4342447817325592,-0.06122449040412903],["coin_p1",0.4765625,-0.03401360660791397],["coin_p2",0.5149739384651184,-0.001700680237263441],["coin_p3",0.5572916865348816,0.03401360660791397]],[0.1985680013895035,-0.7653059959411621,0.2216800004243851,-0.7627550363540649,0.2418619990348816,-0.7739689946174622,0.2592769861221314,-0.7972999811172485,0.2758179903030396,-0.8308219909667969,0.2897540032863617,-0.8717849850654602,0.3026530146598816,-0.9069408774375916,0.3133539855480194,-0.9287043213844299,0.3325090110301971,-0.9539155960083008,0.3466190099716187,-0.9821029901504517,0.3579100072383881,-0.992559552192688,0.3754880130290985,-1,0.3925170004367828,-0.9991496801376343,0.4137780070304871,-0.9902210831642151,0.4356279969215393,-0.9766156077384949,0.5,-0.9268707036972046,0.5285639762878418,-0.9030612111091614,0.5658969879150391,-0.8585249781608582,0.5933020114898682,-0.8161140084266663,0.6006060242652893,-0.8043149709701538,0.6172789931297302,-0.7635520100593567,0.6336259841918945,-0.7359690070152283,0.6534019708633423,-0.7185369729995728,0.6694539785385132,-0.7132229804992676,0.6897379755973816,-0.7206630110740662,0.7067570090293884,-0.7390519976615906,0.7200319766998291,-0.7625429630279541,0.7330729961395264,-0.7903909683227539,0.7445470094680786,-0.8274340033531189,0.7516679763793945,-0.8531830310821533,0.7602739930152893,-0.8728610277175903,0.7701820135116577,-0.8908380270004273,0.7870690226554871,-0.9018123149871826,0.8021649718284607,-0.9085353016853333,0.8232420086860657,-0.9130526781082153,0.8454790115356445,-0.9127073287963867,0.8617249727249146,-0.9099835157394409,0.8802490234375,-0.9030081033706665,0.8995559811592102,-0.8743889927864075,0.9193519949913025,-0.838966965675354,0.9308270215988159,-0.8095239996910095,0.9473059773445129,-0.7827379703521729,0.9664919972419739,-0.767645001411438,1,-0.7687070369720459,1,0,0.0006510419771075249,-0.001700997352600098,0,-0.7687070369720459],0],["images/a_track-sheet3.png",208604,1,1100,1536,515,1,0,1,[["right",1,0.1184466034173966],["power_up",0.21875,-0.1281553357839584],["coin_p0",0.330078125,0.03106796182692051],["coin_p1",0.35546875,0.1029126197099686],["coin_p2",0.384765625,0.1825242787599564],["coin_p3",0.4186197817325592,0.2407767027616501]],[0.4645180106163025,-0.6160190105438232,0.5008140206336975,-0.604369044303894,0.5437620282173157,-0.6064929962158203,0.578095018863678,-0.6162930130958557,0.6199139952659607,-0.6455099582672119,0.6384580135345459,-0.6761829853057861,0.66497802734375,-0.7189930081367493,0.7070410251617432,-0.7766079902648926,0.7520340085029602,-0.8254849910736084,0.7930300235748291,-0.8560069799423218,0.8408709764480591,-0.8712680339813232,0.8870850205421448,-0.8777909874916077,1,-0.8776699900627136,1,0,0,0,0,-0.8776699900627136,0.0752767026424408,-0.8800970315933228,0.08980309963226318,-0.8686890006065369,0.1069340035319328,-0.8864079713821411,0.1229249984025955,-0.9012135863304138,0.1365250051021576,-0.9282159805297852,0.1532540023326874,-0.9693871140480042,0.1683550029993057,-0.9975728392601013,0.1940920054912567,-0.9975728392601013,0.2287999987602234,-0.9898058176040649,0.2571409940719605,-0.9779126048088074,0.2794600129127502,-0.9587377905845642,0.2913410067558289,-0.9419901967048645,0.3057050108909607,-0.9001820087432861,0.3246259987354279,-0.8389559984207153,0.3453780114650726,-0.7820389866828919,0.3780919909477234,-0.7094659805297852,0.4090169966220856,-0.6548539996147156,0.4297690093517304,-0.6364079713821411],0],["images/a_track-sheet2.png",266220,1,591,1536,588,1,0,1,[["right",1,0.2329932004213333],["power_up",0.16796875,-0.005102040711790323],["coin_p0",0.4329427182674408,0.04251700639724731],["coin_p1",0.4733072817325592,0],["coin_p2",0.5130208134651184,-0.03231292590498924],["coin_p3",0.5533854365348816,-0.06462585180997849],["coin_p4",0.61328125,-0.09013605117797852]],[0.03352870047092438,-0.7687070369720459,0.05863450095057488,-0.7891160249710083,0.08062750101089478,-0.8375849723815918,0.1162919998168945,-0.9005101919174194,0.1483969986438751,-0.9145407676696777,0.1905920058488846,-0.9111393690109253,0.2290849983692169,-0.8915820121765137,0.2480060011148453,-0.8565050363540649,0.2633459866046906,-0.8018710017204285,0.2740069925785065,-0.774446964263916,0.2913819849491119,-0.7441539764404297,0.3075560033321381,-0.7243300080299377,0.3255720138549805,-0.7152689695358276,0.3480069935321808,-0.7192419767379761,0.3703739941120148,-0.7433370351791382,0.3898110091686249,-0.7784860134124756,0.403564989566803,-0.8118619918823242,0.4267779886722565,-0.8484799861907959,0.4604080021381378,-0.8910499811172485,0.4939779937267304,-0.9234694242477417,0.5217080116271973,-0.9434790015220642,0.558879017829895,-0.9732673764228821,0.5841779708862305,-0.9893043041229248,0.6076859831809998,-0.9987244606018066,0.6301270127296448,-1,0.6440430283546448,-0.9929847121238709,0.6524249911308289,-0.9820365905761719,0.669963002204895,-0.9493516087532044,0.6852419972419739,-0.9304580688476563,0.6945379972457886,-0.9132270812988281,0.7101730108261108,-0.8710229992866516,0.7245050072669983,-0.8296700119972229,0.7437490224838257,-0.7918059825897217,0.7598999738693237,-0.7724379897117615,0.7796319723129273,-0.7628480195999146,0.8445690274238586,-0.7632269859313965,1,-0.7670069932937622,0.9993489980697632,-0.001700997352600098,0,0,0,-0.7670069932937622],0],["images/a_track-sheet0.png",210395,1,1,1536,926,1,0,1,[["right",1,0.511879026889801],["power_up",0.5026041865348816,-0.1328293681144714],["coin_p0",0.2337239533662796,0.2904967665672302],["coin_p1",0.2630208432674408,0.2419006526470184],["coin_p2",0.2845052182674408,0.1760259121656418],["coin_p3",0.3177083432674408,0.1317494660615921],["coin_p4",0.3587239682674408,0.1079913601279259]],[0.04036460071802139,-0.4897410273551941,0.09098310023546219,-0.5116770267486572,0.1139319986104965,-0.5255129933357239,0.1408690065145493,-0.5328359603881836,0.160970002412796,-0.5396189689636231,0.1796060055494309,-0.5558519959449768,0.1959230005741119,-0.5769270062446594,0.2144979983568192,-0.6090630292892456,0.2405499964952469,-0.6418690085411072,0.2581300139427185,-0.6645150184631348,0.2822209894657135,-0.7146979570388794,0.3017550110816956,-0.7678509950637817,0.3125,-0.7961660027503967,0.3274739980697632,-0.8181700110435486,0.3417969942092896,-0.8291710019111633,0.3668619990348816,-0.835211992263794,0.3860679864883423,-0.839851975440979,0.4030759930610657,-0.8545910120010376,0.4176639914512634,-0.8765000104904175,0.4325770139694214,-0.9105570316314697,0.4439800083637238,-0.9519512057304382,0.4542390108108521,-0.9766979813575745,0.4661259949207306,-0.9882158041000366,0.493153989315033,-0.9968076944351196,0.522786021232605,-1,0.5431320071220398,-0.9946004152297974,0.559732973575592,-0.9832612872123718,0.5728350281715393,-0.9619330167770386,0.5845950245857239,-0.9226511716842651,0.5968220233917236,-0.8749330043792725,0.6089580059051514,-0.8451340198516846,0.6276170015335083,-0.8136559724807739,0.6462759971618652,-0.792976975440979,0.6821879744529724,-0.7749980092048645,0.6978639960289002,-0.761148989200592,0.7151299715042114,-0.7317689657211304,0.7320700287818909,-0.6824100017547607,0.7429879903793335,-0.639801025390625,0.7604169845581055,-0.6025919914245606,0.7825520038604736,-0.5580450296401978,0.8183590173721314,-0.4983800053596497,0.8473309874534607,-0.4786720275878906,0.8815109729766846,-0.4805619716644287,1,-0.488120973110199,1,0,0,0,0,-0.4870409965515137],0]]]],[],false,false,796881399186053,[],null],["t7",9,false,[],0,0,null,[["Default",5,false,1,0,false,337239737033539,[["images/shaft-sheet0.png",92,0,0,40,10,1,0,0.5,[["right",1,0.5],["left",0,0.5]],[1,0.5,0,0.5,0,-0.5,1,-0.5],1]]]],[],false,false,919257936517872,[],null],["t8",9,false,[],0,0,null,[["Default",0,false,0,0,false,969046932377140,[["images/sprite2-sheet0.png",94,0,0,50,50,1,0.5,0.5,[],[],1],["images/sprite2-sheet1.png",94,0,0,50,50,1,0.5,0.5,[],[],1]]]],[],false,false,156016240913298,[],null],["t9",2,false,[],0,0,null,null,[],false,false,898815903716757,[],null,[]],["t10",9,false,[124456785019839],0,0,null,[["Default",5,false,1,0,false,233038749581815,[["images/ground_detector-sheet0.png",94,0,0,50,50,1,0.5,0,[],[],1]]]],[],false,false,599127020886521,[],null],["t11",11,false,[],0,0,null,null,[],false,false,813435601922122,[],null],["t12",0,false,[],0,0,null,null,[],true,false,527976176952214,[],null],["t13",6,false,[],0,0,["images/particles.png",512,0],null,[],false,false,331444020445699,[],null],["t14",9,false,[],0,0,null,[["Default",0,false,0,0,false,888035128718638,[["images/a_egg_outline-sheet0.png",2404,0,0,100,130,1,0.5,0.5,[],[],0]]]],[],false,false,208803087860435,[],null],["t15",6,false,[],0,0,["images/particles2.png",1071,0],null,[],false,false,786853907274721,[],null],["t16",6,false,[],0,0,["images/particles3.png",1071,0],null,[],false,false,510474352398796,[],null],["t17",9,false,[476114818005129,645106956169507,678531476742050,704265137964370,177864083902431],0,0,null,[["Default",0,false,0,0,false,450345696223370,[["images/bg_parrallax_front-sheet0.png",140034,1,1,1280,521,1,0,1,[],[0.04843749850988388,-0.8809980154037476,0.5,-0.7735120058059692,0.9281250238418579,-0.8234170079231262,1,-0.5009599924087524,1,0,0,0,0,-0.5009599924087524],0],["images/bg_parrallax_front-sheet0.png",140034,1,524,1280,489,1,0,1,[],[0.06953120231628418,-0.8179960250854492,0.9374999403953552,-0.8364009857177734,1,-0.5010219812393189,1,0,0,0,0,-0.5010219812393189],0]]]],[],false,false,833557904288148,[],null],["t18",9,false,[476114818005129,645106956169507,678531476742050,704265137964370,177864083902431],0,0,null,[["Default",0,false,0,0,false,626765463520642,[["images/bg_parrallax_back-sheet0.png",224312,1,1,1138,356,1,0,1,[],[],0],["images/bg_parrallax_back-sheet0.png",224312,1,359,1138,308,1,0,1,[],[],0]]]],[],false,false,351654305346426,[],null],["t19",9,false,[476114818005129,645106956169507,678531476742050,704265137964370,177864083902431],0,0,null,[["Default",0,false,0,0,false,950492729368393,[["images/sprite3-sheet0.png",23069,0,0,246,246,1,0.5,0.5,[],[],0]]]],[],false,false,136276284631825,[],null],["t20",0,false,[],0,0,null,null,[],true,false,310224226140766,[],null],["t21",0,false,[],0,0,null,null,[],true,false,653602238666466,[],null],["t22",9,false,[],0,0,null,[["Default",5,false,1,0,false,590065887000409,[["images/blockage-sheet0.png",10289,0,0,144,143,1,0.5,1,[],[],0]]]],[],false,false,759797325989666,[],null],["t23",9,false,[639062338976045,716512423134002],0,0,null,[["Default",25,true,1,0,false,485607172443594,[["images/a_coin-sheet0.png",33669,163,1,75,75,1,0.5066666603088379,0.5066666603088379,[],[],0],["images/a_coin-sheet0.png",33669,1,1,79,74,1,0.5063291192054749,0.5,[],[],0],["images/a_coin-sheet0.png",33669,1,77,68,74,1,0.5,0.5,[],[],0],["images/a_coin-sheet0.png",33669,1,77,68,74,1,0.5,0.5,[],[],0],["images/a_coin-sheet0.png",33669,133,78,47,75,1,0.5106382966041565,0.5066666603088379,[],[],0],["images/a_coin-sheet0.png",33669,1,153,40,75,1,0.5,0.5066666603088379,[],[],0],["images/a_coin-sheet0.png",33669,240,1,14,77,1,0.5,0.5064935088157654,[],[],0],["images/a_coin-sheet0.png",33669,43,154,40,75,1,0.5,0.5066666603088379,[],[0.5,0.4933333396911621,-0.5,0.4933333396911621,-0.5,-0.5066666603088379,0.5,-0.5066666603088379],0],["images/a_coin-sheet0.png",33669,182,78,47,75,1,0.4893617033958435,0.5066666603088379,[],[0.5106382966041565,0.4933333396911621,-0.4893617033958435,0.4933333396911621,-0.4893617033958435,-0.5066666603088379,0.5106382966041565,-0.5066666603088379],0],["images/a_coin-sheet0.png",33669,71,77,60,75,1,0.5,0.5066666603088379,[],[0.5,0.4933333396911621,-0.5,0.4933333396911621,-0.5,-0.5066666603088379,0.5,-0.5066666603088379],0],["images/a_coin-sheet0.png",33669,71,77,60,75,1,0.5,0.5066666603088379,[],[0.5,0.4933333396911621,-0.5,0.4933333396911621,-0.5,-0.5066666603088379,0.5,-0.5066666603088379],0],["images/a_coin-sheet0.png",33669,82,1,79,74,1,0.4936708807945252,0.5,[],[0.5063291192054749,0.5,-0.4936708807945252,0.5,-0.4936708807945252,-0.5,0.5063291192054749,-0.5],0]]]],[],false,false,183971530538193,[],null],["t24",9,false,[],0,0,null,[["Default",0,false,0,0,false,736646968892680,[["images/a_egg_crack-sheet1.png",4684,0,0,100,83,1,0.5,0.5060241222381592,[],[-0.3199999928474426,-0.2891571223735809,-0.1924999952316284,-0.4246988296508789,-0.02000001072883606,-0.5030120611190796,0.1700000166893005,-0.4608434140682221,0.3299999833106995,-0.3012051284313202,0.4025000333786011,-0.1626511216163635,0.449999988079071,-0.01204812526702881,0.5,0.3072288632392883,0.4174999594688416,0.4457828998565674,0.3225000500679016,0.2138548493385315,0.252500057220459,0.3524098992347717,0.1549999713897705,0.2319278717041016,0.06375002861022949,0.2725898623466492,-0.04750001430511475,0.02710789442062378,-0.2181249856948853,0.2929208874702454,-0.2821879982948303,0.2405868768692017,-0.3662499785423279,0.3719878792762756,-0.4925000071525574,0.1837348937988281,-0.4300000071525574,-0.07530111074447632],0],["images/a_egg_crack-sheet0.png",4800,0,0,100,84,1,0.5,0.5,[],[-0.375,-0.3958330154418945,-0.2775000035762787,-0.2529760003089905,-0.21875,-0.2991070151329041,-0.04249998927116394,-0.02976199984550476,0.06375002861022949,-0.255952000617981,0.159375011920929,-0.2470239996910095,0.2346879839897156,-0.3348209857940674,0.3223440051078796,-0.2180060148239136,0.4036719799041748,-0.4542410969734192,0.4900000095367432,-0.3214290142059326,0.4674999713897705,-0.04464301466941834,0.4074999690055847,0.1547619700431824,0.3299999833106995,0.2976189851760864,0.1800000071525574,0.4374999403953552,0.004999995231628418,0.4851189851760864,-0.1649999916553497,0.4255949854850769,-0.324999988079071,0.2738100290298462,-0.4549999833106995,0,-0.487500011920929,-0.1845239996910095],0]]]],[],false,false,758334965846932,[],null],["t25",9,false,[555873085906943,603623643386744,579507754173600,945708553159216,493918203990164,804538701337090],0,0,null,[["Default",0,false,0,0,false,528487908857035,[["images/a_power_up-sheet0.png",6158,0,0,82,84,1,0.5,0.4285714328289032,[],[],0],["images/a_power_up-sheet1.png",7647,0,0,63,61,1,0.5079365372657776,0.5081967115402222,[],[],0]]]],[],false,false,393680056153829,[],null],["t26",9,false,[],3,0,null,[["Default",0,false,0,0,false,818554099839157,[["images/a_focus-sheet0.png",22245,0,0,233,233,1,0.5021459460258484,0.5021459460258484,[],[],0]]]],[["Pin",14,483470362329178],["Rotate",15,547878884482362],["Sine",16,995312170307469]],false,false,720569299537805,[],null],["t27",9,false,[829136499250640],0,0,null,[["Default",0,false,0,0,false,509375983185661,[["images/a_dial-sheet0.png",11905,0,0,165,169,1,0.5030303001403809,0.5325443744659424,[],[],0],["images/a_dial-sheet1.png",12024,0,0,165,169,1,0.5030303001403809,0.5325443744659424,[],[],0]]]],[],false,false,964118943135258,[],null],["t28",9,false,[890055103057434,447742278246090,220341141832227,663706487429087,954794261466735,616539714332001,382751111974019,585647413571385,491656391840986,897434507703637],0,0,null,[["Default",0,false,0,0,false,749650426798672,[["images/icon_coin-sheet0.png",7088,0,0,77,77,1,0.5064935088157654,0.5064935088157654,[],[],0]]]],[],false,false,375693801051165,[],null],["t29",11,false,[],0,0,null,null,[],false,false,296259459329297,[],null],["t30",10,false,[],0,0,["images/spritefont.png",29972,0],null,[],false,false,933799845164043,[],null],["t31",7,false,[],0,0,null,null,[],false,false,107978926274829,[],null,[]],["t32",9,false,[808530949819576,946123310868298,564937613154856],0,0,null,[["Default",0,false,0,0,false,539144040156987,[["images/hud_paddle-sheet0.png",12985,0,0,138,207,1,0.2971014380455017,1,[],[],0],["images/hud_paddle-sheet1.png",9734,0,0,154,124,1,0.5844155550003052,1,[],[],0]]]],[],false,false,708779197523355,[],null],["t33",9,false,[372851269599266,519922834736622,789349525276572,653424666179997,316355721690176,104115823866786,541897271924559],0,0,null,[["Default",0,false,0,0,false,507767351244038,[["images/a_dial_needle-sheet0.png",539,0,0,73,17,1,0.8904109597206116,0.529411792755127,[],[],0]]]],[],false,false,152682629473903,[],null],["t34",11,false,[],0,0,null,null,[],false,false,787768683176757,[],null],["t35",11,false,[],0,0,null,null,[],false,false,202907620014504,[],null],["t36",9,false,[890055103057434,447742278246090,220341141832227,663706487429087,954794261466735,616539714332001,382751111974019,585647413571385,491656391840986,897434507703637],0,0,null,[["Default",0,false,0,0,false,511134792322023,[["images/icon_trophy-sheet0.png",4043,0,0,128,128,1,0.5,0.5,[],[],0]]]],[],false,false,232271265883690,[],null],["t37",13,false,[370287668776813],0,0,["images/dotted_line.png",112,3],null,[],false,false,361552608866663,[],null],["t38",11,false,[926420131854004],0,0,null,null,[],false,false,539098750971298,[],null],["t39",6,false,[],0,0,["images/particles4.png",1696,0],null,[],false,false,403547390482061,[],null],["t40",11,false,[],0,0,null,null,[],false,false,164773787867573,[],null],["t41",11,false,[],0,0,null,null,[],false,false,193933097838227,[],null],["t42",13,false,[450601492019944,951567391380411,106485162691010,586193918657688,636936560957559,740491210631319,660230449231458,538401153918565,977777313842562],0,0,["images/power_up_bar.png",421,0],null,[],false,false,965553225465640,[],null],["t43",9,false,[],0,0,null,[["Default",5,false,1,0,false,870132488565593,[["images/power_up_bar_frame-sheet0.png",305,0,0,126,24,1,0,0.5,[],[],0]]]],[],false,false,478838279739679,[],null],["t44",9,false,[],2,0,null,[["Default",5,false,1,0,false,641034384845456,[["images/egg_freeze_vfx-sheet0.png",9114,0,0,100,166,1,0.5,0.4156626462936401,[],[],0]]]],[["Pin",14,787436920601171],["Flash",17,606801495920967]],false,false,211674352442487,[],null],["t45",9,false,[816472931974824,604492468335414],0,0,null,[["Default",0,false,0,0,false,919273425782850,[["images/a_logo-sheet0.png",48331,0,0,561,256,1,0.5008912682533264,0.5,[["tyre_0",0.7468805909156799,0.875],["tyre_1",0.8805704116821289,0.84375],["egg",0.8092691898345947,0.5859375]],[],0]]]],[],false,true,795912231917955,[],null],["t46",9,false,[890055103057434,447742278246090,220341141832227,663706487429087,954794261466735,616539714332001,382751111974019,585647413571385,491656391840986,897434507703637],2,0,null,[["Default",0,false,0,0,false,515880141293447,[["images/a_logo_tyre-sheet0.png",1722,0,0,64,64,1,0.5,0.5,[],[],0]]]],[["Rotate",15,741635228202895],["Pin",14,166590942810313]],false,true,843559730256992,[],null],["t47",9,false,[890055103057434,447742278246090,220341141832227,663706487429087,954794261466735,616539714332001,382751111974019,585647413571385,491656391840986,897434507703637,466353137323271,126764197946735,960812191858448,569893559151970,177523624520845],0,0,null,[["Default",0,false,0,0,false,451399627180116,[["images/btn_play-sheet0.png",16401,0,0,310,113,1,0.5,0.5044247508049011,[],[],0]]]],[],false,false,336002755178019,[],null],["t48",9,false,[890055103057434,447742278246090,220341141832227,663706487429087,954794261466735,616539714332001,382751111974019,585647413571385,491656391840986,897434507703637,466353137323271,126764197946735,960812191858448,569893559151970,177523624520845],0,0,null,[["Default",0,false,0,0,false,571352316359586,[["images/btn_car_selection-sheet0.png",17438,0,0,310,113,1,0.5,0.5044247508049011,[],[],0]]]],[],false,false,406595972060623,[],null],["t49",8,false,[],0,0,null,null,[],false,false,498700929456049,[],null,[]],["t50",1,false,[],0,0,null,null,[],false,false,723018488520912,[],null,[0,0,0,1,1,600,600,10000,1]],["t51",5,false,[],0,0,null,null,[],false,false,770737379420423,[],null,["59a98bf799ef499d9d7b9285bccaa196",""]],["t52",9,false,[],0,0,null,[["Default",0,false,0,0,false,918075206498570,[["images/car_sel_frame-sheet0.png",119642,0,0,876,599,1,0.5,0.5008347034454346,[],[],0]]]],[],false,false,752040849878490,[],null],["t53",9,false,[767706281784932,870866451398056,452546199701982,611066092464583,372712293535894],0,0,null,[["car_0",5,false,1,0,false,358862608313734,[["images/car_sel_card-sheet1.png",42504,1,190,175,186,1,0.5028571486473084,0.5,[],[],0]]],["car_1",0,false,0,0,false,341389809292753,[["images/car_sel_card-sheet0.png",39904,1,1,176,187,1,0.5,0.5026738047599793,[],[],0],["images/car_sel_card-sheet0.png",39904,179,1,176,187,1,0.5,0.5026738047599793,[],[],0]]],["car_2",0,false,0,0,false,985572550608161,[["images/car_sel_card-sheet1.png",42504,178,190,175,186,1,0.5028571486473084,0.5,[],[],0],["images/car_sel_card-sheet2.png",8627,0,0,175,186,1,0.5028571486473084,0.5,[],[],0]]],["car_3",0,false,0,0,false,180935209479464,[["images/car_sel_card-sheet0.png",39904,1,190,176,187,1,0.5,0.5026738047599793,[],[],0],["images/car_sel_card-sheet0.png",39904,179,190,176,187,1,0.5,0.5026738047599793,[],[],0]]],["car_4",0,false,0,0,false,562365650366626,[["images/car_sel_card-sheet1.png",42504,1,1,176,187,1,0.5,0.5026738047599793,[],[],0],["images/car_sel_card-sheet1.png",42504,179,1,176,187,1,0.5,0.5026738047599793,[],[],0]]]],[],false,false,313219240373030,[],null],["t54",0,false,[],0,0,null,null,[],true,false,295297314258044,[],null],["t55",9,false,[890055103057434,447742278246090,220341141832227,663706487429087,954794261466735,616539714332001,382751111974019,585647413571385,491656391840986,897434507703637,466353137323271,126764197946735,960812191858448,569893559151970,177523624520845],0,0,null,[["Default",0,false,0,0,false,692621470465933,[["images/car_sel_button-sheet0.png",8190,1,45,105,41,1,0.5047619342803955,0.5121951103210449,[],[],0],["images/car_sel_button-sheet1.png",5315,0,0,105,41,1,0.5047619342803955,0.5121951103210449,[],[],0],["images/car_sel_button-sheet0.png",8190,1,1,107,42,1,0.5046728849411011,0.5,[],[],0]]]],[],false,false,831193031891594,[],null],["t56",11,false,[],0,0,null,null,[],false,false,622505995581980,[],null],["t57",9,false,[466353137323271,126764197946735,960812191858448,569893559151970,177523624520845],0,0,null,[["Default",0,false,0,0,false,520555716526215,[["images/btn_close-sheet0.png",7081,0,0,82,83,1,0.5,0.5060241222381592,[],[],0]]]],[],false,false,681369596427278,[],null],["t58",9,false,[816472931974824,604492468335414],0,0,null,[["Default",0,false,0,0,false,332570220866297,[["images/tuto-sheet0.png",233649,0,0,672,690,1,0.5,0.9884058237075806,[["button",0.5,0.852173924446106]],[-0.4947916567325592,-0.9814614057540894,0.4947919845581055,-0.9814614057540894,0.4947919845581055,0.00465017557144165,-0.4947916567325592,0.00465017557144165],0]]]],[],false,false,528307125898000,[],null],["t59",9,false,[466353137323271,126764197946735,960812191858448,569893559151970,177523624520845],0,0,null,[["Default",0,false,0,0,false,351523259500998,[["images/btn_continue-sheet0.png",20366,0,0,292,119,1,0.5,0.5042017102241516,[],[],0]]]],[],false,false,556431755393608,[],null],["t60",9,false,[890055103057434,447742278246090,220341141832227,663706487429087,954794261466735,616539714332001,382751111974019,585647413571385,491656391840986,897434507703637,466353137323271,126764197946735,960812191858448,569893559151970,177523624520845],0,0,null,[["Default",0,false,0,0,false,944300294634479,[["images/btn_sound-sheet0.png",21501,1,1,128,94,1,0.5,0.5,[],[],0],["images/btn_sound-sheet0.png",21501,1,97,128,94,1,0.5,0.5,[],[],0]]]],[],false,false,893621022077340,[],null],["t61",9,false,[890055103057434,447742278246090,220341141832227,663706487429087,954794261466735,616539714332001,382751111974019,585647413571385,491656391840986,897434507703637,466353137323271,126764197946735,960812191858448,569893559151970,177523624520845],0,0,null,[["Default",0,false,0,0,false,116815367305020,[["images/btn_music-sheet0.png",22013,1,1,128,94,1,0.5,0.5,[],[],0],["images/btn_music-sheet0.png",22013,1,97,128,94,1,0.5,0.5,[],[],0]]]],[],false,false,198277350567764,[],null],["t62",11,false,[],0,0,null,null,[],false,true,471120263083707,[],null],["t63",9,false,[],0,0,null,[["Default",0,false,0,0,false,407053765624598,[["images/a_loading_frame-sheet0.png",6095,0,0,398,120,1,0.5,0.5,[],[],0]]]],[],false,true,691546350352600,[],null],["t64",13,false,[],0,0,["images/a_loading_bar.png",2548,0],null,[],false,true,168683633636155,[],null],["t65",9,false,[890055103057434,447742278246090,220341141832227,663706487429087,954794261466735,616539714332001,382751111974019,585647413571385,491656391840986,897434507703637,466353137323271,126764197946735,960812191858448,569893559151970,177523624520845],0,0,null,[["Default",0,false,0,0,false,730986013041428,[["images/btn_invite-sheet0.png",8525,0,0,116,85,1,0.5,0.5058823823928833,[],[],0]]]],[],false,false,674241775674086,[],null],["t66",9,false,[890055103057434,447742278246090,220341141832227,663706487429087,954794261466735,616539714332001,382751111974019,585647413571385,491656391840986,897434507703637,466353137323271,126764197946735,960812191858448,569893559151970,177523624520845],0,0,null,[["Default",0,false,0,0,false,124117724132074,[["images/btn_leaderboard-sheet0.png",8194,0,0,116,85,1,0.5,0.5058823823928833,[],[],0]]]],[],false,false,915290299357923,[],null],["t67",9,false,[890055103057434,447742278246090,220341141832227,663706487429087,954794261466735,616539714332001,382751111974019,585647413571385,491656391840986,897434507703637,466353137323271,126764197946735,960812191858448,569893559151970,177523624520845],0,0,null,[["Default",0,false,0,0,false,422982083441680,[["images/btn_challenge-sheet0.png",13442,0,0,224,93,1,0.5,0.5053763389587402,[],[],0]]]],[],false,false,879882738251044,[],null],["t68",0,false,[],0,0,null,null,[],true,false,558604810993546,[],null],["t69",9,false,[568385342049927],0,0,null,[["Default",5,false,1,0,false,609623603987962,[["images/challenge_pic-sheet0.png",117,0,0,100,100,1,0.5,0.5,[],[],3]]]],[],false,false,283072392105345,[],null],["t70",11,false,[749607443325818],0,0,null,null,[],false,false,994908955043136,[],null],["t71",9,true,[939242505359876,678048934722792,990849584957206,680912114542905,138851308707390,688209092685894,787263476954717,848333068193907,682272672483769,851819424728570,392347966618527,498921876391339,482364165404074,518136694416169,496055965916613,451409918651197],2,0,null,null,[["ScrollTo",18,866247415518107],["Chipmunk",19,971804683617474]],false,false,571492705993638,[],null],["t72",9,true,[758674793871285,931473615217218,407429057905417],1,0,null,null,[["Chipmunk",19,466078923952866]],false,false,618976135757035,[],null],["t73",9,true,[254599962372085,173788934016196,952153190905389],2,0,null,null,[["Chipmunk",19,374663385358043],["Pin",14,119843349940313]],false,false,591653245166269,[],null],["t74",9,true,[640929515728473,731547919224874,109213957815732],1,0,null,null,[["Chipmunk",19,474425232570980]],false,false,956486310742859,[],null],["t75",9,true,[],0,0,null,null,[],false,false,336921584854705,[],null],["t76",9,true,[124456785019839],1,0,null,null,[["Pin",14,791968716760609]],false,false,411831939844669,[],null],["t77",6,true,[],1,0,null,null,[["Fade",20,513320743159258]],false,false,335531389206786,[],null],["t78",9,true,[476114818005129,645106956169507,678531476742050,704265137964370,177864083902431],0,0,null,null,[],false,false,470301415655857,[],null],["t79",9,true,[],1,0,null,null,[["Chipmunk",19,646782690803153]],false,false,564824180258984,[],null],["t80",9,true,[],1,0,null,null,[["Chipmunk",19,909616457879709]],false,false,393925475516863,[],null],["t81",9,true,[555873085906943,603623643386744,579507754173600,945708553159216,493918203990164,804538701337090],1,0,null,null,[["Sine",16,991181802616949]],false,false,692928059936430,[],null],["t82",9,true,[],0,0,null,null,[],false,false,802972847874883,[],null],["t83",9,true,[639062338976045,716512423134002],2,0,null,null,[["Spline",21,208778489477855],["Fade",20,739050464138909]],false,false,377604002394632,[],null],["t84",11,true,[],0,1,null,null,[],false,false,950180896531819,[["outline","Outline"]],null],["t85",9,true,[890055103057434,447742278246090,220341141832227,663706487429087,954794261466735,616539714332001,382751111974019,585647413571385,491656391840986,897434507703637],0,0,null,null,[],false,false,285837008013107,[],null],["t86",13,true,[450601492019944,951567391380411,106485162691010,586193918657688,636936560957559,740491210631319,660230449231458,538401153918565,977777313842562],0,1,null,null,[],false,false,621773497392965,[["tint","Tint"]],null],["t87",9,true,[816472931974824,604492468335414],1,0,null,null,[["LiteTween",22,485240101753096]],false,false,248558132986799,[],null],["t88",9,true,[466353137323271,126764197946735,960812191858448,569893559151970,177523624520845],0,0,null,null,[],false,false,869099069077809,[],null]],[[71,3],[72,4],[73,5],[74,6],[75,7],[76,10],[77,13,15,16,39],[78,18,17,19],[79,22],[80,24],[81,25],[82,26,44],[83,23],[84,38,70,35,29,40,41,34,56],[85,46,48,67,65,66,61,47,60,55,28,36],[86,42],[87,45,58],[88,48,67,57,59,65,66,61,47,60,55]],[["gamelayout",20000,1440,true,"GameManager",442887351584918,[["bg",0,188067109334037,true,[75,200,239],false,1,1,1,false,false,1,0,0,[],[["brightness","Brightness",[1]]]],["parallax",1,210775471790304,true,[255,255,255],true,0,0.5,1,false,false,1,0,0,[[[0,697,0,1138,356,0,0,1,0,1,0,0,[]],18,25,[[0.02],[2],[-1280],[1280],[1280]],[],[0,"Default",0,0]],[[1280,697,0,1138,356,0,0,1,0,1,0,0,[]],18,27,[[0.02],[2],[-1280],[1280],[1280]],[],[0,"Default",0,0]],[[679,651,0,1138,308,0,0,0.5,0,1,0,0,[]],18,26,[[0.02],[2],[-1280],[1280],[1280]],[],[0,"Default",1,0]],[[0,981,0,1280,521,0,0,1,0,1,0,0,[]],17,23,[[0.1],[2],[-1280],[1280],[1280]],[],[0,"Default",0,0]],[[1280,981,0,1280,489,0,0,1,0,1,0,0,[]],17,24,[[0.1],[2],[-1280],[1280],[1280]],[],[0,"Default",1,0]],[[362,380,0,246,246,0,0,1,0.5,0.5,0,0,[]],19,28,[[0.001],[2],[-1280],[1280],[1280]],[],[0,"Default",0,0]]],[["brightness","Brightness",[1]]]],["track",2,558887067715856,true,[255,255,255],true,1,1,1,false,false,1,0,0,[[[897.2589721679688,872.0112915039063,0,209,103,0,0,1,0.5023923516273499,0.7281553149223328,0,0,[]],3,3,[[0],[0],[-1],[0],[0],[1],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0]],[[0],[0,3,0,"ffffffff",4,0,1,0,0,0]],[0,"Default",0,1]],[[850.7803955078125,893.7456665039063,0,60,60,0,0,1,0.5,0.5,0,0,[]],4,4,[[0],[100],[-1]],[[0,2,0,"ffffffff",2,0,0.7,0,30,0]],[0,"Default",0,1]],[[860,732,0,100,130,0,0,1,0.5099999904632568,0.5076923370361328,0,0,[]],5,5,[[0],[1],[0]],[[0,3,0,"ffffffff",0.5,0,1,0,0,0],[]],[0,"Default",0,1]],[[0,1440,0,1536,452,0,0,1,0,1,0,0,[]],6,6,[[-1],[0],[0]],[[1,3,0,"ffffffff",1,0,1,0,0,0]],[0,"Default",0,1]],[[1536,1440,0,1536,515,0,0,1,0,1,0,0,[]],6,7,[[-1],[0],[0]],[[1,3,0,"ffffffff",1,0,1,0,0,0]],[0,"Default",13,1]],[[4608,1440,0,1536,585,0,0,1,0,1,0,0,[]],6,8,[[-1],[0],[0]],[[1,3,0,"ffffffff",1,0,1,0,0,0]],[0,"Default",10,1]],[[3072,1440,0,1536,483,0,0,1,0,1,0,0,[]],6,10,[[-1],[0],[0]],[[1,3,0,"ffffffff",1,0,1,0,0,0]],[0,"Default",11,1]],[[6144,1440,0,1536,453,0,0,1,0,1,0,0,[]],6,9,[[-1],[0],[0]],[[1,3,0,"ffffffff",1,0,1,0,0,0]],[0,"Default",7,1]],[[7680,1440,0,1536,515,0,0,1,0,1,0,0,[]],6,11,[[-1],[0],[0]],[[1,3,0,"ffffffff",1,0,1,0,0,0]],[0,"Default",15,1]],[[9216,1440,0,1536,452,0,0,1,0,1,0,0,[]],6,12,[[-1],[0],[0]],[[1,3,0,"ffffffff",1,0,1,0,0,0]],[0,"Default",0,1]],[[1083,805,0,40,10,0,0,1,0,0.5,0,0,[]],7,15,[],[],[0,"Default",0,1]],[[1409,390,0,5,5,0,0,1,0.5,0.5,0,0,[]],8,16,[],[],[0,"Default",0,1]],[[1110.505615234375,551.7259521484375,0,50,50,0,0,1,0.5,0,0,0,[]],10,18,[[0]],[[]],[1,"Default",0,1]],[[272,731,0,128,128,0,0,1,0,0.5,0,0,[]],13,19,[],[[1,0,1,1,1]],[5,90,1,100,4,100,-4,12,12,100,4,0,0,0,0,800,0,0,0.25]],[[-138,994,0,100,130,0,0,1,0.5,0.5,0,0,[]],14,20,[],[],[0,"Default",0,0]],[[549,775,0,128,128,0,0,1,0,0.5,0,0,[]],15,21,[],[[1,0,1,1,1]],[12,360,1,200,32,100,-64,0,0,125,24,0,-100,0,0,800,50,1,0.5]],[[490,508,0,128,128,0,0,1,0,0.5,0,0,[]],16,22,[],[[1,0,1,1,1]],[20,360,1,200,16,100,-48,0,0,150,8,0,-150,0,0,800,0,1,0.4]],[[520.9137573242188,988.1682739257813,0,144,143,0,0,1,0.5,1,0,0,[]],22,31,[],[[1,1,0,"ffffffff",1,0,0.8,0,0,0]],[0,"Default",0,1]],[[700,895,0,48.07692337036133,48.07692337036133,0,0,1,0.5066666603088379,0.5066666603088379,0,0,[]],23,32,[[0],[0]],[[1,1200,0,0,0],[0,0,0.25,1,1]],[0,"Default",0,1]],[[793.3934326171875,477.574462890625,0,100,83,0,0,1,0.5,0.5060241222381592,0,0,[]],24,33,[],[[1,3,0,"ffffffff",1,1,0.8,0,0,0]],[0,"Default",0,1]],[[797,1211,0,233,233,0,0,0.25,0.5021459460258484,0.5021459460258484,0,0,[]],26,35,[],[[],[90,0],[1,2,0,2,0,0,0,10,0]],[0,"Default",0,0]],[[1244,882,0,82,84,0,0,1,0.5,0.4285714328289032,0,0,[]],25,34,[[0],[0],[0],[""],[0],[0]],[[1,1,0,2,0,0,0,5,0]],[0,"Default",0,1]],[[524,238,0,200,75,0,0,1,0.5,0.5,0,0,[[33,33,33,1,0]]],35,46,[],[],["Text",0,"20pt Changa One","rgb(255,255,255)",1,1,4,0,0]],[[939,286,0,128,128,0,0,1,0.5,0.5,0,0,[]],36,47,[[0],[0],[0],[0.35],[0.45],[200],[128],[128],[-1],[0]],[],[0,"Default",0,0]],[[1452,393,0,8,750,0,0,1,0.5,1,0,0,[]],37,48,[[""]],[],[0,7]],[[938,161.5,0,200,75,0,0,1,0,0.5,0,0,[[33,33,33,1,0]]],38,49,[[""]],[],["0",0,"28pt Changa One","rgb(255,255,255)",0,1,3,0,0]],[[973,903,0,128,128,0,0,1,0,0.5,1,0,[]],39,50,[],[[1,0,1,1,1]],[20,360,1,150,32,100,-24,0,0,150,20,0,-100,0,0,800,0,1,1]],[[1199,55,0,150,40,0,0,1,1,0,0,0,[[33,33,33,1,0]]],40,51,[],[],["Text",0,"20pt Changa One","rgb(255,255,255)",2,0,2,0,0]],[[1235,12,0,200,34,0,0,1,1,0,0,0,[[33,33,33,1,0]]],41,52,[],[],["Text",0,"16pt Changa One","rgb(250,205,51)",2,1,2,0,0]],[[-255,1229,0,100,166,0,0,1,0.5,0.4156626462936401,0,0,[]],44,55,[],[[],[]],[0,"Default",0,1]]],[["brightness","Brightness",[1]]]],["hud",3,116090611649182,true,[255,255,255],true,0,0,1,false,false,1,0,0,[[[294,1608,0,800,70,0,0,1,0,0,0,0,[]],11,13,[],[],["Text",0,"bold 14pt Arial","rgb(0,0,0)",0,0,0,0,0]],[[417,609,0,165,169,0,0,1,0.5030303001403809,0.5325443744659424,0,0,[]],27,36,[["RPM"]],[],[0,"Default",0,0]],[[615,607,0,165,169,0,0,1,0.5030303001403809,0.5325443744659424,0,0,[]],27,37,[["BOOST"]],[],[0,"Default",1,0]],[[81.81790161132813,82.81661987304688,0,77,77,0,0,1,0.5064935088157654,0.5064935088157654,0,0,[]],28,38,[[0],[0],[0],[0.5],[0.575],[400],[77],[77],[-1],[0]],[],[0,"Default",0,1]],[[136.8294677734375,79.74348449707031,0,150,50,0,0,1,0,0.5,0,0,[[33,33,33,1,0]]],29,39,[],[],["Text",0,"24pt Changa One","rgb(255,255,255)",0,1,3,0,0]],[[-148.6812744140625,274.5432434082031,0,389,318,0,0,1,0,0,0,0,[]],30,40,[],[],[93,100,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,;:?!-_~#\"'&()[]|`\\/@°+=*$£€<>","Text",0.5,0,0,0,0,0,0,0,"{\"\"c2array\"\":true,\"\"size\"\":[2,40,1],\"\"data\"\":[[[15],[19],[26],[27],[28],[29],[30],[32],[33],[36],[37],[38],[39],[40],[41],[42],[46],[47],[48],[52],[53],[56],[57],[58],[59],[60],[61],[62],[63],[64],[65],[66],[67],[68],[69],[72],[83],[85],[86],[91]],[[\"\" \"\"],[\"\"|\"\"],[\"\"I\"\"],[\"\"'\"\"],[\"\".,;:\"\"],[\"\"i\"\"],[\"\"!\"\"],[\"\"l\"\"],[\"\"()[]\"\"],[\"\"`\"\"],[\"\"-\"\"],[\"\"r\"\"],[\"\"jt\"\"],[\"\"J\"\"],[\"\"f\"\"],[\"\"°\"\"],[\"\"<>\"\"],[\"\"Lc\"\"],[\"\"F\"\"],[\"\"E?\"\"],[\"\"C\\\"\"+=\"\"],[\"\"sz*$\"\"],[\"\"T7\"\"],[\"\"hknu1\\\\/£\"\"],[\"\"abdepq3€\"\"],[\"\"Bvy\"\"],[\"\"KPSgo25689\"\"],[\"\"GRUZx0\"\"],[\"\"HN_\"\"],[\"\"Y\"\"],[\"\"D\"\"],[\"\"4~\"\"],[\"\"OX\"\"],[\"\"V\"\"],[\"\"Q&\"\"],[\"\"A\"\"],[\"\"#\"\"],[\"\"Mm\"\"],[\"\"w@\"\"],[\"\"W\"\"]]]}",-1]],[[932,670,0,138,207,0,0,1,0.2971014380455017,1,0,0,[]],32,42,[[""],["IDLE"],[0]],[],[0,"Default",0,1]],[[417,609,0,73,17,0,0,1,0.8904109597206116,0.529411792755127,0,0,[]],33,43,[[0],[0],[0],[2],[1],[0],[0]],[],[0,"Default",0,1]],[[615,607,0,73,17,0,-3.054326295852661,1,0.8904109597206116,0.529411792755127,0,0,[]],33,44,[[95],[0],[185],[2],[1],[0],[0]],[],[0,"Default",0,1]],[[558.5,45,0,200,75,0,0,1,0.5,0,0,0,[[33,33,33,1,0]]],34,45,[],[],["Text",0,"40pt Changa One","rgb(250,206,68)",1,0,1,0,0]],[[138.123779296875,152.5989379882813,0,124,21,0,0,1,0,0.5,0,0,[[0.9300000000000001,0.15,0.15]]],42,53,[["HUD"],[124],[0],[0],[0],[0],[0],[0],[""]],[],[0,3]],[[145.4376220703125,184.7249298095703,0,126,24,0,0,1,0,0.5,0,0,[]],43,54,[],[],[0,"Default",0,0]],[[-431,567,0,100,100,0,0,1,0.5,0.5,0,0,[]],69,83,[[""]],[],[0,"Default",0,1]],[[-439,642,0,125,65,0,0,1,1,0,0,0,[[33,33,33,1,0]]],70,84,[[""]],[],["Text",0,"18pt Changa One","rgb(250,206,68)",2,0,2,0,0]]],[]],["menu",4,604618933586574,true,[255,255,255],true,0,0,1,false,false,1,0,0,[[[586,146,0,561,256,0,0,1,0.5008912682533264,0.5,0,0,[]],45,56,[["logo"],[""]],[[1,0,18,"100,100",0,1,1]],[0,"Default",0,1]],[[556,-63,0,64,64,0,0,1,0.5,0.5,0,0,[]],46,57,[[0],[0],[0],[0.35],[0.45],[400],[77],[77],[-1],[0]],[[75,0],[]],[0,"Default",0,0]],[[640,400,0,310,113,0,0,1,0.5,0.5044247508049011,0,0,[]],47,58,[[0],[0],[0],[0.5],[0.575],[200],[77],[77],[0],[0.85],[0],[0],[1],[0],[0.85]],[],[0,"Default",0,1]],[[640,500,0,310,113,0,0,1,0.5,0.5044247508049011,0,0,[]],48,59,[[0],[0],[0],[0.5],[0.575],[100],[77],[77],[0],[0.75],[1],[0],[1],[0],[0.75]],[],[0,"Default",0,1]],[[-1157,599,0,672,690,0,0,1,0.5,0.9884058237075806,0,0,[]],58,69,[["logo"],[""]],[[0,9,18,"0.75",0,0.45,1]],[0,"Default",0,0]],[[-1191,962,0,292,119,0,0,1,0.5,0.5042017102241516,0,0,[]],59,70,[[20],[2],[1],[0],[0.55]],[],[0,"Default",0,1]],[[584,658,0,128,94,0,0,1,0.5,0.5,0,0,[]],60,71,[[0],[0],[0],[0.5],[0.575],[100],[77],[77],[0],[0.75],[5],[0],[1],[0],[0.75]],[],[0,"Default",1,1]],[[725,656,0,128,94,0,0,1,0.5,0.5,0,0,[]],61,72,[[0],[0],[0],[0.5],[0.575],[100],[77],[77],[0],[0.75],[6],[0],[1],[0],[0.75]],[],[0,"Default",1,1]],[[225,666,0,116,85,0,0,1,0.5,0.5058823823928833,0,0,[]],65,79,[[0],[0],[0],[0.5],[0.575],[400],[77],[77],[0],[0.85],[4],[0],[1],[0],[0.85]],[],[0,"Default",0,1]],[[210,447,0,116,85,0,0,1,0.5,0.5058823823928833,0,0,[]],66,80,[[0],[0],[0],[0.5],[0.575],[400],[77],[77],[0],[0.85],[3],[0],[1],[0],[0.85]],[],[0,"Default",0,1]],[[640,595,0,224,93,0,0,1,0.5,0.5053763389587402,0,0,[]],67,81,[[0],[0],[0],[0.5],[0.575],[400],[77],[77],[0],[0.85],[2],[0],[1],[0],[0.85]],[],[0,"Default",0,1]]],[]],["tutorial_bg",5,136825339506039,false,[0,0,0],false,0,0,0.25,false,false,1,0,0,[],[]],["tutorial",6,158211556045122,false,[255,255,255],true,0,0,1,false,false,1,0,0,[],[]],["flash",7,921665041804266,false,[0,0,0],false,1,1,1,false,false,1,0,0,[],[]],["selection_bg",8,200262077004007,false,[0,0,0],false,0,0,0.25,false,false,1,0,0,[],[]],["selection",9,638106780938384,false,[255,255,255],true,0,0,1,false,false,1,0,0,[[[640,360,0,876,599,0,0,1,0.5,0.5008347034454346,0,0,[]],52,63,[],[],[0,"Default",0,1]],[[439,240,0,175,186,0,0,1,0.5028571486473084,0.5,0,0,[]],53,64,[[0],[0],[0],[0],[0]],[],[0,"Default",0,1]],[[651,238,0,105,41,0,0,1,0.5047619342803955,0.5121951103210449,0,0,[]],55,66,[[0],[0],[0],[0.75],[1],[150],[77],[77],[-1],[0],[11],[1],[1],[0],[1]],[],[0,"Default",0,1]],[[621,352,0,200,50,0,0,1,0,0.5,0,0,[[33,33,33,1,0]]],56,67,[],[],["Text",0,"16pt Changa One","rgb(255,255,255)",0,1,3,0,0]],[[1021,115,0,82,83,0,0,1,0.5,0.5060241222381592,0,0,[]],57,68,[[10],[1],[1],[0],[1]],[],[0,"Default",0,1]]],[]],["overlay",10,737174848624036,false,[0,0,0],false,1,1,0.5,false,false,1,0,0,[],[]]],[[null,12,14,[],[],[10,1,1]],[null,20,29,[],[],[10,1,1]],[null,21,30,[],[],[10,1,1]],[null,54,65,[],[],[10,1,1]],[null,68,82,[],[],[10,1,1]]],[]],["loaderlayout",1280,720,false,"LoaderSheet",542078829082308,[["loading_bg",0,996521632035910,true,[75,202,239],false,0,0,1,false,false,1,0,0,[[[640,192,0,561,256,0,0,1,0.5008912682533264,0.5,0,0,[]],45,73,[["logo"],[""]],[[0,0,18,"100,100",0,1,1]],[0,"Default",0,1]]],[]],["loading",1,207360349185955,true,[255,255,255],true,1,1,1,false,false,1,0,0,[[[640,440,0,400,85,0,0,1,0.5,1,0,0,[]],62,74,[],[],["Loading ...",0,"22pt Changa One","rgb(255,255,255)",1,2,7,0,0]],[[640,500,0,398,120,0,0,1,0.5,0.5,0,0,[]],63,75,[],[],[0,"Default",0,1]],[[465,494,0,349,74,0,0,1,0,0.5,0,0,[]],64,76,[],[],[0,3]],[[778,287,0,32,32,0,0,1,0.5,0.5,0,0,[]],46,77,[[0],[0],[0],[0.35],[0.45],[400],[77],[77],[-1],[0]],[[75,0],[]],[0,"Default",0,0]],[[853,280,0,32,32,0,0,1,0.5,0.5,0,0,[]],46,78,[[0],[0],[0],[0.35],[0.45],[400],[77],[77],[-1],[0]],[[75,0],[]],[0,"Default",0,0]]],[]]],[],[]]],[["GameManager",[[2,"PlatformManager",false],[2,"CarManager",false],[2,"UIManager",false],[0,[true,"On Start of Layout"],false,null,990728617257414,[[-1,23,null,0,false,false,false,990728617257414,false,[[1,[2,"On Start of Layout"]]]]],[],[[0,null,false,null,730799314560504,[[-1,24,null,1,false,false,false,999478165883383,false]],[[81,25,null,226052173528885,false],[83,25,null,130041386804932,false],[0,26,null,849027420075566,false,[[1,[2,"Play_GpTrack"]],[13]]],[0,26,null,904456713378380,false,[[1,[2,"Destroy_Props"]],[13]]],[0,26,null,744237895290639,false,[[1,[2,"Init_Layout"]],[13]]],[0,26,null,431783967379006,false,[[1,[2,"Init_TrackData"]],[13]]],[0,26,null,622796687694496,false,[[1,[2,"Play_MM_Animation"]],[13,[7,[2,"forward"]]]]],[0,26,null,205467922033932,false,[[1,[2,"Init_PreGame"]],[13]]]],[[0,null,false,null,989025374555501,[[-1,27,null,0,false,false,false,138181769855310,false,[[11,"EXECUTE_ONCE"],[8,0],[7,[0,1]]]]],[],[[0,null,false,null,471168996562718,[[-1,27,null,0,false,false,false,418923127692419,false,[[11,"platform"],[8,0],[7,[23,"PLATFORM_GD"]]]]],[[51,28,null,346492242518764,false]]],[0,null,false,null,609335160974870,[],[[-1,29,null,515608719277261,false,[[11,"EXECUTE_ONCE"],[7,[0,0]]]],[0,26,null,484640965982119,false,[[1,[2,"Load_LocalProfile"]],[13]]]]]]],[0,null,false,null,966645278048570,[],[]]]]]],[1,"EXECUTE_ONCE",0,1,false,false,548275781276639,false],[1,"START_COINS",0,25,false,false,150633215466898,false],[0,[true,"STORAGE"],false,null,188171755689176,[[-1,23,null,0,false,false,false,188171755689176,false,[[1,[2,"STORAGE"]]]]],[]],[1,"PREFIX",1,"eggcar_",false,false,336380718670397,false],[0,[true,"Local Storage"],false,null,424935215473698,[[-1,23,null,0,false,false,false,424935215473698,false,[[1,[2,"Local Storage"]]]]],[],[[0,null,false,null,809952191908015,[[0,30,null,2,false,false,false,769655419968886,false,[[1,[2,"Load_LocalProfile"]]]]],[[31,31,null,939114157650097,false,[[1,[10,[23,"PREFIX"],[2,"coins"]]]]],[31,31,null,331306818995078,false,[[1,[10,[23,"PREFIX"],[2,"best"]]]]],[31,31,null,384545799005396,false,[[1,[10,[23,"PREFIX"],[2,"sound"]]]]],[31,31,null,191403403177162,false,[[1,[10,[23,"PREFIX"],[2,"music"]]]]],[31,31,null,390242281757102,false,[[1,[10,[23,"PREFIX"],[2,"lockkey"]]]]]]],[0,null,false,null,380010360618177,[[31,32,null,1,false,false,false,753398083343666,false]],[],[[0,null,false,null,428719398498737,[[-1,33,null,0,false,false,false,402741051596708,false,[[7,[20,31,34,true,null]],[8,0],[7,[10,[23,"PREFIX"],[2,"coins"]]]]]],[],[[0,null,false,null,957626841548592,[[-1,33,null,0,false,false,false,342218669769664,false,[[7,[20,31,35,false,null]],[8,1],[7,[2,""]]]]],[[0,26,null,854701060983769,false,[[1,[2,"Update_Coins"]],[13,[7,[19,36,[[20,31,35,false,null]]]]]]]]],[0,null,false,null,388474372696432,[[-1,37,null,0,false,false,false,409924843871840,false]],[[0,26,null,948538328864309,false,[[1,[2,"Update_Coins"]],[13,[7,[23,"START_COINS"]]]]]]]]],[0,null,false,null,255098971589770,[[-1,33,null,0,false,false,false,947872276719942,false,[[7,[20,31,34,true,null]],[8,0],[7,[10,[23,"PREFIX"],[2,"best"]]]]]],[],[[0,null,false,null,213971226757258,[[-1,33,null,0,false,false,false,442639168646051,false,[[7,[20,31,35,false,null]],[8,1],[7,[2,""]]]]],[[0,26,null,172283259088753,false,[[1,[2,"Update_BestDistance"]],[13,[7,[19,36,[[20,31,35,false,null]]]]]]]]],[0,null,false,null,927308391783351,[[-1,37,null,0,false,false,false,854182238244843,false]],[[0,26,null,414988891474209,false,[[1,[2,"Update_BestDistance"]],[13,[7,[0,0]]]]]]]]],[0,null,false,null,720262233817508,[[-1,33,null,0,false,false,false,111621608260210,false,[[7,[20,31,34,true,null]],[8,0],[7,[10,[23,"PREFIX"],[2,"sound"]]]]]],[],[[0,null,false,null,911812346612034,[[-1,33,null,0,false,false,false,789729958156357,false,[[7,[20,31,35,false,null]],[8,1],[7,[2,""]]]]],[[0,26,null,484511414312580,false,[[1,[2,"Update_Sound"]],[13,[7,[19,36,[[20,31,35,false,null]]]]]]]]]]],[0,null,false,null,564417152850002,[[-1,33,null,0,false,false,false,114060698504729,false,[[7,[20,31,34,true,null]],[8,0],[7,[10,[23,"PREFIX"],[2,"music"]]]]]],[],[[0,null,false,null,299695480617218,[[-1,33,null,0,false,false,false,608715229950657,false,[[7,[20,31,35,false,null]],[8,1],[7,[2,""]]]]],[[0,26,null,576000291899943,false,[[1,[2,"Update_Music"]],[13,[7,[19,36,[[20,31,35,false,null]]]]]]]]]]],[0,null,false,null,738581440543574,[[-1,33,null,0,false,false,false,634775470741324,false,[[7,[20,31,34,true,null]],[8,0],[7,[10,[23,"PREFIX"],[2,"lockkey"]]]]]],[],[[0,null,false,null,808367693204323,[[-1,33,null,0,false,false,false,255065137061920,false,[[7,[20,31,35,false,null]],[8,1],[7,[2,""]]]]],[[0,26,null,234165333378802,false,[[1,[2,"Parse_LockKey"]],[13,[7,[20,31,35,false,null]]]]]]]]]]],[0,null,false,null,302952687756021,[[0,30,null,2,false,false,false,103505011936217,false,[[1,[2,"Parse_LockKey"]]]]],[],[[1,"saveString",1,"",false,false,709798764278237,false],[0,null,false,null,290779289341357,[],[[-1,29,null,335606683271961,false,[[11,"saveString"],[7,[20,0,38,false,null,[[0,0]]]]]]]],[0,null,false,null,568028675497600,[[-1,39,null,0,true,false,false,151119990746707,false,[[0,[23,"MAX_SKINS"]]]]],[[54,40,null,464923371353318,false,[[0,[19,41]],[7,[19,36,[[19,42,[[23,"saveString"],[19,41],[2,"|"]]]]]]]]]]]],[0,null,false,null,590414409908951,[[0,30,null,2,false,false,false,640014956010873,false,[[1,[2,"Save_LockKey"]]]]],[],[[1,"saveString",1,"",false,false,572603448134574,false],[0,null,false,null,773854481650007,[[-1,39,null,0,true,false,false,342020820519407,false,[[0,[23,"MAX_SKINS"]]]]],[],[[0,null,false,null,726755616792121,[[-1,33,null,0,false,false,false,577170852204726,false,[[7,[19,41]],[8,2],[7,[5,[23,"MAX_SKINS"],[0,1]]]]]],[[-1,29,null,396362547629928,false,[[11,"saveString"],[7,[10,[10,[23,"saveString"],[20,54,43,false,null,[[19,41]]]],[2,"|"]]]]]]],[0,null,false,null,461499353067110,[[-1,33,null,0,false,false,false,170308212777089,false,[[7,[19,41]],[8,0],[7,[5,[23,"MAX_SKINS"],[0,1]]]]]],[[-1,29,null,715216997126831,false,[[11,"saveString"],[7,[10,[23,"saveString"],[20,54,43,false,null,[[19,41]]]]]]]]]]],[0,null,false,null,826698098549562,[],[[31,44,null,443119887027924,false,[[1,[10,[23,"PREFIX"],[2,"lockkey"]]],[7,[23,"saveString"]]]]]]]]]],[0,[true,"User Params"],false,null,866090913860874,[[-1,23,null,0,false,false,false,866090913860874,false,[[1,[2,"User Params"]]]]],[]],[1,"myCoins",0,0,false,false,925009367024982,false],[1,"myScore",0,0,false,false,536407654593874,false],[1,"myLastDistance",0,0,false,false,162803993198861,false],[1,"myBestDistance",0,0,false,false,848828147650913,false],[1,"myPreRecordBeaten",0,0,false,false,421662785088816,false],[0,[true,"Uses Preferences"],false,null,247162104959040,[[-1,23,null,0,false,false,false,247162104959040,false,[[1,[2,"Uses Preferences"]]]]],[],[[0,null,false,null,461635448476941,[[0,30,null,2,false,false,false,181549610665431,false,[[1,[2,"Update_Coins"]]]]],[[-1,29,null,337968122839000,false,[[11,"myCoins"],[7,[20,0,38,false,null,[[0,0]]]]]],[31,44,null,301883031251877,false,[[1,[10,[23,"PREFIX"],[2,"coins"]]],[7,[23,"myCoins"]]]],[29,45,null,511014535838775,false,[[7,[23,"myCoins"]]]]]],[0,null,false,null,495817978338706,[[0,30,null,2,false,false,false,416167814974308,false,[[1,[2,"Update_BestDistance"]]]]],[[-1,29,null,796170983874069,false,[[11,"myBestDistance"],[7,[20,0,38,false,null,[[0,0]]]]]],[31,44,null,669521366579201,false,[[1,[10,[23,"PREFIX"],[2,"best"]]],[7,[23,"myBestDistance"]]]]]],[0,null,false,null,671797946135301,[[0,30,null,2,false,false,false,271923743228005,false,[[1,[2,"Update_Score"]]]]],[[-1,29,null,554065366738627,false,[[11,"myScore"],[7,[20,0,38,false,null,[[0,0]]]]]],[34,45,null,997614812950102,false,[[7,[10,[23,"myScore"],[2,"m"]]]]]],[[0,null,false,null,183769608884025,[[-1,27,null,0,false,false,false,986468962483867,false,[[11,"myBestDistance"],[8,1],[7,[0,0]]]]],[],[[0,null,false,null,215356396857096,[[-1,27,null,0,false,false,false,908793530525561,false,[[11,"myPreRecordBeaten"],[8,0],[7,[0,1]]]]],[[40,45,null,444575365633480,false,[[7,[10,[19,46,[[23,"myScore"],[19,36,[[6,[23,"myBestDistance"],[23,"SCORE_PER_PIXEL"]]]],[19,47]]],[2,"m"]]]]]]]]]]]]],[0,[true," Layout Params"],false,null,820859247570866,[[-1,23,null,0,false,false,false,820859247570866,false,[[1,[2," Layout Params"]]]]],[]],[1,"canvasWidth",0,0,false,false,649624717334055,false],[1,"canvasHeight",0,0,false,false,567330587603975,false],[1,"CANVAS_WIDTH",0,1280,false,false,504310959155005,false],[1,"CANVAS_HEIGHT",0,720,false,false,991893344878627,false],[1,"CANVAS_MID_X",0,0,false,false,665686665232915,false],[1,"CANVAS_MID_Y",0,0,false,false,772617476044288,false],[1,"canvasDeltaWidth",0,0,false,false,944334487217682,false],[1,"canvasDeltaHeight",0,0,false,false,479593720758289,false],[0,[true," Layout"],false,null,311076216714241,[[-1,23,null,0,false,false,false,311076216714241,false,[[1,[2," Layout"]]]]],[],[[0,null,false,null,736960205266658,[[0,30,null,2,false,false,false,408432197520810,false,[[1,[2,"Init_Layout"]]]]],[],[[0,null,false,null,338488814499947,[[-1,33,null,0,false,false,false,718549576879822,false,[[7,[19,48]],[8,0],[7,[2,"gamelayout"]]]]],[[-1,29,null,126799655868186,false,[[11,"CANVAS_MID_X"],[7,[6,[23,"CANVAS_WIDTH"],[1,0.5]]]]],[-1,29,null,199302616947421,false,[[11,"CANVAS_MID_Y"],[7,[6,[23,"CANVAS_HEIGHT"],[1,0.5]]]]],[-1,29,null,836443969200982,false,[[11,"canvasWidth"],[7,[5,[19,49,[[2,"hud"]]],[19,50,[[2,"hud"]]]]]]],[-1,29,null,824036948115675,false,[[11,"canvasHeight"],[7,[5,[19,51,[[2,"hud"]]],[19,52,[[2,"hud"]]]]]]],[-1,29,null,408359656809404,false,[[11,"canvasDeltaWidth"],[7,[5,[23,"canvasWidth"],[23,"CANVAS_WIDTH"]]]]],[-1,29,null,245097435480222,false,[[11,"canvasDeltaHeight"],[7,[5,[23,"canvasHeight"],[23,"CANVAS_HEIGHT"]]]]],[60,53,null,926536915448573,false,[[0,[4,[6,[3,[23,"canvasDeltaWidth"]],[1,0.5]],[0,60]]],[0,[4,[6,[3,[23,"canvasDeltaHeight"]],[1,0.5]],[0,50]]]]],[61,53,null,306065819293829,false,[[0,[5,[4,[23,"CANVAS_WIDTH"],[6,[23,"canvasDeltaWidth"],[1,0.5]]],[0,60]]],[0,[4,[6,[3,[23,"canvasDeltaHeight"]],[1,0.5]],[0,50]]]]],[65,53,null,766439569982447,false,[[0,[4,[6,[3,[23,"canvasDeltaWidth"]],[1,0.5]],[0,160]]],[0,[4,[6,[3,[23,"canvasDeltaHeight"]],[1,0.5]],[0,50]]]]],[66,53,null,522038314645816,false,[[0,[5,[4,[23,"CANVAS_WIDTH"],[6,[23,"canvasDeltaWidth"],[1,0.5]]],[0,160]]],[0,[4,[6,[3,[23,"canvasDeltaHeight"]],[1,0.5]],[0,50]]]]]],[[0,null,false,null,389051117448561,[[-1,27,null,0,false,false,false,941757520641249,false,[[11,"platform"],[8,1],[7,[23,"PLATFORM_FACEBOOK"]]]]],[[67,25,null,931891489575476,false],[65,25,null,101157885856693,false],[66,25,null,756022020748128,false]]]]]]]]],[0,[true,"Track Params"],false,null,743720788646250,[[-1,23,null,0,false,false,false,743720788646250,false,[[1,[2,"Track Params"]]]]],[]],[1,"TRACK_FRAMES",0,18,false,false,152153420929489,false],[1,"TRACK_UNIT_WIDTH",0,1536,false,false,740219448412646,false],[1,"TRACK_CHUNK_SIZE",0,5,false,false,712369006798388,false],[1,"TRACK_CHUNKS",0,8,false,false,971237539595264,false],[1,"TRACK_POS_Y",0,1440,false,false,528251733418207,false],[1,"TRACK_START_X",0,-500,false,false,444424934998042,false],[1,"trackSpawnX",0,0,false,false,490339833686346,false],[1,"chunkNo",0,0,false,false,669042399287224,false],[1,"trackTraceX",0,0,false,false,471837870337532,false],[1,"trackTraceX2",0,0,false,false,714996127780880,false],[0,[true,"Track"],false,null,410675441414955,[[-1,23,null,0,false,false,false,410675441414955,false,[[1,[2,"Track"]]]]],[],[[0,null,false,null,537167947413148,[[0,30,null,2,false,false,false,818271821014176,false,[[1,[2,"Init_TrackData"]]]]],[[21,54,null,108705903865104,false,[[0,[0,0]],[0,[0,1]],[0,[0,1]]]],[21,55,null,374396656643559,false,[[3,0],[7,[0,0]],[3,0]]]],[[1,"ind",0,0,false,false,856453917378342,false],[0,null,false,null,640127617641835,[[-1,56,null,0,true,false,false,605738294455533,false,[[1,[2,"i"]],[0,[0,0]],[0,[5,[23,"TRACK_CHUNKS"],[0,1]]]]]],[[20,54,null,729817707816958,false,[[0,[23,"TRACK_CHUNK_SIZE"]],[0,[0,1]],[0,[0,1]]]]],[[0,null,false,null,316242946295484,[[-1,39,null,0,true,false,false,952619086397562,false,[[0,[23,"TRACK_CHUNK_SIZE"]]]]],[[20,40,null,931255627015548,false,[[0,[19,41]],[7,[4,[4,[6,[19,41,[[2,"i"]]],[0,2]],[19,41]],[0,1]]]]]]],[0,null,false,null,451657535475925,[[-1,39,null,0,true,false,false,691421801696152,false,[[0,[23,"TRACK_CHUNK_SIZE"]]]]],[[-1,29,null,397199071380085,false,[[11,"ind"],[7,[19,36,[[19,57,[[20,20,58,false,null]]]]]]]],[21,55,null,812857642305512,false,[[3,0],[7,[20,20,43,false,null,[[23,"ind"]]]],[3,0]]],[20,59,null,126533686422895,false,[[0,[23,"ind"]],[3,0]]]]],[0,null,false,null,388276765366065,[[-1,33,null,0,false,false,false,354241929371968,false,[[7,[19,41,[[2,"i"]]]],[8,0],[7,[5,[23,"TRACK_CHUNKS"],[0,1]]]]]],[],[[0,null,false,null,613626021808415,[[-1,39,null,0,true,false,false,388021171731442,false,[[0,[5,[23,"TRACK_CHUNK_SIZE"],[0,1]]]]]],[[21,55,null,141040003289601,false,[[3,0],[7,[4,[19,41],[0,1]]],[3,0]]]]]]]]]]],[0,null,false,null,388428194977842,[[0,30,null,2,false,false,false,739270433278861,false,[[1,[2,"Init_Track"]]]]],[[74,25,null,882203844782810,false],[83,25,null,762695306305534,false],[81,25,null,451434675442334,false],[26,25,null,847453292189307,false],[-1,29,null,194456088553247,false,[[11,"trackSpawnX"],[7,[23,"TRACK_START_X"]]]],[-1,29,null,464197490319399,false,[[11,"chunkNo"],[7,[0,-1]]]],[-1,29,null,266697842961243,false,[[11,"trackTraceX"],[7,[5,[4,[23,"TRACK_START_X"],[6,[6,[1,1.5],[23,"TRACK_CHUNK_SIZE"]],[23,"TRACK_UNIT_WIDTH"]]],[6,[23,"TRACK_UNIT_WIDTH"],[1,0.5]]]]]]],[[0,null,false,null,918923413824990,[[-1,39,null,0,true,false,false,778399671945655,false,[[0,[0,3]]]]],[[0,26,null,951288805911054,false,[[1,[2,"Spawn_aTrackChunk"]],[13]]]]]]],[0,null,false,null,643377502522982,[[0,30,null,2,false,false,false,955132789452191,false,[[1,[2,"Spawn_aTrackChunk"]]]]],[[-1,60,null,753778241231172,false,[[11,"chunkNo"],[7,[0,1]]]]],[[1,"isTriggerChunk",0,0,false,false,993962527633049,false],[0,null,false,null,560624770381898,[[-1,39,null,0,true,false,false,218188536310107,false,[[0,[23,"TRACK_CHUNK_SIZE"]]]]],[[0,26,null,359384208302232,false,[[1,[2,"Spawn_aTrack"]],[13,[7,[20,21,43,false,null,[[4,[6,[23,"chunkNo"],[23,"TRACK_CHUNK_SIZE"]],[19,41]]]]],[7,[23,"chunkNo"]],[7,[19,41]]]]]]]]],[0,null,false,null,662364226500657,[[0,30,null,2,false,false,false,283638964852438,false,[[1,[2,"Spawn_aTrack"]]]]],[[-1,61,null,108331033041883,false,[[4,6],[5,[2,"track"]],[0,[23,"trackSpawnX"]],[0,[23,"TRACK_POS_Y"]]]],[6,62,null,497982131573200,false,[[0,[20,0,38,false,null,[[0,0]]]]]],[6,63,null,479168732404709,false,[[10,0],[7,[20,0,38,false,null,[[0,1]]]]]],[6,63,null,420752899734646,false,[[10,1],[7,[20,0,38,false,null,[[0,2]]]]]],[-1,60,null,482890061244613,false,[[11,"trackSpawnX"],[7,[23,"TRACK_UNIT_WIDTH"]]]]],[[0,null,false,null,895152604778120,[[6,64,null,0,false,false,false,778355634484534,false,[[8,0],[0,[0,1]]]]],[[6,63,null,781178465256844,false,[[10,2],[7,[0,7]]]]]],[0,null,true,null,649444832393868,[[6,64,null,0,false,false,false,768149344558681,false,[[8,0],[0,[0,2]]]],[6,64,null,0,false,false,false,667602374429293,false,[[8,0],[0,[0,3]]]],[6,64,null,0,false,false,false,203942973386118,false,[[8,0],[0,[0,6]]]],[6,64,null,0,false,false,false,212559965077726,false,[[8,0],[0,[0,7]]]],[6,64,null,0,false,false,false,323322389426356,false,[[8,0],[0,[0,10]]]],[6,64,null,0,false,false,false,497358608024311,false,[[8,0],[0,[0,11]]]],[6,64,null,0,false,false,false,701276576071463,false,[[8,0],[0,[0,12]]]],[6,64,null,0,false,false,false,867070772108549,false,[[8,0],[0,[0,13]]]],[6,64,null,0,false,false,false,686146820762032,false,[[8,0],[0,[0,17]]]]],[[6,63,null,994636184434817,false,[[10,2],[7,[0,5]]]]]],[0,null,true,null,786067795148529,[[6,64,null,0,false,false,false,919800142842229,false,[[8,0],[0,[0,4]]]],[6,64,null,0,false,false,false,770267250856990,false,[[8,0],[0,[0,8]]]],[6,64,null,0,false,false,false,553183605108644,false,[[8,0],[0,[0,9]]]]],[[6,63,null,971112525597742,false,[[10,2],[7,[0,6]]]]]],[0,null,true,null,926733930269613,[[6,64,null,0,false,false,false,869176794006339,false,[[8,0],[0,[0,5]]]],[6,64,null,0,false,false,false,322137935441754,false,[[8,0],[0,[0,14]]]],[6,64,null,0,false,false,false,991223907216166,false,[[8,0],[0,[0,15]]]],[6,64,null,0,false,false,false,519765290662407,false,[[8,0],[0,[0,16]]]]],[[6,63,null,770170243000931,false,[[10,2],[7,[0,4]]]]]],[0,null,false,null,956495763962661,[[-1,39,null,0,true,false,false,732174759429699,false,[[0,[21,6,false,null,2]]]]],[[-1,61,null,704398916605024,false,[[4,23],[5,[2,"track"]],[0,[20,6,65,false,null,[[10,[2,"coin_p"],[19,41]]]]],[0,[4,[20,6,66,false,null,[[10,[2,"coin_p"],[19,41]]]],[0,5]]]]]]],[0,null,false,null,426658881520619,[[6,67,null,0,false,false,false,251717797519682,false,[[10,1],[8,0],[7,[0,2]]]]],[[0,26,null,833730161675056,false,[[1,[2,"Spawn_aPowerUp"]],[13,[7,[20,6,65,false,null,[[2,"power_up"]]]],[7,[20,6,66,false,null,[[2,"power_up"]]]],[7,[19,68,[[2,"FREEZE"],[2,"MAGNET"]]]]]]]]],[0,null,false,null,753120119510402,[],[]]]],[0,null,false,null,724500777646472,[[0,30,null,2,false,false,false,417598177808988,false,[[1,[2,"On_TrackMid_Covered"]]]]],[[9,69,null,834627371828335,false,[[3,0],[7,[2,""]]]],[-1,60,null,913983907892311,false,[[11,"trackTraceX"],[7,[6,[23,"TRACK_CHUNK_SIZE"],[23,"TRACK_UNIT_WIDTH"]]]]]],[[0,null,false,null,514617009646078,[[74,67,null,0,false,false,false,895358423586741,false,[[10,0],[8,0],[7,[5,[23,"chunkNo"],[0,3]]]]]],[[0,26,null,394177119701860,false,[[1,[2,"Destroy_This_TrackChunk"]],[13,[7,[21,74,false,null,0]]]]]]],[0,null,false,null,193560267202302,[[74,67,null,0,false,false,false,920410944045111,false,[[10,0],[8,0],[7,[5,[23,"chunkNo"],[0,2]]]]]],[],[[0,null,false,null,718048869770936,[[74,67,null,0,false,false,false,328708443133390,false,[[10,1],[8,0],[7,[5,[23,"TRACK_CHUNK_SIZE"],[0,1]]]]]],[[-1,61,null,203249864428260,false,[[4,22],[5,[2,"track"]],[0,[20,74,65,false,null,[[2,"right"]]]],[0,[20,74,66,false,null,[[2,"right"]]]]]]]]]],[0,null,false,null,662259695137957,[[74,67,null,0,false,false,false,523219932950758,false,[[10,0],[8,5],[7,[23,"TRACK_CHUNKS"]]]]],[],[[0,null,false,null,220625051191690,[[-1,39,null,0,true,false,false,955666051462116,false,[[0,[23,"TRACK_CHUNK_SIZE"]]]]],[[21,55,null,924634456425842,false,[[3,0],[7,[4,[0,13],[19,36,[[19,57,[[0,5]]]]]]],[3,0]]]]]]],[0,null,false,null,554844860703545,[],[[0,26,null,558154221343581,false,[[1,[2,"Spawn_aTrackChunk"]],[13]]]]]]],[0,null,false,null,769648508840369,[[0,30,null,2,false,false,false,545978088652532,false,[[1,[2,"Destroy_This_TrackChunk"]]]]],[],[[0,null,false,null,971669625025442,[[74,67,null,0,false,false,false,231061165079985,false,[[10,0],[8,0],[7,[20,0,38,false,null,[[0,0]]]]]]],[[74,25,null,880335809004239,false]]]]]]],[0,[true,"Power Ups Params"],false,null,979306291238837,[[-1,23,null,0,false,false,false,979306291238837,false,[[1,[2,"Power Ups Params"]]]]],[]],[1,"MAGNET_TIME",0,6,false,false,670345262987024,false],[1,"FREEZE_TIME",0,4,false,false,309093370166949,false],[0,[true,"Power Ups"],false,null,190246459742705,[[-1,23,null,0,false,false,false,190246459742705,false,[[1,[2,"Power Ups"]]]]],[],[[0,null,false,null,879381637302131,[[0,30,null,2,false,false,false,544756987139735,false,[[1,[2,"Spawn_aPowerUp"]]]]],[[-1,61,null,624374165193683,false,[[4,26],[5,[2,"track"]],[0,[20,0,38,false,null,[[0,0]]]],[0,[20,0,38,false,null,[[0,1]]]]]],[-1,61,null,476335151780746,false,[[4,25],[5,[2,"track"]],[0,[20,0,38,false,null,[[0,0]]]],[0,[20,0,38,false,null,[[0,1]]]]]],[25,63,null,968409174557607,false,[[10,4],[7,[20,26,70,false,null]]]],[25,63,null,119467451560469,false,[[10,3],[7,[20,0,38,false,null,[[0,2]]]]]]],[[0,null,false,null,129836426083615,[[0,71,null,0,false,false,false,701500952811546,false,[[0,[0,2]],[8,0],[7,[2,"MAGNET"]]]]],[[25,63,null,332082286202484,false,[[10,5],[7,[23,"MAGNET_TIME"]]]],[25,72,null,193693038398400,false,[[0,[1,0.75]]]],[25,63,null,697749042641726,false,[[10,1],[7,[20,25,73,false,null]]]],[25,63,null,918039346052709,false,[[10,2],[7,[20,25,74,false,null]]]],[25,62,null,914994953364111,false,[[0,[0,0]]]],[26,72,null,947626102049996,false,[[0,[1,0.5]]]],[26,75,"Sine",195284671271279,false],[26,76,"Pin",186942129909556,false,[[4,25],[3,1]]]]],[0,null,false,null,728292789557356,[[0,71,null,0,false,false,false,192046844881757,false,[[0,[0,2]],[8,0],[7,[2,"FREEZE"]]]]],[[25,63,null,395427131005051,false,[[10,5],[7,[23,"FREEZE_TIME"]]]],[25,72,null,336085872967439,false,[[0,[1,0.85]]]],[25,63,null,368297811943689,false,[[10,1],[7,[20,25,73,false,null]]]],[25,63,null,800658677748378,false,[[10,2],[7,[20,25,74,false,null]]]],[25,62,null,991881625851354,false,[[0,[0,1]]]],[26,72,null,386294665174990,false,[[0,[1,0.5]]]],[26,75,"Sine",867989170495663,false],[26,76,"Pin",572990281883197,false,[[4,25],[3,1]]]]]]],[0,null,false,null,856084650504685,[[0,30,null,2,false,false,false,531043529533752,false,[[1,[2,"Pick_aPowerUp"]]]]],[],[[0,null,false,null,546198922839836,[[81,77,null,0,false,false,true,682983466995248,false,[[0,[20,0,38,false,null,[[0,0]]]]]]],[[81,78,null,619611789910255,false,[[10,0],[3,1]]],[0,26,null,266293774890609,false,[[1,[2,"Activate_aPowerBar"]],[13,[7,[21,81,true,null,3]],[7,[21,81,false,null,5]]]]]],[[0,null,false,null,107461684836105,[[71,79,null,0,false,false,false,316132213000073,false,[[10,5]]]],[],[[0,null,false,null,577374346038826,[[81,67,null,0,false,false,false,397852543034170,false,[[10,3],[8,0],[7,[2,"MAGNET"]]]]],[[71,78,null,197881915292169,false,[[10,13],[3,1]]]]],[0,null,false,null,796000847420000,[[81,67,null,0,false,false,false,167138834368187,false,[[10,3],[8,0],[7,[2,"FREEZE"]]]]],[[71,78,null,304888870640405,false,[[10,14],[3,1]]]],[[0,null,false,null,661431451235460,[[73,80,"Chipmunk",0,false,true,false,622921013182021,false]],[[73,81,"Chipmunk",987809242890104,false,[[3,0]]],[73,76,"Pin",926069479824789,false,[[4,71],[3,0]]],[73,82,null,386034115377396,false,[[4,44],[5,[2,"track"]],[7,[0,0]]]],[44,72,null,158556648137965,false,[[0,[23,"EGG_SCALE"]]]],[44,83,null,686188652901297,false,[[0,[20,73,84,false,null]]]],[44,76,"Pin",298753171615990,false,[[4,73],[3,0]]],[0,26,null,860236463220073,false,[[1,[2,"Play_GpSound"]],[13,[7,[2,"ice"]]]]]]]]]]],[0,null,false,null,840739896726121,[[26,77,null,0,false,false,true,870948989344288,false,[[0,[21,81,false,null,4]]]]],[[26,25,null,827518171790592,false]]]]]]],[0,null,false,null,471743485058267,[[81,79,null,0,false,false,false,961351830220031,false,[[10,0]]]],[[81,85,null,831088011554311,false,[[0,[5,[20,81,86,false,null],[6,[0,200],[19,87]]]]]],[81,88,null,867705593784601,false,[[0,[5,[20,81,89,false,null],[6,[0,200],[19,87]]]]]]],[[0,null,false,null,154459014944370,[[81,90,null,0,false,false,false,259643618897835,false,[[8,3],[0,[0,0]]]]],[[81,25,null,934296823327656,false]]]]],[0,null,false,null,296988038968650,[[0,30,null,2,false,false,false,390485956869036,false,[[1,[2,"Destroy_PowerUps"]]]]],[[81,25,null,831476274225764,false],[26,25,null,227688767158304,false]]]]],[0,[true,"Coins"],false,null,826232856607046,[[-1,23,null,0,false,false,false,826232856607046,false,[[1,[2,"Coins"]]]]],[],[[0,null,false,null,959263935126759,[[0,30,null,2,false,false,false,199589632171551,false,[[1,[2,"Pick_aCoin"]]]]],[],[[1,"beforeLastX",0,0,false,false,290713513031859,false],[1,"beforeLastY",0,0,false,false,138758675563261,false],[1,"acuDistance",0,0,false,false,759865204381436,false],[1,"directionAngle",0,0,false,false,563802270222173,false],[1,"oY",0,75,false,false,569879109850544,false],[0,null,false,null,126973433977447,[[83,77,null,0,false,false,true,889500829556510,false,[[0,[20,0,38,false,null,[[0,0]]]]]]],[[0,26,null,519084110400795,false,[[1,[2,"Play_GpSound"]],[13,[7,[2,"coin"]]]]],[83,78,null,732139218941500,false,[[10,0],[3,1]]],[83,78,null,549390077483889,false,[[10,1],[3,0]]],[83,91,null,728491042585143,false,[[5,[2,"hud"]]]],[83,92,null,233572404956215,false],[83,53,null,455919466210849,false,[[0,[4,[5,[20,83,93,false,null],[19,94]],[23,"CANVAS_MID_X"]]],[0,[4,[5,[20,83,86,false,null],[19,95]],[23,"CANVAS_MID_Y"]]]]],[-1,29,null,937869152845332,false,[[11,"beforeLastX"],[7,[4,[20,28,93,false,null],[0,25]]]]],[-1,29,null,992069629942813,false,[[11,"beforeLastY"],[7,[4,[20,28,86,false,null],[0,35]]]]],[-1,29,null,661631044978626,false,[[11,"acuDistance"],[7,[19,96,[[20,83,93,false,null],[5,[20,83,86,false,null],[23,"oY"]],[23,"beforeLastX"],[23,"beforeLastY"]]]]]],[-1,29,null,184187144565938,false,[[11,"directionAngle"],[7,[19,97,[[20,83,93,false,null],[5,[20,83,86,false,null],[23,"oY"]],[23,"beforeLastX"],[23,"beforeLastY"]]]]]]],[[0,null,false,null,700984253443349,[],[[83,98,null,428916916578558,false],[83,62,null,294766537750232,false,[[0,[0,0]]]],[83,99,"Spline",218220171353619,false],[83,100,"Spline",557882670075141,false,[[0,[20,83,93,false,null]],[0,[20,83,86,false,null]]]],[83,100,"Spline",713455142004980,false,[[0,[20,83,93,false,null]],[0,[5,[20,83,86,false,null],[23,"oY"]]]]],[83,100,"Spline",377175054678313,false,[[0,[4,[20,83,93,false,null],[6,[6,[1,0.5],[23,"acuDistance"]],[19,101,[[23,"directionAngle"]]]]]],[0,[4,[5,[20,83,86,false,null],[23,"oY"]],[6,[6,[1,0.5],[23,"acuDistance"]],[19,102,[[23,"directionAngle"]]]]]]]],[83,100,"Spline",701406237433349,false,[[0,[23,"beforeLastX"]],[0,[23,"beforeLastY"]]]],[83,100,"Spline",216031031226025,false,[[0,[20,28,93,false,null]],[0,[20,28,86,false,null]]]],[83,103,"Spline",376160298145360,false],[83,104,"Fade",383039279289533,false]]]]]]],[0,null,false,null,576612736025000,[[83,105,"Spline",1,false,false,false,465760410048109,false]],[],[[0,null,false,null,419572366506438,[[-1,106,null,0,true,false,false,831319783392108,false,[[4,83]]]],[[83,25,null,280478574318639,false],[0,26,null,203478524102700,false,[[1,[2,"Play_GpSound"]],[13,[7,[2,"coin_collect"]]]]],[0,26,null,862923441165914,false,[[1,[2,"Update_Coins"]],[13,[7,[4,[23,"myCoins"],[0,1]]]]]],[0,26,null,902148239333066,false,[[1,[2,"Play_CoinIcon_Animation"]],[13]]]]]]],[0,null,false,null,243905903608229,[[83,79,null,0,false,false,false,997211884438311,false,[[10,1]]]],[[83,107,null,642336366818120,false,[[0,[19,97,[[20,83,93,false,null],[20,83,86,false,null],[20,71,93,false,null],[20,71,86,false,null]]]],[0,[6,[0,800],[19,87]]]]]],[[0,null,false,null,781661155336083,[[83,108,null,0,false,false,false,519045069950443,false,[[4,74],[0,[0,0]],[0,[0,25]]]]],[[83,85,null,274869430759891,false,[[0,[5,[20,83,86,false,null],[6,[0,250],[19,87]]]]]]]],[0,null,false,null,808648363592758,[[83,108,null,0,false,true,false,420236375163921,false,[[4,74],[0,[0,0]],[0,[0,40]]]]],[[83,85,null,715551557525381,false,[[0,[4,[20,83,86,false,null],[6,[0,250],[19,87]]]]]]]]]]]],[0,[true,"Control Params"],false,null,301741459470168,[[-1,23,null,0,false,false,false,301741459470168,false,[[1,[2,"Control Params"]]]]],[]],[1,"gameSequence",0,0,false,false,786045216911323,false],[1,"soundOn",0,1,false,false,628880825676308,false],[1,"isTutorialActive",0,1,false,false,887738943596555,false],[1,"musicOn",0,1,false,false,486475731544481,false],[1,"DEBUG_MODE",0,0,false,false,877571498333277,false],[1,"GAME_START",0,0,false,false,237216155741071,false],[1,"playCount",0,0,false,false,961953942609942,false],[1,"saveGS",0,0,false,false,911926045797493,false],[0,[true,"Game Manager"],false,null,454070649154455,[[-1,23,null,0,false,false,false,454070649154455,false,[[1,[2,"Game Manager"]]]]],[],[[0,null,false,null,717158303815325,[[0,30,null,2,false,false,false,923748497223632,false,[[1,[2,"Init_PreGame"]]]]],[[0,26,null,399740093430801,false,[[1,[2,"Clean_CarManager"]],[13]]],[-1,109,null,358516341727325,false,[[0,[23,"startX"]],[0,[5,[19,110],[0,700]]]]],[0,26,null,393843021521817,false,[[1,[2,"Destroy_Hud"]],[13]]],[0,26,null,120486225044053,false,[[1,[2,"Init_Track"]],[13]]],[0,26,null,632796940666401,false,[[1,[2,"Init_Props"]],[13]]]]],[0,null,false,null,397694503518675,[[0,30,null,2,false,false,false,270818355406562,false,[[1,[2,"Start_Game"]]]]],[[-1,60,null,900543748567619,false,[[11,"playCount"],[7,[0,1]]]],[0,26,null,264855384269107,false,[[1,[2,"Init_CarManager"]],[13]]],[0,26,null,302874831396705,false,[[1,[2,"Init_Hud"]],[13]]],[-1,29,null,817157098802436,false,[[11,"GAME_START"],[7,[0,1]]]],[-1,29,null,691343318789871,false,[[11,"isControllerActive"],[7,[0,1]]]]],[[0,null,false,null,309220318117875,[[-1,27,null,0,false,false,false,151294536547858,false,[[11,"myBestDistance"],[8,1],[7,[0,0]]]]],[[-1,29,null,396511711398849,false,[[11,"myPreRecordBeaten"],[7,[0,0]]]],[0,26,null,211767696573652,false,[[1,[2,"Spawn_preBest_Mark"]],[13,[7,[4,[23,"startX"],[23,"myBestDistance"]]],[7,[19,36,[[6,[23,"myBestDistance"],[23,"SCORE_PER_PIXEL"]]]]]]]]]],[0,null,false,null,768297301405302,[[-1,27,null,0,false,false,false,307031127410238,false,[[11,"platform"],[8,0],[7,[23,"PLATFORM_FACEBOOK"]]]]],[[0,26,null,575088635223066,false,[[1,[2,"Init_Challenge"]],[13,[7,[23,"myBestDistance"]]]]]]]]],[0,null,false,null,355977286909666,[[0,30,null,2,false,false,false,978207032788640,false,[[1,[2,"End_Game"]]]]],[[-1,29,null,807227907206892,false,[[11,"GAME_START"],[7,[0,0]]]],[-1,29,null,752756478132115,false,[[11,"isControllerActive"],[7,[0,0]]]],[-1,29,null,354142826239837,false,[[11,"gameSequence"],[7,[23,"SEQ_TUTORIAL"]]]]],[[0,null,false,null,844978116661477,[[-1,27,null,0,false,false,false,602779694076923,false,[[11,"myLastDistance"],[8,4],[7,[23,"myBestDistance"]]]]],[[0,26,null,180371143541658,false,[[1,[2,"Update_BestDistance"]],[13,[7,[23,"myLastDistance"]]]]]],[[0,null,false,null,632780041694527,[[-1,27,null,0,false,false,false,758330137703079,false,[[11,"platform"],[8,0],[7,[23,"PLATFORM_FACEBOOK"]]]]],[[9,111,null,933585259499238,false,[[1,[10,[10,[2,"onFB_gameOver("],[19,36,[[23,"myBestDistance"]]]],[2,");"]]]]]]]]],[0,null,false,null,828150914876420,[[71,79,null,0,false,false,false,790572889137470,false,[[10,5]]]],[[71,78,null,464284003751806,false,[[10,4],[3,0]]]]],[0,null,false,null,579084982558050,[],[[-1,112,null,746435059746231,false,[[0,[1,2.5]]]],[0,26,null,770258174733526,false,[[1,[2,"Play_MM_Animation"]],[13,[7,[2,"forward"]]]]],[0,26,null,939257470138765,false,[[1,[2,"Destroy_Hud"]],[13]]],[0,26,null,660106283467555,false,[[1,[2,"Destroy_Challenge"]],[13]]],[-1,29,null,539104603563352,false,[[11,"gameSequence"],[7,[23,"SEQ_MENU"]]]]]]]]]],[0,[true,"Props"],false,null,306202166633113,[[-1,23,null,0,false,false,false,306202166633113,false,[[1,[2,"Props"]]]]],[],[[0,null,false,null,252674553072306,[[0,30,null,2,false,false,false,932053382212355,false,[[1,[2,"Destroy_Props"]]]]],[[79,25,null,252869437819445,false],[35,113,null,388960336648590,false],[36,25,null,726329730056744,false],[37,114,null,175477866473294,false],[38,113,null,318845983448113,false]]],[0,null,false,null,183693757925311,[[0,30,null,2,false,false,false,417782866330564,false,[[1,[2,"Init_Props"]]]]],[[0,26,null,335421166270674,false,[[1,[2,"Destroy_Props"]],[13]]],[-1,61,null,411186825155439,false,[[4,22],[5,[2,"track"]],[0,[5,[23,"startX"],[0,300]]],[0,[5,[23,"TRACK_POS_Y"],[0,452]]]]]]],[0,null,false,null,787028717893455,[[0,30,null,2,false,false,false,429980293337979,false,[[1,[2,"Spawn_preBest_Mark"]]]]],[],[[1,"deltaY",0,40,false,false,963684891520039,false],[1,"oY",0,75,false,false,626602581588027,false],[0,null,false,null,743954128086560,[],[[-1,61,null,805115171361754,false,[[4,37],[5,[2,"track"]],[0,[20,0,38,false,null,[[0,0]]]],[0,[4,[5,[6,[19,110],[1,0.5]],[23,"deltaY"]],[23,"oY"]]]]],[37,115,null,274197991923630,false,[[10,0],[7,[2,"best"]]]],[37,116,null,358563266134347,false,[[0,[0,2]],[0,[0,4000]]]],[37,117,null,642842001932161,false,[[0,[0,0]]]],[-1,61,null,804390115289127,false,[[4,37],[5,[2,"track"]],[0,[20,0,38,false,null,[[0,0]]]],[0,[4,[4,[6,[19,110],[1,0.5]],[23,"deltaY"]],[23,"oY"]]]]],[37,115,null,494067232808610,false,[[10,0],[7,[2,"best"]]]],[37,116,null,290509439756085,false,[[0,[0,2]],[0,[0,2000]]]],[37,117,null,131007834183546,false,[[0,[0,180]]]],[-1,61,null,150082219417041,false,[[4,36],[5,[2,"track"]],[0,[20,0,38,false,null,[[0,0]]]],[0,[4,[6,[19,110],[1,0.5]],[23,"oY"]]]]],[36,83,null,622739069826952,false,[[0,[0,-10]]]],[36,63,null,932028223282482,false,[[10,1],[7,[0,1]]]],[36,78,null,546340110724141,false,[[10,0],[3,1]]],[-1,61,null,354921166827581,false,[[4,38],[5,[2,"track"]],[0,[20,36,93,false,null]],[0,[4,[20,36,86,false,null],[0,5]]]]],[38,45,null,854605390357415,false,[[7,[10,[20,0,38,false,null,[[0,1]]],[2,"m"]]]]],[38,118,null,874482613455181,false,[[10,0],[7,[2,"best"]]]]]]]],[0,null,false,null,110140726599460,[[0,30,null,2,false,false,false,462521670346277,false,[[1,[2,"On_BestLine_Crossed"]]]]],[[0,26,null,761392970431526,false,[[1,[2,"Play_UISound"]],[13,[7,[2,"unlock"]]]]],[-1,29,null,271533479079255,false,[[11,"myPreRecordBeaten"],[7,[0,1]]]],[36,82,null,667350233644112,false,[[4,39],[5,[2,"track"]],[7,[0,0]]]],[36,25,null,476357783880574,false]],[[0,null,false,null,695481259921469,[[37,119,null,0,false,false,false,977643557979914,false,[[10,0],[8,0],[7,[2,"best"]]]]],[[37,114,null,618871174946180,false]]],[0,null,false,null,633355927642346,[[38,120,null,0,false,false,false,743097930850285,false,[[10,0],[8,0],[7,[2,"best"]]]]],[[38,113,null,644131381976876,false]]]]],[0,null,false,null,268081114831630,[[0,30,null,2,false,false,false,164806710581336,false,[[1,[2,"Spawn_Challenge_Mark"]]]]],[],[[1,"deltaY",0,40,false,false,873834794563380,false],[1,"oY",0,75,false,false,695302287297320,false],[0,null,false,null,136105823084772,[],[[-1,61,null,328963599145961,false,[[4,37],[5,[2,"track"]],[0,[20,0,38,false,null,[[0,0]]]],[0,[4,[5,[6,[19,110],[1,0.5]],[23,"deltaY"]],[23,"oY"]]]]],[37,115,null,467362203886032,false,[[10,0],[7,[2,"challenge"]]]],[37,116,null,832151549334137,false,[[0,[0,2]],[0,[0,4000]]]],[37,117,null,695781642678912,false,[[0,[0,0]]]],[-1,61,null,753322180759386,false,[[4,37],[5,[2,"track"]],[0,[20,0,38,false,null,[[0,0]]]],[0,[4,[4,[4,[6,[19,110],[1,0.5]],[23,"deltaY"]],[23,"oY"]],[0,40]]]]],[37,115,null,751946880838505,false,[[10,0],[7,[2,"challenge"]]]],[37,116,null,524747231830304,false,[[0,[0,2]],[0,[0,2000]]]],[37,117,null,163771059026990,false,[[0,[0,180]]]],[-1,61,null,445986124820631,false,[[4,69],[5,[2,"track"]],[0,[20,0,38,false,null,[[0,0]]]],[0,[4,[6,[19,110],[1,0.5]],[23,"oY"]]]]],[69,121,null,384299962324712,false,[[0,[0,80]],[0,[0,80]]]],[69,63,null,235875118170789,false,[[10,0],[7,[2,"challenge"]]]],[-1,61,null,309815825043873,false,[[4,38],[5,[2,"track"]],[0,[20,69,93,false,null]],[0,[4,[4,[20,69,86,false,null],[6,[20,69,74,false,null],[1,0.5]]],[0,18]]]]],[38,45,null,853865048556094,false,[[7,[10,[20,0,38,false,null,[[0,1]]],[2,"m"]]]]],[38,118,null,658634730275314,false,[[10,0],[7,[2,"challenge"]]]],[38,122,null,141372644455087,false,[[0,[0,24]]]]]]]],[0,null,false,null,259877203909015,[[0,30,null,2,false,false,false,553148664541306,false,[[1,[2,"On_ChallengeLine_Crossed"]]]]],[[0,26,null,196466220653267,false,[[1,[2,"Play_UISound"]],[13,[7,[2,"challenge_won"]]]]]],[[0,null,false,null,249160065796662,[[69,67,null,0,false,false,false,282631637520811,false,[[10,0],[8,0],[7,[2,"challenge"]]]]],[[69,82,null,334710930799540,false,[[4,39],[5,[2,"track"]],[7,[0,0]]]],[69,25,null,785434952862049,false]]],[0,null,false,null,779737788623659,[[37,119,null,0,false,false,false,414503150354761,false,[[10,0],[8,0],[7,[2,"challenge"]]]]],[[37,114,null,761519321716677,false]]],[0,null,false,null,629071091422750,[[38,120,null,0,false,false,false,821019749004113,false,[[10,0],[8,0],[7,[2,"challenge"]]]]],[[38,113,null,281779560725089,false]]]]]]],[0,[true,"Day Night Params"],false,null,782974879425495,[[-1,23,null,0,false,false,false,782974879425495,false,[[1,[2,"Day Night Params"]]]]],[]],[1,"DAY_TIME",0,60,false,false,708360471180972,false],[1,"NIGHT_TIME",0,20,false,false,187183382430521,false],[1,"NIGHT_STRENGTH",0,75,false,false,749270969996475,false],[1,"dayTc",0,0,false,false,128592297244047,false],[1,"dayState",1,"day",false,false,840374122927345,false],[1,"isDayTransitioning",0,0,false,false,129166961213680,false],[1,"dayVfxCounter",0,0,false,false,325979807641624,false],[0,[true,"Day Night"],false,null,446462024556510,[[-1,23,null,0,false,false,false,446462024556510,false,[[1,[2,"Day Night"]]]]],[],[[0,null,false,null,558321981905273,[[-1,123,null,0,false,false,false,283325998030906,false,[[0,[0,1]]]]],[[-1,60,null,789113191684120,false,[[11,"dayTc"],[7,[0,1]]]]],[[0,null,false,null,796166053992966,[[-1,27,null,0,false,false,false,975743627450555,false,[[11,"dayState"],[8,0],[7,[2,"day"]]]]],[],[[0,null,false,null,981393399533872,[[-1,27,null,0,false,false,false,405353054614818,false,[[11,"dayTc"],[8,5],[7,[23,"DAY_TIME"]]]]],[[-1,124,null,999531511575982,false,[[11,"dayTc"],[7,[23,"DAY_TIME"]]]],[0,26,null,857188027959815,false,[[1,[2,"Update_DayNight"]],[13,[7,[2,"night"]]]]]]]]],[0,null,false,null,457539442417221,[[-1,27,null,0,false,false,false,779921003636067,false,[[11,"dayState"],[8,0],[7,[2,"night"]]]]],[],[[0,null,false,null,818813143242051,[[-1,27,null,0,false,false,false,875773988083363,false,[[11,"dayTc"],[8,5],[7,[23,"NIGHT_TIME"]]]]],[[-1,124,null,567161400698076,false,[[11,"dayTc"],[7,[23,"NIGHT_TIME"]]]],[0,26,null,360428599949316,false,[[1,[2,"Update_DayNight"]],[13,[7,[2,"day"]]]]]]]]]]],[0,null,false,null,798232809125443,[[0,30,null,2,false,false,false,514165562529185,false,[[1,[2,"Update_DayNight"]]]]],[[-1,29,null,466220278062044,false,[[11,"dayState"],[7,[20,0,38,false,null,[[0,0]]]]]],[-1,29,null,567901165042010,false,[[11,"isDayTransitioning"],[7,[0,1]]]]],[[0,null,false,null,737239319875809,[[-1,27,null,0,false,false,false,790076525491857,false,[[11,"dayState"],[8,0],[7,[2,"day"]]]]],[[-1,29,null,138785425164952,false,[[11,"dayVfxCounter"],[7,[23,"NIGHT_STRENGTH"]]]]]],[0,null,false,null,276396164651546,[[-1,27,null,0,false,false,false,264578327123564,false,[[11,"dayState"],[8,0],[7,[2,"night"]]]]],[[-1,29,null,736541665532201,false,[[11,"dayVfxCounter"],[7,[0,100]]]]]]]],[0,null,false,null,462546152105687,[[-1,27,null,0,false,false,false,228706850118179,false,[[11,"isDayTransitioning"],[8,0],[7,[0,1]]]]],[],[[0,null,false,null,632060956053450,[[-1,27,null,0,false,false,false,550196048053282,false,[[11,"dayState"],[8,0],[7,[2,"day"]]]]],[[-1,60,null,263135198299168,false,[[11,"dayVfxCounter"],[7,[6,[0,10],[19,87]]]]],[-1,125,null,559123335758892,false,[[5,[2,"bg"]],[1,[2,"Brightness"]],[0,[0,0]],[0,[23,"dayVfxCounter"]]]],[-1,125,null,191382518891651,false,[[5,[2,"parallax"]],[1,[2,"Brightness"]],[0,[0,0]],[0,[23,"dayVfxCounter"]]]],[-1,125,null,729856774445576,false,[[5,[2,"track"]],[1,[2,"Brightness"]],[0,[0,0]],[0,[23,"dayVfxCounter"]]]]],[[0,null,false,null,713236415986066,[[-1,27,null,0,false,false,false,803618605512845,false,[[11,"dayVfxCounter"],[8,5],[7,[0,100]]]]],[[-1,29,null,763007327482812,false,[[11,"isDayTransitioning"],[7,[0,0]]]],[-1,29,null,574050256553932,false,[[11,"dayVfxCounter"],[7,[0,100]]]],[-1,125,null,334538473461804,false,[[5,[2,"bg"]],[1,[2,"Brightness"]],[0,[0,0]],[0,[23,"dayVfxCounter"]]]],[-1,125,null,331275407358125,false,[[5,[2,"parallax"]],[1,[2,"Brightness"]],[0,[0,0]],[0,[23,"dayVfxCounter"]]]],[-1,125,null,759872348938679,false,[[5,[2,"track"]],[1,[2,"Brightness"]],[0,[0,0]],[0,[23,"dayVfxCounter"]]]]]]]],[0,null,false,null,641251088512543,[[-1,27,null,0,false,false,false,623935581116924,false,[[11,"dayState"],[8,0],[7,[2,"night"]]]]],[[-1,60,null,678245838288213,false,[[11,"dayVfxCounter"],[7,[6,[0,-10],[19,87]]]]],[-1,125,null,148486079323013,false,[[5,[2,"bg"]],[1,[2,"Brightness"]],[0,[0,0]],[0,[23,"dayVfxCounter"]]]],[-1,125,null,384835260642657,false,[[5,[2,"parallax"]],[1,[2,"Brightness"]],[0,[0,0]],[0,[23,"dayVfxCounter"]]]],[-1,125,null,502521906360422,false,[[5,[2,"track"]],[1,[2,"Brightness"]],[0,[0,0]],[0,[23,"dayVfxCounter"]]]]],[[0,null,false,null,723362861907641,[[-1,27,null,0,false,false,false,562538112650060,false,[[11,"dayVfxCounter"],[8,3],[7,[23,"NIGHT_STRENGTH"]]]]],[[-1,29,null,370965143205566,false,[[11,"isDayTransitioning"],[7,[0,0]]]],[-1,29,null,524288732042422,false,[[11,"dayVfxCounter"],[7,[23,"NIGHT_STRENGTH"]]]],[-1,125,null,373129049209402,false,[[5,[2,"bg"]],[1,[2,"Brightness"]],[0,[0,0]],[0,[23,"dayVfxCounter"]]]],[-1,125,null,364622071064637,false,[[5,[2,"parallax"]],[1,[2,"Brightness"]],[0,[0,0]],[0,[23,"dayVfxCounter"]]]],[-1,125,null,953791727855844,false,[[5,[2,"track"]],[1,[2,"Brightness"]],[0,[0,0]],[0,[23,"dayVfxCounter"]]]]]]]],[0,null,false,null,764154373749859,[],[[19,88,null,875236258843667,false,[[0,[23,"dayVfxCounter"]]]]]]]]]],[1,"bgTrackVolume",0,-10,false,false,930704992104592,false],[1,"bgTrack_nVolume",0,-10,false,false,889950782990257,false],[1,"bgTrack_minVolume",0,-14,false,false,908604958364391,false],[0,[true,"SOUND"],false,null,249126202407988,[[-1,23,null,0,false,false,false,249126202407988,false,[[1,[2,"SOUND"]]]]],[],[[0,null,false,null,619842961153638,[[0,30,null,2,false,false,false,205244248628111,false,[[1,[2,"Update_Sound"]]]]],[[-1,29,null,946575081518567,false,[[11,"soundOn"],[7,[20,0,38,false,null,[[0,0]]]]]],[31,44,null,962163451510457,false,[[1,[10,[23,"PREFIX"],[2,"sound"]]],[7,[23,"soundOn"]]]],[60,62,null,300268423675775,false,[[0,[23,"soundOn"]]]]]],[0,null,false,null,119416407719908,[[0,30,null,2,false,false,false,256641839806303,false,[[1,[2,"Update_Music"]]]]],[[-1,29,null,406479437705763,false,[[11,"musicOn"],[7,[20,0,38,false,null,[[0,0]]]]]],[31,44,null,769774392074900,false,[[1,[10,[23,"PREFIX"],[2,"music"]]],[7,[23,"musicOn"]]]],[61,62,null,958195861199280,false,[[0,[23,"musicOn"]]]]],[[0,null,false,null,980468983043160,[[-1,27,null,0,false,false,false,122896385727200,false,[[11,"musicOn"],[8,0],[7,[0,1]]]]],[[0,26,null,442050849579962,false,[[1,[2,"Resume_aTrack"]],[13,[7,[2,"gp_track"]]]]]]],[0,null,false,null,453007765263918,[[-1,37,null,0,false,false,false,709282709384497,false]],[[0,26,null,377297126313765,false,[[1,[2,"Pause_aTrack"]],[13,[7,[2,"gp_track"]]]]]]]]],[0,null,false,null,958435447126102,[[0,30,null,2,false,false,false,179079814047540,false,[[1,[2,"Play_GpTrack"]]]]],[[50,126,null,489000399763574,false,[[2,["bg-music",false]],[3,1],[0,[0,-10]],[1,[2,"gp_track"]]]]]],[0,null,false,null,910959392000901,[[0,30,null,2,false,false,false,456092163508386,false,[[1,[2,"Pause_aTrack"]]]]],[[50,127,null,184502886991589,false,[[1,[20,0,38,false,null,[[0,0]]]],[3,0]]]]],[0,null,false,null,493696983798373,[[0,30,null,2,false,false,false,287587140632008,false,[[1,[2,"Resume_aTrack"]]]]],[[50,127,null,452502825530867,false,[[1,[20,0,38,false,null,[[0,0]]]],[3,1]]]]],[0,null,false,null,359778601841654,[[0,30,null,2,false,false,false,492217503207306,false,[[1,[2,"Play_GpSound"]]]]],[],[[0,null,false,null,647677607249863,[[-1,27,null,0,false,false,false,658397634922666,false,[[11,"soundOn"],[8,0],[7,[0,1]]]]],[],[[0,null,false,null,418977478307535,[[0,71,null,0,false,false,false,303422081579070,false,[[0,[0,0]],[8,0],[7,[2,"coin"]]]]],[[50,126,null,459579841177981,false,[[2,["coin",false]],[3,0],[0,[0,-5]],[1,[2,"gp_audio"]]]]]],[0,null,false,null,339877900555107,[[0,71,null,0,false,false,false,939171873990235,false,[[0,[0,0]],[8,0],[7,[2,"coin_collect"]]]]],[[50,126,null,153019003509940,false,[[2,["coin_add",false]],[3,0],[0,[0,-5]],[1,[2,"gp_audio"]]]]]],[0,null,false,null,373755028010624,[[0,71,null,0,false,false,false,314491659672154,false,[[0,[0,0]],[8,0],[7,[2,"egg_broken"]]]]],[[50,126,null,816370866462561,false,[[2,["egg_broken",false]],[3,0],[0,[0,0]],[1,[2,"gp_audio"]]]]]],[0,null,false,null,993038589705157,[[0,71,null,0,false,false,false,679131523825644,false,[[0,[0,0]],[8,0],[7,[2,"egg_hit"]]]]],[[50,128,null,916818509068090,false,[[3,0],[1,[10,[2,"egg_hit_"],[20,0,38,false,null,[[0,1]]]]],[3,0],[0,[0,0]],[1,[2,""]]]]]],[0,null,false,null,916388498729046,[[0,71,null,0,false,false,false,968383856896471,false,[[0,[0,0]],[8,0],[7,[2,"ice"]]]]],[[50,126,null,509935604252653,false,[[2,["ice",false]],[3,0],[0,[0,0]],[1,[2,"gp_audio"]]]]]],[0,null,false,null,328054891214362,[[0,71,null,0,false,false,false,208338249234139,false,[[0,[0,0]],[8,0],[7,[2,"game_over"]]]]],[[50,126,null,132062819422507,false,[[2,["game_over",false]],[3,0],[0,[0,0]],[1,[2,""]]]]]]]]]],[0,null,false,null,928848042336494,[[0,30,null,2,false,false,false,955387294813468,false,[[1,[2,"Play_UISound"]]]]],[],[[0,null,false,null,262837960973862,[[-1,27,null,0,false,false,false,336309791463598,false,[[11,"soundOn"],[8,0],[7,[0,1]]]]],[],[[0,null,false,null,943983396217869,[[0,71,null,0,false,false,false,219003639879893,false,[[0,[0,0]],[8,0],[7,[2,"click_0"]]]]],[[50,126,null,257548921346924,false,[[2,["click_0",false]],[3,0],[0,[0,0]],[1,[2,""]]]]]],[0,null,false,null,108079103405225,[[0,71,null,0,false,false,false,320288833286926,false,[[0,[0,0]],[8,0],[7,[2,"not_ready"]]]]],[[50,126,null,333737137859016,false,[[2,["not_ready",false]],[3,0],[0,[0,0]],[1,[2,""]]]]]],[0,null,false,null,839207857324296,[[0,71,null,0,false,false,false,314278467345817,false,[[0,[0,0]],[8,0],[7,[2,"unlock"]]]]],[[50,126,null,275146422897036,false,[[2,["unlock",false]],[3,0],[0,[0,0]],[1,[2,""]]]]]],[0,null,false,null,771129480684641,[[0,71,null,0,false,false,false,590817133227944,false,[[0,[0,0]],[8,0],[7,[2,"challenge_won"]]]]],[[50,126,null,299292261532007,false,[[2,["challenge_won",false]],[3,0],[0,[0,-5]],[1,[2,""]]]]]]]]]]]]]],["UIManager",[[0,[true,"UI - On Start"],false,null,321192755613962,[[-1,23,null,0,false,false,false,321192755613962,false,[[1,[2,"UI - On Start"]]]]],[],[[0,null,false,null,399056870989542,[[-1,24,null,1,false,false,false,230664452391386,false]],[[77,129,null,140060165529437,false],[82,25,null,202592187139384,false],[19,92,null,509973960687595,false],[88,72,null,728120107355638,false,[[0,[21,88,false,null,4]]]],[0,26,null,318247316854097,false,[[1,[2,"Destroy_Hud"]],[13]]],[0,26,null,825414359280121,false,[[1,[2,"Destroy_Tutorial"]],[13]]]]]]],[0,[true,"Animation - Functions"],false,null,869847338302528,[[-1,23,null,0,false,false,false,869847338302528,false,[[1,[2,"Animation - Functions"]]]]],[],[[0,null,false,null,990380929923492,[[0,30,null,2,false,false,false,113749319508015,false,[[1,[2,"Play_CoinIcon_Animation"]]]]],[[28,63,null,407627212820379,false,[[10,1],[7,[0,5]]]],[28,78,null,290973247376775,false,[[10,0],[3,1]]]]],[0,null,false,null,115677915178893,[[0,30,null,2,false,false,false,870515394986528,false,[[1,[2,"Play_MM_Animation"]]]]],[[45,72,null,161501051870222,false,[[0,[1,0.85]]]]],[[0,null,false,null,209976200380017,[[0,71,null,0,false,false,false,716842867559697,false,[[0,[0,0]],[8,0],[7,[2,"forward"]]]]],[[46,25,null,207764037100241,false],[45,53,null,569486241012398,false,[[0,[23,"CANVAS_MID_X"]],[0,[5,[6,[3,[23,"canvasDeltaHeight"]],[1,0.5]],[0,150]]]]],[45,130,"LiteTween",795096854459183,false,[[3,0],[3,0],[0,[23,"CANVAS_MID_X"]]]],[45,130,"LiteTween",319966426723194,false,[[3,1],[3,0],[0,[4,[6,[3,[23,"canvasDeltaHeight"]],[1,0.5]],[0,110]]]]],[45,131,"LiteTween",389773777783884,false,[[3,0],[3,1]]],[45,63,null,748963241022504,false,[[10,1],[7,[20,0,38,false,null,[[0,0]]]]]]],[[0,null,false,null,846252815275052,[[85,67,null,0,false,false,false,636239279357853,false,[[10,8],[8,0],[7,[0,0]]]]],[[85,72,null,419041158399418,false,[[0,[0,0]]]]]],[0,null,false,null,388985809524464,[],[[-1,112,null,904540929462993,false,[[0,[1,0.75]]]]],[[0,null,false,null,248852678278838,[[85,67,null,0,false,false,false,763378675313139,false,[[10,8],[8,0],[7,[0,0]]]]],[[85,63,null,895550952972687,false,[[10,3],[7,[6,[21,85,false,null,9],[1,0.75]]]]],[85,63,null,723755450232291,false,[[10,4],[7,[21,85,false,null,9]]]],[85,63,null,222669130400407,false,[[10,2],[7,[0,0]]]],[85,63,null,775875331370648,false,[[10,1],[7,[0,1]]]],[85,63,null,206509514038424,false,[[10,5],[7,[0,150]]]],[85,78,null,358506920266236,false,[[10,0],[3,1]]]]]]]]],[0,null,false,null,195938545726484,[[0,71,null,0,false,false,false,331127974068596,false,[[0,[0,0]],[8,0],[7,[2,"backward"]]]]],[[45,132,"LiteTween",215039880394943,false,[[3,0]]],[45,63,null,811157776805236,false,[[10,1],[7,[20,0,38,false,null,[[0,0]]]]]]],[[0,null,false,null,751883885737113,[[85,67,null,0,false,false,false,427756310704667,false,[[10,8],[8,0],[7,[0,0]]]]],[[85,63,null,422573146723662,false,[[10,3],[7,[21,85,false,null,9]]]],[85,63,null,839731742736855,false,[[10,4],[7,[0,0]]]],[85,63,null,910881838703351,false,[[10,2],[7,[0,0]]]],[85,63,null,475129805322594,false,[[10,1],[7,[0,1]]]],[85,63,null,209058126991831,false,[[10,5],[7,[0,400]]]],[85,78,null,845402956544764,false,[[10,0],[3,1]]]]],[0,null,false,null,410072904500637,[],[[-1,112,null,898281795190609,false,[[0,[1,0.5]]]]],[[0,null,false,null,608024038068445,[[-1,27,null,0,false,false,false,348556337626744,false,[[11,"playCount"],[8,5],[7,[0,1]]]]],[[0,26,null,778600302902690,false,[[1,[2,"Init_PreGame"]],[13]]],[0,26,null,764261139015624,false,[[1,[2,"Start_Game"]],[13]]]]],[0,null,false,null,688634745075090,[[-1,37,null,0,false,false,false,436213749718601,false]],[[0,26,null,140844252476321,false,[[1,[2,"Start_Game"]],[13]]]]]]]]]]]]],[0,[true,"Animations"],false,null,470873912340914,[[-1,23,null,0,false,false,false,470873912340914,false,[[1,[2,"Animations"]]]]],[],[[0,[true,"Sprites"],false,null,435949237583189,[[-1,23,null,0,false,false,false,435949237583189,false,[[1,[2,"Sprites"]]]]],[],[[0,null,false,null,672878452552951,[[85,79,null,0,false,false,false,638334345161523,false,[[10,0]]]],[],[[0,null,false,null,955140877072091,[[85,67,null,0,false,false,false,862846384875593,false,[[10,1],[8,0],[7,[0,1]]]]],[[85,133,null,363218162707353,false,[[10,2],[7,[6,[21,85,false,null,5],[19,87]]]]],[85,72,null,240380251371187,false,[[0,[19,134,[[21,85,false,null,3],[21,85,false,null,4],[19,102,[[21,85,false,null,2]]]]]]]]],[[0,null,false,null,361550531199600,[[85,67,null,0,false,false,false,950319778516264,false,[[10,2],[8,5],[7,[0,90]]]]],[[85,72,null,608415040499827,false,[[0,[21,85,false,null,4]]]],[85,63,null,612894325943139,false,[[10,1],[7,[0,0]]]],[85,78,null,625112050886469,false,[[10,0],[3,0]]]]]]],[0,null,false,null,273491257268167,[[85,67,null,0,false,false,false,880414460939090,false,[[10,1],[8,0],[7,[0,5]]]]],[[85,121,null,702767729202611,false,[[0,[4,[20,85,73,false,null],[6,[6,[21,85,false,null,6],[0,2]],[19,87]]]],[0,[4,[20,85,74,false,null],[6,[6,[21,85,false,null,7],[0,2]],[19,87]]]]]]],[[0,null,false,null,766222188980863,[[85,135,null,0,false,false,false,195760046593091,false,[[8,5],[0,[6,[21,85,false,null,6],[21,85,false,null,4]]]]]],[[85,63,null,776688324831508,false,[[10,1],[7,[0,6]]]]]]]],[0,null,false,null,744199390500235,[[85,67,null,0,false,false,false,634054608087734,false,[[10,1],[8,0],[7,[0,6]]]]],[[85,121,null,100219614340428,false,[[0,[5,[20,85,73,false,null],[6,[6,[21,85,false,null,6],[1,1.5]],[19,87]]]],[0,[5,[20,85,74,false,null],[6,[6,[21,85,false,null,7],[1,1.5]],[19,87]]]]]]],[[0,null,false,null,690555304866264,[[85,135,null,0,false,false,false,187196519257020,false,[[8,3],[0,[6,[21,85,false,null,6],[21,85,false,null,3]]]]]],[[85,72,null,738706678521419,false,[[0,[21,85,false,null,3]]]],[85,63,null,971450490633454,false,[[10,1],[7,[0,0]]]],[85,63,null,800709253191527,false,[[10,2],[7,[0,0]]]],[85,78,null,678865479421475,false,[[10,0],[3,0]]]]]]]]]]],[0,[true,"Lite Tweens"],false,null,624464129045661,[[-1,23,null,0,false,false,false,624464129045661,false,[[1,[2,"Lite Tweens"]]]]],[],[[0,null,false,null,204268677092402,[[87,136,"LiteTween",1,false,false,false,228972350711345,false]],[],[[0,null,false,null,684927702540957,[[87,67,null,0,false,false,false,961502823339273,false,[[10,0],[8,0],[7,[2,"logo"]]]]],[],[[0,null,false,null,483289451612368,[[87,67,null,0,false,false,false,243920879567643,false,[[10,1],[8,0],[7,[2,"forward"]]]]],[[87,82,null,218377138196834,false,[[4,46],[5,[2,"menu"]],[7,[2,"tyre_0"]]]],[46,63,null,346811242184851,false,[[10,1],[7,[0,1]]]],[46,78,null,736894138386034,false,[[10,0],[3,1]]],[46,76,"Pin",195138427841493,false,[[4,87],[3,1]]],[87,82,null,247734152992478,false,[[4,46],[5,[2,"menu"]],[7,[2,"tyre_1"]]]],[46,63,null,183028867449075,false,[[10,1],[7,[0,1]]]],[46,78,null,164110595528316,false,[[10,0],[3,1]]],[46,76,"Pin",364468973644621,false,[[4,87],[3,1]]]]],[0,null,false,null,857246853024635,[[87,67,null,0,false,false,false,486513370890747,false,[[10,1],[8,0],[7,[2,"backward"]]]]],[[46,25,null,187182359685593,false]]]]]]]]],[0,[true,"Game Seq"],false,null,474278191632172,[[-1,23,null,0,false,false,false,474278191632172,false,[[1,[2,"Game Seq"]]]]],[],[[0,null,false,null,707502177905960,[[-1,27,null,0,false,false,false,587780624315365,false,[[11,"gameSequence"],[8,0],[7,[0,20]]]]],[[-1,137,null,747306188145610,false,[[5,[2,"menu"]],[0,[5,[19,138,[[2,"menu"]]],[6,[0,300],[19,87]]]]]],[-1,137,null,733446703805739,false,[[5,[2,"selection"]],[0,[5,[0,100],[19,138,[[2,"menu"]]]]]]],[-1,139,null,560640095217572,false,[[5,[2,"selection"]],[0,[5,[1,1.35],[6,[19,138,[[2,"selection"]]],[1,0.0035]]]]]],[-1,137,null,719433104176006,false,[[5,[2,"selection_bg"]],[0,[6,[19,138,[[2,"selection"]]],[1,0.25]]]]]],[[0,null,false,null,787111820084881,[[-1,140,null,0,false,false,false,624503973175926,false,[[5,[2,"menu"]],[8,3],[0,[0,0]]]]],[[-1,137,null,857604240124370,false,[[5,[2,"selection"]],[0,[0,100]]]],[-1,139,null,669398543715647,false,[[5,[2,"selection"]],[0,[0,1]]]],[-1,29,null,521033465086813,false,[[11,"gameSequence"],[7,[23,"SEQ_SELECTION"]]]]]]]],[0,null,false,null,896116788585175,[[-1,27,null,0,false,false,false,616925112798165,false,[[11,"gameSequence"],[8,0],[7,[0,21]]]]],[[-1,137,null,938230555009591,false,[[5,[2,"menu"]],[0,[4,[19,138,[[2,"menu"]]],[6,[0,300],[19,87]]]]]],[-1,137,null,889304616182510,false,[[5,[2,"selection"]],[0,[5,[0,100],[19,138,[[2,"menu"]]]]]]],[-1,139,null,465181728262457,false,[[5,[2,"selection"]],[0,[5,[1,1.35],[6,[19,138,[[2,"selection"]]],[1,0.0035]]]]]],[-1,137,null,714256687444770,false,[[5,[2,"selection_bg"]],[0,[6,[19,138,[[2,"selection"]]],[1,0.25]]]]]],[[0,null,false,null,113010197580084,[[-1,140,null,0,false,false,false,839487935152994,false,[[5,[2,"menu"]],[8,5],[0,[0,100]]]]],[[-1,137,null,216002232841461,false,[[5,[2,"selection"]],[0,[0,0]]]],[-1,139,null,375011675346729,false,[[5,[2,"selection"]],[0,[0,1]]]],[-1,29,null,711190644285345,false,[[11,"gameSequence"],[7,[23,"SEQ_MENU"]]]],[0,26,null,931087547177261,false,[[1,[2,"Destroy_SelectionScreen"]],[13]]]]]]]]]]],[0,[true,"UI PARAMS"],false,null,724362257691247,[[-1,23,null,0,false,false,false,724362257691247,false,[[1,[2,"UI PARAMS"]]]]],[]],[0,[true,"Flash Params"],false,null,680135736235091,[[-1,23,null,0,false,false,false,680135736235091,false,[[1,[2,"Flash Params"]]]]],[]],[1,"flash_fadeIn",0,400,false,false,452840499907002,false],[1,"flash_fadeOut",0,800,false,false,189955802379592,false],[1,"flashSeq",0,0,false,false,354798718379060,false],[1,"isFlashActive",0,0,false,false,160491388562783,false],[1,"flashTrace",1,"",false,false,632715825457037,false],[0,[true,"Flash"],false,null,253724787615555,[[-1,23,null,0,false,false,false,253724787615555,false,[[1,[2,"Flash"]]]]],[],[[0,null,false,null,776646772400993,[[0,30,null,2,false,false,false,650274754126626,false,[[1,[2,"Flash_Screen"]]]]],[[-1,141,null,152372759653219,false,[[5,[2,"flash"]],[3,1]]],[-1,137,null,697325564351995,false,[[5,[2,"flash"]],[0,[20,0,38,false,null,[[0,0]]]]]],[-1,29,null,488165181586662,false,[[11,"flash_fadeIn"],[7,[20,0,38,false,null,[[0,1]]]]]],[-1,29,null,689365958489078,false,[[11,"flash_fadeOut"],[7,[20,0,38,false,null,[[0,2]]]]]],[-1,29,null,810332369707934,false,[[11,"flashTrace"],[7,[20,0,38,false,null,[[0,3]]]]]],[-1,29,null,951479913103680,false,[[11,"isFlashActive"],[7,[0,1]]]],[-1,29,null,865625625916641,false,[[11,"flashSeq"],[7,[0,1]]]],[-1,29,null,483797613967390,false,[[11,"gameSequence"],[7,[23,"SEQ_BETWEEN"]]]]]],[0,null,false,null,239863724071464,[[-1,27,null,0,false,false,false,363318474691910,false,[[11,"isFlashActive"],[8,0],[7,[0,1]]]]],[],[[0,null,false,null,756115204648772,[[-1,27,null,0,false,false,false,161282578222247,false,[[11,"flashSeq"],[8,0],[7,[0,1]]]]],[[-1,137,null,783317708723575,false,[[5,[2,"flash"]],[0,[4,[19,138,[[2,"flash"]]],[6,[23,"flash_fadeIn"],[19,87]]]]]]],[[0,null,false,null,483862691319539,[[-1,33,null,0,false,false,false,171245248076775,false,[[7,[19,138,[[2,"flash"]]]],[8,5],[7,[0,100]]]]],[[-1,29,null,374316808852411,false,[[11,"flashSeq"],[7,[0,2]]]]],[[0,null,false,null,489273794372201,[[-1,27,null,0,false,false,false,792905534167593,false,[[11,"flashTrace"],[8,0],[7,[2,"game_over"]]]]],[[0,26,null,637353053710099,false,[[1,[2,"Play_MM_Animation"]],[13,[7,[2,"forward"]]]]],[0,26,null,890858377995466,false,[[1,[2,"Init_PreGame"]],[13]]]]]]]]],[0,null,false,null,880396895522751,[[-1,27,null,0,false,false,false,176658659981726,false,[[11,"flashSeq"],[8,0],[7,[0,2]]]]],[[-1,137,null,958713021940780,false,[[5,[2,"flash"]],[0,[5,[19,138,[[2,"flash"]]],[6,[23,"flash_fadeOut"],[19,87]]]]]]],[[0,null,false,null,716200393461448,[[-1,33,null,0,false,false,false,848034141685628,false,[[7,[19,138,[[2,"flash"]]]],[8,3],[7,[0,0]]]]],[[-1,29,null,674977062901604,false,[[11,"flashSeq"],[7,[0,0]]]],[-1,29,null,190666737087970,false,[[11,"isFlashActive"],[7,[0,0]]]]],[[0,null,false,null,875857035750420,[[-1,27,null,0,false,false,false,290113404544115,false,[[11,"flashTrace"],[8,0],[7,[2,"game_over"]]]]],[[-1,29,null,323892249434779,false,[[11,"gameSequence"],[7,[23,"SEQ_MENU"]]]]]]]]]]]]]],[0,[true,"SEQ PARAMS"],false,null,348480028706698,[[-1,23,null,0,false,false,false,348480028706698,false,[[1,[2,"SEQ PARAMS"]]]]],[]],[1,"SEQ_MENU",0,0,false,false,240425828238921,false],[1,"SEQ_SELECTION",0,1,false,false,927705383957452,false],[1,"SEQ_TUTORIAL",0,2,false,false,528446179239802,false],[1,"SEQ_GP",0,5,false,false,290717822069165,false],[1,"SEQ_BETWEEN",0,10,false,false,286671274505458,false],[0,[true,"Button Params"],false,null,958035318786761,[[-1,23,null,0,false,false,false,958035318786761,false,[[1,[2,"Button Params"]]]]],[]],[1,"chbuttonId",0,-1,false,false,586166298195894,false],[1,"chbuttonScale",0,0.95,false,false,115251759160033,false],[0,[true,"Screens"],false,null,573643329399072,[[-1,23,null,0,false,false,false,573643329399072,false,[[1,[2,"Screens"]]]]],[],[[0,null,false,null,488049379445031,[[0,30,null,2,false,false,false,202632648726789,false,[[1,[2,"Reset_Buttons"]]]]],[]],[0,null,false,null,432799491000150,[[0,30,null,2,false,false,false,178794806440921,false,[[1,[2,"Hide_aButton"]]]]],[],[[0,null,false,null,922672226509869,[[88,77,null,0,false,false,true,839159321145001,false,[[0,[20,0,38,false,null,[[0,0]]]]]]],[[88,142,null,671607057528024,false,[[3,0]]],[88,78,null,245876878776072,false,[[10,2],[3,0]]]]]]],[0,null,false,null,404025581547369,[[0,30,null,2,false,false,false,163041081586508,false,[[1,[2,"Show_aButton"]]]]],[],[[0,null,false,null,694420089822448,[[88,77,null,0,false,false,true,647611690699792,false,[[0,[20,0,38,false,null,[[0,0]]]]]]],[[88,142,null,590479543338943,false,[[3,1]]],[88,78,null,585612086053840,false,[[10,2],[3,1]]]]]]],[0,null,false,null,905653282352422,[[88,67,null,0,false,false,false,584142141353887,false,[[10,1],[8,0],[7,[23,"gameSequence"]]]]],[],[[0,null,false,null,772917648371895,[[88,79,null,0,false,false,false,785321992133210,false,[[10,2]]]],[],[[0,null,false,null,284283935562389,[[49,143,null,0,false,false,false,699504122539160,false,[[4,88]]],[88,67,null,0,false,false,false,240653499985474,false,[[10,0],[8,1],[7,[23,"chbuttonId"]]]]],[[-1,29,null,701513852311707,false,[[11,"chbuttonId"],[7,[21,88,false,null,0]]]],[49,144,null,452861724412587,false,[[3,1]]]]],[0,null,false,null,412562835954587,[[49,143,null,0,false,true,false,288562597154995,false,[[4,88]]],[-1,27,null,0,false,false,false,358901207282845,false,[[11,"chbuttonId"],[8,1],[7,[0,-1]]]]],[[-1,29,null,261424877589768,false,[[11,"chbuttonId"],[7,[0,-1]]]],[49,144,null,608552580465744,false,[[3,0]]]]]]]]],[0,null,false,null,775344723227923,[[1,145,null,1,false,false,false,998559573189109,false,[[4,88]]]],[],[[0,null,false,null,391396674647737,[[88,67,null,0,false,false,false,797574642924902,false,[[10,1],[8,0],[7,[23,"gameSequence"]]]]],[],[[0,null,false,null,822910478591248,[[88,79,null,0,false,false,false,926498303719370,false,[[10,2]]]],[[88,72,null,926142815699977,false,[[0,[6,[23,"chbuttonScale"],[21,88,false,null,4]]]]],[88,78,null,776867835864512,false,[[10,3],[3,1]]]]]]]]],[0,null,false,null,404514587652730,[[1,146,null,1,false,false,false,658621882364130,false]],[],[[0,null,false,null,345554561634389,[[88,79,null,0,false,false,false,546678252320849,false,[[10,3]]]],[[88,78,null,676914580697054,false,[[10,3],[3,0]]],[88,72,null,498281739070138,false,[[0,[21,88,false,null,4]]]]],[[0,[true,"MENU"],false,null,310171931952185,[[-1,23,null,0,false,false,false,310171931952185,false,[[1,[2,"MENU"]]]]],[],[[0,null,false,null,764838873632024,[[88,67,null,0,false,false,false,685087657021485,false,[[10,1],[8,0],[7,[23,"SEQ_MENU"]]]]],[],[[0,null,false,null,653415250050041,[[88,67,null,0,false,false,false,458603908063319,false,[[10,0],[8,0],[7,[0,0]]]]],[[0,26,null,561877402014374,false,[[1,[2,"Play_UISound"]],[13,[7,[2,"click_0"]]]]]],[[0,null,false,null,826149637390430,[[-1,27,null,0,false,false,false,220160271428057,false,[[11,"isTutorialActive"],[8,0],[7,[0,1]]]]],[[0,26,null,770700156362933,false,[[1,[2,"Show_Tutorial"]],[13]]]]],[0,null,false,null,913539896226900,[[-1,37,null,0,false,false,false,359426769583479,false]],[],[[0,null,false,null,910149832993811,[[-1,27,null,0,false,false,false,191594613554724,false,[[11,"platform"],[8,0],[7,[23,"PLATFORM_GD"]]]]],[[0,26,null,974258441215397,false,[[1,[2,"Show_Ads"]],[13]]]]],[0,null,false,null,116728907368113,[[-1,37,null,0,false,false,false,550442718728716,false]],[[0,26,null,487986799994689,false,[[1,[2,"Play_MM_Animation"]],[13,[7,[2,"backward"]]]]]]]]]]],[0,null,false,null,929740414716359,[[88,67,null,0,false,false,false,900182153351705,false,[[10,0],[8,0],[7,[0,1]]]]],[[0,26,null,303796686705198,false,[[1,[2,"Play_UISound"]],[13,[7,[2,"click_0"]]]]],[0,26,null,929433421580943,false,[[1,[2,"Show_SelectionScreen"]],[13]]]]],[0,null,false,null,392837789778027,[[88,67,null,0,false,false,false,349712135045027,false,[[10,0],[8,0],[7,[0,2]]]]],[[0,26,null,300217955949936,false,[[1,[2,"Play_UISound"]],[13,[7,[2,"click_0"]]]]],[9,111,null,136722112198587,false,[[1,[10,[10,[10,[10,[2,"onFB_ChallengeBtn_Clicked("],[19,36,[[23,"myBestDistance"]]]],[2,","]],[19,147,[[6,[23,"myBestDistance"],[23,"SCORE_PER_PIXEL"]]]]],[2,");"]]]]]]],[0,null,false,null,217950014396558,[[88,67,null,0,false,false,false,752543088538340,false,[[10,0],[8,0],[7,[0,3]]]]],[[0,26,null,720274343262114,false,[[1,[2,"Play_UISound"]],[13,[7,[2,"click_0"]]]]],[9,111,null,211302621641758,false,[[1,[2,"onFB_LBBtn_Clicked();"]]]]]],[0,null,false,null,191046093781803,[[88,67,null,0,false,false,false,358453490495789,false,[[10,0],[8,0],[7,[0,4]]]]],[[0,26,null,920124726404191,false,[[1,[2,"Play_UISound"]],[13,[7,[2,"click_0"]]]]],[9,111,null,925140862769466,false,[[1,[2,"onFB_InviteBtn_Clicked();"]]]]]],[0,null,false,null,951760087445909,[[88,67,null,0,false,false,false,255658046371569,false,[[10,0],[8,0],[7,[0,5]]]]],[[0,26,null,324419657664725,false,[[1,[2,"Update_Sound"]],[13,[7,[0,0]]]]]],[[0,null,false,null,346467594785131,[[-1,27,null,0,false,false,false,495387874649518,false,[[11,"soundOn"],[8,0],[7,[0,1]]]]],[]],[0,null,false,null,412281055290768,[[-1,37,null,0,false,false,false,103681096780247,false]],[[0,26,null,287065703602560,false,[[1,[2,"Update_Sound"]],[13,[7,[0,1]]]]]]],[0,null,false,null,629930156505496,[],[[0,26,null,184902272042392,false,[[1,[2,"Play_UISound"]],[13,[7,[2,"click_0"]]]]]]]]],[0,null,false,null,332851346227184,[[88,67,null,0,false,false,false,566234024284167,false,[[10,0],[8,0],[7,[0,6]]]]],[],[[0,null,false,null,543680502898144,[[-1,27,null,0,false,false,false,311999256195516,false,[[11,"musicOn"],[8,0],[7,[0,1]]]]],[[0,26,null,938080797141759,false,[[1,[2,"Update_Music"]],[13,[7,[0,0]]]]]]],[0,null,false,null,542310864805260,[[-1,37,null,0,false,false,false,722120843530233,false]],[[0,26,null,562226734642042,false,[[1,[2,"Update_Music"]],[13,[7,[0,1]]]]]]],[0,null,false,null,109692864737472,[],[[0,26,null,169037936618828,false,[[1,[2,"Play_UISound"]],[13,[7,[2,"click_0"]]]]]]]]]]]]],[0,[true,"SELECTION"],false,null,583919917145470,[[-1,23,null,0,false,false,false,583919917145470,false,[[1,[2,"SELECTION"]]]]],[],[[0,null,false,null,722864467277457,[[88,67,null,0,false,false,false,463076726250922,false,[[10,1],[8,0],[7,[23,"SEQ_SELECTION"]]]]],[],[[0,null,false,null,580648164992524,[[88,67,null,0,false,false,false,775423664050076,false,[[10,0],[8,0],[7,[0,10]]]]],[[0,26,null,175264869238945,false,[[1,[2,"Play_UISound"]],[13,[7,[2,"click_0"]]]]],[-1,29,null,592060889146166,false,[[11,"gameSequence"],[7,[0,21]]]]]],[0,null,false,null,498443590745375,[[88,67,null,0,false,false,false,346408378121345,false,[[10,0],[8,5],[7,[0,11]]]]],[[0,26,null,372508608692560,false,[[1,[2,"On_CarSelectBtn_Clicked"]],[13,[7,[5,[21,88,false,null,0],[0,11]]]]]]]]]]]],[0,[true,"TUTO"],false,null,942088085397062,[[-1,23,null,0,false,false,false,942088085397062,false,[[1,[2,"TUTO"]]]]],[],[[0,null,false,null,199751750617593,[[88,67,null,0,false,false,false,253834653408801,false,[[10,1],[8,0],[7,[23,"SEQ_TUTORIAL"]]]]],[],[[0,null,false,null,435597785037401,[[88,67,null,0,false,false,false,631822351017908,false,[[10,0],[8,0],[7,[0,20]]]]],[[0,26,null,995906736819091,false,[[1,[2,"Play_UISound"]],[13,[7,[2,"click_0"]]]]]],[[0,null,false,null,601999655763473,[[-1,27,null,0,false,false,false,375412352785897,false,[[11,"platform"],[8,0],[7,[23,"PLATFORM_GD"]]]]],[[49,144,null,500727810420023,false,[[3,0]]],[0,26,null,295851437768406,false,[[1,[2,"Show_Ads"]],[13]]]]],[0,null,false,null,353089335084126,[[-1,37,null,0,false,false,false,941491252799449,false]],[[0,26,null,820390405717620,false,[[1,[2,"Destroy_Tutorial"]],[13]]],[0,26,null,649497514070243,false,[[1,[2,"Play_MM_Animation"]],[13,[7,[2,"backward"]]]]]]]]]]]]]]]]]]],[0,[true,"HUD Params"],false,null,389251154266613,[[-1,23,null,0,false,false,false,389251154266613,false,[[1,[2,"HUD Params"]]]]],[]],[1,"HUD_SCALE",0,0.75,false,false,556831409849001,false],[0,[true,"HUD"],false,null,446927424454860,[[-1,23,null,0,false,false,false,446927424454860,false,[[1,[2,"HUD"]]]]],[],[[0,null,false,null,478568042219828,[[0,30,null,2,false,false,false,703336495149119,false,[[1,[2,"Destroy_Hud"]]]]],[[27,25,null,671446044214610,false],[28,25,null,914005668622209,false],[29,113,null,796574969498164,false],[34,113,null,372050529420235,false],[32,25,null,875505195149992,false],[41,113,null,690876847311780,false],[40,113,null,747652641138166,false],[42,114,null,297505936904396,false],[43,25,null,838995915687939,false]]],[0,null,false,null,514366921532116,[[0,30,null,2,false,false,false,721220222266321,false,[[1,[2,"Init_Hud"]]]]],[[0,26,null,673296892364766,false,[[1,[2,"Destroy_Hud"]],[13]]],[-1,61,null,468379129694183,false,[[4,28],[5,[2,"hud"]],[0,[4,[6,[3,[23,"canvasDeltaWidth"]],[1,0.5]],[0,40]]],[0,[4,[6,[3,[23,"canvasDeltaHeight"]],[1,0.5]],[0,40]]]]],[28,72,null,654606274628298,false,[[0,[21,28,false,null,3]]]],[-1,61,null,387884185855995,false,[[4,29],[5,[2,"hud"]],[0,[4,[4,[20,28,93,false,null],[6,[20,28,73,false,null],[1,0.5]]],[0,7]]],[0,[20,28,86,false,null]]]],[29,45,null,475242855791933,false,[[7,[23,"myCoins"]]]],[-1,61,null,720123064354321,false,[[4,34],[5,[2,"hud"]],[0,[23,"CANVAS_MID_X"]],[0,[4,[6,[3,[23,"canvasDeltaHeight"]],[1,0.5]],[0,13]]]]],[34,45,null,463934953741521,false,[[7,[2,"0m"]]]],[34,148,null,859087554092071,false,[[0,[19,149,[[0,0],[0,0],[0,0]]]]]],[34,150,null,340171312318296,false,[[1,[2,"Outline"]],[0,[0,3]],[0,[0,0]]]],[-1,61,null,386167628198428,false,[[4,34],[5,[2,"hud"]],[0,[23,"CANVAS_MID_X"]],[0,[4,[6,[3,[23,"canvasDeltaHeight"]],[1,0.5]],[0,10]]]]],[34,45,null,975949520320649,false,[[7,[2,"0m"]]]]],[[0,null,false,null,227049709697633,[[-1,27,null,0,false,false,false,592923080775934,false,[[11,"myBestDistance"],[8,1],[7,[0,0]]]]],[[-1,61,null,667697060333840,false,[[4,41],[5,[2,"hud"]],[0,[5,[4,[23,"CANVAS_WIDTH"],[6,[23,"canvasDeltaWidth"],[1,0.5]]],[0,10]]],[0,[4,[6,[3,[23,"canvasDeltaHeight"]],[1,0.5]],[0,10]]]]],[41,45,null,650954727902017,false,[[7,[2,"BEST"]]]],[-1,61,null,480785461620878,false,[[4,40],[5,[2,"hud"]],[0,[5,[4,[23,"CANVAS_WIDTH"],[6,[23,"canvasDeltaWidth"],[1,0.5]]],[0,10]]],[0,[4,[6,[3,[23,"canvasDeltaHeight"]],[1,0.5]],[0,35]]]]],[40,45,null,287122335211431,false,[[7,[10,[19,36,[[6,[23,"myBestDistance"],[23,"SCORE_PER_PIXEL"]]]],[2,"m"]]]]]]],[1,"paddeDX",0,400,false,false,813167822998157,false],[0,null,false,null,600476149971516,[],[[-1,61,null,401058580422119,false,[[4,32],[5,[2,"hud"]],[0,[4,[23,"CANVAS_MID_X"],[23,"paddeDX"]]],[0,[4,[4,[23,"CANVAS_HEIGHT"],[6,[23,"canvasDeltaHeight"],[1,0.5]]],[0,25]]]]],[32,63,null,621007262209047,false,[[10,0],[7,[2,"FORWARD"]]]],[-1,61,null,519280214632063,false,[[4,32],[5,[2,"hud"]],[0,[5,[23,"CANVAS_MID_X"],[23,"paddeDX"]]],[0,[4,[4,[23,"CANVAS_HEIGHT"],[6,[23,"canvasDeltaHeight"],[1,0.5]]],[0,25]]]]],[32,63,null,101936723775840,false,[[10,0],[7,[2,"BACKWARD"]]]],[32,151,null,564643056406241,false,[[3,0]]]]],[1,"DIAL_DX",0,90,false,false,344277835300822,false],[0,null,false,null,346753343894461,[],[[-1,61,null,565644339505446,false,[[4,27],[5,[2,"hud"]],[0,[5,[23,"CANVAS_MID_X"],[23,"DIAL_DX"]]],[0,[5,[4,[23,"CANVAS_HEIGHT"],[6,[23,"canvasDeltaHeight"],[1,0.5]]],[0,90]]]]],[27,63,null,373605472891692,false,[[10,0],[7,[2,"RPM"]]]],[33,53,null,143063259894569,false,[[0,[20,27,93,false,null]],[0,[20,27,86,false,null]]]],[33,63,null,975891171579508,false,[[10,0],[7,[0,0]]]],[33,83,null,852303613011505,false,[[0,[21,33,false,null,0]]]],[33,63,null,871743559146382,false,[[10,2],[7,[0,165]]]],[-1,61,null,272802690812281,false,[[4,27],[5,[2,"hud"]],[0,[4,[23,"CANVAS_MID_X"],[23,"DIAL_DX"]]],[0,[5,[4,[23,"CANVAS_HEIGHT"],[6,[23,"canvasDeltaHeight"],[1,0.5]]],[0,90]]]]],[27,62,null,286243510002688,false,[[0,[0,1]]]],[27,63,null,317625314019060,false,[[10,0],[7,[2,"BOOST"]]]],[33,53,null,801105932216840,false,[[0,[20,27,93,false,null]],[0,[20,27,86,false,null]]]],[33,63,null,745701542778642,false,[[10,0],[7,[0,85]]]],[33,83,null,150902054386985,false,[[0,[21,33,false,null,0]]]],[33,63,null,412150109204007,false,[[10,2],[7,[0,100]]]],[33,63,null,820290479869160,false,[[10,1],[7,[0,-85]]]]]]]],[0,null,false,null,659885323062060,[[0,30,null,2,false,false,false,872640903078781,false,[[1,[2,"Update_aPaddleState"]]]]],[],[[0,null,false,null,664787176200258,[[32,67,null,0,false,false,false,633025788763738,false,[[10,0],[8,0],[7,[20,0,38,false,null,[[0,0]]]]]]],[[32,63,null,274931468123367,false,[[10,1],[7,[20,0,38,false,null,[[0,1]]]]]]],[[0,null,false,null,942526789285603,[[32,67,null,0,false,false,false,447646830442675,false,[[10,1],[8,0],[7,[2,"PRESSED"]]]]],[[32,62,null,876785444874391,false,[[0,[0,1]]]]]],[0,null,false,null,981080431749534,[[32,67,null,0,false,false,false,780423830810461,false,[[10,1],[8,0],[7,[2,"IDLE"]]]]],[[32,62,null,222787963793667,false,[[0,[0,0]]]]]]]]]]]],[0,[true,"Bars"],false,null,544819178583130,[[-1,23,null,0,false,false,false,544819178583130,false,[[1,[2,"Bars"]]]]],[],[[0,null,false,null,330840095302527,[[0,30,null,2,false,false,false,877488831688008,false,[[1,[2,"Activate_aPowerBar"]]]]],[],[[1,"oX",0,25,false,false,620342873625772,false],[1,"oY",0,100,false,false,558698212984917,false],[1,"posX",0,0,false,false,913527432796964,false],[1,"posY",0,0,false,false,991762916100978,false],[1,"barOccupyY",0,50,false,false,135758834710213,false],[0,null,false,null,125853680003393,[],[[-1,29,null,718708063315772,false,[[11,"posX"],[7,[4,[6,[3,[23,"canvasDeltaWidth"]],[1,0.5]],[23,"oX"]]]]],[-1,29,null,351107040441246,false,[[11,"posY"],[7,[4,[6,[3,[23,"canvasDeltaHeight"]],[1,0.5]],[23,"oY"]]]]]]],[0,null,false,null,383189241642021,[[-1,33,null,0,false,false,false,439781748755659,false,[[7,[20,42,152,false,null]],[8,4],[7,[0,0]]]]],[[-1,60,null,280236396805969,false,[[11,"posY"],[7,[6,[23,"barOccupyY"],[20,42,152,false,null]]]]]]],[0,null,false,null,442979732437661,[[42,119,null,0,false,false,false,105598654914303,false,[[10,8],[8,0],[7,[20,0,38,false,null,[[0,0]]]]]]],[[42,115,null,995908557698306,false,[[10,2],[7,[20,0,38,false,null,[[0,1]]]]]]]],[0,null,false,null,427046668856989,[[-1,37,null,0,false,false,false,509463744508439,false]],[[-1,61,null,858534238576803,false,[[4,43],[5,[2,"hud"]],[0,[23,"posX"]],[0,[23,"posY"]]]],[-1,61,null,218002592757941,false,[[4,42],[5,[2,"hud"]],[0,[4,[23,"posX"],[0,1]]],[0,[23,"posY"]]]],[42,115,null,594523937979069,false,[[10,8],[7,[20,0,38,false,null,[[0,0]]]]]],[42,115,null,404465623298339,false,[[10,4],[7,[20,43,70,false,null]]]],[-1,61,null,149175862518102,false,[[4,25],[5,[2,"hud"]],[0,[23,"posX"]],[0,[23,"posY"]]]],[42,115,null,779737508067427,false,[[10,5],[7,[20,25,70,false,null]]]],[25,153,"Sine",601658647094599,false,[[3,0]]],[42,115,null,206587469393720,false,[[10,3],[7,[20,0,38,false,null,[[0,1]]]]]],[42,115,null,552463329022230,false,[[10,6],[7,[7,[0,1],[21,42,false,null,3]]]]],[42,115,null,533299232156296,false,[[10,2],[7,[21,42,false,null,3]]]],[42,154,null,282317097954707,false,[[10,7],[3,1]]]],[[0,null,false,null,887967313631057,[[0,71,null,0,false,false,false,914880540454892,false,[[0,[0,0]],[8,0],[7,[2,"MAGNET"]]]]],[[25,85,null,457354456126631,false,[[0,[5,[20,25,86,false,null],[0,15]]]]],[25,72,null,511066943424956,false,[[0,[1,0.4]]]],[25,62,null,293091758789837,false,[[0,[0,0]]]],[42,155,null,172931218002170,false,[[1,[2,"Tint"]],[0,[0,0]],[0,[0,93]]]],[42,155,null,854411712470355,false,[[1,[2,"Tint"]],[0,[0,1]],[0,[0,15]]]],[42,155,null,367980887297586,false,[[1,[2,"Tint"]],[0,[0,2]],[0,[0,15]]]]]],[0,null,false,null,388308129200185,[[0,71,null,0,false,false,false,956813731817873,false,[[0,[0,0]],[8,0],[7,[2,"FREEZE"]]]]],[[25,62,null,472779913322970,false,[[0,[0,1]]]],[25,85,null,257356799728907,false,[[0,[20,25,86,false,null]]]],[25,156,null,144952920890525,false,[[0,[5,[20,25,93,false,null],[0,10]]]]],[25,72,null,347131352642743,false,[[0,[1,0.65]]]],[42,155,null,316276003937777,false,[[1,[2,"Tint"]],[0,[0,0]],[0,[0,55]]]],[42,155,null,307807112218864,false,[[1,[2,"Tint"]],[0,[0,1]],[0,[0,100]]]],[42,155,null,128779403828715,false,[[1,[2,"Tint"]],[0,[0,2]],[0,[0,100]]]]]],[0,null,false,null,985762662661403,[],[[25,156,null,569999291261353,false,[[0,[4,[20,25,93,false,null],[6,[20,25,73,false,null],[1,0.5]]]]]]]]]]]],[0,null,false,null,212982573205213,[[0,30,null,2,false,false,false,298341222199774,false,[[1,[2,"On_PowerBar_Finished"]]]]],[],[[0,null,false,null,657334941841941,[[86,157,null,0,false,false,true,419694150900369,false,[[0,[20,0,38,false,null,[[0,0]]]]]]],[[86,154,null,877001494472119,false,[[10,7],[3,0]]],[86,114,null,924137512992446,false]],[[0,null,false,null,268511133143740,[[86,119,null,0,false,false,false,516851806177325,false,[[10,8],[8,0],[7,[2,"MAGNET"]]]]],[],[[0,null,false,null,406120854509697,[[71,79,null,0,false,false,false,500182488642048,false,[[10,5]]]],[[71,78,null,307466860998708,false,[[10,13],[3,0]]]]]]],[0,null,false,null,647785020914214,[[86,119,null,0,false,false,false,745536176723616,false,[[10,8],[8,0],[7,[2,"FREEZE"]]]]],[],[[0,null,false,null,602958640287548,[[71,79,null,0,false,false,false,951590750193447,false,[[10,5]]]],[[71,78,null,595954528601407,false,[[10,14],[3,0]]],[73,158,"Pin",179873148543679,false],[73,81,"Chipmunk",638641684601430,false,[[3,1]]],[73,159,"Chipmunk",700986746430685,false,[[3,0],[0,[0,0]],[0,[0,0]]]],[44,25,null,625478616392818,false]]]]],[0,null,false,null,398819350235871,[[81,77,null,0,false,false,true,966507697756245,false,[[0,[21,86,false,null,5]]]]],[[81,25,null,495537034391151,false]]],[0,null,false,null,785345007223612,[[43,77,null,0,false,false,true,945650381961385,false,[[0,[21,86,false,null,4]]]]],[[43,25,null,174329215447082,false]]]]]]],[0,null,false,null,921520992469502,[[86,160,null,0,false,false,false,597909091284058,false,[[10,7]]]],[[86,161,null,268650142709131,false,[[10,2],[7,[19,87]]]],[86,162,null,620660565058060,false,[[0,[6,[6,[21,86,false,null,2],[21,86,false,null,6]],[21,86,false,null,1]]]]]],[[0,null,false,null,119662347800675,[[86,119,null,0,false,false,false,389583042092256,false,[[10,8],[8,0],[7,[2,"FREEZE"]]]]],[],[[0,null,false,null,363754818116376,[[86,119,null,0,false,false,false,958612568813829,false,[[10,2],[8,3],[7,[0,1]]]],[-1,163,null,0,false,false,false,100043921624061,false]],[[44,164,"Flash",699822322084341,false,[[0,[1,0.1]],[0,[1,0.1]],[0,[1,1]]]]]]]],[0,null,false,null,102355511365746,[[86,119,null,0,false,false,false,940881822777851,false,[[10,2],[8,3],[7,[0,0]]]]],[[86,162,null,546786076279390,false,[[0,[0,0]]]]],[[0,null,false,null,910715716560178,[[86,119,null,0,false,false,false,388089814289683,false,[[10,0],[8,0],[7,[2,"HUD"]]]]],[[0,26,null,836556925822799,false,[[1,[2,"On_PowerBar_Finished"]],[13,[7,[20,86,165,false,null]]]]]]]]]]]]],[0,[true,"Selection Screen Params"],false,null,741643226186183,[[-1,23,null,0,false,false,false,741643226186183,false,[[1,[2,"Selection Screen Params"]]]]],[]],[0,[true,"Selection Screen"],false,null,567916837216117,[[-1,23,null,0,false,false,false,567916837216117,false,[[1,[2,"Selection Screen"]]]]],[],[[0,null,false,null,213877432419110,[[0,30,null,2,false,false,false,495051668999293,false,[[1,[2,"Destroy_SelectionScreen"]]]]],[[53,25,null,553737082851440,false],[55,25,null,247391843341818,false],[56,113,null,821215226932808,false],[29,113,null,652477728033713,false],[28,25,null,321926761572395,false]]],[0,null,false,null,797423627727185,[[0,30,null,2,false,false,false,141238407656758,false,[[1,[2,"Show_SelectionScreen"]]]]],[[-1,141,null,879823247677990,false,[[5,[2,"selection"]],[3,1]]],[-1,141,null,988552378286342,false,[[5,[2,"selection_bg"]],[3,1]]],[-1,29,null,731315557680102,false,[[11,"gameSequence"],[7,[0,20]]]],[0,26,null,472674704914143,false,[[1,[2,"Spawn_SelectionScreen"]],[13]]],[-1,112,null,416677846221073,false,[[0,[1,0.5]]]],[0,26,null,590708328301895,false,[[1,[2,"Spawn_CarSelection_Buttons"]],[13]]]]],[0,null,false,null,168284767113956,[[0,30,null,2,false,false,false,675820013659002,false,[[1,[2,"Spawn_SelectionScreen"]]]]],[[0,26,null,590700829049372,false,[[1,[2,"Destroy_SelectionScreen"]],[13]]],[-1,61,null,806649130466353,false,[[4,28],[5,[2,"selection"]],[0,[4,[6,[3,[23,"canvasDeltaWidth"]],[1,0.5]],[0,40]]],[0,[4,[6,[3,[23,"canvasDeltaHeight"]],[1,0.5]],[0,40]]]]],[28,72,null,483513962511269,false,[[0,[1,0.55]]]],[-1,61,null,473898771771117,false,[[4,29],[5,[2,"selection"]],[0,[4,[4,[20,28,93,false,null],[6,[20,28,73,false,null],[1,0.5]]],[0,7]]],[0,[20,28,86,false,null]]]],[29,45,null,404593725753797,false,[[7,[23,"myCoins"]]]]],[[1,"posX",0,0,false,false,530026840136672,false],[1,"posY",0,0,false,false,249046334142190,false],[1,"dx",0,200,false,false,967875570530801,false],[1,"maxItemsPerRow",0,3,false,false,386106127204596,false],[0,null,false,null,220567748087671,[],[[-1,29,null,810431216212863,false,[[11,"posX"],[7,[5,[23,"CANVAS_MID_X"],[6,[5,[6,[19,46,[[23,"MAX_SKINS"],[0,0],[23,"maxItemsPerRow"]]],[1,0.5]],[1,0.5]],[23,"dx"]]]]]],[-1,29,null,574433484197313,false,[[11,"posY"],[7,[0,250]]]]]],[0,null,false,null,174392418644457,[[-1,39,null,0,true,false,false,557021281819330,false,[[0,[23,"MAX_SKINS"]]]]],[[-1,61,null,150178471608680,false,[[4,53],[5,[2,"selection"]],[0,[23,"posX"]],[0,[23,"posY"]]]],[53,166,null,100346670635064,false,[[1,[10,[2,"car_"],[19,41]]],[3,1]]],[53,63,null,312742885098877,false,[[10,1],[7,[19,41]]]],[-1,60,null,741892052153606,false,[[11,"posX"],[7,[23,"dx"]]]]],[[0,null,false,null,259799466696406,[[54,167,null,0,false,false,false,510084889440885,false,[[0,[19,41]],[8,1],[7,[0,1]]]]],[[53,78,null,901744468668380,false,[[10,0],[3,1]]],[53,62,null,772467416576395,false,[[0,[0,1]]]]]],[0,null,false,null,860592856044511,[[-1,33,null,0,false,false,false,920309300552748,false,[[7,[19,41]],[8,4],[7,[0,0]]]],[-1,33,null,0,false,false,false,623231582503715,false,[[7,[8,[4,[19,41],[0,1]],[23,"maxItemsPerRow"]]],[8,0],[7,[0,0]]]]],[[-1,29,null,773798498034491,false,[[11,"posX"],[7,[5,[23,"CANVAS_MID_X"],[6,[5,[6,[19,46,[[5,[5,[23,"MAX_SKINS"],[0,1]],[19,41]],[0,0],[23,"maxItemsPerRow"]]],[1,0.5]],[1,0.5]],[23,"dx"]]]]]],[-1,60,null,481727857197885,false,[[11,"posY"],[7,[0,220]]]]]]]]]],[0,null,false,null,252390100650662,[[0,30,null,2,false,false,false,754326087284280,false,[[1,[2,"Spawn_CarSelection_Buttons"]]]]],[],[[0,null,false,null,889829549202144,[[-1,106,null,0,true,false,false,761832530188001,false,[[4,53]]]],[[-1,61,null,162964618725506,false,[[4,55],[5,[2,"selection"]],[0,[20,53,93,false,null]],[0,[4,[20,53,86,false,null],[0,52]]]]],[55,63,null,926031495094874,false,[[10,10],[7,[4,[0,11],[21,53,false,null,1]]]]],[55,63,null,957361028533361,false,[[10,1],[7,[0,1]]]],[55,78,null,632266185351676,false,[[10,0],[3,1]]],[53,63,null,267031759438825,false,[[10,4],[7,[20,55,70,false,null]]]]],[[0,null,false,null,570993976638653,[[54,167,null,0,false,false,false,846547101094467,false,[[0,[21,53,false,null,1]],[8,1],[7,[0,1]]]]],[[55,62,null,101366758770645,false,[[0,[0,2]]]],[-1,61,null,566634110427975,false,[[4,56],[5,[2,"selection"]],[0,[5,[20,55,93,false,null],[0,15]]],[0,[20,55,86,false,null]]]],[56,45,null,319189751271149,false,[[7,[20,12,43,false,null,[[21,53,false,null,1],[0,2]]]]]],[53,63,null,195431644937308,false,[[10,2],[7,[20,56,168,false,null]]]],[-1,61,null,932204404666661,false,[[4,28],[5,[2,"selection"]],[0,[5,[20,55,93,false,null],[0,30]]],[0,[5,[20,55,86,false,null],[0,1]]]]],[28,72,null,168678902989342,false,[[0,[1,0.25]]]],[53,63,null,157190893456289,false,[[10,3],[7,[20,28,70,false,null]]]]]],[0,null,false,null,799851945165921,[[-1,37,null,0,false,false,false,624406812478604,false]],[],[[0,null,false,null,822704277000199,[[-1,33,null,0,false,false,false,684601003810175,false,[[7,[21,53,false,null,1]],[8,0],[7,[23,"myCarSkin"]]]]],[[55,62,null,900397614649487,false,[[0,[0,0]]]]]],[0,null,false,null,182767624106391,[[-1,37,null,0,false,false,false,230937013797935,false]],[[55,62,null,394584914554646,false,[[0,[0,1]]]]]]]]]]]],[0,null,false,null,751014039866955,[[0,30,null,2,false,false,false,852585441709338,false,[[1,[2,"On_CarSelectBtn_Clicked"]]]]],[],[[0,null,false,null,157097796010615,[[0,71,null,0,false,false,false,561358250664822,false,[[0,[0,0]],[8,1],[7,[23,"myCarSkin"]]]]],[],[[0,null,false,null,672470171827125,[[54,167,null,0,false,false,false,660038692663334,false,[[0,[20,0,38,false,null,[[0,0]]]],[8,1],[7,[0,1]]]]],[],[[0,null,false,null,220938612013901,[[-1,27,null,0,false,false,false,786652288700005,false,[[11,"myCoins"],[8,5],[7,[20,12,43,false,null,[[20,0,38,false,null,[[0,0]]],[0,2]]]]]]],[[0,26,null,467663011436957,false,[[1,[2,"On_Car_Unlocked"]],[13,[7,[20,0,38,false,null,[[0,0]]]]]]],[0,26,null,577229168403274,false,[[1,[2,"Play_UISound"]],[13,[7,[2,"unlock"]]]]]]],[0,null,false,null,150617785288337,[[-1,37,null,0,false,false,false,360388706805235,false]],[[0,26,null,673620488018336,false,[[1,[2,"Play_UISound"]],[13,[7,[2,"not_ready"]]]]]]]]],[0,null,false,null,260233952263523,[[-1,37,null,0,false,false,false,367538037628141,false]],[[0,26,null,706502608809151,false,[[1,[2,"Play_UISound"]],[13,[7,[2,"click_0"]]]]],[0,26,null,634664893643103,false,[[1,[2,"Select_ThisCar"]],[13,[7,[20,0,38,false,null,[[0,0]]]]]]]]]]]]],[0,null,false,null,807979770204121,[[0,30,null,2,false,false,false,400867781905612,false,[[1,[2,"Select_ThisCar"]]]]],[],[[0,null,false,null,658680996061779,[[53,67,null,0,false,false,false,166057525147597,false,[[10,1],[8,0],[7,[23,"myCarSkin"]]]]],[],[[0,null,false,null,900374879203519,[[55,77,null,0,false,false,true,985835595302130,false,[[0,[21,53,false,null,4]]]]],[[55,62,null,450947986005938,false,[[0,[0,1]]]]]]]],[0,null,false,null,693739676488702,[],[[-1,29,null,608244070352782,false,[[11,"myCarSkin"],[7,[20,0,38,false,null,[[0,0]]]]]]]],[0,null,false,null,730589287025701,[[53,67,null,0,false,false,false,341472045234405,false,[[10,1],[8,0],[7,[23,"myCarSkin"]]]]],[],[[0,null,false,null,617906693109027,[[55,77,null,0,false,false,true,906795077377609,false,[[0,[21,53,false,null,4]]]]],[[55,62,null,870167390848854,false,[[0,[0,0]]]]]]]]]],[0,null,false,null,251374898254718,[[0,30,null,2,false,false,false,801996388062578,false,[[1,[2,"On_Car_Unlocked"]]]]],[[0,26,null,576863295340030,false,[[1,[2,"Select_ThisCar"]],[13,[7,[20,0,38,false,null,[[0,0]]]]]]],[54,40,null,800081371349354,false,[[0,[20,0,38,false,null,[[0,0]]]],[7,[0,1]]]],[0,26,null,159744809682756,false,[[1,[2,"Save_LockKey"]],[13]]],[0,26,null,744949969002019,false,[[1,[2,"Update_Coins"]],[13,[7,[5,[23,"myCoins"],[20,12,43,false,null,[[20,0,38,false,null,[[0,0]]],[0,2]]]]]]]]],[[0,null,false,null,819808328034759,[[53,67,null,0,false,false,false,181102824129932,false,[[10,1],[8,0],[7,[20,0,38,false,null,[[0,0]]]]]]],[[53,62,null,773086457953775,false,[[0,[0,0]]]],[53,82,null,446297766227508,false,[[4,39],[5,[2,"selection"]],[7,[0,0]]]]],[[0,null,false,null,736228689197167,[[28,77,null,0,false,false,true,961009084790046,false,[[0,[21,53,false,null,3]]]]],[[28,25,null,960181359084624,false]]],[0,null,false,null,518604770485354,[[56,169,null,0,false,false,true,164542201098788,false,[[0,[21,53,false,null,2]]]]],[[56,113,null,578226237483138,false]]]]]]]]],[0,[true,"Tutorial"],false,null,785700447192806,[[-1,23,null,0,false,false,false,785700447192806,false,[[1,[2,"Tutorial"]]]]],[],[[0,null,false,null,871457631452967,[[0,30,null,2,false,false,false,391707590856718,false,[[1,[2,"Show_Tutorial"]]]]],[[-1,29,null,124150636431404,false,[[11,"isTutorialActive"],[7,[0,0]]]],[-1,141,null,367887665993424,false,[[5,[2,"tutorial_bg"]],[3,1]]],[-1,141,null,758148693165545,false,[[5,[2,"tutorial"]],[3,1]]],[-1,141,null,166968300404113,false,[[5,[2,"menu"]],[3,0]]],[-1,29,null,242359386462729,false,[[11,"gameSequence"],[7,[23,"SEQ_TUTORIAL"]]]],[-1,61,null,786130629529813,false,[[4,58],[5,[2,"tutorial"]],[0,[23,"CANVAS_MID_X"]],[0,[4,[23,"CANVAS_MID_Y"],[0,250]]]]],[58,72,null,870570171886459,false,[[0,[1,0.55]]]],[58,131,"LiteTween",979241153328228,false,[[3,0],[3,1]]],[-1,61,null,150185988753074,false,[[4,59],[5,[2,"tutorial"]],[0,[5,[23,"CANVAS_MID_X"],[0,10]]],[0,[5,[4,[23,"CANVAS_HEIGHT"],[6,[23,"canvasDeltaHeight"],[1,0.5]]],[0,125]]]]],[59,72,null,604881183210150,false,[[0,[21,59,false,null,4]]]]]],[0,null,false,null,988564597466900,[[0,30,null,2,false,false,false,360667802036723,false,[[1,[2,"Destroy_Tutorial"]]]]],[[58,25,null,165887926578801,false],[59,25,null,467048823911142,false],[-1,141,null,152929800685578,false,[[5,[2,"tutorial_bg"]],[3,0]]],[-1,141,null,941950528738900,false,[[5,[2,"tutorial"]],[3,0]]],[-1,141,null,186462753190912,false,[[5,[2,"menu"]],[3,1]]]]]]]]],["CarManager",[[0,[true,"CM - On Start"],false,null,448462659487543,[[-1,23,null,0,false,false,false,448462659487543,false,[[1,[2,"CM - On Start"]]]]],[],[[0,null,false,null,856635614345968,[[-1,24,null,1,false,false,false,126246209917035,false]],[[0,26,null,692685119813208,false,[[1,[2,"Init_CarsData"]],[13]]],[71,170,"Chipmunk",530480564195392,false,[[0,[1,0.05]]]],[71,171,"Chipmunk",977737921838183,false,[[3,0],[0,[0,0]],[0,[0,150]]]],[0,26,null,404481939084725,false,[[1,[2,"Clean_CarManager"]],[13]]]]]]],[0,[true,"CM - User Params"],false,null,312250656856091,[[-1,23,null,0,false,false,false,312250656856091,false,[[1,[2,"CM - User Params"]]]]],[]],[1,"myCarSkin",0,0,false,false,509927787402518,false],[0,[true,"CM CONTATNS"],false,null,352257931047112,[[-1,23,null,0,false,false,false,352257931047112,false,[[1,[2,"CM CONTATNS"]]]]],[]],[1,"MAX_SKINS",0,5,false,false,143729125929979,false],[1,"MAX_VIR_SPEED",0,1200,false,false,934484839228825,false],[1,"SCORE_PER_PIXEL",0,0.02,false,false,761089241257778,false],[0,[true,"Balance Params"],false,null,384826172169141,[[-1,23,null,0,false,false,false,384826172169141,false,[[1,[2,"Balance Params"]]]]],[]],[1,"COM_BALANCE_FORCE",0,150,false,false,857910951301962,false],[1,"comForce_ShiftX",0,0,false,false,664493991599433,false],[1,"comForce_ShiftY",0,0,false,false,399675045328321,false],[1,"slopeBalanceMag",0,10,false,false,747319776250575,false],[1,"motionDampingDT",0,0.025,false,false,691887230888278,false],[0,[true,"Camera Params"],false,null,673480222972493,[[-1,23,null,0,false,false,false,673480222972493,false,[[1,[2,"Camera Params"]]]]],[]],[1,"cameraLerp",0,3,false,false,641819865147628,false],[1,"cameraOY",0,50,false,false,121493648660446,false],[1,"startX",0,400,false,false,221352874561827,false],[1,"dropY",0,900,false,false,565312075287010,false],[0,[true,"Car Params"],false,null,117981845434695,[[-1,23,null,0,false,false,false,117981845434695,false,[[1,[2,"Car Params"]]]]],[]],[1,"isControllerActive",0,0,false,false,192693776887627,false],[1,"isGrounded",0,1,false,false,815274497405752,false],[1,"werightPoint",1,"wp_origin",false,false,399545440454164,false],[0,[true,"Boost Dial"],false,null,271432015731080,[[-1,23,null,0,false,false,false,271432015731080,false,[[1,[2,"Boost Dial"]]]]],[]],[1,"needleSimulateAngle",0,0,false,false,419165441739180,false],[1,"boostDial_accMag",0,240,false,false,803316821897777,false],[1,"boostDial_daccMag",0,175,false,false,724312915663753,false],[0,[true,"Cars"],false,null,930800223638274,[[-1,23,null,0,false,false,false,930800223638274,false,[[1,[2,"Cars"]]]]],[],[[0,[true,"Cars - Functions"],false,null,189982599591916,[[-1,23,null,0,false,false,false,189982599591916,false,[[1,[2,"Cars - Functions"]]]]],[],[[0,null,false,null,293761952467524,[[0,30,null,2,false,false,false,123889257131687,false,[[1,[2,"Init_CarsData"]]]]],[[12,54,null,406552785721032,false,[[0,[23,"MAX_SKINS"]],[0,[0,3]],[0,[0,1]]]]],[[0,null,false,null,259078072858043,[],[[12,172,null,194060331505679,false,[[0,[0,0]],[0,[0,0]],[7,[0,0]]]],[12,172,null,460320323865851,false,[[0,[0,0]],[0,[0,1]],[7,[0,1500]]]],[12,172,null,870724337641983,false,[[0,[0,0]],[0,[0,2]],[7,[0,0]]]]]],[0,null,false,null,847234543253960,[],[[12,172,null,107498978684318,false,[[0,[0,1]],[0,[0,0]],[7,[0,0]]]],[12,172,null,460325146684209,false,[[0,[0,1]],[0,[0,1]],[7,[0,1500]]]],[12,172,null,991095006298295,false,[[0,[0,1]],[0,[0,2]],[7,[0,200]]]]]],[0,null,false,null,519637570851272,[],[[12,172,null,168476110710540,false,[[0,[0,2]],[0,[0,0]],[7,[0,0]]]],[12,172,null,403146393147068,false,[[0,[0,2]],[0,[0,1]],[7,[0,2000]]]],[12,172,null,676622443825731,false,[[0,[0,2]],[0,[0,2]],[7,[0,300]]]]]],[0,null,false,null,677697994463766,[],[[12,172,null,400405092823590,false,[[0,[0,3]],[0,[0,0]],[7,[0,1]]]],[12,172,null,889959535487954,false,[[0,[0,3]],[0,[0,1]],[7,[0,2000]]]],[12,172,null,497931048487861,false,[[0,[0,3]],[0,[0,2]],[7,[0,500]]]]]],[0,null,false,null,391566782085064,[],[[12,172,null,489598070060295,false,[[0,[0,4]],[0,[0,0]],[7,[0,1]]]],[12,172,null,407961133698568,false,[[0,[0,4]],[0,[0,1]],[7,[0,2000]]]],[12,172,null,675360751898835,false,[[0,[0,4]],[0,[0,2]],[7,[0,1000]]]]]],[0,null,false,null,482790095694824,[],[[54,54,null,636500828165732,false,[[0,[23,"MAX_SKINS"]],[0,[0,1]],[0,[0,1]]]],[54,40,null,400415353376439,false,[[0,[0,0]],[7,[0,1]]]]]]]],[0,null,false,null,249073449127567,[[0,30,null,2,false,false,false,923453088404721,false,[[1,[2,"Init_CarManager"]]]]],[[0,26,null,384107980996325,false,[[1,[2,"Spawn_aCar"]],[13,[7,[0,0]],[7,[23,"myCarSkin"]],[7,[23,"startX"]],[7,[23,"dropY"]]]]],[-1,112,null,450410779194477,false,[[0,[1,0.25]]]],[0,26,null,749392564151760,false,[[1,[2,"Spawn_aEgg"]],[13]]]]],[0,null,false,null,593920435326214,[[0,30,null,2,false,false,false,725570438582798,false,[[1,[2,"Clean_CarManager"]]]]],[[71,25,null,907191593417553,false],[72,25,null,472958413411327,false],[75,25,null,607500795325605,false],[73,25,null,109106495281883,false],[14,25,null,312473452527459,false],[76,25,null,924180295166269,false],[80,25,null,424284600851460,false]]],[0,null,false,null,480387335821122,[[0,30,null,2,false,false,false,657809004641582,false,[[1,[2,"Spawn_aCar"]]]]],[[-1,61,null,185384220477600,false,[[4,3],[5,[2,"track"]],[0,[20,0,38,false,null,[[0,2]]]],[0,[20,0,38,false,null,[[0,3]]]]]],[3,63,null,643507772056140,false,[[10,9],[7,[7,[0,1],[23,"MAX_VIR_SPEED"]]]]],[3,63,null,448724785359477,false,[[10,6],[7,[20,0,38,false,null,[[0,0]]]]]],[3,63,null,633029918261621,false,[[10,2],[7,[20,0,38,false,null,[[0,1]]]]]],[3,62,null,412412049498580,false,[[0,[21,3,false,null,2]]]],[3,63,null,163116459282967,false,[[10,8],[7,[20,3,93,false,null]]]],[3,78,null,372120050820753,false,[[10,4],[3,1]]]],[[0,null,false,null,879429648016886,[[-1,39,null,0,true,false,false,833414597330658,false,[[0,[0,2]]]]],[[-1,61,null,704356478602557,false,[[4,4],[5,[2,"track"]],[0,[20,3,65,false,null,[[10,[2,"tyre_"],[19,41]]]]],[0,[20,3,66,false,null,[[10,[2,"tyre_"],[19,41]]]]]]],[4,63,null,149784775639640,false,[[10,2],[7,[21,3,false,null,6]]]],[4,62,null,861978097997276,false,[[0,[20,12,43,false,null,[[21,3,false,null,2],[0,0]]]]]],[4,173,"Chipmunk",155430055688310,false,[[3,2],[0,[0,31]]]],[3,174,"Chipmunk",815267658368588,false,[[3,2],[0,[20,3,65,false,null,[[10,[2,"shaft_"],[19,41]]]]],[0,[20,3,66,false,null,[[10,[2,"shaft_"],[19,41]]]]],[3,2],[0,[20,3,65,false,null,[[10,[2,"tyre_"],[19,41]]]]],[0,[20,3,66,false,null,[[10,[2,"tyre_"],[19,41]]]]],[0,[20,4,70,false,null]],[3,0],[0,[0,0]],[0,[0,0]],[1,[2,""]]]],[3,175,"Chipmunk",837163192587776,false,[[3,2],[0,[20,3,65,false,null,[[10,[2,"shaft_"],[19,41]]]]],[0,[5,[20,3,66,false,null,[[10,[2,"shaft_"],[19,41]]]],[0,10]]],[0,[20,4,70,false,null]],[3,0],[0,[0,0]],[0,[0,0]],[0,[0,50]],[0,[0,20]],[0,[0,10]],[1,[2,""]]]],[-1,61,null,274985767278199,false,[[4,10],[5,[2,"track"]],[0,[20,4,93,false,null]],[0,[20,4,86,false,null]]]],[10,176,null,365041848555243,false,[[0,[4,[6,[20,4,74,false,null],[1,0.5]],[0,15]]]]],[10,76,"Pin",274527529489506,false,[[4,4],[3,1]]],[10,63,null,972412668899804,false,[[10,0],[7,[19,41]]]]],[[0,null,false,null,306668886304386,[[-1,33,null,0,false,false,false,233224265174853,false,[[7,[19,41]],[8,0],[7,[0,1]]]]],[[4,78,null,316296358801137,false,[[10,0],[3,1]]],[4,63,null,337277335105401,false,[[10,1],[7,[20,12,43,false,null,[[21,3,false,null,2],[0,1]]]]]]]]]]]],[0,null,false,null,955491372887288,[[0,30,null,2,false,false,false,833401047687704,false,[[1,[2,"Push_aCar"]]]]],[],[[0,null,false,null,760573312339743,[[71,79,null,0,false,false,false,895824684042797,false,[[10,5]]]],[[71,78,null,658861061341884,false,[[10,1],[3,1]]]],[[0,null,false,null,269722505950454,[[72,67,null,0,false,false,false,167242040875958,false,[[10,2],[8,0],[7,[21,71,false,null,6]]]]],[],[[0,null,false,null,472440707465652,[[71,79,null,0,false,false,false,509150517203940,false,[[10,3]]]],[],[[0,null,false,null,955686565259287,[[72,79,null,0,false,false,false,298348362334445,false,[[10,0]]]],[],[[0,null,false,null,317208288498053,[[0,71,null,0,false,false,false,117514897174135,false,[[0,[0,0]],[8,0],[7,[2,"FORWARD"]]]]],[[72,177,"Chipmunk",334908153942961,false,[[3,1],[0,[20,71,84,false,null]],[0,[21,72,false,null,1]],[3,0],[0,[0,0]],[0,[0,0]]]]]],[0,null,false,null,217364709794605,[[0,71,null,0,false,false,false,940252490844325,false,[[0,[0,0]],[8,0],[7,[2,"BACKWARD"]]]]],[[72,177,"Chipmunk",755926657447432,false,[[3,1],[0,[4,[20,71,84,false,null],[0,180]]],[0,[21,72,false,null,1]],[3,0],[0,[0,0]],[0,[0,0]]]]]]]]]]]]]]]]]],[0,[true,"Cars - Input"],false,null,908850373277060,[[-1,23,null,0,false,false,false,908850373277060,false,[[1,[2,"Cars - Input"]]]]],[],[[0,null,false,null,812348958874475,[[1,145,null,1,false,false,false,311956083062569,false,[[4,32]]]],[],[[0,null,false,null,625270815733870,[[-1,27,null,0,false,false,false,102217595590082,false,[[11,"isControllerActive"],[8,0],[7,[0,1]]]]],[],[[0,null,false,null,702610932302966,[[32,79,null,0,false,true,false,218468986973972,false,[[10,2]]]],[[0,26,null,933447415519696,false,[[1,[2,"Update_aPaddleState"]],[13,[7,[21,32,true,null,0]],[7,[2,"PRESSED"]]]]]]]]]]],[0,null,false,null,933151021552588,[[1,146,null,1,false,false,false,922749953123398,false]],[],[[0,null,false,null,814637775624640,[[32,67,null,0,false,false,false,853156540237579,false,[[10,1],[8,0],[7,[2,"PRESSED"]]]]],[],[[0,null,false,null,382923224243404,[[32,79,null,0,false,true,false,622584842948542,false,[[10,2]]]],[],[[0,null,false,null,208738689299993,[[-1,106,null,0,true,false,false,104183965628339,false,[[4,32]]]],[[0,26,null,648426006760847,false,[[1,[2,"Update_aPaddleState"]],[13,[7,[21,32,true,null,0]],[7,[2,"IDLE"]]]]]]]]]]]]],[0,null,false,null,233629433570840,[[-1,27,null,0,false,false,false,701353055485336,false,[[11,"isControllerActive"],[8,0],[7,[0,1]]]]],[],[[1,"inputActive",0,0,false,false,315515277788245,false],[1,"isMovingForward",0,0,false,false,309982345142202,false],[1,"isMovingBackward",0,0,false,false,412887495690549,false],[0,null,false,null,556236851220673,[[32,67,null,0,false,false,false,123633052390832,false,[[10,1],[8,0],[7,[2,"PRESSED"]]]]],[],[[0,null,false,null,774996704483439,[[32,67,null,0,false,false,false,609526685136074,false,[[10,0],[8,0],[7,[2,"FORWARD"]]]]],[[-1,29,null,993994692037705,false,[[11,"inputActive"],[7,[0,1]]]],[-1,29,null,498004619884544,false,[[11,"isMovingForward"],[7,[0,1]]]]]],[0,null,false,null,923486427807882,[[32,67,null,0,false,false,false,475500964842443,false,[[10,0],[8,0],[7,[2,"BACKWARD"]]]]],[[-1,29,null,832743443806735,false,[[11,"inputActive"],[7,[0,1]]]],[-1,29,null,106933573005424,false,[[11,"isMovingBackward"],[7,[0,1]]]]]]]],[0,null,false,null,607792595307777,[[-1,178,null,0,false,true,false,506785583472097,false]],[],[[0,null,true,null,802778897162593,[[2,179,null,0,false,false,false,187683080764271,false,[[9,68]]],[2,179,null,0,false,false,false,642447734179952,false,[[9,39]]]],[[-1,29,null,194149765549824,false,[[11,"inputActive"],[7,[0,1]]]],[-1,29,null,319647889707884,false,[[11,"isMovingForward"],[7,[0,1]]]]],[[0,null,false,null,508024099649656,[[32,67,null,0,false,false,false,246311040075561,false,[[10,0],[8,0],[7,[2,"FORWARD"]]]]],[[32,78,null,686828871705727,false,[[10,2],[3,1]]],[0,26,null,915124902369471,false,[[1,[2,"Update_aPaddleState"]],[13,[7,[21,32,true,null,0]],[7,[2,"PRESSED"]]]]]]]]],[0,null,true,null,878786336234897,[[2,179,null,0,false,false,false,842016217648617,false,[[9,65]]],[2,179,null,0,false,false,false,695393389823282,false,[[9,37]]]],[[-1,29,null,380520045034453,false,[[11,"inputActive"],[7,[0,1]]]],[-1,29,null,172425989591681,false,[[11,"isMovingBackward"],[7,[0,1]]]]],[[0,null,false,null,937381505820567,[[32,67,null,0,false,false,false,481781829540663,false,[[10,0],[8,0],[7,[2,"BACKWARD"]]]]],[[32,78,null,780838684212680,false,[[10,2],[3,1]]],[0,26,null,242019085231047,false,[[1,[2,"Update_aPaddleState"]],[13,[7,[21,32,true,null,0]],[7,[2,"PRESSED"]]]]]]]]],[0,null,false,null,611536126288454,[[32,79,null,0,false,false,false,557842870452608,false,[[10,2]]]],[],[[0,null,false,null,249579359744839,[[32,67,null,0,false,false,false,551942054279669,false,[[10,0],[8,0],[7,[2,"FORWARD"]]]]],[],[[0,null,false,null,321435256544048,[[2,179,null,0,false,true,false,320751115890024,false,[[9,68]]],[2,179,null,0,false,true,false,677125952098832,false,[[9,39]]]],[[-1,29,null,260681455826901,false,[[11,"isMovingForward"],[7,[0,0]]]],[32,78,null,806939393285909,false,[[10,2],[3,0]]],[0,26,null,261267826836405,false,[[1,[2,"Update_aPaddleState"]],[13,[7,[21,32,true,null,0]],[7,[2,"IDLE"]]]]]]]]],[0,null,false,null,426878057050485,[[32,67,null,0,false,false,false,248124933979753,false,[[10,0],[8,0],[7,[2,"BACKWARD"]]]]],[],[[0,null,false,null,777596468413522,[[2,179,null,0,false,true,false,587768414305288,false,[[9,65]]],[2,179,null,0,false,true,false,382022439606887,false,[[9,37]]]],[[-1,29,null,112591608030605,false,[[11,"isMovingBackward"],[7,[0,0]]]],[32,78,null,478226022325534,false,[[10,2],[3,0]]],[0,26,null,673192152104633,false,[[1,[2,"Update_aPaddleState"]],[13,[7,[21,32,true,null,0]],[7,[2,"IDLE"]]]]]]]]]]]]],[0,null,false,null,391420988223311,[[-1,27,null,0,false,false,false,464920461259346,false,[[11,"inputActive"],[8,0],[7,[0,1]]]]],[],[[0,null,false,null,356532572604661,[[-1,27,null,0,false,false,false,538611140635919,false,[[11,"isMovingForward"],[8,0],[7,[0,1]]]]],[[0,26,null,981298284533784,false,[[1,[2,"Push_aCar"]],[13,[7,[2,"FORWARD"]]]]],[-1,60,null,716830624764602,false,[[11,"needleSimulateAngle"],[7,[6,[23,"boostDial_accMag"],[19,87]]]]]]],[0,null,false,null,704399712329733,[[-1,27,null,0,false,false,false,631422458018152,false,[[11,"isMovingBackward"],[8,0],[7,[0,1]]]]],[[0,26,null,170915386050529,false,[[1,[2,"Push_aCar"]],[13,[7,[2,"BACKWARD"]]]]],[-1,60,null,929522911729108,false,[[11,"needleSimulateAngle"],[7,[6,[3,[23,"boostDial_accMag"]],[19,87]]]]]]]]],[0,null,false,null,625776764613278,[[-1,27,null,0,false,false,false,101724026100706,false,[[11,"inputActive"],[8,0],[7,[0,0]]]]],[],[[0,null,false,null,963567840801925,[[-1,27,null,0,false,false,false,820850397018543,false,[[11,"needleSimulateAngle"],[8,4],[7,[0,0]]]]],[[-1,124,null,539547503376600,false,[[11,"needleSimulateAngle"],[7,[6,[23,"boostDial_daccMag"],[19,87]]]]]],[[0,null,false,null,419569444157638,[[-1,27,null,0,false,false,false,920716590731154,false,[[11,"needleSimulateAngle"],[8,3],[7,[0,0]]]]],[[-1,29,null,273113416108601,false,[[11,"needleSimulateAngle"],[7,[0,0]]]]]]]],[0,null,false,null,821761981428553,[[-1,27,null,0,false,false,false,837767291554665,false,[[11,"needleSimulateAngle"],[8,2],[7,[0,0]]]]],[[-1,60,null,460710958002737,false,[[11,"needleSimulateAngle"],[7,[6,[23,"boostDial_daccMag"],[19,87]]]]]],[[0,null,false,null,502572492202796,[[-1,27,null,0,false,false,false,287604508953224,false,[[11,"needleSimulateAngle"],[8,5],[7,[0,0]]]]],[[-1,29,null,854505154799800,false,[[11,"needleSimulateAngle"],[7,[0,0]]]]]]]],[0,null,false,null,230495063643488,[[71,79,null,0,false,false,false,233055183633632,false,[[10,5]]]],[],[[0,null,false,null,667273771882175,[[71,79,null,0,false,false,false,135062269155453,false,[[10,1]]]],[[71,78,null,547890694015737,false,[[10,1],[3,0]]]]]]]]],[0,null,false,null,873791627041557,[[27,67,null,0,false,false,false,548959688399941,false,[[10,0],[8,0],[7,[2,"BOOST"]]]]],[[-1,29,null,867521828630321,false,[[11,"needleSimulateAngle"],[7,[19,46,[[23,"needleSimulateAngle"],[0,-90],[0,90]]]]]]],[[0,null,false,null,993227116047663,[[-1,27,null,0,false,false,false,146696708522948,false,[[11,"needleSimulateAngle"],[8,4],[7,[0,0]]]]],[[33,83,null,776890121135755,false,[[0,[4,[4,[21,33,false,null,0],[6,[21,33,false,null,2],[19,102,[[23,"needleSimulateAngle"]]]]],[21,33,false,null,5]]]]]]],[0,null,false,null,875730948581530,[[-1,27,null,0,false,false,false,722111216905073,false,[[11,"needleSimulateAngle"],[8,2],[7,[0,0]]]]],[[33,83,null,231833275315639,false,[[0,[4,[5,[21,33,false,null,0],[6,[21,33,false,null,1],[19,102,[[23,"needleSimulateAngle"]]]]],[21,33,false,null,5]]]]]]],[0,null,false,null,704158352827961,[[-1,27,null,0,false,false,false,245384091461825,false,[[11,"needleSimulateAngle"],[8,0],[7,[0,0]]]]],[[33,83,null,397017496097319,false,[[0,[4,[21,33,false,null,0],[21,33,false,null,5]]]]]]],[0,null,false,null,975166410822475,[],[[33,133,null,633558826350706,false,[[10,6],[7,[3,[19,87]]]]]],[[0,null,false,null,482309463009362,[[33,67,null,0,false,false,false,757228438617598,false,[[10,6],[8,3],[7,[0,0]]]]],[[33,133,null,731908237993142,false,[[10,6],[7,[5,[1,0.05],[6,[19,102,[[19,180,[[23,"needleSimulateAngle"]]]]],[1,0.035]]]]]]],[[0,null,false,null,585077987963569,[[-1,33,null,0,false,false,false,211879923283646,false,[[7,[19,180,[[19,102,[[23,"needleSimulateAngle"]]]]]],[8,0],[7,[0,1]]]]],[[33,63,null,189238502707948,false,[[10,5],[7,[4,[3,[21,33,false,null,3]],[19,57,[[6,[21,33,false,null,3],[0,2]]]]]]]]]],[0,null,false,null,854128958732671,[[-1,37,null,0,false,false,false,807237043054499,false]],[[33,63,null,689735045960570,false,[[10,5],[7,[4,[3,[21,33,false,null,4]],[19,57,[[6,[21,33,false,null,4],[0,2]]]]]]]]]]]]]]]]]]]],[0,[true,"Cars - Tick"],false,null,929063332777303,[[-1,23,null,0,false,false,false,929063332777303,false,[[1,[2,"Cars - Tick"]]]]],[],[[0,null,false,null,465430883390607,[[71,79,null,0,false,false,false,313202833347373,false,[[10,4]]]],[[71,78,null,748214200322330,false,[[10,3],[3,1]]],[71,63,null,338775868545607,false,[[10,0],[7,[22,71,"Chipmunk",181,false,null]]]],[71,177,"Chipmunk",574503562357729,false,[[3,1],[0,[4,[20,71,84,false,null],[0,90]]],[0,[23,"COM_BALANCE_FORCE"]],[3,0],[0,[23,"comForce_ShiftX"]],[0,[0,0]]]],[-1,29,null,249943772128512,false,[[11,"comForce_ShiftX"],[7,[6,[6,[3,[19,102,[[20,71,84,false,null]]]],[20,71,73,false,null]],[1,0.5]]]]],[11,45,null,606738115498461,false,[[7,[19,36,[[22,71,"Chipmunk",181,false,null]]]]]]],[[0,null,false,null,398013264053586,[[74,182,null,0,false,false,true,363483860595865,false,[[3,0],[0,[5,[4,[20,71,93,false,null],[0,50]],[6,[23,"TRACK_UNIT_WIDTH"],[1,0.5]]]],[0,[19,110]]]]],[],[[0,null,false,null,210097211104428,[[76,67,null,0,false,false,false,570451436165717,false,[[10,0],[8,0],[7,[0,0]]]]],[],[[0,null,false,null,827426279976374,[[76,183,null,0,false,true,false,907077197476968,false,[[4,74]]]],[[71,78,null,866345350530570,false,[[10,3],[3,0]]]]]]]]],[0,null,false,null,105177799862619,[[74,182,null,0,false,false,true,428117007427363,false,[[3,0],[0,[5,[5,[20,71,93,false,null],[0,50]],[6,[23,"TRACK_UNIT_WIDTH"],[1,0.5]]]],[0,[19,110]]]]],[],[[0,null,false,null,344892795220273,[[76,67,null,0,false,false,false,182174606917154,false,[[10,0],[8,0],[7,[0,1]]]]],[],[[0,null,false,null,231617014479949,[[76,183,null,0,false,true,false,665971350314509,false,[[4,74]]]],[[71,78,null,261347591639148,false,[[10,3],[3,0]]]]]]]]],[0,null,false,null,660924775075560,[[71,184,null,0,false,false,false,532901700177305,false,[[0,[0,275]],[0,[0,325]]]]],[],[[0,null,false,null,862202616712290,[[-1,33,null,0,false,false,false,724087109319491,false,[[7,[22,71,"Chipmunk",185,false,null]],[8,2],[7,[0,0]]]]],[[71,177,"Chipmunk",153868324882108,false,[[3,1],[0,[4,[20,71,84,false,null],[0,90]]],[0,[6,[3,[22,71,"Chipmunk",185,false,null]],[23,"slopeBalanceMag"]]],[3,0],[0,[3,[4,[6,[20,71,73,false,null],[1,0.5]],[0,20]]]],[0,[6,[3,[20,71,74,false,null]],[1,0.5]]]]]]],[0,null,false,null,347190724440427,[[-1,33,null,0,false,false,false,401022669102915,false,[[7,[22,71,"Chipmunk",185,false,null]],[8,4],[7,[0,0]]]]],[[71,177,"Chipmunk",926586069680333,false,[[3,1],[0,[4,[20,71,84,false,null],[0,90]]],[0,[6,[3,[22,71,"Chipmunk",185,false,null]],[23,"slopeBalanceMag"]]],[3,0],[0,[3,[5,[6,[20,71,73,false,null],[1,0.5]],[0,20]]]],[0,[6,[3,[20,71,74,false,null]],[1,0.5]]]]]]]]],[0,null,false,null,794631652278874,[[71,79,null,0,false,true,false,161624499321574,false,[[10,1]]]],[[71,159,"Chipmunk",458203162977570,false,[[3,0],[0,[19,134,[[22,71,"Chipmunk",186,false,null],[0,0],[23,"motionDampingDT"]]]],[0,[19,134,[[22,71,"Chipmunk",185,false,null],[0,0],[23,"motionDampingDT"]]]]]]]],[0,null,false,null,488369896996369,[],[[71,63,null,112482256104468,false,[[10,10],[7,[6,[22,71,"Chipmunk",181,false,null],[21,71,false,null,9]]]]]]],[0,null,false,null,203051479880660,[[71,79,null,0,false,false,false,752613255915985,false,[[10,5]]]],[[71,63,null,780316719122311,false,[[10,7],[7,[5,[20,71,93,false,null],[21,71,false,null,8]]]]],[71,63,null,162763919384883,false,[[10,8],[7,[20,71,93,false,null]]]]],[[0,null,false,null,269582552541883,[[73,187,null,0,false,false,false,699710908866970,false]],[[-1,109,null,297431782948836,false,[[0,[19,134,[[19,94],[20,73,93,false,null],[6,[23,"cameraLerp"],[19,87]]]]],[0,[19,134,[[19,95],[19,46,[[4,[20,73,86,false,null],[23,"cameraOY"]],[0,0],[5,[23,"TRACK_POS_Y"],[23,"CANVAS_MID_Y"]]]],[6,[23,"cameraLerp"],[19,87]]]]]]]]],[0,null,false,null,633383162644412,[[-1,37,null,0,false,false,false,561972511332310,false]],[[-1,109,null,840201548954386,false,[[0,[19,134,[[19,94],[20,71,93,false,null],[6,[23,"cameraLerp"],[19,87]]]]],[0,[19,134,[[19,95],[19,46,[[4,[20,71,86,false,null],[23,"cameraOY"]],[0,0],[5,[23,"TRACK_POS_Y"],[23,"CANVAS_MID_Y"]]]],[6,[23,"cameraLerp"],[19,87]]]]]]]]],[0,null,false,null,269552807050496,[[71,188,null,0,false,false,false,785195985181580,false,[[8,5],[0,[23,"trackTraceX"]]]]],[[0,26,null,939001670993944,false,[[1,[2,"On_TrackMid_Covered"]],[13]]]]],[0,null,false,null,334061088742891,[[-1,27,null,0,false,false,false,730130903723347,false,[[11,"GAME_START"],[8,0],[7,[0,1]]]]],[[71,63,null,108986601793293,false,[[10,15],[7,[19,46,[[5,[20,73,93,false,null],[21,73,false,null,2]],[0,0],[19,47]]]]]],[0,26,null,118448076577827,false,[[1,[2,"Update_Score"]],[13,[7,[19,36,[[6,[21,71,false,null,15],[23,"SCORE_PER_PIXEL"]]]]]]]]],[[0,null,false,null,557525169346204,[[-1,27,null,0,false,false,false,531162628499893,false,[[11,"myPreRecordBeaten"],[8,0],[7,[0,0]]]],[-1,27,null,0,false,false,false,648406922663969,false,[[11,"myBestDistance"],[8,1],[7,[0,0]]]]],[],[[0,null,false,null,859882783699783,[[71,67,null,0,false,false,false,648584785050751,false,[[10,15],[8,4],[7,[23,"myBestDistance"]]]]],[[0,26,null,645965097536307,false,[[1,[2,"On_BestLine_Crossed"]],[13]]]]]]],[0,null,false,null,977317192296217,[[-1,27,null,0,false,false,false,618186232231114,false,[[11,"platform"],[8,0],[7,[23,"PLATFORM_FACEBOOK"]]]]],[],[[0,null,false,null,887386168952890,[[-1,27,null,0,false,false,false,301198929539778,false,[[11,"LBScoreToBeat"],[8,1],[7,[0,-1]]]]],[[0,26,null,326205679591558,false,[[1,[2,"on_LBScoreToBeat_Update"]],[13,[7,[21,71,false,null,15]]]]]]],[0,null,false,null,144140836324574,[[-1,27,null,0,false,false,false,743734170681058,false,[[11,"scoreToBeat"],[8,1],[7,[0,-1]]]]],[[0,26,null,521362105326000,false,[[1,[2,"on_ScoreToBeat_Update"]],[13,[7,[21,71,false,null,15]]]]]]]]]]],[0,null,false,null,838886534740861,[[71,79,null,0,false,false,false,555559918923313,false,[[10,13]]]],[],[[0,null,false,null,484117540881702,[[83,189,null,0,false,false,false,741045805417281,false]],[],[[0,null,false,null,222455941909802,[[83,79,null,0,false,true,false,301250861434886,false,[[10,1]]],[83,79,null,0,false,true,false,647019663803871,false,[[10,0]]]],[[83,78,null,466719307866983,false,[[10,1],[3,1]]]],[[0,null,false,null,996447127718027,[],[]]]]]]]],[0,null,false,null,201240100714201,[],[[78,156,null,158694466781931,false,[[0,[5,[20,78,93,false,null],[6,[21,71,false,null,7],[21,78,false,null,0]]]]]]],[[0,null,false,null,551709979420712,[[78,188,null,0,false,false,false,438020233597770,false,[[8,2],[0,[21,78,false,null,2]]]]],[[78,156,null,171329919778125,false,[[0,[4,[20,78,93,false,null],[6,[21,78,false,null,1],[21,78,false,null,4]]]]]]]],[0,null,false,null,202592215446279,[[78,188,null,0,false,false,false,942501749128467,false,[[8,4],[0,[21,78,false,null,3]]]]],[[78,156,null,306845165646600,false,[[0,[5,[20,78,93,false,null],[6,[21,78,false,null,1],[21,78,false,null,4]]]]]]]]]],[0,null,false,null,834671251984877,[[27,67,null,0,false,false,false,171391492364904,false,[[10,0],[8,0],[7,[2,"RPM"]]]]],[[33,83,null,714068190127062,false,[[0,[4,[4,[21,33,false,null,0],[6,[21,33,false,null,2],[21,71,false,null,10]]],[21,33,false,null,5]]]]]],[[0,null,false,null,238574807986766,[],[[33,133,null,138387931118008,false,[[10,6],[7,[3,[19,87]]]]]],[[0,null,false,null,642267434773242,[[33,67,null,0,false,false,false,380949652782562,false,[[10,6],[8,3],[7,[0,0]]]]],[[33,133,null,463614310053057,false,[[10,6],[7,[5,[1,0.05],[6,[19,102,[[19,180,[[23,"needleSimulateAngle"]]]]],[1,0.035]]]]]]],[[0,null,false,null,613477547213292,[[-1,33,null,0,false,false,false,438709069440063,false,[[7,[19,180,[[21,71,false,null,10]]]],[8,3],[7,[1,0.05]]]]],[[33,63,null,548764371037678,false,[[10,5],[7,[4,[3,[21,33,false,null,4]],[19,57,[[6,[21,33,false,null,4],[0,2]]]]]]]]]],[0,null,false,null,551865200270897,[[-1,37,null,0,false,false,false,260472700878672,false]],[[33,63,null,600715204146265,false,[[10,5],[7,[0,0]]]]]]]]]]]]]]]]]],[0,[true,"Cars - Triggers"],false,null,688037297886230,[[-1,23,null,0,false,false,false,688037297886230,false,[[1,[2,"Cars - Triggers"]]]]],[],[[0,null,false,null,397615896680494,[[71,190,null,0,false,false,true,363918900764275,false,[[4,83]]]],[],[[0,null,false,null,733205834725333,[[71,79,null,0,false,false,false,949960363656628,false,[[10,4]]]],[],[[0,null,false,null,452056208954513,[[83,79,null,0,false,true,false,364446998907954,false,[[10,0]]]],[],[[0,null,false,null,460430860223676,[[-1,106,null,0,true,false,false,430796649620677,false,[[4,83]]]],[[0,26,null,829166240493568,false,[[1,[2,"Pick_aCoin"]],[13,[7,[20,83,70,false,null]]]]]]]]]]]]],[0,null,false,null,534807431034584,[[71,190,null,0,false,false,true,264935626415185,false,[[4,81]]]],[],[[0,null,false,null,307395532244963,[[71,79,null,0,false,false,false,507886013590353,false,[[10,4]]]],[],[[0,null,false,null,334255380983713,[[81,79,null,0,false,true,false,308695356800941,false,[[10,0]]]],[[0,26,null,360802531608449,false,[[1,[2,"Pick_aPowerUp"]],[13,[7,[20,81,70,false,null]]]]]]]]]]]]]]],[0,[true,"Egg Params"],false,null,506693994301675,[[-1,23,null,0,false,false,false,506693994301675,false,[[1,[2,"Egg Params"]]]]],[]],[1,"EGG_SCALE",0,0.65,false,false,490844703400992,false],[1,"eggDropX",0,0,false,false,595978107118735,false],[1,"eggDropY",0,0,false,false,210370061199847,false],[0,[true,"Eggs"],false,null,673193186483794,[[-1,23,null,0,false,false,false,673193186483794,false,[[1,[2,"Eggs"]]]]],[],[[0,[true,"Egg - Functions"],false,null,332100307571283,[[-1,23,null,0,false,false,false,332100307571283,false,[[1,[2,"Egg - Functions"]]]]],[],[[0,null,false,null,944564312628516,[[0,30,null,2,false,false,false,995933930091130,false,[[1,[2,"Spawn_aEgg"]]]]],[[-1,61,null,423287672300519,false,[[4,5],[5,[2,"track"]],[0,[20,71,93,false,null]],[0,[5,[20,71,86,false,null],[0,150]]]]],[5,63,null,994359062609596,false,[[10,2],[7,[20,5,93,false,null]]]],[5,72,null,182588085946860,false,[[0,[23,"EGG_SCALE"]]]]]],[0,null,false,null,577337269248211,[[0,30,null,2,false,false,false,586620191177338,false,[[1,[2,"Spawn_aEggOutline"]]]]],[[-1,61,null,927601449439320,false,[[4,14],[5,[2,"track"]],[0,[20,0,38,false,null,[[0,0]]]],[0,[20,0,38,false,null,[[0,1]]]]]],[14,83,null,528963396952834,false,[[0,[20,0,38,false,null,[[0,2]]]]]],[14,72,null,516894423531862,false,[[0,[23,"EGG_SCALE"]]]]]]]],[0,[true,"Egg - Triggers"],false,null,553407137334835,[[-1,23,null,0,false,false,false,553407137334835,false,[[1,[2,"Egg - Triggers"]]]]],[],[[0,null,false,null,465287170659329,[[73,191,"Chipmunk",1,false,false,false,600338962757599,false]],[],[[0,null,false,null,144295714845947,[[74,77,null,0,false,false,true,649429738728984,false,[[0,[22,73,"Chipmunk",192,false,null]]]]],[[9,69,null,313936746328147,false,[[3,0],[7,[2,"Collided with track"]]]]],[[0,null,false,null,301339133878580,[[-1,27,null,0,false,false,false,164268446460686,false,[[11,"GAME_START"],[8,0],[7,[0,1]]]]],[[0,26,null,513574800619485,false,[[1,[2,"Play_GpSound"]],[13,[7,[2,"egg_broken"]]]]],[-1,29,null,326263015515853,false,[[11,"myLastDistance"],[7,[19,36,[[19,46,[[5,[20,73,93,false,null],[21,73,false,null,2]],[0,0],[19,47]]]]]]]],[-1,29,null,691450033194556,false,[[11,"eggDropX"],[7,[20,73,93,false,null]]]],[-1,29,null,185551916967798,false,[[11,"eggDropY"],[7,[20,73,86,false,null]]]],[0,26,null,596925964198192,false,[[1,[2,"End_Game"]],[13]]],[0,26,null,557494768845196,false,[[1,[2,"Spawn_aEggOutline"]],[13,[7,[20,73,93,false,null]],[7,[20,73,86,false,null]],[7,[20,73,84,false,null]]]]],[0,26,null,376044415668877,false,[[1,[2,"Spawn_eggBroke_Particles"]],[13,[7,[20,73,93,false,null]],[7,[20,73,86,false,null]]]]],[-1,61,null,869457094167020,false,[[4,24],[5,[2,"track"]],[0,[4,[20,73,93,false,null],[6,[6,[0,50],[19,102,[[20,73,84,false,null]]]],[23,"EGG_SCALE"]]]],[0,[5,[20,73,86,false,null],[6,[6,[0,50],[19,101,[[20,73,84,false,null]]]],[23,"EGG_SCALE"]]]]]],[24,83,null,140084213014356,false,[[0,[20,73,84,false,null]]]],[24,72,null,575906607618611,false,[[0,[23,"EGG_SCALE"]]]],[24,193,"Chipmunk",354621454412379,false,[[3,0]]],[24,194,"Chipmunk",595302608004247,false,[[3,1],[0,[20,73,84,false,null]],[0,[0,100]],[3,0],[0,[0,0]],[0,[0,0]]]],[-1,61,null,909074715826877,false,[[4,24],[5,[2,"track"]],[0,[5,[20,73,93,false,null],[6,[6,[0,50],[19,102,[[20,73,84,false,null]]]],[23,"EGG_SCALE"]]]],[0,[4,[20,73,86,false,null],[6,[6,[0,50],[19,101,[[20,73,84,false,null]]]],[23,"EGG_SCALE"]]]]]],[24,62,null,629163394124577,false,[[0,[0,1]]]],[24,83,null,425247289140296,false,[[0,[20,73,84,false,null]]]],[24,72,null,142860714182664,false,[[0,[23,"EGG_SCALE"]]]],[24,193,"Chipmunk",616840100759864,false,[[3,0]]],[24,194,"Chipmunk",466333487510254,false,[[3,1],[0,[4,[20,73,84,false,null],[0,180]]],[0,[0,100]],[3,0],[0,[0,0]],[0,[0,0]]]],[73,25,null,948733496931452,false],[-1,61,null,465871858753430,false,[[4,35],[5,[2,"track"]],[0,[20,73,93,false,null]],[0,[5,[20,73,86,false,null],[19,195,[[19,180,[[6,[4,[6,[20,73,74,false,null],[1,0.5]],[0,20]],[19,102,[[4,[20,73,84,false,null],[0,90]]]]]]],[19,180,[[6,[4,[6,[20,73,73,false,null],[1,0.5]],[0,20]],[19,101,[[4,[20,73,84,false,null],[0,90]]]]]]]]]]]]],[35,45,null,502603328215340,false,[[7,[10,[23,"myScore"],[2,"m"]]]]]]]]],[0,null,false,null,969602783382728,[[73,79,null,0,false,false,false,648779049555223,false,[[10,1]]]],[],[[0,null,false,null,913414347891714,[[-1,33,null,0,false,false,false,292448902648689,false,[[7,[22,73,"Chipmunk",196,false,null]],[8,5],[7,[0,600]]]]],[[73,133,null,785605750253176,false,[[10,0],[7,[1,0.15]]]],[73,78,null,379122871876509,false,[[10,1],[3,0]]],[0,26,null,452415592665988,false,[[1,[2,"Spawn_eggHit_Particles"]],[13,[7,[22,73,"Chipmunk",197,false,null,[[5,[22,73,"Chipmunk",198,false,null],[0,1]]]]],[7,[22,73,"Chipmunk",199,false,null,[[5,[22,73,"Chipmunk",198,false,null],[0,1]]]]],[7,[19,97,[[20,73,93,false,null],[20,73,86,false,null],[22,73,"Chipmunk",197,false,null,[[5,[22,73,"Chipmunk",198,false,null],[0,1]]]],[22,73,"Chipmunk",199,false,null,[[5,[22,73,"Chipmunk",198,false,null],[0,1]]]]]]]]]],[0,26,null,655973871885036,false,[[1,[2,"Play_GpSound"]],[13,[7,[2,"egg_hit"]],[7,[19,46,[[19,36,[[7,[22,73,"Chipmunk",196,false,null],[0,600]]]],[0,0],[0,3]]]]]]]]]]]]]]],[0,[true,"Egg - Tick"],false,null,867539372878842,[[-1,23,null,0,false,false,false,867539372878842,false,[[1,[2,"Egg - Tick"]]]]],[],[[0,null,false,null,681447489883377,[[-1,200,null,0,false,false,false,395658539424806,false]],[],[[0,null,false,null,250720621352886,[[-1,27,null,0,false,false,false,796492775783300,false,[[11,"gameSequence"],[8,0],[7,[23,"SEQ_TUTORIAL"]]]]],[]],[0,null,false,null,390383309694278,[[73,79,null,0,false,true,false,507544146714762,false,[[10,1]]]],[[73,201,null,320763549758236,false,[[10,0],[7,[19,87]]]]],[[0,null,false,null,578101845338359,[[73,67,null,0,false,false,false,625597717492081,false,[[10,0],[8,3],[7,[0,0]]]]],[[73,78,null,731560148618001,false,[[10,1],[3,1]]]]]]]]]]]]],[0,[true,"CM VFX"],false,null,613784146524289,[[-1,23,null,0,false,false,false,613784146524289,false,[[1,[2,"CM VFX"]]]]],[],[[0,null,false,null,244372693851331,[[0,30,null,2,false,false,false,118447996343269,false,[[1,[2,"Spawn_eggHit_Particles"]]]]],[[-1,61,null,509580025704358,false,[[4,13],[5,[2,"track"]],[0,[20,0,38,false,null,[[0,0]]]],[0,[20,0,38,false,null,[[0,1]]]]]],[13,202,null,808144420352177,false,[[0,[20,0,38,false,null,[[0,2]]]]]]]],[0,null,false,null,521219448179391,[[0,30,null,2,false,false,false,102188759602544,false,[[1,[2,"Spawn_eggBroke_Particles"]]]]],[[-1,61,null,536314573178156,false,[[4,16],[5,[2,"track"]],[0,[20,0,38,false,null,[[0,0]]]],[0,[20,0,38,false,null,[[0,1]]]]]],[-1,61,null,511319481881834,false,[[4,15],[5,[2,"track"]],[0,[20,0,38,false,null,[[0,0]]]],[0,[20,0,38,false,null,[[0,1]]]]]]]]]],[0,[true,"CM - Debug"],false,null,532869089379210,[[-1,23,null,0,false,false,false,532869089379210,false,[[1,[2,"CM - Debug"]]]]],[],[[0,null,false,null,731705297430147,[[-1,27,null,0,false,false,false,632442906921375,false,[[11,"DEBUG_MODE"],[8,0],[7,[0,1]]]]],[],[[0,null,false,null,908936022136507,[[2,179,null,0,false,false,false,840539777495620,false,[[9,87]]]],[[71,177,"Chipmunk",996884518446052,false,[[3,1],[0,[5,[20,71,84,false,null],[0,90]]],[0,[0,5000]],[3,0],[0,[0,0]],[0,[0,0]]]]]],[0,null,false,null,970184471956160,[[2,179,null,0,false,false,false,995984760369105,false,[[9,68]]]],[]],[0,null,false,null,771306427884288,[[2,179,null,0,false,false,false,479811862426580,false,[[9,65]]]],[]],[0,null,false,null,300903218618116,[[1,203,null,1,false,false,false,347790999569933,false]],[]]]]]]]],["LoaderSheet",[[1,"isLoadingDone",0,0,false,false,245730859107426,false],[0,null,false,null,741230669645374,[[-1,24,null,1,false,false,false,881455104235510,false]],[[-1,61,null,990654254213783,false,[[4,62],[5,[2,"loading"]],[0,[4,[20,62,204,false,null],[0,1]]],[0,[4,[20,62,205,false,null],[0,2]]]]],[62,148,null,723382831494446,false,[[0,[19,149,[[0,33],[0,33],[0,33]]]]]],[62,206,null,871314674998289,false]]],[0,null,false,null,763754342733272,[[-1,200,null,0,false,false,false,879181695806678,false]],[[62,45,null,719311374598865,false,[[7,[10,[10,[2,"Loading ...\n"],[19,36,[[6,[19,207],[0,100]]]]],[2,"%"]]]]],[64,162,null,230651187162291,false,[[0,[6,[19,207],[0,349]]]]]],[[0,null,false,null,261788483134638,[[-1,33,null,0,false,false,false,187442190453135,false,[[7,[19,207]],[8,5],[7,[0,1]]]]],[],[[0,null,false,null,344996203231690,[[-1,27,null,0,false,false,false,165487539971418,false,[[11,"isLoadingDone"],[8,0],[7,[0,0]]]]],[[-1,29,null,310832857710816,false,[[11,"isLoadingDone"],[7,[0,1]]]],[-1,208,null,197929956291263,false,[[6,"gamelayout"]]]]]]]]]]],["PlatformManager",[[0,[true,"Platform - On Start of Layout"],false,null,156360003225077,[[-1,23,null,0,false,false,false,156360003225077,false,[[1,[2,"Platform - On Start of Layout"]]]]],[],[[0,null,false,null,474380893104234,[[-1,24,null,1,false,false,false,213627584855017,false]],[[0,26,null,767890830346283,false,[[1,[2,"Destroy_Challenge"]],[13]]]],[[0,null,false,null,567626759286755,[[-1,27,null,0,false,false,false,462566639263337,false,[[11,"platform"],[8,0],[7,[23,"PLATFORM_FACEBOOK"]]]]],[],[[0,null,false,null,452892570018005,[[-1,27,null,0,false,false,false,320392119218892,false,[[11,"FB_OFFLINE"],[8,0],[7,[0,1]]]]],[[0,26,null,411066805755361,false,[[1,[2,"onC2_LoggedIn"]],[13,[7,[2,"8"]],[7,[2,"Waqas Siddique"]],[7,[0,125]]]]],[0,26,null,882235256140336,false,[[1,[2,"onC2_EntryPointData"]],[13,[7,[0,1]],[7,[2,"Jeff"]],[7,[2,""]],[7,[2,"1000"]]]]],[0,26,null,560593206691877,false,[[1,[2,"onC2_LBUpdate"]],[13,[7,[0,8]],[7,[2,"1*rana*https://www.gstatic.com/webp/gallery3/1.sm.png*10000|2*momo*https://www.gstatic.com/webp/gallery3/1.sm.png*8000|3*hah*https://www.gstatic.com/webp/gallery3/1.sm.png*7000|4*abc*https://www.gstatic.com/webp/gallery3/1.sm.png*6000|5*xyz*https://www.gstatic.com/webp/gallery3/1.sm.png*3000|6*xyzzzz*https://www.gstatic.com/webp/gallery3/1.sm.png*2000|7*blah blas*https://www.gstatic.com/webp/gallery3/1.sm.png*1000|8*waqas*https://www.gstatic.com/webp/gallery3/1.sm.png*0"]]]]]]],[0,null,false,null,997404085125786,[[-1,37,null,0,false,false,false,897989818176705,false]],[[9,111,null,241403032354818,false,[[1,[2,"onFB_init();"]]]]]]]]]]]],[0,[true,"Platforms"],false,null,808927714356792,[[-1,23,null,0,false,false,false,808927714356792,false,[[1,[2,"Platforms"]]]]],[]],[1,"PLATFORM_WEB",0,0,false,false,584982582954678,false],[1,"PLATFORM_GD",0,1,false,false,536760030772674,false],[1,"PLATFORM_FACEBOOK",0,2,false,false,660654964659168,false],[0,[true,"Platform Params"],false,null,742209607388126,[[-1,23,null,0,false,false,false,742209607388126,false,[[1,[2,"Platform Params"]]]]],[]],[1,"platform",0,1,false,false,972762467653787,false],[0,[true,"AD Params"],false,null,509943102587010,[[-1,23,null,0,false,false,false,509943102587010,false,[[1,[2,"AD Params"]]]]],[]],[1,"adBlockerEnabled",0,0,false,false,472429460863011,false],[1,"adRequested",0,0,false,false,107761010457578,false],[1,"adDisplayPending",0,0,false,false,447747872214209,false],[0,[true,"GD Params"],false,null,741039806731856,[[-1,23,null,0,false,false,false,741039806731856,false,[[1,[2,"GD Params"]]]]],[]],[1,"GD_SDK_READY",0,0,false,false,839966493257383,false],[0,[true,"GD"],false,null,924872371197346,[[-1,23,null,0,false,false,false,924872371197346,false,[[1,[2,"GD"]]]]],[],[[0,null,false,null,853256768227505,[[51,209,null,1,false,false,false,494017680376801,false]],[[9,69,null,832800520795962,false,[[3,0],[7,[2,"SDK Ready"]]]],[-1,29,null,721707291908459,false,[[11,"GD_SDK_READY"],[7,[0,1]]]]],[[0,null,false,null,323406093660374,[[-1,27,null,0,false,false,false,878476708946759,false,[[11,"adRequested"],[8,0],[7,[0,1]]]]],[[51,210,null,470374674756218,false,[[1,[2,"ec_dca"]]]]]]]],[0,null,false,null,937941578238046,[[51,211,null,1,false,false,false,624785026483748,false]],[[9,69,null,491891133250554,false,[[3,0],[7,[2,"SDK Error"]]]],[-1,29,null,529833345845637,false,[[11,"GD_SDK_READY"],[7,[0,1]]]],[-1,29,null,665386616140935,false,[[11,"adBlockerEnabled"],[7,[0,1]]]]]],[0,null,false,null,129572420520628,[[51,212,null,1,false,false,false,768272715623950,false]],[],[[0,null,false,null,588855827380751,[[-1,27,null,0,false,false,false,245906143084048,false,[[11,"adRequested"],[8,0],[7,[0,1]]]]],[[0,26,null,678993973599283,false,[[1,[2,"On_Ad_Served"]],[13]]]]]]]]],[0,[true,"AD Functions"],false,null,526452600911650,[[-1,23,null,0,false,false,false,526452600911650,false,[[1,[2,"AD Functions"]]]]],[],[[0,null,false,null,373351312880615,[[0,30,null,2,false,false,false,712671251811496,false,[[1,[2,"On_AdSDK_Ready"]]]]],[],[[0,null,false,null,752819969743691,[[-1,27,null,0,false,false,false,957786445376749,false,[[11,"adRequested"],[8,0],[7,[0,1]]]]],[],[[0,null,false,null,716744560589269,[[-1,27,null,0,false,false,false,196723185657572,false,[[11,"platform"],[8,0],[7,[23,"PLATFORM_GD"]]]]],[[51,210,null,171593038179593,false,[[1,[2,"ec_dca"]]]]]]]]]],[0,null,false,null,568949664675177,[[0,30,null,2,false,false,false,855682422449276,false,[[1,[2,"Show_Ads"]]]]],[[9,69,null,314537798530956,false,[[3,0],[7,[2," Called"]]]],[-1,29,null,648084689246465,false,[[11,"saveGS"],[7,[23,"gameSequence"]]]],[-1,29,null,812334567875149,false,[[11,"gameSequence"],[7,[23,"SEQ_BETWEEN"]]]],[-1,141,null,847787017609030,false,[[5,[2,"overlay"]],[3,1]]],[-1,213,null,638210026416189,false,[[0,[0,0]]]],[50,214,null,642396433506373,false,[[3,0]]]],[[0,null,false,null,736664496942077,[[-1,27,null,0,false,false,false,513773731605984,false,[[11,"adRequested"],[8,1],[7,[0,1]]]]],[[-1,29,null,887638770222832,false,[[11,"adRequested"],[7,[0,1]]]]],[[0,null,false,null,824287184456294,[[-1,27,null,0,false,false,false,233671345594998,false,[[11,"platform"],[8,0],[7,[23,"PLATFORM_GD"]]]]],[],[[0,null,false,null,127367976001939,[[-1,27,null,0,false,false,false,741961967494852,false,[[11,"GD_SDK_READY"],[8,0],[7,[0,1]]]]],[[51,210,null,847683472111353,false,[[1,[2,"ec_dca"]]]]]]]]]]]],[0,null,false,null,661286617130012,[[0,30,null,2,false,false,false,417966302353843,false,[[1,[2,"On_Ad_Served"]]]]],[[9,69,null,550978402033596,false,[[3,0],[7,[2," Served"]]]],[-1,29,null,116764285995859,false,[[11,"adRequested"],[7,[0,0]]]],[-1,141,null,920751441852935,false,[[5,[2,"overlay"]],[3,0]]],[-1,213,null,233966477613025,false,[[0,[0,1]]]],[50,214,null,212314134888131,false,[[3,1]]]],[[0,null,false,null,157026202057799,[[-1,27,null,0,false,false,false,355056435373219,false,[[11,"saveGS"],[8,0],[7,[23,"SEQ_TUTORIAL"]]]]],[[0,26,null,353362129203148,false,[[1,[2,"Destroy_Tutorial"]],[13]]],[0,26,null,466705273357739,false,[[1,[2,"Play_MM_Animation"]],[13,[7,[2,"backward"]]]]]]],[0,null,false,null,494133146944099,[[-1,27,null,0,false,false,false,245267502284250,false,[[11,"saveGS"],[8,0],[7,[23,"SEQ_MENU"]]]]],[[0,26,null,628430437643954,false,[[1,[2,"Play_MM_Animation"]],[13,[7,[2,"backward"]]]]]]],[0,null,false,null,105178916382459,[],[[-1,29,null,608688684833882,false,[[11,"gameSequence"],[7,[23,"SEQ_TUTORIAL"]]]]]]]]]],[0,[true,"Facebook"],false,null,143082246552620,[[-1,23,null,0,false,false,false,143082246552620,false,[[1,[2,"Facebook"]]]]],[]],[0,[true,"FB - Entrydata"],false,null,185137906843725,[[-1,23,null,0,false,false,false,185137906843725,false,[[1,[2,"FB - Entrydata"]]]]],[]],[1,"entryDataName",1,"",false,false,363478419645466,false],[1,"entryDataPIC",1,"",false,false,804029372255176,false],[1,"entryDataScore",0,0,false,false,170958417460896,false],[1,"isEntryPointHasData",0,0,false,false,221421603605127,false],[0,[true,"FB - Control Params"],false,null,756005174213814,[[-1,23,null,0,false,false,false,756005174213814,false,[[1,[2,"FB - Control Params"]]]]],[]],[1,"FB_OFFLINE",0,0,false,false,347750152655026,false],[0,[true,"FB - My Details"],false,null,132239187558498,[[-1,23,null,0,false,false,false,132239187558498,false,[[1,[2,"FB - My Details"]]]]],[]],[1,"fb_myName",1,"",false,false,999330706460999,false],[1,"fb_myBestScore",0,0,false,false,619609824294620,false],[1,"fb_myID",1,"",false,false,606938799711182,false],[0,[true,"FB - Profile"],false,null,788219312987640,[[-1,23,null,0,false,false,false,788219312987640,false,[[1,[2,"FB - Profile"]]]]],[],[[0,null,false,null,974715443928452,[[0,30,null,2,false,false,false,592706889565397,false,[[1,[2,"onC2_LoggedIn"]]]]],[[-1,29,null,610792987927045,false,[[11,"fb_myID"],[7,[20,0,38,false,null,[[0,0]]]]]],[-1,29,null,856499713792895,false,[[11,"fb_myName"],[7,[20,0,38,false,null,[[0,1]]]]]]]],[0,null,false,null,958589461295076,[[0,30,null,2,false,false,false,486241544667666,false,[[1,[2,"onC2_EntryPointData"]]]]],[],[[0,null,false,null,270178850156482,[[0,71,null,0,false,false,false,737807180870679,false,[[0,[0,0]],[8,0],[7,[0,1]]]]],[[-1,29,null,286892087219317,false,[[11,"isEntryPointHasData"],[7,[0,1]]]],[-1,29,null,506881591645044,false,[[11,"entryDataName"],[7,[20,0,38,false,null,[[0,1]]]]]],[-1,29,null,926179450753325,false,[[11,"entryDataPIC"],[7,[20,0,38,false,null,[[0,2]]]]]],[-1,29,null,338749830127238,false,[[11,"entryDataScore"],[7,[19,36,[[20,0,38,false,null,[[0,3]]]]]]]]]],[0,null,false,null,596943322075409,[[-1,37,null,0,false,false,false,827087791741052,false]],[[-1,29,null,600389300922992,false,[[11,"isEntryPointHasData"],[7,[0,0]]]]]]]]]],[0,[true,"FB - LB Params"],false,null,864757834614469,[[-1,23,null,0,false,false,false,864757834614469,false,[[1,[2,"FB - LB Params"]]]]],[]],[1,"isFB_LeaderboardReady",0,0,false,false,728729800558764,false],[1,"isFB_LeaderboardHasData",0,0,false,false,947491326607104,false],[1,"scoreToBeat",0,0,false,false,513145237577246,false],[1,"LBScoreToBeat",0,0,false,false,691367743313851,false],[1,"challengedCompleted",0,0,false,false,554168830711021,false],[0,[true,"FB - LB"],false,null,919506271733769,[[-1,23,null,0,false,false,false,919506271733769,false,[[1,[2,"FB - LB"]]]]],[],[[0,null,false,null,710460443937665,[[0,30,null,2,false,false,false,201453206134368,false,[[1,[2,"onC2_LBUpdate"]]]]],[[-1,29,null,849586352441084,false,[[11,"isFB_LeaderboardReady"],[7,[0,1]]]],[68,54,null,289102673928726,false,[[0,[20,0,38,false,null,[[0,0]]]],[0,[0,4]],[0,[0,1]]]]],[[0,null,false,null,334577471618882,[[0,71,null,0,false,false,false,695570863284040,false,[[0,[0,0]],[8,4],[7,[0,0]]]]],[[-1,29,null,462544183524432,false,[[11,"isFB_LeaderboardHasData"],[7,[0,1]]]]]],[0,null,false,null,250542566434541,[[-1,39,null,0,true,false,false,602194048157015,false,[[0,[20,0,38,false,null,[[0,0]]]]]]],[],[[1,"user_data",1,"",false,false,359892418375399,false],[0,null,false,null,451064246958518,[],[[-1,29,null,781850631099993,false,[[11,"user_data"],[7,[19,42,[[20,0,38,false,null,[[0,1]]],[19,41],[2,"|"]]]]]]]],[0,null,false,null,927384951225712,[],[[68,172,null,688541891230025,false,[[0,[19,41]],[0,[0,0]],[7,[19,42,[[23,"user_data"],[0,0],[2,"*"]]]]]],[68,172,null,369037604200359,false,[[0,[19,41]],[0,[0,1]],[7,[19,42,[[23,"user_data"],[0,1],[2,"*"]]]]]],[68,172,null,217199530033381,false,[[0,[19,41]],[0,[0,2]],[7,[19,42,[[23,"user_data"],[0,2],[2,"*"]]]]]],[68,172,null,271615915320631,false,[[0,[19,41]],[0,[0,3]],[7,[19,36,[[19,42,[[23,"user_data"],[0,3],[2,"*"]]]]]]]]]]]]]]]],[0,[true,"Fb - Challenge"],false,null,372138832013677,[[-1,23,null,0,false,false,false,372138832013677,false,[[1,[2,"Fb - Challenge"]]]]],[],[[0,null,false,null,683671035051354,[[0,30,null,2,false,false,false,482894042381149,false,[[1,[2,"Init_Challenge"]]]]],[[-1,29,null,777530986408633,false,[[11,"scoreToBeat"],[7,[0,-1]]]],[-1,29,null,875052754578010,false,[[11,"LBScoreToBeat"],[7,[0,-1]]]]],[[1,"challengeFound",0,0,false,false,338757653590092,false],[0,null,false,null,498547436737950,[[-1,27,null,0,false,false,false,372478774952117,false,[[11,"isEntryPointHasData"],[8,0],[7,[0,1]]]]],[],[[0,null,false,null,485871865896937,[[-1,27,null,0,false,true,false,388216430086370,false,[[11,"challengedCompleted"],[8,0],[7,[0,1]]]]],[[-1,29,null,348293425080253,false,[[11,"scoreToBeat"],[7,[23,"entryDataScore"]]]]],[[0,null,false,null,650860076778831,[[-1,27,null,0,false,false,false,405499989368461,false,[[11,"scoreToBeat"],[8,2],[7,[20,0,38,false,null,[[0,0]]]]]]],[[0,26,null,314120864792777,false,[[1,[2,"Spawn_Challenge"]],[13,[7,[19,215,[[23,"entryDataName"]]]],[7,[23,"entryDataPIC"]],[7,[23,"scoreToBeat"]]]]]]],[0,null,false,null,879210595536559,[[-1,37,null,0,false,false,false,269994843520237,false]],[[0,26,null,501048180881851,false,[[1,[2,"on_Challenge_Completed"]],[13]]]]]]]]],[0,null,false,null,163363111788291,[[-1,27,null,0,false,false,false,822123163963419,false,[[11,"isFB_LeaderboardHasData"],[8,0],[7,[0,1]]]],[-1,27,null,0,false,true,false,783734770286463,false,[[11,"isEntryPointHasData"],[8,0],[7,[0,1]]]]],[],[[0,null,false,null,107016453714644,[[-1,56,null,0,true,false,false,529966794581529,false,[[1,[2,"i"]],[0,[5,[20,68,58,false,null],[0,1]]],[0,[0,0]]]]],[],[[0,null,false,null,236580208574068,[[-1,27,null,0,false,false,false,176851151391484,false,[[11,"challengeFound"],[8,0],[7,[0,0]]]]],[],[[0,null,false,null,766890080443099,[[68,216,null,0,false,false,false,889414242755242,false,[[0,[19,41,[[2,"i"]]]],[0,[0,0]],[8,1],[7,[23,"fb_myID"]]]]],[[9,69,null,715532240486215,false,[[3,0],[7,[10,[20,0,38,false,null,[[0,0]]],[2,"<>"]]]]]],[[0,null,false,null,656272591728837,[[68,216,null,0,false,false,false,652414729533763,false,[[0,[19,41,[[2,"i"]]]],[0,[0,3]],[8,1],[7,[0,0]]]],[68,216,null,0,false,false,false,668142011701914,false,[[0,[19,41,[[2,"i"]]]],[0,[0,3]],[8,5],[7,[20,0,38,false,null,[[0,0]]]]]]],[[-1,29,null,341088825918806,false,[[11,"LBScoreToBeat"],[7,[20,68,43,false,null,[[19,41,[[2,"i"]]],[0,3]]]]]],[-1,29,null,965866471149910,false,[[11,"challengeFound"],[7,[0,1]]]]],[[0,null,false,null,381984776851646,[[-1,27,null,0,false,true,false,511365308227658,false,[[11,"isEntryPointHasData"],[8,0],[7,[0,1]]]]],[[0,26,null,834408503038413,false,[[1,[2,"Spawn_Challenge"]],[13,[7,[19,215,[[20,68,43,false,null,[[19,41,[[2,"i"]]],[0,1]]]]]],[7,[20,68,43,false,null,[[19,41,[[2,"i"]]],[0,2]]]],[7,[23,"LBScoreToBeat"]]]]]]]]]]]]]]]]],[0,null,false,null,320326822899780,[[-1,27,null,0,false,true,false,870094089619323,false,[[11,"isEntryPointHasData"],[8,0],[7,[0,1]]]]],[],[[0,null,false,null,445330653684294,[[-1,27,null,0,false,false,false,480978389277989,false,[[11,"isFB_LeaderboardHasData"],[8,0],[7,[0,1]]]]],[],[[0,null,false,null,188766581925327,[[-1,27,null,0,false,false,false,668465334503235,false,[[11,"LBScoreToBeat"],[8,0],[7,[0,-1]]]]],[[0,26,null,849368859012609,false,[[1,[2,"Destroy_Challenge"]],[13]]]]]]],[0,null,false,null,484920631826345,[[-1,37,null,0,false,false,false,154736514765494,false]],[[0,26,null,555572531899962,false,[[1,[2,"Destroy_Challenge"]],[13]]]]]]]]],[0,null,false,null,620107877497427,[[0,30,null,2,false,false,false,802193536441890,false,[[1,[2,"On_Challenge_Completed"]]]]],[[-1,29,null,212897286911212,false,[[11,"scoreToBeat"],[7,[0,-1]]]],[0,26,null,806527597998655,false,[[1,[2,"Destroy_Challenge"]],[13]]],[-1,29,null,595789157263511,false,[[11,"challengedCompleted"],[7,[0,1]]]],[9,111,null,105612728322996,false,[[1,[2,"onFB_challengeCompleted()"]]]]],[[0,null,false,null,603328626468625,[],[[-1,29,null,267277529204614,false,[[11,"isEntryPointHasData"],[7,[0,0]]]],[0,26,null,509452725053776,false,[[1,[2,"Init_Challenge"]],[13]]]]]]],[0,null,false,null,742189040940250,[[0,30,null,2,false,false,false,494689131111426,false,[[1,[2,"Destroy_Challenge"]]]]],[[69,25,null,576493882076930,false],[70,113,null,618192604403487,false]]],[0,null,false,null,974934389526549,[[0,30,null,2,false,false,false,587014412050847,false,[[1,[2,"Spawn_Challenge"]]]]],[[0,26,null,143063697531693,false,[[1,[2,"Destroy_Challenge"]],[13]]],[-1,61,null,950791516734200,false,[[4,69],[5,[2,"hud"]],[0,[5,[4,[23,"CANVAS_WIDTH"],[6,[23,"canvasDeltaWidth"],[1,0.5]]],[0,50]]],[0,[4,[6,[3,[23,"canvasDeltaHeight"]],[1,0.5]],[0,110]]]]],[69,121,null,575971299349074,false,[[0,[0,80]],[0,[0,80]]]],[69,142,null,204622008532997,false,[[3,0]]],[70,148,null,302101926001754,false,[[0,[19,149,[[0,33],[0,33],[0,33]]]]]],[-1,61,null,853917562778148,false,[[4,70],[5,[2,"hud"]],[0,[4,[20,69,93,false,null],[6,[20,69,73,false,null],[1,0.5]]]],[0,[4,[4,[20,69,86,false,null],[6,[20,69,74,false,null],[1,0.5]]],[0,8]]]]],[70,45,null,575926102359073,false,[[7,[10,[19,36,[[6,[20,0,38,false,null,[[0,2]]],[23,"SCORE_PER_PIXEL"]]]],[2,"m"]]]]],[70,118,null,899197501670944,false,[[10,0],[7,[2,"hud"]]]],[0,26,null,614133460291183,false,[[1,[2,"Spawn_Challenge_Mark"]],[13,[7,[4,[23,"startX"],[20,0,38,false,null,[[0,2]]]]],[7,[19,36,[[6,[20,0,38,false,null,[[0,2]]],[23,"SCORE_PER_PIXEL"]]]]]]]],[9,69,null,663726873652663,false,[[3,0],[7,[10,[20,0,38,false,null,[[0,2]]],[2,"m"]]]]]],[[0,null,false,null,672788848807165,[[-1,217,null,0,false,false,false,101964796676462,false]],[[69,218,null,218614792653650,false,[[1,[2,"icon-128.png"]],[3,1],[3,0]]]]],[0,null,false,null,955770208692046,[[-1,37,null,0,false,false,false,616917023768171,false]],[[69,218,null,790551790179122,false,[[1,[20,0,38,false,null,[[0,1]]]],[3,1],[3,0]]]]]]],[0,null,false,null,980868308410527,[[69,219,null,1,false,false,false,888936081655110,false]],[[69,121,null,301160330529143,false,[[0,[0,80]],[0,[0,80]]]],[69,142,null,489821532453476,false,[[3,1]]]]],[0,null,false,null,339864782678544,[[0,30,null,2,false,false,false,789758125968363,false,[[1,[2,"on_LBScoreToBeat_Update"]]]]],[],[[0,null,false,null,587928026438244,[[0,71,null,0,false,false,false,879960709378070,false,[[0,[0,0]],[8,3],[7,[23,"LBScoreToBeat"]]]]],[],[[0,null,false,null,816401022621021,[[70,120,null,0,false,false,false,291640666500397,false,[[10,0],[8,0],[7,[2,"hud"]]]]],[[70,45,null,605799317076702,false,[[7,[10,[19,147,[[6,[5,[23,"LBScoreToBeat"],[20,0,38,false,null,[[0,0]]]],[23,"SCORE_PER_PIXEL"]]]],[2,"m"]]]]]]]]],[0,null,false,null,411038596748081,[[-1,37,null,0,false,false,false,331478793998667,false]],[[0,26,null,521705885410539,false,[[1,[2,"On_ChallengeLine_Crossed"]],[13]]],[0,26,null,902033387958948,false,[[1,[2,"Init_Challenge"]],[13,[7,[20,0,38,false,null,[[0,0]]]]]]]]]]],[0,null,false,null,680777258347889,[[0,30,null,2,false,false,false,974830951439242,false,[[1,[2,"on_ScoreToBeat_Update"]]]]],[],[[0,null,false,null,697059591273497,[[0,71,null,0,false,false,false,987735098943984,false,[[0,[0,0]],[8,3],[7,[23,"scoreToBeat"]]]]],[],[[0,null,false,null,245295769455912,[[70,120,null,0,false,false,false,360493842931273,false,[[10,0],[8,0],[7,[2,"hud"]]]]],[[70,45,null,263082875424393,false,[[7,[10,[19,147,[[6,[5,[23,"scoreToBeat"],[20,0,38,false,null,[[0,0]]]],[23,"SCORE_PER_PIXEL"]]]],[2,"m"]]]]]]]]],[0,null,false,null,292054072858106,[[-1,37,null,0,false,false,false,522210100474863,false]],[[0,26,null,741443151343824,false,[[1,[2,"On_ChallengeLine_Crossed"]],[13]]],[0,26,null,310590308327892,false,[[1,[2,"On_Challenge_Completed"]],[13]]]]]]]]]]]],[["chat_msg.m4a",9070],["chat_msg.ogg",8952],["coin_add.m4a",2284],["coin_add.ogg",6074],["coin_hit.m4a",2818],["coin_hit.ogg",6192],["not_ready.m4a",15164],["not_ready.ogg",15384],["egg_broken.m4a",13166],["egg_broken.ogg",14652],["click_0.m4a",1723],["click_0.ogg",5031],["egg_hit_0.m4a",4575],["egg_hit_0.ogg",7215],["egg_hit_1.m4a",3972],["egg_hit_1.ogg",6730],["egg_hit_2.m4a",4686],["egg_hit_2.ogg",7300],["egg_hit_3.m4a",3871],["egg_hit_3.ogg",6907],["ice.m4a",24961],["ice.ogg",34608],["coin.m4a",8622],["coin.ogg",10150],["unlock.m4a",42092],["unlock.ogg",36815],["bg-music.m4a",2275437],["bg-music.ogg",1787218],["game_over.m4a",25652],["game_over.ogg",26302],["challenge_won.m4a",11327],["challenge_won.ogg",12738]],"media/",false,1280,720,2,true,true,true,"1.0.0.0",true,true,1,0,85,false,true,1,true,"Eggy Car",0,[[27,33]]]} \ No newline at end of file diff --git a/games/eggy-car/icon-256.png b/games/eggy-car/icon-256.png new file mode 100644 index 00000000..106d5dff Binary files /dev/null and b/games/eggy-car/icon-256.png differ diff --git a/games/eggy-car/images/a_coin-sheet0.png b/games/eggy-car/images/a_coin-sheet0.png new file mode 100644 index 00000000..e44b8b72 Binary files /dev/null and b/games/eggy-car/images/a_coin-sheet0.png differ diff --git a/games/eggy-car/images/a_dial-sheet0.png b/games/eggy-car/images/a_dial-sheet0.png new file mode 100644 index 00000000..bae83e13 Binary files /dev/null and b/games/eggy-car/images/a_dial-sheet0.png differ diff --git a/games/eggy-car/images/a_dial-sheet1.png b/games/eggy-car/images/a_dial-sheet1.png new file mode 100644 index 00000000..6cc8d3c5 Binary files /dev/null and b/games/eggy-car/images/a_dial-sheet1.png differ diff --git a/games/eggy-car/images/a_dial_needle-sheet0.png b/games/eggy-car/images/a_dial_needle-sheet0.png new file mode 100644 index 00000000..e48952e3 Binary files /dev/null and b/games/eggy-car/images/a_dial_needle-sheet0.png differ diff --git a/games/eggy-car/images/a_egg-sheet0.png b/games/eggy-car/images/a_egg-sheet0.png new file mode 100644 index 00000000..ef3b8a7b Binary files /dev/null and b/games/eggy-car/images/a_egg-sheet0.png differ diff --git a/games/eggy-car/images/a_egg_crack-sheet0.png b/games/eggy-car/images/a_egg_crack-sheet0.png new file mode 100644 index 00000000..0b5874d5 Binary files /dev/null and b/games/eggy-car/images/a_egg_crack-sheet0.png differ diff --git a/games/eggy-car/images/a_egg_crack-sheet1.png b/games/eggy-car/images/a_egg_crack-sheet1.png new file mode 100644 index 00000000..1c18c9a1 Binary files /dev/null and b/games/eggy-car/images/a_egg_crack-sheet1.png differ diff --git a/games/eggy-car/images/a_egg_outline-sheet0.png b/games/eggy-car/images/a_egg_outline-sheet0.png new file mode 100644 index 00000000..38e61f5c Binary files /dev/null and b/games/eggy-car/images/a_egg_outline-sheet0.png differ diff --git a/games/eggy-car/images/a_focus-sheet0.png b/games/eggy-car/images/a_focus-sheet0.png new file mode 100644 index 00000000..6c6ff611 Binary files /dev/null and b/games/eggy-car/images/a_focus-sheet0.png differ diff --git a/games/eggy-car/images/a_loading_bar.png b/games/eggy-car/images/a_loading_bar.png new file mode 100644 index 00000000..4b317a9d Binary files /dev/null and b/games/eggy-car/images/a_loading_bar.png differ diff --git a/games/eggy-car/images/a_loading_frame-sheet0.png b/games/eggy-car/images/a_loading_frame-sheet0.png new file mode 100644 index 00000000..6e3a2075 Binary files /dev/null and b/games/eggy-car/images/a_loading_frame-sheet0.png differ diff --git a/games/eggy-car/images/a_logo-sheet0.png b/games/eggy-car/images/a_logo-sheet0.png new file mode 100644 index 00000000..9bc08b45 Binary files /dev/null and b/games/eggy-car/images/a_logo-sheet0.png differ diff --git a/games/eggy-car/images/a_logo_tyre-sheet0.png b/games/eggy-car/images/a_logo_tyre-sheet0.png new file mode 100644 index 00000000..215865d2 Binary files /dev/null and b/games/eggy-car/images/a_logo_tyre-sheet0.png differ diff --git a/games/eggy-car/images/a_power_up-sheet0.png b/games/eggy-car/images/a_power_up-sheet0.png new file mode 100644 index 00000000..2945dfcf Binary files /dev/null and b/games/eggy-car/images/a_power_up-sheet0.png differ diff --git a/games/eggy-car/images/a_power_up-sheet1.png b/games/eggy-car/images/a_power_up-sheet1.png new file mode 100644 index 00000000..59e52036 Binary files /dev/null and b/games/eggy-car/images/a_power_up-sheet1.png differ diff --git a/games/eggy-car/images/a_track-sheet0.png b/games/eggy-car/images/a_track-sheet0.png new file mode 100644 index 00000000..0266af65 Binary files /dev/null and b/games/eggy-car/images/a_track-sheet0.png differ diff --git a/games/eggy-car/images/a_track-sheet1.png b/games/eggy-car/images/a_track-sheet1.png new file mode 100644 index 00000000..bf4484b1 Binary files /dev/null and b/games/eggy-car/images/a_track-sheet1.png differ diff --git a/games/eggy-car/images/a_track-sheet2.png b/games/eggy-car/images/a_track-sheet2.png new file mode 100644 index 00000000..ae472942 Binary files /dev/null and b/games/eggy-car/images/a_track-sheet2.png differ diff --git a/games/eggy-car/images/a_track-sheet3.png b/games/eggy-car/images/a_track-sheet3.png new file mode 100644 index 00000000..356829f1 Binary files /dev/null and b/games/eggy-car/images/a_track-sheet3.png differ diff --git a/games/eggy-car/images/a_track-sheet4.png b/games/eggy-car/images/a_track-sheet4.png new file mode 100644 index 00000000..19d60079 Binary files /dev/null and b/games/eggy-car/images/a_track-sheet4.png differ diff --git a/games/eggy-car/images/a_track-sheet5.png b/games/eggy-car/images/a_track-sheet5.png new file mode 100644 index 00000000..ae9e5642 Binary files /dev/null and b/games/eggy-car/images/a_track-sheet5.png differ diff --git a/games/eggy-car/images/bg_parrallax_back-sheet0.png b/games/eggy-car/images/bg_parrallax_back-sheet0.png new file mode 100644 index 00000000..e13a2194 Binary files /dev/null and b/games/eggy-car/images/bg_parrallax_back-sheet0.png differ diff --git a/games/eggy-car/images/bg_parrallax_front-sheet0.png b/games/eggy-car/images/bg_parrallax_front-sheet0.png new file mode 100644 index 00000000..97f042cb Binary files /dev/null and b/games/eggy-car/images/bg_parrallax_front-sheet0.png differ diff --git a/games/eggy-car/images/blockage-sheet0.png b/games/eggy-car/images/blockage-sheet0.png new file mode 100644 index 00000000..49eb8ea1 Binary files /dev/null and b/games/eggy-car/images/blockage-sheet0.png differ diff --git a/games/eggy-car/images/btn_car_selection-sheet0.png b/games/eggy-car/images/btn_car_selection-sheet0.png new file mode 100644 index 00000000..e3d0ac5f Binary files /dev/null and b/games/eggy-car/images/btn_car_selection-sheet0.png differ diff --git a/games/eggy-car/images/btn_challenge-sheet0.png b/games/eggy-car/images/btn_challenge-sheet0.png new file mode 100644 index 00000000..1292170c Binary files /dev/null and b/games/eggy-car/images/btn_challenge-sheet0.png differ diff --git a/games/eggy-car/images/btn_close-sheet0.png b/games/eggy-car/images/btn_close-sheet0.png new file mode 100644 index 00000000..ef531bb2 Binary files /dev/null and b/games/eggy-car/images/btn_close-sheet0.png differ diff --git a/games/eggy-car/images/btn_continue-sheet0.png b/games/eggy-car/images/btn_continue-sheet0.png new file mode 100644 index 00000000..5ecab4fa Binary files /dev/null and b/games/eggy-car/images/btn_continue-sheet0.png differ diff --git a/games/eggy-car/images/btn_invite-sheet0.png b/games/eggy-car/images/btn_invite-sheet0.png new file mode 100644 index 00000000..95c435c7 Binary files /dev/null and b/games/eggy-car/images/btn_invite-sheet0.png differ diff --git a/games/eggy-car/images/btn_leaderboard-sheet0.png b/games/eggy-car/images/btn_leaderboard-sheet0.png new file mode 100644 index 00000000..1599cfdf Binary files /dev/null and b/games/eggy-car/images/btn_leaderboard-sheet0.png differ diff --git a/games/eggy-car/images/btn_music-sheet0.png b/games/eggy-car/images/btn_music-sheet0.png new file mode 100644 index 00000000..4ae6b7a6 Binary files /dev/null and b/games/eggy-car/images/btn_music-sheet0.png differ diff --git a/games/eggy-car/images/btn_play-sheet0.png b/games/eggy-car/images/btn_play-sheet0.png new file mode 100644 index 00000000..cb8042a4 Binary files /dev/null and b/games/eggy-car/images/btn_play-sheet0.png differ diff --git a/games/eggy-car/images/btn_sound-sheet0.png b/games/eggy-car/images/btn_sound-sheet0.png new file mode 100644 index 00000000..b6d7757d Binary files /dev/null and b/games/eggy-car/images/btn_sound-sheet0.png differ diff --git a/games/eggy-car/images/car_0-sheet0.png b/games/eggy-car/images/car_0-sheet0.png new file mode 100644 index 00000000..2ec6cf45 Binary files /dev/null and b/games/eggy-car/images/car_0-sheet0.png differ diff --git a/games/eggy-car/images/car_0_tyre-sheet0.png b/games/eggy-car/images/car_0_tyre-sheet0.png new file mode 100644 index 00000000..63955b56 Binary files /dev/null and b/games/eggy-car/images/car_0_tyre-sheet0.png differ diff --git a/games/eggy-car/images/car_0_tyre-sheet1.png b/games/eggy-car/images/car_0_tyre-sheet1.png new file mode 100644 index 00000000..1bab5735 Binary files /dev/null and b/games/eggy-car/images/car_0_tyre-sheet1.png differ diff --git a/games/eggy-car/images/car_sel_button-sheet0.png b/games/eggy-car/images/car_sel_button-sheet0.png new file mode 100644 index 00000000..5198451c Binary files /dev/null and b/games/eggy-car/images/car_sel_button-sheet0.png differ diff --git a/games/eggy-car/images/car_sel_button-sheet1.png b/games/eggy-car/images/car_sel_button-sheet1.png new file mode 100644 index 00000000..902c7414 Binary files /dev/null and b/games/eggy-car/images/car_sel_button-sheet1.png differ diff --git a/games/eggy-car/images/car_sel_card-sheet0.png b/games/eggy-car/images/car_sel_card-sheet0.png new file mode 100644 index 00000000..d4d5f3b3 Binary files /dev/null and b/games/eggy-car/images/car_sel_card-sheet0.png differ diff --git a/games/eggy-car/images/car_sel_card-sheet1.png b/games/eggy-car/images/car_sel_card-sheet1.png new file mode 100644 index 00000000..556e2efb Binary files /dev/null and b/games/eggy-car/images/car_sel_card-sheet1.png differ diff --git a/games/eggy-car/images/car_sel_card-sheet2.png b/games/eggy-car/images/car_sel_card-sheet2.png new file mode 100644 index 00000000..dd7c7995 Binary files /dev/null and b/games/eggy-car/images/car_sel_card-sheet2.png differ diff --git a/games/eggy-car/images/car_sel_frame-sheet0.png b/games/eggy-car/images/car_sel_frame-sheet0.png new file mode 100644 index 00000000..0adec8c3 Binary files /dev/null and b/games/eggy-car/images/car_sel_frame-sheet0.png differ diff --git a/games/eggy-car/images/challenge_pic-sheet0.png b/games/eggy-car/images/challenge_pic-sheet0.png new file mode 100644 index 00000000..7d52977d Binary files /dev/null and b/games/eggy-car/images/challenge_pic-sheet0.png differ diff --git a/games/eggy-car/images/dotted_line.png b/games/eggy-car/images/dotted_line.png new file mode 100644 index 00000000..7672a523 Binary files /dev/null and b/games/eggy-car/images/dotted_line.png differ diff --git a/games/eggy-car/images/egg_freeze_vfx-sheet0.png b/games/eggy-car/images/egg_freeze_vfx-sheet0.png new file mode 100644 index 00000000..65eaf126 Binary files /dev/null and b/games/eggy-car/images/egg_freeze_vfx-sheet0.png differ diff --git a/games/eggy-car/images/ground_detector-sheet0.png b/games/eggy-car/images/ground_detector-sheet0.png new file mode 100644 index 00000000..3550bce7 Binary files /dev/null and b/games/eggy-car/images/ground_detector-sheet0.png differ diff --git a/games/eggy-car/images/hud_paddle-sheet0.png b/games/eggy-car/images/hud_paddle-sheet0.png new file mode 100644 index 00000000..c16827a5 Binary files /dev/null and b/games/eggy-car/images/hud_paddle-sheet0.png differ diff --git a/games/eggy-car/images/hud_paddle-sheet1.png b/games/eggy-car/images/hud_paddle-sheet1.png new file mode 100644 index 00000000..46ded729 Binary files /dev/null and b/games/eggy-car/images/hud_paddle-sheet1.png differ diff --git a/games/eggy-car/images/icon_coin-sheet0.png b/games/eggy-car/images/icon_coin-sheet0.png new file mode 100644 index 00000000..1351001f Binary files /dev/null and b/games/eggy-car/images/icon_coin-sheet0.png differ diff --git a/games/eggy-car/images/icon_trophy-sheet0.png b/games/eggy-car/images/icon_trophy-sheet0.png new file mode 100644 index 00000000..eb1926b9 Binary files /dev/null and b/games/eggy-car/images/icon_trophy-sheet0.png differ diff --git a/games/eggy-car/images/particles.png b/games/eggy-car/images/particles.png new file mode 100644 index 00000000..3596fd18 Binary files /dev/null and b/games/eggy-car/images/particles.png differ diff --git a/games/eggy-car/images/particles2.png b/games/eggy-car/images/particles2.png new file mode 100644 index 00000000..cb42c2cc Binary files /dev/null and b/games/eggy-car/images/particles2.png differ diff --git a/games/eggy-car/images/particles3.png b/games/eggy-car/images/particles3.png new file mode 100644 index 00000000..f096637d Binary files /dev/null and b/games/eggy-car/images/particles3.png differ diff --git a/games/eggy-car/images/particles4.png b/games/eggy-car/images/particles4.png new file mode 100644 index 00000000..f50e5767 Binary files /dev/null and b/games/eggy-car/images/particles4.png differ diff --git a/games/eggy-car/images/power_up_bar.png b/games/eggy-car/images/power_up_bar.png new file mode 100644 index 00000000..fa60c39b Binary files /dev/null and b/games/eggy-car/images/power_up_bar.png differ diff --git a/games/eggy-car/images/power_up_bar_frame-sheet0.png b/games/eggy-car/images/power_up_bar_frame-sheet0.png new file mode 100644 index 00000000..addaa4a9 Binary files /dev/null and b/games/eggy-car/images/power_up_bar_frame-sheet0.png differ diff --git a/games/eggy-car/images/shaft-sheet0.png b/games/eggy-car/images/shaft-sheet0.png new file mode 100644 index 00000000..f005be61 Binary files /dev/null and b/games/eggy-car/images/shaft-sheet0.png differ diff --git a/games/eggy-car/images/sprite2-sheet0.png b/games/eggy-car/images/sprite2-sheet0.png new file mode 100644 index 00000000..1a11ca4e Binary files /dev/null and b/games/eggy-car/images/sprite2-sheet0.png differ diff --git a/games/eggy-car/images/sprite2-sheet1.png b/games/eggy-car/images/sprite2-sheet1.png new file mode 100644 index 00000000..5eb8146f Binary files /dev/null and b/games/eggy-car/images/sprite2-sheet1.png differ diff --git a/games/eggy-car/images/sprite3-sheet0.png b/games/eggy-car/images/sprite3-sheet0.png new file mode 100644 index 00000000..9bbbba15 Binary files /dev/null and b/games/eggy-car/images/sprite3-sheet0.png differ diff --git a/games/eggy-car/images/spritefont.png b/games/eggy-car/images/spritefont.png new file mode 100644 index 00000000..2957f727 Binary files /dev/null and b/games/eggy-car/images/spritefont.png differ diff --git a/games/eggy-car/images/tuto-sheet0.png b/games/eggy-car/images/tuto-sheet0.png new file mode 100644 index 00000000..7ed604e7 Binary files /dev/null and b/games/eggy-car/images/tuto-sheet0.png differ diff --git a/games/eggy-car/index.html b/games/eggy-car/index.html new file mode 100644 index 00000000..2677c42a --- /dev/null +++ b/games/eggy-car/index.html @@ -0,0 +1,121 @@ + + + + + + + Eggy Car + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + +

Your browser does not appear to support HTML5. Try upgrading your browser to the latest version.

+
+ +
+ + + + + + + + + + + + + + diff --git a/games/eggy-car/jquery-2.1.1.min.js b/games/eggy-car/jquery-2.1.1.min.js new file mode 100644 index 00000000..9ed2acc6 --- /dev/null +++ b/games/eggy-car/jquery-2.1.1.min.js @@ -0,0 +1,4 @@ +/*! jQuery v2.1.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ +!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.1",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="
",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+Math.random()}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b) +},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthx",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*\s*$/g,ib={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$1>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(ob(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&mb(ob(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(ob(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ob(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(ob(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&eb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(ob(c,"script"),kb),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(hb,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qb,rb={};function sb(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function tb(a){var b=l,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||n("