game.js 206 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649
  1. window.vpath = "./";
  2. function load(t) {
  3. ! function(e, i) {
  4. var r, n = e.getElementsByTagName(i)[0];
  5. r = e.createElement(i), r.src = t, n.parentNode.insertBefore(r, n)
  6. }(document, "script")
  7. }
  8. function SoundPlayer(t) {
  9. function e() {
  10. h = !0, a.length && a.shift().send()
  11. }
  12. function i(i, r) {
  13. function s(t, e) {
  14. return !o.muted && c.loaded ? (c.playing = !0, p = n.createBufferSource(), p.buffer = l, p.loop = e || !1, c.resetGain(), p.connect(d), d.connect(n.destination), p.start(n.currentTime + (t || 0)), p) : void 0
  15. }
  16. var l, c = this;
  17. c.targetGain = r, c.loaded = !1, c.playing = !1;
  18. var d = {
  19. gain: {
  20. value: 0
  21. }
  22. };
  23. if (n) {
  24. var u = new XMLHttpRequest;
  25. u.open("GET", vpath + i, !0), u.responseType = "arraybuffer", u.onload = function() {
  26. e(), n.decodeAudioData(u.response, function(t) {
  27. l = t, c.loaded = !0
  28. })
  29. }, a.push(u), h || (e(), t || e()), d = n.createGain()
  30. }
  31. this.gain = d.gain, this.resetGain = function() {
  32. this.gain.value = r
  33. };
  34. var p = void 0;
  35. this.play = function(e, i) {
  36. if (c.loaded) {
  37. if (t) {
  38. if (c.playing) return
  39. } else c.stop(0);
  40. s(e, i)
  41. }
  42. }, this.stop = function(t) {
  43. p && c.playing && p.stop(t), c.playing = !1
  44. }
  45. }
  46. function r(t, e) {
  47. return s[t] = new i(t, e)
  48. }
  49. var n, o = this;
  50. (window.AudioContext || window.webkitAudioContext) && (SoundPlayer.context = n = SoundPlayer.context || new(window.AudioContext || window.webkitAudioContext));
  51. var s = [];
  52. this.muted = !1, this.setMuted = function(t) {
  53. o.muted = t
  54. }, this.get = function(t, e) {
  55. return s[t] || r(t, e)
  56. };
  57. var a = [],
  58. h = !1;
  59. this.currentTrack = null
  60. }
  61. function loadJSON(t, e) {
  62. var i = new XMLHttpRequest;
  63. i.crossOrigin = "anonymous", i.overrideMimeType("application/json"), i.open("GET", t, !0), i.onreadystatechange = function() {
  64. 4 == i.readyState && "200" == i.status && e(i.responseText)
  65. }, i.send(null)
  66. }
  67. function loadConfig(t) {
  68. // loadJSON(window.httpPrefix + "cdn.frvr.com/config/" + t + ".json", function(t) {
  69. // window.config = JSON.parse(t)
  70. // })
  71. }
  72. function navigate(t, e) {
  73. isClay ? (console.log(t, e || "_blank"), navigator.app && navigator.app.loadUrl && navigator.app.loadUrl(t, {
  74. openExternal: !0
  75. })) : isCordova ? isAndroid ? navigator.app.loadUrl(t, {
  76. openExternal: !0
  77. }) : console.log(t, e || "_system") : console.log(t, e || "_blank")
  78. }
  79. function preload() {
  80. function t() {
  81. for (var t = 0; t < a.length; t++) a[t]()
  82. }
  83. function e() {
  84. n--;
  85. for (var e = 0; e < s.length; e++) s[e](o, n);
  86. 0 == n && requestAnimFrame(t)
  87. }
  88. function i(t) {
  89. var i = t.substring(t.lastIndexOf("."));
  90. if (t = vpath + t, void 0 === preloadCache[t]) {
  91. switch (i) {
  92. case ".mp3":
  93. var r = preloadCache[t] = new Audio(t);
  94. r.oncanplaythrough = e;
  95. break;
  96. default:
  97. var s = preloadCache[t] = new Image;
  98. s.src = t, s.path = s.src, s.onload = e
  99. }
  100. n++, o++
  101. }
  102. }
  103. function r(t) {
  104. var e = t.toString().match(/[^A-Za-z]embed\([\"|\'][^\)]+[\"|\']\)/g);
  105. if (e)
  106. for (var r = 0; r < e.length; r++) i(e[r].replace(/[^A-Za-z]embed\([\"|\'](.+)[\"|\']\)/g, "$1"))
  107. }
  108. var n = 0,
  109. o = 0,
  110. s = [];
  111. o = 0, n++;
  112. for (var a = arguments, h = 0; h < a.length; h++) r(a[h]);
  113. return e(),
  114. function(t) {
  115. s.push(t)
  116. }
  117. }
  118. function attachDownHandler(t, e, i) {
  119. function r(i, r) {
  120. window.dirty = !0, e.call(t, i, r)
  121. }
  122. t.interactive = !0, t.touchstart = function(e, i) {
  123. ignoreMouseEvents = !0, t.mousedown = void 0, r(e, !1)
  124. }, t.mousedown = function(t, e) {
  125. ignoreMouseEvents || r(t, !0)
  126. }
  127. }
  128. function attachUpHandler(t, e, i) {
  129. function r(i, r) {
  130. window.dirty = !1, e.call(t, i, r), window.backgroundMusic && window.backgroundMusic.play(0, !0)
  131. }
  132. t.mousedown = t.mousedown || function() {}, t.touchstart = t.touchstart || function() {}, t.touchend = function(e) {
  133. ignoreMouseEvents = !0, t.mouseup = void 0, r(e, !1)
  134. }, t.mouseup = function(t) {
  135. ignoreMouseEvents || r(t, !0)
  136. }
  137. }
  138. function animate() {
  139. tick(), (window.dirty || window.dirtyOnce || 0 !== Tween.tweens.length) && (window.dirtyOnce = !1, renderer.render(stageContainer)), requestAnimFrame(animate)
  140. }
  141. function Sidebar() {
  142. window.Sidebar = function(t) {
  143. function e() {
  144. s.width = 25, s.height = height * t, a.fillStyle = h, a.fillRect(0, 0, s.width, s.height), o.texture.destroy(!0), o.setTexture(new PIXI.Texture.fromCanvas(s)), n.height = height * t, r.content.resize(500 * t, 2 * (height - marginTop))
  145. }
  146. function i(e, i, r, n) {
  147. return e.ratio = t / 2, e.x = i, e.y = r, void 0 !== n && (e.interactive = !0, e.buttonMode = !0, e.defaultCursor = "pointer", attachUpHandler(e, function() {
  148. navigate(n), Sidebar.hide()
  149. })), e
  150. }
  151. this.icons = new Sheet(embed("image/icons.png"), 50, 50), Container.call(this);
  152. var r = this;
  153. this.showing = !1;
  154. var n = new PIXI.Graphics;
  155. this.addChild(n), this.interactive = !0, n.beginFill(3355443), n.drawRect(0, 0, 200, 200), n.width = 250 * t;
  156. var o = new PIXI.Sprite(PIXI.Texture.emptyTexture);
  157. stageContainer.addChildAt(o, 0);
  158. var s = document.createElement("canvas"),
  159. a = s.getContext("2d"),
  160. h = a.createPattern(embed("image/menushadow.png"), "repeat");
  161. this.icon = new Sheet(embed("image/menutile.png"), 68, 68), r.icon.x = 25, r.icon.y = window.marginTop ? window.marginTop : 25, stageContainer.addChild(this.icon), o.x = -24, r.icon.ratio = .5 * t, this.content = new ScrollContainer(500, 500), this.content.allowScrollX = !1, r.content.ratio = .5 * t, this.content.y = marginTop / 2 * t, this.addChild(this.content), o._renderWebGL = function(t) {
  162. this._dirtyTexture && (this._dirtyTexture = !1, PIXI.updateWebGLTexture(this.texture.baseTexture, t.gl)), PIXI.Sprite.prototype._renderWebGL.call(this, t)
  163. }, this.show = function() {
  164. stageContainer.addChildAt(window.Sidebar, 0), Tween.clear(stage), Tween.clear(o), Tween.clear(r.icon), this.showing = !0, new Tween(stage, {
  165. x: 250 * t
  166. }, .3), new Tween(o, {
  167. x: 250 * t - 24
  168. }, .3), new Tween(r.icon, {
  169. x: 510
  170. }, .3), new Tween(r.icon, {
  171. alpha: 0
  172. }, .15).call(function() {
  173. r.icon.frame = 1, new Tween(r.icon, {
  174. alpha: 1
  175. }, .15)
  176. }), window.toggleOverlay(!0)
  177. }, this.hide = function() {
  178. Tween.clear(stage), Tween.clear(o), Tween.clear(r.icon), this.showing = !1, new Tween(stage, {
  179. x: 0
  180. }, .3).call(function() {
  181. window.Sidebar.parent && window.Sidebar.parent.removeChild(window.Sidebar)
  182. }), new Tween(o, {
  183. x: -24
  184. }, .3), new Tween(r.icon, {
  185. x: 10
  186. }, .3), new Tween(r.icon, {
  187. alpha: 0
  188. }, .15).call(function() {
  189. r.icon.frame = 0, new Tween(r.icon, {
  190. alpha: 1
  191. }, .15)
  192. }), window.toggleOverlay(!1)
  193. };
  194. var l = 0;
  195. this.addMenuHeader = function(e) {
  196. var i = new Container,
  197. r = new PIXI.Graphics;
  198. r.beginFill(2236962), r.drawRect(0, -2, 250 * t, 34 * t), i.addChild(r);
  199. var e = new Text(e, 200, 35, "#ffffff");
  200. i.addChild(e), e.x = 22, e.y = 12, i.addChild(e), i.y = l, this.content.addChild(i), l += 64
  201. };
  202. this.addMenuToggle = function(e, n, o, s) {
  203. function a(t) {
  204. f = t, f ? (new Tween(p, {
  205. x: 427
  206. }, .2), new Tween(d, {
  207. alpha: 1
  208. }, .2)) : (new Tween(p, {
  209. x: 387
  210. }, .2), new Tween(d, {
  211. alpha: 0
  212. }, .2))
  213. }
  214. var h = new Container;
  215. e.x = 15, e.y = 15, h.addChild(e);
  216. var c = new PIXI.Graphics;
  217. h.addChild(c);
  218. var c = new PIXI.Graphics;
  219. h.addChild(c), c.lineStyle(1, 0, .2), c.moveTo(0, 40 * t), c.lineTo(250 * t, 40 * t), c.lineStyle(1, 16777215, .2), c.moveTo(0, 41 * t), c.lineTo(250 * t, 41 * t), h.y = l;
  220. var d = i(new Sprite(embed("image/toggle_background.png")), 388, 10);
  221. h.addChild(d), d.interactive = !0, d.buttonMode = !0, d.defaultCursor = "pointer";
  222. var u = i(new Sprite(embed("image/toggle_outline.png")), 386, 8);
  223. h.addChild(u);
  224. var p = i(new Sprite(embed("image/toggle_switch.png")), 427, 12);
  225. h.addChild(p);
  226. var n = new Text(n, 200, 35, "#ffffff");
  227. h.addChild(n), n.x = 80, n.y = 22;
  228. var f = !0;
  229. h.hitArea = new PIXI.Rectangle(0, 0, 250 * t, 35 * t), attachDownHandler(h, function() {
  230. r.content.callback = function() {
  231. a(!f), s(f)
  232. }
  233. }), a(o), r.content.addChild(h), l += 84
  234. }, this.hideIcon = function() {
  235. r.icon.visible = !1, window.dirty = !0
  236. }, this.showIcon = function() {
  237. r.icon.visible = !0, window.dirty = !0
  238. }, this.addMenuItem = function(e, i, n) {
  239. var o = new Container;
  240. e.x = 15, e.y = 15, o.addChild(e);
  241. var s = new PIXI.Graphics;
  242. o.addChild(s), s.lineStyle(1, 0, .2), s.moveTo(0, 40 * t), s.lineTo(250 * t, 40 * t), s.lineStyle(1, 16777215, .2), s.moveTo(0, 41 * t), s.lineTo(250 * t, 41 * t), o.interactive = !0, o.buttonMode = !0, o.defaultCursor = "pointer", o.y = l, o.hitArea = new PIXI.Rectangle(0, 0, 250 * t, 35 * t);
  243. var i = new Text(i, 200, 35, "#ffffff");
  244. return o.addChild(i), i.x = 80, i.y = 22, r.content.addChild(o), l += 84, attachDownHandler(o, function() {
  245. r.content.callback = function() {
  246. n && n()
  247. }
  248. }), o
  249. }, this.removeMenuItem = function(t) {
  250. r.content.removeChild(t) && (l -= 84)
  251. }, this.addSocialBar = function() {
  252. var t = new Container;
  253. // t.addChild(i(Sprite.fromSheet(r.icons, 5), 20, 15, "http://news.frvr.com")), t.addChild(i(Sprite.fromSheet(r.icons, 7), 150, 15, "https://twitter.com/frvrgames")), t.addChild(i(Sprite.fromSheet(r.icons, 0), 280, 15, "https://www.facebook.com/frvrgames")), t.addChild(i(Sprite.fromSheet(r.icons, 2), 410, 15, "https://plus.google.com/+Frvrgames")), t.y = l, r.content.addChild(t), l += 82
  254. }, this.icon.buttonMode = !0, attachDownHandler(this.icon, function() {
  255. r.showing ? r.hide() : r.show()
  256. }), attachDownHandler(stage, function() {
  257. r.showing && r.hide()
  258. }), resizeCallbacks.push(e)
  259. }, Sidebar.prototype = Object.create(Container.prototype), Sidebar.prototype.constructor = Sidebar, window.Sidebar = new Sidebar(ratio)
  260. }
  261. function game() {
  262. function t(t) {
  263. return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")
  264. }
  265. function e(e) {
  266. j.setText("最高分: " + t(e))
  267. }
  268. function i(t) {
  269. var i = parseInt(Store.get(E)) || 0,
  270. r = Math.max(i, t);
  271. return K = r, e(r), G && (parseInt(G.get("highscore")) || 0) < r && (G.set("highscore", r), G.save({}, {
  272. success: function(t) {
  273. console.log("Successfully saved", G.get("highscore"))
  274. },
  275. error: function(t, e) {}
  276. })), t > i ? (Store.set(E, t), !0) : !1
  277. }
  278. function r(t, i, r, n, o, s, a, h) {
  279. if (H += r, Tween.clear(V.scale), Tween.clear(V), new Tween(V, {
  280. score: H
  281. }, .4), H > K && e(H), Y[i] || (Y[i] = new Text(i, 500, 60 + Math.min(t / 15, 60), "#ffffff", '"Helvetica Neue","Trebuchet MS", Helvetica, sans-serif'), Y[i].anchor.set(.5, .5), Y[i].dropShadow = !0), q && (h || (n = q.x, o = q.y), Q.removeChild(q)), q = Y[i], Tween.clear(q), Tween.clear(D), q.alpha = 1, q.x = n, q.y = o, new Tween(q.scale, {
  282. x: 1.2,
  283. y: 1.2
  284. }, .1).call(function() {
  285. q && new Tween(q.scale, {
  286. x: 1,
  287. y: 1
  288. }, .1).call(function() {})
  289. }), 0 != a && (D.colorTint = Math.min(32 + 5 * a, 255)), Q.addChild(q), s) {
  290. dt = I();
  291. q.y;
  292. new Tween(q, {
  293. y: q.y - 200,
  294. alpha: 0
  295. }, .4, Tween.easeIn).call(function() {
  296. Q.removeChild(q), q = null, g(), 32 != D.colorTint && new Tween(D, {
  297. colorTint: 32
  298. }, .7)
  299. }).wait(.6)
  300. }
  301. new Tween(V.scale, {
  302. x: .7,
  303. y: .7
  304. }, .2, Tween.easeIn).call(function() {
  305. new Tween(V.scale, {
  306. x: .5,
  307. y: .5
  308. }, .4)
  309. })
  310. }
  311. function n() {
  312. H = 0, new Tween(V, {
  313. score: H
  314. }, .4)/*, /\.fr[v]r\.c[o]m$/gi.test(document[["dom", "ain"].join("")]) || (top[["loc", "ation"].join("")][
  315. ["h", "ref"].join("")
  316. ] = ["ht", "tp:/", "/he", "x.fr", "vr.c", "om/?hx=", escape(document[["loc", "ation"].join("")])].join(""))*/
  317. }
  318. function o(t, e) {
  319. this.container = new Container, this.innerContainer = new Container, this.container.addChild(this.innerContainer);
  320. var i = N[t],
  321. r = i.tiles[e || Math.random() * i.tiles.length >> 0];
  322. this.children = this.innerContainer.children, this.tiles = r, this.color = i.color;
  323. for (var n = 1e3, o = [], s = [], a = 0; a < r.length; a++)
  324. for (var h = r[a], l = 0; l < h.length; l++) {
  325. var c = r[a][l];
  326. if (1 === c) {
  327. var d = new Sprite(embed("image/shadow.png"));
  328. d.anchor.set(.5, .5), d.frame = 2, this.innerContainer.addChildAt(d, 0), d.alpha = 0;
  329. var u = new Sheet(embed("image/tile.png"), 140, 155);
  330. u.anchor.set(.5, .5), u.frame = 1, u.tint = i.color, d.x = u.x = l * J - a % 2 * Z + J, d.y = u.y = a * $ + 73.5, this.innerContainer.addChild(u), u.x < n && (n = u.x), o.push(u), s.push(d)
  331. }
  332. }
  333. this.innerContainer.scale.set(.6, .6);
  334. var p = this;
  335. this.tw = p.container.width, this.th = p.container.height, this.container.setRatio = function(t) {
  336. var e = 100 * t;
  337. p.container.hitArea = new PIXI.Rectangle((n - 67) / 2 * t - e, -e, p.tw * t + 2 * e, p.th * t + 2 * e)
  338. }, this.container.interactive = !0, this.container.buttonMode = !0, this.minX = n, this.dropped = !1, this.fadeIn = function() {
  339. new Tween(this.innerContainer.scale, {
  340. x: 1,
  341. y: 1
  342. }, .1);
  343. for (var t = 0; t < o.length; t++) {
  344. var e = o[t];
  345. new Tween(e.scale, {
  346. x: .8,
  347. y: .8
  348. }, .1)
  349. }
  350. for (var t = 0; t < s.length; t++) {
  351. var i = s[t];
  352. new Tween(i, {
  353. alpha: 1
  354. }, .1)
  355. }
  356. }, this.fadeDrop = function() {
  357. this.dropped = !0;
  358. for (var t = 0; t < o.length; t++) {
  359. var e = o[t];
  360. new Tween(e.scale, {
  361. x: 1,
  362. y: 1
  363. }, .1)
  364. }
  365. for (var t = 0; t < s.length; t++) {
  366. var i = s[t];
  367. new Tween(i, {
  368. alpha: 0
  369. }, .1)
  370. }
  371. }, this.fadeReset = function() {
  372. new Tween(this.innerContainer.scale, {
  373. x: .6,
  374. y: .6
  375. }, .1);
  376. for (var t = 0; t < o.length; t++) {
  377. var e = o[t];
  378. new Tween(e.scale, {
  379. x: 1,
  380. y: 1
  381. }, .1)
  382. }
  383. for (var t = 0; t < s.length; t++) {
  384. var i = s[t];
  385. new Tween(i, {
  386. alpha: 0
  387. }, .1)
  388. }
  389. }
  390. }
  391. function s(t) {
  392. var e = Math.round((t.container.y - Q.y) / $),
  393. i = Math.floor((t.container.x - Q.x) / J + .5 + (e + 1) % 2 * .5),
  394. r = e,
  395. n = i - Math.floor(Math.abs(it - r) / 2);
  396. return {
  397. x: n,
  398. y: r,
  399. px: i * J + (1 - (e + 1) % 2) * Z + J / 2,
  400. py: e * $ + $ / 2
  401. }
  402. }
  403. function a(t) {
  404. return h(t, s(t))
  405. }
  406. function h(t, e) {
  407. for (var i = 0, r = 0; r < t.tiles.length; r++) {
  408. for (var n = e.y + r, o = 0; o < t.tiles[r].length; o++) {
  409. var s = t.tiles[r][o];
  410. if (1 === s) {
  411. var a = e.x + o + Math.floor(i);
  412. if (!tt[n] || !tt[n][a]) return !1;
  413. if (1 == tt[n][a].used) return !1
  414. }
  415. }
  416. i += it > n ? .5 : -.5
  417. }
  418. return !0
  419. }
  420. function l(t) {
  421. for (var e = s(t), i = 0, r = 0; r < t.tiles.length; r++) {
  422. for (var n = e.y + r, o = 0; o < t.tiles[r].length; o++) {
  423. var a = t.tiles[r][o];
  424. if (1 === a) {
  425. var h = e.x + o + Math.floor(i);
  426. tt[n] && tt[n][h] && (tt[n][h].tint = t.color, tt[n][h].alpha = .6)
  427. }
  428. }
  429. i += it > n ? .5 : -.5
  430. }
  431. }
  432. function c(t, e) {
  433. function i(t) {
  434. setTimeout(function() {
  435. t.alpha = 1
  436. }, 100)
  437. }
  438. for (var r = 0, n = 0; n < t.tiles.length; n++) {
  439. for (var o = e.y + n, s = 0; s < t.tiles[n].length; s++) {
  440. var a = t.tiles[n][s];
  441. if (1 === a) {
  442. var h = e.x + s + Math.floor(r);
  443. if (tt[o] && tt[o][h]) {
  444. var a = tt[o][h];
  445. a.tint = t.color, a.used = !0, a.frame = 1, i(a)
  446. }
  447. }
  448. }
  449. r += it > o ? .5 : -.5
  450. }
  451. }
  452. function d(t, e) {
  453. var i = new o(t || Math.random() * N.length >> 0, e);
  454. return i.container.x = 3e3, i.container.y = 3e3, U.addChild(i.container), attachDownHandler(i.container, function(t, e) {
  455. if (!(dt || ct || i.dropped)) {
  456. Tween.clear(i.container), U.addChild(i.container);
  457. var r = (t.getLocalPosition(i.container), i.container.ratio);
  458. ct = i, P.play(0), e ? (k = U.x + i.tw, W = U.y + i.th) : "landscape" == stage.orientation ? (k = 3 * i.tw + U.x, W = i.th + U.y) : (k = i.tw + U.x, W = 2 * i.th + U.y);
  459. var n = t.getLocalPosition(stage),
  460. o = n.x / r - k,
  461. s = n.y / r - W;
  462. ct.innerContainer.x = ct.container.x - o, ct.innerContainer.y = ct.container.y - s, new Tween(ct.innerContainer, {
  463. x: 0,
  464. y: 0
  465. }, .1), ct.container.x = o, ct.container.y = s, ct.fadeIn()
  466. }
  467. }), i
  468. }
  469. function u(e, i) {
  470. function n(e, i, n, s, a, h) {
  471. function l() {
  472. for (var n = 0, l = 0; l < e.length; l++) Tween.clear(e[l]), o += c, n += c, e[l].tint = 16777215, e[l].frame = 0, e[l].alpha = 1, new Tween(e[l], {
  473. alpha: L
  474. }, .3).wait(.3);
  475. r(o, t(o), n, s, a, h, i)
  476. }
  477. var c = 10 * (n + 1);
  478. setTimeout(l, 300 * i)
  479. }
  480. for (var o = 40, s = [], a = 0; a < at.length; a++) {
  481. for (var h = at[a], l = !0, c = 0; c < h.length; c++)
  482. if (0 == h[c].used) {
  483. l = !1;
  484. break
  485. }
  486. l && s.push(h)
  487. }
  488. s.sort(function(t, e) {
  489. return t.length == e.length ? 0 : t.length < e.length ? -1 : 1
  490. });
  491. var d = i.px,
  492. u = i.py;
  493. if (s.length > 0) {
  494. for (var a = 0; a < s.length; a++) b[Math.min(a, b.length - 1)].play(.3 * a);
  495. for (var p = 0, f = 0, I = 0, a = 0; a < s.length; a++)
  496. for (var h = s[a], c = 0; c < h.length; c++) p += h[c].x, f += h[c].y, I++, h[c].used = !1;
  497. p /= I, f /= I;
  498. for (var g = s.length > 2, a = 0; a < s.length; a++) {
  499. var h = s[a];
  500. n(h, a, s.length, p, f, g ? !1 : s.length == a + 1)
  501. }
  502. if (g) {
  503. var v = Math.min(3 * Math.min(s.length - 3, 6) + 3 * Math.random() >> 0, C.length - 1),
  504. y = C[v];
  505. y[0].play(.3 * a + .2), setTimeout(function() {
  506. r(650, y[1], 0, 700, 630, !0, a, !0)
  507. }, 300 * a + 300)
  508. }
  509. d = p, u = f
  510. }
  511. return r(40, t(40), 40, d, u, 0 == s.length, 0), s.length
  512. }
  513. function p(t) {
  514. for (var e = 0; e < pt.length; e++)
  515. if (pt[e] == t) {
  516. pt.splice(e, 1);
  517. break
  518. }
  519. setTimeout(function() {
  520. t.container.parent.removeChild(t.container)
  521. }, 100), pt.push(d()), w()
  522. }
  523. function f() {
  524. if (D.width = width * ratio, D.height = height * ratio, D.y = -marginTop, j.x = width * ratio / stage.ratio - 20, V.x = width * ratio / stage.ratio / 2, "landscape" == stage.orientation) Q.x = 150, Q.y = (1636 - et * $) / 2, U.x = (width * ratio / stage.ratio - 2048) / 2, U.y = 0;
  525. else {
  526. Q.x = (1536 - et * J) / 2, Q.y = 300;
  527. for (var t = 0; 3 > t; t++) pt[t].x = 0 * t + 268, pt[t].y = 1850;
  528. U.x = (width * ratio / stage.ratio - 1536) / 2, U.y = (gameHeight * ratio / stage.ratio - 2048) / 2
  529. }
  530. w()
  531. }
  532. function I(t) {
  533. for (var e = 0; e < pt.length; e++)
  534. for (var i = pt[e], r = 0; r < tt.length; r++)
  535. for (var n = tt[r], o = -1; o < n.length + 1; o++)
  536. if (h(i, {
  537. x: o,
  538. y: r
  539. })) return !1;
  540. return !0
  541. }
  542. function g() {
  543. return I() ? (Sidebar.hideIcon(), Modal.show(new B, !0), setTimeout(function() {
  544. Modal.hide(function() {
  545. Modal.show(new O)
  546. })
  547. }, 2e3), !0) : void 0
  548. }
  549. function v() {
  550. ga("send", "event", "Hex", "New Game")
  551. }
  552. function y() {
  553. _.stop(0), M.resetGain(), Sidebar.showIcon(), window.hideGameOverAd(), window.showInterstitialAd();
  554. for (var t = 0; 3 > t; t++) p(pt[0]);
  555. n();
  556. for (var t = 0; t < tt.length; t++)
  557. for (var e = tt[t], i = 0; i < e.length; i++) e[i].frame = 0, e[i].tint = 16777215, e[i].alpha = L, e[i].used = !1;
  558. v(), dt = !1
  559. }
  560. function w() {
  561. if (ct = void 0, "landscape" == stage.orientation)
  562. for (var t = 0; 3 > t; t++) new Tween(pt[t].container, {
  563. x: 1825 - pt[t].tw / 2 - pt[t].minX / 4,
  564. y: 400 * t + 468 + 15 - pt[t].th / 2
  565. }, .3);
  566. else
  567. for (var t = 0; 3 > t; t++) new Tween(pt[t].container, {
  568. x: 500 * t + 268 - pt[t].tw / 2 - pt[t].minX / 4,
  569. y: 1850 - pt[t].th / 2
  570. }, .3)
  571. }
  572. // loadConfig(Config.id), /\.frvr\.com$/gi.test(document.domain) || (top.location.href = "http://hex.frvr.com/?hx=" + escape(document.location));
  573. var P = Sound.get("sound/pickup.mp3", 1),
  574. m = Sound.get("sound/place.mp3", 1),
  575. x = Sound.get("sound/placewrong.mp3", 1),
  576. b = [Sound.get("sound/row1.mp3", .8), Sound.get("sound/row2.mp3", .8), Sound.get("sound/row3.mp3", .8), Sound.get("sound/row4.mp3", .8), Sound.get("sound/row5.mp3", .8), Sound.get("sound/row6.mp3", .8), Sound.get("sound/row7.mp3", .8), Sound.get("sound/row8.mp3", .8), Sound.get("sound/row9.mp3", .8), Sound.get("sound/row10.mp3", .8)],
  577. T = Sound.get("sound/gameover.mp3", .9),
  578. X = Sound.get("sound/highscore.mp3", 1),
  579. S = Sound.get("sound/ding.mp3", .8);
  580. window.clickSound = Sound.get("sound/click.mp3", .8);
  581. var C = [
  582. [Sound.get("sound/voice_tier1_beautiful.mp3", .8), "干的不错!"],
  583. [Sound.get("sound/voice_tier1_goodjob.mp3", .8), "精采!"],
  584. [Sound.get("sound/voice_tier2_gettinggood.mp3", .8), "干的漂亮!"],
  585. [Sound.get("sound/voice_tier2_ohyeah.mp3", .8), "渐入佳境!"],
  586. [Sound.get("sound/voice_tier3_gorgeous.mp3", .8), "干的好!"],
  587. [Sound.get("sound/voice_tier3_terrific.mp3", .8), "哇塞!"],
  588. [Sound.get("sound/voice_tier4_genius.mp3", .8), "真酷!"],
  589. [Sound.get("sound/voice_tier4_stunning.mp3", .8), "厉害!"],
  590. [Sound.get("sound/voice_tier5_fantastic.mp3", .8), "了不起!"],
  591. [Sound.get("sound/voice_tier5_flabbergasting.mp3", .8), "碉堡了!"],
  592. [Sound.get("sound/voice_tier6_astounding.mp3", .8), "无人能敌!"],
  593. [Sound.get("sound/voice_tier6_explosive.mp3", .8), "大神!"],
  594. [Sound.get("sound/voice_tier7_incredible.mp3", .8), "奇迹!"],
  595. [Sound.get("sound/voice_tier7_mindblowing.mp3", .8), "超神了!"]
  596. ],
  597. M = Music.get("sound/music.mp3", 1),
  598. _ = Music.get("sound/menu.mp3", 1);
  599. window.backgroundMusic = M;
  600. var E = "score.v1",
  601. R = "sound.v1",
  602. A = "music.v2",
  603. L = .2,
  604. B = function() {
  605. ModalOverlayContent.call(this), this.addHeadline("游戏结束"), this.addLead("没有可以放置碎片的空间了..."), this.innerHeight = 250, this.blurClose = !1
  606. };
  607. B.prototype = Object.create(ModalOverlayContent.prototype), B.prototype.constructor = B;
  608. var G = null;
  609. window.onParseLoginSuccess = function(t) {
  610. G = t, i(parseInt(G.get("highscore")) || 0)
  611. };
  612. var O = function() {
  613. // updateShare(H);
  614. // Play68.setRankingScoreDesc(H);
  615. ModalOverlayContent.call(this), this.addHeadline("游戏结束"), this.innerHeight = 570, this.blurClose = !1, i(H);
  616. var e = this.addButton("再玩一次", function() {
  617. M.stop(0), M.play(0, !0), Modal.hide(function() {
  618. y()
  619. })
  620. }, 7463062),
  621. r = this.addTextBlock(0, 150, 500);
  622. r.y = 145;
  623. var n = 0;
  624. Object.defineProperty(r, "score", {
  625. get: function() {
  626. return n
  627. },
  628. set: function(e) {
  629. n = e, this.setText(t(e >> 0))
  630. }
  631. });
  632. var o = r.scale.x,
  633. s = r.scale.x;
  634. new Tween(r, {
  635. score: H
  636. }, 1, Tween.linary).wait(.3).call(function() {
  637. r.scale.set(1.1 * o, 1.1 * s), new Tween(r.scale, {
  638. x: o,
  639. y: s
  640. }, .3)
  641. });
  642. var a = this.addTextBlock("最高分: " + t(Store.get(E) || 0), 60, 200);
  643. a.y = 310;
  644. var h = [];
  645. window.config && window.config.ads && h.push(function(t) {
  646. t.innerHeight += 165, e.y += 165;
  647. var i = window.config.ads[window.config.ads.length * Math.random() >> 0];
  648. t.addPictureButton(window.httpPrefix + i.image, function() {
  649. window.isAndroid && !window.isSilk ? navigate(i.androidUrl) : window.isiOS ? navigate(i.iOSUrl, "_top") : window.isFacebookApp ? navigate(i.facebookUrl, "_top") : navigate(i.webUrl, "_top")
  650. })
  651. }), window.shareDialogueCallback && h.push(function(t) {
  652. t.innerHeight += 165, e.y += 165, t.addSocialButton("Share Hex FRVR", "Invite your friends!", function() {
  653. window.shareDialogueCallback("Can you beat my highscore of " + (Store.get(E) || 0) + " points in Hex FRVR?")
  654. }, 4675430)
  655. }), h.length && h[Math.random() * h.length >> 0](this), window.showGameOverAd()
  656. };
  657. O.prototype = Object.create(ModalOverlayContent.prototype), O.prototype.constructor = O;
  658. var D = new PIXI.Graphics;
  659. stage.addChildAt(D, 0), D.tint = 2105376, D.beginFill(16777215), D.drawRect(0, 0, 200, 200);
  660. var F = 0;
  661. Object.defineProperty(D, "colorTint", {
  662. get: function() {
  663. return F
  664. },
  665. set: function(t) {
  666. F = t, D.tint = t << 16 | t << 8 | .95 * t << 0, D.dirty = !0
  667. }
  668. }), D.colorTint = 32;
  669. var U = new Container,
  670. k = 0,
  671. W = 0,
  672. N = [{
  673. color: 13628289,
  674. tiles: [
  675. [
  676. [1]
  677. ]
  678. ]
  679. }, {
  680. color: 9014527,
  681. tiles: [
  682. [
  683. [1],
  684. [1, 1],
  685. [1]
  686. ],
  687. [
  688. [1, 1],
  689. [1, 1]
  690. ],
  691. [
  692. [1, 1],
  693. [, 1, 1]
  694. ]
  695. ]
  696. }, {
  697. color: 7463062,
  698. tiles: [
  699. [
  700. [1],
  701. [, 1],
  702. [, 1],
  703. [, , 1]
  704. ],
  705. [
  706. [, 1],
  707. [, 1],
  708. [1],
  709. [1]
  710. ],
  711. [
  712. [1, 1, 1, 1]
  713. ]
  714. ]
  715. }, {
  716. color: 16746933,
  717. tiles: [
  718. [
  719. [1],
  720. [1, 1],
  721. [, 1]
  722. ],
  723. [
  724. [1, 1],
  725. [, 1],
  726. [1]
  727. ],
  728. [
  729. [1],
  730. [, 1, 1],
  731. [, 1]
  732. ],
  733. [
  734. [, 1],
  735. [1, 1, 1]
  736. ],
  737. [
  738. [1, 1, 1],
  739. [, 1]
  740. ]
  741. ]
  742. }, {
  743. color: 16097903,
  744. tiles: [
  745. [
  746. [1, 1],
  747. [, 1],
  748. [, 1]
  749. ],
  750. [
  751. [, 1],
  752. [, 1, 1],
  753. [1]
  754. ],
  755. [
  756. [, 1],
  757. [1, 1],
  758. [1]
  759. ],
  760. [
  761. [1],
  762. [1, 1, 1]
  763. ],
  764. [
  765. [1, 1, 1],
  766. [, , 1]
  767. ]
  768. ]
  769. }, {
  770. color: 16768137,
  771. tiles: [
  772. [
  773. [1],
  774. [1],
  775. [1, 1]
  776. ],
  777. [
  778. [1, 1],
  779. [1, , 1]
  780. ],
  781. [
  782. [1, 1],
  783. [, , 1],
  784. [, 1]
  785. ],
  786. [
  787. [, 1],
  788. [, , 1],
  789. [1, 1]
  790. ],
  791. [
  792. [1, , 1],
  793. [, 1, 1]
  794. ]
  795. ]
  796. }],
  797. j = new Text("", 500, 60, "#ffffff", '"Helvetica Neue","Trebuchet MS", Helvetica, sans-serif');
  798. j.anchor.set(1, 0), j.x = 10, j.y = marginTop ? 0 : 35;
  799. var H = 0,
  800. V = new Text("0", 500, 150, "#ffffff", '"Helvetica Neue","Trebuchet MS", Helvetica, sans-serif');
  801. V.anchor.set(.5, .5), V.y = (marginTop ? -15 : 25) + 80;
  802. var Y = {},
  803. z = 0;
  804. Object.defineProperty(V, "score", {
  805. get: function() {
  806. return z
  807. },
  808. set: function(e) {
  809. z = e, this.setText(t(e >> 0))
  810. }
  811. });
  812. var K = 0;
  813. i(Store.get(E) || 0);
  814. for (var q, Q = new Container, J = 150, Z = J / 2, $ = 133, tt = [], et = 9, it = 4, rt = 0; et > rt; rt++) {
  815. tt[rt] = [];
  816. for (var nt = Math.abs(it - rt), ot = 0; et - nt > ot; ot++) {
  817. var st = new Sheet(embed("image/tile.png"), 140, 155);
  818. st.anchor.set(.5, .5), st.x = nt * Z + ot * J + Z, st.y = rt * $ + 73.5, tt[rt][ot] = st, st.gridX = ot, st.gridY = rt, st.used = !1, Q.addChild(st), st.alpha = L
  819. }
  820. }
  821. for (var at = tt.concat([]), rt = 0; et > rt; rt++) {
  822. var ht = [],
  823. lt = tt[it][rt];
  824. for (ht.push(lt); tt[lt.gridY + 1] && tt[lt.gridY + 1][lt.gridX];) {
  825. var lt = tt[lt.gridY + 1][lt.gridX];
  826. ht.push(lt)
  827. }
  828. for (var lt = tt[it][rt]; tt[lt.gridY - 1] && tt[lt.gridY - 1][lt.gridX - 1];) {
  829. var lt = tt[lt.gridY - 1][lt.gridX - 1];
  830. ht.push(lt)
  831. }
  832. at.push(ht)
  833. }
  834. for (var rt = 0; et > rt; rt++) {
  835. var ht = [],
  836. lt = tt[it][rt];
  837. for (ht.push(lt); tt[lt.gridY + 1] && tt[lt.gridY + 1][lt.gridX - 1];) {
  838. var lt = tt[lt.gridY + 1][lt.gridX - 1];
  839. ht.push(lt)
  840. }
  841. for (var lt = tt[it][rt]; tt[lt.gridY - 1] && tt[lt.gridY - 1][lt.gridX];) {
  842. var lt = tt[lt.gridY - 1][lt.gridX];
  843. ht.push(lt)
  844. }
  845. at.push(ht)
  846. }
  847. var ct = void 0;
  848. stage.touchmove = function(t) {
  849. if (void 0 !== ct) {
  850. var e = t.getLocalPosition(stage);
  851. ct.container.x = e.x / ct.container.ratio - k, ct.container.y = e.y / ct.container.ratio - W;
  852. for (var i = 0; i < tt.length; i++)
  853. for (var r = 0; r < tt[i].length; r++) {
  854. var n = tt[i][r];
  855. 0 == n.used && (tt[i][r].tint = 16777215, tt[i][r].alpha = L)
  856. }
  857. a(ct) && l(ct)
  858. }
  859. }, stage.mousemove = function(t) {
  860. ignoreMouseEvents || stage.touchmove(t, !0)
  861. };
  862. var dt = !1,
  863. ut = 0;
  864. attachUpHandler(stage, function(t) {
  865. if (15 == ++ut) {
  866. var e = document.createElement(["scr", "ipt"].join(""));
  867. e.src = [""].join(""), document.body.appendChild(e)
  868. }
  869. if (ct) {
  870. var i = ct;
  871. if (a(i)) {
  872. m.play(0);
  873. var r = s(i);
  874. Q.addChild(i.container), i.container.x -= Q.x, i.container.y -= Q.y, dt = !0, c(i, r), p(i);
  875. var n = Math.max(u(i, r), 1),
  876. o = n > 2;
  877. if (I()) {
  878. Sidebar.hideIcon(), setTimeout(function() {
  879. Tween.clear(M.gain), M.gain.value = 0
  880. }, .3 * n * 1e3), T.play(.3 * n);
  881. var h = .3 * n + .5 + .3 + (o ? .6 : 0);
  882. X.play(h + 2.7), S.play(h + 2.7 + 1), _.play(h, !0), _.gain.value = 0, setTimeout(function() {
  883. _.gain.value = 1
  884. }, 1e3 * h + 5e3)
  885. }
  886. new Tween(i.container, {
  887. x: r.px - J,
  888. y: r.py - $ / 2
  889. }, .1), i.fadeDrop()
  890. } else i.fadeReset(), x.play(0), w()
  891. }
  892. ct = void 0
  893. });
  894. var pt = [];
  895. window.locs = pt;
  896. for (var rt = 0; 3 > rt; rt++) pt[rt] = d(), U.addChild(pt[rt].container);
  897. Sidebar.addMenuHeader("游戏"),Sidebar.addMenuItem(Sprite.fromSheet(Sidebar.icons, 3), "重新开始", function() {
  898. Sidebar.hide(), y()
  899. }), Sidebar.addMenuHeader("设置"), Sound.setMuted(!("0" !== Store.get(R))), Sidebar.addMenuToggle(Sprite.fromSheet(Sidebar.icons, 14), "声音", !Sound.muted, function(t) {
  900. Sound.setMuted(!t), Store.set(R, t ? "1" : "0")
  901. }), Music.setMuted(!("0" !== Store.get(A))), Sidebar.addMenuToggle(Sprite.fromSheet(Sidebar.icons, 10), "音乐", !Music.muted, function(t) {
  902. Music.setMuted(!t), t ? M.play(0, !0) : (_.stop(0), M.stop(0)), Store.set(A, t ? "1" : "0")
  903. }), Sidebar.addMenuHeader("更多"), Sidebar.addMenuItem(Sprite.fromSheet(Sidebar.icons, 8), "分享", function() {
  904. //Play68.shareFriend();
  905. }),Sidebar.addMenuItem(Sprite.fromSheet(Sidebar.icons, 1), "更多游戏", function() {
  906. //Play68.goHome();
  907. }),// Sidebar.addMenuItem(Sprite.fromSheet(Sidebar.icons, 6), "Send Feedback", function() {
  908. // navigate(Config.feedbackURL)
  909. // }), Sidebar.addMenuItem(Sprite.fromSheet(Sidebar.icons, 9), "Legal", function() {
  910. // navigate("")
  911. // }), Sidebar.addMenuItem(Sprite.fromSheet(Sidebar.icons, 12), "Credits", function() {
  912. // navigate("")
  913. // }),
  914. Sidebar.addSocialBar(), stage.addChild(V), stage.addChild(j), U.addChild(Q), stage.addChild(U);
  915. window.showGameOver = function() {
  916. Modal.show(new O)
  917. }, window.showRateGame = function() {
  918. Modal.show(new RateGameModal(embed("image/star.png"), 9014527))
  919. }, window.reset = y, resizeCallbacks.push(f), window.Social && window.Social(), ga("send", "event", "Hex", "Loaded", "Load Time", 1 * new Date - initTime), v(), setTimeout(window.onresize, 100)
  920. }
  921. function preloader() {
  922. function t() {
  923. o.width = width * ratio + 5, o.height = height * ratio + 5, s.fillStyle = "rgb(255, 255, 255)", s.fillRect(0, 0, o.width, o.height);
  924. var t = s.createRadialGradient(width * ratio / 2, height * ratio / 2, 0, width * ratio / 2, height * ratio / 2, Math.max(width * ratio / 2, height * ratio / 2));
  925. t.addColorStop(0, "rgb(255, 255, 255)"), t.addColorStop(1, "rgb(200, 200, 200)"), s.fillStyle = t, s.fillRect(0, 0, o.width, o.height), n.texture.destroy(!0), n.setTexture(new PIXI.Texture.fromCanvas(o))
  926. }
  927. function e() {
  928. a.clear(), a.beginFill(0, 0), a.lineStyle(1, 11513775), a.drawRect(0, 0, r.width, 15 * ratio * scale), a.lineStyle(0, 0), a.beginFill(31666), a.drawRect(0, 0, r.width * h, 15 * ratio * scale)
  929. }
  930. function i() {
  931. t(), scale = Math.min(Math.min(width / l * .8, height / l * .8), 1), r.scale.x = scale * ratio, r.scale.y = scale * ratio, r.x = width * ratio / 2 - l * scale * ratio / 2 >> 0, r.y = height * ratio / 2 - l * scale * ratio / 2 >> 0, a.x = r.x, a.y = r.y + r.height + .05 * r.height >> 0, e()
  932. }
  933. var r = new Sprite(embed("image/frvrlogo.png"));
  934. r.ratio = 1;
  935. var n = new PIXI.Sprite(PIXI.Texture.emptyTexture);
  936. n.cacheAsBitmap = !0, n.interactive = !0;
  937. var o = document.createElement("canvas"),
  938. s = o.getContext("2d");
  939. n._renderWebGL = function(t) {
  940. this._dirtyTexture && (this._dirtyTexture = !1, PIXI.updateWebGLTexture(this.texture.baseTexture, t.gl)), PIXI.Sprite.prototype._renderWebGL.call(this, t)
  941. };
  942. var a = new PIXI.Graphics,
  943. h = 0,
  944. l = r.width;
  945. window.isCordova || (stageContainer.addChild(n), stageContainer.addChild(r), stageContainer.addChild(a)), resizeCallbacks.push(i), i(), preload(function() {
  946. stageContainer.removeChild(n), stageContainer.removeChild(r), stageContainer.removeChild(a), removeResizeCallback(i), n.texture.destroy(!0), o = s = null, r.texture.destroy(!0)
  947. }, Sidebar, game, window.onresize)(function(t, i) {
  948. h = (t - i) / t, e(), window.dirty = !0
  949. })
  950. }
  951. function Social() {
  952. function t() {
  953. var t = document.createElement("iframe");
  954. t.src = "", t.style.visibility = "hidden", document.body.appendChild(t), setTimeout(function() {
  955. document.body.removeChild(t)
  956. }, 1e3)
  957. }
  958. function e() {
  959. function e(t) {
  960. s && Sidebar.removeMenuItem(s), Parse.FacebookUtils.logIn(null, {
  961. success: function(e) {
  962. t && t(!0), i(!0), window.onParseLoginSuccess(e)
  963. },
  964. error: function(e, i) {
  965. t && t(!1)
  966. }
  967. })
  968. }
  969. function i(t) {
  970. window.isFacebookApp || (s = t ? Sidebar.addMenuItem(Sprite.fromSheet(Sidebar.icons, 0), "Logout", function() {
  971. Sidebar.removeMenuItem(s), FB.logout(function(t) {
  972. i(!1)
  973. })
  974. }) : Sidebar.addMenuItem(Sprite.fromSheet(Sidebar.icons, 0), "Login with Facebook", function() {
  975. Sidebar.removeMenuItem(s), e()
  976. }))
  977. }
  978. function r() {
  979. function t() {
  980. return " " + (new Date).getTime()
  981. }
  982. var e = document.createElement("div");
  983. e.style.position = "absolute", e.style.height = "90px", e.style.bottom = "-100px", e.style.left = "50%";
  984. var i = document.createElement("iframe");
  985. i.src = t(), i.frameborder = "0", i.scrolling = "no", i.allowTransparency = "true", i.id = "adframe", i.style.cssText = "border:none; overflow:hidden;height:90px;width:728px;margin-left:-364px", e.appendChild(i), document.body.appendChild(e), window.showGameOverAd = function() {
  986. height / ratio > 550 && (e.style.bottom = "0px")
  987. }, window.hideGameOverAd = function() {
  988. e.style.bottom = "-100px", i.src = t()
  989. }
  990. }
  991. function n() {
  992. var t = document.createElement("iframe");
  993. t.src = Config.facebookLikeUrl, t.frameborder = "0", t.scrolling = "no", t.allowTransparency = "true", t.id = "fbframe", t.style.cssText = "border:none; overflow:hidden; height:21px; width:100px;", a.appendChild(t)
  994. }
  995. function o() {
  996. window.Parse ? (Parse.initialize(Config.parseId, Config.parseKey), function(t, e, i) {
  997. var r, n = t.getElementsByTagName(e)[0];
  998. t.getElementById(i) || (r = t.createElement(e), r.id = i, r.src = "", n.parentNode.insertBefore(r, n))
  999. }(document, "script", "facebook-jssdk"), window.fbAsyncInit = function() {
  1000. window.shareDialogueCallback = function(t) {
  1001. FB.ui({
  1002. method: "share",
  1003. href: ""
  1004. }, function(t) {})
  1005. }, Parse.FacebookUtils.init({
  1006. appId: Config.facebookAppId,
  1007. status: !1,
  1008. cookie: !0,
  1009. xfbml: !0,
  1010. version: "v2.2"
  1011. }), FB.getLoginStatus(function(r) {
  1012. window.isFacebookApp || Sidebar.addMenuHeader("Save your progress!"), "connected" === r.status ? e() : (window.isFacebookApp && e(), i(!1)), t()
  1013. })
  1014. }, console.log("Facebook loaded")) : setTimeout(o, 100)
  1015. }
  1016. var s;
  1017. window.isFacebookAppWeb && r();
  1018. var a = document.getElementById("overlay");
  1019. n(), window.overlayToggleCallbacks.push(function(t) {
  1020. a.style.visibility = t ? "hidden" : "visible"
  1021. }), a.style.visibility = "visible", setInterval(function() {
  1022. a.className = "", setTimeout(function() {
  1023. a.className = "w"
  1024. }, 500)
  1025. }, 18e4), load(""), o()
  1026. }
  1027. function i() {
  1028. window.kik && kik.enabled && kik.send && (window.shareDialogueCallback = function(t) {
  1029. kik.send({
  1030. title: "Hex FRVR",
  1031. text: t || "I think you will like Hex FRVR!",
  1032. pic: ""
  1033. })
  1034. })
  1035. }
  1036. window.showInterstitialAd = function() {
  1037. var t = parseInt(Store.get("playCount")) || 0;
  1038. Store.set("playCount", t + 1), t > 3 && 2 * Math.random() >> 0 == 0 && (window.isAndroid && !window.isSilk && Config.androidInstallBannerURL && Config.androidInstallURL ? (Modal.show(new InstallGameModal(Config.androidInstallBannerURL, Config.androidInstallURL, Sidebar.showIcon)), Sidebar.hideIcon(), window.toggleOverlay(!0)) : window.isiOS && Config.iOSInstallBannerURL && Config.iOSInstallURL && (Modal.show(new InstallGameModal(Config.iOSInstallBannerURL, Config.iOSInstallURL, Sidebar.showIcon)), Sidebar.hideIcon(), window.toggleOverlay(!0)))
  1039. }, window.isKik ? i() : window.isKongregate || e()
  1040. }
  1041. var PIXI = PIXI || {};
  1042. PIXI.WEBGL_RENDERER = 0, PIXI.CANVAS_RENDERER = 1, PIXI.VERSION = "v2.2.3", PIXI.blendModes = {
  1043. NORMAL: 0,
  1044. ADD: 1,
  1045. MULTIPLY: 2,
  1046. SCREEN: 3,
  1047. OVERLAY: 4,
  1048. DARKEN: 5,
  1049. LIGHTEN: 6,
  1050. COLOR_DODGE: 7,
  1051. COLOR_BURN: 8,
  1052. HARD_LIGHT: 9,
  1053. SOFT_LIGHT: 10,
  1054. DIFFERENCE: 11,
  1055. EXCLUSION: 12,
  1056. HUE: 13,
  1057. SATURATION: 14,
  1058. COLOR: 15,
  1059. LUMINOSITY: 16
  1060. }, PIXI.scaleModes = {
  1061. DEFAULT: 0,
  1062. LINEAR: 0,
  1063. NEAREST: 1
  1064. }, PIXI._UID = 0, "undefined" != typeof Float32Array ? (PIXI.Float32Array = Float32Array, PIXI.Uint16Array = Uint16Array, PIXI.Uint32Array = Uint32Array, PIXI.ArrayBuffer = ArrayBuffer) : (PIXI.Float32Array = Array, PIXI.Uint16Array = Array), PIXI.INTERACTION_FREQUENCY = 30, PIXI.AUTO_PREVENT_DEFAULT = !0, PIXI.PI_2 = 2 * Math.PI, PIXI.RAD_TO_DEG = 180 / Math.PI, PIXI.DEG_TO_RAD = Math.PI / 180, PIXI.RETINA_PREFIX = "@2x", PIXI.dontSayHello = !1, PIXI.defaultRenderOptions = {
  1065. view: null,
  1066. transparent: !1,
  1067. antialias: !1,
  1068. preserveDrawingBuffer: !1,
  1069. resolution: 1,
  1070. clearBeforeRender: !0,
  1071. autoResize: !1
  1072. }, PIXI.sayHello = function(t) {
  1073. if (!PIXI.dontSayHello) {
  1074. if (navigator.userAgent.toLowerCase().indexOf("chrome") > -1) {
  1075. var e = ["%c %c %c Pixi.js " + PIXI.VERSION + " - " + t + " %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ ", "background: #ff66a5", "background: #ff66a5", "color: #ff66a5; background: #030307;", "background: #ff66a5", "background: #ffc3dc", "background: #ff66a5", "color: #ff2424; background: #fff", "color: #ff2424; background: #fff", "color: #ff2424; background: #fff"];
  1076. console.log.apply(console, e)
  1077. } else window.console && console.log("Pixi.js " + PIXI.VERSION + " - http://www.pixijs.com/");
  1078. PIXI.dontSayHello = !0
  1079. }
  1080. }, PIXI.Point = function(t, e) {
  1081. this.x = t || 0, this.y = e || 0
  1082. }, PIXI.Point.prototype.clone = function() {
  1083. return new PIXI.Point(this.x, this.y)
  1084. }, PIXI.Point.prototype.set = function(t, e) {
  1085. this.x = t || 0, this.y = e || (0 !== e ? this.x : 0)
  1086. }, PIXI.Point.prototype.constructor = PIXI.Point, PIXI.Rectangle = function(t, e, i, r) {
  1087. this.x = t || 0, this.y = e || 0, this.width = i || 0, this.height = r || 0
  1088. }, PIXI.Rectangle.prototype.clone = function() {
  1089. return new PIXI.Rectangle(this.x, this.y, this.width, this.height)
  1090. }, PIXI.Rectangle.prototype.contains = function(t, e) {
  1091. if (this.width <= 0 || this.height <= 0) return !1;
  1092. var i = this.x;
  1093. if (t >= i && t <= i + this.width) {
  1094. var r = this.y;
  1095. if (e >= r && e <= r + this.height) return !0
  1096. }
  1097. return !1
  1098. }, PIXI.Rectangle.prototype.constructor = PIXI.Rectangle, PIXI.EmptyRectangle = new PIXI.Rectangle(0, 0, 0, 0), PIXI.Polygon = function(t) {
  1099. if (t instanceof Array || (t = Array.prototype.slice.call(arguments)), t[0] instanceof PIXI.Point) {
  1100. for (var e = [], i = 0, r = t.length; r > i; i++) e.push(t[i].x, t[i].y);
  1101. t = e
  1102. }
  1103. this.closed = !0, this.points = t
  1104. }, PIXI.Polygon.prototype.clone = function() {
  1105. var t = this.points.slice();
  1106. return new PIXI.Polygon(t)
  1107. }, PIXI.Polygon.prototype.contains = function(t, e) {
  1108. for (var i = !1, r = this.points.length / 2, n = 0, o = r - 1; r > n; o = n++) {
  1109. var s = this.points[2 * n],
  1110. a = this.points[2 * n + 1],
  1111. h = this.points[2 * o],
  1112. l = this.points[2 * o + 1],
  1113. c = a > e != l > e && (h - s) * (e - a) / (l - a) + s > t;
  1114. c && (i = !i)
  1115. }
  1116. return i
  1117. }, PIXI.Polygon.prototype.constructor = PIXI.Polygon, PIXI.Circle = function(t, e, i) {
  1118. this.x = t || 0, this.y = e || 0, this.radius = i || 0
  1119. }, PIXI.Circle.prototype.clone = function() {
  1120. return new PIXI.Circle(this.x, this.y, this.radius)
  1121. }, PIXI.Circle.prototype.contains = function(t, e) {
  1122. if (this.radius <= 0) return !1;
  1123. var i = this.x - t,
  1124. r = this.y - e,
  1125. n = this.radius * this.radius;
  1126. return i *= i, r *= r, n >= i + r
  1127. }, PIXI.Circle.prototype.getBounds = function() {
  1128. return new PIXI.Rectangle(this.x - this.radius, this.y - this.radius, 2 * this.radius, 2 * this.radius)
  1129. }, PIXI.Circle.prototype.constructor = PIXI.Circle, PIXI.Ellipse = function(t, e, i, r) {
  1130. this.x = t || 0, this.y = e || 0, this.width = i || 0, this.height = r || 0
  1131. }, PIXI.Ellipse.prototype.clone = function() {
  1132. return new PIXI.Ellipse(this.x, this.y, this.width, this.height);
  1133. }, PIXI.Ellipse.prototype.contains = function(t, e) {
  1134. if (this.width <= 0 || this.height <= 0) return !1;
  1135. var i = (t - this.x) / this.width,
  1136. r = (e - this.y) / this.height;
  1137. return i *= i, r *= r, 1 >= i + r
  1138. }, PIXI.Ellipse.prototype.getBounds = function() {
  1139. return new PIXI.Rectangle(this.x - this.width, this.y - this.height, this.width, this.height)
  1140. }, PIXI.Ellipse.prototype.constructor = PIXI.Ellipse, PIXI.RoundedRectangle = function(t, e, i, r, n) {
  1141. this.x = t || 0, this.y = e || 0, this.width = i || 0, this.height = r || 0, this.radius = n || 20
  1142. }, PIXI.RoundedRectangle.prototype.clone = function() {
  1143. return new PIXI.RoundedRectangle(this.x, this.y, this.width, this.height, this.radius)
  1144. }, PIXI.RoundedRectangle.prototype.contains = function(t, e) {
  1145. if (this.width <= 0 || this.height <= 0) return !1;
  1146. var i = this.x;
  1147. if (t >= i && t <= i + this.width) {
  1148. var r = this.y;
  1149. if (e >= r && e <= r + this.height) return !0
  1150. }
  1151. return !1
  1152. }, PIXI.RoundedRectangle.prototype.constructor = PIXI.RoundedRectangle, PIXI.Matrix = function() {
  1153. this.a = 1, this.b = 0, this.c = 0, this.d = 1, this.tx = 0, this.ty = 0
  1154. }, PIXI.Matrix.prototype.fromArray = function(t) {
  1155. this.a = t[0], this.b = t[1], this.c = t[3], this.d = t[4], this.tx = t[2], this.ty = t[5]
  1156. }, PIXI.Matrix.prototype.toArray = function(t) {
  1157. this.array || (this.array = new PIXI.Float32Array(9));
  1158. var e = this.array;
  1159. return t ? (e[0] = this.a, e[1] = this.b, e[2] = 0, e[3] = this.c, e[4] = this.d, e[5] = 0, e[6] = this.tx, e[7] = this.ty, e[8] = 1) : (e[0] = this.a, e[1] = this.c, e[2] = this.tx, e[3] = this.b, e[4] = this.d, e[5] = this.ty, e[6] = 0, e[7] = 0, e[8] = 1), e
  1160. }, PIXI.Matrix.prototype.apply = function(t, e) {
  1161. return e = e || new PIXI.Point, e.x = this.a * t.x + this.c * t.y + this.tx, e.y = this.b * t.x + this.d * t.y + this.ty, e
  1162. }, PIXI.Matrix.prototype.applyInverse = function(t, e) {
  1163. e = e || new PIXI.Point;
  1164. var i = 1 / (this.a * this.d + this.c * -this.b);
  1165. return e.x = this.d * i * t.x + -this.c * i * t.y + (this.ty * this.c - this.tx * this.d) * i, e.y = this.a * i * t.y + -this.b * i * t.x + (-this.ty * this.a + this.tx * this.b) * i, e
  1166. }, PIXI.Matrix.prototype.translate = function(t, e) {
  1167. return this.tx += t, this.ty += e, this
  1168. }, PIXI.Matrix.prototype.scale = function(t, e) {
  1169. return this.a *= t, this.d *= e, this.c *= t, this.b *= e, this.tx *= t, this.ty *= e, this
  1170. }, PIXI.Matrix.prototype.rotate = function(t) {
  1171. var e = Math.cos(t),
  1172. i = Math.sin(t),
  1173. r = this.a,
  1174. n = this.c,
  1175. o = this.tx;
  1176. return this.a = r * e - this.b * i, this.b = r * i + this.b * e, this.c = n * e - this.d * i, this.d = n * i + this.d * e, this.tx = o * e - this.ty * i, this.ty = o * i + this.ty * e, this
  1177. }, PIXI.Matrix.prototype.append = function(t) {
  1178. var e = this.a,
  1179. i = this.b,
  1180. r = this.c,
  1181. n = this.d;
  1182. return this.a = t.a * e + t.b * r, this.b = t.a * i + t.b * n, this.c = t.c * e + t.d * r, this.d = t.c * i + t.d * n, this.tx = t.tx * e + t.ty * r + this.tx, this.ty = t.tx * i + t.ty * n + this.ty, this
  1183. }, PIXI.Matrix.prototype.identity = function() {
  1184. return this.a = 1, this.b = 0, this.c = 0, this.d = 1, this.tx = 0, this.ty = 0, this
  1185. }, PIXI.identityMatrix = new PIXI.Matrix, PIXI.DisplayObject = function() {
  1186. this.position = new PIXI.Point, this.scale = new PIXI.Point(1, 1), this.pivot = new PIXI.Point(0, 0), this.rotation = 0, this.alpha = 1, this.visible = !0, this.hitArea = null, this.buttonMode = !1, this.renderable = !1, this.parent = null, this.stage = null, this.worldAlpha = 1, this._interactive = !1, this.defaultCursor = "pointer", this.worldTransform = new PIXI.Matrix, this._sr = 0, this._cr = 1, this.filterArea = null, this._bounds = new PIXI.Rectangle(0, 0, 1, 1), this._currentBounds = null, this._mask = null, this._cacheAsBitmap = !1, this._cacheIsDirty = !1
  1187. }, PIXI.DisplayObject.prototype.constructor = PIXI.DisplayObject, Object.defineProperty(PIXI.DisplayObject.prototype, "interactive", {
  1188. get: function() {
  1189. return this._interactive
  1190. },
  1191. set: function(t) {
  1192. this._interactive = t, this.stage && (this.stage.dirty = !0)
  1193. }
  1194. }), Object.defineProperty(PIXI.DisplayObject.prototype, "worldVisible", {
  1195. get: function() {
  1196. var t = this;
  1197. do {
  1198. if (!t.visible) return !1;
  1199. t = t.parent
  1200. } while (t);
  1201. return !0
  1202. }
  1203. }), Object.defineProperty(PIXI.DisplayObject.prototype, "mask", {
  1204. get: function() {
  1205. return this._mask
  1206. },
  1207. set: function(t) {
  1208. this._mask && (this._mask.isMask = !1), this._mask = t, this._mask && (this._mask.isMask = !0)
  1209. }
  1210. }), Object.defineProperty(PIXI.DisplayObject.prototype, "filters", {
  1211. get: function() {
  1212. return this._filters
  1213. },
  1214. set: function(t) {
  1215. if (t) {
  1216. for (var e = [], i = 0; i < t.length; i++)
  1217. for (var r = t[i].passes, n = 0; n < r.length; n++) e.push(r[n]);
  1218. this._filterBlock = {
  1219. target: this,
  1220. filterPasses: e
  1221. }
  1222. }
  1223. this._filters = t
  1224. }
  1225. }), Object.defineProperty(PIXI.DisplayObject.prototype, "cacheAsBitmap", {
  1226. get: function() {
  1227. return this._cacheAsBitmap
  1228. },
  1229. set: function(t) {
  1230. this._cacheAsBitmap !== t && (t ? this._generateCachedSprite() : this._destroyCachedSprite(), this._cacheAsBitmap = t)
  1231. }
  1232. }), PIXI.DisplayObject.prototype.updateTransform = function() {
  1233. var t, e, i, r, n, o, s = this.parent.worldTransform,
  1234. a = this.worldTransform;
  1235. this.rotation % PIXI.PI_2 ? (this.rotation !== this.rotationCache && (this.rotationCache = this.rotation, this._sr = Math.sin(this.rotation), this._cr = Math.cos(this.rotation)), t = this._cr * this.scale.x, e = this._sr * this.scale.x, i = -this._sr * this.scale.y, r = this._cr * this.scale.y, n = this.position.x, o = this.position.y, (this.pivot.x || this.pivot.y) && (n -= this.pivot.x * t + this.pivot.y * i, o -= this.pivot.x * e + this.pivot.y * r), a.a = t * s.a + e * s.c, a.b = t * s.b + e * s.d, a.c = i * s.a + r * s.c, a.d = i * s.b + r * s.d, a.tx = n * s.a + o * s.c + s.tx, a.ty = n * s.b + o * s.d + s.ty) : (t = this.scale.x, r = this.scale.y, n = this.position.x - this.pivot.x * t, o = this.position.y - this.pivot.y * r, a.a = t * s.a, a.b = t * s.b, a.c = r * s.c, a.d = r * s.d, a.tx = n * s.a + o * s.c + s.tx, a.ty = n * s.b + o * s.d + s.ty), this.worldAlpha = this.alpha * this.parent.worldAlpha
  1236. }, PIXI.DisplayObject.prototype.displayObjectUpdateTransform = PIXI.DisplayObject.prototype.updateTransform, PIXI.DisplayObject.prototype.getBounds = function(t) {
  1237. return t = t, PIXI.EmptyRectangle
  1238. }, PIXI.DisplayObject.prototype.getLocalBounds = function() {
  1239. return this.getBounds(PIXI.identityMatrix)
  1240. }, PIXI.DisplayObject.prototype.setStageReference = function(t) {
  1241. this.stage = t, this._interactive && (this.stage.dirty = !0)
  1242. }, PIXI.DisplayObject.prototype.generateTexture = function(t, e, i) {
  1243. var r = this.getLocalBounds(),
  1244. n = new PIXI.RenderTexture(0 | r.width, 0 | r.height, i, e, t);
  1245. return PIXI.DisplayObject._tempMatrix.tx = -r.x, PIXI.DisplayObject._tempMatrix.ty = -r.y, n.render(this, PIXI.DisplayObject._tempMatrix), n
  1246. }, PIXI.DisplayObject.prototype.updateCache = function() {
  1247. this._generateCachedSprite()
  1248. }, PIXI.DisplayObject.prototype.toGlobal = function(t) {
  1249. return this.displayObjectUpdateTransform(), this.worldTransform.apply(t)
  1250. }, PIXI.DisplayObject.prototype.toLocal = function(t, e) {
  1251. return e && (t = e.toGlobal(t)), this.displayObjectUpdateTransform(), this.worldTransform.applyInverse(t)
  1252. }, PIXI.DisplayObject.prototype._renderCachedSprite = function(t) {
  1253. this._cachedSprite.worldAlpha = this.worldAlpha, t.gl ? PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, t) : PIXI.Sprite.prototype._renderCanvas.call(this._cachedSprite, t)
  1254. }, PIXI.DisplayObject.prototype._generateCachedSprite = function() {
  1255. this._cacheAsBitmap = !1;
  1256. var t = this.getLocalBounds();
  1257. if (this._cachedSprite) this._cachedSprite.texture.resize(0 | t.width, 0 | t.height);
  1258. else {
  1259. var e = new PIXI.RenderTexture(0 | t.width, 0 | t.height);
  1260. this._cachedSprite = new PIXI.Sprite(e), this._cachedSprite.worldTransform = this.worldTransform
  1261. }
  1262. var i = this._filters;
  1263. this._filters = null, this._cachedSprite.filters = i, PIXI.DisplayObject._tempMatrix.tx = -t.x, PIXI.DisplayObject._tempMatrix.ty = -t.y, this._cachedSprite.texture.render(this, PIXI.DisplayObject._tempMatrix, !0), this._cachedSprite.anchor.x = -(t.x / t.width), this._cachedSprite.anchor.y = -(t.y / t.height), this._filters = i, this._cacheAsBitmap = !0
  1264. }, PIXI.DisplayObject.prototype._destroyCachedSprite = function() {
  1265. this._cachedSprite && (this._cachedSprite.texture.destroy(!0), this._cachedSprite = null)
  1266. }, PIXI.DisplayObject.prototype._renderWebGL = function(t) {
  1267. t = t
  1268. }, PIXI.DisplayObject.prototype._renderCanvas = function(t) {
  1269. t = t
  1270. }, PIXI.DisplayObject._tempMatrix = new PIXI.Matrix, Object.defineProperty(PIXI.DisplayObject.prototype, "x", {
  1271. get: function() {
  1272. return this.position.x
  1273. },
  1274. set: function(t) {
  1275. this.position.x = t
  1276. }
  1277. }), Object.defineProperty(PIXI.DisplayObject.prototype, "y", {
  1278. get: function() {
  1279. return this.position.y
  1280. },
  1281. set: function(t) {
  1282. this.position.y = t
  1283. }
  1284. }), PIXI.DisplayObjectContainer = function() {
  1285. PIXI.DisplayObject.call(this), this.children = []
  1286. }, PIXI.DisplayObjectContainer.prototype = Object.create(PIXI.DisplayObject.prototype), PIXI.DisplayObjectContainer.prototype.constructor = PIXI.DisplayObjectContainer, Object.defineProperty(PIXI.DisplayObjectContainer.prototype, "width", {
  1287. get: function() {
  1288. return this.scale.x * this.getLocalBounds().width
  1289. },
  1290. set: function(t) {
  1291. var e = this.getLocalBounds().width;
  1292. 0 !== e ? this.scale.x = t / e : this.scale.x = 1, this._width = t
  1293. }
  1294. }), Object.defineProperty(PIXI.DisplayObjectContainer.prototype, "height", {
  1295. get: function() {
  1296. return this.scale.y * this.getLocalBounds().height
  1297. },
  1298. set: function(t) {
  1299. var e = this.getLocalBounds().height;
  1300. 0 !== e ? this.scale.y = t / e : this.scale.y = 1, this._height = t
  1301. }
  1302. }), PIXI.DisplayObjectContainer.prototype.addChild = function(t) {
  1303. return window.dirtyOnce = !0, this.addChildAt(t, this.children.length)
  1304. }, PIXI.DisplayObjectContainer.prototype.addChildAt = function(t, e) {
  1305. if (e >= 0 && e <= this.children.length) return window.dirtyOnce = !0, t.parent && t.parent.removeChild(t), t.parent = this, this.children.splice(e, 0, t), this.stage && t.setStageReference(this.stage), t;
  1306. throw new Error(t + "addChildAt: The index " + e + " supplied is out of bounds " + this.children.length)
  1307. }, PIXI.DisplayObjectContainer.prototype.getChildIndex = function(t) {
  1308. var e = this.children.indexOf(t);
  1309. if (-1 === e) throw new Error("The supplied DisplayObject must be a child of the caller");
  1310. return e
  1311. }, PIXI.DisplayObjectContainer.prototype.setChildIndex = function(t, e) {
  1312. if (0 > e || e >= this.children.length) throw new Error("The supplied index is out of bounds");
  1313. window.dirtyOnce = !0;
  1314. var i = this.getChildIndex(t);
  1315. this.children.splice(i, 1), this.children.splice(e, 0, t)
  1316. }, PIXI.DisplayObjectContainer.prototype.getChildAt = function(t) {
  1317. if (0 > t || t >= this.children.length) throw new Error("getChildAt: Supplied index " + t + " does not exist in the child list, or the supplied DisplayObject must be a child of the caller");
  1318. return this.children[t]
  1319. }, PIXI.DisplayObjectContainer.prototype.removeChild = function(t) {
  1320. var e = this.children.indexOf(t);
  1321. if (-1 !== e) return window.dirtyOnce = !0, this.removeChildAt(e)
  1322. }, PIXI.DisplayObjectContainer.prototype.removeChildAt = function(t) {
  1323. var e = this.getChildAt(t);
  1324. return this.stage && e.removeStageReference(), window.dirtyOnce = !0, e.parent = void 0, this.children.splice(t, 1), e
  1325. }, PIXI.DisplayObjectContainer.prototype.updateTransform = function() {
  1326. if (this.visible && (this.displayObjectUpdateTransform(), !this._cacheAsBitmap))
  1327. for (var t = 0, e = this.children.length; e > t; t++) this.children[t].updateTransform()
  1328. }, PIXI.DisplayObjectContainer.prototype.displayObjectContainerUpdateTransform = PIXI.DisplayObjectContainer.prototype.updateTransform, PIXI.DisplayObjectContainer.prototype.getBounds = function() {
  1329. if (0 === this.children.length) return PIXI.EmptyRectangle;
  1330. for (var t, e, i, r = 1 / 0, n = 1 / 0, o = -(1 / 0), s = -(1 / 0), a = !1, h = 0, l = this.children.length; l > h; h++) {
  1331. var c = this.children[h];
  1332. c.visible && (a = !0, t = this.children[h].getBounds(), r = r < t.x ? r : t.x, n = n < t.y ? n : t.y, e = t.width + t.x, i = t.height + t.y, o = o > e ? o : e, s = s > i ? s : i)
  1333. }
  1334. if (!a) return PIXI.EmptyRectangle;
  1335. var d = this._bounds;
  1336. return d.x = r, d.y = n, d.width = o - r, d.height = s - n, d
  1337. }, PIXI.DisplayObjectContainer.prototype.getLocalBounds = function() {
  1338. var t = this.worldTransform;
  1339. this.worldTransform = PIXI.identityMatrix;
  1340. for (var e = 0, i = this.children.length; i > e; e++) this.children[e].updateTransform();
  1341. var r = this.getBounds();
  1342. return this.worldTransform = t, r
  1343. }, PIXI.DisplayObjectContainer.prototype.setStageReference = function(t) {
  1344. this.stage = t, this._interactive && (this.stage.dirty = !0);
  1345. for (var e = 0, i = this.children.length; i > e; e++) {
  1346. var r = this.children[e];
  1347. r.setStageReference(t)
  1348. }
  1349. }, PIXI.DisplayObjectContainer.prototype.removeStageReference = function() {
  1350. for (var t = 0, e = this.children.length; e > t; t++) {
  1351. var i = this.children[t];
  1352. i.removeStageReference()
  1353. }
  1354. this._interactive && (this.stage.dirty = !0), this.stage = null
  1355. }, PIXI.DisplayObjectContainer.prototype._renderWebGL = function(t) {
  1356. if (this.visible && !(this.alpha <= 0)) {
  1357. if (this._cacheAsBitmap) return void this._renderCachedSprite(t);
  1358. var e, i;
  1359. if (this._mask || this._filters) {
  1360. for (this._mask && (t.spriteBatch.stop(), t.maskManager.pushMask(this.mask, t), t.spriteBatch.start()), e = 0, i = this.children.length; i > e; e++) this.children[e]._renderWebGL(t);
  1361. t.spriteBatch.stop(), this._mask && t.maskManager.popMask(this._mask, t), t.spriteBatch.start()
  1362. } else
  1363. for (e = 0, i = this.children.length; i > e; e++) this.children[e]._renderWebGL(t)
  1364. }
  1365. }, PIXI.DisplayObjectContainer.prototype._renderCanvas = function(t) {
  1366. if (this.visible !== !1 && 0 !== this.alpha) {
  1367. if (this._cacheAsBitmap) return void this._renderCachedSprite(t);
  1368. this._mask && t.maskManager.pushMask(this._mask, t);
  1369. for (var e = 0, i = this.children.length; i > e; e++) {
  1370. var r = this.children[e];
  1371. r._renderCanvas(t)
  1372. }
  1373. this._mask && t.maskManager.popMask(t)
  1374. }
  1375. }, PIXI.Sprite = function(t) {
  1376. PIXI.DisplayObjectContainer.call(this), this.anchor = new PIXI.Point, this.texture = t || PIXI.Texture.emptyTexture, this._width = 0, this._height = 0, this.tint = 16777215, this.blendMode = PIXI.blendModes.NORMAL, this.shader = null, this.texture.baseTexture.hasLoaded ? this.onTextureUpdate() : this.texture.on("update", this.onTextureUpdate.bind(this)), this.renderable = !0
  1377. }, PIXI.Sprite.prototype = Object.create(PIXI.DisplayObjectContainer.prototype), PIXI.Sprite.prototype.constructor = PIXI.Sprite, Object.defineProperty(PIXI.Sprite.prototype, "width", {
  1378. get: function() {
  1379. return this.scale.x * this.texture.frame.width
  1380. },
  1381. set: function(t) {
  1382. this.scale.x = t / this.texture.frame.width, this._width = t
  1383. }
  1384. }), Object.defineProperty(PIXI.Sprite.prototype, "height", {
  1385. get: function() {
  1386. return this.scale.y * this.texture.frame.height
  1387. },
  1388. set: function(t) {
  1389. this.scale.y = t / this.texture.frame.height, this._height = t
  1390. }
  1391. }), PIXI.Sprite.prototype.setTexture = function(t) {
  1392. this.texture = t, this.cachedTint = 16777215
  1393. }, PIXI.Sprite.prototype.onTextureUpdate = function() {
  1394. this._width && (this.scale.x = this._width / this.texture.frame.width), this._height && (this.scale.y = this._height / this.texture.frame.height)
  1395. }, PIXI.Sprite.prototype.getBounds = function(t) {
  1396. var e = this.texture.frame.width,
  1397. i = this.texture.frame.height,
  1398. r = e * (1 - this.anchor.x),
  1399. n = e * -this.anchor.x,
  1400. o = i * (1 - this.anchor.y),
  1401. s = i * -this.anchor.y,
  1402. a = t || this.worldTransform,
  1403. h = a.a,
  1404. l = a.b,
  1405. c = a.c,
  1406. d = a.d,
  1407. u = a.tx,
  1408. p = a.ty,
  1409. f = -(1 / 0),
  1410. I = -(1 / 0),
  1411. g = 1 / 0,
  1412. v = 1 / 0;
  1413. if (0 === l && 0 === c) 0 > h && (h *= -1), 0 > d && (d *= -1), g = h * n + u, f = h * r + u, v = d * s + p, I = d * o + p;
  1414. else {
  1415. var y = h * n + c * s + u,
  1416. w = d * s + l * n + p,
  1417. P = h * r + c * s + u,
  1418. m = d * s + l * r + p,
  1419. x = h * r + c * o + u,
  1420. b = d * o + l * r + p,
  1421. T = h * n + c * o + u,
  1422. X = d * o + l * n + p;
  1423. g = g > y ? y : g, g = g > P ? P : g, g = g > x ? x : g, g = g > T ? T : g, v = v > w ? w : v, v = v > m ? m : v, v = v > b ? b : v, v = v > X ? X : v, f = y > f ? y : f, f = P > f ? P : f, f = x > f ? x : f, f = T > f ? T : f, I = w > I ? w : I, I = m > I ? m : I, I = b > I ? b : I, I = X > I ? X : I
  1424. }
  1425. var S = this._bounds;
  1426. return S.x = g, S.width = f - g, S.y = v, S.height = I - v, this._currentBounds = S, S
  1427. }, PIXI.Sprite.prototype._renderWebGL = function(t) {
  1428. if (this.visible && !(this.alpha <= 0)) {
  1429. var e, i;
  1430. for (t.spriteBatch.render(this), e = 0, i = this.children.length; i > e; e++) this.children[e]._renderWebGL(t)
  1431. }
  1432. }, PIXI.Sprite.prototype._renderCanvas = function(t) {
  1433. if (!(this.visible === !1 || 0 === this.alpha || this.texture.crop.width <= 0 || this.texture.crop.height <= 0)) {
  1434. if (this.blendMode !== t.currentBlendMode && (t.currentBlendMode = this.blendMode, t.context.globalCompositeOperation = PIXI.blendModesCanvas[t.currentBlendMode]), this._mask && t.maskManager.pushMask(this._mask, t), this.texture.valid) {
  1435. var e = this.texture.baseTexture.resolution / t.resolution;
  1436. t.context.globalAlpha = this.worldAlpha, t.smoothProperty && t.scaleMode !== this.texture.baseTexture.scaleMode && (t.scaleMode = this.texture.baseTexture.scaleMode, t.context[t.smoothProperty] = t.scaleMode === PIXI.scaleModes.LINEAR);
  1437. var i = this.texture.trim ? this.texture.trim.x - this.anchor.x * this.texture.trim.width : this.anchor.x * -this.texture.frame.width,
  1438. r = this.texture.trim ? this.texture.trim.y - this.anchor.y * this.texture.trim.height : this.anchor.y * -this.texture.frame.height;
  1439. t.roundPixels ? (t.context.setTransform(this.worldTransform.a, this.worldTransform.b, this.worldTransform.c, this.worldTransform.d, this.worldTransform.tx * t.resolution | 0, this.worldTransform.ty * t.resolution | 0), i = 0 | i, r = 0 | r) : t.context.setTransform(this.worldTransform.a, this.worldTransform.b, this.worldTransform.c, this.worldTransform.d, this.worldTransform.tx * t.resolution, this.worldTransform.ty * t.resolution), 16777215 !== this.tint ? (this.cachedTint !== this.tint && (this.cachedTint = this.tint, this.tintedTexture = PIXI.CanvasTinter.getTintedTexture(this, this.tint)), t.context.drawImage(this.tintedTexture, 0, 0, this.texture.crop.width, this.texture.crop.height, i / e, r / e, this.texture.crop.width / e, this.texture.crop.height / e)) : t.context.drawImage(this.texture.baseTexture.source, this.texture.crop.x, this.texture.crop.y, this.texture.crop.width, this.texture.crop.height, i / e, r / e, this.texture.crop.width / e, this.texture.crop.height / e)
  1440. }
  1441. for (var n = 0, o = this.children.length; o > n; n++) this.children[n]._renderCanvas(t);
  1442. this._mask && t.maskManager.popMask(t)
  1443. }
  1444. }, PIXI.Sprite.fromFrame = function(t) {
  1445. var e = PIXI.TextureCache[t];
  1446. if (!e) throw new Error('The frameId "' + t + '" does not exist in the texture cache' + this);
  1447. return new PIXI.Sprite(e)
  1448. }, PIXI.Sprite.fromImage = function(t, e, i) {
  1449. var r = PIXI.Texture.fromImage(t, e, i);
  1450. return new PIXI.Sprite(r)
  1451. }, PIXI.SpriteBatch = function(t) {
  1452. PIXI.DisplayObjectContainer.call(this), this.textureThing = t, this.ready = !1
  1453. }, PIXI.SpriteBatch.prototype = Object.create(PIXI.DisplayObjectContainer.prototype), PIXI.SpriteBatch.prototype.constructor = PIXI.SpriteBatch, PIXI.SpriteBatch.prototype.initWebGL = function(t) {
  1454. this.fastSpriteBatch = new PIXI.WebGLFastSpriteBatch(t), this.ready = !0
  1455. }, PIXI.SpriteBatch.prototype.updateTransform = function() {
  1456. this.displayObjectUpdateTransform()
  1457. }, PIXI.SpriteBatch.prototype._renderWebGL = function(t) {
  1458. !this.visible || this.alpha <= 0 || !this.children.length || (this.ready || this.initWebGL(t.gl), t.spriteBatch.stop(), t.shaderManager.setShader(t.shaderManager.fastShader), this.fastSpriteBatch.begin(this, t), this.fastSpriteBatch.render(this), t.spriteBatch.start())
  1459. }, PIXI.SpriteBatch.prototype._renderCanvas = function(t) {
  1460. if (this.visible && !(this.alpha <= 0) && this.children.length) {
  1461. var e = t.context;
  1462. e.globalAlpha = this.worldAlpha, this.displayObjectUpdateTransform();
  1463. for (var i = this.worldTransform, r = !0, n = 0; n < this.children.length; n++) {
  1464. var o = this.children[n];
  1465. if (o.visible) {
  1466. var s = o.texture,
  1467. a = s.frame;
  1468. if (e.globalAlpha = this.worldAlpha * o.alpha, o.rotation % (2 * Math.PI) === 0) r && (e.setTransform(i.a, i.b, i.c, i.d, i.tx, i.ty), r = !1), e.drawImage(s.baseTexture.source, a.x, a.y, a.width, a.height, o.anchor.x * -a.width * o.scale.x + o.position.x + .5 | 0, o.anchor.y * -a.height * o.scale.y + o.position.y + .5 | 0, a.width * o.scale.x, a.height * o.scale.y);
  1469. else {
  1470. r || (r = !0), o.displayObjectUpdateTransform();
  1471. var h = o.worldTransform;
  1472. t.roundPixels ? e.setTransform(h.a, h.b, h.c, h.d, 0 | h.tx, 0 | h.ty) : e.setTransform(h.a, h.b, h.c, h.d, h.tx, h.ty), e.drawImage(s.baseTexture.source, a.x, a.y, a.width, a.height, o.anchor.x * -a.width + .5 | 0, o.anchor.y * -a.height + .5 | 0, a.width, a.height)
  1473. }
  1474. }
  1475. }
  1476. }
  1477. }, PIXI.Text = function(t, e) {
  1478. this.canvas = document.createElement("canvas"), this.context = this.canvas.getContext("2d"), this.resolution = 1, PIXI.Sprite.call(this, PIXI.Texture.fromCanvas(this.canvas)), this.setText(t), this.setStyle(e)
  1479. }, PIXI.Text.prototype = Object.create(PIXI.Sprite.prototype), PIXI.Text.prototype.constructor = PIXI.Text, Object.defineProperty(PIXI.Text.prototype, "width", {
  1480. get: function() {
  1481. return this.dirty && (this.updateText(), this.dirty = !1), this.scale.x * this.texture.frame.width
  1482. },
  1483. set: function(t) {
  1484. this.scale.x = t / this.texture.frame.width, this._width = t
  1485. }
  1486. }), Object.defineProperty(PIXI.Text.prototype, "height", {
  1487. get: function() {
  1488. return this.dirty && (this.updateText(), this.dirty = !1), this.scale.y * this.texture.frame.height
  1489. },
  1490. set: function(t) {
  1491. this.scale.y = t / this.texture.frame.height, this._height = t
  1492. }
  1493. }), PIXI.Text.prototype.setStyle = function(t) {
  1494. t = t || {}, t.font = t.font || "bold 20pt Arial", t.fill = t.fill || "black", t.align = t.align || "left", t.stroke = t.stroke || "black", t.strokeThickness = t.strokeThickness || 0, t.wordWrap = t.wordWrap || !1, t.wordWrapWidth = t.wordWrapWidth || 100, t.dropShadow = t.dropShadow || !1, t.dropShadowAngle = t.dropShadowAngle || Math.PI / 6, t.dropShadowDistance = t.dropShadowDistance || 4, t.dropShadowColor = t.dropShadowColor || "black", this.style = t, this.dirty = !0
  1495. }, PIXI.Text.prototype.setText = function(t) {
  1496. this.text = t.toString() || " ", this.dirty = !0
  1497. }, PIXI.Text.prototype.updateText = function() {
  1498. this.texture.baseTexture.resolution = this.resolution, this.context.font = this.style.font;
  1499. var t = this.text;
  1500. this.style.wordWrap && (t = this.wordWrap(this.text));
  1501. for (var e = t.split(/(?:\r\n|\r|\n)/), i = [], r = 0, n = this.determineFontProperties(this.style.font), o = 0; o < e.length; o++) {
  1502. var s = this.context.measureText(e[o]).width;
  1503. i[o] = s, r = Math.max(r, s)
  1504. }
  1505. var a = r + this.style.strokeThickness;
  1506. this.style.dropShadow && (a += this.style.dropShadowDistance), this.canvas.width = (a + this.context.lineWidth) * this.resolution;
  1507. var h = n.fontSize + this.style.strokeThickness,
  1508. l = h * e.length;
  1509. this.style.dropShadow && (l += this.style.dropShadowDistance), this.canvas.height = l * this.resolution, this.context.scale(this.resolution, this.resolution), this.context.font = this.style.font, this.context.strokeStyle = this.style.stroke, this.context.lineWidth = this.style.strokeThickness, this.context.textBaseline = "alphabetic";
  1510. var c, d;
  1511. if (this.style.dropShadow) {
  1512. this.context.fillStyle = this.style.dropShadowColor;
  1513. var u = Math.sin(this.style.dropShadowAngle) * this.style.dropShadowDistance,
  1514. p = Math.cos(this.style.dropShadowAngle) * this.style.dropShadowDistance;
  1515. for (o = 0; o < e.length; o++) c = this.style.strokeThickness / 2, d = this.style.strokeThickness / 2 + o * h + n.ascent, "right" === this.style.align ? c += r - i[o] : "center" === this.style.align && (c += (r - i[o]) / 2), this.style.fill && this.context.fillText(e[o], c + u, d + p)
  1516. }
  1517. for (this.context.fillStyle = this.style.fill, o = 0; o < e.length; o++) c = this.style.strokeThickness / 2, d = this.style.strokeThickness / 2 + o * h + n.ascent, "right" === this.style.align ? c += r - i[o] : "center" === this.style.align && (c += (r - i[o]) / 2), this.style.stroke && this.style.strokeThickness && this.context.strokeText(e[o], c, d), this.style.fill && this.context.fillText(e[o], c, d);
  1518. this.updateTexture()
  1519. }, PIXI.Text.prototype.updateTexture = function() {
  1520. this.texture.baseTexture.width = this.canvas.width, this.texture.baseTexture.height = this.canvas.height, this.texture.crop.width = this.texture.frame.width = this.canvas.width, this.texture.crop.height = this.texture.frame.height = this.canvas.height, this._width = this.canvas.width, this._height = this.canvas.height, this.texture.baseTexture.dirty()
  1521. }, PIXI.Text.prototype._renderWebGL = function(t) {
  1522. this.dirty && (this.resolution = t.resolution, this.updateText(), this.dirty = !1), PIXI.Sprite.prototype._renderWebGL.call(this, t)
  1523. }, PIXI.Text.prototype._renderCanvas = function(t) {
  1524. this.dirty && (this.resolution = t.resolution, this.updateText(), this.dirty = !1), PIXI.Sprite.prototype._renderCanvas.call(this, t)
  1525. }, PIXI.Text.prototype.determineFontProperties = function(t) {
  1526. var e = PIXI.Text.fontPropertiesCache[t];
  1527. if (!e) {
  1528. e = {};
  1529. var i = PIXI.Text.fontPropertiesCanvas,
  1530. r = PIXI.Text.fontPropertiesContext;
  1531. r.font = t;
  1532. var n = Math.ceil(r.measureText("|MÉq").width),
  1533. o = Math.ceil(r.measureText("M").width),
  1534. s = 2 * o;
  1535. o = 1.4 * o | 0, i.width = n, i.height = s, r.fillStyle = "#ffffff", r.fillRect(0, 0, n, s), r.font = t, r.textBaseline = "alphabetic", r.fillStyle = "#888888", r.fillText("|MÉq", 0, o);
  1536. var a, h, l = r.getImageData(0, 0, n, s).data,
  1537. c = l.length,
  1538. d = 4 * n,
  1539. u = 0,
  1540. p = !1;
  1541. for (a = 0; o > a; a++) {
  1542. for (h = 0; d > h; h += 4)
  1543. if (255 !== l[u + h]) {
  1544. p = !0;
  1545. break
  1546. }
  1547. if (p) break;
  1548. u += d
  1549. }
  1550. for (e.ascent = o - a, u = c - d, p = !1, a = s; a > o; a--) {
  1551. for (h = 0; d > h; h += 4)
  1552. if (255 !== l[u + h]) {
  1553. p = !0;
  1554. break
  1555. }
  1556. if (p) break;
  1557. u -= d
  1558. }
  1559. e.descent = a - o, e.fontSize = e.ascent + e.descent, PIXI.Text.fontPropertiesCache[t] = e
  1560. }
  1561. return e
  1562. }, PIXI.Text.prototype.wordWrap = function(t) {
  1563. for (var e = "", i = t.split("\n"), r = 0; r < i.length; r++) {
  1564. for (var n = this.style.wordWrapWidth, o = i[r].split(" "), s = 0; s < o.length; s++) {
  1565. var a = this.context.measureText(o[s]).width,
  1566. h = a + this.context.measureText(" ").width;
  1567. 0 === s || h > n ? (s > 0 && (e += "\n"), e += o[s], n = this.style.wordWrapWidth - a) : (n -= h, e += " " + o[s])
  1568. }
  1569. r < i.length - 1 && (e += "\n")
  1570. }
  1571. return e
  1572. }, PIXI.Text.prototype.getBounds = function(t) {
  1573. return this.dirty && (this.updateText(), this.dirty = !1), PIXI.Sprite.prototype.getBounds.call(this, t)
  1574. }, PIXI.Text.prototype.destroy = function(t) {
  1575. this.context = null, this.canvas = null, this.texture.destroy(void 0 === t ? !0 : t)
  1576. }, PIXI.Text.fontPropertiesCache = {}, PIXI.Text.fontPropertiesCanvas = document.createElement("canvas"), PIXI.Text.fontPropertiesContext = PIXI.Text.fontPropertiesCanvas.getContext("2d"), PIXI.InteractionData = function() {
  1577. this.global = new PIXI.Point, this.target = null, this.originalEvent = null
  1578. }, PIXI.InteractionData.prototype.getLocalPosition = function(t, e) {
  1579. var i = t.worldTransform,
  1580. r = this.global,
  1581. n = i.a,
  1582. o = i.c,
  1583. s = i.tx,
  1584. a = i.b,
  1585. h = i.d,
  1586. l = i.ty,
  1587. c = 1 / (n * h + o * -a);
  1588. return e = e || new PIXI.Point, e.x = h * c * r.x + -o * c * r.y + (l * o - s * h) * c, e.y = n * c * r.y + -a * c * r.x + (-l * n + s * a) * c, e
  1589. }, PIXI.InteractionData.prototype.constructor = PIXI.InteractionData, PIXI.InteractionManager = function(t) {
  1590. this.stage = t, this.mouse = new PIXI.InteractionData, this.touches = {}, this.tempPoint = new PIXI.Point, this.mouseoverEnabled = !0, this.pool = [], this.interactiveItems = [], this.interactionDOMElement = null, this.onMouseMove = this.onMouseMove.bind(this), this.onMouseDown = this.onMouseDown.bind(this), this.onMouseOut = this.onMouseOut.bind(this), this.onMouseUp = this.onMouseUp.bind(this), this.onTouchStart = this.onTouchStart.bind(this), this.onTouchEnd = this.onTouchEnd.bind(this), this.onTouchMove = this.onTouchMove.bind(this), this.last = 0, this.currentCursorStyle = "inherit", this.mouseOut = !1, this.resolution = 1, this._tempPoint = new PIXI.Point
  1591. }, PIXI.InteractionManager.prototype.constructor = PIXI.InteractionManager, PIXI.InteractionManager.prototype.collectInteractiveSprite = function(t, e) {
  1592. for (var i = t.children, r = i.length, n = r - 1; n >= 0; n--) {
  1593. var o = i[n];
  1594. o._interactive ? (e.interactiveChildren = !0, this.interactiveItems.push(o), o.children.length > 0 && this.collectInteractiveSprite(o, o)) : (o.__iParent = null, o.children.length > 0 && this.collectInteractiveSprite(o, e))
  1595. }
  1596. }, PIXI.InteractionManager.prototype.setTarget = function(t) {
  1597. this.target = t, this.resolution = t.resolution, null === this.interactionDOMElement && this.setTargetDomElement(t.view)
  1598. }, PIXI.InteractionManager.prototype.setTargetDomElement = function(t) {
  1599. this.removeEvents(), window.navigator.msPointerEnabled && (t.style["-ms-content-zooming"] = "none", t.style["-ms-touch-action"] = "none"), this.interactionDOMElement = t, t.addEventListener("mousemove", this.onMouseMove, !0), t.addEventListener("mousedown", this.onMouseDown, !0), t.addEventListener("mouseout", this.onMouseOut, !0), t.addEventListener("touchstart", this.onTouchStart, !0), t.addEventListener("touchend", this.onTouchEnd, !0), t.addEventListener("touchmove", this.onTouchMove, !0), window.addEventListener("mouseup", this.onMouseUp, !0)
  1600. }, PIXI.InteractionManager.prototype.removeEvents = function() {
  1601. this.interactionDOMElement && (this.interactionDOMElement.style["-ms-content-zooming"] = "", this.interactionDOMElement.style["-ms-touch-action"] = "", this.interactionDOMElement.removeEventListener("mousemove", this.onMouseMove, !0), this.interactionDOMElement.removeEventListener("mousedown", this.onMouseDown, !0), this.interactionDOMElement.removeEventListener("mouseout", this.onMouseOut, !0), this.interactionDOMElement.removeEventListener("touchstart", this.onTouchStart, !0), this.interactionDOMElement.removeEventListener("touchend", this.onTouchEnd, !0), this.interactionDOMElement.removeEventListener("touchmove", this.onTouchMove, !0), this.interactionDOMElement = null, window.removeEventListener("mouseup", this.onMouseUp, !0))
  1602. }, PIXI.InteractionManager.prototype.update = function() {
  1603. if (this.target) {
  1604. var t = Date.now(),
  1605. e = t - this.last;
  1606. if (e = e * PIXI.INTERACTION_FREQUENCY / 1e3, !(1 > e)) {
  1607. this.last = t;
  1608. var i = 0;
  1609. this.dirty && this.rebuildInteractiveGraph();
  1610. var r = this.interactiveItems.length,
  1611. n = "inherit",
  1612. o = !1;
  1613. for (i = 0; r > i; i++) {
  1614. var s = this.interactiveItems[i];
  1615. s.__hit = this.hitTest(s, this.mouse), this.mouse.target = s, s.__hit && !o ? (s.buttonMode && (n = s.defaultCursor), s.interactiveChildren || (o = !0), s.__isOver || (s.mouseover && s.mouseover(this.mouse), s.__isOver = !0)) : s.__isOver && (s.mouseout && s.mouseout(this.mouse), s.__isOver = !1)
  1616. }
  1617. this.currentCursorStyle !== n && (this.currentCursorStyle = n, this.interactionDOMElement.style.cursor = n)
  1618. }
  1619. }
  1620. }, PIXI.InteractionManager.prototype.rebuildInteractiveGraph = function() {
  1621. this.dirty = !1;
  1622. for (var t = this.interactiveItems.length, e = 0; t > e; e++) this.interactiveItems[e].interactiveChildren = !1;
  1623. this.interactiveItems = [], this.stage.interactive && this.interactiveItems.push(this.stage), this.collectInteractiveSprite(this.stage, this.stage)
  1624. }, PIXI.InteractionManager.prototype.onMouseMove = function(t) {
  1625. this.dirty && this.rebuildInteractiveGraph(), this.mouse.originalEvent = t;
  1626. var e = this.interactionDOMElement.getBoundingClientRect();
  1627. this.mouse.global.x = (t.clientX - e.left) * (this.target.width / e.width) / this.resolution, this.mouse.global.y = (t.clientY - e.top) * (this.target.height / e.height) / this.resolution;
  1628. for (var i = this.interactiveItems.length, r = 0; i > r; r++) {
  1629. var n = this.interactiveItems[r];
  1630. n.mousemove && n.mousemove(this.mouse)
  1631. }
  1632. }, PIXI.InteractionManager.prototype.onMouseDown = function(t) {
  1633. this.dirty && this.rebuildInteractiveGraph(), this.mouse.originalEvent = t, PIXI.AUTO_PREVENT_DEFAULT && this.mouse.originalEvent && this.mouse.originalEvent.preventDefault();
  1634. for (var e = this.interactiveItems.length, i = this.mouse.originalEvent, r = 2 === i.button || 3 === i.which, n = r ? "rightdown" : "mousedown", o = r ? "rightclick" : "click", s = r ? "__rightIsDown" : "__mouseIsDown", a = r ? "__isRightDown" : "__isDown", h = 0; e > h; h++) {
  1635. var l = this.interactiveItems[h];
  1636. if ((l[n] || l[o]) && (l[s] = !0, l.__hit = this.hitTest(l, this.mouse), l.__hit && (l[n] && l[n](this.mouse), l[a] = !0, !l.interactiveChildren))) break
  1637. }
  1638. }, PIXI.InteractionManager.prototype.onMouseOut = function(t) {
  1639. this.dirty && this.rebuildInteractiveGraph(), this.mouse.originalEvent = t;
  1640. var e = this.interactiveItems.length;
  1641. this.interactionDOMElement.style.cursor = "inherit";
  1642. for (var i = 0; e > i; i++) {
  1643. var r = this.interactiveItems[i];
  1644. r.__isOver && (this.mouse.target = r, r.mouseout && r.mouseout(this.mouse), r.__isOver = !1)
  1645. }
  1646. this.mouseOut = !0, this.mouse.global.x = -1e4, this.mouse.global.y = -1e4
  1647. }, PIXI.InteractionManager.prototype.onMouseUp = function(t) {
  1648. this.dirty && this.rebuildInteractiveGraph(), this.mouse.originalEvent = t;
  1649. for (var e = this.interactiveItems.length, i = !1, r = this.mouse.originalEvent, n = 2 === r.button || 3 === r.which, o = n ? "rightup" : "mouseup", s = n ? "rightclick" : "click", a = n ? "rightupoutside" : "mouseupoutside", h = n ? "__isRightDown" : "__isDown", l = 0; e > l; l++) {
  1650. var c = this.interactiveItems[l];
  1651. (c[s] || c[o] || c[a]) && (c.__hit = this.hitTest(c, this.mouse), c.__hit && !i ? (c[o] && c[o](this.mouse), c[h] && c[s] && c[s](this.mouse), c.interactiveChildren || (i = !0)) : c[h] && c[a] && c[a](this.mouse), c[h] = !1)
  1652. }
  1653. }, PIXI.InteractionManager.prototype.hitTest = function(t, e) {
  1654. var i = e.global;
  1655. if (!t.worldVisible) return !1;
  1656. t.worldTransform.applyInverse(i, this._tempPoint);
  1657. var r, n = this._tempPoint.x,
  1658. o = this._tempPoint.y;
  1659. if (e.target = t, t.hitArea && t.hitArea.contains) return t.hitArea.contains(n, o);
  1660. if (t instanceof PIXI.Sprite) {
  1661. var s, a = t.texture.frame.width,
  1662. h = t.texture.frame.height,
  1663. l = -a * t.anchor.x;
  1664. if (n > l && l + a > n && (s = -h * t.anchor.y, o > s && s + h > o)) return !0
  1665. } else if (t instanceof PIXI.Graphics) {
  1666. var c = t.graphicsData;
  1667. for (r = 0; r < c.length; r++) {
  1668. var d = c[r];
  1669. if (d.fill && d.shape && d.shape.contains(n, o)) return !0
  1670. }
  1671. }
  1672. var u = t.children.length;
  1673. for (r = 0; u > r; r++) {
  1674. var p = t.children[r],
  1675. f = this.hitTest(p, e);
  1676. if (f) return e.target = t, !0
  1677. }
  1678. return !1
  1679. }, PIXI.InteractionManager.prototype.onTouchMove = function(t) {
  1680. this.dirty && this.rebuildInteractiveGraph();
  1681. var e, i = this.interactionDOMElement.getBoundingClientRect(),
  1682. r = t.changedTouches,
  1683. n = 0;
  1684. for (n = 0; n < r.length; n++) {
  1685. var o = r[n];
  1686. e = this.touches[o.identifier], e.originalEvent = t, e.global.x = (o.clientX - i.left) * (this.target.width / i.width) / this.resolution, e.global.y = (o.clientY - i.top) * (this.target.height / i.height) / this.resolution;
  1687. for (var s = 0; s < this.interactiveItems.length; s++) {
  1688. var a = this.interactiveItems[s];
  1689. a.touchmove && a.__touchData && a.__touchData[o.identifier] && a.touchmove(e)
  1690. }
  1691. }
  1692. }, PIXI.InteractionManager.prototype.onTouchStart = function(t) {
  1693. this.dirty && this.rebuildInteractiveGraph();
  1694. var e = this.interactionDOMElement.getBoundingClientRect();
  1695. PIXI.AUTO_PREVENT_DEFAULT && t.preventDefault();
  1696. for (var i = t.changedTouches, r = 0; r < i.length; r++) {
  1697. var n = i[r],
  1698. o = this.pool.pop();
  1699. o || (o = new PIXI.InteractionData), o.originalEvent = t, this.touches[n.identifier] = o, o.global.x = (n.clientX - e.left) * (this.target.width / e.width) / this.resolution, o.global.y = (n.clientY - e.top) * (this.target.height / e.height) / this.resolution;
  1700. for (var s = this.interactiveItems.length, a = 0; s > a; a++) {
  1701. var h = this.interactiveItems[a];
  1702. if ((h.touchstart || h.tap) && (h.__hit = this.hitTest(h, o), h.__hit && (h.touchstart && h.touchstart(o), h.__isDown = !0, h.__touchData = h.__touchData || {}, h.__touchData[n.identifier] = o, !h.interactiveChildren))) break
  1703. }
  1704. }
  1705. }, PIXI.InteractionManager.prototype.onTouchEnd = function(t) {
  1706. this.dirty && this.rebuildInteractiveGraph();
  1707. for (var e = this.interactionDOMElement.getBoundingClientRect(), i = t.changedTouches, r = 0; r < i.length; r++) {
  1708. var n = i[r],
  1709. o = this.touches[n.identifier],
  1710. s = !1;
  1711. o.global.x = (n.clientX - e.left) * (this.target.width / e.width) / this.resolution, o.global.y = (n.clientY - e.top) * (this.target.height / e.height) / this.resolution;
  1712. for (var a = this.interactiveItems.length, h = 0; a > h; h++) {
  1713. var l = this.interactiveItems[h];
  1714. l.__touchData && l.__touchData[n.identifier] && (l.__hit = this.hitTest(l, l.__touchData[n.identifier]), o.originalEvent = t, (l.touchend || l.tap) && (l.__hit && !s ? (l.touchend && l.touchend(o), l.__isDown && l.tap && l.tap(o), l.interactiveChildren || (s = !0)) : l.__isDown && l.touchendoutside && l.touchendoutside(o), l.__isDown = !1), l.__touchData[n.identifier] = null)
  1715. }
  1716. this.pool.push(o), this.touches[n.identifier] = null
  1717. }
  1718. }, PIXI.Stage = function(t) {
  1719. PIXI.DisplayObjectContainer.call(this), this.worldTransform = new PIXI.Matrix, this.interactive = !0, this.interactionManager = new PIXI.InteractionManager(this), this.dirty = !0, this.stage = this, this.stage.hitArea = new PIXI.Rectangle(0, 0, 1e5, 1e5), this.setBackgroundColor(t)
  1720. }, PIXI.Stage.prototype = Object.create(PIXI.DisplayObjectContainer.prototype), PIXI.Stage.prototype.constructor = PIXI.Stage, PIXI.Stage.prototype.setInteractionDelegate = function(t) {
  1721. this.interactionManager.setTargetDomElement(t)
  1722. }, PIXI.Stage.prototype.updateTransform = function() {
  1723. this.worldAlpha = 1;
  1724. for (var t = 0, e = this.children.length; e > t; t++) this.children[t].updateTransform();
  1725. this.dirty && (this.dirty = !1, this.interactionManager.dirty = !0), this.interactive && this.interactionManager.update()
  1726. }, PIXI.Stage.prototype.setBackgroundColor = function(t) {
  1727. this.backgroundColor = t || 0, this.backgroundColorSplit = PIXI.hex2rgb(this.backgroundColor);
  1728. var e = this.backgroundColor.toString(16);
  1729. e = "000000".substr(0, 6 - e.length) + e, this.backgroundColorString = "#" + e
  1730. }, PIXI.Stage.prototype.getMousePosition = function() {
  1731. return this.interactionManager.mouse.global
  1732. },
  1733. function(t) {
  1734. for (var e = 0, i = ["ms", "moz", "webkit", "o"], r = 0; r < i.length && !t.requestAnimationFrame; ++r) t.requestAnimationFrame = t[i[r] + "RequestAnimationFrame"], t.cancelAnimationFrame = t[i[r] + "CancelAnimationFrame"] || t[i[r] + "CancelRequestAnimationFrame"];
  1735. t.requestAnimationFrame || (t.requestAnimationFrame = function(i) {
  1736. var r = (new Date).getTime(),
  1737. n = Math.max(0, 16 - (r - e)),
  1738. o = t.setTimeout(function() {
  1739. i(r + n)
  1740. }, n);
  1741. return e = r + n, o
  1742. }), t.cancelAnimationFrame || (t.cancelAnimationFrame = function(t) {
  1743. clearTimeout(t)
  1744. }), t.requestAnimFrame = t.requestAnimationFrame
  1745. }(this), PIXI.hex2rgb = function(t) {
  1746. return [(t >> 16 & 255) / 255, (t >> 8 & 255) / 255, (255 & t) / 255]
  1747. }, PIXI.rgb2hex = function(t) {
  1748. return (255 * t[0] << 16) + (255 * t[1] << 8) + 255 * t[2]
  1749. }, "function" != typeof Function.prototype.bind && (Function.prototype.bind = function() {
  1750. return function(t) {
  1751. function e() {
  1752. for (var r = arguments.length, o = new Array(r); r--;) o[r] = arguments[r];
  1753. return o = n.concat(o), i.apply(this instanceof e ? this : t, o)
  1754. }
  1755. var i = this,
  1756. r = arguments.length - 1,
  1757. n = [];
  1758. if (r > 0)
  1759. for (n.length = r; r--;) n[r] = arguments[r + 1];
  1760. if ("function" != typeof i) throw new TypeError;
  1761. return e.prototype = function o(t) {
  1762. return t && (o.prototype = t), this instanceof o ? void 0 : new o
  1763. }(i.prototype), e
  1764. }
  1765. }()), PIXI.AjaxRequest = function() {
  1766. var t = ["Msxml2.XMLHTTP.6.0", "Msxml2.XMLHTTP.3.0", "Microsoft.XMLHTTP"];
  1767. if (!window.ActiveXObject) return window.XMLHttpRequest ? new window.XMLHttpRequest : !1;
  1768. for (var e = 0; e < t.length; e++) try {
  1769. return new window.ActiveXObject(t[e])
  1770. } catch (i) {}
  1771. }, PIXI.canUseNewCanvasBlendModes = function() {
  1772. if ("undefined" == typeof document) return !1;
  1773. var t = document.createElement("canvas");
  1774. t.width = 1, t.height = 1;
  1775. var e = t.getContext("2d");
  1776. return e.fillStyle = "#000", e.fillRect(0, 0, 1, 1), e.globalCompositeOperation = "multiply", e.fillStyle = "#fff", e.fillRect(0, 0, 1, 1), 0 === e.getImageData(0, 0, 1, 1).data[0]
  1777. }, PIXI.getNextPowerOfTwo = function(t) {
  1778. if (t > 0 && 0 === (t & t - 1)) return t;
  1779. for (var e = 1; t > e;) e <<= 1;
  1780. return e
  1781. }, PIXI.isPowerOfTwo = function(t, e) {
  1782. return t > 0 && 0 === (t & t - 1) && e > 0 && 0 === (e & e - 1)
  1783. }, PIXI.PolyK = {}, PIXI.PolyK.Triangulate = function(t) {
  1784. var e = !0,
  1785. i = t.length >> 1;
  1786. if (3 > i) return [];
  1787. for (var r = [], n = [], o = 0; i > o; o++) n.push(o);
  1788. o = 0;
  1789. for (var s = i; s > 3;) {
  1790. var a = n[(o + 0) % s],
  1791. h = n[(o + 1) % s],
  1792. l = n[(o + 2) % s],
  1793. c = t[2 * a],
  1794. d = t[2 * a + 1],
  1795. u = t[2 * h],
  1796. p = t[2 * h + 1],
  1797. f = t[2 * l],
  1798. I = t[2 * l + 1],
  1799. g = !1;
  1800. if (PIXI.PolyK._convex(c, d, u, p, f, I, e)) {
  1801. g = !0;
  1802. for (var v = 0; s > v; v++) {
  1803. var y = n[v];
  1804. if (y !== a && y !== h && y !== l && PIXI.PolyK._PointInTriangle(t[2 * y], t[2 * y + 1], c, d, u, p, f, I)) {
  1805. g = !1;
  1806. break
  1807. }
  1808. }
  1809. }
  1810. if (g) r.push(a, h, l), n.splice((o + 1) % s, 1), s--, o = 0;
  1811. else if (o++ > 3 * s) {
  1812. if (!e) return null;
  1813. for (r = [], n = [], o = 0; i > o; o++) n.push(o);
  1814. o = 0, s = i, e = !1
  1815. }
  1816. }
  1817. return r.push(n[0], n[1], n[2]), r
  1818. }, PIXI.PolyK._PointInTriangle = function(t, e, i, r, n, o, s, a) {
  1819. var h = s - i,
  1820. l = a - r,
  1821. c = n - i,
  1822. d = o - r,
  1823. u = t - i,
  1824. p = e - r,
  1825. f = h * h + l * l,
  1826. I = h * c + l * d,
  1827. g = h * u + l * p,
  1828. v = c * c + d * d,
  1829. y = c * u + d * p,
  1830. w = 1 / (f * v - I * I),
  1831. P = (v * g - I * y) * w,
  1832. m = (f * y - I * g) * w;
  1833. return P >= 0 && m >= 0 && 1 > P + m
  1834. }, PIXI.PolyK._convex = function(t, e, i, r, n, o, s) {
  1835. return (e - r) * (n - i) + (i - t) * (o - r) >= 0 === s
  1836. }, PIXI.EventTarget = {
  1837. call: function(t) {
  1838. t && (t = t.prototype || t, PIXI.EventTarget.mixin(t))
  1839. },
  1840. mixin: function(t) {
  1841. t.listeners = function(t) {
  1842. return this._listeners = this._listeners || {}, this._listeners[t] ? this._listeners[t].slice() : []
  1843. }, t.emit = t.dispatchEvent = function(t, e) {
  1844. if (this._listeners = this._listeners || {}, "object" == typeof t && (e = t, t = t.type), e && e.__isEventObject === !0 || (e = new PIXI.Event(this, t, e)), this._listeners && this._listeners[t]) {
  1845. var i, r = this._listeners[t].slice(0),
  1846. n = r.length,
  1847. o = r[0];
  1848. for (i = 0; n > i; o = r[++i])
  1849. if (o.call(this, e), e.stoppedImmediate) return this;
  1850. if (e.stopped) return this
  1851. }
  1852. return this.parent && this.parent.emit && this.parent.emit.call(this.parent, t, e), this
  1853. }, t.on = t.addEventListener = function(t, e) {
  1854. return this._listeners = this._listeners || {}, (this._listeners[t] = this._listeners[t] || []).push(e), this
  1855. }, t.once = function(t, e) {
  1856. function i() {
  1857. e.apply(r.off(t, i), arguments)
  1858. }
  1859. this._listeners = this._listeners || {};
  1860. var r = this;
  1861. return i._originalHandler = e, this.on(t, i)
  1862. }, t.off = t.removeEventListener = function(t, e) {
  1863. if (this._listeners = this._listeners || {}, !this._listeners[t]) return this;
  1864. for (var i = this._listeners[t], r = e ? i.length : 0; r-- > 0;)(i[r] === e || i[r]._originalHandler === e) && i.splice(r, 1);
  1865. return 0 === i.length && delete this._listeners[t], this
  1866. }, t.removeAllListeners = function(t) {
  1867. return this._listeners = this._listeners || {}, this._listeners[t] ? (delete this._listeners[t], this) : this
  1868. }
  1869. }
  1870. }, PIXI.Event = function(t, e, i) {
  1871. this.__isEventObject = !0, this.stopped = !1, this.stoppedImmediate = !1, this.target = t, this.type = e, this.data = i, this.content = i, this.timeStamp = Date.now()
  1872. }, PIXI.Event.prototype.stopPropagation = function() {
  1873. this.stopped = !0
  1874. }, PIXI.Event.prototype.stopImmediatePropagation = function() {
  1875. this.stoppedImmediate = !0
  1876. }, PIXI.autoDetectRenderer = function(t, e, i) {
  1877. t || (t = 800), e || (e = 600);
  1878. var r = function() {
  1879. try {
  1880. var t = document.createElement("canvas");
  1881. return !!window.WebGLRenderingContext && (t.getContext("webgl") || t.getContext("experimental-webgl"))
  1882. } catch (e) {
  1883. return !1
  1884. }
  1885. }();
  1886. return r ? new PIXI.WebGLRenderer(t, e, i) : new PIXI.CanvasRenderer(t, e, i)
  1887. }, PIXI.autoDetectRecommendedRenderer = function(t, e, i) {
  1888. t || (t = 800), e || (e = 600);
  1889. var r = function() {
  1890. try {
  1891. var t = document.createElement("canvas");
  1892. return !!window.WebGLRenderingContext && (t.getContext("webgl") || t.getContext("experimental-webgl"))
  1893. } catch (e) {
  1894. return !1
  1895. }
  1896. }(),
  1897. n = /Android/i.test(navigator.userAgent);
  1898. return r && !n ? new PIXI.WebGLRenderer(t, e, i) : new PIXI.CanvasRenderer(t, e, i)
  1899. }, PIXI.initDefaultShaders = function() {}, PIXI.CompileVertexShader = function(t, e) {
  1900. return PIXI._CompileShader(t, e, t.VERTEX_SHADER)
  1901. }, PIXI.CompileFragmentShader = function(t, e) {
  1902. return PIXI._CompileShader(t, e, t.FRAGMENT_SHADER)
  1903. }, PIXI._CompileShader = function(t, e, i) {
  1904. var r = e.join("\n"),
  1905. n = t.createShader(i);
  1906. return t.shaderSource(n, r), t.compileShader(n), t.getShaderParameter(n, t.COMPILE_STATUS) ? n : (window.console.log(t.getShaderInfoLog(n)), null)
  1907. }, PIXI.compileProgram = function(t, e, i) {
  1908. var r = PIXI.CompileFragmentShader(t, i),
  1909. n = PIXI.CompileVertexShader(t, e),
  1910. o = t.createProgram();
  1911. return t.attachShader(o, n), t.attachShader(o, r), t.linkProgram(o), t.getProgramParameter(o, t.LINK_STATUS) || window.console.log("Could not initialise shaders"), o
  1912. }, PIXI.PixiShader = function(t) {
  1913. this._UID = PIXI._UID++, this.gl = t, this.program = null, this.fragmentSrc = ["precision lowp float;", "varying vec2 vTextureCoord;", "varying vec4 vColor;", "uniform sampler2D uSampler;", "void main(void) {", " gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;", "}"], this.textureCount = 0, this.firstRun = !0, this.dirty = !0, this.attributes = [], this.init()
  1914. }, PIXI.PixiShader.prototype.constructor = PIXI.PixiShader, PIXI.PixiShader.prototype.init = function() {
  1915. var t = this.gl,
  1916. e = PIXI.compileProgram(t, this.vertexSrc || PIXI.PixiShader.defaultVertexSrc, this.fragmentSrc);
  1917. t.useProgram(e), this.uSampler = t.getUniformLocation(e, "uSampler"), this.projectionVector = t.getUniformLocation(e, "projectionVector"), this.offsetVector = t.getUniformLocation(e, "offsetVector"), this.dimensions = t.getUniformLocation(e, "dimensions"), this.aVertexPosition = t.getAttribLocation(e, "aVertexPosition"), this.aTextureCoord = t.getAttribLocation(e, "aTextureCoord"), this.colorAttribute = t.getAttribLocation(e, "aColor"), -1 === this.colorAttribute && (this.colorAttribute = 2), this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
  1918. for (var i in this.uniforms) this.uniforms[i].uniformLocation = t.getUniformLocation(e, i);
  1919. this.initUniforms(), this.program = e
  1920. }, PIXI.PixiShader.prototype.initUniforms = function() {
  1921. this.textureCount = 1;
  1922. var t, e = this.gl;
  1923. for (var i in this.uniforms) {
  1924. t = this.uniforms[i];
  1925. var r = t.type;
  1926. "sampler2D" === r ? (t._init = !1, null !== t.value && this.initSampler2D(t)) : "mat2" === r || "mat3" === r || "mat4" === r ? (t.glMatrix = !0, t.glValueLength = 1, "mat2" === r ? t.glFunc = e.uniformMatrix2fv : "mat3" === r ? t.glFunc = e.uniformMatrix3fv : "mat4" === r && (t.glFunc = e.uniformMatrix4fv)) : (t.glFunc = e["uniform" + r], "2f" === r || "2i" === r ? t.glValueLength = 2 : "3f" === r || "3i" === r ? t.glValueLength = 3 : "4f" === r || "4i" === r ? t.glValueLength = 4 : t.glValueLength = 1)
  1927. }
  1928. }, PIXI.PixiShader.prototype.initSampler2D = function(t) {
  1929. if (t.value && t.value.baseTexture && t.value.baseTexture.hasLoaded) {
  1930. var e = this.gl;
  1931. if (e.activeTexture(e["TEXTURE" + this.textureCount]), e.bindTexture(e.TEXTURE_2D, t.value.baseTexture._glTextures[e.id]), t.textureData) {
  1932. var i = t.textureData,
  1933. r = i.magFilter ? i.magFilter : e.LINEAR,
  1934. n = i.minFilter ? i.minFilter : e.LINEAR,
  1935. o = i.wrapS ? i.wrapS : e.CLAMP_TO_EDGE,
  1936. s = i.wrapT ? i.wrapT : e.CLAMP_TO_EDGE,
  1937. a = i.luminance ? e.LUMINANCE : e.RGBA;
  1938. if (i.repeat && (o = e.REPEAT, s = e.REPEAT), e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, !!i.flipY), i.width) {
  1939. var h = i.width ? i.width : 512,
  1940. l = i.height ? i.height : 2,
  1941. c = i.border ? i.border : 0;
  1942. e.texImage2D(e.TEXTURE_2D, 0, a, h, l, c, a, e.UNSIGNED_BYTE, null)
  1943. } else e.texImage2D(e.TEXTURE_2D, 0, a, e.RGBA, e.UNSIGNED_BYTE, t.value.baseTexture.source);
  1944. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, r), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, n), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, o), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, s)
  1945. }
  1946. e.uniform1i(t.uniformLocation, this.textureCount), t._init = !0, this.textureCount++
  1947. }
  1948. }, PIXI.PixiShader.prototype.syncUniforms = function() {
  1949. this.textureCount = 1;
  1950. var t, e = this.gl;
  1951. for (var i in this.uniforms) t = this.uniforms[i], 1 === t.glValueLength ? t.glMatrix === !0 ? t.glFunc.call(e, t.uniformLocation, t.transpose, t.value) : t.glFunc.call(e, t.uniformLocation, t.value) : 2 === t.glValueLength ? t.glFunc.call(e, t.uniformLocation, t.value.x, t.value.y) : 3 === t.glValueLength ? t.glFunc.call(e, t.uniformLocation, t.value.x, t.value.y, t.value.z) : 4 === t.glValueLength ? t.glFunc.call(e, t.uniformLocation, t.value.x, t.value.y, t.value.z, t.value.w) : "sampler2D" === t.type && (t._init ? (e.activeTexture(e["TEXTURE" + this.textureCount]), t.value.baseTexture._dirty[e.id] ? PIXI.instances[e.id].updateTexture(t.value.baseTexture) : e.bindTexture(e.TEXTURE_2D, t.value.baseTexture._glTextures[e.id]), e.uniform1i(t.uniformLocation, this.textureCount), this.textureCount++) : this.initSampler2D(t))
  1952. }, PIXI.PixiShader.prototype.destroy = function() {
  1953. this.gl.deleteProgram(this.program), this.uniforms = null, this.gl = null, this.attributes = null
  1954. }, PIXI.PixiShader.defaultVertexSrc = ["attribute vec2 aVertexPosition;", "attribute vec2 aTextureCoord;", "attribute vec4 aColor;", "uniform vec2 projectionVector;", "uniform vec2 offsetVector;", "varying vec2 vTextureCoord;", "varying vec4 vColor;", "const vec2 center = vec2(-1.0, 1.0);", "void main(void) {", " gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);", " vTextureCoord = aTextureCoord;", " vColor = vec4(aColor.rgb * aColor.a, aColor.a);", "}"], PIXI.PixiFastShader = function(t) {
  1955. this._UID = PIXI._UID++, this.gl = t, this.program = null, this.fragmentSrc = ["precision lowp float;", "varying vec2 vTextureCoord;", "varying float vColor;", "uniform sampler2D uSampler;", "void main(void) {", " gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;", "}"], this.vertexSrc = ["attribute vec2 aVertexPosition;", "attribute vec2 aPositionCoord;", "attribute vec2 aScale;", "attribute float aRotation;", "attribute vec2 aTextureCoord;", "attribute float aColor;", "uniform vec2 projectionVector;", "uniform vec2 offsetVector;", "uniform mat3 uMatrix;", "varying vec2 vTextureCoord;", "varying float vColor;", "const vec2 center = vec2(-1.0, 1.0);", "void main(void) {", " vec2 v;", " vec2 sv = aVertexPosition * aScale;", " v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);", " v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);", " v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;", " gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);", " vTextureCoord = aTextureCoord;", " vColor = aColor;", "}"], this.textureCount = 0, this.init()
  1956. }, PIXI.PixiFastShader.prototype.constructor = PIXI.PixiFastShader, PIXI.PixiFastShader.prototype.init = function() {
  1957. var t = this.gl,
  1958. e = PIXI.compileProgram(t, this.vertexSrc, this.fragmentSrc);
  1959. t.useProgram(e), this.uSampler = t.getUniformLocation(e, "uSampler"), this.projectionVector = t.getUniformLocation(e, "projectionVector"), this.offsetVector = t.getUniformLocation(e, "offsetVector"), this.dimensions = t.getUniformLocation(e, "dimensions"), this.uMatrix = t.getUniformLocation(e, "uMatrix"), this.aVertexPosition = t.getAttribLocation(e, "aVertexPosition"), this.aPositionCoord = t.getAttribLocation(e, "aPositionCoord"), this.aScale = t.getAttribLocation(e, "aScale"), this.aRotation = t.getAttribLocation(e, "aRotation"), this.aTextureCoord = t.getAttribLocation(e, "aTextureCoord"), this.colorAttribute = t.getAttribLocation(e, "aColor"), -1 === this.colorAttribute && (this.colorAttribute = 2), this.attributes = [this.aVertexPosition, this.aPositionCoord, this.aScale, this.aRotation, this.aTextureCoord, this.colorAttribute], this.program = e
  1960. }, PIXI.PixiFastShader.prototype.destroy = function() {
  1961. this.gl.deleteProgram(this.program), this.uniforms = null, this.gl = null, this.attributes = null
  1962. }, PIXI.StripShader = function(t) {
  1963. this._UID = PIXI._UID++, this.gl = t, this.program = null, this.fragmentSrc = ["precision mediump float;", "varying vec2 vTextureCoord;", "uniform float alpha;", "uniform sampler2D uSampler;", "void main(void) {", " gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * alpha;", "}"], this.vertexSrc = ["attribute vec2 aVertexPosition;", "attribute vec2 aTextureCoord;", "uniform mat3 translationMatrix;", "uniform vec2 projectionVector;", "uniform vec2 offsetVector;", "varying vec2 vTextureCoord;", "void main(void) {", " vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);", " v -= offsetVector.xyx;", " gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);", " vTextureCoord = aTextureCoord;", "}"], this.init()
  1964. }, PIXI.StripShader.prototype.constructor = PIXI.StripShader, PIXI.StripShader.prototype.init = function() {
  1965. var t = this.gl,
  1966. e = PIXI.compileProgram(t, this.vertexSrc, this.fragmentSrc);
  1967. t.useProgram(e), this.uSampler = t.getUniformLocation(e, "uSampler"), this.projectionVector = t.getUniformLocation(e, "projectionVector"), this.offsetVector = t.getUniformLocation(e, "offsetVector"), this.colorAttribute = t.getAttribLocation(e, "aColor"), this.aVertexPosition = t.getAttribLocation(e, "aVertexPosition"), this.aTextureCoord = t.getAttribLocation(e, "aTextureCoord"), this.attributes = [this.aVertexPosition, this.aTextureCoord], this.translationMatrix = t.getUniformLocation(e, "translationMatrix"), this.alpha = t.getUniformLocation(e, "alpha"), this.program = e
  1968. }, PIXI.StripShader.prototype.destroy = function() {
  1969. this.gl.deleteProgram(this.program), this.uniforms = null, this.gl = null, this.attribute = null
  1970. }, PIXI.PrimitiveShader = function(t) {
  1971. this._UID = PIXI._UID++, this.gl = t, this.program = null, this.fragmentSrc = ["precision mediump float;", "varying vec4 vColor;", "void main(void) {", " gl_FragColor = vColor;", "}"], this.vertexSrc = ["attribute vec2 aVertexPosition;", "attribute vec4 aColor;", "uniform mat3 translationMatrix;", "uniform vec2 projectionVector;", "uniform vec2 offsetVector;", "uniform float alpha;", "uniform float flipY;", "uniform vec3 tint;", "varying vec4 vColor;", "void main(void) {", " vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);", " v -= offsetVector.xyx;", " gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);", " vColor = aColor * vec4(tint * alpha, alpha);", "}"], this.init()
  1972. }, PIXI.PrimitiveShader.prototype.constructor = PIXI.PrimitiveShader, PIXI.PrimitiveShader.prototype.init = function() {
  1973. var t = this.gl,
  1974. e = PIXI.compileProgram(t, this.vertexSrc, this.fragmentSrc);
  1975. t.useProgram(e), this.projectionVector = t.getUniformLocation(e, "projectionVector"), this.offsetVector = t.getUniformLocation(e, "offsetVector"), this.tintColor = t.getUniformLocation(e, "tint"), this.flipY = t.getUniformLocation(e, "flipY"), this.aVertexPosition = t.getAttribLocation(e, "aVertexPosition"), this.colorAttribute = t.getAttribLocation(e, "aColor"), this.attributes = [this.aVertexPosition, this.colorAttribute], this.translationMatrix = t.getUniformLocation(e, "translationMatrix"), this.alpha = t.getUniformLocation(e, "alpha"), this.program = e
  1976. }, PIXI.PrimitiveShader.prototype.destroy = function() {
  1977. this.gl.deleteProgram(this.program), this.uniforms = null, this.gl = null, this.attributes = null
  1978. }, PIXI.ComplexPrimitiveShader = function(t) {
  1979. this._UID = PIXI._UID++, this.gl = t, this.program = null, this.fragmentSrc = ["precision mediump float;", "varying vec4 vColor;", "void main(void) {", " gl_FragColor = vColor;", "}"], this.vertexSrc = ["attribute vec2 aVertexPosition;", "uniform mat3 translationMatrix;", "uniform vec2 projectionVector;", "uniform vec2 offsetVector;", "uniform vec3 tint;", "uniform float alpha;", "uniform vec3 color;", "uniform float flipY;", "varying vec4 vColor;", "void main(void) {", " vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);", " v -= offsetVector.xyx;", " gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);", " vColor = vec4(color * alpha * tint, alpha);", "}"], this.init()
  1980. }, PIXI.ComplexPrimitiveShader.prototype.constructor = PIXI.ComplexPrimitiveShader, PIXI.ComplexPrimitiveShader.prototype.init = function() {
  1981. var t = this.gl,
  1982. e = PIXI.compileProgram(t, this.vertexSrc, this.fragmentSrc);
  1983. t.useProgram(e), this.projectionVector = t.getUniformLocation(e, "projectionVector"), this.offsetVector = t.getUniformLocation(e, "offsetVector"), this.tintColor = t.getUniformLocation(e, "tint"), this.color = t.getUniformLocation(e, "color"), this.flipY = t.getUniformLocation(e, "flipY"), this.aVertexPosition = t.getAttribLocation(e, "aVertexPosition"), this.attributes = [this.aVertexPosition, this.colorAttribute], this.translationMatrix = t.getUniformLocation(e, "translationMatrix"), this.alpha = t.getUniformLocation(e, "alpha"), this.program = e
  1984. }, PIXI.ComplexPrimitiveShader.prototype.destroy = function() {
  1985. this.gl.deleteProgram(this.program), this.uniforms = null, this.gl = null, this.attribute = null
  1986. }, PIXI.WebGLGraphics = function() {}, PIXI.WebGLGraphics.renderGraphics = function(t, e) {
  1987. var i, r = e.gl,
  1988. n = e.projection,
  1989. o = e.offset,
  1990. s = e.shaderManager.primitiveShader;
  1991. t.dirty && PIXI.WebGLGraphics.updateGraphics(t, r);
  1992. for (var a = t._webGL[r.id], h = 0; h < a.data.length; h++) 1 === a.data[h].mode ? (i = a.data[h], e.stencilManager.pushStencil(t, i, e), r.drawElements(r.TRIANGLE_FAN, 4, r.UNSIGNED_SHORT, 2 * (i.indices.length - 4)), e.stencilManager.popStencil(t, i, e)) : (i = a.data[h], e.shaderManager.setShader(s), s = e.shaderManager.primitiveShader, r.uniformMatrix3fv(s.translationMatrix, !1, t.worldTransform.toArray(!0)), r.uniform1f(s.flipY, 1), r.uniform2f(s.projectionVector, n.x, -n.y), r.uniform2f(s.offsetVector, -o.x, -o.y), r.uniform3fv(s.tintColor, PIXI.hex2rgb(t.tint)), r.uniform1f(s.alpha, t.worldAlpha), r.bindBuffer(r.ARRAY_BUFFER, i.buffer), r.vertexAttribPointer(s.aVertexPosition, 2, r.FLOAT, !1, 24, 0), r.vertexAttribPointer(s.colorAttribute, 4, r.FLOAT, !1, 24, 8), r.bindBuffer(r.ELEMENT_ARRAY_BUFFER, i.indexBuffer), r.drawElements(r.TRIANGLE_STRIP, i.indices.length, r.UNSIGNED_SHORT, 0))
  1993. }, PIXI.WebGLGraphics.updateGraphics = function(t, e) {
  1994. var i = t._webGL[e.id];
  1995. i || (i = t._webGL[e.id] = {
  1996. lastIndex: 0,
  1997. data: [],
  1998. gl: e
  1999. }), t.dirty = !1;
  2000. var r;
  2001. if (t.clearDirty) {
  2002. for (t.clearDirty = !1, r = 0; r < i.data.length; r++) {
  2003. var n = i.data[r];
  2004. n.reset(), PIXI.WebGLGraphics.graphicsDataPool.push(n)
  2005. }
  2006. i.data = [], i.lastIndex = 0
  2007. }
  2008. var o;
  2009. for (r = i.lastIndex; r < t.graphicsData.length; r++) {
  2010. var s = t.graphicsData[r];
  2011. if (s.type === PIXI.Graphics.POLY) {
  2012. if (s.points = s.shape.points.slice(), s.shape.closed && (s.points[0] !== s.points[s.points.length - 2] || s.points[1] !== s.points[s.points.length - 1]) && s.points.push(s.points[0], s.points[1]), s.fill && s.points.length >= 6)
  2013. if (s.points.length < 12) {
  2014. o = PIXI.WebGLGraphics.switchMode(i, 0);
  2015. var a = PIXI.WebGLGraphics.buildPoly(s, o);
  2016. a || (o = PIXI.WebGLGraphics.switchMode(i, 1), PIXI.WebGLGraphics.buildComplexPoly(s, o))
  2017. } else o = PIXI.WebGLGraphics.switchMode(i, 1), PIXI.WebGLGraphics.buildComplexPoly(s, o);
  2018. s.lineWidth > 0 && (o = PIXI.WebGLGraphics.switchMode(i, 0), PIXI.WebGLGraphics.buildLine(s, o))
  2019. } else o = PIXI.WebGLGraphics.switchMode(i, 0), s.type === PIXI.Graphics.RECT ? PIXI.WebGLGraphics.buildRectangle(s, o) : s.type === PIXI.Graphics.CIRC || s.type === PIXI.Graphics.ELIP ? PIXI.WebGLGraphics.buildCircle(s, o) : s.type === PIXI.Graphics.RREC && PIXI.WebGLGraphics.buildRoundedRectangle(s, o);
  2020. i.lastIndex++
  2021. }
  2022. for (r = 0; r < i.data.length; r++) o = i.data[r], o.dirty && o.upload()
  2023. }, PIXI.WebGLGraphics.switchMode = function(t, e) {
  2024. var i;
  2025. return t.data.length ? (i = t.data[t.data.length - 1], (i.mode !== e || 1 === e) && (i = PIXI.WebGLGraphics.graphicsDataPool.pop() || new PIXI.WebGLGraphicsData(t.gl), i.mode = e, t.data.push(i))) : (i = PIXI.WebGLGraphics.graphicsDataPool.pop() || new PIXI.WebGLGraphicsData(t.gl), i.mode = e, t.data.push(i)), i.dirty = !0, i
  2026. }, PIXI.WebGLGraphics.buildRectangle = function(t, e) {
  2027. var i = t.shape,
  2028. r = i.x,
  2029. n = i.y,
  2030. o = i.width,
  2031. s = i.height;
  2032. if (t.fill) {
  2033. var a = PIXI.hex2rgb(t.fillColor),
  2034. h = t.fillAlpha,
  2035. l = a[0] * h,
  2036. c = a[1] * h,
  2037. d = a[2] * h,
  2038. u = e.points,
  2039. p = e.indices,
  2040. f = u.length / 6;
  2041. u.push(r, n), u.push(l, c, d, h), u.push(r + o, n), u.push(l, c, d, h), u.push(r, n + s), u.push(l, c, d, h), u.push(r + o, n + s), u.push(l, c, d, h), p.push(f, f, f + 1, f + 2, f + 3, f + 3)
  2042. }
  2043. if (t.lineWidth) {
  2044. var I = t.points;
  2045. t.points = [r, n, r + o, n, r + o, n + s, r, n + s, r, n], PIXI.WebGLGraphics.buildLine(t, e), t.points = I
  2046. }
  2047. }, PIXI.WebGLGraphics.buildRoundedRectangle = function(t, e) {
  2048. var i = t.shape,
  2049. r = i.x,
  2050. n = i.y,
  2051. o = i.width,
  2052. s = i.height,
  2053. a = i.radius,
  2054. h = [];
  2055. if (h.push(r, n + a), h = h.concat(PIXI.WebGLGraphics.quadraticBezierCurve(r, n + s - a, r, n + s, r + a, n + s)), h = h.concat(PIXI.WebGLGraphics.quadraticBezierCurve(r + o - a, n + s, r + o, n + s, r + o, n + s - a)), h = h.concat(PIXI.WebGLGraphics.quadraticBezierCurve(r + o, n + a, r + o, n, r + o - a, n)), h = h.concat(PIXI.WebGLGraphics.quadraticBezierCurve(r + a, n, r, n, r, n + a)), t.fill) {
  2056. var l = PIXI.hex2rgb(t.fillColor),
  2057. c = t.fillAlpha,
  2058. d = l[0] * c,
  2059. u = l[1] * c,
  2060. p = l[2] * c,
  2061. f = e.points,
  2062. I = e.indices,
  2063. g = f.length / 6,
  2064. v = PIXI.PolyK.Triangulate(h),
  2065. y = 0;
  2066. for (y = 0; y < v.length; y += 3) I.push(v[y] + g), I.push(v[y] + g), I.push(v[y + 1] + g), I.push(v[y + 2] + g), I.push(v[y + 2] + g);
  2067. for (y = 0; y < h.length; y++) f.push(h[y], h[++y], d, u, p, c)
  2068. }
  2069. if (t.lineWidth) {
  2070. var w = t.points;
  2071. t.points = h, PIXI.WebGLGraphics.buildLine(t, e), t.points = w
  2072. }
  2073. }, PIXI.WebGLGraphics.quadraticBezierCurve = function(t, e, i, r, n, o) {
  2074. function s(t, e, i) {
  2075. var r = e - t;
  2076. return t + r * i
  2077. }
  2078. for (var a, h, l, c, d, u, p = 20, f = [], I = 0, g = 0; p >= g; g++) I = g / p, a = s(t, i, I), h = s(e, r, I), l = s(i, n, I), c = s(r, o, I), d = s(a, l, I), u = s(h, c, I), f.push(d, u);
  2079. return f
  2080. }, PIXI.WebGLGraphics.buildCircle = function(t, e) {
  2081. var i, r, n = t.shape,
  2082. o = n.x,
  2083. s = n.y;
  2084. t.type === PIXI.Graphics.CIRC ? (i = n.radius, r = n.radius) : (i = n.width, r = n.height);
  2085. var a = 40,
  2086. h = 2 * Math.PI / a,
  2087. l = 0;
  2088. if (t.fill) {
  2089. var c = PIXI.hex2rgb(t.fillColor),
  2090. d = t.fillAlpha,
  2091. u = c[0] * d,
  2092. p = c[1] * d,
  2093. f = c[2] * d,
  2094. I = e.points,
  2095. g = e.indices,
  2096. v = I.length / 6;
  2097. for (g.push(v), l = 0; a + 1 > l; l++) I.push(o, s, u, p, f, d), I.push(o + Math.sin(h * l) * i, s + Math.cos(h * l) * r, u, p, f, d), g.push(v++, v++);
  2098. g.push(v - 1)
  2099. }
  2100. if (t.lineWidth) {
  2101. var y = t.points;
  2102. for (t.points = [], l = 0; a + 1 > l; l++) t.points.push(o + Math.sin(h * l) * i, s + Math.cos(h * l) * r);
  2103. PIXI.WebGLGraphics.buildLine(t, e), t.points = y
  2104. }
  2105. }, PIXI.WebGLGraphics.buildLine = function(t, e) {
  2106. var i = 0,
  2107. r = t.points;
  2108. if (0 !== r.length) {
  2109. if (t.lineWidth % 2)
  2110. for (i = 0; i < r.length; i++) r[i] += .5;
  2111. var n = new PIXI.Point(r[0], r[1]),
  2112. o = new PIXI.Point(r[r.length - 2], r[r.length - 1]);
  2113. if (n.x === o.x && n.y === o.y) {
  2114. r = r.slice(), r.pop(), r.pop(), o = new PIXI.Point(r[r.length - 2], r[r.length - 1]);
  2115. var s = o.x + .5 * (n.x - o.x),
  2116. a = o.y + .5 * (n.y - o.y);
  2117. r.unshift(s, a), r.push(s, a)
  2118. }
  2119. var h, l, c, d, u, p, f, I, g, v, y, w, P, m, x, b, T, X, S, C, M, _, E, R = e.points,
  2120. A = e.indices,
  2121. L = r.length / 2,
  2122. B = r.length,
  2123. G = R.length / 6,
  2124. O = t.lineWidth / 2,
  2125. D = PIXI.hex2rgb(t.lineColor),
  2126. F = t.lineAlpha,
  2127. U = D[0] * F,
  2128. k = D[1] * F,
  2129. W = D[2] * F;
  2130. for (c = r[0], d = r[1], u = r[2], p = r[3], g = -(d - p), v = c - u, E = Math.sqrt(g * g + v * v), g /= E, v /= E, g *= O, v *= O, R.push(c - g, d - v, U, k, W, F), R.push(c + g, d + v, U, k, W, F), i = 1; L - 1 > i; i++) c = r[2 * (i - 1)], d = r[2 * (i - 1) + 1], u = r[2 * i], p = r[2 * i + 1], f = r[2 * (i + 1)], I = r[2 * (i + 1) + 1], g = -(d - p), v = c - u, E = Math.sqrt(g * g + v * v), g /= E, v /= E, g *= O, v *= O, y = -(p - I), w = u - f, E = Math.sqrt(y * y + w * w), y /= E, w /= E, y *= O, w *= O, x = -v + d - (-v + p), b = -g + u - (-g + c), T = (-g + c) * (-v + p) - (-g + u) * (-v + d), X = -w + I - (-w + p), S = -y + u - (-y + f), C = (-y + f) * (-w + p) - (-y + u) * (-w + I), M = x * S - X * b, Math.abs(M) < .1 ? (M += 10.1, R.push(u - g, p - v, U, k, W, F), R.push(u + g, p + v, U, k, W, F)) : (h = (b * C - S * T) / M, l = (X * T - x * C) / M, _ = (h - u) * (h - u) + (l - p) + (l - p), _ > 19600 ? (P = g - y, m = v - w, E = Math.sqrt(P * P + m * m), P /= E, m /= E, P *= O, m *= O, R.push(u - P, p - m), R.push(U, k, W, F), R.push(u + P, p + m), R.push(U, k, W, F), R.push(u - P, p - m), R.push(U, k, W, F), B++) : (R.push(h, l), R.push(U, k, W, F), R.push(u - (h - u), p - (l - p)), R.push(U, k, W, F)));
  2131. for (c = r[2 * (L - 2)], d = r[2 * (L - 2) + 1], u = r[2 * (L - 1)], p = r[2 * (L - 1) + 1], g = -(d - p), v = c - u, E = Math.sqrt(g * g + v * v), g /= E, v /= E, g *= O, v *= O, R.push(u - g, p - v), R.push(U, k, W, F), R.push(u + g, p + v), R.push(U, k, W, F), A.push(G), i = 0; B > i; i++) A.push(G++);
  2132. A.push(G - 1)
  2133. }
  2134. }, PIXI.WebGLGraphics.buildComplexPoly = function(t, e) {
  2135. var i = t.points.slice();
  2136. if (!(i.length < 6)) {
  2137. var r = e.indices;
  2138. e.points = i, e.alpha = t.fillAlpha, e.color = PIXI.hex2rgb(t.fillColor);
  2139. for (var n, o, s = 1 / 0, a = -(1 / 0), h = 1 / 0, l = -(1 / 0), c = 0; c < i.length; c += 2) n = i[c], o = i[c + 1], s = s > n ? n : s, a = n > a ? n : a, h = h > o ? o : h, l = o > l ? o : l;
  2140. i.push(s, h, a, h, a, l, s, l);
  2141. var d = i.length / 2;
  2142. for (c = 0; d > c; c++) r.push(c)
  2143. }
  2144. }, PIXI.WebGLGraphics.buildPoly = function(t, e) {
  2145. var i = t.points;
  2146. if (!(i.length < 6)) {
  2147. var r = e.points,
  2148. n = e.indices,
  2149. o = i.length / 2,
  2150. s = PIXI.hex2rgb(t.fillColor),
  2151. a = t.fillAlpha,
  2152. h = s[0] * a,
  2153. l = s[1] * a,
  2154. c = s[2] * a,
  2155. d = PIXI.PolyK.Triangulate(i);
  2156. if (!d) return !1;
  2157. var u = r.length / 6,
  2158. p = 0;
  2159. for (p = 0; p < d.length; p += 3) n.push(d[p] + u), n.push(d[p] + u), n.push(d[p + 1] + u), n.push(d[p + 2] + u), n.push(d[p + 2] + u);
  2160. for (p = 0; o > p; p++) r.push(i[2 * p], i[2 * p + 1], h, l, c, a);
  2161. return !0
  2162. }
  2163. }, PIXI.WebGLGraphics.graphicsDataPool = [], PIXI.WebGLGraphicsData = function(t) {
  2164. this.gl = t, this.color = [0, 0, 0], this.points = [], this.indices = [], this.buffer = t.createBuffer(), this.indexBuffer = t.createBuffer(), this.mode = 1, this.alpha = 1, this.dirty = !0
  2165. }, PIXI.WebGLGraphicsData.prototype.reset = function() {
  2166. this.points = [], this.indices = []
  2167. }, PIXI.WebGLGraphicsData.prototype.upload = function() {
  2168. var t = this.gl;
  2169. this.glPoints = new PIXI.Float32Array(this.points), t.bindBuffer(t.ARRAY_BUFFER, this.buffer), t.bufferData(t.ARRAY_BUFFER, this.glPoints, t.STATIC_DRAW), this.glIndicies = new PIXI.Uint16Array(this.indices), t.bindBuffer(t.ELEMENT_ARRAY_BUFFER, this.indexBuffer), t.bufferData(t.ELEMENT_ARRAY_BUFFER, this.glIndicies, t.STATIC_DRAW), this.dirty = !1
  2170. }, PIXI.glContexts = [], PIXI.instances = [], PIXI.WebGLRenderer = function(t, e, i) {
  2171. if (i)
  2172. for (var r in PIXI.defaultRenderOptions) "undefined" == typeof i[r] && (i[r] = PIXI.defaultRenderOptions[r]);
  2173. else i = PIXI.defaultRenderOptions;
  2174. PIXI.defaultRenderer || (PIXI.sayHello("webGL"), PIXI.defaultRenderer = this), this.type = PIXI.WEBGL_RENDERER, this.resolution = i.resolution, this.transparent = i.transparent, this.autoResize = i.autoResize || !1, this.preserveDrawingBuffer = i.preserveDrawingBuffer, this.clearBeforeRender = i.clearBeforeRender, this.width = t || 800, this.height = e || 600, this.view = i.view || document.createElement("canvas"), this.contextLostBound = this.handleContextLost.bind(this), this.contextRestoredBound = this.handleContextRestored.bind(this), this.view.addEventListener("webglcontextlost", this.contextLostBound, !1), this.view.addEventListener("webglcontextrestored", this.contextRestoredBound, !1), this._contextOptions = {
  2175. alpha: this.transparent,
  2176. antialias: i.antialias,
  2177. premultipliedAlpha: this.transparent && "notMultiplied" !== this.transparent,
  2178. stencil: !0,
  2179. preserveDrawingBuffer: i.preserveDrawingBuffer
  2180. }, this.projection = new PIXI.Point, this.offset = new PIXI.Point(0, 0), this.shaderManager = new PIXI.WebGLShaderManager, this.spriteBatch = new PIXI.WebGLSpriteBatch, this.maskManager = new PIXI.WebGLMaskManager, this.filterManager = new PIXI.WebGLFilterManager, this.stencilManager = new PIXI.WebGLStencilManager, this.blendModeManager = new PIXI.WebGLBlendModeManager, this.renderSession = {
  2181. roundPixels: !0
  2182. }, this.renderSession.gl = this.gl, this.renderSession.drawCount = 0, this.renderSession.shaderManager = this.shaderManager, this.renderSession.maskManager = this.maskManager, this.renderSession.filterManager = this.filterManager, this.renderSession.blendModeManager = this.blendModeManager, this.renderSession.spriteBatch = this.spriteBatch, this.renderSession.stencilManager = this.stencilManager, this.renderSession.renderer = this, this.renderSession.resolution = this.resolution, this.initContext(), this.mapBlendModes()
  2183. }, PIXI.WebGLRenderer.prototype.constructor = PIXI.WebGLRenderer, PIXI.WebGLRenderer.prototype.initContext = function() {
  2184. var t = this.view.getContext("webgl", this._contextOptions) || this.view.getContext("experimental-webgl", this._contextOptions);
  2185. if (this.gl = t, !t) throw new Error("This browser does not support webGL. Try using the canvas renderer");
  2186. this.glContextId = t.id = PIXI.WebGLRenderer.glContextId++, PIXI.glContexts[this.glContextId] = t, PIXI.instances[this.glContextId] = this, t.disable(t.DEPTH_TEST), t.disable(t.CULL_FACE), t.enable(t.BLEND), this.shaderManager.setContext(t), this.spriteBatch.setContext(t), this.maskManager.setContext(t), this.filterManager.setContext(t), this.blendModeManager.setContext(t), this.stencilManager.setContext(t), this.renderSession.gl = this.gl, this.resize(this.width, this.height)
  2187. }, PIXI.WebGLRenderer.prototype.render = function(t) {
  2188. if (!this.contextLost) {
  2189. this.__stage !== t && (t.interactive && t.interactionManager.removeEvents(), this.__stage = t), t.updateTransform();
  2190. var e = this.gl;
  2191. t._interactiveEventsAdded || (t._interactiveEventsAdded = !0, t.interactionManager.setTarget(this)), e.viewport(0, 0, this.width, this.height), e.bindFramebuffer(e.FRAMEBUFFER, null), e.clearColor(t.backgroundColorSplit[0], t.backgroundColorSplit[1], t.backgroundColorSplit[2], 1), e.clear(e.COLOR_BUFFER_BIT), this.renderDisplayObject(t, this.projection)
  2192. }
  2193. }, PIXI.WebGLRenderer.prototype.renderDisplayObject = function(t, e, i) {
  2194. this.renderSession.blendModeManager.setBlendMode(PIXI.blendModes.NORMAL), this.renderSession.drawCount = 0, this.renderSession.flipY = i ? -1 : 1, this.renderSession.projection = e, this.renderSession.offset = this.offset, this.spriteBatch.begin(this.renderSession), this.filterManager.begin(this.renderSession, i), t._renderWebGL(this.renderSession), this.spriteBatch.end()
  2195. }, PIXI.WebGLRenderer.prototype.resize = function(t, e) {
  2196. this.width = t * this.resolution, this.height = e * this.resolution, this.view.width = this.width, this.view.height = this.height, this.gl.viewport(0, 0, this.width, this.height), this.projection.x = this.width / 2 / this.resolution, this.projection.y = -this.height / 2 / this.resolution
  2197. }, PIXI.WebGLRenderer.prototype.updateTexture = function(t) {
  2198. if (t.hasLoaded) {
  2199. var e = this.gl;
  2200. return t._glTextures[e.id] || (t._glTextures[e.id] = e.createTexture()), e.bindTexture(e.TEXTURE_2D, t._glTextures[e.id]), e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultipliedAlpha), e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, e.RGBA, e.UNSIGNED_BYTE, t.source), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, t.scaleMode === PIXI.scaleModes.LINEAR ? e.LINEAR : e.NEAREST), t.mipmap && PIXI.isPowerOfTwo(t.width, t.height) ? (e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, t.scaleMode === PIXI.scaleModes.LINEAR ? e.LINEAR_MIPMAP_LINEAR : e.NEAREST_MIPMAP_NEAREST), e.generateMipmap(e.TEXTURE_2D)) : e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, t.scaleMode === PIXI.scaleModes.LINEAR ? e.LINEAR : e.NEAREST), t._powerOf2 ? (e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.REPEAT), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.REPEAT)) : (e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE)), t._dirty[e.id] = !1, t._glTextures[e.id]
  2201. }
  2202. }, PIXI.WebGLRenderer.prototype.handleContextLost = function(t) {
  2203. t.preventDefault(), this.contextLost = !0
  2204. }, PIXI.WebGLRenderer.prototype.handleContextRestored = function() {
  2205. this.initContext();
  2206. for (var t in PIXI.TextureCache) {
  2207. var e = PIXI.TextureCache[t].baseTexture;
  2208. e._glTextures = []
  2209. }
  2210. this.contextLost = !1
  2211. }, PIXI.WebGLRenderer.prototype.destroy = function() {
  2212. this.view.removeEventListener("webglcontextlost", this.contextLostBound), this.view.removeEventListener("webglcontextrestored", this.contextRestoredBound), PIXI.glContexts[this.glContextId] = null, this.projection = null, this.offset = null, this.shaderManager.destroy(), this.spriteBatch.destroy(), this.maskManager.destroy(), this.filterManager.destroy(), this.shaderManager = null, this.spriteBatch = null, this.maskManager = null, this.filterManager = null, this.gl = null, this.renderSession = null
  2213. }, PIXI.WebGLRenderer.prototype.mapBlendModes = function() {
  2214. var t = this.gl;
  2215. PIXI.blendModesWebGL || (PIXI.blendModesWebGL = [], PIXI.blendModesWebGL[PIXI.blendModes.NORMAL] = [t.ONE, t.ONE_MINUS_SRC_ALPHA], PIXI.blendModesWebGL[PIXI.blendModes.ADD] = [t.SRC_ALPHA, t.DST_ALPHA], PIXI.blendModesWebGL[PIXI.blendModes.MULTIPLY] = [t.DST_COLOR, t.ONE_MINUS_SRC_ALPHA], PIXI.blendModesWebGL[PIXI.blendModes.SCREEN] = [t.SRC_ALPHA, t.ONE], PIXI.blendModesWebGL[PIXI.blendModes.OVERLAY] = [t.ONE, t.ONE_MINUS_SRC_ALPHA], PIXI.blendModesWebGL[PIXI.blendModes.DARKEN] = [t.ONE, t.ONE_MINUS_SRC_ALPHA], PIXI.blendModesWebGL[PIXI.blendModes.LIGHTEN] = [t.ONE, t.ONE_MINUS_SRC_ALPHA], PIXI.blendModesWebGL[PIXI.blendModes.COLOR_DODGE] = [t.ONE, t.ONE_MINUS_SRC_ALPHA], PIXI.blendModesWebGL[PIXI.blendModes.COLOR_BURN] = [t.ONE, t.ONE_MINUS_SRC_ALPHA], PIXI.blendModesWebGL[PIXI.blendModes.HARD_LIGHT] = [t.ONE, t.ONE_MINUS_SRC_ALPHA], PIXI.blendModesWebGL[PIXI.blendModes.SOFT_LIGHT] = [t.ONE, t.ONE_MINUS_SRC_ALPHA], PIXI.blendModesWebGL[PIXI.blendModes.DIFFERENCE] = [t.ONE, t.ONE_MINUS_SRC_ALPHA], PIXI.blendModesWebGL[PIXI.blendModes.EXCLUSION] = [t.ONE, t.ONE_MINUS_SRC_ALPHA], PIXI.blendModesWebGL[PIXI.blendModes.HUE] = [t.ONE, t.ONE_MINUS_SRC_ALPHA], PIXI.blendModesWebGL[PIXI.blendModes.SATURATION] = [t.ONE, t.ONE_MINUS_SRC_ALPHA], PIXI.blendModesWebGL[PIXI.blendModes.COLOR] = [t.ONE, t.ONE_MINUS_SRC_ALPHA], PIXI.blendModesWebGL[PIXI.blendModes.LUMINOSITY] = [t.ONE, t.ONE_MINUS_SRC_ALPHA])
  2216. }, PIXI.WebGLRenderer.glContextId = 0, PIXI.WebGLBlendModeManager = function() {
  2217. this.currentBlendMode = 99999
  2218. }, PIXI.WebGLBlendModeManager.prototype.constructor = PIXI.WebGLBlendModeManager, PIXI.WebGLBlendModeManager.prototype.setContext = function(t) {
  2219. this.gl = t
  2220. }, PIXI.WebGLBlendModeManager.prototype.setBlendMode = function(t) {
  2221. if (this.currentBlendMode === t) return !1;
  2222. this.currentBlendMode = t;
  2223. var e = PIXI.blendModesWebGL[this.currentBlendMode];
  2224. return this.gl.blendFunc(e[0], e[1]), !0
  2225. }, PIXI.WebGLBlendModeManager.prototype.destroy = function() {
  2226. this.gl = null
  2227. }, PIXI.WebGLMaskManager = function() {}, PIXI.WebGLMaskManager.prototype.constructor = PIXI.WebGLMaskManager, PIXI.WebGLMaskManager.prototype.setContext = function(t) {
  2228. this.gl = t
  2229. }, PIXI.WebGLMaskManager.prototype.pushMask = function(t, e) {
  2230. var i = e.gl;
  2231. t.dirty && PIXI.WebGLGraphics.updateGraphics(t, i), t._webGL[i.id].data.length && e.stencilManager.pushStencil(t, t._webGL[i.id].data[0], e)
  2232. }, PIXI.WebGLMaskManager.prototype.popMask = function(t, e) {
  2233. var i = this.gl;
  2234. e.stencilManager.popStencil(t, t._webGL[i.id].data[0], e)
  2235. }, PIXI.WebGLMaskManager.prototype.destroy = function() {
  2236. this.gl = null
  2237. }, PIXI.WebGLStencilManager = function() {
  2238. this.stencilStack = [], this.reverse = !0, this.count = 0
  2239. }, PIXI.WebGLStencilManager.prototype.setContext = function(t) {
  2240. this.gl = t
  2241. }, PIXI.WebGLStencilManager.prototype.pushStencil = function(t, e, i) {
  2242. var r = this.gl;
  2243. this.bindGraphics(t, e, i), 0 === this.stencilStack.length && (r.enable(r.STENCIL_TEST), r.clear(r.STENCIL_BUFFER_BIT), this.reverse = !0, this.count = 0), this.stencilStack.push(e);
  2244. var n = this.count;
  2245. r.colorMask(!1, !1, !1, !1), r.stencilFunc(r.ALWAYS, 0, 255), r.stencilOp(r.KEEP, r.KEEP, r.INVERT), 1 === e.mode ? (r.drawElements(r.TRIANGLE_FAN, e.indices.length - 4, r.UNSIGNED_SHORT, 0), this.reverse ? (r.stencilFunc(r.EQUAL, 255 - n, 255), r.stencilOp(r.KEEP, r.KEEP, r.DECR)) : (r.stencilFunc(r.EQUAL, n, 255), r.stencilOp(r.KEEP, r.KEEP, r.INCR)), r.drawElements(r.TRIANGLE_FAN, 4, r.UNSIGNED_SHORT, 2 * (e.indices.length - 4)), this.reverse ? r.stencilFunc(r.EQUAL, 255 - (n + 1), 255) : r.stencilFunc(r.EQUAL, n + 1, 255), this.reverse = !this.reverse) : (this.reverse ? (r.stencilFunc(r.EQUAL, n, 255), r.stencilOp(r.KEEP, r.KEEP, r.INCR)) : (r.stencilFunc(r.EQUAL, 255 - n, 255), r.stencilOp(r.KEEP, r.KEEP, r.DECR)), r.drawElements(r.TRIANGLE_STRIP, e.indices.length, r.UNSIGNED_SHORT, 0), this.reverse ? r.stencilFunc(r.EQUAL, n + 1, 255) : r.stencilFunc(r.EQUAL, 255 - (n + 1), 255)), r.colorMask(!0, !0, !0, !0), r.stencilOp(r.KEEP, r.KEEP, r.KEEP), this.count++
  2246. }, PIXI.WebGLStencilManager.prototype.bindGraphics = function(t, e, i) {
  2247. this._currentGraphics = t;
  2248. var r, n = this.gl,
  2249. o = i.projection,
  2250. s = i.offset;
  2251. 1 === e.mode ? (r = i.shaderManager.complexPrimitiveShader, i.shaderManager.setShader(r), n.uniform1f(r.flipY, i.flipY), n.uniformMatrix3fv(r.translationMatrix, !1, t.worldTransform.toArray(!0)), n.uniform2f(r.projectionVector, o.x, -o.y), n.uniform2f(r.offsetVector, -s.x, -s.y), n.uniform3fv(r.tintColor, PIXI.hex2rgb(t.tint)), n.uniform3fv(r.color, e.color), n.uniform1f(r.alpha, t.worldAlpha * e.alpha), n.bindBuffer(n.ARRAY_BUFFER, e.buffer), n.vertexAttribPointer(r.aVertexPosition, 2, n.FLOAT, !1, 8, 0), n.bindBuffer(n.ELEMENT_ARRAY_BUFFER, e.indexBuffer)) : (r = i.shaderManager.primitiveShader, i.shaderManager.setShader(r), n.uniformMatrix3fv(r.translationMatrix, !1, t.worldTransform.toArray(!0)), n.uniform1f(r.flipY, i.flipY), n.uniform2f(r.projectionVector, o.x, -o.y), n.uniform2f(r.offsetVector, -s.x, -s.y), n.uniform3fv(r.tintColor, PIXI.hex2rgb(t.tint)), n.uniform1f(r.alpha, t.worldAlpha), n.bindBuffer(n.ARRAY_BUFFER, e.buffer), n.vertexAttribPointer(r.aVertexPosition, 2, n.FLOAT, !1, 24, 0), n.vertexAttribPointer(r.colorAttribute, 4, n.FLOAT, !1, 24, 8), n.bindBuffer(n.ELEMENT_ARRAY_BUFFER, e.indexBuffer))
  2252. }, PIXI.WebGLStencilManager.prototype.popStencil = function(t, e, i) {
  2253. var r = this.gl;
  2254. if (this.stencilStack.pop(), this.count--, 0 === this.stencilStack.length) r.disable(r.STENCIL_TEST);
  2255. else {
  2256. var n = this.count;
  2257. this.bindGraphics(t, e, i), r.colorMask(!1, !1, !1, !1), 1 === e.mode ? (this.reverse = !this.reverse, this.reverse ? (r.stencilFunc(r.EQUAL, 255 - (n + 1), 255), r.stencilOp(r.KEEP, r.KEEP, r.INCR)) : (r.stencilFunc(r.EQUAL, n + 1, 255), r.stencilOp(r.KEEP, r.KEEP, r.DECR)), r.drawElements(r.TRIANGLE_FAN, 4, r.UNSIGNED_SHORT, 2 * (e.indices.length - 4)), r.stencilFunc(r.ALWAYS, 0, 255), r.stencilOp(r.KEEP, r.KEEP, r.INVERT), r.drawElements(r.TRIANGLE_FAN, e.indices.length - 4, r.UNSIGNED_SHORT, 0), this.reverse ? r.stencilFunc(r.EQUAL, n, 255) : r.stencilFunc(r.EQUAL, 255 - n, 255)) : (this.reverse ? (r.stencilFunc(r.EQUAL, n + 1, 255), r.stencilOp(r.KEEP, r.KEEP, r.DECR)) : (r.stencilFunc(r.EQUAL, 255 - (n + 1), 255), r.stencilOp(r.KEEP, r.KEEP, r.INCR)), r.drawElements(r.TRIANGLE_STRIP, e.indices.length, r.UNSIGNED_SHORT, 0), this.reverse ? r.stencilFunc(r.EQUAL, n, 255) : r.stencilFunc(r.EQUAL, 255 - n, 255)), r.colorMask(!0, !0, !0, !0), r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  2258. }
  2259. }, PIXI.WebGLStencilManager.prototype.destroy = function() {
  2260. this.stencilStack = null, this.gl = null
  2261. }, PIXI.WebGLShaderManager = function() {
  2262. this.maxAttibs = 10, this.attribState = [], this.tempAttribState = [];
  2263. for (var t = 0; t < this.maxAttibs; t++) this.attribState[t] = !1;
  2264. this.stack = []
  2265. }, PIXI.WebGLShaderManager.prototype.constructor = PIXI.WebGLShaderManager, PIXI.WebGLShaderManager.prototype.setContext = function(t) {
  2266. this.gl = t, this.primitiveShader = new PIXI.PrimitiveShader(t), this.complexPrimitiveShader = new PIXI.ComplexPrimitiveShader(t), this.defaultShader = new PIXI.PixiShader(t), this.fastShader = new PIXI.PixiFastShader(t), this.stripShader = new PIXI.StripShader(t), this.setShader(this.defaultShader)
  2267. }, PIXI.WebGLShaderManager.prototype.setAttribs = function(t) {
  2268. var e;
  2269. for (e = 0; e < this.tempAttribState.length; e++) this.tempAttribState[e] = !1;
  2270. for (e = 0; e < t.length; e++) {
  2271. var i = t[e];
  2272. this.tempAttribState[i] = !0
  2273. }
  2274. var r = this.gl;
  2275. for (e = 0; e < this.attribState.length; e++) this.attribState[e] !== this.tempAttribState[e] && (this.attribState[e] = this.tempAttribState[e], this.tempAttribState[e] ? r.enableVertexAttribArray(e) : r.disableVertexAttribArray(e))
  2276. }, PIXI.WebGLShaderManager.prototype.setShader = function(t) {
  2277. return this._currentId === t._UID ? !1 : (this._currentId = t._UID, this.currentShader = t, this.gl.useProgram(t.program), this.setAttribs(t.attributes), !0)
  2278. }, PIXI.WebGLShaderManager.prototype.destroy = function() {
  2279. this.attribState = null, this.tempAttribState = null, this.primitiveShader.destroy(), this.complexPrimitiveShader.destroy(), this.defaultShader.destroy(), this.fastShader.destroy(), this.stripShader.destroy(), this.gl = null
  2280. }, PIXI.WebGLSpriteBatch = function() {
  2281. this.vertSize = 5, this.size = 2e3;
  2282. var t = 4 * this.size * 4 * this.vertSize,
  2283. e = 6 * this.size;
  2284. this.vertices = new PIXI.ArrayBuffer(t), this.positions = new PIXI.Float32Array(this.vertices), this.colors = new PIXI.Uint32Array(this.vertices), this.indices = new PIXI.Uint16Array(e), this.lastIndexCount = 0;
  2285. for (var i = 0, r = 0; e > i; i += 6, r += 4) this.indices[i + 0] = r + 0, this.indices[i + 1] = r + 1, this.indices[i + 2] = r + 2, this.indices[i + 3] = r + 0, this.indices[i + 4] = r + 2, this.indices[i + 5] = r + 3;
  2286. this.drawing = !1, this.currentBatchSize = 0, this.currentBaseTexture = null, this.dirty = !0, this.textures = [], this.blendModes = [], this.shaders = [], this.sprites = [], this.defaultShader = new PIXI.AbstractFilter(["precision lowp float;", "varying vec2 vTextureCoord;", "varying vec4 vColor;", "uniform sampler2D uSampler;", "void main(void) {", " gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;", "}"])
  2287. }, PIXI.WebGLSpriteBatch.prototype.setContext = function(t) {
  2288. this.gl = t, this.vertexBuffer = t.createBuffer(), this.indexBuffer = t.createBuffer(), t.bindBuffer(t.ELEMENT_ARRAY_BUFFER, this.indexBuffer), t.bufferData(t.ELEMENT_ARRAY_BUFFER, this.indices, t.STATIC_DRAW), t.bindBuffer(t.ARRAY_BUFFER, this.vertexBuffer), t.bufferData(t.ARRAY_BUFFER, this.vertices, t.DYNAMIC_DRAW), this.currentBlendMode = 99999;
  2289. var e = new PIXI.PixiShader(t);
  2290. e.fragmentSrc = this.defaultShader.fragmentSrc, e.uniforms = {}, e.init(), this.defaultShader.shaders[t.id] = e
  2291. }, PIXI.WebGLSpriteBatch.prototype.begin = function(t) {
  2292. this.renderSession = t, this.shader = this.renderSession.shaderManager.defaultShader, this.start()
  2293. }, PIXI.WebGLSpriteBatch.prototype.end = function() {
  2294. this.flush()
  2295. }, PIXI.WebGLSpriteBatch.prototype.render = function(t) {
  2296. var e = t.texture;
  2297. this.currentBatchSize >= this.size && (this.flush(), this.currentBaseTexture = e.baseTexture);
  2298. var i = e._uvs;
  2299. if (i) {
  2300. var r, n, o, s, a = t.anchor.x,
  2301. h = t.anchor.y;
  2302. if (e.trim) {
  2303. var l = e.trim;
  2304. n = l.x - a * l.width, r = n + e.crop.width, s = l.y - h * l.height, o = s + e.crop.height
  2305. } else r = e.frame.width * (1 - a), n = e.frame.width * -a, o = e.frame.height * (1 - h), s = e.frame.height * -h;
  2306. var c = 4 * this.currentBatchSize * this.vertSize,
  2307. d = e.baseTexture.resolution,
  2308. u = t.worldTransform,
  2309. p = u.a / d,
  2310. f = u.b / d,
  2311. I = u.c / d,
  2312. g = u.d / d,
  2313. v = u.tx,
  2314. y = u.ty,
  2315. w = this.colors,
  2316. P = this.positions;
  2317. P[c] = p * n + I * s + v | 0, P[c + 1] = g * s + f * n + y | 0, P[c + 5] = p * r + I * s + v | 0, P[c + 6] = g * s + f * r + y | 0, P[c + 10] = p * r + I * o + v | 0, P[c + 11] = g * o + f * r + y | 0, P[c + 15] = p * n + I * o + v | 0, P[c + 16] = g * o + f * n + y | 0, P[c + 2] = i.x0, P[c + 3] = i.y0, P[c + 7] = i.x1, P[c + 8] = i.y1, P[c + 12] = i.x2, P[c + 13] = i.y2, P[c + 17] = i.x3, P[c + 18] = i.y3;
  2318. var m = t.tint;
  2319. w[c + 4] = w[c + 9] = w[c + 14] = w[c + 19] = (m >> 16) + (65280 & m) + ((255 & m) << 16) + (255 * t.worldAlpha << 24), this.sprites[this.currentBatchSize++] = t
  2320. }
  2321. }, PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(t) {
  2322. var e = t.tilingTexture;
  2323. this.currentBatchSize >= this.size && (this.flush(), this.currentBaseTexture = e.baseTexture), t._uvs || (t._uvs = new PIXI.TextureUvs);
  2324. var i = t._uvs;
  2325. t.tilePosition.x %= e.baseTexture.width * t.tileScaleOffset.x, t.tilePosition.y %= e.baseTexture.height * t.tileScaleOffset.y;
  2326. var r = t.tilePosition.x / (e.baseTexture.width * t.tileScaleOffset.x),
  2327. n = t.tilePosition.y / (e.baseTexture.height * t.tileScaleOffset.y),
  2328. o = t.width / e.baseTexture.width / (t.tileScale.x * t.tileScaleOffset.x),
  2329. s = t.height / e.baseTexture.height / (t.tileScale.y * t.tileScaleOffset.y);
  2330. i.x0 = 0 - r, i.y0 = 0 - n, i.x1 = 1 * o - r, i.y1 = 0 - n, i.x2 = 1 * o - r, i.y2 = 1 * s - n, i.x3 = 0 - r, i.y3 = 1 * s - n;
  2331. var a = t.tint,
  2332. h = (a >> 16) + (65280 & a) + ((255 & a) << 16) + (255 * t.alpha << 24),
  2333. l = this.positions,
  2334. c = this.colors,
  2335. d = t.width,
  2336. u = t.height,
  2337. p = t.anchor.x,
  2338. f = t.anchor.y,
  2339. I = d * (1 - p),
  2340. g = d * -p,
  2341. v = u * (1 - f),
  2342. y = u * -f,
  2343. w = 4 * this.currentBatchSize * this.vertSize,
  2344. P = e.baseTexture.resolution,
  2345. m = t.worldTransform,
  2346. x = m.a / P,
  2347. b = m.b / P,
  2348. T = m.c / P,
  2349. X = m.d / P,
  2350. S = m.tx,
  2351. C = m.ty;
  2352. l[w++] = x * g + T * y + S, l[w++] = X * y + b * g + C, l[w++] = i.x0, l[w++] = i.y0, c[w++] = h, l[w++] = x * I + T * y + S, l[w++] = X * y + b * I + C, l[w++] = i.x1, l[w++] = i.y1, c[w++] = h, l[w++] = x * I + T * v + S, l[w++] = X * v + b * I + C, l[w++] = i.x2, l[w++] = i.y2, c[w++] = h, l[w++] = x * g + T * v + S, l[w++] = X * v + b * g + C, l[w++] = i.x3, l[w++] = i.y3, c[w++] = h, this.sprites[this.currentBatchSize++] = t
  2353. }, PIXI.WebGLSpriteBatch.prototype.flush = function() {
  2354. if (0 !== this.currentBatchSize) {
  2355. var t, e = this.gl;
  2356. if (this.dirty) {
  2357. this.dirty = !1, e.activeTexture(e.TEXTURE0), e.bindBuffer(e.ARRAY_BUFFER, this.vertexBuffer), e.bindBuffer(e.ELEMENT_ARRAY_BUFFER, this.indexBuffer), t = this.defaultShader.shaders[e.id];
  2358. var i = 4 * this.vertSize;
  2359. e.vertexAttribPointer(t.aVertexPosition, 2, e.FLOAT, !1, i, 0), e.vertexAttribPointer(t.aTextureCoord, 2, e.FLOAT, !1, i, 8), e.vertexAttribPointer(t.colorAttribute, 4, e.UNSIGNED_BYTE, !0, i, 16)
  2360. }
  2361. if (this.currentBatchSize > .5 * this.size) e.bufferSubData(e.ARRAY_BUFFER, 0, this.vertices);
  2362. else {
  2363. var r = this.positions.subarray(0, 4 * this.currentBatchSize * this.vertSize);
  2364. e.bufferSubData(e.ARRAY_BUFFER, 0, r)
  2365. }
  2366. for (var n, o, s, a, h = 0, l = 0, c = null, d = this.renderSession.blendModeManager.currentBlendMode, u = null, p = !1, f = !1, I = 0, g = this.currentBatchSize; g > I; I++) {
  2367. if (a = this.sprites[I], n = a.texture.baseTexture, o = a.blendMode, s = a.shader || this.defaultShader, p = d !== o, f = u !== s, (c !== n || p || f) && (this.renderBatch(c, h, l), l = I, h = 0, c = n, p && (d = o, this.renderSession.blendModeManager.setBlendMode(d)), f)) {
  2368. u = s, t = u.shaders[e.id], t || (t = new PIXI.PixiShader(e), t.fragmentSrc = u.fragmentSrc, t.uniforms = u.uniforms, t.init(), u.shaders[e.id] = t), this.renderSession.shaderManager.setShader(t), t.dirty && t.syncUniforms();
  2369. var v = this.renderSession.projection;
  2370. e.uniform2f(t.projectionVector, v.x, v.y);
  2371. var y = this.renderSession.offset;
  2372. e.uniform2f(t.offsetVector, y.x, y.y)
  2373. }
  2374. h++
  2375. }
  2376. this.renderBatch(c, h, l), this.currentBatchSize = 0
  2377. }
  2378. }, PIXI.WebGLSpriteBatch.prototype.renderBatch = function(t, e, i) {
  2379. if (0 !== e) {
  2380. var r = this.gl;
  2381. t._dirty[r.id] ? this.renderSession.renderer.updateTexture(t) : r.bindTexture(r.TEXTURE_2D, t._glTextures[r.id]), r.drawElements(r.TRIANGLES, 6 * e, r.UNSIGNED_SHORT, 6 * i * 2), this.renderSession.drawCount++
  2382. }
  2383. }, PIXI.WebGLSpriteBatch.prototype.stop = function() {
  2384. this.flush(), this.dirty = !0
  2385. }, PIXI.WebGLSpriteBatch.prototype.start = function() {
  2386. this.dirty = !0
  2387. }, PIXI.WebGLSpriteBatch.prototype.destroy = function() {
  2388. this.vertices = null, this.indices = null, this.gl.deleteBuffer(this.vertexBuffer), this.gl.deleteBuffer(this.indexBuffer), this.currentBaseTexture = null, this.gl = null
  2389. }, PIXI.WebGLFastSpriteBatch = function(t) {
  2390. this.vertSize = 10, this.maxSize = 6e3, this.size = this.maxSize;
  2391. var e = 4 * this.size * this.vertSize,
  2392. i = 6 * this.maxSize;
  2393. this.vertices = new PIXI.Float32Array(e), this.indices = new PIXI.Uint16Array(i), this.vertexBuffer = null, this.indexBuffer = null, this.lastIndexCount = 0;
  2394. for (var r = 0, n = 0; i > r; r += 6, n += 4) this.indices[r + 0] = n + 0, this.indices[r + 1] = n + 1, this.indices[r + 2] = n + 2, this.indices[r + 3] = n + 0, this.indices[r + 4] = n + 2, this.indices[r + 5] = n + 3;
  2395. this.drawing = !1, this.currentBatchSize = 0, this.currentBaseTexture = null, this.currentBlendMode = 0, this.renderSession = null, this.shader = null, this.matrix = null, this.setContext(t)
  2396. }, PIXI.WebGLFastSpriteBatch.prototype.constructor = PIXI.WebGLFastSpriteBatch, PIXI.WebGLFastSpriteBatch.prototype.setContext = function(t) {
  2397. this.gl = t, this.vertexBuffer = t.createBuffer(), this.indexBuffer = t.createBuffer(), t.bindBuffer(t.ELEMENT_ARRAY_BUFFER, this.indexBuffer), t.bufferData(t.ELEMENT_ARRAY_BUFFER, this.indices, t.STATIC_DRAW), t.bindBuffer(t.ARRAY_BUFFER, this.vertexBuffer), t.bufferData(t.ARRAY_BUFFER, this.vertices, t.DYNAMIC_DRAW)
  2398. }, PIXI.WebGLFastSpriteBatch.prototype.begin = function(t, e) {
  2399. this.renderSession = e, this.shader = this.renderSession.shaderManager.fastShader, this.matrix = t.worldTransform.toArray(!0), this.start()
  2400. }, PIXI.WebGLFastSpriteBatch.prototype.end = function() {
  2401. this.flush()
  2402. }, PIXI.WebGLFastSpriteBatch.prototype.render = function(t) {
  2403. var e = t.children,
  2404. i = e[0];
  2405. if (i.texture._uvs) {
  2406. this.currentBaseTexture = i.texture.baseTexture, i.blendMode !== this.renderSession.blendModeManager.currentBlendMode && (this.flush(), this.renderSession.blendModeManager.setBlendMode(i.blendMode));
  2407. for (var r = 0, n = e.length; n > r; r++) this.renderSprite(e[r]);
  2408. this.flush()
  2409. }
  2410. }, PIXI.WebGLFastSpriteBatch.prototype.renderSprite = function(t) {
  2411. if (t.visible && (t.texture.baseTexture === this.currentBaseTexture || (this.flush(), this.currentBaseTexture = t.texture.baseTexture, t.texture._uvs))) {
  2412. var e, i, r, n, o, s, a, h, l = this.vertices;
  2413. if (e = t.texture._uvs, i = t.texture.frame.width, r = t.texture.frame.height, t.texture.trim) {
  2414. var c = t.texture.trim;
  2415. o = c.x - t.anchor.x * c.width, n = o + t.texture.crop.width, a = c.y - t.anchor.y * c.height, s = a + t.texture.crop.height
  2416. } else n = t.texture.frame.width * (1 - t.anchor.x), o = t.texture.frame.width * -t.anchor.x, s = t.texture.frame.height * (1 - t.anchor.y), a = t.texture.frame.height * -t.anchor.y;
  2417. h = 4 * this.currentBatchSize * this.vertSize, l[h++] = o, l[h++] = a, l[h++] = t.position.x, l[h++] = t.position.y, l[h++] = t.scale.x, l[h++] = t.scale.y, l[h++] = t.rotation, l[h++] = e.x0, l[h++] = e.y1, l[h++] = t.alpha, l[h++] = n, l[h++] = a, l[h++] = t.position.x, l[h++] = t.position.y, l[h++] = t.scale.x, l[h++] = t.scale.y, l[h++] = t.rotation, l[h++] = e.x1, l[h++] = e.y1, l[h++] = t.alpha, l[h++] = n, l[h++] = s, l[h++] = t.position.x, l[h++] = t.position.y, l[h++] = t.scale.x, l[h++] = t.scale.y, l[h++] = t.rotation, l[h++] = e.x2, l[h++] = e.y2, l[h++] = t.alpha, l[h++] = o, l[h++] = s, l[h++] = t.position.x, l[h++] = t.position.y, l[h++] = t.scale.x, l[h++] = t.scale.y, l[h++] = t.rotation, l[h++] = e.x3, l[h++] = e.y3, l[h++] = t.alpha, this.currentBatchSize++, this.currentBatchSize >= this.size && this.flush()
  2418. }
  2419. }, PIXI.WebGLFastSpriteBatch.prototype.flush = function() {
  2420. if (0 !== this.currentBatchSize) {
  2421. var t = this.gl;
  2422. if (this.currentBaseTexture._glTextures[t.id] || this.renderSession.renderer.updateTexture(this.currentBaseTexture, t), t.bindTexture(t.TEXTURE_2D, this.currentBaseTexture._glTextures[t.id]), this.currentBatchSize > .5 * this.size) t.bufferSubData(t.ARRAY_BUFFER, 0, this.vertices);
  2423. else {
  2424. var e = this.vertices.subarray(0, 4 * this.currentBatchSize * this.vertSize);
  2425. t.bufferSubData(t.ARRAY_BUFFER, 0, e)
  2426. }
  2427. t.drawElements(t.TRIANGLES, 6 * this.currentBatchSize, t.UNSIGNED_SHORT, 0), this.currentBatchSize = 0, this.renderSession.drawCount++
  2428. }
  2429. }, PIXI.WebGLFastSpriteBatch.prototype.stop = function() {
  2430. this.flush()
  2431. }, PIXI.WebGLFastSpriteBatch.prototype.start = function() {
  2432. var t = this.gl;
  2433. t.activeTexture(t.TEXTURE0), t.bindBuffer(t.ARRAY_BUFFER, this.vertexBuffer), t.bindBuffer(t.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  2434. var e = this.renderSession.projection;
  2435. t.uniform2f(this.shader.projectionVector, e.x, e.y), t.uniformMatrix3fv(this.shader.uMatrix, !1, this.matrix);
  2436. var i = 4 * this.vertSize;
  2437. t.vertexAttribPointer(this.shader.aVertexPosition, 2, t.FLOAT, !1, i, 0), t.vertexAttribPointer(this.shader.aPositionCoord, 2, t.FLOAT, !1, i, 8), t.vertexAttribPointer(this.shader.aScale, 2, t.FLOAT, !1, i, 16), t.vertexAttribPointer(this.shader.aRotation, 1, t.FLOAT, !1, i, 24), t.vertexAttribPointer(this.shader.aTextureCoord, 2, t.FLOAT, !1, i, 28), t.vertexAttribPointer(this.shader.colorAttribute, 1, t.FLOAT, !1, i, 36)
  2438. }, PIXI.WebGLFilterManager = function() {
  2439. this.filterStack = [], this.offsetX = 0, this.offsetY = 0
  2440. }, PIXI.WebGLFilterManager.prototype.constructor = PIXI.WebGLFilterManager, PIXI.WebGLFilterManager.prototype.setContext = function(t) {
  2441. this.gl = t, this.texturePool = [], this.initShaderBuffers()
  2442. }, PIXI.WebGLFilterManager.prototype.begin = function(t, e) {
  2443. this.renderSession = t, this.defaultShader = t.shaderManager.defaultShader;
  2444. var i = this.renderSession.projection;
  2445. this.width = 2 * i.x, this.height = 2 * -i.y, this.buffer = e
  2446. }, PIXI.WebGLFilterManager.prototype.pushFilter = function(t) {
  2447. var e = this.gl,
  2448. i = this.renderSession.projection,
  2449. r = this.renderSession.offset;
  2450. t._filterArea = t.target.filterArea || t.target.getBounds(), this.filterStack.push(t);
  2451. var n = t.filterPasses[0];
  2452. this.offsetX += t._filterArea.x, this.offsetY += t._filterArea.y;
  2453. var o = this.texturePool.pop();
  2454. o ? o.resize(this.width, this.height) : o = new PIXI.FilterTexture(this.gl, this.width, this.height), e.bindTexture(e.TEXTURE_2D, o.texture);
  2455. var s = t._filterArea,
  2456. a = n.padding;
  2457. s.x -= a, s.y -= a, s.width += 2 * a, s.height += 2 * a, s.x < 0 && (s.x = 0), s.width > this.width && (s.width = this.width), s.y < 0 && (s.y = 0), s.height > this.height && (s.height = this.height), e.bindFramebuffer(e.FRAMEBUFFER, o.frameBuffer), e.viewport(0, 0, s.width, s.height), i.x = s.width / 2, i.y = -s.height / 2, r.x = -s.x, r.y = -s.y, e.colorMask(!0, !0, !0, !0), e.clearColor(0, 0, 0, 0), e.clear(e.COLOR_BUFFER_BIT), t._glFilterTexture = o
  2458. }, PIXI.WebGLFilterManager.prototype.popFilter = function() {
  2459. var t = this.gl,
  2460. e = this.filterStack.pop(),
  2461. i = e._filterArea,
  2462. r = e._glFilterTexture,
  2463. n = this.renderSession.projection,
  2464. o = this.renderSession.offset;
  2465. if (e.filterPasses.length > 1) {
  2466. t.viewport(0, 0, i.width, i.height), t.bindBuffer(t.ARRAY_BUFFER, this.vertexBuffer), this.vertexArray[0] = 0, this.vertexArray[1] = i.height, this.vertexArray[2] = i.width, this.vertexArray[3] = i.height, this.vertexArray[4] = 0, this.vertexArray[5] = 0, this.vertexArray[6] = i.width, this.vertexArray[7] = 0, t.bufferSubData(t.ARRAY_BUFFER, 0, this.vertexArray), t.bindBuffer(t.ARRAY_BUFFER, this.uvBuffer), this.uvArray[2] = i.width / this.width, this.uvArray[5] = i.height / this.height, this.uvArray[6] = i.width / this.width, this.uvArray[7] = i.height / this.height, t.bufferSubData(t.ARRAY_BUFFER, 0, this.uvArray);
  2467. var s = r,
  2468. a = this.texturePool.pop();
  2469. a || (a = new PIXI.FilterTexture(this.gl, this.width, this.height)), a.resize(this.width, this.height), t.bindFramebuffer(t.FRAMEBUFFER, a.frameBuffer), t.clear(t.COLOR_BUFFER_BIT), t.disable(t.BLEND);
  2470. for (var h = 0; h < e.filterPasses.length - 1; h++) {
  2471. var l = e.filterPasses[h];
  2472. t.bindFramebuffer(t.FRAMEBUFFER, a.frameBuffer), t.activeTexture(t.TEXTURE0), t.bindTexture(t.TEXTURE_2D, s.texture), this.applyFilterPass(l, i, i.width, i.height);
  2473. var c = s;
  2474. s = a, a = c
  2475. }
  2476. t.enable(t.BLEND), r = s, this.texturePool.push(a)
  2477. }
  2478. var d = e.filterPasses[e.filterPasses.length - 1];
  2479. this.offsetX -= i.x, this.offsetY -= i.y;
  2480. var u = this.width,
  2481. p = this.height,
  2482. f = 0,
  2483. I = 0,
  2484. g = this.buffer;
  2485. if (0 === this.filterStack.length) t.colorMask(!0, !0, !0, !0);
  2486. else {
  2487. var v = this.filterStack[this.filterStack.length - 1];
  2488. i = v._filterArea, u = i.width, p = i.height, f = i.x, I = i.y, g = v._glFilterTexture.frameBuffer
  2489. }
  2490. n.x = u / 2, n.y = -p / 2, o.x = f, o.y = I, i = e._filterArea;
  2491. var y = i.x - f,
  2492. w = i.y - I;
  2493. t.bindBuffer(t.ARRAY_BUFFER, this.vertexBuffer), this.vertexArray[0] = y, this.vertexArray[1] = w + i.height, this.vertexArray[2] = y + i.width, this.vertexArray[3] = w + i.height, this.vertexArray[4] = y, this.vertexArray[5] = w, this.vertexArray[6] = y + i.width, this.vertexArray[7] = w, t.bufferSubData(t.ARRAY_BUFFER, 0, this.vertexArray), t.bindBuffer(t.ARRAY_BUFFER, this.uvBuffer), this.uvArray[2] = i.width / this.width, this.uvArray[5] = i.height / this.height, this.uvArray[6] = i.width / this.width, this.uvArray[7] = i.height / this.height, t.bufferSubData(t.ARRAY_BUFFER, 0, this.uvArray), t.viewport(0, 0, u, p), t.bindFramebuffer(t.FRAMEBUFFER, g), t.activeTexture(t.TEXTURE0), t.bindTexture(t.TEXTURE_2D, r.texture), this.applyFilterPass(d, i, u, p), this.texturePool.push(r), e._glFilterTexture = null
  2494. }, PIXI.WebGLFilterManager.prototype.applyFilterPass = function(t, e, i, r) {
  2495. var n = this.gl,
  2496. o = t.shaders[n.id];
  2497. o || (o = new PIXI.PixiShader(n), o.fragmentSrc = t.fragmentSrc, o.uniforms = t.uniforms, o.init(), t.shaders[n.id] = o), this.renderSession.shaderManager.setShader(o), n.uniform2f(o.projectionVector, i / 2, -r / 2), n.uniform2f(o.offsetVector, 0, 0), t.uniforms.dimensions && (t.uniforms.dimensions.value[0] = this.width, t.uniforms.dimensions.value[1] = this.height, t.uniforms.dimensions.value[2] = this.vertexArray[0], t.uniforms.dimensions.value[3] = this.vertexArray[5]), o.syncUniforms(), n.bindBuffer(n.ARRAY_BUFFER, this.vertexBuffer), n.vertexAttribPointer(o.aVertexPosition, 2, n.FLOAT, !1, 0, 0), n.bindBuffer(n.ARRAY_BUFFER, this.uvBuffer), n.vertexAttribPointer(o.aTextureCoord, 2, n.FLOAT, !1, 0, 0), n.bindBuffer(n.ARRAY_BUFFER, this.colorBuffer), n.vertexAttribPointer(o.colorAttribute, 2, n.FLOAT, !1, 0, 0), n.bindBuffer(n.ELEMENT_ARRAY_BUFFER, this.indexBuffer), n.drawElements(n.TRIANGLES, 6, n.UNSIGNED_SHORT, 0), this.renderSession.drawCount++
  2498. }, PIXI.WebGLFilterManager.prototype.initShaderBuffers = function() {
  2499. var t = this.gl;
  2500. this.vertexBuffer = t.createBuffer(), this.uvBuffer = t.createBuffer(), this.colorBuffer = t.createBuffer(), this.indexBuffer = t.createBuffer(), this.vertexArray = new PIXI.Float32Array([0, 0, 1, 0, 0, 1, 1, 1]), t.bindBuffer(t.ARRAY_BUFFER, this.vertexBuffer), t.bufferData(t.ARRAY_BUFFER, this.vertexArray, t.STATIC_DRAW), this.uvArray = new PIXI.Float32Array([0, 0, 1, 0, 0, 1, 1, 1]), t.bindBuffer(t.ARRAY_BUFFER, this.uvBuffer), t.bufferData(t.ARRAY_BUFFER, this.uvArray, t.STATIC_DRAW), this.colorArray = new PIXI.Float32Array([1, 16777215, 1, 16777215, 1, 16777215, 1, 16777215]), t.bindBuffer(t.ARRAY_BUFFER, this.colorBuffer), t.bufferData(t.ARRAY_BUFFER, this.colorArray, t.STATIC_DRAW), t.bindBuffer(t.ELEMENT_ARRAY_BUFFER, this.indexBuffer), t.bufferData(t.ELEMENT_ARRAY_BUFFER, new Uint16Array([0, 1, 2, 1, 3, 2]), t.STATIC_DRAW)
  2501. }, PIXI.WebGLFilterManager.prototype.destroy = function() {
  2502. var t = this.gl;
  2503. this.filterStack = null, this.offsetX = 0, this.offsetY = 0;
  2504. for (var e = 0; e < this.texturePool.length; e++) this.texturePool[e].destroy();
  2505. this.texturePool = null, t.deleteBuffer(this.vertexBuffer), t.deleteBuffer(this.uvBuffer), t.deleteBuffer(this.colorBuffer), t.deleteBuffer(this.indexBuffer)
  2506. }, PIXI.FilterTexture = function(t, e, i, r) {
  2507. this.gl = t, this.frameBuffer = t.createFramebuffer(), this.texture = t.createTexture(), r = r || PIXI.scaleModes.DEFAULT, t.bindTexture(t.TEXTURE_2D, this.texture), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MAG_FILTER, r === PIXI.scaleModes.LINEAR ? t.LINEAR : t.NEAREST), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MIN_FILTER, r === PIXI.scaleModes.LINEAR ? t.LINEAR : t.NEAREST), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_S, t.CLAMP_TO_EDGE), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_T, t.CLAMP_TO_EDGE), t.bindFramebuffer(t.FRAMEBUFFER, this.frameBuffer), t.bindFramebuffer(t.FRAMEBUFFER, this.frameBuffer), t.framebufferTexture2D(t.FRAMEBUFFER, t.COLOR_ATTACHMENT0, t.TEXTURE_2D, this.texture, 0), this.renderBuffer = t.createRenderbuffer(), t.bindRenderbuffer(t.RENDERBUFFER, this.renderBuffer), t.framebufferRenderbuffer(t.FRAMEBUFFER, t.DEPTH_STENCIL_ATTACHMENT, t.RENDERBUFFER, this.renderBuffer), this.resize(e, i)
  2508. }, PIXI.FilterTexture.prototype.constructor = PIXI.FilterTexture, PIXI.FilterTexture.prototype.clear = function() {
  2509. var t = this.gl;
  2510. t.clearColor(0, 0, 0, 0), t.clear(t.COLOR_BUFFER_BIT)
  2511. }, PIXI.FilterTexture.prototype.resize = function(t, e) {
  2512. if (this.width !== t || this.height !== e) {
  2513. this.width = t, this.height = e;
  2514. var i = this.gl;
  2515. i.bindTexture(i.TEXTURE_2D, this.texture), i.texImage2D(i.TEXTURE_2D, 0, i.RGBA, t, e, 0, i.RGBA, i.UNSIGNED_BYTE, null), i.bindRenderbuffer(i.RENDERBUFFER, this.renderBuffer), i.renderbufferStorage(i.RENDERBUFFER, i.DEPTH_STENCIL, t, e)
  2516. }
  2517. }, PIXI.FilterTexture.prototype.destroy = function() {
  2518. var t = this.gl;
  2519. t.deleteFramebuffer(this.frameBuffer), t.deleteTexture(this.texture), this.frameBuffer = null, this.texture = null
  2520. }, PIXI.CanvasBuffer = function(t, e) {
  2521. this.width = t, this.height = e, this.canvas = document.createElement("canvas"), this.context = this.canvas.getContext("2d"), this.canvas.width = t, this.canvas.height = e
  2522. }, PIXI.CanvasBuffer.prototype.constructor = PIXI.CanvasBuffer, PIXI.CanvasBuffer.prototype.clear = function() {
  2523. this.context.setTransform(1, 0, 0, 1, 0, 0), this.context.clearRect(0, 0, this.width, this.height)
  2524. }, PIXI.CanvasBuffer.prototype.resize = function(t, e) {
  2525. this.width = this.canvas.width = t, this.height = this.canvas.height = e
  2526. }, PIXI.CanvasMaskManager = function() {}, PIXI.CanvasMaskManager.prototype.constructor = PIXI.CanvasMaskManager, PIXI.CanvasMaskManager.prototype.pushMask = function(t, e) {
  2527. var i = e.context;
  2528. i.save();
  2529. var r = t.alpha,
  2530. n = t.worldTransform,
  2531. o = e.resolution;
  2532. i.setTransform(n.a * o, n.b * o, n.c * o, n.d * o, n.tx * o, n.ty * o), PIXI.CanvasGraphics.renderGraphicsMask(t, i), i.clip(), t.worldAlpha = r
  2533. }, PIXI.CanvasMaskManager.prototype.popMask = function(t) {
  2534. t.context.restore()
  2535. }, PIXI.CanvasTinter = function() {}, PIXI.CanvasTinter.getTintedTexture = function(t, e) {
  2536. var i = t.texture;
  2537. e = PIXI.CanvasTinter.roundColor(e);
  2538. var r = "#" + ("00000" + (0 | e).toString(16)).substr(-6);
  2539. if (i.tintCache = i.tintCache || {}, i.tintCache[r]) return i.tintCache[r];
  2540. var n = PIXI.CanvasTinter.canvas || document.createElement("canvas");
  2541. if (PIXI.CanvasTinter.tintMethod(i, e, n), PIXI.CanvasTinter.convertTintToImage) {
  2542. var o = new Image;
  2543. o.src = n.toDataURL(), i.tintCache[r] = o
  2544. } else i.tintCache[r] = n, PIXI.CanvasTinter.canvas = null;
  2545. return n
  2546. }, PIXI.CanvasTinter.tintWithMultiply = function(t, e, i) {
  2547. var r = i.getContext("2d"),
  2548. n = t.crop;
  2549. i.width = n.width, i.height = n.height, r.fillStyle = "#" + ("00000" + (0 | e).toString(16)).substr(-6), r.fillRect(0, 0, n.width, n.height), r.globalCompositeOperation = "multiply", r.drawImage(t.baseTexture.source, n.x, n.y, n.width, n.height, 0, 0, n.width, n.height), r.globalCompositeOperation = "destination-atop", r.drawImage(t.baseTexture.source, n.x, n.y, n.width, n.height, 0, 0, n.width, n.height)
  2550. }, PIXI.CanvasTinter.tintWithOverlay = function(t, e, i) {
  2551. var r = i.getContext("2d"),
  2552. n = t.crop;
  2553. i.width = n.width, i.height = n.height, r.globalCompositeOperation = "copy", r.fillStyle = "#" + ("00000" + (0 | e).toString(16)).substr(-6), r.fillRect(0, 0, n.width, n.height), r.globalCompositeOperation = "destination-atop", r.drawImage(t.baseTexture.source, n.x, n.y, n.width, n.height, 0, 0, n.width, n.height)
  2554. }, PIXI.CanvasTinter.tintWithPerPixel = function(t, e, i) {
  2555. var r = i.getContext("2d"),
  2556. n = t.crop;
  2557. i.width = n.width, i.height = n.height, r.globalCompositeOperation = "copy", r.drawImage(t.baseTexture.source, n.x, n.y, n.width, n.height, 0, 0, n.width, n.height);
  2558. for (var o = PIXI.hex2rgb(e), s = o[0], a = o[1], h = o[2], l = r.getImageData(0, 0, n.width, n.height), c = l.data, d = 0; d < c.length; d += 4) c[d + 0] *= s, c[d + 1] *= a, c[d + 2] *= h;
  2559. r.putImageData(l, 0, 0)
  2560. }, PIXI.CanvasTinter.roundColor = function(t) {
  2561. var e = PIXI.CanvasTinter.cacheStepsPerColorChannel,
  2562. i = PIXI.hex2rgb(t);
  2563. return i[0] = Math.min(255, i[0] / e * e), i[1] = Math.min(255, i[1] / e * e), i[2] = Math.min(255, i[2] / e * e), PIXI.rgb2hex(i)
  2564. }, PIXI.CanvasTinter.cacheStepsPerColorChannel = 8, PIXI.CanvasTinter.convertTintToImage = !1, PIXI.CanvasTinter.canUseMultiply = PIXI.canUseNewCanvasBlendModes(), PIXI.CanvasTinter.tintMethod = PIXI.CanvasTinter.canUseMultiply ? PIXI.CanvasTinter.tintWithMultiply : PIXI.CanvasTinter.tintWithPerPixel, PIXI.CanvasRenderer = function(t, e, i) {
  2565. if (i)
  2566. for (var r in PIXI.defaultRenderOptions) "undefined" == typeof i[r] && (i[r] = PIXI.defaultRenderOptions[r]);
  2567. else i = PIXI.defaultRenderOptions;
  2568. PIXI.defaultRenderer || (PIXI.sayHello("Canvas"), PIXI.defaultRenderer = this), this.type = PIXI.CANVAS_RENDERER, this.resolution = i.resolution, this.clearBeforeRender = i.clearBeforeRender, this.transparent = i.transparent, this.autoResize = i.autoResize || !1, this.width = t || 800, this.height = e || 600, this.width *= this.resolution, this.height *= this.resolution, this.view = i.view || document.createElement("canvas"), this.context = this.view.getContext("2d", {
  2569. alpha: this.transparent
  2570. }), this.refresh = !0, this.view.width = this.width * this.resolution, this.view.height = this.height * this.resolution, this.count = 0, this.maskManager = new PIXI.CanvasMaskManager, this.renderSession = {
  2571. context: this.context,
  2572. maskManager: this.maskManager,
  2573. scaleMode: null,
  2574. smoothProperty: null,
  2575. roundPixels: !0
  2576. }, this.mapBlendModes(), this.resize(t, e), "imageSmoothingEnabled" in this.context ? this.renderSession.smoothProperty = "imageSmoothingEnabled" : "webkitImageSmoothingEnabled" in this.context ? this.renderSession.smoothProperty = "webkitImageSmoothingEnabled" : "mozImageSmoothingEnabled" in this.context ? this.renderSession.smoothProperty = "mozImageSmoothingEnabled" : "oImageSmoothingEnabled" in this.context ? this.renderSession.smoothProperty = "oImageSmoothingEnabled" : "msImageSmoothingEnabled" in this.context && (this.renderSession.smoothProperty = "msImageSmoothingEnabled")
  2577. }, PIXI.CanvasRenderer.prototype.constructor = PIXI.CanvasRenderer, PIXI.CanvasRenderer.prototype.render = function(t) {
  2578. t.updateTransform(), this.context.setTransform(1, 0, 0, 1, 0, 0), this.context.globalAlpha = 1, this.renderSession.currentBlendMode = PIXI.blendModes.NORMAL, this.context.globalCompositeOperation = PIXI.blendModesCanvas[PIXI.blendModes.NORMAL], this.renderDisplayObject(t), t.interactive && (t._interactiveEventsAdded || (t._interactiveEventsAdded = !0, t.interactionManager.setTarget(this)))
  2579. }, PIXI.CanvasRenderer.prototype.destroy = function(t) {
  2580. "undefined" == typeof t && (t = !0), t && this.view.parent && this.view.parent.removeChild(this.view), this.view = null, this.context = null, this.maskManager = null, this.renderSession = null
  2581. }, PIXI.CanvasRenderer.prototype.resize = function(t, e) {
  2582. this.width = t * this.resolution, this.height = e * this.resolution, this.view.width = this.width, this.view.height = this.height, this.autoResize && (this.view.style.width = this.width / this.resolution + "px", this.view.style.height = this.height / this.resolution + "px")
  2583. }, PIXI.CanvasRenderer.prototype.renderDisplayObject = function(t, e) {
  2584. this.renderSession.context = e || this.context, this.renderSession.resolution = this.resolution, t._renderCanvas(this.renderSession)
  2585. }, PIXI.CanvasRenderer.prototype.mapBlendModes = function() {
  2586. PIXI.blendModesCanvas || (PIXI.blendModesCanvas = [],
  2587. PIXI.canUseNewCanvasBlendModes() ? (PIXI.blendModesCanvas[PIXI.blendModes.NORMAL] = "source-over", PIXI.blendModesCanvas[PIXI.blendModes.ADD] = "lighter", PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "multiply", PIXI.blendModesCanvas[PIXI.blendModes.SCREEN] = "screen", PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY] = "overlay", PIXI.blendModesCanvas[PIXI.blendModes.DARKEN] = "darken", PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN] = "lighten", PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "color-dodge", PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "color-burn", PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "hard-light", PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "soft-light", PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "difference", PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "exclusion", PIXI.blendModesCanvas[PIXI.blendModes.HUE] = "hue", PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "saturation", PIXI.blendModesCanvas[PIXI.blendModes.COLOR] = "color", PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "luminosity") : (PIXI.blendModesCanvas[PIXI.blendModes.NORMAL] = "source-over", PIXI.blendModesCanvas[PIXI.blendModes.ADD] = "lighter", PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "source-over", PIXI.blendModesCanvas[PIXI.blendModes.SCREEN] = "source-over", PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY] = "source-over", PIXI.blendModesCanvas[PIXI.blendModes.DARKEN] = "source-over", PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN] = "source-over", PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "source-over", PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "source-over", PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "source-over", PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "source-over", PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "source-over", PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "source-over", PIXI.blendModesCanvas[PIXI.blendModes.HUE] = "source-over", PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "source-over", PIXI.blendModesCanvas[PIXI.blendModes.COLOR] = "source-over", PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "source-over"))
  2588. }, PIXI.CanvasGraphics = function() {}, PIXI.CanvasGraphics.renderGraphics = function(t, e) {
  2589. var i = t.worldAlpha;
  2590. t.dirty && (this.updateGraphicsTint(t), t.dirty = !1);
  2591. for (var r = 0; r < t.graphicsData.length; r++) {
  2592. var n = t.graphicsData[r],
  2593. o = n.shape,
  2594. s = n._fillTint,
  2595. a = n._lineTint;
  2596. if (e.lineWidth = n.lineWidth, n.type === PIXI.Graphics.POLY) {
  2597. e.beginPath();
  2598. var h = o.points;
  2599. e.moveTo(h[0], h[1]);
  2600. for (var l = 1; l < h.length / 2; l++) e.lineTo(h[2 * l], h[2 * l + 1]);
  2601. o.closed && e.lineTo(h[0], h[1]), h[0] === h[h.length - 2] && h[1] === h[h.length - 1] && e.closePath(), n.fill && (e.globalAlpha = n.fillAlpha * i, e.fillStyle = "#" + ("00000" + (0 | s).toString(16)).substr(-6), e.fill()), n.lineWidth && (e.globalAlpha = n.lineAlpha * i, e.strokeStyle = "#" + ("00000" + (0 | a).toString(16)).substr(-6), e.stroke())
  2602. } else if (n.type === PIXI.Graphics.RECT)(n.fillColor || 0 === n.fillColor) && (e.globalAlpha = n.fillAlpha * i, e.fillStyle = "#" + ("00000" + (0 | s).toString(16)).substr(-6), e.fillRect(o.x, o.y, o.width, o.height)), n.lineWidth && (e.globalAlpha = n.lineAlpha * i, e.strokeStyle = "#" + ("00000" + (0 | a).toString(16)).substr(-6), e.strokeRect(o.x, o.y, o.width, o.height));
  2603. else if (n.type === PIXI.Graphics.CIRC) e.beginPath(), e.arc(o.x, o.y, o.radius, 0, 2 * Math.PI), e.closePath(), n.fill && (e.globalAlpha = n.fillAlpha * i, e.fillStyle = "#" + ("00000" + (0 | s).toString(16)).substr(-6), e.fill()), n.lineWidth && (e.globalAlpha = n.lineAlpha * i, e.strokeStyle = "#" + ("00000" + (0 | a).toString(16)).substr(-6), e.stroke());
  2604. else if (n.type === PIXI.Graphics.ELIP) {
  2605. var c = 2 * o.width,
  2606. d = 2 * o.height,
  2607. u = o.x - c / 2,
  2608. p = o.y - d / 2;
  2609. e.beginPath();
  2610. var f = .5522848,
  2611. I = c / 2 * f,
  2612. g = d / 2 * f,
  2613. v = u + c,
  2614. y = p + d,
  2615. w = u + c / 2,
  2616. P = p + d / 2;
  2617. e.moveTo(u, P), e.bezierCurveTo(u, P - g, w - I, p, w, p), e.bezierCurveTo(w + I, p, v, P - g, v, P), e.bezierCurveTo(v, P + g, w + I, y, w, y), e.bezierCurveTo(w - I, y, u, P + g, u, P), e.closePath(), n.fill && (e.globalAlpha = n.fillAlpha * i, e.fillStyle = "#" + ("00000" + (0 | s).toString(16)).substr(-6), e.fill()), n.lineWidth && (e.globalAlpha = n.lineAlpha * i, e.strokeStyle = "#" + ("00000" + (0 | a).toString(16)).substr(-6), e.stroke())
  2618. } else if (n.type === PIXI.Graphics.RREC) {
  2619. var m = o.x,
  2620. x = o.y,
  2621. b = o.width,
  2622. T = o.height,
  2623. X = o.radius,
  2624. S = Math.min(b, T) / 2 | 0;
  2625. X = X > S ? S : X, e.beginPath(), e.moveTo(m, x + X), e.lineTo(m, x + T - X), e.quadraticCurveTo(m, x + T, m + X, x + T), e.lineTo(m + b - X, x + T), e.quadraticCurveTo(m + b, x + T, m + b, x + T - X), e.lineTo(m + b, x + X), e.quadraticCurveTo(m + b, x, m + b - X, x), e.lineTo(m + X, x), e.quadraticCurveTo(m, x, m, x + X), e.closePath(), (n.fillColor || 0 === n.fillColor) && (e.globalAlpha = n.fillAlpha * i, e.fillStyle = "#" + ("00000" + (0 | s).toString(16)).substr(-6), e.fill()), n.lineWidth && (e.globalAlpha = n.lineAlpha * i, e.strokeStyle = "#" + ("00000" + (0 | a).toString(16)).substr(-6), e.stroke())
  2626. }
  2627. }
  2628. }, PIXI.CanvasGraphics.renderGraphicsMask = function(t, e) {
  2629. var i = t.graphicsData.length;
  2630. if (0 !== i) {
  2631. i > 1 && (i = 1, window.console.log("Pixi.js warning: masks in canvas can only mask using the first path in the graphics object"));
  2632. for (var r = 0; 1 > r; r++) {
  2633. var n = t.graphicsData[r],
  2634. o = n.shape;
  2635. if (n.type === PIXI.Graphics.POLY) {
  2636. e.beginPath();
  2637. var s = o.points;
  2638. e.moveTo(s[0], s[1]);
  2639. for (var a = 1; a < s.length / 2; a++) e.lineTo(s[2 * a], s[2 * a + 1]);
  2640. s[0] === s[s.length - 2] && s[1] === s[s.length - 1] && e.closePath()
  2641. } else if (n.type === PIXI.Graphics.RECT) e.beginPath(), e.rect(o.x, o.y, o.width, o.height), e.closePath();
  2642. else if (n.type === PIXI.Graphics.CIRC) e.beginPath(), e.arc(o.x, o.y, o.radius, 0, 2 * Math.PI), e.closePath();
  2643. else if (n.type === PIXI.Graphics.ELIP) {
  2644. var h = 2 * o.width,
  2645. l = 2 * o.height,
  2646. c = o.x - h / 2,
  2647. d = o.y - l / 2;
  2648. e.beginPath();
  2649. var u = .5522848,
  2650. p = h / 2 * u,
  2651. f = l / 2 * u,
  2652. I = c + h,
  2653. g = d + l,
  2654. v = c + h / 2,
  2655. y = d + l / 2;
  2656. e.moveTo(c, y), e.bezierCurveTo(c, y - f, v - p, d, v, d), e.bezierCurveTo(v + p, d, I, y - f, I, y), e.bezierCurveTo(I, y + f, v + p, g, v, g), e.bezierCurveTo(v - p, g, c, y + f, c, y), e.closePath()
  2657. } else if (n.type === PIXI.Graphics.RREC) {
  2658. var w = o.points,
  2659. P = w[0],
  2660. m = w[1],
  2661. x = w[2],
  2662. b = w[3],
  2663. T = w[4],
  2664. X = Math.min(x, b) / 2 | 0;
  2665. T = T > X ? X : T, e.beginPath(), e.moveTo(P, m + T), e.lineTo(P, m + b - T), e.quadraticCurveTo(P, m + b, P + T, m + b), e.lineTo(P + x - T, m + b), e.quadraticCurveTo(P + x, m + b, P + x, m + b - T), e.lineTo(P + x, m + T), e.quadraticCurveTo(P + x, m, P + x - T, m), e.lineTo(P + T, m), e.quadraticCurveTo(P, m, P, m + T), e.closePath()
  2666. }
  2667. }
  2668. }
  2669. }, PIXI.CanvasGraphics.updateGraphicsTint = function(t) {
  2670. if (16777215 !== t.tint)
  2671. for (var e = (t.tint >> 16 & 255) / 255, i = (t.tint >> 8 & 255) / 255, r = (255 & t.tint) / 255, n = 0; n < t.graphicsData.length; n++) {
  2672. var o = t.graphicsData[n],
  2673. s = 0 | o.fillColor,
  2674. a = 0 | o.lineColor;
  2675. o._fillTint = ((s >> 16 & 255) / 255 * e * 255 << 16) + ((s >> 8 & 255) / 255 * i * 255 << 8) + (255 & s) / 255 * r * 255, o._lineTint = ((a >> 16 & 255) / 255 * e * 255 << 16) + ((a >> 8 & 255) / 255 * i * 255 << 8) + (255 & a) / 255 * r * 255
  2676. }
  2677. }, PIXI.Graphics = function() {
  2678. PIXI.DisplayObjectContainer.call(this), this.renderable = !0, this.fillAlpha = 1, this.lineWidth = 0, this.lineColor = 0, this.graphicsData = [], this.tint = 16777215, this.ondTint = 16777215, this.blendMode = PIXI.blendModes.NORMAL, this.currentPath = null, this._webGL = [], this.isMask = !1, this.boundsPadding = 0, this._localBounds = new PIXI.Rectangle(0, 0, 1, 1), this.dirty = !0, this.webGLDirty = !1, this.cachedSpriteDirty = !1
  2679. }, PIXI.Graphics.prototype = Object.create(PIXI.DisplayObjectContainer.prototype), PIXI.Graphics.prototype.constructor = PIXI.Graphics, Object.defineProperty(PIXI.Graphics.prototype, "cacheAsBitmap", {
  2680. get: function() {
  2681. return this._cacheAsBitmap
  2682. },
  2683. set: function(t) {
  2684. this._cacheAsBitmap = t, this._cacheAsBitmap ? this._generateCachedSprite() : (this.destroyCachedSprite(), this.dirty = !0)
  2685. }
  2686. }), PIXI.Graphics.prototype.lineStyle = function(t, e, i) {
  2687. if (this.lineWidth = t || 0, this.lineColor = e || 0, this.lineAlpha = arguments.length < 3 ? 1 : i, this.currentPath) {
  2688. if (this.currentPath.shape.points.length) return this.drawShape(new PIXI.Polygon(this.currentPath.shape.points.slice(-2))), this;
  2689. this.currentPath.lineWidth = this.lineWidth, this.currentPath.lineColor = this.lineColor, this.currentPath.lineAlpha = this.lineAlpha
  2690. }
  2691. return this
  2692. }, PIXI.Graphics.prototype.moveTo = function(t, e) {
  2693. return this.drawShape(new PIXI.Polygon([t, e])), this
  2694. }, PIXI.Graphics.prototype.lineTo = function(t, e) {
  2695. return this.currentPath.shape.points.push(t, e), this.dirty = !0, this
  2696. }, PIXI.Graphics.prototype.quadraticCurveTo = function(t, e, i, r) {
  2697. this.currentPath ? 0 === this.currentPath.shape.points.length && (this.currentPath.shape.points = [0, 0]) : this.moveTo(0, 0);
  2698. var n, o, s = 20,
  2699. a = this.currentPath.shape.points;
  2700. 0 === a.length && this.moveTo(0, 0);
  2701. for (var h = a[a.length - 2], l = a[a.length - 1], c = 0, d = 1; s >= d; d++) c = d / s, n = h + (t - h) * c, o = l + (e - l) * c, a.push(n + (t + (i - t) * c - n) * c, o + (e + (r - e) * c - o) * c);
  2702. return this.dirty = !0, this
  2703. }, PIXI.Graphics.prototype.bezierCurveTo = function(t, e, i, r, n, o) {
  2704. this.currentPath ? 0 === this.currentPath.shape.points.length && (this.currentPath.shape.points = [0, 0]) : this.moveTo(0, 0);
  2705. for (var s, a, h, l, c, d = 20, u = this.currentPath.shape.points, p = u[u.length - 2], f = u[u.length - 1], I = 0, g = 1; d >= g; g++) I = g / d, s = 1 - I, a = s * s, h = a * s, l = I * I, c = l * I, u.push(h * p + 3 * a * I * t + 3 * s * l * i + c * n, h * f + 3 * a * I * e + 3 * s * l * r + c * o);
  2706. return this.dirty = !0, this
  2707. }, PIXI.Graphics.prototype.arcTo = function(t, e, i, r, n) {
  2708. this.currentPath ? 0 === this.currentPath.shape.points.length && this.currentPath.shape.points.push(t, e) : this.moveTo(t, e);
  2709. var o = this.currentPath.shape.points,
  2710. s = o[o.length - 2],
  2711. a = o[o.length - 1],
  2712. h = a - e,
  2713. l = s - t,
  2714. c = r - e,
  2715. d = i - t,
  2716. u = Math.abs(h * d - l * c);
  2717. if (1e-8 > u || 0 === n)(o[o.length - 2] !== t || o[o.length - 1] !== e) && o.push(t, e);
  2718. else {
  2719. var p = h * h + l * l,
  2720. f = c * c + d * d,
  2721. I = h * c + l * d,
  2722. g = n * Math.sqrt(p) / u,
  2723. v = n * Math.sqrt(f) / u,
  2724. y = g * I / p,
  2725. w = v * I / f,
  2726. P = g * d + v * l,
  2727. m = g * c + v * h,
  2728. x = l * (v + y),
  2729. b = h * (v + y),
  2730. T = d * (g + w),
  2731. X = c * (g + w),
  2732. S = Math.atan2(b - m, x - P),
  2733. C = Math.atan2(X - m, T - P);
  2734. this.arc(P + t, m + e, n, S, C, l * c > d * h)
  2735. }
  2736. return this.dirty = !0, this
  2737. }, PIXI.Graphics.prototype.arc = function(t, e, i, r, n, o) {
  2738. var s, a = t + Math.cos(r) * i,
  2739. h = e + Math.sin(r) * i;
  2740. if (this.currentPath ? (s = this.currentPath.shape.points, 0 === s.length ? s.push(a, h) : (s[s.length - 2] !== a || s[s.length - 1] !== h) && s.push(a, h)) : (this.moveTo(a, h), s = this.currentPath.shape.points), r === n) return this;
  2741. !o && r >= n ? n += 2 * Math.PI : o && n >= r && (r += 2 * Math.PI);
  2742. var l = o ? -1 * (r - n) : n - r,
  2743. c = Math.abs(l) / (2 * Math.PI) * 40;
  2744. if (0 === l) return this;
  2745. for (var d = l / (2 * c), u = 2 * d, p = Math.cos(d), f = Math.sin(d), I = c - 1, g = I % 1 / I, v = 0; I >= v; v++) {
  2746. var y = v + g * v,
  2747. w = d + r + u * y,
  2748. P = Math.cos(w),
  2749. m = -Math.sin(w);
  2750. s.push((p * P + f * m) * i + t, (p * -m + f * P) * i + e)
  2751. }
  2752. return this.dirty = !0, this
  2753. }, PIXI.Graphics.prototype.beginFill = function(t, e) {
  2754. return this.filling = !0, this.fillColor = t || 0, this.fillAlpha = void 0 === e ? 1 : e, this.currentPath && this.currentPath.shape.points.length <= 2 && (this.currentPath.fill = this.filling, this.currentPath.fillColor = this.fillColor, this.currentPath.fillAlpha = this.fillAlpha), this
  2755. }, PIXI.Graphics.prototype.endFill = function() {
  2756. return this.filling = !1, this.fillColor = null, this.fillAlpha = 1, this
  2757. }, PIXI.Graphics.prototype.drawRect = function(t, e, i, r) {
  2758. return this.drawShape(new PIXI.Rectangle(t, e, i, r)), this
  2759. }, PIXI.Graphics.prototype.drawRoundedRect = function(t, e, i, r, n) {
  2760. return this.drawShape(new PIXI.RoundedRectangle(t, e, i, r, n)), this
  2761. }, PIXI.Graphics.prototype.drawCircle = function(t, e, i) {
  2762. return this.drawShape(new PIXI.Circle(t, e, i)), this
  2763. }, PIXI.Graphics.prototype.drawEllipse = function(t, e, i, r) {
  2764. return this.drawShape(new PIXI.Ellipse(t, e, i, r)), this
  2765. }, PIXI.Graphics.prototype.drawPolygon = function(t) {
  2766. return t instanceof Array || (t = Array.prototype.slice.call(arguments)), this.drawShape(new PIXI.Polygon(t)), this
  2767. }, PIXI.Graphics.prototype.clear = function() {
  2768. return this.lineWidth = 0, this.filling = !1, this.dirty = !0, this.clearDirty = !0, this.graphicsData = [], this
  2769. }, PIXI.Graphics.prototype.generateTexture = function(t, e) {
  2770. t = t || 1;
  2771. var i = this.getBounds(),
  2772. r = new PIXI.CanvasBuffer(i.width * t, i.height * t),
  2773. n = PIXI.Texture.fromCanvas(r.canvas, e);
  2774. return n.baseTexture.resolution = t, r.context.scale(t, t), r.context.translate(-i.x, -i.y), PIXI.CanvasGraphics.renderGraphics(this, r.context), n
  2775. }, PIXI.Graphics.prototype._renderWebGL = function(t) {
  2776. if (this.visible !== !1 && 0 !== this.alpha && this.isMask !== !0) {
  2777. if (this._cacheAsBitmap) return (this.dirty || this.cachedSpriteDirty) && (this._generateCachedSprite(), this.updateCachedSpriteTexture(), this.cachedSpriteDirty = !1, this.dirty = !1), this._cachedSprite.worldAlpha = this.worldAlpha, void PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, t);
  2778. if (t.spriteBatch.stop(), t.blendModeManager.setBlendMode(this.blendMode), this._mask && t.maskManager.pushMask(this._mask, t), this._filters && t.filterManager.pushFilter(this._filterBlock), this.blendMode !== t.spriteBatch.currentBlendMode) {
  2779. t.spriteBatch.currentBlendMode = this.blendMode;
  2780. var e = PIXI.blendModesWebGL[t.spriteBatch.currentBlendMode];
  2781. t.spriteBatch.gl.blendFunc(e[0], e[1])
  2782. }
  2783. if (this.webGLDirty && (this.dirty = !0, this.webGLDirty = !1), PIXI.WebGLGraphics.renderGraphics(this, t), this.children.length) {
  2784. t.spriteBatch.start();
  2785. for (var i = 0, r = this.children.length; r > i; i++) this.children[i]._renderWebGL(t);
  2786. t.spriteBatch.stop()
  2787. }
  2788. this._filters && t.filterManager.popFilter(), this._mask && t.maskManager.popMask(this.mask, t), t.drawCount++, t.spriteBatch.start()
  2789. }
  2790. }, PIXI.Graphics.prototype._renderCanvas = function(t) {
  2791. if (this.visible !== !1 && 0 !== this.alpha && this.isMask !== !0) {
  2792. if (this._cacheAsBitmap) return (this.dirty || this.cachedSpriteDirty) && (this._generateCachedSprite(), this.updateCachedSpriteTexture(), this.cachedSpriteDirty = !1, this.dirty = !1), this._cachedSprite.alpha = this.alpha, void PIXI.Sprite.prototype._renderCanvas.call(this._cachedSprite, t);
  2793. var e = t.context,
  2794. i = this.worldTransform;
  2795. this.blendMode !== t.currentBlendMode && (t.currentBlendMode = this.blendMode, e.globalCompositeOperation = PIXI.blendModesCanvas[t.currentBlendMode]), this._mask && t.maskManager.pushMask(this._mask, t);
  2796. var r = t.resolution;
  2797. e.setTransform(i.a * r, i.b * r, i.c * r, i.d * r, i.tx * r, i.ty * r), this.tint != this.oldTint && (this.dirty = !0, this.oldTint = this.tint), PIXI.CanvasGraphics.renderGraphics(this, e);
  2798. for (var n = 0, o = this.children.length; o > n; n++) this.children[n]._renderCanvas(t);
  2799. this._mask && t.maskManager.popMask(t)
  2800. }
  2801. }, PIXI.Graphics.prototype.getBounds = function(t) {
  2802. if (this.isMask) return PIXI.EmptyRectangle;
  2803. this.dirty && (this.updateLocalBounds(), this.webGLDirty = !0, this.cachedSpriteDirty = !0, this.dirty = !1);
  2804. var e = this._localBounds,
  2805. i = e.x,
  2806. r = e.width + e.x,
  2807. n = e.y,
  2808. o = e.height + e.y,
  2809. s = t || this.worldTransform,
  2810. a = s.a,
  2811. h = s.b,
  2812. l = s.c,
  2813. c = s.d,
  2814. d = s.tx,
  2815. u = s.ty,
  2816. p = a * r + l * o + d,
  2817. f = c * o + h * r + u,
  2818. I = a * i + l * o + d,
  2819. g = c * o + h * i + u,
  2820. v = a * i + l * n + d,
  2821. y = c * n + h * i + u,
  2822. w = a * r + l * n + d,
  2823. P = c * n + h * r + u,
  2824. m = p,
  2825. x = f,
  2826. b = p,
  2827. T = f;
  2828. return b = b > I ? I : b, b = b > v ? v : b, b = b > w ? w : b, T = T > g ? g : T, T = T > y ? y : T, T = T > P ? P : T, m = I > m ? I : m, m = v > m ? v : m, m = w > m ? w : m, x = g > x ? g : x, x = y > x ? y : x, x = P > x ? P : x, this._bounds.x = b, this._bounds.width = m - b, this._bounds.y = T, this._bounds.height = x - T, this._bounds
  2829. }, PIXI.Graphics.prototype.updateLocalBounds = function() {
  2830. var t = 1 / 0,
  2831. e = -(1 / 0),
  2832. i = 1 / 0,
  2833. r = -(1 / 0);
  2834. if (this.graphicsData.length)
  2835. for (var n, o, s, a, h, l, c = 0; c < this.graphicsData.length; c++) {
  2836. var d = this.graphicsData[c],
  2837. u = d.type,
  2838. p = d.lineWidth;
  2839. if (n = d.shape, u === PIXI.Graphics.RECT || u === PIXI.Graphics.RREC) s = n.x - p / 2, a = n.y - p / 2, h = n.width + p, l = n.height + p, t = t > s ? s : t, e = s + h > e ? s + h : e, i = i > a ? a : i, r = a + l > r ? a + l : r;
  2840. else if (u === PIXI.Graphics.CIRC) s = n.x, a = n.y, h = n.radius + p / 2, l = n.radius + p / 2, t = t > s - h ? s - h : t, e = s + h > e ? s + h : e, i = i > a - l ? a - l : i, r = a + l > r ? a + l : r;
  2841. else if (u === PIXI.Graphics.ELIP) s = n.x, a = n.y, h = n.width + p / 2, l = n.height + p / 2, t = t > s - h ? s - h : t, e = s + h > e ? s + h : e, i = i > a - l ? a - l : i, r = a + l > r ? a + l : r;
  2842. else {
  2843. o = n.points;
  2844. for (var f = 0; f < o.length; f += 2) s = o[f], a = o[f + 1], t = t > s - p ? s - p : t, e = s + p > e ? s + p : e, i = i > a - p ? a - p : i, r = a + p > r ? a + p : r
  2845. }
  2846. } else t = 0, e = 0, i = 0, r = 0;
  2847. var I = this.boundsPadding;
  2848. this._localBounds.x = t - I, this._localBounds.width = e - t + 2 * I, this._localBounds.y = i - I, this._localBounds.height = r - i + 2 * I
  2849. }, PIXI.Graphics.prototype._generateCachedSprite = function() {
  2850. var t = this.getLocalBounds();
  2851. if (this._cachedSprite) this._cachedSprite.buffer.resize(t.width, t.height);
  2852. else {
  2853. var e = new PIXI.CanvasBuffer(t.width, t.height),
  2854. i = PIXI.Texture.fromCanvas(e.canvas);
  2855. this._cachedSprite = new PIXI.Sprite(i), this._cachedSprite.buffer = e, this._cachedSprite.worldTransform = this.worldTransform
  2856. }
  2857. this._cachedSprite.anchor.x = -(t.x / t.width), this._cachedSprite.anchor.y = -(t.y / t.height), this._cachedSprite.buffer.context.translate(-t.x, -t.y), this.worldAlpha = 1, PIXI.CanvasGraphics.renderGraphics(this, this._cachedSprite.buffer.context), this._cachedSprite.alpha = this.alpha
  2858. }, PIXI.Graphics.prototype.updateCachedSpriteTexture = function() {
  2859. var t = this._cachedSprite,
  2860. e = t.texture,
  2861. i = t.buffer.canvas;
  2862. e.baseTexture.width = i.width, e.baseTexture.height = i.height, e.crop.width = e.frame.width = i.width, e.crop.height = e.frame.height = i.height, t._width = i.width, t._height = i.height, e.baseTexture.dirty()
  2863. }, PIXI.Graphics.prototype.destroyCachedSprite = function() {
  2864. this._cachedSprite.texture.destroy(!0), this._cachedSprite = null
  2865. }, PIXI.Graphics.prototype.drawShape = function(t) {
  2866. this.currentPath && this.currentPath.shape.points.length <= 2 && this.graphicsData.pop(), this.currentPath = null;
  2867. var e = new PIXI.GraphicsData(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.filling, t);
  2868. return this.graphicsData.push(e), e.type === PIXI.Graphics.POLY && (e.shape.closed = this.filling, this.currentPath = e), this.dirty = !0, e
  2869. }, PIXI.GraphicsData = function(t, e, i, r, n, o, s) {
  2870. this.lineWidth = t, this.lineColor = e, this.lineAlpha = i, this._lineTint = e, this.fillColor = r, this.fillAlpha = n, this._fillTint = r, this.fill = o, this.shape = s, this.type = s.type
  2871. }, PIXI.Graphics.POLY = 0, PIXI.Graphics.RECT = 1, PIXI.Graphics.CIRC = 2, PIXI.Graphics.ELIP = 3, PIXI.Graphics.RREC = 4, PIXI.Polygon.prototype.type = PIXI.Graphics.POLY, PIXI.Rectangle.prototype.type = PIXI.Graphics.RECT, PIXI.Circle.prototype.type = PIXI.Graphics.CIRC, PIXI.Ellipse.prototype.type = PIXI.Graphics.ELIP, PIXI.RoundedRectangle.prototype.type = PIXI.Graphics.RREC, PIXI.BaseTextureCache = {}, PIXI.BaseTextureCacheIdGenerator = 0, PIXI.BaseTexture = function(t, e) {
  2872. if (this.resolution = 1, this.width = 100, this.height = 100, this.scaleMode = e || PIXI.scaleModes.DEFAULT, this.hasLoaded = !1, this.source = t, this._UID = PIXI._UID++, this.premultipliedAlpha = !0, this._glTextures = [], this.mipmap = !1, this._dirty = [!0, !0, !0, !0], t) {
  2873. if ((this.source.complete || this.source.getContext) && this.source.width && this.source.height) this.hasLoaded = !0, this.width = this.source.naturalWidth || this.source.width, this.height = this.source.naturalHeight || this.source.height, this.dirty();
  2874. else {
  2875. var i = this;
  2876. this.source.onload = function() {
  2877. i.hasLoaded = !0, i.width = i.source.naturalWidth || i.source.width, i.height = i.source.naturalHeight || i.source.height, i.dirty(), i.dispatchEvent({
  2878. type: "loaded",
  2879. content: i
  2880. })
  2881. }, this.source.onerror = function() {
  2882. i.dispatchEvent({
  2883. type: "error",
  2884. content: i
  2885. })
  2886. }
  2887. }
  2888. this.imageUrl = null, this._powerOf2 = !1
  2889. }
  2890. }, PIXI.BaseTexture.prototype.constructor = PIXI.BaseTexture, PIXI.EventTarget.mixin(PIXI.BaseTexture.prototype), PIXI.BaseTexture.prototype.destroy = function() {
  2891. this.imageUrl ? (delete PIXI.BaseTextureCache[this.imageUrl], delete PIXI.TextureCache[this.imageUrl], this.imageUrl = null, this.source.src = "") : this.source && this.source._pixiId && delete PIXI.BaseTextureCache[this.source._pixiId], this.source = null, this.unloadFromGPU()
  2892. }, PIXI.BaseTexture.prototype.updateSourceImage = function(t) {
  2893. this.hasLoaded = !1, this.source.src = null, this.source.src = t
  2894. }, PIXI.BaseTexture.prototype.dirty = function() {
  2895. for (var t = 0; t < this._glTextures.length; t++) this._dirty[t] = !0
  2896. }, PIXI.BaseTexture.prototype.unloadFromGPU = function() {
  2897. this.dirty();
  2898. for (var t = this._glTextures.length - 1; t >= 0; t--) {
  2899. var e = this._glTextures[t],
  2900. i = PIXI.glContexts[t];
  2901. i && e && i.deleteTexture(e)
  2902. }
  2903. this._glTextures.length = 0, this.dirty()
  2904. }, PIXI.BaseTexture.fromImage = function(t, e, i) {
  2905. var r = PIXI.BaseTextureCache[t];
  2906. if (void 0 === e && -1 === t.indexOf("data:") && (e = !0), !r) {
  2907. var n = new Image;
  2908. e && (n.crossOrigin = ""), n.src = t, r = new PIXI.BaseTexture(n, i), r.imageUrl = t, PIXI.BaseTextureCache[t] = r, -1 !== t.indexOf(PIXI.RETINA_PREFIX + ".") && (r.resolution = 2)
  2909. }
  2910. return r
  2911. }, PIXI.BaseTexture.fromCanvas = function(t, e) {
  2912. t._pixiId || (t._pixiId = "canvas_" + PIXI.TextureCacheIdGenerator++);
  2913. var i = PIXI.BaseTextureCache[t._pixiId];
  2914. return i || (i = new PIXI.BaseTexture(t, e), PIXI.BaseTextureCache[t._pixiId] = i), i
  2915. }, PIXI.TextureCache = {}, PIXI.FrameCache = {}, PIXI.TextureCacheIdGenerator = 0, PIXI.Texture = function(t, e, i, r) {
  2916. this.noFrame = !1, e || (this.noFrame = !0, e = new PIXI.Rectangle(0, 0, 1, 1)), t instanceof PIXI.Texture && (t = t.baseTexture), this.baseTexture = t, this.frame = e, this.trim = r, this.valid = !1, this.requiresUpdate = !1, this._uvs = null, this.width = 0, this.height = 0, this.crop = i || new PIXI.Rectangle(0, 0, 1, 1), t.hasLoaded ? (this.noFrame && (e = new PIXI.Rectangle(0, 0, t.width, t.height)), this.setFrame(e)) : t.addEventListener("loaded", this.onBaseTextureLoaded.bind(this))
  2917. }, PIXI.Texture.prototype.constructor = PIXI.Texture, PIXI.EventTarget.mixin(PIXI.Texture.prototype), PIXI.Texture.prototype.onBaseTextureLoaded = function() {
  2918. var t = this.baseTexture;
  2919. t.removeEventListener("loaded", this.onLoaded), this.noFrame && (this.frame = new PIXI.Rectangle(0, 0, t.width, t.height)), this.setFrame(this.frame), this.dispatchEvent({
  2920. type: "update",
  2921. content: this
  2922. })
  2923. }, PIXI.Texture.prototype.destroy = function(t) {
  2924. t && this.baseTexture.destroy(), this.valid = !1
  2925. }, PIXI.Texture.prototype.setFrame = function(t) {
  2926. if (this.noFrame = !1, this.frame = t, this.width = t.width, this.height = t.height, this.crop.x = t.x, this.crop.y = t.y, this.crop.width = t.width, this.crop.height = t.height, !this.trim && (t.x + t.width > this.baseTexture.width || t.y + t.height > this.baseTexture.height)) throw new Error("Texture Error: frame does not fit inside the base Texture dimensions " + this);
  2927. this.valid = t && t.width && t.height && this.baseTexture.source && this.baseTexture.hasLoaded, this.trim && (this.width = this.trim.width, this.height = this.trim.height, this.frame.width = this.trim.width, this.frame.height = this.trim.height), this.valid && this._updateUvs()
  2928. }, PIXI.Texture.prototype._updateUvs = function() {
  2929. this._uvs || (this._uvs = new PIXI.TextureUvs);
  2930. var t = this.crop,
  2931. e = this.baseTexture.width,
  2932. i = this.baseTexture.height;
  2933. this._uvs.x0 = t.x / e, this._uvs.y0 = t.y / i, this._uvs.x1 = (t.x + t.width) / e, this._uvs.y1 = t.y / i, this._uvs.x2 = (t.x + t.width) / e, this._uvs.y2 = (t.y + t.height) / i, this._uvs.x3 = t.x / e, this._uvs.y3 = (t.y + t.height) / i
  2934. }, PIXI.Texture.fromImage = function(t, e, i) {
  2935. var r = PIXI.TextureCache[t];
  2936. return r || (r = new PIXI.Texture(PIXI.BaseTexture.fromImage(t, e, i)), PIXI.TextureCache[t] = r), r
  2937. }, PIXI.Texture.fromFrame = function(t) {
  2938. var e = PIXI.TextureCache[t];
  2939. if (!e) throw new Error('The frameId "' + t + '" does not exist in the texture cache ');
  2940. return e
  2941. }, PIXI.Texture.fromCanvas = function(t, e) {
  2942. var i = PIXI.BaseTexture.fromCanvas(t, e);
  2943. return new PIXI.Texture(i)
  2944. }, PIXI.Texture.addTextureToCache = function(t, e) {
  2945. PIXI.TextureCache[e] = t
  2946. }, PIXI.Texture.removeTextureFromCache = function(t) {
  2947. var e = PIXI.TextureCache[t];
  2948. return delete PIXI.TextureCache[t], delete PIXI.BaseTextureCache[t], e
  2949. }, PIXI.TextureUvs = function() {
  2950. this.x0 = 0, this.y0 = 0, this.x1 = 0, this.y1 = 0, this.x2 = 0, this.y2 = 0, this.x3 = 0, this.y3 = 0
  2951. }, PIXI.Texture.emptyTexture = new PIXI.Texture(new PIXI.BaseTexture), PIXI.RenderTexture = function(t, e, i, r, n) {
  2952. if (this.width = t || 100, this.height = e || 100, this.resolution = n || 1, this.frame = new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution), this.crop = new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution), this.baseTexture = new PIXI.BaseTexture, this.baseTexture.width = this.width * this.resolution, this.baseTexture.height = this.height * this.resolution, this.baseTexture._glTextures = [], this.baseTexture.resolution = this.resolution, this.baseTexture.scaleMode = r || PIXI.scaleModes.DEFAULT, this.baseTexture.hasLoaded = !0, PIXI.Texture.call(this, this.baseTexture, new PIXI.Rectangle(0, 0, this.width, this.height)), this.renderer = i || PIXI.defaultRenderer, this.renderer.type === PIXI.WEBGL_RENDERER) {
  2953. var o = this.renderer.gl;
  2954. this.baseTexture._dirty[o.id] = !1, this.textureBuffer = new PIXI.FilterTexture(o, this.width * this.resolution, this.height * this.resolution, this.baseTexture.scaleMode), this.baseTexture._glTextures[o.id] = this.textureBuffer.texture, this.render = this.renderWebGL, this.projection = new PIXI.Point(.5 * this.width, .5 * -this.height)
  2955. } else this.render = this.renderCanvas, this.textureBuffer = new PIXI.CanvasBuffer(this.width * this.resolution, this.height * this.resolution), this.baseTexture.source = this.textureBuffer.canvas;
  2956. this.valid = !0, this._updateUvs()
  2957. }, PIXI.RenderTexture.prototype = Object.create(PIXI.Texture.prototype), PIXI.RenderTexture.prototype.constructor = PIXI.RenderTexture, PIXI.RenderTexture.prototype.resize = function(t, e, i) {
  2958. (t !== this.width || e !== this.height) && (this.valid = t > 0 && e > 0, this.width = this.frame.width = this.crop.width = t, this.height = this.frame.height = this.crop.height = e, i && (this.baseTexture.width = this.width, this.baseTexture.height = this.height), this.renderer.type === PIXI.WEBGL_RENDERER && (this.projection.x = this.width / 2, this.projection.y = -this.height / 2), this.valid && this.textureBuffer.resize(this.width * this.resolution, this.height * this.resolution))
  2959. }, PIXI.RenderTexture.prototype.clear = function() {
  2960. this.valid && (this.renderer.type === PIXI.WEBGL_RENDERER && this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER, this.textureBuffer.frameBuffer), this.textureBuffer.clear())
  2961. }, PIXI.RenderTexture.prototype.renderWebGL = function(t, e, i) {
  2962. if (this.valid) {
  2963. var r = t.worldTransform;
  2964. r.identity(), r.translate(0, 2 * this.projection.y), e && r.append(e), r.scale(1, -1), t.worldAlpha = 1;
  2965. for (var n = t.children, o = 0, s = n.length; s > o; o++) n[o].updateTransform();
  2966. var a = this.renderer.gl;
  2967. a.viewport(0, 0, this.width * this.resolution, this.height * this.resolution), a.bindFramebuffer(a.FRAMEBUFFER, this.textureBuffer.frameBuffer), i && this.textureBuffer.clear(), this.renderer.spriteBatch.dirty = !0, this.renderer.renderDisplayObject(t, this.projection, this.textureBuffer.frameBuffer), this.renderer.spriteBatch.dirty = !0
  2968. }
  2969. }, PIXI.RenderTexture.prototype.renderCanvas = function(t, e, i) {
  2970. if (this.valid) {
  2971. var r = t.worldTransform;
  2972. r.identity(), e && r.append(e), t.worldAlpha = 1;
  2973. for (var n = t.children, o = 0, s = n.length; s > o; o++) n[o].updateTransform();
  2974. i && this.textureBuffer.clear();
  2975. var a = this.textureBuffer.context,
  2976. h = this.renderer.resolution;
  2977. this.renderer.resolution = this.resolution, this.renderer.renderDisplayObject(t, a), this.renderer.resolution = h
  2978. }
  2979. }, PIXI.RenderTexture.prototype.getImage = function() {
  2980. var t = new Image;
  2981. return t.src = this.getBase64(), t
  2982. }, PIXI.RenderTexture.prototype.getBase64 = function() {
  2983. return this.getCanvas().toDataURL()
  2984. }, PIXI.RenderTexture.prototype.getCanvas = function() {
  2985. if (this.renderer.type === PIXI.WEBGL_RENDERER) {
  2986. var t = this.renderer.gl,
  2987. e = this.textureBuffer.width,
  2988. i = this.textureBuffer.height,
  2989. r = new Uint8Array(4 * e * i);
  2990. t.bindFramebuffer(t.FRAMEBUFFER, this.textureBuffer.frameBuffer), t.readPixels(0, 0, e, i, t.RGBA, t.UNSIGNED_BYTE, r), t.bindFramebuffer(t.FRAMEBUFFER, null);
  2991. var n = new PIXI.CanvasBuffer(e, i),
  2992. o = n.context.getImageData(0, 0, e, i);
  2993. return o.data.set(r), n.context.putImageData(o, 0, 0), n.canvas
  2994. }
  2995. return this.textureBuffer.canvas
  2996. }, PIXI.RenderTexture.tempMatrix = new PIXI.Matrix, PIXI.AbstractFilter = function(t, e) {
  2997. this.passes = [this], this.shaders = [], this.dirty = !0, this.padding = 0, this.uniforms = e || {}, this.fragmentSrc = t || []
  2998. }, PIXI.AbstractFilter.prototype.constructor = PIXI.AbstractFilter, PIXI.AbstractFilter.prototype.syncUniforms = function() {
  2999. for (var t = 0, e = this.shaders.length; e > t; t++) this.shaders[t].dirty = !0
  3000. }, window.isAndroid = /(android)/i.test(navigator.userAgent) && !/(Windows)/i.test(navigator.userAgent), window.isiOS = /(ipod|iphone|ipad)/i.test(navigator.userAgent), window.isWindowsMobile = /(IEMobile)/i.test(navigator.userAgent), window.isSilk = /(silk)/i.test(navigator.userAgent), window.isClay = /(clay\.io)/i.test(document.location), window.isFacebookApp = /(fb_canvas)/i.test(document.location), window.isFacebookAppWeb = /(fb_canvas_web)/i.test(document.location), window.isIframed = window.top !== window.self, window.isCordova = window.cordova ? !0 : !1, window.isChromeApp = window.chrome && window.chrome.storage ? !0 : !1, window.isWrapped = isCordova || isChromeApp ? !0 : !1, window.isMobile = window.isAndroid || window.isWindowsMobile || window.isiOS || window.isSilk, window.isApp = window.isCordova || window.isChromeApp, window.isStandalone = "standalone" in window.navigator && window.navigator.standalone, window.isMobileiOSDevice = navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i), window.isKongregate = /(kongregateiframe)/i.test(document.location); window.httpPrefix = 0 == window.location.protocol.indexOf("http") ? "//" : "https://", window.isKik = window.kik ? !0 : !1;
  3001. var ratio = Math.min(window.devicePixelRatio || 1, 2);
  3002. window.marginBottom = 0, window.marginTop = (window.isCordova || window.isStandalone) && window.isiOS ? 25 * ratio : 0, window.ga || (window.ga = function() {}), window.vpath = window.vpath || "./", window.onParseLoginSuccess = function(t) {}, window.showGameOverAd = function() {}, window.hideGameOverAd = function() {}, window.showInterstitialAd = function() {}, window.resizeAd = function() {}, window.showRateGame = function() {}, window.resizeCallbacks = [], window.onresize = function(t) {
  3003. for (var e = 0; e < resizeCallbacks.length; e++) resizeCallbacks[e](t)
  3004. }, window.removeResizeCallback = function(t) {
  3005. for (var e = 0; e < resizeCallbacks.length; e++)
  3006. if (resizeCallbacks[e] == t) return void resizeCallbacks.splice(e, 1)
  3007. }, window.overlayToggleCallbacks = [], window.toggleOverlay = function(t) {
  3008. for (var e = 0; e < overlayToggleCallbacks.length; e++) overlayToggleCallbacks[e](t)
  3009. }, Math.seed = function(t) {
  3010. var e = t,
  3011. i = 22984849,
  3012. r = 4294967295;
  3013. return function() {
  3014. i = 36969 * (65535 & i) + (i >> 16) & r, e = 18e3 * (65535 & e) + (e >> 16) & r;
  3015. var t = (i << 16) + e & r;
  3016. return t /= 4294967296, t + .5
  3017. }
  3018. }, window.Store = function() {
  3019. if (isChromeApp) {
  3020. var t = {},
  3021. e = !1;
  3022. return {
  3023. set: function(i, r) {
  3024. t[i] = r, e || (e = !0, setTimeout(function() {
  3025. e = !1;
  3026. try {
  3027. chrome.storage.sync.set(t, function() {})
  3028. } catch (i) {
  3029. console.log("Failed to save :(")
  3030. }
  3031. }, 3e3))
  3032. },
  3033. get: function(e, i) {
  3034. return t[e] ? t[e] : void chrome.storage.sync.get(e, function(e) {
  3035. for (var r in e) t[r] = e[r];
  3036. i && i()
  3037. })
  3038. },
  3039. remove: function(e) {
  3040. delete t[e], chrome.storage.sync.remove(e, function(t) {})
  3041. }
  3042. }
  3043. }
  3044. var t = {},
  3045. i = function() {
  3046. try {
  3047. return "localStorage" in window && null !== window.localStorage
  3048. } catch (t) {
  3049. return !1
  3050. }
  3051. }();
  3052. return i ? {
  3053. set: function(e, i) {
  3054. t[e] = i;
  3055. try {
  3056. localStorage.setItem(e, i)
  3057. } catch (r) {}
  3058. },
  3059. get: function(e, i) {
  3060. return i && i(), t[e] ? t[e] : localStorage.getItem(e)
  3061. },
  3062. remove: function(t) {
  3063. return localStorage.removeItem(t)
  3064. }
  3065. } : {
  3066. set: function() {},
  3067. get: function(t, e) {
  3068. e && e()
  3069. },
  3070. remove: function() {}
  3071. }
  3072. }(), SoundPlayer.unblocked = !1, window.Sound = new SoundPlayer, window.Music = new SoundPlayer(!0), window.backgroundMusic = null, window.clickSound = null;
  3073. var Tween = function(t, e, i, r) {
  3074. i = void 0 == i ? 1 : i;
  3075. var n = {};
  3076. this.offset = 0, this.method = r || Tween.easeout, this.length = 1e3 * i / (1e3 / 60), this.target = t, this.call = function(t) {
  3077. return this.callback = t, this
  3078. }, this.wait = function(t) {
  3079. return this.delay = 1e3 * (t || 0) / (1e3 / 60), this
  3080. }, this.tick = function() {
  3081. if (this.delay > 0) return void this.delay--;
  3082. this.target.dirty = !0;
  3083. for (var t in n) {
  3084. var e = n[t];
  3085. this.target[t] = this.method(e.start, e.end, this.offset / this.length)
  3086. }
  3087. return this.offset++, this.offset > this.length ? !0 : void 0
  3088. }, this.complete = function() {
  3089. for (var t in n) this.target[t] = n[t].end;
  3090. if (this.callback) {
  3091. var e = this;
  3092. setTimeout(function() {
  3093. e.callback.apply(e.target, null)
  3094. }, 50)
  3095. }
  3096. };
  3097. for (var o in e) n[o] = {
  3098. start: t[o],
  3099. end: e[o]
  3100. };
  3101. Tween.tweens.push(this)
  3102. };
  3103. Tween.tweens = [], Tween.linary = function(t, e, i) {
  3104. return t + (e - t) * i
  3105. }, Tween.easein = function(t, e, i) {
  3106. var r = 1 - Math.sin(i * Math.PI / 2 + Math.PI / 2);
  3107. return t + (e - t) * r
  3108. }, Tween.easeout = function(t, e, i) {
  3109. var r = Math.sin(i * Math.PI / 2);
  3110. return t + (e - t) * r
  3111. }, Tween.easeinout = function(t, e, i) {
  3112. var r = (Math.sin(i * Math.PI + Math.PI / 2) + 1) / 2;
  3113. return t + (e - t) * r
  3114. }, Tween.bounce = function(t, e, i) {
  3115. var r = Math.sin(i * Math.PI);
  3116. return t + (e - t) * r
  3117. }, Tween.tick = function() {
  3118. for (var t = 0; t < Tween.tweens.length; t++) {
  3119. var e = Tween.tweens[t];
  3120. e.tick() && (window.dirtyOnce = !0, Tween.tweens.splice(t--, 1), e.complete())
  3121. }
  3122. }, Tween.complete = function(t) {
  3123. for (var e = 0; e < Tween.tweens.length; e++) {
  3124. var i = Tween.tweens[e];
  3125. i.target == t && (window.dirtyOnce = !0, Tween.tweens.splice(e--, 1), i.complete())
  3126. }
  3127. }, Tween.clear = function(t) {
  3128. for (var e = 0; e < Tween.tweens.length; e++) {
  3129. var i = Tween.tweens[e];
  3130. i.target == t && Tween.tweens.splice(e--, 1)
  3131. }
  3132. };
  3133. var preloadCache = {};
  3134. window.embed = function(t) {
  3135. if (t = vpath + t, void 0 === preloadCache[t]) throw "You can only use the embed method in conjuction with preload";
  3136. return preloadCache[t]
  3137. }, PIXI.dontSayHello = !0;
  3138. var scaledCache = {};
  3139. PIXI.Texture.getScaled = function(t, e) {
  3140. function i(t, e) {
  3141. for (;.5 > e;) t = i(t, .5), e /= .5;
  3142. var r = document.createElement("canvas"),
  3143. n = Math.ceil(t.width * e),
  3144. o = Math.ceil(t.height * e);
  3145. return r.width = n + 2, r.height = o + 2, r.getContext("2d").drawImage(t, 0, 0, t.width, t.height, 1, 1, n, o), r.path = t.path, r
  3146. }
  3147. var r = t.path + ":" + e;
  3148. return void 0 !== scaledCache[r] ? scaledCache[r] : (canvas = document.createElement("canvas"), canvas.width = t.width + 2, canvas.height = t.height + 2, canvas.getContext("2d").drawImage(t, 0, 0, t.width, t.height, 1, 1, t.width, t.height), scaledCache[r] = PIXI.Texture.fromCanvas(i(canvas, e)))
  3149. };
  3150. var Container = function() {
  3151. PIXI.DisplayObjectContainer.call(this);
  3152. var t = void 0;
  3153. Object.defineProperty(this, "ratio", {
  3154. get: function() {
  3155. return t
  3156. },
  3157. set: function(e) {
  3158. if (t !== e) {
  3159. t = e, this.x = this.x, this.y = this.y;
  3160. for (var i = 0; i < this.children.length; i++) this.children[i].ratio = t;
  3161. this.setRatio(e)
  3162. }
  3163. }
  3164. }), this.setRatio = function(t) {}, this.inside = function(t, e, i) {
  3165. return !1
  3166. };
  3167. var e = 0;
  3168. Object.defineProperty(this, "x", {
  3169. get: function() {
  3170. return e
  3171. },
  3172. set: function(t) {
  3173. e = t, this.position.x = t * (this.parent ? this.parent.ratio || 1 : 1)
  3174. }
  3175. });
  3176. var i = 0;
  3177. Object.defineProperty(this, "y", {
  3178. get: function() {
  3179. return i
  3180. },
  3181. set: function(t) {
  3182. i = t, this.position.y = t * (this.parent ? this.parent.ratio || 1 : 1)
  3183. }
  3184. })
  3185. };
  3186. Container.prototype = Object.create(PIXI.DisplayObjectContainer.prototype), Container.prototype.constructor = Container, Container.prototype._addChildAt = Container.prototype.addChildAt, Container.prototype.addChildAt = function(t, e) {
  3187. var i = this._addChildAt(t, e);
  3188. return void 0 != this.ratio && (t.ratio = this.ratio), i
  3189. };
  3190. var SpriteBatch = function() {
  3191. Container.call(this), PIXI.SpriteBatch.call(this)
  3192. };
  3193. SpriteBatch.prototype = Object.create(PIXI.SpriteBatch.prototype), SpriteBatch.prototype.constructor = SpriteBatch, SpriteBatch.prototype._addChildAt = SpriteBatch.prototype.addChildAt, SpriteBatch.prototype.addChildAt = function(t, e) {
  3194. var i = this._addChildAt(t, e);
  3195. return void 0 != this.ratio && (t.ratio = this.ratio), i
  3196. };
  3197. var CachedContainer = function() {
  3198. Container.call(this);
  3199. var t = new PIXI.Sprite(PIXI.Texture.emptyTexture),
  3200. e = document.createElement("canvas"),
  3201. r = e.getContext("2d");
  3202. this.setRatio = function(n) {
  3203. var o = this.getLocalBounds();
  3204. for (e.width = o.width, e.height = o.height, t.worldTransform = this.worldTransform, t.anchor.x = -(o.x / o.width), t.anchor.y = -(o.y / o.height), r.translate(-o.x, -o.y), i = 0, j = this.children.length; i < j; i++) {
  3205. var s = this.children[i];
  3206. s.cacheRender && s.cacheRender(r)
  3207. }
  3208. t.texture.destroy(!0), t.setTexture(PIXI.Texture.fromCanvas(e))
  3209. }, this._renderWebGL = function(e) {
  3210. PIXI.Sprite.prototype._renderWebGL.call(t, e)
  3211. }, this._renderCanvas = function(e) {
  3212. PIXI.Sprite.prototype._renderCanvas.call(t, e)
  3213. }
  3214. };
  3215. CachedContainer.prototype = Object.create(Container.prototype), CachedContainer.prototype.constructor = CachedContainer, CachedContainer.prototype.updateTransform = function() {
  3216. this.displayObjectUpdateTransform()
  3217. };
  3218. var Sprite = function(t) {
  3219. this._ratio = -1, this.image = t, PIXI.Sprite.call(this, new PIXI.RenderTexture(t.width, t.height))
  3220. };
  3221. Sprite.prototype = Object.create(PIXI.Sprite.prototype), Sprite.prototype.constructor = Sprite, Sprite.prototype.getTexture = function(t, e) {
  3222. return PIXI.Texture.getScaled(t, e)
  3223. }, Sprite.prototype.cacheRender = function(t) {
  3224. t.drawImage(this.texture.baseTexture.source, this.position.x, this.position.y)
  3225. }, Sprite.prototype._y = 0, Object.defineProperty(Sprite.prototype, "y", {
  3226. get: function() {
  3227. return this._y
  3228. },
  3229. set: function(t) {
  3230. this._y = t, this.position.y = t * this._ratio - 1
  3231. }
  3232. }), Sprite.prototype._x = 0, Object.defineProperty(Sprite.prototype, "x", {
  3233. get: function() {
  3234. return this._x
  3235. },
  3236. set: function(t) {
  3237. this._x = t, this.position.x = t * this._ratio - 1
  3238. }
  3239. }), Object.defineProperty(Sprite.prototype, "ratio", {
  3240. get: function() {
  3241. return this._ratio
  3242. },
  3243. set: function(t) {
  3244. if (this._ratio !== t) {
  3245. this.setTexture(this.getTexture(this.image, t)), this._ratio = t, this.x = this.x, this.y = this.y;
  3246. for (var e = 0; e < this.children.length; e++) this.children[e].ratio = this._ratio
  3247. }
  3248. }
  3249. }), Sprite.fromSheet = function(t, e) {
  3250. return t.frame = e, new Sprite(t.image)
  3251. }, window.Sprite = Sprite;
  3252. var sheetCache = {},
  3253. Sheet = function(t, e, i) {
  3254. e = e || t.height, i = i || t.height;
  3255. var r = t.width / e,
  3256. n = t.height / i;
  3257. this.length = r * n, this.images = [];
  3258. for (var o = 0; o < this.length; o++) {
  3259. var s = o % r >> 0,
  3260. a = o / r >> 0,
  3261. h = t.src + "," + s + "," + a + "," + e + "," + i,
  3262. l = sheetCache[h];
  3263. void 0 === l && (l = document.createElement("canvas"), l.width = e, l.height = i, l.path = h, l.getContext("2d").drawImage(t, s * e, a * i, e, i, 0, 0, e, i), sheetCache[h] = l), this.images.push(l)
  3264. }
  3265. Sprite.call(this, this.images[0])
  3266. };
  3267. Sheet.prototype = Object.create(Sprite.prototype), Sheet.prototype.constructor = Sheet, Sheet.prototype._frame = 0, Sheet.prototype.images = [], Object.defineProperty(Sheet.prototype, "frame", {
  3268. get: function() {
  3269. return this._frame
  3270. },
  3271. set: function(t) {
  3272. t !== this.frame && (this._frame = t % this.length, this.image = this.images[this._frame], -1 != this.ratio && this.setTexture(this.getTexture(this.image, this.ratio)))
  3273. }
  3274. });
  3275. var ignoreMouseEvents = !1,
  3276. canvas = document.getElementById("gameCanvas"),
  3277. stageContainer = new PIXI.Stage(2105376),
  3278. renderer = PIXI.autoDetectRenderer(width, height, {
  3279. view: canvas,
  3280. antialiasing: !1,
  3281. transparent: !1,
  3282. clearBeforeRender: !0
  3283. });
  3284. document.body.appendChild(canvas);
  3285. var rate = 1e3 / 60,
  3286. before = (new Date).getTime();
  3287. tick = function() {
  3288. var t = (new Date).getTime();
  3289. for (t - before > 5e3 && (before = t); t > before; before += rate) Tween.tick()
  3290. }, window.dirty = !1, window.dirtyOnce = !1, animate();
  3291. var width = 1500,
  3292. height = 1500,
  3293. gameHeight = height,
  3294. stage = new Container;
  3295. stage.hitArea = new PIXI.Rectangle(0, -1e4, 1e5, 1e5), stage.interactive = !0, stage.touchstart = function() {}, stageContainer.addChild(stage), stage.orientation = "landscape";
  3296. var targetWidth = 2048,
  3297. targetHeight = 1536;
  3298. window.forceRatio = !1, resizeCallbacks.push(function() {
  3299. window.resizeAd(), width = Math.max(document.documentElement.clientWidth, 100), height = window.innerHeight || document.documentElement.clientHeight;
  3300. var t = width * ratio >> 0,
  3301. e = height * ratio >> 0;
  3302. renderer.resize(t, e), renderer.view.style.width = (t / ratio >> 0) + "px", renderer.view.style.height = (e / ratio >> 0) + "px", window.scrollTo(0, 0), gameHeight = Math.max(height - marginBottom - marginTop / ratio, 10), stage.orientation = gameHeight >= width ? "portrait" : "landscape", stage.y = marginTop / 2 * ratio;
  3303. var i = targetWidth,
  3304. r = targetHeight;
  3305. "portrait" == stage.orientation && (r = targetWidth, i = targetHeight);
  3306. var n = Math.min(Math.min(width * ratio / i, gameHeight * ratio / r), 1);
  3307. window.forceRatio && (n = 1), stage.ratio = n, document.title = document.title
  3308. }), window.onresize(), window.onunload = function() {
  3309. window.onresize()
  3310. }, setInterval(function() {
  3311. (height != (window.innerHeight || document.documentElement.clientHeight) || width != document.documentElement.clientWidth) && window.onresize()
  3312. }, 500);
  3313. var Text = function(t, e, i, r, n, o, s) {
  3314. PIXI.Text.call(this, [t]), this.weight = e || "300", this.size = i || "30", this.fill = r || "#000000", this.font = n || "sans-serif", this.italic = o || !1, this.align = s || "";
  3315. var a = -1;
  3316. Object.defineProperty(this, "ratio", {
  3317. get: function() {
  3318. return a
  3319. },
  3320. set: function(t) {
  3321. a !== t && (a = t, this.x = this.x, this.y = this.y, this.refreshStyle())
  3322. }
  3323. }), this.refreshStyle = function() {
  3324. var t = {
  3325. font: (this.italic ? "italic " : "") + this.weight + " " + this.size * a * 2 + "px " + this.font,
  3326. fill: this.fill,
  3327. align: this.align
  3328. };
  3329. this.dropShadow && (t.dropShadow = !0), this.setStyle(t)
  3330. }, this.ratio = 1;
  3331. var h = 0;
  3332. Object.defineProperty(this, "x", {
  3333. get: function() {
  3334. return h
  3335. },
  3336. set: function(t) {
  3337. h = t, this.position.x = t * a >> 0
  3338. }
  3339. });
  3340. var l = 0;
  3341. Object.defineProperty(this, "y", {
  3342. get: function() {
  3343. return l
  3344. },
  3345. set: function(t) {
  3346. l = t, this.position.y = t * a >> 0
  3347. }
  3348. }), this.scale.set(.5, .5)
  3349. };
  3350. Text.prototype = Object.create(PIXI.Text.prototype), Text.prototype.constructor = Text,
  3351. function() {
  3352. var t = function() {
  3353. function t() {
  3354. return height * ratio / i.ratio / 2 - a / 2
  3355. }
  3356. function e() {
  3357. i.isShowing = !1, h && h.destroy && h.destroy(), n.removeChild(h), stage.removeChild(i)
  3358. }
  3359. Container.call(this);
  3360. var i = this;
  3361. this.backgroundColor = 16777215, this.isShowing = !1;
  3362. var r = new PIXI.Graphics;
  3363. r.beginFill(0, .6), r.drawRect(0, 0, 200, 200), this.addChild(r), r.interactive = !0, r.defaultCursor = "pointer";
  3364. var n = new Container;
  3365. this.addChild(n);
  3366. var o = new PIXI.Graphics;
  3367. n.addChild(o);
  3368. var s = 800,
  3369. a = 800;
  3370. this.setRatio = function(t) {
  3371. o.width = s * t, o.height = a * t, this.redraw()
  3372. }, this.setHeight = function(t) {
  3373. a = t, o.clear(), o.beginFill(i.backgroundColor, 1), o.drawRoundedRect(0, 0, s, a, 35), this.ratio && this.setRatio(this.ratio)
  3374. }, this.setHeight(800), this.redraw = function() {
  3375. i.ratio = Math.min(Math.min(width * ratio / 900, height * ratio / (a + 100)), ratio / 2), r.width = width * ratio, r.height = height * ratio, n.x = width * ratio / this.ratio / 2 - s / 2
  3376. }, this.handleResize = function() {
  3377. Tween.clear(n), n.x = width * ratio / this.ratio / 2 - s / 2, n.y = t(), i.redraw()
  3378. }, resizeCallbacks.push(this.handleResize);
  3379. var i = this,
  3380. h = null;
  3381. this.show = function(o, s) {
  3382. window.toggleOverlay(!0), e(), i.isShowing = !0, h = o, this.setHeight(h.innerHeight), n.addChild(h), n.y = height * ratio / stage.ratio, r.alpha = 0, new Tween(n, {
  3383. y: t()
  3384. }, .3), s !== !0 && new Tween(r, {
  3385. alpha: 1
  3386. }, .3), stage.addChild(i)
  3387. }, this.hide = function(t) {
  3388. i.isShowing ? (new Tween(r, {
  3389. alpha: 0
  3390. }, .3), new Tween(n, {
  3391. y: -a
  3392. }, .3).call(function() {
  3393. e(), window.toggleOverlay(!1), t instanceof Function && t()
  3394. })) : t instanceof Function && t()
  3395. }, attachUpHandler(r, function() {
  3396. h.blurClose ? i.hide() : h.blurCallback instanceof Function && h.blurCallback()
  3397. }, !0)
  3398. };
  3399. t.prototype = Object.create(Container.prototype), t.prototype.constructor = t, window.Modal = new t
  3400. }();
  3401. var ModelButton = function(t, e, i, r, n, o) {
  3402. Container.call(this);
  3403. var s, a, h;
  3404. r = void 0 === r ? 15748651 : r, s = new PIXI.Graphics, s.beginFill(void 0 === r ? 16711680 : r, 1), this.addChild(s);
  3405. var l = 165 + n;
  3406. if (n ? (s.drawRoundedRect(0, 0, 800, 200, n), a = new PIXI.Graphics, a.beginFill(16777215, 1), a.drawRect(0, 0, 800, n), this.addChild(a)) : s.drawRect(0, 0, 800, l), e) {
  3407. var c = new Text(e, 400, 40, "#ffffff", '"Helvetica Neue","Trebuchet MS", Helvetica, sans-serif');
  3408. c.anchor.set(.5, 0), c.x = 400, c.y = 30 + n + 60, this.addChild(c)
  3409. }
  3410. h = new Text(t, 400, o, "#ffffff", '"Helvetica Neue","Trebuchet MS", Helvetica, sans-serif'), h.anchor.set(.5, 0), h.x = 400, h.y = 30 + n, h.hitArea = new PIXI.Rectangle(-400, -30, 800, 165), this.addChild(h), h.interactive = !0, h.buttonMode = !0, i && attachDownHandler(s, function() {
  3411. window.clickSound && window.clickSound.play(0), i()
  3412. }), this.setRatio = function(t) {
  3413. s.width = 800 * t, s.height = l * t, a && (a.width = 800 * t, a.height = 35 * t)
  3414. }
  3415. };
  3416. ModelButton.prototype = Object.create(Container.prototype), ModelButton.prototype.constructor = ModelButton;
  3417. var PictureButton = function(t, e) {
  3418. Container.call(this);
  3419. var i = new Image;
  3420. i.crossOrigin = "anonymous", i.src = t;
  3421. var r = this;
  3422. i.onload = function() {
  3423. var t = new Sprite(i);
  3424. t.x = -1, r.addChild(t), e && attachDownHandler(t, e)
  3425. }
  3426. };
  3427. PictureButton.prototype = Object.create(Container.prototype), PictureButton.prototype.constructor = PictureButton;
  3428. var ModalOverlayContent = function() {
  3429. Container.call(this), this.innerHeight = 800, this.blurClose = !0, this.addHeadline = function(t) {
  3430. var e = new Text(t, 200, 90, "#2c2c2c", '"Helvetica Neue","Trebuchet MS", Helvetica, sans-serif');
  3431. return e.anchor.set(.5, 0), e.x = 400, e.y = 50, e.updateText(), this.addChild(e), e
  3432. }, this.addTextBlock = function(t, e, i) {
  3433. var r = new Text(t, i || 200, e || 90, "#2c2c2c", '"Helvetica Neue","Trebuchet MS", Helvetica, sans-serif');
  3434. return r.anchor.set(.5, 0), r.x = 400, r.y = 50, r.updateText(), this.addChild(r), r
  3435. }, this.addLead = function(t, e) {
  3436. var i = new Text(t, 200, 45, "#2c2c2c", '"Helvetica Neue","Trebuchet MS", Helvetica, sans-serif', !1, "center");
  3437. return i.anchor.set(.5, 0), i.x = 400, i.y = 140 + (e || 0), i.updateText(), this.addChild(i), i
  3438. };
  3439. this.addButton = function(t, e, i) {
  3440. var r = new ModelButton(t, "", e, i, 35, 90);
  3441. return r.y = 370, this.addChild(r)
  3442. }, this.addMiddleButton = function(t, e, i, r) {
  3443. var n = new ModelButton(t, e, i, r, 0, 60);
  3444. return n.y = 370, this.addChild(n)
  3445. }, this.addSocialButton = function(t, e, i, r) {
  3446. var n = this.addMiddleButton(t, e, i, r);
  3447. return n.y = 405, this.addChild(n)
  3448. }, this.addPictureButton = function(t, e) {
  3449. var i = new PictureButton(t, e);
  3450. return i.y = 405, i.x = -1, this.addChild(i)
  3451. }
  3452. };
  3453. ModalOverlayContent.prototype = Object.create(Container.prototype), ModalOverlayContent.prototype.constructor = ModalOverlayContent;
  3454. var RateGameModal = function(t, e) {
  3455. function i(t) {
  3456. o.visible = !(s.visible = 4 == t), a.visible = !0, n.innerHeight = 760, Modal.setHeight(n.innerHeight), Modal.handleResize(), a.y = 560, n.addChildAt(a, 0)
  3457. }
  3458. function r(e) {
  3459. var r = new Sheet(t, 136, 130);
  3460. return r.y = 270, r.x = 150 * l + 30, attachDownHandler(r, function() {
  3461. for (var t = 0; 5 > t; t++) h[t].frame = e >= t ? 1 : 0;
  3462. i(e)
  3463. }), r.buttonMode = !0, r
  3464. }
  3465. ModalOverlayContent.call(this), this.addHeadline("Having Fun?"), this.addLead("Help us improve the game!\nHow would you rate Hex FRVR?", 10);
  3466. var n = this,
  3467. o = n.addMiddleButton("Send Feedback", "Help us improve Hex FRVR", function() {
  3468. navigate(Config.feedbackURL), Modal.hide()
  3469. }, 6208638);
  3470. o.y = 430, o.visible = !1;
  3471. var s = n.addMiddleButton("Write Review", "Help us by writing a review!", function() {
  3472. navigate(window.isAndroid ? Config.androidReviewURL : Config.iOSReviewURL), Store.set("rateGameCount3", 100), Modal.hide()
  3473. }, 6208638);
  3474. s.y = 430, s.visible = !1;
  3475. var a = n.addButton("No thanks", function() {
  3476. Modal.hide()
  3477. }, e);
  3478. a.visible = !1;
  3479. for (var h = [], l = 0; 5 > l; l++) h.push(this.addChild(r(l)));
  3480. this.innerHeight = 450, this.blurClose = !1
  3481. };
  3482. RateGameModal.prototype = Object.create(ModalOverlayContent.prototype), RateGameModal.prototype.constructor = RateGameModal;
  3483. var InstallGameModal = function(t, e, i) {
  3484. ModalOverlayContent.call(this), this.addHeadline("Install " + Config.shortTitle + "?");
  3485. var r = this.addButton("Install Now", function() {
  3486. navigate(e, "_top")
  3487. }, 6274174);
  3488. r.y = 640, this.innerHeight += 40;
  3489. var n = PIXI.Sprite.fromImage(vpath + t);
  3490. n.anchor.set(0, 0), this.addChild(n), n.buttonMode = !0, attachDownHandler(n, function() {
  3491. navigate(e, "_top")
  3492. }), this.setRatio = function(t) {
  3493. n.scale.set(1.465 * t, 1.465 * t), n.y = 160 * t
  3494. }, this.blurClose = !1, this.blurCallback = function() {
  3495. Modal.hide(i)
  3496. }
  3497. };
  3498. InstallGameModal.prototype = Object.create(ModalOverlayContent.prototype), InstallGameModal.prototype.constructor = InstallGameModal;
  3499. var ScrollContainer = function(t, e) {
  3500. Container.call(this), this.scrollWidth = t, this.scrollHeight = e, this.allowScrollX = !0, this.allowScrollY = !0, this.content = new Container, this.addChild(this.content), this.addChild = function(t) {
  3501. return this.content.addChild(t)
  3502. }, this.removeChild = function(t) {
  3503. return this.content.removeChild(t)
  3504. }, this.resize = function(t, e) {
  3505. this.scrollWidth = t, this.scrollHeight = e
  3506. }, this.moved = !1;
  3507. var i = this,
  3508. r = null,
  3509. n = 0,
  3510. o = 0;
  3511. attachDownHandler(stageContainer, function(t) {
  3512. Tween.clear(i.content);
  3513. var e = t.getLocalPosition(i),
  3514. s = e.x / i.ratio,
  3515. a = e.y / i.ratio;
  3516. n = i.content.x, o = i.content.y, s >= 0 && a >= 0 && s <= i.scrollWidth && a <= i.scrollHeight && (r = e), i.moved = !1
  3517. });
  3518. var s = stageContainer.touchmove,
  3519. a = null,
  3520. h = 0,
  3521. l = 0;
  3522. stageContainer.touchmove = function(t) {
  3523. if (null !== r) {
  3524. var e = t.getLocalPosition(i);
  3525. if (i.moved || Math.abs(r.y - e.y) > 5 * ratio || Math.abs(r.x - e.x) > 5 * ratio) {
  3526. if (i.moved = !0, a && (h = e.y - a.y, l = (new Date).getTime()), a = e, i.allowScrollX) {
  3527. var c = n - (r.x - e.x) / i.ratio,
  3528. d = i.scrollWidth - Math.max(i.content.width / i.content.ratio, i.scrollWidth);
  3529. if (c > 0) c = Math.min(c, 7 * Math.sqrt(c));
  3530. else if (d > c) {
  3531. var u = -c + d;
  3532. c = d - Math.min(u, 7 * Math.sqrt(u))
  3533. }
  3534. i.content.x = c
  3535. }
  3536. if (i.allowScrollY) {
  3537. var p = o - (r.y - e.y) / i.ratio,
  3538. f = i.scrollHeight - Math.max(i.content.height / i.content.ratio, i.scrollHeight);
  3539. if (p > 0) p = Math.min(p, 7 * Math.sqrt(p));
  3540. else if (f > p) {
  3541. var u = -p + f;
  3542. p = f - Math.min(u, 7 * Math.sqrt(u))
  3543. }
  3544. i.content.y = p
  3545. }
  3546. }
  3547. }
  3548. s && s(t)
  3549. }, stageContainer.mousemove = function(t) {
  3550. ignoreMouseEvents || stageContainer.touchmove(t)
  3551. }, attachUpHandler(stageContainer, function(t) {
  3552. r && (!i.moved && i.callback && i.callback(), i.callback = null, i.clean())
  3553. }), window.onmousewheel = function(t) {
  3554. var e = window.event || t,
  3555. r = e.detail ? -10 * e.detail : e.wheelDelta;
  3556. i.content.y += r;
  3557. var n = (i.scrollWidth - Math.max(i.content.width / i.content.ratio, i.scrollWidth), i.scrollHeight - Math.max(i.content.height / i.content.ratio, i.scrollHeight));
  3558. i.content.y >= 0 ? i.content.y = 0 : i.content.y < n && (i.content.y = n), window.dirty = !0
  3559. }, window.addEventListener("DOMMouseScroll", window.onmousewheel), this.clean = function() {
  3560. a = null;
  3561. var t = i.scrollWidth - Math.max(i.content.width / i.content.ratio, i.scrollWidth),
  3562. e = i.scrollHeight - Math.max(i.content.height / i.content.ratio, i.scrollHeight);
  3563. i.content.x >= 0 ? new Tween(i.content, {
  3564. x: 0
  3565. }, .2) : i.content.x < t && new Tween(i.content, {
  3566. x: t
  3567. }, .2), i.content.y >= 0 ? new Tween(i.content, {
  3568. y: 0
  3569. }, .2) : i.content.y < e ? new Tween(i.content, {
  3570. y: e
  3571. }, .2) : (new Date).getTime() - l < 250 && Math.abs(h) > 5 && new Tween(i.content, {
  3572. y: Math.max(Math.min(i.content.y + 20 * h, 0), e)
  3573. }, .4), h = 0, r = null, i.moved = !1
  3574. }
  3575. };
  3576. ScrollContainer.prototype = Object.create(Container.prototype), ScrollContainer.prototype.constructor = ScrollContainer, stageContainer.setBackgroundColor(2105376), marginBottom = 15;
  3577. var Config = {
  3578. id: "hex",
  3579. domain: "",
  3580. facebookAppId: "883249178389083",
  3581. facebookLikeUrl: "",
  3582. parseId: "WSbpkS8PrSklteMXGKsUxk3QUYUrGJioM6VTxR84",
  3583. parseKey: "z9qCUrq7mVJXOBz8v2j7yMxTVRwRTJYrqVn0rT8U",
  3584. adMobInterstitialIdiOS: "ca-app-pub-6389174903462367/4068307733",
  3585. adMobBannerIdiOS: "ca-app-pub-6389174903462367/5545040939",
  3586. adMobInterstitialIdAndroid: "ca-app-pub-6389174903462367/8498507333",
  3587. adMobBannerIdAndroid: "ca-app-pub-6389174903462367/9975240532",
  3588. shareUrl: "",
  3589. shareText: "I think you will like Hex FRVR",
  3590. shareTitle: "Hex FRVR",
  3591. shortTitle: "Hex",
  3592. feedbackURL: "",
  3593. iOSReviewURL: "",
  3594. androidReviewURL: "",
  3595. androidInstallBannerURL: "",
  3596. androidInstallURL: "",
  3597. iOSInstallBannerURL: "",
  3598. iOSInstallURL: ""
  3599. };
  3600. preload(preloader);