Файловый менеджер - Редактировать - /home/jogoso94/public_html/jogos/mahjong_deluxe/js/main.js
�азад
/* Platform.js <https://mths.be/platform> Copyright 2014-2018 Benjamin Tan <https://bnjmnt4n.now.sh/> Copyright 2011-2013 John-David Dalton Available under MIT license <https://mths.be/mit> */ (function() { var a = "undefined" !== typeof window && "undefined" !== typeof window.document ? window.document : {}, d = "undefined" !== typeof module && module.exports, c = function() { for (var g, k = ["requestFullscreen exitFullscreen fullscreenElement fullscreenEnabled fullscreenchange fullscreenerror".split(" "), "webkitRequestFullscreen webkitExitFullscreen webkitFullscreenElement webkitFullscreenEnabled webkitfullscreenchange webkitfullscreenerror".split(" "), "webkitRequestFullScreen webkitCancelFullScreen webkitCurrentFullScreenElement webkitCancelFullScreen webkitfullscreenchange webkitfullscreenerror".split(" "), "mozRequestFullScreen mozCancelFullScreen mozFullScreenElement mozFullScreenEnabled mozfullscreenchange mozfullscreenerror".split(" "), "msRequestFullscreen msExitFullscreen msFullscreenElement msFullscreenEnabled MSFullscreenChange MSFullscreenError".split(" ") ], b = 0, l = k.length, p = {}; b < l; b++) if ((g = k[b]) && g[1] in a) { for (b = 0; b < g.length; b++) p[k[0][b]] = g[b]; return p } return !1 }(), f = { change: c.fullscreenchange, error: c.fullscreenerror }, q = { request: function(g) { return new Promise(function(k, b) { var l = function() { this.off("change", l); k() }.bind(this); this.on("change", l); g = g || a.documentElement; Promise.resolve(g[c.requestFullscreen]())["catch"](b) }.bind(this)) }, exit: function() { return new Promise(function(g, k) { if (this.isFullscreen) { var b = function() { this.off("change", b); g() }.bind(this); this.on("change", b); Promise.resolve(a[c.exitFullscreen]())["catch"](k) } else g() }.bind(this)) }, toggle: function(g) { return this.isFullscreen ? this.exit() : this.request(g) }, onchange: function(g) { this.on("change", g) }, onerror: function(g) { this.on("error", g) }, on: function(g, k) { var b = f[g]; b && a.addEventListener(b, k, !1) }, off: function(g, k) { var b = f[g]; b && a.removeEventListener(b, k, !1) }, raw: c }; c ? (Object.defineProperties(q, { isFullscreen: { get: function() { return !!a[c.fullscreenElement] } }, element: { enumerable: !0, get: function() { return a[c.fullscreenElement] } }, isEnabled: { enumerable: !0, get: function() { return !!a[c.fullscreenEnabled] } } }), d ? module.exports = q : window.screenfull = q) : d ? module.exports = { isEnabled: !1 } : window.screenfull = { isEnabled: !1 } })(); (function() { function a(e) { e = String(e); return e.charAt(0).toUpperCase() + e.slice(1) } function d(e, w) { var E = -1, u = e ? e.length : 0; if ("number" == typeof u && -1 < u && u <= y) for (; ++E < u;) w(e[E], E, e); else f(e, w) } function c(e) { e = String(e).replace(/^ +| +$/g, ""); return /^(?:webOS|i(?:OS|P))/.test(e) ? e : a(e) } function f(e, w) { for (var E in e) A.call(e, E) && w(e[E], E, e) } function q(e) { return null == e ? a(e) : I.call(e).slice(8, -1) } function g(e, w) { var E = null != e ? typeof e[w] : "number"; return !/^(?:boolean|number|string|undefined)$/.test(E) && ("object" == E ? !!e[w] : !0) } function k(e) { return String(e).replace(/([ -])(?!$)/g, "$1?") } function b(e, w) { var E = null; d(e, function(u, t) { E = w(E, u, t, e) }); return E } function l(e) { function w(S) { return b(S, function(Q, M) { var U = M.pattern || k(M); !Q && (Q = RegExp("\\b" + U + " *\\d+[.\\w_]*", "i").exec(e) || RegExp("\\b" + U + " *\\w+-[\\w]*", "i").exec(e) || RegExp("\\b" + U + "(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)", "i").exec(e)) && ((Q = String(M.label && !RegExp(U, "i").test(M.label) ? M.label : Q).split("/"))[1] && !/[\d.]+/.test(Q[0]) && (Q[0] += " " + Q[1]), M = M.label || M, Q = c(Q[0].replace(RegExp(U, "i"), M).replace(RegExp("; *(?:" + M + "[_-])?", "i"), " ").replace(RegExp("(" + M + ")[-_.]?(\\w)", "i"), "$1 $2"))); return Q }) } function E(S) { return b(S, function(Q, M) { return Q || (RegExp(M + "(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)", "i").exec(e) || 0)[1] || null }) } var u = B, t = e && "object" == typeof e && "String" != q(e); t && (u = e, e = null); var m = u.navigator || {}, n = m.userAgent || ""; e || (e = n); var D = t ? !!m.likeChrome : /\bChrome\b/.test(e) && !/internal|\n/i.test(I.toString()), H = t ? "Object" : "ScriptBridgingProxyObject", J = t ? "Object" : "Environment", R = t && u.java ? "JavaPackage" : q(u.java), O = t ? "Object" : "RuntimeObject"; J = (R = /\bJava/.test(R) && u.java) && q(u.environment) == J; var x = R ? "a" : "\u03b1", P = R ? "b" : "\u03b2", T = u.document || {}, N = u.operamini || u.opera, Y = C.test(Y = t && N ? N["[[Class]]"] : q(N)) ? Y : N = null, h, Z = e; t = []; var aa = null, X = e == n; n = X && N && "function" == typeof N.version && N.version(); var K = function(S) { return b(S, function(Q, M) { return Q || RegExp("\\b" + (M.pattern || k(M)) + "\\b", "i").exec(e) && (M.label || M) }) }([{ label: "EdgeHTML", pattern: "Edge" }, "Trident", { label: "WebKit", pattern: "AppleWebKit" }, "iCab", "Presto", "NetFront", "Tasman", "KHTML", "Gecko"]), z = function(S) { return b(S, function(Q, M) { return Q || RegExp("\\b" + (M.pattern || k(M)) + "\\b", "i").exec(e) && (M.label || M) }) }(["Adobe AIR", "Arora", "Avant Browser", "Breach", "Camino", "Electron", "Epiphany", "Fennec", "Flock", "Galeon", "GreenBrowser", "iCab", "Iceweasel", "K-Meleon", "Konqueror", "Lunascape", "Maxthon", { label: "Microsoft Edge", pattern: "Edge" }, "Midori", "Nook Browser", "PaleMoon", "PhantomJS", "Raven", "Rekonq", "RockMelt", { label: "Samsung Internet", pattern: "SamsungBrowser" }, "SeaMonkey", { label: "Silk", pattern: "(?:Cloud9|Silk-Accelerated)" }, "Sleipnir", "SlimBrowser", { label: "SRWare Iron", pattern: "Iron" }, "Sunrise", "Swiftfox", "Waterfox", "WebPositive", "Opera Mini", { label: "Opera Mini", pattern: "OPiOS" }, "Opera", { label: "Opera", pattern: "OPR" }, "Chrome", { label: "Chrome Mobile", pattern: "(?:CriOS|CrMo)" }, { label: "Firefox", pattern: "(?:Firefox|Minefield)" }, { label: "Firefox for iOS", pattern: "FxiOS" }, { label: "IE", pattern: "IEMobile" }, { label: "IE", pattern: "MSIE" }, "Safari" ]), L = w([{ label: "BlackBerry", pattern: "BB10" }, "BlackBerry", { label: "Galaxy S", pattern: "GT-I9000" }, { label: "Galaxy S2", pattern: "GT-I9100" }, { label: "Galaxy S3", pattern: "GT-I9300" }, { label: "Galaxy S4", pattern: "GT-I9500" }, { label: "Galaxy S5", pattern: "SM-G900" }, { label: "Galaxy S6", pattern: "SM-G920" }, { label: "Galaxy S6 Edge", pattern: "SM-G925" }, { label: "Galaxy S7", pattern: "SM-G930" }, { label: "Galaxy S7 Edge", pattern: "SM-G935" }, "Google TV", "Lumia", "iPad", "iPod", "iPhone", "Kindle", { label: "Kindle Fire", pattern: "(?:Cloud9|Silk-Accelerated)" }, "Nexus", "Nook", "PlayBook", "PlayStation Vita", "PlayStation", "TouchPad", "Transformer", { label: "Wii U", pattern: "WiiU" }, "Wii", "Xbox One", { label: "Xbox 360", pattern: "Xbox" }, "Xoom" ]), V = function(S) { return b(S, function(Q, M, U) { return Q || (M[L] || M[/^[a-z]+(?: +[a-z]+\b)*/i.exec(L)] || RegExp("\\b" + k(U) + "(?:\\b|\\w*\\d)", "i").exec(e)) && U }) }({ Apple: { iPad: 1, iPhone: 1, iPod: 1 }, Archos: {}, Amazon: { Kindle: 1, "Kindle Fire": 1 }, Asus: { Transformer: 1 }, "Barnes & Noble": { Nook: 1 }, BlackBerry: { PlayBook: 1 }, Google: { "Google TV": 1, Nexus: 1 }, HP: { TouchPad: 1 }, HTC: {}, LG: {}, Microsoft: { Xbox: 1, "Xbox One": 1 }, Motorola: { Xoom: 1 }, Nintendo: { "Wii U": 1, Wii: 1 }, Nokia: { Lumia: 1 }, Samsung: { "Galaxy S": 1, "Galaxy S2": 1, "Galaxy S3": 1, "Galaxy S4": 1 }, Sony: { PlayStation: 1, "PlayStation Vita": 1 } }), F = function(S) { return b(S, function(Q, M) { var U = M.pattern || k(M); if (!Q && (Q = RegExp("\\b" + U + "(?:/[\\d.]+|[ \\w.]*)", "i").exec(e))) { var W = Q, ba = M.label || M, ca = { "10.0": "10", "6.4": "10 Technical Preview", "6.3": "8.1", "6.2": "8", "6.1": "Server 2008 R2 / 7", "6.0": "Server 2008 / Vista", "5.2": "Server 2003 / XP 64-bit", "5.1": "XP", "5.01": "2000 SP1", "5.0": "2000", "4.0": "NT", "4.90": "ME" }; U && ba && /^Win/i.test(W) && !/^Windows Phone /i.test(W) && (ca = ca[/[\d.]+$/.exec(W)]) && (W = "Windows " + ca); W = String(W); U && ba && (W = W.replace(RegExp(U, "i"), ba)); Q = W = c(W.replace(/ ce$/i, " CE").replace(/\bhpw/i, "web").replace(/\bMacintosh\b/, "Mac OS").replace(/_PowerPC\b/i, " OS").replace(/\b(OS X) [^ \d]+/i, "$1").replace(/\bMac (OS X)\b/, "$1").replace(/\/(\d)/, " $1").replace(/_/g, ".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i, "").replace(/\bx86\.64\b/gi, "x86_64").replace(/\b(Windows Phone) OS\b/, "$1").replace(/\b(Chrome OS \w+) [\d.]+\b/, "$1").split(" on ")[0]) } return Q }) }(["Windows Phone", "Android", "CentOS", { label: "Chrome OS", pattern: "CrOS" }, "Debian", "Fedora", "FreeBSD", "Gentoo", "Haiku", "Kubuntu", "Linux Mint", "OpenBSD", "Red Hat", "SuSE", "Ubuntu", "Xubuntu", "Cygwin", "Symbian OS", "hpwOS", "webOS ", "webOS", "Tablet OS", "Tizen", "Linux", "Mac OS X", "Macintosh", "Mac", "Windows 98;", "Windows " ]); K && (K = [K]); V && !L && (L = w([V])); if (h = /\bGoogle TV\b/.exec(L)) L = h[0]; /\bSimulator\b/i.test(e) && (L = (L ? L + " " : "") + "Simulator"); "Opera Mini" == z && /\bOPiOS\b/.test(e) && t.push("running in Turbo/Uncompressed mode"); "IE" == z && /\blike iPhone OS\b/.test(e) ? (h = l(e.replace(/like iPhone OS/, "")), V = h.manufacturer, L = h.product) : /^iP/.test(L) ? (z || (z = "Safari"), F = "iOS" + ((h = / OS ([\d_]+)/i.exec(e)) ? " " + h[1].replace(/_/g, ".") : "")) : "Konqueror" != z || /buntu/i.test(F) ? V && "Google" != V && (/Chrome/.test(z) && !/\bMobile Safari\b/i.test(e) || /\bVita\b/.test(L)) || /\bAndroid\b/.test(F) && /^Chrome/.test(z) && /\bVersion\//i.test(e) ? (z = "Android Browser", F = /\bAndroid\b/.test(F) ? F : "Android") : "Silk" == z ? (/\bMobi/i.test(e) || (F = "Android", t.unshift("desktop mode")), /Accelerated *= *true/i.test(e) && t.unshift("accelerated")) : "PaleMoon" == z && (h = /\bFirefox\/([\d.]+)\b/.exec(e)) ? t.push("identifying as Firefox " + h[1]) : "Firefox" == z && (h = /\b(Mobile|Tablet|TV)\b/i.exec(e)) ? (F || (F = "Firefox OS"), L || (L = h[1])) : !z || (h = !/\bMinefield\b/i.test(e) && /\b(?:Firefox|Safari)\b/.exec(z)) ? (z && !L && /[\/,]|^[^(]+?\)/.test(e.slice(e.indexOf(h + "/") + 8)) && (z = null), (h = L || V || F) && (L || V || /\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(F)) && (z = /[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(F) ? F : h) + " Browser")) : "Electron" == z && (h = (/\bChrome\/([\d.]+)\b/.exec(e) || 0)[1]) && t.push("Chromium " + h) : F = "Kubuntu"; n || (n = E(["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))", "Version", k(z), "(?:Firefox|Minefield|NetFront)" ])); if (h = "iCab" == K && 3 < parseFloat(n) && "WebKit" || /\bOpera\b/.test(z) && (/\bOPR\b/.test(e) ? "Blink" : "Presto") || /\b(?:Midori|Nook|Safari)\b/i.test(e) && !/^(?:Trident|EdgeHTML)$/.test(K) && "WebKit" || !K && /\bMSIE\b/i.test(e) && ("Mac OS" == F ? "Tasman" : "Trident") || "WebKit" == K && /\bPlayStation\b(?! Vita\b)/i.test(z) && "NetFront") K = [h]; "IE" == z && (h = (/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(e) || 0)[1]) ? (z += " Mobile", F = "Windows Phone " + (/\+$/.test(h) ? h : h + ".x"), t.unshift("desktop mode")) : /\bWPDesktop\b/i.test(e) ? (z = "IE Mobile", F = "Windows Phone 8.x", t.unshift("desktop mode"), n || (n = (/\brv:([\d.]+)/.exec(e) || 0)[1])) : "IE" != z && "Trident" == K && (h = /\brv:([\d.]+)/.exec(e)) && (z && t.push("identifying as " + z + (n ? " " + n : "")), z = "IE", n = h[1]); if (X) { if (g(u, "global")) if (R && (h = R.lang.System, Z = h.getProperty("os.arch"), F = F || h.getProperty("os.name") + " " + h.getProperty("os.version")), J) { try { n = u.require("ringo/engine").version.join("."), z = "RingoJS" } catch (S) { (h = u.system) && h.global.system == u.system && (z = "Narwhal", F || (F = h[0].os || null)) } z || (z = "Rhino") } else "object" == typeof u.process && !u.process.browser && (h = u.process) && ("object" == typeof h.versions && ("string" == typeof h.versions.electron ? (t.push("Node " + h.versions.node), z = "Electron", n = h.versions.electron) : "string" == typeof h.versions.nw && (t.push("Chromium " + n, "Node " + h.versions.node), z = "NW.js", n = h.versions.nw)), z || (z = "Node.js", Z = h.arch, F = h.platform, n = (n = /[\d.]+/.exec(h.version)) ? n[0] : null)); else q(h = u.runtime) == H ? (z = "Adobe AIR", F = h.flash.system.Capabilities.os) : q(h = u.phantom) == O ? (z = "PhantomJS", n = (h = h.version || null) && h.major + "." + h.minor + "." + h.patch) : "number" == typeof T.documentMode && (h = /\bTrident\/(\d+)/i.exec(e)) ? (n = [n, T.documentMode], (h = +h[1] + 4) != n[1] && (t.push("IE " + n[1] + " mode"), K && (K[1] = ""), n[1] = h), n = "IE" == z ? String(n[1].toFixed(1)) : n[0]) : "number" == typeof T.documentMode && /^(?:Chrome|Firefox)\b/.test(z) && (t.push("masking as " + z + " " + n), z = "IE", n = "11.0", K = ["Trident"], F = "Windows"); F = F && c(F) } n && (h = /(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(n) || /(?:alpha|beta)(?: ?\d)?/i.exec(e + ";" + (X && m.appMinorVersion)) || /\bMinefield\b/i.test(e) && "a") && (aa = /b/i.test(h) ? "beta" : "alpha", n = n.replace(RegExp(h + "\\+?$"), "") + ("beta" == aa ? P : x) + (/\d+\+?/.exec(h) || "")); if ("Fennec" == z || "Firefox" == z && /\b(?:Android|Firefox OS)\b/.test(F)) z = "Firefox Mobile"; else if ("Maxthon" == z && n) n = n.replace(/\.[\d.]+/, ".x"); else if (/\bXbox\b/i.test(L)) "Xbox 360" == L && (F = null), "Xbox 360" == L && /\bIEMobile\b/.test(e) && t.unshift("mobile mode"); else if (!/^(?:Chrome|IE|Opera)$/.test(z) && (!z || L || /Browser|Mobi/.test(z)) || "Windows CE" != F && !/Mobi/i.test(e)) if ("IE" == z && X) try { null === u.external && t.unshift("platform preview") } catch (S) { t.unshift("embedded") } else(/\bBlackBerry\b/.test(L) || /\bBB10\b/.test(e)) && (h = (RegExp(L.replace(/ +/g, " *") + "/([.\\d]+)", "i").exec(e) || 0)[1] || n) ? (h = [h, /BB10/.test(e)], F = (h[1] ? (L = null, V = "BlackBerry") : "Device Software") + " " + h[0], n = null) : this != f && "Wii" != L && (X && N || /Opera/.test(z) && /\b(?:MSIE|Firefox)\b/i.test(e) || "Firefox" == z && /\bOS X (?:\d+\.){2,}/.test(F) || "IE" == z && (F && !/^Win/.test(F) && 5.5 < n || /\bWindows XP\b/.test(F) && 8 < n || 8 == n && !/\bTrident\b/.test(e))) && !C.test(h = l.call(f, e.replace(C, "") + ";")) && h.name && (h = "ing as " + h.name + ((h = h.version) ? " " + h : ""), C.test(z) ? (/\bIE\b/.test(h) && "Mac OS" == F && (F = null), h = "identify" + h) : (h = "mask" + h, z = Y ? c(Y.replace(/([a-z])([A-Z])/g, "$1 $2")) : "Opera", /\bIE\b/.test(h) && (F = null), X || (n = null)), K = ["Presto"], t.push(h)); else z += " Mobile"; if (h = (/\bAppleWebKit\/([\d.]+\+?)/i.exec(e) || 0)[1]) { h = [parseFloat(h.replace(/\.(\d)$/, ".0$1")), h]; if ("Safari" == z && "+" == h[1].slice(-1)) z = "WebKit Nightly", aa = "alpha", n = h[1].slice(0, -1); else if (n == h[1] || n == (h[2] = (/\bSafari\/([\d.]+\+?)/i.exec(e) || 0)[1])) n = null; h[1] = (/\bChrome\/([\d.]+)/i.exec(e) || 0)[1]; 537.36 == h[0] && 537.36 == h[2] && 28 <= parseFloat(h[1]) && "WebKit" == K && (K = ["Blink"]); X && (D || h[1]) ? (K && (K[1] = "like Chrome"), h = h[1] || (h = h[0], 530 > h ? 1 : 532 > h ? 2 : 532.05 > h ? 3 : 533 > h ? 4 : 534.03 > h ? 5 : 534.07 > h ? 6 : 534.1 > h ? 7 : 534.13 > h ? 8 : 534.16 > h ? 9 : 534.24 > h ? 10 : 534.3 > h ? 11 : 535.01 > h ? 12 : 535.02 > h ? "13+" : 535.07 > h ? 15 : 535.11 > h ? 16 : 535.19 > h ? 17 : 536.05 > h ? 18 : 536.1 > h ? 19 : 537.01 > h ? 20 : 537.11 > h ? "21+" : 537.13 > h ? 23 : 537.18 > h ? 24 : 537.24 > h ? 25 : 537.36 > h ? 26 : "Blink" != K ? "27" : "28")) : (K && (K[1] = "like Safari"), h = (h = h[0], 400 > h ? 1 : 500 > h ? 2 : 526 > h ? 3 : 533 > h ? 4 : 534 > h ? "4+" : 535 > h ? 5 : 537 > h ? 6 : 538 > h ? 7 : 601 > h ? 8 : "8")); K && (K[1] += " " + (h += "number" == typeof h ? ".x" : /[.+]/.test(h) ? "" : "+")); "Safari" == z && (!n || 45 < parseInt(n)) && (n = h) } "Opera" == z && (h = /\bzbov|zvav$/.exec(F)) ? (z += " ", t.unshift("desktop mode"), "zvav" == h ? (z += "Mini", n = null) : z += "Mobile", F = F.replace(RegExp(" *" + h + "$"), "")) : "Safari" == z && /\bChrome\b/.exec(K && K[1]) && (t.unshift("desktop mode"), z = "Chrome Mobile", n = null, /\bOS X\b/.test(F) ? (V = "Apple", F = "iOS 4.3+") : F = null); n && 0 == n.indexOf(h = /[\d.]+$/.exec(F)) && -1 < e.indexOf("/" + h + "-") && (F = String(F.replace(h, "")).replace(/^ +| +$/g, "")); K && !/\b(?:Avant|Nook)\b/.test(z) && (/Browser|Lunascape|Maxthon/.test(z) || "Safari" != z && /^iOS/.test(F) && /\bSafari\b/.test(K[1]) || /^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(z) && K[1]) && (h = K[K.length - 1]) && t.push(h); t.length && (t = ["(" + t.join("; ") + ")"]); V && L && 0 > L.indexOf(V) && t.push("on " + V); L && t.push((/^on /.test(t[t.length - 1]) ? "" : "on ") + L); if (F) { var da = (h = / ([\d.+]+)$/.exec(F)) && "/" == F.charAt(F.length - h[0].length - 1); F = { architecture: 32, family: h && !da ? F.replace(h[0], "") : F, version: h ? h[1] : null, toString: function() { var S = this.version; return this.family + (S && !da ? " " + S : "") + (64 == this.architecture ? " 64-bit" : "") } } }(h = /\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(Z)) && !/\bi686\b/i.test(Z) ? (F && (F.architecture = 64, F.family = F.family.replace(RegExp(" *" + h), "")), z && (/\bWOW64\b/i.test(e) || X && /\w(?:86|32)$/.test(m.cpuClass || m.platform) && !/\bWin64; x64\b/i.test(e)) && t.unshift("32-bit")) : F && /^OS X/.test(F.family) && "Chrome" == z && 39 <= parseFloat(n) && (F.architecture = 64); e || (e = null); u = {}; u.description = e; u.layout = K && K[0]; u.manufacturer = V; u.name = z; u.prerelease = aa; u.product = L; u.ua = e; u.version = z && n; u.os = F || { architecture: null, family: null, version: null, toString: function() { return "null" } }; u.parse = l; u.toString = function() { return this.description || "" }; u.version && t.unshift(n); u.name && t.unshift(z); F && z && (F != String(F).split(" ")[0] || F != z.split(" ")[0] && !L) && t.push(L ? "(" + F + ")" : "on " + F); t.length && (u.description = t.join(" ")); return u } var p = { "function": !0, object: !0 }, B = p[typeof window] && window || this, v = p[typeof exports] && exports; p = p[typeof module] && module && !module.nodeType && module; var r = v && p && "object" == typeof global && global; !r || r.global !== r && r.window !== r && r.self !== r || (B = r); var y = Math.pow(2, 53) - 1, C = /\bOpera/; r = Object.prototype; var A = r.hasOwnProperty, I = r.toString, G = l(); "function" == typeof define && "object" == typeof define.amd && define.amd ? (B.platform = G, define(function() { return G })) : v && p ? f(G, function(e, w) { v[w] = e }) : B.platform = G }).call(this); function buildIOSMeta() { for (var a = [{ name: "viewport", content: "width=device-width, height=device-height, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" }, { name: "apple-mobile-web-app-capable", content: "yes" }, { name: "apple-mobile-web-app-status-bar-style", content: "black" }], d = 0; d < a.length; d++) { var c = document.createElement("meta"); c.name = a[d].name; c.content = a[d].content; var f = window.document.head.querySelector('meta[name="' + c.name + '"]'); f && f.parentNode.removeChild(f); window.document.head.appendChild(c) } } function hideIOSFullscreenPanel() { jQuery(".xxx-ios-fullscreen-message").css("display", "none"); jQuery(".xxx-ios-fullscreen-scroll").css("display", "none"); jQuery(".xxx-game-iframe-full").removeClass("xxx-game-iframe-iphone-se") } function buildIOSFullscreenPanel() { jQuery("body").append('<div class="xxx-ios-fullscreen-message"><div class="xxx-ios-fullscreen-swipe"></div></div><div class="xxx-ios-fullscreen-scroll"></div>') } function showIOSFullscreenPanel() { jQuery(".xxx-ios-fullscreen-message").css("display", "block"); jQuery(".xxx-ios-fullscreen-scroll").css("display", "block") } function __iosResize() { window.scrollTo(0, 0); console.log(window.devicePixelRatio); console.log(window.innerWidth); console.log(window.innerHeight); if ("iPhone" === platform.product) switch (window.devicePixelRatio) { case 2: switch (window.innerWidth) { case 568: 320 !== window.innerHeight && jQuery(".xxx-game-iframe-full").addClass("xxx-game-iframe-iphone-se"); break; case 667: 375 === window.innerHeight ? hideIOSFullscreenPanel() : showIOSFullscreenPanel(); break; case 808: 414 === window.innerHeight ? hideIOSFullscreenPanel() : showIOSFullscreenPanel(); break; default: hideIOSFullscreenPanel() } break; case 3: switch (window.innerWidth) { case 736: 414 === window.innerHeight ? hideIOSFullscreenPanel() : showIOSFullscreenPanel(); break; case 724: 375 === window.innerHeight ? hideIOSFullscreenPanel() : showIOSFullscreenPanel(); break; case 808: 414 === window.innerHeight ? hideIOSFullscreenPanel() : showIOSFullscreenPanel(); break; default: hideIOSFullscreenPanel() } break; default: hideIOSFullscreenPanel() } } function iosResize() { __iosResize(); setTimeout(function() { __iosResize() }, 500) } function iosInIframe() { try { return window.self !== window.top } catch (a) { return !0 } } function isIOSLessThen13() { var a = platform.os, d = a.family.toLowerCase(); a = parseFloat(a.version); return "ios" === d && 13 > a ? !0 : !1 } $(document).ready(function() { platform && "iPhone" === platform.product && "safari" === platform.name.toLowerCase() && isIOSLessThen13() && !iosInIframe() && (buildIOSFullscreenPanel(), buildIOSMeta()) }); jQuery(window).resize(function() { platform && "iPhone" === platform.product && "safari" === platform.name.toLowerCase() && isIOSLessThen13() && !iosInIframe() && iosResize() }); var s_iScaleFactor = 1, s_iOffsetX, s_iOffsetY, s_bIsIphone = !1, s_bFocus = !0; (function(a) { (jQuery.browser = jQuery.browser || {}).mobile = /android|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(ad|hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|tablet|treo|up\.(browser|link)|vodafone|wap|webos|windows (ce|phone)|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4)) })(navigator.userAgent || navigator.vendor || window.opera); $(window).resize(function() { sizeHandler() }); function trace(a) { console.log(a) } function isMobile() { return isIpad() ? !0 : jQuery.browser.mobile } function isIpad() { var a = -1 !== navigator.userAgent.toLowerCase().indexOf("ipad"); return !a && navigator.userAgent.match(/Mac/) && navigator.maxTouchPoints && 2 < navigator.maxTouchPoints ? !0 : a } function isIOS() { var a = "iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";"); if (-1 !== navigator.userAgent.toLowerCase().indexOf("iphone")) return s_bIsIphone = !0; for (; a.length;) if (navigator.platform === a.pop()) return !0; return s_bIsIphone = !1 } function getSize(a) { var d = a.toLowerCase(), c = window.document, f = c.documentElement; if (void 0 === window["inner" + a]) a = f["client" + a]; else if (window["inner" + a] != f["client" + a]) { var q = c.createElement("body"); q.id = "vpw-test-b"; q.style.cssText = "overflow:scroll"; var g = c.createElement("div"); g.id = "vpw-test-d"; g.style.cssText = "position:absolute;top:-1000px"; g.innerHTML = "<style>@media(" + d + ":" + f["client" + a] + "px){body#vpw-test-b div#vpw-test-d{" + d + ":7px!important}}</style>"; q.appendChild(g); f.insertBefore(q, c.head); a = 7 == g["offset" + a] ? f["client" + a] : window["inner" + a]; f.removeChild(q) } else a = window["inner" + a]; return a } window.addEventListener("orientationchange", onOrientationChange); function onOrientationChange() { window.matchMedia("(orientation: portrait)").matches && sizeHandler(); window.matchMedia("(orientation: landscape)").matches && sizeHandler() } function getIOSWindowHeight() { return document.documentElement.clientWidth / window.innerWidth * window.innerHeight } function getHeightOfIOSToolbars() { var a = (0 === window.orientation ? screen.height : screen.width) - getIOSWindowHeight(); return 1 < a ? a : 0 } function sizeHandler() { window.scrollTo(0, 1); if ($("#canvas")) { var a = null !== platform.name && "safari" === platform.name.toLowerCase() ? getIOSWindowHeight() : getSize("Height"); var d = getSize("Width"); s_bFocus && _checkOrientation(d, a); var c = Math.min(a / CANVAS_HEIGHT, d / CANVAS_WIDTH), f = Math.round(CANVAS_WIDTH * c); c = Math.round(CANVAS_HEIGHT * c); if (c < a) { var q = a - c; c += q; f += CANVAS_WIDTH / CANVAS_HEIGHT * q } else f < d && (q = d - f, f += q, c += CANVAS_HEIGHT / CANVAS_WIDTH * q); q = a / 2 - c / 2; var g = d / 2 - f / 2, k = CANVAS_WIDTH / f; if (g * k < -EDGEBOARD_X || q * k < -EDGEBOARD_Y) c = Math.min(a / (CANVAS_HEIGHT - 2 * EDGEBOARD_Y), d / (CANVAS_WIDTH - 2 * EDGEBOARD_X)), f = Math.round(CANVAS_WIDTH * c), c = Math.round(CANVAS_HEIGHT * c), q = (a - c) / 2, g = (d - f) / 2, k = CANVAS_WIDTH / f; s_iOffsetX = -1 * g * k; s_iOffsetY = -1 * q * k; 0 <= q && (s_iOffsetY = 0); 0 <= g && (s_iOffsetX = 0); null !== s_oGame && s_oGame.refreshButtonPos(s_iOffsetX, s_iOffsetY); null !== s_oMenu && s_oMenu.refreshButtonPos(s_iOffsetX, s_iOffsetY); null !== s_oLevelMenu && s_oLevelMenu.refreshButtonPos(s_iOffsetX, s_iOffsetY); s_bIsIphone && s_oStage ? (canvas = document.getElementById("canvas"), s_oStage.canvas.width = 2 * f, s_oStage.canvas.height = 2 * c, canvas.style.width = f + "px", canvas.style.height = c + "px", d = Math.min(f / CANVAS_WIDTH, c / CANVAS_HEIGHT), s_iScaleFactor = 2 * d, s_oStage.scaleX = s_oStage.scaleY = 2 * d) : s_bMobile ? ($("#canvas").css("width", f + "px"), $("#canvas").css("height", c + "px")) : s_oStage && (s_oStage.canvas.width = f, s_oStage.canvas.height = c, s_iScaleFactor = Math.min(f / CANVAS_WIDTH, c / CANVAS_HEIGHT), s_oStage.scaleX = s_oStage.scaleY = s_iScaleFactor); 0 > q || (q = (a - c) / 2); $("#canvas").css("top", q + "px"); $("#canvas").css("left", g + "px"); fullscreenHandler() } } function _checkOrientation(a, d) { s_bMobile && ENABLE_CHECK_ORIENTATION && (a > d ? "landscape" === $(".orientation-msg-container").attr("data-orientation") ? ($(".orientation-msg-container").css("display", "none"), s_oMain.startUpdate()) : ($(".orientation-msg-container").css("display", "block"), s_oMain.stopUpdate()) : "portrait" === $(".orientation-msg-container").attr("data-orientation") ? ($(".orientation-msg-container").css("display", "none"), s_oMain.startUpdate()) : ($(".orientation-msg-container").css("display", "block"), s_oMain.stopUpdate())) } function inIframe() { try { return window.self !== window.top } catch (a) { return !0 } } function createBitmap(a, d, c) { var f = new createjs.Bitmap(a), q = new createjs.Shape; d && c ? q.graphics.beginFill("#fff").drawRect(0, 0, d, c) : q.graphics.beginFill("#ff0").drawRect(0, 0, a.width, a.height); f.hitArea = q; return f } function createSprite(a, d, c, f, q, g) { a = null !== d ? new createjs.Sprite(a, d) : new createjs.Sprite(a); d = new createjs.Shape; d.graphics.beginFill("#000000").drawRect(-c, -f, q, g); a.hitArea = d; return a } function randomFloatBetween(a, d, c) { "undefined" === typeof c && (c = 2); return parseFloat(Math.min(a + Math.random() * (d - a), d).toFixed(c)) } function shuffle(a) { for (var d = a.length, c, f; 0 !== d;) f = Math.floor(Math.random() * d), --d, c = a[d], a[d] = a[f], a[f] = c; return a } function formatTime(a) { a /= 1E3; var d = Math.floor(a / 60); a = parseFloat(a - 60 * d).toFixed(1); var c = ""; c = 10 > d ? c + ("0" + d + ":") : c + (d + ":"); return 10 > a ? c + ("0" + a) : c + a } function NoClickDelay(a) { this.element = a; window.Touch && this.element.addEventListener("touchstart", this, !1) } function shuffle(a) { for (var d = a.length, c, f; 0 < d;) f = Math.floor(Math.random() * d), d--, c = a[d], a[d] = a[f], a[f] = c; return a } NoClickDelay.prototype = { handleEvent: function(a) { switch (a.type) { case "touchstart": this.onTouchStart(a); break; case "touchmove": this.onTouchMove(a); break; case "touchend": this.onTouchEnd(a) } }, onTouchStart: function(a) { a.preventDefault(); this.moved = !1; this.element.addEventListener("touchmove", this, !1); this.element.addEventListener("touchend", this, !1) }, onTouchMove: function(a) { this.moved = !0 }, onTouchEnd: function(a) { this.element.removeEventListener("touchmove", this, !1); this.element.removeEventListener("touchend", this, !1); if (!this.moved) { a = document.elementFromPoint(a.changedTouches[0].clientX, a.changedTouches[0].clientY); 3 == a.nodeType && (a = a.parentNode); var d = document.createEvent("MouseEvents"); d.initEvent("click", !0, !0); a.dispatchEvent(d) } } }; (function() { function a(c) { var f = { focus: "visible", focusin: "visible", pageshow: "visible", blur: "hidden", focusout: "hidden", pagehide: "hidden" }; c = c || window.event; c.type in f ? document.body.className = f[c.type] : (document.body.className = this[d] ? "hidden" : "visible", "hidden" === document.body.className ? (s_oMain.stopUpdate(), s_bFocus = !1) : (s_oMain.startUpdate(), s_bFocus = !0)) } var d = "hidden"; d in document ? document.addEventListener("visibilitychange", a) : (d = "mozHidden") in document ? document.addEventListener("mozvisibilitychange", a) : (d = "webkitHidden") in document ? document.addEventListener("webkitvisibilitychange", a) : (d = "msHidden") in document ? document.addEventListener("msvisibilitychange", a) : "onfocusin" in document ? document.onfocusin = document.onfocusout = a : window.onpageshow = window.onpagehide = window.onfocus = window.onblur = a })(); function ctlArcadeResume() { null !== s_oMain && s_oMain.startUpdate() } function ctlArcadePause() { null !== s_oMain && s_oMain.stopUpdate() } function getParamValue(a) { for (var d = window.location.search.substring(1).split("&"), c = 0; c < d.length; c++) { var f = d[c].split("="); if (f[0] == a) return f[1] } } function playSound(a, d, c) { return !1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile ? (s_aSounds[a].play(), s_aSounds[a].volume(d), s_aSounds[a].loop(c), s_aSounds[a]) : null } function stopSound(a) { !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || s_aSounds[a].stop() } function setVolume(a, d) { !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || s_aSounds[a].volume(d) } function setMute(a, d) { !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || s_aSounds[a].mute(d) } function saveItem(a, d) { s_bStorageAvailable && localStorage.setItem(a, d) } function getItem(a) { return s_bStorageAvailable ? localStorage.getItem(a) : null } function fullscreenHandler() { ENABLE_FULLSCREEN && !1 !== screenfull.isEnabled && (s_bFullscreen = screenfull.isFullscreen, null !== s_oInterface && s_oInterface.resetFullscreenBut(), null !== s_oMenu && s_oMenu.resetFullscreenBut(), null !== s_oLevelMenu && s_oLevelMenu.resetFullscreenBut()) } if (screenfull.isEnabled) screenfull.on("change", function() { s_bFullscreen = screenfull.isFullscreen; null !== s_oInterface && s_oInterface.resetFullscreenBut(); null !== s_oMenu && s_oMenu.resetFullscreenBut(); null !== s_oLevelMenu && s_oLevelMenu.resetFullscreenBut() }); function CSpriteLibrary() { var a = {}, d, c, f, q, g, k; this.init = function(b, l, p) { d = {}; f = c = 0; q = b; g = l; k = p }; this.addSprite = function(b, l) { if (!a.hasOwnProperty(b)) { var p = new Image; a[b] = d[b] = { szPath: l, oSprite: p, bLoaded: !1 }; c++ } }; this.getSprite = function(b) { return a.hasOwnProperty(b) ? a[b].oSprite : null }; this._onSpritesLoaded = function() { c = 0; g.call(k) }; this._onSpriteLoaded = function() { q.call(k); ++f === c && this._onSpritesLoaded() }; this.loadSprites = function() { for (var b in d) d[b].oSprite.oSpriteLibrary = this, d[b].oSprite.szKey = b, d[b].oSprite.onload = function() { this.oSpriteLibrary.setLoaded(this.szKey); this.oSpriteLibrary._onSpriteLoaded(this.szKey) }, d[b].oSprite.onerror = function(l) { var p = l.currentTarget; setTimeout(function() { d[p.szKey].oSprite.src = d[p.szKey].szPath }, 500) }, d[b].oSprite.src = d[b].szPath }; this.setLoaded = function(b) { a[b].bLoaded = !0 }; this.isLoaded = function(b) { return a[b].bLoaded }; this.getNumSprites = function() { return c } } var CANVAS_WIDTH = 960, CANVAS_HEIGHT = 540, EDGEBOARD_X = 128, EDGEBOARD_Y = 42, FPS_TIME = 1E3 / 24, DISABLE_SOUND_MOBILE = !1, FONT_GAME = "TradeGothic", SOUNDTRACK_VOLUME_IN_GAME = 1, STATE_LOADING = 0, STATE_MENU = 1, STATE_HELP = 1, STATE_GAME = 3, ON_MOUSE_DOWN = 0, ON_MOUSE_UP = 1, ON_MOUSE_OVER = 2, ON_MOUSE_OUT = 3, ON_DRAG_START = 4, ON_DRAG_END = 5, ON_MSG_BOX_LEFT_BUT = 6, ON_MSG_BOX_CENTER_BUT = 7, ON_MSG_BOX_RIGHT_BUT = 8, ON_RELEASE_YES = 9, ON_RELEASE_NO = 10, ALERT_FROM_EXIT = 0, ALERT_FROM_RESTART = 1, ALERT_FROM_SHUFFLE = 2, NUM_ROWS_PAGE_LEVEL = 2, NUM_COLS_PAGE_LEVEL = 3, TILE_WIDTH = 60, TILE_HEIGHT = 78, BONUS_TIME, HINT_PENALTY, SCORE_BONUS_LAYOUT = []; SCORE_BONUS_LAYOUT.easy = 1; SCORE_BONUS_LAYOUT.medium = 2; SCORE_BONUS_LAYOUT.hard = 3; var ENABLE_FULLSCREEN, ENABLE_CHECK_ORIENTATION; CTLText.prototype = { constructor: CTLText, __autofit: function() { if (this._bFitText) { for (var a = this._iFontSize; (this._oText.getBounds().height > this._iHeight - 2 * this._iPaddingV || this._oText.getBounds().width > this._iWidth - 2 * this._iPaddingH) && !(a--, this._oText.font = a + "px " + this._szFont, this._oText.lineHeight = Math.round(a * this._fLineHeightFactor), this.__updateY(), this.__verticalAlign(), 8 > a);); this._iFontSize = a } }, __verticalAlign: function() { if (this._bVerticalAlign) { var a = this._oText.getBounds().height; this._oText.y -= (a - this._iHeight) / 2 + this._iPaddingV } }, __updateY: function() { this._oText.y = this._y + this._iPaddingV; switch (this._oText.textBaseline) { case "middle": this._oText.y += this._oText.lineHeight / 2 + (this._iFontSize * this._fLineHeightFactor - this._iFontSize) } }, __createText: function(a) { this._bDebug && (this._oDebugShape = new createjs.Shape, this._oDebugShape.graphics.beginFill("rgba(255,0,0,0.5)").drawRect(this._x, this._y, this._iWidth, this._iHeight), this._oContainer.addChild(this._oDebugShape)); this._oText = new createjs.Text(a, this._iFontSize + "px " + this._szFont, this._szColor); this._oText.textBaseline = "middle"; this._oText.lineHeight = Math.round(this._iFontSize * this._fLineHeightFactor); this._oText.textAlign = this._szAlign; this._oText.lineWidth = this._bMultiline ? this._iWidth - 2 * this._iPaddingH : null; switch (this._szAlign) { case "center": this._oText.x = this._x + this._iWidth / 2; break; case "left": this._oText.x = this._x + this._iPaddingH; break; case "right": this._oText.x = this._x + this._iWidth - this._iPaddingH } this._oContainer.addChild(this._oText); this.refreshText(a) }, setVerticalAlign: function(a) { this._bVerticalAlign = a }, setOutline: function(a) { null !== this._oText && (this._oText.outline = a) }, setShadow: function(a, d, c, f) { null !== this._oText && (this._oText.shadow = new createjs.Shadow(a, d, c, f)) }, setColor: function(a) { this._oText.color = a }, setAlpha: function(a) { this._oText.alpha = a }, setY: function(a) { this._y = this._oText.y = a }, removeTweens: function() { createjs.Tween.removeTweens(this._oText) }, getText: function() { return this._oText }, getY: function() { return this._y }, getFontSize: function() { return this._iFontSize }, refreshText: function(a) { "" === a && (a = " "); null === this._oText && this.__createText(a); this._oText.text = a; this._oText.font = this._iFontSize + "px " + this._szFont; this._oText.lineHeight = Math.round(this._iFontSize * this._fLineHeightFactor); this.__autofit(); this.__updateY(); this.__verticalAlign() } }; function CTLText(a, d, c, f, q, g, k, b, l, p, B, v, r, y, C, A, I) { this._oContainer = a; this._x = d; this._y = c; this._iWidth = f; this._iHeight = q; this._bMultiline = A; this._iFontSize = g; this._szAlign = k; this._szColor = b; this._szFont = l; this._iPaddingH = B; this._iPaddingV = v; this._bVerticalAlign = C; this._bFitText = y; this._bDebug = I; this._oDebugShape = null; this._fLineHeightFactor = p; this._oText = null; r && this.__createText(r) } function CPreloader() { var a, d, c, f, q, g, k, b, l; this._init = function() { s_oSpriteLibrary.init(this._onImagesLoaded, this._onAllImagesLoaded, this); s_oSpriteLibrary.addSprite("progress_bar", "./sprites/progress_bar.png"); s_oSpriteLibrary.addSprite("200x200", "./sprites/200x200.jpg"); s_oSpriteLibrary.loadSprites(); l = new createjs.Container; s_oStage.addChild(l) }; this.unload = function() { l.removeAllChildren() }; this._onImagesLoaded = function() {}; this._onAllImagesLoaded = function() { this.attachSprites(); s_oMain.preloaderReady() }; this.attachSprites = function() { var p = new createjs.Shape; p.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); l.addChild(p); p = s_oSpriteLibrary.getSprite("200x200"); k = createBitmap(p); k.regX = .5 * p.width; k.regY = .5 * p.height; k.x = CANVAS_WIDTH / 2; k.y = CANVAS_HEIGHT / 2 - 80; l.addChild(k); b = new createjs.Shape; b.graphics.beginFill("rgba(0,0,0,0.01)").drawRoundRect(k.x - 100, k.y - 100, 200, 200, 10); l.addChild(b); k.mask = b; p = s_oSpriteLibrary.getSprite("progress_bar"); f = createBitmap(p); f.x = CANVAS_WIDTH / 2 - p.width / 2; f.y = CANVAS_HEIGHT / 2 + 70; l.addChild(f); a = p.width; d = p.height; q = new createjs.Shape; q.graphics.beginFill("rgba(0,0,0,0.01)").drawRect(f.x, f.y, 1, d); l.addChild(q); f.mask = q; c = new createjs.Text("", "30px " + FONT_GAME, "#fff"); c.x = CANVAS_WIDTH / 2; c.y = CANVAS_HEIGHT / 2 + 120; c.textBaseline = "alphabetic"; c.textAlign = "center"; l.addChild(c); g = new createjs.Shape; g.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); l.addChild(g); createjs.Tween.get(g).to({ alpha: 0 }, 500).call(function() { createjs.Tween.removeTweens(g); l.removeChild(g) }) }; this.refreshLoader = function(p) { c.text = p + "%"; 100 === p && (s_oMain._allResourcesLoaded(), c.visible = !1, f.visible = !1); q.graphics.clear(); p = Math.floor(p * a / 100); q.graphics.beginFill("rgba(0,0,0,0.01)").drawRect(f.x, f.y, p, d) }; this._init() } function CMain(a) { var d, c = 0, f = 0, q = STATE_LOADING, g, k; this.initContainer = function() { var b = document.getElementById("canvas"); s_oStage = new createjs.Stage(b); s_bMobile = isMobile(); !1 === s_bMobile ? s_oStage.enableMouseOver(20) : createjs.Touch.enable(s_oStage, !0); s_iPrevTime = (new Date).getTime(); createjs.Ticker.framerate = 30; createjs.Ticker.on("tick", this._update); navigator.userAgent.match(/Windows Phone/i) && (DISABLE_SOUND_MOBILE = !0); s_oSpriteLibrary = new CSpriteLibrary; g = new CPreloader; }; this.clearLocalStorage = function() { s_bStorageAvailable && localStorage.clear() }; this.preloaderReady = function() { this.onLoadedJSON(LAYOUT_INFO); d = !0 }; this.soundLoaded = function() { c++; g.refreshLoader(Math.floor(c / f * 100)) }; this._initSounds = function() { Howler.mute(!s_bAudioActive); s_aSoundsInfo = []; s_aSoundsInfo.push({ path: "./sounds/", filename: "win", loop: !1, volume: 1, ingamename: "win" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "click", loop: !1, volume: 1, ingamename: "click" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "game_over", loop: !1, volume: 1, ingamename: "game_over" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "matching", loop: !1, volume: 1, ingamename: "matching" }); f += s_aSoundsInfo.length; s_aSounds = []; for (var b = 0; b < s_aSoundsInfo.length; b++) this.tryToLoadSound(s_aSoundsInfo[b], !1) }; this.tryToLoadSound = function(b, l) { setTimeout(function() { s_aSounds[b.ingamename] = new Howl({ src: [b.path + b.filename + ".mp3"], autoplay: !1, preload: !0, loop: b.loop, volume: b.volume, onload: s_oMain.soundLoaded, onloaderror: function(p, B) { for (var v = 0; v < s_aSoundsInfo.length; v++) if (p === s_aSounds[s_aSoundsInfo[v].ingamename]._sounds[0]._id) { s_oMain.tryToLoadSound(s_aSoundsInfo[v], !0); break } }, onplayerror: function(p) { for (var B = 0; B < s_aSoundsInfo.length; B++) if (p === s_aSounds[s_aSoundsInfo[B].ingamename]._sounds[0]._id) { s_aSounds[s_aSoundsInfo[B].ingamename].once("unlock", function() { s_aSounds[s_aSoundsInfo[B].ingamename].play(); "soundtrack" === s_aSoundsInfo[B].ingamename && null !== s_oGame && setVolume("soundtrack", SOUNDTRACK_VOLUME_IN_GAME) }); break } } }) }, l ? 200 : 0) }; this._loadImages = function() { s_oSpriteLibrary.init(this._onImagesLoaded, this._onAllImagesLoaded, this); s_oSpriteLibrary.addSprite("but_play", "./sprites/but_play.png"); s_oSpriteLibrary.addSprite("but_continue", "./sprites/but_continue.png"); s_oSpriteLibrary.addSprite("but_generic_small", "./sprites/but_generic_small.png"); s_oSpriteLibrary.addSprite("but_exit", "./sprites/but_exit.png"); s_oSpriteLibrary.addSprite("bg_menu", "./sprites/bg_menu.jpg"); s_oSpriteLibrary.addSprite("audio_icon", "./sprites/audio_icon.png"); s_oSpriteLibrary.addSprite("msg_box", "./sprites/msg_box.png"); s_oSpriteLibrary.addSprite("but_level", "./sprites/but_level.png"); s_oSpriteLibrary.addSprite("bg_menu_level", "./sprites/bg_menu_level.jpg"); s_oSpriteLibrary.addSprite("arrow_left", "./sprites/arrow_left.png"); s_oSpriteLibrary.addSprite("arrow_right", "./sprites/arrow_right.png"); s_oSpriteLibrary.addSprite("logo_ctl", "./sprites/logo_ctl.png"); s_oSpriteLibrary.addSprite("but_credits", "./sprites/but_credits.png"); s_oSpriteLibrary.addSprite("but_exit_small", "./sprites/but_exit_small.png"); s_oSpriteLibrary.addSprite("but_fullscreen", "./sprites/but_fullscreen.png"); s_oSpriteLibrary.addSprite("tiles", "./sprites/tiles.png"); s_oSpriteLibrary.addSprite("selection", "./sprites/selection.png"); s_oSpriteLibrary.addSprite("bg_game", "./sprites/bg_game.jpg"); s_oSpriteLibrary.addSprite("but_yes", "./sprites/but_yes.png"); s_oSpriteLibrary.addSprite("but_no", "./sprites/but_no.png"); s_oSpriteLibrary.addSprite("panel_bg", "./sprites/panel_bg.png"); s_oSpriteLibrary.addSprite("but_restart", "./sprites/but_restart.png"); s_oSpriteLibrary.addSprite("but_shuffle", "./sprites/but_shuffle.png"); s_oSpriteLibrary.addSprite("but_hint", "./sprites/but_hint.png"); for (var b = s_oLevelSettings.getLayoutNames(), l = 0; l < b.length; l++) s_oSpriteLibrary.addSprite("but_level_" + l, "./sprites/but_level_" + b[l] + ".png"); f += s_oSpriteLibrary.getNumSprites(); s_oSpriteLibrary.loadSprites() }; this._onImagesLoaded = function() { c++; g.refreshLoader(Math.floor(c / f * 100)) }; this._onAllImagesLoaded = function() {}; this._allResourcesLoaded = function() { g.unload(); try { saveItem("ls_available", "ok") } catch (b) { s_bStorageAvailable = !1 } s_oMain.gotoMenu() }; this.onLoadedJSON = function(b) { s_oLevelSettings = new CLevelSettings(b); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || s_oMain._initSounds(); s_oMain._loadImages() }; this.stopUpdate = function() { d = !1; createjs.Ticker.paused = !0; $("#block_game").css("display", "block"); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || Howler.mute(!0) }; this.startUpdate = function() { s_iPrevTime = (new Date).getTime(); d = !0; createjs.Ticker.paused = !1; $("#block_game").css("display", "none"); (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) && s_bAudioActive && Howler.mute(!1) }; this.gotoMenu = function() { new CMenu; q = STATE_MENU }; this.gotoLevelMenu = function() { new CLevelMenu }; this.gotoGame = function(b, l) { k = new CGame(b, l); q = STATE_GAME }; this.gotoHelp = function() { new CHelp; q = STATE_HELP }; this.levelSelected = function(b, l) { this.gotoGame(b, l) }; this._update = function(b) { if (!1 !== d) { var l = (new Date).getTime(); s_iTimeElaps = l - s_iPrevTime; s_iCntTime += s_iTimeElaps; s_iCntFps++; s_iPrevTime = l; 1E3 <= s_iCntTime && (s_iCurFps = s_iCntFps, s_iCntTime -= 1E3, s_iCntFps = 0); q === STATE_GAME && k.update(); void 0 !== s_oStage && s_oStage.update(b) } }; s_oMain = this; BONUS_TIME = a.bonus_time; HINT_PENALTY = a.hint_penalty; ENABLE_FULLSCREEN = a.fullscreen; ENABLE_CHECK_ORIENTATION = a.check_orientation; s_bAudioActive = a.audio_enable_on_startup; this.initContainer() } var s_bMobile, s_bAudioActive = !1, s_iCntTime = 0, s_iTimeElaps = 0, s_iPrevTime = 0, s_iCntFps = 0, s_iCurFps = 0, s_oSoundTrack = null, s_oStage, s_oMain = null, s_oSpriteLibrary, s_oLevelSettings, s_bFullscreen = !1, s_bStorageAvailable = !0, s_aSounds, s_aSoundsInfo; function CTextButton(a, d, c, f, q, g, k, b) { var l, p, B, v, r, y, C, A, I, G; this._init = function(e, w, E, u, t, m, n) { l = !1; p = 1; B = []; v = []; G = createBitmap(E); A = new createjs.Container; A.x = e; A.y = w; A.regX = E.width / 2; A.regY = E.height / 2; s_bMobile || (A.cursor = "pointer"); A.addChild(G, I); b.addChild(A); I = new CTLText(A, 20, 0, E.width - 40, E.height + 2, n, "center", m, t, 1, 2, 2, u, !0, !0, !1, !1); this._initListener() }; this.unload = function() { A.off("mousedown", r); A.off("pressup", y); b.removeChild(A) }; this.setVisible = function(e) { A.visible = e }; this.setAlign = function(e) { I.textAlign = e }; this.setTextX = function(e) { I.x = e }; this.setScale = function(e) { p = A.scaleX = A.scaleY = e }; this.enable = function() { l = !1 }; this.disable = function() { l = !0 }; this._initListener = function() { r = A.on("mousedown", this.buttonDown); y = A.on("pressup", this.buttonRelease) }; this.addEventListener = function(e, w, E) { B[e] = w; v[e] = E }; this.addEventListenerWithParams = function(e, w, E, u) { B[e] = w; v[e] = E; C = u }; this.buttonRelease = function() { l || (playSound("click", 1, !1), A.scaleX = p, A.scaleY = p, B[ON_MOUSE_UP] && B[ON_MOUSE_UP].call(v[ON_MOUSE_UP], C)) }; this.buttonDown = function() { l || (A.scaleX = .9 * p, A.scaleY = .9 * p, B[ON_MOUSE_DOWN] && B[ON_MOUSE_DOWN].call(v[ON_MOUSE_DOWN])) }; this.setPosition = function(e, w) { A.x = e; A.y = w }; this.tweenPosition = function(e, w, E, u, t, m, n) { createjs.Tween.get(A).wait(u).to({ x: e, y: w }, E, t).call(function() { void 0 !== m && m.call(n) }) }; this.changeText = function(e) { I.refreshText(e) }; this.setX = function(e) { A.x = e }; this.setY = function(e) { A.y = e }; this.getButtonImage = function() { return A }; this.getX = function() { return A.x }; this.getY = function() { return A.y }; this.getSprite = function() { return A }; this.getScale = function() { return A.scaleX }; this._init(a, d, c, f, q, g, k) } function CGfxButton(a, d, c, f) { var q, g, k = [], b, l, p; this._init = function(v, r, y) { q = []; g = []; b = createBitmap(y); b.x = v; b.y = r; b.regX = y.width / 2; b.regY = y.height / 2; b.cursor = "pointer"; B.addChild(b); this._initListener() }; this.unload = function() { b.off("mousedown", l); b.off("pressup", p); B.removeChild(b) }; this.setVisible = function(v) { b.visible = v }; this._initListener = function() { l = b.on("mousedown", this.buttonDown); p = b.on("pressup", this.buttonRelease) }; this.addEventListener = function(v, r, y) { q[v] = r; g[v] = y }; this.addEventListenerWithParams = function(v, r, y, C) { q[v] = r; g[v] = y; k = C }; this.buttonRelease = function() { playSound("click", 1, !1); b.scaleX = 1; b.scaleY = 1; q[ON_MOUSE_UP] && q[ON_MOUSE_UP].call(g[ON_MOUSE_UP], k) }; this.buttonDown = function() { b.scaleX = .9; b.scaleY = .9; q[ON_MOUSE_DOWN] && q[ON_MOUSE_DOWN].call(g[ON_MOUSE_DOWN], k) }; this.setPosition = function(v, r) { b.x = v; b.y = r }; this.setX = function(v) { b.x = v }; this.setY = function(v) { b.y = v }; this.getButtonImage = function() { return b }; this.getX = function() { return b.x }; this.getY = function() { return b.y }; var B = f; this._init(a, d, c); return this } function CToggle(a, d, c, f, q) { var g, k, b, l, p, B; this._init = function(v, r, y, C) { k = []; b = []; var A = new createjs.SpriteSheet({ images: [y], frames: { width: y.width / 2, height: y.height, regX: y.width / 2 / 2, regY: y.height / 2 }, animations: { state_true: [0], state_false: [1] } }); g = C; l = createSprite(A, "state_" + g, y.width / 2 / 2, y.height / 2, y.width / 2, y.height); l.x = v; l.y = r; l.stop(); l.cursor = "pointer"; q.addChild(l); this._initListener() }; this.unload = function() { l.off("mousedown", p); l.off("pressup", B); q.removeChild(l) }; this._initListener = function() { p = l.on("mousedown", this.buttonDown); B = l.on("pressup", this.buttonRelease) }; this.addEventListener = function(v, r, y) { k[v] = r; b[v] = y }; this.setActive = function(v) { g = v; l.gotoAndStop("state_" + g) }; this.buttonRelease = function() { l.scaleX = 1; l.scaleY = 1; playSound("click", 1, !1); g = !g; l.gotoAndStop("state_" + g); k[ON_MOUSE_UP] && k[ON_MOUSE_UP].call(b[ON_MOUSE_UP], g) }; this.buttonDown = function() { l.scaleX = .9; l.scaleY = .9; k[ON_MOUSE_DOWN] && k[ON_MOUSE_DOWN].call(b[ON_MOUSE_DOWN]) }; this.setPosition = function(v, r) { l.x = v; l.y = r }; this._init(a, d, c, f) } function CMenu() { var a, d, c, f, q, g, k, b, l, p, B, v, r = null, y = null; this._init = function() { k = createBitmap(s_oSpriteLibrary.getSprite("bg_menu")); s_oStage.addChild(k); b = new CGfxButton(CANVAS_WIDTH / 2, CANVAS_HEIGHT - 120, s_oSpriteLibrary.getSprite("but_play"), s_oStage); b.addEventListener(ON_MOUSE_UP, this._onButPlayRelease, this); if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) { var C = s_oSpriteLibrary.getSprite("audio_icon"); q = CANVAS_WIDTH - C.width / 4 - 10; g = C.height / 2 + 10; l = new CToggle(q, g, C, s_bAudioActive, s_oStage); l.addEventListener(ON_MOUSE_UP, this._onAudioToggle, this) } C = s_oSpriteLibrary.getSprite("but_credits"); c = C.height / 2 + 10; f = C.height / 2 + 10; p = new CGfxButton(c, f, C, s_oStage); p.addEventListener(ON_MOUSE_UP, this._onButCreditsRelease, this); C = window.document; var A = C.documentElement; r = A.requestFullscreen || A.mozRequestFullScreen || A.webkitRequestFullScreen || A.msRequestFullscreen; y = C.exitFullscreen || C.mozCancelFullScreen || C.webkitExitFullscreen || C.msExitFullscreen; !1 === ENABLE_FULLSCREEN && (r = !1); r && screenfull.isEnabled && (C = s_oSpriteLibrary.getSprite("but_fullscreen"), a = c + C.width / 2, d = f, v = new CToggle(a, d, C, s_bFullscreen, s_oStage), v.addEventListener(ON_MOUSE_UP, this._onFullscreenRelease, this)); B = new createjs.Shape; B.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); s_oStage.addChild(B); s_bStorageAvailable || new CAlertSavingBox(TEXT_ERR_LS, s_oStage); createjs.Tween.get(B).to({ alpha: 0 }, 400).call(function() { B.visible = !1 }); this.refreshButtonPos(s_iOffsetX, s_iOffsetY) }; this.unload = function() { b.unload(); b = null; p.unload(); if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) l.unload(), l = null; r && screenfull.isEnabled && v.unload(); s_oStage.removeChild(k); k = null; s_oStage.removeChild(B); s_oMenu = B = null }; this.refreshButtonPos = function(C, A) { !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || l.setPosition(q - C, A + g); r && screenfull.isEnabled && v.setPosition(a + C, d + A); p.setPosition(c + C, f + A) }; this._exitFromMenu = function() { this.unload(); s_oMain.gotoLevelMenu(); $(s_oMain).trigger("start_session") }; this._onButPlayRelease = function() { s_oMenu._exitFromMenu() }; this._onButCreditsRelease = function() { new CCreditsPanel }; this._onAudioToggle = function() { Howler.mute(s_bAudioActive); s_bAudioActive = !s_bAudioActive }; this.resetFullscreenBut = function() { r && screenfull.isEnabled && v.setActive(s_bFullscreen) }; this._onFullscreenRelease = function() { s_bFullscreen ? y.call(window.document) : r.call(window.document.documentElement); sizeHandler() }; s_oMenu = this; this._init() } var s_oMenu = null; function CGame(a, d) { var c = !1, f, q, g, k, b, l, p, B, v, r = [], y, C, A, I, G, e, w, E, u, t; this._init = function(m, n) { q = m; v = n; var D = createBitmap(s_oSpriteLibrary.getSprite("bg_game")); s_oStage.addChild(D); this.createLayout(); u = new CInterface(0); this._setTiles(); this.refreshButtonPos(s_iOffsetX, s_iOffsetY) }; this.unload = function() { c = !1; u.unload(); s_oStage.removeAllChildren(); s_oGame = null }; this.reset = function() { p = f = 0; b = BONUS_TIME; l = r.length; k = 2; E = w = e = G = null; this._storeSelectableTiles(); u.reset(); $(s_oMain).trigger("start_level", d); c = !0 }; this.refreshButtonPos = function(m, n) { t.x = A.x + m; u.refreshButtonPos(m, n) }; this.stopUpdate = function() { c = !1 }; this.startUpdate = function() { c = !0 }; this.createLayout = function() { I = s_oLevelSettings.getLayoutInfos(q); A = I.layout_pos; var m = I.pos, n = I.blocks, D = I.block_list, H = I.heights; g = SCORE_BONUS_LAYOUT[I.difficulty]; t = new createjs.Container; t.x = A.x; t.y = A.y; t.scaleX = t.scaleY = B = I.layout_scale; s_oStage.addChild(t); for (var J = 0; J < m.length; J++) { var R = new CTile(J, m[J].x, m[J].y, n[J].left_block, n[J].right_block, n[J].up_block, D[J], H[J], t); r[J] = R } }; this._setTiles = function() { do { for (var m = s_oLevelSettings.getShuffledTiles(), n = 0; n < r.length; n++) r[n].setValue(m[n]); this.reset() } while (0 === C.length); u.setHintNum(C.length) }; this._unloadAllTiles = function() { for (var m = 0; m < r.length; m++) r[m].unload() }; this._storeSelectableTiles = function() { y = []; for (var m = 0; m < r.length; m++) r[m].isSelectable() && y.push(r[m]); C = []; for (m = 0; m < y.length;) { for (var n = y[m], D = m + 1; D < y.length; D++) n.getValue() === y[D].getValue() && C.push({ first: n, second: y[D] }); m++ } }; this.onShuffleBoard = function() { w && w.deselect(); E && E.deselect(); var m = s_oLevelSettings.getLayoutInfos(q), n = m.blocks; m = m.block_list; for (var D = 0; D < r.length; D++) r[D].initBlocksArray(n[D].left_block, n[D].right_block, n[D].up_block, m[D]); this._setTiles(); u.setHintNum(C.length) }; this.onRestartBoard = function() { w && w.deselect(); E && E.deselect(); var m = s_oLevelSettings.getLayoutInfos(q), n = m.blocks; m = m.block_list; for (var D = 0; D < r.length; D++) r[D].initBlocksArray(n[D].left_block, n[D].right_block, n[D].up_block, m[D]); this.reset(); u.setHintNum(C.length); $(s_oMain).trigger("restart_level", v) }; this.onHintReleased = function() { 0 !== C.length && (w && w.deselect(), E && E.deselect(), w = C[p].first, E = C[p].second, w.showHint(), E.showHint(), p++, p === C.length && (p = 0), b = 0, f -= HINT_PENALTY, 0 > f && (f = 0), u.setScore(f)) }; this.removeHint = function() { null !== w && null !== E && (this._checkForSimilarBlock(w), w.disable(), this._checkForSimilarBlock(E), E.disable(), playSound("matching", 1, !1), E = w = null, p = 0) }; this.onTileRemoved = function(m) { l--; k--; 0 === k && (this._storeSelectableTiles(), u.setHintNum(C.length), 0 === l ? this._win() : 0 === C.length && this._gameOver(), k = 2) }; this.onTileSelected = function(m) { null !== w && (w.deselect(), w = null); null !== E && (E.deselect(), E = null); null === G ? G = r[m] : (e = r[m], this._checkTileMatching()) }; this.onTileDeselected = function() { G = null }; this._checkTileMatching = function() { G.getValue() === e.getValue() ? (this._checkForSimilarBlock(G), G.remove(), this._checkForSimilarBlock(e), e.remove(), p = 0, this._calculateScore(), playSound("matching", 1, !1)) : (G.deselect(), e.deselect()); e = G = null }; this._checkForSimilarBlock = function(m) { for (var n = m.getBlockList(), D = 0; D < n.length; D++) r[n[D].tile].removeBlock(m.getIndex()) }; this._calculateScore = function() { var m = Math.floor(b / 100); 0 < m && u.showBonusScore(t.x + e.getX() * B, t.y + e.getY() * B, m); f += g * m; u.setScore(f); b = BONUS_TIME }; this._gameOver = function() { c = !1; var m = getItem("md_best_score_" + q); (null === m || m < f) && saveItem("md_best_score_" + q, f); u.gameOver(f); playSound("game_over", 1, !1); $(s_oMain).trigger("end_level", v) }; this._win = function() { c = !1; var m = getItem("md_best_score_" + q); if (null === m || m < f) saveItem("md_best_score_" + q, f), m = f; u.win(f, m); playSound("win", 1, !1); $(s_oMain).trigger("end_level", v) }; this.onExit = function() { this.unload(); s_oMain.gotoMenu(); $(s_oMain).trigger("end_session") }; this.update = function() { !1 !== c && (b -= s_iTimeElaps, 0 > b && (b = 0), u.refreshTime(b)) }; s_oGame = this; this._init(a, d) } var s_oGame = null; function CInterface(a) { var d, c, f, q, g, k, b, l, p, B, v, r, y, C, A, I, G, e, w, E, u, t, m, n, D, H, J, R = null, O = null; this._init = function(x) { y = 10; C = 5; e = new createjs.Text(TEXT_SCORE + " " + x, "22px " + FONT_GAME, "#d7d5d2"); e.x = y; e.y = C; e.textAlign = "left"; s_oStage.addChild(e); v = 200; r = 5; G = new createjs.Text(TEXT_BONUS_TIME + ":0", "22px " + FONT_GAME, "#d7d5d2"); G.x = v; G.y = r; G.textAlign = "left"; s_oStage.addChild(G); x = s_oSpriteLibrary.getSprite("but_exit"); f = CANVAS_WIDTH - x.width / 2; q = x.height / 2 + 4; w = new CGfxButton(f, q, x, s_oStage); w.addEventListener(ON_MOUSE_UP, this._onExit, this); !1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile ? (A = f - x.width, I = x.height / 2 + 4, x = s_oSpriteLibrary.getSprite("audio_icon"), H = new CToggle(A, I, x, s_bAudioActive, s_oStage), H.addEventListener(ON_MOUSE_UP, this._onAudioToggle, this), p = A - x.width / 2, B = I) : (p = w.getX() - x.width, B = x.height / 2 + 4); x = window.document; var P = x.documentElement; R = P.requestFullscreen || P.mozRequestFullScreen || P.webkitRequestFullScreen || P.msRequestFullscreen; O = x.exitFullscreen || x.mozCancelFullScreen || x.webkitExitFullscreen || x.msExitFullscreen; !1 === ENABLE_FULLSCREEN && (R = !1); R && screenfull.isEnabled && (x = s_oSpriteLibrary.getSprite("but_fullscreen"), J = new CToggle(p, B, x, s_bFullscreen, s_oStage), J.addEventListener(ON_MOUSE_UP, this._onFullscreenRelease, this)); x = s_oSpriteLibrary.getSprite("but_shuffle"); g = CANVAS_WIDTH - x.width / 2 - 10; k = CANVAS_HEIGHT - x.height / 2; t = new CGfxButton(g, k, x, s_oStage); t.addEventListener(ON_MOUSE_UP, this._onShuffle, this); x = s_oSpriteLibrary.getSprite("but_restart"); d = CANVAS_WIDTH - x.width / 2 - 10; c = k - x.height; u = new CGfxButton(d, c, x, s_oStage); u.addEventListener(ON_MOUSE_UP, this._onRestart, this); x = s_oSpriteLibrary.getSprite("but_hint"); b = CANVAS_WIDTH - x.width / 2 - 10; l = c - x.height; E = new CButHint(b, l, x, "0", FONT_GAME, "#d7d5d2", 28, s_oStage); E.addEventListener(ON_MOUSE_UP, this._onHint, this); m = new CAreYouSurePanel(s_oStage); m.addEventListener(ON_RELEASE_NO, this._onReleaseNoMsgBox, this); m.addEventListener(ON_RELEASE_YES, this._onReleaseYesMsgBox, this); n = new CWinPanel; D = new CGameOverPanel }; this.unload = function() { w.unload(); w = null; !1 === DISABLE_SOUND_MOBILE && (H.unload(), H = null); R && screenfull.isEnabled && J.unload(); n.unload(); D.unload(); m.unload(); s_oInterface = null }; this.refreshButtonPos = function(x, P) { e.x = y + x; e.y = C + P; G.x = v + x; G.y = r + P; E.setPosition(b - x, l - P); u.setPosition(d - x, c - P); t.setPosition(g - x, k - P); w.setPosition(f - x, q + P); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || H.setPosition(A - x, P + I); R && screenfull.isEnabled && J.setPosition(p - x, B + P) }; this.reset = function() { e.text = TEXT_SCORE + " 0" }; this.refreshTime = function(x) { G.text = TEXT_BONUS_TIME + " " + x }; this.setScore = function(x) { e.text = TEXT_SCORE + " " + x }; this.setHintNum = function(x) { E.setText(x) }; this.showBonusScore = function(x, P, T) { new CScoreText(x, P, T) }; this.gameOver = function(x) { D.show(x) }; this.win = function(x, P) { n.show(x, P) }; this.refreshScore = function(x) { e.text = TEXT_SCORE + " " + x }; this._onReleaseYesMsgBox = function(x) { switch (x) { case ALERT_FROM_EXIT: s_oGame.onExit(); break; case ALERT_FROM_RESTART: m.hide(); s_oGame.onRestartBoard(); break; case ALERT_FROM_SHUFFLE: m.hide(), s_oGame.onShuffleBoard() } }; this._onReleaseNoMsgBox = function() { s_oGame.startUpdate() }; this._onShuffle = function() { s_oGame.stopUpdate(); m.show(TEXT_ALERT_SHUFFLE, ALERT_FROM_SHUFFLE) }; this._onRestart = function() { s_oGame.stopUpdate(); m.show(TEXT_ALERT_RESTART, ALERT_FROM_RESTART) }; this._onHint = function() { s_oGame.onHintReleased() }; this._onExit = function() { s_oGame.stopUpdate(); m.show(TEXT_ALERT_EXIT, ALERT_FROM_EXIT) }; this._onAudioToggle = function() { Howler.mute(s_bAudioActive); s_bAudioActive = !s_bAudioActive }; this.resetFullscreenBut = function() { R && screenfull.isEnabled && J.setActive(s_bFullscreen) }; this._onFullscreenRelease = function() { s_bFullscreen ? O.call(window.document) : R.call(window.document.documentElement); sizeHandler() }; s_oInterface = this; this._init(a); return this } var s_oInterface = null; function CWinPanel() { var a, d, c, f, q, g; this.init = function() { g = new createjs.Container; q = g.on("click", function() {}); g.visible = !1; s_oStage.addChild(g); var k = s_oSpriteLibrary.getSprite("msg_box"); k = createBitmap(k); g.addChild(k); k = 430; var b = 60, l = CANVAS_WIDTH / 2, p = CANVAS_HEIGHT / 2 - 80; (new CTLText(g, l - k / 2, p - b / 2, k, b, 50, "center", "#000", FONT_GAME, 1, 2, 2, TEXT_CONGRATS, !0, !0, !0, !1)).setOutline(2); new CTLText(g, l - k / 2, p - b / 2, k, b, 50, "center", "#d7d5d2", FONT_GAME, 1, 2, 2, TEXT_CONGRATS, !0, !0, !0, !1); k = 430; b = 50; l = CANVAS_WIDTH / 2; p = CANVAS_HEIGHT / 2; a = new CTLText(g, l - k / 2, p - b / 2, k, b, 40, "center", "#fff", FONT_GAME, 1, 2, 2, TEXT_FINAL_SCORE, !0, !0, !0, !1); l = CANVAS_WIDTH / 2; p = CANVAS_HEIGHT / 2 + 40; d = new CTLText(g, l - k / 2, p - b / 2, k, b, 40, "center", "#fff", FONT_GAME, 1, 2, 2, TEXT_BEST_SCORE, !0, !0, !0, !1); c = new CTextButton(CANVAS_WIDTH / 2 - 140, CANVAS_HEIGHT / 2 + 100, s_oSpriteLibrary.getSprite("but_generic_small"), TEXT_EXIT, FONT_GAME, "#d7d5d2", 20, g); c.addEventListener(ON_MOUSE_UP, this._onExit, this); f = new CTextButton(CANVAS_WIDTH / 2 + 140, CANVAS_HEIGHT / 2 + 100, s_oSpriteLibrary.getSprite("but_generic_small"), TEXT_SHUFFLE, FONT_GAME, "#d7d5d2", 20, g); f.addEventListener(ON_MOUSE_UP, this._onShuffle, this) }; this.unload = function() { c.unload(); f.unload(); g.off("click", q) }; this.show = function(k, b) { a.refreshText(TEXT_FINAL_SCORE + ": " + k); d.refreshText(TEXT_BEST_SCORE + ": " + b); g.alpha = 0; g.visible = !0; createjs.Tween.get(g).to({ alpha: 1 }, 500, createjs.Ease.cubicOut).call(function() { $(s_oMain).trigger("show_interlevel_ad") }); $(s_oMain).trigger("save_score", k); $(s_oMain).trigger("share_event", k) }; this._onShuffle = function() { createjs.Tween.get(g).to({ alpha: 0 }, 500, createjs.Ease.cubicOut).call(function() { g.visible = !1; s_oGame.onShuffleBoard() }) }; this._onExit = function() { createjs.Tween.get(g).to({ alpha: 0 }, 500, createjs.Ease.cubicOut).call(function() { g.visible = !1; s_oMain.gotoMenu() }) }; this.init() } function CGameOverPanel() { var a, d, c, f, q, g; this.init = function() { g = new createjs.Container; q = g.on("click", function() {}); g.visible = !1; s_oStage.addChild(g); var k = s_oSpriteLibrary.getSprite("msg_box"); k = createBitmap(k); g.addChild(k); k = 430; var b = 50, l = CANVAS_WIDTH / 2, p = CANVAS_HEIGHT / 2 - 100; (new CTLText(g, l - k / 2, p - b / 2, k, b, 40, "center", "#000", FONT_GAME, 1, 2, 2, TEXT_NO_TILES, !0, !0, !0, !1)).setOutline(2); new CTLText(g, l - k / 2, p - b / 2, k, b, 40, "center", "#d7d5d2", FONT_GAME, 1, 2, 2, TEXT_NO_TILES, !0, !0, !0, !1); k = 430; b = 30; l = CANVAS_WIDTH / 2; p = CANVAS_HEIGHT / 2 - 60; a = new CTLText(g, l - k / 2, p - b / 2, k, b, 30, "center", "#d7d5d2", FONT_GAME, 1, 2, 2, TEXT_NO_TILES, !0, !0, !0, !1); k = s_oSpriteLibrary.getSprite("but_generic_small"); c = new CTextButton(CANVAS_WIDTH / 2, CANVAS_HEIGHT / 2 + 100, k, TEXT_SHUFFLE, FONT_GAME, "#d7d5d2", 20, g); c.addEventListener(ON_MOUSE_UP, this._onShuffle, this); f = new CTextButton(CANVAS_WIDTH / 2, c.getY() - k.height, k, TEXT_RESTART, FONT_GAME, "#d7d5d2", 20, g); f.addEventListener(ON_MOUSE_UP, this._onRestart, this); d = new CTextButton(CANVAS_WIDTH / 2, f.getY() - k.height, k, TEXT_EXIT, FONT_GAME, "#d7d5d2", 20, g); d.addEventListener(ON_MOUSE_UP, this._onExit, this) }; this.unload = function() { d.unload(); c.unload(); f.unload(); g.off("click", q) }; this.show = function(k) { a.refreshText(TEXT_FINAL_SCORE + ": " + k); g.alpha = 0; g.visible = !0; createjs.Tween.get(g).to({ alpha: 1 }, 500, createjs.Ease.cubicOut).call(function() { $(s_oMain).trigger("show_interlevel_ad") }); $(s_oMain).trigger("save_score", k); $(s_oMain).trigger("share_event", k) }; this._onShuffle = function() { s_oGame.onShuffleBoard(); createjs.Tween.get(g).to({ alpha: 0 }, 500, createjs.Ease.cubicOut).call(function() { g.visible = !1 }) }; this._onExit = function() { g.visible = !1; s_oMain.gotoMenu() }; this._onRestart = function() { s_oGame.onRestartBoard(); createjs.Tween.get(g).to({ alpha: 0 }, 500, createjs.Ease.cubicOut).call(function() { g.visible = !1 }) }; this.init() } function CLevelSettings(a) { var d, c, f, q; this._init = function(g) { q = g; NUM_LEVELS = Object.keys(q).length; d = []; f = []; for (g = 0; g < NUM_LEVELS; g++) d[g] = q[g], f[g] = d[g].label; c = "circle1 circle1 circle1 circle1 circle2 circle2 circle2 circle2 circle3 circle3 circle3 circle3 circle4 circle4 circle4 circle4 circle5 circle5 circle5 circle5 circle6 circle6 circle6 circle6 circle7 circle7 circle7 circle7 circle8 circle8 circle8 circle8 circle9 circle9 circle9 circle9 bamboo1 bamboo1 bamboo1 bamboo1 bamboo2 bamboo2 bamboo2 bamboo2 bamboo3 bamboo3 bamboo3 bamboo3 bamboo4 bamboo4 bamboo4 bamboo4 bamboo5 bamboo5 bamboo5 bamboo5 bamboo6 bamboo6 bamboo6 bamboo6 bamboo7 bamboo7 bamboo7 bamboo7 bamboo8 bamboo8 bamboo8 bamboo8 bamboo9 bamboo9 bamboo9 bamboo9 characters1 characters1 characters1 characters1 characters2 characters2 characters2 characters2 characters3 characters3 characters3 characters3 characters4 characters4 characters4 characters4 characters5 characters5 characters5 characters5 characters6 characters6 characters6 characters6 characters7 characters7 characters7 characters7 characters8 characters8 characters8 characters8 characters9 characters9 characters9 characters9 wind1 wind1 wind1 wind1 wind2 wind2 wind2 wind2 wind3 wind3 wind3 wind3 wind4 wind4 wind4 wind4 dragon1 dragon1 dragon1 dragon1 dragon2 dragon2 dragon2 dragon2 dragon3 dragon3 dragon3 dragon3 flower1 flower2 flower3 flower4 season1 season2 season3 season4".split(" ") }; this.getLayoutInfos = function(g) { return d[g] }; this.getShuffledTiles = function() { return c = shuffle(c) }; this.getLayoutNames = function() { return f }; this._init(a) } function CLevelMenu() { var a, d, c, f, q, g, k, b, l, p, B, v, r, y, C, A = null, I = null, G, e, w, E, u = null, t = null; this._init = function() { l = 0; w = new createjs.Container; s_oStage.addChild(w); var m = createBitmap(s_oSpriteLibrary.getSprite("bg_menu_level")); w.addChild(m); m = s_oSpriteLibrary.getSprite("but_exit"); q = CANVAS_WIDTH - m.width / 2 - 10; g = m.height / 2 + 10; y = new CGfxButton(q, g, m, w); y.addEventListener(ON_MOUSE_UP, this._onExit, this); p = m.height; if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) c = y.getX() - m.width, f = m.height / 2 + 10, C = new CToggle(c, f, s_oSpriteLibrary.getSprite("audio_icon"), s_bAudioActive, s_oStage), C.addEventListener(ON_MOUSE_UP, this._onAudioToggle, this); m = window.document; var n = m.documentElement; u = n.requestFullscreen || n.mozRequestFullScreen || n.webkitRequestFullScreen || n.msRequestFullscreen; t = m.exitFullscreen || m.mozCancelFullScreen || m.webkitExitFullscreen || m.msExitFullscreen; !1 === ENABLE_FULLSCREEN && (u = !1); u && screenfull.isEnabled && (m = s_oSpriteLibrary.getSprite("but_fullscreen"), a = m.width / 4 + 9, d = m.height / 2 + 10, E = new CToggle(a, d, m, s_bFullscreen, s_oStage), E.addEventListener(ON_MOUSE_UP, this._onFullscreenRelease, this)); this._checkBoundLimits(); v = []; m = CANVAS_WIDTH - 2 * EDGEBOARD_X - 100; m = Math.floor(m / NUM_COLS_PAGE_LEVEL) / 2; for (var D = n = 0; D < NUM_COLS_PAGE_LEVEL; D++) v.push(n), n += 2 * m; r = []; this._createNewLevelPage(0, NUM_LEVELS); k = CANVAS_WIDTH / 2; b = r[0].y - r[0].getBounds().height / 2 - 60; m = 500; n = k; D = b; e = new CTLText(w, n - m / 2, D - 25, m, 50, 40, "center", "#000", FONT_GAME, 1, 2, 2, TEXT_SELECT_LEVEL.toUpperCase(), !0, !0, !0, !1); e.setOutline(2); G = new CTLText(w, n - m / 2, D - 25, m, 50, 40, "center", "#d7d5d2", FONT_GAME, 1, 2, 2, TEXT_SELECT_LEVEL.toUpperCase(), !0, !0, !0, !1); if (1 < r.length) { for (m = 1; m < r.length; m++) r[m].visible = !1; A = new CGfxButton(CANVAS_WIDTH / 2 + 320, CANVAS_HEIGHT / 2 + 30, s_oSpriteLibrary.getSprite("arrow_right"), w); A.addEventListener(ON_MOUSE_UP, this._onRight, this); I = new CGfxButton(CANVAS_WIDTH / 2 - 320, CANVAS_HEIGHT / 2 + 30, s_oSpriteLibrary.getSprite("arrow_left"), w); I.addEventListener(ON_MOUSE_UP, this._onLeft, this) } this.refreshButtonPos(s_iOffsetX, s_iOffsetY) }; this.unload = function() { for (var m = 0; m < B.length; m++) B[m].unload(); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || C.unload(); u && screenfull.isEnabled && E.unload(); y.unload(); null !== I && (I.unload(), A.unload()); for (m = 0; m < B.length; m++) B[m].unload(); s_oStage.removeChild(w); s_oLevelMenu = null }; this.refreshButtonPos = function(m, n) { e.setY(b + n); G.setY(b + n); y.setPosition(q - m, g + n); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || C.setPosition(c - m, n + f); u && screenfull.isEnabled && E.setPosition(a + m, d + n) }; this._checkBoundLimits = function() { for (var m = s_oSpriteLibrary.getSprite("but_level"), n = 0, D = CANVAS_HEIGHT - 2 * EDGEBOARD_Y - 2 * p, H = 0; n < D;) n += m.height + 20, H++; NUM_ROWS_PAGE_LEVEL > H && (NUM_ROWS_PAGE_LEVEL = H); D = n = 0; H = CANVAS_WIDTH - 2 * EDGEBOARD_X; for (m = s_oSpriteLibrary.getSprite("but_level"); D < H;) D += m.width / 2 + 5, n++; NUM_COLS_PAGE_LEVEL > n && (NUM_COLS_PAGE_LEVEL = n) }; this._createNewLevelPage = function(m, n) { var D = new createjs.Container; w.addChild(D); r.push(D); B = []; for (var H = 0, J = 0, R = 1, O = !1, x = m; x < n; x++) { var P = s_oLevelSettings.getLayoutInfos(x), T = s_oSpriteLibrary.getSprite("but_level_" + x), N = new CButLevel(v[H] + T.width / 2, J + T.height / 2, T, P.name, P.difficulty, FONT_GAME, "#d7d5d2", 20, D); N.addEventListenerWithParams(ON_MOUSE_UP, this._onButLevelRelease, this, [x, P.name]); B.push(N); H++; if (H === v.length && x < n - 1 && (H = 0, J += T.height + 20, R++, R > NUM_ROWS_PAGE_LEVEL)) { O = !0; break } } D.x = CANVAS_WIDTH / 2; D.y = CANVAS_HEIGHT / 2 + 30; D.regX = D.getBounds().width / 2; D.regY = D.getBounds().height / 2; O && this._createNewLevelPage(x + 1, n) }; this._onRight = function() { r[l].visible = !1; l++; l >= r.length && (l = 0); r[l].visible = !0 }; this._onLeft = function() { r[l].visible = !1; l--; 0 > l && (l = r.length - 1); r[l].visible = !0 }; this._onButLevelRelease = function(m) { s_oLevelMenu.unload(); s_oMain.levelSelected(m[0], m[1]) }; this._onAudioToggle = function() { Howler.mute(s_bAudioActive); s_bAudioActive = !s_bAudioActive }; this.resetFullscreenBut = function() { u && screenfull.isEnabled && E.setActive(s_bFullscreen) }; this._onFullscreenRelease = function() { s_bFullscreen ? t.call(window.document) : u.call(window.document.documentElement); sizeHandler() }; this._onExit = function() { s_oLevelMenu.unload(); s_oMain.gotoMenu() }; s_oLevelMenu = this; this._init() } var s_oLevelMenu = null; function CButLevel(a, d, c, f, q, g, k, b, l) { var p, B, v, r, y, C, A, I, G, e, w, E; this._init = function(t, m, n, D, H, J, R, O) { p = !1; r = []; y = []; G = new createjs.Container; G.x = t; G.y = m; G.regX = n.width / 2; G.regY = n.height / 2; G.cursor = "pointer"; u.addChild(G); e = createBitmap(n); G.addChild(e); B = n.width; v = n.height; t = n.width / 2; E = new CTLText(G, t - 65, 9, 130, 26, O, "center", R, J, 1, 2, 2, H.toUpperCase(), !0, !0, !0, !1); E.setShadow("#000000", 2, 2, 4); w = new CTLText(G, t - 65, v - 18 - 13, 130, 26, O, "center", R, J, 1, 2, 2, D.toUpperCase(), !0, !0, !0, !1); w.setShadow("#000000", 2, 2, 4); this._initListener() }; this.unload = function() { G.off("mousedown", A); G.off("pressup", I); u.removeChild(G) }; this.setVisible = function(t) { G.visible = t }; this.enable = function() { p = !1; e.filters = []; e.cache(0, 0, B, v) }; this.disable = function() { p = !0; var t = (new createjs.ColorMatrix).adjustSaturation(-100); e.filters = [new createjs.ColorMatrixFilter(t)]; e.cache(0, 0, B, v) }; this._initListener = function() { A = G.on("mousedown", this.buttonDown); I = G.on("pressup", this.buttonRelease) }; this.addEventListener = function(t, m, n) { r[t] = m; y[t] = n }; this.addEventListenerWithParams = function(t, m, n, D) { r[t] = m; y[t] = n; C = D }; this.buttonRelease = function() { p || (playSound("click", 1, !1), G.scaleX = 1, G.scaleY = 1, r[ON_MOUSE_UP] && r[ON_MOUSE_UP].call(y[ON_MOUSE_UP], C)) }; this.buttonDown = function() { p || (G.scaleX = .9, G.scaleY = .9, r[ON_MOUSE_DOWN] && r[ON_MOUSE_DOWN].call(y[ON_MOUSE_DOWN], C)) }; this.setPosition = function(t, m) { G.x = t; G.y = m }; this.changeText = function(t) { w.refreshText(t) }; this.setX = function(t) { G.x = t }; this.setY = function(t) { G.y = t }; this.getButtonImage = function() { return G }; this.getX = function() { return G.x }; this.getY = function() { return G.y }; var u = l; this._init(a, d, c, f, q, g, k, b, l); return this } function CCreditsPanel() { var a, d, c, f, q, g, k; this._init = function() { k = new createjs.Container; k.alpha = 0; s_oStage.addChild(k); var b = new createjs.Shape; b.graphics.beginFill("rgba(0,0,0,0.7)").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); k.addChild(b); a = createBitmap(s_oSpriteLibrary.getSprite("msg_box")); k.addChild(a); q = new createjs.Shape; q.graphics.beginFill("#0f0f0f").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); q.alpha = .01; g = q.on("click", this._onLogoButRelease); k.addChild(q); b = s_oSpriteLibrary.getSprite("but_exit_small"); c = new CGfxButton(684, 174, b, k); c.addEventListener(ON_MOUSE_UP, this.unload, this); b = 430; var l = 30, p = CANVAS_WIDTH / 2, B = 226; f = new CTLText(k, p - b / 2, B - l / 2, b, l, 28, "center", "#000", FONT_GAME, 1, 2, 2, TEXT_CREDITS_DEVELOPED, !0, !0, !0, !1); f.setOutline(2); new CTLText(k, p - b / 2, B - l / 2, b, l, 28, "center", "#d7d5d2", FONT_GAME, 1, 2, 2, TEXT_CREDITS_DEVELOPED, !0, !0, !0, !1); b = s_oSpriteLibrary.getSprite("logo_ctl"); d = createBitmap(b); d.regX = b.width / 2; d.regY = b.height / 2; d.x = CANVAS_WIDTH / 2; d.y = CANVAS_HEIGHT / 2; k.addChild(d); b = 430; l = 30; p = CANVAS_WIDTH / 2; B = 384; f = new CTLText(k, p - b / 2, B - l / 2, b, l, 20, "center", "#000", FONT_GAME, 1, 2, 2, "www.codethislab.com", !0, !0, !0, !1); f.setOutline(2); new CTLText(k, p - b / 2, B - l / 2, b, l, 20, "center", "#d7d5d2", FONT_GAME, 1, 2, 2, "www.codethislab.com", !0, !0, !0, !1); createjs.Tween.get(k).to({ alpha: 1 }, 600, createjs.Ease.cubicOut); this.refreshButtonPos(s_iOffsetX, s_iOffsetY) }; this.refreshButtonPos = function(b, l) {}; this.unload = function() { q.off("click", g); c.unload(); c = null; s_oStage.removeChild(k) }; this._onLogoButRelease = function() { window.open("http://www.codethislab.com/index.php?&l=en", "_blank") }; this._init() } function CAlertSavingBox(a, d) { var c, f; this._init = function(k) { f = new createjs.Container; g.addChild(f); var b = new createjs.Shape; b.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); b.alpha = .5; b.on("click", function() {}); f.addChild(b); b = s_oSpriteLibrary.getSprite("msg_box"); var l = createBitmap(b); l.x = .5 * CANVAS_WIDTH; l.y = .5 * CANVAS_HEIGHT; l.regX = .5 * b.width; l.regY = .5 * b.height; f.addChild(l); b = CANVAS_WIDTH / 2; (new CTLText(f, b - 175, 160, 350, 220, 28, "center", "#000000", FONT_GAME, 1, 2, 2, k, !0, !0, !0, !1)).setOutline(2); new CTLText(f, b - 175, 160, 350, 220, 28, "center", "#d7d5d2", FONT_GAME, 1, 2, 2, k, !0, !0, !0, !1); c = new CGfxButton(CANVAS_WIDTH / 2 + 206, 174, s_oSpriteLibrary.getSprite("but_exit_small"), f); c.addEventListener(ON_MOUSE_UP, this._onButOk, this) }; this._onButOk = function() { q.unload() }; this.unload = function() { c.unload(); g.removeChild(f) }; var q = this; var g = d; this._init(a) } function CTile(a, d, c, f, q, g, k, b, l) { var p, B, v, r, y, C, A, I, G, e, w, E, u, t, m, n, D, H; this._init = function(O, x, P, T, N, Y, h, Z) { y = O; I = Z; H = new createjs.Container; H.x = x; H.y = P; R.addChild(H); O = { images: [s_oSpriteLibrary.getSprite("tiles")], frames: { width: TILE_WIDTH, height: TILE_HEIGHT, regX: TILE_WIDTH / 2, regY: TILE_HEIGHT / 2 }, animations: { bamboo1: [0, 0], bamboo2: [1, 1], bamboo3: [2, 2], bamboo4: [3, 3], bamboo5: [4, 4], bamboo6: [5, 5], bamboo7: [6, 6], bamboo8: [7, 7], bamboo9: [8, 8], characters1: [9, 9], characters2: [10, 10], characters3: [11, 11], characters4: [12, 12 ], characters5: [13, 13], characters6: [14, 14], characters7: [15, 15], characters8: [16, 16], characters9: [17, 17], circle1: [18, 18], circle2: [19, 19], circle3: [20, 20], circle4: [21, 21], circle5: [22, 22], circle6: [23, 23], circle7: [24, 24], circle8: [25, 25], circle9: [26, 26], dragon1: [27, 27], dragon2: [28, 28], dragon3: [29, 29], flower1: [30, 30], flower2: [31, 31], flower3: [32, 32], flower4: [33, 33], season1: [34, 34], season2: [35, 35], season3: [36, 36], season4: [37, 37], wind1: [38, 38], wind2: [39, 39], wind3: [40, 40], wind4: [41, 41] } }; O = new createjs.SpriteSheet(O); n = createSprite(O, "bamboo1", TILE_WIDTH / 2, TILE_HEIGHT / 2, TILE_WIDTH, TILE_HEIGHT); H.addChild(n); O = s_oSpriteLibrary.getSprite("selection"); D = createBitmap(O); D.x = -TILE_WIDTH / 2; D.y = -TILE_HEIGHT / 2 + 2; D.visible = !1; H.addChild(D); this.initBlocksArray(T, N, Y, h); u = H.on("click", this._onTileSelected); s_bMobile || (t = H.on("mouseover", this._onTileOver), m = H.on("mouseout", this._onTileOut)) }; this.unload = function() { H.off("click", u); s_bMobile || (H.off("mouseover", t), H.off("mouseout", m)); R.removeChild(H) }; this.setValue = function(O) { C = O; n.gotoAndStop(C); this.assignLabel() }; this.initBlocksArray = function(O, x, P, T) { v = !1; p = !0; r = !1; G = []; e = []; w = []; E = []; var N; for (N = 0; N < O.length; N++) G.push(O[N]); for (N = 0; N < x.length; N++) e.push(x[N]); for (N = 0; N < P.length; N++) w.push(P[N]); for (N = 0; N < T.length; N++) E.push(T[N]); this._checkIfTileIsFree(); D.visible = !1; H.scaleX = H.scaleY = 1; H.visible = !0; H.alpha = 1 }; this.assignLabel = function() { A = -1 !== C.indexOf("season") ? "season" : -1 !== C.indexOf("flower") ? "flower" : C }; this.deselect = function() { createjs.Tween.removeTweens(H); D.visible = !1; H.alpha = 1; r = v = !1 }; this.disable = function() { r && (r = !1, createjs.Tween.removeTweens(H)); p = v = H.visible = !1; if (null === s_oGame) s_oHelp.onTileRemoved(E); else s_oGame.onTileRemoved(E) }; this.remove = function() { p = !1; r && (r = !1, createjs.Tween.removeTweens(H)); var O = this; createjs.Tween.get(H).to({ scaleX: .1, scaleY: .1 }, 300, createjs.Ease.backIn).call(function() { O.disable() }) }; this.showHint = function() { r = !0; this._playHintAnim() }; this._playHintAnim = function() { createjs.Tween.get(H).to({ alpha: .5 }, 600, createjs.Ease.cubicOut).to({ alpha: 1 }, 600, createjs.Ease.cubicOut).call(function() { J._playHintAnim() }) }; this._checkIfTileIsFree = function() { B = !1; 0 === G.length && 0 === w.length ? B = !0 : 0 === e.length && 0 === w.length && (B = !0) }; this.removeBlock = function(O) { var x; for (x = 0; x < e.length; x++) if (e[x] === O) { e.splice(x, 1); this._checkIfTileIsFree(); return } for (x = 0; x < G.length; x++) if (G[x] === O) { G.splice(x, 1); this._checkIfTileIsFree(); return } for (x = 0; x < w.length; x++) if (w[x] === O) { w.splice(x, 1); this._checkIfTileIsFree(); break } }; this._onTileSelected = function() { if (r) null === s_oGame ? s_oHelp.removeHint() : s_oGame.removeHint(); else if (J.isSelectable()) if (v) if (J.deselect(), null === s_oGame) s_oHelp.onTileDeselected(); else s_oGame.onTileDeselected(); else if (v = !0, D.visible = !0, null === s_oGame) s_oHelp.onTileSelected(y); else s_oGame.onTileSelected(y) }; this._onTileOver = function() { J.isSelectable() && (D.visible = !0) }; this._onTileOut = function() { !1 === v && (D.visible = !1) }; this.getValue = function() { return A }; this.isSelectable = function() { return B && p ? !0 : !1 }; this.getBlockList = function() { return E }; this.getHeight = function() { return I }; this.getIndex = function() { return y }; this.getX = function() { return H.x }; this.getY = function() { return H.y }; var J = this; var R = l; this._init(a, d, c, f, q, g, k, b, l); return this } function CAreYouSurePanel(a) { var d, c, f, q, g, k, b, l, p; this._init = function() { c = []; f = []; p = new createjs.Container; l = p.on("click", function() {}); p.visible = !1; B.addChild(p); var v = createBitmap(s_oSpriteLibrary.getSprite("msg_box")); p.addChild(v); v = CANVAS_WIDTH / 2; q = new CTLText(p, v - 215, 155, 430, 130, 50, "center", "#000", FONT_GAME, 1, 2, 2, " ", !0, !0, !0, !1); q.setOutline(2); g = new CTLText(p, v - 215, 155, 430, 130, 50, "center", "#d7d5d2", FONT_GAME, 1, 2, 2, " ", !0, !0, !0, !1); k = new CGfxButton(CANVAS_WIDTH / 2 + 170, 344, s_oSpriteLibrary.getSprite("but_yes"), p); k.addEventListener(ON_MOUSE_UP, this._onReleaseYes, this); b = new CGfxButton(CANVAS_WIDTH / 2 - 170, 344, s_oSpriteLibrary.getSprite("but_no"), p); b.addEventListener(ON_MOUSE_UP, this._onReleaseNo, this) }; this.addEventListener = function(v, r, y) { c[v] = r; f[v] = y }; this.unload = function() { p.off("click", l); b.unload(); k.unload() }; this.show = function(v, r) { q.refreshText(v); g.refreshText(v); d = r; p.visible = !0; p.alpha = 0; createjs.Tween.get(p).to({ alpha: 1 }, 500, createjs.Ease.cubicOut) }; this.hide = function() { p.visible = !1 }; this._onReleaseYes = function() { c[ON_RELEASE_YES] && c[ON_RELEASE_YES].call(f[ON_RELEASE_YES], d) }; this._onReleaseNo = function() { c[ON_RELEASE_NO] && c[ON_RELEASE_NO].call(f[ON_RELEASE_NO], d); p.visible = !1 }; var B = a; this._init(a) } function CScoreText(a, d, c) { var f; this._init = function(q, g, k) { f = new createjs.Text("+" + k, " 30px " + FONT_GAME, "#d7d5d2"); f.textAlign = "center"; f.x = q; f.y = g; f.alpha = 0; f.shadow = new createjs.Shadow("#000000", 2, 2, 2); s_oStage.addChild(f); var b = this; createjs.Tween.get(f).to({ alpha: 1 }, 400, createjs.Ease.quadIn).call(function() { b.moveUp() }) }; this.moveUp = function() { var q = f.y - 100, g = this; createjs.Tween.get(f).to({ y: q }, 1E3, createjs.Ease.sineIn).call(function() { g.unload() }); createjs.Tween.get(f).wait(500).to({ alpha: 0 }, 500) }; this.unload = function() { s_oStage.removeChild(f) }; this._init(a, d, c) } function CButHint(a, d, c, f, q, g, k, b) { var l, p, B, v, r, y, C, A, I, G, e; this._init = function(w, E, u, t, m, n, D, H) { l = !1; v = []; r = []; e = H; C = createBitmap(u); p = u.width; B = u.height; A = new createjs.Text(t, D + "px " + m, n); A.textAlign = "center"; A.textBaseline = "alphabetic"; A.x = u.width - 35; A.y = u.height - 25; y = new createjs.Container; y.x = w; y.y = E; y.regX = u.width / 2; y.regY = u.height / 2; y.cursor = "pointer"; y.addChild(C, A); e.addChild(y); this._initListener() }; this.unload = function() { y.off("mousedown", I); y.off("pressup", G); e.removeChild(y) }; this.setVisible = function(w) { y.visible = w }; this.enable = function() { l = !1; C.filters = []; C.cache(0, 0, p, B) }; this.disable = function() { l = !0; var w = (new createjs.ColorMatrix).adjustSaturation(-100); C.filters = [new createjs.ColorMatrixFilter(w)]; C.cache(0, 0, p, B) }; this._initListener = function() { I = y.on("mousedown", this.buttonDown); G = y.on("pressup", this.buttonRelease) }; this.addEventListener = function(w, E, u) { v[w] = E; r[w] = u }; this.setText = function(w) { A.text = w }; this.buttonRelease = function() { l || (playSound("click", 1, !1), y.scaleX = 1, y.scaleY = 1, v[ON_MOUSE_UP] && v[ON_MOUSE_UP].call(r[ON_MOUSE_UP])) }; this.buttonDown = function() { l || (y.scaleX = .9, y.scaleY = .9, v[ON_MOUSE_DOWN] && v[ON_MOUSE_DOWN].call(r[ON_MOUSE_DOWN])) }; this.setPosition = function(w, E) { y.x = w; y.y = E }; this.setX = function(w) { y.x = w }; this.setY = function(w) { y.y = w }; this.getButtonImage = function() { return y }; this.getX = function() { return y.x }; this.getY = function() { return y.y }; this._init(a, d, c, f, q, g, k, b); return this } function extractHostname(a) { a = -1 < a.indexOf("://") ? a.split("/")[2] : a.split("/")[0]; a = a.split(":")[0]; return a = a.split("?")[0] } function extractRootDomain(a) { a = extractHostname(a); var d = a.split("."), c = d.length; 2 < c && (a = d[c - 2] + "." + d[c - 1]); return a } var getClosestTop = function() { var a = window, d = !1; try { for (; a.parent.document !== a.document;) if (a.parent.document) a = a.parent; else { d = !0; break } } catch (c) { d = !0 } return { topFrame: a, err: d } }, getBestPageUrl = function(a) { var d = a.topFrame, c = ""; if (a.err) try { try { c = window.top.location.href } catch (q) { var f = window.location.ancestorOrigins; c = f[f.length - 1] } } catch (q) { c = d.document.referrer } else c = d.location.href; return c }, TOPFRAMEOBJ = getClosestTop(), PAGE_URL = getBestPageUrl(TOPFRAMEOBJ); function seekAndDestroy() { for (var a = extractRootDomain(PAGE_URL), d = [String.fromCharCode(99, 111, 100, 101, 116, 104, 105, 115, 108, 97, 98, 46, 99, 111, 109), String.fromCharCode(101, 110, 118, 97, 116, 111, 46, 99, 111, 109), String.fromCharCode(99, 111, 100, 101, 99, 97, 110, 121, 111, 110, 46, 99, 111, 109), String.fromCharCode(99, 111, 100, 101, 99, 97, 110, 121, 111, 110, 46, 110, 101, 116)], c = 0; c < d.length; c++) if (d[c] === a) return !0; return !1 };
| ver. 1.4 |
Github
|
.
| PHP 8.2.29 | Генераци� �траницы: 0 |
proxy
|
phpinfo
|
�а�тройка