main-html.js 202 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664
  1. "use strict";
  2. (function() {
  3. function e(e, t) {
  4. function n() {}
  5. n.prototype = e;
  6. var r = new n,
  7. i;
  8. for (i in t) r[i] = t[i];
  9. t.toString !== Object.prototype.toString && (r.toString = t.toString);
  10. return r
  11. }
  12. function t(e) {
  13. return e instanceof Array ? function() {
  14. return l.iter(e)
  15. } : "function" == typeof e.iterator ? n(e, e.iterator) : e.iterator
  16. }
  17. function n(e, t) {
  18. if (null == t) return null;
  19. null == t.__id__ && (t.__id__ = Qn++);
  20. var n;
  21. null == e.hx__closures__ ? e.hx__closures__ = {} : n = e.hx__closures__[t.__id__];
  22. null == n && (n = function() {
  23. return n.method.apply(n.scope, arguments)
  24. }, n.scope = e, n.method = t, e.hx__closures__[t.__id__] = n);
  25. return n
  26. }
  27. var r = {},
  28. i = function() {
  29. return In.__string_rec(this, "")
  30. },
  31. s = function(e, t) {
  32. t = t.split("u").join("");
  33. this.r = RegExp(e, t)
  34. };
  35. r.EReg = s;
  36. s.__name__ = ["EReg"];
  37. s.prototype = {
  38. match: function(e) {
  39. this.r.global && (this.r.lastIndex = 0);
  40. this.r.m = this.r.exec(e);
  41. this.r.s = e;
  42. return null != this.r.m
  43. },
  44. matched: function(e) {
  45. if (null != this.r.m && 0 <= e && e < this.r.m.length) return this.r.m[e];
  46. throw "EReg::matched"
  47. },
  48. matchedPos: function() {
  49. if (null == this.r.m) throw "No string matched";
  50. return {
  51. pos: this.r.m.index,
  52. len: this.r.m[0].length
  53. }
  54. },
  55. split: function(e) {
  56. return e.replace(this.r, "#__delim__#").split("#__delim__#")
  57. },
  58. __class__: s
  59. };
  60. var o = function() {};
  61. r.G = o;
  62. o.__name__ = ["G"];
  63. o.saveHiScore = function(e) {
  64. e > o.HI_SCORE && (o.HI_SCORE = e, Kn.saveData("hi_score", o.HI_SCORE))
  65. };
  66. o.loadHiScore = function() {
  67. var e = Kn.loadData("hi_score");
  68. o.HI_SCORE = 0 < e ? e : 0
  69. };
  70. var u = function(e, t) {
  71. null == t && (t = 0);
  72. null == e && (e = 0);
  73. this.x = e;
  74. this.y = t
  75. };
  76. r["flambe.math.Point"] = u;
  77. u.__name__ = ["flambe", "math", "Point"];
  78. u.prototype = {
  79. __class__: u
  80. };
  81. var a = function(e, t, n) {
  82. a.ref = this;
  83. this.rootRef = e;
  84. this.width = t;
  85. this.height = n;
  86. a.offsetX = (Kn.width - t * (a.pieceWidth + a.gap)) / 2 + a.pieceWidth / 2 | 0;
  87. e = [];
  88. t = 0;
  89. for (n = this.height; t < n;) t++, e.push(function(e) {
  90. for (var t = [], n = 0, e = e.width; n < e;) n++, t.push(null);
  91. return t
  92. }(this));
  93. this.grid = e;
  94. f.canMakeAction = !0
  95. };
  96. r.Grid = a;
  97. a.__name__ = ["Grid"];
  98. a.prototype = {
  99. addRandPiece: function(e, t) {
  100. return new f(e, t, m.random(a.pieceTypes))
  101. },
  102. addBonusPieceAt: function(e, t) {
  103. var n = new f(t, 0, a.pieceTypes + e);
  104. return this.grid[0][t] = n
  105. },
  106. addRandRows: function(e) {
  107. for (var t = this.grid.length - 1, e = t - e; t > e;) {
  108. for (var n = 0, r = this.grid[t].length; n < r;) {
  109. var i = n++;
  110. this.grid[t][i] = this.addRandPiece(i, t)
  111. }
  112. t--
  113. }
  114. },
  115. getPiecesOfType: function(e) {
  116. for (var t = [], n = 0, r = this.grid.length; n < r;)
  117. for (var i = n++, s = 0, o = this.grid[i].length; s < o;) {
  118. var u = s++;
  119. null != this.grid[i][u] && this.grid[i][u].type == e && t.push(this.grid[i][u])
  120. }
  121. return t
  122. },
  123. pushPiecesUp: function() {
  124. var e = this.getPiecesAtTop();
  125. if (0 < e.length)
  126. for (var t = 0, n = e.length; t < n;) {
  127. var r = t++;
  128. if (!(e[r].type > a.pieceTypes - 1)) return !1
  129. }
  130. e = 0;
  131. for (t = this.grid.length; e < t;)
  132. for (var n = e++, r = 0, i = this.grid[n].length; r < i;) {
  133. var s = r++;
  134. null != this.grid[n][s] && (0 != n ? (this.grid[n - 1][s] = this.grid[n][s], this.grid[n - 1][s].gridY = n - 1, this.grid[n - 1][s].tweenOnPushUp(), this.grid[n][s] = null) : this.grid[n][s].type > a.pieceTypes - 1 && (this.grid[n][s].tweenOnBonusDeath(), this.grid[n][s] = null))
  135. }
  136. this.getPiecesAtTop();
  137. return !0
  138. },
  139. getPiecesAtTop: function() {
  140. for (var e = [], t = 0, n = this.grid[0].length; t < n;) {
  141. var r = t++;
  142. null != this.grid[0][r] && (e.push(this.grid[0][r]), this.grid[0][r].tweenOnTop())
  143. }
  144. return e
  145. },
  146. coordsInGrid: function(e, t) {
  147. return 0 <= e && 0 <= t && e < this.width && t < this.height
  148. },
  149. getPiece: function(e, t) {
  150. return this.coordsInGrid(e, t) && null != this.grid[t][e] ? this.grid[t][e] : null
  151. },
  152. neighbourOf: function(e, t) {
  153. var n = e.relativeCoordinates(t, 1);
  154. return this.getPiece(n.x | 0, n.y | 0)
  155. },
  156. neighboursOf: function(e) {
  157. for (var t = [], n = 0, r = a.dirs.length; n < r;) {
  158. var i = n++;
  159. t.push(this.neighbourOf(e, a.dirs[i]))
  160. }
  161. return t
  162. },
  163. getDeepMatches: function(e) {
  164. null == e && (e = 2);
  165. for (var t = [], n = [], r = 0, i = this.grid.length; r < i;)
  166. for (var s = this.grid[r++], o = 0, u = s.length; o < u;) {
  167. var a = o++,
  168. f = s[a];
  169. if (null != f && -1 == c.indexOf(t, f)) {
  170. for (var a = f.deepMatchingNeighbours(), l = 0, h = a.length; l < h;) {
  171. var p = l++;
  172. t.push(a[p])
  173. }
  174. if (a.length >= e && null != f) {
  175. f = 0;
  176. for (l = a.length; f < l;) h = f++, n.push(a[h])
  177. }
  178. }
  179. }
  180. return n
  181. },
  182. applyGravityDown: function() {
  183. for (var e = this.grid.length - 1, t = []; 0 < e;) {
  184. for (var n = this.grid[e], r = 0, i = n.length; r < i;) {
  185. var s = r++;
  186. if (null == n[s])
  187. for (var o = e; 0 < o;) o--, null != this.grid[o][s] && (this.grid[e][s] = this.grid[o][s], this.grid[e][s].gridY = e, t.push(this.grid[e][s]), this.grid[o][s] = null, o = 0)
  188. }
  189. e--
  190. }
  191. return t
  192. },
  193. slideToLeft: function() {
  194. for (var e = this.grid[this.grid.length - 1], t = 0, n = [], r = 0, i = e.length; r < i;) {
  195. var s = r++;
  196. if (null == e[s] && s != e.length - 1 && (t++, null != e[s + 1])) {
  197. for (var s = s + 1, o = e[s]; null != o;) {
  198. for (var o = 0, u = this.grid.length; o < u;) {
  199. var a = o++;
  200. null != this.grid[a][s] && (this.grid[a][s - t] = this.grid[a][s], this.grid[a][s - t].gridX = s - t, n.push(this.grid[a][s - t]), this.grid[a][s] = null)
  201. }
  202. s++;
  203. o = e[s]
  204. }
  205. t = 0
  206. }
  207. }
  208. return n
  209. },
  210. clear: function() {
  211. for (var e = 0, t = this.grid.length; e < t;)
  212. for (var n = e++, r = 0, i = this.grid[n].length; r < i;) {
  213. var s = r++;
  214. null != this.grid[n][s] && this.grid[n][s].tweenOnGameOver();
  215. this.grid[n][s] = null
  216. }
  217. },
  218. clear2: function() {
  219. for (var e = 0, t = this.grid.length; e < t;)
  220. for (var n = e++, r = 0, i = this.grid[n].length; r < i;) {
  221. var s = r++;
  222. null != this.grid[n][s] && this.grid[n][s].tweenOnLevelEnd();
  223. this.grid[n][s] = null
  224. }
  225. },
  226. __class__: a
  227. };
  228. var f = function(e, t, n) {
  229. this.gridX = e;
  230. this.gridY = t;
  231. this.type = n;
  232. this.init()
  233. };
  234. r.Piece = f;
  235. f.__name__ = ["Piece"];
  236. f.prototype = {
  237. init: function() {
  238. var e = this;
  239. f.canMakeAction = !0;
  240. this.pieceEnt = Kn.addImageSprite(a.ref.rootRef, this.getX(), this.initY(), "bl" + this.type);
  241. this.pieceEnt.add(new yn);
  242. this.pieceEnt._compMap.Disposer_2.connect1(this.pieceEnt._compMap.Sprite_0.get_pointerUp(), n(this, this.onPointerUp));
  243. null == f.actionSequence && (f.actionSequence = new wn, f.actionSequence.add(new dn(function() {
  244. f.canMakeAction = !1;
  245. for (var e = a.ref.applyGravityDown(), t = 0, n = e.length; t < n;) {
  246. var r = t++;
  247. e[r].tweenOnGravityDown()
  248. }
  249. })), f.actionSequence.add(new vn(.1)), f.actionSequence.add(new dn(function() {
  250. for (var t = a.ref.slideToLeft(), n = 0, r = t.length; n < r;) {
  251. var i = n++;
  252. t[i].tweenOnSlideLeft()
  253. }
  254. e.showBonusInfo()
  255. })), f.actionSequence.add(new dn(function() {
  256. a.ref.rootRef._compMap.GameSceneComp_7.checkForMatches()
  257. })), f.actionSequence.add(new dn(function() {
  258. f.canMakeAction = !0
  259. })));
  260. this.tweenOnInit();
  261. this.showBonusInfo()
  262. },
  263. onPointerUp: function() {
  264. if (f.canMakeAction)
  265. if (this.type > a.pieceTypes - 1) this.activateBonus3(this.type - a.pieceTypes);
  266. else {
  267. var e = this.deepMatchingNeighbours();
  268. if (0 < e.length) {
  269. $n.playSfx("pop_sfx");
  270. for (var t = 0, n = e.length; t < n;) {
  271. var r = t++;
  272. this.tweenOnRemove(e[r])
  273. }
  274. this.updateGrid(e);
  275. e.length > a.minMatchForBonus - 1 && this.addBonus(Kn.rand(a.pieceTypes))
  276. } else this.tweenShake()
  277. }
  278. },
  279. updateGrid: function(e, t) {
  280. null == t && (t = !1);
  281. var n = e.length,
  282. r = 10 * n * n * n - 10 * n;
  283. t && (r = 10 * n * n);
  284. a.ref.rootRef._compMap.GameSceneComp_7.updateScore(r);
  285. var i;
  286. i = Kn.addLabel(a.ref.rootRef, this.getX(), this.getY(), "+" + r, 1.2, 1, !0)._compMap.Sprite_0;
  287. Jn.to(i, .5, {
  288. y: i.y._value - 45
  289. }, 0, function() {
  290. i.dispose()
  291. }, F.cubeOut);
  292. a.ref.rootRef._compMap.Script_3.run(f.actionSequence)
  293. },
  294. addBonus: function(e) {
  295. var t = this;
  296. a.ref.rootRef._compMap.Script_3.run(new wn([new vn(.1), new dn(function() {
  297. a.ref.addBonusPieceAt(e, t.gridX);
  298. a.ref.rootRef._compMap.Script_3.run(f.actionSequence)
  299. })]))
  300. },
  301. activateBonus3: function(e) {
  302. e = a.ref.getPiecesOfType(e);
  303. if (0 == e.length) this.tweenShake();
  304. else {
  305. for (var t = 0, n = e.length; t < n;) {
  306. var r = t++;
  307. this.tweenOnRemove(e[r])
  308. }
  309. this.tweenOnRemove(this);
  310. $n.playSfx("bonus_sfx", 1);
  311. a.ref.rootRef._compMap.Script_3.run(new En(10, 0, .5));
  312. this.updateGrid(e, !0)
  313. }
  314. },
  315. showBonusInfo: function() {
  316. for (var e = [], t = [], n = 0, r = a.ref.grid.length; n < r;)
  317. for (var i = n++, s = 0, o = a.ref.grid[i].length; s < o;) {
  318. var u = s++;
  319. if (null != a.ref.grid[i][u]) {
  320. a.ref.grid[i][u].pieceEnt.disposeChildren();
  321. var f = a.ref.grid[i][u].deepMatchingNeighbours();
  322. if (f.length > a.minMatchForBonus - 1 && -1 == c.indexOf(e, a.ref.grid[i][u])) {
  323. t.push(a.ref.grid[i][u]);
  324. for (var u = 0, l = f.length; u < l;) {
  325. var h = u++;
  326. e.push(f[h])
  327. }
  328. }
  329. }
  330. }
  331. e = 0;
  332. for (n = t.length; e < n;) r = e++, Kn.addImageSprite(t[r].pieceEnt, (a.pieceWidth / 2 | 0) + 5, a.pieceHeight / 2 | 0, "bonus_marker")
  333. },
  334. getX: function() {
  335. return this.gridX * (a.pieceWidth + a.gap) + (a.gap / 2 | 0) + a.offsetX
  336. },
  337. getY: function() {
  338. return this.gridY * (a.pieceHeight + a.gap) + (a.gap / 2 | 0) + a.offsetY
  339. },
  340. initY: function() {
  341. return this.type < a.pieceTypes ? this.getY() + Kn.height + (a.pieceHeight / 2 | 0) - a.offsetY : -100
  342. },
  343. tweenOnInit: function() {
  344. this.pieceEnt._compMap.Sprite_0.y.animateTo(this.getY(), .4, F.bounceIn)
  345. },
  346. tweenOnRemove: function(e) {
  347. this.removeJitterBehavior();
  348. a.ref.grid[e.gridY][e.gridX] = null;
  349. e.pieceEnt._compMap.Sprite_0.setAlpha(.7);
  350. Jn.to(e.pieceEnt._compMap.Sprite_0, .4, {
  351. alpha: .5,
  352. scaleX: 0,
  353. scaleY: 0
  354. }, 0, function() {
  355. e.pieceEnt.dispose()
  356. }, F.backIn)
  357. },
  358. tweenOnBonusDeath: function() {
  359. var e = this;
  360. this.removeJitterBehavior();
  361. this.pieceEnt._compMap.Sprite_0.setAlpha(.7);
  362. this.pieceEnt._compMap.Sprite_0.y.animateTo(Kn.height + 100, 1, F.backIn);
  363. Jn.to(this.pieceEnt._compMap.Sprite_0, 3, {
  364. rotation: 720
  365. }, 0, function() {
  366. e.pieceEnt.dispose()
  367. }, F.backIn)
  368. },
  369. tweenOnLevelEnd: function() {
  370. f.canMakeAction = !1
  371. },
  372. tweenOnGameOver: function() {
  373. var e = this;
  374. this.removeJitterBehavior();
  375. f.canMakeAction = !1;
  376. Jn.to(this.pieceEnt._compMap.Sprite_0, .4, {
  377. y: this.getY() - 20
  378. }, 0, function() {
  379. e.pieceEnt._compMap.Sprite_0.y.animateTo(Kn.height + 100, 1, F.backIn);
  380. e.pieceEnt._compMap.Sprite_0.rotation.animateTo(720 * Kn.randSign(), 3, F.quadIn)
  381. }, F.backIn)
  382. },
  383. tweenOnTop: function() {
  384. var e = this;
  385. this.type > a.pieceTypes - 1 || this.pieceEnt._compMap.Script_3.run(new wn([new vn(.6), new dn(function() {
  386. e.pieceEnt._compMap.Sprite_0.x.set_behavior(new I(e.getX(), 2));
  387. e.pieceEnt._compMap.Sprite_0.y.set_behavior(new I(e.getY(), 2));
  388. if (null == a.ref.rootRef.firstChild.firstChild) {
  389. var t;
  390. t = Kn.addFillSprite(a.ref.rootRef.firstChild, 0, 0, 16711680, Kn.width, Kn.height, .2, !1)._compMap.Sprite_0;
  391. Kn.addDelay(t.owner, .2, function() {.2 == t.alpha._value ? t.alpha.set__(0) : t.alpha.set__(.2)
  392. }, !0)
  393. }
  394. })]))
  395. },
  396. removeJitterBehavior: function() {
  397. this.pieceEnt._compMap.Script_3.stopAll();
  398. this.pieceEnt._compMap.Sprite_0.x.set_behavior(null);
  399. this.pieceEnt._compMap.Sprite_0.y.set_behavior(null);
  400. 0 == a.ref.getPiecesAtTop().length && null != a.ref.rootRef.firstChild.firstChild && a.ref.rootRef.firstChild.disposeChildren()
  401. },
  402. tweenOnSlideLeft: function() {
  403. var e = this;
  404. f.canMakeAction = !1;
  405. this.pieceEnt._compMap.Sprite_0.x.animateTo(this.getX(), .4, F.backInOut);
  406. Jn.to(this.pieceEnt._compMap.Sprite_0, .1, {
  407. rotation: 10,
  408. scaleX: .7
  409. }, .1, function() {
  410. Jn.to(e.pieceEnt._compMap.Sprite_0, .15, {
  411. rotation: 0,
  412. scaleX: 1
  413. }, 0, null, F.backOut)
  414. }, F.backIn)
  415. },
  416. tweenOnPushUp: function() {
  417. f.canMakeAction = !1;
  418. Jn.to(this.pieceEnt._compMap.Sprite_0, .4, {
  419. y: this.getY()
  420. }, 0, function() {
  421. f.canMakeAction = !0
  422. }, F.backIn)
  423. },
  424. tweenOnGravityDown: function() {
  425. var e = this;
  426. this.removeJitterBehavior();
  427. this.pieceEnt._compMap.Sprite_0.y.animateTo(this.getY(), .4, F.backIn);
  428. Jn.to(this.pieceEnt._compMap.Sprite_0, .15, {
  429. scaleX: 1.2,
  430. scaleY: .7
  431. }, .1, function() {
  432. Jn.to(e.pieceEnt._compMap.Sprite_0, .25, {
  433. scaleX: 1,
  434. scaleY: 1
  435. }, 0, null, F.backInOut)
  436. }, F.bounceInOut)
  437. },
  438. tweenShake: function() {
  439. $n.playSfx("no_match_sfx", .5);
  440. this.pieceEnt._compMap.Sprite_0.x.set__(this.getX());
  441. this.pieceEnt._compMap.Sprite_0.y.set__(this.getY());
  442. this.pieceEnt._compMap.Script_3.run(new En(10, 0, .3))
  443. },
  444. relativeCoordinates: function(e, t) {
  445. return new u(this.gridX + t * e.x, this.gridY + t * e.y)
  446. },
  447. neighbours: function() {
  448. return a.ref.neighboursOf(this)
  449. },
  450. matchingNeighbours: function() {
  451. for (var e = [], t = this.neighbours(), n, r = 0, i = t.length; r < i;) n = r++, n = t[n], null != n && n.type == this.type && this.type < a.pieceTypes && e.push(n);
  452. return e
  453. },
  454. deepMatchingNeighbours: function() {
  455. var e = [],
  456. t = null,
  457. t = function(n) {
  458. for (var n = n.matchingNeighbours(), r = 0, i = n.length; r < i;) {
  459. var s = r++,
  460. s = n[s]; - 1 == c.indexOf(e, s) && (e.push(s), t(s))
  461. }
  462. };
  463. t(this);
  464. return e
  465. },
  466. __class__: f
  467. };
  468. var l = function() {};
  469. r.HxOverrides = l;
  470. l.__name__ = ["HxOverrides"];
  471. l.dateStr = function(e) {
  472. var t = e.getMonth() + 1,
  473. n = e.getDate(),
  474. r = e.getHours(),
  475. i = e.getMinutes(),
  476. s = e.getSeconds();
  477. return e.getFullYear() + "-" + (10 > t ? "0" + t : "" + t) + "-" + (10 > n ? "0" + n : "" + n) + " " + (10 > r ? "0" + r : "" + r) + ":" + (10 > i ? "0" + i : "" + i) + ":" + (10 > s ? "0" + s : "" + s)
  478. };
  479. l.strDate = function(e) {
  480. switch (e.length) {
  481. case 8:
  482. var e = e.split(":"),
  483. t = new Date;
  484. t.setTime(0);
  485. t.setUTCHours(e[0]);
  486. t.setUTCMinutes(e[1]);
  487. t.setUTCSeconds(e[2]);
  488. return t;
  489. case 10:
  490. return e = e.split("-"), new Date(e[0], e[1] - 1, e[2], 0, 0, 0);
  491. case 19:
  492. return t = e.split(" "), e = t[0].split("-"), t = t[1].split(":"), new Date(e[0], e[1] - 1, e[2], t[0], t[1], t[2]);
  493. default:
  494. throw "Invalid date format : " + e
  495. }
  496. };
  497. l.cca = function(e, t) {
  498. var n = e.charCodeAt(t);
  499. return n != n ? void 0 : n
  500. };
  501. l.substr = function(e, t, n) {
  502. if (null != t && 0 != t && null != n && 0 > n) return "";
  503. null == n && (n = e.length);
  504. 0 > t ? (t = e.length + t, 0 > t && (t = 0)) : 0 > n && (n = e.length + n - t);
  505. return e.substr(t, n)
  506. };
  507. l.remove = function(e, t) {
  508. var n = e.indexOf(t);
  509. if (-1 == n) return !1;
  510. e.splice(n, 1);
  511. return !0
  512. };
  513. l.iter = function(e) {
  514. return {
  515. cur: 0,
  516. arr: e,
  517. hasNext: function() {
  518. return this.cur < this.arr.length
  519. },
  520. next: function() {
  521. return this.arr[this.cur++]
  522. }
  523. }
  524. };
  525. var c = function() {};
  526. r.Lambda = c;
  527. c.__name__ = ["Lambda"];
  528. c.array = function(e) {
  529. for (var n = [], e = t(e)(); e.hasNext();) {
  530. var r = e.next();
  531. n.push(r)
  532. }
  533. return n
  534. };
  535. c.count = function(e, n) {
  536. var r = 0;
  537. if (null == n)
  538. for (var i = t(e)(); i.hasNext();) i.next(), r++;
  539. else
  540. for (i = t(e)(); i.hasNext();) {
  541. var s = i.next();
  542. n(s) && r++
  543. }
  544. return r
  545. };
  546. c.indexOf = function(e, n) {
  547. for (var r = 0, i = t(e)(); i.hasNext();) {
  548. var s = i.next();
  549. if (n == s) return r;
  550. r++
  551. }
  552. return -1
  553. };
  554. var h = function() {
  555. this.length = 0
  556. };
  557. r.List = h;
  558. h.__name__ = ["List"];
  559. h.prototype = {
  560. add: function(e) {
  561. e = [e];
  562. null == this.h ? this.h = e : this.q[1] = e;
  563. this.q = e;
  564. this.length++
  565. },
  566. iterator: function() {
  567. return {
  568. h: this.h,
  569. hasNext: function() {
  570. return null != this.h
  571. },
  572. next: function() {
  573. if (null == this.h) return null;
  574. var e = this.h[0];
  575. this.h = this.h[1];
  576. return e
  577. }
  578. }
  579. },
  580. __class__: h
  581. };
  582. var p = function() {};
  583. r.Main = p;
  584. p.__name__ = ["Main"];
  585. p.main = function() {
  586. P.init();
  587. Kn.systemBgColor = 5459013;
  588. (new Kn(640, 960)).init.connect(p.onInit).once()
  589. };
  590. p.onInit = function() {
  591. o.loadHiScore();
  592. Kn.buttonClickSfx = "button_click_sfx";
  593. Kn.goToScene((new Xn).root)
  594. };
  595. var d = function() {};
  596. r.IMap = d;
  597. d.__name__ = ["IMap"];
  598. Math.__name__ = ["Math"];
  599. var v = function() {};
  600. r.Reflect = v;
  601. v.__name__ = ["Reflect"];
  602. v.field = function(e, t) {
  603. try {
  604. return e[t]
  605. } catch (n) {
  606. return null
  607. }
  608. };
  609. v.getProperty = function(e, t) {
  610. var n;
  611. return null == e ? null : e.__properties__ && (n = e.__properties__["get_" + t]) ? e[n]() : e[t]
  612. };
  613. v.callMethod = function(e, t, n) {
  614. return t.apply(e, n)
  615. };
  616. v.fields = function(e) {
  617. var t = [];
  618. if (null != e) {
  619. var n = Object.prototype.hasOwnProperty,
  620. r;
  621. for (r in e) "__id__" != r && "hx__closures__" != r && n.call(e, r) && t.push(r)
  622. }
  623. return t
  624. };
  625. v.isFunction = function(e) {
  626. return "function" == typeof e && !(e.__name__ || e.__ename__)
  627. };
  628. v.deleteField = function(e, t) {
  629. if (!Object.prototype.hasOwnProperty.call(e, t)) return !1;
  630. delete e[t];
  631. return !0
  632. };
  633. var m = function() {};
  634. r.Std = m;
  635. m.__name__ = ["Std"];
  636. m.is = function(e, t) {
  637. return In.__instanceof(e, t)
  638. };
  639. m.string = function(e) {
  640. return In.__string_rec(e, "")
  641. };
  642. m["int"] = function(e) {
  643. return e | 0
  644. };
  645. m.parseInt = function(e) {
  646. var t = parseInt(e, 10);
  647. if (0 == t && (120 == l.cca(e, 1) || 88 == l.cca(e, 1))) t = parseInt(e);
  648. return isNaN(t) ? null : t
  649. };
  650. m.parseFloat = function(e) {
  651. return parseFloat(e)
  652. };
  653. m.random = function(e) {
  654. return 0 >= e ? 0 : Math.floor(Math.random() * e)
  655. };
  656. var g = function() {
  657. this.b = ""
  658. };
  659. r.StringBuf = g;
  660. g.__name__ = ["StringBuf"];
  661. g.prototype = {
  662. add: function(e) {
  663. this.b += m.string(e)
  664. },
  665. __class__: g
  666. };
  667. var y = function() {};
  668. r.StringTools = y;
  669. y.__name__ = ["StringTools"];
  670. y.startsWith = function(e, t) {
  671. return e.length >= t.length && l.substr(e, 0, t.length) == t
  672. };
  673. y.replace = function(e, t, n) {
  674. return e.split(t).join(n)
  675. };
  676. y.fastCodeAt = function(e, t) {
  677. return e.charCodeAt(t)
  678. };
  679. var b = r.ValueType = {
  680. __ename__: ["ValueType"],
  681. __constructs__: "TNull,TInt,TFloat,TBool,TObject,TFunction,TClass,TEnum,TUnknown".split(",")
  682. };
  683. b.TNull = ["TNull", 0];
  684. b.TNull.toString = i;
  685. b.TNull.__enum__ = b;
  686. b.TInt = ["TInt", 1];
  687. b.TInt.toString = i;
  688. b.TInt.__enum__ = b;
  689. b.TFloat = ["TFloat", 2];
  690. b.TFloat.toString = i;
  691. b.TFloat.__enum__ = b;
  692. b.TBool = ["TBool", 3];
  693. b.TBool.toString = i;
  694. b.TBool.__enum__ = b;
  695. b.TObject = ["TObject", 4];
  696. b.TObject.toString = i;
  697. b.TObject.__enum__ = b;
  698. b.TFunction = ["TFunction", 5];
  699. b.TFunction.toString = i;
  700. b.TFunction.__enum__ = b;
  701. b.TClass = function(e) {
  702. e = ["TClass", 6, e];
  703. e.__enum__ = b;
  704. e.toString = i;
  705. return e
  706. };
  707. b.TEnum = function(e) {
  708. e = ["TEnum", 7, e];
  709. e.__enum__ = b;
  710. e.toString = i;
  711. return e
  712. };
  713. b.TUnknown = ["TUnknown", 8];
  714. b.TUnknown.toString = i;
  715. b.TUnknown.__enum__ = b;
  716. var w = function() {};
  717. r.Type = w;
  718. w.__name__ = ["Type"];
  719. w.getClassName = function(e) {
  720. return e.__name__.join(".")
  721. };
  722. w.getEnumName = function(e) {
  723. return e.__ename__.join(".")
  724. };
  725. w.resolveClass = function(e) {
  726. e = r[e];
  727. return null == e || !e.__name__ ? null : e
  728. };
  729. w.resolveEnum = function(e) {
  730. e = r[e];
  731. return null == e || !e.__ename__ ? null : e
  732. };
  733. w.createEmptyInstance = function(e) {
  734. function t() {}
  735. t.prototype = e.prototype;
  736. return new t
  737. };
  738. w.createEnum = function(e, t, n) {
  739. var r = v.field(e, t);
  740. if (null == r) throw "No such constructor " + t;
  741. if (v.isFunction(r)) {
  742. if (null == n) throw "Constructor " + t + " need parameters";
  743. return r.apply(e, n)
  744. }
  745. if (null != n && 0 != n.length) throw "Constructor " + t + " does not need parameters";
  746. return r
  747. };
  748. w.getEnumConstructs = function(e) {
  749. return e.__constructs__.slice()
  750. };
  751. w["typeof"] = function(e) {
  752. switch (typeof e) {
  753. case "boolean":
  754. return b.TBool;
  755. case "string":
  756. return b.TClass(String);
  757. case "number":
  758. return Math.ceil(e) == e % 2147483648 ? b.TInt : b.TFloat;
  759. case "object":
  760. if (null == e) return b.TNull;
  761. var t = e.__enum__;
  762. if (null != t) return b.TEnum(t);
  763. e = e instanceof Array && null == e.__enum__ ? Array : e.__class__;
  764. return null != e ? b.TClass(e) : b.TObject;
  765. case "function":
  766. return e.__name__ || e.__ename__ ? b.TObject : b.TFunction;
  767. case "undefined":
  768. return b.TNull;
  769. default:
  770. return b.TUnknown
  771. }
  772. };
  773. var E = function() {};
  774. r["flambe.util.Disposable"] = E;
  775. E.__name__ = ["flambe", "util", "Disposable"];
  776. E.prototype = {
  777. __class__: E
  778. };
  779. var S = function() {};
  780. r["flambe.Component"] = S;
  781. S.__name__ = ["flambe", "Component"];
  782. S.__interfaces__ = [E];
  783. S.prototype = {
  784. onAdded: function() {},
  785. onRemoved: function() {},
  786. onUpdate: function() {},
  787. dispose: function() {
  788. null != this.owner && this.owner.remove(this)
  789. },
  790. get_name: function() {
  791. return null
  792. },
  793. init: function(e, t) {
  794. this.owner = e;
  795. this.next = t
  796. },
  797. __class__: S,
  798. __properties__: {
  799. get_name: "get_name"
  800. }
  801. };
  802. var x = function() {
  803. this._disposables = []
  804. };
  805. r["flambe.Disposer"] = x;
  806. x.__name__ = ["flambe", "Disposer"];
  807. x.__super__ = S;
  808. x.prototype = e(S.prototype, {
  809. get_name: function() {
  810. return "Disposer_2"
  811. },
  812. add: function(e) {
  813. this._disposables.push(e);
  814. return this
  815. },
  816. connect1: function(e, t) {
  817. this.add(e.connect(t));
  818. return this
  819. },
  820. onRemoved: function() {
  821. this.freeDisposables()
  822. },
  823. dispose: function() {
  824. S.prototype.dispose.call(this);
  825. this.freeDisposables()
  826. },
  827. freeDisposables: function() {
  828. var e = this._disposables;
  829. this._disposables = [];
  830. for (var t = 0; t < e.length;) {
  831. var n = e[t];
  832. ++t;
  833. n.dispose()
  834. }
  835. },
  836. __class__: x
  837. });
  838. var T = function() {
  839. this.parent = this.firstChild = this.next = this.firstComponent = null;
  840. this._compMap = {}
  841. };
  842. r["flambe.Entity"] = T;
  843. T.__name__ = ["flambe", "Entity"];
  844. T.__interfaces__ = [E];
  845. T.prototype = {
  846. add: function(e) {
  847. null != e.owner && e.owner.remove(e);
  848. var t = e.get_name(),
  849. n = this._compMap[t];
  850. null != n && this.remove(n);
  851. this._compMap[t] = e;
  852. t = null;
  853. for (n = this.firstComponent; null != n;) t = n, n = n.next;
  854. null != t ? t.next = e : this.firstComponent = e;
  855. e.init(this, null);
  856. e.onAdded();
  857. return this
  858. },
  859. remove: function(e) {
  860. for (var t = null, n = this.firstComponent; null != n;) {
  861. var r = n.next;
  862. if (n == e) return null == t ? this.firstComponent = r : t.init(this, r), delete this._compMap[n.get_name()], n.onRemoved(), n.init(null, null), !0;
  863. t = n;
  864. n = r
  865. }
  866. return !1
  867. },
  868. addChild: function(e, t) {
  869. null == t && (t = !0);
  870. null != e.parent && e.parent.removeChild(e);
  871. e.parent = this;
  872. if (t) {
  873. for (var n = null, r = this.firstChild; null != r;) n = r, r = r.next;
  874. null != n ? n.next = e : this.firstChild = e
  875. } else e.next = this.firstChild, this.firstChild = e;
  876. return this
  877. },
  878. removeChild: function(e) {
  879. for (var t = null, n = this.firstChild; null != n;) {
  880. var r = n.next;
  881. if (n == e) {
  882. null == t ? this.firstChild = r : t.next = r;
  883. n.parent = null;
  884. n.next = null;
  885. break
  886. }
  887. t = n;
  888. n = r
  889. }
  890. },
  891. disposeChildren: function() {
  892. for (; null != this.firstChild;) this.firstChild.dispose()
  893. },
  894. dispose: function() {
  895. for (null != this.parent && this.parent.removeChild(this); null != this.firstComponent;) this.firstComponent.dispose();
  896. this.disposeChildren()
  897. },
  898. __class__: T
  899. };
  900. var N = function() {};
  901. r["flambe.util.PackageLog"] = N;
  902. N.__name__ = ["flambe", "util", "PackageLog"];
  903. var C = function() {};
  904. r["flambe.platform.Platform"] = C;
  905. C.__name__ = ["flambe", "platform", "Platform"];
  906. C.prototype = {
  907. __class__: C
  908. };
  909. var k = function() {};
  910. r["flambe.platform.html.HtmlPlatform"] = k;
  911. k.__name__ = ["flambe", "platform", "html", "HtmlPlatform"];
  912. k.__interfaces__ = [C];
  913. k.prototype = {
  914. init: function() {
  915. var e = this;
  916. tn.fixAndroidMath();
  917. var t = null;
  918. try {
  919. t = window.flambe.canvas
  920. } catch (n) {}
  921. t.setAttribute("tabindex", "0");
  922. t.style.outlineStyle = "none";
  923. t.style.webkitTapHighlightColor = "transparent";
  924. t.setAttribute("moz-opaque", "true");
  925. this._stage = new Zt(t);
  926. this._pointer = new Tt;
  927. this._mouse = new Kt(this._pointer, t);
  928. this._renderer = this.createRenderer(t);
  929. this.mainLoop = new qt;
  930. this.musicPlaying = !1;
  931. this._canvas = t;
  932. this._container = t.parentElement;
  933. this._container.style.overflow = "visible";
  934. this._container.style.position = "relative";
  935. this._container.style.msTouchAction = "none";
  936. var r = 0,
  937. i = function(n) {
  938. if (!(1e3 > n.timeStamp - r)) {
  939. var i = t.getBoundingClientRect(),
  940. s = e.getX(n, i),
  941. i = e.getY(n, i);
  942. switch (n.type) {
  943. case "mousedown":
  944. n.target == t && (n.preventDefault(), e._mouse.submitDown(s, i, n.button), t.focus());
  945. break;
  946. case "mousemove":
  947. e._mouse.submitMove(s, i);
  948. break;
  949. case "mouseup":
  950. e._mouse.submitUp(s, i, n.button);
  951. break;
  952. case "mousewheel":
  953. case "DOMMouseScroll":
  954. e._mouse.submitScroll(s, i, "mousewheel" == n.type ? n.wheelDelta / 40 : -n.detail) && n.preventDefault()
  955. }
  956. }
  957. };
  958. window.addEventListener("mousedown", i, !1);
  959. window.addEventListener("mousemove", i, !1);
  960. window.addEventListener("mouseup", i, !1);
  961. t.addEventListener("mousewheel", i, !1);
  962. t.addEventListener("DOMMouseScroll", i, !1);
  963. t.addEventListener("contextmenu", function(e) {
  964. e.preventDefault()
  965. }, !1);
  966. var s = "undefined" != typeof window.ontouchstart,
  967. i = "msMaxTouchPoints" in window.navigator && 1 < window.navigator.msMaxTouchPoints;
  968. if (s || i) {
  969. var o = new kt(this._pointer, s ? 4 : window.navigator.msMaxTouchPoints);
  970. this._touch = o;
  971. i = function(t) {
  972. var n;
  973. n = s ? t.changedTouches : [t];
  974. var i = t.target.getBoundingClientRect();
  975. r = t.timeStamp;
  976. switch (t.type) {
  977. case "touchstart":
  978. case "MSPointerDown":
  979. case "pointerdown":
  980. t.preventDefault();
  981. tn.SHOULD_HIDE_MOBILE_BROWSER && tn.hideMobileBrowser();
  982. for (t = 0; t < n.length;) {
  983. var u = n[t];
  984. ++t;
  985. var a = e.getX(u, i),
  986. f = e.getY(u, i);
  987. o.submitDown((s ? u.identifier : u.pointerId) | 0, a, f)
  988. }
  989. break;
  990. case "touchmove":
  991. case "MSPointerMove":
  992. case "pointermove":
  993. t.preventDefault();
  994. for (t = 0; t < n.length;) u = n[t], ++t, a = e.getX(u, i), f = e.getY(u, i), o.submitMove((s ? u.identifier : u.pointerId) | 0, a, f);
  995. break;
  996. case "touchend":
  997. case "touchcancel":
  998. case "MSPointerUp":
  999. case "pointerup":
  1000. for (t = 0; t < n.length;) u = n[t], ++t, a = e.getX(u, i), f = e.getY(u, i), o.submitUp((s ? u.identifier : u.pointerId) | 0, a, f)
  1001. }
  1002. };
  1003. s ? (t.addEventListener("touchstart", i, !1), t.addEventListener("touchmove", i, !1), t.addEventListener("touchend", i, !1), t.addEventListener("touchcancel", i, !1)) : (t.addEventListener("MSPointerDown", i, !1), t.addEventListener("MSPointerMove", i, !1), t.addEventListener("MSPointerUp", i, !1))
  1004. } else this._touch = new Pt;
  1005. var u = window.onerror;
  1006. window.onerror = function(e, t, n) {
  1007. P.uncaughtError.emit(e);
  1008. return null != u ? u(e, t, n) : !1
  1009. };
  1010. var a = tn.loadExtension("hidden", window.document);
  1011. null != a.value ? (i = function() {
  1012. P.hidden.set__(v.field(window.document, a.field))
  1013. }, i(null), window.document.addEventListener(a.prefix + "visibilitychange", i, !1)) : (i = function(e) {
  1014. P.hidden.set__("pagehide" == e.type)
  1015. }, window.addEventListener("pageshow", i, !1), window.addEventListener("pagehide", i, !1));
  1016. P.hidden.get_changed().connect(function(t) {
  1017. t || (e._skipFrame = !0)
  1018. });
  1019. this._skipFrame = !1;
  1020. this._lastUpdate = Date.now();
  1021. var f = tn.loadExtension("requestAnimationFrame").value,
  1022. i = tn.loadExtension("requestAnimationFrame").prefix;
  1023. if (null != f && "webkit" != i) {
  1024. var l = window.performance,
  1025. c = null != l && tn.polyfill("now", l);
  1026. c ? this._lastUpdate = l.now() : null;
  1027. var h = null,
  1028. h = function(n) {
  1029. e.update(c ? l.now() : n);
  1030. f(h, t)
  1031. };
  1032. f(h, t)
  1033. } else window.setInterval(function() {
  1034. e.update(Date.now())
  1035. }, 16);
  1036. H.info("Initialized HTML platform", ["renderer", this._renderer.get_type()])
  1037. },
  1038. loadAssetPack: function(e) {
  1039. return (new Jt(this, e)).promise
  1040. },
  1041. getStage: function() {
  1042. return this._stage
  1043. },
  1044. getStorage: function() {
  1045. if (null == this._storage) {
  1046. var e = qn.getLocalStorage();
  1047. this._storage = null != e ? new en(e) : new Dt
  1048. }
  1049. return this._storage
  1050. },
  1051. update: function(e) {
  1052. var t = (e - this._lastUpdate) / 1e3;
  1053. this._lastUpdate = e;
  1054. P.hidden._value || (this._skipFrame ? this._skipFrame = !1 : (this.mainLoop.update(t), this.mainLoop.render(this._renderer)))
  1055. },
  1056. getPointer: function() {
  1057. return this._pointer
  1058. },
  1059. getRenderer: function() {
  1060. return this._renderer
  1061. },
  1062. getX: function(e, t) {
  1063. return (e.clientX - t.left) * this._stage.get_width() / t.width
  1064. },
  1065. getY: function(e, t) {
  1066. return (e.clientY - t.top) * this._stage.get_height() / t.height
  1067. },
  1068. createRenderer: function(e) {
  1069. return new Xt(e)
  1070. },
  1071. __class__: k
  1072. };
  1073. var L = function(e, t) {
  1074. this._value = e;
  1075. this._changed = null != t ? new M(t) : null
  1076. };
  1077. r["flambe.util.Value"] = L;
  1078. L.__name__ = ["flambe", "util", "Value"];
  1079. L.prototype = {
  1080. watch: function(e) {
  1081. e(this._value, this._value);
  1082. return this.get_changed().connect(e)
  1083. },
  1084. set__: function(e) {
  1085. var t = this._value;
  1086. e != t && (this._value = e, null != this._changed && this._changed.emit(e, t));
  1087. return e
  1088. },
  1089. get_changed: function() {
  1090. null == this._changed && (this._changed = new M);
  1091. return this._changed
  1092. },
  1093. __class__: L,
  1094. __properties__: {
  1095. get_changed: "get_changed",
  1096. set__: "set__"
  1097. }
  1098. };
  1099. var A = function(e, t) {
  1100. this._next = null;
  1101. this._signal = e;
  1102. this._listener = t;
  1103. this.stayInList = !0
  1104. };
  1105. r["flambe.util.SignalConnection"] = A;
  1106. A.__name__ = ["flambe", "util", "SignalConnection"];
  1107. A.__interfaces__ = [E];
  1108. A.prototype = {
  1109. once: function() {
  1110. this.stayInList = !1;
  1111. return this
  1112. },
  1113. dispose: function() {
  1114. null != this._signal && (this._signal.disconnect(this), this._signal = null)
  1115. },
  1116. __class__: A
  1117. };
  1118. var O = function(e) {
  1119. this._head = null != e ? new A(this, e) : null;
  1120. this._deferredTasks = null
  1121. };
  1122. r["flambe.util.SignalBase"] = O;
  1123. O.__name__ = ["flambe", "util", "SignalBase"];
  1124. O.prototype = {
  1125. connectImpl: function(e, t) {
  1126. var n = this,
  1127. r = new A(this, e);
  1128. this._head == O.DISPATCHING_SENTINEL ? this.defer(function() {
  1129. n.listAdd(r, t)
  1130. }) : this.listAdd(r, t);
  1131. return r
  1132. },
  1133. disconnect: function(e) {
  1134. var t = this;
  1135. this._head == O.DISPATCHING_SENTINEL ? this.defer(function() {
  1136. t.listRemove(e)
  1137. }) : this.listRemove(e)
  1138. },
  1139. defer: function(e) {
  1140. for (var t = null, n = this._deferredTasks; null != n;) t = n, n = n.next;
  1141. e = new An(e);
  1142. null != t ? t.next = e : this._deferredTasks = e
  1143. },
  1144. willEmit: function() {
  1145. var e = this._head;
  1146. this._head = O.DISPATCHING_SENTINEL;
  1147. return e
  1148. },
  1149. didEmit: function(e) {
  1150. this._head = e;
  1151. e = this._deferredTasks;
  1152. for (this._deferredTasks = null; null != e;) e.fn(), e = e.next
  1153. },
  1154. listAdd: function(e, t) {
  1155. if (t) e._next = this._head, this._head = e;
  1156. else {
  1157. for (var n = null, r = this._head; null != r;) n = r, r = r._next;
  1158. null != n ? n._next = e : this._head = e
  1159. }
  1160. },
  1161. listRemove: function(e) {
  1162. for (var t = null, n = this._head; null != n;) {
  1163. if (n == e) {
  1164. e = n._next;
  1165. null == t ? this._head = e : t._next = e;
  1166. break
  1167. }
  1168. t = n;
  1169. n = n._next
  1170. }
  1171. },
  1172. __class__: O
  1173. };
  1174. var M = function(e) {
  1175. O.call(this, e)
  1176. };
  1177. r["flambe.util.Signal2"] = M;
  1178. M.__name__ = ["flambe", "util", "Signal2"];
  1179. M.__super__ = O;
  1180. M.prototype = e(O.prototype, {
  1181. connect: function(e, t) {
  1182. null == t && (t = !1);
  1183. return this.connectImpl(e, t)
  1184. },
  1185. emit: function(e, t) {
  1186. var n = this;
  1187. this._head == O.DISPATCHING_SENTINEL ? this.defer(function() {
  1188. n.emitImpl(e, t)
  1189. }) : this.emitImpl(e, t)
  1190. },
  1191. emitImpl: function(e, t) {
  1192. for (var n = this.willEmit(), r = n; null != r;) r._listener(e, t), r.stayInList || r.dispose(), r = r._next;
  1193. this.didEmit(n)
  1194. },
  1195. __class__: M
  1196. });
  1197. var _ = function(e) {
  1198. O.call(this, e)
  1199. };
  1200. r["flambe.util.Signal1"] = _;
  1201. _.__name__ = ["flambe", "util", "Signal1"];
  1202. _.__super__ = O;
  1203. _.prototype = e(O.prototype, {
  1204. connect: function(e, t) {
  1205. null == t && (t = !1);
  1206. return this.connectImpl(e, t)
  1207. },
  1208. emit: function(e) {
  1209. var t = this;
  1210. this._head == O.DISPATCHING_SENTINEL ? this.defer(function() {
  1211. t.emitImpl(e)
  1212. }) : this.emitImpl(e)
  1213. },
  1214. emitImpl: function(e) {
  1215. for (var t = this.willEmit(), n = t; null != n;) n._listener(e), n.stayInList || n.dispose(), n = n._next;
  1216. this.didEmit(t)
  1217. },
  1218. __class__: _
  1219. });
  1220. var D = function(e, t) {
  1221. this._behavior = null;
  1222. L.call(this, e, t)
  1223. };
  1224. r["flambe.animation.AnimatedFloat"] = D;
  1225. D.__name__ = ["flambe", "animation", "AnimatedFloat"];
  1226. D.__super__ = L;
  1227. D.prototype = e(L.prototype, {
  1228. set__: function(e) {
  1229. this._behavior = null;
  1230. return L.prototype.set__.call(this, e)
  1231. },
  1232. update: function(e) {
  1233. null != this._behavior && (L.prototype.set__.call(this, this._behavior.update(e)), this._behavior.isComplete() && (this._behavior = null))
  1234. },
  1235. animateTo: function(e, t, n) {
  1236. this.set_behavior(new q(this._value, e, t, n))
  1237. },
  1238. set_behavior: function(e) {
  1239. this._behavior = e;
  1240. this.update(0);
  1241. return e
  1242. },
  1243. __class__: D,
  1244. __properties__: e(L.prototype.__properties__, {
  1245. set_behavior: "set_behavior"
  1246. })
  1247. });
  1248. var P = function() {};
  1249. r["flambe.System"] = P;
  1250. P.__name__ = ["flambe", "System"];
  1251. P.init = function() {
  1252. P._calledInit || (P._platform.init(), P._calledInit = !0)
  1253. };
  1254. P.loadAssetPack = function(e) {
  1255. return P._platform.loadAssetPack(e)
  1256. };
  1257. var H = function() {};
  1258. r["flambe.Log"] = H;
  1259. H.__name__ = ["flambe", "Log"];
  1260. H.info = function() {
  1261. null
  1262. };
  1263. H.__super__ = N;
  1264. H.prototype = e(N.prototype, {
  1265. __class__: H
  1266. });
  1267. var B = function() {
  1268. this._realDt = 0
  1269. };
  1270. r["flambe.SpeedAdjuster"] = B;
  1271. B.__name__ = ["flambe", "SpeedAdjuster"];
  1272. B.__super__ = S;
  1273. B.prototype = e(S.prototype, {
  1274. get_name: function() {
  1275. return "SpeedAdjuster_6"
  1276. },
  1277. onUpdate: function(e) {
  1278. 0 < this._realDt && (e = this._realDt, this._realDt = 0);
  1279. this.scale.update(e)
  1280. },
  1281. __class__: B
  1282. });
  1283. var j = function() {};
  1284. r["flambe.animation.Behavior"] = j;
  1285. j.__name__ = ["flambe", "animation", "Behavior"];
  1286. j.prototype = {
  1287. __class__: j
  1288. };
  1289. var F = function() {};
  1290. r["flambe.animation.Ease"] = F;
  1291. F.__name__ = ["flambe", "animation", "Ease"];
  1292. F.linear = function(e) {
  1293. return e
  1294. };
  1295. F.quadIn = function(e) {
  1296. return e * e
  1297. };
  1298. F.quadOut = function(e) {
  1299. return e * (2 - e)
  1300. };
  1301. F.cubeOut = function(e) {
  1302. return 1 + --e * e * e
  1303. };
  1304. F.bounceIn = function(e) {
  1305. e = 1 - e;
  1306. return .36363636363636365 > e ? 1 - 7.5625 * e * e : .7272727272727273 > e ? 1 - (7.5625 * (e - .5454545454545454) * (e - .5454545454545454) + .75) : .9090909090909091 > e ? 1 - (7.5625 * (e - .8181818181818182) * (e - .8181818181818182) + .9375) : 1 - (7.5625 * (e - .9545454545454546) * (e - .9545454545454546) + .984375)
  1307. };
  1308. F.bounceOut = function(e) {
  1309. return .36363636363636365 > e ? 7.5625 * e * e : .7272727272727273 > e ? 7.5625 * (e - .5454545454545454) * (e - .5454545454545454) + .75 : .9090909090909091 > e ? 7.5625 * (e - .8181818181818182) * (e - .8181818181818182) + .9375 : 7.5625 * (e - .9545454545454546) * (e - .9545454545454546) + .984375
  1310. };
  1311. F.bounceInOut = function(e) {
  1312. if (.5 > e) return e = 1 - 2 * e, .36363636363636365 > e ? (1 - 7.5625 * e * e) / 2 : .7272727272727273 > e ? (1 - (7.5625 * (e - .5454545454545454) * (e - .5454545454545454) + .75)) / 2 : .9090909090909091 > e ? (1 - (7.5625 * (e - .8181818181818182) * (e - .8181818181818182) + .9375)) / 2 : (1 - (7.5625 * (e - .9545454545454546) * (e - .9545454545454546) + .984375)) / 2;
  1313. e = 2 * e - 1;
  1314. return .36363636363636365 > e ? 7.5625 * e * e / 2 + .5 : .7272727272727273 > e ? (7.5625 * (e - .5454545454545454) * (e - .5454545454545454) + .75) / 2 + .5 : .9090909090909091 > e ? (7.5625 * (e - .8181818181818182) * (e - .8181818181818182) + .9375) / 2 + .5 : (7.5625 * (e - .9545454545454546) * (e - .9545454545454546) + .984375) / 2 + .5
  1315. };
  1316. F.backIn = function(e) {
  1317. return e * e * (2.70158 * e - 1.70158)
  1318. };
  1319. F.backOut = function(e) {
  1320. return 1 - --e * e * (-2.70158 * e - 1.70158)
  1321. };
  1322. F.backInOut = function(e) {
  1323. e *= 2;
  1324. if (1 > e) return e * e * (2.70158 * e - 1.70158) / 2;
  1325. e -= 2;
  1326. return (1 - e * e * (-2.70158 * e - 1.70158)) / 2 + .5
  1327. };
  1328. var I = function(e, t) {
  1329. this.base = e;
  1330. this.strength = t
  1331. };
  1332. r["flambe.animation.Jitter"] = I;
  1333. I.__name__ = ["flambe", "animation", "Jitter"];
  1334. I.__interfaces__ = [j];
  1335. I.prototype = {
  1336. update: function() {
  1337. return this.base + 2 * Math.random() * this.strength - this.strength
  1338. },
  1339. isComplete: function() {
  1340. return !1
  1341. },
  1342. __class__: I
  1343. };
  1344. var q = function(e, t, n, r) {
  1345. this._from = e;
  1346. this._to = t;
  1347. this._duration = n;
  1348. this.elapsed = 0;
  1349. this._easing = null != r ? r : F.linear
  1350. };
  1351. r["flambe.animation.Tween"] = q;
  1352. q.__name__ = ["flambe", "animation", "Tween"];
  1353. q.__interfaces__ = [j];
  1354. q.prototype = {
  1355. update: function(e) {
  1356. this.elapsed += e;
  1357. return this.elapsed >= this._duration ? this._to : this._from + (this._to - this._from) * this._easing(this.elapsed / this._duration)
  1358. },
  1359. isComplete: function() {
  1360. return this.elapsed >= this._duration
  1361. },
  1362. __class__: q
  1363. };
  1364. var R = function() {};
  1365. r["flambe.asset.Asset"] = R;
  1366. R.__name__ = ["flambe", "asset", "Asset"];
  1367. R.__interfaces__ = [E];
  1368. R.prototype = {
  1369. __class__: R
  1370. };
  1371. var U = r["flambe.asset.AssetFormat"] = {
  1372. __ename__: ["flambe", "asset", "AssetFormat"],
  1373. __constructs__: "WEBP,JXR,PNG,JPG,GIF,DDS,PVR,PKM,MP3,M4A,OPUS,OGG,WAV,Data".split(",")
  1374. };
  1375. U.WEBP = ["WEBP", 0];
  1376. U.WEBP.toString = i;
  1377. U.WEBP.__enum__ = U;
  1378. U.JXR = ["JXR", 1];
  1379. U.JXR.toString = i;
  1380. U.JXR.__enum__ = U;
  1381. U.PNG = ["PNG", 2];
  1382. U.PNG.toString = i;
  1383. U.PNG.__enum__ = U;
  1384. U.JPG = ["JPG", 3];
  1385. U.JPG.toString = i;
  1386. U.JPG.__enum__ = U;
  1387. U.GIF = ["GIF", 4];
  1388. U.GIF.toString = i;
  1389. U.GIF.__enum__ = U;
  1390. U.DDS = ["DDS", 5];
  1391. U.DDS.toString = i;
  1392. U.DDS.__enum__ = U;
  1393. U.PVR = ["PVR", 6];
  1394. U.PVR.toString = i;
  1395. U.PVR.__enum__ = U;
  1396. U.PKM = ["PKM", 7];
  1397. U.PKM.toString = i;
  1398. U.PKM.__enum__ = U;
  1399. U.MP3 = ["MP3", 8];
  1400. U.MP3.toString = i;
  1401. U.MP3.__enum__ = U;
  1402. U.M4A = ["M4A", 9];
  1403. U.M4A.toString = i;
  1404. U.M4A.__enum__ = U;
  1405. U.OPUS = ["OPUS", 10];
  1406. U.OPUS.toString = i;
  1407. U.OPUS.__enum__ = U;
  1408. U.OGG = ["OGG", 11];
  1409. U.OGG.toString = i;
  1410. U.OGG.__enum__ = U;
  1411. U.WAV = ["WAV", 12];
  1412. U.WAV.toString = i;
  1413. U.WAV.__enum__ = U;
  1414. U.Data = ["Data", 13];
  1415. U.Data.toString = i;
  1416. U.Data.__enum__ = U;
  1417. var z = function(e, t, n, r) {
  1418. this.name = e;
  1419. this.url = t;
  1420. this.format = n;
  1421. this.bytes = r
  1422. };
  1423. r["flambe.asset.AssetEntry"] = z;
  1424. z.__name__ = ["flambe", "asset", "AssetEntry"];
  1425. z.prototype = {
  1426. __class__: z
  1427. };
  1428. var W = function() {};
  1429. r["flambe.asset.AssetPack"] = W;
  1430. W.__name__ = ["flambe", "asset", "AssetPack"];
  1431. W.__interfaces__ = [E];
  1432. W.prototype = {
  1433. __class__: W
  1434. };
  1435. var X = function() {};
  1436. r["flambe.asset.File"] = X;
  1437. X.__name__ = ["flambe", "asset", "File"];
  1438. X.__interfaces__ = [R];
  1439. X.prototype = {
  1440. __class__: X
  1441. };
  1442. var V = function() {
  1443. this._localBase = this._remoteBase = null;
  1444. this._entries = []
  1445. };
  1446. r["flambe.asset.Manifest"] = V;
  1447. V.__name__ = ["flambe", "asset", "Manifest"];
  1448. V.fromAssets = function(e, t) {
  1449. null == t && (t = !0);
  1450. var n = v.field(Fn.getType(V).assets[0], e);
  1451. if (null == n) {
  1452. if (t) throw On.withFields("Missing asset pack", ["name", e]);
  1453. return null
  1454. }
  1455. var r = new V;
  1456. r.set_localBase("assets");
  1457. for (var i = 0; i < n.length;) {
  1458. var s = n[i];
  1459. ++i;
  1460. var o = s.name,
  1461. u = e + "/" + o + "?v=" + m.string(s.md5),
  1462. a = V.inferFormat(o);
  1463. a != U.Data && (o = On.removeFileExtension(o));
  1464. r.add(o, u, s.bytes, a)
  1465. }
  1466. return r
  1467. };
  1468. V.inferFormat = function(e) {
  1469. e = On.getUrlExtension(e);
  1470. if (null != e) switch (e.toLowerCase()) {
  1471. case "gif":
  1472. return U.GIF;
  1473. case "jpg":
  1474. case "jpeg":
  1475. return U.JPG;
  1476. case "jxr":
  1477. case "wdp":
  1478. return U.JXR;
  1479. case "png":
  1480. return U.PNG;
  1481. case "webp":
  1482. return U.WEBP;
  1483. case "dds":
  1484. return U.DDS;
  1485. case "pvr":
  1486. return U.PVR;
  1487. case "pkm":
  1488. return U.PKM;
  1489. case "m4a":
  1490. return U.M4A;
  1491. case "mp3":
  1492. return U.MP3;
  1493. case "ogg":
  1494. return U.OGG;
  1495. case "opus":
  1496. return U.OPUS;
  1497. case "wav":
  1498. return U.WAV
  1499. } else null;
  1500. return U.Data
  1501. };
  1502. V.prototype = {
  1503. add: function(e, t, n, r) {
  1504. null == n && (n = 0);
  1505. null == r && (r = V.inferFormat(t));
  1506. e = new z(e, t, r, n);
  1507. this._entries.push(e);
  1508. return e
  1509. },
  1510. iterator: function() {
  1511. return l.iter(this._entries)
  1512. },
  1513. getFullURL: function(e) {
  1514. var t;
  1515. t = null != this.get_remoteBase() && V._supportsCrossOrigin ? this.get_remoteBase() : this.get_localBase();
  1516. return null != t ? On.joinPath(t, e.url) : e.url
  1517. },
  1518. get_localBase: function() {
  1519. return this._localBase
  1520. },
  1521. set_localBase: function(e) {
  1522. null != e && xn.that(!y.startsWith(e, "http://") && !y.startsWith(e, "https://"), "localBase must be a path on the same domain, NOT starting with http(s)://", null);
  1523. return this._localBase = e
  1524. },
  1525. get_remoteBase: function() {
  1526. return this._remoteBase
  1527. },
  1528. __class__: V,
  1529. __properties__: {
  1530. get_remoteBase: "get_remoteBase",
  1531. set_localBase: "set_localBase",
  1532. get_localBase: "get_localBase"
  1533. }
  1534. };
  1535. var $ = r["flambe.display.BlendMode"] = {
  1536. __ename__: ["flambe", "display", "BlendMode"],
  1537. __constructs__: ["Normal", "Add", "Mask", "Copy"]
  1538. };
  1539. $.Normal = ["Normal", 0];
  1540. $.Normal.toString = i;
  1541. $.Normal.__enum__ = $;
  1542. $.Add = ["Add", 1];
  1543. $.Add.toString = i;
  1544. $.Add.__enum__ = $;
  1545. $.Mask = ["Mask", 2];
  1546. $.Mask.toString = i;
  1547. $.Mask.__enum__ = $;
  1548. $.Copy = ["Copy", 3];
  1549. $.Copy.toString = i;
  1550. $.Copy.__enum__ = $;
  1551. var J = function() {
  1552. this.blendMode = this.scissor = null;
  1553. var e = this;
  1554. this._flags = 139;
  1555. this._localMatrix = new vt;
  1556. var t = function() {
  1557. e._flags |= 12
  1558. };
  1559. this.x = new D(0, t);
  1560. this.y = new D(0, t);
  1561. this.rotation = new D(0, t);
  1562. this.scaleX = new D(1, t);
  1563. this.scaleY = new D(1, t);
  1564. this.anchorX = new D(0, t);
  1565. this.anchorY = new D(0, t);
  1566. this.alpha = new D(1)
  1567. };
  1568. r["flambe.display.Sprite"] = J;
  1569. J.__name__ = ["flambe", "display", "Sprite"];
  1570. J.hitTest = function(e, t, n) {
  1571. var r = e._compMap.Sprite_0;
  1572. if (null != r) {
  1573. if (3 != (r._flags & 3)) return null;
  1574. r.getLocalMatrix().inverseTransform(t, n, J._scratchPoint) && (t = J._scratchPoint.x, n = J._scratchPoint.y);
  1575. var i = r.scissor;
  1576. if (null != i && !i.contains(t, n)) return null
  1577. }
  1578. e = J.hitTestBackwards(e.firstChild, t, n);
  1579. return null != e ? e : null != r && r.containsLocal(t, n) ? r : null
  1580. };
  1581. J.render = function(e, t) {
  1582. var n = e._compMap.Sprite_0;
  1583. if (null != n) {
  1584. var r = n.alpha._value;
  1585. if (0 == (n._flags & 1) || 0 >= r) return;
  1586. t.save();
  1587. 1 > r && t.multiplyAlpha(r);
  1588. null != n.blendMode && t.setBlendMode(n.blendMode);
  1589. var r = n.getLocalMatrix(),
  1590. i = r.m02,
  1591. s = r.m12;
  1592. 0 != (n._flags & 128) && (i = Math.round(i), s = Math.round(s));
  1593. t.transform(r.m00, r.m10, r.m01, r.m11, i, s);
  1594. r = n.scissor;
  1595. null != r && t.applyScissor(r.x, r.y, r.width, r.height);
  1596. n.draw(t)
  1597. }
  1598. r = e._compMap.Director_5;
  1599. if (null != r) {
  1600. r = r.occludedScenes;
  1601. for (i = 0; i < r.length;) s = r[i], ++i, J.render(s, t)
  1602. }
  1603. for (r = e.firstChild; null != r;) i = r.next, J.render(r, t), r = i;
  1604. null != n && t.restore()
  1605. };
  1606. J.hitTestBackwards = function(e, t, n) {
  1607. if (null != e) {
  1608. var r = J.hitTestBackwards(e.next, t, n);
  1609. return null != r ? r : J.hitTest(e, t, n)
  1610. }
  1611. return null
  1612. };
  1613. J.__super__ = S;
  1614. J.prototype = e(S.prototype, {
  1615. get_name: function() {
  1616. return "Sprite_0"
  1617. },
  1618. getNaturalWidth: function() {
  1619. return 0
  1620. },
  1621. getNaturalHeight: function() {
  1622. return 0
  1623. },
  1624. containsLocal: function(e, t) {
  1625. return 0 <= e && e < this.getNaturalWidth() && 0 <= t && t < this.getNaturalHeight()
  1626. },
  1627. getLocalMatrix: function() {
  1628. 0 != (this._flags & 4) && (this._flags &= -5, this._localMatrix.compose(this.x._value, this.y._value, this.scaleX._value, this.scaleY._value, 3.141592653589793 * this.rotation._value / 180), this._localMatrix.translate(-this.anchorX._value, -this.anchorY._value));
  1629. return this._localMatrix
  1630. },
  1631. centerAnchor: function() {
  1632. this.anchorX.set__(this.getNaturalWidth() / 2);
  1633. this.anchorY.set__(this.getNaturalHeight() / 2);
  1634. return this
  1635. },
  1636. setXY: function(e, t) {
  1637. this.x.set__(e);
  1638. this.y.set__(t);
  1639. return this
  1640. },
  1641. setAlpha: function(e) {
  1642. this.alpha.set__(e);
  1643. return this
  1644. },
  1645. setRotation: function(e) {
  1646. this.rotation.set__(e);
  1647. return this
  1648. },
  1649. setScale: function(e) {
  1650. this.scaleX.set__(e);
  1651. this.scaleY.set__(e);
  1652. return this
  1653. },
  1654. onAdded: function() {
  1655. 0 != (this._flags & 256) && this.connectHover()
  1656. },
  1657. onRemoved: function() {
  1658. null != this._hoverConnection && (this._hoverConnection.dispose(), this._hoverConnection = null)
  1659. },
  1660. onUpdate: function(e) {
  1661. this.x.update(e);
  1662. this.y.update(e);
  1663. this.rotation.update(e);
  1664. this.scaleX.update(e);
  1665. this.scaleY.update(e);
  1666. this.alpha.update(e);
  1667. this.anchorX.update(e);
  1668. this.anchorY.update(e)
  1669. },
  1670. draw: function() {},
  1671. getParentSprite: function() {
  1672. if (null == this.owner) return null;
  1673. for (var e = this.owner.parent; null != e;) {
  1674. var t = e._compMap.Sprite_0;
  1675. if (null != t) return t;
  1676. e = e.parent
  1677. }
  1678. return null
  1679. },
  1680. get_pointerDown: function() {
  1681. null == this._pointerDown && (this._pointerDown = new _);
  1682. return this._pointerDown
  1683. },
  1684. get_pointerUp: function() {
  1685. null == this._pointerUp && (this._pointerUp = new _);
  1686. return this._pointerUp
  1687. },
  1688. connectHover: function() {
  1689. var e = this;
  1690. null == this._hoverConnection && (this._hoverConnection = P._platform.getPointer().move.connect(function(t) {
  1691. for (var n = t.hit; null != n;) {
  1692. if (n == e) return;
  1693. n = n.getParentSprite()
  1694. }
  1695. null != e._pointerOut && 0 != (e._flags & 256) && e._pointerOut.emit(t);
  1696. e._flags &= -257;
  1697. e._hoverConnection.dispose();
  1698. e._hoverConnection = null
  1699. }))
  1700. },
  1701. set_visible: function(e) {
  1702. this._flags = Tn.set(this._flags, 1, e);
  1703. return e
  1704. },
  1705. onPointerDown: function(e) {
  1706. this.onHover(e);
  1707. null != this._pointerDown && this._pointerDown.emit(e)
  1708. },
  1709. onPointerMove: function(e) {
  1710. this.onHover(e);
  1711. null != this._pointerMove && this._pointerMove.emit(e)
  1712. },
  1713. onHover: function(e) {
  1714. if (0 == (this._flags & 256) && (this._flags |= 256, null != this._pointerIn || null != this._pointerOut)) null != this._pointerIn && this._pointerIn.emit(e), this.connectHover()
  1715. },
  1716. onPointerUp: function(e) {
  1717. switch (e.source[1]) {
  1718. case 1:
  1719. null != this._pointerOut && 0 != (this._flags & 256) && this._pointerOut.emit(e), this._flags &= -257, null != this._hoverConnection && (this._hoverConnection.dispose(), this._hoverConnection = null)
  1720. }
  1721. null != this._pointerUp && this._pointerUp.emit(e)
  1722. },
  1723. __class__: J,
  1724. __properties__: e(S.prototype.__properties__, {
  1725. set_visible: "set_visible",
  1726. get_pointerUp: "get_pointerUp",
  1727. get_pointerDown: "get_pointerDown"
  1728. })
  1729. });
  1730. var K = function(e, t, n) {
  1731. J.call(this);
  1732. this.color = e;
  1733. this.width = new D(t);
  1734. this.height = new D(n)
  1735. };
  1736. r["flambe.display.FillSprite"] = K;
  1737. K.__name__ = ["flambe", "display", "FillSprite"];
  1738. K.__super__ = J;
  1739. K.prototype = e(J.prototype, {
  1740. draw: function(e) {
  1741. e.fillRect(this.color, 0, 0, this.width._value, this.height._value)
  1742. },
  1743. getNaturalWidth: function() {
  1744. return this.width._value
  1745. },
  1746. getNaturalHeight: function() {
  1747. return this.height._value
  1748. },
  1749. setSize: function(e, t) {
  1750. this.width.set__(e);
  1751. this.height.set__(t);
  1752. return this
  1753. },
  1754. onUpdate: function(e) {
  1755. J.prototype.onUpdate.call(this, e);
  1756. this.width.update(e);
  1757. this.height.update(e)
  1758. },
  1759. __class__: K
  1760. });
  1761. var Q = function(e) {
  1762. this._kernings = null;
  1763. this.xOffset = this.yOffset = this.xAdvance = 0;
  1764. this.page = null;
  1765. this.x = this.y = this.width = this.height = 0;
  1766. this.charCode = e
  1767. };
  1768. r["flambe.display.Glyph"] = Q;
  1769. Q.__name__ = ["flambe", "display", "Glyph"];
  1770. Q.prototype = {
  1771. draw: function(e, t, n) {
  1772. 0 < this.width && e.drawSubTexture(this.page, t + this.xOffset, n + this.yOffset, this.x, this.y, this.width, this.height)
  1773. },
  1774. getKerning: function(e) {
  1775. return null != this._kernings ? m["int"](this._kernings.get(e)) : 0
  1776. },
  1777. setKerning: function(e, t) {
  1778. null == this._kernings && (this._kernings = new Dn);
  1779. this._kernings.set(e, t)
  1780. },
  1781. __class__: Q
  1782. };
  1783. var G = function(e, t) {
  1784. this.name = t;
  1785. this._pack = e;
  1786. this.reload()
  1787. };
  1788. r["flambe.display.Font"] = G;
  1789. G.__name__ = ["flambe", "display", "Font"];
  1790. G.prototype = {
  1791. layoutText: function(e, t, n, r, i) {
  1792. null == i && (i = 0);
  1793. null == r && (r = 0);
  1794. null == n && (n = 0);
  1795. null == t && (t = Y.Left);
  1796. return new Z(this, e, t, n, r, i)
  1797. },
  1798. reload: function() {
  1799. this._glyphs = new Dn;
  1800. this._glyphs.set(G.NEWLINE.charCode, G.NEWLINE);
  1801. for (var e = new et(this._pack.getFile(this.name + ".fnt").toString()), t = new Dn, n = this.name.lastIndexOf("/"), n = 0 <= n ? l.substr(this.name, 0, n + 1) : "", r = e.keywords(); r.hasNext();) switch (r.next()) {
  1802. case "info":
  1803. for (var i = e.pairs(); i.hasNext();) {
  1804. var s = i.next();
  1805. switch (s.key) {
  1806. case "size":
  1807. this.size = s.getInt()
  1808. }
  1809. }
  1810. break;
  1811. case "common":
  1812. for (i = e.pairs(); i.hasNext();) switch (s = i.next(), s.key) {
  1813. case "lineHeight":
  1814. this.lineHeight = s.getInt()
  1815. }
  1816. break;
  1817. case "page":
  1818. for (var i = 0, s = null, o = e.pairs(); o.hasNext();) {
  1819. var u = o.next();
  1820. switch (u.key) {
  1821. case "id":
  1822. i = u.getInt();
  1823. break;
  1824. case "file":
  1825. s = u.getString()
  1826. }
  1827. }
  1828. s = this._pack.getTexture(n + On.removeFileExtension(s));
  1829. t.set(i, s);
  1830. break;
  1831. case "char":
  1832. i = null;
  1833. for (s = e.pairs(); s.hasNext();) switch (o = s.next(), o.key) {
  1834. case "id":
  1835. i = new Q(o.getInt());
  1836. break;
  1837. case "x":
  1838. i.x = o.getInt();
  1839. break;
  1840. case "y":
  1841. i.y = o.getInt();
  1842. break;
  1843. case "width":
  1844. i.width = o.getInt();
  1845. break;
  1846. case "height":
  1847. i.height = o.getInt();
  1848. break;
  1849. case "page":
  1850. o = o.getInt();
  1851. i.page = t.get(o);
  1852. break;
  1853. case "xoffset":
  1854. i.xOffset = o.getInt();
  1855. break;
  1856. case "yoffset":
  1857. i.yOffset = o.getInt();
  1858. break;
  1859. case "xadvance":
  1860. i.xAdvance = o.getInt()
  1861. }
  1862. this._glyphs.set(i.charCode, i);
  1863. break;
  1864. case "kerning":
  1865. i = null;
  1866. o = s = 0;
  1867. for (u = e.pairs(); u.hasNext();) {
  1868. var a = u.next();
  1869. switch (a.key) {
  1870. case "first":
  1871. i = this._glyphs.get(a.getInt());
  1872. break;
  1873. case "second":
  1874. s = a.getInt();
  1875. break;
  1876. case "amount":
  1877. o = a.getInt()
  1878. }
  1879. }
  1880. null != i && 0 != o && i.setKerning(s, o)
  1881. }
  1882. },
  1883. __class__: G
  1884. };
  1885. var Y = r["flambe.display.TextAlign"] = {
  1886. __ename__: ["flambe", "display", "TextAlign"],
  1887. __constructs__: ["Left", "Center", "Right"]
  1888. };
  1889. Y.Left = ["Left", 0];
  1890. Y.Left.toString = i;
  1891. Y.Left.__enum__ = Y;
  1892. Y.Center = ["Center", 1];
  1893. Y.Center.toString = i;
  1894. Y.Center.__enum__ = Y;
  1895. Y.Right = ["Right", 2];
  1896. Y.Right.toString = i;
  1897. Y.Right.__enum__ = Y;
  1898. var Z = function(e, t, n, r, i, s) {
  1899. this.lines = 0;
  1900. var o = this;
  1901. this._font = e;
  1902. this._glyphs = [];
  1903. this._offsets = [];
  1904. this._lineOffset = Math.round(e.lineHeight + s);
  1905. this.bounds = new mt;
  1906. for (var u = [], s = t.length, a = 0; a < s;) {
  1907. var f = a++,
  1908. f = t.charCodeAt(f),
  1909. f = e._glyphs.get(f);
  1910. null != f ? this._glyphs.push(f) : null
  1911. }
  1912. for (var t = -1, l = 0, c = 0, e = e._glyphs.get(10), s = function() {
  1913. o.bounds.width = dt.max(o.bounds.width, l);
  1914. o.bounds.height += c;
  1915. u[o.lines] = l;
  1916. c = l = 0;
  1917. ++o.lines
  1918. }, a = 0; a < this._glyphs.length;) {
  1919. f = this._glyphs[a];
  1920. this._offsets[a] = Math.round(l);
  1921. var h = 0 < r && l + f.width > r;
  1922. h || f == e ? (h && (0 <= t ? (this._glyphs[t] = e, l = this._offsets[t], a = t) : this._glyphs.splice(a, 0, e)), t = -1, c = this._lineOffset, s()) : (32 == f.charCode && (t = a), l += f.xAdvance + i, c = dt.max(c, f.height + f.yOffset), a + 1 < this._glyphs.length && (l += f.getKerning(this._glyphs[a + 1].charCode)));
  1923. ++a
  1924. }
  1925. s();
  1926. i = 0;
  1927. e = Z.getAlignOffset(n, u[0], r);
  1928. t = 1.79769313486231e308;
  1929. s = -1.79769313486231e308;
  1930. f = a = 0;
  1931. for (h = this._glyphs.length; f < h;) {
  1932. var p = this._glyphs[f];
  1933. 10 == p.charCode && (i += this._lineOffset, ++a, e = Z.getAlignOffset(n, u[a], r));
  1934. this._offsets[f] += e;
  1935. var d = i + p.yOffset;
  1936. t < d || (t = d);
  1937. s = dt.max(s, d + p.height);
  1938. ++f
  1939. }
  1940. this.bounds.x = Z.getAlignOffset(n, this.bounds.width, r);
  1941. this.bounds.y = t;
  1942. this.bounds.height = s - t
  1943. };
  1944. r["flambe.display.TextLayout"] = Z;
  1945. Z.__name__ = ["flambe", "display", "TextLayout"];
  1946. Z.getAlignOffset = function(e, t, n) {
  1947. switch (e[1]) {
  1948. case 0:
  1949. return 0;
  1950. case 2:
  1951. return n - t;
  1952. case 1:
  1953. return Math.round((n - t) / 2)
  1954. }
  1955. };
  1956. Z.prototype = {
  1957. draw: function(e) {
  1958. for (var t = 0, n = 0, r = this._glyphs.length; n < r;) {
  1959. var i = this._glyphs[n];
  1960. 10 == i.charCode ? t += this._lineOffset : i.draw(e, this._offsets[n], t);
  1961. ++n
  1962. }
  1963. },
  1964. __class__: Z
  1965. };
  1966. var et = function(e) {
  1967. this._configText = e;
  1968. this._keywordPattern = new s("([A-Za-z]+)(.*)", "");
  1969. this._pairPattern = new s('([A-Za-z]+)=("[^"]*"|[^\\s]+)', "")
  1970. };
  1971. r["flambe.display._Font.ConfigParser"] = et;
  1972. et.__name__ = ["flambe", "display", "_Font", "ConfigParser"];
  1973. et.advance = function(e, t) {
  1974. var n = t.matchedPos();
  1975. return l.substr(e, n.pos + n.len, e.length)
  1976. };
  1977. et.prototype = {
  1978. keywords: function() {
  1979. var e = this,
  1980. t = this._configText;
  1981. return {
  1982. next: function() {
  1983. t = et.advance(t, e._keywordPattern);
  1984. e._pairText = e._keywordPattern.matched(2);
  1985. return e._keywordPattern.matched(1)
  1986. },
  1987. hasNext: function() {
  1988. return e._keywordPattern.match(t)
  1989. }
  1990. }
  1991. },
  1992. pairs: function() {
  1993. var e = this,
  1994. t = this._pairText;
  1995. return {
  1996. next: function() {
  1997. t = et.advance(t, e._pairPattern);
  1998. return new tt(e._pairPattern.matched(1), e._pairPattern.matched(2))
  1999. },
  2000. hasNext: function() {
  2001. return e._pairPattern.match(t)
  2002. }
  2003. }
  2004. },
  2005. __class__: et
  2006. };
  2007. var tt = function(e, t) {
  2008. this.key = e;
  2009. this._value = t
  2010. };
  2011. r["flambe.display._Font.ConfigPair"] = tt;
  2012. tt.__name__ = ["flambe", "display", "_Font", "ConfigPair"];
  2013. tt.prototype = {
  2014. getInt: function() {
  2015. return m.parseInt(this._value)
  2016. },
  2017. getString: function() {
  2018. return 34 != this._value.charCodeAt(0) ? null : l.substr(this._value, 1, this._value.length - 2)
  2019. },
  2020. __class__: tt
  2021. };
  2022. var nt = function() {};
  2023. r["flambe.display.Graphics"] = nt;
  2024. nt.__name__ = ["flambe", "display", "Graphics"];
  2025. nt.prototype = {
  2026. __class__: nt
  2027. };
  2028. var rt = function(e) {
  2029. J.call(this);
  2030. this.texture = e
  2031. };
  2032. r["flambe.display.ImageSprite"] = rt;
  2033. rt.__name__ = ["flambe", "display", "ImageSprite"];
  2034. rt.__super__ = J;
  2035. rt.prototype = e(J.prototype, {
  2036. draw: function(e) {
  2037. null != this.texture && e.drawTexture(this.texture, 0, 0)
  2038. },
  2039. getNaturalWidth: function() {
  2040. return null != this.texture ? this.texture.get_width() : 0
  2041. },
  2042. getNaturalHeight: function() {
  2043. return null != this.texture ? this.texture.get_height() : 0
  2044. },
  2045. __class__: rt
  2046. });
  2047. var it = r["flambe.display.Orientation"] = {
  2048. __ename__: ["flambe", "display", "Orientation"],
  2049. __constructs__: ["Portrait", "Landscape"]
  2050. };
  2051. it.Portrait = ["Portrait", 0];
  2052. it.Portrait.toString = i;
  2053. it.Portrait.__enum__ = it;
  2054. it.Landscape = ["Landscape", 1];
  2055. it.Landscape.toString = i;
  2056. it.Landscape.__enum__ = it;
  2057. var st = function() {};
  2058. r["flambe.display.Texture"] = st;
  2059. st.__name__ = ["flambe", "display", "Texture"];
  2060. st.__interfaces__ = [R];
  2061. st.prototype = {
  2062. __class__: st
  2063. };
  2064. var ot = function() {};
  2065. r["flambe.display.SubTexture"] = ot;
  2066. ot.__name__ = ["flambe", "display", "SubTexture"];
  2067. ot.__interfaces__ = [st];
  2068. var ut = function(e, t) {
  2069. null == t && (t = "");
  2070. this._layout = null;
  2071. var n = this;
  2072. J.call(this);
  2073. this._font = e;
  2074. this._text = t;
  2075. this._align = Y.Left;
  2076. this._flags |= 64;
  2077. var r = function() {
  2078. n._flags |= 64
  2079. };
  2080. this.wrapWidth = new D(0, r);
  2081. this.letterSpacing = new D(0, r);
  2082. this.lineSpacing = new D(0, r)
  2083. };
  2084. r["flambe.display.TextSprite"] = ut;
  2085. ut.__name__ = ["flambe", "display", "TextSprite"];
  2086. ut.__super__ = J;
  2087. ut.prototype = e(J.prototype, {
  2088. draw: function(e) {
  2089. this.updateLayout();
  2090. this._layout.draw(e)
  2091. },
  2092. getNaturalWidth: function() {
  2093. this.updateLayout();
  2094. return 0 < this.wrapWidth._value ? this.wrapWidth._value : this._layout.bounds.width
  2095. },
  2096. getNaturalHeight: function() {
  2097. this.updateLayout();
  2098. var e = this._layout.lines * (this._font.lineHeight + this.lineSpacing._value),
  2099. t = this._layout.bounds.height;
  2100. return e > t ? e : t
  2101. },
  2102. containsLocal: function(e, t) {
  2103. this.updateLayout();
  2104. return this._layout.bounds.contains(e, t)
  2105. },
  2106. setAlign: function(e) {
  2107. this.set_align(e);
  2108. return this
  2109. },
  2110. set_text: function(e) {
  2111. e != this._text && (this._text = e, this._flags |= 64);
  2112. return e
  2113. },
  2114. set_align: function(e) {
  2115. e != this._align && (this._align = e, this._flags |= 64);
  2116. return e
  2117. },
  2118. updateLayout: function() {
  2119. 0 != (this._flags & 64) && (this._flags &= -65, this._layout = this._font.layoutText(this._text, this._align, this.wrapWidth._value, this.letterSpacing._value, this.lineSpacing._value))
  2120. },
  2121. onUpdate: function(e) {
  2122. J.prototype.onUpdate.call(this, e);
  2123. this.wrapWidth.update(e);
  2124. this.letterSpacing.update(e);
  2125. this.lineSpacing.update(e)
  2126. },
  2127. __class__: ut,
  2128. __properties__: e(J.prototype.__properties__, {
  2129. set_align: "set_align",
  2130. set_text: "set_text"
  2131. })
  2132. });
  2133. var at = r["flambe.input.MouseButton"] = {
  2134. __ename__: ["flambe", "input", "MouseButton"],
  2135. __constructs__: ["Left", "Middle", "Right", "Unknown"]
  2136. };
  2137. at.Left = ["Left", 0];
  2138. at.Left.toString = i;
  2139. at.Left.__enum__ = at;
  2140. at.Middle = ["Middle", 1];
  2141. at.Middle.toString = i;
  2142. at.Middle.__enum__ = at;
  2143. at.Right = ["Right", 2];
  2144. at.Right.toString = i;
  2145. at.Right.__enum__ = at;
  2146. at.Unknown = function(e) {
  2147. e = ["Unknown", 3, e];
  2148. e.__enum__ = at;
  2149. e.toString = i;
  2150. return e
  2151. };
  2152. var ft = r["flambe.input.MouseCursor"] = {
  2153. __ename__: ["flambe", "input", "MouseCursor"],
  2154. __constructs__: ["Default", "Button", "None"]
  2155. };
  2156. ft.Default = ["Default", 0];
  2157. ft.Default.toString = i;
  2158. ft.Default.__enum__ = ft;
  2159. ft.Button = ["Button", 1];
  2160. ft.Button.toString = i;
  2161. ft.Button.__enum__ = ft;
  2162. ft.None = ["None", 2];
  2163. ft.None.toString = i;
  2164. ft.None.__enum__ = ft;
  2165. var lt = function() {
  2166. this.init(0, 0, 0, null)
  2167. };
  2168. r["flambe.input.MouseEvent"] = lt;
  2169. lt.__name__ = ["flambe", "input", "MouseEvent"];
  2170. lt.prototype = {
  2171. init: function(e, t, n, r) {
  2172. this.id = e;
  2173. this.viewX = t;
  2174. this.viewY = n;
  2175. this.button = r
  2176. },
  2177. __class__: lt
  2178. };
  2179. var ct = r["flambe.input.EventSource"] = {
  2180. __ename__: ["flambe", "input", "EventSource"],
  2181. __constructs__: ["Mouse", "Touch"]
  2182. };
  2183. ct.Mouse = function(e) {
  2184. e = ["Mouse", 0, e];
  2185. e.__enum__ = ct;
  2186. e.toString = i;
  2187. return e
  2188. };
  2189. ct.Touch = function(e) {
  2190. e = ["Touch", 1, e];
  2191. e.__enum__ = ct;
  2192. e.toString = i;
  2193. return e
  2194. };
  2195. var ht = function() {
  2196. this.init(0, 0, 0, null, null)
  2197. };
  2198. r["flambe.input.PointerEvent"] = ht;
  2199. ht.__name__ = ["flambe", "input", "PointerEvent"];
  2200. ht.prototype = {
  2201. init: function(e, t, n, r, i) {
  2202. this.id = e;
  2203. this.viewX = t;
  2204. this.viewY = n;
  2205. this.hit = r;
  2206. this.source = i;
  2207. this._stopped = !1
  2208. },
  2209. __class__: ht
  2210. };
  2211. var pt = function(e) {
  2212. this.id = e;
  2213. this._source = ct.Touch(this)
  2214. };
  2215. r["flambe.input.TouchPoint"] = pt;
  2216. pt.__name__ = ["flambe", "input", "TouchPoint"];
  2217. pt.prototype = {
  2218. init: function(e, t) {
  2219. this.viewX = e;
  2220. this.viewY = t
  2221. },
  2222. __class__: pt
  2223. };
  2224. var dt = function() {};
  2225. r["flambe.math.FMath"] = dt;
  2226. dt.__name__ = ["flambe", "math", "FMath"];
  2227. dt.max = function(e, t) {
  2228. return e > t ? e : t
  2229. };
  2230. var vt = function() {
  2231. this.identity()
  2232. };
  2233. r["flambe.math.Matrix"] = vt;
  2234. vt.__name__ = ["flambe", "math", "Matrix"];
  2235. vt.prototype = {
  2236. set: function(e, t, n, r, i, s) {
  2237. this.m00 = e;
  2238. this.m01 = n;
  2239. this.m02 = i;
  2240. this.m10 = t;
  2241. this.m11 = r;
  2242. this.m12 = s
  2243. },
  2244. identity: function() {
  2245. this.set(1, 0, 0, 1, 0, 0)
  2246. },
  2247. compose: function(e, t, n, r, i) {
  2248. var s = Math.sin(i),
  2249. i = Math.cos(i);
  2250. this.set(i * n, s * n, -s * r, i * r, e, t)
  2251. },
  2252. translate: function(e, t) {
  2253. this.m02 += this.m00 * e + this.m01 * t;
  2254. this.m12 += this.m11 * t + this.m10 * e
  2255. },
  2256. determinant: function() {
  2257. return this.m00 * this.m11 - this.m01 * this.m10
  2258. },
  2259. inverseTransform: function(e, t, n) {
  2260. var r = this.determinant();
  2261. if (0 == r) return !1;
  2262. e -= this.m02;
  2263. t -= this.m12;
  2264. n.x = (e * this.m11 - t * this.m01) / r;
  2265. n.y = (t * this.m00 - e * this.m10) / r;
  2266. return !0
  2267. },
  2268. __class__: vt
  2269. };
  2270. var mt = function(e, t, n, r) {
  2271. null == r && (r = 0);
  2272. null == n && (n = 0);
  2273. null == t && (t = 0);
  2274. null == e && (e = 0);
  2275. this.set(e, t, n, r)
  2276. };
  2277. r["flambe.math.Rectangle"] = mt;
  2278. mt.__name__ = ["flambe", "math", "Rectangle"];
  2279. mt.prototype = {
  2280. set: function(e, t, n, r) {
  2281. this.x = e;
  2282. this.y = t;
  2283. this.width = n;
  2284. this.height = r
  2285. },
  2286. contains: function(e, t) {
  2287. e -= this.x;
  2288. if (0 <= this.width) {
  2289. if (0 > e || e > this.width) return !1
  2290. } else if (0 < e || e < this.width) return !1;
  2291. t -= this.y;
  2292. if (0 <= this.height) {
  2293. if (0 > t || t > this.height) return !1
  2294. } else if (0 < t || t < this.height) return !1;
  2295. return !0
  2296. },
  2297. __class__: mt
  2298. };
  2299. var gt = function() {
  2300. this._disposed = !1
  2301. };
  2302. r["flambe.platform.BasicAsset"] = gt;
  2303. gt.__name__ = ["flambe", "platform", "BasicAsset"];
  2304. gt.__interfaces__ = [R];
  2305. gt.prototype = {
  2306. dispose: function() {
  2307. this._disposed || (this._disposed = !0, this.onDisposed())
  2308. },
  2309. onDisposed: function() {
  2310. null
  2311. },
  2312. __class__: gt
  2313. };
  2314. var yt = function(e, t) {
  2315. var n = this;
  2316. this.manifest = t;
  2317. this._platform = e;
  2318. this.promise = new kn;
  2319. this._bytesLoaded = new Hn;
  2320. this._pack = new bt(t, this);
  2321. var r = c.array(t);
  2322. if (0 == r.length) this.handleSuccess();
  2323. else {
  2324. for (var i = new Hn, s = 0; s < r.length;) {
  2325. var o = r[s];
  2326. ++s;
  2327. var u = i.get(o.name);
  2328. null == u && (u = [], i.set(o.name, u));
  2329. u.push(o)
  2330. }
  2331. this._assetsRemaining = c.count(i);
  2332. for (r = i.iterator(); r.hasNext();) i = [r.next()], this.pickBestEntry(i[0], function(e) {
  2333. return function(r) {
  2334. if (null != r) {
  2335. var i = t.getFullURL(r);
  2336. try {
  2337. n.loadEntry(i, r)
  2338. } catch (s) {
  2339. n.handleError(r, "Unexpected error: " + m.string(s))
  2340. }
  2341. i = n.promise;
  2342. i.set_total(i._total + r.bytes)
  2343. } else r = e[0][0], yt.isAudio(r.format) ? n.handleLoad(r, At.getInstance()) : n.handleError(r, "Could not find a supported format to load")
  2344. }
  2345. }(i))
  2346. }
  2347. };
  2348. r["flambe.platform.BasicAssetPackLoader"] = yt;
  2349. yt.__name__ = ["flambe", "platform", "BasicAssetPackLoader"];
  2350. yt.isAudio = function(e) {
  2351. switch (e[1]) {
  2352. case 8:
  2353. case 9:
  2354. case 10:
  2355. case 11:
  2356. case 12:
  2357. return !0;
  2358. default:
  2359. return !1
  2360. }
  2361. };
  2362. yt.prototype = {
  2363. onDisposed: function() {},
  2364. pickBestEntry: function(e, t) {
  2365. this.getAssetFormats(function(n) {
  2366. for (var r = 0; r < n.length;) {
  2367. var i = n[r];
  2368. ++r;
  2369. for (var s = 0; s < e.length;) {
  2370. var o = e[s];
  2371. ++s;
  2372. if (o.format == i) {
  2373. t(o);
  2374. return
  2375. }
  2376. }
  2377. }
  2378. t(null)
  2379. })
  2380. },
  2381. loadEntry: function() {
  2382. null
  2383. },
  2384. getAssetFormats: function() {
  2385. null
  2386. },
  2387. handleLoad: function(e, t) {
  2388. if (!this._pack.disposed) {
  2389. this.handleProgress(e, e.bytes);
  2390. var n;
  2391. switch (e.format[1]) {
  2392. case 0:
  2393. case 1:
  2394. case 2:
  2395. case 3:
  2396. case 4:
  2397. case 5:
  2398. case 6:
  2399. case 7:
  2400. n = this._pack.textures;
  2401. break;
  2402. case 8:
  2403. case 9:
  2404. case 10:
  2405. case 11:
  2406. case 12:
  2407. n = this._pack.sounds;
  2408. break;
  2409. case 13:
  2410. n = this._pack.files
  2411. }
  2412. n.set(e.name, t);
  2413. this._assetsRemaining -= 1;
  2414. 0 == this._assetsRemaining && this.handleSuccess()
  2415. }
  2416. },
  2417. handleProgress: function(e, t) {
  2418. this._bytesLoaded.set(e.name, t);
  2419. for (var n = 0, r = this._bytesLoaded.iterator(); r.hasNext();) var i = r.next(),
  2420. n = n + i;
  2421. this.promise.set_progress(n)
  2422. },
  2423. handleSuccess: function() {
  2424. this.promise.set_result(this._pack)
  2425. },
  2426. handleError: function(e, t) {
  2427. this.promise.error.emit(On.withFields(t, ["url", e.url]))
  2428. },
  2429. handleTextureError: function(e) {
  2430. this.handleError(e, "Failed to create texture. Is the GPU context unavailable?")
  2431. },
  2432. __class__: yt
  2433. };
  2434. var bt = function(e, t) {
  2435. this.disposed = !1;
  2436. this._manifest = e;
  2437. this.loader = t;
  2438. this.textures = new Hn;
  2439. this.sounds = new Hn;
  2440. this.files = new Hn
  2441. };
  2442. r["flambe.platform._BasicAssetPackLoader.BasicAssetPack"] = bt;
  2443. bt.__name__ = ["flambe", "platform", "_BasicAssetPackLoader", "BasicAssetPack"];
  2444. bt.__interfaces__ = [W];
  2445. bt.prototype = {
  2446. getTexture: function(e, t) {
  2447. null == t && (t = !0);
  2448. var n = this.textures.get(e);
  2449. if (null == n && t) throw On.withFields("Missing texture", ["name", e]);
  2450. return n
  2451. },
  2452. getSound: function(e, t) {
  2453. null == t && (t = !0);
  2454. var n = this.sounds.get(e);
  2455. if (null == n && t) throw On.withFields("Missing sound", ["name", e]);
  2456. return n
  2457. },
  2458. getFile: function(e, t) {
  2459. null == t && (t = !0);
  2460. var n = this.files.get(e);
  2461. if (null == n && t) throw On.withFields("Missing file", ["name", e]);
  2462. return n
  2463. },
  2464. dispose: function() {
  2465. if (!this.disposed) {
  2466. this.disposed = !0;
  2467. for (var e = this.textures.iterator(); e.hasNext();) e.next().dispose();
  2468. this.textures = null;
  2469. for (e = this.sounds.iterator(); e.hasNext();) e.next().dispose();
  2470. this.sounds = null;
  2471. for (e = this.files.iterator(); e.hasNext();) e.next().dispose();
  2472. this.files = null;
  2473. this.loader.onDisposed()
  2474. }
  2475. },
  2476. __class__: bt
  2477. };
  2478. var wt = function(e) {
  2479. this._disposed = !1;
  2480. this._content = e
  2481. };
  2482. r["flambe.platform.BasicFile"] = wt;
  2483. wt.__name__ = ["flambe", "platform", "BasicFile"];
  2484. wt.__interfaces__ = [X];
  2485. wt.__super__ = gt;
  2486. wt.prototype = e(gt.prototype, {
  2487. toString: function() {
  2488. return this._content
  2489. },
  2490. onDisposed: function() {
  2491. this._content = null
  2492. },
  2493. __class__: wt
  2494. });
  2495. var Et = function() {};
  2496. r["flambe.subsystem.MouseSystem"] = Et;
  2497. Et.__name__ = ["flambe", "subsystem", "MouseSystem"];
  2498. var St = function(e) {
  2499. this._pointer = e;
  2500. this._source = ct.Mouse(St._sharedEvent);
  2501. this.down = new _;
  2502. this.move = new _;
  2503. this.up = new _;
  2504. this.scroll = new _;
  2505. this._y = this._x = 0;
  2506. this._cursor = ft.Default;
  2507. this._buttonStates = new Dn
  2508. };
  2509. r["flambe.platform.BasicMouse"] = St;
  2510. St.__name__ = ["flambe", "platform", "BasicMouse"];
  2511. St.__interfaces__ = [Et];
  2512. St.prototype = {
  2513. submitDown: function(e, t, n) {
  2514. this._buttonStates.exists(n) || (this._buttonStates.set(n, !0), this.prepare(e, t, Rt.toButton(n)), this._pointer.submitDown(e, t, this._source), this.down.emit(St._sharedEvent))
  2515. },
  2516. submitMove: function(e, t) {
  2517. this.prepare(e, t, null);
  2518. this._pointer.submitMove(e, t, this._source);
  2519. this.move.emit(St._sharedEvent)
  2520. },
  2521. submitUp: function(e, t, n) {
  2522. this._buttonStates.exists(n) && (this._buttonStates.remove(n), this.prepare(e, t, Rt.toButton(n)), this._pointer.submitUp(e, t, this._source), this.up.emit(St._sharedEvent))
  2523. },
  2524. submitScroll: function(e, t, n) {
  2525. this._x = e;
  2526. this._y = t;
  2527. if (null == this.scroll._head) return !1;
  2528. this.scroll.emit(n);
  2529. return !0
  2530. },
  2531. prepare: function(e, t, n) {
  2532. this._x = e;
  2533. this._y = t;
  2534. St._sharedEvent.init(St._sharedEvent.id + 1, e, t, n)
  2535. },
  2536. __class__: St
  2537. };
  2538. var xt = function() {};
  2539. r["flambe.subsystem.PointerSystem"] = xt;
  2540. xt.__name__ = ["flambe", "subsystem", "PointerSystem"];
  2541. xt.prototype = {
  2542. __class__: xt
  2543. };
  2544. var Tt = function(e, t, n) {
  2545. null == n && (n = !1);
  2546. null == t && (t = 0);
  2547. null == e && (e = 0);
  2548. this.down = new _;
  2549. this.move = new _;
  2550. this.up = new _;
  2551. this._x = e;
  2552. this._y = t;
  2553. this._isDown = n
  2554. };
  2555. r["flambe.platform.BasicPointer"] = Tt;
  2556. Tt.__name__ = ["flambe", "platform", "BasicPointer"];
  2557. Tt.__interfaces__ = [xt];
  2558. Tt.prototype = {
  2559. submitDown: function(e, t, n) {
  2560. if (!this._isDown) {
  2561. this.submitMove(e, t, n);
  2562. this._isDown = !0;
  2563. var r = [],
  2564. i = J.hitTest(P.root, e, t);
  2565. if (null != i) {
  2566. var s = i.owner;
  2567. do {
  2568. var o = s._compMap.Sprite_0;
  2569. null != o && r.push(o);
  2570. s = s.parent
  2571. } while (null != s)
  2572. }
  2573. this.prepare(e, t, i, n);
  2574. for (e = 0; e < r.length;)
  2575. if (t = r[e], ++e, t.onPointerDown(Tt._sharedEvent), Tt._sharedEvent._stopped) return;
  2576. this.down.emit(Tt._sharedEvent)
  2577. }
  2578. },
  2579. submitMove: function(e, t, n) {
  2580. if (!(e == this._x && t == this._y)) {
  2581. var r = [],
  2582. i = J.hitTest(P.root, e, t);
  2583. if (null != i) {
  2584. var s = i.owner;
  2585. do {
  2586. var o = s._compMap.Sprite_0;
  2587. null != o && r.push(o);
  2588. s = s.parent
  2589. } while (null != s)
  2590. }
  2591. this.prepare(e, t, i, n);
  2592. for (e = 0; e < r.length;)
  2593. if (t = r[e], ++e, t.onPointerMove(Tt._sharedEvent), Tt._sharedEvent._stopped) return;
  2594. this.move.emit(Tt._sharedEvent)
  2595. }
  2596. },
  2597. submitUp: function(e, t, n) {
  2598. if (this._isDown) {
  2599. this.submitMove(e, t, n);
  2600. this._isDown = !1;
  2601. var r = [],
  2602. i = J.hitTest(P.root, e, t);
  2603. if (null != i) {
  2604. var s = i.owner;
  2605. do {
  2606. var o = s._compMap.Sprite_0;
  2607. null != o && r.push(o);
  2608. s = s.parent
  2609. } while (null != s)
  2610. }
  2611. this.prepare(e, t, i, n);
  2612. for (e = 0; e < r.length;)
  2613. if (t = r[e], ++e, t.onPointerUp(Tt._sharedEvent), Tt._sharedEvent._stopped) return;
  2614. this.up.emit(Tt._sharedEvent)
  2615. }
  2616. },
  2617. prepare: function(e, t, n, r) {
  2618. this._x = e;
  2619. this._y = t;
  2620. Tt._sharedEvent.init(Tt._sharedEvent.id + 1, e, t, n, r)
  2621. },
  2622. __class__: Tt
  2623. };
  2624. var Nt = function(e, t, n) {
  2625. this._parent = null;
  2626. this.rootX = this.rootY = 0;
  2627. this._disposed = !1;
  2628. this.root = e;
  2629. this._width = t;
  2630. this._height = n
  2631. };
  2632. r["flambe.platform.BasicTexture"] = Nt;
  2633. Nt.__name__ = ["flambe", "platform", "BasicTexture"];
  2634. Nt.__interfaces__ = [ot];
  2635. Nt.__super__ = gt;
  2636. Nt.prototype = e(gt.prototype, {
  2637. onDisposed: function() {
  2638. null == this._parent && this.root.dispose()
  2639. },
  2640. get_width: function() {
  2641. return this._width
  2642. },
  2643. get_height: function() {
  2644. return this._height
  2645. },
  2646. __class__: Nt,
  2647. __properties__: {
  2648. get_height: "get_height",
  2649. get_width: "get_width"
  2650. }
  2651. });
  2652. var Ct = function() {};
  2653. r["flambe.subsystem.TouchSystem"] = Ct;
  2654. Ct.__name__ = ["flambe", "subsystem", "TouchSystem"];
  2655. var kt = function(e, t) {
  2656. null == t && (t = 4);
  2657. this._pointer = e;
  2658. this._maxPoints = t;
  2659. this._pointMap = new Dn;
  2660. this._points = [];
  2661. this.down = new _;
  2662. this.move = new _;
  2663. this.up = new _
  2664. };
  2665. r["flambe.platform.BasicTouch"] = kt;
  2666. kt.__name__ = ["flambe", "platform", "BasicTouch"];
  2667. kt.__interfaces__ = [Ct];
  2668. kt.prototype = {
  2669. submitDown: function(e, t, n) {
  2670. if (!this._pointMap.exists(e)) {
  2671. var r = new pt(e);
  2672. r.init(t, n);
  2673. this._pointMap.set(e, r);
  2674. this._points.push(r);
  2675. null == this._pointerTouch && (this._pointerTouch = r, this._pointer.submitDown(t, n, r._source));
  2676. this.down.emit(r)
  2677. }
  2678. },
  2679. submitMove: function(e, t, n) {
  2680. e = this._pointMap.get(e);
  2681. null != e && (e.init(t, n), this._pointerTouch == e && this._pointer.submitMove(t, n, e._source), this.move.emit(e))
  2682. },
  2683. submitUp: function(e, t, n) {
  2684. var r = this._pointMap.get(e);
  2685. null != r && (r.init(t, n), this._pointMap.remove(e), l.remove(this._points, r), this._pointerTouch == r && (this._pointerTouch = null, this._pointer.submitUp(t, n, r._source)), this.up.emit(r))
  2686. },
  2687. __class__: kt
  2688. };
  2689. var Lt = function() {};
  2690. r["flambe.sound.Sound"] = Lt;
  2691. Lt.__name__ = ["flambe", "sound", "Sound"];
  2692. Lt.__interfaces__ = [R];
  2693. Lt.prototype = {
  2694. __class__: Lt
  2695. };
  2696. var At = function() {
  2697. this._disposed = !1;
  2698. this._playback = new Mt(this)
  2699. };
  2700. r["flambe.platform.DummySound"] = At;
  2701. At.__name__ = ["flambe", "platform", "DummySound"];
  2702. At.__interfaces__ = [Lt];
  2703. At.getInstance = function() {
  2704. null == At._instance && (At._instance = new At);
  2705. return At._instance
  2706. };
  2707. At.__super__ = gt;
  2708. At.prototype = e(gt.prototype, {
  2709. play: function() {
  2710. return this._playback
  2711. },
  2712. loop: function() {
  2713. return this._playback
  2714. },
  2715. onDisposed: function() {},
  2716. __class__: At
  2717. });
  2718. var Ot = function() {};
  2719. r["flambe.sound.Playback"] = Ot;
  2720. Ot.__name__ = ["flambe", "sound", "Playback"];
  2721. Ot.__interfaces__ = [E];
  2722. Ot.prototype = {
  2723. __class__: Ot
  2724. };
  2725. var Mt = function(e) {
  2726. this._sound = e;
  2727. this.volume = new D(0);
  2728. this._complete = new L(!0)
  2729. };
  2730. r["flambe.platform.DummyPlayback"] = Mt;
  2731. Mt.__name__ = ["flambe", "platform", "DummyPlayback"];
  2732. Mt.__interfaces__ = [Ot];
  2733. Mt.prototype = {
  2734. get_sound: function() {
  2735. return this._sound
  2736. },
  2737. set_paused: function() {
  2738. return !0
  2739. },
  2740. dispose: function() {},
  2741. __class__: Mt,
  2742. __properties__: {
  2743. get_sound: "get_sound",
  2744. set_paused: "set_paused"
  2745. }
  2746. };
  2747. var _t = function() {};
  2748. r["flambe.subsystem.StorageSystem"] = _t;
  2749. _t.__name__ = ["flambe", "subsystem", "StorageSystem"];
  2750. _t.prototype = {
  2751. __class__: _t
  2752. };
  2753. var Dt = function() {
  2754. this.clear()
  2755. };
  2756. r["flambe.platform.DummyStorage"] = Dt;
  2757. Dt.__name__ = ["flambe", "platform", "DummyStorage"];
  2758. Dt.__interfaces__ = [_t];
  2759. Dt.prototype = {
  2760. set: function(e, t) {
  2761. this._hash.set(e, t);
  2762. return !0
  2763. },
  2764. get: function(e, t) {
  2765. return this._hash.exists(e) ? this._hash.get(e) : t
  2766. },
  2767. clear: function() {
  2768. this._hash = new Hn
  2769. },
  2770. __class__: Dt
  2771. };
  2772. var Pt = function() {
  2773. this.down = new _;
  2774. this.move = new _;
  2775. this.up = new _
  2776. };
  2777. r["flambe.platform.DummyTouch"] = Pt;
  2778. Pt.__name__ = ["flambe", "platform", "DummyTouch"];
  2779. Pt.__interfaces__ = [Ct];
  2780. Pt.prototype = {
  2781. __class__: Pt
  2782. };
  2783. var Ht = function() {
  2784. this._entries = []
  2785. };
  2786. r["flambe.platform.EventGroup"] = Ht;
  2787. Ht.__name__ = ["flambe", "platform", "EventGroup"];
  2788. Ht.__interfaces__ = [E];
  2789. Ht.prototype = {
  2790. addListener: function(e, t, n) {
  2791. e.addEventListener(t, n, !1);
  2792. this._entries.push(new Bt(e, t, n))
  2793. },
  2794. addDisposingListener: function(e, t, n) {
  2795. var r = this;
  2796. this.addListener(e, t, function(e) {
  2797. r.dispose();
  2798. n(e)
  2799. })
  2800. },
  2801. dispose: function() {
  2802. for (var e = 0, t = this._entries; e < t.length;) {
  2803. var n = t[e];
  2804. ++e;
  2805. n.dispatcher.removeEventListener(n.type, n.listener, !1)
  2806. }
  2807. this._entries = []
  2808. },
  2809. __class__: Ht
  2810. };
  2811. var Bt = function(e, t, n) {
  2812. this.dispatcher = e;
  2813. this.type = t;
  2814. this.listener = n
  2815. };
  2816. r["flambe.platform._EventGroup.Entry"] = Bt;
  2817. Bt.__name__ = ["flambe", "platform", "_EventGroup", "Entry"];
  2818. Bt.prototype = {
  2819. __class__: Bt
  2820. };
  2821. var jt = function() {};
  2822. r["flambe.platform.InternalGraphics"] = jt;
  2823. jt.__name__ = ["flambe", "platform", "InternalGraphics"];
  2824. jt.__interfaces__ = [nt];
  2825. jt.prototype = {
  2826. __class__: jt
  2827. };
  2828. var Ft = function() {};
  2829. r["flambe.subsystem.RendererSystem"] = Ft;
  2830. Ft.__name__ = ["flambe", "subsystem", "RendererSystem"];
  2831. Ft.prototype = {
  2832. __class__: Ft
  2833. };
  2834. var It = function() {};
  2835. r["flambe.platform.InternalRenderer"] = It;
  2836. It.__name__ = ["flambe", "platform", "InternalRenderer"];
  2837. It.__interfaces__ = [Ft];
  2838. It.prototype = {
  2839. __class__: It
  2840. };
  2841. var qt = function() {
  2842. this._tickables = []
  2843. };
  2844. r["flambe.platform.MainLoop"] = qt;
  2845. qt.__name__ = ["flambe", "platform", "MainLoop"];
  2846. qt.updateEntity = function(e, t) {
  2847. var n = e._compMap.SpeedAdjuster_6;
  2848. if (null != n && (n._realDt = t, t *= n.scale._value, 0 >= t)) {
  2849. n.onUpdate(t);
  2850. return
  2851. }
  2852. for (n = e.firstComponent; null != n;) {
  2853. var r = n.next;
  2854. n.onUpdate(t);
  2855. n = r
  2856. }
  2857. for (n = e.firstChild; null != n;) r = n.next, qt.updateEntity(n, t), n = r
  2858. };
  2859. qt.prototype = {
  2860. update: function(e) {
  2861. if (!(0 >= e)) {
  2862. 1 < e && (e = 1);
  2863. for (var t = 0; t < this._tickables.length;) {
  2864. var n = this._tickables[t];
  2865. null == n || n.update(e) ? this._tickables.splice(t, 1) : ++t
  2866. }
  2867. P.volume.update(e);
  2868. qt.updateEntity(P.root, e)
  2869. }
  2870. },
  2871. render: function(e) {
  2872. var t = e.graphics;
  2873. null != t && (e.willRender(), J.render(P.root, t), e.didRender())
  2874. },
  2875. addTickable: function(e) {
  2876. this._tickables.push(e)
  2877. },
  2878. __class__: qt
  2879. };
  2880. var Rt = function() {};
  2881. r["flambe.platform.MouseCodes"] = Rt;
  2882. Rt.__name__ = ["flambe", "platform", "MouseCodes"];
  2883. Rt.toButton = function(e) {
  2884. switch (e) {
  2885. case 0:
  2886. return at.Left;
  2887. case 1:
  2888. return at.Middle;
  2889. case 2:
  2890. return at.Right
  2891. }
  2892. return at.Unknown(e)
  2893. };
  2894. var Ut = function() {};
  2895. r["flambe.platform.TextureRoot"] = Ut;
  2896. Ut.__name__ = ["flambe", "platform", "TextureRoot"];
  2897. var zt = function() {};
  2898. r["flambe.platform.Tickable"] = zt;
  2899. zt.__name__ = ["flambe", "platform", "Tickable"];
  2900. zt.prototype = {
  2901. __class__: zt
  2902. };
  2903. var Wt = function(e) {
  2904. this._firstDraw = !1;
  2905. this._canvasCtx = e.getContext("2d")
  2906. };
  2907. r["flambe.platform.html.CanvasGraphics"] = Wt;
  2908. Wt.__name__ = ["flambe", "platform", "html", "CanvasGraphics"];
  2909. Wt.__interfaces__ = [jt];
  2910. Wt.prototype = {
  2911. save: function() {
  2912. this._canvasCtx.save()
  2913. },
  2914. transform: function(e, t, n, r, i, s) {
  2915. this._canvasCtx.transform(e, t, n, r, i, s)
  2916. },
  2917. restore: function() {
  2918. this._canvasCtx.restore()
  2919. },
  2920. drawTexture: function(e, t, n) {
  2921. this.drawSubTexture(e, t, n, 0, 0, e.get_width(), e.get_height())
  2922. },
  2923. drawSubTexture: function(e, t, n, r, i, s, o) {
  2924. this._firstDraw ? (this._firstDraw = !1, this._canvasCtx.globalCompositeOperation = "copy", this.drawSubTexture(e, t, n, r, i, s, o), this._canvasCtx.globalCompositeOperation = "source-over") : this._canvasCtx.drawImage(e.root.image, e.rootX + r | 0, e.rootY + i | 0, s | 0, o | 0, t | 0, n | 0, s | 0, o | 0)
  2925. },
  2926. fillRect: function(e, t, n, r, i) {
  2927. if (this._firstDraw) this._firstDraw = !1, this._canvasCtx.globalCompositeOperation = "copy", this.fillRect(e, t, n, r, i), this._canvasCtx.globalCompositeOperation = "source-over";
  2928. else {
  2929. for (e = (16777215 & e).toString(16); 6 > e.length;) e = "0" + m.string(e);
  2930. this._canvasCtx.fillStyle = "#" + m.string(e);
  2931. this._canvasCtx.fillRect(t | 0, n | 0, r | 0, i | 0)
  2932. }
  2933. },
  2934. multiplyAlpha: function(e) {
  2935. this._canvasCtx.globalAlpha *= e
  2936. },
  2937. setBlendMode: function(e) {
  2938. var t;
  2939. switch (e[1]) {
  2940. case 0:
  2941. t = "source-over";
  2942. break;
  2943. case 1:
  2944. t = "lighter";
  2945. break;
  2946. case 2:
  2947. t = "destination-in";
  2948. break;
  2949. case 3:
  2950. t = "copy"
  2951. }
  2952. this._canvasCtx.globalCompositeOperation = t
  2953. },
  2954. applyScissor: function(e, t, n, r) {
  2955. this._canvasCtx.beginPath();
  2956. this._canvasCtx.rect(e | 0, t | 0, n | 0, r | 0);
  2957. this._canvasCtx.clip()
  2958. },
  2959. willRender: function() {
  2960. this._firstDraw = !0
  2961. },
  2962. didRender: function() {},
  2963. __class__: Wt
  2964. };
  2965. var Xt = function(e) {
  2966. this.graphics = new Wt(e);
  2967. this._hasGPU = new L(!0)
  2968. };
  2969. r["flambe.platform.html.CanvasRenderer"] = Xt;
  2970. Xt.__name__ = ["flambe", "platform", "html", "CanvasRenderer"];
  2971. Xt.__interfaces__ = [It];
  2972. Xt.prototype = {
  2973. get_type: function() {
  2974. return Sn.Canvas
  2975. },
  2976. createTextureFromImage: function(e) {
  2977. e = new $t(Xt.CANVAS_TEXTURES ? tn.createCanvas(e) : e);
  2978. return e.createTexture(e.width, e.height)
  2979. },
  2980. getCompressedTextureFormats: function() {
  2981. return []
  2982. },
  2983. createCompressedTexture: function() {
  2984. return null
  2985. },
  2986. willRender: function() {
  2987. this.graphics.willRender()
  2988. },
  2989. didRender: function() {
  2990. this.graphics.didRender()
  2991. },
  2992. __class__: Xt,
  2993. __properties__: {
  2994. get_type: "get_type"
  2995. }
  2996. };
  2997. var Vt = function(e, t, n) {
  2998. Nt.call(this, e, t, n)
  2999. };
  3000. r["flambe.platform.html.CanvasTexture"] = Vt;
  3001. Vt.__name__ = ["flambe", "platform", "html", "CanvasTexture"];
  3002. Vt.__super__ = Nt;
  3003. Vt.prototype = e(Nt.prototype, {
  3004. __class__: Vt
  3005. });
  3006. var $t = function(e) {
  3007. this._graphics = null;
  3008. this._disposed = !1;
  3009. this.image = e;
  3010. this.width = e.width;
  3011. this.height = e.height
  3012. };
  3013. r["flambe.platform.html.CanvasTextureRoot"] = $t;
  3014. $t.__name__ = ["flambe", "platform", "html", "CanvasTextureRoot"];
  3015. $t.__interfaces__ = [Ut];
  3016. $t.__super__ = gt;
  3017. $t.prototype = e(gt.prototype, {
  3018. createTexture: function(e, t) {
  3019. return new Vt(this, e, t)
  3020. },
  3021. onDisposed: function() {
  3022. this._graphics = this.image = null
  3023. },
  3024. __class__: $t
  3025. });
  3026. var Jt = function(e, t) {
  3027. yt.call(this, e, t)
  3028. };
  3029. r["flambe.platform.html.HtmlAssetPackLoader"] = Jt;
  3030. Jt.__name__ = ["flambe", "platform", "html", "HtmlAssetPackLoader"];
  3031. Jt.detectImageFormats = function(e) {
  3032. var t = [U.PNG, U.JPG, U.GIF],
  3033. n = 2,
  3034. r;
  3035. r = window.document.createElement("img");
  3036. r.onload = r.onerror = function() {
  3037. 1 == r.width && t.unshift(U.WEBP);
  3038. --n;
  3039. 0 == n && e(t)
  3040. };
  3041. r.src = "data:image/webp;base64,UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==";
  3042. var i;
  3043. i = window.document.createElement("img");
  3044. i.onload = i.onerror = function() {
  3045. 1 == i.width && t.unshift(U.JXR);
  3046. --n;
  3047. 0 == n && e(t)
  3048. };
  3049. i.src = "data:image/vnd.ms-photo;base64,SUm8AQgAAAAFAAG8AQAQAAAASgAAAIC8BAABAAAAAQAAAIG8BAABAAAAAQAAAMC8BAABAAAAWgAAAMG8BAABAAAAHwAAAAAAAAAkw91vA07+S7GFPXd2jckNV01QSE9UTwAZAYBxAAAAABP/gAAEb/8AAQAAAQAAAA=="
  3050. };
  3051. Jt.detectAudioFormats = function() {
  3052. var e;
  3053. e = window.document.createElement("audio");
  3054. if (null == e || null == n(e, e.canPlayType)) return [];
  3055. var t = new s("\\b(iPhone|iPod|iPad|Android|Windows Phone)\\b", ""),
  3056. r = window.navigator.userAgent;
  3057. if (!nn.get_supported() && t.match(r)) return [];
  3058. for (var t = [{
  3059. format: U.M4A,
  3060. mimeType: "audio/mp4; codecs=mp4a"
  3061. }, {
  3062. format: U.MP3,
  3063. mimeType: "audio/mpeg"
  3064. }, {
  3065. format: U.OPUS,
  3066. mimeType: "audio/ogg; codecs=opus"
  3067. }, {
  3068. format: U.OGG,
  3069. mimeType: "audio/ogg; codecs=vorbis"
  3070. }, {
  3071. format: U.WAV,
  3072. mimeType: "audio/wav"
  3073. }], r = [], i = 0; i < t.length;) {
  3074. var o = t[i];
  3075. ++i;
  3076. var u = "";
  3077. try {
  3078. u = e.canPlayType(o.mimeType)
  3079. } catch (a) {}
  3080. "" != u && r.push(o.format)
  3081. }
  3082. return r
  3083. };
  3084. Jt.supportsBlob = function() {
  3085. if (Jt._detectBlobSupport) {
  3086. Jt._detectBlobSupport = !1;
  3087. if ((new s("\\bSilk\\b", "")).match(window.navigator.userAgent) || null == window.Blob) return !1;
  3088. var e = new XMLHttpRequest;
  3089. e.open("GET", ".", !0);
  3090. if ("" != e.responseType) return !1;
  3091. e.responseType = "blob";
  3092. if ("blob" != e.responseType) return !1;
  3093. Jt._URL = tn.loadExtension("URL").value
  3094. }
  3095. return null != Jt._URL && null != Jt._URL.createObjectURL
  3096. };
  3097. Jt.__super__ = yt;
  3098. Jt.prototype = e(yt.prototype, {
  3099. loadEntry: function(e, t) {
  3100. var n = this;
  3101. switch (t.format[1]) {
  3102. case 0:
  3103. case 1:
  3104. case 2:
  3105. case 3:
  3106. case 4:
  3107. var r;
  3108. r = window.document.createElement("img");
  3109. var i = new Ht;
  3110. i.addDisposingListener(r, "load", function() {
  3111. Jt.supportsBlob() && Jt._URL.revokeObjectURL(r.src);
  3112. var e = n._platform.getRenderer().createTextureFromImage(r);
  3113. null != e ? n.handleLoad(t, e) : n.handleTextureError(t)
  3114. });
  3115. i.addDisposingListener(r, "error", function() {
  3116. n.handleError(t, "Failed to load image")
  3117. });
  3118. Jt.supportsBlob() ? this.download(e, t, "blob", function(e) {
  3119. r.src = Jt._URL.createObjectURL(e)
  3120. }) : r.src = e;
  3121. break;
  3122. case 5:
  3123. case 6:
  3124. case 7:
  3125. this.download(e, t, "arraybuffer", function() {
  3126. var e = n._platform.getRenderer().createCompressedTexture(t.format, null);
  3127. null != e ? n.handleLoad(t, e) : n.handleTextureError(t)
  3128. });
  3129. break;
  3130. case 8:
  3131. case 9:
  3132. case 10:
  3133. case 11:
  3134. case 12:
  3135. if (nn.get_supported()) this.download(e, t, "arraybuffer", function(e) {
  3136. nn.ctx.decodeAudioData(e, function(e) {
  3137. n.handleLoad(t, new nn(e))
  3138. }, function() {
  3139. n.handleLoad(t, At.getInstance())
  3140. })
  3141. });
  3142. else {
  3143. var s;
  3144. s = window.document.createElement("audio");
  3145. s.preload = "auto";
  3146. var o = ++Jt._mediaRefCount;
  3147. null == Jt._mediaElements && (Jt._mediaElements = new Dn);
  3148. Jt._mediaElements.set(o, s);
  3149. i = new Ht;
  3150. i.addDisposingListener(s, "canplaythrough", function() {
  3151. Jt._mediaElements.remove(o);
  3152. n.handleLoad(t, new Qt(s))
  3153. });
  3154. i.addDisposingListener(s, "error", function() {
  3155. Jt._mediaElements.remove(o);
  3156. var e = s.error.code;
  3157. 3 == e || 4 == e ? n.handleLoad(t, At.getInstance()) : n.handleError(t, "Failed to load audio: " + s.error.code)
  3158. });
  3159. i.addListener(s, "progress", function() {
  3160. if (0 < s.buffered.length && 0 < s.duration) {
  3161. var e = s.buffered.end(0) / s.duration;
  3162. n.handleProgress(t, e * t.bytes | 0)
  3163. }
  3164. });
  3165. s.src = e;
  3166. s.load()
  3167. }
  3168. break;
  3169. case 13:
  3170. this.download(e, t, "text", function(e) {
  3171. n.handleLoad(t, new wt(e))
  3172. })
  3173. }
  3174. },
  3175. getAssetFormats: function(e) {
  3176. var t = this;
  3177. null == Jt._supportedFormats && (Jt._supportedFormats = new kn, Jt.detectImageFormats(function(e) {
  3178. Jt._supportedFormats.set_result(t._platform.getRenderer().getCompressedTextureFormats().concat(e).concat(Jt.detectAudioFormats()).concat([U.Data]))
  3179. }));
  3180. Jt._supportedFormats.get(e)
  3181. },
  3182. download: function(e, t, n, r) {
  3183. var i = this,
  3184. s = null,
  3185. o = null,
  3186. u = 0,
  3187. a = !1,
  3188. f = function() {
  3189. a && (a = !1, window.clearInterval(u))
  3190. },
  3191. l = 3,
  3192. c = function() {
  3193. --l;
  3194. return 0 <= l ? (o(), !0) : !1
  3195. },
  3196. o = function() {
  3197. f();
  3198. null != s && s.abort();
  3199. s = new XMLHttpRequest;
  3200. s.open("GET", e, !0);
  3201. s.responseType = n;
  3202. var o = 0;
  3203. s.onprogress = function(e) {
  3204. a || (a = !0, u = window.setInterval(function() {
  3205. 4 != s.readyState && 5e3 < Date.now() - o && !c() && (f(), i.handleError(t, "Download stalled"))
  3206. }, 1e3));
  3207. o = Date.now();
  3208. i.handleProgress(t, e.loaded)
  3209. };
  3210. s.onerror = function() {
  3211. if (0 != s.status || !c()) f(), i.handleError(t, "HTTP error " + s.status)
  3212. };
  3213. s.onload = function() {
  3214. var e = s.response;
  3215. null == e && (e = s.responseText);
  3216. f();
  3217. r(e)
  3218. };
  3219. s.send()
  3220. };
  3221. o()
  3222. },
  3223. __class__: Jt
  3224. });
  3225. var Kt = function(e, t) {
  3226. St.call(this, e);
  3227. this._canvas = t
  3228. };
  3229. r["flambe.platform.html.HtmlMouse"] = Kt;
  3230. Kt.__name__ = ["flambe", "platform", "html", "HtmlMouse"];
  3231. Kt.__super__ = St;
  3232. Kt.prototype = e(St.prototype, {
  3233. __class__: Kt
  3234. });
  3235. var Qt = function(e) {
  3236. this._disposed = !1;
  3237. this.audioElement = e
  3238. };
  3239. r["flambe.platform.html.HtmlSound"] = Qt;
  3240. Qt.__name__ = ["flambe", "platform", "html", "HtmlSound"];
  3241. Qt.__interfaces__ = [Lt];
  3242. Qt.__super__ = gt;
  3243. Qt.prototype = e(gt.prototype, {
  3244. play: function(e) {
  3245. null == e && (e = 1);
  3246. return new Gt(this, e, !1)
  3247. },
  3248. loop: function(e) {
  3249. null == e && (e = 1);
  3250. return new Gt(this, e, !0)
  3251. },
  3252. onDisposed: function() {
  3253. this.audioElement = null
  3254. },
  3255. __class__: Qt
  3256. });
  3257. var Gt = function(e, t, n) {
  3258. var r = this;
  3259. this._sound = e;
  3260. this._tickableAdded = !1;
  3261. this._clonedElement = window.document.createElement("audio");
  3262. this._clonedElement.loop = n;
  3263. this._clonedElement.src = e.audioElement.src;
  3264. this.volume = new D(t, function() {
  3265. r.updateVolume()
  3266. });
  3267. this.updateVolume();
  3268. this._complete = new L(!1);
  3269. this.playAudio();
  3270. P.hidden._value && this.set_paused(!0)
  3271. };
  3272. r["flambe.platform.html._HtmlSound.HtmlPlayback"] = Gt;
  3273. Gt.__name__ = ["flambe", "platform", "html", "_HtmlSound", "HtmlPlayback"];
  3274. Gt.__interfaces__ = [zt, Ot];
  3275. Gt.prototype = {
  3276. get_sound: function() {
  3277. return this._sound
  3278. },
  3279. set_paused: function(e) {
  3280. this._clonedElement.paused != e && (e ? this._clonedElement.pause() : this.playAudio());
  3281. return e
  3282. },
  3283. update: function(e) {
  3284. this.volume.update(e);
  3285. this._complete.set__(this._clonedElement.ended);
  3286. return this._complete._value || this._clonedElement.paused ? (this._tickableAdded = !1, this._volumeBinding.dispose(), this._hideBinding.dispose(), !0) : !1
  3287. },
  3288. dispose: function() {
  3289. this.set_paused(!0);
  3290. this._complete.set__(!0)
  3291. },
  3292. playAudio: function() {
  3293. var e = this;
  3294. this._clonedElement.play();
  3295. this._tickableAdded || (k.instance.mainLoop.addTickable(this), this._tickableAdded = !0, this._volumeBinding = P.volume.get_changed().connect(function() {
  3296. e.updateVolume()
  3297. }), this._hideBinding = P.hidden.get_changed().connect(function(t) {
  3298. t ? (e._wasPaused = e._clonedElement.paused, e.set_paused(!0)) : e.set_paused(e._wasPaused)
  3299. }))
  3300. },
  3301. updateVolume: function() {
  3302. this._clonedElement.volume = P.volume._value * this.volume._value
  3303. },
  3304. __class__: Gt,
  3305. __properties__: {
  3306. get_sound: "get_sound",
  3307. set_paused: "set_paused"
  3308. }
  3309. };
  3310. var Yt = function() {};
  3311. r["flambe.subsystem.StageSystem"] = Yt;
  3312. Yt.__name__ = ["flambe", "subsystem", "StageSystem"];
  3313. Yt.prototype = {
  3314. __class__: Yt
  3315. };
  3316. var Zt = function(e) {
  3317. var t = this;
  3318. this._canvas = e;
  3319. this.resize = new Ln;
  3320. this.scaleFactor = Zt.computeScaleFactor();
  3321. 1 != this.scaleFactor && (tn.setVendorStyle(this._canvas, "transform-origin", "top left"), tn.setVendorStyle(this._canvas, "transform", "scale(" + 1 / this.scaleFactor + ")"));
  3322. tn.SHOULD_HIDE_MOBILE_BROWSER && (window.addEventListener("orientationchange", function() {
  3323. tn.callLater(n(t, t.hideMobileBrowser), 200)
  3324. }, !1), this.hideMobileBrowser());
  3325. window.addEventListener("resize", n(this, this.onWindowResize), !1);
  3326. this.onWindowResize(null);
  3327. this.orientation = new L(null);
  3328. null != window.orientation && (window.addEventListener("orientationchange", n(this, this.onOrientationChange), !1), this.onOrientationChange(null));
  3329. this.fullscreen = new L(!1);
  3330. tn.addVendorListener(window.document, "fullscreenchange", function() {
  3331. t.updateFullscreen()
  3332. }, !1);
  3333. this.updateFullscreen()
  3334. };
  3335. r["flambe.platform.html.HtmlStage"] = Zt;
  3336. Zt.__name__ = ["flambe", "platform", "html", "HtmlStage"];
  3337. Zt.__interfaces__ = [Yt];
  3338. Zt.computeScaleFactor = function() {
  3339. var e = window.devicePixelRatio;
  3340. null == e && (e = 1);
  3341. var t = window.document.createElement("canvas").getContext("2d"),
  3342. t = tn.loadExtension("backingStorePixelRatio", t).value;
  3343. null == t && (t = 1);
  3344. e /= t;
  3345. t = window.screen.height;
  3346. return 1536 < e * window.screen.width || 1536 < e * t ? 1 : e
  3347. };
  3348. Zt.prototype = {
  3349. get_width: function() {
  3350. return this._canvas.width
  3351. },
  3352. get_height: function() {
  3353. return this._canvas.height
  3354. },
  3355. lockOrientation: function(e) {
  3356. var t = tn.loadExtension("lockOrientation", window.screen).value;
  3357. if (null != t) {
  3358. var n;
  3359. switch (e[1]) {
  3360. case 0:
  3361. n = "portrait";
  3362. break;
  3363. case 1:
  3364. n = "landscape"
  3365. }
  3366. t.apply(window.screen, [n]) || null
  3367. }
  3368. },
  3369. requestFullscreen: function(e) {
  3370. null == e && (e = !0);
  3371. if (e) {
  3372. var e = window.document.documentElement,
  3373. t = tn.loadFirstExtension(["requestFullscreen", "requestFullScreen"], e).value;
  3374. null != t && t.apply(e, [])
  3375. } else e = tn.loadFirstExtension(["cancelFullscreen", "cancelFullScreen"], window.document).value, null != e && v.callMethod(window.document, e, [])
  3376. },
  3377. onWindowResize: function() {
  3378. var e = this._canvas.parentElement.getBoundingClientRect();
  3379. this.resizeCanvas(e.width, e.height)
  3380. },
  3381. resizeCanvas: function(e, t) {
  3382. var n = this.scaleFactor * e,
  3383. r = this.scaleFactor * t;
  3384. if (this._canvas.width == n && this._canvas.height == r) return !1;
  3385. this._canvas.width = n | 0;
  3386. this._canvas.height = r | 0;
  3387. this.resize.emit();
  3388. return !0
  3389. },
  3390. hideMobileBrowser: function() {
  3391. var e = this,
  3392. t = window.document.documentElement.style;
  3393. t.height = window.innerHeight + 100 + "px";
  3394. t.width = window.innerWidth + "px";
  3395. t.overflow = "visible";
  3396. tn.callLater(function() {
  3397. tn.hideMobileBrowser();
  3398. tn.callLater(function() {
  3399. t.height = window.innerHeight + "px";
  3400. e.onWindowResize(null)
  3401. }, 100)
  3402. })
  3403. },
  3404. onOrientationChange: function() {
  3405. this.orientation.set__(tn.orientation(window.orientation))
  3406. },
  3407. updateFullscreen: function() {
  3408. this.fullscreen.set__(!0 == tn.loadFirstExtension(["fullscreen", "fullScreen", "isFullScreen"], window.document).value)
  3409. },
  3410. __class__: Zt,
  3411. __properties__: {
  3412. get_height: "get_height",
  3413. get_width: "get_width"
  3414. }
  3415. };
  3416. var en = function(e) {
  3417. this._storage = e
  3418. };
  3419. r["flambe.platform.html.HtmlStorage"] = en;
  3420. en.__name__ = ["flambe", "platform", "html", "HtmlStorage"];
  3421. en.__interfaces__ = [_t];
  3422. en.prototype = {
  3423. set: function(e, t) {
  3424. var n;
  3425. try {
  3426. var r = new Mn;
  3427. r.useCache = !0;
  3428. r.useEnumIndex = !1;
  3429. r.serialize(t);
  3430. n = r.toString()
  3431. } catch (i) {
  3432. return !1
  3433. }
  3434. try {
  3435. this._storage.setItem("flambe:" + e, n)
  3436. } catch (s) {
  3437. return !1
  3438. }
  3439. return !0
  3440. },
  3441. get: function(e, t) {
  3442. var n = null;
  3443. try {
  3444. n = this._storage.getItem("flambe:" + e)
  3445. } catch (r) {
  3446. null
  3447. }
  3448. if (null != n) try {
  3449. return _n.run(n)
  3450. } catch (i) {
  3451. null
  3452. }
  3453. return t
  3454. },
  3455. __class__: en
  3456. };
  3457. var tn = function() {};
  3458. r["flambe.platform.html.HtmlUtil"] = tn;
  3459. tn.__name__ = ["flambe", "platform", "html", "HtmlUtil"];
  3460. tn.callLater = function(e, t) {
  3461. null == t && (t = 0);
  3462. window.setTimeout(e, t)
  3463. };
  3464. tn.hideMobileBrowser = function() {
  3465. window.scrollTo(1, 0)
  3466. };
  3467. tn.loadExtension = function(e, t) {
  3468. null == t && (t = window);
  3469. var n = v.field(t, e);
  3470. if (null != n) return {
  3471. prefix: "",
  3472. field: e,
  3473. value: n
  3474. };
  3475. for (var n = e.charAt(0).toUpperCase() + l.substr(e, 1, null), r = 0, i = tn.VENDOR_PREFIXES; r < i.length;) {
  3476. var s = i[r];
  3477. ++r;
  3478. var o = s + n,
  3479. u = v.field(t, o);
  3480. if (null != u) return {
  3481. prefix: s,
  3482. field: o,
  3483. value: u
  3484. }
  3485. }
  3486. return {
  3487. prefix: null,
  3488. field: null,
  3489. value: null
  3490. }
  3491. };
  3492. tn.loadFirstExtension = function(e, t) {
  3493. for (var n = 0; n < e.length;) {
  3494. var r = e[n];
  3495. ++n;
  3496. r = tn.loadExtension(r, t);
  3497. if (null != r.field) return r
  3498. }
  3499. return {
  3500. prefix: null,
  3501. field: null,
  3502. value: null
  3503. }
  3504. };
  3505. tn.polyfill = function(e, t) {
  3506. null == t && (t = window);
  3507. var n = tn.loadExtension(e, t).value;
  3508. if (null == n) return !1;
  3509. t[e] = n;
  3510. return !0
  3511. };
  3512. tn.setVendorStyle = function(e, t, n) {
  3513. for (var e = e.style, r = 0, i = tn.VENDOR_PREFIXES; r < i.length;) {
  3514. var s = i[r];
  3515. ++r;
  3516. e.setProperty("-" + s + "-" + t, n)
  3517. }
  3518. e.setProperty(t, n)
  3519. };
  3520. tn.addVendorListener = function(e, t, n, r) {
  3521. for (var i = 0, s = tn.VENDOR_PREFIXES; i < s.length;) {
  3522. var o = s[i];
  3523. ++i;
  3524. e.addEventListener(o + t, n, r)
  3525. }
  3526. e.addEventListener(t, n, r)
  3527. };
  3528. tn.orientation = function(e) {
  3529. switch (e) {
  3530. case -90:
  3531. case 90:
  3532. return it.Landscape;
  3533. default:
  3534. return it.Portrait
  3535. }
  3536. };
  3537. tn.createEmptyCanvas = function(e, t) {
  3538. var n;
  3539. n = window.document.createElement("canvas");
  3540. n.width = e;
  3541. n.height = t;
  3542. return n
  3543. };
  3544. tn.createCanvas = function(e) {
  3545. var t = tn.createEmptyCanvas(e.width, e.height),
  3546. n = t.getContext("2d");
  3547. n.save();
  3548. n.globalCompositeOperation = "copy";
  3549. n.drawImage(e, 0, 0);
  3550. n.restore();
  3551. return t
  3552. };
  3553. tn.fixAndroidMath = function() {
  3554. if (0 <= window.navigator.userAgent.indexOf("Linux; U; Android 4")) {
  3555. var e = Math.sin,
  3556. t = Math.cos;
  3557. Math.sin = function(t) {
  3558. return 0 == t ? 0 : e(t)
  3559. };
  3560. Math.cos = function(e) {
  3561. return 0 == e ? 1 : t(e)
  3562. }
  3563. }
  3564. };
  3565. var nn = function(e) {
  3566. this._disposed = !1;
  3567. this.buffer = e
  3568. };
  3569. r["flambe.platform.html.WebAudioSound"] = nn;
  3570. nn.__name__ = ["flambe", "platform", "html", "WebAudioSound"];
  3571. nn.__interfaces__ = [Lt];
  3572. nn.__properties__ = {
  3573. get_supported: "get_supported"
  3574. };
  3575. nn.get_supported = function() {
  3576. if (nn._detectSupport) {
  3577. nn._detectSupport = !1;
  3578. var e = tn.loadExtension("AudioContext").value;
  3579. null != e && (nn.ctx = new e, nn.gain = nn.createGain(), nn.gain.connect(nn.ctx.destination), P.volume.watch(function(e) {
  3580. nn.gain.gain.value = e
  3581. }))
  3582. }
  3583. return null != nn.ctx
  3584. };
  3585. nn.createGain = function() {
  3586. return null != nn.ctx.createGain ? nn.ctx.createGain() : nn.ctx.createGainNode()
  3587. };
  3588. nn.start = function(e, t) {
  3589. null != e.start ? e.start(t) : e.noteOn(t)
  3590. };
  3591. nn.__super__ = gt;
  3592. nn.prototype = e(gt.prototype, {
  3593. play: function(e) {
  3594. null == e && (e = 1);
  3595. return new rn(this, e, !1)
  3596. },
  3597. loop: function(e) {
  3598. null == e && (e = 1);
  3599. return new rn(this, e, !0)
  3600. },
  3601. get_duration: function() {
  3602. return this.buffer.duration
  3603. },
  3604. onDisposed: function() {
  3605. this.buffer = null
  3606. },
  3607. __class__: nn,
  3608. __properties__: {
  3609. get_duration: "get_duration"
  3610. }
  3611. });
  3612. var rn = function(e, t, n) {
  3613. var r = this;
  3614. this._sound = e;
  3615. this._head = nn.gain;
  3616. this._complete = new L(!1);
  3617. this._sourceNode = nn.ctx.createBufferSource();
  3618. this._sourceNode.buffer = e.buffer;
  3619. this._sourceNode.loop = n;
  3620. this._sourceNode.onended = function() {
  3621. r._complete.set__(!0)
  3622. };
  3623. nn.start(this._sourceNode, 0);
  3624. this.playAudio();
  3625. this.volume = new D(t, function(e) {
  3626. r.setVolume(e)
  3627. });
  3628. 1 != t && this.setVolume(t);
  3629. P.hidden._value && this.set_paused(!0)
  3630. };
  3631. r["flambe.platform.html._WebAudioSound.WebAudioPlayback"] = rn;
  3632. rn.__name__ = ["flambe", "platform", "html", "_WebAudioSound", "WebAudioPlayback"];
  3633. rn.__interfaces__ = [zt, Ot];
  3634. rn.prototype = {
  3635. get_sound: function() {
  3636. return this._sound
  3637. },
  3638. set_paused: function(e) {
  3639. e != 0 <= this._pausedAt && (e ? (this._sourceNode.disconnect(), this._pausedAt = this.get_position()) : this.playAudio());
  3640. return e
  3641. },
  3642. get_position: function() {
  3643. return this._complete._value ? this._sound.get_duration() : 0 <= this._pausedAt ? this._pausedAt : (nn.ctx.currentTime - this._startedAt) % this._sound.get_duration()
  3644. },
  3645. update: function(e) {
  3646. this.volume.update(e);
  3647. 3 == this._sourceNode.playbackState && this._complete.set__(!0);
  3648. return this._complete._value || 0 <= this._pausedAt ? (this._tickableAdded = !1, this._hideBinding.dispose(), !0) : !1
  3649. },
  3650. dispose: function() {
  3651. this.set_paused(!0);
  3652. this._complete.set__(!0)
  3653. },
  3654. setVolume: function(e) {
  3655. null == this._gainNode && (this._gainNode = nn.createGain(), this.insertNode(this._gainNode));
  3656. this._gainNode.gain.value = e
  3657. },
  3658. insertNode: function(e) {
  3659. 0 <= this._pausedAt || (this._sourceNode.disconnect(), this._sourceNode.connect(e));
  3660. e.connect(this._head);
  3661. this._head = e
  3662. },
  3663. playAudio: function() {
  3664. var e = this;
  3665. this._sourceNode.connect(this._head);
  3666. this._startedAt = nn.ctx.currentTime;
  3667. this._pausedAt = -1;
  3668. this._tickableAdded || (k.instance.mainLoop.addTickable(this), this._tickableAdded = !0, this._hideBinding = P.hidden.get_changed().connect(function(t) {
  3669. t ? (e._wasPaused = 0 <= e._pausedAt, e.set_paused(!0)) : e.set_paused(e._wasPaused)
  3670. }))
  3671. },
  3672. __class__: rn,
  3673. __properties__: {
  3674. get_position: "get_position",
  3675. get_sound: "get_sound",
  3676. set_paused: "set_paused"
  3677. }
  3678. };
  3679. var sn = function() {
  3680. this._width = this._height = -1;
  3681. this._transitor = null;
  3682. this.scenes = [];
  3683. this.occludedScenes = [];
  3684. this._root = new T
  3685. };
  3686. r["flambe.scene.Director"] = sn;
  3687. sn.__name__ = ["flambe", "scene", "Director"];
  3688. sn.__super__ = S;
  3689. sn.prototype = e(S.prototype, {
  3690. get_name: function() {
  3691. return "Director_5"
  3692. },
  3693. setSize: function(e, t) {
  3694. this._width = e;
  3695. this._height = t;
  3696. return this
  3697. },
  3698. pushScene: function(e, t) {
  3699. var n = this;
  3700. this.completeTransition();
  3701. var r = this.get_topScene();
  3702. null != r ? this.playTransition(r, e, t, function() {
  3703. n.hide(r)
  3704. }) : (this.add(e), this.invalidateVisibility())
  3705. },
  3706. popScene: function(e) {
  3707. var t = this;
  3708. this.completeTransition();
  3709. var n = this.get_topScene();
  3710. if (null != n) {
  3711. this.scenes.pop();
  3712. var r = this.get_topScene();
  3713. null != r ? this.playTransition(n, r, e, function() {
  3714. t.hideAndDispose(n)
  3715. }) : (this.hideAndDispose(n), this.invalidateVisibility())
  3716. }
  3717. },
  3718. unwindToScene: function(e, t) {
  3719. var n = this;
  3720. this.completeTransition();
  3721. var r = this.get_topScene();
  3722. if (null != r) {
  3723. if (r != e) {
  3724. for (this.scenes.pop(); 0 < this.scenes.length && this.scenes[this.scenes.length - 1] != e;) this.scenes.pop().dispose();
  3725. this.playTransition(r, e, t, function() {
  3726. n.hideAndDispose(r)
  3727. })
  3728. }
  3729. } else this.pushScene(e, t)
  3730. },
  3731. onAdded: function() {
  3732. this.owner.addChild(this._root)
  3733. },
  3734. onRemoved: function() {
  3735. this.completeTransition();
  3736. for (var e = 0, t = this.scenes; e < t.length;) {
  3737. var n = t[e];
  3738. ++e;
  3739. n.dispose()
  3740. }
  3741. this.scenes = [];
  3742. this.occludedScenes = [];
  3743. this._root.dispose()
  3744. },
  3745. onUpdate: function(e) {
  3746. null != this._transitor && this._transitor.update(e) && this.completeTransition()
  3747. },
  3748. get_topScene: function() {
  3749. var e = this.scenes.length;
  3750. return 0 < e ? this.scenes[e - 1] : null
  3751. },
  3752. add: function(e) {
  3753. var t = this.get_topScene();
  3754. null != t && this._root.removeChild(t);
  3755. l.remove(this.scenes, e);
  3756. this.scenes.push(e);
  3757. this._root.addChild(e)
  3758. },
  3759. hide: function(e) {
  3760. e = e._compMap.Scene_4;
  3761. null != e && e.hidden.emit()
  3762. },
  3763. hideAndDispose: function(e) {
  3764. this.hide(e);
  3765. e.dispose()
  3766. },
  3767. show: function(e) {
  3768. e = e._compMap.Scene_4;
  3769. null != e && e.shown.emit()
  3770. },
  3771. invalidateVisibility: function() {
  3772. for (var e = this.scenes.length; 0 < e;) {
  3773. var t = this.scenes[--e]._compMap.Scene_4;
  3774. if (null == t || t.opaque) break
  3775. }
  3776. this.occludedScenes = 0 < this.scenes.length ? this.scenes.slice(e, this.scenes.length - 1) : [];
  3777. e = this.get_topScene();
  3778. null != e && this.show(e)
  3779. },
  3780. completeTransition: function() {
  3781. null != this._transitor && (this._transitor.complete(), this._transitor = null, this.invalidateVisibility())
  3782. },
  3783. playTransition: function(e, t, n, r) {
  3784. this.completeTransition();
  3785. this.add(t);
  3786. null != n ? (this.occludedScenes.push(e), this._transitor = new on(e, t, n, r), this._transitor.init(this)) : (r(), this.invalidateVisibility())
  3787. },
  3788. get_width: function() {
  3789. return 0 > this._width ? P._platform.getStage().get_width() : this._width
  3790. },
  3791. get_height: function() {
  3792. return 0 > this._height ? P._platform.getStage().get_height() : this._height
  3793. },
  3794. __class__: sn,
  3795. __properties__: e(S.prototype.__properties__, {
  3796. get_height: "get_height",
  3797. get_width: "get_width",
  3798. get_topScene: "get_topScene"
  3799. })
  3800. });
  3801. var on = function(e, t, n, r) {
  3802. this._from = e;
  3803. this._to = t;
  3804. this._transition = n;
  3805. this._onComplete = r
  3806. };
  3807. r["flambe.scene._Director.Transitor"] = on;
  3808. on.__name__ = ["flambe", "scene", "_Director", "Transitor"];
  3809. on.prototype = {
  3810. init: function(e) {
  3811. this._transition.init(e, this._from, this._to)
  3812. },
  3813. update: function(e) {
  3814. return this._transition.update(e)
  3815. },
  3816. complete: function() {
  3817. this._transition.complete();
  3818. this._onComplete()
  3819. },
  3820. __class__: on
  3821. };
  3822. var un = function() {};
  3823. r["flambe.scene.Transition"] = un;
  3824. un.__name__ = ["flambe", "scene", "Transition"];
  3825. un.prototype = {
  3826. init: function(e, t, n) {
  3827. this._director = e;
  3828. this._from = t;
  3829. this._to = n
  3830. },
  3831. update: function() {
  3832. return !0
  3833. },
  3834. complete: function() {},
  3835. __class__: un
  3836. };
  3837. var an = function(e, t) {
  3838. this._duration = e;
  3839. this._ease = null != t ? t : F.linear
  3840. };
  3841. r["flambe.scene.TweenTransition"] = an;
  3842. an.__name__ = ["flambe", "scene", "TweenTransition"];
  3843. an.__super__ = un;
  3844. an.prototype = e(un.prototype, {
  3845. init: function(e, t, n) {
  3846. un.prototype.init.call(this, e, t, n);
  3847. this._elapsed = 0
  3848. },
  3849. update: function(e) {
  3850. this._elapsed += e;
  3851. return this._elapsed >= this._duration
  3852. },
  3853. interp: function(e, t) {
  3854. return e + (t - e) * this._ease(this._elapsed / this._duration)
  3855. },
  3856. __class__: an
  3857. });
  3858. var fn = function(e, t) {
  3859. an.call(this, e, t)
  3860. };
  3861. r["flambe.scene.FadeTransition"] = fn;
  3862. fn.__name__ = ["flambe", "scene", "FadeTransition"];
  3863. fn.__super__ = an;
  3864. fn.prototype = e(an.prototype, {
  3865. init: function(e, t, n) {
  3866. an.prototype.init.call(this, e, t, n);
  3867. e = this._to._compMap.Sprite_0;
  3868. null == e && this._to.add(e = new J);
  3869. e.alpha.set__(0)
  3870. },
  3871. update: function(e) {
  3872. e = an.prototype.update.call(this, e);
  3873. this._to._compMap.Sprite_0.alpha.set__(this.interp(0, 1));
  3874. return e
  3875. },
  3876. complete: function() {
  3877. this._to._compMap.Sprite_0.alpha.set__(1)
  3878. },
  3879. __class__: fn
  3880. });
  3881. var ln = function(e) {
  3882. null == e && (e = !0);
  3883. this.opaque = e;
  3884. this.shown = new Ln;
  3885. this.hidden = new Ln
  3886. };
  3887. r["flambe.scene.Scene"] = ln;
  3888. ln.__name__ = ["flambe", "scene", "Scene"];
  3889. ln.__super__ = S;
  3890. ln.prototype = e(S.prototype, {
  3891. get_name: function() {
  3892. return "Scene_4"
  3893. },
  3894. __class__: ln
  3895. });
  3896. var cn = function(e, t) {
  3897. this._direction = 2;
  3898. an.call(this, e, t)
  3899. };
  3900. r["flambe.scene.SlideTransition"] = cn;
  3901. cn.__name__ = ["flambe", "scene", "SlideTransition"];
  3902. cn.__super__ = an;
  3903. cn.prototype = e(an.prototype, {
  3904. left: function() {
  3905. this._direction = 2;
  3906. return this
  3907. },
  3908. init: function(e, t, n) {
  3909. an.prototype.init.call(this, e, t, n);
  3910. switch (this._direction) {
  3911. case 0:
  3912. this._x = 0;
  3913. this._y = -this._director.get_height();
  3914. break;
  3915. case 1:
  3916. this._x = 0;
  3917. this._y = this._director.get_height();
  3918. break;
  3919. case 2:
  3920. this._x = -this._director.get_width();
  3921. this._y = 0;
  3922. break;
  3923. case 3:
  3924. this._x = this._director.get_width(), this._y = 0
  3925. }
  3926. e = this._from._compMap.Sprite_0;
  3927. null == e && this._from.add(e = new J);
  3928. e.setXY(0, 0);
  3929. e = this._to._compMap.Sprite_0;
  3930. null == e && this._to.add(e = new J);
  3931. e.setXY(-this._x, -this._y)
  3932. },
  3933. update: function(e) {
  3934. e = an.prototype.update.call(this, e);
  3935. this._from._compMap.Sprite_0.setXY(this.interp(0, this._x), this.interp(0, this._y));
  3936. this._to._compMap.Sprite_0.setXY(this.interp(-this._x, 0), this.interp(-this._y, 0));
  3937. return e
  3938. },
  3939. complete: function() {
  3940. this._from._compMap.Sprite_0.setXY(0, 0);
  3941. this._to._compMap.Sprite_0.setXY(0, 0)
  3942. },
  3943. __class__: cn
  3944. });
  3945. var hn = function() {};
  3946. r["flambe.script.Action"] = hn;
  3947. hn.__name__ = ["flambe", "script", "Action"];
  3948. hn.prototype = {
  3949. __class__: hn
  3950. };
  3951. var pn = function(e, t, n, r) {
  3952. this._value = e;
  3953. this._to = t;
  3954. this._seconds = n;
  3955. this._easing = r
  3956. };
  3957. r["flambe.script.AnimateTo"] = pn;
  3958. pn.__name__ = ["flambe", "script", "AnimateTo"];
  3959. pn.__interfaces__ = [hn];
  3960. pn.prototype = {
  3961. update: function(e) {
  3962. null == this._tween && (this._tween = new q(this._value._value, this._to, this._seconds, this._easing), this._value.set_behavior(this._tween), this._value.update(e));
  3963. if (this._value._behavior != this._tween) {
  3964. var t = this._tween.elapsed - this._seconds;
  3965. this._tween = null;
  3966. return 0 < t ? e - t : 0
  3967. }
  3968. return -1
  3969. },
  3970. __class__: pn
  3971. };
  3972. var dn = function(e) {
  3973. this._fn = e
  3974. };
  3975. r["flambe.script.CallFunction"] = dn;
  3976. dn.__name__ = ["flambe", "script", "CallFunction"];
  3977. dn.__interfaces__ = [hn];
  3978. dn.prototype = {
  3979. update: function() {
  3980. this._fn();
  3981. return 0
  3982. },
  3983. __class__: dn
  3984. };
  3985. var vn = function(e) {
  3986. this._duration = e;
  3987. this._elapsed = 0
  3988. };
  3989. r["flambe.script.Delay"] = vn;
  3990. vn.__name__ = ["flambe", "script", "Delay"];
  3991. vn.__interfaces__ = [hn];
  3992. vn.prototype = {
  3993. update: function(e) {
  3994. this._elapsed += e;
  3995. if (this._elapsed >= this._duration) {
  3996. var t = this._elapsed - this._duration;
  3997. this._elapsed = 0;
  3998. return e - t
  3999. }
  4000. return -1
  4001. },
  4002. __class__: vn
  4003. };
  4004. var mn = function(e) {
  4005. this._completedActions = [];
  4006. this._runningActions = null != e ? e.slice() : []
  4007. };
  4008. r["flambe.script.Parallel"] = mn;
  4009. mn.__name__ = ["flambe", "script", "Parallel"];
  4010. mn.__interfaces__ = [hn];
  4011. mn.prototype = {
  4012. update: function(e, t) {
  4013. for (var n = !0, r = 0, i = 0, s = this._runningActions.length; i < s;) {
  4014. var o = i++,
  4015. u = this._runningActions[o];
  4016. if (null != u) {
  4017. var a = u.update(e, t);
  4018. 0 <= a ? (this._runningActions[o] = null, this._completedActions.push(u), a > r && (r = a)) : n = !1
  4019. }
  4020. }
  4021. return n ? (this._runningActions = this._completedActions, this._completedActions = [], r) : -1
  4022. },
  4023. __class__: mn
  4024. };
  4025. var gn = function(e, t) {
  4026. null == t && (t = -1);
  4027. this._action = e;
  4028. this._remaining = this._count = t
  4029. };
  4030. r["flambe.script.Repeat"] = gn;
  4031. gn.__name__ = ["flambe", "script", "Repeat"];
  4032. gn.__interfaces__ = [hn];
  4033. gn.prototype = {
  4034. update: function(e, t) {
  4035. if (0 == this._count) return 0;
  4036. var n = this._action.update(e, t);
  4037. return 0 < this._count && 0 <= n && 0 == --this._remaining ? (this._remaining = this._count, n) : -1
  4038. },
  4039. __class__: gn
  4040. };
  4041. var yn = function() {
  4042. this.stopAll()
  4043. };
  4044. r["flambe.script.Script"] = yn;
  4045. yn.__name__ = ["flambe", "script", "Script"];
  4046. yn.__super__ = S;
  4047. yn.prototype = e(S.prototype, {
  4048. get_name: function() {
  4049. return "Script_3"
  4050. },
  4051. run: function(e) {
  4052. e = new bn(e);
  4053. this._handles.push(e);
  4054. return e
  4055. },
  4056. stopAll: function() {
  4057. this._handles = []
  4058. },
  4059. onUpdate: function(e) {
  4060. for (var t = 0; t < this._handles.length;) {
  4061. var n = this._handles[t];
  4062. n.removed || 0 <= n.action.update(e, this.owner) ? this._handles.splice(t, 1) : ++t
  4063. }
  4064. },
  4065. __class__: yn
  4066. });
  4067. var bn = function(e) {
  4068. this.removed = !1;
  4069. this.action = e
  4070. };
  4071. r["flambe.script._Script.Handle"] = bn;
  4072. bn.__name__ = ["flambe", "script", "_Script", "Handle"];
  4073. bn.__interfaces__ = [E];
  4074. bn.prototype = {
  4075. dispose: function() {
  4076. this.removed = !0;
  4077. this.action = null
  4078. },
  4079. __class__: bn
  4080. };
  4081. var wn = function(e) {
  4082. this._idx = 0;
  4083. this._runningActions = null != e ? e.slice() : []
  4084. };
  4085. r["flambe.script.Sequence"] = wn;
  4086. wn.__name__ = ["flambe", "script", "Sequence"];
  4087. wn.__interfaces__ = [hn];
  4088. wn.prototype = {
  4089. add: function(e) {
  4090. this._runningActions.push(e)
  4091. },
  4092. update: function(e, t) {
  4093. for (var n = 0;;) {
  4094. var r = this._runningActions[this._idx];
  4095. if (null != r)
  4096. if (r = r.update(e - n, t), 0 <= r) n += r;
  4097. else return -1;
  4098. ++this._idx;
  4099. if (this._idx >= this._runningActions.length) {
  4100. this._idx = 0;
  4101. break
  4102. } else if (n > e) return -1
  4103. }
  4104. return n
  4105. },
  4106. __class__: wn
  4107. };
  4108. var En = function(e, t, n) {
  4109. this._strengthX = e;
  4110. this._strengthY = t;
  4111. this._duration = n;
  4112. this._elapsed = 0
  4113. };
  4114. r["flambe.script.Shake"] = En;
  4115. En.__name__ = ["flambe", "script", "Shake"];
  4116. En.__interfaces__ = [hn];
  4117. En.prototype = {
  4118. update: function(e, t) {
  4119. var n = t._compMap.Sprite_0;
  4120. null == this._jitterX && (this._jitterX = new I(n.x._value, this._strengthX), this._jitterY = new I(n.y._value, this._strengthY), n.x.set_behavior(this._jitterX), n.y.set_behavior(this._jitterY));
  4121. this._elapsed += e;
  4122. if (this._elapsed >= this._duration) {
  4123. var r = this._elapsed - this._duration;
  4124. n.x._behavior == this._jitterX && n.x.set__(this._jitterX.base);
  4125. n.y._behavior == this._jitterY && n.y.set__(this._jitterY.base);
  4126. this._jitterY = this._jitterX = null;
  4127. this._elapsed = 0;
  4128. return e - r
  4129. }
  4130. return -1
  4131. },
  4132. __class__: En
  4133. };
  4134. var Sn = r["flambe.subsystem.RendererType"] = {
  4135. __ename__: ["flambe", "subsystem", "RendererType"],
  4136. __constructs__: ["Stage3D", "WebGL", "Canvas"]
  4137. };
  4138. Sn.Stage3D = ["Stage3D", 0];
  4139. Sn.Stage3D.toString = i;
  4140. Sn.Stage3D.__enum__ = Sn;
  4141. Sn.WebGL = ["WebGL", 1];
  4142. Sn.WebGL.toString = i;
  4143. Sn.WebGL.__enum__ = Sn;
  4144. Sn.Canvas = ["Canvas", 2];
  4145. Sn.Canvas.toString = i;
  4146. Sn.Canvas.__enum__ = Sn;
  4147. var xn = function() {};
  4148. r["flambe.util.Assert"] = xn;
  4149. xn.__name__ = ["flambe", "util", "Assert"];
  4150. xn.that = function() {};
  4151. var Tn = function() {};
  4152. r["flambe.util.BitSets"] = Tn;
  4153. Tn.__name__ = ["flambe", "util", "BitSets"];
  4154. Tn.set = function(e, t, n) {
  4155. return n ? e | t : e & ~t
  4156. };
  4157. var Nn = function() {
  4158. this.mainSection = new Hn;
  4159. this.sections = new Hn
  4160. };
  4161. r["flambe.util.Config"] = Nn;
  4162. Nn.__name__ = ["flambe", "util", "Config"];
  4163. Nn.parse = function(e) {
  4164. for (var t = new Nn, n = new s("^\\s*;", ""), r = new s("^\\s*\\[\\s*([^\\]]*)\\s*\\]", ""), i = new s("^\\s*([\\w\\.\\-_]+)\\s*=\\s*(.*)", ""), o = t.mainSection, u = 0, e = (new s("\r\n|\r|\n", "g")).split(e); u < e.length;) {
  4165. var a = e[u];
  4166. ++u;
  4167. if (!n.match(a))
  4168. if (r.match(a)) a = r.matched(1), t.sections.exists(a) ? o = t.sections.get(a) : (o = new Hn, t.sections.set(a, o));
  4169. else if (i.match(a)) {
  4170. var a = i.matched(1),
  4171. f = i.matched(2),
  4172. c = f.charCodeAt(0);
  4173. if ((34 == c || 39 == c) && f.charCodeAt(f.length - 1) == c) f = l.substr(f, 1, f.length - 2);
  4174. f = y.replace(y.replace(y.replace(y.replace(y.replace(y.replace(f, "\\n", "\n"), "\\r", "\r"), "\\t", " "), "\\'", "'"), '\\"', '"'), "\\\\", "\\");
  4175. o.set(a, f)
  4176. }
  4177. }
  4178. return t
  4179. };
  4180. Nn.prototype = {
  4181. __class__: Nn
  4182. };
  4183. var Cn = function(e) {
  4184. this.config = e;
  4185. this.missingTranslation = new _
  4186. };
  4187. r["flambe.util.MessageBundle"] = Cn;
  4188. Cn.__name__ = ["flambe", "util", "MessageBundle"];
  4189. Cn.parse = function(e) {
  4190. return new Cn(Nn.parse(e))
  4191. };
  4192. Cn.prototype = {
  4193. __class__: Cn
  4194. };
  4195. var kn = function() {
  4196. this.success = new _;
  4197. this.error = new _;
  4198. this.progressChanged = new Ln;
  4199. this.hasResult = !1;
  4200. this._total = this._progress = 0
  4201. };
  4202. r["flambe.util.Promise"] = kn;
  4203. kn.__name__ = ["flambe", "util", "Promise"];
  4204. kn.prototype = {
  4205. set_result: function(e) {
  4206. if (this.hasResult) throw "Promise result already assigned";
  4207. this._result = e;
  4208. this.hasResult = !0;
  4209. this.success.emit(e);
  4210. return e
  4211. },
  4212. get: function(e) {
  4213. return this.hasResult ? (e(this._result), null) : this.success.connect(e).once()
  4214. },
  4215. set_progress: function(e) {
  4216. this._progress != e && (this._progress = e, this.progressChanged.emit());
  4217. return e
  4218. },
  4219. set_total: function(e) {
  4220. this._total != e && (this._total = e, this.progressChanged.emit());
  4221. return e
  4222. },
  4223. __class__: kn,
  4224. __properties__: {
  4225. set_total: "set_total",
  4226. set_progress: "set_progress",
  4227. set_result: "set_result"
  4228. }
  4229. };
  4230. var Ln = function(e) {
  4231. O.call(this, e)
  4232. };
  4233. r["flambe.util.Signal0"] = Ln;
  4234. Ln.__name__ = ["flambe", "util", "Signal0"];
  4235. Ln.__super__ = O;
  4236. Ln.prototype = e(O.prototype, {
  4237. connect: function(e, t) {
  4238. null == t && (t = !1);
  4239. return this.connectImpl(e, t)
  4240. },
  4241. emit: function() {
  4242. var e = this;
  4243. this._head == O.DISPATCHING_SENTINEL ? this.defer(function() {
  4244. e.emitImpl()
  4245. }) : this.emitImpl()
  4246. },
  4247. emitImpl: function() {
  4248. for (var e = this.willEmit(), t = e; null != t;) t._listener(), t.stayInList || t.dispose(), t = t._next;
  4249. this.didEmit(e)
  4250. },
  4251. __class__: Ln
  4252. });
  4253. var An = function(e) {
  4254. this.next = null;
  4255. this.fn = e
  4256. };
  4257. r["flambe.util._SignalBase.Task"] = An;
  4258. An.__name__ = ["flambe", "util", "_SignalBase", "Task"];
  4259. An.prototype = {
  4260. __class__: An
  4261. };
  4262. var On = function() {};
  4263. r["flambe.util.Strings"] = On;
  4264. On.__name__ = ["flambe", "util", "Strings"];
  4265. On.getFileExtension = function(e) {
  4266. var t = e.lastIndexOf(".");
  4267. return 0 < t ? l.substr(e, t + 1, null) : null
  4268. };
  4269. On.removeFileExtension = function(e) {
  4270. var t = e.lastIndexOf(".");
  4271. return 0 < t ? l.substr(e, 0, t) : e
  4272. };
  4273. On.getUrlExtension = function(e) {
  4274. var t = e.lastIndexOf("?");
  4275. 0 <= t && (e = l.substr(e, 0, t));
  4276. t = e.lastIndexOf("/");
  4277. 0 <= t && (e = l.substr(e, t + 1, null));
  4278. return On.getFileExtension(e)
  4279. };
  4280. On.joinPath = function(e, t) {
  4281. 0 < e.length && 47 != e.charCodeAt(e.length - 1) && (e += "/");
  4282. return e + t
  4283. };
  4284. On.withFields = function(e, t) {
  4285. var n = t.length;
  4286. if (0 < n) {
  4287. for (var e = 0 < e.length ? e + " [" : e + "[", r = 0; r < n;) {
  4288. 0 < r && (e += ", ");
  4289. var i = t[r],
  4290. s = t[r + 1];
  4291. if (m.is(s, Error)) {
  4292. var o = s.stack;
  4293. null != o && (s = o)
  4294. }
  4295. e += i + "=" + m.string(s);
  4296. r += 2
  4297. }
  4298. e += "]"
  4299. }
  4300. return e
  4301. };
  4302. var Mn = function() {
  4303. this.buf = new g;
  4304. this.cache = [];
  4305. this.useCache = Mn.USE_CACHE;
  4306. this.useEnumIndex = Mn.USE_ENUM_INDEX;
  4307. this.shash = new Hn;
  4308. this.scount = 0
  4309. };
  4310. r["haxe.Serializer"] = Mn;
  4311. Mn.__name__ = ["haxe", "Serializer"];
  4312. Mn.prototype = {
  4313. toString: function() {
  4314. return this.buf.b
  4315. },
  4316. serializeString: function(e) {
  4317. var t = this.shash.get(e);
  4318. null != t ? (this.buf.b += "R", this.buf.b = null == t ? this.buf.b + "null" : this.buf.b + ("" + t)) : (this.shash.set(e, this.scount++), this.buf.b += "y", e = encodeURIComponent(e), this.buf.b = null == e.length ? this.buf.b + "null" : this.buf.b + ("" + e.length), this.buf.b += ":", this.buf.b = null == e ? this.buf.b + "null" : this.buf.b + ("" + e))
  4319. },
  4320. serializeRef: function(e) {
  4321. for (var t = typeof e, n = 0, r = this.cache.length; n < r;) {
  4322. var i = n++,
  4323. s = this.cache[i];
  4324. if (typeof s == t && s == e) return this.buf.b += "r", this.buf.b = null == i ? this.buf.b + "null" : this.buf.b + ("" + i), !0
  4325. }
  4326. this.cache.push(e);
  4327. return !1
  4328. },
  4329. serializeFields: function(e) {
  4330. for (var t = 0, n = v.fields(e); t < n.length;) {
  4331. var r = n[t];
  4332. ++t;
  4333. this.serializeString(r);
  4334. this.serialize(v.field(e, r))
  4335. }
  4336. this.buf.b += "g"
  4337. },
  4338. serialize: function(e) {
  4339. var t = w["typeof"](e);
  4340. switch (t[1]) {
  4341. case 0:
  4342. this.buf.b += "n";
  4343. break;
  4344. case 1:
  4345. if (0 == e) {
  4346. this.buf.b += "z";
  4347. break
  4348. }
  4349. this.buf.b += "i";
  4350. this.buf.b = null == e ? this.buf.b + "null" : this.buf.b + ("" + e);
  4351. break;
  4352. case 2:
  4353. Math.isNaN(e) ? this.buf.b += "k" : Math.isFinite(e) ? (this.buf.b += "d", this.buf.b = null == e ? this.buf.b + "null" : this.buf.b + ("" + e)) : this.buf.b = 0 > e ? this.buf.b + "m" : this.buf.b + "p";
  4354. break;
  4355. case 3:
  4356. this.buf.b = e ? this.buf.b + "t" : this.buf.b + "f";
  4357. break;
  4358. case 6:
  4359. t = t[2];
  4360. if (t == String) {
  4361. this.serializeString(e);
  4362. break
  4363. }
  4364. if (this.useCache && this.serializeRef(e)) break;
  4365. switch (t) {
  4366. case Array:
  4367. t = 0;
  4368. this.buf.b += "a";
  4369. for (var n = e.length, r = 0; r < n;) {
  4370. var i = r++;
  4371. null == e[i] ? t++ : (0 < t && (1 == t ? this.buf.b += "n" : (this.buf.b += "u", this.buf.b = null == t ? this.buf.b + "null" : this.buf.b + ("" + t)), t = 0), this.serialize(e[i]))
  4372. }
  4373. 0 < t && (1 == t ? this.buf.b += "n" : (this.buf.b += "u", this.buf.b = null == t ? this.buf.b + "null" : this.buf.b + ("" + t)));
  4374. this.buf.b += "h";
  4375. break;
  4376. case h:
  4377. this.buf.b += "l";
  4378. for (e = e.iterator(); e.hasNext();) this.serialize(e.next());
  4379. this.buf.b += "h";
  4380. break;
  4381. case Date:
  4382. this.buf.b += "v";
  4383. this.buf.add(l.dateStr(e));
  4384. break;
  4385. case Hn:
  4386. this.buf.b += "b";
  4387. for (t = e.keys(); t.hasNext();) n = t.next(), this.serializeString(n), this.serialize(e.get(n));
  4388. this.buf.b += "h";
  4389. break;
  4390. case Dn:
  4391. this.buf.b += "q";
  4392. for (t = e.keys(); t.hasNext();) n = t.next(), this.buf.b += ":", this.buf.b = null == n ? this.buf.b + "null" : this.buf.b + ("" + n), this.serialize(e.get(n));
  4393. this.buf.b += "h";
  4394. break;
  4395. case Pn:
  4396. this.buf.b += "M";
  4397. for (t = e.keys(); t.hasNext();) n = t.next(), r = v.field(n, "__id__"), v.deleteField(n, "__id__"), this.serialize(n), n.__id__ = r, this.serialize(e.h[n.__id__]);
  4398. this.buf.b += "h";
  4399. break;
  4400. case Bn:
  4401. r = 0;
  4402. i = e.length - 2;
  4403. t = new g;
  4404. for (n = Mn.BASE64; r < i;) {
  4405. var s = e.get(r++),
  4406. o = e.get(r++),
  4407. u = e.get(r++);
  4408. t.add(n.charAt(s >> 2));
  4409. t.add(n.charAt((s << 4 | o >> 4) & 63));
  4410. t.add(n.charAt((o << 2 | u >> 6) & 63));
  4411. t.add(n.charAt(u & 63))
  4412. }
  4413. r == i ? (i = e.get(r++), e = e.get(r++), t.add(n.charAt(i >> 2)), t.add(n.charAt((i << 4 | e >> 4) & 63)), t.add(n.charAt(e << 2 & 63))) : r == i + 1 && (e = e.get(r++), t.add(n.charAt(e >> 2)), t.add(n.charAt(e << 4 & 63)));
  4414. e = t.b;
  4415. this.buf.b += "s";
  4416. this.buf.b = null == e.length ? this.buf.b + "null" : this.buf.b + ("" + e.length);
  4417. this.buf.b += ":";
  4418. this.buf.b = null == e ? this.buf.b + "null" : this.buf.b + ("" + e);
  4419. break;
  4420. default:
  4421. this.useCache && this.cache.pop(), null != e.hxSerialize ? (this.buf.b += "C", this.serializeString(w.getClassName(t)), this.useCache && this.cache.push(e), e.hxSerialize(this), this.buf.b += "g") : (this.buf.b += "c", this.serializeString(w.getClassName(t)), this.useCache && this.cache.push(e), this.serializeFields(e))
  4422. }
  4423. break;
  4424. case 4:
  4425. if (this.useCache && this.serializeRef(e)) break;
  4426. this.buf.b += "o";
  4427. this.serializeFields(e);
  4428. break;
  4429. case 7:
  4430. t = t[2];
  4431. if (this.useCache) {
  4432. if (this.serializeRef(e)) break;
  4433. this.cache.pop()
  4434. }
  4435. this.buf.b = this.useEnumIndex ? this.buf.b + "j" : this.buf.b + "w";
  4436. this.serializeString(w.getEnumName(t));
  4437. this.useEnumIndex ? (this.buf.b += ":", this.buf.b += m.string(e[1])) : this.serializeString(e[0]);
  4438. this.buf.b += ":";
  4439. t = e.length;
  4440. this.buf.b += m.string(t - 2);
  4441. for (n = 2; n < t;) r = n++, this.serialize(e[r]);
  4442. this.useCache && this.cache.push(e);
  4443. break;
  4444. case 5:
  4445. throw "Cannot serialize function";
  4446. default:
  4447. throw "Cannot serialize " + m.string(e)
  4448. }
  4449. },
  4450. __class__: Mn
  4451. };
  4452. var _n = function(e) {
  4453. this.buf = e;
  4454. this.length = e.length;
  4455. this.pos = 0;
  4456. this.scache = [];
  4457. this.cache = [];
  4458. e = _n.DEFAULT_RESOLVER;
  4459. null == e && (e = w, _n.DEFAULT_RESOLVER = e);
  4460. this.setResolver(e)
  4461. };
  4462. r["haxe.Unserializer"] = _n;
  4463. _n.__name__ = ["haxe", "Unserializer"];
  4464. _n.initCodes = function() {
  4465. for (var e = [], t = 0, n = _n.BASE64.length; t < n;) {
  4466. var r = t++;
  4467. e[_n.BASE64.charCodeAt(r)] = r
  4468. }
  4469. return e
  4470. };
  4471. _n.run = function(e) {
  4472. return (new _n(e)).unserialize()
  4473. };
  4474. _n.prototype = {
  4475. setResolver: function(e) {
  4476. this.resolver = null == e ? {
  4477. resolveClass: function() {
  4478. return null
  4479. },
  4480. resolveEnum: function() {
  4481. return null
  4482. }
  4483. } : e
  4484. },
  4485. get: function(e) {
  4486. return this.buf.charCodeAt(e)
  4487. },
  4488. readDigits: function() {
  4489. for (var e = 0, t = !1, n = this.pos;;) {
  4490. var r = this.buf.charCodeAt(this.pos);
  4491. if (r != r) break;
  4492. if (45 == r) {
  4493. if (this.pos != n) break;
  4494. t = !0
  4495. } else {
  4496. if (48 > r || 57 < r) break;
  4497. e = 10 * e + (r - 48)
  4498. }
  4499. this.pos++
  4500. }
  4501. t && (e *= -1);
  4502. return e
  4503. },
  4504. unserializeObject: function(e) {
  4505. for (;;) {
  4506. if (this.pos >= this.length) throw "Invalid object";
  4507. if (103 == this.buf.charCodeAt(this.pos)) break;
  4508. var t = this.unserialize();
  4509. if ("string" != typeof t) throw "Invalid object key";
  4510. var n = this.unserialize();
  4511. e[t] = n
  4512. }
  4513. this.pos++
  4514. },
  4515. unserializeEnum: function(e, t) {
  4516. if (58 != this.get(this.pos++)) throw "Invalid enum format";
  4517. var n = this.readDigits();
  4518. if (0 == n) return w.createEnum(e, t);
  4519. for (var r = []; 0 < n--;) r.push(this.unserialize());
  4520. return w.createEnum(e, t, r)
  4521. },
  4522. unserialize: function() {
  4523. switch (this.get(this.pos++)) {
  4524. case 110:
  4525. return null;
  4526. case 116:
  4527. return !0;
  4528. case 102:
  4529. return !1;
  4530. case 122:
  4531. return 0;
  4532. case 105:
  4533. return this.readDigits();
  4534. case 100:
  4535. for (var e = this.pos;;) {
  4536. var t = this.buf.charCodeAt(this.pos);
  4537. if (43 <= t && 58 > t || 101 == t || 69 == t) this.pos++;
  4538. else break
  4539. }
  4540. return m.parseFloat(l.substr(this.buf, e, this.pos - e));
  4541. case 121:
  4542. e = this.readDigits();
  4543. if (58 != this.get(this.pos++) || this.length - this.pos < e) throw "Invalid string length";
  4544. t = l.substr(this.buf, this.pos, e);
  4545. this.pos += e;
  4546. t = decodeURIComponent(t.split("+").join(" "));
  4547. this.scache.push(t);
  4548. return t;
  4549. case 107:
  4550. return Math.NaN;
  4551. case 109:
  4552. return Math.NEGATIVE_INFINITY;
  4553. case 112:
  4554. return Math.POSITIVE_INFINITY;
  4555. case 97:
  4556. e = [];
  4557. for (this.cache.push(e);;) {
  4558. t = this.buf.charCodeAt(this.pos);
  4559. if (104 == t) {
  4560. this.pos++;
  4561. break
  4562. }
  4563. 117 == t ? (this.pos++, t = this.readDigits(), e[e.length + t - 1] = null) : e.push(this.unserialize())
  4564. }
  4565. return e;
  4566. case 111:
  4567. return e = {}, this.cache.push(e), this.unserializeObject(e), e;
  4568. case 114:
  4569. e = this.readDigits();
  4570. if (0 > e || e >= this.cache.length) throw "Invalid reference";
  4571. return this.cache[e];
  4572. case 82:
  4573. e = this.readDigits();
  4574. if (0 > e || e >= this.scache.length) throw "Invalid string reference";
  4575. return this.scache[e];
  4576. case 120:
  4577. throw this.unserialize();
  4578. case 99:
  4579. e = this.unserialize();
  4580. t = this.resolver.resolveClass(e);
  4581. if (null == t) throw "Class not found " + e;
  4582. e = w.createEmptyInstance(t);
  4583. this.cache.push(e);
  4584. this.unserializeObject(e);
  4585. return e;
  4586. case 119:
  4587. e = this.unserialize();
  4588. t = this.resolver.resolveEnum(e);
  4589. if (null == t) throw "Enum not found " + e;
  4590. e = this.unserializeEnum(t, this.unserialize());
  4591. this.cache.push(e);
  4592. return e;
  4593. case 106:
  4594. e = this.unserialize();
  4595. t = this.resolver.resolveEnum(e);
  4596. if (null == t) throw "Enum not found " + e;
  4597. this.pos++;
  4598. var n = this.readDigits(),
  4599. r = w.getEnumConstructs(t)[n];
  4600. if (null == r) throw "Unknown enum index " + e + "@" + n;
  4601. e = this.unserializeEnum(t, r);
  4602. this.cache.push(e);
  4603. return e;
  4604. case 108:
  4605. e = new h;
  4606. for (this.cache.push(e); 104 != this.buf.charCodeAt(this.pos);) e.add(this.unserialize());
  4607. this.pos++;
  4608. return e;
  4609. case 98:
  4610. e = new Hn;
  4611. for (this.cache.push(e); 104 != this.buf.charCodeAt(this.pos);) t = this.unserialize(), e.set(t, this.unserialize());
  4612. this.pos++;
  4613. return e;
  4614. case 113:
  4615. e = new Dn;
  4616. this.cache.push(e);
  4617. for (t = this.get(this.pos++); 58 == t;) t = this.readDigits(), e.set(t, this.unserialize()), t = this.get(this.pos++);
  4618. if (104 != t) throw "Invalid IntMap format";
  4619. return e;
  4620. case 77:
  4621. e = new Pn;
  4622. for (this.cache.push(e); 104 != this.buf.charCodeAt(this.pos);) t = this.unserialize(), e.set(t, this.unserialize());
  4623. this.pos++;
  4624. return e;
  4625. case 118:
  4626. return e = l.substr(this.buf, this.pos, 19), e = l.strDate(e), this.cache.push(e), this.pos += 19, e;
  4627. case 115:
  4628. e = this.readDigits();
  4629. r = this.buf;
  4630. if (58 != this.get(this.pos++) || this.length - this.pos < e) throw "Invalid bytes length";
  4631. var i = _n.CODES;
  4632. null == i && (i = _n.initCodes(), _n.CODES = i);
  4633. for (var s = this.pos, o = e & 3, u = s + (e - o), t = Bn.alloc(3 * (e >> 2) + (2 <= o ? o - 1 : 0)), n = 0; s < u;) {
  4634. var a = i[y.fastCodeAt(r, s++)],
  4635. f = i[y.fastCodeAt(r, s++)];
  4636. t.set(n++, a << 2 | f >> 4);
  4637. a = i[y.fastCodeAt(r, s++)];
  4638. t.set(n++, f << 4 | a >> 2);
  4639. f = i[y.fastCodeAt(r, s++)];
  4640. t.set(n++, a << 6 | f)
  4641. }
  4642. 2 <= o && (f = i[y.fastCodeAt(r, s++)], u = i[y.fastCodeAt(r, s++)], t.set(n++, f << 2 | u >> 4), 3 == o && (r = i[y.fastCodeAt(r, s++)], t.set(n++, u << 4 | r >> 2)));
  4643. this.pos += e;
  4644. this.cache.push(t);
  4645. return t;
  4646. case 67:
  4647. e = this.unserialize();
  4648. t = this.resolver.resolveClass(e);
  4649. if (null == t) throw "Class not found " + e;
  4650. e = w.createEmptyInstance(t);
  4651. this.cache.push(e);
  4652. e.hxUnserialize(this);
  4653. if (103 != this.get(this.pos++)) throw "Invalid custom data";
  4654. return e
  4655. }
  4656. this.pos--;
  4657. throw "Invalid char " + this.buf.charAt(this.pos) + " at position " + this.pos
  4658. },
  4659. __class__: _n
  4660. };
  4661. var Dn = function() {
  4662. this.h = {}
  4663. };
  4664. r["haxe.ds.IntMap"] = Dn;
  4665. Dn.__name__ = ["haxe", "ds", "IntMap"];
  4666. Dn.__interfaces__ = [d];
  4667. Dn.prototype = {
  4668. set: function(e, t) {
  4669. this.h[e] = t
  4670. },
  4671. get: function(e) {
  4672. return this.h[e]
  4673. },
  4674. exists: function(e) {
  4675. return this.h.hasOwnProperty(e)
  4676. },
  4677. remove: function(e) {
  4678. if (!this.h.hasOwnProperty(e)) return !1;
  4679. delete this.h[e];
  4680. return !0
  4681. },
  4682. keys: function() {
  4683. var e = [],
  4684. t;
  4685. for (t in this.h) this.h.hasOwnProperty(t) && e.push(t | 0);
  4686. return l.iter(e)
  4687. },
  4688. __class__: Dn
  4689. };
  4690. var Pn = function() {
  4691. this.h = {};
  4692. this.h.__keys__ = {}
  4693. };
  4694. r["haxe.ds.ObjectMap"] = Pn;
  4695. Pn.__name__ = ["haxe", "ds", "ObjectMap"];
  4696. Pn.__interfaces__ = [d];
  4697. Pn.prototype = {
  4698. set: function(e, t) {
  4699. var n = e.__id__ || (e.__id__ = ++Pn.count);
  4700. this.h[n] = t;
  4701. this.h.__keys__[n] = e
  4702. },
  4703. keys: function() {
  4704. var e = [],
  4705. t;
  4706. for (t in this.h.__keys__) this.h.hasOwnProperty(t) && e.push(this.h.__keys__[t]);
  4707. return l.iter(e)
  4708. },
  4709. __class__: Pn
  4710. };
  4711. var Hn = function() {
  4712. this.h = {}
  4713. };
  4714. r["haxe.ds.StringMap"] = Hn;
  4715. Hn.__name__ = ["haxe", "ds", "StringMap"];
  4716. Hn.__interfaces__ = [d];
  4717. Hn.prototype = {
  4718. set: function(e, t) {
  4719. this.h["$" + e] = t
  4720. },
  4721. get: function(e) {
  4722. return this.h["$" + e]
  4723. },
  4724. exists: function(e) {
  4725. return this.h.hasOwnProperty("$" + e)
  4726. },
  4727. keys: function() {
  4728. var e = [],
  4729. t;
  4730. for (t in this.h) this.h.hasOwnProperty(t) && e.push(t.substr(1));
  4731. return l.iter(e)
  4732. },
  4733. iterator: function() {
  4734. return {
  4735. ref: this.h,
  4736. it: this.keys(),
  4737. hasNext: function() {
  4738. return this.it.hasNext()
  4739. },
  4740. next: function() {
  4741. return this.ref["$" + this.it.next()]
  4742. }
  4743. }
  4744. },
  4745. __class__: Hn
  4746. };
  4747. var Bn = function(e, t) {
  4748. this.length = e;
  4749. this.b = t
  4750. };
  4751. r["haxe.io.Bytes"] = Bn;
  4752. Bn.__name__ = ["haxe", "io", "Bytes"];
  4753. Bn.alloc = function(e) {
  4754. for (var t = [], n = 0; n < e;) n++, t.push(0);
  4755. return new Bn(e, t)
  4756. };
  4757. Bn.prototype = {
  4758. get: function(e) {
  4759. return this.b[e]
  4760. },
  4761. set: function(e, t) {
  4762. this.b[e] = t & 255
  4763. },
  4764. __class__: Bn
  4765. };
  4766. var jn = function() {};
  4767. r["haxe.io.Eof"] = jn;
  4768. jn.__name__ = ["haxe", "io", "Eof"];
  4769. jn.prototype = {
  4770. toString: function() {
  4771. return "Eof"
  4772. },
  4773. __class__: jn
  4774. };
  4775. var Fn = function() {};
  4776. r["haxe.rtti.Meta"] = Fn;
  4777. Fn.__name__ = ["haxe", "rtti", "Meta"];
  4778. Fn.getType = function(e) {
  4779. e = e.__meta__;
  4780. return null == e || null == e.obj ? {} : e.obj
  4781. };
  4782. var In = function() {};
  4783. r["js.Boot"] = In;
  4784. In.__name__ = ["js", "Boot"];
  4785. In.getClass = function(e) {
  4786. return e instanceof Array && null == e.__enum__ ? Array : e.__class__
  4787. };
  4788. In.__string_rec = function(e, t) {
  4789. if (null == e) return "null";
  4790. if (5 <= t.length) return "<...>";
  4791. var n = typeof e;
  4792. if ("function" == n && (e.__name__ || e.__ename__)) n = "object";
  4793. switch (n) {
  4794. case "object":
  4795. if (e instanceof Array) {
  4796. if (e.__enum__) {
  4797. if (2 == e.length) return e[0];
  4798. for (var n = e[0] + "(", t = t + " ", r = 2, i = e.length; r < i;) var s = r++,
  4799. n = 2 != s ? n + ("," + In.__string_rec(e[s], t)) : n + In.__string_rec(e[s], t);
  4800. return n + ")"
  4801. }
  4802. n = e.length;
  4803. r = "[";
  4804. t += " ";
  4805. for (i = 0; i < n;) s = i++, r += (0 < s ? "," : "") + In.__string_rec(e[s], t);
  4806. return r + "]"
  4807. }
  4808. try {
  4809. r = e.toString
  4810. } catch (o) {
  4811. return "???"
  4812. }
  4813. if (null != r && r != Object.toString && (n = e.toString(), "[object Object]" != n)) return n;
  4814. n = null;
  4815. r = "{\n";
  4816. t += " ";
  4817. i = null != e.hasOwnProperty;
  4818. for (n in e)
  4819. if (!i || e.hasOwnProperty(n)) "prototype" == n || "__class__" == n || "__super__" == n || "__interfaces__" == n || "__properties__" == n || (2 != r.length && (r += ", \n"), r += t + n + " : " + In.__string_rec(e[n], t));
  4820. t = t.substring(1);
  4821. return r + ("\n" + t + "}");
  4822. case "function":
  4823. return "<function>";
  4824. case "string":
  4825. return e;
  4826. default:
  4827. return "" + e
  4828. }
  4829. };
  4830. In.__interfLoop = function(e, t) {
  4831. if (null == e) return !1;
  4832. if (e == t) return !0;
  4833. var n = e.__interfaces__;
  4834. if (null != n)
  4835. for (var r = 0, i = n.length; r < i;) {
  4836. var s = r++,
  4837. s = n[s];
  4838. if (s == t || In.__interfLoop(s, t)) return !0
  4839. }
  4840. return In.__interfLoop(e.__super__, t)
  4841. };
  4842. In.__instanceof = function(e, t) {
  4843. if (null == t) return !1;
  4844. switch (t) {
  4845. case Gn:
  4846. return (e | 0) === e;
  4847. case Zn:
  4848. return "number" == typeof e;
  4849. case er:
  4850. return "boolean" == typeof e;
  4851. case String:
  4852. return "string" == typeof e;
  4853. case Array:
  4854. return e instanceof Array && null == e.__enum__;
  4855. case Yn:
  4856. return !0;
  4857. default:
  4858. if (null != e) {
  4859. if ("function" == typeof t && (e instanceof t || In.__interfLoop(In.getClass(e), t))) return !0
  4860. } else return !1;
  4861. return t == tr && null != e.__name__ || t == nr && null != e.__ename__ ? !0 : e.__enum__ == t
  4862. }
  4863. };
  4864. In.__cast = function(e, t) {
  4865. if (In.__instanceof(e, t)) return e;
  4866. throw "Cannot cast " + m.string(e) + " to " + m.string(t)
  4867. };
  4868. var qn = function() {};
  4869. r["js.Browser"] = qn;
  4870. qn.__name__ = ["js", "Browser"];
  4871. qn.getLocalStorage = function() {
  4872. try {
  4873. var e = window.localStorage;
  4874. e.getItem("");
  4875. return e
  4876. } catch (t) {
  4877. return null
  4878. }
  4879. };
  4880. var Rn = function(e) {
  4881. this.root = (new T).add(new ln(!1));
  4882. Kn.addFillSprite(this.root, Kn.halfWidth, Kn.halfHeight, 0, Kn.width, Kn.height, .8);
  4883. Kn.addLabel(this.root, Kn.halfWidth, Kn.halfHeight - 150, "eRMB", 1.2, 1, !0, "font2");
  4884. e = Kn.addLabel(this.root, Kn.halfWidth + 50, Kn.halfHeight, "" + e, 1.2, 1, !0);
  4885. Kn.addImageSprite(e, -50, 25, "score_icon");
  4886. Kn.addButton(this.root, Kn.halfWidth - 75, Kn.halfHeight + 170, "home_btn", function() {
  4887. $n.unmuteSoundtrack();
  4888. Kn.goToScene((new Xn).root)
  4889. });
  4890. Kn.addButton(this.root, Kn.halfWidth + 75, Kn.halfHeight + 170, "replay_btn", function() {
  4891. $n.unmuteSoundtrack();
  4892. Kn.goToScene((new Un(0)).root)
  4893. })
  4894. };
  4895. r["scenes.GameOverScene"] = Rn;
  4896. Rn.__name__ = ["scenes", "GameOverScene"];
  4897. Rn.prototype = {
  4898. __class__: Rn
  4899. };
  4900. var Un = function() {
  4901. this.root = (new T).add(new ln);
  4902. var e = this;
  4903. this.root.add(new yn);
  4904. Kn.addImageSprite(this.root, 0, 0, "game_scene_bg", 1, 1, !1);
  4905. var t = Kn.addImageSprite(this.root, 0, -70, "spikes_block", 1, 1, !1);
  4906. Un.spikesBlock = t._compMap.Sprite_0;
  4907. Kn.addImageSprite(this.root, 0, -20, "hud_bg", 1, 1, !1);
  4908. 1 == Un.cLevel && (Un.totalScore = 0, Kn.addDelay(this.root, .2, function() {
  4909. Kn.pushScene((new Wn).root)
  4910. }, !1));
  4911. Kn.addDelay(this.root, .8, function() {
  4912. Kn.addButton(e.root, 585, 58, "pause_btn", function() {
  4913. Kn.pushScene((new Vn).root)
  4914. });
  4915. Kn.addButton(e.root, 390, 58, "push_btn", function() {
  4916. e.root._compMap.GameSceneComp_7.addRow()
  4917. });
  4918. Un.spikesBlock.y.animateTo(101, .8, F.linear);
  4919. e.root.add(new zn(Un.scoreTillNextLevel(Un.cLevel + 1), 0))
  4920. }, !1)
  4921. };
  4922. r["scenes.GameScene"] = Un;
  4923. Un.__name__ = ["scenes", "GameScene"];
  4924. Un.scoreTillNextLevel = function(e) {
  4925. return 1e3 * e + 1e3 * e + (30 * e * e - 30 * e)
  4926. };
  4927. Un.prototype = {
  4928. __class__: Un
  4929. };
  4930. var zn = function(e, t) {
  4931. this.levelEnd = !1;
  4932. this.timerC = this.cLevelScore = 0;
  4933. this.scoreTillNextLevel = e;
  4934. this.cLevelScore = t
  4935. };
  4936. r["scenes.GameSceneComp"] = zn;
  4937. zn.__name__ = ["scenes", "GameSceneComp"];
  4938. zn.__super__ = S;
  4939. zn.prototype = e(S.prototype, {
  4940. get_name: function() {
  4941. return "GameSceneComp_7"
  4942. },
  4943. onAdded: function() {
  4944. this.grid = new a(this.owner, 9, 11);
  4945. this.grid.addRandRows(8);
  4946. this.timeTillNextRow = this.caclAddRowTimer();
  4947. Kn.addLabel(this.owner, 48, 54, "" + Un.cLevel, 1, 1, !0, "font3");
  4948. Kn.addImageSprite(this.owner, 90, 30, "bar1_bg", 1, 1, !1);
  4949. this.scoreBarFill = Kn.addImageSprite(this.owner, 90, 30, "bar1_fill", 1, 1, !1)._compMap.Sprite_0;
  4950. this.scoreBarFillRect = new mt(0, 0, 0, this.scoreBarFill.getNaturalHeight());
  4951. this.scoreBarFill.scissor = this.scoreBarFillRect;
  4952. this.scoreLabel = Kn.addLabel(this.owner, 210, 54, "", 1, 1, !0, "font3")._compMap.Sprite_0;
  4953. this.scoreLabel.setAlign(Y.Center);
  4954. this.updateScore(0);
  4955. Kn.addImageSprite(this.owner, 442, 30, "bar2_bg", 1, 1, !1);
  4956. this.pushUpBarFill = Kn.addImageSprite(this.owner, 442, 30, "bar2_fill", 1, 1, !1)._compMap.Sprite_0;
  4957. this.pushUpBarFillRect = new mt(0, 0, 0, this.pushUpBarFill.getNaturalHeight());
  4958. this.pushUpBarFill.scissor = this.pushUpBarFillRect;
  4959. this.pushUpTimer = Kn.addDelay(this.owner, this.timeTillNextRow, n(this, this.addRow), !0);
  4960. this.timer = Kn.addDelay(this.owner, .1, n(this, this.updateTimer), !0);
  4961. this.checkForMatches()
  4962. },
  4963. caclAddRowTimer: function() {
  4964. var e = 9 - (.5 * Un.cLevel | 0);
  4965. 2 > e && (e = 2);
  4966. return e
  4967. },
  4968. checkForMatches: function() {
  4969. this.levelEnd || (this.checkNextLevel(), 0 == this.grid.getDeepMatches().length && (this.pushUpTimer.dispose(), this.pushUpTimer = Kn.addDelay(this.owner, this.timeTillNextRow, n(this, this.addRow), !0), this.addRow()))
  4970. },
  4971. addRow: function() {
  4972. this.pushUpBarFillRect.width = this.pushUpBarFill.getNaturalWidth();
  4973. this.pushUpBarFill.scissor = this.pushUpBarFillRect;
  4974. this.timerC = 0;
  4975. this.levelEnd || (this.grid.pushPiecesUp() ? (this.grid.addRandRows(1), 0 == this.grid.getDeepMatches().length && this.addRow()) : this.checkGameOver())
  4976. },
  4977. checkNextLevel: function() {
  4978. var e = this;
  4979. if (this.cLevelScore >= this.scoreTillNextLevel) {
  4980. this.levelEnd = !0;
  4981. f.canMakeAction = !1;
  4982. Un.spikesBlock.y.animateTo(-70, .6, F.linear);
  4983. this.pushUpTimer._compMap.Script_3.stopAll();
  4984. this.timer._compMap.Script_3.stopAll();
  4985. Kn.addDelay(this.owner, 1, function() {
  4986. e.grid.clear2()
  4987. }, !1);
  4988. Un.cLevel += 1;
  4989. var t = this.cLevelScore - this.scoreTillNextLevel;
  4990. Un.totalScore += this.cLevelScore;
  4991. o.saveHiScore(Un.totalScore);
  4992. // updateShare(Un.cLevel - 1, Un.totalScore);
  4993. // Play68.setRankingLevelScoreDesc(Un.cLevel - 1, Un.totalScore);
  4994. $n.playSfx("level_end_sfx", 1);
  4995. this.showLevelCompleteMsg();
  4996. Kn.addDelay(this.owner, 1.5, function() {
  4997. Kn.goToScene((new Un(t)).root, (new cn(.6, F.backIn)).left())
  4998. }, !1)
  4999. }
  5000. },
  5001. checkGameOver: function() {
  5002. this.levelEnd = !0;
  5003. f.canMakeAction = !1;
  5004. var e = o.HI_SCORE;
  5005. Un.totalScore += this.cLevelScore;
  5006. o.saveHiScore(Un.totalScore);
  5007. this.pushUpTimer._compMap.Script_3.stopAll();
  5008. this.timer._compMap.Script_3.stopAll();
  5009. // updateShare(Un.cLevel, Un.totalScore);
  5010. // Play68.setRankingLevelScoreDesc(Un.cLevel, Un.totalScore);
  5011. Un.cLevel = 1;
  5012. this.grid.clear();
  5013. Kn.addDelay(this.owner, 2, function() {
  5014. $n.muteSoundtrack();
  5015. $n.playSfx("game_over_sfx", 1);
  5016. Kn.pushScene((new Rn(Un.totalScore, e)).root)
  5017. }, !1)
  5018. },
  5019. updateScore: function(e) {
  5020. this.cLevelScore += e;
  5021. this.cLevelScore > this.scoreTillNextLevel && (this.cLevelScore = this.scoreTillNextLevel);
  5022. this.scoreLabel.set_text(this.cLevelScore + " - " + this.scoreTillNextLevel);
  5023. this.scoreBarFillRect.width = this.cLevelScore / this.scoreTillNextLevel * this.scoreBarFill.getNaturalWidth();
  5024. this.scoreBarFill.scissor = this.scoreBarFillRect
  5025. },
  5026. updateTimer: function() {
  5027. this.timerC += .1;
  5028. this.timerC > this.timeTillNextRow && (this.timerC = this.timeTillNextRow);
  5029. this.pushUpBarFillRect.width = this.timerC / this.timeTillNextRow * this.pushUpBarFill.getNaturalWidth();
  5030. this.pushUpBarFill.scissor = this.pushUpBarFillRect
  5031. },
  5032. showLevelCompleteMsg: function() {
  5033. var e;
  5034. e = Kn.addFillSprite(this.owner, Kn.halfWidth, Kn.halfHeight, 0, Kn.width, 140, 0)._compMap.Sprite_0;
  5035. var t;
  5036. t = Kn.addLabel(this.owner, Kn.halfWidth, Kn.halfHeight, "ZYXV", 1, 0, !0, "font2")._compMap.Sprite_0;
  5037. e.alpha.animateTo(.8, .4, F.quadIn);
  5038. t.alpha.animateTo(1, .4, F.quadIn)
  5039. },
  5040. __class__: zn
  5041. });
  5042. var Wn = function() {
  5043. this.root = (new T).add(new ln(!1));
  5044. Kn.addFillSprite(this.root, Kn.halfWidth, Kn.halfHeight, 0, Kn.width, Kn.height, .5);
  5045. Kn.addImageSprite(this.root, Kn.halfWidth, 380, "help_info", 1, 1);
  5046. Kn.addButton(this.root, Kn.halfWidth, Kn.height - 160, "play_btn2", function() {
  5047. Kn.popScene(new fn(.2))
  5048. })
  5049. };
  5050. r["scenes.HelpScene"] = Wn;
  5051. Wn.__name__ = ["scenes", "HelpScene"];
  5052. Wn.prototype = {
  5053. __class__: Wn
  5054. };
  5055. var Xn = function() {
  5056. this.root = (new T).add(new ln);
  5057. $n.playSoundtrack("soundtrack1", .8);
  5058. Kn.addImageSprite(this.root, Kn.halfWidth, Kn.halfHeight, "game_scene_bg");
  5059. var e;
  5060. e = Kn.addImageSprite(this.root, Kn.halfWidth, Kn.halfHeight - 270, "game_title", 1, 1)._compMap.Sprite_0;
  5061. e.alpha.animateTo(1, 1, F.quadOut);
  5062. e.y.animateTo(Kn.halfHeight - 160, 1, F.bounceOut);
  5063. e = Kn.addLabel(this.root, Kn.halfWidth + 40, Kn.height + 100, "" + o.HI_SCORE, 1.2, 0, !0)._compMap.Sprite_0;
  5064. Kn.addImageSprite(e.owner, -40, 15, "score_icon");
  5065. e.alpha.animateTo(1, 1, F.quadOut);
  5066. e.y.animateTo(Kn.height - 80, 1, F.bounceOut);
  5067. e = Kn.addButton(this.root, Kn.halfWidth, Kn.height - 200, "play_btn2", function() {
  5068. Kn.goToScene((new Un(0)).root)
  5069. }, "", 1, 0)._compMap.Sprite_0;
  5070. e.alpha.animateTo(1, 1, F.quadOut);
  5071. e.y.animateTo(Kn.height - 280, 1, F.bounceOut);
  5072. Kn.addButton(this.root, Kn.width - 80, 90, "sound_on_btn", function() {
  5073. $n.muteAll()
  5074. }, "sound_off_btn", 1, 1)
  5075. };
  5076. r["scenes.MainScene"] = Xn;
  5077. Xn.__name__ = ["scenes", "MainScene"];
  5078. Xn.prototype = {
  5079. __class__: Xn
  5080. };
  5081. var Vn = function() {
  5082. this.root = (new T).add(new ln(!1));
  5083. Kn.addFillSprite(this.root, Kn.halfWidth, Kn.halfHeight, 0, Kn.width, Kn.height, .8);
  5084. Kn.addLabel(this.root, Kn.halfWidth, Kn.halfHeight - 205, "fb", 1.2, 1, !0, "font2");
  5085. Kn.addButton(this.root, Kn.halfWidth, Kn.halfHeight + 5, "play_btn2", function() {
  5086. Kn.popScene(new fn(0))
  5087. });
  5088. Kn.addButton(this.root, Kn.halfWidth - 150, Kn.halfHeight + 200, "home_btn", function() {
  5089. Un.cLevel = 1;
  5090. Kn.goToScene((new Xn).root)
  5091. });
  5092. Kn.addButton(this.root, Kn.halfWidth, Kn.halfHeight + 200, "replay_btn", function() {
  5093. Un.cLevel = 1;
  5094. Kn.goToScene((new Un(0)).root)
  5095. });
  5096. Kn.addButton(this.root, Kn.halfWidth + 150, Kn.halfHeight + 200, "sound_on_btn", function() {
  5097. $n.muteAll()
  5098. }, "sound_off_btn").firstChild._compMap.Sprite_0.set_visible($n.isMuted)
  5099. };
  5100. r["scenes.PauseScene"] = Vn;
  5101. Vn.__name__ = ["scenes", "PauseScene"];
  5102. Vn.prototype = {
  5103. __class__: Vn
  5104. };
  5105. var $n = function() {};
  5106. r["yzi.Sfx"] = $n;
  5107. $n.__name__ = ["yzi", "Sfx"];
  5108. $n.playSfx = function(e, t) {
  5109. null == t && (t = 1);
  5110. return $n.isMuted ? null : Kn.assets.getSound($n.soundsFolder + "/" + e).play(t)
  5111. };
  5112. $n.playSoundtrack = function(e, t) {
  5113. null == t && (t = 1);
  5114. var n = Kn.assets.getSound($n.soundsFolder + "/" + e);
  5115. null != $n.cSoundtrackPlayback ? $n.cSoundtrackPlayback.get_sound() != n && ($n.cSoundtrackVolume = t, $n.cSoundtrackPlayback = n.loop(t)) : ($n.cSoundtrackVolume = t, $n.cSoundtrackPlayback = n.loop(t));
  5116. return $n.cSoundtrackPlayback
  5117. };
  5118. $n.muteSoundtrack = function() {
  5119. null != $n.cSoundtrackPlayback && ($n.cSoundtrackPlayback.volume.animateTo(0, 1), Kn.addDelay(null, .8, function() {
  5120. $n.cSoundtrackPlayback.set_paused(!0)
  5121. }, !1))
  5122. };
  5123. $n.unmuteSoundtrack = function() {
  5124. null != $n.cSoundtrackPlayback && !$n.isMuted && ($n.cSoundtrackPlayback.set_paused(!1), $n.cSoundtrackPlayback.volume.animateTo($n.cSoundtrackVolume, 1))
  5125. };
  5126. $n.muteAll = function() {
  5127. $n.isMuted ? ($n.isMuted = !1, $n.unmuteSoundtrack(), P.volume.animateTo(1, 0)) : ($n.isMuted = !0, $n.muteSoundtrack(), P.volume.animateTo(0, 1))
  5128. };
  5129. var Jn = function() {};
  5130. r["yzi.Tweener"] = Jn;
  5131. Jn.__name__ = ["yzi", "Tweener"];
  5132. Jn.to = function(e, t, n, r, i, s) {
  5133. null == r && (r = 0);
  5134. F;
  5135. var o = new wn;
  5136. 0 > r && (r = 0);
  5137. if (0 == t && 0 == r) Jn.apply(e, n, i);
  5138. else {
  5139. if (0 == t && 0 < r) {
  5140. var u = new T;
  5141. 0 != r && o.add(new vn(r));
  5142. o.add(new dn(function() {
  5143. Jn.apply(e, n, i);
  5144. u.dispose()
  5145. }));
  5146. t = new yn;
  5147. P.root.addChild(u.add(t))
  5148. } else {
  5149. 0 < r && o.add(new vn(r));
  5150. for (var r = [], a = 0, f = v.fields(n); a < f.length;) {
  5151. var l = f[a];
  5152. ++a;
  5153. var c = v.getProperty(e, l);
  5154. r.push(new pn(c, v.field(n, l), t, s))
  5155. }
  5156. s = new mn(r);
  5157. o.add(s);
  5158. var h = new T;
  5159. o.add(new vn(t));
  5160. o.add(new dn(function() {
  5161. null != i && i();
  5162. h.dispose()
  5163. }));
  5164. t = new yn;
  5165. P.root.addChild(h.add(t))
  5166. }
  5167. t.run(o)
  5168. }
  5169. };
  5170. Jn.apply = function(e, t, n) {
  5171. for (var r = 0, i = v.fields(t); r < i.length;) {
  5172. var s = i[r];
  5173. ++r;
  5174. var o = v.getProperty(e, s);
  5175. In.__cast(o, D).set__(v.field(t, s))
  5176. }
  5177. null != n && n()
  5178. };
  5179. var Kn = function(e, t) {
  5180. this.init = new Ln;
  5181. var r = this;
  5182. Kn.width = e;
  5183. Kn.height = t;
  5184. Kn.halfWidth = e / 2 | 0;
  5185. Kn.halfHeight = t / 2 | 0;
  5186. Kn.director = (new T).add(new J).add((new sn).setSize(Kn.width, Kn.height));
  5187. P.root.addChild(Kn.director);
  5188. this.systemBg = Kn.initFillSpriteComp(0, 0, Kn.systemBgColor, 0, 0, 1, !1);
  5189. P.root.add(this.systemBg);
  5190. this.leftBorder = Kn.addFillSprite(P.root, 0, 0, Kn.systemBgColor, 0, 0, 1, !1)._compMap.Sprite_0;
  5191. this.rightBorder = Kn.addFillSprite(P.root, 0, 0, Kn.systemBgColor, 0, 0, 1, !1)._compMap.Sprite_0;
  5192. this.topBorder = Kn.addFillSprite(P.root, 0, 0, Kn.systemBgColor, 0, 0, 1, !1)._compMap.Sprite_0;
  5193. this.bottomBorder = Kn.addFillSprite(P.root, 0, 0, Kn.systemBgColor, 0, 0, 1, !1)._compMap.Sprite_0;
  5194. P.loadAssetPack(V.fromAssets("boot")).get(function(e) {
  5195. Kn.assets = e;
  5196. e = Kn.addFillSprite(P.root, 0, 0, 1118481, P._platform.getStage().get_width(), P._platform.getStage().get_height(), 1, !1);
  5197. r.rotPhonePrompt = e._compMap.Sprite_0;
  5198. e = Kn.addImageSprite(r.rotPhonePrompt.owner, 0, 0, "rot_phone")._compMap.Sprite_0;
  5199. Kn.defaultOrientation == it.Landscape && e.setRotation(90);
  5200. (Kn.defaultOrientation == P._platform.getStage().orientation._value || null == P._platform.getStage().orientation._value) && r.rotPhonePrompt.set_visible(!1);
  5201. P._platform.getStage().lockOrientation(Kn.defaultOrientation);
  5202. P._platform.getStage().requestFullscreen(!0);
  5203. P._platform.getStage().orientation.get_changed().connect(n(r, r.onOrientationChange));
  5204. P._platform.getStage().resize.connect(n(r, r.onResize));
  5205. r.onResize();
  5206. r.initPreloaderScene()
  5207. })
  5208. };
  5209. r["yzi.YZI"] = Kn;
  5210. Kn.__name__ = ["yzi", "YZI"];
  5211. Kn.onResizeCallback = function() {};
  5212. Kn.onOrientationChangeCallback = function() {};
  5213. Kn.goToScene = function(e, t) {
  5214. null == t && (t = new fn(.5, F.quadOut));
  5215. Kn.director._compMap.Director_5.unwindToScene(e, t)
  5216. };
  5217. Kn.pushScene = function(e, t) {
  5218. null == t && (t = new fn(.5, F.quadOut));
  5219. Kn.director._compMap.Director_5.pushScene(e, t)
  5220. };
  5221. Kn.popScene = function(e) {
  5222. null == e && (e = new fn(.5, F.quadOut));
  5223. Kn.director._compMap.Director_5.popScene(e)
  5224. };
  5225. Kn.saveData = function(e, t) {
  5226. return P._platform.getStorage().set(e, t)
  5227. };
  5228. Kn.loadData = function(e) {
  5229. return P._platform.getStorage().get(e)
  5230. };
  5231. Kn.initFillSpriteComp = function(e, t, n, r, i, s, o) {
  5232. null == o && (o = !0);
  5233. null == s && (s = 1);
  5234. n = new K(n, r, i);
  5235. n.setXY(e, t);
  5236. n.setAlpha(s);
  5237. o && n.centerAnchor();
  5238. return n
  5239. };
  5240. Kn.initImageSpriteComp = function(e, t, n, r, i, s) {
  5241. null == s && (s = !0);
  5242. null == i && (i = 1);
  5243. null == r && (r = 1);
  5244. n = new rt(Kn.assets.getTexture(n));
  5245. n.setXY(e, t);
  5246. n.setScale(r);
  5247. n.setAlpha(i);
  5248. s && n.centerAnchor();
  5249. return n
  5250. };
  5251. Kn.initTextSpriteComp = function(e, t, n, r, i, s, o) {
  5252. null == o && (o = "");
  5253. null == s && (s = !1);
  5254. null == i && (i = 1);
  5255. null == r && (r = 1);
  5256. null == n && (n = "Label");
  5257. "" == o && (o = Kn.defaultFont);
  5258. n = new ut(new G(Kn.assets, o), n);
  5259. n.setXY(e, t);
  5260. n.setScale(r);
  5261. n.setAlpha(i);
  5262. s && n.centerAnchor();
  5263. return n
  5264. };
  5265. Kn.addFillSprite = function(e, t, n, r, i, s, o, u) {
  5266. null == u && (u = !0);
  5267. null == o && (o = 1);
  5268. var a = new T;
  5269. a.add(new x);
  5270. a.add(Kn.initFillSpriteComp(t, n, r, i, s, o, u));
  5271. null != e && e.addChild(a);
  5272. return a
  5273. };
  5274. Kn.addImageSprite = function(e, t, n, r, i, s, o) {
  5275. null == o && (o = !0);
  5276. null == s && (s = 1);
  5277. null == i && (i = 1);
  5278. var u = new T;
  5279. u.add(new x);
  5280. u.add(Kn.initImageSpriteComp(t, n, r, i, s, o));
  5281. null != e && e.addChild(u);
  5282. return u
  5283. };
  5284. Kn.addLabel = function(e, t, n, r, i, s, o, u) {
  5285. null == u && (u = "");
  5286. null == o && (o = !1);
  5287. null == s && (s = 1);
  5288. null == i && (i = 1);
  5289. null == r && (r = "Label");
  5290. var a = new T;
  5291. a.add(new x);
  5292. a.add(Kn.initTextSpriteComp(t, n, r, i, s, o, u));
  5293. null != e && e.addChild(a);
  5294. return a
  5295. };
  5296. Kn.addButton = function(e, t, n, r, i, s, o, u) {
  5297. null == u && (u = 1);
  5298. null == o && (o = 1);
  5299. null == s && (s = "");
  5300. var a = Kn.addImageSprite(e, t, n, r, o, u, !0);
  5301. a.add(new yn);
  5302. "" != s && (Kn.addImageSprite(a, 0, 0, s, 1, 1, !1), a.firstChild._compMap.Sprite_0.set_visible(!1));
  5303. var f = new wn;
  5304. f.add(new dn(function() {
  5305. a._compMap.Sprite_0.scaleX.animateTo(1.15, .2, F.backOut);
  5306. a._compMap.Sprite_0.scaleY.animateTo(1.15, .2, F.backOut)
  5307. }));
  5308. f.add(new vn(.2));
  5309. f.add(new dn(function() {
  5310. a._compMap.Sprite_0.scaleX.animateTo(1, .1, F.quadIn);
  5311. a._compMap.Sprite_0.scaleY.animateTo(1, .1, F.quadIn)
  5312. }));
  5313. a._compMap.Disposer_2.connect1(a._compMap.Sprite_0.get_pointerDown(), function() {
  5314. a._compMap.Script_3.run(f)
  5315. });
  5316. a._compMap.Disposer_2.connect1(a._compMap.Sprite_0.get_pointerUp(), function() {
  5317. "" != s && (0 == (a.firstChild._compMap.Sprite_0._flags & 1) ? a.firstChild._compMap.Sprite_0.set_visible(!0) : a.firstChild._compMap.Sprite_0.set_visible(!1));
  5318. "" != Kn.buttonClickSfx && $n.playSfx(Kn.buttonClickSfx, .4);
  5319. null != i && i()
  5320. });
  5321. return a
  5322. };
  5323. Kn.addDelay = function(e, t, n, r) {
  5324. var i = new T,
  5325. s = new wn;
  5326. s.add(new vn(t));
  5327. s.add(new dn(function() {
  5328. null != n && n();
  5329. r || i.dispose()
  5330. }));
  5331. t = new yn;
  5332. i.add(new x);
  5333. i.add(t);
  5334. null != e && e.addChild(i);
  5335. r ? t.run(new gn(s)) : t.run(s);
  5336. return i
  5337. };
  5338. Kn.rand = function(e) {
  5339. return m.random(e)
  5340. };
  5341. Kn.randSign = function() {
  5342. var e = 1;
  5343. 0 == m.random(2) && (e = -1);
  5344. return e
  5345. };
  5346. Kn.prototype = {
  5347. onResize: function() {
  5348. var e = P._platform.getStage().get_width(),
  5349. t = P._platform.getStage().get_height(),
  5350. n = Math.min(e / Kn.width, t / Kn.height);
  5351. Kn.director._compMap.Sprite_0.setXY(.5 * e - .5 * n * Kn.width, .5 * t - .5 * n * Kn.height);
  5352. Kn.director._compMap.Sprite_0.setScale(n);
  5353. var r = Kn.director._compMap.Sprite_0.x._value,
  5354. i = Kn.director._compMap.Sprite_0.y._value;
  5355. this.systemBg.setXY(0, 0);
  5356. this.systemBg.setSize(e, t);
  5357. this.leftBorder.setXY(0, i);
  5358. this.leftBorder.setSize(r, t - 2 * i);
  5359. this.rightBorder.setXY(e - r, i);
  5360. this.rightBorder.setSize(r, t - 2 * i);
  5361. this.topBorder.setXY(0, 0);
  5362. this.topBorder.setSize(e, i);
  5363. this.bottomBorder.setXY(0, t - i);
  5364. this.bottomBorder.setSize(e, i);
  5365. Kn.onResizeCallback();
  5366. this.rotPhonePrompt.setXY(0, 0);
  5367. this.rotPhonePrompt.setSize(P._platform.getStage().get_width(), P._platform.getStage().get_height());
  5368. this.rotPhonePrompt.owner.firstChild._compMap.Sprite_0.setXY(this.rotPhonePrompt.width._value / 2, this.rotPhonePrompt.height._value / 2);
  5369. this.rotPhonePrompt.owner.firstChild._compMap.Sprite_0.setScale(n)
  5370. },
  5371. onOrientationChange: function(e) {
  5372. Kn.onOrientationChangeCallback();
  5373. Kn.defaultOrientation != e ? this.rotPhonePrompt.set_visible(!0) : this.rotPhonePrompt.set_visible(!1)
  5374. },
  5375. initPreloaderScene: function() {
  5376. var e = this,
  5377. t = Kn.width - 150,
  5378. n = (new T).add(new ln),
  5379. r = Kn.addFillSprite(n, 0, 0, 1118481, Kn.width, Kn.height, 1, !1),
  5380. i = Kn.addFillSprite(r, Kn.halfWidth, Kn.halfHeight, 16777215, t, 50),
  5381. s = Kn.addFillSprite(i, 4, 4, 1118481, 0, 42, 1, !1),
  5382. o = P.loadAssetPack(V.fromAssets("main"));
  5383. o.get(function(t) {
  5384. Kn.assets = t;
  5385. Kn.settings = Cn.parse(t.getFile("settings.ini").toString());
  5386. n.removeChild(i);
  5387. e.init.emit()
  5388. });
  5389. o.progressChanged.connect(function() {
  5390. var e = o._progress / o._total;
  5391. 1 < e && (e = 1);
  5392. s._compMap.Sprite_0.width.set__(e * (t - 8))
  5393. });
  5394. Kn.goToScene(n)
  5395. },
  5396. __class__: Kn
  5397. };
  5398. var Qn = 0;
  5399. Math.NaN = Number.NaN;
  5400. Math.NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY;
  5401. Math.POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
  5402. r.Math = Math;
  5403. Math.isFinite = function(e) {
  5404. return isFinite(e)
  5405. };
  5406. Math.isNaN = function(e) {
  5407. return isNaN(e)
  5408. };
  5409. String.prototype.__class__ = r.String = String;
  5410. String.__name__ = ["String"];
  5411. r.Array = Array;
  5412. Array.__name__ = ["Array"];
  5413. Date.prototype.__class__ = r.Date = Date;
  5414. Date.__name__ = ["Date"];
  5415. var Gn = r.Int = {
  5416. __name__: ["Int"]
  5417. },
  5418. Yn = r.Dynamic = {
  5419. __name__: ["Dynamic"]
  5420. },
  5421. Zn = r.Float = Number;
  5422. Zn.__name__ = ["Float"];
  5423. var er = r.Bool = Boolean;
  5424. er.__ename__ = ["Bool"];
  5425. var tr = r.Class = {
  5426. __name__: ["Class"]
  5427. },
  5428. nr = {};
  5429. o.HI_SCORE = 0;
  5430. a.dirs = [new u(0, -1), new u(0, 1), new u(1, 0), new u(-1, 0)];
  5431. a.pieceWidth = 70;
  5432. a.pieceHeight = 70;
  5433. a.gap = 0;
  5434. a.offsetX = 0;
  5435. a.offsetY = 220;
  5436. a.pieceTypes = 5;
  5437. a.minMatchForBonus = 6;
  5438. f.canMakeAction = !0;
  5439. k.instance = new k;
  5440. O.DISPATCHING_SENTINEL = new A(null, null);
  5441. P.root = new T;
  5442. P.uncaughtError = new _;
  5443. P.hidden = new L(!1);
  5444. P.volume = new D(1);
  5445. P._platform = k.instance;
  5446. P._calledInit = !1;
  5447. V.__meta__ = {
  5448. obj: {
  5449. assets: [{
  5450. main: [{
  5451. bytes: 4502,
  5452. md5: "1a07e1b8bd85ac57302a7f6943252f1b",
  5453. name: "bar1_bg.png"
  5454. }, {
  5455. bytes: 3900,
  5456. md5: "d158ec68f183f19e1a667d33cb2a5e99",
  5457. name: "bar1_fill.png"
  5458. }, {
  5459. bytes: 4282,
  5460. md5: "b2a3b7fa65a9f33964e3a1753bcbd7f2",
  5461. name: "bar2_bg.png"
  5462. }, {
  5463. bytes: 3665,
  5464. md5: "db7b4625dc8c124172a30d7248914017",
  5465. name: "bar2_fill.png"
  5466. }, {
  5467. bytes: 10470,
  5468. md5: "6d8e31007cf845b7a413458015586e7b",
  5469. name: "bl0.png"
  5470. }, {
  5471. bytes: 10144,
  5472. md5: "dacb277a99d15cdbcc356e3d00b1af3e",
  5473. name: "bl1.png"
  5474. }, {
  5475. bytes: 10448,
  5476. md5: "c49f2cdd7fd13f28990d61df73f7f1c7",
  5477. name: "bl2.png"
  5478. }, {
  5479. bytes: 9871,
  5480. md5: "70689a46fd2a9a7228fbb4a174bb245a",
  5481. name: "bl3.png"
  5482. }, {
  5483. bytes: 9981,
  5484. md5: "7466a42e9c2d50611cf78d22c0d55378",
  5485. name: "bl4.png"
  5486. }, {
  5487. bytes: 9360,
  5488. md5: "87eb9e9ae2bf7c4bae9c5a70d3623d7c",
  5489. name: "bl5.png"
  5490. }, {
  5491. bytes: 9330,
  5492. md5: "9ebc4e7a4ae6c923fb2dd5277fec55c6",
  5493. name: "bl6.png"
  5494. }, {
  5495. bytes: 9248,
  5496. md5: "598433035f5fcbf72949d9b27e2f69b6",
  5497. name: "bl7.png"
  5498. }, {
  5499. bytes: 9237,
  5500. md5: "23de6d2dc69da478422a56bb4d166752",
  5501. name: "bl8.png"
  5502. }, {
  5503. bytes: 9129,
  5504. md5: "97bb837096b10a28cda9ab5f3adafe50",
  5505. name: "bl9.png"
  5506. }, {
  5507. bytes: 4492,
  5508. md5: "1dbd656bdfcd2bdb665d2c0daf8b46e0",
  5509. name: "bonus_marker.png"
  5510. }, {
  5511. bytes: 2797,
  5512. md5: "60a6a8d9c1630acfc695f5eea0664bce",
  5513. name: "default_font1.fnt"
  5514. }, {
  5515. bytes: 8254,
  5516. md5: "7f35e4863f2abe5207e4625449183cf0",
  5517. name: "default_font1.png"
  5518. }, {
  5519. bytes: 8620,
  5520. md5: "dcbd02ae6f63af09d6a7fe617d66c2fe",
  5521. name: "font2.fnt"
  5522. }, {
  5523. bytes: 52839,
  5524. md5: "508510075cfdc25011c449c5a3dce79e",
  5525. name: "font2.png"
  5526. }, {
  5527. bytes: 2789,
  5528. md5: "695a163add424d6b95932d8ecfe822e2",
  5529. name: "font3.fnt"
  5530. }, {
  5531. bytes: 7569,
  5532. md5: "3715a569408118acc6456f1b26f48d07",
  5533. name: "font3.png"
  5534. }, {
  5535. bytes: 215286,
  5536. md5: "ae4bf05b601d87257526ff0ade180af9",
  5537. name: "game_scene_bg.png"
  5538. }, {
  5539. bytes: 80614,
  5540. md5: "95bf85cd975bf0ab4c1f184a82a05e00",
  5541. name: "game_title.png"
  5542. }, {
  5543. bytes: 124840,
  5544. md5: "e57a33a0b70b5e9a7c8fdc41cac906b1",
  5545. name: "help_info.png"
  5546. }, {
  5547. bytes: 12048,
  5548. md5: "f25d83ad9fa23ebd909eb1f390e1f5c4",
  5549. name: "home_btn.png"
  5550. }, {
  5551. bytes: 3768,
  5552. md5: "935abfbea4723840a3e86879a7a377bd",
  5553. name: "hud_bg.png"
  5554. }, {
  5555. bytes: 9386,
  5556. md5: "9c9bea8879710a27ec2ed7dc676c7aba",
  5557. name: "pause_btn.png"
  5558. }, {
  5559. bytes: 17551,
  5560. md5: "6a40697b164d720c573667f9ccac9d87",
  5561. name: "play_btn.png"
  5562. }, {
  5563. bytes: 19888,
  5564. md5: "581e716809709e6247b69ad9d3b0ecb5",
  5565. name: "play_btn2.png"
  5566. }, {
  5567. bytes: 9260,
  5568. md5: "e87c61b2acc5abafa79bfb9529672a71",
  5569. name: "push_btn.png"
  5570. }, {
  5571. bytes: 11724,
  5572. md5: "9558da2f1295b321c8b9b0bb846f6ade",
  5573. name: "replay_btn.png"
  5574. }, {
  5575. bytes: 8170,
  5576. md5: "11d79da76c6e9f6d0d4d305f7d111062",
  5577. name: "score_icon.png"
  5578. }, {
  5579. bytes: 12,
  5580. md5: "dc8056702323802c70172d6227ecff26",
  5581. name: "settings.ini"
  5582. }, {
  5583. bytes: 12139,
  5584. md5: "8f2205d16e919e14420292efeed78868",
  5585. name: "sound_off_btn.png"
  5586. }, {
  5587. bytes: 12222,
  5588. md5: "e8d46c16b669fc7ba6ecfa7cecc37778",
  5589. name: "sound_on_btn.png"
  5590. }, {
  5591. bytes: 11319,
  5592. md5: "101279fccc260cb7badc168e2c1d50b3",
  5593. name: "sounds/bonus_sfx.mp3"
  5594. }, {
  5595. bytes: 15705,
  5596. md5: "492f3aafc9acc2b8c3b5bad8e2f17747",
  5597. name: "sounds/button_click_sfx.mp3"
  5598. }, {
  5599. bytes: 57710,
  5600. md5: "0f9d57525bd6973c3b40a133ebd1dd12",
  5601. name: "sounds/game_over_sfx.mp3"
  5602. }, {
  5603. bytes: 74010,
  5604. md5: "a8a348dd23303bf14ad040ce7e9b0856",
  5605. name: "sounds/level_end_sfx.mp3"
  5606. }, {
  5607. bytes: 8182,
  5608. md5: "0a371ce975a643d632f309a20a0eb90f",
  5609. name: "sounds/no_match_sfx.mp3"
  5610. }, {
  5611. bytes: 16332,
  5612. md5: "37f74f6a6c5a74b34213e1880f5c1477",
  5613. name: "sounds/pop_sfx.mp3"
  5614. }, {
  5615. bytes: 385324,
  5616. md5: "4ebc4263412e80d7ff60ed3ac82e01a2",
  5617. name: "sounds/soundtrack1.mp3"
  5618. }, {
  5619. bytes: 49489,
  5620. md5: "662133e46b53ed6e96a34a220051dfa5",
  5621. name: "spikes_block.png"
  5622. }],
  5623. boot: [{
  5624. bytes: 12539,
  5625. md5: "8ff68b1f9e1dc38d7cb46c0defb7539e",
  5626. name: "rot_phone.png"
  5627. }]
  5628. }]
  5629. }
  5630. };
  5631. V._supportsCrossOrigin = function() {
  5632. var e;
  5633. e = 0 <= window.navigator.userAgent.indexOf("Linux; U; Android") ? !1 : null != (new XMLHttpRequest).withCredentials;
  5634. e || null;
  5635. return e
  5636. }();
  5637. J._scratchPoint = new u;
  5638. G.NEWLINE = new Q(10);
  5639. St._sharedEvent = new lt;
  5640. Tt._sharedEvent = new ht;
  5641. Xt.CANVAS_TEXTURES = (new s("(iPhone|iPod|iPad)", "")).match(window.navigator.userAgent);
  5642. Jt._mediaRefCount = 0;
  5643. Jt._detectBlobSupport = !0;
  5644. tn.VENDOR_PREFIXES = ["webkit", "moz", "ms", "o", "khtml"];
  5645. tn.SHOULD_HIDE_MOBILE_BROWSER = window.top == window && (new s("Mobile(/.*)? Safari", "")).match(window.navigator.userAgent);
  5646. nn._detectSupport = !0;
  5647. Mn.USE_CACHE = !1;
  5648. Mn.USE_ENUM_INDEX = !1;
  5649. Mn.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:";
  5650. _n.DEFAULT_RESOLVER = w;
  5651. _n.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:";
  5652. Pn.count = 0;
  5653. Un.cLevel = 1;
  5654. $n.soundsFolder = "sounds";
  5655. $n.isMuted = !1;
  5656. Kn.defaultOrientation = it.Portrait;
  5657. Kn.defaultFont = "default_font1";
  5658. Kn.systemBgColor = 0;
  5659. Kn.buttonClickSfx = "";
  5660. p.main()
  5661. })()