game.min.js 510 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749
  1. var isNeedFpsMeter = !1,
  2. isLevelEditor = !1,
  3. isSkipMenus = !1,
  4. isSkipReadyWin = !0,
  5. autoLevelToLoad = 1,
  6. isLastLevelLoad = !1,
  7. isDisableWin = !1,
  8. isOpenAllLevels = !1,
  9. openedLevels = 20,
  10. isPhysicsDebugDraw = !1,
  11. isGetAllProperties = !1,
  12. isLoadAnimFromJSON = !1,
  13. isSkipSplash = !0,
  14. isShowLogo = !0,
  15. isLevelSelectShow = !1,
  16. spriteScale = 1,
  17. isWithCache = !1,
  18. isTimerUpdateMode = !1,
  19. isPageLeaved = !1,
  20. isNeedHelperLabel = !1,
  21. isDesktopBrowser = !1,
  22. isLowQuality = !1,
  23. isDesignerSettingsPreferred = !0,
  24. STORAGE_PREFIX = "Soccer23",
  25. isMobileOnlyResize = !1,
  26. // SPONSOR_URL = "http://play68.com",
  27. PRELOADER_LOGO = "logo_spele.png",
  28. HERO_TYPE = 0,
  29. HERO_DOC_TYPE = 1,
  30. HERO_WOMAN_TYPE = 2,
  31. MONSTER_TYPE = 3,
  32. DECOR_BALK_1_TYPE = 21,
  33. DECOR_BALK_2_TYPE = 22,
  34. DECOR_BALK_3_TYPE = 23,
  35. DECOR_BALK_4_TYPE = 24,
  36. DECOR_BALK_5_TYPE = 25,
  37. DECOR_LAND_TYPE = 26,
  38. DECOR_HOUSE_TYPE = 27,
  39. DECOR_KUST_TYPE = 28,
  40. DECOR_ZABOR_TYPE = 29,
  41. DECOR_MELNICA_TYPE = 30,
  42. DECOR_MELNICA_ROT_TYPE = 31,
  43. DECOR_ARROW_TYPE = 32,
  44. DECOR_HOUSE_2_TYPE = 33,
  45. DECOR_COW_TYPE = 34,
  46. DECOR_CIRCUS_TYPE = 35,
  47. DECOR_HOUSE_3_TYPE = 36,
  48. DECOR_HOUSE_4_TYPE = 37,
  49. DECOR_BALK_6_TYPE = 38,
  50. DECOR_WINDOW_TYPE = 39,
  51. DECOR_CAT_1_TYPE =
  52. 40,
  53. DECOR_CAT_2_TYPE = 41,
  54. DECOR_GRAM_TYPE = 42,
  55. DECOR_PICT_1_TYPE = 43,
  56. DECOR_FLOWER_1_TYPE = 44,
  57. DECOR_VENT_TYPE = 45,
  58. DECOR_ELECTR_TYPE = 46,
  59. DECOR_DOOR_TYPE = 47,
  60. DECOR_PICT_2_TYPE = 48,
  61. DECOR_SVECHA_TYPE = 49,
  62. DECOR_TABLE_TYPE = 50,
  63. DECOR_STUL_TYPE = 51,
  64. DECOR_PICT_3_TYPE = 52,
  65. DECOR_VESHALKA_TYPE = 53,
  66. DECOR_VELO_TYPE = 54,
  67. DECOR_COVER_TYPE = 55,
  68. DECOR_BALK_7_TYPE = 56,
  69. DECOR_HELP_1_TYPE = 57,
  70. PHYSICS_RECT_TYPE = 100,
  71. DYNAMIC_BOX_TYPE = 101,
  72. TELEPORT_TYPE = 102,
  73. BOMB_TYPE = 103,
  74. DANGER_TYPE = 104,
  75. PHYSICS_MAN_BLOCK_TYPE = 105,
  76. PHYSICS_WOMAN_BLOCK_TYPE = 106,
  77. GLASS_BLOCK_TYPE =
  78. 107,
  79. ACTIVATOR_TYPE = 108,
  80. DOOR_TYPE = 109,
  81. DYNAMIC_CIRCLE_TYPE = 110,
  82. DYNAMIC_RECT_TYPE = 111,
  83. TELEGA_TYPE = 112,
  84. DYNAMIC_TRIANGLE_TYPE = 113,
  85. MOVABLE_BALK_TYPE = 114,
  86. FAN_TYPE = 115,
  87. GLASS_BOX_TYPE = 116,
  88. GLASS_TRIANGLE_TYPE = 117,
  89. HARD_BOX_TYPE = 118,
  90. HARD_RECT_TYPE = 119,
  91. HARD_TRIANGLE_TYPE = 120,
  92. STATIC_BALK_1_TYPE = 121,
  93. LAND_TYPE = 122,
  94. STATIC_BOX_TYPE = 123,
  95. BONUS_DIAMOND_TYPE = 201,
  96. BONUS_MONEY_TYPE = 202,
  97. BONUS_STAR_TYPE = 203,
  98. BONUS_GHOST_TYPE = 204,
  99. AIM_TYPE = 301,
  100. STATIC_CATEGORY = 1,
  101. WOMAN_CATEGORY = 2,
  102. MAN_CATEGORY = 4,
  103. WOMAN_BLOCK_CATEGORY = 8,
  104. MAN_BLOCK_CATEGORY =
  105. 16,
  106. FAN_ACTIV_DISTANCE = 130,
  107. FAN_MAX_FORCE = 40,
  108. GLASS_BREAK_VELOCITY = 70;
  109. this.createjs = this.createjs || {};
  110. (function () {
  111. var c = function (b, c, a) {
  112. this.initialize(b, c, a)
  113. },
  114. a = c.prototype;
  115. a.type = null;
  116. a.target = null;
  117. a.currentTarget = null;
  118. a.eventPhase = 0;
  119. a.bubbles = !1;
  120. a.cancelable = !1;
  121. a.timeStamp = 0;
  122. a.defaultPrevented = !1;
  123. a.propagationStopped = !1;
  124. a.immediatePropagationStopped = !1;
  125. a.removed = !1;
  126. a.initialize = function (b, c, a) {
  127. this.type = b;
  128. this.bubbles = c;
  129. this.cancelable = a;
  130. this.timeStamp = (new Date)
  131. .getTime()
  132. };
  133. a.preventDefault = function () {
  134. this.defaultPrevented = !0
  135. };
  136. a.stopPropagation = function () {
  137. this.propagationStopped = !0
  138. };
  139. a.stopImmediatePropagation =
  140. function () {
  141. this.immediatePropagationStopped = this.propagationStopped = !0
  142. };
  143. a.remove = function () {
  144. this.removed = !0
  145. };
  146. a.clone = function () {
  147. return new c(this.type, this.bubbles, this.cancelable)
  148. };
  149. a.toString = function () {
  150. return "[Event (type=" + this.type + ")]"
  151. };
  152. createjs.Event = c
  153. })();
  154. this.createjs = this.createjs || {};
  155. (function () {
  156. var c = function () {},
  157. a = c.prototype;
  158. c.initialize = function (b) {
  159. b.addEventListener = a.addEventListener;
  160. b.on = a.on;
  161. b.removeEventListener = b.off = a.removeEventListener;
  162. b.removeAllEventListeners = a.removeAllEventListeners;
  163. b.hasEventListener = a.hasEventListener;
  164. b.dispatchEvent = a.dispatchEvent;
  165. b._dispatchEvent = a._dispatchEvent
  166. };
  167. a._listeners = null;
  168. a._captureListeners = null;
  169. a.initialize = function () {};
  170. a.addEventListener = function (b, c, a) {
  171. var d;
  172. d = a ? this._captureListeners = this._captureListeners || {} : this._listeners =
  173. this._listeners || {};
  174. var e = d[b];
  175. e && this.removeEventListener(b, c, a);
  176. (e = d[b]) ? e.push(c) : d[b] = [c];
  177. return c
  178. };
  179. a.on = function (b, c, a, d, e, h) {
  180. c.handleEvent && (a = a || c, c = c.handleEvent);
  181. a = a || this;
  182. return this.addEventListener(b, function (b) {
  183. c.call(a, b, e);
  184. d && b.remove()
  185. }, h)
  186. };
  187. a.removeEventListener = function (b, c, a) {
  188. if (a = a ? this._captureListeners : this._listeners) {
  189. var d = a[b];
  190. if (d)
  191. for (var e = 0, h = d.length; e < h; e++)
  192. if (d[e] == c) {
  193. 1 == h ? delete a[b] : d.splice(e, 1);
  194. break
  195. }
  196. }
  197. };
  198. a.off = a.removeEventListener;
  199. a.removeAllEventListeners = function (b) {
  200. b ?
  201. (this._listeners && delete this._listeners[b], this._captureListeners && delete this._captureListeners[b]) : this._listeners = this._captureListeners = null
  202. };
  203. a.dispatchEvent = function (b, c) {
  204. if ("string" == typeof b) {
  205. var a = this._listeners;
  206. if (!a || !a[b]) return !1;
  207. b = new createjs.Event(b)
  208. }
  209. b.target = c || this;
  210. if (b.bubbles && this.parent) {
  211. for (var d = this, a = [d]; d.parent;) a.push(d = d.parent);
  212. for (var e = a.length, d = e - 1; 0 <= d && !b.propagationStopped; d--) a[d]._dispatchEvent(b, 1 + (0 == d));
  213. for (d = 1; d < e && !b.propagationStopped; d++) a[d]._dispatchEvent(b,
  214. 3)
  215. } else this._dispatchEvent(b, 2);
  216. return b.defaultPrevented
  217. };
  218. a.hasEventListener = function (b) {
  219. var c = this._listeners,
  220. a = this._captureListeners;
  221. return !!(c && c[b] || a && a[b])
  222. };
  223. a.toString = function () {
  224. return "[EventDispatcher]"
  225. };
  226. a._dispatchEvent = function (b, c) {
  227. var a, d = 1 == c ? this._captureListeners : this._listeners;
  228. if (b && d && (d = d[b.type]) && (a = d.length)) {
  229. b.currentTarget = this;
  230. b.eventPhase = c;
  231. b.removed = !1;
  232. for (var d = d.slice(), e = 0; e < a && !b.immediatePropagationStopped; e++) {
  233. var h = d[e];
  234. h.handleEvent ? h.handleEvent(b) : h(b);
  235. b.removed &&
  236. (this.off(b.type, h, 1 == c), b.removed = !1)
  237. }
  238. }
  239. };
  240. createjs.EventDispatcher = c
  241. })();
  242. this.createjs = this.createjs || {};
  243. (function () {
  244. createjs.indexOf = function (c, a) {
  245. for (var b = 0, g = c.length; b < g; b++)
  246. if (a === c[b]) return b;
  247. return -1
  248. }
  249. })();
  250. this.createjs = this.createjs || {};
  251. (function () {
  252. var c = function () {
  253. throw "UID cannot be instantiated";
  254. };
  255. c._nextID = 0;
  256. c.get = function () {
  257. return c._nextID++
  258. };
  259. createjs.UID = c
  260. })();
  261. this.createjs = this.createjs || {};
  262. (function () {
  263. var c = function () {
  264. throw "Ticker cannot be instantiated.";
  265. };
  266. c.RAF_SYNCHED = "synched";
  267. c.RAF = "raf";
  268. c.TIMEOUT = "timeout";
  269. c.useRAF = !1;
  270. c.timingMode = null;
  271. c.maxDelta = 60;
  272. c.removeEventListener = null;
  273. c.removeAllEventListeners = null;
  274. c.dispatchEvent = null;
  275. c.hasEventListener = null;
  276. c._listeners = null;
  277. createjs.EventDispatcher.initialize(c);
  278. c._addEventListener = c.addEventListener;
  279. c.addEventListener = function () {
  280. !c._inited && c.init();
  281. return c._addEventListener.apply(c, arguments)
  282. };
  283. c._paused = !1;
  284. c._inited = !1;
  285. c._startTime =
  286. 0;
  287. c._pausedTime = 0;
  288. c._ticks = 0;
  289. c._pausedTicks = 0;
  290. c._interval = 50;
  291. c._lastTime = 0;
  292. c._times = [];
  293. c._tickTimes = [];
  294. c._timerId = null;
  295. c._raf = !0;
  296. c._isFirstInit = !0;
  297. c.init = function () {
  298. c._inited || (c._timerId = null, c._inited = !0, c._isFirstInit = !1, c._times = [], c._tickTimes = [], c._startTime = c._getTime(), c._times.push(c._lastTime = 0), c.setInterval(c._interval))
  299. };
  300. c.reset = function () {
  301. c._inited = !1;
  302. if (c._raf) {
  303. var b = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame ||
  304. window.msCancelAnimationFrame;
  305. b && b(c._timerId)
  306. } else clearTimeout(c._timerId)
  307. };
  308. c.setInterval = function (b) {
  309. c._interval = b;
  310. c._inited && c._setupTick()
  311. };
  312. c.getInterval = function () {
  313. return c._interval
  314. };
  315. c.setFPS = function (b) {
  316. c.setInterval(1E3 / b)
  317. };
  318. c.getFPS = function () {
  319. return 1E3 / c._interval
  320. };
  321. c.getMeasuredTickTime = function (b) {
  322. var a = 0,
  323. f = c._tickTimes;
  324. if (1 > f.length) return -1;
  325. b = Math.min(f.length, b || c.getFPS() | 0);
  326. for (var d = 0; d < b; d++) a += f[d];
  327. return a / b
  328. };
  329. c.getMeasuredFPS = function (b) {
  330. var a = c._times;
  331. if (2 > a.length) return -1;
  332. b = Math.min(a.length - 1, b || c.getFPS() | 0);
  333. return 1E3 / ((a[0] - a[b]) / b)
  334. };
  335. c.setPaused = function (b) {
  336. c._paused = b
  337. };
  338. c.getPaused = function () {
  339. return c._paused
  340. };
  341. c.getTime = function (b) {
  342. return c._getTime() - c._startTime - (b ? c._pausedTime : 0)
  343. };
  344. c.getEventTime = function (b) {
  345. return (c._lastTime || c._startTime) - (b ? c._pausedTime : 0)
  346. };
  347. c.getTicks = function (b) {
  348. return c._ticks - (b ? c._pausedTicks : 0)
  349. };
  350. c._handleSynch = function () {
  351. var b = c._getTime() - c._startTime;
  352. c._timerId = null;
  353. c._setupTick();
  354. b - c._lastTime >= 0.97 * (c._interval - 1) && c._tick()
  355. };
  356. c._handleRAF = function () {
  357. c._timerId = null;
  358. c._setupTick();
  359. c._tick()
  360. };
  361. c._handleTimeout = function () {
  362. c._timerId = null;
  363. c._setupTick();
  364. c._tick()
  365. };
  366. c._setupTick = function () {
  367. if (null != c._timerId) trace("duplicate");
  368. else {
  369. var b = c.timingMode || c.useRAF && c.RAF_SYNCHED;
  370. if (b == c.RAF_SYNCHED || b == c.RAF) {
  371. var a = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame;
  372. if (a) {
  373. c._timerId = a(b == c.RAF ? c._handleRAF : c._handleSynch);
  374. c._raf = !0;
  375. return
  376. }
  377. }
  378. c._raf = !1;
  379. c._timerId = setTimeout(c._handleTimeout, c._interval)
  380. }
  381. };
  382. c._tick = function () {
  383. var b = c._getTime() - c._startTime,
  384. a = b - c._lastTime,
  385. f = c._paused;
  386. c._ticks++;
  387. f && (c._pausedTicks++, c._pausedTime += a);
  388. c._lastTime = b;
  389. if (c.hasEventListener("tick")) {
  390. var d = new createjs.Event("tick"),
  391. e = c.maxDelta;
  392. d.delta = e && a > e ? e : a;
  393. d.paused = f;
  394. d.time = b;
  395. d.runTime = b - c._pausedTime;
  396. c.dispatchEvent(d)
  397. }
  398. for (c._tickTimes.unshift(c._getTime() - b); 100 < c._tickTimes.length;) c._tickTimes.pop();
  399. for (c._times.unshift(b); 100 < c._times.length;) c._times.pop()
  400. };
  401. var a = window.performance && (performance.now || performance.mozNow || performance.msNow || performance.oNow || performance.webkitNow);
  402. c._getTime = function () {
  403. return a && a.call(performance) || (new Date)
  404. .getTime()
  405. };
  406. createjs.Ticker = c
  407. })();
  408. this.createjs = this.createjs || {};
  409. (function () {
  410. var c = function (b, c, a, d, e, h, k, m, n, p) {
  411. this.initialize(b, c, a, d, e, h, k, m, n, p)
  412. },
  413. a = c.prototype = new createjs.Event;
  414. a.stageX = 0;
  415. a.stageY = 0;
  416. a.rawX = 0;
  417. a.rawY = 0;
  418. a.nativeEvent = null;
  419. a.pointerID = 0;
  420. a.primary = !1;
  421. a.addEventListener = null;
  422. a.removeEventListener = null;
  423. a.removeAllEventListeners = null;
  424. a.dispatchEvent = null;
  425. a.hasEventListener = null;
  426. a._listeners = null;
  427. createjs.EventDispatcher.initialize(a);
  428. a.Event_initialize = a.initialize;
  429. a.initialize = function (b, c, a, d, e, h, k, m, n, p) {
  430. this.Event_initialize(b, c, a);
  431. this.stageX =
  432. d;
  433. this.stageY = e;
  434. this.nativeEvent = h;
  435. this.pointerID = k;
  436. this.primary = m;
  437. this.rawX = null == n ? d : n;
  438. this.rawY = null == p ? e : p
  439. };
  440. a.clone = function () {
  441. return new c(this.type, this.bubbles, this.cancelable, this.stageX, this.stageY, this.target, this.nativeEvent, this.pointerID, this.primary, this.rawX, this.rawY)
  442. };
  443. a.toString = function () {
  444. return "[MouseEvent (type=" + this.type + " stageX=" + this.stageX + " stageY=" + this.stageY + ")]"
  445. };
  446. createjs.MouseEvent = c
  447. })();
  448. this.createjs = this.createjs || {};
  449. (function () {
  450. var c = function (b, c, a, d, e, h) {
  451. this.initialize(b, c, a, d, e, h)
  452. },
  453. a = c.prototype;
  454. c.identity = null;
  455. c.DEG_TO_RAD = Math.PI / 180;
  456. a.a = 1;
  457. a.b = 0;
  458. a.c = 0;
  459. a.d = 1;
  460. a.tx = 0;
  461. a.ty = 0;
  462. a.alpha = 1;
  463. a.shadow = null;
  464. a.compositeOperation = null;
  465. a.initialize = function (b, c, a, d, e, h) {
  466. this.a = null == b ? 1 : b;
  467. this.b = c || 0;
  468. this.c = a || 0;
  469. this.d = null == d ? 1 : d;
  470. this.tx = e || 0;
  471. this.ty = h || 0;
  472. return this
  473. };
  474. a.prepend = function (b, c, a, d, e, h) {
  475. var k = this.tx;
  476. if (1 != b || 0 != c || 0 != a || 1 != d) {
  477. var m = this.a,
  478. n = this.c;
  479. this.a = m * b + this.b * a;
  480. this.b = m * c + this.b * d;
  481. this.c = n * b + this.d *
  482. a;
  483. this.d = n * c + this.d * d
  484. }
  485. this.tx = k * b + this.ty * a + e;
  486. this.ty = k * c + this.ty * d + h;
  487. return this
  488. };
  489. a.append = function (b, c, a, d, e, h) {
  490. var k = this.a,
  491. m = this.b,
  492. n = this.c,
  493. p = this.d;
  494. this.a = b * k + c * n;
  495. this.b = b * m + c * p;
  496. this.c = a * k + d * n;
  497. this.d = a * m + d * p;
  498. this.tx = e * k + h * n + this.tx;
  499. this.ty = e * m + h * p + this.ty;
  500. return this
  501. };
  502. a.prependMatrix = function (b) {
  503. this.prepend(b.a, b.b, b.c, b.d, b.tx, b.ty);
  504. this.prependProperties(b.alpha, b.shadow, b.compositeOperation);
  505. return this
  506. };
  507. a.appendMatrix = function (b) {
  508. this.append(b.a, b.b, b.c, b.d, b.tx, b.ty);
  509. this.appendProperties(b.alpha,
  510. b.shadow, b.compositeOperation);
  511. return this
  512. };
  513. a.prependTransform = function (b, a, f, d, e, h, k, m, n) {
  514. if (e % 360) {
  515. var p = e * c.DEG_TO_RAD;
  516. e = Math.cos(p);
  517. p = Math.sin(p)
  518. } else e = 1, p = 0; if (m || n) this.tx -= m, this.ty -= n;
  519. h || k ? (h *= c.DEG_TO_RAD, k *= c.DEG_TO_RAD, this.prepend(e * f, p * f, -p * d, e * d, 0, 0), this.prepend(Math.cos(k), Math.sin(k), -Math.sin(h), Math.cos(h), b, a)) : this.prepend(e * f, p * f, -p * d, e * d, b, a);
  520. return this
  521. };
  522. a.appendTransform = function (b, a, f, d, e, h, k, m, n) {
  523. if (e % 360) {
  524. var p = e * c.DEG_TO_RAD;
  525. e = Math.cos(p);
  526. p = Math.sin(p)
  527. } else e = 1, p = 0;
  528. h ||
  529. k ? (h *= c.DEG_TO_RAD, k *= c.DEG_TO_RAD, this.append(Math.cos(k), Math.sin(k), -Math.sin(h), Math.cos(h), b, a), this.append(e * f, p * f, -p * d, e * d, 0, 0)) : this.append(e * f, p * f, -p * d, e * d, b, a);
  530. if (m || n) this.tx -= m * this.a + n * this.c, this.ty -= m * this.b + n * this.d;
  531. return this
  532. };
  533. a.rotate = function (b) {
  534. var c = Math.cos(b);
  535. b = Math.sin(b);
  536. var a = this.a,
  537. d = this.c,
  538. e = this.tx;
  539. this.a = a * c - this.b * b;
  540. this.b = a * b + this.b * c;
  541. this.c = d * c - this.d * b;
  542. this.d = d * b + this.d * c;
  543. this.tx = e * c - this.ty * b;
  544. this.ty = e * b + this.ty * c;
  545. return this
  546. };
  547. a.skew = function (b, a) {
  548. b *= c.DEG_TO_RAD;
  549. a *= c.DEG_TO_RAD;
  550. this.append(Math.cos(a), Math.sin(a), -Math.sin(b), Math.cos(b), 0, 0);
  551. return this
  552. };
  553. a.scale = function (b, c) {
  554. this.a *= b;
  555. this.d *= c;
  556. this.c *= b;
  557. this.b *= c;
  558. this.tx *= b;
  559. this.ty *= c;
  560. return this
  561. };
  562. a.translate = function (b, c) {
  563. this.tx += b;
  564. this.ty += c;
  565. return this
  566. };
  567. a.identity = function () {
  568. this.alpha = this.a = this.d = 1;
  569. this.b = this.c = this.tx = this.ty = 0;
  570. this.shadow = this.compositeOperation = null;
  571. return this
  572. };
  573. a.invert = function () {
  574. var b = this.a,
  575. c = this.b,
  576. a = this.c,
  577. d = this.d,
  578. e = this.tx,
  579. h = b * d - c * a;
  580. this.a = d / h;
  581. this.b = -c / h;
  582. this.c = -a /
  583. h;
  584. this.d = b / h;
  585. this.tx = (a * this.ty - d * e) / h;
  586. this.ty = -(b * this.ty - c * e) / h;
  587. return this
  588. };
  589. a.isIdentity = function () {
  590. return 0 == this.tx && 0 == this.ty && 1 == this.a && 0 == this.b && 0 == this.c && 1 == this.d
  591. };
  592. a.transformPoint = function (b, c, a) {
  593. a = a || {};
  594. a.x = b * this.a + c * this.c + this.tx;
  595. a.y = b * this.b + c * this.d + this.ty;
  596. return a
  597. };
  598. a.decompose = function (b) {
  599. null == b && (b = {});
  600. b.x = this.tx;
  601. b.y = this.ty;
  602. b.scaleX = Math.sqrt(this.a * this.a + this.b * this.b);
  603. b.scaleY = Math.sqrt(this.c * this.c + this.d * this.d);
  604. var a = Math.atan2(-this.c, this.d),
  605. f = Math.atan2(this.b,
  606. this.a);
  607. a == f ? (b.rotation = f / c.DEG_TO_RAD, 0 > this.a && 0 <= this.d && (b.rotation += 0 >= b.rotation ? 180 : -180), b.skewX = b.skewY = 0) : (b.skewX = a / c.DEG_TO_RAD, b.skewY = f / c.DEG_TO_RAD);
  608. return b
  609. };
  610. a.reinitialize = function (b, c, a, d, e, h, k, m, n) {
  611. this.initialize(b, c, a, d, e, h);
  612. this.alpha = null == k ? 1 : k;
  613. this.shadow = m;
  614. this.compositeOperation = n;
  615. return this
  616. };
  617. a.copy = function (b) {
  618. return this.reinitialize(b.a, b.b, b.c, b.d, b.tx, b.ty, b.alpha, b.shadow, b.compositeOperation)
  619. };
  620. a.appendProperties = function (b, c, a) {
  621. this.alpha *= b;
  622. this.shadow = c || this.shadow;
  623. this.compositeOperation = a || this.compositeOperation;
  624. return this
  625. };
  626. a.prependProperties = function (b, c, a) {
  627. this.alpha *= b;
  628. this.shadow = this.shadow || c;
  629. this.compositeOperation = this.compositeOperation || a;
  630. return this
  631. };
  632. a.clone = function () {
  633. return (new c)
  634. .copy(this)
  635. };
  636. a.toString = function () {
  637. return "[Matrix2D (a=" + this.a + " b=" + this.b + " c=" + this.c + " d=" + this.d + " tx=" + this.tx + " ty=" + this.ty + ")]"
  638. };
  639. c.identity = new c;
  640. createjs.Matrix2D = c
  641. })();
  642. this.createjs = this.createjs || {};
  643. (function () {
  644. var c = function (b, c) {
  645. this.initialize(b, c)
  646. },
  647. a = c.prototype;
  648. a.x = 0;
  649. a.y = 0;
  650. a.initialize = function (b, c) {
  651. this.x = null == b ? 0 : b;
  652. this.y = null == c ? 0 : c;
  653. return this
  654. };
  655. a.copy = function (b) {
  656. return this.initialize(b.x, b.y)
  657. };
  658. a.clone = function () {
  659. return new c(this.x, this.y)
  660. };
  661. a.toString = function () {
  662. return "[Point (x=" + this.x + " y=" + this.y + ")]"
  663. };
  664. createjs.Point = c
  665. })();
  666. this.createjs = this.createjs || {};
  667. (function () {
  668. var c = function (b, c, a, d) {
  669. this.initialize(b, c, a, d)
  670. },
  671. a = c.prototype;
  672. a.x = 0;
  673. a.y = 0;
  674. a.width = 0;
  675. a.height = 0;
  676. a.initialize = function (b, c, a, d) {
  677. this.x = b || 0;
  678. this.y = c || 0;
  679. this.width = a || 0;
  680. this.height = d || 0;
  681. return this
  682. };
  683. a.copy = function (b) {
  684. return this.initialize(b.x, b.y, b.width, b.height)
  685. };
  686. a.clone = function () {
  687. return new c(this.x, this.y, this.width, this.height)
  688. };
  689. a.toString = function () {
  690. return "[Rectangle (x=" + this.x + " y=" + this.y + " width=" + this.width + " height=" + this.height + ")]"
  691. };
  692. createjs.Rectangle = c
  693. })();
  694. this.createjs = this.createjs || {};
  695. (function () {
  696. var c = function (b, c, a, d, e, h, k) {
  697. this.initialize(b, c, a, d, e, h, k)
  698. },
  699. a = c.prototype;
  700. a.target = null;
  701. a.overLabel = null;
  702. a.outLabel = null;
  703. a.downLabel = null;
  704. a.play = !1;
  705. a._isPressed = !1;
  706. a._isOver = !1;
  707. a.initialize = function (b, c, a, d, e, h, k) {
  708. b.addEventListener && (this.target = b, b.cursor = "pointer", this.overLabel = null == a ? "over" : a, this.outLabel = null == c ? "out" : c, this.downLabel = null == d ? "down" : d, this.play = e, this.setEnabled(!0), this.handleEvent({}), h && (k && (h.actionsEnabled = !1, h.gotoAndStop && h.gotoAndStop(k)), b.hitArea = h))
  709. };
  710. a.setEnabled = function (b) {
  711. var c = this.target;
  712. b ? (c.addEventListener("rollover", this), c.addEventListener("rollout", this), c.addEventListener("mousedown", this), c.addEventListener("pressup", this)) : (c.removeEventListener("rollover", this), c.removeEventListener("rollout", this), c.removeEventListener("mousedown", this), c.removeEventListener("pressup", this))
  713. };
  714. a.toString = function () {
  715. return "[ButtonHelper]"
  716. };
  717. a.handleEvent = function (b) {
  718. var c = this.target;
  719. b = b.type;
  720. "mousedown" == b ? (this._isPressed = !0, b = this.downLabel) : "pressup" ==
  721. b ? (this._isPressed = !1, b = this._isOver ? this.overLabel : this.outLabel) : "rollover" == b ? (this._isOver = !0, b = this._isPressed ? this.downLabel : this.overLabel) : (this._isOver = !1, b = this._isPressed ? this.overLabel : this.outLabel);
  722. this.play ? c.gotoAndPlay && c.gotoAndPlay(b) : c.gotoAndStop && c.gotoAndStop(b)
  723. };
  724. createjs.ButtonHelper = c
  725. })();
  726. this.createjs = this.createjs || {};
  727. (function () {
  728. var c = function (b, c, a, d) {
  729. this.initialize(b, c, a, d)
  730. },
  731. a = c.prototype;
  732. c.identity = null;
  733. a.color = null;
  734. a.offsetX = 0;
  735. a.offsetY = 0;
  736. a.blur = 0;
  737. a.initialize = function (b, c, a, d) {
  738. this.color = b;
  739. this.offsetX = c;
  740. this.offsetY = a;
  741. this.blur = d
  742. };
  743. a.toString = function () {
  744. return "[Shadow]"
  745. };
  746. a.clone = function () {
  747. return new c(this.color, this.offsetX, this.offsetY, this.blur)
  748. };
  749. c.identity = new c("transparent", 0, 0, 0);
  750. createjs.Shadow = c
  751. })();
  752. this.createjs = this.createjs || {};
  753. (function () {
  754. var c = function (b) {
  755. this.initialize(b)
  756. },
  757. a = c.prototype = new createjs.EventDispatcher;
  758. a.complete = !0;
  759. a.framerate = 0;
  760. a._animations = null;
  761. a._frames = null;
  762. a._images = null;
  763. a._data = null;
  764. a._loadCount = 0;
  765. a._frameHeight = 0;
  766. a._frameWidth = 0;
  767. a._numFrames = 0;
  768. a._regX = 0;
  769. a._regY = 0;
  770. a.initialize = function (b) {
  771. var c, a, d;
  772. if (null != b) {
  773. this.framerate = b.framerate || 0;
  774. if (b.images && 0 < (a = b.images.length))
  775. for (d = this._images = [], c = 0; c < a; c++) {
  776. var e = b.images[c];
  777. if ("string" == typeof e) {
  778. var h = e,
  779. e = document.createElement("img");
  780. e.src = h
  781. }
  782. d.push(e);
  783. e.getContext || e.complete || (this._loadCount++, this.complete = !1, function (b) {
  784. e.onload = function () {
  785. b._handleImageLoad()
  786. }
  787. }(this))
  788. }
  789. if (null != b.frames)
  790. if (b.frames instanceof Array)
  791. for (this._frames = [], d = b.frames, c = 0, a = d.length; c < a; c++) h = d[c], this._frames.push({
  792. image: this._images[h[4] ? h[4] : 0],
  793. rect: new createjs.Rectangle(h[0], h[1], h[2], h[3]),
  794. regX: h[5] || 0,
  795. regY: h[6] || 0
  796. });
  797. else a = b.frames, this._frameWidth = a.width, this._frameHeight = a.height, this._regX = a.regX || 0, this._regY = a.regY || 0, this._numFrames = a.count, 0 == this._loadCount &&
  798. this._calculateFrames();
  799. this._animations = [];
  800. if (null != (a = b.animations)) {
  801. this._data = {};
  802. for (var k in a) {
  803. b = {
  804. name: k
  805. };
  806. h = a[k];
  807. if ("number" == typeof h) d = b.frames = [h];
  808. else if (h instanceof Array)
  809. if (1 == h.length) b.frames = [h[0]];
  810. else
  811. for (b.speed = h[3], b.next = h[2], d = b.frames = [], c = h[0]; c <= h[1]; c++) d.push(c);
  812. else b.speed = h.speed, b.next = h.next, c = h.frames, d = b.frames = "number" == typeof c ? [c] : c.slice(0); if (!0 === b.next || void 0 === b.next) b.next = k;
  813. if (!1 === b.next || 2 > d.length && b.next == k) b.next = null;
  814. b.speed || (b.speed = 1);
  815. this._animations.push(k);
  816. this._data[k] = b
  817. }
  818. }
  819. }
  820. };
  821. a.getNumFrames = function (b) {
  822. if (null == b) return this._frames ? this._frames.length : this._numFrames;
  823. b = this._data[b];
  824. return null == b ? 0 : b.frames.length
  825. };
  826. a.getAnimations = function () {
  827. return this._animations.slice(0)
  828. };
  829. a.getAnimation = function (b) {
  830. return this._data[b]
  831. };
  832. a.getFrame = function (b) {
  833. var c;
  834. return this._frames && (c = this._frames[b]) ? c : null
  835. };
  836. a.getFrameBounds = function (b, c) {
  837. var a = this.getFrame(b);
  838. return a ? (c || new createjs.Rectangle)
  839. .initialize(-a.regX, -a.regY, a.rect.width, a.rect.height) : null
  840. };
  841. a.toString = function () {
  842. return "[SpriteSheet]"
  843. };
  844. a.clone = function () {
  845. var b = new c;
  846. b.complete = this.complete;
  847. b._animations = this._animations;
  848. b._frames = this._frames;
  849. b._images = this._images;
  850. b._data = this._data;
  851. b._frameHeight = this._frameHeight;
  852. b._frameWidth = this._frameWidth;
  853. b._numFrames = this._numFrames;
  854. b._loadCount = this._loadCount;
  855. return b
  856. };
  857. a._handleImageLoad = function () {
  858. 0 == --this._loadCount && (this._calculateFrames(), this.complete = !0, this.dispatchEvent("complete"))
  859. };
  860. a._calculateFrames = function () {
  861. if (!this._frames &&
  862. 0 != this._frameWidth) {
  863. this._frames = [];
  864. for (var b = 0, c = this._frameWidth, a = this._frameHeight, d = 0, e = this._images; d < e.length; d++) {
  865. for (var h = e[d], k = (h.width + 1) / c | 0, m = (h.height + 1) / a | 0, m = 0 < this._numFrames ? Math.min(this._numFrames - b, k * m) : k * m, n = 0; n < m; n++) this._frames.push({
  866. image: h,
  867. rect: new createjs.Rectangle(n % k * c, (n / k | 0) * a, c, a),
  868. regX: this._regX,
  869. regY: this._regY
  870. });
  871. b += m
  872. }
  873. this._numFrames = b
  874. }
  875. };
  876. createjs.SpriteSheet = c
  877. })();
  878. this.createjs = this.createjs || {};
  879. (function () {
  880. function c(b, c, a) {
  881. this.f = b;
  882. this.params = c;
  883. this.path = null == a ? !0 : a
  884. }
  885. c.prototype.exec = function (b) {
  886. this.f.apply(b, this.params)
  887. };
  888. var a = function () {
  889. this.initialize()
  890. },
  891. b = a.prototype;
  892. a.getRGB = function (b, c, a, g) {
  893. null != b && null == a && (g = c, a = b & 255, c = b >> 8 & 255, b = b >> 16 & 255);
  894. return null == g ? "rgb(" + b + "," + c + "," + a + ")" : "rgba(" + b + "," + c + "," + a + "," + g + ")"
  895. };
  896. a.getHSL = function (b, c, a, g) {
  897. return null == g ? "hsl(" + b % 360 + "," + c + "%," + a + "%)" : "hsla(" + b % 360 + "," + c + "%," + a + "%," + g + ")"
  898. };
  899. a.Command = c;
  900. a.BASE_64 = {
  901. A: 0,
  902. B: 1,
  903. C: 2,
  904. D: 3,
  905. E: 4,
  906. F: 5,
  907. G: 6,
  908. H: 7,
  909. I: 8,
  910. J: 9,
  911. K: 10,
  912. L: 11,
  913. M: 12,
  914. N: 13,
  915. O: 14,
  916. P: 15,
  917. Q: 16,
  918. R: 17,
  919. S: 18,
  920. T: 19,
  921. U: 20,
  922. V: 21,
  923. W: 22,
  924. X: 23,
  925. Y: 24,
  926. Z: 25,
  927. a: 26,
  928. b: 27,
  929. c: 28,
  930. d: 29,
  931. e: 30,
  932. f: 31,
  933. g: 32,
  934. h: 33,
  935. i: 34,
  936. j: 35,
  937. k: 36,
  938. l: 37,
  939. m: 38,
  940. n: 39,
  941. o: 40,
  942. p: 41,
  943. q: 42,
  944. r: 43,
  945. s: 44,
  946. t: 45,
  947. u: 46,
  948. v: 47,
  949. w: 48,
  950. x: 49,
  951. y: 50,
  952. z: 51,
  953. 0: 52,
  954. 1: 53,
  955. 2: 54,
  956. 3: 55,
  957. 4: 56,
  958. 5: 57,
  959. 6: 58,
  960. 7: 59,
  961. 8: 60,
  962. 9: 61,
  963. "+": 62,
  964. "/": 63
  965. };
  966. a.STROKE_CAPS_MAP = ["butt", "round", "square"];
  967. a.STROKE_JOINTS_MAP = ["miter", "round", "bevel"];
  968. var g = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas");
  969. if (g.getContext) {
  970. var f = a._ctx = g.getContext("2d");
  971. a.beginCmd = new c(f.beginPath, [], !1);
  972. a.fillCmd = new c(f.fill, [], !1);
  973. a.strokeCmd = new c(f.stroke, [], !1);
  974. g.width = g.height = 1
  975. }
  976. b._strokeInstructions = null;
  977. b._strokeStyleInstructions = null;
  978. b._strokeIgnoreScale = !1;
  979. b._fillInstructions = null;
  980. b._fillMatrix = null;
  981. b._instructions = null;
  982. b._oldInstructions = null;
  983. b._activeInstructions = null;
  984. b._active = !1;
  985. b._dirty = !1;
  986. b.initialize = function () {
  987. this.clear();
  988. this._ctx = a._ctx
  989. };
  990. b.isEmpty = function () {
  991. return !(this._instructions.length || this._oldInstructions.length || this._activeInstructions.length)
  992. };
  993. b.draw = function (b) {
  994. this._dirty && this._updateInstructions();
  995. for (var c = this._instructions, a = 0, g = c.length; a < g; a++) c[a].exec(b)
  996. };
  997. b.drawAsPath = function (b) {
  998. this._dirty && this._updateInstructions();
  999. for (var c, a = this._instructions, g = 0, f = a.length; g < f; g++)((c = a[g])
  1000. .path || 0 == g) && c.exec(b)
  1001. };
  1002. b.moveTo = function (b, a) {
  1003. this._activeInstructions.push(new c(this._ctx.moveTo, [b, a]));
  1004. return this
  1005. };
  1006. b.lineTo = function (b, a) {
  1007. this._dirty = this._active = !0;
  1008. this._activeInstructions.push(new c(this._ctx.lineTo, [b, a]));
  1009. return this
  1010. };
  1011. b.arcTo =
  1012. function (b, a, g, f, m) {
  1013. this._dirty = this._active = !0;
  1014. this._activeInstructions.push(new c(this._ctx.arcTo, [b, a, g, f, m]));
  1015. return this
  1016. };
  1017. b.arc = function (b, a, g, f, m, n) {
  1018. this._dirty = this._active = !0;
  1019. null == n && (n = !1);
  1020. this._activeInstructions.push(new c(this._ctx.arc, [b, a, g, f, m, n]));
  1021. return this
  1022. };
  1023. b.quadraticCurveTo = function (b, a, g, f) {
  1024. this._dirty = this._active = !0;
  1025. this._activeInstructions.push(new c(this._ctx.quadraticCurveTo, [b, a, g, f]));
  1026. return this
  1027. };
  1028. b.bezierCurveTo = function (b, a, g, f, m, n) {
  1029. this._dirty = this._active = !0;
  1030. this._activeInstructions.push(new c(this._ctx.bezierCurveTo, [b, a, g, f, m, n]));
  1031. return this
  1032. };
  1033. b.rect = function (b, a, g, f) {
  1034. this._dirty = this._active = !0;
  1035. this._activeInstructions.push(new c(this._ctx.rect, [b, a, g, f]));
  1036. return this
  1037. };
  1038. b.closePath = function () {
  1039. this._active && (this._dirty = !0, this._activeInstructions.push(new c(this._ctx.closePath, [])));
  1040. return this
  1041. };
  1042. b.clear = function () {
  1043. this._instructions = [];
  1044. this._oldInstructions = [];
  1045. this._activeInstructions = [];
  1046. this._strokeStyleInstructions = this._strokeInstructions = this._fillInstructions = this._fillMatrix = null;
  1047. this._active = this._dirty =
  1048. this._strokeIgnoreScale = !1;
  1049. return this
  1050. };
  1051. b.beginFill = function (b) {
  1052. this._active && this._newPath();
  1053. this._fillInstructions = b ? [new c(this._setProp, ["fillStyle", b], !1)] : null;
  1054. this._fillMatrix = null;
  1055. return this
  1056. };
  1057. b.beginLinearGradientFill = function (b, a, g, f, m, n) {
  1058. this._active && this._newPath();
  1059. g = this._ctx.createLinearGradient(g, f, m, n);
  1060. f = 0;
  1061. for (m = b.length; f < m; f++) g.addColorStop(a[f], b[f]);
  1062. this._fillInstructions = [new c(this._setProp, ["fillStyle", g], !1)];
  1063. this._fillMatrix = null;
  1064. return this
  1065. };
  1066. b.beginRadialGradientFill = function (b,
  1067. a, g, f, m, n, p, r) {
  1068. this._active && this._newPath();
  1069. g = this._ctx.createRadialGradient(g, f, m, n, p, r);
  1070. f = 0;
  1071. for (m = b.length; f < m; f++) g.addColorStop(a[f], b[f]);
  1072. this._fillInstructions = [new c(this._setProp, ["fillStyle", g], !1)];
  1073. this._fillMatrix = null;
  1074. return this
  1075. };
  1076. b.beginBitmapFill = function (b, a, g) {
  1077. this._active && this._newPath();
  1078. b = this._ctx.createPattern(b, a || "");
  1079. this._fillInstructions = [new c(this._setProp, ["fillStyle", b], !1)];
  1080. this._fillMatrix = g ? [g.a, g.b, g.c, g.d, g.tx, g.ty] : null;
  1081. return this
  1082. };
  1083. b.endFill = function () {
  1084. return this.beginFill()
  1085. };
  1086. b.setStrokeStyle = function (b, g, f, k, m) {
  1087. this._active && this._newPath();
  1088. this._strokeStyleInstructions = [new c(this._setProp, ["lineWidth", null == b ? "1" : b], !1), new c(this._setProp, ["lineCap", null == g ? "butt" : isNaN(g) ? g : a.STROKE_CAPS_MAP[g]], !1), new c(this._setProp, ["lineJoin", null == f ? "miter" : isNaN(f) ? f : a.STROKE_JOINTS_MAP[f]], !1), new c(this._setProp, ["miterLimit", null == k ? "10" : k], !1)];
  1089. this._strokeIgnoreScale = m;
  1090. return this
  1091. };
  1092. b.beginStroke = function (b) {
  1093. this._active && this._newPath();
  1094. this._strokeInstructions = b ? [new c(this._setProp, ["strokeStyle", b], !1)] : null;
  1095. return this
  1096. };
  1097. b.beginLinearGradientStroke = function (b, a, g, f, m, n) {
  1098. this._active && this._newPath();
  1099. g = this._ctx.createLinearGradient(g, f, m, n);
  1100. f = 0;
  1101. for (m = b.length; f < m; f++) g.addColorStop(a[f], b[f]);
  1102. this._strokeInstructions = [new c(this._setProp, ["strokeStyle", g], !1)];
  1103. return this
  1104. };
  1105. b.beginRadialGradientStroke = function (b, a, g, f, m, n, p, r) {
  1106. this._active && this._newPath();
  1107. g = this._ctx.createRadialGradient(g, f, m, n, p, r);
  1108. f = 0;
  1109. for (m = b.length; f < m; f++) g.addColorStop(a[f], b[f]);
  1110. this._strokeInstructions = [new c(this._setProp, ["strokeStyle", g], !1)];
  1111. return this
  1112. };
  1113. b.beginBitmapStroke = function (b, a) {
  1114. this._active && this._newPath();
  1115. var g = this._ctx.createPattern(b, a || "");
  1116. this._strokeInstructions = [new c(this._setProp, ["strokeStyle", g], !1)];
  1117. return this
  1118. };
  1119. b.endStroke = function () {
  1120. this.beginStroke();
  1121. return this
  1122. };
  1123. b.curveTo = b.quadraticCurveTo;
  1124. b.drawRect = b.rect;
  1125. b.drawRoundRect = function (b, a, c, g, f) {
  1126. this.drawRoundRectComplex(b, a, c, g, f, f, f, f);
  1127. return this
  1128. };
  1129. b.drawRoundRectComplex = function (b, a, g, f, m, n, p, r) {
  1130. var s = (g < f ? g : f) /
  1131. 2,
  1132. t = 0,
  1133. q = 0,
  1134. w = 0,
  1135. u = 0;
  1136. 0 > m && (m *= t = -1);
  1137. m > s && (m = s);
  1138. 0 > n && (n *= q = -1);
  1139. n > s && (n = s);
  1140. 0 > p && (p *= w = -1);
  1141. p > s && (p = s);
  1142. 0 > r && (r *= u = -1);
  1143. r > s && (r = s);
  1144. this._dirty = this._active = !0;
  1145. var s = this._ctx.arcTo,
  1146. x = this._ctx.lineTo;
  1147. this._activeInstructions.push(new c(this._ctx.moveTo, [b + g - n, a]), new c(s, [b + g + n * q, a - n * q, b + g, a + n, n]), new c(x, [b + g, a + f - p]), new c(s, [b + g + p * w, a + f + p * w, b + g - p, a + f, p]), new c(x, [b + r, a + f]), new c(s, [b - r * u, a + f + r * u, b, a + f - r, r]), new c(x, [b, a + m]), new c(s, [b - m * t, a - m * t, b + m, a, m]), new c(this._ctx.closePath));
  1148. return this
  1149. };
  1150. b.drawCircle =
  1151. function (b, a, c) {
  1152. this.arc(b, a, c, 0, 2 * Math.PI);
  1153. return this
  1154. };
  1155. b.drawEllipse = function (b, a, g, f) {
  1156. this._dirty = this._active = !0;
  1157. var m = 0.5522848 * (g / 2),
  1158. n = 0.5522848 * (f / 2),
  1159. p = b + g,
  1160. r = a + f;
  1161. g = b + g / 2;
  1162. f = a + f / 2;
  1163. this._activeInstructions.push(new c(this._ctx.moveTo, [b, f]), new c(this._ctx.bezierCurveTo, [b, f - n, g - m, a, g, a]), new c(this._ctx.bezierCurveTo, [g + m, a, p, f - n, p, f]), new c(this._ctx.bezierCurveTo, [p, f + n, g + m, r, g, r]), new c(this._ctx.bezierCurveTo, [g - m, r, b, f + n, b, f]));
  1164. return this
  1165. };
  1166. b.inject = function (b, a) {
  1167. this._dirty = this._active = !0;
  1168. this._activeInstructions.push(new c(b, [a]));
  1169. return this
  1170. };
  1171. b.drawPolyStar = function (b, a, g, f, m, n) {
  1172. this._dirty = this._active = !0;
  1173. null == m && (m = 0);
  1174. m = 1 - m;
  1175. n = null == n ? 0 : n / (180 / Math.PI);
  1176. var p = Math.PI / f;
  1177. this._activeInstructions.push(new c(this._ctx.moveTo, [b + Math.cos(n) * g, a + Math.sin(n) * g]));
  1178. for (var r = 0; r < f; r++) n += p, 1 != m && this._activeInstructions.push(new c(this._ctx.lineTo, [b + Math.cos(n) * g * m, a + Math.sin(n) * g * m])), n += p, this._activeInstructions.push(new c(this._ctx.lineTo, [b + Math.cos(n) * g, a + Math.sin(n) * g]));
  1179. return this
  1180. };
  1181. b.decodePath = function (b) {
  1182. for (var c = [this.moveTo, this.lineTo, this.quadraticCurveTo, this.bezierCurveTo, this.closePath], g = [2, 2, 4, 6, 0], f = 0, m = b.length, n = [], p = 0, r = 0, s = a.BASE_64; f < m;) {
  1183. var t = b.charAt(f),
  1184. q = s[t],
  1185. w = q >> 3,
  1186. u = c[w];
  1187. if (!u || q & 3) throw "bad path data (@" + f + "): " + t;
  1188. t = g[w];
  1189. w || (p = r = 0);
  1190. n.length = 0;
  1191. f++;
  1192. q = (q >> 2 & 1) + 2;
  1193. for (w = 0; w < t; w++) {
  1194. var x = s[b.charAt(f)],
  1195. K = x >> 5 ? -1 : 1,
  1196. x = (x & 31) << 6 | s[b.charAt(f + 1)];
  1197. 3 == q && (x = x << 6 | s[b.charAt(f + 2)]);
  1198. x = K * x / 10;
  1199. w % 2 ? p = x += p : r = x += r;
  1200. n[w] = x;
  1201. f += q
  1202. }
  1203. u.apply(this, n)
  1204. }
  1205. return this
  1206. };
  1207. b.clone = function () {
  1208. var b =
  1209. new a;
  1210. b._instructions = this._instructions.slice();
  1211. b._activeInstructions = this._activeInstructions.slice();
  1212. b._oldInstructions = this._oldInstructions.slice();
  1213. this._fillInstructions && (b._fillInstructions = this._fillInstructions.slice());
  1214. this._strokeInstructions && (b._strokeInstructions = this._strokeInstructions.slice());
  1215. this._strokeStyleInstructions && (b._strokeStyleInstructions = this._strokeStyleInstructions.slice());
  1216. b._active = this._active;
  1217. b._dirty = this._dirty;
  1218. b._fillMatrix = this._fillMatrix;
  1219. b._strokeIgnoreScale =
  1220. this._strokeIgnoreScale;
  1221. return b
  1222. };
  1223. b.toString = function () {
  1224. return "[Graphics]"
  1225. };
  1226. b.mt = b.moveTo;
  1227. b.lt = b.lineTo;
  1228. b.at = b.arcTo;
  1229. b.bt = b.bezierCurveTo;
  1230. b.qt = b.quadraticCurveTo;
  1231. b.a = b.arc;
  1232. b.r = b.rect;
  1233. b.cp = b.closePath;
  1234. b.c = b.clear;
  1235. b.f = b.beginFill;
  1236. b.lf = b.beginLinearGradientFill;
  1237. b.rf = b.beginRadialGradientFill;
  1238. b.bf = b.beginBitmapFill;
  1239. b.ef = b.endFill;
  1240. b.ss = b.setStrokeStyle;
  1241. b.s = b.beginStroke;
  1242. b.ls = b.beginLinearGradientStroke;
  1243. b.rs = b.beginRadialGradientStroke;
  1244. b.bs = b.beginBitmapStroke;
  1245. b.es = b.endStroke;
  1246. b.dr = b.drawRect;
  1247. b.rr = b.drawRoundRect;
  1248. b.rc = b.drawRoundRectComplex;
  1249. b.dc = b.drawCircle;
  1250. b.de = b.drawEllipse;
  1251. b.dp = b.drawPolyStar;
  1252. b.p = b.decodePath;
  1253. b._updateInstructions = function () {
  1254. this._instructions = this._oldInstructions.slice();
  1255. this._instructions.push(a.beginCmd);
  1256. this._appendInstructions(this._fillInstructions);
  1257. this._appendInstructions(this._strokeInstructions);
  1258. this._appendInstructions(this._strokeInstructions && this._strokeStyleInstructions);
  1259. this._appendInstructions(this._activeInstructions);
  1260. this._fillInstructions && this._appendDraw(a.fillCmd,
  1261. this._fillMatrix);
  1262. this._strokeInstructions && this._appendDraw(a.strokeCmd, this._strokeIgnoreScale && [1, 0, 0, 1, 0, 0])
  1263. };
  1264. b._appendInstructions = function (b) {
  1265. b && this._instructions.push.apply(this._instructions, b)
  1266. };
  1267. b._appendDraw = function (b, a) {
  1268. a ? this._instructions.push(new c(this._ctx.save, [], !1), new c(this._ctx.transform, a, !1), b, new c(this._ctx.restore, [], !1)) : this._instructions.push(b)
  1269. };
  1270. b._newPath = function () {
  1271. this._dirty && this._updateInstructions();
  1272. this._oldInstructions = this._instructions;
  1273. this._activeInstructions = [];
  1274. this._active = this._dirty = !1
  1275. };
  1276. b._setProp = function (b, a) {
  1277. this[b] = a
  1278. };
  1279. createjs.Graphics = a
  1280. })();
  1281. this.createjs = this.createjs || {};
  1282. (function () {
  1283. var c = function () {
  1284. this.initialize()
  1285. },
  1286. a = c.prototype = new createjs.EventDispatcher;
  1287. c.suppressCrossDomainErrors = !1;
  1288. var b = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas");
  1289. b.getContext && (c._hitTestCanvas = b, c._hitTestContext = b.getContext("2d"), b.width = b.height = 1);
  1290. c._nextCacheID = 1;
  1291. a.alpha = 1;
  1292. a.cacheCanvas = null;
  1293. a.id = -1;
  1294. a.mouseEnabled = !0;
  1295. a.name = null;
  1296. a.parent = null;
  1297. a.regX = 0;
  1298. a.regY = 0;
  1299. a.rotation = 0;
  1300. a.scaleX = 1;
  1301. a.scaleY = 1;
  1302. a.skewX = 0;
  1303. a.skewY = 0;
  1304. a.shadow = null;
  1305. a.visible = !0;
  1306. a.x = 0;
  1307. a.y = 0;
  1308. a.compositeOperation = null;
  1309. a.snapToPixel = !1;
  1310. a.filters = null;
  1311. a.cacheID = 0;
  1312. a.mask = null;
  1313. a.hitArea = null;
  1314. a.cursor = null;
  1315. a._cacheOffsetX = 0;
  1316. a._cacheOffsetY = 0;
  1317. a._cacheScale = 1;
  1318. a._cacheDataURLID = 0;
  1319. a._cacheDataURL = null;
  1320. a._matrix = null;
  1321. a._rectangle = null;
  1322. a._bounds = null;
  1323. a.initialize = function () {
  1324. this.id = createjs.UID.get();
  1325. this._matrix = new createjs.Matrix2D;
  1326. this._rectangle = new createjs.Rectangle
  1327. };
  1328. a.isVisible = function () {
  1329. return !!(this.visible && 0 < this.alpha && 0 != this.scaleX && 0 != this.scaleY)
  1330. };
  1331. a.draw = function (b, a) {
  1332. var c =
  1333. this.cacheCanvas;
  1334. if (a || !c) return !1;
  1335. var e = this._cacheScale,
  1336. h = this._cacheOffsetX,
  1337. k = this._cacheOffsetY,
  1338. m;
  1339. if (m = this._applyFilterBounds(h, k, 0, 0)) h = m.x, k = m.y;
  1340. b.drawImage(c, h, k, c.width / e, c.height / e);
  1341. return !0
  1342. };
  1343. a.updateContext = function (b) {
  1344. var a, c = this.mask;
  1345. c && c.graphics && !c.graphics.isEmpty() && (a = c.getMatrix(c._matrix), b.transform(a.a, a.b, a.c, a.d, a.tx, a.ty), c.graphics.drawAsPath(b), b.clip(), a.invert(), b.transform(a.a, a.b, a.c, a.d, a.tx, a.ty));
  1346. a = this._matrix.identity()
  1347. .appendTransform(this.x, this.y, this.scaleX,
  1348. this.scaleY, this.rotation, this.skewX, this.skewY, this.regX, this.regY);
  1349. createjs.Stage._snapToPixelEnabled && this.snapToPixel ? b.transform(a.a, a.b, a.c, a.d, a.tx + 0.5 | 0, a.ty + 0.5 | 0) : b.transform(a.a, a.b, a.c, a.d, a.tx, a.ty);
  1350. b.globalAlpha *= this.alpha;
  1351. this.compositeOperation && (b.globalCompositeOperation = this.compositeOperation);
  1352. this.shadow && this._applyShadow(b, this.shadow)
  1353. };
  1354. a.cache = function (b, a, c, e, h) {
  1355. h = h || 1;
  1356. this.cacheCanvas || (this.cacheCanvas = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas"));
  1357. this._cacheWidth = c;
  1358. this._cacheHeight = e;
  1359. this._cacheOffsetX = b;
  1360. this._cacheOffsetY = a;
  1361. this._cacheScale = h;
  1362. this.updateCache()
  1363. };
  1364. a.updateCache = function (b) {
  1365. var a = this.cacheCanvas,
  1366. d = this._cacheScale,
  1367. e = this._cacheOffsetX * d,
  1368. h = this._cacheOffsetY * d,
  1369. k = this._cacheWidth,
  1370. m = this._cacheHeight,
  1371. n;
  1372. if (!a) throw "cache() must be called before updateCache()";
  1373. var p = a.getContext("2d");
  1374. if (n = this._applyFilterBounds(e, h, k, m)) e = n.x, h = n.y, k = n.width, m = n.height;
  1375. k = Math.ceil(k * d);
  1376. m = Math.ceil(m * d);
  1377. k != a.width || m != a.height ? (a.width = k, a.height =
  1378. m) : b || p.clearRect(0, 0, k + 1, m + 1);
  1379. p.save();
  1380. p.globalCompositeOperation = b;
  1381. p.setTransform(d, 0, 0, d, -e, -h);
  1382. this.draw(p, !0);
  1383. this._applyFilters();
  1384. p.restore();
  1385. this.cacheID = c._nextCacheID++
  1386. };
  1387. a.uncache = function () {
  1388. this._cacheDataURL = this.cacheCanvas = null;
  1389. this.cacheID = this._cacheOffsetX = this._cacheOffsetY = 0;
  1390. this._cacheScale = 1
  1391. };
  1392. a.getCacheDataURL = function () {
  1393. if (!this.cacheCanvas) return null;
  1394. this.cacheID != this._cacheDataURLID && (this._cacheDataURL = this.cacheCanvas.toDataURL());
  1395. return this._cacheDataURL
  1396. };
  1397. a.getStage = function () {
  1398. for (var b =
  1399. this; b.parent;) b = b.parent;
  1400. return b instanceof createjs.Stage ? b : null
  1401. };
  1402. a.localToGlobal = function (b, a) {
  1403. var c = this.getConcatenatedMatrix(this._matrix);
  1404. if (null == c) return null;
  1405. c.append(1, 0, 0, 1, b, a);
  1406. return new createjs.Point(c.tx, c.ty)
  1407. };
  1408. a.globalToLocal = function (b, a) {
  1409. var c = this.getConcatenatedMatrix(this._matrix);
  1410. if (null == c) return null;
  1411. c.invert();
  1412. c.append(1, 0, 0, 1, b, a);
  1413. return new createjs.Point(c.tx, c.ty)
  1414. };
  1415. a.localToLocal = function (b, a, c) {
  1416. b = this.localToGlobal(b, a);
  1417. return c.globalToLocal(b.x, b.y)
  1418. };
  1419. a.setTransform =
  1420. function (b, a, c, e, h, k, m, n, p) {
  1421. this.x = b || 0;
  1422. this.y = a || 0;
  1423. this.scaleX = null == c ? 1 : c;
  1424. this.scaleY = null == e ? 1 : e;
  1425. this.rotation = h || 0;
  1426. this.skewX = k || 0;
  1427. this.skewY = m || 0;
  1428. this.regX = n || 0;
  1429. this.regY = p || 0;
  1430. return this
  1431. };
  1432. a.getMatrix = function (b) {
  1433. return (b ? b.identity() : new createjs.Matrix2D)
  1434. .appendTransform(this.x, this.y, this.scaleX, this.scaleY, this.rotation, this.skewX, this.skewY, this.regX, this.regY)
  1435. .appendProperties(this.alpha, this.shadow, this.compositeOperation)
  1436. };
  1437. a.getConcatenatedMatrix = function (b) {
  1438. b ? b.identity() : b = new createjs.Matrix2D;
  1439. for (var a = this; null != a;) b.prependTransform(a.x, a.y, a.scaleX, a.scaleY, a.rotation, a.skewX, a.skewY, a.regX, a.regY)
  1440. .prependProperties(a.alpha, a.shadow, a.compositeOperation), a = a.parent;
  1441. return b
  1442. };
  1443. a.hitTest = function (b, a) {
  1444. var d = c._hitTestContext;
  1445. d.setTransform(1, 0, 0, 1, -b, -a);
  1446. this.draw(d);
  1447. var e = this._testHit(d);
  1448. d.setTransform(1, 0, 0, 1, 0, 0);
  1449. d.clearRect(0, 0, 2, 2);
  1450. return e
  1451. };
  1452. a.set = function (b) {
  1453. for (var a in b) this[a] = b[a];
  1454. return this
  1455. };
  1456. a.getBounds = function () {
  1457. if (this._bounds) return this._rectangle.copy(this._bounds);
  1458. var b = this.cacheCanvas;
  1459. if (b) {
  1460. var a = this._cacheScale;
  1461. return this._rectangle.initialize(this._cacheOffsetX, this._cacheOffsetY, b.width / a, b.height / a)
  1462. }
  1463. return null
  1464. };
  1465. a.getTransformedBounds = function () {
  1466. return this._getBounds()
  1467. };
  1468. a.setBounds = function (b, a, c, e) {
  1469. null == b && (this._bounds = b);
  1470. this._bounds = (this._bounds || new createjs.Rectangle)
  1471. .initialize(b, a, c, e)
  1472. };
  1473. a.clone = function () {
  1474. var b = new c;
  1475. this.cloneProps(b);
  1476. return b
  1477. };
  1478. a.toString = function () {
  1479. return "[DisplayObject (name=" + this.name + ")]"
  1480. };
  1481. a.cloneProps = function (b) {
  1482. b.alpha =
  1483. this.alpha;
  1484. b.name = this.name;
  1485. b.regX = this.regX;
  1486. b.regY = this.regY;
  1487. b.rotation = this.rotation;
  1488. b.scaleX = this.scaleX;
  1489. b.scaleY = this.scaleY;
  1490. b.shadow = this.shadow;
  1491. b.skewX = this.skewX;
  1492. b.skewY = this.skewY;
  1493. b.visible = this.visible;
  1494. b.x = this.x;
  1495. b.y = this.y;
  1496. b._bounds = this._bounds;
  1497. b.mouseEnabled = this.mouseEnabled;
  1498. b.compositeOperation = this.compositeOperation
  1499. };
  1500. a._applyShadow = function (b, a) {
  1501. a = a || Shadow.identity;
  1502. b.shadowColor = a.color;
  1503. b.shadowOffsetX = a.offsetX;
  1504. b.shadowOffsetY = a.offsetY;
  1505. b.shadowBlur = a.blur
  1506. };
  1507. a._tick = function (b) {
  1508. var a =
  1509. this._listeners;
  1510. a && a.tick && (a = new createjs.Event("tick"), a.params = b, this._dispatchEvent(a, this, 2))
  1511. };
  1512. a._testHit = function (b) {
  1513. try {
  1514. var a = 1 < b.getImageData(0, 0, 1, 1)
  1515. .data[3]
  1516. } catch (d) {
  1517. if (!c.suppressCrossDomainErrors) throw "An error has occurred. This is most likely due to security restrictions on reading canvas pixel data with local or cross-domain images.";
  1518. }
  1519. return a
  1520. };
  1521. a._applyFilters = function () {
  1522. if (this.filters && 0 != this.filters.length && this.cacheCanvas)
  1523. for (var b = this.filters.length, a = this.cacheCanvas.getContext("2d"),
  1524. c = this.cacheCanvas.width, e = this.cacheCanvas.height, h = 0; h < b; h++) this.filters[h].applyFilter(a, 0, 0, c, e)
  1525. };
  1526. a._applyFilterBounds = function (b, a, c, e) {
  1527. var h, k, m = this.filters;
  1528. if (m && (k = m.length)) {
  1529. for (m = 0; m < k; m++) {
  1530. var n = this.filters[m];
  1531. if (n = n.getBounds && n.getBounds()) h || (h = this._rectangle.initialize(b, a, c, e)), h.x += n.x, h.y += n.y, h.width += n.width, h.height += n.height
  1532. }
  1533. return h
  1534. }
  1535. };
  1536. a._getBounds = function (b, a) {
  1537. return this._transformBounds(this.getBounds(), b, a)
  1538. };
  1539. a._transformBounds = function (b, a, c) {
  1540. if (!b) return b;
  1541. var e = b.x,
  1542. h = b.y,
  1543. k = b.width,
  1544. m = b.height,
  1545. n = c ? this._matrix.identity() : this.getMatrix(this._matrix);
  1546. (e || h) && n.appendTransform(0, 0, 1, 1, 0, 0, 0, -e, -h);
  1547. a && n.prependMatrix(a);
  1548. a = k * n.a;
  1549. k *= n.b;
  1550. c = m * n.c;
  1551. var m = m * n.d,
  1552. p = n.tx,
  1553. n = n.ty,
  1554. r = p,
  1555. s = p,
  1556. t = n,
  1557. q = n;
  1558. (e = a + p) < r ? r = e : e > s && (s = e);
  1559. (e = a + c + p) < r ? r = e : e > s && (s = e);
  1560. (e = c + p) < r ? r = e : e > s && (s = e);
  1561. (h = k + n) < t ? t = h : h > q && (q = h);
  1562. (h = k + m + n) < t ? t = h : h > q && (q = h);
  1563. (h = m + n) < t ? t = h : h > q && (q = h);
  1564. return b.initialize(r, t, s - r, q - t)
  1565. };
  1566. a.isRoot = !1;
  1567. a.bounding_box = null;
  1568. a.isCheckMouseWithDraw = !1;
  1569. a.isOnlyBoundsCheck = !1;
  1570. a.setBoundingBox =
  1571. function (b, a, c, e) {
  1572. return this.bounding_box = new createjs.Rectangle(b, a, c, e)
  1573. };
  1574. createjs.DisplayObject = c
  1575. })();
  1576. this.createjs = this.createjs || {};
  1577. (function () {
  1578. var c = function () {
  1579. this.initialize()
  1580. },
  1581. a = c.prototype = new createjs.DisplayObject;
  1582. a.children = null;
  1583. a.mouseChildren = !0;
  1584. a.DisplayObject_initialize = a.initialize;
  1585. a.initialize = function () {
  1586. this.DisplayObject_initialize();
  1587. this.children = []
  1588. };
  1589. a.isVisible = function () {
  1590. var b = this.cacheCanvas || this.children.length;
  1591. return !!(this.visible && 0 < this.alpha && 0 != this.scaleX && 0 != this.scaleY && b)
  1592. };
  1593. a.DisplayObject_draw = a.draw;
  1594. a.draw = function (b, a) {
  1595. if (this.DisplayObject_draw(b, a)) return !0;
  1596. for (var c = this.children.slice(0),
  1597. d = 0, e = c.length; d < e; d++) {
  1598. var h = c[d];
  1599. h.isVisible() && (b.save(), h.updateContext(b), h.draw(b), b.restore())
  1600. }
  1601. return !0
  1602. };
  1603. a.addChild = function (b) {
  1604. if (null == b) return b;
  1605. var a = arguments.length;
  1606. if (1 < a) {
  1607. for (var c = 0; c < a; c++) this.addChild(arguments[c]);
  1608. return arguments[a - 1]
  1609. }
  1610. b.parent && b.parent.removeChild(b);
  1611. b.parent = this;
  1612. this.children.push(b);
  1613. return b
  1614. };
  1615. a.addChildAt = function (b, a) {
  1616. var c = arguments.length,
  1617. d = arguments[c - 1];
  1618. if (0 > d || d > this.children.length) return arguments[c - 2];
  1619. if (2 < c) {
  1620. for (var e = 0; e < c - 1; e++) this.addChildAt(arguments[e],
  1621. d + e);
  1622. return arguments[c - 2]
  1623. }
  1624. b.parent && b.parent.removeChild(b);
  1625. b.parent = this;
  1626. this.children.splice(a, 0, b);
  1627. return b
  1628. };
  1629. a.removeChild = function (b) {
  1630. var a = arguments.length;
  1631. if (1 < a) {
  1632. for (var c = !0, d = 0; d < a; d++) c = c && this.removeChild(arguments[d]);
  1633. return c
  1634. }
  1635. return this.removeChildAt(createjs.indexOf(this.children, b))
  1636. };
  1637. a.removeChildAt = function (b) {
  1638. var a = arguments.length;
  1639. if (1 < a) {
  1640. for (var c = [], d = 0; d < a; d++) c[d] = arguments[d];
  1641. c.sort(function (b, a) {
  1642. return a - b
  1643. });
  1644. for (var e = !0, d = 0; d < a; d++) e = e && this.removeChildAt(c[d]);
  1645. return e
  1646. }
  1647. if (0 >
  1648. b || b > this.children.length - 1) return !1;
  1649. if (a = this.children[b]) a.parent = null;
  1650. this.children.splice(b, 1);
  1651. return !0
  1652. };
  1653. a.removeAllChildren = function () {
  1654. for (var b = this.children; b.length;) b.pop()
  1655. .parent = null
  1656. };
  1657. a.getChildAt = function (b) {
  1658. return this.children[b]
  1659. };
  1660. a.getChildByName = function (b) {
  1661. for (var a = this.children, c = 0, d = a.length; c < d; c++)
  1662. if (a[c].name == b) return a[c];
  1663. return null
  1664. };
  1665. a.sortChildren = function (b) {
  1666. this.children.sort(b)
  1667. };
  1668. a.getChildIndex = function (b) {
  1669. return createjs.indexOf(this.children, b)
  1670. };
  1671. a.getNumChildren = function () {
  1672. return this.children.length
  1673. };
  1674. a.swapChildrenAt = function (b, a) {
  1675. var c = this.children,
  1676. d = c[b],
  1677. e = c[a];
  1678. d && e && (c[b] = e, c[a] = d)
  1679. };
  1680. a.swapChildren = function (b, a) {
  1681. for (var c = this.children, d, e, h = 0, k = c.length; h < k && (c[h] == b && (d = h), c[h] == a && (e = h), null == d || null == e); h++);
  1682. h != k && (c[d] = a, c[e] = b)
  1683. };
  1684. a.setChildIndex = function (b, a) {
  1685. var c = this.children,
  1686. d = c.length;
  1687. if (!(b.parent != this || 0 > a || a >= d)) {
  1688. for (var e = 0; e < d && c[e] != b; e++);
  1689. e != d && e != a && (c.splice(e, 1), c.splice(a, 0, b))
  1690. }
  1691. };
  1692. a.contains = function (b) {
  1693. for (; b;) {
  1694. if (b == this) return !0;
  1695. b = b.parent
  1696. }
  1697. return !1
  1698. };
  1699. a.hitTest = function (b,
  1700. a) {
  1701. return null != this.getObjectUnderPoint(b, a)
  1702. };
  1703. a.getObjectsUnderPoint = function (b, a) {
  1704. var c = [],
  1705. d = this.localToGlobal(b, a);
  1706. this._getObjectsUnderPoint(d.x, d.y, c);
  1707. return c
  1708. };
  1709. a.getObjectUnderPoint = function (b, a) {
  1710. var c = this.localToGlobal(b, a);
  1711. return this._getObjectsUnderPoint(c.x, c.y)
  1712. };
  1713. a.DisplayObject_getBounds = a.getBounds;
  1714. a.getBounds = function () {
  1715. return this._getBounds(null, !0)
  1716. };
  1717. a.getTransformedBounds = function () {
  1718. return this._getBounds()
  1719. };
  1720. a.clone = function (b) {
  1721. var a = new c;
  1722. this.cloneProps(a);
  1723. if (b)
  1724. for (var f = a.children = [], d = 0, e = this.children.length; d < e; d++) {
  1725. var h = this.children[d].clone(b);
  1726. h.parent = a;
  1727. f.push(h)
  1728. }
  1729. return a
  1730. };
  1731. a.toString = function () {
  1732. return "[Container (name=" + this.name + ")]"
  1733. };
  1734. a.DisplayObject__tick = a._tick;
  1735. a._tick = function (b) {
  1736. for (var a = this.children.length - 1; 0 <= a; a--) {
  1737. var c = this.children[a];
  1738. c._tick && c._tick(b)
  1739. }
  1740. this.DisplayObject__tick(b)
  1741. };
  1742. a._getObjectsUnderPoint = function (b, a, f, d) {
  1743. var e, h;
  1744. e = this.children.length;
  1745. if (!isDesktopBrowser) {
  1746. var k, m;
  1747. for (e -= 1; 0 <= e; e--)
  1748. if (h = this.children[e], h.visible && h.mouseEnabled &&
  1749. !(0 >= h.alpha)) {
  1750. if (k = h.bounding_box) {
  1751. if (m = h.isRoot ? h.x + k.x <= b && b < h.x + k.x + k.width && h.y + k.y <= a && a < h.y + k.y + k.height : (h.x + k.x) * scaleFactor <= b && b < scaleFactor * (h.x + k.x + k.width) && (h.y + k.y) * scaleFactor <= a && a < scaleFactor * (h.y + k.y + k.height))
  1752. if (f) {
  1753. f.push(h);
  1754. continue
  1755. } else return h
  1756. } else if (h.isCheckMouseWithDraw) {
  1757. m = createjs.DisplayObject._hitTestContext;
  1758. var n = this._matrix;
  1759. k = d && h.hitArea;
  1760. h.getConcatenatedMatrix(n);
  1761. k && (n.appendTransform(k.x, k.y, k.scaleX, k.scaleY, k.rotation, k.skewX, k.skewY, k.regX, k.regY), n.alpha =
  1762. k.alpha);
  1763. m.globalAlpha = n.alpha;
  1764. m.setTransform(n.a, n.b, n.c, n.d, n.tx - b, n.ty - a);
  1765. (k || h)
  1766. .draw(m);
  1767. if (!this._testHit(m)) continue;
  1768. m.setTransform(1, 0, 0, 1, 0, 0);
  1769. m.clearRect(0, 0, 2, 2);
  1770. if (f) f.push(h);
  1771. else return d && !this.mouseChildren ? this : h
  1772. }
  1773. if (h instanceof c && (h = h.isRoot ? h._getObjectsUnderPoint(b - (h.x + h.regX), a - (h.y + h.regY), f, d) : h._getObjectsUnderPoint(b - (h.x + h.regX) * scaleFactor, a - (h.y + h.regY) * scaleFactor, f, d)))
  1774. if (f) f.push(h);
  1775. else return h
  1776. }
  1777. return null
  1778. }
  1779. m = createjs.DisplayObject._hitTestContext;
  1780. n = this._matrix;
  1781. for (e -=
  1782. 1; 0 <= e; e--)
  1783. if (h = this.children[e], k = d && h.hitArea, h.visible && (k || h.isVisible()) && (!d || h.mouseEnabled))
  1784. if (!k && h instanceof c) {
  1785. if (h = h._getObjectsUnderPoint(b, a, f, d), !f && h) return d && !this.mouseChildren ? this : h
  1786. } else {
  1787. h.getConcatenatedMatrix(n);
  1788. k && (n.appendTransform(k.x, k.y, k.scaleX, k.scaleY, k.rotation, k.skewX, k.skewY, k.regX, k.regY), n.alpha = k.alpha);
  1789. if (h.isOnlyBoundsCheck) {
  1790. if ((k = h.bounding_box) && !((b - n.tx) / scaleFactor >= k.x && (b - n.tx) / scaleFactor <= k.x + k.width && (a - n.ty) / scaleFactor >= k.y && (a - n.ty) / scaleFactor <=
  1791. k.y + k.height)) continue
  1792. } else {
  1793. m.globalAlpha = n.alpha;
  1794. m.setTransform(n.a, n.b, n.c, n.d, n.tx - b, n.ty - a);
  1795. (k || h)
  1796. .draw(m);
  1797. if (!this._testHit(m)) continue;
  1798. m.setTransform(1, 0, 0, 1, 0, 0);
  1799. m.clearRect(0, 0, 2, 2)
  1800. } if (f) f.push(h);
  1801. else return d && !this.mouseChildren ? this : h
  1802. }
  1803. return null
  1804. };
  1805. a._getBounds = function (b, a) {
  1806. var c = this.DisplayObject_getBounds();
  1807. if (c) return this._transformBounds(c, b, a);
  1808. var d, e, h, k, m = a ? this._matrix.identity() : this.getMatrix(this._matrix);
  1809. b && m.prependMatrix(b);
  1810. for (var n = this.children.length, p = 0; p < n; p++) {
  1811. var r =
  1812. this.children[p];
  1813. if (r.visible && (c = r._getBounds(m))) {
  1814. var r = c.x,
  1815. s = c.y,
  1816. t = r + c.width,
  1817. q = s + c.height;
  1818. if (r < d || null == d) d = r;
  1819. if (t > e || null == e) e = t;
  1820. if (s < h || null == h) h = s;
  1821. if (q > k || null == k) k = q
  1822. }
  1823. }
  1824. return null == e ? null : this._rectangle.initialize(d, h, e - d, k - h)
  1825. };
  1826. createjs.Container = c
  1827. })();
  1828. this.createjs = this.createjs || {};
  1829. (function () {
  1830. var c = function (b) {
  1831. this.initialize(b)
  1832. },
  1833. a = c.prototype = new createjs.Container;
  1834. c._snapToPixelEnabled = !1;
  1835. a.autoClear = !0;
  1836. a.canvas = null;
  1837. a.mouseX = 0;
  1838. a.mouseY = 0;
  1839. a.snapToPixelEnabled = !1;
  1840. a.mouseInBounds = !1;
  1841. a.tickOnUpdate = !0;
  1842. a.mouseMoveOutside = !1;
  1843. a.nextStage = null;
  1844. a._pointerData = null;
  1845. a._pointerCount = 0;
  1846. a._primaryPointerID = null;
  1847. a._mouseOverIntervalID = null;
  1848. a.Container_initialize = a.initialize;
  1849. a.initialize = function (b) {
  1850. this.Container_initialize();
  1851. this.canvas = "string" == typeof b ? document.getElementById(b) :
  1852. b;
  1853. this._pointerData = {};
  1854. this.enableDOMEvents(!0)
  1855. };
  1856. a.update = function (b) {
  1857. if (this.canvas) {
  1858. this.tickOnUpdate && (this.dispatchEvent("tickstart"), this._tick(arguments.length ? arguments : null), this.dispatchEvent("tickend"));
  1859. this.dispatchEvent("drawstart");
  1860. c._snapToPixelEnabled = this.snapToPixelEnabled;
  1861. this.autoClear && this.clear();
  1862. var a = this.canvas.getContext("2d");
  1863. a.save();
  1864. this.updateContext(a);
  1865. this.draw(a, !1);
  1866. a.restore();
  1867. this.dispatchEvent("drawend")
  1868. }
  1869. };
  1870. a.handleEvent = function (b) {
  1871. "tick" == b.type && this.update(b)
  1872. };
  1873. a.clear = function () {
  1874. if (this.canvas) {
  1875. var b = this.canvas.getContext("2d");
  1876. b.setTransform(1, 0, 0, 1, 0, 0);
  1877. b.clearRect(0, 0, this.canvas.width + 1, this.canvas.height + 1)
  1878. }
  1879. };
  1880. a.toDataURL = function (b, a) {
  1881. a || (a = "image/png");
  1882. var c = this.canvas.getContext("2d"),
  1883. d = this.canvas.width,
  1884. e = this.canvas.height,
  1885. h;
  1886. if (b) {
  1887. h = c.getImageData(0, 0, d, e);
  1888. var k = c.globalCompositeOperation;
  1889. c.globalCompositeOperation = "destination-over";
  1890. c.fillStyle = b;
  1891. c.fillRect(0, 0, d, e)
  1892. }
  1893. var m = this.canvas.toDataURL(a);
  1894. b && (c.clearRect(0, 0, d + 1, e + 1), c.putImageData(h,
  1895. 0, 0), c.globalCompositeOperation = k);
  1896. return m
  1897. };
  1898. a.enableMouseOver = function (b) {
  1899. this._mouseOverIntervalID && (clearInterval(this._mouseOverIntervalID), this._mouseOverIntervalID = null, 0 == b && this._testMouseOver(!0));
  1900. if (null == b) b = 20;
  1901. else if (0 >= b) return;
  1902. var a = this;
  1903. this._mouseOverIntervalID = setInterval(function () {
  1904. a._testMouseOver()
  1905. }, 1E3 / Math.min(50, b))
  1906. };
  1907. a.enableDOMEvents = function (b) {
  1908. null == b && (b = !0);
  1909. var a, c = this._eventListeners;
  1910. if (!b && c) {
  1911. for (a in c) b = c[a], b.t.removeEventListener(a, b.f, !1);
  1912. this._eventListeners =
  1913. null
  1914. } else if (b && !c && this.canvas) {
  1915. b = window.addEventListener ? window : document;
  1916. var d = this,
  1917. c = this._eventListeners = {};
  1918. c.mouseup = {
  1919. t: b,
  1920. f: function (b) {
  1921. d._handleMouseUp(b)
  1922. }
  1923. };
  1924. c.mousemove = {
  1925. t: b,
  1926. f: function (b) {
  1927. d._handleMouseMove(b)
  1928. }
  1929. };
  1930. c.dblclick = {
  1931. t: b,
  1932. f: function (b) {
  1933. d._handleDoubleClick(b)
  1934. }
  1935. };
  1936. c.mousedown = {
  1937. t: this.canvas,
  1938. f: function (b) {
  1939. d._handleMouseDown(b)
  1940. }
  1941. };
  1942. for (a in c) b = c[a], b.t.addEventListener(a, b.f, !1)
  1943. }
  1944. };
  1945. a.clone = function () {
  1946. var b = new c(null);
  1947. this.cloneProps(b);
  1948. return b
  1949. };
  1950. a.toString = function () {
  1951. return "[Stage (name=" + this.name +
  1952. ")]"
  1953. };
  1954. a._getElementRect = function (b) {
  1955. var a;
  1956. try {
  1957. a = b.getBoundingClientRect()
  1958. } catch (c) {
  1959. a = {
  1960. top: b.offsetTop,
  1961. left: b.offsetLeft,
  1962. width: b.offsetWidth,
  1963. height: b.offsetHeight
  1964. }
  1965. }
  1966. var d = (window.pageXOffset || document.scrollLeft || 0) - (document.clientLeft || document.body.clientLeft || 0),
  1967. e = (window.pageYOffset || document.scrollTop || 0) - (document.clientTop || document.body.clientTop || 0),
  1968. h = window.getComputedStyle ? getComputedStyle(b) : b.currentStyle;
  1969. b = parseInt(h.paddingLeft) + parseInt(h.borderLeftWidth);
  1970. var k = parseInt(h.paddingTop) +
  1971. parseInt(h.borderTopWidth),
  1972. m = parseInt(h.paddingRight) + parseInt(h.borderRightWidth),
  1973. h = parseInt(h.paddingBottom) + parseInt(h.borderBottomWidth);
  1974. return {
  1975. left: a.left + d + b,
  1976. right: a.right + d - m,
  1977. top: a.top + e + k,
  1978. bottom: a.bottom + e - h
  1979. }
  1980. };
  1981. a._getPointerData = function (b) {
  1982. var a = this._pointerData[b];
  1983. a || (a = this._pointerData[b] = {
  1984. x: 0,
  1985. y: 0
  1986. }, null != this._primaryPointerID && -1 != this._primaryPointerID) || (this._primaryPointerID = b);
  1987. return a
  1988. };
  1989. a._handleMouseMove = function (b) {
  1990. b || (b = window.event);
  1991. this._handlePointerMove(-1, b, b.pageX, b.pageY)
  1992. };
  1993. a._handlePointerMove = function (b, a, c, d) {
  1994. if (this.canvas) {
  1995. var e = this._getPointerData(b),
  1996. h = e.inBounds;
  1997. this._updatePointerPosition(b, a, c, d);
  1998. if (h || e.inBounds || this.mouseMoveOutside) - 1 == b && e.inBounds == !h && this._dispatchMouseEvent(this, h ? "mouseleave" : "mouseenter", !1, b, e, a), this._dispatchMouseEvent(this, "stagemousemove", !1, b, e, a), this._dispatchMouseEvent(e.target, "pressmove", !0, b, e, a), (h = e.event) && h.hasEventListener("mousemove") && h.dispatchEvent(new createjs.MouseEvent("mousemove", !1, !1, e.x, e.y, a, b, b == this._primaryPointerID,
  1999. e.rawX, e.rawY), oTarget), this.nextStage && this.nextStage._handlePointerMove(b, a, c, d)
  2000. }
  2001. };
  2002. a._updatePointerPosition = function (b, a, c, d) {
  2003. var e = this._getElementRect(this.canvas);
  2004. c -= e.left;
  2005. d -= e.top;
  2006. var h = this.canvas.width,
  2007. k = this.canvas.height;
  2008. c /= (e.right - e.left) / h;
  2009. d /= (e.bottom - e.top) / k;
  2010. e = this._getPointerData(b);
  2011. (e.inBounds = 0 <= c && 0 <= d && c <= h - 1 && d <= k - 1) ? (e.x = c, e.y = d) : this.mouseMoveOutside && (e.x = 0 > c ? 0 : c > h - 1 ? h - 1 : c, e.y = 0 > d ? 0 : d > k - 1 ? k - 1 : d);
  2012. e.posEvtObj = a;
  2013. e.rawX = c;
  2014. e.rawY = d;
  2015. b == this._primaryPointerID && (this.mouseX = e.x,
  2016. this.mouseY = e.y, this.mouseInBounds = e.inBounds)
  2017. };
  2018. a._handleMouseUp = function (b) {
  2019. this._handlePointerUp(-1, b, !1)
  2020. };
  2021. a._handlePointerUp = function (b, a, c) {
  2022. var d = this._getPointerData(b),
  2023. e = d.target;
  2024. e && (e.hasEventListener("pressup") || e.hasEventListener("click")) ? (e.hasEventListener("click") && this._getObjectsUnderPoint(d.x, d.y, null, !0) == e && this._dispatchMouseEvent(e, "click", !0, b, d, a), this._dispatchMouseEvent(e, "pressup", !0, b, d, a)) : this._dispatchMouseEvent(this, "stagemouseup", !1, b, d, a);
  2025. c ? (b == this._primaryPointerID &&
  2026. (this._primaryPointerID = null), delete this._pointerData[b]) : d.event = d.target = null;
  2027. this.nextStage && this.nextStage._handlePointerUp(b, a, c)
  2028. };
  2029. a._handleMouseDown = function (b) {
  2030. this._handlePointerDown(-1, b, b.pageX, b.pageY)
  2031. };
  2032. a._handlePointerDown = function (b, a, c, d) {
  2033. null != d && this._updatePointerPosition(b, a, c, d);
  2034. var e = this._getPointerData(b);
  2035. e.target = this._getObjectsUnderPoint(e.x, e.y, null, !0);
  2036. this._dispatchMouseEvent(e.target, "mousedown", !0, b, e, a);
  2037. e.target && e.target.hasEventListener("mousedown") || this._dispatchMouseEvent(this,
  2038. "stagemousedown", !1, b, e, a);
  2039. this.nextStage && this.nextStage._handlePointerDown(b, a, c, d)
  2040. };
  2041. a._testMouseOver = function (b) {
  2042. if (-1 == this._primaryPointerID && (b || this.mouseX != this._mouseOverX || this.mouseY != this._mouseOverY || !this.mouseInBounds)) {
  2043. var a = this._getPointerData(-1),
  2044. c = a.posEvtObj,
  2045. d, e = -1,
  2046. h = "",
  2047. k;
  2048. if (b || this.mouseInBounds && c && c.target == this.canvas) d = this._getObjectsUnderPoint(this.mouseX, this.mouseY, null, !0), this._mouseOverX = this.mouseX, this._mouseOverY = this.mouseY;
  2049. b = this._mouseOverTarget || [];
  2050. var m = b[b.length -
  2051. 1],
  2052. n = this._mouseOverTarget = [];
  2053. for (k = d; k;) n.unshift(k), null != k.cursor && (h = k.cursor), k = k.parent;
  2054. this.canvas.style.cursor = h;
  2055. h = 0;
  2056. for (k = n.length; h < k && n[h] == b[h]; h++) e = h;
  2057. m != d && this._dispatchMouseEvent(m, "mouseout", !0, -1, a, c);
  2058. for (h = b.length - 1; h > e; h--) this._dispatchMouseEvent(b[h], "rollout", !1, -1, a, c);
  2059. for (h = n.length - 1; h > e; h--) this._dispatchMouseEvent(n[h], "rollover", !1, -1, a, c);
  2060. m != d && this._dispatchMouseEvent(d, "mouseover", !0, -1, a, c)
  2061. }
  2062. };
  2063. a._handleDoubleClick = function (b) {
  2064. var a = this._getPointerData(-1),
  2065. c = this._getObjectsUnderPoint(a.x,
  2066. a.y, null, !0);
  2067. this._dispatchMouseEvent(c, "dblclick", !0, -1, a, b);
  2068. this.nextStage && this.nextStage._handleDoubleClick(b)
  2069. };
  2070. a._dispatchMouseEvent = function (b, a, c, d, e, h) {
  2071. b && (c || b.hasEventListener(a)) && (a = new createjs.MouseEvent(a, c, !1, e.x, e.y, h, d, d == this._primaryPointerID, e.rawX, e.rawY), b.dispatchEvent(a))
  2072. };
  2073. createjs.Stage = c
  2074. })();
  2075. this.createjs = this.createjs || {};
  2076. (function () {
  2077. var c = function (b) {
  2078. this.initialize(b)
  2079. },
  2080. a = c.prototype = new createjs.DisplayObject;
  2081. a.image = null;
  2082. a.snapToPixel = !0;
  2083. a.sourceRect = null;
  2084. a.DisplayObject_initialize = a.initialize;
  2085. a.initialize = function (b) {
  2086. this.DisplayObject_initialize();
  2087. "string" == typeof b ? (this.image = document.createElement("img"), this.image.src = b) : this.image = b
  2088. };
  2089. a.isVisible = function () {
  2090. var b = this.cacheCanvas || this.image && (this.image.complete || this.image.getContext || 2 <= this.image.readyState);
  2091. return !!(this.visible && 0 < this.alpha && 0 != this.scaleX &&
  2092. 0 != this.scaleY && b)
  2093. };
  2094. a.DisplayObject_draw = a.draw;
  2095. a.draw = function (b, a) {
  2096. if (this.DisplayObject_draw(b, a)) return !0;
  2097. var c = this.sourceRect;
  2098. c ? b.drawImage(this.image, c.x, c.y, c.width, c.height, 0, 0, c.width, c.height) : b.drawImage(this.image, 0, 0);
  2099. return !0
  2100. };
  2101. a.DisplayObject_getBounds = a.getBounds;
  2102. a.getBounds = function () {
  2103. var b = this.DisplayObject_getBounds();
  2104. if (b) return b;
  2105. b = this.sourceRect || this.image;
  2106. return this.image && (this.image.complete || this.image.getContext || 2 <= this.image.readyState) ? this._rectangle.initialize(0,
  2107. 0, b.width, b.height) : null
  2108. };
  2109. a.clone = function () {
  2110. var b = new c(this.image);
  2111. this.sourceRect && (b.sourceRect = this.sourceRect.clone());
  2112. this.cloneProps(b);
  2113. return b
  2114. };
  2115. a.toString = function () {
  2116. return "[Bitmap (name=" + this.name + ")]"
  2117. };
  2118. createjs.Bitmap = c
  2119. })();
  2120. this.createjs = this.createjs || {};
  2121. (function () {
  2122. var c = function (b, a) {
  2123. this.initialize(b, a)
  2124. },
  2125. a = c.prototype = new createjs.DisplayObject;
  2126. a.currentFrame = 0;
  2127. a.currentAnimation = null;
  2128. a.paused = !0;
  2129. a.spriteSheet = null;
  2130. a.snapToPixel = !0;
  2131. a.isLoop = !0;
  2132. a.offset = 0;
  2133. a.currentAnimationFrame = 0;
  2134. a.framerate = 0;
  2135. a._advanceCount = 0;
  2136. a._animation = null;
  2137. a._currentFrame = null;
  2138. a.rectMask = null;
  2139. a.DisplayObject_initialize = a.initialize;
  2140. a.initialize = function (b, a) {
  2141. this.DisplayObject_initialize();
  2142. this.spriteSheet = b;
  2143. a && this.gotoAndPlay(a)
  2144. };
  2145. a.isVisible = function () {
  2146. var b = this.cacheCanvas ||
  2147. this.spriteSheet.complete;
  2148. return !!(this.visible && 0 < this.alpha && 0 != this.scaleX && 0 != this.scaleY && b)
  2149. };
  2150. a.DisplayObject_draw = a.draw;
  2151. a.draw = function (b, a) {
  2152. if (this.DisplayObject_draw(b, a)) return !0;
  2153. this._normalizeFrame();
  2154. var c = this.spriteSheet.getFrame(this._currentFrame | 0);
  2155. if (!c) return !1;
  2156. var d = c.rect;
  2157. this.rectMask ? b.drawImage(c.image, d.x + this.rectMask.x, d.y + this.rectMask.y, d.width + this.rectMask.width, d.height + this.rectMask.height, -c.regX + this.rectMask.x, -c.regY + this.rectMask.y, d.width + this.rectMask.width,
  2158. d.height + this.rectMask.height) : 1 <= d.width && 1 <= d.height && b.drawImage(c.image, d.x, d.y, d.width, d.height, -c.regX, -c.regY, d.width, d.height);
  2159. return !0
  2160. };
  2161. a.play = function () {
  2162. this.paused = !1
  2163. };
  2164. a.stop = function () {
  2165. this.paused = !0
  2166. };
  2167. a.gotoAndPlay = function (b) {
  2168. this.paused = !1;
  2169. this._goto(b)
  2170. };
  2171. a.gotoAndStop = function (b) {
  2172. this.paused = !0;
  2173. this._goto(b)
  2174. };
  2175. a.advance = function (b) {
  2176. var a = this._animation && this._animation.speed || 1,
  2177. c = this.framerate || this.spriteSheet.framerate;
  2178. b = c && null != b ? b / (1E3 / c) : 1;
  2179. this._animation ? this.currentAnimationFrame +=
  2180. b * a : this._currentFrame += b * a;
  2181. this._normalizeFrame()
  2182. };
  2183. a.DisplayObject_getBounds = a.getBounds;
  2184. a.getBounds = function () {
  2185. return this.DisplayObject_getBounds() || this.spriteSheet.getFrameBounds(this.currentFrame, this._rectangle)
  2186. };
  2187. a.clone = function () {
  2188. var b = new c(this.spriteSheet);
  2189. this.cloneProps(b);
  2190. return b
  2191. };
  2192. a.toString = function () {
  2193. return "[Sprite (name=" + this.name + ")]"
  2194. };
  2195. a.DisplayObject__tick = a._tick;
  2196. a._tick = function (b) {
  2197. this.paused || this.advance(b && b[0] && b[0].delta);
  2198. this.DisplayObject__tick(b)
  2199. };
  2200. a._normalizeFrame =
  2201. function () {
  2202. var b = this._animation,
  2203. a = this.paused,
  2204. c = this._currentFrame,
  2205. d = this.currentAnimationFrame,
  2206. e;
  2207. if (b)
  2208. if (e = b.frames.length, (d | 0) >= e) {
  2209. var h = b.next;
  2210. if (!this._dispatchAnimationEnd(b, c, a, h, e - 1)) {
  2211. if (h && this.isLoop) return this._goto(h, d - e);
  2212. this.paused = !0;
  2213. d = this.currentAnimationFrame = b.frames.length - 1;
  2214. this._currentFrame = b.frames[d]
  2215. }
  2216. } else this._currentFrame = b.frames[d | 0];
  2217. else if (e = this.spriteSheet.getNumFrames(), c >= e && !this._dispatchAnimationEnd(b, c, a, e - 1) && (this._currentFrame -= e) >= e) return this._normalizeFrame();
  2218. this.currentFrame = this._currentFrame | 0
  2219. };
  2220. a._dispatchAnimationEnd = function (b, a, c, d, e) {
  2221. var h = b ? b.name : null;
  2222. if (this.hasEventListener("animationend")) {
  2223. var k = new createjs.Event("animationend");
  2224. k.name = h;
  2225. k.next = d;
  2226. this.dispatchEvent(k)
  2227. }
  2228. b = this._animation != b || this._currentFrame != a;
  2229. b || c || !this.paused || (this.currentAnimationFrame = e, b = !0);
  2230. return b
  2231. };
  2232. a.DisplayObject_cloneProps = a.cloneProps;
  2233. a.cloneProps = function (b) {
  2234. this.DisplayObject_cloneProps(b);
  2235. b.currentFrame = this.currentFrame;
  2236. b._currentFrame = this._currentFrame;
  2237. b.currentAnimation = this.currentAnimation;
  2238. b.paused = this.paused;
  2239. b._animation = this._animation;
  2240. b.currentAnimationFrame = this.currentAnimationFrame;
  2241. b.framerate = this.framerate
  2242. };
  2243. a._goto = function (b, a) {
  2244. if (isNaN(b)) {
  2245. var c = this.spriteSheet.getAnimation(b);
  2246. c && (this.currentAnimationFrame = a || 0, this._animation = c, this.currentAnimation = b, this._normalizeFrame())
  2247. } else this.currentAnimationFrame = 0, this.currentAnimation = this._animation = null, this._currentFrame = b, this._normalizeFrame()
  2248. };
  2249. createjs.Sprite = c
  2250. })();
  2251. this.createjs = this.createjs || {};
  2252. (function () {
  2253. if (!createjs.Sprite) throw "BitmapAnimation is deprecated in favour of Sprite. See VERSIONS file for info on changes.";
  2254. (createjs.BitmapAnimation = function (c) {
  2255. console.log("BitmapAnimation is deprecated in favour of Sprite. See VERSIONS file for info on changes.");
  2256. this.initialize(c)
  2257. })
  2258. .prototype = new createjs.Sprite
  2259. })();
  2260. this.createjs = this.createjs || {};
  2261. (function () {
  2262. var c = function (b) {
  2263. this.initialize(b)
  2264. },
  2265. a = c.prototype = new createjs.DisplayObject;
  2266. a.graphics = null;
  2267. a.DisplayObject_initialize = a.initialize;
  2268. a.initialize = function (b) {
  2269. this.DisplayObject_initialize();
  2270. this.graphics = b ? b : new createjs.Graphics
  2271. };
  2272. a.isVisible = function () {
  2273. var b = this.cacheCanvas || this.graphics && !this.graphics.isEmpty();
  2274. return !!(this.visible && 0 < this.alpha && 0 != this.scaleX && 0 != this.scaleY && b)
  2275. };
  2276. a.DisplayObject_draw = a.draw;
  2277. a.draw = function (b, a) {
  2278. if (this.DisplayObject_draw(b, a)) return !0;
  2279. this.graphics.draw(b);
  2280. return !0
  2281. };
  2282. a.clone = function (b) {
  2283. b = new c(b && this.graphics ? this.graphics.clone() : this.graphics);
  2284. this.cloneProps(b);
  2285. return b
  2286. };
  2287. a.toString = function () {
  2288. return "[Shape (name=" + this.name + ")]"
  2289. };
  2290. createjs.Shape = c
  2291. })();
  2292. this.createjs = this.createjs || {};
  2293. (function () {
  2294. var c = function (b, a, c) {
  2295. this.initialize(b, a, c)
  2296. },
  2297. a = c.prototype = new createjs.DisplayObject,
  2298. b = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas");
  2299. b.getContext && (c._workingContext = b.getContext("2d"), b.width = b.height = 1);
  2300. c.H_OFFSETS = {
  2301. start: 0,
  2302. left: 0,
  2303. center: -0.5,
  2304. end: -1,
  2305. right: -1
  2306. };
  2307. c.V_OFFSETS = {
  2308. top: 0,
  2309. hanging: -0.01,
  2310. middle: -0.4,
  2311. alphabetic: -0.8,
  2312. ideographic: -0.85,
  2313. bottom: -1
  2314. };
  2315. a.text = "";
  2316. a.font = null;
  2317. a.color = null;
  2318. a.textAlign = "left";
  2319. a.textBaseline = "top";
  2320. a.maxWidth = null;
  2321. a.outline = 0;
  2322. a.lineHeight = 0;
  2323. a.lineWidth = null;
  2324. a.DisplayObject_initialize = a.initialize;
  2325. a.initialize = function (b, a, c) {
  2326. this.DisplayObject_initialize();
  2327. this.text = b;
  2328. this.font = a;
  2329. this.color = c
  2330. };
  2331. a.isVisible = function () {
  2332. var b = this.cacheCanvas || null != this.text && "" !== this.text;
  2333. return !!(this.visible && 0 < this.alpha && 0 != this.scaleX && 0 != this.scaleY && b)
  2334. };
  2335. a.DisplayObject_draw = a.draw;
  2336. a.draw = function (b, a) {
  2337. if (this.DisplayObject_draw(b, a)) return !0;
  2338. var c = this.color || "#000";
  2339. this.outline ? (b.strokeStyle = c, b.lineWidth = 1 * this.outline) : b.fillStyle =
  2340. c;
  2341. this._drawText(this._prepContext(b));
  2342. return !0
  2343. };
  2344. a.getMeasuredWidth = function () {
  2345. return this._prepContext(c._workingContext)
  2346. .measureText(this.text)
  2347. .width
  2348. };
  2349. a.getMeasuredLineHeight = function () {
  2350. return 1.2 * this._prepContext(c._workingContext)
  2351. .measureText("M")
  2352. .width
  2353. };
  2354. a.getMeasuredHeight = function () {
  2355. return this._drawText(null, {})
  2356. .height
  2357. };
  2358. a.DisplayObject_getBounds = a.getBounds;
  2359. a.getBounds = function () {
  2360. var b = this.DisplayObject_getBounds();
  2361. if (b) return b;
  2362. if (null == this.text || "" == this.text) return null;
  2363. var b = this._drawText(null, {}),
  2364. a = this.maxWidth && this.maxWidth < b.width ? this.maxWidth : b.width,
  2365. d = a * c.H_OFFSETS[this.textAlign || "left"],
  2366. e = (this.lineHeight || this.getMeasuredLineHeight()) * c.V_OFFSETS[this.textBaseline || "top"];
  2367. return this._rectangle.initialize(d, e, a, b.height)
  2368. };
  2369. a.clone = function () {
  2370. var b = new c(this.text, this.font, this.color);
  2371. this.cloneProps(b);
  2372. return b
  2373. };
  2374. a.toString = function () {
  2375. return "[Text (text=" + (20 < this.text.length ? this.text.substr(0, 17) + "..." : this.text) + ")]"
  2376. };
  2377. a.DisplayObject_cloneProps = a.cloneProps;
  2378. a.cloneProps = function (b) {
  2379. this.DisplayObject_cloneProps(b);
  2380. b.textAlign = this.textAlign;
  2381. b.textBaseline = this.textBaseline;
  2382. b.maxWidth = this.maxWidth;
  2383. b.outline = this.outline;
  2384. b.lineHeight = this.lineHeight;
  2385. b.lineWidth = this.lineWidth
  2386. };
  2387. a._prepContext = function (b) {
  2388. b.font = this.font;
  2389. b.textAlign = this.textAlign || "left";
  2390. b.textBaseline = this.textBaseline || "top";
  2391. return b
  2392. };
  2393. a._drawText = function (b, a) {
  2394. var d = !!b;
  2395. d || (b = this._prepContext(c._workingContext));
  2396. for (var e = this.lineHeight || this.getMeasuredLineHeight(), h = 0, k = 0, m = String(this.text)
  2397. .split(/(?:\r\n|\r|\n)/), n = 0, p = m.length; n < p; n++) {
  2398. var r =
  2399. m[n],
  2400. s = null;
  2401. if (null != this.lineWidth && (s = b.measureText(r)
  2402. .width) > this.lineWidth)
  2403. for (var t = r.split(/(\s)/), r = t[0], s = b.measureText(r)
  2404. .width, q = 1, w = t.length; q < w; q += 2) {
  2405. var u = b.measureText(t[q] + t[q + 1])
  2406. .width;
  2407. s + u > this.lineWidth ? (d && this._drawTextLine(b, r, k * e), s > h && (h = s), r = t[q + 1], s = b.measureText(r)
  2408. .width, k++) : (r += t[q] + t[q + 1], s += u)
  2409. }
  2410. d && this._drawTextLine(b, r, k * e);
  2411. a && null == s && (s = b.measureText(r)
  2412. .width);
  2413. s > h && (h = s);
  2414. k++
  2415. }
  2416. a && (a.count = k, a.width = h, a.height = k * e);
  2417. return a
  2418. };
  2419. a._drawTextLine = function (b, a, c) {
  2420. this.outline ?
  2421. b.strokeText(a, 0, c, this.maxWidth || 65535) : b.fillText(a, 0, c, this.maxWidth || 65535)
  2422. };
  2423. createjs.Text = c
  2424. })();
  2425. this.createjs = this.createjs || {};
  2426. (function () {
  2427. function c(b, a) {
  2428. this.initialize(b, a)
  2429. }
  2430. var a = c.prototype = new createjs.DisplayObject;
  2431. a.text = "";
  2432. a.spriteSheet = null;
  2433. a.lineHeight = 0;
  2434. a.letterSpacing = 0;
  2435. a.isNeedCenter = !1;
  2436. a.centerX = 0;
  2437. a.centerY = 0;
  2438. a.textBounds;
  2439. a.spaceWidth = 0;
  2440. a.postfix = "";
  2441. a.DisplayObject_initialize = a.initialize;
  2442. a.initialize = function (b, c) {
  2443. this.DisplayObject_initialize();
  2444. this.text = b;
  2445. this.spriteSheet = c;
  2446. a.textBounds = new createjs.Rectangle
  2447. };
  2448. a.DisplayObject_draw = a.draw;
  2449. a.draw = function (b, a) {
  2450. if (this.DisplayObject_draw(b, a)) return !0;
  2451. this._drawText(b)
  2452. };
  2453. a.isVisible = function () {
  2454. var b = this.cacheCanvas || this.spriteSheet && this.spriteSheet.complete && this.text;
  2455. return !!(this.visible && 0 < this.alpha && 0 != this.scaleX && 0 != this.scaleY && b)
  2456. };
  2457. a.getBounds = function () {
  2458. var b = this._rectangle;
  2459. this._drawText(null, b);
  2460. return b.width ? b : null
  2461. };
  2462. a._getFrame = function (b, a) {
  2463. var c, d = a.getAnimation(b + this.postfix);
  2464. d || (b != (c = b.toUpperCase()) || b != (c = b.toLowerCase()) || (c = null), c && (d = a.getAnimation(c + this.postfix)));
  2465. return d && a.getFrame(d.frames[0])
  2466. };
  2467. a._getLineHeight = function (b) {
  2468. return (b =
  2469. this._getFrame("1", b) || this._getFrame("T", b) || this._getFrame("L", b) || b.getFrame(0)) ? b.rect.height : 1
  2470. };
  2471. a._getSpaceWidth = function (b) {
  2472. return (b = this._getFrame("1", b) || this._getFrame("l", b) || this._getFrame("e", b) || this._getFrame("a", b) || b.getFrame(0)) ? b.rect.width : 1
  2473. };
  2474. a._drawText = function (b, a) {
  2475. var c, d, e, h = 0,
  2476. k = 0,
  2477. m = this.spaceWidth,
  2478. n = this.lineHeight,
  2479. p = this.spriteSheet;
  2480. 0 == m && (m = this._getSpaceWidth(p));
  2481. 0 == n && (n = this._getLineHeight(p));
  2482. for (var r = 0, s = 0, t = this.text.length; s < t; s++)
  2483. if (c = this.text.charAt(s), " " == c) h +=
  2484. m;
  2485. else if ("\n" == c || "\r" == c) "\r" == c && "\n" == this.text.charAt(s + 1) && s++, h - e > r && (r = h - e), h = 0, k += n;
  2486. else {
  2487. var q = this._getFrame(c, p);
  2488. if (q) {
  2489. var w = q.rect;
  2490. e = q.regX;
  2491. c = w.width;
  2492. b && b.drawImage(q.image, w.x, w.y, c, d = w.height, h - e, k - q.regY, c, d);
  2493. h += c + this.letterSpacing
  2494. }
  2495. }
  2496. h - e > r && (r = h - e);
  2497. a && (a.width = r - this.letterSpacing, a.height = k + n);
  2498. this.textBounds.width = r - this.letterSpacing;
  2499. this.textBounds.height = k + n
  2500. };
  2501. createjs.BitmapText = c
  2502. })();
  2503. this.createjs = this.createjs || {};
  2504. (function () {
  2505. var c = function () {
  2506. throw "SpriteSheetUtils cannot be instantiated";
  2507. },
  2508. a = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas");
  2509. a.getContext && (c._workingCanvas = a, c._workingContext = a.getContext("2d"), a.width = a.height = 1);
  2510. c.addFlippedFrames = function (b, a, f, d) {
  2511. if (a || f || d) {
  2512. var e = 0;
  2513. a && c._flip(b, ++e, !0, !1);
  2514. f && c._flip(b, ++e, !1, !0);
  2515. d && c._flip(b, ++e, !0, !0)
  2516. }
  2517. };
  2518. c.extractFrame = function (b, a) {
  2519. isNaN(a) && (a = b.getAnimation(a)
  2520. .frames[0]);
  2521. var f = b.getFrame(a);
  2522. if (!f) return null;
  2523. var d = f.rect,
  2524. e = c._workingCanvas;
  2525. e.width = d.width;
  2526. e.height = d.height;
  2527. c._workingContext.drawImage(f.image, d.x, d.y, d.width, d.height, 0, 0, d.width, d.height);
  2528. f = document.createElement("img");
  2529. f.src = e.toDataURL("image/png");
  2530. return f
  2531. };
  2532. c.mergeAlpha = function (b, a, c) {
  2533. c || (c = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas"));
  2534. c.width = Math.max(a.width, b.width);
  2535. c.height = Math.max(a.height, b.height);
  2536. var d = c.getContext("2d");
  2537. d.save();
  2538. d.drawImage(b, 0, 0);
  2539. d.globalCompositeOperation = "destination-in";
  2540. d.drawImage(a,
  2541. 0, 0);
  2542. d.restore();
  2543. return c
  2544. };
  2545. c._flip = function (b, a, f, d) {
  2546. for (var e = b._images, h = c._workingCanvas, k = c._workingContext, m = e.length / a, n = 0; n < m; n++) {
  2547. var p = e[n];
  2548. p.__tmp = n;
  2549. k.setTransform(1, 0, 0, 1, 0, 0);
  2550. k.clearRect(0, 0, h.width + 1, h.height + 1);
  2551. h.width = p.width;
  2552. h.height = p.height;
  2553. k.setTransform(f ? -1 : 1, 0, 0, d ? -1 : 1, f ? p.width : 0, d ? p.height : 0);
  2554. k.drawImage(p, 0, 0);
  2555. var r = document.createElement("img");
  2556. r.src = h.toDataURL("image/png");
  2557. r.width = p.width;
  2558. r.height = p.height;
  2559. e.push(r)
  2560. }
  2561. k = b._frames;
  2562. h = k.length / a;
  2563. for (n = 0; n < h; n++) {
  2564. var p = k[n],
  2565. s = p.rect.clone(),
  2566. r = e[p.image.__tmp + m * a],
  2567. t = {
  2568. image: r,
  2569. rect: s,
  2570. regX: p.regX,
  2571. regY: p.regY
  2572. };
  2573. f && (s.x = r.width - s.x - s.width, t.regX = s.width - p.regX);
  2574. d && (s.y = r.height - s.y - s.height, t.regY = s.height - p.regY);
  2575. k.push(t)
  2576. }
  2577. f = "_" + (f ? "h" : "") + (d ? "v" : "");
  2578. d = b._animations;
  2579. b = b._data;
  2580. e = d.length / a;
  2581. for (n = 0; n < e; n++) {
  2582. k = d[n];
  2583. p = b[k];
  2584. m = {
  2585. name: k + f,
  2586. frequency: p.frequency,
  2587. next: p.next,
  2588. frames: []
  2589. };
  2590. p.next && (m.next += f);
  2591. k = p.frames;
  2592. p = 0;
  2593. for (r = k.length; p < r; p++) m.frames.push(k[p] + h * a);
  2594. b[m.name] = m;
  2595. d.push(m.name)
  2596. }
  2597. };
  2598. createjs.SpriteSheetUtils = c
  2599. })();
  2600. this.createjs = this.createjs || {};
  2601. (function () {
  2602. var c = function () {
  2603. this.initialize()
  2604. },
  2605. a = c.prototype = new createjs.EventDispatcher;
  2606. c.ERR_DIMENSIONS = "frame dimensions exceed max spritesheet dimensions";
  2607. c.ERR_RUNNING = "a build is already running";
  2608. a.maxWidth = 2048;
  2609. a.maxHeight = 2048;
  2610. a.spriteSheet = null;
  2611. a.scale = 1;
  2612. a.padding = 1;
  2613. a.timeSlice = 0.3;
  2614. a.progress = -1;
  2615. a._frames = null;
  2616. a._animations = null;
  2617. a._data = null;
  2618. a._nextFrameIndex = 0;
  2619. a._index = 0;
  2620. a._timerID = null;
  2621. a._scale = 1;
  2622. a.initialize = function () {
  2623. this._frames = [];
  2624. this._animations = {}
  2625. };
  2626. a.addFrame = function (b, a, f, d,
  2627. e, h) {
  2628. if (this._data) throw c.ERR_RUNNING;
  2629. a = a || b.bounds || b.nominalBounds;
  2630. !a && b.getBounds && (a = b.getBounds());
  2631. if (!a) return null;
  2632. f = f || 1;
  2633. return this._frames.push({
  2634. source: b,
  2635. sourceRect: a,
  2636. scale: f,
  2637. funct: d,
  2638. params: e,
  2639. scope: h,
  2640. index: this._frames.length,
  2641. height: a.height * f
  2642. }) - 1
  2643. };
  2644. a.addAnimation = function (b, a, f, d) {
  2645. if (this._data) throw c.ERR_RUNNING;
  2646. this._animations[b] = {
  2647. frames: a,
  2648. next: f,
  2649. frequency: d
  2650. }
  2651. };
  2652. a.addMovieClip = function (b, a, f) {
  2653. if (this._data) throw c.ERR_RUNNING;
  2654. var d = b.frameBounds,
  2655. e = a || b.bounds || b.nominalBounds;
  2656. !e && b.getBounds &&
  2657. (e = b.getBounds());
  2658. if (!e && !d) return null;
  2659. a = this._frames.length;
  2660. for (var h = b.timeline.duration, k = 0; k < h; k++) this.addFrame(b, d && d[k] ? d[k] : e, f, function (b) {
  2661. var a = this.actionsEnabled;
  2662. this.actionsEnabled = !1;
  2663. this.gotoAndStop(b);
  2664. this.actionsEnabled = a
  2665. }, [k], b);
  2666. k = b.timeline._labels;
  2667. b = [];
  2668. for (var m in k) b.push({
  2669. index: k[m],
  2670. label: m
  2671. });
  2672. if (b.length)
  2673. for (b.sort(function (b, a) {
  2674. return b.index - a.index
  2675. }), k = 0, m = b.length; k < m; k++) {
  2676. f = b[k].label;
  2677. for (var d = a + (k == m - 1 ? h : b[k + 1].index), e = [], n = a + b[k].index; n < d; n++) e.push(n);
  2678. this.addAnimation(f,
  2679. e, !0)
  2680. }
  2681. };
  2682. a.build = function () {
  2683. if (this._data) throw c.ERR_RUNNING;
  2684. for (this._startBuild(); this._drawNext(););
  2685. this._endBuild();
  2686. return this.spriteSheet
  2687. };
  2688. a.buildAsync = function (b) {
  2689. if (this._data) throw c.ERR_RUNNING;
  2690. this.timeSlice = b;
  2691. this._startBuild();
  2692. var a = this;
  2693. this._timerID = setTimeout(function () {
  2694. a._run()
  2695. }, 50 - 50 * Math.max(0.01, Math.min(0.99, this.timeSlice || 0.3)))
  2696. };
  2697. a.stopAsync = function () {
  2698. clearTimeout(this._timerID);
  2699. this._data = null
  2700. };
  2701. a.clone = function () {
  2702. throw "SpriteSheetBuilder cannot be cloned.";
  2703. };
  2704. a.toString = function () {
  2705. return "[SpriteSheetBuilder]"
  2706. };
  2707. a._startBuild = function () {
  2708. var b = this.padding || 0;
  2709. this.progress = 0;
  2710. this.spriteSheet = null;
  2711. this._index = 0;
  2712. this._scale = this.scale;
  2713. var a = [];
  2714. this._data = {
  2715. images: [],
  2716. frames: a,
  2717. animations: this._animations
  2718. };
  2719. var f = this._frames.slice();
  2720. f.sort(function (b, a) {
  2721. return b.height <= a.height ? -1 : 1
  2722. });
  2723. if (f[f.length - 1].height + 2 * b > this.maxHeight) throw c.ERR_DIMENSIONS;
  2724. for (var d = 0, e = 0, h = 0; f.length;) {
  2725. var k = this._fillRow(f, d, h, a, b);
  2726. k.w > e && (e = k.w);
  2727. d += k.h;
  2728. if (!k.h || !f.length) {
  2729. var m = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas");
  2730. m.width = this._getSize(e, this.maxWidth);
  2731. m.height = this._getSize(d, this.maxHeight);
  2732. this._data.images[h] = m;
  2733. k.h || (e = d = 0, h++)
  2734. }
  2735. }
  2736. };
  2737. a._getSize = function (b, a) {
  2738. for (var c = 4; Math.pow(2, ++c) < b;);
  2739. return Math.min(a, Math.pow(2, c))
  2740. };
  2741. a._fillRow = function (b, a, f, d, e) {
  2742. var h = this.maxWidth,
  2743. k = this.maxHeight;
  2744. a += e;
  2745. for (var k = k - a, m = e, n = 0, p = b.length - 1; 0 <= p; p--) {
  2746. var r = b[p],
  2747. s = this._scale * r.scale,
  2748. t = r.sourceRect,
  2749. q = r.source,
  2750. w = Math.floor(s * t.x - e),
  2751. u = Math.floor(s * t.y - e),
  2752. x = Math.ceil(s * t.height + 2 * e),
  2753. t = Math.ceil(s * t.width + 2 * e);
  2754. if (t > h) throw c.ERR_DIMENSIONS;
  2755. x > k || m + t > h || (r.img = f, r.rect = new createjs.Rectangle(m, a, t, x), n = n || x, b.splice(p, 1), d[r.index] = [m, a, t, x, f, Math.round(-w + s * q.regX - e), Math.round(-u + s * q.regY - e)], m += t)
  2756. }
  2757. return {
  2758. w: m,
  2759. h: n
  2760. }
  2761. };
  2762. a._endBuild = function () {
  2763. this.spriteSheet = new createjs.SpriteSheet(this._data);
  2764. this._data = null;
  2765. this.progress = 1;
  2766. this.dispatchEvent("complete")
  2767. };
  2768. a._run = function () {
  2769. for (var b = 50 * Math.max(0.01, Math.min(0.99, this.timeSlice || 0.3)), a = (new Date)
  2770. .getTime() + b, c = !1; a > (new Date)
  2771. .getTime();)
  2772. if (!this._drawNext()) {
  2773. c = !0;
  2774. break
  2775. }
  2776. if (c) this._endBuild();
  2777. else {
  2778. var d = this;
  2779. this._timerID = setTimeout(function () {
  2780. d._run()
  2781. }, 50 - b)
  2782. }
  2783. b = this.progress = this._index / this._frames.length;
  2784. this.hasEventListener("progress") && (a = new createjs.Event("progress"), a.progress = b, this.dispatchEvent(a))
  2785. };
  2786. a._drawNext = function () {
  2787. var b = this._frames[this._index],
  2788. a = b.scale * this._scale,
  2789. c = b.rect,
  2790. d = b.sourceRect,
  2791. e = this._data.images[b.img].getContext("2d");
  2792. b.funct && b.funct.apply(b.scope, b.params);
  2793. e.save();
  2794. e.beginPath();
  2795. e.rect(c.x, c.y, c.width, c.height);
  2796. e.clip();
  2797. e.translate(Math.ceil(c.x - d.x *
  2798. a), Math.ceil(c.y - d.y * a));
  2799. e.scale(a, a);
  2800. b.source.draw(e);
  2801. e.restore();
  2802. return ++this._index < this._frames.length
  2803. };
  2804. createjs.SpriteSheetBuilder = c
  2805. })();
  2806. this.createjs = this.createjs || {};
  2807. (function () {
  2808. var c = function (b) {
  2809. this.initialize(b)
  2810. },
  2811. a = c.prototype = new createjs.DisplayObject;
  2812. a.htmlElement = null;
  2813. a._oldMtx = null;
  2814. a._visible = !1;
  2815. a.DisplayObject_initialize = a.initialize;
  2816. a.initialize = function (b) {
  2817. "string" == typeof b && (b = document.getElementById(b));
  2818. this.DisplayObject_initialize();
  2819. this.mouseEnabled = !1;
  2820. this.htmlElement = b;
  2821. b = b.style;
  2822. b.position = "absolute";
  2823. b.transformOrigin = b.WebkitTransformOrigin = b.msTransformOrigin = b.MozTransformOrigin = b.OTransformOrigin = "0% 0%"
  2824. };
  2825. a.isVisible = function () {
  2826. return null !=
  2827. this.htmlElement
  2828. };
  2829. a.draw = function (b, a) {
  2830. this.visible && (this._visible = !0);
  2831. return !0
  2832. };
  2833. a.cache = function () {};
  2834. a.uncache = function () {};
  2835. a.updateCache = function () {};
  2836. a.hitTest = function () {};
  2837. a.localToGlobal = function () {};
  2838. a.globalToLocal = function () {};
  2839. a.localToLocal = function () {};
  2840. a.clone = function () {
  2841. throw "DOMElement cannot be cloned.";
  2842. };
  2843. a.toString = function () {
  2844. return "[DOMElement (name=" + this.name + ")]"
  2845. };
  2846. a.DisplayObject__tick = a._tick;
  2847. a._tick = function (b) {
  2848. var a = this.getStage();
  2849. this._visible = !1;
  2850. a && a.on("drawend", this._handleDrawEnd,
  2851. this, !0);
  2852. this.DisplayObject__tick(b)
  2853. };
  2854. a._handleDrawEnd = function (b) {
  2855. if (b = this.htmlElement) {
  2856. b = b.style;
  2857. var a = this._visible ? "visible" : "hidden";
  2858. a != b.visibility && (b.visibility = a);
  2859. if (this._visible) {
  2860. var a = this.getConcatenatedMatrix(this._matrix),
  2861. c = this._oldMtx;
  2862. c && c.alpha == a.alpha || (b.opacity = "" + (1E4 * a.alpha | 0) / 1E4, c && (c.alpha = a.alpha));
  2863. if (!c || c.tx != a.tx || c.ty != a.ty || c.a != a.a || c.b != a.b || c.c != a.c || c.d != a.d) {
  2864. var d = "matrix(" + (1E4 * a.a | 0) / 1E4 + "," + (1E4 * a.b | 0) / 1E4 + "," + (1E4 * a.c | 0) / 1E4 + "," + (1E4 * a.d | 0) / 1E4 + "," + (a.tx +
  2865. 0.5 | 0);
  2866. b.transform = b.WebkitTransform = b.OTransform = b.msTransform = d + "," + (a.ty + 0.5 | 0) + ")";
  2867. b.MozTransform = d + "px," + (a.ty + 0.5 | 0) + "px)";
  2868. this._oldMtx = c ? c.copy(a) : a.clone()
  2869. }
  2870. }
  2871. }
  2872. };
  2873. createjs.DOMElement = c
  2874. })();
  2875. this.createjs = this.createjs || {};
  2876. (function () {
  2877. var c = function () {
  2878. this.initialize()
  2879. },
  2880. a = c.prototype;
  2881. a.initialize = function () {};
  2882. a.getBounds = function () {
  2883. return null
  2884. };
  2885. a.applyFilter = function (b, a, c, d, e, h, k, m) {};
  2886. a.toString = function () {
  2887. return "[Filter]"
  2888. };
  2889. a.clone = function () {
  2890. return new c
  2891. };
  2892. createjs.Filter = c
  2893. })();
  2894. this.createjs = this.createjs || {};
  2895. (function () {
  2896. var c = function (b, a, c) {
  2897. this.initialize(b, a, c)
  2898. },
  2899. a = c.prototype = new createjs.Filter;
  2900. a.initialize = function (b, a, c) {
  2901. if (isNaN(b) || 0 > b) b = 0;
  2902. this.blurX = b | 0;
  2903. if (isNaN(a) || 0 > a) a = 0;
  2904. this.blurY = a | 0;
  2905. if (isNaN(c) || 1 > c) c = 1;
  2906. this.quality = c | 0
  2907. };
  2908. a.blurX = 0;
  2909. a.blurY = 0;
  2910. a.quality = 1;
  2911. a.mul_table = [1, 171, 205, 293, 57, 373, 79, 137, 241, 27, 391, 357, 41, 19, 283, 265, 497, 469, 443, 421, 25, 191, 365, 349, 335, 161, 155, 149, 9, 278, 269, 261, 505, 245, 475, 231, 449, 437, 213, 415, 405, 395, 193, 377, 369, 361, 353, 345, 169, 331, 325, 319, 313, 307, 301, 37, 145, 285, 281,
  2912. 69, 271, 267, 263, 259, 509, 501, 493, 243, 479, 118, 465, 459, 113, 446, 55, 435, 429, 423, 209, 413, 51, 403, 199, 393, 97, 3, 379, 375, 371, 367, 363, 359, 355, 351, 347, 43, 85, 337, 333, 165, 327, 323, 5, 317, 157, 311, 77, 305, 303, 75, 297, 294, 73, 289, 287, 71, 141, 279, 277, 275, 68, 135, 67, 133, 33, 262, 260, 129, 511, 507, 503, 499, 495, 491, 61, 121, 481, 477, 237, 235, 467, 232, 115, 457, 227, 451, 7, 445, 221, 439, 218, 433, 215, 427, 425, 211, 419, 417, 207, 411, 409, 203, 202, 401, 399, 396, 197, 49, 389, 387, 385, 383, 95, 189, 47, 187, 93, 185, 23, 183, 91, 181, 45, 179, 89, 177, 11, 175, 87, 173, 345, 343,
  2913. 341, 339, 337, 21, 167, 83, 331, 329, 327, 163, 81, 323, 321, 319, 159, 79, 315, 313, 39, 155, 309, 307, 153, 305, 303, 151, 75, 299, 149, 37, 295, 147, 73, 291, 145, 289, 287, 143, 285, 71, 141, 281, 35, 279, 139, 69, 275, 137, 273, 17, 271, 135, 269, 267, 133, 265, 33, 263, 131, 261, 130, 259, 129, 257, 1
  2914. ];
  2915. a.shg_table = [0, 9, 10, 11, 9, 12, 10, 11, 12, 9, 13, 13, 10, 9, 13, 13, 14, 14, 14, 14, 10, 13, 14, 14, 14, 13, 13, 13, 9, 14, 14, 14, 15, 14, 15, 14, 15, 15, 14, 15, 15, 15, 14, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 12, 14, 15, 15, 13, 15, 15, 15, 15, 16, 16, 16, 15, 16, 14, 16, 16, 14, 16, 13, 16, 16, 16, 15, 16, 13, 16, 15,
  2916. 16, 14, 9, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, 14, 16, 16, 15, 16, 16, 10, 16, 15, 16, 14, 16, 16, 14, 16, 16, 14, 16, 16, 14, 15, 16, 16, 16, 14, 15, 14, 15, 13, 16, 16, 15, 17, 17, 17, 17, 17, 17, 14, 15, 17, 17, 16, 16, 17, 16, 15, 17, 16, 17, 11, 17, 16, 17, 16, 17, 16, 17, 17, 16, 17, 17, 16, 17, 17, 16, 16, 17, 17, 17, 16, 14, 17, 17, 17, 17, 15, 16, 14, 16, 15, 16, 13, 16, 15, 16, 14, 16, 15, 16, 12, 16, 15, 16, 17, 17, 17, 17, 17, 13, 16, 15, 17, 17, 17, 16, 15, 17, 17, 17, 16, 15, 17, 17, 14, 16, 17, 17, 16, 17, 17, 16, 15, 17, 16, 14, 17, 16, 15, 17, 16, 17, 17, 16, 17, 15, 16, 17, 14, 17, 16, 15, 17, 16, 17, 13, 17, 16, 17, 17, 16, 17, 14, 17, 16,
  2917. 17, 16, 17, 16, 17, 9
  2918. ];
  2919. a.getBounds = function () {
  2920. var b = 0.5 * Math.pow(this.quality, 0.6);
  2921. return new createjs.Rectangle(-this.blurX * b, -this.blurY * b, 2 * this.blurX * b, 2 * this.blurY * b)
  2922. };
  2923. a.applyFilter = function (b, a, c, d, e, h, k, m) {
  2924. h = h || b;
  2925. null == k && (k = a);
  2926. null == m && (m = c);
  2927. try {
  2928. var n = b.getImageData(a, c, d, e)
  2929. } catch (p) {
  2930. return !1
  2931. }
  2932. b = this.blurX / 2;
  2933. if (isNaN(b) || 0 > b) return !1;
  2934. b |= 0;
  2935. var r = this.blurY / 2;
  2936. if (isNaN(r) || 0 > r) return !1;
  2937. r |= 0;
  2938. if (0 == b && 0 == r) return !1;
  2939. var s = this.quality;
  2940. if (isNaN(s) || 1 > s) s = 1;
  2941. s |= 0;
  2942. 3 < s && (s = 3);
  2943. 1 > s && (s = 1);
  2944. var t = n.data,
  2945. q, w, u,
  2946. x, K, A, y, C, z, F, J, P, E = b + b + 1;
  2947. x = r + r + 1;
  2948. var S = d - 1,
  2949. N = e - 1,
  2950. Z = b + 1,
  2951. T = r + 1,
  2952. Q = {
  2953. r: 0,
  2954. b: 0,
  2955. g: 0,
  2956. a: 0,
  2957. next: null
  2958. };
  2959. a = Q;
  2960. for (q = 1; q < E; q++) a = a.next = {
  2961. r: 0,
  2962. b: 0,
  2963. g: 0,
  2964. a: 0,
  2965. next: null
  2966. };
  2967. a.next = Q;
  2968. c = E = {
  2969. r: 0,
  2970. b: 0,
  2971. g: 0,
  2972. a: 0,
  2973. next: null
  2974. };
  2975. for (q = 1; q < x; q++) c = c.next = {
  2976. r: 0,
  2977. b: 0,
  2978. g: 0,
  2979. a: 0,
  2980. next: null
  2981. };
  2982. c.next = E;
  2983. for (q = null; 0 < s--;) {
  2984. K = x = 0;
  2985. var G = this.mul_table[b],
  2986. M = this.shg_table[b];
  2987. for (c = e; - 1 < --c;) {
  2988. A = Z * (F = t[x]);
  2989. y = Z * (J = t[x + 1]);
  2990. C = Z * (P = t[x + 2]);
  2991. z = Z * (u = t[x + 3]);
  2992. a = Q;
  2993. for (q = Z; - 1 < --q;) a.r = F, a.g = J, a.b = P, a.a = u, a = a.next;
  2994. for (q = 1; q < Z; q++) w = x + ((S < q ? S : q) << 2), A += a.r = t[w], y += a.g =
  2995. t[w + 1], C += a.b = t[w + 2], z += a.a = t[w + 3], a = a.next;
  2996. q = Q;
  2997. for (a = 0; a < d; a++) t[x++] = A * G >>> M, t[x++] = y * G >>> M, t[x++] = C * G >>> M, t[x++] = z * G >>> M, w = K + ((w = a + b + 1) < S ? w : S) << 2, A -= q.r - (q.r = t[w]), y -= q.g - (q.g = t[w + 1]), C -= q.b - (q.b = t[w + 2]), z -= q.a - (q.a = t[w + 3]), q = q.next;
  2998. K += d
  2999. }
  3000. G = this.mul_table[r];
  3001. M = this.shg_table[r];
  3002. for (a = 0; a < d; a++) {
  3003. x = a << 2;
  3004. A = T * (F = t[x]);
  3005. y = T * (J = t[x + 1]);
  3006. C = T * (P = t[x + 2]);
  3007. z = T * (u = t[x + 3]);
  3008. c = E;
  3009. for (q = 0; q < T; q++) c.r = F, c.g = J, c.b = P, c.a = u, c = c.next;
  3010. u = d;
  3011. for (q = 1; q <= r; q++) x = u + a << 2, A += c.r = t[x], y += c.g = t[x + 1], C += c.b = t[x + 2], z += c.a = t[x + 3], c =
  3012. c.next, q < N && (u += d);
  3013. x = a;
  3014. q = E;
  3015. if (0 < s)
  3016. for (c = 0; c < e; c++) w = x << 2, t[w + 3] = u = z * G >>> M, 0 < u ? (t[w] = A * G >>> M, t[w + 1] = y * G >>> M, t[w + 2] = C * G >>> M) : t[w] = t[w + 1] = t[w + 2] = 0, w = a + ((w = c + T) < N ? w : N) * d << 2, A -= q.r - (q.r = t[w]), y -= q.g - (q.g = t[w + 1]), C -= q.b - (q.b = t[w + 2]), z -= q.a - (q.a = t[w + 3]), q = q.next, x += d;
  3017. else
  3018. for (c = 0; c < e; c++) w = x << 2, t[w + 3] = u = z * G >>> M, 0 < u ? (u = 255 / u, t[w] = (A * G >>> M) * u, t[w + 1] = (y * G >>> M) * u, t[w + 2] = (C * G >>> M) * u) : t[w] = t[w + 1] = t[w + 2] = 0, w = a + ((w = c + T) < N ? w : N) * d << 2, A -= q.r - (q.r = t[w]), y -= q.g - (q.g = t[w + 1]), C -= q.b - (q.b = t[w + 2]), z -= q.a - (q.a = t[w + 3]), q =
  3019. q.next, x += d
  3020. }
  3021. }
  3022. h.putImageData(n, k, m);
  3023. return !0
  3024. };
  3025. a.clone = function () {
  3026. return new c(this.blurX, this.blurY, this.quality)
  3027. };
  3028. a.toString = function () {
  3029. return "[BlurFilter]"
  3030. };
  3031. createjs.BlurFilter = c
  3032. })();
  3033. this.createjs = this.createjs || {};
  3034. (function () {
  3035. var c = function (b) {
  3036. this.initialize(b)
  3037. },
  3038. a = c.prototype = new createjs.Filter;
  3039. a.initialize = function (b) {
  3040. this.alphaMap = b
  3041. };
  3042. a.alphaMap = null;
  3043. a._alphaMap = null;
  3044. a._mapData = null;
  3045. a.applyFilter = function (b, a, c, d, e, h, k, m) {
  3046. if (!this.alphaMap) return !0;
  3047. if (!this._prepAlphaMap()) return !1;
  3048. h = h || b;
  3049. null == k && (k = a);
  3050. null == m && (m = c);
  3051. try {
  3052. var n = b.getImageData(a, c, d, e)
  3053. } catch (p) {
  3054. return !1
  3055. }
  3056. b = n.data;
  3057. a = this._mapData;
  3058. c = b.length;
  3059. for (d = 0; d < c; d += 4) b[d + 3] = a[d] || 0;
  3060. n.data = b;
  3061. h.putImageData(n, k, m);
  3062. return !0
  3063. };
  3064. a.clone = function () {
  3065. return new c(this.alphaMap)
  3066. };
  3067. a.toString = function () {
  3068. return "[AlphaMapFilter]"
  3069. };
  3070. a._prepAlphaMap = function () {
  3071. if (!this.alphaMap) return !1;
  3072. if (this.alphaMap == this._alphaMap && this._mapData) return !0;
  3073. this._mapData = null;
  3074. var b = this._alphaMap = this.alphaMap,
  3075. a = b;
  3076. b instanceof HTMLCanvasElement ? a = a.getContext("2d") : (a = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas"), a.width = b.width, a.height = b.height, a = a.getContext("2d"), a.drawImage(b, 0, 0));
  3077. try {
  3078. var c = a.getImageData(0, 0, b.width, b.height)
  3079. } catch (d) {
  3080. return !1
  3081. }
  3082. this._mapData =
  3083. c.data;
  3084. return !0
  3085. };
  3086. createjs.AlphaMapFilter = c
  3087. })();
  3088. this.createjs = this.createjs || {};
  3089. (function () {
  3090. var c = function (b) {
  3091. this.initialize(b)
  3092. },
  3093. a = c.prototype = new createjs.Filter;
  3094. a.initialize = function (b) {
  3095. this.mask = b
  3096. };
  3097. a.mask = null;
  3098. a.applyFilter = function (b, a, c, d, e, h, k, m) {
  3099. if (!this.mask) return !0;
  3100. h = h || b;
  3101. null == k && (k = a);
  3102. null == m && (m = c);
  3103. h.save();
  3104. h.globalCompositeOperation = "destination-in";
  3105. h.drawImage(this.mask, k, m);
  3106. h.restore();
  3107. return !0
  3108. };
  3109. a.clone = function () {
  3110. return new c(this.mask)
  3111. };
  3112. a.toString = function () {
  3113. return "[AlphaMaskFilter]"
  3114. };
  3115. createjs.AlphaMaskFilter = c
  3116. })();
  3117. this.createjs = this.createjs || {};
  3118. (function () {
  3119. var c = function (b, a, c, d, e, h, k, m) {
  3120. this.initialize(b, a, c, d, e, h, k, m)
  3121. },
  3122. a = c.prototype = new createjs.Filter;
  3123. a.redMultiplier = 1;
  3124. a.greenMultiplier = 1;
  3125. a.blueMultiplier = 1;
  3126. a.alphaMultiplier = 1;
  3127. a.redOffset = 0;
  3128. a.greenOffset = 0;
  3129. a.blueOffset = 0;
  3130. a.alphaOffset = 0;
  3131. a.initialize = function (b, a, c, d, e, h, k, m) {
  3132. this.redMultiplier = null != b ? b : 1;
  3133. this.greenMultiplier = null != a ? a : 1;
  3134. this.blueMultiplier = null != c ? c : 1;
  3135. this.alphaMultiplier = null != d ? d : 1;
  3136. this.redOffset = e || 0;
  3137. this.greenOffset = h || 0;
  3138. this.blueOffset = k || 0;
  3139. this.alphaOffset = m ||
  3140. 0
  3141. };
  3142. a.applyFilter = function (b, a, c, d, e, h, k, m) {
  3143. h = h || b;
  3144. null == k && (k = a);
  3145. null == m && (m = c);
  3146. try {
  3147. var n = b.getImageData(a, c, d, e)
  3148. } catch (p) {
  3149. return !1
  3150. }
  3151. b = n.data;
  3152. a = b.length;
  3153. for (c = 0; c < a; c += 4) b[c] = b[c] * this.redMultiplier + this.redOffset, b[c + 1] = b[c + 1] * this.greenMultiplier + this.greenOffset, b[c + 2] = b[c + 2] * this.blueMultiplier + this.blueOffset, b[c + 3] = b[c + 3] * this.alphaMultiplier + this.alphaOffset;
  3154. h.putImageData(n, k, m);
  3155. return !0
  3156. };
  3157. a.toString = function () {
  3158. return "[ColorFilter]"
  3159. };
  3160. a.clone = function () {
  3161. return new c(this.redMultiplier, this.greenMultiplier,
  3162. this.blueMultiplier, this.alphaMultiplier, this.redOffset, this.greenOffset, this.blueOffset, this.alphaOffset)
  3163. };
  3164. createjs.ColorFilter = c
  3165. })();
  3166. this.createjs = this.createjs || {};
  3167. (function () {
  3168. var c = function (b, a, c, d) {
  3169. this.initialize(b, a, c, d)
  3170. },
  3171. a = c.prototype = [];
  3172. c.DELTA_INDEX = [0, 0.01, 0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.1, 0.11, 0.12, 0.14, 0.15, 0.16, 0.17, 0.18, 0.2, 0.21, 0.22, 0.24, 0.25, 0.27, 0.28, 0.3, 0.32, 0.34, 0.36, 0.38, 0.4, 0.42, 0.44, 0.46, 0.48, 0.5, 0.53, 0.56, 0.59, 0.62, 0.65, 0.68, 0.71, 0.74, 0.77, 0.8, 0.83, 0.86, 0.89, 0.92, 0.95, 0.98, 1, 1.06, 1.12, 1.18, 1.24, 1.3, 1.36, 1.42, 1.48, 1.54, 1.6, 1.66, 1.72, 1.78, 1.84, 1.9, 1.96, 2, 2.12, 2.25, 2.37, 2.5, 2.62, 2.75, 2.87, 3, 3.2, 3.4, 3.6, 3.8, 4, 4.3, 4.7, 4.9, 5, 5.5, 6, 6.5, 6.8, 7, 7.3,
  3173. 7.5, 7.8, 8, 8.4, 8.7, 9, 9.4, 9.6, 9.8, 10
  3174. ];
  3175. c.IDENTITY_MATRIX = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
  3176. c.LENGTH = c.IDENTITY_MATRIX.length;
  3177. a.initialize = function (b, a, c, d) {
  3178. this.reset();
  3179. this.adjustColor(b, a, c, d);
  3180. return this
  3181. };
  3182. a.reset = function () {
  3183. return this.copyMatrix(c.IDENTITY_MATRIX)
  3184. };
  3185. a.adjustColor = function (b, a, c, d) {
  3186. this.adjustHue(d);
  3187. this.adjustContrast(a);
  3188. this.adjustBrightness(b);
  3189. return this.adjustSaturation(c)
  3190. };
  3191. a.adjustBrightness = function (b) {
  3192. if (0 == b || isNaN(b)) return this;
  3193. b = this._cleanValue(b, 255);
  3194. this._multiplyMatrix([1, 0, 0, 0, b, 0, 1, 0, 0, b, 0, 0, 1, 0, b, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
  3195. return this
  3196. };
  3197. a.adjustContrast = function (b) {
  3198. if (0 == b || isNaN(b)) return this;
  3199. b = this._cleanValue(b, 100);
  3200. var a;
  3201. 0 > b ? a = 127 + 127 * (b / 100) : (a = b % 1, a = 0 == a ? c.DELTA_INDEX[b] : c.DELTA_INDEX[b << 0] * (1 - a) + c.DELTA_INDEX[(b << 0) + 1] * a, a = 127 * a + 127);
  3202. this._multiplyMatrix([a / 127, 0, 0, 0, 0.5 * (127 - a), 0, a / 127, 0, 0, 0.5 * (127 - a), 0, 0, a / 127, 0, 0.5 * (127 - a), 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
  3203. return this
  3204. };
  3205. a.adjustSaturation = function (b) {
  3206. if (0 == b || isNaN(b)) return this;
  3207. b = this._cleanValue(b,
  3208. 100);
  3209. b = 1 + (0 < b ? 3 * b / 100 : b / 100);
  3210. this._multiplyMatrix([0.3086 * (1 - b) + b, 0.6094 * (1 - b), 0.082 * (1 - b), 0, 0, 0.3086 * (1 - b), 0.6094 * (1 - b) + b, 0.082 * (1 - b), 0, 0, 0.3086 * (1 - b), 0.6094 * (1 - b), 0.082 * (1 - b) + b, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
  3211. return this
  3212. };
  3213. a.adjustHue = function (b) {
  3214. if (0 == b || isNaN(b)) return this;
  3215. b = this._cleanValue(b, 180) / 180 * Math.PI;
  3216. var a = Math.cos(b);
  3217. b = Math.sin(b);
  3218. this._multiplyMatrix([0.213 + 0.787 * a + -0.213 * b, 0.715 + -0.715 * a + -0.715 * b, 0.072 + -0.072 * a + 0.928 * b, 0, 0, 0.213 + -0.213 * a + 0.143 * b, 0.715 + a * (1 - 0.715) + 0.14 * b, 0.072 + -0.072 * a +
  3219. -0.283 * b, 0, 0, 0.213 + -0.213 * a + -0.787 * b, 0.715 + -0.715 * a + 0.715 * b, 0.072 + 0.928 * a + 0.072 * b, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1
  3220. ]);
  3221. return this
  3222. };
  3223. a.concat = function (b) {
  3224. b = this._fixMatrix(b);
  3225. if (b.length != c.LENGTH) return this;
  3226. this._multiplyMatrix(b);
  3227. return this
  3228. };
  3229. a.clone = function () {
  3230. return new c(this)
  3231. };
  3232. a.toArray = function () {
  3233. return this.slice(0, c.LENGTH)
  3234. };
  3235. a.copyMatrix = function (b) {
  3236. for (var a = c.LENGTH, f = 0; f < a; f++) this[f] = b[f];
  3237. return this
  3238. };
  3239. a._multiplyMatrix = function (b) {
  3240. for (var a = [], c = 0; 5 > c; c++) {
  3241. for (var d = 0; 5 > d; d++) a[d] = this[d + 5 * c];
  3242. for (d =
  3243. 0; 5 > d; d++) {
  3244. for (var e = 0, h = 0; 5 > h; h++) e += b[d + 5 * h] * a[h];
  3245. this[d + 5 * c] = e
  3246. }
  3247. }
  3248. };
  3249. a._cleanValue = function (b, a) {
  3250. return Math.min(a, Math.max(-a, b))
  3251. };
  3252. a._fixMatrix = function (b) {
  3253. b instanceof c && (b = b.slice(0));
  3254. b.length < c.LENGTH ? b = b.slice(0, b.length)
  3255. .concat(c.IDENTITY_MATRIX.slice(b.length, c.LENGTH)) : b.length > c.LENGTH && (b = b.slice(0, c.LENGTH));
  3256. return b
  3257. };
  3258. createjs.ColorMatrix = c
  3259. })();
  3260. this.createjs = this.createjs || {};
  3261. (function () {
  3262. var c = function (b) {
  3263. this.initialize(b)
  3264. },
  3265. a = c.prototype = new createjs.Filter;
  3266. a.matrix = null;
  3267. a.initialize = function (b) {
  3268. this.matrix = b
  3269. };
  3270. a.applyFilter = function (b, a, c, d, e, h, k, m) {
  3271. h = h || b;
  3272. null == k && (k = a);
  3273. null == m && (m = c);
  3274. try {
  3275. var n = b.getImageData(a, c, d, e)
  3276. } catch (p) {
  3277. return !1
  3278. }
  3279. b = n.data;
  3280. a = b.length;
  3281. var r, s, t, q;
  3282. r = this.matrix;
  3283. c = r[0];
  3284. d = r[1];
  3285. e = r[2];
  3286. for (var w = r[3], u = r[4], x = r[5], K = r[6], A = r[7], y = r[8], C = r[9], z = r[10], F = r[11], J = r[12], P = r[13], E = r[14], S = r[15], N = r[16], Z = r[17], T = r[18], Q = r[19], G = 0; G < a; G += 4) r = b[G], s = b[G + 1], t =
  3287. b[G + 2], q = b[G + 3], b[G] = r * c + s * d + t * e + q * w + u, b[G + 1] = r * x + s * K + t * A + q * y + C, b[G + 2] = r * z + s * F + t * J + q * P + E, b[G + 3] = r * S + s * N + t * Z + q * T + Q;
  3288. h.putImageData(n, k, m);
  3289. return !0
  3290. };
  3291. a.toString = function () {
  3292. return "[ColorMatrixFilter]"
  3293. };
  3294. a.clone = function () {
  3295. return new c(this.matrix)
  3296. };
  3297. createjs.ColorMatrixFilter = c
  3298. })();
  3299. this.createjs = this.createjs || {};
  3300. (function () {
  3301. var c = function () {
  3302. throw "Touch cannot be instantiated";
  3303. };
  3304. c.isSupported = function () {
  3305. return "ontouchstart" in window || window.navigator.msPointerEnabled && 0 < window.navigator.msMaxTouchPoints
  3306. };
  3307. c.enable = function (a, b, g) {
  3308. if (!a || !a.canvas || !c.isSupported()) return !1;
  3309. a.__touch = {
  3310. pointers: {},
  3311. multitouch: !b,
  3312. preventDefault: !g,
  3313. count: 0
  3314. };
  3315. "ontouchstart" in window ? c._IOS_enable(a) : window.navigator.msPointerEnabled && c._IE_enable(a);
  3316. return !0
  3317. };
  3318. c.disable = function (a) {
  3319. a && ("ontouchstart" in window ? c._IOS_disable(a) : window.navigator.msPointerEnabled &&
  3320. c._IE_disable(a))
  3321. };
  3322. c._IOS_enable = function (a) {
  3323. var b = a.canvas,
  3324. g = a.__touch.f = function (b) {
  3325. c._IOS_handleEvent(a, b)
  3326. };
  3327. b.addEventListener("touchstart", g, !1);
  3328. b.addEventListener("touchmove", g, !1);
  3329. b.addEventListener("touchend", g, !1);
  3330. b.addEventListener("touchcancel", g, !1)
  3331. };
  3332. c._IOS_disable = function (a) {
  3333. var b = a.canvas;
  3334. b && (a = a.__touch.f, b.removeEventListener("touchstart", a, !1), b.removeEventListener("touchmove", a, !1), b.removeEventListener("touchend", a, !1), b.removeEventListener("touchcancel", a, !1))
  3335. };
  3336. c._IOS_handleEvent =
  3337. function (a, b) {
  3338. if (a) {
  3339. a.__touch.preventDefault && b.preventDefault && b.preventDefault();
  3340. for (var c = b.changedTouches, f = b.type, d = 0, e = c.length; d < e; d++) {
  3341. var h = c[d],
  3342. k = h.identifier;
  3343. h.target == a.canvas && ("touchstart" == f ? this._handleStart(a, k, b, h.pageX, h.pageY) : "touchmove" == f ? this._handleMove(a, k, b, h.pageX, h.pageY) : "touchend" != f && "touchcancel" != f || this._handleEnd(a, k, b))
  3344. }
  3345. }
  3346. };
  3347. c._IE_enable = function (a) {
  3348. var b = a.canvas,
  3349. g = a.__touch.f = function (b) {
  3350. c._IE_handleEvent(a, b)
  3351. };
  3352. b.addEventListener("MSPointerDown", g, !1);
  3353. window.addEventListener("MSPointerMove",
  3354. g, !1);
  3355. window.addEventListener("MSPointerUp", g, !1);
  3356. window.addEventListener("MSPointerCancel", g, !1);
  3357. a.__touch.preventDefault && (b.style.msTouchAction = "none");
  3358. a.__touch.activeIDs = {}
  3359. };
  3360. c._IE_disable = function (a) {
  3361. var b = a.__touch.f;
  3362. window.removeEventListener("MSPointerMove", b, !1);
  3363. window.removeEventListener("MSPointerUp", b, !1);
  3364. window.removeEventListener("MSPointerCancel", b, !1);
  3365. a.canvas && a.canvas.removeEventListener("MSPointerDown", b, !1)
  3366. };
  3367. c._IE_handleEvent = function (a, b) {
  3368. if (a) {
  3369. a.__touch.preventDefault && b.preventDefault &&
  3370. b.preventDefault();
  3371. var c = b.type,
  3372. f = b.pointerId,
  3373. d = a.__touch.activeIDs;
  3374. if ("MSPointerDown" == c) b.srcElement == a.canvas && (d[f] = !0, this._handleStart(a, f, b, b.pageX, b.pageY));
  3375. else if (d[f])
  3376. if ("MSPointerMove" == c) this._handleMove(a, f, b, b.pageX, b.pageY);
  3377. else if ("MSPointerUp" == c || "MSPointerCancel" == c) delete d[f], this._handleEnd(a, f, b)
  3378. }
  3379. };
  3380. c._handleStart = function (a, b, c, f, d) {
  3381. var e = a.__touch;
  3382. if (e.multitouch || !e.count) {
  3383. var h = e.pointers;
  3384. h[b] || (h[b] = !0, e.count++, a._handlePointerDown(b, c, f, d))
  3385. }
  3386. };
  3387. c._handleMove = function (a,
  3388. b, c, f, d) {
  3389. a.__touch.pointers[b] && a._handlePointerMove(b, c, f, d)
  3390. };
  3391. c._handleEnd = function (a, b, c) {
  3392. var f = a.__touch,
  3393. d = f.pointers;
  3394. d[b] && (f.count--, a._handlePointerUp(b, c, !0), delete d[b])
  3395. };
  3396. createjs.Touch = c
  3397. })();
  3398. this.createjs = this.createjs || {};
  3399. (function () {
  3400. var c = createjs.EaselJS = createjs.EaselJS || {};
  3401. c.version = "NEXT";
  3402. c.buildDate = "Sun, 06 Oct 2013 10:56:52 GMT"
  3403. })();
  3404. (function () {
  3405. var c = createjs.Stage.prototype._handlePointerDown,
  3406. a = createjs.Stage.prototype._handlePointerUp,
  3407. b = !1; - 1 < navigator.userAgent.indexOf("Android") && (createjs.Stage.prototype._handlePointerDown = function (a, f, d, e) {
  3408. f.touches && (b = !0, this.enableDOMEvents(!1));
  3409. b ? f.touches && "undefined" != typeof f.touches[0].pageX && (f.screenX = f.touches[0].pageX, f.screenY = f.touches[0].pageY, c.call(this, a, f, d, e)) : (f.screenX = f.x, f.screenY = f.y, c.call(this, a, f, d, e))
  3410. }, createjs.Stage.prototype._handlePointerUp = function (c, f,
  3411. d) {
  3412. f.changedTouches && (b = !0);
  3413. b ? f.changedTouches && "undefined" != typeof f.changedTouches[0].pageX && (f.screenX = f.changedTouches[0].pageX, f.screenY = f.changedTouches[0].pageY, a.call(this, c, f, d)) : (f.screenX = f.x, f.screenY = f.y, a.call(this, c, f, d))
  3414. })
  3415. })();
  3416. this.createjs = this.createjs || {};
  3417. (function () {
  3418. var c = createjs.PreloadJS = createjs.PreloadJS || {};
  3419. c.version = "0.4.0";
  3420. c.buildDate = "Wed, 25 Sep 2013 17:09:35 GMT"
  3421. })();
  3422. this.createjs = this.createjs || {};
  3423. (function () {
  3424. var c = function (b, a, c) {
  3425. this.initialize(b, a, c)
  3426. },
  3427. a = c.prototype;
  3428. a.type = null;
  3429. a.target = null;
  3430. a.currentTarget = null;
  3431. a.eventPhase = 0;
  3432. a.bubbles = !1;
  3433. a.cancelable = !1;
  3434. a.timeStamp = 0;
  3435. a.defaultPrevented = !1;
  3436. a.propagationStopped = !1;
  3437. a.immediatePropagationStopped = !1;
  3438. a.removed = !1;
  3439. a.initialize = function (b, a, c) {
  3440. this.type = b;
  3441. this.bubbles = a;
  3442. this.cancelable = c;
  3443. this.timeStamp = (new Date)
  3444. .getTime()
  3445. };
  3446. a.preventDefault = function () {
  3447. this.defaultPrevented = !0
  3448. };
  3449. a.stopPropagation = function () {
  3450. this.propagationStopped = !0
  3451. };
  3452. a.stopImmediatePropagation =
  3453. function () {
  3454. this.immediatePropagationStopped = this.propagationStopped = !0
  3455. };
  3456. a.remove = function () {
  3457. this.removed = !0
  3458. };
  3459. a.clone = function () {
  3460. return new c(this.type, this.bubbles, this.cancelable)
  3461. };
  3462. a.toString = function () {
  3463. return "[Event (type=" + this.type + ")]"
  3464. };
  3465. createjs.Event = c
  3466. })();
  3467. this.createjs = this.createjs || {};
  3468. (function () {
  3469. var c = function () {},
  3470. a = c.prototype;
  3471. c.initialize = function (b) {
  3472. b.addEventListener = a.addEventListener;
  3473. b.on = a.on;
  3474. b.removeEventListener = b.off = a.removeEventListener;
  3475. b.removeAllEventListeners = a.removeAllEventListeners;
  3476. b.hasEventListener = a.hasEventListener;
  3477. b.dispatchEvent = a.dispatchEvent;
  3478. b._dispatchEvent = a._dispatchEvent
  3479. };
  3480. a._listeners = null;
  3481. a._captureListeners = null;
  3482. a.initialize = function () {};
  3483. a.addEventListener = function (b, a, c) {
  3484. var d;
  3485. d = c ? this._captureListeners = this._captureListeners || {} : this._listeners =
  3486. this._listeners || {};
  3487. var e = d[b];
  3488. return e && this.removeEventListener(b, a, c), e = d[b], e ? e.push(a) : d[b] = [a], a
  3489. };
  3490. a.on = function (b, a, c, d, e, h) {
  3491. return a.handleEvent && (c = c || a, a = a.handleEvent), c = c || this, this.addEventListener(b, function (b) {
  3492. a.call(c, b, e);
  3493. d && b.remove()
  3494. }, h)
  3495. };
  3496. a.removeEventListener = function (b, a, c) {
  3497. if (c = c ? this._captureListeners : this._listeners) {
  3498. var d = c[b];
  3499. if (d)
  3500. for (var e = 0, h = d.length; h > e; e++)
  3501. if (d[e] == a) {
  3502. 1 == h ? delete c[b] : d.splice(e, 1);
  3503. break
  3504. }
  3505. }
  3506. };
  3507. a.off = a.removeEventListener;
  3508. a.removeAllEventListeners = function (b) {
  3509. b ?
  3510. (this._listeners && delete this._listeners[b], this._captureListeners && delete this._captureListeners[b]) : this._listeners = this._captureListeners = null
  3511. };
  3512. a.dispatchEvent = function (b, a) {
  3513. if ("string" == typeof b) {
  3514. var c = this._listeners;
  3515. if (!c || !c[b]) return !1;
  3516. b = new createjs.Event(b)
  3517. }
  3518. if (b.target = a || this, b.bubbles && this.parent) {
  3519. for (var d = this, c = [d]; d.parent;) c.push(d = d.parent);
  3520. for (var e = c.length, d = e - 1; 0 <= d && !b.propagationStopped; d--) c[d]._dispatchEvent(b, 1 + (0 == d));
  3521. for (d = 1; e > d && !b.propagationStopped; d++) c[d]._dispatchEvent(b,
  3522. 3)
  3523. } else this._dispatchEvent(b, 2);
  3524. return b.defaultPrevented
  3525. };
  3526. a.hasEventListener = function (b) {
  3527. var a = this._listeners,
  3528. c = this._captureListeners;
  3529. return !!(a && a[b] || c && c[b])
  3530. };
  3531. a.toString = function () {
  3532. return "[EventDispatcher]"
  3533. };
  3534. a._dispatchEvent = function (b, a) {
  3535. var c, d = 1 == a ? this._captureListeners : this._listeners;
  3536. if (b && d && (d = d[b.type]) && (c = d.length)) {
  3537. b.currentTarget = this;
  3538. b.eventPhase = a;
  3539. b.removed = !1;
  3540. for (var d = d.slice(), e = 0; c > e && !b.immediatePropagationStopped; e++) {
  3541. var h = d[e];
  3542. h.handleEvent ? h.handleEvent(b) : h(b);
  3543. b.removed &&
  3544. (this.off(b.type, h, 1 == a), b.removed = !1)
  3545. }
  3546. }
  3547. };
  3548. createjs.EventDispatcher = c
  3549. })();
  3550. this.createjs = this.createjs || {};
  3551. (function () {
  3552. createjs.indexOf = function (c, a) {
  3553. for (var b = 0, g = c.length; g > b; b++)
  3554. if (a === c[b]) return b;
  3555. return -1
  3556. }
  3557. })();
  3558. this.createjs = this.createjs || {};
  3559. (function () {
  3560. createjs.proxy = function (c, a) {
  3561. var b = Array.prototype.slice.call(arguments, 2);
  3562. return function () {
  3563. return c.apply(a, Array.prototype.slice.call(arguments, 0)
  3564. .concat(b))
  3565. }
  3566. }
  3567. })();
  3568. this.createjs = this.createjs || {};
  3569. (function () {
  3570. var c = function () {
  3571. this.init()
  3572. };
  3573. c.prototype = {};
  3574. var a = c.prototype;
  3575. c.FILE_PATTERN = /^(?:(\w+:)\/{2}(\w+(?:\.\w+)*\/?))?([/.]*?(?:[^?]+)?\/)?((?:[^/?]+)\.(\w+))(?:\?(\S+)?)?$/;
  3576. a.loaded = !1;
  3577. a.canceled = !1;
  3578. a.progress = 0;
  3579. a._item = null;
  3580. a._basePath = null;
  3581. a.addEventListener = null;
  3582. a.removeEventListener = null;
  3583. a.removeAllEventListeners = null;
  3584. a.dispatchEvent = null;
  3585. a.hasEventListener = null;
  3586. a._listeners = null;
  3587. createjs.EventDispatcher.initialize(a);
  3588. a.getItem = function () {
  3589. return this._item
  3590. };
  3591. a.init = function () {};
  3592. a.load =
  3593. function () {};
  3594. a.close = function () {};
  3595. a._sendLoadStart = function () {
  3596. this._isCanceled() || this.dispatchEvent("loadstart")
  3597. };
  3598. a._sendProgress = function (b) {
  3599. if (!this._isCanceled()) {
  3600. var a = null;
  3601. "number" == typeof b ? (this.progress = b, a = new createjs.Event("progress"), a.loaded = this.progress, a.total = 1) : (a = b, this.progress = b.loaded / b.total, (isNaN(this.progress) || 1 / 0 == this.progress) && (this.progress = 0));
  3602. a.progress = this.progress;
  3603. this.hasEventListener("progress") && this.dispatchEvent(a)
  3604. }
  3605. };
  3606. a._sendComplete = function () {
  3607. this._isCanceled() ||
  3608. this.dispatchEvent("complete")
  3609. };
  3610. a._sendError = function (b) {
  3611. !this._isCanceled() && this.hasEventListener("error") && (null == b && (b = new createjs.Event("error")), this.dispatchEvent(b))
  3612. };
  3613. a._isCanceled = function () {
  3614. return null == window.createjs || this.canceled ? !0 : !1
  3615. };
  3616. a._parseURI = function (b) {
  3617. return b ? b.match(c.FILE_PATTERN) : null
  3618. };
  3619. a._formatQueryString = function (b, a) {
  3620. if (null == b) throw Error("You must specify data.");
  3621. var c = [],
  3622. d;
  3623. for (d in b) c.push(d + "=" + escape(b[d]));
  3624. return a && (c = c.concat(a)), c.join("&")
  3625. };
  3626. a.buildPath = function (b,
  3627. a, c) {
  3628. if (null != a) {
  3629. var d = this._parseURI(b);
  3630. null != d && null != d[1] && "" != d[1] || (b = a + b)
  3631. }
  3632. if (null == c) return b;
  3633. a = [];
  3634. d = b.indexOf("?");
  3635. if (-1 != d) {
  3636. var e = b.slice(d + 1);
  3637. a = a.concat(e.split("&"))
  3638. }
  3639. return -1 != d ? b.slice(0, d) + "?" + this._formatQueryString(c, a) : b + "?" + this._formatQueryString(c, a)
  3640. };
  3641. a.toString = function () {
  3642. return "[PreloadJS AbstractLoader]"
  3643. };
  3644. createjs.AbstractLoader = c
  3645. })();
  3646. this.createjs = this.createjs || {};
  3647. (function () {
  3648. var c = function (b, a) {
  3649. this.init(b, a)
  3650. },
  3651. a = c.prototype = new createjs.AbstractLoader;
  3652. c.LOAD_TIMEOUT = 8E3;
  3653. c.BINARY = "binary";
  3654. c.CSS = "css";
  3655. c.IMAGE = "image";
  3656. c.JAVASCRIPT = "javascript";
  3657. c.JSON = "json";
  3658. c.JSONP = "jsonp";
  3659. c.SOUND = "sound";
  3660. c.SVG = "svg";
  3661. c.TEXT = "text";
  3662. c.XML = "xml";
  3663. c.POST = "POST";
  3664. c.GET = "GET";
  3665. a.useXHR = !0;
  3666. a.stopOnError = !1;
  3667. a.maintainScriptOrder = !0;
  3668. a.next = null;
  3669. a._typeCallbacks = null;
  3670. a._extensionCallbacks = null;
  3671. a._loadStartWasDispatched = !1;
  3672. a._maxConnections = 1;
  3673. a._currentlyLoadingScript = null;
  3674. a._currentLoads =
  3675. null;
  3676. a._loadQueue = null;
  3677. a._loadQueueBackup = null;
  3678. a._loadItemsById = null;
  3679. a._loadItemsBySrc = null;
  3680. a._loadedResults = null;
  3681. a._loadedRawResults = null;
  3682. a._numItems = 0;
  3683. a._numItemsLoaded = 0;
  3684. a._scriptOrder = null;
  3685. a._loadedScripts = null;
  3686. a.init = function (b, a) {
  3687. this._numItems = this._numItemsLoaded = 0;
  3688. this._loadStartWasDispatched = this._paused = !1;
  3689. this._currentLoads = [];
  3690. this._loadQueue = [];
  3691. this._loadQueueBackup = [];
  3692. this._scriptOrder = [];
  3693. this._loadedScripts = [];
  3694. this._loadItemsById = {};
  3695. this._loadItemsBySrc = {};
  3696. this._loadedResults = {};
  3697. this._loadedRawResults = {};
  3698. this._typeCallbacks = {};
  3699. this._extensionCallbacks = {};
  3700. this._basePath = a;
  3701. this.setUseXHR(b)
  3702. };
  3703. a.setUseXHR = function (b) {
  3704. return this.useXHR = 0 != b && null != window.XMLHttpRequest, this.useXHR
  3705. };
  3706. a.removeAll = function () {
  3707. this.remove()
  3708. };
  3709. a.remove = function (b) {
  3710. var a = null;
  3711. if (!b || b instanceof Array)
  3712. if (b) a = b;
  3713. else {
  3714. if (0 < arguments.length) return
  3715. } else a = [b];
  3716. var c = !1;
  3717. if (a) {
  3718. for (; a.length;) {
  3719. for (var e = a.pop(), h = this.getResult(e), k = this._loadQueue.length - 1; 0 <= k; k--)
  3720. if (m = this._loadQueue[k].getItem(), m.id == e || m.src == e) {
  3721. this._loadQueue.splice(k,
  3722. 1)[0].cancel();
  3723. break
  3724. }
  3725. for (k = this._loadQueueBackup.length - 1; 0 <= k; k--)
  3726. if (m = this._loadQueueBackup[k].getItem(), m.id == e || m.src == e) {
  3727. this._loadQueueBackup.splice(k, 1)[0].cancel();
  3728. break
  3729. }
  3730. if (h) delete this._loadItemsById[h.id], delete this._loadItemsBySrc[h.src], this._disposeItem(h);
  3731. else
  3732. for (var k = this._currentLoads.length - 1; 0 <= k; k--) {
  3733. var m = this._currentLoads[k].getItem();
  3734. if (m.id == e || m.src == e) {
  3735. this._currentLoads.splice(k, 1)[0].cancel();
  3736. c = !0;
  3737. break
  3738. }
  3739. }
  3740. }
  3741. c && this._loadNext()
  3742. } else {
  3743. this.close();
  3744. for (e in this._loadItemsById) this._disposeItem(this._loadItemsById[e]);
  3745. this.init(this.useXHR)
  3746. }
  3747. };
  3748. a.reset = function () {
  3749. this.close();
  3750. for (var b in this._loadItemsById) this._disposeItem(this._loadItemsById[b]);
  3751. b = [];
  3752. i = 0;
  3753. for (l = this._loadQueueBackup.length; l > i; i++) b.push(this._loadQueueBackup[i].getItem());
  3754. this.loadManifest(b, !1)
  3755. };
  3756. c.isBinary = function (b) {
  3757. switch (b) {
  3758. case createjs.LoadQueue.IMAGE:
  3759. case createjs.LoadQueue.BINARY:
  3760. return !0;
  3761. default:
  3762. return !1
  3763. }
  3764. };
  3765. a.installPlugin = function (b) {
  3766. if (null != b && null != b.getPreloadHandlers) {
  3767. b = b.getPreloadHandlers();
  3768. if (null != b.types)
  3769. for (var a = 0, c = b.types.length; c >
  3770. a; a++) this._typeCallbacks[b.types[a]] = b.callback;
  3771. if (null != b.extensions)
  3772. for (a = 0, c = b.extensions.length; c > a; a++) this._extensionCallbacks[b.extensions[a]] = b.callback
  3773. }
  3774. };
  3775. a.setMaxConnections = function (b) {
  3776. this._maxConnections = b;
  3777. !this._paused && 0 < this._loadQueue.length && this._loadNext()
  3778. };
  3779. a.loadFile = function (b, a, c) {
  3780. if (null == b) return b = new createjs.Event("error"), b.text = "PRELOAD_NO_FILE", this._sendError(b), void 0;
  3781. this._addItem(b, c);
  3782. !1 !== a ? this.setPaused(!1) : this.setPaused(!0)
  3783. };
  3784. a.loadManifest = function (b, a, c) {
  3785. var e =
  3786. null;
  3787. if (b instanceof Array) {
  3788. if (0 == b.length) return a = new createjs.Event("error"), a.text = "PRELOAD_MANIFEST_EMPTY", this._sendError(a), void 0;
  3789. e = b
  3790. } else {
  3791. if (null == b) return a = new createjs.Event("error"), a.text = "PRELOAD_MANIFEST_NULL", this._sendError(a), void 0;
  3792. e = [b]
  3793. }
  3794. b = 0;
  3795. for (var h = e.length; h > b; b++) this._addItem(e[b], c);
  3796. !1 !== a ? this.setPaused(!1) : this.setPaused(!0)
  3797. };
  3798. a.load = function () {
  3799. this.setPaused(!1)
  3800. };
  3801. a.getItem = function (b) {
  3802. return this._loadItemsById[b] || this._loadItemsBySrc[b]
  3803. };
  3804. a.getResult = function (b, a) {
  3805. var c =
  3806. this._loadItemsById[b] || this._loadItemsBySrc[b];
  3807. if (null == c) return null;
  3808. c = c.id;
  3809. return a && this._loadedRawResults[c] ? this._loadedRawResults[c] : this._loadedResults[c]
  3810. };
  3811. a.setPaused = function (b) {
  3812. (this._paused = b) || this._loadNext()
  3813. };
  3814. a.close = function () {
  3815. for (; this._currentLoads.length;) this._currentLoads.pop()
  3816. .cancel();
  3817. this._scriptOrder.length = 0;
  3818. this._loadedScripts.length = 0;
  3819. this.loadStartWasDispatched = !1
  3820. };
  3821. a._addItem = function (b, a) {
  3822. var c = this._createLoadItem(b);
  3823. if (null != c) {
  3824. var e = this._createLoader(c, a);
  3825. null != e &&
  3826. (this._loadQueue.push(e), this._loadQueueBackup.push(e), this._numItems++, this._updateProgress(), this.maintainScriptOrder && c.type == createjs.LoadQueue.JAVASCRIPT && e instanceof createjs.XHRLoader && (this._scriptOrder.push(c), this._loadedScripts.push(null)))
  3827. }
  3828. };
  3829. a._createLoadItem = function (b) {
  3830. var a = null;
  3831. switch (typeof b) {
  3832. case "string":
  3833. a = {
  3834. src: b
  3835. };
  3836. break;
  3837. case "object":
  3838. a = window.HTMLAudioElement && b instanceof HTMLAudioElement ? {
  3839. tag: b,
  3840. src: a.tag.src,
  3841. type: createjs.LoadQueue.SOUND
  3842. } : b;
  3843. break;
  3844. default:
  3845. return null
  3846. }
  3847. b = this._parseURI(a.src);
  3848. if (null != b && (a.ext = b[5]), null == a.type && (a.type = this._getTypeByExtension(a.ext)), a.type == createjs.LoadQueue.JSON && null != a.callback && (a.type = createjs.LoadQueue.JSONP), a.type == createjs.LoadQueue.JSONP && null == a.callback) throw Error("callback is required for loading JSONP requests.");
  3849. null == a.tag && (a.tag = this._createTag(a.type));
  3850. null != a.id && "" != a.id || (a.id = a.src);
  3851. if (b = this._typeCallbacks[a.type] || this._extensionCallbacks[a.ext]) {
  3852. b = b(a.src, a.type, a.id, a.data);
  3853. if (!1 === b) return null;
  3854. !0 === b || (null != b.src &&
  3855. (a.src = b.src), null != b.id && (a.id = b.id), null != b.tag && b.tag.load instanceof Function && (a.tag = b.tag), null != b.completeHandler && (a.completeHandler = b.completeHandler));
  3856. b.type && (a.type = b.type);
  3857. b = this._parseURI(a.src);
  3858. null != b && null != b[5] && (a.ext = b[5].toLowerCase())
  3859. }
  3860. return this._loadItemsById[a.id] = a, this._loadItemsBySrc[a.src] = a, a
  3861. };
  3862. a._createLoader = function (b, a) {
  3863. var c = this.useXHR;
  3864. switch (b.type) {
  3865. case createjs.LoadQueue.JSON:
  3866. case createjs.LoadQueue.XML:
  3867. case createjs.LoadQueue.TEXT:
  3868. c = !0;
  3869. break;
  3870. case createjs.LoadQueue.SOUND:
  3871. case createjs.LoadQueue.JSONP:
  3872. c = !1;
  3873. break;
  3874. case null:
  3875. return null
  3876. }
  3877. return null == a && (a = this._basePath), c ? new createjs.XHRLoader(b, a) : new createjs.TagLoader(b, a)
  3878. };
  3879. a._loadNext = function () {
  3880. if (!this._paused) {
  3881. this._loadStartWasDispatched || (this._sendLoadStart(), this._loadStartWasDispatched = !0);
  3882. this._numItems == this._numItemsLoaded ? (this.loaded = !0, this._sendComplete(), this.next && this.next.load && this.next.load()) : this.loaded = !1;
  3883. for (var b = 0; b < this._loadQueue.length && !(this._currentLoads.length >= this._maxConnections); b++) {
  3884. var a = this._loadQueue[b];
  3885. if (this.maintainScriptOrder && a instanceof createjs.TagLoader && a.getItem()
  3886. .type == createjs.LoadQueue.JAVASCRIPT) {
  3887. if (this._currentlyLoadingScript) continue;
  3888. this._currentlyLoadingScript = !0
  3889. }
  3890. this._loadQueue.splice(b, 1);
  3891. b--;
  3892. this._loadItem(a)
  3893. }
  3894. }
  3895. };
  3896. a._loadItem = function (b) {
  3897. b.addEventListener("progress", createjs.proxy(this._handleProgress, this));
  3898. b.addEventListener("complete", createjs.proxy(this._handleFileComplete, this));
  3899. b.addEventListener("error", createjs.proxy(this._handleFileError, this));
  3900. this._currentLoads.push(b);
  3901. this._sendFileStart(b.getItem());
  3902. b.load()
  3903. };
  3904. a._handleFileError = function (b) {
  3905. var a = b.target;
  3906. this._numItemsLoaded++;
  3907. this._updateProgress();
  3908. b = new createjs.Event("error");
  3909. b.text = "FILE_LOAD_ERROR";
  3910. b.item = a.getItem();
  3911. this._sendError(b);
  3912. this.stopOnError || (this._removeLoadItem(a), this._loadNext())
  3913. };
  3914. a._handleFileComplete = function (b) {
  3915. b = b.target;
  3916. var a = b.getItem();
  3917. if (this._loadedResults[a.id] = b.getResult(), b instanceof createjs.XHRLoader && (this._loadedRawResults[a.id] = b.getResult(!0)), this._removeLoadItem(b), this.maintainScriptOrder &&
  3918. a.type == createjs.LoadQueue.JAVASCRIPT) {
  3919. if (!(b instanceof createjs.TagLoader)) return this._loadedScripts[createjs.indexOf(this._scriptOrder, a)] = a, this._checkScriptLoadOrder(b), void 0;
  3920. this._currentlyLoadingScript = !1
  3921. }
  3922. this._processFinishedLoad(a, b)
  3923. };
  3924. a._processFinishedLoad = function (b, a) {
  3925. this._numItemsLoaded++;
  3926. this._updateProgress();
  3927. this._sendFileComplete(b, a);
  3928. this._loadNext()
  3929. };
  3930. a._checkScriptLoadOrder = function () {
  3931. for (var b = this._loadedScripts.length, a = 0; b > a; a++) {
  3932. var c = this._loadedScripts[a];
  3933. if (null === c) break;
  3934. !0 !== c && (this._processFinishedLoad(c), this._loadedScripts[a] = !0, a--, b--)
  3935. }
  3936. };
  3937. a._removeLoadItem = function (b) {
  3938. for (var a = this._currentLoads.length, c = 0; a > c; c++)
  3939. if (this._currentLoads[c] == b) {
  3940. this._currentLoads.splice(c, 1);
  3941. break
  3942. }
  3943. };
  3944. a._handleProgress = function (b) {
  3945. b = b.target;
  3946. this._sendFileProgress(b.getItem(), b.progress);
  3947. this._updateProgress()
  3948. };
  3949. a._updateProgress = function () {
  3950. var b = this._numItemsLoaded / this._numItems,
  3951. a = this._numItems - this._numItemsLoaded;
  3952. if (0 < a) {
  3953. for (var c = 0, e = 0, h = this._currentLoads.length; h > e; e++) c +=
  3954. this._currentLoads[e].progress;
  3955. b += c / a * (a / this._numItems)
  3956. }
  3957. this._sendProgress(b)
  3958. };
  3959. a._disposeItem = function (b) {
  3960. delete this._loadedResults[b.id];
  3961. delete this._loadedRawResults[b.id];
  3962. delete this._loadItemsById[b.id];
  3963. delete this._loadItemsBySrc[b.src]
  3964. };
  3965. a._createTag = function (b) {
  3966. var a = null;
  3967. switch (b) {
  3968. case createjs.LoadQueue.IMAGE:
  3969. return document.createElement("img");
  3970. case createjs.LoadQueue.SOUND:
  3971. return a = document.createElement("audio"), a.autoplay = !1, a;
  3972. case createjs.LoadQueue.JSONP:
  3973. case createjs.LoadQueue.JAVASCRIPT:
  3974. return a =
  3975. document.createElement("script"), a.type = "text/javascript", a;
  3976. case createjs.LoadQueue.CSS:
  3977. return a = this.useXHR ? document.createElement("style") : document.createElement("link"), a.rel = "stylesheet", a.type = "text/css", a;
  3978. case createjs.LoadQueue.SVG:
  3979. return this.useXHR ? a = document.createElement("svg") : (a = document.createElement("object"), a.type = "image/svg+xml"), a
  3980. }
  3981. return null
  3982. };
  3983. a._getTypeByExtension = function (b) {
  3984. if (null == b) return createjs.LoadQueue.TEXT;
  3985. switch (b.toLowerCase()) {
  3986. case "jpeg":
  3987. case "jpg":
  3988. case "gif":
  3989. case "png":
  3990. case "webp":
  3991. case "bmp":
  3992. return createjs.LoadQueue.IMAGE;
  3993. case "ogg":
  3994. case "mp3":
  3995. case "wav":
  3996. return createjs.LoadQueue.SOUND;
  3997. case "json":
  3998. return createjs.LoadQueue.JSON;
  3999. case "xml":
  4000. return createjs.LoadQueue.XML;
  4001. case "css":
  4002. return createjs.LoadQueue.CSS;
  4003. case "js":
  4004. return createjs.LoadQueue.JAVASCRIPT;
  4005. case "svg":
  4006. return createjs.LoadQueue.SVG;
  4007. default:
  4008. return createjs.LoadQueue.TEXT
  4009. }
  4010. };
  4011. a._sendFileProgress = function (b, a) {
  4012. if (this._isCanceled()) return this._cleanUp(), void 0;
  4013. if (this.hasEventListener("fileprogress")) {
  4014. var c = new createjs.Event("fileprogress");
  4015. c.progress = a;
  4016. c.loaded = a;
  4017. c.total = 1;
  4018. c.item = b;
  4019. this.dispatchEvent(c)
  4020. }
  4021. };
  4022. a._sendFileComplete = function (b, a) {
  4023. if (!this._isCanceled()) {
  4024. var c = new createjs.Event("fileload");
  4025. c.loader = a;
  4026. c.item = b;
  4027. c.result = this._loadedResults[b.id];
  4028. c.rawResult = this._loadedRawResults[b.id];
  4029. b.completeHandler && b.completeHandler(c);
  4030. this.hasEventListener("fileload") && this.dispatchEvent(c)
  4031. }
  4032. };
  4033. a._sendFileStart = function (b) {
  4034. var a = new createjs.Event("filestart");
  4035. a.item = b;
  4036. this.hasEventListener("filestart") && this.dispatchEvent(a)
  4037. };
  4038. a.toString = function () {
  4039. return "[PreloadJS LoadQueue]"
  4040. };
  4041. createjs.LoadQueue = c;
  4042. var b = function () {};
  4043. b.init = function () {
  4044. var a = navigator.userAgent;
  4045. b.isFirefox = -1 < a.indexOf("Firefox");
  4046. b.isOpera = null != window.opera;
  4047. b.isChrome = -1 < a.indexOf("Chrome");
  4048. b.isIOS = -1 < a.indexOf("iPod") || -1 < a.indexOf("iPhone") || -1 < a.indexOf("iPad")
  4049. };
  4050. b.init();
  4051. createjs.LoadQueue.BrowserDetect = b
  4052. })();
  4053. this.createjs = this.createjs || {};
  4054. (function () {
  4055. var c = function (b, a) {
  4056. this.init(b, a)
  4057. },
  4058. a = c.prototype = new createjs.AbstractLoader;
  4059. a._loadTimeout = null;
  4060. a._tagCompleteProxy = null;
  4061. a._isAudio = !1;
  4062. a._tag = null;
  4063. a._jsonResult = null;
  4064. a.init = function (b, a) {
  4065. this._item = b;
  4066. this._basePath = a;
  4067. this._tag = b.tag;
  4068. this._isAudio = window.HTMLAudioElement && b.tag instanceof HTMLAudioElement;
  4069. this._tagCompleteProxy = createjs.proxy(this._handleLoad, this)
  4070. };
  4071. a.getResult = function () {
  4072. return this._item.type == createjs.LoadQueue.JSONP ? this._jsonResult : this._tag
  4073. };
  4074. a.cancel = function () {
  4075. this.canceled = !0;
  4076. this._clean();
  4077. this.getItem()
  4078. };
  4079. a.load = function () {
  4080. var b = this._item,
  4081. a = this._tag;
  4082. clearTimeout(this._loadTimeout);
  4083. this._loadTimeout = setTimeout(createjs.proxy(this._handleTimeout, this), createjs.LoadQueue.LOAD_TIMEOUT);
  4084. this._isAudio && (a.src = null, a.preload = "auto");
  4085. a.onerror = createjs.proxy(this._handleError, this);
  4086. this._isAudio ? (a.onstalled = createjs.proxy(this._handleStalled, this), a.addEventListener("canplaythrough", this._tagCompleteProxy, !1)) : (a.onload = createjs.proxy(this._handleLoad, this), a.onreadystatechange =
  4087. createjs.proxy(this._handleReadyStateChange, this));
  4088. var c = this.buildPath(b.src, this._basePath, b.values);
  4089. switch (b.type) {
  4090. case createjs.LoadQueue.CSS:
  4091. a.href = c;
  4092. break;
  4093. case createjs.LoadQueue.SVG:
  4094. a.data = c;
  4095. break;
  4096. default:
  4097. a.src = c
  4098. }
  4099. if (b.type == createjs.LoadQueue.JSONP) {
  4100. if (null == b.callback) throw Error("callback is required for loading JSONP requests.");
  4101. if (null != window[b.callback]) throw Error('JSONP callback "' + b.callback + '" already exists on window. You need to specify a different callback. Or re-name the current one.');
  4102. window[b.callback] = createjs.proxy(this._handleJSONPLoad, this)
  4103. }
  4104. b.type != createjs.LoadQueue.SVG && b.type != createjs.LoadQueue.JSONP && b.type != createjs.LoadQueue.JSON && b.type != createjs.LoadQueue.JAVASCRIPT && b.type != createjs.LoadQueue.CSS || (this._startTagVisibility = a.style.visibility, a.style.visibility = "hidden", (document.body || document.getElementsByTagName("body")[0])
  4105. .appendChild(a));
  4106. null != a.load && a.load()
  4107. };
  4108. a._handleJSONPLoad = function (b) {
  4109. this._jsonResult = b
  4110. };
  4111. a._handleTimeout = function () {
  4112. this._clean();
  4113. var b =
  4114. new createjs.Event("error");
  4115. b.text = "PRELOAD_TIMEOUT";
  4116. this._sendError(b)
  4117. };
  4118. a._handleStalled = function () {};
  4119. a._handleError = function () {
  4120. this._clean();
  4121. var b = new createjs.Event("error");
  4122. this._sendError(b)
  4123. };
  4124. a._handleReadyStateChange = function () {
  4125. clearTimeout(this._loadTimeout);
  4126. var b = this.getItem()
  4127. .tag;
  4128. "loaded" != b.readyState && "complete" != b.readyState || this._handleLoad()
  4129. };
  4130. a._handleLoad = function () {
  4131. if (!this._isCanceled()) {
  4132. var b = this.getItem(),
  4133. a = b.tag;
  4134. if (!(this.loaded || this.isAudio && 4 !== a.readyState)) {
  4135. switch (this.loaded = !0, b.type) {
  4136. case createjs.LoadQueue.SVG:
  4137. case createjs.LoadQueue.JSONP:
  4138. a.style.visibility = this._startTagVisibility, (document.body || document.getElementsByTagName("body")[0])
  4139. .removeChild(a)
  4140. }
  4141. this._clean();
  4142. this._sendComplete()
  4143. }
  4144. }
  4145. };
  4146. a._clean = function () {
  4147. clearTimeout(this._loadTimeout);
  4148. var b = this.getItem()
  4149. .tag;
  4150. b.onload = null;
  4151. b.removeEventListener && b.removeEventListener("canplaythrough", this._tagCompleteProxy, !1);
  4152. b.onstalled = null;
  4153. b.onprogress = null;
  4154. b.onerror = null;
  4155. b.parentNode && b.parentNode.removeChild(b);
  4156. b = this.getItem();
  4157. b.type == createjs.LoadQueue.JSONP && (window[b.callback] = null)
  4158. };
  4159. a.toString = function () {
  4160. return "[PreloadJS TagLoader]"
  4161. };
  4162. createjs.TagLoader = c
  4163. })();
  4164. this.createjs = this.createjs || {};
  4165. (function () {
  4166. var c = function (b, a) {
  4167. this.init(b, a)
  4168. },
  4169. a = c.prototype = new createjs.AbstractLoader;
  4170. a._request = null;
  4171. a._loadTimeout = null;
  4172. a._xhrLevel = 1;
  4173. a._response = null;
  4174. a._rawResponse = null;
  4175. a.init = function (b, a) {
  4176. this._item = b;
  4177. this._basePath = a;
  4178. !this._createXHR(b)
  4179. };
  4180. a.getResult = function (b) {
  4181. return b && this._rawResponse ? this._rawResponse : this._response
  4182. };
  4183. a.cancel = function () {
  4184. this.canceled = !0;
  4185. this._clean();
  4186. this._request.abort()
  4187. };
  4188. a.load = function () {
  4189. if (null == this._request) return this._handleError(), void 0;
  4190. this._request.onloadstart =
  4191. createjs.proxy(this._handleLoadStart, this);
  4192. this._request.onprogress = createjs.proxy(this._handleProgress, this);
  4193. this._request.onabort = createjs.proxy(this._handleAbort, this);
  4194. this._request.onerror = createjs.proxy(this._handleError, this);
  4195. this._request.ontimeout = createjs.proxy(this._handleTimeout, this);
  4196. 1 == this._xhrLevel && (this._loadTimeout = setTimeout(createjs.proxy(this._handleTimeout, this), createjs.LoadQueue.LOAD_TIMEOUT));
  4197. this._request.onload = createjs.proxy(this._handleLoad, this);
  4198. this._request.onreadystatechange =
  4199. createjs.proxy(this._handleReadyStateChange, this);
  4200. try {
  4201. this._item.values && this._item.method != createjs.LoadQueue.GET ? this._item.method == createjs.LoadQueue.POST && this._request.send(this._formatQueryString(this._item.values)) : this._request.send()
  4202. } catch (b) {
  4203. var a = new createjs.Event("error");
  4204. a.error = b;
  4205. this._sendError(a)
  4206. }
  4207. };
  4208. a.getAllResponseHeaders = function () {
  4209. return this._request.getAllResponseHeaders instanceof Function ? this._request.getAllResponseHeaders() : null
  4210. };
  4211. a.getResponseHeader = function (b) {
  4212. return this._request.getResponseHeader instanceof
  4213. Function ? this._request.getResponseHeader(b) : null
  4214. };
  4215. a._handleProgress = function (b) {
  4216. if (b && !(0 < b.loaded && 0 == b.total)) {
  4217. var a = new createjs.Event("progress");
  4218. a.loaded = b.loaded;
  4219. a.total = b.total;
  4220. this._sendProgress(a)
  4221. }
  4222. };
  4223. a._handleLoadStart = function () {
  4224. clearTimeout(this._loadTimeout);
  4225. this._sendLoadStart()
  4226. };
  4227. a._handleAbort = function (b) {
  4228. this._clean();
  4229. b = new createjs.Event("error");
  4230. b.text = "XHR_ABORTED";
  4231. this._sendError(b)
  4232. };
  4233. a._handleError = function () {
  4234. this._clean();
  4235. var b = new createjs.Event("error");
  4236. this._sendError(b)
  4237. };
  4238. a._handleReadyStateChange =
  4239. function () {
  4240. 4 == this._request.readyState && this._handleLoad()
  4241. };
  4242. a._handleLoad = function () {
  4243. if (!this.loaded) {
  4244. if (this.loaded = !0, !this._checkError()) return this._handleError(), void 0;
  4245. this._response = this._getResponse();
  4246. this._clean();
  4247. this._generateTag() && this._sendComplete()
  4248. }
  4249. };
  4250. a._handleTimeout = function (b) {
  4251. this._clean();
  4252. (new createjs.Event("error"))
  4253. .text = "PRELOAD_TIMEOUT";
  4254. this._sendError(b)
  4255. };
  4256. a._checkError = function () {
  4257. switch (parseInt(this._request.status)) {
  4258. case 404:
  4259. case 0:
  4260. return !1
  4261. }
  4262. return !0
  4263. };
  4264. a._getResponse = function () {
  4265. if (null !=
  4266. this._response) return this._response;
  4267. if (null != this._request.response) return this._request.response;
  4268. try {
  4269. if (null != this._request.responseText) return this._request.responseText
  4270. } catch (b) {}
  4271. try {
  4272. if (null != this._request.responseXML) return this._request.responseXML
  4273. } catch (a) {}
  4274. return null
  4275. };
  4276. a._createXHR = function (b) {
  4277. var a = document.createElement("a");
  4278. a.href = this.buildPath(b.src, this._basePath);
  4279. var c = document.createElement("a");
  4280. c.href = location.href;
  4281. a = "" != a.hostname && (a.port != c.port || a.protocol != c.protocol || a.hostname !=
  4282. c.hostname);
  4283. c = null;
  4284. if (a && window.XDomainRequest) c = new XDomainRequest;
  4285. else if (window.XMLHttpRequest) c = new XMLHttpRequest;
  4286. else try {
  4287. c = new ActiveXObject("Msxml2.XMLHTTP.6.0")
  4288. } catch (d) {
  4289. try {
  4290. c = new ActiveXObject("Msxml2.XMLHTTP.3.0")
  4291. } catch (e) {
  4292. try {
  4293. c = new ActiveXObject("Msxml2.XMLHTTP")
  4294. } catch (h) {
  4295. return !1
  4296. }
  4297. }
  4298. }
  4299. b.type == createjs.LoadQueue.TEXT && c.overrideMimeType && c.overrideMimeType("text/plain; charset=x-user-defined");
  4300. this._xhrLevel = "string" == typeof c.responseType ? 2 : 1;
  4301. var k = null;
  4302. return k = b.method == createjs.LoadQueue.GET ?
  4303. this.buildPath(b.src, this._basePath, b.values) : this.buildPath(b.src, this._basePath), c.open(b.method || createjs.LoadQueue.GET, k, !0), a && c instanceof XMLHttpRequest && 1 == this._xhrLevel && c.setRequestHeader("Origin", location.origin), b.values && b.method == createjs.LoadQueue.POST && c.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), createjs.LoadQueue.isBinary(b.type) && (c.responseType = "arraybuffer"), this._request = c, !0
  4304. };
  4305. a._clean = function () {
  4306. clearTimeout(this._loadTimeout);
  4307. var b = this._request;
  4308. b.onloadstart = null;
  4309. b.onprogress = null;
  4310. b.onabort = null;
  4311. b.onerror = null;
  4312. b.onload = null;
  4313. b.ontimeout = null;
  4314. b.onloadend = null;
  4315. b.onreadystatechange = null
  4316. };
  4317. a._generateTag = function () {
  4318. var b = this._item.tag;
  4319. switch (this._item.type) {
  4320. case createjs.LoadQueue.IMAGE:
  4321. return b.onload = createjs.proxy(this._handleTagReady, this), b.src = this.buildPath(this._item.src, this._basePath, this._item.values), this._rawResponse = this._response, this._response = b, !1;
  4322. case createjs.LoadQueue.JAVASCRIPT:
  4323. return b = document.createElement("script"),
  4324. b.text = this._response, this._rawResponse = this._response, this._response = b, !0;
  4325. case createjs.LoadQueue.CSS:
  4326. if (document.getElementsByTagName("head")[0].appendChild(b), b.styleSheet) b.styleSheet.cssText = this._response;
  4327. else {
  4328. var a = document.createTextNode(this._response);
  4329. b.appendChild(a)
  4330. }
  4331. return this._rawResponse = this._response, this._response = b, !0;
  4332. case createjs.LoadQueue.XML:
  4333. return a = this._parseXML(this._response, "text/xml"), this._response = a, !0;
  4334. case createjs.LoadQueue.SVG:
  4335. return a = this._parseXML(this._response,
  4336. "image/svg+xml"), this._rawResponse = this._response, null != a.documentElement ? (b.appendChild(a.documentElement), this._response = b) : this._response = a, !0;
  4337. case createjs.LoadQueue.JSON:
  4338. b = {};
  4339. try {
  4340. b = JSON.parse(this._response)
  4341. } catch (c) {
  4342. b = c
  4343. }
  4344. return this._rawResponse = this._response, this._response = b, !0
  4345. }
  4346. return !0
  4347. };
  4348. a._parseXML = function (b, a) {
  4349. var c = null;
  4350. window.DOMParser ? c = (new DOMParser)
  4351. .parseFromString(b, a) : (c = new ActiveXObject("Microsoft.XMLDOM"), c.async = !1, c.loadXML(b));
  4352. return c
  4353. };
  4354. a._handleTagReady = function () {
  4355. this._sendComplete()
  4356. };
  4357. a.toString = function () {
  4358. return "[PreloadJS XHRLoader]"
  4359. };
  4360. createjs.XHRLoader = c
  4361. })();
  4362. "object" != typeof JSON && (JSON = {});
  4363. (function () {
  4364. function c(b) {
  4365. return 10 > b ? "0" + b : b
  4366. }
  4367. function a(b) {
  4368. return f.lastIndex = 0, f.test(b) ? '"' + b.replace(f, function (b) {
  4369. var a = h[b];
  4370. return "string" == typeof a ? a : "\\u" + ("0000" + b.charCodeAt(0)
  4371. .toString(16))
  4372. .slice(-4)
  4373. }) + '"' : '"' + b + '"'
  4374. }
  4375. function b(c, f) {
  4376. var g, h, s, t, q, w = d,
  4377. u = f[c];
  4378. switch (u && "object" == typeof u && "function" == typeof u.toJSON && (u = u.toJSON(c)), "function" == typeof k && (u = k.call(f, c, u)), typeof u) {
  4379. case "string":
  4380. return a(u);
  4381. case "number":
  4382. return isFinite(u) ? String(u) : "null";
  4383. case "boolean":
  4384. case "null":
  4385. return String(u);
  4386. case "object":
  4387. if (!u) return "null";
  4388. if (d += e, q = [], "[object Array]" === Object.prototype.toString.apply(u)) {
  4389. t = u.length;
  4390. for (g = 0; t > g; g += 1) q[g] = b(g, u) || "null";
  4391. return s = 0 === q.length ? "[]" : d ? "[\n" + d + q.join(",\n" + d) + "\n" + w + "]" : "[" + q.join(",") + "]", d = w, s
  4392. }
  4393. if (k && "object" == typeof k)
  4394. for (t = k.length, g = 0; t > g; g += 1) "string" == typeof k[g] && (h = k[g], s = b(h, u), s && q.push(a(h) + (d ? ": " : ":") + s));
  4395. else
  4396. for (h in u) Object.prototype.hasOwnProperty.call(u, h) && (s = b(h, u), s && q.push(a(h) + (d ? ": " : ":") + s));
  4397. return s = 0 === q.length ? "{}" : d ? "{\n" + d +
  4398. q.join(",\n" + d) + "\n" + w + "}" : "{" + q.join(",") + "}", d = w, s
  4399. }
  4400. }
  4401. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function () {
  4402. return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + c(this.getUTCMonth() + 1) + "-" + c(this.getUTCDate()) + "T" + c(this.getUTCHours()) + ":" + c(this.getUTCMinutes()) + ":" + c(this.getUTCSeconds()) + "Z" : null
  4403. }, String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function () {
  4404. return this.valueOf()
  4405. });
  4406. var g = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  4407. f = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  4408. d, e, h = {
  4409. "\b": "\\b",
  4410. "\t": "\\t",
  4411. "\n": "\\n",
  4412. "\f": "\\f",
  4413. "\r": "\\r",
  4414. '"': '\\"',
  4415. "\\": "\\\\"
  4416. },
  4417. k;
  4418. "function" != typeof JSON.stringify && (JSON.stringify = function (a, c, f) {
  4419. var g;
  4420. if (d = "", e = "", "number" == typeof f)
  4421. for (g = 0; f > g; g += 1) e += " ";
  4422. else "string" == typeof f && (e = f); if (k = c, c && "function" != typeof c && ("object" != typeof c || "number" != typeof c.length)) throw Error("JSON.stringify");
  4423. return b("", {
  4424. "": a
  4425. })
  4426. });
  4427. "function" != typeof JSON.parse && (JSON.parse = function (b, a) {
  4428. function c(b, f) {
  4429. var d, g, e = b[f];
  4430. if (e && "object" == typeof e)
  4431. for (d in e) Object.prototype.hasOwnProperty.call(e, d) && (g = c(e, d), void 0 !== g ? e[d] = g : delete e[d]);
  4432. return a.call(b, f, e)
  4433. }
  4434. var f;
  4435. if (b = String(b), g.lastIndex = 0, g.test(b) && (b = b.replace(g, function (b) {
  4436. return "\\u" + ("0000" + b.charCodeAt(0)
  4437. .toString(16))
  4438. .slice(-4)
  4439. })), /^[\],:{}\s]*$/.test(b.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
  4440. .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
  4441. "]")
  4442. .replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) return f = eval("(" + b + ")"), "function" == typeof a ? c({
  4443. "": f
  4444. }, "") : f;
  4445. throw new SyntaxError("JSON.parse");
  4446. })
  4447. })();
  4448. this.createjs = this.createjs || {};
  4449. (function () {
  4450. var c = function (b, a, c) {
  4451. this.initialize(b, a, c)
  4452. },
  4453. a = c.prototype;
  4454. a.type = null;
  4455. a.target = null;
  4456. a.currentTarget = null;
  4457. a.eventPhase = 0;
  4458. a.bubbles = !1;
  4459. a.cancelable = !1;
  4460. a.timeStamp = 0;
  4461. a.defaultPrevented = !1;
  4462. a.propagationStopped = !1;
  4463. a.immediatePropagationStopped = !1;
  4464. a.removed = !1;
  4465. a.initialize = function (b, a, c) {
  4466. this.type = b;
  4467. this.bubbles = a;
  4468. this.cancelable = c;
  4469. this.timeStamp = (new Date)
  4470. .getTime()
  4471. };
  4472. a.preventDefault = function () {
  4473. this.defaultPrevented = !0
  4474. };
  4475. a.stopPropagation = function () {
  4476. this.propagationStopped = !0
  4477. };
  4478. a.stopImmediatePropagation =
  4479. function () {
  4480. this.immediatePropagationStopped = this.propagationStopped = !0
  4481. };
  4482. a.remove = function () {
  4483. this.removed = !0
  4484. };
  4485. a.clone = function () {
  4486. return new c(this.type, this.bubbles, this.cancelable)
  4487. };
  4488. a.toString = function () {
  4489. return "[Event (type=" + this.type + ")]"
  4490. };
  4491. createjs.Event = c
  4492. })();
  4493. this.createjs = this.createjs || {};
  4494. (function () {
  4495. var c = function () {
  4496. this.initialize()
  4497. },
  4498. a = c.prototype;
  4499. c.initialize = function (b) {
  4500. b.addEventListener = a.addEventListener;
  4501. b.on = a.on;
  4502. b.removeEventListener = b.off = a.removeEventListener;
  4503. b.removeAllEventListeners = a.removeAllEventListeners;
  4504. b.hasEventListener = a.hasEventListener;
  4505. b.dispatchEvent = a.dispatchEvent;
  4506. b._dispatchEvent = a._dispatchEvent
  4507. };
  4508. a._listeners = null;
  4509. a._captureListeners = null;
  4510. a.initialize = function () {};
  4511. a.addEventListener = function (b, a, c) {
  4512. var d;
  4513. d = c ? this._captureListeners = this._captureListeners || {} : this._listeners = this._listeners || {};
  4514. var e = d[b];
  4515. return e && this.removeEventListener(b, a, c), e = d[b], e ? e.push(a) : d[b] = [a], a
  4516. };
  4517. a.on = function (b, a, c, d, e, h) {
  4518. return a.handleEvent && (c = c || a, a = a.handleEvent), c = c || this, this.addEventListener(b, function (b) {
  4519. a.call(c, b, e);
  4520. d && b.remove()
  4521. }, h)
  4522. };
  4523. a.removeEventListener = function (b, a, c) {
  4524. if (c = c ? this._captureListeners : this._listeners) {
  4525. var d = c[b];
  4526. if (d)
  4527. for (var e = 0, h = d.length; h > e; e++)
  4528. if (d[e] == a) {
  4529. 1 == h ? delete c[b] : d.splice(e, 1);
  4530. break
  4531. }
  4532. }
  4533. };
  4534. a.off = a.removeEventListener;
  4535. a.removeAllEventListeners =
  4536. function (b) {
  4537. b ? (this._listeners && delete this._listeners[b], this._captureListeners && delete this._captureListeners[b]) : this._listeners = this._captureListeners = null
  4538. };
  4539. a.dispatchEvent = function (b, a) {
  4540. if ("string" == typeof b) {
  4541. var c = this._listeners;
  4542. if (!c || !c[b]) return !1;
  4543. b = new createjs.Event(b)
  4544. }
  4545. if (b.target = a || this, b.bubbles && this.parent) {
  4546. for (var d = this, c = [d]; d.parent;) c.push(d = d.parent);
  4547. for (var e = c.length, d = e - 1; 0 <= d && !b.propagationStopped; d--) c[d]._dispatchEvent(b, 1 + (0 == d));
  4548. for (d = 1; e > d && !b.propagationStopped; d++) c[d]._dispatchEvent(b,
  4549. 3)
  4550. } else this._dispatchEvent(b, 2);
  4551. return b.defaultPrevented
  4552. };
  4553. a.hasEventListener = function (b) {
  4554. var a = this._listeners,
  4555. c = this._captureListeners;
  4556. return !!(a && a[b] || c && c[b])
  4557. };
  4558. a.toString = function () {
  4559. return "[EventDispatcher]"
  4560. };
  4561. a._dispatchEvent = function (b, a) {
  4562. var c, d = 1 == a ? this._captureListeners : this._listeners;
  4563. if (b && d && (d = d[b.type]) && (c = d.length)) {
  4564. b.currentTarget = this;
  4565. b.eventPhase = a;
  4566. b.removed = !1;
  4567. for (var d = d.slice(), e = 0; c > e && !b.immediatePropagationStopped; e++) {
  4568. var h = d[e];
  4569. h.handleEvent ? h.handleEvent(b) : h(b);
  4570. b.removed &&
  4571. (this.off(b.type, h, 1 == a), b.removed = !1)
  4572. }
  4573. }
  4574. };
  4575. createjs.EventDispatcher = c
  4576. })();
  4577. this.createjs = this.createjs || {};
  4578. (function () {
  4579. var c = function (b, a, c) {
  4580. this.initialize(b, a, c)
  4581. },
  4582. a = c.prototype = new createjs.EventDispatcher;
  4583. c.NONE = 0;
  4584. c.LOOP = 1;
  4585. c.REVERSE = 2;
  4586. c.IGNORE = {};
  4587. c._tweens = [];
  4588. c._plugins = {};
  4589. c.get = function (b, a, f, d) {
  4590. return d && c.removeTweens(b), new c(b, a, f)
  4591. };
  4592. c.tick = function (b, a) {
  4593. for (var f = c._tweens.slice(), d = f.length - 1; 0 <= d; d--) {
  4594. var e = f[d];
  4595. a && !e.ignoreGlobalPause || e._paused || e.tick(e._useTicks ? 1 : b)
  4596. }
  4597. };
  4598. c.handleEvent = function (b) {
  4599. "tick" == b.type && this.tick(b.delta, b.paused)
  4600. };
  4601. c.removeTweens = function (b) {
  4602. if (b.tweenjs_count) {
  4603. for (var a =
  4604. c._tweens, f = a.length - 1; 0 <= f; f--) a[f]._target == b && (a[f]._paused = !0, a.splice(f, 1));
  4605. b.tweenjs_count = 0
  4606. }
  4607. };
  4608. c.removeAllTweens = function () {
  4609. for (var b = c._tweens, a = 0, f = b.length; f > a; a++) {
  4610. var d = b[a];
  4611. d.paused = !0;
  4612. d.target.tweenjs_count = 0
  4613. }
  4614. b.length = 0
  4615. };
  4616. c.hasActiveTweens = function (b) {
  4617. return b ? b.tweenjs_count : c._tweens && !!c._tweens.length
  4618. };
  4619. c.installPlugin = function (b, a) {
  4620. var f = b.priority;
  4621. null == f && (b.priority = f = 0);
  4622. for (var d = 0, e = a.length, h = c._plugins; e > d; d++) {
  4623. var k = a[d];
  4624. if (h[k]) {
  4625. for (var m = h[k], n = 0, p = m.length; p > n && !(f < m[n].priority); n++);
  4626. h[k].splice(n, 0, b)
  4627. } else h[k] = [b]
  4628. }
  4629. };
  4630. c._register = function (b, a) {
  4631. var f = b._target,
  4632. d = c._tweens;
  4633. if (a) f && (f.tweenjs_count = f.tweenjs_count ? f.tweenjs_count + 1 : 1), d.push(b), !c._inited && createjs.Ticker && (createjs.Ticker.addEventListener("tick", c), c._inited = !0);
  4634. else
  4635. for (f && f.tweenjs_count--, f = d.length; f--;)
  4636. if (d[f] == b) return d.splice(f, 1), void 0
  4637. };
  4638. a.ignoreGlobalPause = !1;
  4639. a.loop = !1;
  4640. a.duration = 0;
  4641. a.pluginData = null;
  4642. a.target = null;
  4643. a.position = null;
  4644. a.passive = !1;
  4645. a._paused = !1;
  4646. a._curQueueProps = null;
  4647. a._initQueueProps = null;
  4648. a._steps =
  4649. null;
  4650. a._actions = null;
  4651. a._prevPosition = 0;
  4652. a._stepPosition = 0;
  4653. a._prevPos = -1;
  4654. a._target = null;
  4655. a._useTicks = !1;
  4656. a._inited = !1;
  4657. a.initialize = function (b, a, f) {
  4658. this.target = this._target = b;
  4659. a && (this._useTicks = a.useTicks, this.ignoreGlobalPause = a.ignoreGlobalPause, this.loop = a.loop, a.onChange && this.addEventListener("change", a.onChange), a.override && c.removeTweens(b));
  4660. this.pluginData = f || {};
  4661. this._curQueueProps = {};
  4662. this._initQueueProps = {};
  4663. this._steps = [];
  4664. this._actions = [];
  4665. a && a.paused ? this._paused = !0 : c._register(this, !0);
  4666. a && null !=
  4667. a.position && this.setPosition(a.position, c.NONE)
  4668. };
  4669. a.wait = function (b, a) {
  4670. if (null == b || 0 >= b) return this;
  4671. var c = this._cloneProps(this._curQueueProps);
  4672. return this._addStep({
  4673. d: b,
  4674. p0: c,
  4675. e: this._linearEase,
  4676. p1: c,
  4677. v: a
  4678. })
  4679. };
  4680. a.to = function (b, a, c) {
  4681. return (isNaN(a) || 0 > a) && (a = 0), this._addStep({
  4682. d: a || 0,
  4683. p0: this._cloneProps(this._curQueueProps),
  4684. e: c,
  4685. p1: this._cloneProps(this._appendQueueProps(b))
  4686. })
  4687. };
  4688. a.call = function (b, a, c) {
  4689. return this._addAction({
  4690. f: b,
  4691. p: a ? a : [this],
  4692. o: c ? c : this._target
  4693. })
  4694. };
  4695. a.set = function (b, a) {
  4696. return this._addAction({
  4697. f: this._set,
  4698. o: this,
  4699. p: [b, a ? a : this._target]
  4700. })
  4701. };
  4702. a.play = function (b) {
  4703. return b || (b = this), this.call(b.setPaused, [!1], b)
  4704. };
  4705. a.pause = function (b) {
  4706. return b || (b = this), this.call(b.setPaused, [!0], b)
  4707. };
  4708. a.setPosition = function (b, a) {
  4709. 0 > b && (b = 0);
  4710. null == a && (a = 1);
  4711. var c = b,
  4712. d = !1;
  4713. if (c >= this.duration && (this.loop ? c %= this.duration : (c = this.duration, d = !0)), c == this._prevPos) return d;
  4714. var e = this._prevPos;
  4715. if (this.position = this._prevPos = c, this._prevPosition = b, this._target)
  4716. if (d) this._updateTargetProps(null, 1);
  4717. else if (0 < this._steps.length) {
  4718. for (var h =
  4719. 0, k = this._steps.length; k > h && !(this._steps[h].t > c); h++);
  4720. h = this._steps[h - 1];
  4721. this._updateTargetProps(h, (this._stepPosition = c - h.t) / h.d)
  4722. }
  4723. return 0 != a && 0 < this._actions.length && (this._useTicks ? this._runActions(c, c) : 1 == a && e > c ? (e != this.duration && this._runActions(e, this.duration), this._runActions(0, c, !0)) : this._runActions(e, c)), d && this.setPaused(!0), this.dispatchEvent("change"), d
  4724. };
  4725. a.tick = function (b) {
  4726. this._paused || this.setPosition(this._prevPosition + b)
  4727. };
  4728. a.setPaused = function (b) {
  4729. return this._paused = !!b, c._register(this, !b), this
  4730. };
  4731. a.w = a.wait;
  4732. a.t = a.to;
  4733. a.c = a.call;
  4734. a.s = a.set;
  4735. a.toString = function () {
  4736. return "[Tween]"
  4737. };
  4738. a.clone = function () {
  4739. throw "Tween can not be cloned.";
  4740. };
  4741. a._updateTargetProps = function (b, a) {
  4742. var f, d, e, h;
  4743. if (b || 1 != a) {
  4744. if (this.passive = !!b.v, this.passive) return;
  4745. b.e && (a = b.e(a, 0, 1, 1));
  4746. f = b.p0;
  4747. d = b.p1
  4748. } else this.passive = !1, f = d = this._curQueueProps;
  4749. for (var k in this._initQueueProps) {
  4750. null == (e = f[k]) && (f[k] = e = this._initQueueProps[k]);
  4751. null == (h = d[k]) && (d[k] = h = e);
  4752. e = e == h || 0 == a || 1 == a || "number" != typeof e ? 1 == a ? h : e : e + (h - e) * a;
  4753. var m = !1;
  4754. if (h = c._plugins[k])
  4755. for (var n = 0, p = h.length; p > n; n++) {
  4756. var r = h[n].tween(this, k, e, f, d, a, !!b && f == d, !b);
  4757. r == c.IGNORE ? m = !0 : e = r
  4758. }
  4759. m || (this._target[k] = e)
  4760. }
  4761. };
  4762. a._runActions = function (b, a, c) {
  4763. var d = b,
  4764. e = a,
  4765. h = -1,
  4766. k = this._actions.length,
  4767. m = 1;
  4768. for (b > a && (d = a, e = b, h = k, k = m = -1);
  4769. (h += m) != k;) {
  4770. a = this._actions[h];
  4771. var n = a.t;
  4772. (n == e || n > d && e > n || c && n == b) && a.f.apply(a.o, a.p)
  4773. }
  4774. };
  4775. a._appendQueueProps = function (b) {
  4776. var a, f, d, e, h, k;
  4777. for (k in b)
  4778. if (void 0 === this._initQueueProps[k]) {
  4779. if (f = this._target[k], a = c._plugins[k])
  4780. for (d = 0, e = a.length; e > d; d++) f = a[d].init(this,
  4781. k, f);
  4782. this._initQueueProps[k] = this._curQueueProps[k] = void 0 === f ? null : f
  4783. }
  4784. for (k in b) {
  4785. if (f = this._curQueueProps[k], a = c._plugins[k])
  4786. for (h = h || {}, d = 0, e = a.length; e > d; d++) a[d].step && a[d].step(this, k, f, b[k], h);
  4787. this._curQueueProps[k] = b[k]
  4788. }
  4789. return h && this._appendQueueProps(h), this._curQueueProps
  4790. };
  4791. a._cloneProps = function (b) {
  4792. var a = {},
  4793. c;
  4794. for (c in b) a[c] = b[c];
  4795. return a
  4796. };
  4797. a._addStep = function (b) {
  4798. return 0 < b.d && (this._steps.push(b), b.t = this.duration, this.duration += b.d), this
  4799. };
  4800. a._addAction = function (b) {
  4801. return b.t = this.duration,
  4802. this._actions.push(b), this
  4803. };
  4804. a._set = function (b, a) {
  4805. for (var c in b) a[c] = b[c]
  4806. };
  4807. createjs.Tween = c
  4808. })();
  4809. this.createjs = this.createjs || {};
  4810. (function () {
  4811. var c = function (b, a, c) {
  4812. this.initialize(b, a, c)
  4813. },
  4814. a = c.prototype = new createjs.EventDispatcher;
  4815. a.ignoreGlobalPause = !1;
  4816. a.duration = 0;
  4817. a.loop = !1;
  4818. a.position = null;
  4819. a._paused = !1;
  4820. a._tweens = null;
  4821. a._labels = null;
  4822. a._labelList = null;
  4823. a._prevPosition = 0;
  4824. a._prevPos = -1;
  4825. a._useTicks = !1;
  4826. a.initialize = function (b, a, c) {
  4827. this._tweens = [];
  4828. c && (this._useTicks = c.useTicks, this.loop = c.loop, this.ignoreGlobalPause = c.ignoreGlobalPause, c.onChange && this.addEventListener("change", c.onChange));
  4829. b && this.addTween.apply(this, b);
  4830. this.setLabels(a);
  4831. c && c.paused ? this._paused = !0 : createjs.Tween._register(this, !0);
  4832. c && null != c.position && this.setPosition(c.position, createjs.Tween.NONE)
  4833. };
  4834. a.addTween = function (b) {
  4835. var a = arguments.length;
  4836. if (1 < a) {
  4837. for (var c = 0; a > c; c++) this.addTween(arguments[c]);
  4838. return arguments[0]
  4839. }
  4840. return 0 == a ? null : (this.removeTween(b), this._tweens.push(b), b.setPaused(!0), b._paused = !1, b._useTicks = this._useTicks, b.duration > this.duration && (this.duration = b.duration), 0 <= this._prevPos && b.setPosition(this._prevPos, createjs.Tween.NONE), b)
  4841. };
  4842. a.removeTween =
  4843. function (b) {
  4844. var a = arguments.length;
  4845. if (1 < a) {
  4846. for (var c = !0, d = 0; a > d; d++) c = c && this.removeTween(arguments[d]);
  4847. return c
  4848. }
  4849. if (0 == a) return !1;
  4850. a = this._tweens;
  4851. for (d = a.length; d--;)
  4852. if (a[d] == b) return a.splice(d, 1), b.duration >= this.duration && this.updateDuration(), !0;
  4853. return !1
  4854. };
  4855. a.addLabel = function (b, a) {
  4856. this._labels[b] = a;
  4857. var c = this._labelList;
  4858. if (c) {
  4859. for (var d = 0, e = c.length; e > d && !(a < c[d].position); d++);
  4860. c.splice(d, 0, {
  4861. label: b,
  4862. position: a
  4863. })
  4864. }
  4865. };
  4866. a.setLabels = function (b) {
  4867. this._labels = b ? b : {}
  4868. };
  4869. a.getLabels = function () {
  4870. var b = this._labelList;
  4871. if (!b) {
  4872. var b = this._labelList = [],
  4873. a = this._labels,
  4874. c;
  4875. for (c in a) b.push({
  4876. label: c,
  4877. position: a[c]
  4878. });
  4879. b.sort(function (b, a) {
  4880. return b.position - a.position
  4881. })
  4882. }
  4883. return b
  4884. };
  4885. a.getCurrentLabel = function () {
  4886. var b = this.getLabels(),
  4887. a = this.position,
  4888. c = b.length;
  4889. if (c) {
  4890. for (var d = 0; c > d && !(a < b[d].position); d++);
  4891. return 0 == d ? null : b[d - 1].label
  4892. }
  4893. return null
  4894. };
  4895. a.gotoAndPlay = function (b) {
  4896. this.setPaused(!1);
  4897. this._goto(b)
  4898. };
  4899. a.gotoAndStop = function (b) {
  4900. this.setPaused(!0);
  4901. this._goto(b)
  4902. };
  4903. a.setPosition = function (b, a) {
  4904. 0 > b && (b = 0);
  4905. var c = this.loop ? b % this.duration :
  4906. b,
  4907. d = !this.loop && b >= this.duration;
  4908. if (c == this._prevPos) return d;
  4909. this._prevPosition = b;
  4910. this.position = this._prevPos = c;
  4911. for (var e = 0, h = this._tweens.length; h > e; e++)
  4912. if (this._tweens[e].setPosition(c, a), c != this._prevPos) return !1;
  4913. return d && this.setPaused(!0), this.dispatchEvent("change"), d
  4914. };
  4915. a.setPaused = function (a) {
  4916. this._paused = !!a;
  4917. createjs.Tween._register(this, !a)
  4918. };
  4919. a.updateDuration = function () {
  4920. for (var a = this.duration = 0, c = this._tweens.length; c > a; a++) {
  4921. var f = this._tweens[a];
  4922. f.duration > this.duration && (this.duration =
  4923. f.duration)
  4924. }
  4925. };
  4926. a.tick = function (a) {
  4927. this.setPosition(this._prevPosition + a)
  4928. };
  4929. a.resolve = function (a) {
  4930. var c = parseFloat(a);
  4931. return isNaN(c) && (c = this._labels[a]), c
  4932. };
  4933. a.toString = function () {
  4934. return "[Timeline]"
  4935. };
  4936. a.clone = function () {
  4937. throw "Timeline can not be cloned.";
  4938. };
  4939. a._goto = function (a) {
  4940. a = this.resolve(a);
  4941. null != a && this.setPosition(a)
  4942. };
  4943. createjs.Timeline = c
  4944. })();
  4945. this.createjs = this.createjs || {};
  4946. (function () {
  4947. var c = function () {
  4948. throw "Ease cannot be instantiated.";
  4949. };
  4950. c.linear = function (a) {
  4951. return a
  4952. };
  4953. c.none = c.linear;
  4954. c.get = function (a) {
  4955. return -1 > a && (a = -1), 1 < a && (a = 1),
  4956. function (b) {
  4957. return 0 == a ? b : 0 > a ? b * (b * -a + 1 + a) : b * ((2 - b) * a + (1 - a))
  4958. }
  4959. };
  4960. c.getPowIn = function (a) {
  4961. return function (b) {
  4962. return Math.pow(b, a)
  4963. }
  4964. };
  4965. c.getPowOut = function (a) {
  4966. return function (b) {
  4967. return 1 - Math.pow(1 - b, a)
  4968. }
  4969. };
  4970. c.getPowInOut = function (a) {
  4971. return function (b) {
  4972. return 1 > (b *= 2) ? 0.5 * Math.pow(b, a) : 1 - 0.5 * Math.abs(Math.pow(2 - b, a))
  4973. }
  4974. };
  4975. c.quadIn = c.getPowIn(2);
  4976. c.quadOut =
  4977. c.getPowOut(2);
  4978. c.quadInOut = c.getPowInOut(2);
  4979. c.cubicIn = c.getPowIn(3);
  4980. c.cubicOut = c.getPowOut(3);
  4981. c.cubicInOut = c.getPowInOut(3);
  4982. c.quartIn = c.getPowIn(4);
  4983. c.quartOut = c.getPowOut(4);
  4984. c.quartInOut = c.getPowInOut(4);
  4985. c.quintIn = c.getPowIn(5);
  4986. c.quintOut = c.getPowOut(5);
  4987. c.quintInOut = c.getPowInOut(5);
  4988. c.sineIn = function (a) {
  4989. return 1 - Math.cos(a * Math.PI / 2)
  4990. };
  4991. c.sineOut = function (a) {
  4992. return Math.sin(a * Math.PI / 2)
  4993. };
  4994. c.sineInOut = function (a) {
  4995. return -0.5 * (Math.cos(Math.PI * a) - 1)
  4996. };
  4997. c.getBackIn = function (a) {
  4998. return function (b) {
  4999. return b *
  5000. b * ((a + 1) * b - a)
  5001. }
  5002. };
  5003. c.backIn = c.getBackIn(1.7);
  5004. c.getBackOut = function (a) {
  5005. return function (b) {
  5006. return --b * b * ((a + 1) * b + a) + 1
  5007. }
  5008. };
  5009. c.backOut = c.getBackOut(1.7);
  5010. c.getBackInOut = function (a) {
  5011. return a *= 1.525,
  5012. function (b) {
  5013. return 1 > (b *= 2) ? 0.5 * b * b * ((a + 1) * b - a) : 0.5 * ((b -= 2) * b * ((a + 1) * b + a) + 2)
  5014. }
  5015. };
  5016. c.backInOut = c.getBackInOut(1.7);
  5017. c.circIn = function (a) {
  5018. return -(Math.sqrt(1 - a * a) - 1)
  5019. };
  5020. c.circOut = function (a) {
  5021. return Math.sqrt(1 - --a * a)
  5022. };
  5023. c.circInOut = function (a) {
  5024. return 1 > (a *= 2) ? -0.5 * (Math.sqrt(1 - a * a) - 1) : 0.5 * (Math.sqrt(1 - (a -= 2) * a) + 1)
  5025. };
  5026. c.bounceIn =
  5027. function (a) {
  5028. return 1 - c.bounceOut(1 - a)
  5029. };
  5030. c.bounceOut = function (a) {
  5031. return 1 / 2.75 > a ? 7.5625 * a * a : 2 / 2.75 > a ? 7.5625 * (a -= 1.5 / 2.75) * a + 0.75 : 2.5 / 2.75 > a ? 7.5625 * (a -= 2.25 / 2.75) * a + 0.9375 : 7.5625 * (a -= 2.625 / 2.75) * a + 0.984375
  5032. };
  5033. c.bounceInOut = function (a) {
  5034. return 0.5 > a ? 0.5 * c.bounceIn(2 * a) : 0.5 * c.bounceOut(2 * a - 1) + 0.5
  5035. };
  5036. c.getElasticIn = function (a, b) {
  5037. var c = 2 * Math.PI;
  5038. return function (f) {
  5039. if (0 == f || 1 == f) return f;
  5040. var d = b / c * Math.asin(1 / a);
  5041. return -(a * Math.pow(2, 10 * (f -= 1)) * Math.sin((f - d) * c / b))
  5042. }
  5043. };
  5044. c.elasticIn = c.getElasticIn(1, 0.3);
  5045. c.getElasticOut =
  5046. function (a, b) {
  5047. var c = 2 * Math.PI;
  5048. return function (f) {
  5049. if (0 == f || 1 == f) return f;
  5050. var d = b / c * Math.asin(1 / a);
  5051. return a * Math.pow(2, -10 * f) * Math.sin((f - d) * c / b) + 1
  5052. }
  5053. };
  5054. c.elasticOut = c.getElasticOut(1, 0.3);
  5055. c.getElasticInOut = function (a, b) {
  5056. var c = 2 * Math.PI;
  5057. return function (f) {
  5058. var d = b / c * Math.asin(1 / a);
  5059. return 1 > (f *= 2) ? -0.5 * a * Math.pow(2, 10 * (f -= 1)) * Math.sin((f - d) * c / b) : 0.5 * a * Math.pow(2, -10 * (f -= 1)) * Math.sin((f - d) * c / b) + 1
  5060. }
  5061. };
  5062. c.elasticInOut = c.getElasticInOut(1, 0.3 * 1.5);
  5063. createjs.Ease = c
  5064. })();
  5065. this.createjs = this.createjs || {};
  5066. (function () {
  5067. var c = function () {
  5068. throw "MotionGuidePlugin cannot be instantiated.";
  5069. };
  5070. c.priority = 0;
  5071. c._rotOffS;
  5072. c._rotOffE;
  5073. c._rotNormS;
  5074. c._rotNormE;
  5075. c.install = function () {
  5076. return createjs.Tween.installPlugin(c, ["guide", "x", "y", "rotation"]), createjs.Tween.IGNORE
  5077. };
  5078. c.init = function (a, b, c) {
  5079. var f = a.target;
  5080. return f.hasOwnProperty("x") || (f.x = 0), f.hasOwnProperty("y") || (f.y = 0), f.hasOwnProperty("rotation") || (f.rotation = 0), "rotation" == b && (a.__needsRot = !0), "guide" == b ? null : c
  5081. };
  5082. c.step = function (a, b, g, f, d) {
  5083. if ("rotation" == b && (a.__rotGlobalS =
  5084. g, a.__rotGlobalE = f, c.testRotData(a, d)), "guide" != b) return f;
  5085. var e;
  5086. f.hasOwnProperty("path") || (f.path = []);
  5087. b = f.path;
  5088. if (f.hasOwnProperty("end") || (f.end = 1), f.hasOwnProperty("start") || (f.start = g && g.hasOwnProperty("end") && g.path === b ? g.end : 0), f.hasOwnProperty("_segments") && f._length) return f;
  5089. g = b.length;
  5090. if (!(6 <= g && 0 == (g - 2) % 4)) throw "invalid 'path' data, please see documentation for valid paths";
  5091. f._segments = [];
  5092. f._length = 0;
  5093. for (var h = 2; g > h; h += 4) {
  5094. for (var k, m, n = b[h - 2], p = b[h - 1], r = b[h + 0], s = b[h + 1], t = b[h + 2], q = b[h + 3],
  5095. w = n, u = p, x = 0, K = [], A = 1; 10 >= A; A++) {
  5096. m = A / 10;
  5097. var y = 1 - m;
  5098. k = y * y * n + 2 * y * m * r + m * m * t;
  5099. m = y * y * p + 2 * y * m * s + m * m * q;
  5100. x += K[K.push(Math.sqrt((e = k - w) * e + (e = m - u) * e)) - 1];
  5101. w = k;
  5102. u = m
  5103. }
  5104. f._segments.push(x);
  5105. f._segments.push(K);
  5106. f._length += x
  5107. }
  5108. e = f.orient;
  5109. f.orient = !0;
  5110. b = {};
  5111. return c.calc(f, f.start, b), a.__rotPathS = Number(b.rotation.toFixed(5)), c.calc(f, f.end, b), a.__rotPathE = Number(b.rotation.toFixed(5)), f.orient = !1, c.calc(f, f.end, d), f.orient = e, f.orient ? (a.__guideData = f, c.testRotData(a, d), f) : f
  5112. };
  5113. c.testRotData = function (a, b) {
  5114. if (void 0 === a.__rotGlobalS ||
  5115. void 0 === a.__rotGlobalE) {
  5116. if (a.__needsRot) return;
  5117. a.__rotGlobalS = a.__rotGlobalE = void 0 !== a._curQueueProps.rotation ? a._curQueueProps.rotation : b.rotation = a.target.rotation || 0
  5118. }
  5119. if (void 0 !== a.__guideData) {
  5120. var c = a.__guideData,
  5121. f = a.__rotGlobalE - a.__rotGlobalS,
  5122. d = a.__rotPathE - a.__rotPathS,
  5123. e = f - d;
  5124. if ("auto" == c.orient) 180 < e ? e -= 360 : -180 > e && (e += 360);
  5125. else if ("cw" == c.orient) {
  5126. for (; 0 > e;) e += 360;
  5127. 0 == e && 0 < f && 180 != f && (e += 360)
  5128. } else if ("ccw" == c.orient) {
  5129. for (e = f - (180 < d ? 360 - d : d); 0 < e;) e -= 360;
  5130. 0 == e && 0 > f && -180 != f && (e -= 360)
  5131. }
  5132. c.rotDelta =
  5133. e;
  5134. c.rotOffS = a.__rotGlobalS - a.__rotPathS;
  5135. a.__rotGlobalS = a.__rotGlobalE = a.__guideData = a.__needsRot = void 0
  5136. }
  5137. };
  5138. c.tween = function (a, b, g, f, d, e, h) {
  5139. d = d.guide;
  5140. if (void 0 == d || d === f.guide) return g;
  5141. if (d.lastRatio != e) {
  5142. switch (c.calc(d, (d.end - d.start) * (h ? d.end : e) + d.start, a.target), d.orient) {
  5143. case "cw":
  5144. case "ccw":
  5145. case "auto":
  5146. a.target.rotation += d.rotOffS + d.rotDelta * e;
  5147. break;
  5148. default:
  5149. a.target.rotation += d.rotOffS
  5150. }
  5151. d.lastRatio = e
  5152. }
  5153. return "rotation" != b || d.orient && "false" != d.orient ? a.target[b] : g
  5154. };
  5155. c.calc = function (a, b, g) {
  5156. void 0 ==
  5157. a._segments && c.validate(a);
  5158. void 0 == g && (g = {
  5159. x: 0,
  5160. y: 0,
  5161. rotation: 0
  5162. });
  5163. var f = a._segments,
  5164. d = a.path,
  5165. e = a._length * b,
  5166. h = f.length - 2;
  5167. for (b = 0; e > f[b] && h > b;) e -= f[b], b += 2;
  5168. for (var f = f[b + 1], k = 0, h = f.length - 1; e > f[k] && h > k;) e -= f[k], k++;
  5169. e = k / ++h + e / (h * f[k]);
  5170. b = 2 * b + 2;
  5171. h = 1 - e;
  5172. return g.x = h * h * d[b - 2] + 2 * h * e * d[b + 0] + e * e * d[b + 2], g.y = h * h * d[b - 1] + 2 * h * e * d[b + 1] + e * e * d[b + 3], a.orient && (g.rotation = 57.2957795 * Math.atan2((d[b + 1] - d[b - 1]) * h + (d[b + 3] - d[b + 1]) * e, (d[b + 0] - d[b - 2]) * h + (d[b + 2] - d[b + 0]) * e)), g
  5173. };
  5174. createjs.MotionGuidePlugin = c
  5175. })();
  5176. this.createjs = this.createjs || {};
  5177. (function () {
  5178. var c = createjs.TweenJS = createjs.TweenJS || {};
  5179. c.version = "0.5.0";
  5180. c.buildDate = "Wed, 25 Sep 2013 17:09:35 GMT"
  5181. })();
  5182. this.createjs = this.createjs || {};
  5183. (function () {
  5184. var c = createjs.SoundJS = createjs.SoundJS || {};
  5185. c.version = "0.5.0";
  5186. c.buildDate = "Wed, 25 Sep 2013 17:09:35 GMT"
  5187. })();
  5188. this.createjs = this.createjs || {};
  5189. (function () {
  5190. var c = function () {},
  5191. a = c.prototype;
  5192. c.initialize = function (b) {
  5193. b.addEventListener = a.addEventListener;
  5194. b.on = a.on;
  5195. b.removeEventListener = b.off = a.removeEventListener;
  5196. b.removeAllEventListeners = a.removeAllEventListeners;
  5197. b.hasEventListener = a.hasEventListener;
  5198. b.dispatchEvent = a.dispatchEvent;
  5199. b._dispatchEvent = a._dispatchEvent
  5200. };
  5201. a._listeners = null;
  5202. a._captureListeners = null;
  5203. a.initialize = function () {};
  5204. a.addEventListener = function (a, c, f) {
  5205. var d;
  5206. d = f ? this._captureListeners = this._captureListeners || {} : this._listeners =
  5207. this._listeners || {};
  5208. var e = d[a];
  5209. return e && this.removeEventListener(a, c, f), e = d[a], e ? e.push(c) : d[a] = [c], c
  5210. };
  5211. a.on = function (a, c, f, d, e, h) {
  5212. return c.handleEvent && (f = f || c, c = c.handleEvent), f = f || this, this.addEventListener(a, function (a) {
  5213. c.call(f, a, e);
  5214. d && a.remove()
  5215. }, h)
  5216. };
  5217. a.removeEventListener = function (a, c, f) {
  5218. if (f = f ? this._captureListeners : this._listeners) {
  5219. var d = f[a];
  5220. if (d)
  5221. for (var e = 0, h = d.length; h > e; e++)
  5222. if (d[e] == c) {
  5223. 1 == h ? delete f[a] : d.splice(e, 1);
  5224. break
  5225. }
  5226. }
  5227. };
  5228. a.off = a.removeEventListener;
  5229. a.removeAllEventListeners = function (a) {
  5230. a ?
  5231. (this._listeners && delete this._listeners[a], this._captureListeners && delete this._captureListeners[a]) : this._listeners = this._captureListeners = null
  5232. };
  5233. a.dispatchEvent = function (a, c) {
  5234. if ("string" == typeof a) {
  5235. var f = this._listeners;
  5236. if (!f || !f[a]) return !1;
  5237. a = new createjs.Event(a)
  5238. }
  5239. if (a.target = c || this, a.bubbles && this.parent) {
  5240. for (var d = this, f = [d]; d.parent;) f.push(d = d.parent);
  5241. for (var e = f.length, d = e - 1; 0 <= d && !a.propagationStopped; d--) f[d]._dispatchEvent(a, 1 + (0 == d));
  5242. for (d = 1; e > d && !a.propagationStopped; d++) f[d]._dispatchEvent(a,
  5243. 3)
  5244. } else this._dispatchEvent(a, 2);
  5245. return a.defaultPrevented
  5246. };
  5247. a.hasEventListener = function (a) {
  5248. var c = this._listeners,
  5249. f = this._captureListeners;
  5250. return !!(c && c[a] || f && f[a])
  5251. };
  5252. a.toString = function () {
  5253. return "[EventDispatcher]"
  5254. };
  5255. a._dispatchEvent = function (a, c) {
  5256. var f, d = 1 == c ? this._captureListeners : this._listeners;
  5257. if (a && d && (d = d[a.type]) && (f = d.length)) {
  5258. a.currentTarget = this;
  5259. a.eventPhase = c;
  5260. a.removed = !1;
  5261. for (var d = d.slice(), e = 0; f > e && !a.immediatePropagationStopped; e++) {
  5262. var h = d[e];
  5263. h.handleEvent ? h.handleEvent(a) : h(a);
  5264. a.removed &&
  5265. (this.off(a.type, h, 1 == c), a.removed = !1)
  5266. }
  5267. }
  5268. };
  5269. createjs.EventDispatcher = c
  5270. })();
  5271. this.createjs = this.createjs || {};
  5272. (function () {
  5273. var c = function (a, c, f) {
  5274. this.initialize(a, c, f)
  5275. },
  5276. a = c.prototype;
  5277. a.type = null;
  5278. a.target = null;
  5279. a.currentTarget = null;
  5280. a.eventPhase = 0;
  5281. a.bubbles = !1;
  5282. a.cancelable = !1;
  5283. a.timeStamp = 0;
  5284. a.defaultPrevented = !1;
  5285. a.propagationStopped = !1;
  5286. a.immediatePropagationStopped = !1;
  5287. a.removed = !1;
  5288. a.initialize = function (a, c, f) {
  5289. this.type = a;
  5290. this.bubbles = c;
  5291. this.cancelable = f;
  5292. this.timeStamp = (new Date)
  5293. .getTime()
  5294. };
  5295. a.preventDefault = function () {
  5296. this.defaultPrevented = !0
  5297. };
  5298. a.stopPropagation = function () {
  5299. this.propagationStopped = !0
  5300. };
  5301. a.stopImmediatePropagation =
  5302. function () {
  5303. this.immediatePropagationStopped = this.propagationStopped = !0
  5304. };
  5305. a.remove = function () {
  5306. this.removed = !0
  5307. };
  5308. a.clone = function () {
  5309. return new c(this.type, this.bubbles, this.cancelable)
  5310. };
  5311. a.toString = function () {
  5312. return "[Event (type=" + this.type + ")]"
  5313. };
  5314. createjs.Event = c
  5315. })();
  5316. this.createjs = this.createjs || {};
  5317. (function () {
  5318. createjs.indexOf = function (c, a) {
  5319. for (var b = 0, g = c.length; g > b; b++)
  5320. if (a === c[b]) return b;
  5321. return -1
  5322. }
  5323. })();
  5324. this.createjs = this.createjs || {};
  5325. (function () {
  5326. createjs.proxy = function (c, a) {
  5327. var b = Array.prototype.slice.call(arguments, 2);
  5328. return function () {
  5329. return c.apply(a, Array.prototype.slice.call(arguments, 0)
  5330. .concat(b))
  5331. }
  5332. }
  5333. })();
  5334. this.createjs = this.createjs || {};
  5335. (function () {
  5336. function c() {
  5337. throw "Sound cannot be instantiated";
  5338. }
  5339. function a(a, b) {
  5340. this.init(a, b)
  5341. }
  5342. function b() {}
  5343. c.DELIMITER = "|";
  5344. c.AUDIO_TIMEOUT = 8E3;
  5345. c.INTERRUPT_ANY = "any";
  5346. c.INTERRUPT_EARLY = "early";
  5347. c.INTERRUPT_LATE = "late";
  5348. c.INTERRUPT_NONE = "none";
  5349. c.PLAY_INITED = "playInited";
  5350. c.PLAY_SUCCEEDED = "playSucceeded";
  5351. c.PLAY_INTERRUPTED = "playInterrupted";
  5352. c.PLAY_FINISHED = "playFinished";
  5353. c.PLAY_FAILED = "playFailed";
  5354. c.SUPPORTED_EXTENSIONS = "mp3 ogg mpeg wav m4a mp4 aiff wma mid".split(" ");
  5355. c.EXTENSION_MAP = {
  5356. m4a: "mp4"
  5357. };
  5358. c.FILE_PATTERN =
  5359. /^(?:(\w+:)\/{2}(\w+(?:\.\w+)*\/?))?([/.]*?(?:[^?]+)?\/)?((?:[^/?]+)\.(\w+))(?:\?(\S+)?)?$/;
  5360. c.defaultInterruptBehavior = c.INTERRUPT_NONE;
  5361. c.lastId = 0;
  5362. c.activePlugin = null;
  5363. c.pluginsRegistered = !1;
  5364. c.masterVolume = 1;
  5365. c.masterMute = !1;
  5366. c.instances = [];
  5367. c.idHash = {};
  5368. c.preloadHash = {};
  5369. c.defaultSoundInstance = null;
  5370. c.addEventListener = null;
  5371. c.removeEventListener = null;
  5372. c.removeAllEventListeners = null;
  5373. c.dispatchEvent = null;
  5374. c.hasEventListener = null;
  5375. c._listeners = null;
  5376. createjs.EventDispatcher.initialize(c);
  5377. c.sendFileLoadEvent = function (a) {
  5378. if (c.preloadHash[a])
  5379. for (var b =
  5380. 0, e = c.preloadHash[a].length; e > b; b++) {
  5381. var g = c.preloadHash[a][b];
  5382. if (c.preloadHash[a][b] = !0, c.hasEventListener("fileload")) {
  5383. var k = new createjs.Event("fileload");
  5384. k.src = g.src;
  5385. k.id = g.id;
  5386. k.data = g.data;
  5387. c.dispatchEvent(k)
  5388. }
  5389. }
  5390. };
  5391. c.getPreloadHandlers = function () {
  5392. return {
  5393. callback: createjs.proxy(c.initLoad, c),
  5394. types: ["sound"],
  5395. extensions: c.SUPPORTED_EXTENSIONS
  5396. }
  5397. };
  5398. c.registerPlugin = function (a) {
  5399. return c.pluginsRegistered = !0, null == a ? !1 : a.isSupported() ? (c.activePlugin = new a, !0) : !1
  5400. };
  5401. c.registerPlugins = function (a) {
  5402. for (var b =
  5403. 0, e = a.length; e > b; b++)
  5404. if (c.registerPlugin(a[b])) return !0;
  5405. return !1
  5406. };
  5407. c.initializeDefaultPlugins = function () {
  5408. return null != c.activePlugin ? !0 : c.pluginsRegistered ? !1 : c.registerPlugins([createjs.WebAudioPlugin, createjs.HTMLAudioPlugin]) ? !0 : !1
  5409. };
  5410. c.isReady = function () {
  5411. return null != c.activePlugin
  5412. };
  5413. c.getCapabilities = function () {
  5414. return null == c.activePlugin ? null : c.activePlugin.capabilities
  5415. };
  5416. c.getCapability = function (a) {
  5417. return null == c.activePlugin ? null : c.activePlugin.capabilities[a]
  5418. };
  5419. c.initLoad = function (a, b, e, g, k) {
  5420. a =
  5421. c.registerSound(a, e, g, !1, k);
  5422. return null == a ? !1 : a
  5423. };
  5424. c.registerSound = function (b, d, e, g, k) {
  5425. if (!c.initializeDefaultPlugins()) return !1;
  5426. b instanceof Object && (k = d, d = b.id, e = b.data, b = b.src);
  5427. var m = c.parsePath(b, "sound", d, e);
  5428. if (null == m) return !1;
  5429. null != d && (c.idHash[d] = m.src);
  5430. var n = null;
  5431. null != e && (isNaN(e.channels) ? isNaN(e) || (n = parseInt(e)) : n = parseInt(e.channels));
  5432. var p = c.activePlugin.register(m.src, n);
  5433. if (null != p && (null != p.numChannels && (n = p.numChannels), a.create(m.src, n), null != e && isNaN(e) ? e.channels = m.data.channels =
  5434. n || a.maxPerChannel() : e = m.data = n || a.maxPerChannel(), null != p.tag ? m.tag = p.tag : p.src && (m.src = p.src), null != p.completeHandler && (m.completeHandler = p.completeHandler), p.type && (m.type = p.type)), 0 != g)
  5435. if (c.preloadHash[m.src] || (c.preloadHash[m.src] = []), c.preloadHash[m.src].push({
  5436. src: b,
  5437. id: d,
  5438. data: e
  5439. }), 1 == c.preloadHash[m.src].length) null == k && (k = ""), c.activePlugin.preload(m.src, p, k);
  5440. else if (1 == c.preloadHash[m.src][0]) return !0;
  5441. return m
  5442. };
  5443. c.registerManifest = function (a, b) {
  5444. for (var c = [], g = 0, k = a.length; k > g; g++) c[g] = createjs.Sound.registerSound(a[g].src,
  5445. a[g].id, a[g].data, a[g].preload, b);
  5446. return c
  5447. };
  5448. c.removeSound = function (b) {
  5449. if (null == c.activePlugin) return !1;
  5450. b instanceof Object && (b = b.src);
  5451. b = c.getSrcById(b);
  5452. b = c.parsePath(b);
  5453. if (null == b) return !1;
  5454. b = b.src;
  5455. for (var d in c.idHash) c.idHash[d] == b && delete c.idHash[d];
  5456. return a.removeSrc(b), delete c.preloadHash[b], c.activePlugin.removeSound(b), !0
  5457. };
  5458. c.removeManifest = function (a) {
  5459. for (var b = [], c = 0, g = a.length; g > c; c++) b[c] = createjs.Sound.removeSound(a[c].src);
  5460. return b
  5461. };
  5462. c.removeAllSounds = function () {
  5463. c.idHash = {};
  5464. c.preloadHash = {};
  5465. a.removeAll();
  5466. c.activePlugin.removeAllSounds()
  5467. };
  5468. c.loadComplete = function (a) {
  5469. var b = c.parsePath(a, "sound");
  5470. return a = b ? c.getSrcById(b.src) : c.getSrcById(a), 1 == c.preloadHash[a][0]
  5471. };
  5472. c.parsePath = function (a, b, e, g) {
  5473. "string" != typeof a && (a = a.toString());
  5474. a = a.split(c.DELIMITER);
  5475. b = {
  5476. type: b || "sound",
  5477. id: e,
  5478. data: g
  5479. };
  5480. e = c.getCapabilities();
  5481. g = 0;
  5482. for (var k = a.length; k > g; g++) {
  5483. var m = a[g],
  5484. n = m.match(c.FILE_PATTERN);
  5485. if (null == n) return !1;
  5486. var p = n[4],
  5487. n = n[5];
  5488. if (e[n] && -1 < createjs.indexOf(c.SUPPORTED_EXTENSIONS, n)) return b.name = p, b.src =
  5489. m, b.extension = n, b
  5490. }
  5491. return null
  5492. };
  5493. c.play = function (a, b, e, g, k, m, n) {
  5494. a = c.createInstance(a);
  5495. return c.playInstance(a, b, e, g, k, m, n) || a.playFailed(), a
  5496. };
  5497. c.createInstance = function (b) {
  5498. if (!c.initializeDefaultPlugins()) return c.defaultSoundInstance;
  5499. b = c.getSrcById(b);
  5500. b = c.parsePath(b, "sound");
  5501. var d = null;
  5502. return null != b && null != b.src ? (a.create(b.src), d = c.activePlugin.create(b.src)) : d = c.defaultSoundInstance, d.uniqueId = c.lastId++, d
  5503. };
  5504. c.setVolume = function (a) {
  5505. if (null == Number(a)) return !1;
  5506. if (a = Math.max(0, Math.min(1, a)), c.masterVolume =
  5507. a, !this.activePlugin || !this.activePlugin.setVolume || !this.activePlugin.setVolume(a))
  5508. for (var b = this.instances, e = 0, g = b.length; g > e; e++) b[e].setMasterVolume(a)
  5509. };
  5510. c.getVolume = function () {
  5511. return c.masterVolume
  5512. };
  5513. c.setMute = function (a) {
  5514. if (null == a || void 0 == a) return !1;
  5515. if (this.masterMute = a, !this.activePlugin || !this.activePlugin.setMute || !this.activePlugin.setMute(a))
  5516. for (var b = this.instances, c = 0, g = b.length; g > c; c++) b[c].setMasterMute(a);
  5517. return !0
  5518. };
  5519. c.getMute = function () {
  5520. return this.masterMute
  5521. };
  5522. c.stop = function () {
  5523. for (var a =
  5524. this.instances, b = a.length; b--;) a[b].stop()
  5525. };
  5526. c.playInstance = function (a, b, e, g, k, m, n) {
  5527. if (b instanceof Object && (e = b.delay, g = b.offset, k = b.loop, m = b.volume, n = b.pan), b = b || c.defaultInterruptBehavior, null == e && (e = 0), null == g && (g = a.getPosition()), null == k && (k = 0), null == m && (m = a.volume), null == n && (n = a.pan), 0 == e) {
  5528. if (!c.beginPlaying(a, b, g, k, m, n)) return !1
  5529. } else e = setTimeout(function () {
  5530. c.beginPlaying(a, b, g, k, m, n)
  5531. }, e), a.delayTimeoutId = e;
  5532. return this.instances.push(a), !0
  5533. };
  5534. c.beginPlaying = function (b, c, e, g, k, m) {
  5535. return a.add(b,
  5536. c) ? b.beginPlaying(e, g, k, m) ? !0 : (b = createjs.indexOf(this.instances, b), -1 < b && this.instances.splice(b, 1), !1) : !1
  5537. };
  5538. c.getSrcById = function (a) {
  5539. return null == c.idHash || null == c.idHash[a] ? a : c.idHash[a]
  5540. };
  5541. c.playFinished = function (b) {
  5542. a.remove(b);
  5543. b = createjs.indexOf(this.instances, b); - 1 < b && this.instances.splice(b, 1)
  5544. };
  5545. createjs.Sound = c;
  5546. a.channels = {};
  5547. a.create = function (b, c) {
  5548. return null == a.get(b) ? (a.channels[b] = new a(b, c), !0) : !1
  5549. };
  5550. a.removeSrc = function (b) {
  5551. var c = a.get(b);
  5552. return null == c ? !1 : (c.removeAll(), delete a.channels[b], !0)
  5553. };
  5554. a.removeAll = function () {
  5555. for (var b in a.channels) a.channels[b].removeAll();
  5556. a.channels = {}
  5557. };
  5558. a.add = function (b, c) {
  5559. var e = a.get(b.src);
  5560. return null == e ? !1 : e.add(b, c)
  5561. };
  5562. a.remove = function (b) {
  5563. var c = a.get(b.src);
  5564. return null == c ? !1 : (c.remove(b), !0)
  5565. };
  5566. a.maxPerChannel = function () {
  5567. return g.maxDefault
  5568. };
  5569. a.get = function (b) {
  5570. return a.channels[b]
  5571. };
  5572. var g = a.prototype;
  5573. g.src = null;
  5574. g.max = null;
  5575. g.maxDefault = 100;
  5576. g.length = 0;
  5577. g.init = function (a, b) {
  5578. this.src = a;
  5579. this.max = b || this.maxDefault; - 1 == this.max && this.max == this.maxDefault;
  5580. this.instances = []
  5581. };
  5582. g.get = function (a) {
  5583. return this.instances[a]
  5584. };
  5585. g.add = function (a, b) {
  5586. return this.getSlot(b, a) ? (this.instances.push(a), this.length++, !0) : !1
  5587. };
  5588. g.remove = function (a) {
  5589. a = createjs.indexOf(this.instances, a);
  5590. return -1 == a ? !1 : (this.instances.splice(a, 1), this.length--, !0)
  5591. };
  5592. g.removeAll = function () {
  5593. for (var a = this.length - 1; 0 <= a; a--) this.instances[a].stop()
  5594. };
  5595. g.getSlot = function (a) {
  5596. for (var b, e, g = 0, k = this.max; k > g; g++) {
  5597. if (b = this.get(g), null == b) return !0;
  5598. (a != c.INTERRUPT_NONE || b.playState == c.PLAY_FINISHED) && (0 != g ? b.playState ==
  5599. c.PLAY_FINISHED || b.playState == c.PLAY_INTERRUPTED || b.playState == c.PLAY_FAILED ? e = b : (a == c.INTERRUPT_EARLY && b.getPosition() < e.getPosition() || a == c.INTERRUPT_LATE && b.getPosition() > e.getPosition()) && (e = b) : e = b)
  5600. }
  5601. return null != e ? (e.interrupt(), this.remove(e), !0) : !1
  5602. };
  5603. g.toString = function () {
  5604. return "[Sound SoundChannel]"
  5605. };
  5606. c.defaultSoundInstance = new function () {
  5607. this.isDefault = !0;
  5608. this.addEventListener = this.removeEventListener = this.removeAllEventListener = this.dispatchEvent = this.hasEventListener = this._listeners = this.interrupt =
  5609. this.playFailed = this.pause = this.resume = this.play = this.beginPlaying = this.cleanUp = this.stop = this.setMasterVolume = this.setVolume = this.mute = this.setMute = this.getMute = this.setPan = this.getPosition = this.setPosition = function () {
  5610. return !1
  5611. };
  5612. this.getVolume = this.getPan = this.getDuration = function () {
  5613. return 0
  5614. };
  5615. this.playState = c.PLAY_FAILED;
  5616. this.toString = function () {
  5617. return "[Sound Default Sound Instance]"
  5618. }
  5619. };
  5620. null == createjs.proxy && (createjs.proxy = function () {
  5621. throw "Proxy has been moved to an external file, and must be included separately.";
  5622. });
  5623. b.init = function () {
  5624. var a = window.navigator.userAgent;
  5625. b.isFirefox = -1 < a.indexOf("Firefox");
  5626. b.isOpera = null != window.opera;
  5627. b.isChrome = -1 < a.indexOf("Chrome");
  5628. b.isIOS = -1 < a.indexOf("iPod") || -1 < a.indexOf("iPhone") || -1 < a.indexOf("iPad");
  5629. b.isAndroid = -1 < a.indexOf("Android");
  5630. b.isBlackberry = -1 < a.indexOf("Blackberry")
  5631. };
  5632. b.init();
  5633. createjs.Sound.BrowserDetect = b
  5634. })();
  5635. this.createjs = this.createjs || {};
  5636. (function () {
  5637. function c() {
  5638. this.init()
  5639. }
  5640. c.capabilities = null;
  5641. c.isSupported = function () {
  5642. var a = createjs.Sound.BrowserDetect.isIOS || createjs.Sound.BrowserDetect.isAndroid || createjs.Sound.BrowserDetect.isBlackberry;
  5643. return "file:" != location.protocol || a || this.isFileXHRSupported() ? (c.generateCapabilities(), null == c.context ? !1 : !0) : !1
  5644. };
  5645. c.isFileXHRSupported = function () {
  5646. var a = !0,
  5647. c = new XMLHttpRequest;
  5648. try {
  5649. c.open("GET", "fail.fail", !1)
  5650. } catch (f) {
  5651. return a = !1
  5652. }
  5653. c.onerror = function () {
  5654. a = !1
  5655. };
  5656. c.onload = function () {
  5657. a = 404 == this.status ||
  5658. 200 == this.status || 0 == this.status && "" != this.response
  5659. };
  5660. try {
  5661. c.send()
  5662. } catch (d) {
  5663. a = !1
  5664. }
  5665. return a
  5666. };
  5667. c.generateCapabilities = function () {
  5668. if (null == c.capabilities) {
  5669. var a = document.createElement("audio");
  5670. if (null == a.canPlayType) return null;
  5671. if (window.webkitAudioContext) c.context = new webkitAudioContext;
  5672. else {
  5673. if (!window.AudioContext) return null;
  5674. c.context = new AudioContext
  5675. }
  5676. c.compatibilitySetUp();
  5677. c.playEmptySound();
  5678. c.capabilities = {
  5679. panning: !0,
  5680. volume: !0,
  5681. tracks: -1
  5682. };
  5683. for (var g = createjs.Sound.SUPPORTED_EXTENSIONS, f = createjs.Sound.EXTENSION_MAP,
  5684. d = 0, e = g.length; e > d; d++) {
  5685. var h = g[d],
  5686. k = f[h] || h;
  5687. c.capabilities[h] = "no" != a.canPlayType("audio/" + h) && "" != a.canPlayType("audio/" + h) || "no" != a.canPlayType("audio/" + k) && "" != a.canPlayType("audio/" + k)
  5688. }
  5689. 2 > c.context.destination.numberOfChannels && (c.capabilities.panning = !1);
  5690. c.dynamicsCompressorNode = c.context.createDynamicsCompressor();
  5691. c.dynamicsCompressorNode.connect(c.context.destination);
  5692. c.gainNode = c.context.createGain();
  5693. c.gainNode.connect(c.dynamicsCompressorNode)
  5694. }
  5695. };
  5696. c.compatibilitySetUp = function () {
  5697. if (!c.context.createGain) {
  5698. c.context.createGain =
  5699. c.context.createGainNode;
  5700. var a = c.context.createBufferSource();
  5701. a.__proto__.start = a.__proto__.noteGrainOn;
  5702. a.__proto__.stop = a.__proto__.noteOff;
  5703. this.panningModel = 0
  5704. }
  5705. };
  5706. c.playEmptySound = function () {
  5707. var a = this.context.createBuffer(1, 1, 22050),
  5708. c = this.context.createBufferSource();
  5709. c.buffer = a;
  5710. c.connect(this.context.destination);
  5711. c.start(0, 0, 0)
  5712. };
  5713. var a = c.prototype;
  5714. a.capabilities = null;
  5715. a.volume = 1;
  5716. a.context = null;
  5717. a.panningModel = "equalpower";
  5718. a.dynamicsCompressorNode = null;
  5719. a.gainNode = null;
  5720. a.arrayBuffers = null;
  5721. a.init = function () {
  5722. this.capabilities =
  5723. c.capabilities;
  5724. this.arrayBuffers = {};
  5725. this.context = c.context;
  5726. this.gainNode = c.gainNode;
  5727. this.dynamicsCompressorNode = c.dynamicsCompressorNode
  5728. };
  5729. a.register = function (a) {
  5730. this.arrayBuffers[a] = !0;
  5731. return {
  5732. tag: new createjs.WebAudioPlugin.Loader(a, this)
  5733. }
  5734. };
  5735. a.isPreloadStarted = function (a) {
  5736. return null != this.arrayBuffers[a]
  5737. };
  5738. a.isPreloadComplete = function (a) {
  5739. return !(null == this.arrayBuffers[a] || 1 == this.arrayBuffers[a])
  5740. };
  5741. a.removeFromPreload = function (a) {
  5742. delete this.arrayBuffers[a]
  5743. };
  5744. a.removeSound = function (a) {
  5745. delete this.arrayBuffers[a]
  5746. };
  5747. a.removeAllSounds = function () {
  5748. this.arrayBuffers = {}
  5749. };
  5750. a.addPreloadResults = function (a, c) {
  5751. this.arrayBuffers[a] = c
  5752. };
  5753. a.handlePreloadComplete = function () {
  5754. createjs.Sound.sendFileLoadEvent(this.src)
  5755. };
  5756. a.preload = function (a, c, f) {
  5757. this.arrayBuffers[a] = !0;
  5758. a = new createjs.WebAudioPlugin.Loader(a, this);
  5759. a.onload = this.handlePreloadComplete;
  5760. null != f && (a.src = f + a.src);
  5761. a.load()
  5762. };
  5763. a.create = function (a) {
  5764. return this.isPreloadStarted(a) || this.preload(a), new createjs.WebAudioPlugin.SoundInstance(a, this)
  5765. };
  5766. a.setVolume = function (a) {
  5767. return this.volume =
  5768. a, this.updateVolume(), !0
  5769. };
  5770. a.updateVolume = function () {
  5771. var a = createjs.Sound.masterMute ? 0 : this.volume;
  5772. a != this.gainNode.gain.value && (this.gainNode.gain.value = a)
  5773. };
  5774. a.getVolume = function () {
  5775. return this.volume
  5776. };
  5777. a.setMute = function () {
  5778. return this.updateVolume(), !0
  5779. };
  5780. a.toString = function () {
  5781. return "[WebAudioPlugin]"
  5782. };
  5783. createjs.WebAudioPlugin = c
  5784. })();
  5785. (function () {
  5786. function c(a, c) {
  5787. this.init(a, c)
  5788. }
  5789. var a = c.prototype;
  5790. a.src = null;
  5791. a.uniqueId = -1;
  5792. a.playState = null;
  5793. a.owner = null;
  5794. a.offset = 0;
  5795. a.delay = 0;
  5796. a._volume = 1;
  5797. Object.defineProperty(a, "volume", {
  5798. get: function () {
  5799. return this._volume
  5800. },
  5801. set: function (a) {
  5802. return null == Number(a) ? !1 : (a = Math.max(0, Math.min(1, a)), this._volume = a, this.updateVolume(), void 0)
  5803. }
  5804. });
  5805. a._pan = 0;
  5806. Object.defineProperty(a, "pan", {
  5807. get: function () {
  5808. return this._pan
  5809. },
  5810. set: function (a) {
  5811. return this.owner.capabilities.panning && null != Number(a) ? (a = Math.max(-1, Math.min(1,
  5812. a)), this._pan = a, this.panNode.setPosition(a, 0, -0.5), void 0) : !1
  5813. }
  5814. });
  5815. a.duration = 0;
  5816. a.remainingLoops = 0;
  5817. a.delayTimeoutId = null;
  5818. a.soundCompleteTimeout = null;
  5819. a.panNode = null;
  5820. a.gainNode = null;
  5821. a.sourceNode = null;
  5822. a.sourceNodeNext = null;
  5823. a.muted = !1;
  5824. a.paused = !1;
  5825. a.startTime = 0;
  5826. a.addEventListener = null;
  5827. a.removeEventListener = null;
  5828. a.removeAllEventListeners = null;
  5829. a.dispatchEvent = null;
  5830. a.hasEventListener = null;
  5831. a._listeners = null;
  5832. a.endedHandler = null;
  5833. a.readyHandler = null;
  5834. a.stalledHandler = null;
  5835. a.sendEvent = function (a) {
  5836. a = new createjs.Event(a);
  5837. this.dispatchEvent(a)
  5838. };
  5839. a.init = function (a, c) {
  5840. this.owner = c;
  5841. this.src = a;
  5842. this.panNode = this.owner.context.createPanner();
  5843. this.panNode.panningModel = this.owner.panningModel;
  5844. this.gainNode = this.owner.context.createGain();
  5845. this.gainNode.connect(this.panNode);
  5846. this.owner.isPreloadComplete(this.src) && (this.duration = 1E3 * this.owner.arrayBuffers[this.src].duration);
  5847. this.endedHandler = createjs.proxy(this.handleSoundComplete, this);
  5848. this.readyHandler = createjs.proxy(this.handleSoundReady, this);
  5849. this.stalledHandler = createjs.proxy(this.handleSoundStalled,
  5850. this)
  5851. };
  5852. a.cleanUp = function () {
  5853. this.sourceNode && this.sourceNode.playbackState != this.sourceNode.UNSCHEDULED_STATE && (this.sourceNode = this.cleanUpAudioNode(this.sourceNode), this.sourceNodeNext = this.cleanUpAudioNode(this.sourceNodeNext));
  5854. 0 != this.panNode.numberOfOutputs && this.panNode.disconnect(0);
  5855. clearTimeout(this.delayTimeoutId);
  5856. clearTimeout(this.soundCompleteTimeout);
  5857. this.startTime = 0;
  5858. null != window.createjs && createjs.Sound.playFinished(this)
  5859. };
  5860. a.cleanUpAudioNode = function (a) {
  5861. return a && (a.stop(0), a.disconnect(this.gainNode),
  5862. a = null), a
  5863. };
  5864. a.interrupt = function () {
  5865. this.playState = createjs.Sound.PLAY_INTERRUPTED;
  5866. this.cleanUp();
  5867. this.paused = !1;
  5868. this.sendEvent("interrupted")
  5869. };
  5870. a.handleSoundStalled = function () {
  5871. this.sendEvent("failed")
  5872. };
  5873. a.handleSoundReady = function () {
  5874. if (null != window.createjs) {
  5875. if (1E3 * this.offset > this.getDuration()) return this.playFailed(), void 0;
  5876. 0 > this.offset && (this.offset = 0);
  5877. this.playState = createjs.Sound.PLAY_SUCCEEDED;
  5878. this.paused = !1;
  5879. this.panNode.connect(this.owner.gainNode);
  5880. var a = this.owner.arrayBuffers[this.src].duration;
  5881. this.sourceNode = this.createAndPlayAudioNode(this.owner.context.currentTime - a, this.offset);
  5882. this.duration = 1E3 * a;
  5883. this.startTime = this.sourceNode.startTime - this.offset;
  5884. this.soundCompleteTimeout = setTimeout(this.endedHandler, 1E3 * (a - this.offset));
  5885. 0 != this.remainingLoops && (this.sourceNodeNext = this.createAndPlayAudioNode(this.startTime, 0))
  5886. }
  5887. };
  5888. a.createAndPlayAudioNode = function (a, c) {
  5889. var f = this.owner.context.createBufferSource();
  5890. return f.buffer = this.owner.arrayBuffers[this.src], f.connect(this.gainNode), this.owner.context.currentTime,
  5891. f.startTime = a + f.buffer.duration, f.start(f.startTime, c, f.buffer.duration - c), f
  5892. };
  5893. a.play = function (a, c, f, d, e, h) {
  5894. this.cleanUp();
  5895. createjs.Sound.playInstance(this, a, c, f, d, e, h)
  5896. };
  5897. a.beginPlaying = function (a, c, f, d) {
  5898. return null != window.createjs && this.src ? (this.offset = a / 1E3, this.remainingLoops = c, this.volume = f, this.pan = d, this.owner.isPreloadComplete(this.src) ? (this.handleSoundReady(null), this.sendEvent("succeeded"), 1) : (this.playFailed(), void 0)) : void 0
  5899. };
  5900. a.pause = function () {
  5901. return this.paused || this.playState != createjs.Sound.PLAY_SUCCEEDED ?
  5902. !1 : (this.paused = !0, this.offset = this.owner.context.currentTime - this.startTime, this.cleanUpAudioNode(this.sourceNode), this.cleanUpAudioNode(this.sourceNodeNext), 0 != this.panNode.numberOfOutputs && this.panNode.disconnect(), clearTimeout(this.delayTimeoutId), clearTimeout(this.soundCompleteTimeout), !0)
  5903. };
  5904. a.resume = function () {
  5905. return this.paused ? (this.handleSoundReady(null), !0) : !1
  5906. };
  5907. a.stop = function () {
  5908. return this.playState = createjs.Sound.PLAY_FINISHED, this.cleanUp(), this.offset = 0, !0
  5909. };
  5910. a.setVolume = function (a) {
  5911. return this.volume =
  5912. a, !0
  5913. };
  5914. a.updateVolume = function () {
  5915. var a = this.muted ? 0 : this._volume;
  5916. return a != this.gainNode.gain.value ? (this.gainNode.gain.value = a, !0) : !1
  5917. };
  5918. a.getVolume = function () {
  5919. return this.volume
  5920. };
  5921. a.setMute = function (a) {
  5922. return null == a || void 0 == a ? !1 : (this.muted = a, this.updateVolume(), !0)
  5923. };
  5924. a.getMute = function () {
  5925. return this.muted
  5926. };
  5927. a.setPan = function (a) {
  5928. return this.pan = a, this.pan != a ? !1 : void 0
  5929. };
  5930. a.getPan = function () {
  5931. return this.pan
  5932. };
  5933. a.getPosition = function () {
  5934. return 1E3 * (this.paused || null == this.sourceNode ? this.offset : this.owner.context.currentTime -
  5935. this.startTime)
  5936. };
  5937. a.setPosition = function (a) {
  5938. return this.offset = a / 1E3, this.sourceNode && this.sourceNode.playbackState != this.sourceNode.UNSCHEDULED_STATE && (this.cleanUpAudioNode(this.sourceNode), this.cleanUpAudioNode(this.sourceNodeNext), clearTimeout(this.soundCompleteTimeout)), this.paused || this.playState != createjs.Sound.PLAY_SUCCEEDED || this.handleSoundReady(null), !0
  5939. };
  5940. a.getDuration = function () {
  5941. return this.duration
  5942. };
  5943. a.handleSoundComplete = function () {
  5944. return this.offset = 0, 0 != this.remainingLoops ? (this.remainingLoops--,
  5945. this.sourceNodeNext ? (this.cleanUpAudioNode(this.sourceNode), this.sourceNode = this.sourceNodeNext, this.startTime = this.sourceNode.startTime, this.sourceNodeNext = this.createAndPlayAudioNode(this.startTime, 0), this.soundCompleteTimeout = setTimeout(this.endedHandler, this.duration)) : this.handleSoundReady(null), this.sendEvent("loop"), void 0) : (null != window.createjs && (this.playState = createjs.Sound.PLAY_FINISHED, this.cleanUp(), this.sendEvent("complete")), void 0)
  5946. };
  5947. a.playFailed = function () {
  5948. null != window.createjs &&
  5949. (this.playState = createjs.Sound.PLAY_FAILED, this.cleanUp(), this.sendEvent("failed"))
  5950. };
  5951. a.toString = function () {
  5952. return "[WebAudioPlugin SoundInstance]"
  5953. };
  5954. createjs.EventDispatcher.initialize(c.prototype);
  5955. createjs.WebAudioPlugin.SoundInstance = c
  5956. })();
  5957. (function () {
  5958. function c(a, c) {
  5959. this.init(a, c)
  5960. }
  5961. var a = c.prototype;
  5962. a.request = null;
  5963. a.owner = null;
  5964. a.progress = -1;
  5965. a.src = null;
  5966. a.originalSrc = null;
  5967. a.result = null;
  5968. a.onload = null;
  5969. a.onprogress = null;
  5970. a.onError = null;
  5971. a.init = function (a, c) {
  5972. this.originalSrc = this.src = a;
  5973. this.owner = c
  5974. };
  5975. a.load = function (a) {
  5976. null != a && (this.src = a);
  5977. this.request = new XMLHttpRequest;
  5978. this.request.open("GET", this.src, !0);
  5979. this.request.responseType = "arraybuffer";
  5980. this.request.onload = createjs.proxy(this.handleLoad, this);
  5981. this.request.onError = createjs.proxy(this.handleError,
  5982. this);
  5983. this.request.onprogress = createjs.proxy(this.handleProgress, this);
  5984. this.request.send()
  5985. };
  5986. a.handleProgress = function (a, c) {
  5987. this.progress = a / c;
  5988. null != this.onprogress && this.onprogress({
  5989. loaded: a,
  5990. total: c,
  5991. progress: this.progress
  5992. })
  5993. };
  5994. a.handleLoad = function () {
  5995. this.owner.context.decodeAudioData(this.request.response, createjs.proxy(this.handleAudioDecoded, this), createjs.proxy(this.handleError, this))
  5996. };
  5997. a.handleAudioDecoded = function (a) {
  5998. this.progress = 1;
  5999. this.result = a;
  6000. this.src = this.originalSrc;
  6001. this.owner.addPreloadResults(this.src,
  6002. this.result);
  6003. this.onload && this.onload()
  6004. };
  6005. a.handleError = function (a) {
  6006. this.owner.removeSound(this.src);
  6007. this.onerror && this.onerror(a)
  6008. };
  6009. a.toString = function () {
  6010. return "[WebAudioPlugin Loader]"
  6011. };
  6012. createjs.WebAudioPlugin.Loader = c
  6013. })();
  6014. this.createjs = this.createjs || {};
  6015. (function () {
  6016. function c() {
  6017. this.init()
  6018. }
  6019. c.MAX_INSTANCES = 30;
  6020. c.capabilities = null;
  6021. c.AUDIO_READY = "canplaythrough";
  6022. c.AUDIO_ENDED = "ended";
  6023. c.AUDIO_SEEKED = "seeked";
  6024. c.AUDIO_ERROR = "error";
  6025. c.AUDIO_STALLED = "stalled";
  6026. c.enableIOS = !1;
  6027. c.isSupported = function () {
  6028. if (createjs.Sound.BrowserDetect.isIOS && !c.enableIOS) return !1;
  6029. c.generateCapabilities();
  6030. return null == c.tag || null == c.capabilities ? !1 : !0
  6031. };
  6032. c.generateCapabilities = function () {
  6033. if (null == c.capabilities) {
  6034. var a = c.tag = document.createElement("audio");
  6035. if (null == a.canPlayType) return null;
  6036. c.capabilities = {
  6037. panning: !0,
  6038. volume: !0,
  6039. tracks: -1
  6040. };
  6041. for (var g = createjs.Sound.SUPPORTED_EXTENSIONS, f = createjs.Sound.EXTENSION_MAP, d = 0, e = g.length; e > d; d++) {
  6042. var h = g[d],
  6043. k = f[h] || h;
  6044. c.capabilities[h] = "no" != a.canPlayType("audio/" + h) && "" != a.canPlayType("audio/" + h) || "no" != a.canPlayType("audio/" + k) && "" != a.canPlayType("audio/" + k)
  6045. }
  6046. }
  6047. };
  6048. var a = c.prototype;
  6049. a.capabilities = null;
  6050. a.audioSources = null;
  6051. a.defaultNumChannels = 2;
  6052. a.loadedHandler = null;
  6053. a.init = function () {
  6054. this.capabilities = c.capabilities;
  6055. this.audioSources = {}
  6056. };
  6057. a.register =
  6058. function (a, c) {
  6059. this.audioSources[a] = !0;
  6060. for (var f = createjs.HTMLAudioPlugin.TagPool.get(a), d = null, e = c || this.defaultNumChannels, h = 0; e > h; h++) d = this.createTag(a), f.add(d);
  6061. if (d.id = a, this.loadedHandler = createjs.proxy(this.handleTagLoad, this), d.addEventListener && d.addEventListener("canplaythrough", this.loadedHandler), null == d.onreadystatechange) d.onreadystatechange = this.loadedHandler;
  6062. else {
  6063. var k = d.onreadystatechange;
  6064. d.onreadystatechange = function () {
  6065. k();
  6066. this.loadedHandler()
  6067. }
  6068. }
  6069. return {
  6070. tag: d,
  6071. numChannels: e
  6072. }
  6073. };
  6074. a.handleTagLoad =
  6075. function (a) {
  6076. a.target.removeEventListener && a.target.removeEventListener("canplaythrough", this.loadedHandler);
  6077. a.target.onreadystatechange = null;
  6078. a.target.src != a.target.id && createjs.HTMLAudioPlugin.TagPool.checkSrc(a.target.id)
  6079. };
  6080. a.createTag = function (a) {
  6081. var c = document.createElement("audio");
  6082. return c.autoplay = !1, c.preload = "none", c.src = a, c
  6083. };
  6084. a.removeSound = function (a) {
  6085. delete this.audioSources[a];
  6086. createjs.HTMLAudioPlugin.TagPool.remove(a)
  6087. };
  6088. a.removeAllSounds = function () {
  6089. this.audioSources = {};
  6090. createjs.HTMLAudioPlugin.TagPool.removeAll()
  6091. };
  6092. a.create = function (a) {
  6093. if (!this.isPreloadStarted(a)) {
  6094. var c = createjs.HTMLAudioPlugin.TagPool.get(a),
  6095. f = this.createTag(a);
  6096. f.id = a;
  6097. c.add(f);
  6098. this.preload(a, {
  6099. tag: f
  6100. })
  6101. }
  6102. return new createjs.HTMLAudioPlugin.SoundInstance(a, this)
  6103. };
  6104. a.isPreloadStarted = function (a) {
  6105. return null != this.audioSources[a]
  6106. };
  6107. a.preload = function (a, c, f) {
  6108. this.audioSources[a] = !0;
  6109. null != f && (c.tag.src = f + a);
  6110. new createjs.HTMLAudioPlugin.Loader(a, c.tag)
  6111. };
  6112. a.toString = function () {
  6113. return "[HTMLAudioPlugin]"
  6114. };
  6115. createjs.HTMLAudioPlugin = c
  6116. })();
  6117. (function () {
  6118. function c(a, c) {
  6119. this.init(a, c)
  6120. }
  6121. var a = c.prototype;
  6122. a.src = null;
  6123. a.uniqueId = -1;
  6124. a.playState = null;
  6125. a.owner = null;
  6126. a.loaded = !1;
  6127. a.offset = 0;
  6128. a.delay = 0;
  6129. a._volume = 1;
  6130. Object.defineProperty(a, "volume", {
  6131. get: function () {
  6132. return this._volume
  6133. },
  6134. set: function (a) {
  6135. null != Number(a) && (a = Math.max(0, Math.min(1, a)), this._volume = a, this.updateVolume())
  6136. }
  6137. });
  6138. a.pan = 0;
  6139. a.duration = 0;
  6140. a.remainingLoops = 0;
  6141. a.delayTimeoutId = null;
  6142. a.tag = null;
  6143. a.muted = !1;
  6144. a.paused = !1;
  6145. a.addEventListener = null;
  6146. a.removeEventListener = null;
  6147. a.removeAllEventListeners =
  6148. null;
  6149. a.dispatchEvent = null;
  6150. a.hasEventListener = null;
  6151. a._listeners = null;
  6152. a.endedHandler = null;
  6153. a.readyHandler = null;
  6154. a.stalledHandler = null;
  6155. a.loopHandler = null;
  6156. a.init = function (a, c) {
  6157. this.src = a;
  6158. this.owner = c;
  6159. this.endedHandler = createjs.proxy(this.handleSoundComplete, this);
  6160. this.readyHandler = createjs.proxy(this.handleSoundReady, this);
  6161. this.stalledHandler = createjs.proxy(this.handleSoundStalled, this);
  6162. this.loopHandler = createjs.proxy(this.handleSoundLoop, this)
  6163. };
  6164. a.sendEvent = function (a) {
  6165. a = new createjs.Event(a);
  6166. this.dispatchEvent(a)
  6167. };
  6168. a.cleanUp = function () {
  6169. var a = this.tag;
  6170. if (null != a) {
  6171. a.pause();
  6172. a.removeEventListener(createjs.HTMLAudioPlugin.AUDIO_ENDED, this.endedHandler, !1);
  6173. a.removeEventListener(createjs.HTMLAudioPlugin.AUDIO_READY, this.readyHandler, !1);
  6174. a.removeEventListener(createjs.HTMLAudioPlugin.AUDIO_SEEKED, this.loopHandler, !1);
  6175. try {
  6176. a.currentTime = 0
  6177. } catch (c) {}
  6178. createjs.HTMLAudioPlugin.TagPool.setInstance(this.src, a);
  6179. this.tag = null
  6180. }
  6181. clearTimeout(this.delayTimeoutId);
  6182. null != window.createjs && createjs.Sound.playFinished(this)
  6183. };
  6184. a.interrupt =
  6185. function () {
  6186. null != this.tag && (this.playState = createjs.Sound.PLAY_INTERRUPTED, this.cleanUp(), this.paused = !1, this.sendEvent("interrupted"))
  6187. };
  6188. a.play = function (a, c, f, d, e, h) {
  6189. this.cleanUp();
  6190. createjs.Sound.playInstance(this, a, c, f, d, e, h)
  6191. };
  6192. a.beginPlaying = function (a, c, f, d) {
  6193. if (null == window.createjs) return -1;
  6194. var e = this.tag = createjs.HTMLAudioPlugin.TagPool.getInstance(this.src);
  6195. return null == e ? (this.playFailed(), -1) : (e.addEventListener(createjs.HTMLAudioPlugin.AUDIO_ENDED, this.endedHandler, !1), this.offset = a, this.volume =
  6196. f, this.pan = d, this.updateVolume(), this.remainingLoops = c, 4 !== e.readyState ? (e.addEventListener(createjs.HTMLAudioPlugin.AUDIO_READY, this.readyHandler, !1), e.addEventListener(createjs.HTMLAudioPlugin.AUDIO_STALLED, this.stalledHandler, !1), e.preload = "auto", e.load()) : this.handleSoundReady(null), this.sendEvent("succeeded"), 1)
  6197. };
  6198. a.handleSoundStalled = function () {
  6199. this.cleanUp();
  6200. this.sendEvent("failed")
  6201. };
  6202. a.handleSoundReady = function () {
  6203. if (null != window.createjs) {
  6204. if (this.duration = 1E3 * this.tag.duration, this.playState =
  6205. createjs.Sound.PLAY_SUCCEEDED, this.paused = !1, this.tag.removeEventListener(createjs.HTMLAudioPlugin.AUDIO_READY, this.readyHandler, !1), this.offset >= this.getDuration()) return this.playFailed(), void 0;
  6206. 0 < this.offset && (this.tag.currentTime = 0.0010 * this.offset); - 1 == this.remainingLoops && (this.tag.loop = !0);
  6207. 0 != this.remainingLoops && (this.tag.addEventListener(createjs.HTMLAudioPlugin.AUDIO_SEEKED, this.loopHandler, !1), this.tag.loop = !0);
  6208. this.tag.play()
  6209. }
  6210. };
  6211. a.pause = function () {
  6212. return this.paused || this.playState != createjs.Sound.PLAY_SUCCEEDED ||
  6213. null == this.tag ? !1 : (this.paused = !0, this.tag.pause(), clearTimeout(this.delayTimeoutId), !0)
  6214. };
  6215. a.resume = function () {
  6216. return this.paused && null != this.tag ? (this.paused = !1, this.tag.play(), !0) : !1
  6217. };
  6218. a.stop = function () {
  6219. return this.offset = 0, this.pause(), this.playState = createjs.Sound.PLAY_FINISHED, this.cleanUp(), !0
  6220. };
  6221. a.setMasterVolume = function () {
  6222. return this.updateVolume(), !0
  6223. };
  6224. a.setVolume = function (a) {
  6225. return this.volume = a, !0
  6226. };
  6227. a.updateVolume = function () {
  6228. if (null != this.tag) {
  6229. var a = this.muted || createjs.Sound.masterMute ? 0 : this._volume *
  6230. createjs.Sound.masterVolume;
  6231. return a != this.tag.volume && (this.tag.volume = a), !0
  6232. }
  6233. return !1
  6234. };
  6235. a.getVolume = function () {
  6236. return this.volume
  6237. };
  6238. a.setMasterMute = function () {
  6239. return this.updateVolume(), !0
  6240. };
  6241. a.setMute = function (a) {
  6242. return null == a || void 0 == a ? !1 : (this.muted = a, this.updateVolume(), !0)
  6243. };
  6244. a.getMute = function () {
  6245. return this.muted
  6246. };
  6247. a.setPan = function () {
  6248. return !1
  6249. };
  6250. a.getPan = function () {
  6251. return 0
  6252. };
  6253. a.getPosition = function () {
  6254. return null == this.tag ? this.offset : 1E3 * this.tag.currentTime
  6255. };
  6256. a.setPosition = function (a) {
  6257. if (null == this.tag) this.offset =
  6258. a;
  6259. else {
  6260. this.tag.removeEventListener(createjs.HTMLAudioPlugin.AUDIO_SEEKED, this.loopHandler, !1);
  6261. try {
  6262. this.tag.currentTime = 0.0010 * a
  6263. } catch (c) {
  6264. return !1
  6265. }
  6266. this.tag.addEventListener(createjs.HTMLAudioPlugin.AUDIO_SEEKED, this.loopHandler, !1)
  6267. }
  6268. return !0
  6269. };
  6270. a.getDuration = function () {
  6271. return this.duration
  6272. };
  6273. a.handleSoundComplete = function () {
  6274. this.offset = 0;
  6275. null != window.createjs && (this.playState = createjs.Sound.PLAY_FINISHED, this.cleanUp(), this.sendEvent("complete"))
  6276. };
  6277. a.handleSoundLoop = function () {
  6278. this.offset = 0;
  6279. this.remainingLoops--;
  6280. 0 == this.remainingLoops && (this.tag.loop = !1, this.tag.removeEventListener(createjs.HTMLAudioPlugin.AUDIO_SEEKED, this.loopHandler, !1));
  6281. this.sendEvent("loop")
  6282. };
  6283. a.playFailed = function () {
  6284. null != window.createjs && (this.playState = createjs.Sound.PLAY_FAILED, this.cleanUp(), this.sendEvent("failed"))
  6285. };
  6286. a.toString = function () {
  6287. return "[HTMLAudioPlugin SoundInstance]"
  6288. };
  6289. createjs.EventDispatcher.initialize(c.prototype);
  6290. createjs.HTMLAudioPlugin.SoundInstance = c
  6291. })();
  6292. (function () {
  6293. function c(a, c) {
  6294. this.init(a, c)
  6295. }
  6296. var a = c.prototype;
  6297. a.src = null;
  6298. a.tag = null;
  6299. a.preloadTimer = null;
  6300. a.loadedHandler = null;
  6301. a.init = function (a, c) {
  6302. if (this.src = a, this.tag = c, this.preloadTimer = setInterval(createjs.proxy(this.preloadTick, this), 200), this.loadedHandler = createjs.proxy(this.sendLoadedEvent, this), this.tag.addEventListener && this.tag.addEventListener("canplaythrough", this.loadedHandler), null == this.tag.onreadystatechange) this.tag.onreadystatechange = createjs.proxy(this.sendLoadedEvent, this);
  6303. else {
  6304. var f =
  6305. this.tag.onreadystatechange;
  6306. this.tag.onreadystatechange = function () {
  6307. f();
  6308. this.tag.onreadystatechange = createjs.proxy(this.sendLoadedEvent, this)
  6309. }
  6310. }
  6311. this.tag.preload = "auto";
  6312. this.tag.load()
  6313. };
  6314. a.preloadTick = function () {
  6315. var a = this.tag.buffered,
  6316. c = this.tag.duration;
  6317. 0 < a.length && a.end(0) >= c - 1 && this.handleTagLoaded()
  6318. };
  6319. a.handleTagLoaded = function () {
  6320. clearInterval(this.preloadTimer)
  6321. };
  6322. a.sendLoadedEvent = function () {
  6323. this.tag.removeEventListener && this.tag.removeEventListener("canplaythrough", this.loadedHandler);
  6324. this.tag.onreadystatechange =
  6325. null;
  6326. createjs.Sound.sendFileLoadEvent(this.src)
  6327. };
  6328. a.toString = function () {
  6329. return "[HTMLAudioPlugin Loader]"
  6330. };
  6331. createjs.HTMLAudioPlugin.Loader = c
  6332. })();
  6333. (function () {
  6334. function c(a) {
  6335. this.init(a)
  6336. }
  6337. c.tags = {};
  6338. c.get = function (a) {
  6339. var g = c.tags[a];
  6340. return null == g && (g = c.tags[a] = new c(a)), g
  6341. };
  6342. c.remove = function (a) {
  6343. var g = c.tags[a];
  6344. return null == g ? !1 : (g.removeAll(), delete c.tags[a], !0)
  6345. };
  6346. c.removeAll = function () {
  6347. for (var a in c.tags) c.tags[a].removeAll();
  6348. c.tags = {}
  6349. };
  6350. c.getInstance = function (a) {
  6351. a = c.tags[a];
  6352. return null == a ? null : a.get()
  6353. };
  6354. c.setInstance = function (a, g) {
  6355. var f = c.tags[a];
  6356. return null == f ? null : f.set(g)
  6357. };
  6358. c.checkSrc = function (a) {
  6359. a = c.tags[a];
  6360. return null == a ? null : (a.checkSrcChange(),
  6361. void 0)
  6362. };
  6363. var a = c.prototype;
  6364. a.src = null;
  6365. a.length = 0;
  6366. a.available = 0;
  6367. a.tags = null;
  6368. a.init = function (a) {
  6369. this.src = a;
  6370. this.tags = []
  6371. };
  6372. a.add = function (a) {
  6373. this.tags.push(a);
  6374. this.length++;
  6375. this.available++
  6376. };
  6377. a.removeAll = function () {
  6378. for (; this.length--;) delete this.tags[this.length];
  6379. this.src = null;
  6380. this.tags.length = 0
  6381. };
  6382. a.get = function () {
  6383. if (0 == this.tags.length) return null;
  6384. this.available = this.tags.length;
  6385. var a = this.tags.pop();
  6386. return null == a.parentNode && document.body.appendChild(a), a
  6387. };
  6388. a.set = function (a) {
  6389. -1 == createjs.indexOf(this.tags,
  6390. a) && this.tags.push(a);
  6391. this.available = this.tags.length
  6392. };
  6393. a.checkSrcChange = function () {
  6394. for (var a = this.tags.length - 1, c = this.tags[a].src; a--;) this.tags[a].src = c
  6395. };
  6396. a.toString = function () {
  6397. return "[HTMLAudioPlugin TagPool]"
  6398. };
  6399. createjs.HTMLAudioPlugin.TagPool = c
  6400. })();
  6401. (function (c) {
  6402. c.hideAddressbar = function (a) {
  6403. a = "string" === typeof a ? document.querySelector(a) : a;
  6404. var b = navigator.userAgent,
  6405. g = ~b.indexOf("iPhone") || ~b.indexOf("iPod"),
  6406. f = ~b.indexOf("iPad"),
  6407. d = g || f,
  6408. e = ~b.indexOf("Android"),
  6409. h = c.navigator.standalone,
  6410. k = 0;
  6411. (d || e) && a && (e && c.addEventListener("scroll", function () {
  6412. a.style.height = c.innerHeight + "px"
  6413. }, !1), function n() {
  6414. var b = a.offsetWidth;
  6415. k !== b && (k = b, b = 0, d ? (b = document.documentElement.clientHeight, g && !h && (b += 60)) : e && (b = c.innerHeight + 56), a.style.height = b + "px", setTimeout(scrollTo,
  6416. 0, 0, 1), c.addEventListener("resize", n, !1), console.log("resizefunt"))
  6417. }())
  6418. }
  6419. })(this);
  6420. function isArrayContains(c, a) {
  6421. return -1 < c.indexOf(a)
  6422. }
  6423. function addToArray(c, a) {
  6424. isArrayContains(c, a) || c.push(a)
  6425. }
  6426. function removeFromArray(c, a) {
  6427. isArrayContains(c, a) && c.splice(c.indexOf(a, 0), 1)
  6428. }
  6429. function setCacheFromOther(c, a) {
  6430. c.cacheCanvas = a.cacheCanvas;
  6431. c.cacheID = a.cacheID;
  6432. c._cacheWidth = a._cacheWidth;
  6433. c._cacheHeight = a._cacheHeight;
  6434. c._cacheOffsetX = a._cacheOffsetX;
  6435. c._cacheOffsetY = a._cacheOffsetY;
  6436. c._cacheScale = a._cacheScale
  6437. }
  6438. function deleteCache(c) {
  6439. c.cacheCanvas = null;
  6440. c.cacheID = 0
  6441. }
  6442. function trace(c) {
  6443. isLevelEditor && console.log(c)
  6444. }
  6445. function onHoverScale(c) {
  6446. c.scaleX = c.scaleY = 1.2 * spriteScale * (c.defaultScale ? c.defaultScale : 1)
  6447. }
  6448. function onOutScale(c) {
  6449. c.scaleX = c.scaleY = spriteScale * (c.defaultScale ? c.defaultScale : 1)
  6450. }
  6451. function removeFromParent(c) {
  6452. c.parent && c.parent.removeChild(c)
  6453. }
  6454. function addToParent(c, a) {
  6455. removeFromParent(c);
  6456. a && a.addChild(c)
  6457. }
  6458. function setSpriteScale(c, a) {
  6459. c.scaleX = c.scaleY = a
  6460. }
  6461. function setTextAndCenter(c, a, b, g) {
  6462. g.text != b && (g.text = b, b = g.getBounds(), g.x = c - (b.width >> 1) * g.scaleX, a && (g.y = a - (b.height >> 1) * g.scaleY))
  6463. }
  6464. function setAnimationSpeed(c, a) {
  6465. c._animation.speed = a
  6466. }
  6467. function setNextAnimation(c, a) {
  6468. c._animation.next = a
  6469. }
  6470. function randomizeAnimFrame(c) {
  6471. c.currentAnimationFrame = Math.floor(30 * Math.random())
  6472. }
  6473. var spilLogo, logoDefaultY = 0,
  6474. logoDefaultX = 0,
  6475. currentLogoHorizPos = 0,
  6476. currentLogoVertPos = 0,
  6477. LOGO_TOP_POS = 0,
  6478. LOGO_BOTTOM_POS = 1,
  6479. LOGO_VERTICAL_ANY_POS = 2,
  6480. LOGO_LEFT_POS = 3,
  6481. LOGO_RIGHT_POS = 4,
  6482. LOGO_HORIZ_ANY_POS = 5,
  6483. logoPosDivisor = 1,
  6484. sponsorLogoFrame = "splashlogo";
  6485. function createSponsorLogo() {
  6486. spilLogo = createButton(160, 322, 0.8, sponsorLogoFrame, sponsorClick, null, null)
  6487. }
  6488. function showSponsorLogo(c, a, b, g, f, d, e, h) {
  6489. spilLogo || createSponsorLogo();
  6490. isSponsorLogoError || (addToParent(spilLogo, g), logoDefaultY = a, logoDefaultX = c, currentLogoHorizPos = d, currentLogoVertPos = e, spilLogo.scaleX = spilLogo.scaleY = b, spilLogo.alpha = f ? f : 1, logoPosDivisor = h, updateLogoPos(), (c = zoeSS.getAnimation(sponsorLogoFrame)) && c.frames && 0 < c.frames.length && (c = zoeSS.getFrameBounds(c.frames[0]), spilLogo.setBoundingBox(c.x * b, c.y * b, c.width * b, c.height * b)))
  6491. }
  6492. function updateLogoPos() {
  6493. spilLogo && !isSponsorLogoError && (spilLogo.x = logoDefaultX, spilLogo.y = logoDefaultY, currentLogoHorizPos === LOGO_LEFT_POS ? spilLogo.x += deltaForHLeft() : currentLogoHorizPos === LOGO_RIGHT_POS && (spilLogo.x -= deltaForHLeft()), currentLogoVertPos === LOGO_TOP_POS ? spilLogo.y += deltaForVTop() / logoPosDivisor : currentLogoVertPos === LOGO_BOTTOM_POS && (spilLogo.y -= deltaForVTop() / logoPosDivisor))
  6494. }
  6495. var isAdPauseSoundMuted = !1;
  6496. function startSponsorAds() {
  6497. sponsorApi && (isAdPauseSoundMuted = isMute, sponsorApi.GameBreak.request(onAdBeginPause, onAdEndUnpause))
  6498. }
  6499. function onAdBeginPause() {
  6500. trace("ad pause, , sound is muted: " + isMute);
  6501. isAdPauseSoundMuted = isMute;
  6502. isMute = !0;
  6503. stopBgMusic();
  6504. stopWindSound()
  6505. }
  6506. function onAdEndUnpause() {
  6507. trace("ad unpause, sound was muted: " + isAdPauseSoundMuted);
  6508. (isMute = isAdPauseSoundMuted) || playBgMusic()
  6509. }
  6510. function showTopLogo(c) {
  6511. showSponsorLogo(160, 26, 0.7 * c, container, 1, LOGO_HORIZ_ANY_POS, LOGO_TOP_POS, 2)
  6512. }
  6513. function initSpilApi() {
  6514. try {
  6515. trace(GameAPI), GameAPI.loadAPI(function (a) {
  6516. sponsorApi = a;
  6517. logoConfig = sponsorApi.Branding.getLogo();
  6518. showPreloaderLogo();
  6519. isLogoReady = !0;
  6520. trace(GameAPI.Branding.getLinks("more_games"));
  6521. trace("list");
  6522. trace(sponsorApi.Branding.getLogo())
  6523. })
  6524. } catch (c) {
  6525. trace("init api fail!"), isSponsorLogoError = !0, isAllFilesLoaded && startGame()
  6526. }
  6527. }
  6528. function handleFileLoadError(c) {
  6529. trace("Logo loading error!");
  6530. isSponsorLogoError = !0
  6531. }
  6532. var isSponsorLogoError = !1;
  6533. function handleSponsorLogoComplete(c) {
  6534. if (!isSponsorLogoError) try {
  6535. spilLogo || createSponsorLogo();
  6536. trace("logo loaded!");
  6537. var a = files.sponsorLogoImg,
  6538. b = sponsorLogoDefWidth = a.width,
  6539. g = sponsorLogoDefHeight = a.height,
  6540. f = sponsorLogoBitmap = (new createjs.Bitmap(a))
  6541. .set({
  6542. scaleX: 1,
  6543. scaleY: 1,
  6544. regX: 0,
  6545. regY: 0,
  6546. cursor: "pointer",
  6547. x: 0,
  6548. y: 0
  6549. });
  6550. f.isOnlyBoundsCheck = !0;
  6551. f.setBoundingBox(0, 0, 1 * b, 1 * g);
  6552. f.addEventListener("mousedown", sponsorClick);
  6553. spilLogo.addChild(f);
  6554. loaderBar && showSponsorLogo(160, 80, 1, loaderBar, 1, LOGO_HORIZ_ANY_POS,
  6555. LOGO_VERTICAL_ANY_POS, 2);
  6556. isLogoReady = !0
  6557. } catch (d) {
  6558. isSponsorLogoError = !0, trace("logo error!")
  6559. }
  6560. isAllFilesLoaded && startGame()
  6561. }
  6562. var logoConfig, sponsorLogoBitmap, sponsorPreload, sponsorLogoDefWidth = 1,
  6563. sponsorLogoDefHeight = 1,
  6564. sponsorApi, isLogoReady = !1,
  6565. isGameInited = !1;
  6566. (function (c, a) {
  6567. function b() {
  6568. function b() {
  6569. var c;
  6570. c = a("amd");
  6571. c.fork = b;
  6572. return c
  6573. }
  6574. return b()
  6575. }
  6576. function g() {
  6577. function b() {
  6578. var d, e = [],
  6579. g = {};
  6580. d = a("global");
  6581. d.fork = b;
  6582. d.noConflict = function () {
  6583. var a, b;
  6584. b = Array.prototype.slice.apply(arguments);
  6585. for (a = 0; a < e.length; a += 1) "undefined" === typeof g[e[a]] ? delete c[e[a]] : c[e[a]] = g[e[a]];
  6586. g = {};
  6587. for (a = 0; a < b.length; a += 1) {
  6588. if ("string" !== typeof b[a]) throw Error("Cannot replace namespaces. All new namespaces must be strings.");
  6589. g[b[a]] = c[b[a]];
  6590. c[b[a]] = d
  6591. }
  6592. return e = b
  6593. };
  6594. return d
  6595. }
  6596. b()
  6597. .noConflict("KeyboardJS",
  6598. "k")
  6599. }[].indexOf || (Array.prototype.indexOf = function (a, b, c) {
  6600. c = this.length;
  6601. for (b = (c + ~~b) % c; b < c && (!(b in this) || this[b] !== a); b++);
  6602. return b ^ c ? b : -1
  6603. });
  6604. "function" === typeof define && define.amd ? define(b) : g()
  6605. })(this, function (c) {
  6606. function a() {
  6607. window.addEventListener ? (document.addEventListener("keydown", g, !1), document.addEventListener("keyup", f, !1), window.addEventListener("blur", b, !1), window.addEventListener("webkitfullscreenchange", b, !1), window.addEventListener("mozfullscreenchange", b, !1)) : window.attachEvent &&
  6608. (document.attachEvent("onkeydown", g), document.attachEvent("onkeyup", f), window.attachEvent("onblur", b))
  6609. }
  6610. function b(a) {
  6611. z = [];
  6612. h();
  6613. k(a)
  6614. }
  6615. function g(a) {
  6616. var b, c;
  6617. b = d(a.keyCode);
  6618. if (!(1 > b.length)) {
  6619. for (c = 0; c < b.length; c += 1) q(b[c]);
  6620. for (b = 0; b < C.length; b += 1)
  6621. if (c = r(C[b][0]), -1 === P.indexOf(C[b]) && n(c))
  6622. for (P.push(C[b]), c = 0; c < C[b][1].length; c += 1) q(C[b][1][c]);
  6623. var e, f, g, h, k, m, s = [];
  6624. c = [].concat(z);
  6625. for (b = 0; b < F.length; b += 1) e = p(F[b].keyCombo)
  6626. .length, s[e] || (s[e] = []), s[e].push(F[b]);
  6627. for (e = s.length - 1; 0 <= e; e -= 1)
  6628. if (s[e])
  6629. for (b =
  6630. 0; b < s[e].length; b += 1) {
  6631. f = s[e][b];
  6632. g = p(f.keyCombo);
  6633. m = !0;
  6634. for (k = 0; k < g.length; k += 1)
  6635. if (-1 === c.indexOf(g[k])) {
  6636. m = !1;
  6637. break
  6638. }
  6639. if (m && n(f.keyCombo)) {
  6640. J.push(f);
  6641. for (k = 0; k < g.length; k += 1) m = c.indexOf(g[k]), -1 < m && (c.splice(m, 1), k -= 1);
  6642. for (g = 0; g < f.keyDownCallback.length; g += 1)!1 === f.keyDownCallback[g](a, t(), f.keyCombo) && (h = !0);
  6643. !0 === h && (a.preventDefault(), a.stopPropagation())
  6644. }
  6645. }
  6646. }
  6647. }
  6648. function f(a) {
  6649. var b, c;
  6650. b = d(a.keyCode);
  6651. if (!(1 > b.length)) {
  6652. for (c = 0; c < b.length; c += 1) w(b[c]);
  6653. h();
  6654. k(a)
  6655. }
  6656. }
  6657. function d(a) {
  6658. return y[a] || []
  6659. }
  6660. function e(a) {
  6661. for (var b in y)
  6662. if (y.hasOwnProperty(b) &&
  6663. -1 < y[b].indexOf(a)) return b;
  6664. return !1
  6665. }
  6666. function h() {
  6667. var a, b;
  6668. for (a = 0; a < P.length; a += 1)
  6669. if (b = r(P[a][0]), !1 === n(b)) {
  6670. for (b = 0; b < P[a][1].length; b += 1) w(P[a][1][b]);
  6671. P.splice(a, 1);
  6672. a -= 1
  6673. }
  6674. }
  6675. function k(a) {
  6676. var b, c, d, e;
  6677. for (b = 0; b < J.length; b += 1)
  6678. if (d = J[b], !1 === n(d.keyCombo)) {
  6679. for (c = 0; c < d.keyUpCallback.length; c += 1)!1 === d.keyUpCallback[c](a, t(), d.keyCombo) && (e = !0);
  6680. !0 === e && (a.preventDefault(), a.stopPropagation());
  6681. J.splice(b, 1);
  6682. b -= 1
  6683. }
  6684. }
  6685. function m(a, b) {
  6686. var c, d, e;
  6687. a = r(a);
  6688. b = r(b);
  6689. if (a.length !== b.length) return !1;
  6690. for (c = 0; c < a.length; c +=
  6691. 1) {
  6692. if (a[c].length !== b[c].length) return !1;
  6693. for (d = 0; d < a[c].length; d += 1) {
  6694. if (a[c][d].length !== b[c][d].length) return !1;
  6695. for (e = 0; e < a[c][d].length; e += 1)
  6696. if (-1 === b[c][d].indexOf(a[c][d][e])) return !1
  6697. }
  6698. }
  6699. return !0
  6700. }
  6701. function n(a) {
  6702. var b, c, d, e, f = 0,
  6703. g, h;
  6704. a = r(a);
  6705. for (b = 0; b < a.length; b += 1) {
  6706. h = !0;
  6707. for (c = f = 0; c < a[b].length; c += 1) {
  6708. d = [].concat(a[b][c]);
  6709. for (e = f; e < z.length; e += 1) g = d.indexOf(z[e]), -1 < g && (d.splice(g, 1), f = e);
  6710. if (0 !== d.length) {
  6711. h = !1;
  6712. break
  6713. }
  6714. }
  6715. if (h) return !0
  6716. }
  6717. return !1
  6718. }
  6719. function p(a) {
  6720. var b, c, d = [];
  6721. a = r(a);
  6722. for (b = 0; b < a.length; b += 1)
  6723. for (c =
  6724. 0; c < a[b].length; c += 1) d = d.concat(a[b][c]);
  6725. return d
  6726. }
  6727. function r(a) {
  6728. var b = 0,
  6729. c = 0,
  6730. d = !1,
  6731. e = !1,
  6732. f = [],
  6733. g = [],
  6734. h = [],
  6735. k = "";
  6736. if ("object" === typeof a && "function" === typeof a.push) return a;
  6737. if ("string" !== typeof a) throw Error('Cannot parse "keyCombo" because its type is "' + typeof a + '". It must be a "string".');
  6738. for (;
  6739. " " === a.charAt(b);) b += 1;
  6740. for (;;) {
  6741. if (" " === a.charAt(b)) {
  6742. for (;
  6743. " " === a.charAt(b);) b += 1;
  6744. d = !0
  6745. } else if ("," === a.charAt(b)) {
  6746. if (c || e) throw Error("Failed to parse key combo. Unexpected , at character index " + b + ".");
  6747. e = !0;
  6748. b += 1
  6749. } else if ("+" === a.charAt(b)) {
  6750. k.length && (h.push(k), k = "");
  6751. if (c || e) throw Error("Failed to parse key combo. Unexpected + at character index " + b + ".");
  6752. c = !0;
  6753. b += 1
  6754. } else if (">" === a.charAt(b)) {
  6755. k.length && (h.push(k), k = "");
  6756. h.length && (g.push(h), h = []);
  6757. if (c || e) throw Error("Failed to parse key combo. Unexpected > at character index " + b + ".");
  6758. c = !0;
  6759. b += 1
  6760. } else if (b < a.length - 1 && "!" === a.charAt(b) && (">" === a.charAt(b + 1) || "," === a.charAt(b + 1) || "+" === a.charAt(b + 1))) k += a.charAt(b + 1), e = d = c = !1, b += 2;
  6761. else if (b < a.length && "+" !== a.charAt(b) &&
  6762. ">" !== a.charAt(b) && "," !== a.charAt(b) && " " !== a.charAt(b)) {
  6763. if (!1 === c && !0 === d || !0 === e) k.length && (h.push(k), k = ""), h.length && (g.push(h), h = []), g.length && (f.push(g), g = []);
  6764. for (e = d = c = !1; b < a.length && "+" !== a.charAt(b) && ">" !== a.charAt(b) && "," !== a.charAt(b) && " " !== a.charAt(b);) k += a.charAt(b), b += 1
  6765. } else {
  6766. b += 1;
  6767. continue
  6768. } if (b >= a.length) {
  6769. k.length && h.push(k);
  6770. h.length && g.push(h);
  6771. g.length && f.push(g);
  6772. break
  6773. }
  6774. }
  6775. return f
  6776. }
  6777. function s(a) {
  6778. var b, c, d = [];
  6779. if ("string" === typeof a) return a;
  6780. if ("object" !== typeof a || "function" !== typeof a.push) throw Error("Cannot stringify key combo.");
  6781. for (b = 0; b < a.length; b += 1) {
  6782. d[b] = [];
  6783. for (c = 0; c < a[b].length; c += 1) d[b][c] = a[b][c].join(" + ");
  6784. d[b] = d[b].join(" > ")
  6785. }
  6786. return d.join(" ")
  6787. }
  6788. function t(a) {
  6789. return [].concat(z)
  6790. }
  6791. function q(a) {
  6792. if (a.match(/\s/)) throw Error("Cannot add key name " + a + " to active keys because it contains whitespace."); - 1 < z.indexOf(a) || z.push(a)
  6793. }
  6794. function w(a) {
  6795. var b = e(a);
  6796. "91" === b || "92" === b ? z = [] : z.splice(z.indexOf(a), 1)
  6797. }
  6798. function u(a, b) {
  6799. if ("string" !== typeof a) throw Error("Cannot register new locale. The locale name must be a string.");
  6800. if ("object" !==
  6801. typeof b) throw Error("Cannot register " + a + " locale. The locale map must be an object.");
  6802. if ("object" !== typeof b.map) throw Error("Cannot register " + a + " locale. The locale map is invalid.");
  6803. b.macros || (b.macros = []);
  6804. K[a] = b
  6805. }
  6806. function x(a) {
  6807. if (a) {
  6808. if ("string" !== typeof a) throw Error("Cannot set locale. The locale name must be a string.");
  6809. if (!K[a]) throw Error("Cannot set locale to " + a + " because it does not exist. If you would like to submit a " + a + " locale map for KeyboardJS please submit it at https://github.com/RobertWHurst/KeyboardJS/issues.");
  6810. y = K[a].map;
  6811. C = K[a].macros;
  6812. A = a
  6813. }
  6814. return A
  6815. }
  6816. c = {};
  6817. var K = {},
  6818. A, y, C, z = [],
  6819. F = [],
  6820. J = [],
  6821. P = [],
  6822. E, S;
  6823. S = {
  6824. map: {
  6825. 3: ["cancel"],
  6826. 8: ["backspace"],
  6827. 9: ["tab"],
  6828. 12: ["clear"],
  6829. 13: ["enter"],
  6830. 16: ["shift"],
  6831. 17: ["ctrl"],
  6832. 18: ["alt", "menu"],
  6833. 19: ["pause", "break"],
  6834. 20: ["capslock"],
  6835. 27: ["escape", "esc"],
  6836. 32: ["space", "spacebar"],
  6837. 33: ["pageup"],
  6838. 34: ["pagedown"],
  6839. 35: ["end"],
  6840. 36: ["home"],
  6841. 37: ["left"],
  6842. 38: ["up"],
  6843. 39: ["right"],
  6844. 40: ["down"],
  6845. 41: ["select"],
  6846. 42: ["printscreen"],
  6847. 43: ["execute"],
  6848. 44: ["snapshot"],
  6849. 45: ["insert", "ins"],
  6850. 46: ["delete", "del"],
  6851. 47: ["help"],
  6852. 91: "command windows win super leftcommand leftwindows leftwin leftsuper".split(" "),
  6853. 92: "command windows win super rightcommand rightwindows rightwin rightsuper".split(" "),
  6854. 145: ["scrolllock", "scroll"],
  6855. 186: ["semicolon", ";"],
  6856. 187: ["equal", "equalsign", "="],
  6857. 188: ["comma", ","],
  6858. 189: ["dash", "-"],
  6859. 190: ["period", "."],
  6860. 191: ["slash", "forwardslash", "/"],
  6861. 192: ["graveaccent", "`"],
  6862. 219: ["openbracket", "["],
  6863. 220: ["backslash", "\\"],
  6864. 221: ["closebracket", "]"],
  6865. 222: ["apostrophe", "'"],
  6866. 48: ["zero", "0"],
  6867. 49: ["one", "1"],
  6868. 50: ["two", "2"],
  6869. 51: ["three", "3"],
  6870. 52: ["four", "4"],
  6871. 53: ["five", "5"],
  6872. 54: ["six", "6"],
  6873. 55: ["seven", "7"],
  6874. 56: ["eight", "8"],
  6875. 57: ["nine", "9"],
  6876. 96: ["numzero", "num0"],
  6877. 97: ["numone", "num1"],
  6878. 98: ["numtwo", "num2"],
  6879. 99: ["numthree", "num3"],
  6880. 100: ["numfour", "num4"],
  6881. 101: ["numfive", "num5"],
  6882. 102: ["numsix", "num6"],
  6883. 103: ["numseven", "num7"],
  6884. 104: ["numeight", "num8"],
  6885. 105: ["numnine", "num9"],
  6886. 106: ["nummultiply", "num*"],
  6887. 107: ["numadd", "num+"],
  6888. 108: ["numenter"],
  6889. 109: ["numsubtract", "num-"],
  6890. 110: ["numdecimal", "num."],
  6891. 111: ["numdevide", "num/"],
  6892. 144: ["numlock", "num"],
  6893. 112: ["f1"],
  6894. 113: ["f2"],
  6895. 114: ["f3"],
  6896. 115: ["f4"],
  6897. 116: ["f5"],
  6898. 117: ["f6"],
  6899. 118: ["f7"],
  6900. 119: ["f8"],
  6901. 120: ["f9"],
  6902. 121: ["f10"],
  6903. 122: ["f11"],
  6904. 123: ["f12"]
  6905. },
  6906. macros: [
  6907. ["shift + `", ["tilde", "~"]],
  6908. ["shift + 1", ["exclamation", "exclamationpoint", "!"]],
  6909. ["shift + 2", ["at", "@"]],
  6910. ["shift + 3", ["number", "#"]],
  6911. ["shift + 4", ["dollar", "dollars", "dollarsign", "$"]],
  6912. ["shift + 5", ["percent", "%"]],
  6913. ["shift + 6", ["caret", "^"]],
  6914. ["shift + 7", ["ampersand", "and", "&"]],
  6915. ["shift + 8", ["asterisk", "*"]],
  6916. ["shift + 9", ["openparen", "("]],
  6917. ["shift + 0", ["closeparen", ")"]],
  6918. ["shift + -", ["underscore", "_"]],
  6919. ["shift + =", ["plus", "+"]],
  6920. ["shift + (", ["opencurlybrace", "opencurlybracket", "{"]],
  6921. ["shift + )", ["closecurlybrace", "closecurlybracket", "}"]],
  6922. ["shift + \\", ["verticalbar", "|"]],
  6923. ["shift + ;", ["colon", ":"]],
  6924. ["shift + '", ["quotationmark", '"']],
  6925. ["shift + !,", ["openanglebracket", "<"]],
  6926. ["shift + .", ["closeanglebracket", ">"]],
  6927. ["shift + /", ["questionmark", "?"]]
  6928. ]
  6929. };
  6930. for (E = 65; 90 >= E; E += 1) S.map[E] = String.fromCharCode(E + 32), S.macros.push(["shift + " + String.fromCharCode(E + 32) + ", capslock + " + String.fromCharCode(E + 32), [String.fromCharCode(E)]]);
  6931. u("us", S);
  6932. x("us");
  6933. a();
  6934. c.enable = a;
  6935. c.disable = function () {
  6936. b();
  6937. window.removeEventListener ? (document.removeEventListener("keydown", g, !1), document.removeEventListener("keyup", f, !1), window.removeEventListener("blur", b, !1), window.removeEventListener("webkitfullscreenchange", b, !1), window.removeEventListener("mozfullscreenchange", b, !1)) : window.detachEvent && (document.detachEvent("onkeydown", g), document.detachEvent("onkeyup", f), window.detachEvent("onblur", b))
  6938. };
  6939. c.activeKeys = t;
  6940. c.isPressed = function (a) {
  6941. return -1 < z.indexOf(a)
  6942. };
  6943. c.on = function (a, b, c) {
  6944. var d = {},
  6945. e, f = [],
  6946. g, h;
  6947. "string" === typeof a && (a = r(a));
  6948. for (g = 0; g < a.length; g += 1) {
  6949. e = {};
  6950. h = s([a[g]]);
  6951. if ("string" !== typeof h) throw Error("Failed to bind key combo. The key combo must be string.");
  6952. e.keyCombo = h;
  6953. e.keyDownCallback = [];
  6954. e.keyUpCallback = [];
  6955. b && e.keyDownCallback.push(b);
  6956. c && e.keyUpCallback.push(c);
  6957. F.push(e);
  6958. f.push(e)
  6959. }
  6960. d.clear = function () {
  6961. var a;
  6962. for (a = 0; a < f.length; a += 1) F.splice(F.indexOf(f[a]), 1)
  6963. };
  6964. d.on = function (a) {
  6965. var b = {},
  6966. c, d, e;
  6967. if ("string" !== typeof a) throw Error("Cannot bind callback. The event name must be a string.");
  6968. if ("keyup" !== a && "keydown" !== a) throw Error('Cannot bind callback. The event name must be a "keyup" or "keydown".');
  6969. c = Array.prototype.slice.apply(arguments, [1]);
  6970. for (d = 0; d < c.length; d += 1)
  6971. if ("function" === typeof c[d])
  6972. if ("keyup" === a)
  6973. for (e = 0; e < f.length; e += 1) f[e].keyUpCallback.push(c[d]);
  6974. else if ("keydown" === a)
  6975. for (e = 0; e < f.length; e += 1) f[e].keyDownCallback.push(c[d]);
  6976. b.clear = function () {
  6977. var b, d;
  6978. for (b = 0; b < c.length; b += 1)
  6979. if ("function" === typeof c[b])
  6980. if ("keyup" === a)
  6981. for (d = 0; d < f.length; d += 1) f[d].keyUpCallback.splice(f[d].keyUpCallback.indexOf(c[b]),
  6982. 1);
  6983. else
  6984. for (d = 0; d < f.length; d += 1) f[d].keyDownCallback.splice(f[d].keyDownCallback.indexOf(c[b]), 1)
  6985. };
  6986. return b
  6987. };
  6988. return d
  6989. };
  6990. c.clear = function (a) {
  6991. var b, c;
  6992. for (b = 0; b < F.length; b += 1) c = F[b], m(a, c.keyCombo) && (F.splice(b, 1), b -= 1)
  6993. };
  6994. c.clear.key = function (a) {
  6995. var b, c, d;
  6996. if (a)
  6997. for (b = 0; b < F.length; b += 1)
  6998. for (d = F[b], c = 0; c < d.keyCombo.length; c += 1) {
  6999. if (-1 < d.keyCombo[c].indexOf(a)) {
  7000. F.splice(b, 1);
  7001. b -= 1;
  7002. break
  7003. }
  7004. } else F = []
  7005. };
  7006. c.locale = x;
  7007. c.locale.register = u;
  7008. c.macro = function (a, b) {
  7009. if ("string" !== typeof a && ("object" !== typeof a || "function" !==
  7010. typeof a.push)) throw Error("Cannot create macro. The combo must be a string or array.");
  7011. if ("object" !== typeof b || "function" !== typeof b.push) throw Error("Cannot create macro. The injectedKeys must be an array.");
  7012. C.push([a, b])
  7013. };
  7014. c.macro.remove = function (a) {
  7015. var b;
  7016. if ("string" !== typeof a && ("object" !== typeof a || "function" !== typeof a.push)) throw Error("Cannot remove macro. The combo must be a string or array.");
  7017. for (mI = 0; mI < C.length; mI += 1)
  7018. if (b = C[mI], m(a, b[0])) {
  7019. w(b[1]);
  7020. C.splice(mI, 1);
  7021. break
  7022. }
  7023. };
  7024. c.key = {};
  7025. c.key.name =
  7026. d;
  7027. c.key.code = e;
  7028. c.combo = {};
  7029. c.combo.active = n;
  7030. c.combo.parse = r;
  7031. c.combo.stringify = s;
  7032. return c
  7033. });
  7034. var allLevels = [
  7035. [
  7036. ["DECOR_HELP_1_TYPE", 182, 216.25, 0.6, 0.6, 0, [""]],
  7037. ["LAND_TYPE", 94.5, 270.95, 0.84, 0.84, 8, [""]],
  7038. ["LAND_TYPE", 229.5, 314.25, 0.84, 0.84, 0, ["4"]],
  7039. ["HERO_TYPE", 92.35, 224.75, 0.68, 0.68, 0, [""]],
  7040. ["DYNAMIC_BOX_TYPE", 123.6, 240, 0.423, 0.423, 7, [""]],
  7041. ["AIM_TYPE", 257.9, 265.4, 0.74, 0.74, 0, ["REV"]]
  7042. ],
  7043. [
  7044. ["LAND_TYPE", 63.7, 249, 0.84, 0.84, 0, ["2"]],
  7045. ["LAND_TYPE", 227.05, 277.7, 0.84, 0.84, 0, [""]],
  7046. ["HERO_TYPE", 226.8, 126.4, 0.68, 0.68, 0, [""]],
  7047. ["DYNAMIC_BOX_TYPE", 200.3, 244.75, 0.423, 0.423, 0, [""]],
  7048. ["DYNAMIC_BOX_TYPE", 251.15,
  7049. 244.75, 0.423, 0.423, 0, [""]
  7050. ],
  7051. ["DYNAMIC_RECT_TYPE", 225.85, 188.05, 0.7, 0.7, 0, [""]],
  7052. ["DYNAMIC_RECT_TYPE", 225.75, 225.45, 0.7, 0.7, 0, ["2"]],
  7053. ["DYNAMIC_BOX_TYPE", 251.25, 207, 0.42, 0.42, 0, ["2"]],
  7054. ["DYNAMIC_BOX_TYPE", 199.55, 207, 0.42, 0.42, 0, ["3"]],
  7055. ["DYNAMIC_TRIANGLE_TYPE", 243.55, 165, 0.7, 0.7, 180, [""]],
  7056. ["DYNAMIC_TRIANGLE_TYPE", 225.3, 163, 0.68, 0.68, 0, [""]],
  7057. ["DYNAMIC_TRIANGLE_TYPE", 207.85, 165, 0.69, 0.69, 180, [""]],
  7058. ["STATIC_BALK_1_TYPE", 149.7, 207.5, 0.6, 0.6, -25, [""]],
  7059. ["AIM_TYPE", 42.05, 199.7, 0.74, 0.74, 0, ["DEF"]]
  7060. ],
  7061. [
  7062. ["LAND_TYPE",
  7063. 116.95, 287.15, 0.84, 0.84, 0, ["2"]
  7064. ],
  7065. ["LAND_TYPE", 40.05, 192.4, 0.84, 0.84, 0, [""]],
  7066. ["HERO_TYPE", 47.8, 107, 0.68, 0.68, 0, [""]],
  7067. ["DYNAMIC_BOX_TYPE", 21.3, 157, 0.43, 0.43, 0, [""]],
  7068. ["DYNAMIC_RECT_TYPE", 46.75, 136.15, 0.7, 0.7, 0, ["2"]],
  7069. ["DYNAMIC_RECT_TYPE", 127.2, 146.75, 0.7, 0.7, 90, [""]],
  7070. ["DYNAMIC_RECT_TYPE", 127.2, 223.8, 0.7, 0.7, 90, [""]],
  7071. ["DYNAMIC_BOX_TYPE", 73.55, 157, 0.43, 0.43, 0, [""]],
  7072. ["BONUS_STAR_TYPE", 185.3, 210.2, 0.798, 0.798, 0, [""]],
  7073. ["AIM_TYPE", 272.2, 287.95, 0.74, 0.74, 0, ["REV_MOVED_R_0_4"]]
  7074. ],
  7075. [
  7076. ["LAND_TYPE", 274, 233.45, 0.84,
  7077. 0.84, -8, ["5"]
  7078. ],
  7079. ["LAND_TYPE", 158.75, 240.9, 0.84, 0.84, 0, ["2"]],
  7080. ["LAND_TYPE", 46.15, 240.9, 0.84, 0.84, 0, ["2"]],
  7081. ["STATIC_BOX_TYPE", 327.7, 166.45, 0.5, 1.06, -23, ["INVIS"]],
  7082. ["DECOR_HELP_2_TYPE", 91.45, 114.4, 0.7, 0.7, 0, [""]],
  7083. ["BOMB_TYPE", 45.55, 195.25, 0.9, 0.9, 0, ["180_700"]],
  7084. ["HERO_TYPE", 128.2, 192.1, 0.68, 0.68, 0, [""]],
  7085. ["DYNAMIC_BOX_TYPE", 11.8, 204.8, 0.43, 0.43, 0, [""]],
  7086. ["BONUS_STAR_TYPE", 211.2, 192.05, 0.798, 0.798, 0, [""]],
  7087. ["AIM_TYPE", 298.65, 182.25, 0.74, 0.74, -8, ["REV"]]
  7088. ],
  7089. [
  7090. ["LAND_TYPE", 161.7, 361.4, 0.84, 0.84, 0, ["5"]],
  7091. ["LAND_TYPE",
  7092. 263.85, 237.95, 0.84, 0.84, 0, [""]
  7093. ],
  7094. ["DYNAMIC_BOX_TYPE", 237.1, 205, 0.423, 0.423, 0, [""]],
  7095. ["DYNAMIC_BOX_TYPE", 287.95, 205, 0.423, 0.423, 0, [""]],
  7096. ["DYNAMIC_RECT_TYPE", 262.65, 148.3, 0.7, 0.7, 0, [""]],
  7097. ["DYNAMIC_RECT_TYPE", 262.55, 185.7, 0.7, 0.7, 0, ["2"]],
  7098. ["DYNAMIC_BOX_TYPE", 288.05, 167.25, 0.42, 0.42, 0, ["2"]],
  7099. ["DYNAMIC_BOX_TYPE", 236.35, 167.25, 0.42, 0.42, 0, ["3"]],
  7100. ["STATIC_BALK_1_TYPE", 157.5, 139.5, 0.7, 0.7, 0, [""]],
  7101. ["STATIC_BALK_1_TYPE", 164.5, 221.05, 0.7, 0.7, 0, [""]],
  7102. ["MOVABLE_BALK_TYPE", 64, 281.45, 1.03, 0.699, 35, ["R_1030_5"]],
  7103. ["HERO_TYPE",
  7104. 261.65, 115.4, 0.68, 0.68, 0, [""]
  7105. ],
  7106. ["BONUS_STAR_TYPE", 163.6, 184, 0.798, 0.798, 0, [""]],
  7107. ["BONUS_STAR_TYPE", 89.95, 253.4, 0.798, 0.798, 0, [""]],
  7108. ["AIM_TYPE", 193.1, 314, 0.74, 0.74, 0, ["REV"]]
  7109. ],
  7110. [
  7111. ["TELEPORT_TYPE", 241.7, 69.45, 1, 1, 0, ["A"]],
  7112. ["TELEPORT_TYPE", 121.55, 367.3, 1, 1, 0, ["A"]],
  7113. ["LAND_TYPE", 219.85, 392.45, 0.84, 0.84, -6, ["2"]],
  7114. ["LAND_TYPE", 68.25, 150.95, 0.84, 0.84, 0, ["3"]],
  7115. ["LAND_TYPE", 62.05, 295.65, 0.84, 0.84, 0, [""]],
  7116. ["HERO_TYPE", 61.8, 218.15, 0.68, 0.68, 0, [""]],
  7117. ["DYNAMIC_TRIANGLE_TYPE", 78.55, 256.75, 0.7, 0.7, 180, [""]],
  7118. ["DYNAMIC_TRIANGLE_TYPE",
  7119. 60.3, 254.75, 0.68, 0.68, 0, [""]
  7120. ],
  7121. ["DYNAMIC_TRIANGLE_TYPE", 42.85, 256.75, 0.69, 0.69, 180, [""]],
  7122. ["STATIC_BALK_1_TYPE", 157.05, 290.2, 0.7, 0.7, 12, [""]],
  7123. ["STATIC_BALK_1_TYPE", 294.05, 261.85, 0.7, 0.7, 68, [""]],
  7124. ["STATIC_BALK_1_TYPE", 290.7, 333.7, 0.7, 0.7, 118, [""]],
  7125. ["BONUS_STAR_TYPE", 158.25, 250.7, 0.798, 0.798, 0, [""]],
  7126. ["BONUS_STAR_TYPE", 238.25, 337.7, 0.798, 0.798, 0, [""]],
  7127. ["BONUS_STAR_TYPE", 158.25, 91.2, 0.798, 0.798, 0, [""]],
  7128. ["STATIC_BALK_1_TYPE", 164.1, 125.8, 0.7, 0.7, 171, [""]],
  7129. ["STATIC_BALK_1_TYPE", 244.15, 112.65, 0.7, 0.7, 171, [""]],
  7130. ["AIM_TYPE", 43.45, 103.6, 0.73, 0.73, 0, ["DEF"]]
  7131. ],
  7132. [
  7133. ["LAND_TYPE", 71, 387.8, 0.84, 0.84, 0, [""]],
  7134. ["DECOR_HELP_3_TYPE", 163.85, 193.45, 0.67, 0.67, 0, [""]],
  7135. ["STATIC_BALK_1_TYPE", 61.35, 153.35, 0.791, 0.814, 0, [""]],
  7136. ["DYNAMIC_RECT_TYPE", 161.15, 130.25, 1.31, 1.278, 0, [""]],
  7137. ["HARD_RECT_TYPE", 162.35, 107.6, 0.92, 1, 0, [""]],
  7138. ["STATIC_BALK_1_TYPE", 262.85, 153.35, 0.791, 0.814, 0, [""]],
  7139. ["STATIC_BALK_1_TYPE", 236.85, 369.7, 0.791, 0.814, 0, [""]],
  7140. ["STATIC_BALK_1_TYPE", 272.5, 262.7, 0.791, 0.814, -11, [""]],
  7141. ["DYNAMIC_TRIANGLE_TYPE", 243.3, 243.65, 0.68,
  7142. 0.68, 170, [""]
  7143. ],
  7144. ["BONUS_STAR_TYPE", 130.05, 325.55, 0.68, 0.68, 0, [""]],
  7145. ["BONUS_STAR_TYPE", 188.65, 273, 0.68, 0.68, 0, [""]],
  7146. ["HERO_TYPE", 271.95, 230.1, 0.68, 0.68, 0, [""]],
  7147. ["AIM_TYPE", 46.2, 339.5, 0.73, 0.73, 0, ["DEF"]]
  7148. ],
  7149. [
  7150. ["TELEPORT_TYPE", 211.9, 186.85, 1, 1, 0, ["A"]],
  7151. ["TELEPORT_TYPE", 53.9, 377.5, 1, 1, 0, ["A"]],
  7152. ["LAND_TYPE", 185, 266.4, 0.989, 0.84, 0, ["5"]],
  7153. ["HARD_RECT_TYPE", 76.45, 230.35, 1, 1, 0, [""]],
  7154. ["STATIC_BOX_TYPE", 33.85, 252.85, 0.75, 0.75, 0, [""]],
  7155. ["STATIC_BOX_TYPE", 72.85, 298.95, 0.75, 0.75, 0, [""]],
  7156. ["BOMB_TYPE", 73.9, 270.2, 0.8,
  7157. 0.8, 0, ["140_600"]
  7158. ],
  7159. ["STATIC_BOX_TYPE", 46.85, 119.3, 0.75, 0.75, 0, [""]],
  7160. ["STATIC_BOX_TYPE", 133.35, 119.8, 0.75, 0.75, 0, [""]],
  7161. ["HARD_RECT_TYPE", 89.85, 97.3, 1, 1, 0, [""]],
  7162. ["HARD_RECT_TYPE", 72.5, 163.25, 1, 1, 90, [""]],
  7163. ["STATIC_BALK_1_TYPE", 182.95, 128.9, 0.7, 0.7, 15, [""]],
  7164. ["STATIC_BALK_1_TYPE", 128.45, 405.8, 0.7, 0.7, 0, [""]],
  7165. ["STATIC_BALK_1_TYPE", 204.45, 405.8, 0.7, 0.7, 0, [""]],
  7166. ["STATIC_BALK_1_TYPE", 277.45, 386.8, 0.7, 0.7, -30, [""]],
  7167. ["DYNAMIC_TRIANGLE_TYPE", 235.45, 233.1, 0.68, 0.68, -60, [""]],
  7168. ["STATIC_BALK_1_TYPE", 312.3, 151.15,
  7169. 0.7, 0.7, -90, [""]
  7170. ],
  7171. ["HERO_TYPE", 118.95, 64.4, 0.68, 0.68, 0, [""]],
  7172. ["BONUS_STAR_TYPE", 267.85, 119, 0.68, 0.68, 0, [""]],
  7173. ["BONUS_STAR_TYPE", 203.85, 358.05, 0.68, 0.68, 0, [""]],
  7174. ["AIM_TYPE", 156.15, 217.55, 0.73, 0.73, 0, ["DEF"]]
  7175. ],
  7176. [
  7177. ["LAND_TYPE", 238.5, 404.05, 0.84, 0.84, 0, ["2"]],
  7178. ["LAND_TYPE", 131.15, 140.05, 0.84, 0.84, 0, ["4"]],
  7179. ["LAND_TYPE", 46.5, 249.6, 0.84, 0.84, 8, [""]],
  7180. ["HERO_TYPE", 44.35, 203.4, 0.68, 0.68, 0, [""]],
  7181. ["DYNAMIC_BOX_TYPE", 75.6, 218.65, 0.423, 0.423, 7, [""]],
  7182. ["TELEGA_TYPE", 199.05, 302.45, 1.68, 0.85, 0, ["1_R_50_8"]],
  7183. ["BOMB_TYPE",
  7184. 240.2, 358.8, 0.9, 0.9, 0, ["180_1400"]
  7185. ],
  7186. ["BONUS_STAR_TYPE", 248.2, 195.3, 0.798, 0.798, 0, [""]],
  7187. ["BONUS_STAR_TYPE", 240.3, 117.65, 0.798, 0.798, 0, [""]],
  7188. ["STATIC_BALK_1_TYPE", 276.2, 127.65, 0.7, 0.7, 68, [""]],
  7189. ["STATIC_BALK_1_TYPE", 229.65, 67.3, 0.7, 0.7, 36, [""]],
  7190. ["STATIC_BALK_1_TYPE", 168, 52.1, 0.48, 0.48, -15, [""]],
  7191. ["BONUS_STAR_TYPE", 150.4, 240, 0.798, 0.798, 0, [""]],
  7192. ["AIM_TYPE", 107.8, 90, 0.73, 0.73, 0, ["DEF"]]
  7193. ],
  7194. [
  7195. ["LAND_TYPE", 259.95, 376.75, 0.84, 0.84, 0, [""]],
  7196. ["LAND_TYPE", 76, 144.8, 0.84, 0.84, 0, [""]],
  7197. ["DECOR_HELP_4_TYPE", 168.25, 78.95,
  7198. 0.59, 0.59, 0, [""]
  7199. ],
  7200. ["STATIC_BALK_1_TYPE", 168.25, 138.6, 0.7, 0.7, 15, [""]],
  7201. ["STATIC_BALK_1_TYPE", 93.4, 327.3, 0.7, 0.7, 15, [""]],
  7202. ["STATIC_BALK_1_TYPE", 167.35, 348.3, 0.7, 0.7, 15, [""]],
  7203. ["HERO_TYPE", 95, 95.3, 0.68, 0.68, 0, [""]],
  7204. ["FAN_TYPE", 44, 93.85, 0.8, 0.8, 0, ["DEF_60_40"]],
  7205. ["BONUS_STAR_TYPE", 263.4, 188.55, 0.68, 0.68, 0, [""]],
  7206. ["BONUS_STAR_TYPE", 98.9, 277.7, 0.68, 0.68, 0, [""]],
  7207. ["STATIC_BALK_1_TYPE", 270.95, 228.2, 0.7, 0.7, -15, [""]],
  7208. ["STATIC_BALK_1_TYPE", 197.95, 247.6, 0.7, 0.7, -15, [""]],
  7209. ["STATIC_BALK_1_TYPE", 20.4, 306.3, 0.7, 0.7,
  7210. 15, [""]
  7211. ],
  7212. ["STATIC_BALK_1_TYPE", 342.95, 208.2, 0.7, 0.7, -15, [""]],
  7213. ["BONUS_STAR_TYPE", 175.4, 218.95, 0.68, 0.68, 0, [""]],
  7214. ["BONUS_STAR_TYPE", 176.4, 307.15, 0.68, 0.68, 0, [""]],
  7215. ["BONUS_STAR_TYPE", 234.35, 124.45, 0.68, 0.68, 0, [""]],
  7216. ["AIM_TYPE", 278.35, 327.55, 0.74, 0.74, 0, ["REV"]]
  7217. ],
  7218. [
  7219. ["LAND_TYPE", 52, 194.5, 0.84, 0.84, 0, ["2"]],
  7220. ["LAND_TYPE", 51.9, 367.85, 0.84, 0.84, 0, ["5"]],
  7221. ["DYNAMIC_RECT_TYPE", 149.9, 350.05, 0.751, 0.819, 0, [""]],
  7222. ["DYNAMIC_TRIANGLE_TYPE", 214.2, 132, 0.822, 0.76, 180, [""]],
  7223. ["DYNAMIC_TRIANGLE_TYPE", 192.5, 130.1, 0.81, 0.749,
  7224. 0, [""]
  7225. ],
  7226. ["DYNAMIC_TRIANGLE_TYPE", 171.7, 131.75, 0.822, 0.76, 180, [""]],
  7227. ["STATIC_BALK_1_TYPE", 232, 333.65, 0.749, 0.767, -22, [""]],
  7228. ["BONUS_STAR_TYPE", 105.4, 119.65, 0.68, 0.68, 0, [""]],
  7229. ["STATIC_BALK_1_TYPE", 193.85, 156.85, 0.875, 0.825, 0, [""]],
  7230. ["FAN_TYPE", 27.4, 147.1, 0.8, 0.8, 0, ["DEF_130_40"]],
  7231. ["STATIC_BALK_1_TYPE", 297, 287.2, 0.749, 0.767, -52, [""]],
  7232. ["STATIC_BALK_1_TYPE", 302, 119.1, 0.921, 0.877, -105, [""]],
  7233. ["BONUS_STAR_TYPE", 282, 215.35, 0.68, 0.68, 0, [""]],
  7234. ["STATIC_BOX_TYPE", 194.8, 368.1, 0.616, 0.615, 0, [""]],
  7235. ["STATIC_BALK_1_TYPE",
  7236. 129.8, 394.3, 0.743, 0.787, 53, [""]
  7237. ],
  7238. ["STATIC_BOX_TYPE", 174.05, 440, 0.75, 0.75, 0, [""]],
  7239. ["FAN_TYPE", 189.95, 416.55, 0.8, 0.8, 45, ["REV_630_10"]],
  7240. ["BONUS_STAR_TYPE", 158.35, 383.05, 0.68, 0.68, 0, [""]],
  7241. ["STATIC_BOX_TYPE", 120.2, 168, 0.616, 0.615, -22, [""]],
  7242. ["STATIC_BOX_TYPE", 136.85, 161.1, 0.616, 0.615, -22, [""]],
  7243. ["STATIC_BOX_TYPE", -1.3, 308.05, 0.5, 1.06, 14, ["INVIS"]],
  7244. ["HERO_TYPE", 192.65, 91.05, 0.68, 0.68, 0, [""]],
  7245. ["AIM_TYPE", 29.2, 319.75, 0.73, 0.73, 0, ["DEF"]]
  7246. ],
  7247. [
  7248. ["LAND_TYPE", 289.4, 407.6, 0.84, 0.84, 6, ["3"]],
  7249. ["LAND_TYPE", 249.5, 144.1,
  7250. 0.84, 0.84, 0, ["3"]
  7251. ],
  7252. ["LAND_TYPE", 180.4, 395.45, 0.84, 0.84, 6, ["3"]],
  7253. ["HERO_TYPE", 248.5, 60.05, 0.68, 0.68, 0, [""]],
  7254. ["BONUS_STAR_TYPE", 294.85, 201.95, 0.65, 0.65, 0, [""]],
  7255. ["BONUS_STAR_TYPE", 53.65, 173.65, 0.65, 0.65, 0, [""]],
  7256. ["BONUS_STAR_TYPE", 180.55, 345.15, 0.65, 0.65, 0, [""]],
  7257. ["DYNAMIC_RECT_TYPE", 248.2, 91.15, 0.7, 0.7, 0, [""]],
  7258. ["DYNAMIC_BOX_TYPE", 273.6, 110.1, 0.42, 0.42, 0, ["2"]],
  7259. ["DYNAMIC_BOX_TYPE", 221.9, 110.1, 0.42, 0.42, 0, ["3"]],
  7260. ["TELEGA_TYPE", 158.65, 242.3, 2.2, 0.85, 0, ["2_R_0_10"]],
  7261. ["AIM_TYPE", 303.1, 360.05, 0.74, 0.74, 6, ["REV"]]
  7262. ],
  7263. [
  7264. ["LAND_TYPE", 236, 242.95, 0.99, 0.84, 0, ["4"]],
  7265. ["LAND_TYPE", 59.9, 405.7, 0.84, 0.84, 0, ["5"]],
  7266. ["TELEPORT_TYPE", 199.85, 141.9, 1, 1, 0, ["A"]],
  7267. ["TELEPORT_TYPE", 274.3, 384.95, 1, 1, 0, ["A"]],
  7268. ["STATIC_BOX_TYPE", 233.9, 205.65, 0.75, 0.75, 0, [""]],
  7269. ["STATIC_BALK_1_TYPE", 41.95, 99.95, 0.7, 0.7, 0, [""]],
  7270. ["STATIC_BALK_1_TYPE", 116.9, 99.95, 0.7, 0.7, 0, [""]],
  7271. ["DYNAMIC_BOX_TYPE", 22.95, 368.7, 0.42, 0.42, 0, [""]],
  7272. ["DYNAMIC_BOX_TYPE", 93.95, 368.7, 0.42, 0.42, 0, [""]],
  7273. ["DYNAMIC_BOX_TYPE", 93.95, 346.7, 0.42, 0.42, 0, [""]],
  7274. ["DYNAMIC_BOX_TYPE", 22.95, 347.7,
  7275. 0.42, 0.42, 0, [""]
  7276. ],
  7277. ["DYNAMIC_RECT_TYPE", 58.9, 326, 0.924, 0.79, 0, [""]],
  7278. ["STATIC_BALK_1_TYPE", 220.95, 430.95, 0.7, 0.7, 0, [""]],
  7279. ["STATIC_BALK_1_TYPE", 295.9, 430.95, 0.7, 0.7, 0, [""]],
  7280. ["STATIC_BALK_1_TYPE", 149.55, 412.95, 0.7, 0.7, 30, [""]],
  7281. ["STATIC_BALK_1_TYPE", 292.85, 101.15, 0.7, 0.7, -90, [""]],
  7282. ["STATIC_BALK_1_TYPE", 292.85, 177.15, 0.7, 0.7, -90, [""]],
  7283. ["STATIC_BALK_1_TYPE", 190.85, 99.95, 0.7, 0.7, 0, [""]],
  7284. ["BOMB_TYPE", 60.4, 73.15, 0.8, 0.8, 0, ["140_700"]],
  7285. ["BOMB_TYPE", 178.35, 73.15, 0.8, 0.8, 0, ["140_700"]],
  7286. ["HERO_TYPE", 57.2, 293.45,
  7287. 0.68, 0.68, 0, [""]
  7288. ],
  7289. ["BONUS_STAR_TYPE", 173.95, 380.55, 0.68, 0.68, 0, [""]],
  7290. ["BONUS_STAR_TYPE", 161.85, 188.35, 0.68, 0.68, 0, [""]],
  7291. ["AIM_TYPE", 48.25, 189.95, 0.832, 0.888, 0, ["DEF_MOVED_R_0_10"]]
  7292. ],
  7293. [
  7294. ["LAND_TYPE", 69.8, 135.2, 0.84, 0.84, 0, ["5"]],
  7295. ["STATIC_BALK_1_TYPE", 164.85, 128.85, 0.7, 0.7, 15, [""]],
  7296. ["STATIC_BALK_1_TYPE", 206.8, 238.9, 0.7, 0.7, -15, [""]],
  7297. ["STATIC_BALK_1_TYPE", 279.25, 219.45, 0.7, 0.7, -15, [""]],
  7298. ["STATIC_BALK_1_TYPE", 133.8, 257.9, 0.7, 0.7, -15, [""]],
  7299. ["STATIC_BALK_1_TYPE", 38.8, 345.85, 0.7, 0.7, 15, [""]],
  7300. ["STATIC_BALK_1_TYPE",
  7301. 110.8, 365.8, 0.7, 0.7, 15, [""]
  7302. ],
  7303. ["BONUS_STAR_TYPE", 53.75, 291.15, 0.68, 0.68, 0, [""]],
  7304. ["STATIC_BALK_1_TYPE", 310.35, 162.35, 0.7, 0.7, -90, [""]],
  7305. ["BONUS_STAR_TYPE", 262.8, 167.15, 0.68, 0.68, 0, [""]],
  7306. ["STATIC_BALK_1_TYPE", 10.4, 289.05, 0.7, 0.7, -90, [""]],
  7307. ["FAN_TYPE", 37.75, 85.6, 0.8, 0.8, 0, ["DEF_100_40"]],
  7308. ["HERO_TYPE", 115, 87.9, 0.68, 0.68, 0, [""]],
  7309. ["AIM_TYPE", 266.25, 362, 1.185, 0.74, 0, ["REV_MOVED_R_0_10"]]
  7310. ],
  7311. [
  7312. ["LAND_TYPE", 53, 391.05, 0.84, 0.84, 0, [""]],
  7313. ["STATIC_BOX_TYPE", 280.4, 58.75, 0.592, 0.516, 20, [""]],
  7314. ["STATIC_BALK_1_TYPE", 310.6,
  7315. 143.15, 0.7, 0.7, -90, [""]
  7316. ],
  7317. ["FAN_TYPE", 302.45, 86.1, 0.8, 0.8, -15, ["REV_530_10"]],
  7318. ["STATIC_BOX_TYPE", 264.9, 52.75, 0.592, 0.516, 20, [""]],
  7319. ["STATIC_BALK_1_TYPE", 141.75, 374.65, 0.599, 0.631, 0, [""]],
  7320. ["STATIC_BALK_1_TYPE", 206.95, 383.65, 0.603, 0.627, 16, [""]],
  7321. ["STATIC_BALK_1_TYPE", 270, 402.65, 0.603, 0.627, 16, [""]],
  7322. ["STATIC_BALK_1_TYPE", 56.65, 49.75, 0.734, 0.7, 0, [""]],
  7323. ["STATIC_BALK_1_TYPE", 136.5, 49.75, 0.734, 0.7, 0, [""]],
  7324. ["STATIC_BALK_1_TYPE", 216.4, 49.75, 0.734, 0.7, 0, [""]],
  7325. ["STATIC_BALK_1_TYPE", 9.2, 82.75, 0.742, 0.7, -90, [""]],
  7326. ["STATIC_BALK_1_TYPE", 9.2, 163.35, 0.742, 0.7, -90, [""]],
  7327. ["STATIC_BALK_1_TYPE", 310.6, 219.15, 0.7, 0.7, -90, [""]],
  7328. ["STATIC_BALK_1_TYPE", 310.6, 294.15, 0.7, 0.7, -90, [""]],
  7329. ["STATIC_BALK_1_TYPE", 310.6, 370.15, 0.7, 0.7, -90, [""]],
  7330. ["STATIC_BALK_1_TYPE", 9.2, 242.75, 0.742, 0.7, -90, [""]],
  7331. ["STATIC_BALK_1_TYPE", 9.2, 323.25, 0.742, 0.7, -90, [""]],
  7332. ["BOMB_TYPE", 284.7, 380.25, 0.8, 0.8, 0, ["140_300"]],
  7333. ["STATIC_BALK_1_TYPE", 247.15, 199.7, 0.725, 0.7, -90, [""]],
  7334. ["STATIC_BALK_1_TYPE", 220.65, 170.15, 0.599, 0.631, -15, [""]],
  7335. ["STATIC_BOX_TYPE", 185.25,
  7336. 180.45, 0.75, 0.75, -10, [""]
  7337. ],
  7338. ["STATIC_BOX_TYPE", 169.35, 92.4, 0.75, 0.75, -10, [""]],
  7339. ["DYNAMIC_RECT_TYPE", 196.55, 125.55, 0.79, 0.79, -100, [""]],
  7340. ["STATIC_BALK_1_TYPE", 247.15, 278.7, 0.725, 0.7, -90, [""]],
  7341. ["STATIC_BALK_1_TYPE", 270.5, 324.95, 0.599, 0.631, 0, [""]],
  7342. ["BOMB_TYPE", 279.25, 297.65, 0.8, 0.8, 0, ["140_1300"]],
  7343. ["STATIC_BALK_1_TYPE", 48.9, 282.55, 0.603, 0.627, 8, [""]],
  7344. ["STATIC_BALK_1_TYPE", 114.1, 291.8, 0.603, 0.627, 8, [""]],
  7345. ["BONUS_STAR_TYPE", 257.25, 115.5, 0.68, 0.68, 0, [""]],
  7346. ["BONUS_STAR_TYPE", 66.3, 249.75, 0.68, 0.68, 0, [""]],
  7347. ["STATIC_BOX_TYPE", 26.8, 212.95, 0.682, 0.662, 5, [""]],
  7348. ["STATIC_BOX_TYPE", 110.15, 219.3, 0.682, 0.662, 5, [""]],
  7349. ["DYNAMIC_RECT_TYPE", 70.6, 198.25, 0.936, 0.79, 5, [""]],
  7350. ["BONUS_STAR_TYPE", 116.35, 343.65, 0.68, 0.68, 0, [""]],
  7351. ["HERO_TYPE", 279.55, 251.3, 0.68, 0.68, 0, [""]],
  7352. ["AIM_TYPE", 43.2, 342.5, 0.73, 0.73, 0, ["DEF"]]
  7353. ],
  7354. [
  7355. ["LAND_TYPE", 208, 292.45, 0.84, 0.84, 0, ["4"]],
  7356. ["LAND_TYPE", 74.5, 166.4, 0.84, 0.84, 0, ["5"]],
  7357. ["HARD_BOX_TYPE", 169.75, 253, 1, 1, 0, ["5"]],
  7358. ["STATIC_BALK_1_TYPE", 113.75, 276.75, 0.7, 0.7, 0, [""]],
  7359. ["DYNAMIC_RECT_TYPE", 72.5,
  7360. 86.85, 0.79, 0.79, 0, [""]
  7361. ],
  7362. ["DYNAMIC_BOX_TYPE", 43.65, 130, 0.42, 0.42, 0, [""]],
  7363. ["DYNAMIC_BOX_TYPE", 103.65, 130, 0.42, 0.42, 0, [""]],
  7364. ["DYNAMIC_BOX_TYPE", 43.65, 107, 0.42, 0.42, 0, [""]],
  7365. ["DYNAMIC_BOX_TYPE", 103.65, 107, 0.42, 0.42, 0, [""]],
  7366. ["STATIC_BALK_1_TYPE", 253.25, 227.65, 0.7, 0.7, -90, [""]],
  7367. ["STATIC_BOX_TYPE", 252.6, 180.5, 0.75, 0.75, 0, [""]],
  7368. ["BOMB_TYPE", 77.75, 61.25, 0.8, 0.8, 0, ["140_600"]],
  7369. ["STATIC_BALK_1_TYPE", 38.1, 329.75, 0.7, 0.7, 30, [""]],
  7370. ["BONUS_STAR_TYPE", 47.8, 296.2, 0.68, 0.68, 0, [""]],
  7371. ["HERO_TYPE", 94.6, 246.6, 0.68, 0.68,
  7372. 0, [""]
  7373. ],
  7374. ["BONUS_STAR_TYPE", 109.6, 344.6, 0.68, 0.68, 0, [""]],
  7375. ["STATIC_BALK_1_TYPE", 39.75, 380.5, 0.7, 0.7, -35, [""]],
  7376. ["AIM_TYPE", 220.6, 378.45, 1.42, 0.74, 0, ["REV_MOVED_R_0_10"]]
  7377. ],
  7378. [
  7379. ["LAND_TYPE", 56, 423.95, 0.84, 0.84, 0, [""]],
  7380. ["STATIC_BALK_1_TYPE", 1, 99.85, 0.7, 0.7, 0, [""]],
  7381. ["FAN_TYPE", 23, 68.6, 0.8, 0.8, 0, ["DEF_100_40"]],
  7382. ["STATIC_BALK_1_TYPE", 76, 99.85, 0.7, 0.7, 0, [""]],
  7383. ["STATIC_BALK_1_TYPE", 151, 99.85, 0.7, 0.7, 0, [""]],
  7384. ["STATIC_BALK_1_TYPE", 151, 195.85, 0.7, 0.7, 0, [""]],
  7385. ["STATIC_BALK_1_TYPE", 226, 195.85, 0.7, 0.7, 0, [""]],
  7386. ["STATIC_BALK_1_TYPE",
  7387. 301, 195.85, 0.7, 0.7, 0, [""]
  7388. ],
  7389. ["STATIC_BALK_1_TYPE", 17, 294.85, 0.7, 0.7, 0, [""]],
  7390. ["STATIC_BALK_1_TYPE", 92, 294.85, 0.7, 0.7, 0, [""]],
  7391. ["STATIC_BALK_1_TYPE", 167, 294.85, 0.7, 0.7, 0, [""]],
  7392. ["STATIC_BALK_1_TYPE", 311.95, 99.85, 0.7, 0.7, 0, [""]],
  7393. ["FAN_TYPE", 299.75, 163.85, 0.8, 0.8, 0, ["REV_130_10"]],
  7394. ["FAN_TYPE", 23, 262.6, 0.8, 0.8, 0, ["DEF_200_10"]],
  7395. ["STATIC_BALK_1_TYPE", 151, 404.8, 0.7, 0.7, 0, [""]],
  7396. ["STATIC_BALK_1_TYPE", 226, 404.8, 0.7, 0.7, 0, [""]],
  7397. ["STATIC_BALK_1_TYPE", 301, 404.8, 0.7, 0.7, 0, [""]],
  7398. ["FAN_TYPE", 299.75, 372.8, 0.8, 0.8, 0, ["REV_150_10"]],
  7399. ["HERO_TYPE", 76.95, 67.95, 0.68, 0.68, 0, [""]],
  7400. ["BONUS_STAR_TYPE", 83.85, 159.3, 0.68, 0.68, 0, [""]],
  7401. ["BONUS_STAR_TYPE", 270.8, 299.1, 0.68, 0.68, 0, [""]],
  7402. ["BONUS_STAR_TYPE", 239.8, 62.85, 0.68, 0.68, 0, [""]],
  7403. ["AIM_TYPE", 32.2, 378, 0.73, 0.73, 0, ["DEF"]]
  7404. ],
  7405. [
  7406. ["LAND_TYPE", 175.85, 424.35, 0.746, 0.643, 0, [""]],
  7407. ["TELEPORT_TYPE", 263.7, 350.9, 1, 1, 0, ["A"]],
  7408. ["TELEPORT_TYPE", 31.85, 181.85, 1, 1, 0, ["A"]],
  7409. ["TELEGA_TYPE", 160, 102.3, 2.171, 0.85, 0, ["2_L_0_10"]],
  7410. ["STATIC_BALK_1_TYPE", 94, 391.4, 0.7, 0.7, 30, [""]],
  7411. ["STATIC_BALK_1_TYPE",
  7412. 29, 353.25, 0.7, 0.7, 30, [""]
  7413. ],
  7414. ["HERO_TYPE", 161.2, 72.2, 0.68, 0.68, 0, [""]],
  7415. ["STATIC_BALK_1_TYPE", 37.8, 130.85, 0.7, 0.7, 0, [""]],
  7416. ["STATIC_BALK_1_TYPE", 112.8, 130.85, 0.7, 0.7, 0, [""]],
  7417. ["STATIC_BALK_1_TYPE", 187.8, 130.85, 0.7, 0.7, 0, [""]],
  7418. ["STATIC_BALK_1_TYPE", 341.75, 130.1, 0.7, 0.7, 0, [""]],
  7419. ["STATIC_BOX_TYPE", 225.85, 297.45, 0.75, 0.75, 0, [""]],
  7420. ["STATIC_BOX_TYPE", 301.85, 297.45, 0.75, 0.75, 0, [""]],
  7421. ["DYNAMIC_RECT_TYPE", 102, 207.1, 0.79, 0.79, 0, [""]],
  7422. ["LAND_TYPE", 101.6, 266.6, 0.746, 0.643, 0, [""]],
  7423. ["DYNAMIC_TRIANGLE_TYPE", 80.9, 237.55,
  7424. 0.68, 0.68, -60, [""]
  7425. ],
  7426. ["DYNAMIC_TRIANGLE_TYPE", 130.9, 237.55, 0.68, 0.68, -60, [""]],
  7427. ["STATIC_BALK_1_TYPE", 203.55, 314.25, 0.61, 0.61, 0, [""]],
  7428. ["STATIC_BOX_TYPE", 159.95, 309.7, 0.75, 0.75, 0, [""]],
  7429. ["BONUS_STAR_TYPE", 266.85, 205.7, 0.68, 0.68, 0, [""]],
  7430. ["BONUS_STAR_TYPE", 76.1, 338, 0.68, 0.68, 0, [""]],
  7431. ["BONUS_STAR_TYPE", 30.9, 61.1, 0.68, 0.68, 0, [""]],
  7432. ["HARD_RECT_TYPE", 263.7, 276.25, 0.856, 0.857, 0, [""]],
  7433. ["BOMB_TYPE", 101.7, 181.4, 0.8, 0.8, 0, ["90_1000"]],
  7434. ["AIM_TYPE", 185.35, 381.1, 0.74, 0.74, 0, ["REV"]]
  7435. ],
  7436. [
  7437. ["STATIC_BOX_TYPE", 286.55, 344.25,
  7438. 0.5, 1.06, -12, ["INVIS"]
  7439. ],
  7440. ["LAND_TYPE", 246.85, 399.45, 0.84, 0.84, 0, ["5"]],
  7441. ["LAND_TYPE", 265.5, 247.55, 0.765, 0.807, 0, [""]],
  7442. ["STATIC_BALK_1_TYPE", 47, 55.45, 0.7, 0.7, 0, [""]],
  7443. ["STATIC_BALK_1_TYPE", 123.2, 55.45, 0.7, 0.7, 0, [""]],
  7444. ["STATIC_BALK_1_TYPE", 199.4, 55.45, 0.7, 0.7, 0, [""]],
  7445. ["STATIC_BALK_1_TYPE", 267.35, 82.8, 0.7, 0.7, 45, [""]],
  7446. ["BOMB_TYPE", 265.7, 205.4, 0.8, 0.8, 0, ["140_1000"]],
  7447. ["TELEGA_TYPE", 173, 165.55, 2.037, 0.85, 0, ["1_L_0_10"]],
  7448. ["STATIC_BALK_1_TYPE", 17.4, 101.25, 0.7, 0.7, -90, [""]],
  7449. ["STATIC_BALK_1_TYPE", 17.4, 175.25,
  7450. 0.7, 0.7, -90, [""]
  7451. ],
  7452. ["STATIC_BOX_TYPE", 21.1, 258.8, 0.75, 0.75, 0, [""]],
  7453. ["STATIC_BOX_TYPE", 112.2, 258.8, 0.75, 0.75, 0, [""]],
  7454. ["DYNAMIC_RECT_TYPE", 68, 221.75, 0.954, 0.79, 0, [""]],
  7455. ["STATIC_BALK_1_TYPE", 130.4, 236, 0.64, 0.64, -90, [""]],
  7456. ["STATIC_BALK_1_TYPE", 48.2, 395.85, 0.7, 0.7, -7, [""]],
  7457. ["STATIC_BALK_1_TYPE", 123.9, 387.1, 0.7, 0.7, -7, [""]],
  7458. ["FAN_TYPE", 28.05, 364.9, 0.8, 0.8, -8, ["DEF_130_40"]],
  7459. ["GLASS_BLOCK_TYPE", 68.35, 238.75, 0.973, 0.79, 0, [""]],
  7460. ["HERO_TYPE", 175.85, 135.2, 0.68, 0.68, 0, [""]],
  7461. ["BONUS_STAR_TYPE", 62.85, 114.25, 0.65,
  7462. 0.65, 0, [""]
  7463. ],
  7464. ["BONUS_STAR_TYPE", 67.3, 287.7, 0.65, 0.65, 0, [""]],
  7465. ["BONUS_STAR_TYPE", 169.4, 340.2, 0.65, 0.65, 0, [""]],
  7466. ["AIM_TYPE", 258.35, 351.15, 0.74, 0.74, 0, ["REV"]]
  7467. ],
  7468. [
  7469. ["STATIC_BOX_TYPE", 84.05, 70.2, 0.5, 1.06, 15, ["INVIS"]],
  7470. ["STATIC_BOX_TYPE", 258.4, 331.3, 0.75, 0.75, 0, [""]],
  7471. ["BONUS_STAR_TYPE", 187.85, 321.9, 0.65, 0.65, 0, [""]],
  7472. ["BONUS_STAR_TYPE", 61.55, 219.75, 0.65, 0.65, 0, [""]],
  7473. ["BONUS_STAR_TYPE", 221.45, 110.25, 0.65, 0.65, 0, [""]],
  7474. ["DYNAMIC_RECT_TYPE", 52.2, 161.75, 0.918, 0.989, 0, [""]],
  7475. ["DYNAMIC_BOX_TYPE", 25.1, 142.95, 0.42,
  7476. 0.42, 0, [""]
  7477. ],
  7478. ["DYNAMIC_BOX_TYPE", 76.05, 142.95, 0.42, 0.42, 0, [""]],
  7479. ["LAND_TYPE", 128.15, 124.6, 0.702, 0.643, -9, [""]],
  7480. ["DYNAMIC_BOX_TYPE", 19.4, 322.25, 0.42, 0.42, 0, ["3"]],
  7481. ["DYNAMIC_BOX_TYPE", 95.7, 321.75, 0.42, 0.42, 0, ["3"]],
  7482. ["DYNAMIC_BOX_TYPE", 95.85, 300.6, 0.42, 0.42, 0, [""]],
  7483. ["DYNAMIC_BOX_TYPE", 19.85, 300.1, 0.42, 0.42, 0, [""]],
  7484. ["DYNAMIC_RECT_TYPE", 58.15, 279.25, 0.918, 0.989, 0, [""]],
  7485. ["HARD_BOX_TYPE", 12.85, 183.9, 0.877, 0.852, 0, ["5"]],
  7486. ["HARD_BOX_TYPE", 89, 183.9, 0.877, 0.852, 0, ["5"]],
  7487. ["STATIC_BALK_1_TYPE", 59.35, 342.15, 0.903,
  7488. 0.886, 0, [""]
  7489. ],
  7490. ["STATIC_BALK_1_TYPE", 183.5, 424.75, 0.801, 0.817, -53, [""]],
  7491. ["STATIC_BALK_1_TYPE", 233.4, 356.8, 0.747, 0.919, -55, [""]],
  7492. ["STATIC_BALK_1_TYPE", 218.6, 211.85, 0.64, 0.92, -113, [""]],
  7493. ["STATIC_BOX_TYPE", 13.5, 208.2, 0.75, 0.75, 0, [""]],
  7494. ["STATIC_BALK_1_TYPE", 313.85, 266.15, 0.779, 0.919, -110, [""]],
  7495. ["STATIC_BOX_TYPE", 89, 208.2, 0.75, 0.75, 0, [""]],
  7496. ["FAN_TYPE", 286.65, 320.25, 0.8, 0.8, 75, ["REV_780_15"]],
  7497. ["FAN_TYPE", 154.25, 405.65, 0.8, 0.8, -52, ["DEF_230_40"]],
  7498. ["HERO_TYPE", 50.35, 113.35, 0.68, 0.68, 0, [""]],
  7499. ["STATIC_BALK_1_TYPE",
  7500. 186.9, 147.1, 0.64, 0.92, -120, [""]
  7501. ],
  7502. ["AIM_TYPE", 114.35, 81.25, 0.73, 0.73, -9, ["DEF"]]
  7503. ]
  7504. ],
  7505. allBgIndexes = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  7506. isEditorDebug = !1,
  7507. editorLevelToLoad = 3,
  7508. manifest = [{
  7509. src: PRELOADER_LOGO,
  7510. id: "preloaderlogo"
  7511. }, {
  7512. src: "soccerassets.png",
  7513. id: "zoespritesheet"
  7514. }],
  7515. zoeCFG = {
  7516. framerate: 24,
  7517. images: ["assets/soccerassets.png"],
  7518. frames: [
  7519. [946, 1742, 37, 33, 0, 17, 15],
  7520. [1051, 1742, 37, 33, 0, 17, 15],
  7521. [909, 1742, 37, 33, 0, 17, 15],
  7522. [1252, 2, 312, 244, 0, 159, 148],
  7523. [131, 692, 128, 127, 0, 63, 59],
  7524. [846, 1694, 230, 45, 0, 104, 17],
  7525. [448, 1555,
  7526. 74, 73, 0, 35, 31
  7527. ],
  7528. [355, 936, 87, 86, 0, 41, 41],
  7529. [529, 936, 87, 86, 0, 41, 41],
  7530. [473, 1628, 168, 62, 0, 81, 30],
  7531. [1242, 1105, 77, 76, 0, 37, 34],
  7532. [700, 1028, 77, 77, 0, 37, 34],
  7533. [855, 1028, 77, 77, 0, 37, 34],
  7534. [546, 1105, 78, 77, 0, 37, 35],
  7535. [442, 936, 87, 86, 0, 41, 39],
  7536. [1920, 1555, 67, 66, 0, 31, 29],
  7537. [1987, 1555, 62, 61, 0, 29, 27],
  7538. [276, 1742, 36, 40, 0, 0, 0],
  7539. [281, 362, 201, 182, 0, 95, 30],
  7540. [1751, 820, 87, 93, 0, 41, 48],
  7541. [1664, 820, 87, 93, 0, 41, 48],
  7542. [1838, 820, 87, 93, 0, 41, 48],
  7543. [482, 362, 298, 166, 0, 146, 141],
  7544. [1578, 936, 80, 79, 0, 39, 36],
  7545. [853, 936, 93, 82, 0, 46, 43],
  7546. [1409, 1628, 161, 50, 0, 80, 23],
  7547. [2, 1694,
  7548. 261, 48, 0, 125, 17
  7549. ],
  7550. [1076, 1694, 141, 45, 0, 71, 21],
  7551. [2, 1785, 174, 30, 0, 84, 12],
  7552. [1274, 1742, 228, 32, 0, 113, 14],
  7553. [1649, 1742, 149, 31, 0, 73, 14],
  7554. [1088, 1742, 186, 32, 0, 93, 14],
  7555. [1798, 1742, 206, 30, 0, 102, 12],
  7556. [176, 1785, 150, 30, 0, 74, 12],
  7557. [2, 820, 168, 116, 0, 86, 57],
  7558. [1019, 1628, 276, 52, 0, 136, 24],
  7559. [2, 544, 160, 148, 0, 73, 68],
  7560. [540, 1694, 306, 47, 0, 150, 20],
  7561. [981, 2, 271, 275, 0, 128, 148],
  7562. [270, 544, 139, 147, 0, 71, 81],
  7563. [1564, 2, 221, 221, 0, 109, 108],
  7564. [2044, 2, 4, 4, 0, 200, 200],
  7565. [1741, 1628, 159, 49, 0, 78, 18],
  7566. [170, 820, 314, 113, 0, 154, 34],
  7567. [1900, 1628, 138, 49, 0, 96, 23],
  7568. [843, 1785, 157,
  7569. 26, 0, 75, 11
  7570. ],
  7571. [1740, 936, 233, 78, 0, 99, 44],
  7572. [2, 1628, 204, 66, 0, 100, 32],
  7573. [2017, 820, 28, 45, 0, -4, 0],
  7574. [1374, 1694, 35, 44, 0, 0, 0],
  7575. [1462, 1694, 33, 44, 0, -1, 0],
  7576. [1495, 1694, 35, 44, 0, 0, 0],
  7577. [1614, 1694, 33, 44, 0, -1, 0],
  7578. [1682, 1694, 35, 44, 0, 0, 0],
  7579. [1647, 1694, 35, 44, 0, 0, 0],
  7580. [1581, 1694, 33, 44, 0, -1, 0],
  7581. [1340, 1694, 34, 44, 0, -1, 0],
  7582. [2013, 1105, 35, 45, 0, 0, 1],
  7583. [1113, 1785, 114, 26, 0, 55, 11],
  7584. [1388, 820, 94, 94, 0, 0, 0],
  7585. [271, 1628, 138, 66, 0, 67, 32],
  7586. [817, 1555, 138, 72, 0, 67, 33],
  7587. [1438, 1555, 138, 68, 0, 67, 32],
  7588. [1576, 1555, 138, 68, 0, 67, 32],
  7589. [1714, 1555, 138, 67, 0, 67, 32],
  7590. [598, 820, 114,
  7591. 113, 0, 55, 54
  7592. ],
  7593. [1508, 692, 120, 119, 0, 57, 58],
  7594. [382, 692, 124, 123, 0, 60, 59],
  7595. [1031, 692, 120, 121, 0, 58, 59],
  7596. [1E3, 1785, 113, 26, 0, 54, 10],
  7597. [499, 1785, 113, 26, 0, 54, 10],
  7598. [1627, 1628, 57, 50, 0, 27, 24],
  7599. [874, 1742, 35, 34, 0, 15, 15],
  7600. [612, 1785, 116, 26, 0, 55, 10],
  7601. [517, 1742, 35, 36, 0, 15, 16],
  7602. [481, 1742, 36, 36, 0, 15, 16],
  7603. [717, 1742, 35, 35, 0, 15, 16],
  7604. [587, 1742, 35, 35, 0, 15, 16],
  7605. [752, 1742, 35, 35, 0, 15, 15],
  7606. [552, 1742, 35, 36, 0, 15, 16],
  7607. [1684, 1628, 57, 50, 0, 27, 24],
  7608. [522, 1555, 73, 73, 0, 35, 34],
  7609. [701, 1628, 58, 58, 0, 27, 27],
  7610. [759, 1628, 59, 58, 0, 27, 27],
  7611. [818, 1628, 58, 56, 0, 27, 26],
  7612. [1570,
  7613. 1628, 57, 50, 0, 27, 24
  7614. ],
  7615. [641, 1628, 60, 60, 0, 28, 29],
  7616. [263, 1694, 50, 48, 0, 24, 22],
  7617. [202, 936, 72, 88, 0, 35, 44],
  7618. [274, 936, 81, 87, 0, 30, 44],
  7619. [1693, 544, 150, 132, 0, 40, 44],
  7620. [1284, 1694, 56, 44, 0, 27, 22],
  7621. [1502, 1742, 68, 32, 0, 34, 14],
  7622. [787, 1742, 87, 35, 0, 46, 14],
  7623. [1570, 1742, 79, 32, 0, 45, 14],
  7624. [622, 1742, 95, 35, 0, 55, 15],
  7625. [1993, 1258, 56, 65, 0, 26, 36],
  7626. [409, 1628, 64, 65, 0, 28, 38],
  7627. [1295, 1628, 55, 51, 0, 25, 27],
  7628. [206, 1628, 65, 66, 0, 29, 33],
  7629. [1436, 936, 82, 79, 0, 37, 43],
  7630. [1022, 936, 89, 81, 0, 39, 44],
  7631. [107, 936, 95, 88, 0, 43, 46],
  7632. [1180, 820, 102, 95, 0, 44, 49],
  7633. [2, 936, 105, 92, 0, 45, 47],
  7634. [1282,
  7635. 820, 106, 94, 0, 47, 48
  7636. ],
  7637. [1559, 820, 105, 93, 0, 44, 49],
  7638. [350, 1742, 131, 37, 0, 64, 17],
  7639. [876, 1628, 90, 55, 0, 45, 26],
  7640. [1981, 1182, 68, 69, 0, 32, 33],
  7641. [1852, 1555, 68, 67, 0, 31, 33],
  7642. [385, 1785, 114, 27, 0, 55, 11],
  7643. [326, 1785, 30, 30, 0, 14, 15],
  7644. [2004, 1742, 33, 30, 0, 15, 14],
  7645. [356, 1785, 29, 28, 0, 13, 12],
  7646. [983, 1742, 35, 33, 0, 16, 16],
  7647. [1227, 1785, 35, 25, 0, 16, 8],
  7648. [1262, 1785, 127, 23, 0, 65, 10],
  7649. [1516, 1785, 127, 23, 0, 65, 10],
  7650. [1389, 1785, 127, 23, 0, 65, 10],
  7651. [1350, 1628, 59, 50, 0, 27, 22],
  7652. [728, 1785, 115, 26, 0, 54, 10],
  7653. [312, 1742, 38, 38, 0, 17, 17],
  7654. [427, 1694, 113, 48, 0, 54, 22],
  7655. [313, 1694, 114, 48,
  7656. 0, 55, 22
  7657. ],
  7658. [1104, 1555, 334, 72, 0, 1, -2],
  7659. [1418, 1482, 334, 73, 0, 1, -1],
  7660. [232, 1408, 334, 74, 0, 1, 0],
  7661. [566, 1408, 334, 74, 0, 1, 0],
  7662. [1414, 1182, 334, 75, 0, 1, 1],
  7663. [1080, 1182, 334, 75, 0, 1, 1],
  7664. [1198, 1408, 334, 74, 0, 1, 0],
  7665. [1680, 1408, 334, 74, 0, 1, 0],
  7666. [634, 1482, 334, 73, 0, 1, -1],
  7667. [300, 1482, 334, 73, 0, 1, -1],
  7668. [2, 2, 554, 360, 0, 0, 0],
  7669. [556, 2, 425, 314, 0, 0, 0],
  7670. [2022, 692, 25, 46, 0, -23, -13],
  7671. [1251, 1694, 33, 44, 0, -20, -14],
  7672. [2017, 1028, 32, 45, 0, -21, -15],
  7673. [2014, 1408, 34, 45, 0, -18, -14],
  7674. [1217, 1694, 34, 45, 0, -21, -15],
  7675. [1907, 1694, 34, 43, 0, -20, -16],
  7676. [245, 1742, 31, 42, 0, -22, -17],
  7677. [215, 1742,
  7678. 30, 43, 0, -22, -17
  7679. ],
  7680. [1875, 1694, 32, 43, 0, -21, -16],
  7681. [108, 1742, 53, 43, 0, -11, -16],
  7682. [1994, 1694, 45, 43, 0, -14, -17],
  7683. [1941, 1694, 53, 43, 0, -10, -16],
  7684. [1409, 1694, 53, 44, 0, -10, -15],
  7685. [161, 1742, 54, 43, 0, -11, -15],
  7686. [2, 1742, 52, 43, 0, -11, -16],
  7687. [54, 1742, 54, 43, 0, -11, -16],
  7688. [1824, 1694, 51, 43, 0, -11, -16],
  7689. [1530, 1694, 51, 44, 0, -11, -16],
  7690. [1717, 1694, 51, 43, 0, -11, -16],
  7691. [1768, 1694, 56, 43, 0, -10, -16],
  7692. [310, 1182, 76, 76, 0, 36, 36],
  7693. [1165, 1028, 76, 77, 0, 36, 37],
  7694. [540, 1258, 76, 75, 0, 36, 36],
  7695. [1004, 1258, 75, 75, 0, 36, 36],
  7696. [1290, 1333, 74, 74, 0, 35, 36],
  7697. [2, 1482, 74, 73, 0, 35, 36],
  7698. [1142,
  7699. 1333, 74, 74, 0, 35, 37
  7700. ],
  7701. [1068, 1333, 74, 74, 0, 35, 38],
  7702. [995, 1333, 73, 74, 0, 35, 38],
  7703. [1762, 1258, 75, 75, 0, 36, 39],
  7704. [1154, 1258, 75, 75, 0, 36, 39],
  7705. [1533, 1258, 75, 75, 0, 36, 39],
  7706. [386, 1182, 76, 76, 0, 36, 40],
  7707. [78, 1182, 76, 76, 0, 36, 40],
  7708. [1241, 1028, 76, 77, 0, 36, 40],
  7709. [1317, 1028, 78, 77, 0, 37, 40],
  7710. [1395, 1028, 78, 77, 0, 37, 40],
  7711. [1706, 1028, 78, 77, 0, 37, 40],
  7712. [1549, 1028, 79, 77, 0, 37, 40],
  7713. [1628, 1028, 78, 77, 0, 36, 40],
  7714. [154, 1182, 78, 76, 0, 36, 39],
  7715. [616, 1182, 78, 76, 0, 36, 39],
  7716. [462, 1182, 78, 76, 0, 36, 39],
  7717. [2, 1258, 78, 75, 0, 36, 38],
  7718. [306, 1258, 78, 75, 0, 36, 38],
  7719. [1686, 1258, 76, 75, 0, 35, 38],
  7720. [232, 1333, 76, 74, 0, 35, 38],
  7721. [539, 1333, 76, 74, 0, 35, 38],
  7722. [1343, 1482, 75, 73, 0, 35, 37],
  7723. [373, 1555, 75, 73, 0, 35, 37],
  7724. [1030, 1555, 74, 72, 0, 35, 36],
  7725. [955, 1555, 75, 72, 0, 36, 36],
  7726. [308, 1333, 76, 74, 0, 36, 37],
  7727. [768, 1333, 76, 74, 0, 36, 37],
  7728. [844, 1333, 77, 74, 0, 37, 37],
  7729. [926, 1258, 78, 75, 0, 37, 37],
  7730. [848, 1258, 78, 75, 0, 37, 37],
  7731. [770, 1258, 78, 75, 0, 37, 37],
  7732. [232, 1182, 78, 76, 0, 37, 38],
  7733. [624, 1105, 78, 77, 0, 37, 38],
  7734. [702, 1105, 78, 77, 0, 37, 38],
  7735. [780, 1105, 77, 77, 0, 37, 38],
  7736. [1863, 1028, 77, 77, 0, 37, 38],
  7737. [1940, 1028, 77, 77, 0, 37, 38],
  7738. [314, 1105, 76, 77, 0, 37, 38],
  7739. [155, 1258, 76, 75, 0, 37, 37],
  7740. [80, 1258, 75, 75, 0, 37, 37],
  7741. [1512, 1333, 75, 74, 0, 37, 36],
  7742. [1664, 1333, 74, 74, 0, 37, 36],
  7743. [2, 1555, 74, 73, 0, 37, 35],
  7744. [158, 1333, 74, 74, 0, 37, 35],
  7745. [1738, 1333, 74, 74, 0, 37, 34],
  7746. [1364, 1333, 74, 74, 0, 37, 34],
  7747. [1004, 1182, 76, 75, 0, 38, 35],
  7748. [1089, 1105, 76, 77, 0, 38, 36],
  7749. [540, 1182, 76, 76, 0, 38, 36],
  7750. [857, 1105, 78, 77, 0, 39, 37],
  7751. [158, 1105, 78, 77, 0, 39, 37],
  7752. [236, 1105, 78, 77, 0, 39, 37],
  7753. [544, 1028, 78, 77, 0, 39, 37],
  7754. [694, 1182, 78, 75, 0, 39, 36],
  7755. [850, 1182, 78, 75, 0, 39, 36],
  7756. [1587, 1333, 77, 74, 0, 38, 36],
  7757. [1119, 1482, 75, 73, 0, 37, 35],
  7758. [1194, 1482, 74, 73, 0, 36, 35],
  7759. [223, 1555, 75, 73, 0, 36,
  7760. 35
  7761. ],
  7762. [298, 1555, 75, 73, 0, 35, 36],
  7763. [692, 1333, 76, 74, 0, 35, 36],
  7764. [615, 1333, 77, 74, 0, 36, 36],
  7765. [1748, 1182, 78, 75, 0, 37, 36],
  7766. [772, 1182, 78, 75, 0, 37, 36],
  7767. [935, 1105, 78, 77, 0, 37, 37],
  7768. [390, 1105, 78, 77, 0, 37, 37],
  7769. [468, 1105, 78, 77, 0, 37, 37],
  7770. [1165, 1105, 77, 77, 0, 36, 37],
  7771. [1319, 1105, 76, 76, 0, 36, 36],
  7772. [1472, 1105, 76, 76, 0, 36, 36],
  7773. [1013, 1105, 76, 77, 0, 36, 37],
  7774. [928, 1182, 76, 75, 0, 36, 36],
  7775. [231, 1258, 75, 75, 0, 36, 36],
  7776. [1438, 1333, 74, 74, 0, 35, 36],
  7777. [149, 1555, 74, 73, 0, 35, 36],
  7778. [1216, 1333, 74, 74, 0, 35, 37],
  7779. [921, 1333, 74, 74, 0, 35, 38],
  7780. [76, 1555, 73, 73, 0, 35, 38],
  7781. [1812, 1333, 75, 74,
  7782. 0, 36, 39
  7783. ],
  7784. [1307, 1258, 75, 75, 0, 36, 39],
  7785. [1382, 1258, 75, 75, 0, 36, 39],
  7786. [2, 1182, 76, 76, 0, 36, 40],
  7787. [1702, 1105, 76, 76, 0, 36, 40],
  7788. [1548, 1105, 76, 76, 0, 36, 40],
  7789. [80, 1105, 78, 77, 0, 37, 40],
  7790. [2, 1105, 78, 77, 0, 37, 40],
  7791. [1856, 1105, 78, 76, 0, 37, 40],
  7792. [1934, 1105, 79, 76, 0, 37, 40],
  7793. [1784, 1028, 79, 77, 0, 37, 40],
  7794. [1778, 1105, 78, 76, 0, 36, 39],
  7795. [80, 1333, 78, 75, 0, 36, 39],
  7796. [1915, 1258, 78, 75, 0, 36, 39],
  7797. [1837, 1258, 78, 75, 0, 36, 39],
  7798. [384, 1333, 78, 74, 0, 36, 38],
  7799. [462, 1333, 77, 74, 0, 35, 38],
  7800. [1887, 1333, 76, 74, 0, 35, 38],
  7801. [968, 1482, 76, 73, 0, 35, 37],
  7802. [1268, 1482, 75, 73, 0, 34, 37],
  7803. [1044, 1482,
  7804. 75, 73, 0, 35, 37
  7805. ],
  7806. [225, 1482, 75, 73, 0, 35, 37],
  7807. [595, 1555, 75, 72, 0, 36, 36],
  7808. [150, 1482, 75, 73, 0, 36, 36],
  7809. [1963, 1333, 76, 74, 0, 36, 37],
  7810. [2, 1408, 76, 74, 0, 36, 37],
  7811. [78, 1408, 77, 74, 0, 37, 37],
  7812. [1903, 1182, 78, 75, 0, 37, 37],
  7813. [1229, 1258, 78, 75, 0, 37, 37],
  7814. [462, 1258, 78, 75, 0, 37, 37],
  7815. [1624, 1105, 78, 76, 0, 37, 38],
  7816. [155, 1028, 78, 77, 0, 37, 38],
  7817. [1087, 1028, 78, 77, 0, 37, 38],
  7818. [1010, 1028, 77, 77, 0, 37, 38],
  7819. [1973, 936, 77, 77, 0, 37, 38],
  7820. [78, 1028, 77, 77, 0, 37, 38],
  7821. [2, 1028, 76, 77, 0, 37, 38],
  7822. [694, 1258, 76, 75, 0, 37, 37],
  7823. [1079, 1258, 75, 75, 0, 37, 37],
  7824. [1049, 1408, 75, 74, 0, 37, 36],
  7825. [1124, 1408,
  7826. 74, 74, 0, 37, 36
  7827. ],
  7828. [76, 1482, 74, 73, 0, 37, 35],
  7829. [1532, 1408, 74, 74, 0, 37, 35],
  7830. [1606, 1408, 74, 74, 0, 37, 34],
  7831. [975, 1408, 74, 74, 0, 37, 34],
  7832. [1457, 1258, 76, 75, 0, 38, 35],
  7833. [1473, 1028, 76, 77, 0, 38, 36],
  7834. [1395, 1105, 77, 76, 0, 38, 36],
  7835. [233, 1028, 78, 77, 0, 39, 37],
  7836. [777, 1028, 78, 77, 0, 39, 37],
  7837. [622, 1028, 78, 77, 0, 39, 37],
  7838. [616, 1258, 78, 75, 0, 39, 36],
  7839. [384, 1258, 78, 75, 0, 39, 36],
  7840. [1826, 1182, 77, 75, 0, 38, 36],
  7841. [1752, 1482, 77, 73, 0, 38, 35],
  7842. [1829, 1482, 75, 73, 0, 37, 35],
  7843. [1904, 1482, 75, 73, 0, 36, 35],
  7844. [670, 1555, 75, 72, 0, 35, 35],
  7845. [900, 1408, 75, 74, 0, 35, 36],
  7846. [155, 1408, 77, 74, 0, 36, 36],
  7847. [2,
  7848. 1333, 78, 75, 0, 37, 36
  7849. ],
  7850. [1608, 1258, 78, 75, 0, 37, 36],
  7851. [311, 1028, 78, 77, 0, 37, 37],
  7852. [932, 1028, 78, 77, 0, 37, 37],
  7853. [389, 1028, 78, 77, 0, 37, 37],
  7854. [467, 1028, 77, 77, 0, 36, 37],
  7855. [1306, 936, 65, 80, 0, 30, 38],
  7856. [1371, 936, 65, 80, 0, 30, 38],
  7857. [1241, 936, 65, 80, 0, 30, 38],
  7858. [1176, 936, 65, 80, 0, 30, 38],
  7859. [1111, 936, 65, 80, 0, 30, 38],
  7860. [2, 362, 279, 182, 0, 0, 0],
  7861. [1785, 2, 215, 160, 0, 0, 1],
  7862. [2E3, 2, 44, 93, 0, 19, 73],
  7863. [1973, 544, 57, 107, 0, 27, 77],
  7864. [830, 692, 80, 122, 0, 39, 81],
  7865. [1948, 362, 101, 135, 0, 50, 84],
  7866. [1050, 544, 103, 139, 0, 51, 87],
  7867. [662, 544, 104, 144, 0, 51, 91],
  7868. [556, 544, 106, 145, 0, 52, 91],
  7869. [162, 544,
  7870. 108, 147, 0, 53, 92
  7871. ],
  7872. [1689, 362, 110, 150, 0, 54, 93],
  7873. [750, 692, 80, 122, 0, 40, 93],
  7874. [1862, 692, 80, 116, 0, 40, 94],
  7875. [1942, 692, 80, 112, 0, 40, 95],
  7876. [712, 820, 79, 110, 0, 39, 97],
  7877. [900, 820, 78, 106, 0, 39, 98],
  7878. [1482, 820, 77, 93, 0, 38, 100],
  7879. [700, 936, 77, 83, 0, 38, 92],
  7880. [777, 936, 76, 82, 0, 37, 93],
  7881. [946, 936, 76, 81, 0, 37, 94],
  7882. [1518, 936, 60, 79, 0, 22, 94],
  7883. [1658, 936, 42, 78, 0, 21, 95],
  7884. [1700, 936, 40, 78, 0, 20, 96],
  7885. [2030, 544, 13, 13, 0, 0, 83],
  7886. [1979, 1482, 68, 67, 0, 32, 32],
  7887. [616, 936, 84, 83, 0, 40, 40],
  7888. [791, 820, 109, 109, 0, 53, 53],
  7889. [1843, 544, 130, 129, 0, 63, 63],
  7890. [1291, 544, 135, 135, 0, 66, 66],
  7891. [909,
  7892. 544, 141, 141, 0, 69, 69
  7893. ],
  7894. [933, 362, 152, 152, 0, 75, 74],
  7895. [780, 362, 153, 152, 0, 75, 74],
  7896. [1085, 362, 152, 151, 0, 75, 74],
  7897. [1388, 362, 151, 151, 0, 74, 74],
  7898. [1237, 362, 151, 151, 0, 74, 74],
  7899. [1539, 362, 150, 150, 0, 74, 73],
  7900. [1799, 362, 149, 148, 0, 73, 72],
  7901. [409, 544, 147, 146, 0, 72, 71],
  7902. [766, 544, 143, 143, 0, 70, 70],
  7903. [1153, 544, 138, 137, 0, 68, 67],
  7904. [1426, 544, 135, 134, 0, 66, 65],
  7905. [1561, 544, 132, 132, 0, 65, 64],
  7906. [2, 692, 129, 128, 0, 63, 62],
  7907. [1018, 1742, 33, 33, 0, 15, 15],
  7908. [966, 1628, 53, 52, 0, 25, 25],
  7909. [745, 1555, 72, 72, 0, 35, 35],
  7910. [1925, 820, 92, 92, 0, 45, 45],
  7911. [1084, 820, 96, 95, 0, 46, 46],
  7912. [978, 820, 106,
  7913. 106, 0, 51, 51
  7914. ],
  7915. [484, 820, 114, 113, 0, 55, 55],
  7916. [1746, 692, 116, 117, 0, 56, 57],
  7917. [1151, 692, 118, 119, 0, 57, 58],
  7918. [1628, 692, 118, 118, 0, 57, 57],
  7919. [1269, 692, 119, 119, 0, 58, 58],
  7920. [1388, 692, 120, 119, 0, 58, 58],
  7921. [910, 692, 121, 121, 0, 59, 59],
  7922. [628, 692, 122, 122, 0, 59, 59],
  7923. [506, 692, 122, 123, 0, 59, 60],
  7924. [259, 692, 123, 123, 0, 60, 60]
  7925. ],
  7926. animations: {
  7927. 0: {
  7928. frames: [56],
  7929. speed: 1
  7930. },
  7931. 1: {
  7932. frames: [48],
  7933. speed: 1
  7934. },
  7935. 2: {
  7936. frames: [49],
  7937. speed: 1
  7938. },
  7939. 3: {
  7940. frames: [50],
  7941. speed: 1
  7942. },
  7943. 4: {
  7944. frames: [51],
  7945. speed: 1
  7946. },
  7947. 5: {
  7948. frames: [52, 52],
  7949. speed: 1
  7950. },
  7951. 6: {
  7952. frames: [57],
  7953. speed: 1
  7954. },
  7955. 7: {
  7956. frames: [53],
  7957. speed: 1
  7958. },
  7959. 8: {
  7960. frames: [54],
  7961. speed: 1
  7962. },
  7963. 9: {
  7964. frames: [55],
  7965. speed: 1
  7966. },
  7967. lvlnum4: {
  7968. frames: [140],
  7969. speed: 1
  7970. },
  7971. BONUS_STAR_TYPE: {
  7972. frames: [91],
  7973. speed: 1
  7974. },
  7975. lvlnum20: {
  7976. frames: [156],
  7977. speed: 1
  7978. },
  7979. particle3v: {
  7980. frames: [2],
  7981. speed: 1
  7982. },
  7983. AIM_TYPE: {
  7984. frames: [88],
  7985. speed: 1
  7986. },
  7987. logov: {
  7988. frames: [3],
  7989. speed: 1
  7990. },
  7991. lvlnum6: {
  7992. frames: [142],
  7993. speed: 1
  7994. },
  7995. biglimetxt: {
  7996. frames: [43],
  7997. speed: 1
  7998. },
  7999. parteffectv3: {
  8000. frames: [356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 41, 41, 41],
  8001. speed: 1
  8002. },
  8003. particleglass2: {
  8004. frames: [113],
  8005. speed: 1
  8006. },
  8007. lvlnum9: {
  8008. frames: [145],
  8009. speed: 1
  8010. },
  8011. lvlnum5: {
  8012. frames: [141],
  8013. speed: 1
  8014. },
  8015. musiconbtn: {
  8016. frames: [11],
  8017. speed: 1
  8018. },
  8019. TELEPORT_TYPE: {
  8020. frames: [157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
  8021. 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307
  8022. ],
  8023. speed: 1
  8024. },
  8025. HARD_RECT_TYPE_2: {
  8026. frames: [70],
  8027. speed: 1
  8028. },
  8029. particleglass1: {
  8030. frames: [112],
  8031. speed: 1
  8032. },
  8033. GLASS_BLOCK_TYPE: {
  8034. frames: [111],
  8035. speed: 1
  8036. },
  8037. achievdesc2: {
  8038. frames: [30],
  8039. speed: 1
  8040. },
  8041. achievdesc1: {
  8042. frames: [29],
  8043. speed: 1
  8044. },
  8045. lvlnum3: {
  8046. frames: [139],
  8047. speed: 1
  8048. },
  8049. tint2: {
  8050. frames: [59],
  8051. speed: 1
  8052. },
  8053. DECOR_HELP_3_TYPE: {
  8054. frames: [67],
  8055. speed: 1
  8056. },
  8057. backbtn: {
  8058. frames: [6],
  8059. speed: 1
  8060. },
  8061. creditstitle: {
  8062. frames: [42],
  8063. speed: 1
  8064. },
  8065. achievdesc4: {
  8066. frames: [32],
  8067. speed: 1
  8068. },
  8069. lvlnum19: {
  8070. frames: [155],
  8071. speed: 1
  8072. },
  8073. lvlnum16: {
  8074. frames: [152],
  8075. speed: 1
  8076. },
  8077. creditselk: {
  8078. frames: [34],
  8079. speed: 1
  8080. },
  8081. lvlnum2: {
  8082. frames: [138],
  8083. speed: 1
  8084. },
  8085. radugav: {
  8086. frames: [40, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41],
  8087. speed: 1
  8088. },
  8089. STATIC_BALK_1_TYPE_2: {
  8090. frames: [73, 73],
  8091. speed: 1
  8092. },
  8093. bgwinv: {
  8094. frames: [136],
  8095. speed: 1
  8096. },
  8097. MONSTER_TYPE: {
  8098. frames: [109, 110, 109],
  8099. speed: 1
  8100. },
  8101. tintbg: {
  8102. frames: [17],
  8103. speed: 1
  8104. },
  8105. DECOR_HELP_2_TYPE: {
  8106. frames: [66],
  8107. speed: 1
  8108. },
  8109. achievback: {
  8110. frames: [35],
  8111. speed: 1
  8112. },
  8113. STATIC_BOX_TYPE: {
  8114. frames: [72, 72, 72, 72, 72,
  8115. 72, 72, 72, 72, 72, 72, 72, 72, 72
  8116. ],
  8117. speed: 1
  8118. },
  8119. lvlnum17: {
  8120. frames: [153],
  8121. speed: 1
  8122. },
  8123. lvlnum18: {
  8124. frames: [154],
  8125. speed: 1
  8126. },
  8127. HARD_RECT_TYPE: {
  8128. frames: [69],
  8129. speed: 1
  8130. },
  8131. nextlevelwin: {
  8132. frames: [23],
  8133. speed: 1
  8134. },
  8135. lvlnum1: {
  8136. frames: [137],
  8137. speed: 1
  8138. },
  8139. deathanimv: {
  8140. frames: [108],
  8141. speed: 1
  8142. },
  8143. TELEGA_TYPE: {
  8144. frames: [123],
  8145. speed: 1
  8146. },
  8147. fansv: {
  8148. frames: [125, 126, 127, 128, 129, 130, 131, 132, 133, 134],
  8149. speed: 1
  8150. },
  8151. playbtnup: {
  8152. frames: [4],
  8153. speed: 1
  8154. },
  8155. PART_50: {
  8156. frames: [92],
  8157. speed: 1
  8158. },
  8159. lvlnum15: {
  8160. frames: [151],
  8161. speed: 1
  8162. },
  8163. achievdesc0: {
  8164. frames: [28],
  8165. speed: 1
  8166. },
  8167. BOMB_TYPE: {
  8168. frames: [96],
  8169. speed: 1
  8170. },
  8171. achievdesc5: {
  8172. frames: [33],
  8173. speed: 1
  8174. },
  8175. DANGER_TYPE: {
  8176. frames: [107],
  8177. speed: 1
  8178. },
  8179. achievdesc3: {
  8180. frames: [31],
  8181. speed: 1
  8182. },
  8183. DYNAMIC_CIRCLE_TYPE: {
  8184. frames: [122],
  8185. speed: 1
  8186. },
  8187. TELEGA_TYPE_2: {
  8188. frames: [124, 124],
  8189. speed: 1
  8190. },
  8191. STATIC_BALK_1_TYPE: {
  8192. frames: [58],
  8193. speed: 1
  8194. },
  8195. LAND_TYPE_2: {
  8196. frames: [61],
  8197. speed: 1
  8198. },
  8199. bombexplosionv: {
  8200. frames: [97, 98, 99, 100, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106],
  8201. speed: 1
  8202. },
  8203. restartbtn: {
  8204. frames: [13],
  8205. speed: 1
  8206. },
  8207. DECOR_HELP_1_TYPE: {
  8208. frames: [65],
  8209. speed: 1
  8210. },
  8211. AIM_TYPE_MOVABLE: {
  8212. frames: [90],
  8213. speed: 1
  8214. },
  8215. DYNAMIC_RECT_TYPE_2: {
  8216. frames: [121],
  8217. speed: 1
  8218. },
  8219. spelelogo: {
  8220. frames: [47],
  8221. speed: 1
  8222. },
  8223. tryagaintitle: {
  8224. frames: [18],
  8225. speed: 1
  8226. },
  8227. splashlogo: {
  8228. frames: [46],
  8229. speed: 1
  8230. },
  8231. particleglass3: {
  8232. frames: [114],
  8233. speed: 1
  8234. },
  8235. lvlnum14: {
  8236. frames: [150],
  8237. speed: 1
  8238. },
  8239. BONUS_GHOST_TYPE: {
  8240. frames: [120],
  8241. speed: 1
  8242. },
  8243. LAND_TYPE: {
  8244. frames: [60],
  8245. speed: 1
  8246. },
  8247. totalscoreslabel: {
  8248. frames: [45],
  8249. speed: 1
  8250. },
  8251. levelreadylabel: {
  8252. frames: [44],
  8253. speed: 1
  8254. },
  8255. DECOR_HELP_4_TYPE: {
  8256. frames: [68, 68, 68, 68],
  8257. speed: 1
  8258. },
  8259. LAND_TYPE_5: {
  8260. frames: [64],
  8261. speed: 1
  8262. },
  8263. particle2v: {
  8264. frames: [1],
  8265. speed: 1
  8266. },
  8267. moregames2v: {
  8268. frames: [25],
  8269. speed: 1
  8270. },
  8271. lvlnum12: {
  8272. frames: [148],
  8273. speed: 1
  8274. },
  8275. ACTIVATOR_TYPE: {
  8276. frames: [115,
  8277. 116, 116
  8278. ],
  8279. speed: 1
  8280. },
  8281. levelselecttitle: {
  8282. frames: [5],
  8283. speed: 1
  8284. },
  8285. LAND_TYPE_3: {
  8286. frames: [62],
  8287. speed: 1
  8288. },
  8289. DOOR_TYPE: {
  8290. frames: [117, 118, 119],
  8291. speed: 1
  8292. },
  8293. particle1v: {
  8294. frames: [0],
  8295. speed: 1
  8296. },
  8297. lvlnum13: {
  8298. frames: [149],
  8299. speed: 1
  8300. },
  8301. pausetitle: {
  8302. frames: [9],
  8303. speed: 1
  8304. },
  8305. parteffectv2: {
  8306. frames: [337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 41],
  8307. speed: 1
  8308. },
  8309. BONUS_DIAMOND_TYPE: {
  8310. frames: [86],
  8311. speed: 1
  8312. },
  8313. btnbaseup: {
  8314. frames: [15],
  8315. speed: 1
  8316. },
  8317. DYNAMIC_BOX_TYPE_3: {
  8318. frames: [84],
  8319. speed: 1
  8320. },
  8321. lvlLabelStar0: {
  8322. frames: [7],
  8323. speed: 1
  8324. },
  8325. DYNAMIC_BOX_TYPE_2: {
  8326. frames: [83],
  8327. speed: 1
  8328. },
  8329. lvlLabelStar3: {
  8330. frames: [21],
  8331. speed: 1
  8332. },
  8333. lvlLabelStar2: {
  8334. frames: [20],
  8335. speed: 1
  8336. },
  8337. newachievtitle: {
  8338. frames: [37],
  8339. speed: 1
  8340. },
  8341. lvlLabelStar1: {
  8342. frames: [19],
  8343. speed: 1
  8344. },
  8345. lvlcompletebgnew: {
  8346. frames: [22],
  8347. speed: 1
  8348. },
  8349. PART_200: {
  8350. frames: [95, 95],
  8351. speed: 1
  8352. },
  8353. HARD_BOX_TYPE_5: {
  8354. frames: [78],
  8355. speed: 1
  8356. },
  8357. GLASS_BOX_TYPE: {
  8358. frames: [79],
  8359. speed: 1
  8360. },
  8361. DYNAMIC_RECT_TYPE: {
  8362. frames: [73],
  8363. speed: 1
  8364. },
  8365. DYNAMIC_TRIANGLE_TYPE: {
  8366. frames: [85, 85, 85, 85, 85],
  8367. speed: 1
  8368. },
  8369. PART_150: {
  8370. frames: [94],
  8371. speed: 1
  8372. },
  8373. HERO_TYPE: {
  8374. frames: [81],
  8375. speed: 1
  8376. },
  8377. HARD_BOX_TYPE_4: {
  8378. frames: [77],
  8379. speed: 1
  8380. },
  8381. achievmenutitle: {
  8382. frames: [26],
  8383. speed: 1
  8384. },
  8385. bigbg: {
  8386. frames: [135],
  8387. speed: 1
  8388. },
  8389. parteffectv1: {
  8390. frames: [315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336],
  8391. speed: 1
  8392. },
  8393. quitbtn: {
  8394. frames: [10],
  8395. speed: 1
  8396. },
  8397. achievclosed: {
  8398. frames: [27],
  8399. speed: 1
  8400. },
  8401. musicoffbtn: {
  8402. frames: [12],
  8403. speed: 1
  8404. },
  8405. achievbtn: {
  8406. frames: [14],
  8407. speed: 1
  8408. },
  8409. smallwinv: {
  8410. frames: [314],
  8411. speed: 1
  8412. },
  8413. completeelk: {
  8414. frames: [39],
  8415. speed: 1
  8416. },
  8417. lvlnum10: {
  8418. frames: [146],
  8419. speed: 1
  8420. },
  8421. levelbuttonlocked: {
  8422. frames: [8],
  8423. speed: 1
  8424. },
  8425. lvlnum11: {
  8426. frames: [147],
  8427. speed: 1
  8428. },
  8429. pausebtn: {
  8430. frames: [16],
  8431. speed: 1
  8432. },
  8433. HARD_BOX_TYPE_3: {
  8434. frames: [76],
  8435. speed: 1
  8436. },
  8437. HARD_BOX_TYPE_2: {
  8438. frames: [75],
  8439. speed: 1
  8440. },
  8441. PART_100: {
  8442. frames: [93],
  8443. speed: 1
  8444. },
  8445. HARD_BOX_TYPE: {
  8446. frames: [74],
  8447. speed: 1
  8448. },
  8449. FAN_TYPE_ON: {
  8450. frames: [309, 310, 311, 312, 309, 310, 311, 312, 309, 309],
  8451. speed: 1
  8452. },
  8453. AIM_BACK: {
  8454. frames: [89],
  8455. speed: 1
  8456. },
  8457. newachievbgv: {
  8458. frames: [38],
  8459. speed: 1
  8460. },
  8461. achievelk: {
  8462. frames: [36],
  8463. speed: 1
  8464. },
  8465. DYNAMIC_BOX_TYPE: {
  8466. frames: [82],
  8467. speed: 1
  8468. },
  8469. HARD_TRIANGLE_TYPE: {
  8470. frames: [71],
  8471. speed: 1
  8472. },
  8473. smallbg: {
  8474. frames: [313],
  8475. speed: 1
  8476. },
  8477. LAND_TYPE_4: {
  8478. frames: [63],
  8479. speed: 1
  8480. },
  8481. lvlnum7: {
  8482. frames: [143],
  8483. speed: 1
  8484. },
  8485. FAN_TYPE: {
  8486. frames: [308],
  8487. speed: 1
  8488. },
  8489. GLASS_TRIANGLE_TYPE: {
  8490. frames: [80],
  8491. speed: 1
  8492. },
  8493. BONUS_MONEY_TYPE: {
  8494. frames: [87],
  8495. speed: 1
  8496. },
  8497. completestar: {
  8498. frames: [24, 24],
  8499. speed: 1
  8500. },
  8501. lvlnum8: {
  8502. frames: [144],
  8503. speed: 1
  8504. }
  8505. }
  8506. },
  8507. interfaceCFG = {},
  8508. bgCFG = {
  8509. framerate: 24,
  8510. images: ["assets/cheapbg.jpg"],
  8511. frames: [
  8512. [0, 270, 401, 270, 0, 0, 0],
  8513. [401, 270, 401, 270, 0, 0, 0],
  8514. [0, 540, 401, 270, 0, 0, 0],
  8515. [401, 0, 401, 270, 0, 0, 0],
  8516. [0, 0, 401, 270, 0, 0, 0]
  8517. ],
  8518. animations: {
  8519. bigbg: {
  8520. speed: 1,
  8521. frames: [0, 1, 2, 3, 4]
  8522. }
  8523. }
  8524. },
  8525. PART_STAR_TYPE = 1,
  8526. PART_CLOUD_TYPE = 2,
  8527. PART_NUM_TYPE = 3,
  8528. PART_INSTRUCTION_TYPE = 4,
  8529. PART_GLASS_TYPE = 5,
  8530. PART_ACHIEV_TYPE = 6,
  8531. MAX_PARTICLES_ON_SCREEN = 12;
  8532. (function (c) {
  8533. function a(a, b, c) {
  8534. this.initialize(a, b, c)
  8535. }
  8536. var b = a.prototype;
  8537. b.initialize = function (a, b, c) {
  8538. var e = new createjs.Sprite(zoeSS);
  8539. e.snapToPixel = !0;
  8540. e.baseBlock = this;
  8541. this.vis = e;
  8542. this.reset(a, b, c)
  8543. };
  8544. b.reset = function (a, b, c) {
  8545. this.type = a;
  8546. this.vis.parent != b && removeFromParent(this.vis);
  8547. createjs.Tween.removeTweens(this.vis);
  8548. this.parent = b;
  8549. this.vis.alpha = 1;
  8550. this.vis.mouseEnabled = !1;
  8551. this.speedY = this.speedX = 0;
  8552. this.moveTarget = null;
  8553. this.speedA = 0;
  8554. this.speedScale = 0.05;
  8555. this.maxScale = 1.2;
  8556. this.isPrerendered = !1;
  8557. this.speedAlpha =
  8558. 0.08;
  8559. this.gravity = 0.6;
  8560. this.isNum = !1;
  8561. this.beforeHideTimer = 0.1;
  8562. this.isNeedDispose = this.isInstruction = !1;
  8563. this.vis.spriteSheet = zoeSS;
  8564. deleteCache(this.vis);
  8565. var e = "numb0";
  8566. a == PART_STAR_TYPE ? e = 0.7 < Math.random() ? "particle1v" : 0.5 < Math.random() ? "particle3v" : "particle2v" : a == PART_NUM_TYPE || a == PART_ACHIEV_TYPE ? this.isNum = !0 : a == PART_CLOUD_TYPE ? (this.gravity = 0, e = 0.5 < Math.random() ? "cloud1v" : "cloud2v") : a == PART_INSTRUCTION_TYPE ? this.isInstruction = !0 : a === PART_GLASS_TYPE && (e = 0.7 < Math.random() ? "particleglass1" : 0.5 < Math.random() ?
  8567. "particleglass2" : "particleglass3");
  8568. this.vis.gotoAndStop(e);
  8569. this.scale = c;
  8570. this.updateVisionScale();
  8571. b.addChild(this.vis)
  8572. };
  8573. b.setPos = function (a, b) {
  8574. this.vis.x = a;
  8575. this.vis.y = b
  8576. };
  8577. b.setNum = function (a) {
  8578. this.beforeHideTimer = 10;
  8579. this.speedAlpha = 0.03;
  8580. this.gravity = 0;
  8581. this.vis.rotation = 0;
  8582. this.vis.gotoAndStop("PART_" + a)
  8583. };
  8584. b.setFrame = function (a, b) {
  8585. this.gravity = 0;
  8586. this.vis.rotation = 0;
  8587. b ? this.vis.gotoAndPlay(a) : this.vis.gotoAndStop(a)
  8588. };
  8589. b.tick = function () {
  8590. if (!(this.isNeedDispose || (this.moveTarget ? (this.vis.x = this.moveTarget.x,
  8591. this.vis.y = this.moveTarget.y) : (this.vis.x += this.speedX * dtScale, this.vis.y += this.speedY * dtScale, this.speedY += this.gravity * dtScale, this.vis.rotation += this.speedA * dtScale), this.beforeHideTimer -= dtScale, 0 < this.beforeHideTimer)))
  8592. if (this.isPrerendered) this.isNeedDispose = !0;
  8593. else {
  8594. if (this.isNum) this.vis.alpha -= this.speedAlpha * dtScale;
  8595. else {
  8596. if (this.isInstruction) return;
  8597. this.vis.visible = !0;
  8598. this.vis.scaleX += this.speedScale * dtScale;
  8599. this.vis.scaleX > this.maxScale && (this.vis.alpha -= this.speedAlpha * dtScale);
  8600. this.vis.scaleY =
  8601. this.vis.scaleX
  8602. }
  8603. 0.01 > this.vis.alpha && (this.isNeedDispose = !0)
  8604. }
  8605. };
  8606. b.updateVisionScale = function () {
  8607. this.vis.scaleX = this.vis.scaleY = this.scale
  8608. };
  8609. b.dispose = function () {
  8610. isArrayContains(allParts, this) && allParts.splice(allParts.indexOf(this, 0), 1);
  8611. addToDisposedParts(this);
  8612. this.vis.removeAllEventListeners();
  8613. this.vis.stop();
  8614. removeFromParent(this.vis)
  8615. };
  8616. c.ParticleBase = a
  8617. })(window);
  8618. var allParts = [],
  8619. disposedParts = [];
  8620. function initParticleManager() {
  8621. container.addChild(particleContainer)
  8622. }
  8623. var partSin, partCos, partScale;
  8624. function createPartExplode(c, a, b, g, f, d) {
  8625. for (var e, h = 0; h < b; h++) {
  8626. e = h * (2 * Math.PI / b);
  8627. partSin = Math.cos(e);
  8628. partCos = Math.sin(e);
  8629. e = createPart(g, c, a, 1, f ? f : particleContainer);
  8630. if (!e) break;
  8631. setParticleParamsByIndex(e, d ? d : 0)
  8632. }
  8633. }
  8634. function setParticleParamsByIndex(c, a) {
  8635. var b = 1.3;
  8636. c.gravity = 0;
  8637. c.speedA = 20 * Math.random();
  8638. 0 === a ? (c.maxScale = 0.7, c.beforeHideTimer = 0.2 * FPS, partScale = 0.2 + 0.2 * Math.random()) : 1 === a ? (b = 4, c.maxScale = 1.3, c.beforeHideTimer = 0.3 * FPS, c.gravity = 0, c.speedAlpha = 0.05, c.speedA = 20 * Math.random(), partScale = 0.4 + 0.6 * Math.random()) : 2 === a ? (b = 2, c.maxScale = 1.3, c.vis.alpha = 1, c.beforeHideTimer = 0.3 * FPS, c.speedA = 20 * Math.random(), partScale = 0.4 + 0.6 * Math.random()) : 3 === a && (b = 1.3, c.gravity = 0, c.speedA = 20 * Math.random(), c.maxScale = 0.7,
  8639. c.beforeHideTimer = 0.1 * FPS, c.gravity = 0, c.speedAlpha = 0.05, partScale = 0.6, c.vis.alpha = 1);
  8640. c.vis.scaleX = c.vis.scaleY = partScale;
  8641. c.speedX = (b + Math.random() * b) * partCos;
  8642. c.speedY = (b + Math.random() * b) * partSin
  8643. }
  8644. function createDiePart(c, a) {
  8645. var b = createPart(PART_NUM_TYPE, c, a, 1, particleContainer);
  8646. b && (b.setNum(11), b.setFrame("deathanimv", !0), b.speedAlpha = 0.05, b.beforeHideTimer = 1.5 * FPS, b.speedX = 0, b.speedY = -1, b.speedA = 0)
  8647. }
  8648. function createGoodPlayExplode(c, a) {
  8649. for (var b, g = 0 == a ? 90 : -120, f = 0; 8 > f; f++) {
  8650. var d = f * (Math.PI / 2 / 8) - Math.PI / 4;
  8651. 0 < a && (d += Math.PI);
  8652. var e = Math.cos(d),
  8653. d = Math.sin(d);
  8654. b = 0.2 + 0.2 * Math.random();
  8655. b = createPart(PART_STAR_TYPE, g, 0, b, monsterCont);
  8656. if (!b) break;
  8657. b.setFrame("particle1v");
  8658. b.speedAlpha = 0.1;
  8659. b.speedScale = 0.02;
  8660. b.vis.visible = !1;
  8661. b.beforeHideTimer = 0.5 * FPS;
  8662. b.maxScale = 0.6;
  8663. b.speedX = (1.5 + 1.5 * Math.random()) * e;
  8664. b.speedY = (1.5 + 1.5 * Math.random()) * d;
  8665. b.speedA = 20 * Math.random()
  8666. }
  8667. }
  8668. function createNumPart(c, a, b) {
  8669. if (c = createPart(PART_NUM_TYPE, c, a, 0.8, particleContainer)) c.setNum(b), c.beforeHideTimer = 0.2 * FPS, c.speedX = 0, c.speedY = -0.8, c.speedA = 0
  8670. }
  8671. function createPrerenderedPart(c, a, b, g, f, d, e) {
  8672. if (c = createPart(PART_NUM_TYPE, c, a, b, particleContainer)) c.setFrame(g, !0), setNextAnimation(c.vis, ""), e && setAnimationSpeed(c.vis, e), c.isPrerendered = !0, d && (c.moveTarget = d), c.beforeHideTimer = f * GAME_FPS, c.speedX = 0, c.speedY = 0, c.speedA = 0, c.gravity = 0, c.vis.rotation = 0
  8673. }
  8674. function createGlassRectExplode(c, a, b, g) {
  8675. for (var f, d = 0; 5 > d; d++) {
  8676. var e = g * Math.PI / 180;
  8677. f = Math.cos(e);
  8678. var e = Math.sin(e),
  8679. h = (24.4 * d - 60) * b;
  8680. f = createPart(PART_GLASS_TYPE, c + h * f, a + h * e, 1, particleContainer);
  8681. if (!f) break;
  8682. f.gravity = 0;
  8683. f.speedA = 20 * Math.random();
  8684. f.maxScale = 0.7;
  8685. f.beforeHideTimer = 0.1 * FPS;
  8686. f.gravity = 0;
  8687. f.speedAlpha = 0.05;
  8688. partScale = 0.6;
  8689. f.vis.scaleX = f.vis.scaleY = partScale;
  8690. f.speedX = 1.3 - 2.6 * Math.random();
  8691. f.speedY = 1.3 - 2.6 * Math.random()
  8692. }
  8693. }
  8694. function createAwesomePart() {
  8695. var c = createPart(PART_NUM_TYPE, 160, topVisionLine + viewportH / 2, 1, particleContainer);
  8696. c && (c.setNum(11), c.speedAlpha = 1, c.beforeHideTimer = 1.5 * FPS, c.speedX = 0, c.speedY = 0, c.speedA = 0, c.vis.rotation = -360, c.vis.scaleX = c.vis.scaleY = 0.1, createjs.Tween.get(c.vis, {
  8697. override: !0
  8698. })
  8699. .to({
  8700. rotation: 0,
  8701. scaleX: 1,
  8702. scaleY: 1
  8703. }, 600)
  8704. .wait(600)
  8705. .to({
  8706. alpha: 0
  8707. }, 200))
  8708. }
  8709. function createAchievPart(c) {
  8710. for (var a = 210, b = 10, g = 0, f, d = 0; d < allParts.length; d++) f = allParts[d], f.type === PART_ACHIEV_TYPE && (a = f.vis.y - 50, b += 200, g++);
  8711. if (f = createPart(PART_ACHIEV_TYPE, -130, a, 0.8, container)) f.setFrame("achievdesc" + c), f.speedAlpha = 1, f.beforeHideTimer = 3.2 * FPS + 0.2 * g, f.speedX = 0, f.speedY = 0, f.speedA = 0, f.vis.rotation = 0, f.vis.scaleX = f.vis.scaleY = 0.7, f.vis.alpha = 1, createjs.Tween.get(f.vis, {
  8712. override: !0
  8713. })
  8714. .wait(b)
  8715. .to({
  8716. x: 5
  8717. }, 600, menuEase)
  8718. .wait(2E3)
  8719. .to({
  8720. x: -130
  8721. }, 400, createjs.Ease.sineIn)
  8722. }
  8723. var allPartsLenght = 0;
  8724. function createPart(c, a, b, g, f) {
  8725. var d;
  8726. allPartsLenght = allParts.length;
  8727. if (allPartsLenght > MAX_PARTICLES_ON_SCREEN) {
  8728. for (var e = 0; e < allPartsLenght; e++)
  8729. if (allParts[e].type === PART_STAR_TYPE) {
  8730. d = allParts[e];
  8731. break
  8732. }
  8733. d || (d = allParts[0]);
  8734. d.reset(c, f, g)
  8735. } else d = gePartFromPool(c, f, g);
  8736. d.setPos(a, b);
  8737. isArrayContains(allParts, d) || allParts.push(d);
  8738. return d
  8739. }
  8740. function addToDisposedParts(c) {
  8741. isArrayContains(disposedParts, c) || disposedParts.push(c)
  8742. }
  8743. function gePartFromPool(c, a, b) {
  8744. if (0 < disposedParts.length) {
  8745. var g = disposedParts.pop();
  8746. g.reset(c, a, b);
  8747. return g
  8748. }
  8749. return new ParticleBase(c, a, b)
  8750. }
  8751. var partLength = 0,
  8752. currPart = null,
  8753. disposeNeededParts = [];
  8754. function updatePartManager() {
  8755. partLength = allParts.length;
  8756. for (var c = 0; c < partLength; c++) currPart = allParts[c], currPart.tick(), currPart.isNeedDispose && disposeNeededParts.push(currPart);
  8757. for (; 0 < disposeNeededParts.length;) disposeNeededParts.pop()
  8758. .dispose()
  8759. }
  8760. (function () {
  8761. Object.create = Object.create || function (a) {
  8762. function b() {}
  8763. return b.prototype = a, new b
  8764. };
  8765. var c;
  8766. "undefined" == typeof exports ? (c = {}, "object" == typeof window && (window.cp = c)) : c = exports;
  8767. var a, b, g = function (a, b) {
  8768. if (!a) throw Error("Assertion failed: " + b);
  8769. },
  8770. f = function (a, b) {
  8771. !a && console && console.warn && (console.warn("ASSERTION FAILED: " + b), console.trace && console.trace())
  8772. },
  8773. d = function (a, b) {
  8774. return b > a ? a : b
  8775. },
  8776. e = function (a, b) {
  8777. return a > b ? a : b
  8778. };
  8779. "object" == typeof window && -1 < window.navigator.userAgent.indexOf("Firefox") ?
  8780. (a = Math.min, b = Math.max) : (a = d, b = e);
  8781. var h = function (a, b) {
  8782. return b > a ? a + " " + b : b + " " + a
  8783. },
  8784. k = function (a, b) {
  8785. for (var c = 0; a.length > c; c++)
  8786. if (a[c] === b) return a[c] = a[a.length - 1], a.length--, void 0
  8787. };
  8788. c.momentForCircle = function (a, b, c, d) {
  8789. return a * (0.5 * (b * b + c * c) + N(d))
  8790. };
  8791. c.areaForCircle = function (a, b) {
  8792. return Math.PI * Math.abs(a * a - b * b)
  8793. };
  8794. c.momentForSegment = function (a, b, c) {
  8795. var d = z(A(b, c), 0.5);
  8796. return a * (Ka(c, b) / 12 + N(d))
  8797. };
  8798. c.areaForSegment = function (a, b, c) {
  8799. return c * (Math.PI * c + 2 * sa(a, b))
  8800. };
  8801. c.momentForPoly = function (a, b, c) {
  8802. for (var d =
  8803. 0, e = 0, f = b.length, g = 0; f > g; g += 2) var h = b[g] + c.x,
  8804. k = b[g + 1] + c.y,
  8805. m = b[(g + 2) % f] + c.x,
  8806. n = b[(g + 3) % f] + c.y,
  8807. q = m * k - n * h,
  8808. d = d + q * (h * h + k * k + (h * m + k * n) + (m * m + n * n)),
  8809. e = e + q;
  8810. return a * d / (6 * e)
  8811. };
  8812. c.areaForPoly = function (a) {
  8813. for (var b = 0, c = 0, d = a.length; d > c; c += 2) b += F(new q(a[c], a[c + 1]), new q(a[(c + 2) % d], a[(c + 3) % d]));
  8814. return -b / 2
  8815. };
  8816. c.centroidForPoly = function (a) {
  8817. for (var b = 0, c = new q(0, 0), d = 0, e = a.length; e > d; d += 2) var f = new q(a[d], a[d + 1]),
  8818. g = new q(a[(d + 2) % e], a[(d + 3) % e]),
  8819. h = F(f, g),
  8820. b = b + h,
  8821. c = A(c, z(A(f, g), h));
  8822. return z(c, 1 / (3 * b))
  8823. };
  8824. c.recenterPoly = function (a) {
  8825. for (var b =
  8826. c.centroidForPoly(a), d = 0; a.length > d; d += 2) a[d] -= b.x, a[d + 1] -= b.y
  8827. };
  8828. c.momentForBox = function (a, b, c) {
  8829. return a * (b * b + c * c) / 12
  8830. };
  8831. c.momentForBox2 = function (a, b) {
  8832. var d = b.r - b.l,
  8833. e = b.t - b.b,
  8834. f = z([b.l + b.r, b.b + b.t], 0.5);
  8835. return c.momentForBox(a, d, e) + a * N(f)
  8836. };
  8837. var m = c.loopIndexes = function (a) {
  8838. var b, c, d, e, f = 0,
  8839. g = 0;
  8840. b = d = a[0];
  8841. c = e = a[1];
  8842. for (var h = a.length >> 1, k = 1; h > k; k++) {
  8843. var m = a[2 * k],
  8844. n = a[2 * k + 1];
  8845. b > m || m == b && c > n ? (b = m, c = n, f = k) : (m > d || m == d && n > e) && (d = m, e = n, g = k)
  8846. }
  8847. return [f, g]
  8848. },
  8849. n = function (a, b, c) {
  8850. var d = a[2 * b];
  8851. a[2 * b] = a[2 * c];
  8852. a[2 * c] = d;
  8853. d = a[2 * b +
  8854. 1];
  8855. a[2 * b + 1] = a[2 * c + 1];
  8856. a[2 * c + 1] = d
  8857. },
  8858. p = function (a, b, c, d, e, f) {
  8859. if (0 === c) return 0;
  8860. var g = 0,
  8861. h = b;
  8862. e = y(e, d);
  8863. f *= x(e);
  8864. var k = b;
  8865. for (c = b + c - 1; c >= k;) {
  8866. var m = new q(a[2 * k], a[2 * k + 1]),
  8867. m = F(e, y(m, d));
  8868. m > f ? (m > g && (g = m, h = k), k++) : (n(a, k, c), c--)
  8869. }
  8870. return h != b && n(a, b, h), k - b
  8871. },
  8872. r = function (a, b, c, d, e, f, g, h) {
  8873. if (0 > d) return 0;
  8874. if (0 == d) return b[2 * h] = f.x, b[2 * h + 1] = f.y, 1;
  8875. var k = p(b, c, d, e, f, a),
  8876. m = new q(b[2 * c], b[2 * c + 1]);
  8877. e = r(a, b, c + 1, k - 1, e, m, f, h);
  8878. m = h + e++;
  8879. b[2 * m] = f.x;
  8880. b[2 * m + 1] = f.y;
  8881. d = p(b, c + k, d - k, f, g, a);
  8882. m = new q(b[2 * (c + k)], b[2 * (c + k) + 1]);
  8883. return e + r(a, b, c + k +
  8884. 1, d - 1, f, m, g, h + e)
  8885. };
  8886. c.convexHull = function (a, b, c) {
  8887. if (b)
  8888. for (var d = 0; a.length > d; d++) b[d] = a[d];
  8889. else b = a;
  8890. var e = m(a),
  8891. d = e[0],
  8892. e = e[1];
  8893. if (d == e) return b.length = 2, b;
  8894. n(b, 0, d);
  8895. n(b, 1, 0 == e ? d : e);
  8896. d = new q(b[0], b[1]);
  8897. e = new q(b[2], b[3]);
  8898. a = r(c, b, 2, (a.length >> 1) - 2, d, e, d, 1) + 1;
  8899. return b.length = 2 * a, f(Ma(b), "Internal error: cpConvexHull() and cpPolyValidate() did not agree.Please report this error with as much info as you can."), b
  8900. };
  8901. var s = function (c, d, e) {
  8902. return a(b(c, d), e)
  8903. },
  8904. t = function (c) {
  8905. return b(0, a(c, 1))
  8906. },
  8907. q = c.Vect = function (a,
  8908. b) {
  8909. this.x = a;
  8910. this.y = b
  8911. };
  8912. c.v = function (a, b) {
  8913. return new q(a, b)
  8914. };
  8915. var w = c.vzero = new q(0, 0),
  8916. u = c.v.dot = function (a, b) {
  8917. return a.x * b.x + a.y * b.y
  8918. },
  8919. x = c.v.len = function (a) {
  8920. return Math.sqrt(u(a, a))
  8921. },
  8922. K = c.v.len2 = function (a, b) {
  8923. return Math.sqrt(a * a + b * b)
  8924. };
  8925. c.v.eql = function (a, b) {
  8926. return a.x === b.x && a.y === b.y
  8927. };
  8928. var A = c.v.add = function (a, b) {
  8929. return new q(a.x + b.x, a.y + b.y)
  8930. };
  8931. q.prototype.add = function (a) {
  8932. return this.x += a.x, this.y += a.y, this
  8933. };
  8934. var y = c.v.sub = function (a, b) {
  8935. return new q(a.x - b.x, a.y - b.y)
  8936. };
  8937. q.prototype.sub = function (a) {
  8938. return this.x -=
  8939. a.x, this.y -= a.y, this
  8940. };
  8941. var C = c.v.neg = function (a) {
  8942. return new q(-a.x, -a.y)
  8943. };
  8944. q.prototype.neg = function () {
  8945. return this.x = -this.x, this.y = -this.y, this
  8946. };
  8947. var z = c.v.mult = function (a, b) {
  8948. return new q(a.x * b, a.y * b)
  8949. };
  8950. q.prototype.mult = function (a) {
  8951. return this.x *= a, this.y *= a, this
  8952. };
  8953. var F = c.v.cross = function (a, b) {
  8954. return a.x * b.y - a.y * b.x
  8955. },
  8956. J = c.v.perp = function (a) {
  8957. return new q(-a.y, a.x)
  8958. };
  8959. c.v.pvrperp = function (a) {
  8960. return new q(a.y, -a.x)
  8961. };
  8962. var P = c.v.project = function (a, b) {
  8963. return z(b, u(a, b) / N(b))
  8964. };
  8965. q.prototype.project = function (a) {
  8966. return this.mult(u(this,
  8967. a) / N(a)), this
  8968. };
  8969. var E = c.v.rotate = function (a, b) {
  8970. return new q(a.x * b.x - a.y * b.y, a.x * b.y + a.y * b.x)
  8971. };
  8972. q.prototype.rotate = function (a) {
  8973. return this.x = this.x * a.x - this.y * a.y, this.y = this.x * a.y + this.y * a.x, this
  8974. };
  8975. var S = c.v.unrotate = function (a, b) {
  8976. return new q(a.x * b.x + a.y * b.y, a.y * b.x - a.x * b.y)
  8977. },
  8978. N = c.v.lengthsq = function (a) {
  8979. return u(a, a)
  8980. },
  8981. Z = c.v.lengthsq2 = function (a, b) {
  8982. return a * a + b * b
  8983. },
  8984. T = c.v.lerp = function (a, b, c) {
  8985. return A(z(a, 1 - c), z(b, c))
  8986. },
  8987. Q = c.v.normalize = function (a) {
  8988. return z(a, 1 / x(a))
  8989. },
  8990. G = c.v.normalize_safe = function (a) {
  8991. return 0 ===
  8992. a.x && 0 === a.y ? w : Q(a)
  8993. },
  8994. M = c.v.clamp = function (a, b) {
  8995. return u(a, a) > b * b ? z(Q(a), b) : a
  8996. };
  8997. c.v.lerpconst = function (a, b, c) {
  8998. return A(a, M(y(b, a), c))
  8999. };
  9000. var sa = c.v.dist = function (a, b) {
  9001. return x(y(a, b))
  9002. },
  9003. Ka = c.v.distsq = function (a, b) {
  9004. return N(y(a, b))
  9005. };
  9006. c.v.near = function (a, b, c) {
  9007. return c * c > Ka(a, b)
  9008. };
  9009. var eb = c.v.slerp = function (a, b, c) {
  9010. var d = Math.acos(u(a, b));
  9011. if (d) {
  9012. var e = 1 / Math.sin(d);
  9013. return A(z(a, Math.sin((1 - c) * d) * e), z(b, Math.sin(c * d) * e))
  9014. }
  9015. return a
  9016. };
  9017. c.v.slerpconst = function (b, c, d) {
  9018. var e = Math.acos(u(b, c));
  9019. return eb(b, c, a(d, e) / e)
  9020. };
  9021. c.v.forangle = function (a) {
  9022. return new q(Math.cos(a), Math.sin(a))
  9023. };
  9024. c.v.toangle = function (a) {
  9025. return Math.atan2(a.y, a.x)
  9026. };
  9027. c.v.str = function (a) {
  9028. return "(" + a.x.toFixed(3) + ", " + a.y.toFixed(3) + ")"
  9029. };
  9030. var fb = 0,
  9031. $ = c.BB = function (a, b, c, d) {
  9032. this.l = a;
  9033. this.b = b;
  9034. this.r = c;
  9035. this.t = d;
  9036. fb++
  9037. };
  9038. c.bb = function (a, b, c, d) {
  9039. return new $(a, b, c, d)
  9040. };
  9041. var La = 0;
  9042. c.NO_GROUP = 0;
  9043. var gb = c.ALL_LAYERS = -1;
  9044. c.resetShapeIdCounter = function () {
  9045. La = 0
  9046. };
  9047. var O = c.Shape = function (a) {
  9048. this.body = a;
  9049. this.bb_l = this.bb_b = this.bb_r = this.bb_t = 0;
  9050. this.hashid = La++;
  9051. this.sensor = !1;
  9052. this.u = this.e = 0;
  9053. this.surface_v = w;
  9054. this.group = this.collision_type = 0;
  9055. this.layers = gb;
  9056. this.space = null;
  9057. this.collisionCode = this.collisionCode
  9058. };
  9059. O.prototype.setElasticity = function (a) {
  9060. this.e = a
  9061. };
  9062. O.prototype.setFriction = function (a) {
  9063. this.body.activate();
  9064. this.u = a
  9065. };
  9066. O.prototype.setLayers = function (a) {
  9067. this.body.activate();
  9068. this.layers = a
  9069. };
  9070. O.prototype.setSensor = function (a) {
  9071. this.body.activate();
  9072. this.sensor = a
  9073. };
  9074. O.prototype.setCollisionType = function (a) {
  9075. this.body.activate();
  9076. this.collision_type = a
  9077. };
  9078. O.prototype.getBody = function () {
  9079. return this.body
  9080. };
  9081. O.prototype.active = function () {
  9082. return this.body && -1 !== this.body.shapeList.indexOf(this)
  9083. };
  9084. O.prototype.setBody = function (a) {
  9085. g(!this.active(), "You cannot change the body on an active shape. You must remove the shape from the space before changing the body.");
  9086. this.body = a
  9087. };
  9088. O.prototype.cacheBB = function () {
  9089. return this.update(this.body.p, this.body.rot)
  9090. };
  9091. O.prototype.update = function (a, b) {
  9092. g(!isNaN(b.x), "Rotation is NaN");
  9093. g(!isNaN(a.x), "Position is NaN");
  9094. this.cacheData(a, b)
  9095. };
  9096. O.prototype.pointQuery = function (a) {
  9097. a =
  9098. this.nearestPointQuery(a);
  9099. return 0 > a.d ? a : void 0
  9100. };
  9101. O.prototype.getBB = function () {
  9102. return new $(this.bb_l, this.bb_b, this.bb_r, this.bb_t)
  9103. };
  9104. var ta = function (a, b, c) {
  9105. this.shape = a;
  9106. this.p = b;
  9107. this.d = c
  9108. },
  9109. ha = function (a, b, c) {
  9110. this.shape = a;
  9111. this.t = b;
  9112. this.n = c
  9113. };
  9114. ha.prototype.hitPoint = function (a, b) {
  9115. return T(a, b, this.t)
  9116. };
  9117. ha.prototype.hitDist = function (a, b) {
  9118. return sa(a, b) * this.t
  9119. };
  9120. var fa = c.CircleShape = function (a, b, c) {
  9121. this.c = this.tc = c;
  9122. this.r = b;
  9123. this.type = "circle";
  9124. O.call(this, a)
  9125. };
  9126. fa.prototype = Object.create(O.prototype);
  9127. fa.prototype.cacheData =
  9128. function (a, b) {
  9129. var c = this.tc = E(this.c, b)
  9130. .add(a),
  9131. d = this.r;
  9132. this.bb_l = c.x - d;
  9133. this.bb_b = c.y - d;
  9134. this.bb_r = c.x + d;
  9135. this.bb_t = c.y + d
  9136. };
  9137. fa.prototype.nearestPointQuery = function (a) {
  9138. var b = a.x - this.tc.x,
  9139. c = a.y - this.tc.y;
  9140. a = K(b, c);
  9141. var d = this.r,
  9142. b = new q(this.tc.x + b * d / a, this.tc.y + c * d / a);
  9143. return new ta(this, b, a - d)
  9144. };
  9145. var ua = function (a, b, c, d, e) {
  9146. d = y(d, b);
  9147. e = y(e, b);
  9148. b = u(d, d) - 2 * u(d, e) + u(e, e);
  9149. var f = -2 * u(d, d) + 2 * u(d, e);
  9150. c = u(d, d) - c * c;
  9151. c = f * f - 4 * b * c;
  9152. if (0 <= c && (b = (-f - Math.sqrt(c)) / (2 * b), 0 <= b && 1 >= b)) return new ha(a, b, Q(T(d, e, b)))
  9153. };
  9154. fa.prototype.segmentQuery =
  9155. function (a, b) {
  9156. return ua(this, this.tc, this.r, a, b)
  9157. };
  9158. var ba = c.SegmentShape = function (a, b, c, d) {
  9159. this.a = b;
  9160. this.b = c;
  9161. this.n = J(Q(y(c, b)));
  9162. this.ta = this.tb = this.tn = null;
  9163. this.r = d;
  9164. this.b_tangent = this.a_tangent = w;
  9165. this.type = "segment";
  9166. O.call(this, a)
  9167. };
  9168. ba.prototype = Object.create(O.prototype);
  9169. ba.prototype.cacheData = function (a, b) {
  9170. this.ta = A(a, E(this.a, b));
  9171. this.tb = A(a, E(this.b, b));
  9172. this.tn = E(this.n, b);
  9173. var c, d, e, f;
  9174. this.ta.x < this.tb.x ? (c = this.ta.x, d = this.tb.x) : (c = this.tb.x, d = this.ta.x);
  9175. this.ta.y < this.tb.y ? (e = this.ta.y, f = this.tb.y) :
  9176. (e = this.tb.y, f = this.ta.y);
  9177. var g = this.r;
  9178. this.bb_l = c - g;
  9179. this.bb_b = e - g;
  9180. this.bb_r = d + g;
  9181. this.bb_t = f + g
  9182. };
  9183. ba.prototype.nearestPointQuery = function (a) {
  9184. var b;
  9185. b = this.tb;
  9186. var c = y(this.ta, b),
  9187. d = t(u(c, y(a, b)) / N(c));
  9188. b = A(b, z(c, d));
  9189. var c = a.x - b.x,
  9190. e = a.y - b.y;
  9191. a = K(c, e);
  9192. d = this.r;
  9193. b = a ? A(b, z(new q(c, e), d / a)) : b;
  9194. return new ta(this, b, a - d)
  9195. };
  9196. ba.prototype.segmentQuery = function (a, b) {
  9197. var c = this.tn,
  9198. d = u(y(this.ta, a), c),
  9199. e = this.r,
  9200. f = 0 < d ? C(c) : c,
  9201. g = y(z(f, e), a),
  9202. h = A(this.ta, g),
  9203. k = A(this.tb, g),
  9204. g = y(b, a);
  9205. if (0 >= F(g, h) * F(g, k)) {
  9206. if (e = d + (0 < d ? -e : e), d = -e,
  9207. c = u(g, c) - e, 0 > d * c) return new ha(this, d / (d - c), f)
  9208. } else if (0 !== e) return f = ua(this, this.ta, this.r, a, b), c = ua(this, this.tb, this.r, a, b), f ? c && c.t < f.t ? c : f : c
  9209. };
  9210. ba.prototype.setNeighbors = function (a, b) {
  9211. this.a_tangent = y(a, this.a);
  9212. this.b_tangent = y(b, this.b)
  9213. };
  9214. ba.prototype.setEndpoints = function (a, b) {
  9215. this.a = a;
  9216. this.b = b;
  9217. this.n = J(Q(y(b, a)))
  9218. };
  9219. var Ma = function (a) {
  9220. for (var b = a.length, c = 0; b > c; c += 2) {
  9221. var d = a[(c + 2) % b],
  9222. e = a[(c + 3) % b];
  9223. if (0 < (d - a[c]) * (a[(c + 5) % b] - e) - (e - a[c + 1]) * (a[(c + 4) % b] - d)) return !1
  9224. }
  9225. return !0
  9226. },
  9227. R = c.PolyShape = function (a,
  9228. b, c) {
  9229. this.setVerts(b, c);
  9230. this.type = "poly";
  9231. O.call(this, a)
  9232. };
  9233. R.prototype = Object.create(O.prototype);
  9234. var va = function (a, b) {
  9235. this.n = a;
  9236. this.d = b
  9237. };
  9238. va.prototype.compare = function (a) {
  9239. return u(this.n, a) - this.d
  9240. };
  9241. R.prototype.setVerts = function (a, b) {
  9242. g(4 <= a.length, "Polygons require some verts");
  9243. g("number" == typeof a[0], "Polygon verticies should be specified in a flattened list (eg [x1,y1,x2,y2,x3,y3,...])");
  9244. g(Ma(a), "Polygon is concave or has a reversed winding. Consider using cpConvexHull()");
  9245. var c = a.length,
  9246. d = c >> 1;
  9247. this.verts =
  9248. Array(c);
  9249. this.tVerts = Array(c);
  9250. this.planes = Array(d);
  9251. this.tPlanes = Array(d);
  9252. for (d = 0; c > d; d += 2) {
  9253. var e = a[d] + b.x,
  9254. f = a[d + 1] + b.y,
  9255. h = Q(J(new q(a[(d + 2) % c] + b.x - e, a[(d + 3) % c] + b.y - f)));
  9256. this.verts[d] = e;
  9257. this.verts[d + 1] = f;
  9258. this.planes[d >> 1] = new va(h, h.x * e + h.y * f);
  9259. this.tPlanes[d >> 1] = new va(new q(0, 0), 0)
  9260. }
  9261. };
  9262. c.BoxShape = function (a, b, c) {
  9263. b /= 2;
  9264. c /= 2;
  9265. return hb(a, new $(-b, -c, b, c))
  9266. };
  9267. var hb = c.BoxShape2 = function (a, b) {
  9268. return new R(a, [b.l, b.b, b.l, b.t, b.r, b.t, b.r, b.b], w)
  9269. };
  9270. R.prototype.transformVerts = function (c, d) {
  9271. for (var e = this.verts, f =
  9272. this.tVerts, g = 1 / 0, h = -1 / 0, k = 1 / 0, m = -1 / 0, n = 0; e.length > n; n += 2) {
  9273. var q = e[n],
  9274. p = e[n + 1],
  9275. r = c.x + q * d.x - p * d.y,
  9276. q = c.y + q * d.y + p * d.x;
  9277. f[n] = r;
  9278. f[n + 1] = q;
  9279. g = a(g, r);
  9280. h = b(h, r);
  9281. k = a(k, q);
  9282. m = b(m, q)
  9283. }
  9284. this.bb_l = g;
  9285. this.bb_b = k;
  9286. this.bb_r = h;
  9287. this.bb_t = m
  9288. };
  9289. R.prototype.transformAxes = function (a, b) {
  9290. for (var c = this.planes, d = this.tPlanes, e = 0; c.length > e; e++) {
  9291. var f = E(c[e].n, b);
  9292. d[e].n = f;
  9293. d[e].d = u(a, f) + c[e].d
  9294. }
  9295. };
  9296. R.prototype.cacheData = function (a, b) {
  9297. this.transformAxes(a, b);
  9298. this.transformVerts(a, b)
  9299. };
  9300. R.prototype.nearestPointQuery = function (a) {
  9301. for (var b =
  9302. this.tPlanes, c = this.tVerts, d = c[c.length - 2], e = c[c.length - 1], f = 1 / 0, g = w, h = !1, k = 0; b.length > k; k++) {
  9303. 0 < b[k].compare(a) && (h = !0);
  9304. var m = c[2 * k],
  9305. n = c[2 * k + 1],
  9306. p;
  9307. p = m;
  9308. var r = n,
  9309. d = d - p,
  9310. e = e - r,
  9311. s = t((d * (a.x - p) + e * (a.y - r)) / Z(d, e));
  9312. p = new q(p + d * s, r + e * s);
  9313. r = sa(a, p);
  9314. f > r && (f = r, g = p);
  9315. d = m;
  9316. e = n
  9317. }
  9318. return new ta(this, g, h ? f : -f)
  9319. };
  9320. R.prototype.segmentQuery = function (a, b) {
  9321. for (var c = this.tPlanes, d = this.tVerts, e = c.length, f = 2 * e, g = 0; e > g; g++) {
  9322. var h = c[g].n,
  9323. k = u(a, h);
  9324. if (!(c[g].d > k)) {
  9325. var m = u(b, h),
  9326. k = (c[g].d - k) / (m - k);
  9327. if (!(0 > k || 1 < k)) {
  9328. var m = T(a, b, k),
  9329. m = -F(h,
  9330. m),
  9331. n = -(h.x * d[(2 * g + 3) % f] - h.y * d[(2 * g + 2) % f]);
  9332. if (m >= -(h.x * d[2 * g + 1] - h.y * d[2 * g]) && n >= m) return new ha(this, k, h)
  9333. }
  9334. }
  9335. }
  9336. };
  9337. R.prototype.valueOnAxis = function (b, c) {
  9338. for (var d = this.tVerts, e = b.x * d[0] + b.y * d[1], f = 2; d.length > f; f += 2) e = a(e, b.x * d[f] + b.y * d[f + 1]);
  9339. return e - c
  9340. };
  9341. R.prototype.containsVert = function (a, b) {
  9342. for (var c = this.tPlanes, d = 0; c.length > d; d++) {
  9343. var e = c[d].n;
  9344. if (0 < e.x * a + e.y * b - c[d].d) return !1
  9345. }
  9346. return !0
  9347. };
  9348. R.prototype.containsVertPartial = function (a, b, c) {
  9349. for (var d = this.tPlanes, e = 0; d.length > e; e++) {
  9350. var f = d[e].n;
  9351. if (!(0 > u(f,
  9352. c)) && 0 < f.x * a + f.y * b - d[e].d) return !1
  9353. }
  9354. return !0
  9355. };
  9356. R.prototype.getNumVerts = function () {
  9357. return this.verts.length / 2
  9358. };
  9359. R.prototype.getVert = function (a) {
  9360. return new q(this.verts[2 * a], this.verts[2 * a + 1])
  9361. };
  9362. var D = c.Body = function (a, b) {
  9363. this.p = new q(0, 0);
  9364. this.vx = this.vy = 0;
  9365. this.f = new q(0, 0);
  9366. this.t = this.w = 0;
  9367. this.v_limit = 1 / 0;
  9368. this.w_limit = 1 / 0;
  9369. this.w_bias = this.v_biasx = this.v_biasy = 0;
  9370. this.space = null;
  9371. this.shapeList = [];
  9372. this.nodeNext = this.nodeRoot = this.constraintList = this.arbiterList = null;
  9373. this.nodeIdleTime = 0;
  9374. this.setMass(a);
  9375. this.setMoment(b);
  9376. this.rot = new q(0, 0);
  9377. this.setAngle(0)
  9378. };
  9379. if ("undefined" != typeof DEBUG && DEBUG) {
  9380. var wa = function (a, b) {
  9381. g(a.x == a.x && a.y == a.y, b)
  9382. },
  9383. xa = function (a, b) {
  9384. g(1 / 0 !== Math.abs(a.x) && 1 / 0 !== Math.abs(a.y), b)
  9385. };
  9386. D.prototype.sanityCheck = function () {
  9387. g(this.m === this.m && this.m_inv === this.m_inv, "Body's mass is invalid.");
  9388. g(this.i === this.i && this.i_inv === this.i_inv, "Body's moment is invalid.");
  9389. var a = this.p;
  9390. wa(a, "Body's position is invalid.");
  9391. xa(a, "Body's position is invalid.");
  9392. a = this.f;
  9393. wa(a, "Body's force is invalid.");
  9394. xa(a, "Body's force is invalid.");
  9395. g(this.vx === this.vx && 1 / 0 !== Math.abs(this.vx), "Body's velocity is invalid.");
  9396. g(this.vy === this.vy && 1 / 0 !== Math.abs(this.vy), "Body's velocity is invalid.");
  9397. g(this.a === this.a && 1 / 0 !== Math.abs(this.a), "Body's angle is invalid.");
  9398. g(this.w === this.w && 1 / 0 !== Math.abs(this.w), "Body's angular velocity is invalid.");
  9399. g(this.t === this.t && 1 / 0 !== Math.abs(this.t), "Body's torque is invalid.");
  9400. a = this.rot;
  9401. wa(a, "Body's rotation vector is invalid.");
  9402. xa(a, "Body's rotation vector is invalid.");
  9403. g(this.v_limit === this.v_limit,
  9404. "Body's velocity limit is invalid.");
  9405. g(this.w_limit === this.w_limit, "Body's angular velocity limit is invalid.")
  9406. }
  9407. } else D.prototype.sanityCheck = function () {};
  9408. D.prototype.getPos = function () {
  9409. return this.p
  9410. };
  9411. D.prototype.getVel = function () {
  9412. return new q(this.vx, this.vy)
  9413. };
  9414. D.prototype.getAngVel = function () {
  9415. return this.w
  9416. };
  9417. D.prototype.isSleeping = function () {
  9418. return null !== this.nodeRoot
  9419. };
  9420. D.prototype.isStatic = function () {
  9421. return 1 / 0 === this.nodeIdleTime
  9422. };
  9423. D.prototype.isRogue = function () {
  9424. return null === this.space
  9425. };
  9426. D.prototype.setMass =
  9427. function (a) {
  9428. g(0 < a, "Mass must be positive and non-zero.");
  9429. this.activate();
  9430. this.m = a;
  9431. this.m_inv = 1 / a
  9432. };
  9433. D.prototype.setMoment = function (a) {
  9434. g(0 < a, "Moment of Inertia must be positive and non-zero.");
  9435. this.activate();
  9436. this.i = a;
  9437. this.i_inv = 1 / a
  9438. };
  9439. D.prototype.addShape = function (a) {
  9440. this.shapeList.push(a)
  9441. };
  9442. D.prototype.removeShape = function (a) {
  9443. k(this.shapeList, a)
  9444. };
  9445. var ya = function (a, b, c) {
  9446. return a === c ? a.next(b) : (a.a === b ? a.next_a = ya(a.next_a, b, c) : a.next_b = ya(a.next_b, b, c), a)
  9447. };
  9448. D.prototype.removeConstraint = function (a) {
  9449. this.constraintList =
  9450. ya(this.constraintList, this, a)
  9451. };
  9452. D.prototype.setPos = function (a) {
  9453. this.activate();
  9454. this.sanityCheck();
  9455. a === w && (a = c.v(0, 0));
  9456. this.p = a
  9457. };
  9458. D.prototype.setVel = function (a) {
  9459. this.activate();
  9460. this.vx = a.x;
  9461. this.vy = a.y
  9462. };
  9463. D.prototype.setAngVel = function (a) {
  9464. this.activate();
  9465. this.w = a
  9466. };
  9467. D.prototype.setAngleInternal = function (a) {
  9468. g(!isNaN(a), "Internal Error: Attempting to set body's angle to NaN");
  9469. this.a = a;
  9470. this.rot.x = Math.cos(a);
  9471. this.rot.y = Math.sin(a)
  9472. };
  9473. D.prototype.setAngle = function (a) {
  9474. this.activate();
  9475. this.sanityCheck();
  9476. this.setAngleInternal(a)
  9477. };
  9478. D.prototype.velocity_func = function (a, b, c) {
  9479. var d = this.vx * b + (a.x + this.f.x * this.m_inv) * c;
  9480. a = this.vy * b + (a.y + this.f.y * this.m_inv) * c;
  9481. var e = this.v_limit,
  9482. f = d * d + a * a,
  9483. e = f > e * e ? e / Math.sqrt(f) : 1;
  9484. this.vx = d * e;
  9485. this.vy = a * e;
  9486. d = this.w_limit;
  9487. this.w = s(this.w * b + this.t * this.i_inv * c, -d, d);
  9488. this.sanityCheck()
  9489. };
  9490. D.prototype.position_func = function (a) {
  9491. this.p.x += (this.vx + this.v_biasx) * a;
  9492. this.p.y += (this.vy + this.v_biasy) * a;
  9493. this.setAngleInternal(this.a + (this.w + this.w_bias) * a);
  9494. this.w_bias = this.v_biasx = this.v_biasy = 0;
  9495. this.sanityCheck()
  9496. };
  9497. D.prototype.resetForces = function () {
  9498. this.activate();
  9499. this.f = new q(0, 0);
  9500. this.t = 0
  9501. };
  9502. D.prototype.applyForce = function (a, b) {
  9503. this.activate();
  9504. this.f = A(this.f, a);
  9505. this.t += F(b, a)
  9506. };
  9507. D.prototype.applyImpulse = function (a, b) {
  9508. this.activate();
  9509. za(this, a.x, a.y, b)
  9510. };
  9511. D.prototype.getVelAtPoint = function (a) {
  9512. return A(new q(this.vx, this.vy), z(J(a), this.w))
  9513. };
  9514. D.prototype.getVelAtWorldPoint = function (a) {
  9515. return this.getVelAtPoint(y(a, this.p))
  9516. };
  9517. D.prototype.getVelAtLocalPoint = function (a) {
  9518. return this.getVelAtPoint(E(a, this.rot))
  9519. };
  9520. D.prototype.eachShape =
  9521. function (a) {
  9522. for (var b = 0, c = this.shapeList.length; c > b; b++) a(this.shapeList[b])
  9523. };
  9524. D.prototype.eachConstraint = function (a) {
  9525. for (var b = this.constraintList; b;) {
  9526. var c = b.next(this);
  9527. a(b);
  9528. b = c
  9529. }
  9530. };
  9531. D.prototype.eachArbiter = function (a) {
  9532. for (var b = this.arbiterList; b;) {
  9533. var c = b.next(this);
  9534. b.swappedColl = this === b.body_b;
  9535. a(b);
  9536. b = c
  9537. }
  9538. };
  9539. D.prototype.local2World = function (a) {
  9540. return A(this.p, E(a, this.rot))
  9541. };
  9542. D.prototype.world2Local = function (a) {
  9543. return S(y(a, this.p), this.rot)
  9544. };
  9545. D.prototype.kineticEnergy = function () {
  9546. var a = this.vx * this.vx +
  9547. this.vy * this.vy,
  9548. b = this.w * this.w;
  9549. return (a ? a * this.m : 0) + (b ? b * this.i : 0)
  9550. };
  9551. var Aa = c.SpatialIndex = function (a) {
  9552. if (this.staticIndex = a, a) {
  9553. if (a.dynamicIndex) throw Error("This static index is already associated with a dynamic index.");
  9554. a.dynamicIndex = this
  9555. }
  9556. };
  9557. Aa.prototype.collideStatic = function (a, b) {
  9558. if (0 < a.count) {
  9559. var c = a.query;
  9560. this.each(function (a) {
  9561. c(a, new $(a.bb_l, a.bb_b, a.bb_r, a.bb_t), b)
  9562. })
  9563. }
  9564. };
  9565. var I = c.BBTree = function (a) {
  9566. Aa.call(this, a);
  9567. this.velocityFunc = null;
  9568. this.leaves = {};
  9569. this.count = 0;
  9570. this.pooledPairs = this.pooledNodes =
  9571. this.root = null;
  9572. this.stamp = 0
  9573. };
  9574. I.prototype = Object.create(Aa.prototype);
  9575. var ib = 0,
  9576. W = function (c, d, e) {
  9577. this.obj = null;
  9578. this.bb_l = a(d.bb_l, e.bb_l);
  9579. this.bb_b = a(d.bb_b, e.bb_b);
  9580. this.bb_r = b(d.bb_r, e.bb_r);
  9581. this.bb_t = b(d.bb_t, e.bb_t);
  9582. this.parent = null;
  9583. this.setA(d);
  9584. this.setB(e)
  9585. };
  9586. I.prototype.makeNode = function (a, b) {
  9587. var c = this.pooledNodes;
  9588. return c ? (this.pooledNodes = c.parent, c.constructor(this, a, b), c) : (ib++, new W(this, a, b))
  9589. };
  9590. var jb = 0,
  9591. X = function (a, b) {
  9592. this.obj = b;
  9593. a.getBB(b, this);
  9594. this.parent = null;
  9595. this.stamp = 1;
  9596. this.pairs = null;
  9597. jb++
  9598. };
  9599. I.prototype.getBB = function (c, d) {
  9600. var e = this.velocityFunc;
  9601. if (e) {
  9602. var f = 0.1 * (c.bb_r - c.bb_l),
  9603. g = 0.1 * (c.bb_t - c.bb_b),
  9604. e = z(e(c), 0.1);
  9605. d.bb_l = c.bb_l + a(-f, e.x);
  9606. d.bb_b = c.bb_b + a(-g, e.y);
  9607. d.bb_r = c.bb_r + b(f, e.x);
  9608. d.bb_t = c.bb_t + b(g, e.y)
  9609. } else d.bb_l = c.bb_l, d.bb_b = c.bb_b, d.bb_r = c.bb_r, d.bb_t = c.bb_t
  9610. };
  9611. I.prototype.getStamp = function () {
  9612. var a = this.dynamicIndex;
  9613. return a && a.stamp ? a.stamp : this.stamp
  9614. };
  9615. I.prototype.incrementStamp = function () {
  9616. this.dynamicIndex && this.dynamicIndex.stamp ? this.dynamicIndex.stamp++ : this.stamp++
  9617. };
  9618. var kb = 0,
  9619. Na = function (a, b, c, d) {
  9620. this.prevA = null;
  9621. this.leafA = a;
  9622. this.nextA = b;
  9623. this.prevB = null;
  9624. this.leafB = c;
  9625. this.nextB = d
  9626. };
  9627. I.prototype.makePair = function (a, b, c, d) {
  9628. var e = this.pooledPairs;
  9629. return e ? (this.pooledPairs = e.prevA, e.prevA = null, e.leafA = a, e.nextA = b, e.prevB = null, e.leafB = c, e.nextB = d, e) : (kb++, new Na(a, b, c, d))
  9630. };
  9631. Na.prototype.recycle = function (a) {
  9632. this.prevA = a.pooledPairs;
  9633. a.pooledPairs = this
  9634. };
  9635. var Oa = function (a, b, c) {
  9636. c && (c.leafA === b ? c.prevA = a : c.prevB = a);
  9637. a ? a.leafA === b ? a.nextA = c : a.nextB = c : b.pairs = c
  9638. };
  9639. X.prototype.clearPairs =
  9640. function (a) {
  9641. var b, c = this.pairs;
  9642. for (this.pairs = null; c;) c.leafA === this ? (b = c.nextA, Oa(c.prevB, c.leafB, c.nextB)) : (b = c.nextB, Oa(c.prevA, c.leafA, c.nextA)), c.recycle(a), c = b
  9643. };
  9644. var Pa = function (a, b, c) {
  9645. var d = a.pairs,
  9646. e = b.pairs;
  9647. c = c.makePair(a, d, b, e);
  9648. a.pairs = b.pairs = c;
  9649. d && (d.leafA === a ? d.prevA = c : d.prevB = c);
  9650. e && (e.leafA === b ? e.prevA = c : e.prevB = c)
  9651. };
  9652. W.prototype.recycle = function (a) {
  9653. this.parent = a.pooledNodes;
  9654. a.pooledNodes = this
  9655. };
  9656. X.prototype.recycle = function () {};
  9657. W.prototype.setA = function (a) {
  9658. this.A = a;
  9659. a.parent = this
  9660. };
  9661. W.prototype.setB =
  9662. function (a) {
  9663. this.B = a;
  9664. a.parent = this
  9665. };
  9666. X.prototype.isLeaf = !0;
  9667. W.prototype.isLeaf = !1;
  9668. W.prototype.otherChild = function (a) {
  9669. return this.A == a ? this.B : this.A
  9670. };
  9671. W.prototype.replaceChild = function (c, d, e) {
  9672. f(c == this.A || c == this.B, "Node is not a child of parent.");
  9673. this.A == c ? (this.A.recycle(e), this.setA(d)) : (this.B.recycle(e), this.setB(d));
  9674. for (c = this; c; c = c.parent) d = c.A, e = c.B, c.bb_l = a(d.bb_l, e.bb_l), c.bb_b = a(d.bb_b, e.bb_b), c.bb_r = b(d.bb_r, e.bb_r), c.bb_t = b(d.bb_t, e.bb_t)
  9675. };
  9676. W.prototype.bbArea = X.prototype.bbArea = function () {
  9677. return (this.bb_r -
  9678. this.bb_l) * (this.bb_t - this.bb_b)
  9679. };
  9680. var Qa = function (c, d) {
  9681. return (b(c.bb_r, d.bb_r) - a(c.bb_l, d.bb_l)) * (b(c.bb_t, d.bb_t) - a(c.bb_b, d.bb_b))
  9682. },
  9683. Ra = function (a, b) {
  9684. return Math.abs(a.bb_l + a.bb_r - b.bb_l - b.bb_r) + Math.abs(a.bb_b + a.bb_t - b.bb_b - b.bb_t)
  9685. },
  9686. ia = function (c, d, e) {
  9687. if (null == c) return d;
  9688. if (c.isLeaf) return e.makeNode(d, c);
  9689. var f = c.B.bbArea() + Qa(c.A, d),
  9690. g = c.A.bbArea() + Qa(c.B, d);
  9691. return f === g && (f = Ra(c.A, d), g = Ra(c.B, d)), f > g ? c.setB(ia(c.B, d, e)) : c.setA(ia(c.A, d, e)), c.bb_l = a(c.bb_l, d.bb_l), c.bb_b = a(c.bb_b, d.bb_b), c.bb_r =
  9692. b(c.bb_r, d.bb_r), c.bb_t = b(c.bb_t, d.bb_t), c
  9693. };
  9694. W.prototype.intersectsBB = X.prototype.intersectsBB = function (a) {
  9695. return this.bb_l <= a.r && a.l <= this.bb_r && this.bb_b <= a.t && a.b <= this.bb_t
  9696. };
  9697. var Ba = function (a, b, c) {
  9698. a.intersectsBB(b) && (a.isLeaf ? c(a.obj) : (Ba(a.A, b, c), Ba(a.B, b, c)))
  9699. },
  9700. Sa = function (c, d, e) {
  9701. var f = 1 / (e.x - d.x),
  9702. g = c.bb_l == d.x ? -1 / 0 : (c.bb_l - d.x) * f,
  9703. h = c.bb_r == d.x ? 1 / 0 : (c.bb_r - d.x) * f,
  9704. f = a(g, h),
  9705. g = b(g, h),
  9706. h = 1 / (e.y - d.y);
  9707. e = c.bb_b == d.y ? -1 / 0 : (c.bb_b - d.y) * h;
  9708. d = c.bb_t == d.y ? 1 / 0 : (c.bb_t - d.y) * h;
  9709. c = a(e, d);
  9710. d = b(e, d);
  9711. return g >= c && d >=
  9712. f && (f = b(f, c), 0 <= a(g, d) && 1 >= f) ? b(f, 0) : 1 / 0
  9713. },
  9714. ja = function (b, c, d, e, f) {
  9715. if (b.isLeaf) return f(b.obj);
  9716. var g = Sa(b.A, c, d),
  9717. h = Sa(b.B, c, d);
  9718. return h > g ? (e > g && (e = a(e, ja(b.A, c, d, e, f))), e > h && (e = a(e, ja(b.B, c, d, e, f)))) : (e > h && (e = a(e, ja(b.B, c, d, e, f))), e > g && (e = a(e, ja(b.A, c, d, e, f)))), e
  9719. };
  9720. I.prototype.subtreeRecycle = function (a) {
  9721. a.isLeaf && (this.subtreeRecycle(a.A), this.subtreeRecycle(a.B), a.recycle(this))
  9722. };
  9723. var Ta = function (a, b, c) {
  9724. if (b == a) return null;
  9725. var d = b.parent;
  9726. return d == a ? (b = a.otherChild(b), b.parent = a.parent, a.recycle(c),
  9727. b) : (d.parent.replaceChild(d, d.otherChild(b), c), a)
  9728. },
  9729. Ua = function (a, b) {
  9730. return a.bb_l <= b.bb_r && b.bb_l <= a.bb_r && a.bb_b <= b.bb_t && b.bb_b <= a.bb_t
  9731. };
  9732. X.prototype.markLeafQuery = function (a, b, c, d) {
  9733. Ua(a, this) && (b ? Pa(a, this, c) : (this.stamp < a.stamp && Pa(this, a, c), d && d(a.obj, this.obj)))
  9734. };
  9735. W.prototype.markLeafQuery = function (a, b, c, d) {
  9736. Ua(a, this) && (this.A.markLeafQuery(a, b, c, d), this.B.markLeafQuery(a, b, c, d))
  9737. };
  9738. X.prototype.markSubtree = function (a, b, c) {
  9739. if (this.stamp == a.getStamp())
  9740. for (b && b.markLeafQuery(this, !1, a, c), b = this; b.parent; b =
  9741. b.parent) b == b.parent.A ? b.parent.B.markLeafQuery(this, !0, a, c) : b.parent.A.markLeafQuery(this, !1, a, c);
  9742. else
  9743. for (a = this.pairs; a;) this === a.leafB ? (c && c(a.leafA.obj, this.obj), a = a.nextB) : a = a.nextA
  9744. };
  9745. W.prototype.markSubtree = function (a, b, c) {
  9746. this.A.markSubtree(a, b, c);
  9747. this.B.markSubtree(a, b, c)
  9748. };
  9749. X.prototype.containsObj = function (a) {
  9750. return this.bb_l <= a.bb_l && this.bb_r >= a.bb_r && this.bb_b <= a.bb_b && this.bb_t >= a.bb_t
  9751. };
  9752. X.prototype.update = function (a) {
  9753. var b = a.root;
  9754. return this.containsObj(this.obj) ? !1 : (a.getBB(this.obj, this),
  9755. b = Ta(b, this, a), a.root = ia(b, this, a), this.clearPairs(a), this.stamp = a.getStamp(), !0)
  9756. };
  9757. X.prototype.addPairs = function (a) {
  9758. var b = a.dynamicIndex;
  9759. b ? (a = b.root) && a.markLeafQuery(this, !0, b, null) : this.markSubtree(a, a.staticIndex.root, null)
  9760. };
  9761. I.prototype.insert = function (a, b) {
  9762. var c = new X(this, a);
  9763. this.leaves[b] = c;
  9764. this.root = ia(this.root, c, this);
  9765. this.count++;
  9766. c.stamp = this.getStamp();
  9767. c.addPairs(this);
  9768. this.incrementStamp()
  9769. };
  9770. I.prototype.remove = function (a, b) {
  9771. var c = this.leaves[b];
  9772. delete this.leaves[b];
  9773. this.root = Ta(this.root,
  9774. c, this);
  9775. this.count--;
  9776. c.clearPairs(this);
  9777. c.recycle(this)
  9778. };
  9779. I.prototype.contains = function (a, b) {
  9780. return null != this.leaves[b]
  9781. };
  9782. var lb = function () {};
  9783. I.prototype.reindexQuery = function (a) {
  9784. if (this.root) {
  9785. var b, c = this.leaves;
  9786. for (b in c) c[b].update(this);
  9787. c = (b = this.staticIndex) && b.root;
  9788. this.root.markSubtree(this, c, a);
  9789. b && !c && this.collideStatic(this, b, a);
  9790. this.incrementStamp()
  9791. }
  9792. };
  9793. I.prototype.reindex = function () {
  9794. this.reindexQuery(lb)
  9795. };
  9796. I.prototype.reindexObject = function (a, b) {
  9797. var c = this.leaves[b];
  9798. c && (c.update(this) && c.addPairs(this),
  9799. this.incrementStamp())
  9800. };
  9801. I.prototype.pointQuery = function (a, b) {
  9802. this.query(new $(a.x, a.y, a.x, a.y), b)
  9803. };
  9804. I.prototype.segmentQuery = function (a, b, c, d) {
  9805. this.root && ja(this.root, a, b, c, d)
  9806. };
  9807. I.prototype.query = function (a, b) {
  9808. this.root && Ba(this.root, a, b)
  9809. };
  9810. I.prototype.count = function () {
  9811. return this.count
  9812. };
  9813. I.prototype.each = function (a) {
  9814. for (var b in this.leaves) a(this.leaves[b].obj)
  9815. };
  9816. var Ca = function (c, d, e, f) {
  9817. if (1 == f) return d[e];
  9818. if (2 == f) return c.makeNode(d[e], d[e + 1]);
  9819. for (var g = d[e], h = g.bb_l, k = g.bb_b, m = g.bb_r, n = g.bb_t, q = e +
  9820. f, p = e + 1; q > p; p++) g = d[p], h = a(h, g.bb_l), k = a(k, g.bb_b), m = b(m, g.bb_r), n = b(n, g.bb_t);
  9821. var g = m - h > n - k,
  9822. r = Array(2 * f);
  9823. if (g)
  9824. for (p = e; q > p; p++) r[2 * p + 0] = d[p].bb_l, r[2 * p + 1] = d[p].bb_r;
  9825. else
  9826. for (p = e; q > p; p++) r[2 * p + 0] = d[p].bb_b, r[2 * p + 1] = d[p].bb_t;
  9827. r.sort(function (a, b) {
  9828. return a - b
  9829. });
  9830. var s = 0.5 * (r[f - 1] + r[f]),
  9831. p = h,
  9832. r = k,
  9833. t = m,
  9834. w = n;
  9835. g ? t = h = s : w = k = s;
  9836. for (var s = q, u = e; s > u;) g = d[u], (b(g.bb_r, m) - a(g.bb_l, h)) * (b(g.bb_t, n) - a(g.bb_b, k)) < (b(g.bb_r, t) - a(g.bb_l, p)) * (b(g.bb_t, w) - a(g.bb_b, r)) ? (s--, d[u] = d[s], d[s] = g) : u++;
  9837. if (s == f) {
  9838. g = null;
  9839. for (p = e; q > p; p++) g =
  9840. ia(g, d[p], c);
  9841. return g
  9842. }
  9843. return NodeNew(c, Ca(c, d, e, s - e), Ca(c, d, s, q - s))
  9844. };
  9845. I.prototype.optimize = function () {
  9846. var a = Array(this.count),
  9847. b = 0,
  9848. c;
  9849. for (c in this.leaves) a[b++] = this.nodes[c];
  9850. tree.subtreeRecycle(root);
  9851. this.root = Ca(tree, a, a.length)
  9852. };
  9853. var Da = function (a, b) {
  9854. !a.isLeaf && 10 >= b && (Da(a.A, b + 1), Da(a.B, b + 1));
  9855. for (var c = "", d = 0; b > d; d++) c += " ";
  9856. console.log(c + a.bb_b + " " + a.bb_t)
  9857. };
  9858. I.prototype.log = function () {
  9859. this.root && Da(this.root, 0)
  9860. };
  9861. var ea = c.CollisionHandler = function () {
  9862. this.a = this.b = 0
  9863. };
  9864. ea.prototype.begin = function () {
  9865. return !0
  9866. };
  9867. ea.prototype.preSolve = function () {
  9868. return !0
  9869. };
  9870. ea.prototype.postSolve = function () {};
  9871. ea.prototype.separate = function () {};
  9872. var L = function (a, b) {
  9873. this.u = this.e = 0;
  9874. this.surface_vr = w;
  9875. this.a = a;
  9876. this.body_a = a.body;
  9877. this.b = b;
  9878. this.body_b = b.body;
  9879. this.contacts = this.thread_b_next = this.thread_b_prev = this.thread_a_next = this.thread_a_prev = null;
  9880. this.stamp = 0;
  9881. this.handler = null;
  9882. this.swappedColl = !1;
  9883. this.state = "first coll"
  9884. };
  9885. L.prototype.getShapes = function () {
  9886. return this.swappedColl ? [this.b, this.a] : [this.a, this.b]
  9887. };
  9888. L.prototype.totalImpulse =
  9889. function () {
  9890. for (var a = this.contacts, b = new q(0, 0), c = 0, d = a.length; d > c; c++) {
  9891. var e = a[c];
  9892. b.add(z(e.n, e.jnAcc))
  9893. }
  9894. return this.swappedColl ? b : b.neg()
  9895. };
  9896. L.prototype.totalImpulseWithFriction = function () {
  9897. for (var a = this.contacts, b = new q(0, 0), c = 0, d = a.length; d > c; c++) {
  9898. var e = a[c];
  9899. b.add((new q(e.jnAcc, e.jtAcc))
  9900. .rotate(e.n))
  9901. }
  9902. return this.swappedColl ? b : b.neg()
  9903. };
  9904. L.prototype.totalKE = function () {
  9905. for (var a = (1 - this.e) / (1 + this.e), b = 0, c = this.contacts, d = 0, e = c.length; e > d; d++) var f = c[d],
  9906. g = f.jnAcc,
  9907. h = f.jtAcc,
  9908. b = b + (a * g * g / f.nMass + h * h / f.tMass);
  9909. return b
  9910. };
  9911. L.prototype.ignore = function () {
  9912. this.state = "ignore"
  9913. };
  9914. L.prototype.getA = function () {
  9915. return this.swappedColl ? this.b : this.a
  9916. };
  9917. L.prototype.getB = function () {
  9918. return this.swappedColl ? this.a : this.b
  9919. };
  9920. L.prototype.isFirstContact = function () {
  9921. return "first coll" === this.state
  9922. };
  9923. var Va = function (a, b, c) {
  9924. this.point = a;
  9925. this.normal = b;
  9926. this.dist = c
  9927. };
  9928. L.prototype.getContactPointSet = function () {
  9929. var a, b = Array(this.contacts.length);
  9930. for (a = 0; b.length > a; a++) b[a] = new Va(this.contacts[a].p, this.contacts[a].n, this.contacts[a].dist);
  9931. return b
  9932. };
  9933. L.prototype.getNormal = function (a) {
  9934. a = this.contacts[a].n;
  9935. return this.swappedColl ? C(a) : a
  9936. };
  9937. L.prototype.getPoint = function (a) {
  9938. return this.contacts[a].p
  9939. };
  9940. L.prototype.getDepth = function (a) {
  9941. return this.contacts[a].dist
  9942. };
  9943. var Wa = function (a, b, c, d) {
  9944. c ? c.body_a === b ? c.thread_a_next = d : c.thread_b_next = d : b.arbiterList = d;
  9945. d && (d.body_a === b ? d.thread_a_prev = c : d.thread_b_prev = c)
  9946. };
  9947. L.prototype.unthread = function () {
  9948. Wa(this, this.body_a, this.thread_a_prev, this.thread_a_next);
  9949. Wa(this, this.body_b, this.thread_b_prev, this.thread_b_next);
  9950. this.thread_b_prev = this.thread_b_next = this.thread_a_prev = this.thread_a_next = null
  9951. };
  9952. L.prototype.update = function (a, b, c, d) {
  9953. if (this.contacts)
  9954. for (var e = 0; this.contacts.length > e; e++)
  9955. for (var f = this.contacts[e], g = 0; a.length > g; g++) {
  9956. var h = a[g];
  9957. h.hash === f.hash && (h.jnAcc = f.jnAcc, h.jtAcc = f.jtAcc)
  9958. }
  9959. this.contacts = a;
  9960. this.handler = b;
  9961. this.swappedColl = c.collision_type !== b.a;
  9962. this.e = c.e * d.e;
  9963. this.u = c.u * d.u;
  9964. this.surface_vr = y(c.surface_v, d.surface_v);
  9965. this.a = c;
  9966. this.body_a = c.body;
  9967. this.b = d;
  9968. this.body_b = d.body;
  9969. "cached" == this.state &&
  9970. (this.state = "first coll")
  9971. };
  9972. L.prototype.preStep = function (b, c, d) {
  9973. for (var e = this.body_a, f = this.body_b, g = 0; this.contacts.length > g; g++) {
  9974. var h = this.contacts[g];
  9975. h.r1 = y(h.p, e.p);
  9976. h.r2 = y(h.p, f.p);
  9977. h.nMass = 1 / ka(e, f, h.r1, h.r2, h.n);
  9978. h.tMass = 1 / ka(e, f, h.r1, h.r2, J(h.n));
  9979. h.bias = -d * a(0, h.dist + c) / b;
  9980. h.jBias = 0;
  9981. h.bounce = Ea(e, f, h.r1, h.r2, h.n) * this.e
  9982. }
  9983. };
  9984. L.prototype.applyCachedImpulse = function (a) {
  9985. if (!this.isFirstContact())
  9986. for (var b = this.body_a, c = this.body_b, d = 0; this.contacts.length > d; d++) {
  9987. var e = this.contacts[d],
  9988. f = e.n.x,
  9989. g = e.n.y;
  9990. U(b, c, e.r1, e.r2, (f * e.jnAcc - g * e.jtAcc) * a, (f * e.jtAcc + g * e.jnAcc) * a)
  9991. }
  9992. };
  9993. var mb = 0,
  9994. nb = 0;
  9995. L.prototype.applyImpulse = function () {
  9996. mb++;
  9997. for (var a = this.body_a, c = this.body_b, d = this.surface_vr, e = this.u, f = 0; this.contacts.length > f; f++) {
  9998. nb++;
  9999. var g = this.contacts[f],
  10000. h = g.nMass,
  10001. k = g.n,
  10002. m = g.r1,
  10003. n = g.r2,
  10004. q = c.vx - n.y * c.w - (a.vx - m.y * a.w),
  10005. p = c.vy + n.x * c.w - (a.vy + m.x * a.w),
  10006. r = q * k.x + p * k.y,
  10007. t = (q + d.x) * -k.y + (p + d.y) * k.x,
  10008. p = g.jBias;
  10009. g.jBias = b(p + (g.bias - (k.x * (c.v_biasx - n.y * c.w_bias - a.v_biasx + m.y * a.w_bias) + k.y * (n.x * c.w_bias + c.v_biasy - m.x * a.w_bias - a.v_biasy))) *
  10010. h, 0);
  10011. q = g.jnAcc;
  10012. g.jnAcc = b(q + -(g.bounce + r) * h, 0);
  10013. r = e * g.jnAcc;
  10014. h = g.jtAcc;
  10015. g.jtAcc = s(h + -t * g.tMass, -r, r);
  10016. r = k.x * (g.jBias - p);
  10017. p = k.y * (g.jBias - p);
  10018. Xa(a, -r, -p, m);
  10019. Xa(c, r, p, n);
  10020. q = g.jnAcc - q;
  10021. g = g.jtAcc - h;
  10022. U(a, c, m, n, k.x * q - k.y * g, k.x * g + k.y * q)
  10023. }
  10024. };
  10025. L.prototype.callSeparate = function (a) {
  10026. a.lookupHandler(this.a.collision_type, this.b.collision_type)
  10027. .separate(this, a)
  10028. };
  10029. L.prototype.next = function (a) {
  10030. return this.body_a == a ? this.thread_a_next : this.thread_b_next
  10031. };
  10032. var ob = 0,
  10033. aa = function (a, b, c, d) {
  10034. this.p = a;
  10035. this.n = b;
  10036. this.dist = c;
  10037. this.r1 = this.r2 =
  10038. w;
  10039. this.jnAcc = this.jtAcc = this.jBias = this.nMass = this.tMass = this.bounce = this.bias = 0;
  10040. this.hash = d;
  10041. ob++
  10042. },
  10043. V = [],
  10044. ca = function (a, b, c, d) {
  10045. d = c + d;
  10046. b = y(b, a);
  10047. var e = N(b);
  10048. if (!(e >= d * d)) return e = Math.sqrt(e), new aa(A(a, z(b, 0.5 + (c - 0.5 * d) / (e ? e : 1 / 0))), e ? z(b, 1 / e) : new q(1, 0), e - d, 0)
  10049. },
  10050. Fa = 0,
  10051. Ya = function (a, b) {
  10052. var c = 0,
  10053. d = a.valueOnAxis(b[0].n, b[0].d);
  10054. if (0 < d) return -1;
  10055. for (var e = 1; b.length > e; e++) {
  10056. var f = a.valueOnAxis(b[e].n, b[e].d);
  10057. if (0 < f) return -1;
  10058. f > d && (d = f, c = e)
  10059. }
  10060. return Fa = d, c
  10061. },
  10062. Za = function (a, b, c, d) {
  10063. for (var e = [], f = a.tVerts, g = 0; f.length >
  10064. g; g += 2) {
  10065. var k = f[g],
  10066. m = f[g + 1];
  10067. b.containsVert(k, m) && e.push(new aa(new q(k, m), c, d, h(a.hashid, g >> 1)))
  10068. }
  10069. f = b.tVerts;
  10070. for (g = 0; f.length > g; g += 2) k = f[g], m = f[g + 1], a.containsVert(k, m) && e.push(new aa(new q(k, m), c, d, h(b.hashid, g >> 1)));
  10071. if (!e.length) {
  10072. e = [];
  10073. f = a.tVerts;
  10074. for (g = 0; f.length > g; g += 2) k = f[g], m = f[g + 1], b.containsVertPartial(k, m, C(c)) && e.push(new aa(new q(k, m), c, d, h(a.hashid, g)));
  10075. f = b.tVerts;
  10076. for (g = 0; f.length > g; g += 2) k = f[g], m = f[g + 1], a.containsVertPartial(k, m, c) && e.push(new aa(new q(k, m), c, d, h(b.hashid, g)))
  10077. }
  10078. return a = e
  10079. },
  10080. $a = function (b, c, d) {
  10081. var e = u(c, b.ta) - b.r;
  10082. b = u(c, b.tb) - b.r;
  10083. return a(e, b) - d
  10084. },
  10085. ab = function (a, b, c, d, e) {
  10086. for (var f = F(b.tn, b.ta), g = F(b.tn, b.tb), k = z(b.tn, e), m = c.tVerts, n = 0; m.length > n; n += 2) {
  10087. var p = m[n],
  10088. r = m[n + 1];
  10089. if (p * k.x + r * k.y < u(b.tn, b.ta) * e + b.r) {
  10090. var s = b.tn.x * r - b.tn.y * p;
  10091. f >= s && s >= g && a.push(new aa(new q(p, r), k, d, h(c.hashid, n)))
  10092. }
  10093. }
  10094. };
  10095. fa.prototype.collisionCode = 0;
  10096. ba.prototype.collisionCode = 1;
  10097. R.prototype.collisionCode = 2;
  10098. fa.prototype.collisionTable = [
  10099. function (a, b) {
  10100. var c = ca(a.tc, b.tc, a.r, b.r);
  10101. return c ? [c] : V
  10102. },
  10103. function (a, b) {
  10104. var c =
  10105. b.ta,
  10106. d = a.tc,
  10107. e = y(b.tb, c),
  10108. f = t(u(e, y(d, c)) / N(e)),
  10109. c = A(c, z(e, f));
  10110. return (d = ca(d, c, a.r, b.r)) ? (c = d.n, 0 === f && 0 > u(c, b.a_tangent) || 1 === f && 0 > u(c, b.b_tangent) ? V : [d]) : V
  10111. },
  10112. function (a, b) {
  10113. for (var c = b.tPlanes, d = 0, e = u(c[0].n, a.tc) - c[0].d - a.r, f = 0; c.length > f; f++) {
  10114. var g = u(c[f].n, a.tc) - c[f].d - a.r;
  10115. if (0 < g) return V;
  10116. g > e && (e = g, d = f)
  10117. }
  10118. var c = c[d].n,
  10119. h = b.tVerts,
  10120. k = h.length,
  10121. m = d << 1,
  10122. d = h[m],
  10123. f = h[m + 1],
  10124. g = h[(m + 2) % k],
  10125. h = h[(m + 3) % k],
  10126. k = c.x * f - c.y * d,
  10127. m = c.x * h - c.y * g,
  10128. n = F(c, a.tc);
  10129. if (m > n) {
  10130. var p = ca(a.tc, new q(g, h), a.r, 0, p);
  10131. return p ? [p] : V
  10132. }
  10133. return k > n ? [new aa(y(a.tc,
  10134. z(c, a.r + e / 2)), C(c), e, 0)] : (p = ca(a.tc, new q(d, f), a.r, 0, p)) ? [p] : V
  10135. }
  10136. ];
  10137. ba.prototype.collisionTable = [null,
  10138. function () {
  10139. return V
  10140. },
  10141. function (a, b) {
  10142. var c = [],
  10143. d = b.tPlanes,
  10144. e = d.length,
  10145. f = u(a.tn, a.ta),
  10146. g = b.valueOnAxis(a.tn, f) - a.r,
  10147. f = b.valueOnAxis(C(a.tn), -f) - a.r;
  10148. if (0 < f || 0 < g) return V;
  10149. var k = 0,
  10150. m = $a(a, d[0].n, d[0].d);
  10151. if (0 < m) return V;
  10152. for (var n = 0; e > n; n++) {
  10153. var p = $a(a, d[n].n, d[n].d);
  10154. if (0 < p) return V;
  10155. p > m && (m = p, k = n)
  10156. }
  10157. d = C(d[k].n);
  10158. n = A(a.ta, z(d, a.r));
  10159. p = A(a.tb, z(d, a.r));
  10160. if (b.containsVert(n.x, n.y) && c.push(new aa(n, d, m, h(a.hashid, 0))), b.containsVert(p.x,
  10161. p.y) && c.push(new aa(p, d, m, h(a.hashid, 1))), (g >= m || f >= m) && (g > f ? ab(c, a, b, g, 1) : ab(c, a, b, f, -1)), 0 === c.length) {
  10162. f = 2 * k;
  10163. k = b.tVerts;
  10164. m = new q(k[f], k[f + 1]);
  10165. if ((g = ca(a.ta, m, a.r, 0, c)) || (g = ca(a.tb, m, a.r, 0, c))) return [g];
  10166. e *= 2;
  10167. e = new q(k[(f + 2) % e], k[(f + 3) % e]);
  10168. if ((g = ca(a.ta, e, a.r, 0, c)) || (g = ca(a.tb, e, a.r, 0, c))) return [g]
  10169. }
  10170. return c
  10171. }
  10172. ];
  10173. R.prototype.collisionTable = [null, null,
  10174. function (a, b) {
  10175. var c = Ya(b, a.tPlanes);
  10176. if (-1 == c) return V;
  10177. var d = Fa,
  10178. e = Ya(a, b.tPlanes);
  10179. if (-1 == e) return V;
  10180. var f = Fa;
  10181. return d > f ? Za(a, b, a.tPlanes[c].n, d) : Za(a, b, C(b.tPlanes[e].n),
  10182. f)
  10183. }
  10184. ];
  10185. var Ga = c.collideShapes = function (a, b) {
  10186. return g(a.collisionCode <= b.collisionCode, "Collided shapes must be sorted by type"), a.collisionTable[b.collisionCode](a, b)
  10187. },
  10188. bb = new ea,
  10189. B = c.Space = function () {
  10190. this.curr_dt = this.stamp = 0;
  10191. this.bodies = [];
  10192. this.rousedBodies = [];
  10193. this.sleepingComponents = [];
  10194. this.staticShapes = new I(null);
  10195. this.activeShapes = new I(this.staticShapes);
  10196. this.arbiters = [];
  10197. this.contactBuffersHead = null;
  10198. this.cachedArbiters = {};
  10199. this.constraints = [];
  10200. this.locked = 0;
  10201. this.collisionHandlers = {};
  10202. this.defaultHandler =
  10203. bb;
  10204. this.postStepCallbacks = [];
  10205. this.iterations = 10;
  10206. this.gravity = w;
  10207. this.damping = 1;
  10208. this.idleSpeedThreshold = 0;
  10209. this.sleepTimeThreshold = 1 / 0;
  10210. this.collisionSlop = 0.1;
  10211. this.collisionBias = Math.pow(0.9, 60);
  10212. this.collisionPersistence = 3;
  10213. this.enableContactGraph = !1;
  10214. this.staticBody = new D(1 / 0, 1 / 0);
  10215. this.staticBody.nodeIdleTime = 1 / 0;
  10216. this.collideShapes = this.makeCollideShapes()
  10217. };
  10218. B.prototype.getCurrentTimeStep = function () {
  10219. return this.curr_dt
  10220. };
  10221. B.prototype.setIterations = function (a) {
  10222. this.iterations = a
  10223. };
  10224. B.prototype.isLocked = function () {
  10225. return this.locked
  10226. };
  10227. var Y = function (a) {
  10228. g(!a.locked, "This addition/removal cannot be done safely during a call to cpSpaceStep() or during a query. Put these calls into a post-step callback.")
  10229. };
  10230. B.prototype.addCollisionHandler = function (a, b, c, d, e, f) {
  10231. Y(this);
  10232. this.removeCollisionHandler(a, b);
  10233. var g = new ea;
  10234. g.a = a;
  10235. g.b = b;
  10236. c && (g.begin = c);
  10237. d && (g.preSolve = d);
  10238. e && (g.postSolve = e);
  10239. f && (g.separate = f);
  10240. this.collisionHandlers[h(a, b)] = g
  10241. };
  10242. B.prototype.removeCollisionHandler = function (a, b) {
  10243. Y(this);
  10244. delete this.collisionHandlers[h(a, b)]
  10245. };
  10246. B.prototype.setDefaultCollisionHandler =
  10247. function (a, b, c, d) {
  10248. Y(this);
  10249. var e = new ea;
  10250. a && (e.begin = a);
  10251. b && (e.preSolve = b);
  10252. c && (e.postSolve = c);
  10253. d && (e.separate = d);
  10254. this.defaultHandler = e
  10255. };
  10256. B.prototype.lookupHandler = function (a, b) {
  10257. return this.collisionHandlers[h(a, b)] || this.defaultHandler
  10258. };
  10259. B.prototype.addShape = function (a) {
  10260. var b = a.body;
  10261. return b.isStatic() ? this.addStaticShape(a) : (g(!a.space, "This shape is already added to a space and cannot be added to another."), Y(this), b.activate(), b.addShape(a), a.update(b.p, b.rot), this.activeShapes.insert(a, a.hashid), a.space =
  10262. this, a)
  10263. };
  10264. B.prototype.addStaticShape = function (a) {
  10265. g(!a.space, "This shape is already added to a space and cannot be added to another.");
  10266. Y(this);
  10267. var b = a.body;
  10268. return b.addShape(a), a.update(b.p, b.rot), this.staticShapes.insert(a, a.hashid), a.space = this, a
  10269. };
  10270. B.prototype.addBody = function (a) {
  10271. return g(!a.isStatic(), "Static bodies cannot be added to a space as they are not meant to be simulated."), g(!a.space, "This body is already added to a space and cannot be added to another."), Y(this), this.bodies.push(a), a.space =
  10272. this, a
  10273. };
  10274. B.prototype.addConstraint = function (a) {
  10275. g(!a.space, "This shape is already added to a space and cannot be added to another.");
  10276. Y(this);
  10277. var b = a.a,
  10278. c = a.b;
  10279. return b.activate(), c.activate(), this.constraints.push(a), a.next_a = b.constraintList, b.constraintList = a, a.next_b = c.constraintList, c.constraintList = a, a.space = this, a
  10280. };
  10281. B.prototype.filterArbiters = function (a, b) {
  10282. for (var c in this.cachedArbiters) {
  10283. var d = this.cachedArbiters[c];
  10284. (a !== d.body_a || b !== d.a && null !== b) && (a !== d.body_b || b !== d.b && null !== b) || (b && "cached" !==
  10285. d.state && d.callSeparate(this), d.unthread(), k(this.arbiters, d), delete this.cachedArbiters[c])
  10286. }
  10287. };
  10288. B.prototype.removeShape = function (a) {
  10289. var b = a.body;
  10290. b.isStatic() ? this.removeStaticShape(a) : (g(this.containsShape(a), "Cannot remove a shape that was not added to the space. (Removed twice maybe?)"), Y(this), b.activate(), b.removeShape(a), this.filterArbiters(b, a), this.activeShapes.remove(a, a.hashid), a.space = null)
  10291. };
  10292. B.prototype.removeStaticShape = function (a) {
  10293. g(this.containsShape(a), "Cannot remove a static or sleeping shape that was not added to the space. (Removed twice maybe?)");
  10294. Y(this);
  10295. var b = a.body;
  10296. b.isStatic() && b.activateStatic(a);
  10297. b.removeShape(a);
  10298. this.filterArbiters(b, a);
  10299. this.staticShapes.remove(a, a.hashid);
  10300. a.space = null
  10301. };
  10302. B.prototype.removeBody = function (a) {
  10303. g(this.containsBody(a), "Cannot remove a body that was not added to the space. (Removed twice maybe?)");
  10304. Y(this);
  10305. a.activate();
  10306. k(this.bodies, a);
  10307. a.space = null
  10308. };
  10309. B.prototype.removeConstraint = function (a) {
  10310. g(this.containsConstraint(a), "Cannot remove a constraint that was not added to the space. (Removed twice maybe?)");
  10311. Y(this);
  10312. a.a.activate();
  10313. a.b.activate();
  10314. k(this.constraints, a);
  10315. a.a.removeConstraint(a);
  10316. a.b.removeConstraint(a);
  10317. a.space = null
  10318. };
  10319. B.prototype.containsShape = function (a) {
  10320. return a.space === this
  10321. };
  10322. B.prototype.containsBody = function (a) {
  10323. return a.space == this
  10324. };
  10325. B.prototype.containsConstraint = function (a) {
  10326. return a.space == this
  10327. };
  10328. B.prototype.uncacheArbiter = function (a) {
  10329. delete this.cachedArbiters[h(a.a.hashid, a.b.hashid)];
  10330. k(this.arbiters, a)
  10331. };
  10332. B.prototype.eachBody = function (a) {
  10333. this.lock();
  10334. for (var b = this.bodies, c = 0; b.length > c; c++) a(b[c]);
  10335. b = this.sleepingComponents;
  10336. for (c = 0; b.length > c; c++)
  10337. for (var d = b[c]; d;) {
  10338. var e = d.nodeNext;
  10339. a(d);
  10340. d = e
  10341. }
  10342. this.unlock(!0)
  10343. };
  10344. B.prototype.eachShape = function (a) {
  10345. this.lock();
  10346. this.activeShapes.each(a);
  10347. this.staticShapes.each(a);
  10348. this.unlock(!0)
  10349. };
  10350. B.prototype.eachConstraint = function (a) {
  10351. this.lock();
  10352. for (var b = this.constraints, c = 0; b.length > c; c++) a(b[c]);
  10353. this.unlock(!0)
  10354. };
  10355. B.prototype.reindexStatic = function () {
  10356. g(!this.locked, "You cannot manually reindex objects while the space is locked. Wait until the current query or step is complete.");
  10357. this.staticShapes.each(function (a) {
  10358. var b = a.body;
  10359. a.update(b.p, b.rot)
  10360. });
  10361. this.staticShapes.reindex()
  10362. };
  10363. B.prototype.reindexShape = function (a) {
  10364. g(!this.locked, "You cannot manually reindex objects while the space is locked. Wait until the current query or step is complete.");
  10365. var b = a.body;
  10366. a.update(b.p, b.rot);
  10367. this.activeShapes.reindexObject(a, a.hashid);
  10368. this.staticShapes.reindexObject(a, a.hashid)
  10369. };
  10370. B.prototype.reindexShapesForBody = function (a) {
  10371. for (a = a.shapeList; a; a = a.next) this.reindexShape(a)
  10372. };
  10373. B.prototype.useSpatialHash =
  10374. function (a, b) {
  10375. throw Error("Spatial Hash not implemented.");
  10376. };
  10377. B.prototype.activateBody = function (a) {
  10378. if (g(!a.isRogue(), "Internal error: Attempting to activate a rogue body."), this.locked) - 1 === this.rousedBodies.indexOf(a) && this.rousedBodies.push(a);
  10379. else {
  10380. this.bodies.push(a);
  10381. for (var b = 0; a.shapeList.length > b; b++) {
  10382. var c = a.shapeList[b];
  10383. this.staticShapes.remove(c, c.hashid);
  10384. this.activeShapes.insert(c, c.hashid)
  10385. }
  10386. for (b = a.arbiterList; b; b = b.next(a))
  10387. if (c = b.body_a, a === c || c.isStatic()) {
  10388. var c = b.a,
  10389. d = b.b;
  10390. this.cachedArbiters[h(c.hashid,
  10391. d.hashid)] = b;
  10392. b.stamp = this.stamp;
  10393. b.handler = this.lookupHandler(c.collision_type, d.collision_type);
  10394. this.arbiters.push(b)
  10395. }
  10396. for (b = a.constraintList; b; b = b.nodeNext) c = b.a, (a === c || c.isStatic()) && this.constraints.push(b)
  10397. }
  10398. };
  10399. B.prototype.deactivateBody = function (a) {
  10400. g(!a.isRogue(), "Internal error: Attempting to deactivate a rogue body.");
  10401. k(this.bodies, a);
  10402. for (var b = 0; a.shapeList.length > b; b++) {
  10403. var c = a.shapeList[b];
  10404. this.activeShapes.remove(c, c.hashid);
  10405. this.staticShapes.insert(c, c.hashid)
  10406. }
  10407. for (c = a.arbiterList; c; c = c.next(a)) b =
  10408. c.body_a, (a === b || b.isStatic()) && this.uncacheArbiter(c);
  10409. for (c = a.constraintList; c; c = c.nodeNext) b = c.a, (a === b || b.isStatic()) && k(this.constraints, c)
  10410. };
  10411. D.prototype.activate = function () {
  10412. if (!this.isRogue()) {
  10413. this.nodeIdleTime = 0;
  10414. var a = this ? this.nodeRoot : null;
  10415. if (a && a.isSleeping(a)) {
  10416. g(!a.isRogue(), "Internal Error: componentActivate() called on a rogue body.");
  10417. for (var b = a.space, c = a; c;) {
  10418. var d = c.nodeNext;
  10419. c.nodeIdleTime = 0;
  10420. c.nodeRoot = null;
  10421. c.nodeNext = null;
  10422. b.activateBody(c);
  10423. c = d
  10424. }
  10425. k(b.sleepingComponents, a)
  10426. }
  10427. }
  10428. };
  10429. D.prototype.activateStatic =
  10430. function (a) {
  10431. g(this.isStatic(), "Body.activateStatic() called on a non-static body.");
  10432. for (var b = this.arbiterList; b; b = b.next(this)) a && a != b.a && a != b.b || (b.body_a == this ? b.body_b : b.body_a)
  10433. .activate()
  10434. };
  10435. D.prototype.pushArbiter = function (a) {
  10436. f(null === (a.body_a === this ? a.thread_a_next : a.thread_b_next), "Internal Error: Dangling contact graph pointers detected. (A)");
  10437. f(null === (a.body_a === this ? a.thread_a_prev : a.thread_b_prev), "Internal Error: Dangling contact graph pointers detected. (B)");
  10438. var b = this.arbiterList;
  10439. f(null === b || null === (b.body_a === this ? b.thread_a_prev : b.thread_b_prev), "Internal Error: Dangling contact graph pointers detected. (C)");
  10440. a.body_a === this ? a.thread_a_next = b : a.thread_b_next = b;
  10441. b && (b.body_a === this ? b.thread_a_prev = a : b.thread_b_prev = a);
  10442. this.arbiterList = a
  10443. };
  10444. var Ha = function (a, b) {
  10445. if (!b.isRogue()) {
  10446. var c = b ? b.nodeRoot : null;
  10447. if (null == c) {
  10448. b.nodeRoot = a;
  10449. b !== a && (b.nodeNext = a.nodeNext, a.nodeNext = b);
  10450. for (c = b.arbiterList; c; c = c.next(b)) Ha(a, b == c.body_a ? c.body_b : c.body_a);
  10451. for (c = b.constraintList; c; c = c.next(b)) Ha(a,
  10452. b == c.a ? c.b : c.a)
  10453. } else f(c === a, "Internal Error: Inconsistency detected in the contact graph.")
  10454. }
  10455. };
  10456. B.prototype.processComponents = function (a) {
  10457. for (var b = 1 / 0 !== this.sleepTimeThreshold, c = this.bodies, d = 0; c.length > d; d++) {
  10458. var e = c[d];
  10459. f(null === e.nodeNext, "Internal Error: Dangling next pointer detected in contact graph.");
  10460. f(null === e.nodeRoot, "Internal Error: Dangling root pointer detected in contact graph.")
  10461. }
  10462. if (b)
  10463. for (var g = (d = this.idleSpeedThreshold) ? d * d : N(this.gravity) * a * a, d = 0; c.length > d; d++) {
  10464. var e = c[d],
  10465. h = g ? e.m *
  10466. g : 0;
  10467. e.nodeIdleTime = e.kineticEnergy() > h ? 0 : e.nodeIdleTime + a
  10468. }
  10469. g = this.arbiters;
  10470. d = 0;
  10471. for (h = g.length; h > d; d++) {
  10472. var k = g[d],
  10473. e = k.body_a;
  10474. a = k.body_b;
  10475. b && ((a.isRogue() && !a.isStatic() || e.isSleeping()) && e.activate(), (e.isRogue() && !e.isStatic() || a.isSleeping()) && a.activate());
  10476. e.pushArbiter(k);
  10477. a.pushArbiter(k)
  10478. }
  10479. if (b) {
  10480. b = this.constraints;
  10481. for (d = 0; b.length > d; d++) a = b[d], e = a.a, a = a.b, a.isRogue() && !a.isStatic() && e.activate(), e.isRogue() && !e.isStatic() && a.activate();
  10482. for (d = 0; c.length > d;) {
  10483. e = c[d];
  10484. if (!(b = null !== (e ? e.nodeRoot : null))) a: {
  10485. for (Ha(e,
  10486. e), b = e; b; b = b.nodeNext)
  10487. if (this.sleepTimeThreshold > b.nodeIdleTime) {
  10488. b = !0;
  10489. break a
  10490. }
  10491. b = !1
  10492. }
  10493. if (b) d++, e.nodeRoot = null, e.nodeNext = null;
  10494. else
  10495. for (this.sleepingComponents.push(e), b = e; b; b = b.nodeNext) this.deactivateBody(b)
  10496. }
  10497. }
  10498. };
  10499. D.prototype.sleep = function () {
  10500. this.sleepWithGroup(null)
  10501. };
  10502. D.prototype.sleepWithGroup = function (a) {
  10503. g(!this.isStatic() && !this.isRogue(), "Rogue and static bodies cannot be put to sleep.");
  10504. var b = this.space;
  10505. if (g(b, "Cannot put a rogue body to sleep."), g(!b.locked, "Bodies cannot be put to sleep during a query or a call to cpSpaceStep(). Put these calls into a post-step callback."),
  10506. g(null === a || a.isSleeping(), "Cannot use a non-sleeping body as a group identifier."), this.isSleeping()) return g((this ? this.nodeRoot : null) === (a ? a.nodeRoot : null), "The body is already sleeping and it's group cannot be reassigned."), void 0;
  10507. for (var c = 0; this.shapeList.length > c; c++) this.shapeList[c].update(this.p, this.rot);
  10508. (b.deactivateBody(this), a) ? (this.nodeRoot = a = a ? a.nodeRoot : null, this.nodeNext = a.nodeNext, this.nodeIdleTime = 0, a.nodeNext = this) : (this.nodeRoot = this, this.nodeNext = null, this.nodeIdleTime = 0, b.sleepingComponents.push(this));
  10509. k(b.bodies, this)
  10510. };
  10511. B.prototype.activateShapesTouchingShape = function (a) {
  10512. 1 / 0 !== this.sleepTimeThreshold && this.shapeQuery(a, function (a) {
  10513. a.body.activate()
  10514. })
  10515. };
  10516. B.prototype.pointQuery = function (a, b, c, d) {
  10517. var e = function (e) {
  10518. (!e.group || c !== e.group) && b & e.layers && e.pointQuery(a) && d(e)
  10519. },
  10520. f = new $(a.x, a.y, a.x, a.y);
  10521. this.lock();
  10522. this.activeShapes.query(f, e);
  10523. this.staticShapes.query(f, e);
  10524. this.unlock(!0)
  10525. };
  10526. B.prototype.pointQueryFirst = function (a, b, c) {
  10527. var d = null;
  10528. return this.pointQuery(a, b, c, function (a) {
  10529. a.sensor || (d = a)
  10530. }), d
  10531. };
  10532. B.prototype.nearestPointQuery =
  10533. function (a, b, c, d, e) {
  10534. var f = function (f) {
  10535. if ((!f.group || d !== f.group) && c & f.layers) {
  10536. var g = f.nearestPointQuery(a);
  10537. b > g.d && e(f, g.d, g.p)
  10538. }
  10539. },
  10540. g = new $(a.x - b, a.y - b, a.x + b, a.y + b);
  10541. this.lock();
  10542. this.activeShapes.query(g, f);
  10543. this.staticShapes.query(g, f);
  10544. this.unlock(!0)
  10545. };
  10546. B.prototype.nearestPointQueryNearest = function (a, b, c, d) {
  10547. var e, f = function (f) {
  10548. f.group && d === f.group || !(c & f.layers) || f.sensor || (f = f.nearestPointQuery(a), b > f.d && (!e || f.d < e.d) && (e = f))
  10549. },
  10550. g = new $(a.x - b, a.y - b, a.x + b, a.y + b);
  10551. return this.activeShapes.query(g, f), this.staticShapes.query(g,
  10552. f), e
  10553. };
  10554. B.prototype.segmentQuery = function (a, b, c, d, e) {
  10555. var f = function (f) {
  10556. var g;
  10557. return (!f.group || d !== f.group) && c & f.layers && (g = f.segmentQuery(a, b)) && e(f, g.t, g.n), 1
  10558. };
  10559. this.lock();
  10560. this.staticShapes.segmentQuery(a, b, 1, f);
  10561. this.activeShapes.segmentQuery(a, b, 1, f);
  10562. this.unlock(!0)
  10563. };
  10564. B.prototype.segmentQueryFirst = function (a, b, c, d) {
  10565. var e = null,
  10566. f = function (f) {
  10567. var g;
  10568. return (!f.group || d !== f.group) && c & f.layers && !f.sensor && (g = f.segmentQuery(a, b)) && (null === e || g.t < e.t) && (e = g), e ? e.t : 1
  10569. };
  10570. return this.staticShapes.segmentQuery(a,
  10571. b, 1, f), this.activeShapes.segmentQuery(a, b, e ? e.t : 1, f), e
  10572. };
  10573. B.prototype.bbQuery = function (a, b, c, d) {
  10574. var e = function (e) {
  10575. (!e.group || c !== e.group) && b & e.layers && e.bb_r >= a.l && a.r >= e.bb_l && e.bb_t >= a.b && a.t >= e.bb_b && d(e)
  10576. };
  10577. this.lock();
  10578. this.activeShapes.query(a, e);
  10579. this.staticShapes.query(a, e);
  10580. this.unlock(!0)
  10581. };
  10582. B.prototype.shapeQuery = function (a, b) {
  10583. var c = a.body;
  10584. c && a.update(c.p, c.rot);
  10585. var c = new $(a.bb_l, a.bb_b, a.bb_r, a.bb_t),
  10586. d = !1,
  10587. e = function (c) {
  10588. if ((!a.group || a.group !== c.group) && a.layers & c.layers && a !== c) {
  10589. var e;
  10590. if (a.collisionCode <=
  10591. c.collisionCode) e = Ga(a, c);
  10592. else {
  10593. e = Ga(c, a);
  10594. for (var f = 0; e.length > f; f++) e[f].n = C(e[f].n)
  10595. } if (e.length && (d = !(a.sensor || c.sensor), b)) {
  10596. for (var g = Array(e.length), f = 0; e.length > f; f++) g[f] = new Va(e[f].p, e[f].n, e[f].dist);
  10597. b(c, g)
  10598. }
  10599. }
  10600. };
  10601. return this.lock(), this.activeShapes.query(c, e), this.staticShapes.query(c, e), this.unlock(!0), d
  10602. };
  10603. B.prototype.addPostStepCallback = function (a) {
  10604. f(this.locked, "Adding a post-step callback when the space is not locked is unnecessary. Post-step callbacks will not called until the end of the next call to cpSpaceStep() or the next query.");
  10605. this.postStepCallbacks.push(a)
  10606. };
  10607. B.prototype.runPostStepCallbacks = function () {
  10608. for (var a = 0; this.postStepCallbacks.length > a; a++) this.postStepCallbacks[a]();
  10609. this.postStepCallbacks = []
  10610. };
  10611. B.prototype.lock = function () {
  10612. this.locked++
  10613. };
  10614. B.prototype.unlock = function (a) {
  10615. if (this.locked--, g(0 <= this.locked, "Internal Error: Space lock underflow."), 0 === this.locked && a) {
  10616. a = this.rousedBodies;
  10617. for (var b = 0; a.length > b; b++) this.activateBody(a[b]);
  10618. a.length = 0;
  10619. this.runPostStepCallbacks()
  10620. }
  10621. };
  10622. B.prototype.makeCollideShapes = function () {
  10623. var a =
  10624. this;
  10625. return function (b, c) {
  10626. if (b.bb_l <= c.bb_r && c.bb_l <= b.bb_r && b.bb_b <= c.bb_t && c.bb_b <= b.bb_t && b.body !== c.body && (!b.group || b.group !== c.group) && b.layers & c.layers) {
  10627. var d = a.lookupHandler(b.collision_type, c.collision_type),
  10628. e = b.sensor || c.sensor;
  10629. if (!e || d !== bb) {
  10630. if (b.collisionCode > c.collisionCode) {
  10631. var f = b;
  10632. b = c;
  10633. c = f
  10634. }
  10635. f = Ga(b, c);
  10636. if (0 !== f.length) {
  10637. var g = h(b.hashid, c.hashid),
  10638. k = a.cachedArbiters[g];
  10639. k || (k = a.cachedArbiters[g] = new L(b, c));
  10640. k.update(f, d, b, c);
  10641. "first coll" != k.state || d.begin(k, a) || k.ignore();
  10642. "ignore" !== k.state &&
  10643. d.preSolve(k, a) && !e ? a.arbiters.push(k) : (k.contacts = null, "ignore" !== k.state && (k.state = "normal"));
  10644. k.stamp = a.stamp
  10645. }
  10646. }
  10647. }
  10648. }
  10649. };
  10650. B.prototype.arbiterSetFilter = function (a) {
  10651. var b = this.stamp - a.stamp,
  10652. c = a.body_a,
  10653. d = a.body_b;
  10654. return (c.isStatic() || c.isSleeping()) && (d.isStatic() || d.isSleeping()) ? !0 : (1 <= b && "cached" != a.state && (a.callSeparate(this), a.state = "cached"), b >= this.collisionPersistence ? (a.contacts = null, !1) : !0)
  10655. };
  10656. var pb = function (a) {
  10657. var b = a.body;
  10658. a.update(b.p, b.rot)
  10659. };
  10660. B.prototype.step = function (a) {
  10661. if (0 !== a) {
  10662. g(0 === w.x &&
  10663. 0 === w.y, "vzero is invalid");
  10664. this.stamp++;
  10665. var b = this.curr_dt;
  10666. this.curr_dt = a;
  10667. var c, d, e = this.bodies,
  10668. f = this.constraints,
  10669. h = this.arbiters;
  10670. for (c = 0; h.length > c; c++) {
  10671. var k = h[c];
  10672. k.state = "normal";
  10673. k.body_a.isSleeping() || k.body_b.isSleeping() || k.unthread()
  10674. }
  10675. h.length = 0;
  10676. this.lock();
  10677. for (c = 0; e.length > c; c++) e[c].position_func(a);
  10678. this.activeShapes.each(pb);
  10679. this.activeShapes.reindexQuery(this.collideShapes);
  10680. this.unlock(!1);
  10681. this.processComponents(a);
  10682. this.lock();
  10683. for (d in this.cachedArbiters) this.arbiterSetFilter(this.cachedArbiters[d]) ||
  10684. delete this.cachedArbiters[d];
  10685. d = this.collisionSlop;
  10686. k = 1 - Math.pow(this.collisionBias, a);
  10687. for (c = 0; h.length > c; c++) h[c].preStep(a, d, k);
  10688. for (c = 0; f.length > c; c++) d = f[c], d.preSolve(this), d.preStep(a);
  10689. d = Math.pow(this.damping, a);
  10690. k = this.gravity;
  10691. for (c = 0; e.length > c; c++) e[c].velocity_func(k, d, a);
  10692. a = 0 === b ? 0 : a / b;
  10693. for (c = 0; h.length > c; c++) h[c].applyCachedImpulse(a);
  10694. for (c = 0; f.length > c; c++) f[c].applyCachedImpulse(a);
  10695. for (c = 0; this.iterations > c; c++) {
  10696. for (a = 0; h.length > a; a++) h[a].applyImpulse();
  10697. for (a = 0; f.length > a; a++) f[a].applyImpulse()
  10698. }
  10699. for (c =
  10700. 0; f.length > c; c++) f[c].postSolve(this);
  10701. for (c = 0; h.length > c; c++) h[c].handler.postSolve(h[c], this);
  10702. this.unlock(!0)
  10703. }
  10704. };
  10705. var Ia = function (a, b, c, d) {
  10706. return new q(b.vx + -d.y * b.w - (a.vx + -c.y * a.w), b.vy + d.x * b.w - (a.vy + c.x * a.w))
  10707. },
  10708. Ea = function (a, b, c, d, e) {
  10709. return (b.vx + -d.y * b.w - (a.vx + -c.y * a.w)) * e.x + (b.vy + d.x * b.w - (a.vy + c.x * a.w)) * e.y
  10710. },
  10711. za = function (a, b, c, d) {
  10712. a.vx += b * a.m_inv;
  10713. a.vy += c * a.m_inv;
  10714. a.w += a.i_inv * (d.x * c - d.y * b)
  10715. },
  10716. U = function (a, b, c, d, e, f) {
  10717. za(a, -e, -f, c);
  10718. za(b, e, f, d)
  10719. },
  10720. Xa = function (a, b, c, d) {
  10721. a.v_biasx += b * a.m_inv;
  10722. a.v_biasy += c * a.m_inv;
  10723. a.w_bias += a.i_inv * (d.x * c - d.y * b)
  10724. },
  10725. cb = function (a, b, c) {
  10726. b = F(b, c);
  10727. return a.m_inv + a.i_inv * b * b
  10728. },
  10729. ka = function (a, b, c, d, e) {
  10730. a = cb(a, c, e) + cb(b, d, e);
  10731. return f(0 !== a, "Unsolvable collision or constraint."), a
  10732. },
  10733. db = function (a, b, c, d, e, g) {
  10734. var h;
  10735. h = a.m_inv + b.m_inv;
  10736. var k = a.i_inv,
  10737. m = c.x * c.x * k;
  10738. a = -c.x * c.y * k;
  10739. c = h + c.y * c.y * k;
  10740. h += m;
  10741. k = b.i_inv;
  10742. b = d.x * d.x * k;
  10743. m = -d.x * d.y * k;
  10744. c += d.y * d.y * k;
  10745. d = 0 + a + m;
  10746. a = 0 + a + m;
  10747. h += b;
  10748. b = c * h - d * a;
  10749. f(0 !== b, "Unsolvable constraint.");
  10750. b = 1 / b;
  10751. e.x = h * b;
  10752. e.y = -d * b;
  10753. g.x = -a * b;
  10754. g.y = c * b
  10755. },
  10756. H = c.Constraint = function (a, b) {
  10757. this.a = a;
  10758. this.b = b;
  10759. this.next_b =
  10760. this.next_a = this.space = null;
  10761. this.maxForce = 1 / 0;
  10762. this.errorBias = Math.pow(0.9, 60);
  10763. this.maxBias = 1 / 0
  10764. };
  10765. H.prototype.activateBodies = function () {
  10766. this.a && this.a.activate();
  10767. this.b && this.b.activate()
  10768. };
  10769. H.prototype.preStep = function () {};
  10770. H.prototype.applyCachedImpulse = function () {};
  10771. H.prototype.applyImpulse = function () {};
  10772. H.prototype.getImpulse = function () {
  10773. return 0
  10774. };
  10775. H.prototype.preSolve = function () {};
  10776. H.prototype.postSolve = function () {};
  10777. H.prototype.next = function (a) {
  10778. return this.a === a ? this.next_a : this.next_b
  10779. };
  10780. var la = c.PinJoint =
  10781. function (a, b, c, d) {
  10782. H.call(this, a, b);
  10783. this.anchr1 = c;
  10784. this.anchr2 = d;
  10785. a = a ? A(a.p, E(c, a.rot)) : c;
  10786. b = b ? A(b.p, E(d, b.rot)) : d;
  10787. this.dist = x(y(b, a));
  10788. f(0 < this.dist, "You created a 0 length pin joint. A pivot joint will be much more stable.");
  10789. this.n = this.r1 = this.r2 = null;
  10790. this.bias = this.jnAcc = this.jnMax = this.nMass = 0
  10791. };
  10792. la.prototype = Object.create(H.prototype);
  10793. la.prototype.preStep = function (a) {
  10794. var b = this.a,
  10795. c = this.b;
  10796. this.r1 = E(this.anchr1, b.rot);
  10797. this.r2 = E(this.anchr2, c.rot);
  10798. var d = y(A(c.p, this.r2), A(b.p, this.r1)),
  10799. e = x(d);
  10800. this.n =
  10801. z(d, 1 / (e ? e : 1 / 0));
  10802. this.nMass = 1 / ka(b, c, this.r1, this.r2, this.n);
  10803. b = this.maxBias;
  10804. this.bias = s(-(1 - Math.pow(this.errorBias, a)) * (e - this.dist) / a, -b, b);
  10805. this.jnMax = this.maxForce * a
  10806. };
  10807. la.prototype.applyCachedImpulse = function (a) {
  10808. a = z(this.n, this.jnAcc * a);
  10809. U(this.a, this.b, this.r1, this.r2, a.x, a.y)
  10810. };
  10811. la.prototype.applyImpulse = function () {
  10812. var a = this.a,
  10813. b = this.b,
  10814. c = this.n,
  10815. d = Ea(a, b, this.r1, this.r2, c),
  10816. d = (this.bias - d) * this.nMass,
  10817. e = this.jnAcc;
  10818. this.jnAcc = s(e + d, -this.jnMax, this.jnMax);
  10819. d = this.jnAcc - e;
  10820. U(a, b, this.r1, this.r2, c.x * d,
  10821. c.y * d)
  10822. };
  10823. la.prototype.getImpulse = function () {
  10824. return Math.abs(this.jnAcc)
  10825. };
  10826. var ma = c.SlideJoint = function (a, b, c, d, e, f) {
  10827. H.call(this, a, b);
  10828. this.anchr1 = c;
  10829. this.anchr2 = d;
  10830. this.min = e;
  10831. this.max = f;
  10832. this.r1 = this.r2 = this.n = null;
  10833. this.bias = this.jnAcc = this.jnMax = this.nMass = 0
  10834. };
  10835. ma.prototype = Object.create(H.prototype);
  10836. ma.prototype.preStep = function (a) {
  10837. var b = this.a,
  10838. c = this.b;
  10839. this.r1 = E(this.anchr1, b.rot);
  10840. this.r2 = E(this.anchr2, c.rot);
  10841. var d = y(A(c.p, this.r2), A(b.p, this.r1)),
  10842. e = x(d),
  10843. f = 0;
  10844. e > this.max ? (f = e - this.max, this.n = G(d)) : this.min >
  10845. e ? (f = this.min - e, this.n = C(G(d))) : (this.n = w, this.jnAcc = 0);
  10846. this.nMass = 1 / ka(b, c, this.r1, this.r2, this.n);
  10847. b = this.maxBias;
  10848. this.bias = s(-(1 - Math.pow(this.errorBias, a)) * f / a, -b, b);
  10849. this.jnMax = this.maxForce * a
  10850. };
  10851. ma.prototype.applyCachedImpulse = function (a) {
  10852. a *= this.jnAcc;
  10853. U(this.a, this.b, this.r1, this.r2, this.n.x * a, this.n.y * a)
  10854. };
  10855. ma.prototype.applyImpulse = function () {
  10856. if (0 !== this.n.x || 0 !== this.n.y) {
  10857. var a = this.a,
  10858. b = this.b,
  10859. c = this.n,
  10860. d = Ia(a, b, this.r1, this.r2),
  10861. d = u(d, c),
  10862. d = (this.bias - d) * this.nMass,
  10863. e = this.jnAcc;
  10864. this.jnAcc = s(e + d, -this.jnMax, 0);
  10865. d = this.jnAcc - e;
  10866. U(a, b, this.r1, this.r2, c.x * d, c.y * d)
  10867. }
  10868. };
  10869. ma.prototype.getImpulse = function () {
  10870. return Math.abs(this.jnAcc)
  10871. };
  10872. var na = c.PivotJoint = function (a, b, c, d) {
  10873. if (H.call(this, a, b), void 0 === d) d = c, c = a ? a.world2Local(d) : d, d = b ? b.world2Local(d) : d;
  10874. this.anchr1 = c;
  10875. this.anchr2 = d;
  10876. this.r1 = this.r2 = w;
  10877. this.k1 = new q(0, 0);
  10878. this.k2 = new q(0, 0);
  10879. this.jAcc = w;
  10880. this.jMaxLen = 0;
  10881. this.bias = w
  10882. };
  10883. na.prototype = Object.create(H.prototype);
  10884. na.prototype.preStep = function (a) {
  10885. var b = this.a,
  10886. c = this.b;
  10887. this.r1 = E(this.anchr1, b.rot);
  10888. this.r2 =
  10889. E(this.anchr2, c.rot);
  10890. db(b, c, this.r1, this.r2, this.k1, this.k2);
  10891. this.jMaxLen = this.maxForce * a;
  10892. b = y(A(c.p, this.r2), A(b.p, this.r1));
  10893. this.bias = M(z(b, -(1 - Math.pow(this.errorBias, a)) / a), this.maxBias)
  10894. };
  10895. na.prototype.applyCachedImpulse = function (a) {
  10896. U(this.a, this.b, this.r1, this.r2, this.jAcc.x * a, this.jAcc.y * a)
  10897. };
  10898. na.prototype.applyImpulse = function () {
  10899. var a = this.a,
  10900. b = this.b,
  10901. c = Ia(a, b, this.r1, this.r2),
  10902. c = y(this.bias, c),
  10903. d = this.k2,
  10904. c = new q(u(c, this.k1), u(c, d)),
  10905. d = this.jAcc;
  10906. this.jAcc = M(A(this.jAcc, c), this.jMaxLen);
  10907. U(a, b, this.r1,
  10908. this.r2, this.jAcc.x - d.x, this.jAcc.y - d.y)
  10909. };
  10910. na.prototype.getImpulse = function () {
  10911. return x(this.jAcc)
  10912. };
  10913. var da = c.GrooveJoint = function (a, b, c, d, e) {
  10914. H.call(this, a, b);
  10915. this.grv_a = c;
  10916. this.grv_b = d;
  10917. this.grv_n = J(Q(y(d, c)));
  10918. this.anchr2 = e;
  10919. this.grv_tn = null;
  10920. this.clamp = 0;
  10921. this.r1 = this.r2 = null;
  10922. this.k1 = new q(0, 0);
  10923. this.k2 = new q(0, 0);
  10924. this.jAcc = w;
  10925. this.jMaxLen = 0;
  10926. this.bias = null
  10927. };
  10928. da.prototype = Object.create(H.prototype);
  10929. da.prototype.preStep = function (a) {
  10930. var b = this.a,
  10931. c = this.b,
  10932. d = b.local2World(this.grv_a),
  10933. e = b.local2World(this.grv_b),
  10934. f = E(this.grv_n, b.rot),
  10935. g = u(d, f);
  10936. this.grv_tn = f;
  10937. this.r2 = E(this.anchr2, c.rot);
  10938. var h = F(A(c.p, this.r2), f);
  10939. F(d, f) >= h ? (this.clamp = 1, this.r1 = y(d, b.p)) : h >= F(e, f) ? (this.clamp = -1, this.r1 = y(e, b.p)) : (this.clamp = 0, this.r1 = y(A(z(J(f), -h), z(f, g)), b.p));
  10940. db(b, c, this.r1, this.r2, this.k1, this.k2);
  10941. this.jMaxLen = this.maxForce * a;
  10942. b = y(A(c.p, this.r2), A(b.p, this.r1));
  10943. this.bias = M(z(b, -(1 - Math.pow(this.errorBias, a)) / a), this.maxBias)
  10944. };
  10945. da.prototype.applyCachedImpulse = function (a) {
  10946. U(this.a, this.b, this.r1, this.r2, this.jAcc.x * a, this.jAcc.y *
  10947. a)
  10948. };
  10949. da.prototype.grooveConstrain = function (a) {
  10950. var b = this.grv_tn;
  10951. a = 0 < this.clamp * F(a, b) ? a : P(a, b);
  10952. return M(a, this.jMaxLen)
  10953. };
  10954. da.prototype.applyImpulse = function () {
  10955. var a = this.a,
  10956. b = this.b,
  10957. c = Ia(a, b, this.r1, this.r2),
  10958. c = y(this.bias, c),
  10959. d = this.k2,
  10960. c = new q(u(c, this.k1), u(c, d)),
  10961. d = this.jAcc;
  10962. this.jAcc = this.grooveConstrain(A(d, c));
  10963. U(a, b, this.r1, this.r2, this.jAcc.x - d.x, this.jAcc.y - d.y)
  10964. };
  10965. da.prototype.getImpulse = function () {
  10966. return x(this.jAcc)
  10967. };
  10968. da.prototype.setGrooveA = function (a) {
  10969. this.grv_a = a;
  10970. this.grv_n = J(Q(y(this.grv_b,
  10971. a)));
  10972. this.activateBodies()
  10973. };
  10974. da.prototype.setGrooveB = function (a) {
  10975. this.grv_b = a;
  10976. this.grv_n = J(Q(y(a, this.grv_a)));
  10977. this.activateBodies()
  10978. };
  10979. var qb = function (a, b) {
  10980. return (a.restLength - b) * a.stiffness
  10981. },
  10982. oa = c.DampedSpring = function (a, b, c, d, e, f, g) {
  10983. H.call(this, a, b);
  10984. this.anchr1 = c;
  10985. this.anchr2 = d;
  10986. this.restLength = e;
  10987. this.stiffness = f;
  10988. this.damping = g;
  10989. this.springForceFunc = qb;
  10990. this.target_vrn = this.v_coef = 0;
  10991. this.r1 = this.r2 = null;
  10992. this.nMass = 0;
  10993. this.n = null
  10994. };
  10995. oa.prototype = Object.create(H.prototype);
  10996. oa.prototype.preStep = function (a) {
  10997. var b =
  10998. this.a,
  10999. c = this.b;
  11000. this.r1 = E(this.anchr1, b.rot);
  11001. this.r2 = E(this.anchr2, c.rot);
  11002. var d = y(A(c.p, this.r2), A(b.p, this.r1)),
  11003. e = x(d);
  11004. this.n = z(d, 1 / (e ? e : 1 / 0));
  11005. d = ka(b, c, this.r1, this.r2, this.n);
  11006. f(0 !== d, "Unsolvable this.");
  11007. this.nMass = 1 / d;
  11008. this.target_vrn = 0;
  11009. this.v_coef = 1 - Math.exp(-this.damping * a * d);
  11010. e = this.springForceFunc(this, e);
  11011. U(b, c, this.r1, this.r2, this.n.x * e * a, this.n.y * e * a)
  11012. };
  11013. oa.prototype.applyCachedImpulse = function () {};
  11014. oa.prototype.applyImpulse = function () {
  11015. var a = this.a,
  11016. b = this.b,
  11017. c = Ea(a, b, this.r1, this.r2, this.n),
  11018. d = (this.target_vrn -
  11019. c) * this.v_coef;
  11020. this.target_vrn = c + d;
  11021. d *= this.nMass;
  11022. U(a, b, this.r1, this.r2, this.n.x * d, this.n.y * d)
  11023. };
  11024. oa.prototype.getImpulse = function () {
  11025. return 0
  11026. };
  11027. var rb = function (a, b) {
  11028. return (b - a.restAngle) * a.stiffness
  11029. },
  11030. Ja = c.DampedRotarySpring = function (a, b, c, d, e) {
  11031. H.call(this, a, b);
  11032. this.restAngle = c;
  11033. this.stiffness = d;
  11034. this.damping = e;
  11035. this.springTorqueFunc = rb;
  11036. this.iSum = this.w_coef = this.target_wrn = 0
  11037. };
  11038. Ja.prototype = Object.create(H.prototype);
  11039. Ja.prototype.preStep = function (a) {
  11040. var b = this.a,
  11041. c = this.b,
  11042. d = b.i_inv + c.i_inv;
  11043. f(0 !== d, "Unsolvable spring.");
  11044. this.iSum = 1 / d;
  11045. this.w_coef = 1 - Math.exp(-this.damping * a * d);
  11046. this.target_wrn = 0;
  11047. a *= this.springTorqueFunc(this, b.a - c.a);
  11048. b.w -= a * b.i_inv;
  11049. c.w += a * c.i_inv
  11050. };
  11051. Ja.prototype.applyImpulse = function () {
  11052. var a = this.a,
  11053. b = this.b,
  11054. c = a.w - b.w,
  11055. d = (this.target_wrn - c) * this.w_coef;
  11056. this.target_wrn = c + d;
  11057. c = d * this.iSum;
  11058. a.w += c * a.i_inv;
  11059. b.w -= c * b.i_inv
  11060. };
  11061. var pa = c.RotaryLimitJoint = function (a, b, c, d) {
  11062. H.call(this, a, b);
  11063. this.min = c;
  11064. this.max = d;
  11065. this.iSum = this.bias = this.jMax = this.jAcc = 0
  11066. };
  11067. pa.prototype = Object.create(H.prototype);
  11068. pa.prototype.preStep = function (a) {
  11069. var b =
  11070. this.a,
  11071. c = this.b,
  11072. d = c.a - b.a,
  11073. e = 0;
  11074. d > this.max ? e = this.max - d : this.min > d && (e = this.min - d);
  11075. this.iSum = 1 / (1 / b.i + 1 / c.i);
  11076. b = this.maxBias;
  11077. this.bias = s(-(1 - Math.pow(this.errorBias, a)) * e / a, -b, b);
  11078. this.jMax = this.maxForce * a;
  11079. this.bias || (this.jAcc = 0)
  11080. };
  11081. pa.prototype.applyCachedImpulse = function (a) {
  11082. var b = this.a,
  11083. c = this.b;
  11084. a *= this.jAcc;
  11085. b.w -= a * b.i_inv;
  11086. c.w += a * c.i_inv
  11087. };
  11088. pa.prototype.applyImpulse = function () {
  11089. if (this.bias) {
  11090. var a = this.a,
  11091. b = this.b,
  11092. c = -(this.bias + (b.w - a.w)) * this.iSum,
  11093. d = this.jAcc;
  11094. this.jAcc = 0 > this.bias ? s(d + c, 0, this.jMax) : s(d +
  11095. c, -this.jMax, 0);
  11096. c = this.jAcc - d;
  11097. a.w -= c * a.i_inv;
  11098. b.w += c * b.i_inv
  11099. }
  11100. };
  11101. pa.prototype.getImpulse = function () {
  11102. return Math.abs(joint.jAcc)
  11103. };
  11104. var qa = c.RatchetJoint = function (a, b, c, d) {
  11105. H.call(this, a, b);
  11106. this.angle = 0;
  11107. this.phase = c;
  11108. this.ratchet = d;
  11109. this.angle = (b ? b.a : 0) - (a ? a.a : 0);
  11110. this.iSum = this.bias = this.jAcc = this.jMax = 0
  11111. };
  11112. qa.prototype = Object.create(H.prototype);
  11113. qa.prototype.preStep = function (a) {
  11114. var b = this.a,
  11115. c = this.b,
  11116. d = this.phase,
  11117. e = this.ratchet,
  11118. f = c.a - b.a,
  11119. g = this.angle - f,
  11120. h = 0;
  11121. 0 < g * e ? h = g : this.angle = Math.floor((f - d) / e) * e + d;
  11122. this.iSum =
  11123. 1 / (b.i_inv + c.i_inv);
  11124. b = this.maxBias;
  11125. this.bias = s(-(1 - Math.pow(this.errorBias, a)) * h / a, -b, b);
  11126. this.jMax = this.maxForce * a;
  11127. this.bias || (this.jAcc = 0)
  11128. };
  11129. qa.prototype.applyCachedImpulse = function (a) {
  11130. var b = this.a,
  11131. c = this.b;
  11132. a *= this.jAcc;
  11133. b.w -= a * b.i_inv;
  11134. c.w += a * c.i_inv
  11135. };
  11136. qa.prototype.applyImpulse = function () {
  11137. if (this.bias) {
  11138. var a = this.a,
  11139. b = this.b,
  11140. c = this.ratchet,
  11141. d = -(this.bias + (b.w - a.w)) * this.iSum,
  11142. e = this.jAcc;
  11143. this.jAcc = s((e + d) * c, 0, this.jMax * Math.abs(c)) / c;
  11144. d = this.jAcc - e;
  11145. a.w -= d * a.i_inv;
  11146. b.w += d * b.i_inv
  11147. }
  11148. };
  11149. qa.prototype.getImpulse =
  11150. function (a) {
  11151. return Math.abs(a.jAcc)
  11152. };
  11153. var ga = c.GearJoint = function (a, b, c, d) {
  11154. H.call(this, a, b);
  11155. this.phase = c;
  11156. this.ratio = d;
  11157. this.ratio_inv = 1 / d;
  11158. this.iSum = this.bias = this.jMax = this.jAcc = 0
  11159. };
  11160. ga.prototype = Object.create(H.prototype);
  11161. ga.prototype.preStep = function (a) {
  11162. var b = this.a,
  11163. c = this.b;
  11164. this.iSum = 1 / (b.i_inv * this.ratio_inv + this.ratio * c.i_inv);
  11165. var d = this.maxBias;
  11166. this.bias = s(-(1 - Math.pow(this.errorBias, a)) * (c.a * this.ratio - b.a - this.phase) / a, -d, d);
  11167. this.jMax = this.maxForce * a
  11168. };
  11169. ga.prototype.applyCachedImpulse = function (a) {
  11170. var b =
  11171. this.a,
  11172. c = this.b;
  11173. a *= this.jAcc;
  11174. b.w -= a * b.i_inv * this.ratio_inv;
  11175. c.w += a * c.i_inv
  11176. };
  11177. ga.prototype.applyImpulse = function () {
  11178. var a = this.a,
  11179. b = this.b,
  11180. c = (this.bias - (b.w * this.ratio - a.w)) * this.iSum,
  11181. d = this.jAcc;
  11182. this.jAcc = s(d + c, -this.jMax, this.jMax);
  11183. c = this.jAcc - d;
  11184. a.w -= c * a.i_inv * this.ratio_inv;
  11185. b.w += c * b.i_inv
  11186. };
  11187. ga.prototype.getImpulse = function () {
  11188. return Math.abs(this.jAcc)
  11189. };
  11190. ga.prototype.setRatio = function (a) {
  11191. this.ratio = a;
  11192. this.ratio_inv = 1 / a;
  11193. this.activateBodies()
  11194. };
  11195. var ra = c.SimpleMotor = function (a, b, c) {
  11196. H.call(this, a, b);
  11197. this.rate =
  11198. c;
  11199. this.iSum = this.jMax = this.jAcc = 0
  11200. };
  11201. ra.prototype = Object.create(H.prototype);
  11202. ra.prototype.preStep = function (a) {
  11203. this.iSum = 1 / (this.a.i_inv + this.b.i_inv);
  11204. this.jMax = this.maxForce * a
  11205. };
  11206. ra.prototype.applyCachedImpulse = function (a) {
  11207. var b = this.a,
  11208. c = this.b;
  11209. a *= this.jAcc;
  11210. b.w -= a * b.i_inv;
  11211. c.w += a * c.i_inv
  11212. };
  11213. ra.prototype.applyImpulse = function () {
  11214. var a = this.a,
  11215. b = this.b,
  11216. c = -(b.w - a.w + this.rate) * this.iSum,
  11217. d = this.jAcc;
  11218. this.jAcc = s(d + c, -this.jMax, this.jMax);
  11219. c = this.jAcc - d;
  11220. a.w -= c * a.i_inv;
  11221. b.w += c * b.i_inv
  11222. };
  11223. ra.prototype.getImpulse = function () {
  11224. return Math.abs(this.jAcc)
  11225. }
  11226. })();
  11227. var world, PHYS_SCALE = 1,
  11228. RAD_TO_DEGREES = 180 / Math.PI,
  11229. DEGREES_TO_RAD = Math.PI / 180,
  11230. objA, objB, debugCanvas, debugDraw, space, v = cp.v,
  11231. GRABABLE_MASK_BIT = -2147483648,
  11232. NOT_GRABABLE_MASK = ~GRABABLE_MASK_BIT;
  11233. function initPhysics(c) {
  11234. isLevelEditor && isEditorDebug && (isPhysicsDebugDraw = !0);
  11235. isPhysicsDebugDraw && !c && (debugCanvas = document.createElement("canvas"), debugCanvas.id = "debugCanvas", debugCanvas.width = 320, debugCanvas.height = 356, debugCanvas.style.position = "absolute", debugCanvas.style.left = "50%", debugCanvas.style.top = "10%", debugCanvas.style.zIndex = "1", debugCanvas.style.pointerEvents = "none", document.body.appendChild(debugCanvas), ChipMunkDebugDrawer.prototype.canvas = debugCanvas, ChipMunkDebugDrawer.prototype.ctx =
  11236. debugCanvas.getContext("2d"), onWindowResize(null));
  11237. debugDraw = new ChipMunkDebugDrawer;
  11238. space = debugDraw.space;
  11239. space.iterations = 10;
  11240. space.gravity = v(0, 500);
  11241. space.sleepTimeThreshold = 1;
  11242. space.collisionSlop = 1;
  11243. space.addCollisionHandler(1, 0, null, onSensorContactPreSolve, null, null);
  11244. space.addCollisionHandler(2, 0, onGlassContactBegin, null, null, null);
  11245. space.addCollisionHandler(2, 2, onGlassContactBegin, null, null, null);
  11246. trace("reinit")
  11247. }
  11248. function onGlassContactBegin(c, a) {
  11249. objA = c.body_a.userdata;
  11250. objB = c.body_b.userdata;
  11251. collidedGlass = collidedAim = null;
  11252. if (objA && objB && (objA.isGlass ? (collidedGlass = objA, collidedAim = objB) : objB.isGlass && (collidedGlass = objB, collidedAim = objA), collidedGlass)) {
  11253. (collidedBody = collidedAim.physBody) && collidedAim.physBody.isStatic() && (collidedBody = collidedGlass.physBody);
  11254. if (!collidedBody) return !0;
  11255. var b = collidedBody.vx,
  11256. g = collidedBody.vy;
  11257. Math.sqrt(b * b + g * g) > GLASS_BREAK_VELOCITY && (addToArray(clickedChars, collidedGlass),
  11258. collidedAim.isGlass && addToArray(clickedChars, collidedAim))
  11259. }
  11260. return !0
  11261. }
  11262. function onSensorContactPreSolve(c, a, b) {
  11263. objA = c.body_a.userdata;
  11264. objB = c.body_b.userdata;
  11265. collidedSensor = collidedAim = null;
  11266. objA && objB && (c.a.sensor ? (collidedSensor = objA, collidedAim = objB) : c.b.sensor && (collidedSensor = objB, collidedAim = objA), collidedSensor && collidedSensor.isActivated && collidedAim.physBody && (dx = collidedAim.vis.x - collidedSensor.vis.x, dy = collidedAim.vis.y - collidedSensor.vis.y, dist = Math.sqrt(dx * dx + dy * dy), force = Math.max(0, 1 - dist / collidedSensor.activDistance), force = force * collidedSensor.activForce *
  11267. collidedAim.physBody.m, angle = collidedSensor.vis.rotation * DEGREES_TO_RAD, collidedSensor.isReversed && (angle += Math.PI), collidedAim.physBody.applyImpulse(v(force * Math.cos(angle), force * Math.sin(angle)), cp.vzero)));
  11268. return !0
  11269. }
  11270. var worldManifold, isCollideParticlesNeed = !0,
  11271. collidedChar, collidedAim, collidedSensor, collidedBody, collidedGlass, force, angle, fixDef, bodyDef;
  11272. function createCircleShape(c, a, b, g, f, d) {
  11273. var e = !1,
  11274. h = 0.5,
  11275. k = 0.3;
  11276. g === HERO_TYPE || g === HERO_DOC_TYPE ? k = 0.8 : g === FAN_TYPE && (e = !0, h = 0.8, k = 0);
  11277. e ? (e = new cp.Body(Infinity, Infinity), e.nodeIdleTime = Infinity) : e = space.addBody(new cp.Body(1, cp.momentForCircle(1, 0, b, v(0, 0))));
  11278. e.setPos(v(c, a));
  11279. e.setAngle(f);
  11280. c = space.addShape(new cp.CircleShape(e, b, v(0, 0)));
  11281. c.setElasticity(k);
  11282. c.setFriction(h);
  11283. g === FAN_TYPE && (g = d.isReversed ? space.addShape(new cp.BoxShape2(e, new cp.BB(-d.activDistance, -15, 0, 15))) : space.addShape(new cp.BoxShape2(e,
  11284. new cp.BB(0, -15, d.activDistance, 15))), g.setSensor(!0), g.setCollisionType(1));
  11285. return e
  11286. }
  11287. var DEFAULT_RECT_SIZE = 90 / PHYS_SCALE,
  11288. DEFAULT_BOX_SIZE = 52 / PHYS_SCALE;
  11289. function createRectPhysics(c, a, b, g, f, d) {
  11290. var e = DEFAULT_RECT_SIZE,
  11291. h = DEFAULT_RECT_SIZE,
  11292. k = !1,
  11293. m = 0.6,
  11294. n = 0,
  11295. p = 0.0010;
  11296. f === PHYSICS_RECT_TYPE ? k = !0 : f === DYNAMIC_BOX_TYPE ? (h = e = DEFAULT_BOX_SIZE, m = 0.8) : f === HARD_BOX_TYPE ? (e = 30 / PHYS_SCALE, h = 30 / PHYS_SCALE, m = 0.8) : f === STATIC_BOX_TYPE ? (e = 30 / PHYS_SCALE, h = 30 / PHYS_SCALE, m = 0.8, k = !0) : f === DANGER_TYPE ? (e = 100 / PHYS_SCALE, h = 18 / PHYS_SCALE) : f === PHYSICS_MAN_BLOCK_TYPE ? (e = 194 / PHYS_SCALE, h = 23 / PHYS_SCALE) : f === GLASS_BLOCK_TYPE ? (e = 103 / PHYS_SCALE, h = 20 / PHYS_SCALE, n = 2) : f === GLASS_BOX_TYPE ? (e =
  11297. 30 / PHYS_SCALE, h = 30 / PHYS_SCALE, n = 2) : f === DOOR_TYPE ? (e = 122 / PHYS_SCALE, h = 18 / PHYS_SCALE) : f === DYNAMIC_RECT_TYPE ? (e = 109 / PHYS_SCALE, h = 20 / PHYS_SCALE, m = 0.8) : f === HARD_RECT_TYPE ? (e = 109 / PHYS_SCALE, h = 20 / PHYS_SCALE, m = 0.8, p = 1 / 1500) : f === STATIC_BALK_1_TYPE && (e = 109 / PHYS_SCALE, h = 20 / PHYS_SCALE, m = 0.8, k = !0);
  11298. b *= e;
  11299. g *= h;
  11300. k ? (k = new cp.Body(Infinity, Infinity), k.nodeIdleTime = Infinity) : (k = b * g * p, k = space.addBody(new cp.Body(k, cp.momentForBox(k, b, g))));
  11301. k.setPos(v(c, a));
  11302. k.setAngle(d);
  11303. c = space.addShape(new cp.BoxShape(k, b, g));
  11304. c.setCollisionType(n);
  11305. c.setFriction(m);
  11306. c.setElasticity(0);
  11307. return k
  11308. }
  11309. function createKinematicPhysics(c, a, b, g, f, d, e) {
  11310. b = 0.8;
  11311. var h = 0,
  11312. k = 0,
  11313. m;
  11314. m = new cp.Body(Infinity, Infinity);
  11315. m.setPos(v(c, a));
  11316. m.setAngle(d);
  11317. f === TELEGA_TYPE ? (h = 105 / PHYS_SCALE * g, k = 20 / PHYS_SCALE * g, e = 0, c = space.addShape(new cp.BoxShape2(m, new cp.BB(-h / 2, e * g, h / 2, k + e))), c.setFriction(b), c.setElasticity(0), e = 20, c = space.addShape(new cp.BoxShape2(m, new cp.BB(-h / 2, -20 * g, -h / 2 + e, k))), c.setFriction(1), c.setElasticity(0), c = space.addShape(new cp.BoxShape2(m, new cp.BB(h / 2 - e, -20 * g, h / 2, k))), c.setFriction(0), c.setElasticity(0)) :
  11318. f === AIM_TYPE ? (h = 50 / PHYS_SCALE * g, k = 40 / PHYS_SCALE * g, b = 0.2, c = (a = e.isReversed) ? space.addShape(new cp.SegmentShape(m, v(h / 2, k / 2), v(h / 2 - 3 * g, -16 * g), 3)) : space.addShape(new cp.SegmentShape(m, v(-h / 2, k / 2), v(-h / 2 + 3 * g, -16 * g), 3)), c.setFriction(b), c.setElasticity(0), c = a ? space.addShape(new cp.SegmentShape(m, v(h / 2 - 8 * g, -19 * g), v(-10 * g, -40 * g), 3)) : space.addShape(new cp.SegmentShape(m, v(-h / 2 + 8 * g, -19 * g), v(10 * g, -40 * g), 3)), c.setFriction(b), c.setElasticity(0), c = a ? space.addShape(new cp.SegmentShape(m, v(-10 * g, -40 * g), v(-35 * g, -40 * g), 3)) : space.addShape(new cp.SegmentShape(m, v(10 * g, -40 * g), v(35 * g, -40 * g), 3)), c.setFriction(b), c.setElasticity(0.7), e.isMovable && (c = a ? space.addShape(new cp.SegmentShape(m, v(-97 * g, 37 * g), v(25 * g, 37 * g), 4)) : space.addShape(new cp.SegmentShape(m, v(-25 * g, 37 * g), v(97 * g, 37 * g), 4)), c.setFriction(b), c.setElasticity(0))) : f === MOVABLE_BALK_TYPE && (h = 105 / PHYS_SCALE * g, k = 20 / PHYS_SCALE * g, c = space.addShape(new cp.BoxShape2(m, new cp.BB(-h / 2, -k / 2, h / 2, k / 2))), c.setFriction(b), c.setElasticity(0));
  11319. return m
  11320. }
  11321. function createSegmentPhysics(c, a, b, g, f, d, e) {
  11322. e = new cp.Body(Infinity, Infinity);
  11323. e.nodeIdleTime = Infinity;
  11324. e.setPos(v(c, a));
  11325. e.setAngle(d);
  11326. f === LAND_TYPE && (c = space.addShape(new cp.SegmentShape(e, v(-60 * b, -22 * g), v(60 * b, -22 * g), 5)), c.setFriction(0.8), c.setElasticity(0));
  11327. return e
  11328. }
  11329. function createTrianglePhysics(c, a, b, g, f, d) {
  11330. var e = 0;
  11331. b *= 51;
  11332. var h = 45 * g;
  11333. g = [-b / 2, -h / 2, 0, h / 2, b / 2, -h / 2];
  11334. b = 0.0010 * b * h;
  11335. b = space.addBody(new cp.Body(b, cp.momentForPoly(b, g, cp.vzero)));
  11336. g = space.addShape(new cp.PolyShape(b, g, cp.vzero));
  11337. g.setFriction(0.6);
  11338. g.setElasticity(0);
  11339. f === GLASS_TRIANGLE_TYPE && (e = 2);
  11340. g.setCollisionType(e);
  11341. b.setPos(v(c, a));
  11342. b.setAngle(d);
  11343. return b
  11344. }
  11345. var querySelectedBody, queryV = new v(0, 0);
  11346. function getBodyAtMouse(c, a) {
  11347. querySelectedBody = null;
  11348. queryV.x = c;
  11349. queryV.y = a;
  11350. var b = this.space.nearestPointQueryNearest(queryV, 100, cp.ALL_LAYERS, cp.NO_GROUP);
  11351. b && 0 > b.d && b.shape && b.shape.body && (querySelectedBody = b.shape.body);
  11352. return querySelectedBody
  11353. }
  11354. function destroyBody(c) {
  11355. var a;
  11356. if (c.isStatic())
  11357. for (; 0 < c.shapeList.length;) a = c.shapeList[0], space.removeStaticShape(a);
  11358. else {
  11359. for (; 0 < c.shapeList.length;) a = c.shapeList[0], a.space && space.removeShape(a);
  11360. c.space && space.removeBody(c)
  11361. }
  11362. }
  11363. function awakeAllBodies() {
  11364. for (var c, a = allChars.length - 1; 0 <= a; --a) c = allChars[a], c.physBody && c.physBody.activate()
  11365. }
  11366. var ChipMunkDebugDrawer = function () {
  11367. this.space = new cp.Space;
  11368. this.fps = this.remainder = 0;
  11369. this.mouse = v(0, 0);
  11370. this.drawTime = this.simulationTime = 0;
  11371. this.scale = 1;
  11372. this.width = minW;
  11373. this.height = minH;
  11374. var c = this;
  11375. this.canvas2point = function (a, b) {
  11376. return v(a / c.scale, 480 - b / c.scale)
  11377. };
  11378. this.point2canvas = function (a) {
  11379. return v(a.x * c.scale, a.y * c.scale)
  11380. }
  11381. };
  11382. ChipMunkDebugDrawer.prototype.drawInfo = function () {
  11383. var c = this.space,
  11384. a = this.width - 20;
  11385. this.ctx.textAlign = "start";
  11386. this.ctx.textBaseline = "alphabetic";
  11387. this.ctx.fillStyle = "black";
  11388. var b = Math.floor(10 * this.fps) / 10;
  11389. 0 === c.activeShapes.count && (b = "--");
  11390. this.ctx.fillText("FPS: " + b, 10, 50, a);
  11391. this.ctx.fillText("Step: " + c.stamp, 10, 80, a);
  11392. b = c.arbiters.length;
  11393. this.maxArbiters = this.maxArbiters ? Math.max(this.maxArbiters, b) : b;
  11394. this.ctx.fillText("Arbiters: " + b + " (Max: " + this.maxArbiters + ")", 10, 110, a);
  11395. for (var g = 0, f = 0; f < b; f++) g +=
  11396. c.arbiters[f].contacts.length;
  11397. this.maxContacts = this.maxContacts ? Math.max(this.maxContacts, g) : g;
  11398. this.ctx.fillText("Contact points: " + g + " (Max: " + this.maxContacts + ")", 10, 140, a);
  11399. this.ctx.fillText("Simulation time: " + this.simulationTime + " ms", 10, 170, a);
  11400. this.ctx.fillText("Draw time: " + this.drawTime + " ms", 10, 200, a);
  11401. this.message && this.ctx.fillText(this.message, 10, this.height - 50, a)
  11402. };
  11403. ChipMunkDebugDrawer.prototype.draw = function () {
  11404. var c = this.ctx,
  11405. a = this;
  11406. a.scale = scaleFactor;
  11407. c.strokeStyle = "black";
  11408. c.clearRect(0, 0, debugCanvas.width, debugCanvas.height);
  11409. this.ctx.font = "16px sans-serif";
  11410. this.ctx.lineCap = "round";
  11411. this.space.eachShape(function (b) {
  11412. c.fillStyle = b.style();
  11413. b.draw(c, a.scale, a.point2canvas)
  11414. });
  11415. this.space.eachConstraint(function (b) {
  11416. b.draw && b.draw(c, a.scale, a.point2canvas)
  11417. })
  11418. };
  11419. var drawSegment = function (c, a, b) {
  11420. var g = this.ctx;
  11421. g.beginPath();
  11422. c = this.point2canvas(c);
  11423. a = this.point2canvas(a);
  11424. g.moveTo(c.x, c.y);
  11425. g.lineTo(a.x, a.y);
  11426. g.lineWidth = 1;
  11427. g.strokeStyle = b;
  11428. g.stroke()
  11429. },
  11430. drawBB = function (c, a, b) {
  11431. var g = this.ctx,
  11432. f = this.point2canvas(v(c.l, c.t)),
  11433. d = this.scale * (c.r - c.l);
  11434. c = this.scale * (c.t - c.b);
  11435. a && (g.fillStyle = a, g.fillRect(f.x, f.y, d, c));
  11436. b && (g.strokeStyle = b, g.strokeRect(f.x, f.y, d, c))
  11437. },
  11438. drawCircle = function (c, a, b, g, f) {
  11439. g = b(g);
  11440. c.beginPath();
  11441. c.arc(g.x, g.y, a * f, 0, 2 * Math.PI, !1);
  11442. c.fill();
  11443. c.stroke()
  11444. },
  11445. drawLine =
  11446. function (c, a, b, g) {
  11447. b = a(b);
  11448. g = a(g);
  11449. c.beginPath();
  11450. c.moveTo(b.x, b.y);
  11451. c.lineTo(g.x, g.y);
  11452. c.stroke()
  11453. },
  11454. drawRect = function (c, a, b, g) {
  11455. var f = a(b);
  11456. a = cp.v.sub(a(cp.v.add(b, g)), f);
  11457. c.fillRect(f.x, f.y, a.x, a.y)
  11458. },
  11459. springPoints = [v(0, 0), v(0.2, 0), v(0.25, 3), v(0.3, -6), v(0.35, 6), v(0.4, -6), v(0.45, 6), v(0.5, -6), v(0.55, 6), v(0.6, -6), v(0.65, 6), v(0.7, -3), v(0.75, 6), v(0.8, 0), v(1, 0)],
  11460. drawSpring = function (c, a, b, g, f) {
  11461. g = b(g);
  11462. f = b(f);
  11463. c.beginPath();
  11464. c.moveTo(g.x, g.y);
  11465. f = v.sub(f, g);
  11466. b = v.len(f);
  11467. f = v.mult(f, 1 / b);
  11468. for (var d = 1; d < springPoints.length; d++) {
  11469. var e =
  11470. v.add(g, v.rotate(v(springPoints[d].x * b, springPoints[d].y * a), f));
  11471. c.lineTo(e.x, e.y)
  11472. }
  11473. c.stroke()
  11474. };
  11475. cp.PolyShape.prototype.draw = function (c, a, b) {
  11476. c.beginPath();
  11477. a = this.tVerts;
  11478. var g = a.length,
  11479. f = b(new cp.Vect(a[g - 2], a[g - 1]));
  11480. c.moveTo(f.x, f.y);
  11481. for (f = 0; f < g; f += 2) {
  11482. var d = b(new cp.Vect(a[f], a[f + 1]));
  11483. c.lineTo(d.x, d.y)
  11484. }
  11485. c.fill();
  11486. c.stroke()
  11487. };
  11488. cp.SegmentShape.prototype.draw = function (c, a, b) {
  11489. var g = c.lineWidth;
  11490. c.lineWidth = Math.max(1, 2 * this.r * a);
  11491. drawLine(c, b, this.ta, this.tb);
  11492. c.lineWidth = g
  11493. };
  11494. cp.CircleShape.prototype.draw = function (c, a, b) {
  11495. drawCircle(c, a, b, this.tc, this.r);
  11496. drawLine(c, b, this.tc, cp.v.mult(this.body.rot, this.r)
  11497. .add(this.tc))
  11498. };
  11499. cp.PinJoint.prototype.draw = function (c, a, b) {
  11500. a = this.a.local2World(this.anchr1);
  11501. var g = this.b.local2World(this.anchr2);
  11502. c.lineWidth = 2;
  11503. c.strokeStyle = "grey";
  11504. drawLine(c, b, a, g)
  11505. };
  11506. cp.SlideJoint.prototype.draw = function (c, a, b) {
  11507. a = this.a.local2World(this.anchr1);
  11508. var g = this.b.local2World(this.anchr2),
  11509. f = v.add(a, v.clamp(v.sub(g, a), this.min));
  11510. c.lineWidth = 2;
  11511. c.strokeStyle = "grey";
  11512. drawLine(c, b, a, g);
  11513. c.strokeStyle = "red";
  11514. drawLine(c, b, a, f)
  11515. };
  11516. cp.PivotJoint.prototype.draw = function (c, a, b) {
  11517. var g = this.a.local2World(this.anchr1),
  11518. f = this.b.local2World(this.anchr2);
  11519. c.strokeStyle = "grey";
  11520. c.fillStyle = "grey";
  11521. drawCircle(c, a, b, g, 2);
  11522. drawCircle(c, a, b, f, 2)
  11523. };
  11524. cp.GrooveJoint.prototype.draw = function (c, a, b) {
  11525. var g = this.a.local2World(this.grv_a),
  11526. f = this.a.local2World(this.grv_b),
  11527. d = this.b.local2World(this.anchr2);
  11528. c.strokeStyle = "grey";
  11529. drawLine(c, b, g, f);
  11530. drawCircle(c, a, b, d, 3)
  11531. };
  11532. cp.DampedSpring.prototype.draw = function (c, a, b) {
  11533. var g = this.a.local2World(this.anchr1),
  11534. f = this.b.local2World(this.anchr2);
  11535. c.strokeStyle = "grey";
  11536. drawSpring(c, a, b, g, f)
  11537. };
  11538. for (var randColor = function () {
  11539. return Math.floor(256 * Math.random())
  11540. }, debugAlpha = 0.7, styles = [], i = 0; 100 > i; i++) styles.push("rgba(" + randColor() + ", " + randColor() + ", " + randColor() + "," + debugAlpha + ")");
  11541. cp.Shape.prototype.style = function () {
  11542. var c;
  11543. if (this.sensor) return "rgba(255,255,255,0)";
  11544. c = this.body;
  11545. return c.isSleeping() ? "rgba(50,50,50," + debugAlpha + ")" : c.nodeIdleTime > this.space.sleepTimeThreshold ? "rgba(170,170,170," + debugAlpha + ")" : styles[this.hashid % styles.length]
  11546. };
  11547. var MINIMUM_SPEED = 3,
  11548. MAX_SPEED = 6,
  11549. IS_NITRO = !1,
  11550. DEFAULT_STATE = 0,
  11551. COLLIDED_STATE = 1,
  11552. ACTIVATOR_RADIUS = 25,
  11553. MORE_EASY_MULT = 1,
  11554. dx, dy, dist, isNeedActivate = !1;
  11555. (function (c) {
  11556. function a(a, b, c, e, h) {
  11557. var k = new createjs.Sprite(zoeSS);
  11558. k.baseBlock = this;
  11559. this.vis = k;
  11560. k = new createjs.Sprite(zoeSS);
  11561. k.baseBlock = this;
  11562. this.additVision = k;
  11563. this.reset(a, b, c, e, h)
  11564. }
  11565. var b = a.prototype;
  11566. b.reset = function (a, b, d, e, h) {
  11567. this.typeId = a;
  11568. this.type = c[a];
  11569. createjs.Tween.removeTweens(this.vis);
  11570. removeFromParent(this.additVision);
  11571. this.parent = b;
  11572. this.vis.isOnTop = !1;
  11573. this.vis.isOnBottom = !0;
  11574. this.isMovable = this.isFly = !1;
  11575. this.teleportPartner = null;
  11576. this.isReversed = !1;
  11577. this.dir = 1;
  11578. this.activForce = FAN_MAX_FORCE;
  11579. this.activDistance = FAN_ACTIV_DISTANCE;
  11580. this.distanceStartX = this.distanceEndX = 0;
  11581. this.isRemovable = this.isClicked = !1;
  11582. this.doorDistanceEnd = 0;
  11583. this.isMechanic = this.isActivated = this.isGlass = !1;
  11584. this.labelId = "";
  11585. this.isMonster = !1;
  11586. this.isRectMonster = !0;
  11587. this.isNeedDispose = !1;
  11588. this.teleportationStatus = -1;
  11589. this.vis.alpha = 1;
  11590. this.vis.mouseEnabled = !1;
  11591. this.physBody = null;
  11592. this.scale = d;
  11593. this.scaleY = e;
  11594. this.isEnemy = !1;
  11595. this.additParams = h;
  11596. this.aimTeleport = this.startTeleport = null;
  11597. this.isFirstCollided = this.isTeleport = this.isDanger =
  11598. this.isAim = !1;
  11599. this.shape = null;
  11600. this.defaultRotation = 0;
  11601. this.animMargin = 30 * Math.random();
  11602. this.isNeutralEnemy = !1;
  11603. this.startMarginX = this.startMoveX = this.visionWidth = this.currSpeed = 0;
  11604. this.state = DEFAULT_STATE;
  11605. this.collideTimer = this.charRadius = 0;
  11606. this.isExploded = !1;
  11607. this.lastColliderType = -1;
  11608. this.raduis = this.vis.rotation = 0;
  11609. this.isDied = !1;
  11610. this.forceToFly = this.vel = null;
  11611. this.isByPhysPosUpdate = !0;
  11612. this.vis.cursor = null;
  11613. this.isLand = this.isHero = !1;
  11614. this.lastAngularVelocity = this.lastVelocity = 0;
  11615. this.isHelp = -1 < a.indexOf("HELP");
  11616. this.isDynamicDecor = (this.isDecor = -1 < a.indexOf("DECOR")) ? this.isDynDecor() : !0;
  11617. this.isPhysStatic = -1 < a.indexOf("PHYSICS");
  11618. this.vis.visible = !this.isPhysStatic;
  11619. this.type === LAND_TYPE && (this.isLand = !0);
  11620. this.setVisionByType();
  11621. this.updateVisionScale();
  11622. !this.isDynamicDecor && isWithCache && (this.parent = allBgContainer);
  11623. this.parent.addChild(this.vis)
  11624. };
  11625. b.isDynDecor = function () {
  11626. return this.isHelp || this.type === DECOR_ARROW_TYPE
  11627. };
  11628. b.setupMouseEventListeners = function () {
  11629. this.vis.cursor = "pointer"
  11630. };
  11631. b.setVisionByType = function () {
  11632. this.vis.gotoAndStop(this.typeId);
  11633. var a = !1;
  11634. if (this.type === DYNAMIC_BOX_TYPE || this.type === DYNAMIC_RECT_TYPE || this.type === DYNAMIC_TRIANGLE_TYPE) a = this.isRemovable = !0;
  11635. if (this.type === HARD_BOX_TYPE || this.type === HARD_RECT_TYPE || this.type === LAND_TYPE || this.type === STATIC_BALK_1_TYPE) a = !0;
  11636. this.type === STATIC_BOX_TYPE && "INVIS" == this.getAdditParams(0) && (this.vis.visible = !1);
  11637. this.type === HERO_TYPE ? (this.isHero = !0, this.vis.play(), this.isByPhysPosUpdate = !0, addToArray(allHeroes, this)) : this.type === BOMB_TYPE ? (this.vis.cursor = "pointer", this.vis.mouseEnabled = !0, this.activDistance = parseInt(this.getAdditParams(0)), this.activForce = parseInt(this.getAdditParams(1)), addToArray(allBombs, this)) : this.type === GLASS_BLOCK_TYPE || this.type === GLASS_BOX_TYPE || this.type === GLASS_TRIANGLE_TYPE ? this.isGlass = !0 : this.type === TELEGA_TYPE ? (this.readMovableConfig(1), this.isMovable = !0, this.visionWidth = 106, "1" !== this.getAdditParams(0) && (this.isRemovable = a = !0)) : this.type === MOVABLE_BALK_TYPE ? (this.readMovableConfig(0), this.isMovable = !0, this.visionWidth = 106, this.vis.gotoAndStop("STATIC_BALK_1_TYPE")) :
  11638. this.type === STATIC_BALK_1_TYPE ? 0 < this.getAdditParams(0)
  11639. .length && (this.isRemovable = !0) : this.type === FAN_TYPE && (this.vis.cursor = "pointer", this.vis.mouseEnabled = !0, addToArray(allFans, this), this.isByPhysPosUpdate = !1);
  11640. this.isRemovable && (this.vis.cursor = "pointer", this.vis.mouseEnabled = !0, currentRemovablesNum++);
  11641. this.type === AIM_TYPE && (this.isAim = !0, this.visionWidth = 65, this.additVision.gotoAndStop("AIM_BACK"), this.parent.addChildAt(this.additVision, 0), "REV" == this.getAdditParams(0) && (this.isReversed = !0), this.getAdditParams(1) &&
  11642. (this.readMovableConfig(2), this.isMovable = !0, this.vis.gotoAndStop("AIM_TYPE_MOVABLE")));
  11643. this.type === DANGER_TYPE && (this.isDanger = !0, this.isDynamicDecor = !1);
  11644. if (this.type === TELEPORT_TYPE) {
  11645. this.vis.play();
  11646. this.isByPhysPosUpdate = !1;
  11647. this.isTeleport = !0;
  11648. this.labelId = this.getAdditParams(0);
  11649. addToArray(allTeleports, this);
  11650. for (var b = allTeleports.length - 1; 0 <= b; --b) {
  11651. var c = allTeleports[b];
  11652. c.labelId === this.labelId && (c.teleportPartner = this, this.teleportPartner = c)
  11653. }
  11654. }
  11655. this.type === FAN_TYPE && ("REV" == this.getAdditParams(0) &&
  11656. (this.isReversed = !0, this.dir = -1), this.getAdditParams(1) && (this.activDistance = parseInt(this.getAdditParams(1))), this.getAdditParams(2) && (this.activForce = parseInt(this.getAdditParams(2))));
  11657. a && 0 < this.getAdditParams(0)
  11658. .length && this.vis.gotoAndStop(this.typeId + "_" + this.getAdditParams(0));
  11659. this.vis.paused || (this.vis.currentAnimationFrame = Math.floor(20 * Math.random()))
  11660. };
  11661. b.readMovableConfig = function (a) {
  11662. this.dir = "R" === this.getAdditParams(0) ? 1 : -1;
  11663. var b = parseInt(this.getAdditParams(1 + a));
  11664. this.startMarginX = 1E3 <=
  11665. b ? 1E3 - b : b;
  11666. this.currSpeed = parseInt(this.getAdditParams(2 + a)) / 10
  11667. };
  11668. b.getAdditParams = function (a) {
  11669. return this.additParams[0].split("_")
  11670. .length > a ? this.additParams[0].split("_")[a] : null
  11671. };
  11672. b.setupActivLabel = function () {
  11673. this.labelId = this.getAdditParams(0)
  11674. };
  11675. b.bombClick = function (a) {
  11676. isLevelCompleted || isLevelFailed || isGamePaused || this.isExploded || (createExplosion(this), this.vis.removeAllEventListeners(), this.vis.mouseEnabled = !1, this.vis.scaleX = this.vis.scaleY = this.scale = 2, this.vis.gotoAndPlay("bombexplosionv"),
  11677. addToParent(this.vis, this.parent), this.isByPhysPosUpdate = !1, this.disposePhysBody(), this.isExploded = !0, playSound("explodeSound"))
  11678. };
  11679. b.calculateBoundingBox = function () {
  11680. var a = 1;
  11681. this.isEnemy && (a = 0.7);
  11682. var b = this.vis._animation;
  11683. b && b.frames && 0 < b.frames.length && (this.bounds = charSS.getFrameBounds(b.frames[0]), this.bounds.width = this.bounds.width * this.scale * a, this.bounds.height = this.bounds.height * this.scale * a, this.bounds.x = this.bounds.x * this.scale * a, this.bounds.y = this.bounds.y * this.scale * a, this.charRadius = this.bounds.width /
  11684. 2)
  11685. };
  11686. b.setPosition = function (a, b, c) {
  11687. var e = a;
  11688. this.isMovable && (this.distanceEndX = 140 * this.scale - this.scaleY * this.visionWidth, this.distanceStartX = a - this.distanceEndX / 2, this.distanceEndX = a + this.distanceEndX / 2, e = Math.min(this.distanceEndX, Math.max(this.distanceStartX, a + this.startMarginX)));
  11689. this.vis.x = this.additVision.x = e;
  11690. this.vis.y = this.additVision.y = b;
  11691. this.defaultRotation = this.vis.rotation = this.additVision.rotation = c
  11692. };
  11693. b.initPhysics = function () {
  11694. if (!this.isDecor && this.type !== ACTIVATOR_TYPE && this.type !== TELEPORT_TYPE) {
  11695. var a;
  11696. a = this.vis.x / PHYS_SCALE;
  11697. var b = this.vis.y / PHYS_SCALE,
  11698. c = this.vis.rotation * DEGREES_TO_RAD;
  11699. if (a = this.isPhysStatic || this.type === DYNAMIC_BOX_TYPE || this.type === DANGER_TYPE || this.type === MONSTER_TYPE && this.isRectMonster || this.type === GLASS_BLOCK_TYPE || this.type === GLASS_BOX_TYPE || this.type === DOOR_TYPE || this.type === DYNAMIC_RECT_TYPE || this.type === HARD_RECT_TYPE || this.type === HARD_BOX_TYPE || this.type === STATIC_BALK_1_TYPE || this.type === STATIC_BOX_TYPE ? createRectPhysics(a, b, this.scale, this.scaleY, this.type, c) : this.type ===
  11700. DYNAMIC_TRIANGLE_TYPE || this.type === GLASS_TRIANGLE_TYPE || this.type === HARD_TRIANGLE_TYPE ? createTrianglePhysics(a, b, this.scale, this.scaleY, this.type, c) : this.type === TELEGA_TYPE || this.type === AIM_TYPE || this.type === MOVABLE_BALK_TYPE ? createKinematicPhysics(a, b, this.scale, this.scaleY, this.type, c, this) : this.type === LAND_TYPE ? createSegmentPhysics(a, b, this.scale, this.scaleY, this.type, c, this) : createCircleShape(a, b, this.scale * this.getRadiusByType() / PHYS_SCALE, this.type, c, this)) a.userdata = this, this.physBody = a
  11701. }
  11702. };
  11703. b.getRadiusByType = function () {
  11704. switch (this.type) {
  11705. case HERO_TYPE:
  11706. return 32;
  11707. case AIM_TYPE:
  11708. return 19;
  11709. case HERO_DOC_TYPE:
  11710. return 31;
  11711. case HERO_WOMAN_TYPE:
  11712. return 31;
  11713. case TELEPORT_TYPE:
  11714. return 25;
  11715. case BOMB_TYPE:
  11716. return 20;
  11717. case MONSTER_TYPE:
  11718. return 31;
  11719. case DYNAMIC_CIRCLE_TYPE:
  11720. return 16;
  11721. case FAN_TYPE:
  11722. return 25
  11723. }
  11724. return 0
  11725. };
  11726. b.setFrame = function (a, b) {
  11727. b ? this.vis.gotoAndPlay(a) : this.vis.gotoAndStop(a)
  11728. };
  11729. b.setVisionState = function (a) {};
  11730. b.onInflateEnd = function () {
  11731. this.isFly = !1
  11732. };
  11733. b.tick = function () {
  11734. if (this.isNeedDispose) addToArray(toDisposeChars,
  11735. this);
  11736. else if (!isGamePaused && (!this.isDecor || this.isDynamicDecor))
  11737. if (this.physBody && !this.isPhysStatic && this.isByPhysPosUpdate && (this.isMovable && (this.vis.x > this.distanceEndX ? this.dir = -1 : this.vis.x < this.distanceStartX && (this.dir = 1), this.physBody.setVel(v(15 * this.currSpeed * this.dir * dtScale, 0)), this.physBody.p.x += this.currSpeed * this.dir * dtScale), this.vis.x = this.additVision.x = this.physBody.p.x, this.vis.y = this.additVision.y = this.physBody.p.y, this.vis.rotation = this.additVision.rotation = Math.atan2(this.physBody.rot.y,
  11738. this.physBody.rot.x) * RAD_TO_DEGREES), this.type === BOMB_TYPE ? (this.vis.scaleX = this.scale + Math.cos((counter + this.animMargin) / 5) / 60, this.vis.scaleY = this.scale - Math.cos((counter + this.animMargin) / 5) / 60, this.isExploded && 13 <= this.vis.currentAnimationFrame && (this.isNeedDispose = !0)) : this.isHelp && (this.vis.scaleX = this.vis.scaleY = this.scale + Math.cos((counter + this.animMargin) / 12) / 20), this.isHero && (this.updateTeleportation(), (-50 > this.vis.x || 410 < this.vis.x || this.vis.y > viewportH + 40 || -140 > this.vis.y) && this.dieByWorldOut()),
  11739. this.type === AIM_TYPE)
  11740. for (var a = 0; a < allHeroesLen; a++) {
  11741. var b = allHeroes[a];
  11742. if (25 > Math.abs(b.vis.x - this.vis.x) && 10 > Math.abs(b.vis.y - this.vis.y)) {
  11743. if (isLevelCompleted && !isLevelFailed) break;
  11744. trace("level complete!");
  11745. this.aimCollected();
  11746. updateShare(currentLevel + 1);
  11747. showLevelCompleteWin();
  11748. // updateShare(currentLevel + 1);Play68.setRankingScoreDesc(currentLevel + 1,Play68.rankingShowType.RANKING_SHOW_NO);
  11749. }
  11750. } else if (this.type === TELEPORT_TYPE)
  11751. for (a = 0; a < allHeroesLen; a++) b = allHeroes[a], 40 > Math.abs(b.vis.x - this.vis.x) && 40 > Math.abs(b.vis.y - this.vis.y) ? b.teleportTo(this) : 0 > b.teleportationStatus && b.teleportContactEnd(this)
  11752. };
  11753. b.updateTeleportation = function () {
  11754. if (this.physBody)
  11755. if (0 ===
  11756. this.teleportationStatus) {
  11757. this.isByPhysPosUpdate = !1;
  11758. this.teleportationStatus = 1;
  11759. this.physBody.p.x = -1E3;
  11760. this.physBody.p.y = 0;
  11761. var a = this;
  11762. playSound("portalAppearSound");
  11763. createjs.Tween.get(this.vis, {
  11764. override: !0
  11765. })
  11766. .to({
  11767. rotation: 900,
  11768. scaleX: 0.05,
  11769. scaleY: 0.05,
  11770. x: this.startTeleport.vis.x,
  11771. y: this.startTeleport.vis.y
  11772. }, 700)
  11773. .to({
  11774. x: this.aimTeleport.vis.x,
  11775. y: this.aimTeleport.vis.y
  11776. }, 0)
  11777. .call(function () {})
  11778. .to({
  11779. rotation: 0,
  11780. scaleX: this.scale,
  11781. scaleY: this.scale
  11782. }, 700)
  11783. .call(function () {
  11784. a.teleportationStatus = 2
  11785. })
  11786. } else 2 == this.teleportationStatus &&
  11787. (this.physBody.p.x = this.aimTeleport.vis.x / PHYS_SCALE, this.physBody.p.y = this.aimTeleport.vis.y / PHYS_SCALE, this.physBody.w = 0, this.physBody.setAngle(0), this.physBody.setVel(v(0, 0)), this.teleportationStatus = -1, this.isByPhysPosUpdate = !0)
  11788. };
  11789. b.updateVisionScale = function () {
  11790. this.vis.scaleX = this.scale;
  11791. this.vis.scaleY = this.scaleY;
  11792. this.isMovable && (this.vis.scaleX = this.vis.scaleY = this.scaleY);
  11793. this.isReversed && (this.vis.scaleX *= -1);
  11794. this.additVision.scaleX = this.vis.scaleX;
  11795. this.additVision.scaleY = this.vis.scaleY
  11796. };
  11797. b.dispose = function () {
  11798. removeFromArray(allChars, this);
  11799. this.isHero && removeFromArray(allHeroes, this);
  11800. this.lastColliderType = -1;
  11801. addToDisposed(this);
  11802. this.vis.removeAllEventListeners();
  11803. this.disposePhysBody();
  11804. this.shape = null;
  11805. this.vis.stop();
  11806. removeFromParent(this.vis);
  11807. removeFromParent(this.additVision)
  11808. };
  11809. b.collideWithOtherDynamic = function () {
  11810. -1 < this.teleportationStatus || (this.isByPhysPosUpdate = !0)
  11811. };
  11812. b.toggleFly = function () {};
  11813. b.heroRejoicing = function () {
  11814. this.vis.gotoAndPlay(this.typeId)
  11815. };
  11816. b.aimCollected = function () {
  11817. createPrerenderedPart(this.vis.x,
  11818. this.vis.y, 1.4, "parteffectv3", 0.71, this.vis, 0.8);
  11819. addAchiev(GREAT_START_ACHIEV)
  11820. };
  11821. b.teleportTo = function (a) {
  11822. this.aimTeleport || (this.startTeleport = a, this.aimTeleport = a.teleportPartner, this.teleportationStatus = 0)
  11823. };
  11824. b.teleportContactEnd = function (a) {
  11825. this.aimTeleport === a && (this.aimTeleport = this.startTeleport = null)
  11826. };
  11827. b.die = function () {
  11828. isLevelCompleted || isLevelFailed || (this.isDied = isLevelFailed = !0, this.isByPhysPosUpdate = this.isFly = !1, hideGameInterface(), createjs.Tween.get(this.vis, {
  11829. override: !0
  11830. })
  11831. .to({
  11832. alpha: 0,
  11833. scaleX: 0,
  11834. scaleY: 0,
  11835. rotation: 900
  11836. }, 1200)
  11837. .wait(400)
  11838. .call(showRestartWin), createDiePart(this.vis.x, this.vis.y), this.physBody && (this.physBody.p.x = -1E3), playSound("restartSound"))
  11839. };
  11840. b.dieByWorldOut = function () {
  11841. isLevelCompleted || isLevelFailed || (1 >= allHeroes.length ? (this.isDied = isLevelFailed = !0, this.isByPhysPosUpdate = this.isFly = !1, hideGameInterface(), createjs.Tween.get(this.vis)
  11842. .wait(400)
  11843. .call(showRestartWin), this.physBody && (this.physBody.p.x = -1E3), playSound("restartSound")) : this.isNeedDispose = !0)
  11844. };
  11845. b.collideWithDyn =
  11846. function (a) {
  11847. this.isFirstCollided || (this.isByPhysPosUpdate = this.isFirstCollided = !0)
  11848. };
  11849. b.breakGlass = function () {
  11850. !this.vis.visible || 15 > levelStartTimer || !this.physBody || (this.disposePhysBody(), this.vis.visible = !1, this.type === GLASS_BLOCK_TYPE ? createGlassRectExplode(this.vis.x, this.vis.y, this.scale, this.vis.rotation) : createPartExplode(this.vis.x, this.vis.y, 3, PART_GLASS_TYPE, null, 3), playSound("glassBrakeSound"))
  11851. };
  11852. b.activateBtn = function () {
  11853. if (!this.isActivated) {
  11854. this.isActivated = !0;
  11855. this.vis.currentAnimationFrame =
  11856. 1;
  11857. for (var a, b = 0; b < allChars.length; b++) a = allChars[b], a.isMechanic && !a.isActivated && a.labelId === this.labelId && a.activateMechanic();
  11858. playSound("clickSound")
  11859. }
  11860. };
  11861. b.deActivateBtn = function () {
  11862. if (this.isActivated) {
  11863. this.isActivated = !1;
  11864. this.vis.currentAnimationFrame = 0;
  11865. for (var a, b = 0; b < allChars.length; b++) a = allChars[b], a.isMechanic && a.isActivated && a.labelId === this.labelId && a.deActivateMechanic();
  11866. playSound("clickSound")
  11867. }
  11868. };
  11869. b.activateMechanic = function () {
  11870. this.isActivated = !0
  11871. };
  11872. b.deActivateMechanic = function () {
  11873. this.isActivated = !1
  11874. };
  11875. b.toggleFan = function () {
  11876. if (this.isActivated = !this.isActivated) this.vis.gotoAndPlay("FAN_TYPE_ON"), awakeAllBodies(), playWindSound();
  11877. else {
  11878. this.vis.gotoAndStop("FAN_TYPE");
  11879. for (var a = 0, b = allFans.length - 1; 0 <= b; --b) allFans[b].isActivated && a++;
  11880. 1 > a && stopWindSound()
  11881. }
  11882. };
  11883. b.removeFromField = function () {
  11884. this.disposePhysBody();
  11885. this.isByPhysPosUpdate = !1;
  11886. currentRemovablesNum--;
  11887. var a = this;
  11888. createjs.Tween.get(this.vis)
  11889. .to({
  11890. alpha: 0,
  11891. scaleX: 0,
  11892. scaleY: 0
  11893. }, 250)
  11894. .call(function () {
  11895. a.isNeedDispose = !0
  11896. });
  11897. playRemoveObjectSound()
  11898. };
  11899. b.disposePhysBody = function () {
  11900. this.physBody && toDisposePhysicsBodies.push(this.physBody);
  11901. this.physBody = null
  11902. };
  11903. c.CharBase = a
  11904. })(window);
  11905. var allChars = [],
  11906. allHeroes = [],
  11907. disposedChars = [],
  11908. allBombs = [],
  11909. allMonsters = [],
  11910. allActivators = [],
  11911. allTeleports = [],
  11912. allFans = [],
  11913. blockContainer, currentLevel = 0,
  11914. isLevelCompleted = !1,
  11915. isLevelFailed = !1,
  11916. isInflateReason = !1,
  11917. currentChar, totalFriends = 0,
  11918. totalBonuses = 0,
  11919. collectedBonuses = 0,
  11920. totalScore = 0,
  11921. currentLevelScore = 0,
  11922. scoreToAdd = 0;
  11923. function initLevelManager() {
  11924. container.addChild(blockContainer);
  11925. initPhysics();
  11926. stage.addEventListener("stagemousedown", onCharContainerMouseDown);
  11927. stage.addEventListener("stagemouseup", onCharContainerMouseUp)
  11928. }
  11929. function createChar(c, a, b, g, f, d, e) {
  11930. c = geCharFromPool(c, blockContainer, g, f, e);
  11931. c.setPosition(a, b, d);
  11932. c.initPhysics();
  11933. isArrayContains(allChars, c) || allChars.push(c);
  11934. return c
  11935. }
  11936. var levelRestartsCounter = 0,
  11937. levelsWithoutRestartsCounter = 0,
  11938. diamondsCounter = 0;
  11939. function loadLevel(c) {
  11940. currentLevel != c && (levelRestartsCounter = 0, MORE_EASY_MULT = 1);
  11941. currentLevel = c;
  11942. currentLevel >= LEVELS_NUM && (currentLevel %= LEVELS_NUM);
  11943. showBgByLevelNum(currentLevel);
  11944. setCurrentLevelLabel(currentLevel);
  11945. loadLevelByCode(allLevels[currentLevel]);
  11946. isLevelRestarted = isGamePaused = !1;
  11947. isNeedCacheSizeUpdate = !0;
  11948. playSound("levelStart")
  11949. }
  11950. var totalEnemies = 0;
  11951. function loadLevelByCode(c) {
  11952. isGamePaused = !0;
  11953. disposeLevel();
  11954. addInstructions();
  11955. if (c) {
  11956. totalEnemies = 0;
  11957. resetSoundOnNewLevel();
  11958. for (var a = 0; a < c.length; a++) {
  11959. var b = c[a];
  11960. isBonus(b[0]) ? createBonus(b[0], b[1], b[2], b[3], b[4], b[5], b[6]) : createChar(b[0], b[1], b[2], b[3], b[4], b[5], b[6])
  11961. }
  11962. }
  11963. }
  11964. function isBonus(c) {
  11965. return -1 < c.indexOf("BONUS")
  11966. }
  11967. var isLevelRestarted = !1;
  11968. function restartLevel() {
  11969. isLevelRestarted = !0;
  11970. levelRestartsCounter += 1;
  11971. levelsWithoutRestartsCounter = 0;
  11972. loadLevel(currentLevel)
  11973. }
  11974. function loadNextLevel() {
  11975. loadLevel(currentLevel + 1)
  11976. }
  11977. var levelStartTimer = 0;
  11978. function disposeLevel() {
  11979. disposeInstructions();
  11980. isLevelFailed = isLevelCompleted = isInflateReason = !1;
  11981. levelStartTimer = 0;
  11982. currentChar = null;
  11983. currentRemovablesNum = collectedBonuses = totalBonuses = currentLevelScore = scoreToAdd = 0;
  11984. var c = allChars.length,
  11985. a;
  11986. for (a = 0; a < c; a++) allChars.pop()
  11987. .dispose();
  11988. toDisposeChars = [];
  11989. clickedChars = [];
  11990. disposeBonuses();
  11991. allBombs = [];
  11992. allMonsters = [];
  11993. allActivators = [];
  11994. allTeleports = [];
  11995. for (allFans = []; 0 < toDisposePhysicsBodies.length;) c = toDisposePhysicsBodies.pop(), destroyBody(c);
  11996. space.step(0.01);
  11997. window.gc &&
  11998. window.gc()
  11999. }
  12000. function disposeLevelPhysics() {
  12001. var c = allChars.length,
  12002. a;
  12003. for (a = 0; a < c; a++) allChars[a].disposePhysBody();
  12004. for (; 0 < toDisposePhysicsBodies.length;) c = toDisposePhysicsBodies.pop(), destroyBody(c)
  12005. }
  12006. function addScore(c) {
  12007. currentLevelScore += c
  12008. }
  12009. function addToDisposed(c) {
  12010. isArrayContains(disposedChars, c) || disposedChars.push(c)
  12011. }
  12012. function geCharFromPool(c, a, b, g, f) {
  12013. if (0 < disposedChars.length) {
  12014. var d = disposedChars.pop();
  12015. d.reset(c, a, b, g, f);
  12016. return d
  12017. }
  12018. return new CharBase(c, a, b, g, f)
  12019. }
  12020. var BIG_DISTANCE = 1E8;
  12021. function onCharContainerMouseDown(c) {
  12022. splashContainer && splashContainer.parent && sponsorClick(c);
  12023. if (!(isGamePaused || isLevelCompleted || isLevelFailed)) {
  12024. var a = (c.stageX - container.x) / scaleFactor;
  12025. c = (c.stageY - container.y) / scaleFactor;
  12026. for (var b, g = 0, f = g = 0, d = 0, d = 0; d < allBombs.length; d++)
  12027. if (b = allBombs[d], !b.isExploded && (g = b.vis.x - a, f = b.vis.y - c, g = g * g + f * f, 484 > g)) {
  12028. addToArray(clickedChars, b);
  12029. return
  12030. }
  12031. for (d = allFans.length - 1; 0 <= d; --d)
  12032. if (b = allFans[d], g = b.vis.x - a, f = b.vis.y - c, g = g * g + f * f, 784 > g) {
  12033. addToArray(clickedChars, b);
  12034. return
  12035. }(a =
  12036. getBodyAtMouse(a / PHYS_SCALE, c / PHYS_SCALE)) && (c = a.userdata) && c.isRemovable && addToArray(clickedChars, a.userdata)
  12037. }
  12038. }
  12039. function onCharContainerMouseUp(c) {}
  12040. var lastopenedlvl = 0,
  12041. levelstates = [],
  12042. LEVELS_NUM = 20,
  12043. ZERO_STAR = 0,
  12044. ONE_STAR = 1,
  12045. TWO_STAR = 2,
  12046. THREE_STAR = 3,
  12047. ACHIEVS_NUM = 6,
  12048. NOT_ACHIEVED = 0,
  12049. ACHIEVED = 1,
  12050. allachievs = [],
  12051. GREAT_START_ACHIEV = 0,
  12052. SUPER_COLLECTOR_ACHIEV = 1,
  12053. DESTROYER_ACHIEV = 2,
  12054. AMAZING_GAME_ACHIEV = 3,
  12055. SOCCER_MASTER_ACHIEV = 4,
  12056. MEGA_STAR_ACHIEV = 5,
  12057. isStorageSupported = !1;
  12058. function loadSaves() {
  12059. lastopenedlvl = 0;
  12060. if (isStorageSupported = isSupportshtml5storage())
  12061. if (localStorage[STORAGE_PREFIX + "lastopenedlvl"]) {
  12062. lastopenedlvl = parseInt(localStorage[STORAGE_PREFIX + "lastopenedlvl"]);
  12063. for (a = 0; a < LEVELS_NUM; a++) levelstates.push(parseInt(localStorage[STORAGE_PREFIX + "levelstate" + a]));
  12064. for (a = 0; a < ACHIEVS_NUM; a++) {
  12065. var c = localStorage[STORAGE_PREFIX + "achiev" + a];
  12066. c ? allachievs.push(parseInt(c)) : allachievs.push(NOT_ACHIEVED)
  12067. }
  12068. isMute = "1" == localStorage[STORAGE_PREFIX + "ismute"];
  12069. totalFriends = localStorage[STORAGE_PREFIX +
  12070. "totalfriends"] ? parseInt(localStorage[STORAGE_PREFIX + "totalFriends"]) : 0;
  12071. totalScore = localStorage[STORAGE_PREFIX + "totalScore"] ? parseInt(localStorage[STORAGE_PREFIX + "totalScore"]) : 0;
  12072. diamondsCounter = localStorage[STORAGE_PREFIX + "diamondsCounter"] ? parseInt(localStorage[STORAGE_PREFIX + "diamondsCounter"]) : 0
  12073. } else {
  12074. trace("saves not found!");
  12075. for (a = 0; a < LEVELS_NUM; a++) levelstates.push(ZERO_STAR);
  12076. for (a = 0; a < ACHIEVS_NUM; a++) allachievs.push(NOT_ACHIEVED);
  12077. updateSaves()
  12078. } else {
  12079. trace("storage not supported");
  12080. for (var a =
  12081. 0; a < LEVELS_NUM; a++) levelstates.push(ZERO_STAR);
  12082. for (a = 0; a < ACHIEVS_NUM; a++) allachievs.push(NOT_ACHIEVED)
  12083. }
  12084. }
  12085. function getStarsForLevel(c) {
  12086. return levelstates[c]
  12087. }
  12088. function saveGame(c) {
  12089. lastopenedlvl <= currentLevel && (lastopenedlvl = currentLevel + 1);
  12090. levelstates[currentLevel] < c && (levelstates[currentLevel] = c);
  12091. updateSaves()
  12092. }
  12093. function updateSaves() {
  12094. if (isStorageSupported) {
  12095. localStorage[STORAGE_PREFIX + "lastopenedlvl"] = lastopenedlvl;
  12096. for (var c = 0; c < LEVELS_NUM; c++) localStorage[STORAGE_PREFIX + "levelstate" + c] = levelstates[c];
  12097. for (c = 0; c < ACHIEVS_NUM; c++) localStorage[STORAGE_PREFIX + "achiev" + c] = allachievs[c];
  12098. saveMuteState();
  12099. localStorage[STORAGE_PREFIX + "totalfriends"] = "" + totalFriends;
  12100. localStorage[STORAGE_PREFIX + "totalScore"] = "" + totalScore;
  12101. localStorage[STORAGE_PREFIX + "diamondsCounter"] = "" + diamondsCounter
  12102. }
  12103. }
  12104. function saveMuteState() {
  12105. isStorageSupported && (localStorage[STORAGE_PREFIX + "ismute"] = isMute ? "1" : "0")
  12106. }
  12107. function isSupportshtml5storage() {
  12108. try {
  12109. var c = "localStorage" in window && null !== window.localStorage;
  12110. c && (localStorage.setItem("storage", ""), localStorage.removeItem("storage"));
  12111. return c
  12112. } catch (a) {
  12113. return !1
  12114. }
  12115. }
  12116. var allInstructions = [];
  12117. function createInstruction(c, a, b, g) {
  12118. c = createPart(PART_INSTRUCTION_TYPE, c, a, 1, g ? blockContainer : allBgContainer);
  12119. c.setFrame(b);
  12120. allInstructions.push(c);
  12121. return c
  12122. }
  12123. function addInstructions() {
  12124. isLevelRestarted || updateBgCache()
  12125. }
  12126. function disposeInstructions() {
  12127. for (; 0 < allInstructions.length;) allInstructions.pop()
  12128. .dispose()
  12129. }
  12130. function getCollectedStarsNum() {
  12131. for (var c = 0, a = 0; a < LEVELS_NUM; a++) c += levelstates[a];
  12132. return c
  12133. }
  12134. function createExplosion(c) {
  12135. for (var a, b = allChars.length - 1; 0 <= b; --b) a = allChars[b], a !== c && a.physBody && (a.physBody.isStatic() || a.isPhysStatic && a.type !== GLASS_BLOCK_TYPE || -1 < a.teleportationStatus || a.isDied || a.isMovable || a.isAim || a.isLand || CreateExplode(c, a))
  12136. }
  12137. function CreateExplode(c, a) {
  12138. var b = a.physBody,
  12139. g = a.vis.x - c.vis.x,
  12140. f = a.vis.y - c.vis.y,
  12141. d = Math.sqrt(g * g + f * f);
  12142. d > c.activDistance || (a.type === GLASS_BLOCK_TYPE ? d < 0.6 * c.activDistance && a.breakGlass() : (g /= d, f /= d, d = Math.max(0, 1 - d / c.activDistance), d = d * c.activForce * b.m, d = v(g * d, f * d), b.applyImpulse(d, v(10 * Math.random() - 5, 0)), a.isByPhysPosUpdate = !0))
  12143. }
  12144. var allBonuses = [],
  12145. disposedBonuses = [],
  12146. currentBon;
  12147. function initBonusManager() {}
  12148. function createBonus(c, a, b, g, f, d, e) {
  12149. c = getBonusFromPool(c, blockContainer, g, f, e);
  12150. c.setPos(a, b, d);
  12151. addToArray(allBonuses, c)
  12152. }
  12153. function disposeBonuses() {
  12154. var c = allBonuses.length,
  12155. a;
  12156. for (a = 0; a < c; a++) allBonuses.pop()
  12157. .dispose()
  12158. }
  12159. function addToDisposedBonuses(c) {
  12160. isArrayContains(disposedBonuses, c) || disposedBonuses.push(c)
  12161. }
  12162. function getBonusFromPool(c, a, b, g, f) {
  12163. if (0 < disposedBonuses.length) {
  12164. var d = disposedBonuses.pop();
  12165. d.reset(c, a, b, g, f);
  12166. return d
  12167. }
  12168. return new BonusBase(c, a, b, g, f)
  12169. }
  12170. var toDisposeBonuses = [];
  12171. function updateBonusManager() {
  12172. for (var c = 0; c < allBonuses.length; c++) allBonuses[c].tick(), allBonuses[c].isCollected && addToArray(toDisposeBonuses, allBonuses[c]);
  12173. for (; 0 < toDisposeBonuses.length;) toDisposeBonuses.pop()
  12174. .dispose()
  12175. }
  12176. (function (c) {
  12177. function a(a, b, c, e, h) {
  12178. var k = new createjs.Sprite(zoeSS);
  12179. k.mouseEnabled = !1;
  12180. k.baseBlock = this;
  12181. this.vis = k;
  12182. this.reset(a, b, c, e, h)
  12183. }
  12184. var b = a.prototype;
  12185. b.reset = function (a, b, d, e, h) {
  12186. this.typeId = a;
  12187. this.type = c[a];
  12188. createjs.Tween.removeTweens(this.vis);
  12189. this.tweenMaxSteps = 0;
  12190. this.isNeedCollect = !1;
  12191. this.additParams = h;
  12192. this.parent = b;
  12193. this.vis.isOnTop = !1;
  12194. this.vis.isOnBottom = !0;
  12195. this.vis.alpha = 1;
  12196. this.isCollected = this.isGhost = !1;
  12197. this.animMargin = 30 * Math.random();
  12198. this.scaleX = d;
  12199. this.scaleY = e;
  12200. this.moveTarget = null;
  12201. this.distanceSq =
  12202. this.speed = this.dy = this.dx = 0;
  12203. this.hero = null;
  12204. this.dir = 1;
  12205. this.distanceStartX = this.distanceEndX = 0;
  12206. this.sensorRadiusSq = 3600;
  12207. this.collectRadiusSq = 100;
  12208. this.setVisionByType();
  12209. this.updateVisionScale();
  12210. b.addChild(this.vis);
  12211. this.isGhost || totalBonuses++
  12212. };
  12213. b.setPos = function (a, b, c) {
  12214. this.vis.x = a;
  12215. this.vis.y = b;
  12216. this.isGhost && 0 === this.distanceStartX && (this.distanceEndX = 140 * this.scaleX - 52 * this.scaleY, this.distanceStartX = a - this.distanceEndX / 2, this.distanceEndX = a + this.distanceEndX / 2);
  12217. c && (this.vis.rotation = c)
  12218. };
  12219. b.updateVisionScale =
  12220. function () {
  12221. this.vis.scaleX = this.scaleX;
  12222. this.vis.scaleY = this.scaleY;
  12223. this.isGhost && (this.vis.scaleX = this.scaleY)
  12224. };
  12225. b.getAdditParams = function (a) {
  12226. return this.additParams[0].split("_")[a]
  12227. };
  12228. b.setVisionByType = function () {
  12229. this.vis.gotoAndStop(this.typeId);
  12230. this.type === BONUS_DIAMOND_TYPE && (this.vis.play(), this.vis._animation.speed = 1.5);
  12231. this.vis.paused || (this.vis.currentAnimationFrame = Math.floor(20 * Math.random()));
  12232. this.type === BONUS_GHOST_TYPE && (this.isGhost = !0, this.vis.play(), this.speed = parseInt(this.getAdditParams(0)) /
  12233. 10, this.vis._animation.speed = 0.7, this.sensorRadiusSq = 625)
  12234. };
  12235. b.tick = function () {
  12236. if (!this.isCollected && !isGamePaused)
  12237. if (this.isGhost) this.updateGhost();
  12238. else if (this.vis.scaleX = this.scaleX + Math.cos((counter + this.animMargin) / 10) / 12, this.vis.scaleY = this.vis.scaleX, this.moveTarget) this.speed += 0.2, this.dx = this.moveTarget.vis.x - this.vis.x, this.dy = this.moveTarget.vis.y - this.vis.y, this.distanceSq = this.dx * this.dx + this.dy * this.dy, this.vis.x += this.dx / 3 * this.speed, this.vis.y += this.dy / 3 * this.speed, this.distanceSq <
  12239. this.collectRadiusSq && (this.isCollected = !0, createPrerenderedPart(this.moveTarget.vis.x, this.moveTarget.vis.y, 1, "parteffectv1", 0.9, this.moveTarget.vis), addScore(this.getScoreByType()), this.checkBonusAchievByType(), this.moveTarget = null, collectedBonuses++, playBonusPickSound());
  12240. else
  12241. for (var a = 0; a < allHeroesLen; a++) this.hero = allHeroes[a], this.dx = this.hero.vis.x - this.vis.x, this.dy = this.hero.vis.y - this.vis.y, this.distanceSq = this.dx * this.dx + this.dy * this.dy, this.distanceSq < this.sensorRadiusSq && (this.moveTarget =
  12242. this.hero)
  12243. };
  12244. b.updateGhost = function () {
  12245. this.vis.x += this.speed * this.dir * dtScale;
  12246. this.vis.x > this.distanceEndX && (this.dir = -1);
  12247. this.vis.x < this.distanceStartX && (this.dir = 1);
  12248. for (var a = 0; a < allHeroesLen; a++) this.hero = allHeroes[a], this.dx = this.hero.vis.x - this.vis.x, this.dy = this.hero.vis.y - this.vis.y, this.distanceSq = this.dx * this.dx + this.dy * this.dy, this.distanceSq < this.sensorRadiusSq && this.hero.die()
  12249. };
  12250. b.checkBonusAchievByType = function () {
  12251. for (var a = 0; a < allBonuses.length; a++);
  12252. };
  12253. b.getScoreByType = function () {
  12254. switch (this.type) {
  12255. case BONUS_STAR_TYPE:
  12256. return 50;
  12257. case BONUS_DIAMOND_TYPE:
  12258. return 150;
  12259. case BONUS_MONEY_TYPE:
  12260. return 100;
  12261. default:
  12262. return 50
  12263. }
  12264. };
  12265. b.dispose = function () {
  12266. removeFromArray(allBonuses, this);
  12267. addToDisposedBonuses(this);
  12268. this.vis.removeAllEventListeners();
  12269. this.vis.stop();
  12270. this.parent.removeChild(this.vis)
  12271. };
  12272. b.startCollectAnim = function (a) {};
  12273. c.BonusBase = a
  12274. })(window);
  12275. var isAudioSupported = !1,
  12276. isMute = !1;
  12277. function initSoundManager() {
  12278. isDesktop() || createjs.Sound.registerPlugins([createjs.WebAudioPlugin]);
  12279. (isAudioSupported = isSamsungDefaultBrowser() ? !1 : createjs.Sound.initializeDefaultPlugins()) && manifest.push({
  12280. src: "click.ogg|click.mp3",
  12281. id: "clickSound",
  12282. data: 1
  12283. }, {
  12284. src: "win.ogg|win.mp3",
  12285. id: "winSound",
  12286. data: 1
  12287. }, {
  12288. src: "sm_main_music.ogg|sm_main_music.mp3",
  12289. id: "bgMusic",
  12290. data: 1
  12291. }, {
  12292. src: "fail.ogg|fail.mp3",
  12293. id: "restartSound",
  12294. data: 1
  12295. }, {
  12296. src: "explosion.ogg|explosion.mp3",
  12297. id: "explodeSound",
  12298. data: 1
  12299. }, {
  12300. src: "elk_achievement_voice2.ogg|elk_achievement_voice2.mp3",
  12301. id: "achievSound0",
  12302. data: 1
  12303. }, {
  12304. src: "elk_achievement_voice1.ogg|elk_achievement_voice1.mp3",
  12305. id: "achievSound1",
  12306. data: 1
  12307. }, {
  12308. src: "star1.ogg|star1.mp3",
  12309. id: "star1",
  12310. data: 1
  12311. }, {
  12312. src: "star2.ogg|star2.mp3",
  12313. id: "star2",
  12314. data: 1
  12315. }, {
  12316. src: "star3.ogg|star3.mp3",
  12317. id: "star3",
  12318. data: 1
  12319. }, {
  12320. src: "whistles_got1.ogg|whistles_got1.mp3",
  12321. id: "bonus0",
  12322. data: 1
  12323. }, {
  12324. src: "whistles_got2.ogg|whistles_got2.mp3",
  12325. id: "bonus1",
  12326. data: 1
  12327. }, {
  12328. src: "whistles_got3.ogg|whistles_got3.mp3",
  12329. id: "bonus2",
  12330. data: 1
  12331. }, {
  12332. src: "start_game.ogg|start_game.mp3",
  12333. id: "levelStart",
  12334. data: 1
  12335. }, {
  12336. src: "remove_object1.ogg|remove_object1.mp3",
  12337. id: "remove_object0",
  12338. data: 1
  12339. }, {
  12340. src: "remove_object2.ogg|remove_object2.mp3",
  12341. id: "remove_object1",
  12342. data: 1
  12343. }, {
  12344. src: "remove_object3.ogg|remove_object3.mp3",
  12345. id: "remove_object2",
  12346. data: 1
  12347. }, {
  12348. src: "teleport.ogg|teleport.mp3",
  12349. id: "portalAppearSound",
  12350. data: 2
  12351. }, {
  12352. src: "glass.ogg|glass.mp3",
  12353. id: "glassBrakeSound",
  12354. data: 1
  12355. }, {
  12356. src: "wind_release.ogg|wind_release.mp3",
  12357. id: "windRelease",
  12358. data: 1
  12359. })
  12360. }
  12361. function isSamsungDefaultBrowser() {
  12362. var c = navigator.userAgent;
  12363. return -1 < c.toLowerCase()
  12364. .indexOf("samsung") && -1 < c.indexOf("Android ")
  12365. }
  12366. function playSound(c, a) {
  12367. if (!isMute && isAudioSupported) return createjs.Sound.play(c, {
  12368. interrupt: createjs.Sound.INTERRUPT_EARLY,
  12369. loop: a ? -1 : 0
  12370. })
  12371. }
  12372. function toggleMute() {
  12373. (isMute = !isMute) ? (stopBgMusic(), stopWindSound()) : playBgMusic();
  12374. saveMuteState()
  12375. }
  12376. var scoresSound;
  12377. function playScoresSound() {
  12378. !isMute && isAudioSupported && (scoresSound ? scoresSound.play() : scoresSound = playSound("countScoreSound", !1))
  12379. }
  12380. function stopScoresSound() {
  12381. isAudioSupported && scoresSound && (scoresSound.stop(), scoresSound = null)
  12382. }
  12383. var windSound;
  12384. function playWindSound() {
  12385. !isMute && isAudioSupported && (windSound = playSound("windRelease", !1))
  12386. }
  12387. function stopWindSound() {
  12388. isAudioSupported && windSound && (windSound.stop(), windSound = null)
  12389. }
  12390. function playRemoveObjectSound() {
  12391. playSound("remove_object" + Math.floor(3 * Math.random()))
  12392. }
  12393. function resetSoundOnNewLevel() {
  12394. isAudioSupported && (bonusSoundNum = 0)
  12395. }
  12396. var bonusSoundNum = 0;
  12397. function playBonusPickSound() {
  12398. playSound("bonus" + bonusSoundNum);
  12399. bonusSoundNum++;
  12400. 2 < bonusSoundNum && (bonusSoundNum = 0)
  12401. }
  12402. var achievSoundNum = 0;
  12403. function playAchievSound() {
  12404. playSound("achievSound" + achievSoundNum);
  12405. achievSoundNum++;
  12406. 1 < achievSoundNum && (achievSoundNum = 0)
  12407. }
  12408. function startBgMusic() {
  12409. bgMusic || playBgMusic()
  12410. }
  12411. var bgMusic;
  12412. function playBgMusic() {
  12413. !isMute && isAudioSupported && (bgMusic ? bgMusic.resume() : bgMusic = playSound("bgMusic", !0))
  12414. }
  12415. function stopBgMusic() {
  12416. isAudioSupported && bgMusic && bgMusic.pause()
  12417. }
  12418. var pauseBtnV, playMenuBtn, creditsBtn, logoImg, levelSelectContainer, interfaceRestartBtn, isGamePaused, levelLabel, menuEase;
  12419. function initInterface() {
  12420. pauseBtnV = createButton(18, 18, 0.8, "pausebtn", onPausePress, null, onPauseUp);
  12421. interfaceRestartBtn = createButton(18, 18, 0.6, "restartbtn", onPressStandartHandler, null, onInterfaceRestartUp);
  12422. levelLabel = new createjs.BitmapText("0", zoeSS);
  12423. levelLabel.scaleX = levelLabel.scaleY = 0.25;
  12424. levelLabel.mouseEnabled = !1;
  12425. levelLabel.y = 253;
  12426. levelLabel.score = 0;
  12427. levelLabel.spaceWidth = 10;
  12428. levelLabel.postfix = "ll";
  12429. menuEase = createjs.Ease.getElasticOut(1, 0.35);
  12430. createMainMenu();
  12431. createLevelSelectMenu();
  12432. createLevelCompleteWin();
  12433. createPauseWin();
  12434. createAchievWin();
  12435. createAchievGalleryMenu();
  12436. createCreditsWin();
  12437. creategameCompleteWin();
  12438. createBlinkWin();
  12439. isGamePaused = !0;
  12440. isSkipMenus ? showGameInterface() : isLevelSelectShow ? showLevelsMenu() : showMainMenu(!1)
  12441. }
  12442. var blinkWin;
  12443. function createBlinkWin() {
  12444. blinkWin = createButton(-40, -60, 6.5, "tint2");
  12445. blinkWin.scaleX = 4.5
  12446. }
  12447. function startBlink(c, a) {
  12448. addToParent(blinkWin, container);
  12449. blinkWin.alpha = 1;
  12450. blinkWin.gotoAndStop(a);
  12451. createjs.Tween.get(blinkWin, {
  12452. override: !0
  12453. })
  12454. .to({
  12455. alpha: 0
  12456. }, c)
  12457. .call(removeChildOnTweenComplete)
  12458. }
  12459. function showFPSMeter() {
  12460. isNeedFpsMeter && addToParent(fpsText, container);
  12461. isNeedHelperLabel && addToParent(helperLabel, container)
  12462. }
  12463. function showGameInterface() {
  12464. addToParent(pauseBtnV, container);
  12465. addToParent(interfaceRestartBtn, container);
  12466. addToParent(levelLabel, container);
  12467. showFPSMeter()
  12468. }
  12469. function hideGameInterface() {
  12470. pauseBtnV.parent && container.removeChild(pauseBtnV);
  12471. removeFromParent(interfaceRestartBtn);
  12472. removeFromParent(levelLabel)
  12473. }
  12474. function setCurrentLevelLabel(c) {
  12475. levelLabel.text = "l " + (c + 1)
  12476. }
  12477. function onPausePress(c) {
  12478. isGamePaused || isLevelFailed || isLevelCompleted || onHoverScale(c.target)
  12479. }
  12480. function onPauseUp(c) {
  12481. onOutScale(c.target);
  12482. isGamePaused || isLevelFailed || isLevelCompleted || levelPauseContainer.parent || isCursorOutMoved(c) || (playSound("clickSound"), showPauseWin())
  12483. }
  12484. var menuContainer, mainMenuMuteBtn, mainMenuMoreGames, mainMenuAchievBtn;
  12485. function createMainMenu() {
  12486. menuContainer = new createjs.Container;
  12487. playMenuBtn = createButton(ow / 2, 220, 0.7, "playbtnup", onPlayPress, menuContainer, onPlayUp);
  12488. creditsBtn = createButton(300, 200, 0.8, "btnbaseup", onCreditsPress, menuContainer, onCreditsUp);
  12489. logoImg = createButton(ow / 2 + 5, 175, 1, "logov", null, menuContainer);
  12490. mainMenuAchievBtn = createButton(37, 170, 0.8, "achievbtn", onAchievGalleryPress, menuContainer, onAchievGalleryUp);
  12491. mainMenuMuteBtn = createButton(382, 17, 0.65, "musiconbtn", onMainMenuMutePress, menuContainer, onMainMenuMuteUp);
  12492. mainMenuMoreGames = createButton(100, 190, 0.7, "moregames2v", sponsorClick, menuContainer, null);
  12493. isAudioSupported || (mainMenuMuteBtn.visible = !1);
  12494. createMainMenuTweens()
  12495. }
  12496. var MUTED_FRAME = "musicoffbtn",
  12497. UNMUTED_FRAME = "musiconbtn";
  12498. function onMainMenuMutePress(c) {
  12499. onHoverScale(c.target)
  12500. }
  12501. function onMainMenuMuteUp(c) {
  12502. onOutScale(c.target);
  12503. isCursorOutMoved(c) || (toggleMute(), updateMusicIconFrame(c.target), playSound("clickSound"))
  12504. }
  12505. function updateMusicIconFrame(c) {
  12506. c.gotoAndStop(isMute ? MUTED_FRAME : UNMUTED_FRAME)
  12507. }
  12508. function showMainMenu(c) {
  12509. container.addChild(menuContainer);
  12510. updateMusicIconFrame(mainMenuMuteBtn);
  12511. showBgByLevelNum(0, 2);
  12512. showFPSMeter();
  12513. showTopLogo(0.8);
  12514. c && (startBlink(700, "tint2"), isNeedCacheSizeUpdate = !0)
  12515. }
  12516. function showMainMenuTweenComplete(c) {}
  12517. function hideMainMenu() {
  12518. removeFromParent(menuContainer)
  12519. }
  12520. function hideMainMenuTweenComplete(c) {
  12521. c = c.target;
  12522. c.alpha = 1;
  12523. c.parent && container.removeChild(c)
  12524. }
  12525. function createBigWinBg(c, a, b, g) {
  12526. c = createButton(c, a, isLowQuality ? 2 : 1, isLowQuality ? "smallwinv" : "bgwinv", null, g);
  12527. c.rotation = -90;
  12528. c.scaleX = isLowQuality ? 2 * b : b
  12529. }
  12530. function createMainMenuTweens() {
  12531. var c = createjs.Ease.bounceOut;
  12532. createjs.Tween.removeTweens(playMenuBtn);
  12533. playMenuBtn.scaleX = playMenuBtn.scaleY = 0.75;
  12534. createjs.Tween.get(playMenuBtn, {
  12535. override: !0,
  12536. loop: !0
  12537. })
  12538. .to({
  12539. scaleX: 0.95,
  12540. scaleY: 0.95
  12541. }, 3E3, c)
  12542. .wait(1E3)
  12543. .to({
  12544. scaleX: 0.75,
  12545. scaleY: 0.75
  12546. }, 3E3, c)
  12547. }
  12548. function disposeMainMenuTweens() {
  12549. createjs.Tween.removeTweens(playMenuBtn)
  12550. }
  12551. function onPlayPress(c) {
  12552. onHoverScale(c.target)
  12553. }
  12554. function onPlayUp(c) {
  12555. onOutScale(c.target);
  12556. isCursorOutMoved(c) || (playSound("clickSound"), hideMainMenu(), showLevelsMenu(), startBgMusic())
  12557. }
  12558. function onAchievGalleryPress(c) {
  12559. onHoverScale(c.target)
  12560. }
  12561. function onAchievGalleryUp(c) {
  12562. onOutScale(c.target);
  12563. isCursorOutMoved(c) || (playSound("clickSound"), hideMainMenu(), showAchievGallery())
  12564. }
  12565. function onCreditsPress(c) {
  12566. c.target.scaleX = c.target.scaleY = 0.9;
  12567. trace("play credits!")
  12568. }
  12569. function onCreditsUp(c) {
  12570. c.target.scaleX = c.target.scaleY = 0.8;
  12571. isCursorOutMoved(c) || (playSound("clickSound"), hideMainMenu(), showCreditsWin())
  12572. }
  12573. function createButton(c, a, b, g, f, d, e) {
  12574. var h = new createjs.Sprite(interfaceSS);
  12575. h.snapToPixel = !0;
  12576. h.x = c;
  12577. h.y = a;
  12578. h.scaleX = h.scaleY = b;
  12579. h.gotoAndStop(g);
  12580. h.defaultScale = b;
  12581. e && h.addEventListener("pressup", e, !1);
  12582. f ? (h.addEventListener("mousedown", f, !1), h.cursor = "pointer") : h.mouseEnabled = !1;
  12583. (f || e) && (c = interfaceSS.getAnimation(g)) && c.frames && 0 < c.frames.length && (c = interfaceSS.getFrameBounds(c.frames[0]), h.setBoundingBox(c.x * b, c.y * b, c.width * b, c.height * b));
  12584. d && d.addChild(h);
  12585. return h
  12586. }
  12587. var selectMenuBackBtn, selectMenuNextBtn, selectMenuPreviousBtn, allLevelBtns = [],
  12588. levelsScreen1, levelsScreen2;
  12589. function createLevelSelectMenu() {
  12590. var c = levelSelectContainer = new createjs.Container;
  12591. levelSelectContainer.name = "levelselcont";
  12592. createBigWinBg(5, 438, 0.95, c);
  12593. levelsScreen1 = new createjs.Container;
  12594. levelsScreen1.name = "levelsScreen1";
  12595. levelsScreen2 = new createjs.Container;
  12596. createButton(156, 73, 1, "levelselecttitle", null, levelSelectContainer);
  12597. selectMenuBackBtn = createButton(28, 411, 0.8, "backbtn", onBackToMenuPress, levelsScreen1, onBackToMenuUp);
  12598. createLevelsButtons();
  12599. levelSelectContainer.addChild(levelsScreen1)
  12600. }
  12601. function cacheWin(c) {
  12602. c.cache(-10, -10, ow + 20, oh + 20)
  12603. }
  12604. function uncacheWin(c) {
  12605. c.uncache()
  12606. }
  12607. function createLevelsButtons() {
  12608. for (var c = 0; 20 > c; c++) {
  12609. var a = createButton(62 + 65 * (c % 4), 129 + 60 * Math.floor(c / 4), 0.72, "lvlLabelStar0", onLevelBtnPress, levelsScreen1, onLevelBtnUp);
  12610. a.levelNum = c;
  12611. allLevelBtns.push(a);
  12612. var b = createButton(a.x - 24, a.y - 26, 0.7, "lvlnum" + (c + 1), null, levelsScreen1);
  12613. a.txtNum = b
  12614. }
  12615. }
  12616. function updateLevelsButtons() {
  12617. for (var c = 0; 20 > c; c++) {
  12618. var a = c <= lastopenedlvl;
  12619. isOpenAllLevels && (a = c < openedLevels);
  12620. var b;
  12621. b = a ? "lvlLabelStar" + getStarsForLevel(c) : "levelbuttonlocked";
  12622. var g = allLevelBtns[c];
  12623. g.gotoAndStop(b);
  12624. (g.isOpened = a) ? g.txtNum.parent || g.parent.addChild(g.txtNum) : g.txtNum.parent && g.parent.removeChild(g.txtNum)
  12625. }
  12626. }
  12627. function onLevelBtnPress(c) {
  12628. c = c.target;
  12629. onHoverScale(c);
  12630. trace("level " + c.levelNum + " load");
  12631. updateCacheByBtnNum(c.levelNum)
  12632. }
  12633. function onLevelBtnUp(c) {
  12634. var a = c.target;
  12635. onOutScale(a);
  12636. isCursorOutMoved(c) ? updateCacheByBtnNum(a.levelNum) : a.isOpened ? (levelsWithoutRestartsCounter = levelRestartsCounter = 0, showGameInterface(), loadLevel(a.levelNum), startBlink(400, "tint2"), showGameField(), hideLevelsMenu()) : (updateCacheByBtnNum(a.levelNum), playSound("clickSound"))
  12637. }
  12638. function updateCacheByBtnNum(c) {}
  12639. function onBackToMenuPress(c) {
  12640. onHoverScale(c.target)
  12641. }
  12642. function onBackToMenuUp(c) {
  12643. onOutScale(c.target);
  12644. isCursorOutMoved(c) || (hideLevelsMenu(), showMainMenu(!0), playSound("clickSound"))
  12645. }
  12646. function showLevelsMenu() {
  12647. container.addChild(levelSelectContainer);
  12648. updateLevelsButtons();
  12649. levelsScreen2.parent && levelSelectContainer.removeChild(levelsScreen2);
  12650. levelsScreen1.parent || levelSelectContainer.addChild(levelsScreen1);
  12651. levelsScreen1.x = 0;
  12652. levelsScreen1.alpha = 1;
  12653. showBgByLevelNum(0, 1, 1.2);
  12654. startBlink(700, "tint2");
  12655. isNeedCacheSizeUpdate = !0;
  12656. showTopLogo(0.8)
  12657. }
  12658. function hideLevelsMenu() {
  12659. createjs.Tween.removeTweens(levelSelectContainer);
  12660. removeFromParent(levelSelectContainer)
  12661. }
  12662. function showGameField() {
  12663. createjs.Tween.removeTweens(blockContainer);
  12664. blockContainer.parent || container.addChild(blockContainer);
  12665. blockContainer.alpha = 0;
  12666. blockContainer.visible = !0;
  12667. createjs.Tween.get(blockContainer, {
  12668. override: !0
  12669. })
  12670. .to({
  12671. alpha: 1
  12672. }, 400)
  12673. }
  12674. function hideGameField(c, a) {
  12675. isGamePaused = !0;
  12676. createjs.Tween.removeTweens(blockContainer);
  12677. var b = createjs.Tween.get(blockContainer)
  12678. .to({
  12679. alpha: 0,
  12680. visible: !1
  12681. }, a ? a : 200)
  12682. .call(removeFromParent);
  12683. c && b.call(disposeLevelPhysics)
  12684. }
  12685. function showRestartWin() {
  12686. isLevelFailed && (levelPauseContainer.parent || showPauseWin(!0))
  12687. }
  12688. var levelCompleteContainer, completeWinNextBtn, star1, star2, star3, completeLevelLabel, completeTotalScore;
  12689. function createLevelCompleteWin() {
  12690. var c = levelCompleteContainer = new createjs.Container;
  12691. createBigWinBg(5, 400, 0.83, c);
  12692. var a = createButton(ow / 2, 220, 0.9, "lvlcompletebgnew", null, c);
  12693. completeWinNextBtn = createButton(270, 390, 0.85, "nextlevelwin", onPressStandartHandler, c, onNextLevelUp);
  12694. createButton(70, 330, 1, "completeelk", null, c, null);
  12695. createButton(50, 390, 0.9, "restartbtn", onPressStandartHandler, c, onCompleteRestartUp);
  12696. createButton(210, 310, 0.8, "levelreadylabel", null, c);
  12697. star1 = createButton(a.x - 82, a.y - 20, 1, "completestar",
  12698. null, null, null);
  12699. star1.rotation = -15;
  12700. star2 = createButton(a.x + 1, a.y - 27, 1, "completestar", null, null, null);
  12701. star3 = createButton(a.x + 86, a.y - 16, 1, "completestar", null, null, null);
  12702. star3.rotation = 12;
  12703. completeLevelLabel = new createjs.BitmapText("0", zoeSS);
  12704. completeLevelLabel.scaleX = completeLevelLabel.scaleY = 0.65;
  12705. completeLevelLabel.mouseEnabled = !1;
  12706. completeLevelLabel.y = 297;
  12707. completeLevelLabel.x = 240;
  12708. completeLevelLabel.score = 0;
  12709. addToParent(completeLevelLabel, c);
  12710. createButton(160, 390, 0.85, "moregames2v", sponsorClick, c, null)
  12711. }
  12712. function onCompleteQuitUp(c) {
  12713. onOutScale(c.target);
  12714. isCursorOutMoved(c) || (hideGameField(!1), disposeLevel(), hideLevelCompleteWin(), showMainMenu(!0), playSound("clickSound"), stopScoresSound())
  12715. }
  12716. function onCompleteRestartUp(c) {
  12717. onOutScale(c.target);
  12718. isCursorOutMoved(c) || (playSound("clickSound"), restartLevel(), showGameField(), hideLevelCompleteWin(), stopScoresSound())
  12719. }
  12720. function onPressStandartHandler(c) {
  12721. onHoverScale(c.target)
  12722. }
  12723. function onNextLevelUp(c) {
  12724. onOutScale(c.target);
  12725. isCursorOutMoved(c) || (playSound("clickSound"), hideLevelCompleteWin(), handleNextLevelClick(), stopScoresSound())
  12726. }
  12727. function handleNextLevelClick() {
  12728. var c = getNewAchievedId(); - 1 < c ? showAchievWin(c) : currentLevel >= LEVELS_NUM - 1 ? (hideGameInterface(), disposeLevel(), showMainMenu(!0)) : (showGameInterface(), loadNextLevel(), showGameField())
  12729. }
  12730. var currentLevelStarsNum = 0;
  12731. function showLevelCompleteWin() {
  12732. isLevelCompleted || isLevelFailed || (isLevelCompleted = !0, hideGameInterface(), createjs.Tween.removeTweens(levelCompleteContainer), removeFromParent(star1), removeFromParent(star2), removeFromParent(star3), container.addChild(levelCompleteContainer), addToParent(particleContainer, container), levelCompleteContainer.x = 400, levelCompleteContainer.alpha = 0, createjs.Tween.get(blockContainer)
  12733. .wait(800)
  12734. .call(hideGameField), createjs.Tween.get(levelCompleteContainer, {
  12735. override: !0
  12736. })
  12737. .wait(900)
  12738. .to({
  12739. alpha: 1,
  12740. x: 0
  12741. }, 1300, menuEase)
  12742. .call(showStars), currentLevelStarsNum = ZERO_STAR, totalBonuses <= collectedBonuses ? currentLevelStarsNum = THREE_STAR : collectedBonuses >= totalBonuses / 2 ? currentLevelStarsNum = TWO_STAR : 0 < collectedBonuses && (currentLevelStarsNum = ONE_STAR), totalScore += currentLevelScore + scoreToAdd, scoreToAdd = 0, totalFriends += totalEnemies, saveGame(currentLevelStarsNum), completeLevelLabel.text = "" + (currentLevel + 1), checkCompleteAchievs(), stopWindSound(), playSound("winSound"))
  12743. }
  12744. function checkCompleteAchievs() {
  12745. 9 <= getStarsForLevel(0) + getStarsForLevel(1) + getStarsForLevel(2) && addAchiev(SUPER_COLLECTOR_ACHIEV);
  12746. currentLevel >= LEVELS_NUM - 1 && addAchiev(SOCCER_MASTER_ACHIEV);
  12747. 60 <= getCollectedStarsNum() && addAchiev(MEGA_STAR_ACHIEV);
  12748. levelsWithoutRestartsCounter++;
  12749. 5 <= levelsWithoutRestartsCounter && addAchiev(AMAZING_GAME_ACHIEV);
  12750. 0 >= currentRemovablesNum && addAchiev(DESTROYER_ACHIEV)
  12751. }
  12752. var scoreTweenLength = 0;
  12753. function showStars(c) {
  12754. startSponsorAds();
  12755. animateStar(star1, 20 + scoreTweenLength, 1, "star1");
  12756. currentLevelStarsNum >= TWO_STAR && animateStar(star2, 800 + scoreTweenLength, 1, "star2");
  12757. currentLevelStarsNum >= THREE_STAR && animateStar(star3, 1600 + scoreTweenLength, 1, "star3")
  12758. }
  12759. function animateStar(c, a, b, g) {
  12760. levelCompleteContainer.addChild(c);
  12761. c.alpha = 0;
  12762. c.scaleX = c.scaleY = 2;
  12763. createjs.Tween.get(c, {
  12764. override: !0
  12765. })
  12766. .wait(a)
  12767. .to({
  12768. alpha: 1,
  12769. scaleX: b,
  12770. scaleY: b
  12771. }, 700, createjs.Ease.bounceOut)
  12772. .call(function () {});
  12773. createjs.Tween.get({
  12774. x: 100
  12775. })
  12776. .wait(a + 200)
  12777. .call(function () {
  12778. isLevelCompleted && (playSound(g), createPrerenderedPart(c.x, c.y, 1.2, "parteffectv2", 0.85, c, 0.8))
  12779. })
  12780. }
  12781. function removeFromParent(c) {
  12782. c.parent && c.parent.removeChild(c)
  12783. }
  12784. function hideLevelCompleteWin() {
  12785. createjs.Tween.removeTweens(star1);
  12786. createjs.Tween.removeTweens(star2);
  12787. createjs.Tween.removeTweens(star3);
  12788. createjs.Tween.removeTweens(levelCompleteContainer);
  12789. createjs.Tween.get(levelCompleteContainer)
  12790. .to({
  12791. alpha: 0,
  12792. x: -400
  12793. }, 200)
  12794. .call(removeChildOnTweenComplete);
  12795. showGameInterface()
  12796. }
  12797. var levelPauseContainer, pauseContinueBtn, pauseMuteBtn, pauseTitle;
  12798. function createPauseWin() {
  12799. var c = levelPauseContainer = new createjs.Container;
  12800. createBigWinBg(5, 420, 0.83, c);
  12801. pauseTitle = createButton(ow / 2 - 2, oh / 2 - 70, 0.92, "pausetitle", null, levelPauseContainer);
  12802. createButton(ow / 2 - 90, 345, 0.9, "quitbtn", onPauseQuitPress, levelPauseContainer, onPauseQuitUp);
  12803. createButton(ow / 2 + 90, 345, 0.9, "restartbtn", onPauseRestartPress, levelPauseContainer, onPauseRestartUp);
  12804. pauseMuteBtn = createButton(ow / 2, 345, 0.9, "musiconbtn", onPauseMutePress, levelPauseContainer, onPauseMuteUp);
  12805. isAudioSupported || (pauseMuteBtn.visible = !1);
  12806. pauseContinueBtn = createButton(160, 250, 0.8, "playbtnup", onPauseContinuePress, levelPauseContainer, onPauseContinueUp);
  12807. createButton(160, 410, 0.9, "moregames2v", sponsorClick, levelPauseContainer, null)
  12808. }
  12809. function onPauseMutePress(c) {
  12810. onHoverScale(c.target)
  12811. }
  12812. function onPauseMuteUp(c) {
  12813. onOutScale(c.target);
  12814. isCursorOutMoved(c) || (toggleMute(), updateMusicIconFrame(c.target), isMute || playSound("clickSound"))
  12815. }
  12816. function onPauseRestartPress(c) {
  12817. onHoverScale(c.target)
  12818. }
  12819. function onPauseRestartUp(c) {
  12820. onOutScale(c.target);
  12821. isCursorOutMoved(c) || (playSound("clickSound"), hidePauseWin(!1, !1), showGameField(), restartLevel())
  12822. }
  12823. function onInterfaceRestartUp(c) {
  12824. onOutScale(c.target);
  12825. isCursorOutMoved(c) || (playSound("clickSound"), showGameField(), restartLevel())
  12826. }
  12827. function onPauseQuitPress(c) {
  12828. onHoverScale(c.target)
  12829. }
  12830. function onPauseQuitUp(c) {
  12831. onOutScale(c.target);
  12832. isCursorOutMoved(c) || (playSound("clickSound"), isGamePaused = !0, disposeLevel(), hidePauseWin(!1, !0), updateBgCache(), hideGameField(!1, 100), showMainMenu(!0))
  12833. }
  12834. function onPauseContinuePress(c) {
  12835. onHoverScale(c.target)
  12836. }
  12837. function onPauseContinueUp(c) {
  12838. onOutScale(c.target);
  12839. isCursorOutMoved(c) || (playSound("clickSound"), hidePauseWin(!1, !1))
  12840. }
  12841. function showPauseWin(c) {
  12842. isGamePaused = !0;
  12843. hideGameInterface();
  12844. updateMusicIconFrame(pauseMuteBtn);
  12845. container.addChild(levelPauseContainer);
  12846. pauseContinueBtn.visible = !c;
  12847. c ? (pauseTitle.gotoAndStop("tryagaintitle"), setSpriteScale(pauseTitle, 1), hideGameField(!0, 400), stopWindSound()) : (pauseTitle.gotoAndStop("pausetitle"), setSpriteScale(pauseTitle, 0.92));
  12848. levelPauseContainer.x = -400;
  12849. levelPauseContainer.y = -20;
  12850. levelPauseContainer.alpha = 0;
  12851. createjs.Tween.get(levelPauseContainer)
  12852. .to({
  12853. alpha: 1,
  12854. x: 0
  12855. }, 1300, menuEase)
  12856. }
  12857. function hidePauseWin(c, a) {
  12858. isGamePaused = !1;
  12859. createjs.Tween.removeTweens(levelPauseContainer);
  12860. createjs.Tween.get(levelPauseContainer)
  12861. .to({
  12862. alpha: 0,
  12863. x: 400
  12864. }, 300)
  12865. .call(removeChildOnTweenComplete);
  12866. a || showGameInterface()
  12867. }
  12868. var achievContainer, raduga, achievDesc;
  12869. function createAchievWin() {
  12870. achievContainer = new createjs.Container;
  12871. createButton(160, 84, 1, "newachievtitle", null, achievContainer);
  12872. raduga = createButton(160, 222, 1.1, "radugav", null, achievContainer);
  12873. createButton(160, 262, 1.1, "newachievbgv", null, achievContainer);
  12874. achievDesc = createButton(160, 343, 0.9, "achievdesc1", null, achievContainer);
  12875. createButton(160, 399, 1, "nextlevelwin", onAchievContinuePress, achievContainer)
  12876. }
  12877. function onAchievContinuePress(c) {
  12878. hideAchievWin();
  12879. handleNextLevelClick()
  12880. }
  12881. function showAchievWin(c) {
  12882. achievContainer.parent || container.addChild(achievContainer);
  12883. disposeLevel();
  12884. updateBgCache();
  12885. hideGameInterface();
  12886. achievDesc.gotoAndStop("achievdesc" + Math.round(c));
  12887. allachievs[c] = ACHIEVED;
  12888. updateSaves();
  12889. createjs.Tween.removeTweens(achievContainer);
  12890. achievContainer.alpha = 0;
  12891. createjs.Tween.get(achievContainer, {
  12892. override: !0
  12893. })
  12894. .to({
  12895. alpha: 1
  12896. }, 300)
  12897. .call(function () {
  12898. playAchievSound()
  12899. })
  12900. }
  12901. function hideAchievWin() {
  12902. removeFromParent(achievContainer)
  12903. }
  12904. function getNewAchievedId() {
  12905. return 0 < achievsReadyToShow.length ? achievsReadyToShow.pop() : -1
  12906. }
  12907. var achievsReadyToShow = [];
  12908. function addAchiev(c) {
  12909. isAlreadyAchieved(c) || addToArray(achievsReadyToShow, c)
  12910. }
  12911. function isAlreadyAchieved(c) {
  12912. return allachievs[c] == ACHIEVED
  12913. }
  12914. var achGalleryMenuBackBtn, achGalleryContainer, achievGalleryTotalScore, allAchievsLabels = [];
  12915. function createAchievGalleryMenu() {
  12916. var c = achGalleryContainer = new createjs.Container;
  12917. createBigWinBg(5, 438, 0.95, c);
  12918. createButton(ow / 2, 76, 0.9, "achievmenutitle", null, c);
  12919. createAchievLabels();
  12920. achGalleryMenuBackBtn = createButton(32, 410, 0.8, "backbtn", onPressStandartHandler, c, onAchievGalleryBackUp);
  12921. createButton(250, 390, 0.9, "achievelk", null, c)
  12922. }
  12923. function createAchievLabels() {
  12924. for (var c = 0; c < ACHIEVS_NUM; c++) {
  12925. var a = c,
  12926. b = createButton(160, 130 + 45 * a, 0.9, "achievback", null, achGalleryContainer, null),
  12927. a = createButton(160, 130 + 45 * a, 0.8 * 0.8, "achievclosed", null, achGalleryContainer, null);
  12928. allAchievsLabels.push(a);
  12929. a.bg = b
  12930. }
  12931. }
  12932. function updateAchievLabels() {
  12933. for (var c = 0; c < ACHIEVS_NUM; c++) allAchievsLabels[c].gotoAndStop(allachievs[c] == ACHIEVED ? "achievdesc" + c.toString() : "achievclosed")
  12934. }
  12935. function onAchievGalleryBackUp(c) {
  12936. onOutScale(c.target);
  12937. isCursorOutMoved(c) || (playSound("clickSound"), hideAchievGallery(), showMainMenu(!0))
  12938. }
  12939. function showAchievGallery() {
  12940. container.addChild(achGalleryContainer);
  12941. updateAchievLabels();
  12942. achGalleryContainer.x = 0;
  12943. achGalleryContainer.alpha = 1;
  12944. showBgByLevelNum(0, 4, 1.2);
  12945. startBlink(700, "tint2");
  12946. showTopLogo(0.8)
  12947. }
  12948. function hideAchievGallery() {
  12949. createjs.Tween.removeTweens(achGalleryContainer);
  12950. createjs.Tween.get(achGalleryContainer, {
  12951. override: !0
  12952. })
  12953. .to({
  12954. alpha: 0,
  12955. x: 400
  12956. }, 200)
  12957. .call(uncacheAndRemove)
  12958. }
  12959. var creditsContainer;
  12960. function createCreditsWin() {
  12961. var c = creditsContainer = new createjs.Container;
  12962. createBigWinBg(5, 400, 0.8, c);
  12963. createButton(33, 370, 0.9, "backbtn", onCreditsQuitPress, c, onCreditsQuitUp);
  12964. createButton(160, 210, 0.85, "biglimetxt", null, c);
  12965. createButton(155, 120, 0.9, "creditstitle", null, c);
  12966. createButton(230, 337, 1, "creditselk", null, c)
  12967. }
  12968. function onSiteLinkPress(c) {
  12969. window.open("http://porubov.com", "_blank")
  12970. }
  12971. function onCreditsLinkPress(c) {
  12972. window.location = "mailto:seddas@gmail.com?subject=BattleFish"
  12973. }
  12974. function onCreditsQuitPress(c) {
  12975. onHoverScale(c.target)
  12976. }
  12977. function onCreditsQuitUp(c) {
  12978. onOutScale(c.target);
  12979. isCursorOutMoved(c) || (playSound("clickSound"), hideCreditsWin(), showMainMenu(!0))
  12980. }
  12981. function showCreditsWin() {
  12982. container.addChild(creditsContainer);
  12983. creditsContainer.x = 0;
  12984. creditsContainer.alpha = 1;
  12985. showBgByLevelNum(0, 4, 1.2);
  12986. startBlink(700, "tint2")
  12987. }
  12988. function hideCreditsWin() {
  12989. removeFromParent(creditsContainer)
  12990. }
  12991. var gameCompleteContainer, collectedStarsTxt;
  12992. function creategameCompleteWin() {
  12993. gameCompleteContainer = new createjs.Container;
  12994. createButton(ow / 2, 310, 1, "nextlevelwin", ongameCompleteQuitPress, gameCompleteContainer, ongameCompleteQuitUp);
  12995. createButton(ow / 2, 237, 1, "levelinstruction8", null, gameCompleteContainer);
  12996. createButton(ow / 2, 105, 1, "allcollectedstars", null, gameCompleteContainer);
  12997. createButton(ow / 2, 30, 1, "gamecompletedTitle", null, gameCompleteContainer);
  12998. collectedStarsTxt = new createjs.BitmapText(getCollectedStarsNum()
  12999. .toString(), interfaceSS);
  13000. collectedStarsTxt.letterSpacing = -7;
  13001. collectedStarsTxt.x = 80;
  13002. collectedStarsTxt.y = 121;
  13003. collectedStarsTxt.mouseEnabled = !1;
  13004. gameCompleteContainer.addChild(collectedStarsTxt);
  13005. createButton(260, 335, 0.7, "moregamesbtn", sponsorClick, gameCompleteContainer, null)
  13006. }
  13007. function ongameCompleteQuitPress(c) {
  13008. c = c.target;
  13009. c.scaleX = c.scaleY = 1.2
  13010. }
  13011. function ongameCompleteQuitUp(c) {
  13012. onOutScale(c.target);
  13013. isCursorOutMoved(c) || (playSound("clickSound"), hidegameCompleteWin(), showMainMenu(!0))
  13014. }
  13015. var isGameCompleteScreenShow = !1;
  13016. function showGameCompleteWin() {
  13017. isGameCompleteScreenShow = !0;
  13018. container.addChild(gameCompleteContainer);
  13019. collectedStarsTxt.text = getCollectedStarsNum()
  13020. .toString();
  13021. gameCompleteContainer.x = 400;
  13022. gameCompleteContainer.alpha = 0;
  13023. createjs.Tween.get(gameCompleteContainer, {
  13024. override: !0
  13025. })
  13026. .to({
  13027. alpha: 1,
  13028. x: 0
  13029. }, 1300, createjs.Ease.elasticOut)
  13030. }
  13031. function hidegameCompleteWin() {
  13032. isGameCompleteScreenShow = !1;
  13033. updateMobileBrowserParams();
  13034. createjs.Tween.removeTweens(gameCompleteContainer);
  13035. createjs.Tween.get(gameCompleteContainer, {
  13036. override: !0
  13037. })
  13038. .to({
  13039. alpha: 0,
  13040. x: 400
  13041. }, 200)
  13042. .call(removeChildOnTweenComplete)
  13043. }
  13044. function uncacheAndRemove(c) {
  13045. c = c.target;
  13046. c.parent && c.parent.removeChild(c)
  13047. }
  13048. function removeChildOnTweenComplete(c) {
  13049. c = c.target;
  13050. c.parent && c.parent.removeChild(c)
  13051. }
  13052. function isTweened(c) {
  13053. return createjs.Tween.hasActiveTweens(c)
  13054. }
  13055. var hitPoint;
  13056. function isCursorOutMoved(c) {
  13057. if (!isDesktop()) return !1;
  13058. hitPoint = c.target.globalToLocal(c.stageX, c.stageY);
  13059. return !c.target.hitTest(hitPoint.x, hitPoint.y)
  13060. }
  13061. function updateScoreLabel(c) {}
  13062. var rotatedDecors = [];
  13063. function interfaceTick() {
  13064. for (var c = 0; c < rotatedDecors.length; c++) rotatedDecors[c].rotation += 3 * dtScale;
  13065. raduga && (raduga.rotation += dtScale, raduga.rotation %= 360)
  13066. }
  13067. function updateInterfacePositions() {
  13068. pauseBtnV.x = 24 + deltaForHLeft();
  13069. pauseBtnV.y = 416 - deltaForVTop() / 2;
  13070. interfaceRestartBtn.x = 70 + deltaForHLeft();
  13071. interfaceRestartBtn.y = 416 - deltaForVTop() / 2;
  13072. creditsBtn.x = 290 - deltaForHLeft();
  13073. creditsBtn.y = 410 - deltaForVTop() / 2;
  13074. mainMenuMuteBtn.x = 292 - deltaForHLeft();
  13075. mainMenuMuteBtn.y = 360 - deltaForVTop() / 2;
  13076. mainMenuMoreGames.x = 160;
  13077. mainMenuMoreGames.y = 420 - deltaForVTop() / 2;
  13078. playMenuBtn.y = 330 - 0.2 * deltaForVTop();
  13079. mainMenuAchievBtn.x = 40 + deltaForHLeft();
  13080. mainMenuAchievBtn.y = 400 - deltaForVTop() /
  13081. 2;
  13082. isNeedFpsMeter && (fpsText.x = ow - 32 - deltaForHLeft(), fpsText.y = deltaForVTop() / 2);
  13083. updateLogoPos()
  13084. }
  13085. var stage, exportRoot, canvas, rect, container, preload, rotationContainer, particleContainer, winWidth, winHeight, scaleFactor = 1,
  13086. minW = 320,
  13087. minH = 440,
  13088. ow = minW,
  13089. oh = minH,
  13090. maxW = 356,
  13091. maxH = 550,
  13092. desctopMaxW = maxW,
  13093. desctopMaxH = maxH,
  13094. viewportW = minW,
  13095. viewportH = minH,
  13096. pixelDensity = 1;
  13097. function initResizeManager() {
  13098. window.addEventListener("resize", onWindowResize);
  13099. document.addEventListener("touchstart", PreventScrollTouch);
  13100. window.onorientationchange = orientChange;
  13101. onGameResize();
  13102. setTimeout(hideAdressBar, 100);
  13103. hideAddressbar(document.getElementById("gamediv"))
  13104. }
  13105. var isWasPaused = null,
  13106. topVisionLine, zoomFactor;
  13107. function onGameResize() {
  13108. hideAdressBar();
  13109. var c = window.innerWidth,
  13110. a = window.innerHeight;
  13111. zoomFactor = 1;
  13112. if (isLowQuality) {
  13113. var b = Math.min(c / minW, a / minH);
  13114. zoomFactor = Math.max(1, Math.min(2, b * b));
  13115. c /= zoomFactor;
  13116. a /= zoomFactor
  13117. }
  13118. b = "scale(" + zoomFactor + "," + zoomFactor + ")";
  13119. canvas.style.transform = b;
  13120. canvas.style.msTransform = b;
  13121. canvas.style.MozTransform = b;
  13122. canvas.style.WebkitTransform = b;
  13123. canvas.style.OTransform = b;
  13124. scaleFactor = Math.min(c / minW, a / minH);
  13125. stage.scaleX = 1;
  13126. stage.scaleY = 1;
  13127. stage.canvas.width = Math.min(c, maxW * scaleFactor);
  13128. stage.canvas.height = Math.min(a, maxH * scaleFactor);
  13129. if (isDesktop() && !isMobileOnlyResize) {
  13130. var b = 10,
  13131. g = getURLParameter("scale");
  13132. g && (b = parseFloat(g));
  13133. scaleFactor = Math.min(c / desctopMaxW, a / desctopMaxH);
  13134. scaleFactor = Math.min(scaleFactor, b / zoomFactor);
  13135. stage.canvas.width = Math.min(c, desctopMaxW * scaleFactor);
  13136. stage.canvas.height = Math.min(a, desctopMaxH * scaleFactor)
  13137. }
  13138. stage.canvas.style.marginTop = "0px";
  13139. stage.canvas.style.marginLeft = "0px";
  13140. stage.canvas.style.left = Math.floor((c * zoomFactor - stage.canvas.width) / 2) + "px";
  13141. stage.canvas.style.top =
  13142. Math.floor((a * zoomFactor - stage.canvas.height) / 2) + "px";
  13143. viewportH = stage.canvas.height / scaleFactor;
  13144. viewportW = stage.canvas.width / scaleFactor;
  13145. topVisionLine = -(viewportH - oh);
  13146. stage.autoClear = !1;
  13147. container.scaleX = scaleFactor;
  13148. container.scaleY = scaleFactor;
  13149. container.x = Math.round((stage.canvas.width - ow * scaleFactor) / 2);
  13150. container.y = Math.round((stage.canvas.height - oh * scaleFactor) / 2);
  13151. splashContainer && (splashContainer.scaleX = container.scaleX, splashContainer.scaleY = container.scaleY, splashContainer.x = container.x, splashContainer.y =
  13152. container.y);
  13153. winWidth = c;
  13154. winHeight = a;
  13155. timer = null;
  13156. loaderBar && (loaderBar.y = (oh - barHeight) / 2 + deltaForVCenter());
  13157. isAllFilesLoaded && isGameInited && updateInterfacePositions();
  13158. isNeedCacheSizeUpdate = !0;
  13159. isPhysicsDebugDraw && debugDraw && (debugCanvas.width = stage.canvas.width, debugCanvas.height = stage.canvas.height, debugCanvas.style.left = stage.canvas.style.left, debugCanvas.style.top = stage.canvas.style.top, debugCanvas.style.marginLeft = container.x + "px", debugCanvas.style.marginTop = container.y + "px");
  13160. stage.update()
  13161. }
  13162. function isNeedCanvasZoom(c, a) {
  13163. if (isDesktop()) return !1;
  13164. var b = Math.min(c / minW, a / minH);
  13165. return isDefaultAndroid() && 2 <= b
  13166. }
  13167. function sizeHandler() {}
  13168. function deltaForVCenter() {
  13169. return -(viewportH - oh) / 2
  13170. }
  13171. function deltaForVTop() {
  13172. return -(viewportH - oh)
  13173. }
  13174. function deltaForHLeft() {
  13175. return -(viewportW - ow) / 2
  13176. }
  13177. function getMaxLeft() {
  13178. return -(maxW - ow) / 2
  13179. }
  13180. function getMaxRight() {
  13181. return maxW + getMaxLeft()
  13182. }
  13183. function getMaxTop() {
  13184. return -(maxH - oh)
  13185. }
  13186. function orientChange(c) {
  13187. setTimeout(hideAdressBar, 50);
  13188. onWindowResize(null)
  13189. }
  13190. function hideAdressBar() {
  13191. window.scrollTo(0, 1)
  13192. }
  13193. function PreventScrollTouch(c) {
  13194. window.scrollTo(0, 1);
  13195. window.innerHeight != winHeight && onWindowResize(null);
  13196. c.preventDefault();
  13197. c.stopPropagation();
  13198. c.cancelBubble = !0;
  13199. return c.returnValue = !1
  13200. }
  13201. var timer;
  13202. function onWindowResize(c) {
  13203. setTimeout(hideAdressBar, 1);
  13204. clearTimeout(timer);
  13205. setTimeout(onGameResize, 1)
  13206. }
  13207. function setPixelRatio() {
  13208. if (isHiDPI()) {
  13209. var c = document.createElement("meta");
  13210. c.name = "viewport";
  13211. c.content = "target-densitydpi=device-dpi, user-scalable=0, initial-scale=0.5, maximum-scale=0.5, minimum-scale=0.5";
  13212. document.getElementsByTagName("head")[0].appendChild(c)
  13213. }
  13214. }
  13215. function isHiDPI() {
  13216. return !window.hasOwnProperty("devicePixelRatio") || -1 == navigator.userAgent.indexOf("iPhone") && -1 == navigator.userAgent.indexOf("iPad") || 2 != window.devicePixelRatio ? !1 : !0
  13217. }
  13218. function getURLParameter(c) {
  13219. return decodeURIComponent((RegExp("[?|&]" + c + "=([^&;]+?)(&|#|;|$)")
  13220. .exec(location.search) || [, ""])[1].replace(/\+/g, "%20")) || null
  13221. }
  13222. function isMobileDetected(c) {
  13223. return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|android|ipad|playbook|silk|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(c) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(c.substr(0,
  13224. 4))
  13225. }
  13226. var MyGame = {},
  13227. images, files;
  13228. MyGame.init = function () {
  13229. try {
  13230. canvas = document.getElementById("canvas");
  13231. images = images || {};
  13232. files = files || {};
  13233. stage = new createjs.Stage("canvas");
  13234. container = new createjs.Container;
  13235. container.isRoot = !0;
  13236. container.width = ow;
  13237. container.height = oh;
  13238. stage.addChild(container);
  13239. detectBrowser();
  13240. blockContainer = new createjs.Container;
  13241. splashContainer = new createjs.Container;
  13242. splashContainer.width = ow;
  13243. splashContainer.height = oh;
  13244. particleContainer = new createjs.Container;
  13245. rotationContainer = new createjs.Container;
  13246. rotationContainer.width =
  13247. ow;
  13248. rotationContainer.height = oh;
  13249. initResizeManager();
  13250. createjs.Touch.enable(stage, !0);
  13251. isDesktop() && stage.enableMouseOver(20);
  13252. stage.mouseMoveOutside = !0;
  13253. initLoaders();
  13254. stage.update();
  13255. var c = document.getElementById("loader");
  13256. c && c.parentNode && c.parentNode.removeChild(c);
  13257. onGameResize();
  13258. initSpilApi()
  13259. } catch (a) {
  13260. trace(a.name + ":" + a.message)
  13261. }
  13262. };
  13263. function isDesktop() {
  13264. return isDesktopBrowser
  13265. }
  13266. function updateMobileBrowserParams() {
  13267. MAX_PARTICLES_ON_SCREEN = isDesktopBrowser ? 30 : 12
  13268. }
  13269. function detectBrowser() {
  13270. isDesktopBrowser = !isMobileDetected(navigator.userAgent || navigator.vendor || window.opera);
  13271. var c = getURLParameter("mobile");
  13272. c && 1 == parseInt(c) && (isDesktopBrowser = !1);
  13273. updateMobileBrowserParams()
  13274. }
  13275. var loaderBar, bar, loaderWidth, barHeight = 20;
  13276. function initLoaders() {
  13277. var c = createjs.Graphics.getRGB(247, 247, 247);
  13278. loaderBar = new createjs.Container;
  13279. bar = new createjs.Shape;
  13280. bar.graphics.beginFill(c)
  13281. .drawRect(0, 0, 1, barHeight)
  13282. .endFill();
  13283. loaderWidth = 300;
  13284. var a = new createjs.Shape;
  13285. a.graphics.setStrokeStyle(2)
  13286. .beginStroke(c)
  13287. .drawRect(-5, -5, loaderWidth + 10, barHeight + 10);
  13288. loaderBar.x = container.width - loaderWidth >> 1;
  13289. loaderBar.y = container.height - barHeight >> 1;
  13290. loaderBar.addChild(bar, a);
  13291. container.addChild(loaderBar);
  13292. initSoundManager();
  13293. preload = new createjs.LoadQueue(!0,
  13294. "assets/");
  13295. preload.installPlugin(createjs.Sound);
  13296. preload.addEventListener("progress", handleOverallProgress);
  13297. preload.addEventListener("complete", handleComplete);
  13298. preload.addEventListener("fileload", handleFileLoad);
  13299. isLoadAnimFromJSON && manifest.push({
  13300. src: "soccerassets.json",
  13301. id: "anim_json"
  13302. });
  13303. preload.loadManifest(manifest);
  13304. createjs.Ticker.timingMode = createjs.Ticker.RAF_SYNCHED;
  13305. isDefaultAndroid() && (createjs.Ticker.timingMode = createjs.Ticker.TIMEOUT);
  13306. createjs.Ticker.setFPS(FPS)
  13307. }
  13308. function isDefaultAndroid() {
  13309. var c = navigator.userAgent;
  13310. return -1 < c.indexOf("Mozilla/5.0") && -1 < c.indexOf("Android ") && -1 < c.indexOf("AppleWebKit") && !(-1 < c.indexOf("Chrome"))
  13311. }
  13312. function handleOverallProgress(c) {
  13313. 0 != c.total && (bar.scaleX = c.loaded / c.total * loaderWidth, stage.update())
  13314. }
  13315. var fpsText, helperLabel, zoeSS, interfaceSS, bgSS, isPreloaderLogoReady = !1;
  13316. function handleFileLoad(c) {
  13317. "image" == c.item.type && (images[c.item.id] = c.result);
  13318. files[c.item.id] = c.result;
  13319. isLogoReady && "preloaderlogo" == c.item.id && showPreloaderLogo()
  13320. }
  13321. function showPreloaderLogo() {
  13322. if (files.preloaderlogo && !isPreloaderLogoReady) {
  13323. isPreloaderLogoReady = !0;
  13324. var c = files.preloaderlogo,
  13325. a = c.width,
  13326. b = c.height,
  13327. c = (new createjs.Bitmap(c))
  13328. .set({
  13329. scaleX: 0.75,
  13330. scaleY: 0.75,
  13331. regX: a / 2,
  13332. regY: b / 2,
  13333. cursor: "pointer",
  13334. x: ow / 2,
  13335. y: 20 + 0.75 * b
  13336. });
  13337. c.setBoundingBox(-a / 2, -b / 2, a, b);
  13338. c.addEventListener("mousedown", sponsorClick);
  13339. loaderBar.addChild(c)
  13340. }
  13341. }
  13342. function sponsorClick(c) {
  13343. // Play68.goHome();
  13344. // window.open(SPONSOR_URL, "_blank")
  13345. }
  13346. function createRotationScreen() {
  13347. var c = new createjs.Sprite(bgSS);
  13348. c.gotoAndStop("rotateScreen");
  13349. c.x = 30;
  13350. rotationContainer.addChild(c)
  13351. }
  13352. var isAllFilesLoaded = !1;
  13353. function handleComplete(c) {
  13354. isAllFilesLoaded || (isLogoReady = isAllFilesLoaded = !0) && startGame()
  13355. }
  13356. function startGame() {
  13357. try {
  13358. isGameInited || (removeFromParent(loaderBar), loaderBar = null, configureSpritesheets(), isDefaultAndroid() && (isLowQuality = !0), createSplashScreen(), createRotationScreen(), createBG(), loadSaves(), initLevelManager(), initBonusManager(), initParticleManager(), isNeedFpsMeter && (fpsText = new createjs.BitmapText("1", interfaceSS), fpsText.scaleX = fpsText.scaleY = 0.6, fpsText.letterSpacing = -7, fpsText.x = ow - 27, container.addChild(fpsText)), initInterface(), isGameInited = !0, onGameResize(), startSplash(),
  13359. isSkipMenus && (isLastLevelLoad ? loadLevel(allLevels.length - 1) : loadLevel(isDesignerSettingsPreferred ? editorLevelToLoad : autoLevelToLoad)), stage.update(), createjs.Ticker.addEventListener("tick", tick), initEditorHandlers(), isGetAllProperties && getAllProperties())
  13360. } catch (c) {
  13361. trace(c.name + ":" + c.message)
  13362. }
  13363. }
  13364. var splashContainer;
  13365. function startSplash() {
  13366. isSkipSplash || isSponsorLogoError || !splashContainer || splashContainer.parent || rotationContainer.parent || (removeFromParent(container), stage.addChild(splashContainer), createjs.Tween.get(splashContainer)
  13367. .wait(3E3)
  13368. .call(addContainer)
  13369. .to({
  13370. alpha: 0
  13371. }, 200)
  13372. .call(disposeSplash), trace("splash"), stage.autoClear = !0)
  13373. }
  13374. function addContainer(c) {
  13375. stage.addChildAt(container, 0)
  13376. }
  13377. function disposeSplash(c) {
  13378. removeFromParent(splashContainer);
  13379. splashContainer = null;
  13380. stage.autoClear = winWidth > maxW * scaleFactor || winHeight > maxH * scaleFactor
  13381. }
  13382. function createSplashScreen() {
  13383. var c = new createjs.Sprite(zoeSS);
  13384. c.gotoAndStop("splashlogo");
  13385. c.x = ow / 2;
  13386. c.y = oh / 2;
  13387. c.scaleX = c.scaleY = 0.8;
  13388. c.mouseEnabled = !0;
  13389. splashContainer.addChild(c)
  13390. }
  13391. function initEditorHandlers() {
  13392. isLevelEditor && stage.addEventListener("stagemousedown", handlePress)
  13393. }
  13394. function updateBgCache() {}
  13395. var mainBg, fansBg, allBgContainer, smallBg, isNeedCacheSizeUpdate = !1;
  13396. function createBG() {
  13397. allBgContainer = new createjs.Container;
  13398. container.addChild(allBgContainer);
  13399. mainBg = (new createjs.Sprite(bgSS))
  13400. .set({
  13401. x: -18,
  13402. y: 495,
  13403. rotation: -90
  13404. });
  13405. mainBg.gotoAndStop("bigbg");
  13406. allBgContainer.addChild(mainBg);
  13407. isLowQuality && (mainBg.gotoAndStop("smallbg"), setSpriteScale(mainBg, 2));
  13408. fansBg = (new createjs.Sprite(bgSS, "fansv"))
  13409. .set({
  13410. x: -30,
  13411. y: 312,
  13412. scaleX: 1.15,
  13413. scaleY: 1.15,
  13414. rotation: 0
  13415. });
  13416. setAnimationSpeed(fansBg, 0.8);
  13417. addToParent(fansBg, allBgContainer);
  13418. allBgContainer.mouseEnabled = !1
  13419. }
  13420. var nameCounter = 0;
  13421. function handlePress(c) {
  13422. isLevelEditor && (KeyboardJS.isPressed("n") && loadNextLevel(), KeyboardJS.isPressed("l") && showLevelCompleteWin(), KeyboardJS.isPressed("a") && showAchievWin(SUPER_COLLECTOR_ACHIEV), KeyboardJS.isPressed("u") && updateBgCache(), KeyboardJS.isPressed("g") && showGameCompleteWin())
  13423. }
  13424. function configureSpritesheets() {
  13425. isLoadAnimFromJSON && (zoeCFG = eval(files.anim_json));
  13426. validateSpritesheetCFG(zoeCFG, "zoespritesheet", !0, 2);
  13427. bgSS = interfaceSS = zoeSS = new createjs.SpriteSheet(zoeCFG)
  13428. }
  13429. function validateSpritesheetCFG(c, a, b, g) {
  13430. var f = images[a].width;
  13431. a = images[a].height;
  13432. c = c.frames;
  13433. for (var d = c.length, e, h = 0; h < d; h++) e = c[h], b && (e[2] -= 2 * g, e[3] -= 2 * g), e[0] + e[2] > f && (e[2] = f - e[0]), e[1] + e[3] > a && (e[3] = a - e[1]), 0 > e[0] && (e[0] = 0), 0 > e[1] && (e[1] = 0)
  13434. }
  13435. var counter = 0,
  13436. animTicker = 0,
  13437. toDisposePhysicsBodies = [],
  13438. toDisposeChars = [],
  13439. clickedChars = [],
  13440. dtScale = 1,
  13441. lastDelta = 0,
  13442. FPS = 30,
  13443. GAME_FPS = 30,
  13444. defaultDelta = 1E3 / GAME_FPS,
  13445. DEFAULT_WORLD_STEP = 1 / GAME_FPS,
  13446. allHeroesLen = 0,
  13447. lastTime = 0,
  13448. data, step = 0;
  13449. function tick(c) {
  13450. if (isDesktop() || !isPageLeaved) {
  13451. dtScale = c.delta / defaultDelta;
  13452. if (!dtScale || 0 >= dtScale) dtScale = 1;
  13453. 2 < dtScale && (dtScale = 2);
  13454. lastDelta = c.delta;
  13455. counter++;
  13456. animTicker++;
  13457. for (levelStartTimer++; 0 < toDisposePhysicsBodies.length;) c = toDisposePhysicsBodies.pop(), destroyBody(c);
  13458. for (; 0 < toDisposeChars.length;) currentChar = toDisposeChars.pop(), currentChar.dispose();
  13459. for (; 0 < clickedChars.length;) currentChar = clickedChars.pop(), currentChar.type === BOMB_TYPE ? currentChar.bombClick() : currentChar.type === FAN_TYPE ?
  13460. currentChar.toggleFan() : currentChar.isGlass ? currentChar.breakGlass() : currentChar.physBody && (awakeAllBodies(), currentChar.removeFromField());
  13461. isGamePaused || (step = DEFAULT_WORLD_STEP * (1.2 < dtScale ? 1.2 : dtScale), space.step(step / 2), space.step(step / 2));
  13462. isPhysicsDebugDraw && debugDraw.draw();
  13463. allHeroesLen = allHeroes.length;
  13464. for (c = allChars.length - 1; 0 <= c; --c) allChars[c].tick();
  13465. interfaceTick();
  13466. updateBonusManager();
  13467. updatePartManager();
  13468. interfaceTick();
  13469. isGameCompleteScreenShow && (MAX_PARTICLES_ON_SCREEN = 30, 0 == animTicker %
  13470. Math.floor(FPS / 6) && createPartExplode(Math.random() * ow, Math.random() * oh, 6, PART_STAR_TYPE, gameCompleteContainer));
  13471. isNeedFpsMeter && 0 == counter % FPS && (fpsText.text = Math.floor(createjs.Ticker.getMeasuredFPS())
  13472. .toString());
  13473. 30 < counter && isNeedCacheSizeUpdate && (isNeedCacheSizeUpdate = !1, isWithCache && allBgContainer.cache(0, 0, ow + 1, oh + 1, 2));
  13474. c = 0;
  13475. 0 < scoreToAdd && (c = Math.round(scoreToAdd / 7), currentLevelScore += c, scoreToAdd -= c, updateScoreLabel(currentLevelScore));
  13476. //onWindowResize(null);
  13477. onGameResize();
  13478. stage.update()
  13479. }
  13480. }
  13481. function trace(c) {
  13482. isLevelEditor && console.log(c)
  13483. }
  13484. var currentBgIndex = 0;
  13485. function showBgByLevelNum(c, a, b) {
  13486. mainBg.currentAnimationFrame = a ? a : allBgIndexes[c]
  13487. };