game-min.js 416 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591
  1. var ns_egret;
  2. (function (d) {
  3. var c = function () {
  4. function b() {
  5. this.isUseCapture = !1
  6. }
  7. b.prototype.addEventListener = function (a, e, b, g, c) {
  8. "undefined" === typeof g && (g = !1);
  9. "undefined" === typeof c && (c = 0);
  10. d.DEBUG && d.DEBUG.ADD_EVENT_LISTENER && d.DEBUG.checkAddEventListener(a, e, b, g, c);
  11. this._eventDataList || (this._eventDataList = []);
  12. for (var k = -1, l = {eventName: a, func: e, thisObj: b, useCapture: g, priority: c}, m = this._eventDataList.length, p = 0; p < m; p++) {
  13. var n = this._eventDataList[p];
  14. if (n.eventName == a && n.func == e && n.thisObj == b && n.useCapture == g)return;
  15. n.priority >= c && -1 == k && (k = p - 1)
  16. }
  17. -1 != k ? this._eventDataList.splice(p - 1, 0, l) : this._eventDataList.unshift(l)
  18. };
  19. b.prototype.removeEventListener = function (a, e, b, d) {
  20. "undefined" === typeof d && (d = !1);
  21. if (this._eventDataList)for (var c = this._eventDataList.length, k = 0; k < c; k++) {
  22. var l = this._eventDataList[k];
  23. if (l.eventName == a && l.func == e && l.thisObj == b && l.useCapture == d) {
  24. this._eventDataList.splice(k, 1);
  25. break
  26. }
  27. }
  28. };
  29. b.prototype.hasEventListener = function (a, e) {
  30. if (!this._eventDataList)return!1;
  31. for (var b = !1, d = this._eventDataList.length,
  32. c = 0; c < d; c++) {
  33. var k = this._eventDataList[c];
  34. k.eventName == a && k.thisObj == e && (b = !0)
  35. }
  36. return b
  37. };
  38. b.prototype.dispatchEvent = function (a) {
  39. for (var e = 0; e < arguments.length - 1; e++);
  40. if (!this._eventDataList)return!1;
  41. for (var b = e = !1, g = this._eventDataList.length, c = 0; c < g; c++)if ((b = this._eventDataList[c]) && b.eventName == a && (!(this instanceof d.DisplayObject) || this.isUseCapture == b.useCapture))b = b.func.apply(b.thisObj, arguments), e = e || b;
  42. return e
  43. };
  44. return b
  45. }();
  46. d.EventDispatcher = c
  47. })(ns_egret || (ns_egret = {}));
  48. var __extends = this.__extends || function (d, c) {
  49. function b() {
  50. this.constructor = d
  51. }
  52. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  53. b.prototype = c.prototype;
  54. d.prototype = new b
  55. };
  56. (function (d) {
  57. var c = function (b) {
  58. function a() {
  59. b.call(this)
  60. }
  61. __extends(a, b);
  62. a.prototype.run = function () {
  63. d.Ticker.getInstance().run();
  64. d.Ticker.getInstance().register(this.renderLoop, this, Number.MAX_VALUE);
  65. d.Ticker.getInstance().register(this.enterFrame, this, Number.MIN_VALUE);
  66. this.touchContext.run()
  67. };
  68. a.prototype.enterFrame = function () {
  69. this.dispatchEvent(a.EVENT_ENTER_FRAME)
  70. };
  71. a.prototype.renderLoop = function () {
  72. var e = this.rendererContext;
  73. e.clearScreen();
  74. this.dispatchEvent(a.EVENT_START_RENDER);
  75. this.stage.updateTransform();
  76. this.stage.draw(e);
  77. this.dispatchEvent(a.EVENT_FINISH_RENDER)
  78. };
  79. a.EVENT_ENTER_FRAME = "enter_frame";
  80. a.EVENT_START_RENDER = "start_render";
  81. a.EVENT_FINISH_RENDER = "finish_render";
  82. return a
  83. }(d.EventDispatcher);
  84. d.MainContext = c
  85. })(ns_egret || (ns_egret = {}));
  86. ns_egret.MainContext.instance = new ns_egret.MainContext;
  87. (function (d) {
  88. var c = function () {
  89. function b() {
  90. this._tick = this._preDrawCount = this._renderPerformanceCost = this._logicPerformanceCost = this._lastFrameTime = this._lastTime = 0
  91. }
  92. b.getInstance = function () {
  93. null == b.instance && (b.instance = new b);
  94. return b.instance
  95. };
  96. b.prototype.run = function () {
  97. d.Ticker.getInstance().register(this.update, this);
  98. null == this._txt && (this._txt = new d.TextField, this._txt.size = 28, d.MainContext.instance.stage.addChild(this._txt));
  99. var a = d.MainContext.instance;
  100. a.addEventListener(d.MainContext.EVENT_ENTER_FRAME,
  101. this.onEnterFrame, this);
  102. a.addEventListener(d.MainContext.EVENT_START_RENDER, this.onStartRender, this);
  103. a.addEventListener(d.MainContext.EVENT_FINISH_RENDER, this.onFinishRender, this)
  104. };
  105. b.prototype.onEnterFrame = function () {
  106. this._lastTime = d.Ticker.now()
  107. };
  108. b.prototype.onStartRender = function () {
  109. var a = d.Ticker.now();
  110. this._logicPerformanceCost = a - this._lastTime;
  111. this._lastTime = a
  112. };
  113. b.prototype.onFinishRender = function () {
  114. var a = d.Ticker.now();
  115. this._renderPerformanceCost = a - this._lastTime;
  116. this._lastTime = a
  117. };
  118. b.prototype.update =
  119. function () {
  120. var a = d.Ticker.now(), e = a - this._lastFrameTime;
  121. this._lastFrameTime = a;
  122. this._tick++;
  123. if (6 == this._tick) {
  124. this._tick = 0;
  125. var a = (this._preDrawCount - 1).toString(), b = d.MainContext.instance.rendererContext.renderCost.toString(), b = Math.ceil(this._logicPerformanceCost).toString() + "," + Math.ceil(this._renderPerformanceCost).toString() + "," + b;
  126. this._txt.text = a + "\n" + b + "\n" + Math.floor(1E3 / e).toString()
  127. }
  128. this._preDrawCount = 0
  129. };
  130. b.prototype.onDrawImage = function () {
  131. this._preDrawCount++
  132. };
  133. return b
  134. }();
  135. d.Profiler = c
  136. })(ns_egret ||
  137. (ns_egret = {}));
  138. __extends = this.__extends || function (d, c) {
  139. function b() {
  140. this.constructor = d
  141. }
  142. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  143. b.prototype = c.prototype;
  144. d.prototype = new b
  145. };
  146. (function (d) {
  147. var c = function (b) {
  148. function a() {
  149. b.apply(this, arguments);
  150. this._timeScale = 1;
  151. this._paused = !1;
  152. this._frameRate = 60
  153. }
  154. __extends(a, b);
  155. a.prototype.run = function () {
  156. this._time = a.now();
  157. a.requestAnimationFrame.call(window, this.enterFrame)
  158. };
  159. a.prototype.enterFrame = function () {
  160. a.requestAnimationFrame.call(window, a.instance.enterFrame);
  161. a.instance.update()
  162. };
  163. a.prototype.update = function () {
  164. if (this._eventDataList && !this._paused) {
  165. for (var e = a.now(), b = this._eventDataList.length, g = 0; g < b; g++) {
  166. var c = this._eventDataList[g];
  167. if (c && "enterFrame" == c.eventName && (!(this instanceof d.DisplayObject) || this.isUseCapture == c.useCapture)) {
  168. var k = e - this._time, k = k * this._timeScale;
  169. c.func.apply(c.thisObj, [k])
  170. }
  171. }
  172. this._time = e
  173. }
  174. };
  175. a.prototype.register = function (a, f, d) {
  176. "undefined" === typeof d && (d = 0);
  177. b.prototype.addEventListener.call(this, "enterFrame", a, f, !1, d)
  178. };
  179. a.prototype.unregister = function (a, f) {
  180. b.prototype.removeEventListener.call(this, "enterFrame", a, f, !1)
  181. };
  182. a.prototype.callLater = function (a, b, d) {
  183. "undefined" === typeof d && (d = 0);
  184. var c = this, k = 0;
  185. this.register(function (l) {
  186. 0 == d ? (c.unregister(arguments.callee, b), a.apply(b)) : (k += l, k >= d && (c.unregister(arguments.callee, b), a.apply(b)))
  187. }, b)
  188. };
  189. a.prototype.setTimeScale = function (a) {
  190. this._timeScale = a
  191. };
  192. a.prototype.getTimeScale = function () {
  193. return this._timeScale
  194. };
  195. a.prototype.pause = function () {
  196. this._paused = !0
  197. };
  198. a.prototype.resume = function () {
  199. this._paused = !1
  200. };
  201. a.prototype.getFrameRate = function () {
  202. return this._frameRate
  203. };
  204. a.getInstance = function () {
  205. null == a.instance && (a.instance = new a);
  206. return a.instance
  207. };
  208. a.now = function () {
  209. return(new Date).getTime()
  210. };
  211. a.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (e) {
  212. return window.setTimeout(e, 1E3 / a.getInstance().getFrameRate())
  213. };
  214. return a
  215. }(d.EventDispatcher);
  216. d.Ticker = c
  217. })(ns_egret || (ns_egret = {}));
  218. __extends = this.__extends || function (d, c) {
  219. function b() {
  220. this.constructor = d
  221. }
  222. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  223. b.prototype = c.prototype;
  224. d.prototype = new b
  225. };
  226. (function (d) {
  227. var c = function (b) {
  228. function a(a, f) {
  229. "undefined" === typeof a && (a = 1E3);
  230. "undefined" === typeof f && (f = -1);
  231. b.call(this);
  232. this._actionInterval = a;
  233. this._totalActionTimes = f
  234. }
  235. __extends(a, b);
  236. a.prototype.start = function () {
  237. this._preTime = d.Ticker.now();
  238. 0 != this._actionTimes && (this._actionTimes = 0);
  239. d.Ticker.getInstance().register(this.onEnterFrame, this)
  240. };
  241. a.prototype.stop = function () {
  242. d.Ticker.getInstance().unregister(this.onEnterFrame, this)
  243. };
  244. a.prototype.onEnterFrame = function () {
  245. var e = d.Ticker.now();
  246. for (this._passTime =
  247. e - this._preTime; this._passTime > this._actionInterval;) {
  248. this._passTime -= this._actionInterval;
  249. this.dispatchEvent(a.ON_TIMER);
  250. this._actionTimes++;
  251. if (-1 != this._actionTimes && this._actionTimes >= this._totalActionTimes) {
  252. this.stop();
  253. break
  254. }
  255. this._preTime = e
  256. }
  257. };
  258. a.ON_TIMER = "onTimer";
  259. return a
  260. }(d.EventDispatcher);
  261. d.Timer = c
  262. })(ns_egret || (ns_egret = {}));
  263. (function (d) {
  264. var c = function () {
  265. function a(a, b, d, c) {
  266. this.x = a;
  267. this.y = b;
  268. this.width = d;
  269. this.height = c
  270. }
  271. a.prototype.initialize = function (a, b, d, c) {
  272. this.x = a;
  273. this.y = b;
  274. this.width = d;
  275. this.height = c;
  276. return this
  277. };
  278. a.prototype.containPoint = function (a, b) {
  279. return this.x <= a && this.x + this.width >= a && this.y <= b && this.y + this.height >= b
  280. };
  281. a.prototype.clone = function () {
  282. return new a(this.x, this.y, this.width, this.height)
  283. };
  284. a.identity = new a(0, 0, 0, 0);
  285. return a
  286. }();
  287. d.Rectangle = c;
  288. c = function () {
  289. function a(a, b, d, c, k, l) {
  290. "undefined" === typeof a &&
  291. (a = 1);
  292. "undefined" === typeof b && (b = 0);
  293. "undefined" === typeof d && (d = 0);
  294. "undefined" === typeof c && (c = 1);
  295. "undefined" === typeof k && (k = 0);
  296. "undefined" === typeof l && (l = 0);
  297. this.a = a;
  298. this.b = b;
  299. this.c = d;
  300. this.d = c;
  301. this.tx = k;
  302. this.ty = l
  303. }
  304. a.prototype.prepend = function (a, b, d, c, k, l) {
  305. var m = this.tx;
  306. if (1 != a || 0 != b || 0 != d || 1 != c) {
  307. var p = this.a, n = this.c;
  308. this.a = p * a + this.b * d;
  309. this.b = p * b + this.b * c;
  310. this.c = n * a + this.d * d;
  311. this.d = n * b + this.d * c
  312. }
  313. this.tx = m * a + this.ty * d + k;
  314. this.ty = m * b + this.ty * c + l;
  315. return this
  316. };
  317. a.prototype.append = function (a, b, d, c, k, l) {
  318. var m =
  319. this.a, p = this.b, n = this.c, q = this.d;
  320. this.a = a * m + b * n;
  321. this.b = a * p + b * q;
  322. this.c = d * m + c * n;
  323. this.d = d * p + c * q;
  324. this.tx = k * m + l * n + this.tx;
  325. this.ty = k * p + l * q + this.ty;
  326. return this
  327. };
  328. a.prototype.prependMatrix = function (a) {
  329. this.prepend(a.a, a.b, a.c, a.d, a.tx, a.ty);
  330. return this
  331. };
  332. a.prototype.appendMatrix = function (a) {
  333. this.append(a.a, a.b, a.c, a.d, a.tx, a.ty);
  334. return this
  335. };
  336. a.prototype.prependTransform = function (e, b, d, c, k, l, m, p, n) {
  337. if (k % 360) {
  338. var q = k * a.DEG_TO_RAD;
  339. k = Math.cos(q);
  340. q = Math.sin(q)
  341. } else k = 1, q = 0;
  342. if (p || n)this.tx -= p, this.ty -= n;
  343. l || m ? (l *=
  344. a.DEG_TO_RAD, m *= a.DEG_TO_RAD, this.prepend(k * d, q * d, -q * c, k * c, 0, 0), this.prepend(Math.cos(m), Math.sin(m), -Math.sin(l), Math.cos(l), e, b)) : this.prepend(k * d, q * d, -q * c, k * c, e, b);
  345. return this
  346. };
  347. a.prototype.appendTransform = function (e, b, d, c, k, l, m, p, n) {
  348. if (k % 360) {
  349. var q = k * a.DEG_TO_RAD;
  350. k = Math.cos(q);
  351. q = Math.sin(q)
  352. } else k = 1, q = 0;
  353. l || m ? (l *= a.DEG_TO_RAD, m *= a.DEG_TO_RAD, this.append(Math.cos(m), Math.sin(m), -Math.sin(l), Math.cos(l), e, b), this.append(k * d, q * d, -q * c, k * c, 0, 0)) : this.append(k * d, q * d, -q * c, k * c, e, b);
  354. if (p || n)this.tx -= p * this.a +
  355. n * this.c, this.ty -= p * this.b + n * this.d;
  356. return this
  357. };
  358. a.prototype.appendTransformFromDisplay = function (a) {
  359. var b, d;
  360. 0 != a.relativeAnchorPointX || 0 != a.relativeAnchorPointY ? (d = a.getBounds(), b = d.width * a.relativeAnchorPointX, d = d.height * a.relativeAnchorPointY) : (b = a.anchorPointX, d = a.anchorPointY);
  361. this.identity();
  362. this.appendTransform(a.x, a.y, a.scaleX, a.scaleY, a.rotation, a.skewX, a.skewY, b, d);
  363. return this
  364. };
  365. a.prototype.rotate = function (a) {
  366. var b = Math.cos(a);
  367. a = Math.sin(a);
  368. var d = this.a, c = this.c, k = this.tx;
  369. this.a = d * b - this.b *
  370. a;
  371. this.b = d * a + this.b * b;
  372. this.c = c * b - this.d * a;
  373. this.d = c * a + this.d * b;
  374. this.tx = k * b - this.ty * a;
  375. this.ty = k * a + this.ty * b;
  376. return this
  377. };
  378. a.prototype.skew = function (e, b) {
  379. e *= a.DEG_TO_RAD;
  380. b *= a.DEG_TO_RAD;
  381. this.append(Math.cos(b), Math.sin(b), -Math.sin(e), Math.cos(e), 0, 0);
  382. return this
  383. };
  384. a.prototype.scale = function (a, b) {
  385. this.a *= a;
  386. this.d *= b;
  387. this.c *= a;
  388. this.b *= b;
  389. this.tx *= a;
  390. this.ty *= b;
  391. return this
  392. };
  393. a.prototype.translate = function (a, b) {
  394. this.tx += a;
  395. this.ty += b;
  396. return this
  397. };
  398. a.prototype.identity = function () {
  399. this.a = this.d = 1;
  400. this.b = this.c =
  401. this.tx = this.ty = 0;
  402. return this
  403. };
  404. a.prototype.invert = function () {
  405. var a = this.a, b = this.b, d = this.c, c = this.d, k = this.tx, l = a * c - b * d;
  406. this.a = c / l;
  407. this.b = -b / l;
  408. this.c = -d / l;
  409. this.d = a / l;
  410. this.tx = (d * this.ty - c * k) / l;
  411. this.ty = -(a * this.ty - b * k) / l;
  412. return this
  413. };
  414. a.prototype.isIdentity = function () {
  415. return 0 == this.tx && 0 == this.ty && 1 == this.a && 0 == this.b && 0 == this.c && 1 == this.d
  416. };
  417. a.prototype.transformPoint = function (a, b, d) {
  418. d = d || {};
  419. d.x = a * this.a + b * this.c + this.tx;
  420. d.y = a * this.b + b * this.d + this.ty;
  421. return d
  422. };
  423. a.prototype.decompose = function (e) {
  424. null ==
  425. e && (e = {});
  426. e.x = this.tx;
  427. e.y = this.ty;
  428. e.scaleX = Math.sqrt(this.a * this.a + this.b * this.b);
  429. e.scaleY = Math.sqrt(this.c * this.c + this.d * this.d);
  430. var b = Math.atan2(-this.c, this.d), d = Math.atan2(this.b, this.a);
  431. b == d ? (e.rotation = d / a.DEG_TO_RAD, 0 > this.a && 0 <= this.d && (e.rotation += 0 >= e.rotation ? 180 : -180), e.skewX = e.skewY = 0) : (e.skewX = b / a.DEG_TO_RAD, e.skewY = d / a.DEG_TO_RAD);
  432. return e
  433. };
  434. a.transformCoords = function (a, f, d) {
  435. var c = new b(0, 0);
  436. c.x = a.a * f + a.c * d + a.tx;
  437. c.y = a.d * d + a.b * f + a.ty;
  438. return c
  439. };
  440. a.identity = new a;
  441. a.DEG_TO_RAD = Math.PI / 180;
  442. return a
  443. }();
  444. d.Matrix2D = c;
  445. var b = function () {
  446. function a(a, b) {
  447. this.x = a;
  448. this.y = b
  449. }
  450. a.identity = new a(0, 0);
  451. return a
  452. }();
  453. d.Point = b
  454. })(ns_egret || (ns_egret = {}));
  455. (function (d) {
  456. var c = function () {
  457. function b() {
  458. }
  459. b.fatal = function (a, e) {
  460. "undefined" === typeof e && (e = null);
  461. d.Logger.traceToConsole("Fatal", a, e);
  462. throw Error(d.Logger.getTraceCode("Fatal", a, e));
  463. };
  464. b.info = function (a, e) {
  465. "undefined" === typeof e && (e = null);
  466. d.Logger.traceToConsole("Info", a, e)
  467. };
  468. b.warning = function (a, e) {
  469. "undefined" === typeof e && (e = null);
  470. d.Logger.traceToConsole("Warning", a, e)
  471. };
  472. b.traceToConsole = function (a, e, b) {
  473. console.log(d.Logger.getTraceCode(a, e, b))
  474. };
  475. b.getTraceCode = function (a, e, b) {
  476. return"[" + a + "]" + e + ":" +
  477. (null == b ? "" : b)
  478. };
  479. return b
  480. }();
  481. d.Logger = c
  482. })(ns_egret || (ns_egret = {}));
  483. (function (d) {
  484. var c = function () {
  485. function b() {
  486. }
  487. b.CENTER = "center";
  488. b.LEFT = "left";
  489. b.RIGHT = "right";
  490. b.TOP = "top";
  491. b.BOTTOM = "bottom";
  492. b.BOTH = "both";
  493. b.HORIZONTAL = "horizontal";
  494. b.VERTICAL = "vertical";
  495. return b
  496. }();
  497. d.Direction = c
  498. })(ns_egret || (ns_egret = {}));
  499. (function (d) {
  500. var c = function () {
  501. function b() {
  502. throw Error("can't create a mixin class");
  503. }
  504. b.prototype.onActivity = function () {
  505. };
  506. b.prototype.onCancel = function () {
  507. };
  508. return b
  509. }();
  510. d.ComponentBase = c;
  511. c = function () {
  512. function b() {
  513. }
  514. b.active = function (a, e) {
  515. var b = e.prototype, d;
  516. for (d in b)null == a[d] ? a[d] = b[d] : console.log("warning", d);
  517. a.onActivity()
  518. };
  519. return b
  520. }();
  521. d.MixIn = c
  522. })(ns_egret || (ns_egret = {}));
  523. __extends = this.__extends || function (d, c) {
  524. function b() {
  525. this.constructor = d
  526. }
  527. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  528. b.prototype = c.prototype;
  529. d.prototype = new b
  530. };
  531. (function (d) {
  532. var c = function () {
  533. function e() {
  534. this._originalDesignHeight = this._originalDesignWidth = this._designHeight = this._designWidth = this._frameHeight = this._frameWidth = null;
  535. this._scaleY = this._scaleX = 1;
  536. this._resolutionPolicy = this._frame = null;
  537. this._frame = document.getElementById(e.canvas_div_name);
  538. this._frameWidth = this._frame.style.width;
  539. this._frameHeight = this._frame.style.height;
  540. var a = document.getElementById(e.canvas_name), b = a.width, a = a.height;
  541. this._designWidth = b;
  542. this._designHeight = a;
  543. this._originalDesignWidth =
  544. b;
  545. this._originalDesignHeight = a
  546. }
  547. e.getInstance = function () {
  548. null == e.instance && (a.initialize(), f.initialize(), e.instance = new e);
  549. return e.instance
  550. };
  551. e.prototype.setFrameSize = function (a, e) {
  552. this._frameWidth = a;
  553. this._frameHeight = e;
  554. this._frame.style.width = a + "px";
  555. this._frame.style.height = e + "px";
  556. this._resizeEvent()
  557. };
  558. e.prototype._resizeEvent = function () {
  559. var a = this._originalDesignWidth, e = this._originalDesignHeight;
  560. 0 < a && this.setDesignSize(a, e, this._resolutionPolicy)
  561. };
  562. e.prototype.setDesignSize = function (a, e, b) {
  563. isNaN(a) ||
  564. 0 == a || isNaN(e) || 0 == e ? d.Logger.info("Resolution Error") : (this.setResolutionPolicy(b), this._designWidth = a, this._designHeight = e, this._originalDesignWidth = a, this._originalDesignHeight = e, this._resolutionPolicy.apply(this, this._designWidth, this._designHeight), d.MainContext.instance.stage.stageWidth = this._designWidth, d.MainContext.instance.stage.stageHeight = this._designHeight)
  565. };
  566. e.prototype.setResolutionPolicy = function (e) {
  567. if (e instanceof b)this._resolutionPolicy = e; else switch (e) {
  568. case b.FIXED_HEIGHT:
  569. this._resolutionPolicy =
  570. new b(a.EQUAL_TO_FRAME, f.FIXED_HEIGHT);
  571. break;
  572. case b.FIXED_WIDTH:
  573. this._resolutionPolicy = new b(a.EQUAL_TO_FRAME, f.FIXED_WIDTH)
  574. }
  575. null != this._resolutionPolicy ? this._resolutionPolicy.init(this) : d.Logger.fatal("\u9700\u8981\u5148\u8bbe\u7f6eresolutionPolicy")
  576. };
  577. e.prototype.getScaleX = function () {
  578. return this._scaleX
  579. };
  580. e.prototype.getScaleY = function () {
  581. return this._scaleY
  582. };
  583. e.canvas_name = "gameCanvas";
  584. e.canvas_div_name = "gameDiv";
  585. return e
  586. }();
  587. d.StageDelegate = c;
  588. var b = function () {
  589. function e(a, b) {
  590. this._contentStrategy =
  591. this._containerStrategy = null;
  592. this.setContainerStrategy(a);
  593. this.setContentStrategy(b)
  594. }
  595. e.prototype.init = function (a) {
  596. this._containerStrategy.init(a);
  597. this._contentStrategy.init(a)
  598. };
  599. e.prototype.apply = function (a, e, b) {
  600. this._containerStrategy.apply(a, e, b);
  601. return this._contentStrategy.apply(a, e, b)
  602. };
  603. e.prototype.setContainerStrategy = function (e) {
  604. e instanceof a && (this._containerStrategy = e)
  605. };
  606. e.prototype.setContentStrategy = function (a) {
  607. a instanceof f && (this._contentStrategy = a)
  608. };
  609. e.FIXED_HEIGHT = 1;
  610. e.FIXED_WIDTH = 2;
  611. return e
  612. }();
  613. d.ResolutionPolicy = b;
  614. var a = function () {
  615. function a() {
  616. }
  617. a.initialize = function () {
  618. a.EQUAL_TO_FRAME = new e
  619. };
  620. a.prototype.init = function (a) {
  621. };
  622. a.prototype.apply = function (a, e, b) {
  623. };
  624. a.prototype._setupContainer = function (a, e, b) {
  625. document.getElementById(c.canvas_name);
  626. document.getElementById(c.canvas_div_name);
  627. a = document.body;
  628. var d;
  629. if (a && (d = a.style))d.paddingTop = d.paddingTop || "0px", d.paddingRight = d.paddingRight || "0px", d.paddingBottom = d.paddingBottom || "0px", d.paddingLeft = d.paddingLeft || "0px", d.borderTop = d.borderTop ||
  630. "0px", d.borderRight = d.borderRight || "0px", d.borderBottom = d.borderBottom || "0px", d.borderLeft = d.borderLeft || "0px", d.marginTop = d.marginTop || "0px", d.marginRight = d.marginRight || "0px", d.marginBottom = d.marginBottom || "0px", d.marginLeft = d.marginLeft || "0px"
  631. };
  632. a.prototype._fixContainer = function () {
  633. document.body.insertBefore(document.getElementById(c.canvas_div_name), document.body.firstChild);
  634. var a = document.body.style;
  635. a.width = window.innerWidth + "px";
  636. a.height = window.innerHeight + "px";
  637. a.overflow = "hidden";
  638. a = document.getElementById(c.canvas_div_name).style;
  639. a.position = "fixed";
  640. a.left = a.top = "0px";
  641. document.body.scrollTop = 0
  642. };
  643. a.EQUAL_TO_FRAME = null;
  644. return a
  645. }();
  646. d.ContainerStrategy = a;
  647. var e = function (a) {
  648. function e() {
  649. a.apply(this, arguments)
  650. }
  651. __extends(e, a);
  652. e.prototype.apply = function (a) {
  653. this._setupContainer(a._frame, a._frameWidth, a._frameHeight)
  654. };
  655. return e
  656. }(a);
  657. d.EqualToFrame = e;
  658. var f = function () {
  659. function a() {
  660. this._result = {scale: [1, 1], x: null, y: null, w: null, h: null}
  661. }
  662. a.initialize = function () {
  663. a.FIXED_HEIGHT = new g;
  664. a.FIXED_WIDTH = new h
  665. };
  666. a.prototype.init = function (a) {
  667. };
  668. a.prototype.apply =
  669. function (a, e, b) {
  670. return{scale: [1, 1]}
  671. };
  672. a.FIXED_HEIGHT = null;
  673. a.FIXED_WIDTH = null;
  674. return a
  675. }();
  676. d.ContentStrategy = f;
  677. var g = function (a) {
  678. function e() {
  679. a.apply(this, arguments)
  680. }
  681. __extends(e, a);
  682. e.prototype.apply = function (a, e, b) {
  683. var d = document.getElementById(c.canvas_name), f = document.getElementById(c.canvas_div_name), g = d.height / b, h = window.innerHeight, g = h / b, k = e * g;
  684. d.width = e;
  685. d.height = b;
  686. d.style.width = k + "px";
  687. d.style.height = h + "px";
  688. f.style.width = k + "px";
  689. f.style.height = h + "px";
  690. a._scaleX = g;
  691. a._scaleY = g
  692. };
  693. return e
  694. }(f);
  695. d.FixedHeight =
  696. g;
  697. var h = function (a) {
  698. function e() {
  699. a.apply(this, arguments)
  700. }
  701. __extends(e, a);
  702. e.prototype.apply = function (a, e, b) {
  703. b = document.getElementById(c.canvas_name);
  704. var d = document.getElementById(c.canvas_div_name), f = document.documentElement.clientWidth, g = document.documentElement.clientHeight, h = f / e;
  705. b.width = e;
  706. b.height = g / h;
  707. b.style.width = f + "px";
  708. b.style.height = g + "px";
  709. d.style.width = f + "px";
  710. d.style.height = g + "px";
  711. a._scaleX = h;
  712. a._scaleY = h
  713. };
  714. return e
  715. }(f);
  716. d.FixedWidth = h;
  717. var k = function (a) {
  718. function e(a, b) {
  719. this.width = a;
  720. this.height =
  721. b
  722. }
  723. __extends(e, a);
  724. e.prototype.apply = function (a, e, b) {
  725. b = document.getElementById(c.canvas_name);
  726. var d = document.getElementById(c.canvas_div_name), f = this.width, g = this.height, h = f / e;
  727. b.width = e;
  728. b.height = g / h;
  729. b.style.width = f + "px";
  730. b.style.height = g + "px";
  731. d.style.width = f + "px";
  732. d.style.height = g + "px";
  733. a._scaleX = h;
  734. a._scaleY = h
  735. };
  736. return e
  737. }(f);
  738. d.FixedSize = k
  739. })(ns_egret || (ns_egret = {}));
  740. __extends = this.__extends || function (d, c) {
  741. function b() {
  742. this.constructor = d
  743. }
  744. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  745. b.prototype = c.prototype;
  746. d.prototype = new b
  747. };
  748. (function (d) {
  749. var c = function (a) {
  750. function e() {
  751. a.call(this);
  752. this.parent = null;
  753. this.scaleY = this.scaleX = 1;
  754. this.rotation = this.relativeAnchorPointY = this.relativeAnchorPointX = this.anchorPointY = this.anchorPointX = 0;
  755. this.alpha = 1;
  756. this.skewY = this.skewX = 0;
  757. this._isRunning = !1;
  758. this.x = this.y = 0;
  759. this.visible = !0;
  760. this.worldTransform = new d.Matrix2D;
  761. this.worldAlpha = 1
  762. }
  763. __extends(e, a);
  764. e.prototype.draw = function (a) {
  765. this.visible && !unstable.cache_api.draw.call(this, a) && (a.setAlpha(this.worldAlpha, this.blendMode), a.setTransform(this.worldTransform),
  766. this.mask && (a.save(), a.clip(this.mask.x, this.mask.y, this.mask.width, this.mask.height)), this.render(a), this.mask && a.restore())
  767. };
  768. e.prototype.updateTransform = function () {
  769. this.worldTransform.identity();
  770. this.worldTransform = this.worldTransform.appendMatrix(this.parent.worldTransform);
  771. var a, e;
  772. 0 != this.relativeAnchorPointX || 0 != this.relativeAnchorPointY ? (e = this.getBounds(), a = e.width * this.relativeAnchorPointX, e = e.height * this.relativeAnchorPointY) : (a = this.anchorPointX, e = this.anchorPointY);
  773. this.worldTransform.appendTransform(this.x,
  774. this.y, this.scaleX, this.scaleY, this.rotation, this.skewX, this.skewY, a, e);
  775. this.worldAlpha = this.parent.worldAlpha * this.alpha
  776. };
  777. e.prototype.render = function (a) {
  778. };
  779. e.prototype.ignoreRender = function () {
  780. var a = e.getTransformBounds(this.getBounds(), this.worldTransform);
  781. return 0 >= a.x + a.width || a.x >= d.MainContext.instance.stage.stageWidth || 0 >= a.y + a.height || a.y >= d.MainContext.instance.stage.stageHeight ? !0 : !1
  782. };
  783. e.prototype.getBounds = function () {
  784. if (void 0 !== this._contentWidth) {
  785. var a, e;
  786. 0 != this.relativeAnchorPointX || 0 !=
  787. this.relativeAnchorPointY ? (a = this._contentWidth * this.relativeAnchorPointX, e = this._contentHeight * this.relativeAnchorPointY) : (a = this.anchorPointX, e = this.anchorPointY);
  788. return d.Rectangle.identity.initialize(-a, -e, this._contentWidth, this._contentHeight)
  789. }
  790. return this._measureBounds()
  791. };
  792. e.prototype.setContentSize = function (a, e) {
  793. this._contentWidth = a;
  794. this._contentHeight = e
  795. };
  796. e.prototype.getConcatenatedMatrix = function () {
  797. for (var a = d.Matrix2D.identity.identity(), e = this; null != e;) {
  798. if (0 != e.relativeAnchorPointX || 0 !=
  799. e.relativeAnchorPointY) {
  800. var b = e.getBounds();
  801. a.prependTransform(e.x, e.y, e.scaleX, e.scaleY, e.rotation, e.skewX, e.skewY, b.width * e.relativeAnchorPointX, b.height * e.relativeAnchorPointY)
  802. } else a.prependTransform(e.x, e.y, e.scaleX, e.scaleY, e.rotation, e.skewX, e.skewY, e.anchorPointX, e.anchorPointY);
  803. e = e.parent
  804. }
  805. return a
  806. };
  807. e.prototype.localToGlobal = function (a, e) {
  808. "undefined" === typeof a && (a = 0);
  809. "undefined" === typeof e && (e = 0);
  810. var b = this.getConcatenatedMatrix();
  811. b.append(1, 0, 0, 1, a, e);
  812. var c = d.Point.identity;
  813. c.x = b.tx;
  814. c.y =
  815. b.ty;
  816. return c
  817. };
  818. e.prototype.globalToLocal = function (a, e) {
  819. "undefined" === typeof a && (a = 0);
  820. "undefined" === typeof e && (e = 0);
  821. var b = this.getConcatenatedMatrix();
  822. b.invert();
  823. b.append(1, 0, 0, 1, a, e);
  824. var c = d.Point.identity;
  825. c.x = b.tx;
  826. c.y = b.ty;
  827. return c
  828. };
  829. e.prototype.hitTest = function (a, e, b) {
  830. "undefined" === typeof b && (b = !1);
  831. if (!this.visible || !b && !this.touchEnabled)return null;
  832. b = this.getBounds();
  833. return 0 < a && a < b.width && 0 < e && e < b.height ? this.mask ? this.mask.x < a && a < this.mask.x + this.mask.width && this.mask.y < e && e < this.mask.y + this.mask.height ?
  834. this : null : this : null
  835. };
  836. e.prototype.getMatrix = function () {
  837. return d.Matrix2D.identity.identity().appendTransformFromDisplay(this)
  838. };
  839. e.prototype._measureBounds = function () {
  840. d.Logger.fatal("\u5b50\u7c7b\u9700\u8981\u5b9e\u73b0\u7684\u65b9\u6cd5");
  841. return d.Rectangle.identity
  842. };
  843. e.prototype.setAnchorPoint = function (a, e) {
  844. this.anchorPointX = a;
  845. this.anchorPointY = e
  846. };
  847. e.prototype.setRelativeAnchorPoint = function (a, e) {
  848. 0 > a || 1 < a || 0 > e || 1 < e ? d.Logger.warning("\u76f8\u5bf9\u951a\u70b9\u53ea\u63a5\u53d70-1\u4e4b\u95f4\u7684\u503c") :
  849. (this.relativeAnchorPointX = a, this.relativeAnchorPointY = e)
  850. };
  851. e.prototype.getOffsetPoint = function () {
  852. var a = this.anchorPointX, e = this.anchorPointY;
  853. if (0 != this.relativeAnchorPointX || 0 != this.relativeAnchorPointY)e = this.getBounds(), a = this.relativeAnchorPointX * e.width, e = this.relativeAnchorPointY * e.height;
  854. var b = d.Point.identity;
  855. b.x = a;
  856. b.y = e;
  857. return b
  858. };
  859. e.prototype.removeFromParent = function () {
  860. this && this.parent && this.parent.removeChild(this)
  861. };
  862. e.prototype._onAddToStage = function () {
  863. this._isRunning = !0;
  864. this.dispatchEvent(b.ADD_TO_STAGE)
  865. };
  866. e.prototype._onRemoveFromStage = function () {
  867. this._isRunning = !1;
  868. this.dispatchEvent(b.REMOVE_FROM_STAGE)
  869. };
  870. e.prototype.isRunning = function () {
  871. return this._isRunning
  872. };
  873. e.getTransformBounds = function (a, e) {
  874. var b = a.x, d = a.y, c = a.width, m = a.height, p = c * e.a, c = c * e.b, n = m * e.c, m = m * e.d, q = e.tx, s = e.ty, x = q, A = q, B = s, D = s;
  875. (b = p + q) < x ? x = b : b > A && (A = b);
  876. (b = p + n + q) < x ? x = b : b > A && (A = b);
  877. (b = n + q) < x ? x = b : b > A && (A = b);
  878. (d = c + s) < B ? B = d : d > D && (D = d);
  879. (d = c + m + s) < B ? B = d : d > D && (D = d);
  880. (d = m + s) < B ? B = d : d > D && (D = d);
  881. return a.initialize(x, B, A - x, D - B)
  882. };
  883. return e
  884. }(d.EventDispatcher);
  885. d.DisplayObject = c;
  886. var b = function () {
  887. function a() {
  888. }
  889. a.ADD_TO_STAGE = "addToStage";
  890. a.REMOVE_FROM_STAGE = "removeFromStage";
  891. return a
  892. }();
  893. d.DisplayListEvent = b
  894. })(ns_egret || (ns_egret = {}));
  895. var unstable = unstable || {};
  896. unstable.cache_api = {};
  897. unstable.cache_api.cacheAsBitmap = function (d) {
  898. d && (d = new ns_egret.RenderTexture, d.drawToTexture(this), this.renderTexture = d)
  899. };
  900. unstable.cache_api.draw = function (d) {
  901. if (this.renderTexture) {
  902. var c = this.renderTexture, b = c.offsetX, a = c.offsetY, e = c.getTextureWidth(), c = c.getTextureHeight();
  903. this.updateTransform();
  904. d.setAlpha(this.worldAlpha, this.blendMode);
  905. d.setTransform(this.worldTransform);
  906. this.mask && (d.save(), d.clip(this.mask.x, this.mask.y, this.mask.width, this.mask.height));
  907. d.drawImage(this.renderTexture, 0, 0, e, c, b, a, e / ns_egret.MainContext.instance.rendererContext.texture_scale_factor, c / ns_egret.MainContext.instance.rendererContext.texture_scale_factor);
  908. this.mask && d.restore();
  909. return!0
  910. }
  911. return!1
  912. };
  913. ns_egret.DisplayObject.prototype.cacheAsBitmap = unstable.cache_api.cacheAsBitmap;
  914. __extends = this.__extends || function (d, c) {
  915. function b() {
  916. this.constructor = d
  917. }
  918. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  919. b.prototype = c.prototype;
  920. d.prototype = new b
  921. };
  922. (function (d) {
  923. var c = function (b) {
  924. function a() {
  925. this._children = [];
  926. this.numChildren = 0;
  927. b.call(this)
  928. }
  929. __extends(a, b);
  930. a.prototype.setChildIndex = function (a, b) {
  931. var c = this._children.indexOf(a);
  932. 0 > c && d.Logger.fatal("child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185");
  933. this._children.splice(c, 1);
  934. 0 > b || this._children.length <= b ? this._children.push(a) : this._children.splice(b, 0, a)
  935. };
  936. a.prototype.addChild = function (a, b) {
  937. "undefined" === typeof b && (b = -1);
  938. null != a.parent ? d.Logger.fatal("child\u5df2\u7ecf\u88ab\u6dfb\u52a0\u5230\u663e\u793a\u5217\u8868") :
  939. this._children.length < b && d.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  940. -1 == b ? this._children.push(a) : 0 <= b ? this._children.splice(b, 0, a) : d.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  941. a.parent = this;
  942. this.isRunning() && a._onAddToStage();
  943. this.numChildren++
  944. };
  945. a.prototype.removeChild = function (a) {
  946. a = this._children.indexOf(a);
  947. 0 <= a ? this.removeChildAt(a) : d.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent")
  948. };
  949. a.prototype.removeChildAt = function (a) {
  950. var b =
  951. this._children;
  952. 0 <= a && a < b.length ? (a = b.splice(a, 1)[0], a.parent = null, this.isRunning() && a._onRemoveFromStage(), this.numChildren--) : d.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent")
  953. };
  954. a.prototype.getChildAt = function (a) {
  955. return this._children[a]
  956. };
  957. a.prototype.getChildByName = function (a) {
  958. return null
  959. };
  960. a.prototype.getChildIndex = function (a) {
  961. return this._children.indexOf(a)
  962. };
  963. a.prototype.removeAllChildren = function () {
  964. for (var a = this._children; 0 < a.length;) {
  965. var b = a.pop();
  966. b.parent = null;
  967. this.isRunning() && b._onRemoveFromStage()
  968. }
  969. this.numChildren =
  970. 0
  971. };
  972. a.prototype.updateTransform = function () {
  973. if (this.visible) {
  974. b.prototype.updateTransform.call(this);
  975. for (var a = 0, d = this._children.length; a < d; a++)this._children[a].updateTransform()
  976. }
  977. };
  978. a.prototype.render = function (a) {
  979. if (this.visible)for (var b = 0, d = this._children.length; b < d; b++)this._children[b].draw(a)
  980. };
  981. a.prototype._measureBounds = function () {
  982. for (var a = 0, b = 0, c = 0, h = 0, k = this._children.length, l = 0; l < k; l++) {
  983. var m = this._children[l], p;
  984. if (m.visible && (p = d.DisplayObject.getTransformBounds(m.getBounds(), m.getMatrix()))) {
  985. var m =
  986. p.x, n = p.y, q = p.width + p.x, s = p.height + p.y;
  987. if (m < a || 0 == l)a = m;
  988. if (q > b || 0 == l)b = q;
  989. if (n < c || 0 == l)c = n;
  990. if (s > h || 0 == l)h = s
  991. }
  992. }
  993. return d.Rectangle.identity.initialize(a, c, b - a, h - c)
  994. };
  995. a.prototype.hitTest = function (a, b) {
  996. var c;
  997. if (!this.visible || this.mask && (this.mask.x > a || a > this.mask.x + this.mask.width || this.mask.y > b || b > this.mask.y + this.mask.height))return null;
  998. for (var h = this._children, k = h.length - 1; 0 <= k; k--) {
  999. var l = h[k], m = l, p = m.getOffsetPoint(), m = d.Matrix2D.identity.identity().prependTransform(m.x, m.y, m.scaleX, m.scaleY, m.rotation,
  1000. 0, 0, p.x, p.y);
  1001. m.invert();
  1002. m = d.Matrix2D.transformCoords(m, a, b);
  1003. if (l = l.hitTest(m.x, m.y, !0)) {
  1004. if (l.touchEnabled)return l;
  1005. if (this.touchEnabled)return this;
  1006. null == c && (c = l)
  1007. }
  1008. }
  1009. return c
  1010. };
  1011. a.prototype._onAddToStage = function () {
  1012. b.prototype._onAddToStage.call(this);
  1013. for (var a = 0; a < this.numChildren; a++)this._children[a]._onAddToStage()
  1014. };
  1015. a.prototype._onRemoveFromStage = function () {
  1016. b.prototype._onRemoveFromStage.call(this);
  1017. for (var a = 0; a < this.numChildren; a++)this._children[a]._onRemoveFromStage()
  1018. };
  1019. return a
  1020. }(d.DisplayObject);
  1021. d.DisplayObjectContainer = c
  1022. })(ns_egret || (ns_egret = {}));
  1023. unstable = unstable || {};
  1024. unstable.modal_api = {};
  1025. unstable.modal_api.setModal = function (d) {
  1026. void 0 == d && (d = !0);
  1027. this.touchEnabled = this._modal = d
  1028. };
  1029. var hitTest = ns_egret.DisplayObjectContainer.prototype.hitTest;
  1030. ns_egret.DisplayObjectContainer.prototype.hitTest = function (d, c) {
  1031. if (!1 == this.visible)return null;
  1032. var b = hitTest.call(this, d, c);
  1033. return this._modal ? b ? b : this : b
  1034. };
  1035. ns_egret.DisplayObjectContainer.prototype.setModal = unstable.modal_api.setModal;
  1036. __extends = this.__extends || function (d, c) {
  1037. function b() {
  1038. this.constructor = d
  1039. }
  1040. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  1041. b.prototype = c.prototype;
  1042. d.prototype = new b
  1043. };
  1044. (function (d) {
  1045. var c = function (b) {
  1046. function a() {
  1047. b.call(this);
  1048. this._isRunning = this.touchEnabled = !0;
  1049. var a = document.getElementById(d.StageDelegate.canvas_name);
  1050. this.stageWidth = a.width;
  1051. this.stageHeight = a.height
  1052. }
  1053. __extends(a, b);
  1054. a.prototype.hitTest = function (a, b) {
  1055. if (!this.touchEnabled)return null;
  1056. var c;
  1057. if (!this.visible)return this;
  1058. for (var h = this._children, k = h.length - 1; 0 <= k; k--) {
  1059. var l = c = h[k], m = l.getOffsetPoint(), l = d.Matrix2D.identity.identity().prependTransform(l.x, l.y, l.scaleX, l.scaleY, l.rotation, 0, 0, m.x, m.y);
  1060. l.invert();
  1061. l = d.Matrix2D.transformCoords(l, a, b);
  1062. if ((c = c.hitTest(l.x, l.y, !0)) && c.touchEnabled)return c
  1063. }
  1064. return this
  1065. };
  1066. a.prototype.getBounds = function () {
  1067. return d.Rectangle.identity.initialize(0, 0, 1E5, 1E5)
  1068. };
  1069. a.prototype.updateTransform = function () {
  1070. for (var a = 0, b = this._children.length; a < b; a++)this._children[a].updateTransform()
  1071. };
  1072. return a
  1073. }(d.DisplayObjectContainer);
  1074. d.Stage = c
  1075. })(ns_egret || (ns_egret = {}));
  1076. __extends = this.__extends || function (d, c) {
  1077. function b() {
  1078. this.constructor = d
  1079. }
  1080. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  1081. b.prototype = c.prototype;
  1082. d.prototype = new b
  1083. };
  1084. (function (d) {
  1085. var c = function (b) {
  1086. function a() {
  1087. b.call(this);
  1088. this.debug = !1;
  1089. this.debugColor = "#ff0000"
  1090. }
  1091. __extends(a, b);
  1092. a.initWithTexture = function (e) {
  1093. if (null == e)throw Error("texture \u53d6\u4e0d\u5230 ");
  1094. var b = new a;
  1095. b.texture = e;
  1096. return b
  1097. };
  1098. a.prototype.render = function (e) {
  1099. if (!b.prototype.ignoreRender.call(this)) {
  1100. var d = this.texture;
  1101. if (!(null == d || null == d._bitmapData)) {
  1102. var c, h, k, l;
  1103. this.spriteFrame ? (l = this.spriteFrame, c = l.x, h = l.y, k = l.w, l = l.h) : (h = c = 0, k = d.getTextureWidth(), l = d.getTextureHeight());
  1104. e.drawImage(d, c, h,
  1105. k, l, 0, 0, k, l);
  1106. (a.debug || this.debug) && e.strokeRect(c, h, k, l, this.debugColor)
  1107. }
  1108. }
  1109. };
  1110. a.prototype._measureBounds = function () {
  1111. var a = this.spriteFrame, b, c;
  1112. a ? (b = a.w, c = a.h) : this.texture ? (b = this.texture.getTextureWidth(), c = this.texture.getTextureHeight()) : d.Logger.fatal("\u83b7\u53d6BitmapBounds\u5931\u8d25");
  1113. var h;
  1114. 0 != this.relativeAnchorPointX || 0 != this.relativeAnchorPointY ? (a = b * this.relativeAnchorPointX, h = c * this.relativeAnchorPointY) : (a = this.anchorPointX, h = this.anchorPointY);
  1115. return d.Rectangle.identity.initialize(-a,
  1116. -h, b, c)
  1117. };
  1118. a.debug = !1;
  1119. return a
  1120. }(d.DisplayObject);
  1121. d.Bitmap = c
  1122. })(ns_egret || (ns_egret = {}));
  1123. __extends = this.__extends || function (d, c) {
  1124. function b() {
  1125. this.constructor = d
  1126. }
  1127. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  1128. b.prototype = c.prototype;
  1129. d.prototype = new b
  1130. };
  1131. (function (d) {
  1132. var c = function (b) {
  1133. function a() {
  1134. b.call(this);
  1135. this.text = ""
  1136. }
  1137. __extends(a, b);
  1138. a.prototype.render = function (a) {
  1139. this.text && (this.text = this.text.toString(), this._renderText(a))
  1140. };
  1141. a.prototype._renderText = function (a, b) {
  1142. "undefined" === typeof b && (b = !1);
  1143. for (var c = this._contentHeight = this._contentWidth = 0, h = this.text.length; c < h; c++) {
  1144. var k = this.text.charAt(c), l = this.bitmapFontData[k];
  1145. null == l && d.Logger.fatal("BitmapText\uff1a\u5f02\u5e38\u7684bitmapFontData: ", k);
  1146. var k = l.offX, m = l.offY, p = l.w;
  1147. b || (a.drawImage(this.texture,
  1148. l.x, l.y, l.w, l.h, k, m, l.w, l.h), a.translate(p, 0));
  1149. this._contentWidth += p + k;
  1150. m + l.h > this._contentHeight && (this._contentHeight = m + l.h)
  1151. }
  1152. };
  1153. a.prototype.getBounds = function () {
  1154. this._renderText(d.MainContext.instance.rendererContext, !0);
  1155. var a, b;
  1156. 0 != this.relativeAnchorPointX || 0 != this.relativeAnchorPointY ? (a = this._contentWidth * this.relativeAnchorPointX, b = this._contentHeight * this.relativeAnchorPointY) : (a = this.anchorPointX, b = this.anchorPointY);
  1157. return d.Rectangle.identity.initialize(-a, -b, this._contentWidth, this._contentHeight)
  1158. };
  1159. return a
  1160. }(d.DisplayObject);
  1161. d.BitmapText = c
  1162. })(ns_egret || (ns_egret = {}));
  1163. __extends = this.__extends || function (d, c) {
  1164. function b() {
  1165. this.constructor = d
  1166. }
  1167. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  1168. b.prototype = c.prototype;
  1169. d.prototype = new b
  1170. };
  1171. (function (d) {
  1172. var c = function (b) {
  1173. function a() {
  1174. b.apply(this, arguments)
  1175. }
  1176. __extends(a, b);
  1177. a.prototype.hitTest = function (a, d) {
  1178. return b.prototype.hitTest.call(this, a, d)
  1179. };
  1180. return a
  1181. }(d.DisplayObject);
  1182. d.Shape = c;
  1183. c = function (b) {
  1184. function a() {
  1185. this._color = 16777215;
  1186. this._colorDirty = !0;
  1187. b.call(this)
  1188. }
  1189. __extends(a, b);
  1190. Object.defineProperty(a.prototype, "color", {get: function () {
  1191. return this._color
  1192. }, set: function (a) {
  1193. this._colorDirty = !0;
  1194. this._color = a
  1195. }, enumerable: !0, configurable: !0});
  1196. Object.defineProperty(a.prototype, "alpha", {get: function () {
  1197. return this._alpha
  1198. },
  1199. set: function (a) {
  1200. this._colorDirty = !0;
  1201. this._alpha = a
  1202. }, enumerable: !0, configurable: !0});
  1203. a.prototype.render = function (a) {
  1204. if (this._colorDirty) {
  1205. var b = this._color;
  1206. this._colorBlue = b & 255;
  1207. this._colorGreen = (b & 65280) >> 8;
  1208. this._colorRed = b >> 16;
  1209. this._colorStr = "rgba(" + this._colorRed + "," + this._colorGreen + "," + this._colorBlue + "," + this._alpha + ")";
  1210. this._colorDirty = !1
  1211. }
  1212. a = a.canvas.getContext("2d");
  1213. a.fillStyle = this._colorStr;
  1214. a.fillRect(0, 0, this._contentWidth, this._contentHeight)
  1215. };
  1216. return a
  1217. }(d.Shape);
  1218. d.ShapeRect = c
  1219. })(ns_egret ||
  1220. (ns_egret = {}));
  1221. __extends = this.__extends || function (d, c) {
  1222. function b() {
  1223. this.constructor = d
  1224. }
  1225. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  1226. b.prototype = c.prototype;
  1227. d.prototype = new b
  1228. };
  1229. (function (d) {
  1230. var c = function (b) {
  1231. function a() {
  1232. b.call(this);
  1233. this.font = "Arial";
  1234. this.size = 30;
  1235. this.textColor = "#ffffff";
  1236. this.strokeColor = "#000000";
  1237. this.stroke = 0;
  1238. this.__hackIgnoreDrawText = !1;
  1239. this.hSpacing = this.vSpacing = 0;
  1240. this.textAlign = "left"
  1241. }
  1242. __extends(a, b);
  1243. a.prototype.render = function (a) {
  1244. this.text && (a.setupFont(this.size + "px " + this.font, this.textAlign, this.textBaseline), this.drawText(a))
  1245. };
  1246. a.prototype.getBounds = function () {
  1247. var a = d.MainContext.instance.rendererContext;
  1248. a.setupFont(this.size + "px " + this.font, this.textAlign,
  1249. this.textBaseline);
  1250. this.drawText(a, !0);
  1251. var b;
  1252. 0 != this.relativeAnchorPointX || 0 != this.relativeAnchorPointY ? (a = this._contentWidth * this.relativeAnchorPointX, b = this._contentHeight * this.relativeAnchorPointY) : (a = this.anchorPointX, b = this.anchorPointY);
  1253. return d.Rectangle.identity.initialize(-a, -b, this._contentWidth, this._contentHeight)
  1254. };
  1255. a.prototype.drawText = function (a, d) {
  1256. "undefined" === typeof d && (d = !1);
  1257. d && (this.__hackIgnoreDrawText = !0);
  1258. var c = 0, h = String(this.text).split(/(?:\r\n|\r|\n)/), k = 0, l = this.size + this.vSpacing,
  1259. m = 0;
  1260. if (null == this.lineWidth || 0 == this.lineWidth) {
  1261. for (var m = h.length, p = 0, n = m; p < n; p++) {
  1262. var q = h[p], s = a.measureText(q);
  1263. s.width > c && (c = s.width)
  1264. }
  1265. p = 0;
  1266. for (n = m; p < n; p++)q = h[p], this._drawTextLine(a, q, k, c), k += l
  1267. } else {
  1268. c = this.lineWidth;
  1269. p = 0;
  1270. for (n = h.length; p < n; p++) {
  1271. q = h[p];
  1272. s = a.measureText(q);
  1273. if (s.width > this.lineWidth)for (var s = q, x = 0, q = "", A = 0; A < s.length; A++) {
  1274. var B = a.measureText(s[A]).width;
  1275. x + B > this.lineWidth ? 0 == x ? (x += B, q += s[A], c = B) : (this._drawTextLine(a, q, k, c), m++, A--, q = "", x = 0, k += l) : (x += B, q += s[A])
  1276. }
  1277. this._drawTextLine(a,
  1278. q, k, c);
  1279. m++;
  1280. k += l
  1281. }
  1282. }
  1283. d && (b.prototype.setContentSize.call(this, c, m * l), this.__hackIgnoreDrawText = !1);
  1284. return null
  1285. };
  1286. a.prototype.setContentSize = function (a, d) {
  1287. b.prototype.setContentSize.call(this, a, d);
  1288. this.lineWidth = a
  1289. };
  1290. a.prototype._drawTextLine = function (a, b, d, c) {
  1291. this.__hackIgnoreDrawText || a.drawText(this, b, "left" == this.textAlign ? 0 : "center" == this.textAlign ? c / 2 : c, d, c)
  1292. };
  1293. return a
  1294. }(d.DisplayObject);
  1295. d.TextField = c
  1296. })(ns_egret || (ns_egret = {}));
  1297. (function (d) {
  1298. var c = function () {
  1299. function a(a) {
  1300. this.frames = a.frames
  1301. }
  1302. a.prototype.getFrame = function (a) {
  1303. var b = this.frames[a];
  1304. null == b && d.Logger.fatal("\u6ca1\u6709\u627e\u5230\u76f8\u5e94\u7684frame\uff1a", a);
  1305. return b
  1306. };
  1307. a.parseFromDragonBones = function (e) {
  1308. var d = new a(e);
  1309. d.frames = {};
  1310. e = e.SubTexture;
  1311. for (var c in e) {
  1312. var h = e[c], k = new b;
  1313. k.w = h.width;
  1314. k.h = h.height;
  1315. k.x = h.x;
  1316. k.y = h.y;
  1317. d.frames[h.name] = k
  1318. }
  1319. return d
  1320. };
  1321. return a
  1322. }();
  1323. d.SpriteSheet = c;
  1324. var b = function () {
  1325. return function () {
  1326. }
  1327. }();
  1328. d.SpriteSheetFrame = b
  1329. })(ns_egret || (ns_egret =
  1330. {}));
  1331. __extends = this.__extends || function (d, c) {
  1332. function b() {
  1333. this.constructor = d
  1334. }
  1335. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  1336. b.prototype = c.prototype;
  1337. d.prototype = new b
  1338. };
  1339. (function (d) {
  1340. var c = function (b) {
  1341. function a() {
  1342. b.apply(this, arguments);
  1343. this._placeholderText = "";
  1344. this._edFontSize = 14;
  1345. this._textColor = "#ff0000";
  1346. this._placeholderFontSize = 14;
  1347. this._placeholderColor = "#ffff00";
  1348. this._preY = this._preX = 0
  1349. }
  1350. __extends(a, b);
  1351. a.prototype._onAddToStage = function () {
  1352. b.prototype._onAddToStage.call(this);
  1353. var a = this.localToGlobal(), f = new d.StageText;
  1354. f.open(a.x, a.y, this._contentWidth, this._contentHeight);
  1355. this.addEventListener(d.TouchEvent.TOUCH_BEGAN, this.onMouseDownHandler, this);
  1356. this.stageText =
  1357. f
  1358. };
  1359. a.prototype.setText = function (a) {
  1360. this.stageText.setText(a)
  1361. };
  1362. a.prototype.getText = function () {
  1363. return this.stageText.getText()
  1364. };
  1365. a.prototype.onMouseDownHandler = function () {
  1366. };
  1367. a.prototype._onRemoveFromStage = function () {
  1368. this.stageText.remove()
  1369. };
  1370. a.prototype._measureBounds = function () {
  1371. return d.Rectangle.identity
  1372. };
  1373. a.prototype.hitTest = function (a, b) {
  1374. return null
  1375. };
  1376. return a
  1377. }(d.DisplayObject);
  1378. d.TextInput = c;
  1379. c = function () {
  1380. function b() {
  1381. }
  1382. b.prototype.editBoxEditingDidBegin = function (a) {
  1383. };
  1384. b.prototype.editBoxEditingDidEnd =
  1385. function (a) {
  1386. };
  1387. b.prototype.editBoxTextChanged = function (a, b) {
  1388. };
  1389. b.prototype.editBoxReturn = function (a) {
  1390. };
  1391. return b
  1392. }();
  1393. d.TextInputDegelete = c
  1394. })(ns_egret || (ns_egret = {}));
  1395. __extends = this.__extends || function (d, c) {
  1396. function b() {
  1397. this.constructor = d
  1398. }
  1399. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  1400. b.prototype = c.prototype;
  1401. d.prototype = new b
  1402. };
  1403. (function (d) {
  1404. var c = function (b) {
  1405. function a(a, f) {
  1406. b.call(this);
  1407. this.data = a;
  1408. this.texture = f;
  1409. this._resPool = {};
  1410. this._currentInterval = this._interval = this._totalFrame = this._currentFrameIndex = 0;
  1411. this._isPlaying = !1;
  1412. this._passTime = 0;
  1413. this._oneFrameTime = 1E3 / d.Ticker.getInstance().getFrameRate();
  1414. this._frameData = a
  1415. }
  1416. __extends(a, b);
  1417. a.prototype.gotoAndPlay = function (a) {
  1418. this.checkHasFrame(a);
  1419. this._isPlaying = !0;
  1420. this._currentInterval = this._currentFrameIndex = 0;
  1421. this._currentFrameName = a;
  1422. this._totalFrame = this._frameData.frames[a].totalFrame;
  1423. this.playNextFrame();
  1424. this._passTime = 0;
  1425. d.Ticker.getInstance().register(this.update, this)
  1426. };
  1427. a.prototype.gotoAndStop = function (a) {
  1428. this.checkHasFrame(a);
  1429. this.stop();
  1430. this._currentInterval = this._currentFrameIndex = 0;
  1431. this._currentFrameName = a;
  1432. this._totalFrame = this._frameData.frames[a].totalFrame;
  1433. this.playNextFrame()
  1434. };
  1435. a.prototype.checkHasFrame = function (a) {
  1436. void 0 == this._frameData.frames[a] && d.Logger.fatal("MovieClip\u6ca1\u6709\u5bf9\u5e94\u7684frame\uff1a", a)
  1437. };
  1438. a.prototype.stop = function () {
  1439. this._isPlaying = !1;
  1440. d.Ticker.getInstance().unregister(this.update,
  1441. this)
  1442. };
  1443. a.prototype.update = function (a) {
  1444. if (this._interval != this._currentInterval)this._currentInterval++; else {
  1445. for (var b = Math.floor((this._passTime % this._oneFrameTime + a) / this._oneFrameTime); 1 <= b;)1 == b ? this.playNextFrame() : this.playNextFrame(!1), b--;
  1446. this._passTime += a
  1447. }
  1448. };
  1449. a.prototype.playNextFrame = function (a) {
  1450. "undefined" === typeof a && (a = !0);
  1451. this._currentInterval = 0;
  1452. var b = this._frameData.frames[this._currentFrameName].childrenFrame[this._currentFrameIndex];
  1453. a && (a = this.getBitmap(b.res), a.x = b.x, a.y = b.y, this.removeAllChildren(),
  1454. this.addChild(a));
  1455. null != b.action && this.dispatchEvent(b.action);
  1456. this._currentFrameIndex++;
  1457. this._currentFrameIndex == this._totalFrame && (this._currentFrameIndex = 0)
  1458. };
  1459. a.prototype.getBitmap = function (a) {
  1460. var b;
  1461. if (null != this._resPool[a])b = this._resPool[a]; else {
  1462. var c = this._frameData.res[a];
  1463. b = d.Bitmap.initWithTexture(this.texture);
  1464. b.spriteFrame = c;
  1465. this._resPool[a] = b
  1466. }
  1467. return b
  1468. };
  1469. a.prototype.release = function () {
  1470. this._resPool = {}
  1471. };
  1472. a.prototype.getCurrentFrameIndex = function () {
  1473. return this._currentFrameIndex
  1474. };
  1475. a.prototype.getTotalFrame =
  1476. function () {
  1477. return this._totalFrame
  1478. };
  1479. a.prototype.setInterval = function (a) {
  1480. this._interval = a
  1481. };
  1482. a.prototype.getIsPlaying = function () {
  1483. return this._isPlaying
  1484. };
  1485. return a
  1486. }(d.DisplayObjectContainer);
  1487. d.MovieClip = c
  1488. })(ns_egret || (ns_egret = {}));
  1489. __extends = this.__extends || function (d, c) {
  1490. function b() {
  1491. this.constructor = d
  1492. }
  1493. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  1494. b.prototype = c.prototype;
  1495. d.prototype = new b
  1496. };
  1497. (function (d) {
  1498. var c = function (b) {
  1499. function a() {
  1500. b.call(this);
  1501. this._callArr = []
  1502. }
  1503. __extends(a, b);
  1504. a.prototype.init = function () {
  1505. this._callArr = [];
  1506. for (var a = this._currentTag = 0; a < this.numChildren; a++) {
  1507. var b = this.getChildAt(a), d = this, c = function () {
  1508. var a = d._callArr.indexOf(this);
  1509. d.chooseIdx(a)
  1510. };
  1511. this._callArr.push(c);
  1512. b.addOnClick(c, c);
  1513. b.useZoomOut(!1)
  1514. }
  1515. };
  1516. a.prototype.chooseIdx = function (a) {
  1517. this._currentTag = a + 1;
  1518. for (var b = 0; b < this.numChildren; b++) {
  1519. var d = this.getChildAt(b);
  1520. b == a ? d.setChoose(!0) : d.setChoose(!1)
  1521. }
  1522. this.onClick(a)
  1523. };
  1524. a.prototype.setDefaultTag = function (a) {
  1525. this.chooseIdx(a - 1)
  1526. };
  1527. a.prototype.addOnClick = function (a, b) {
  1528. this._callBack = a;
  1529. this._target = b
  1530. };
  1531. a.prototype.onClick = function (a) {
  1532. this._callBack && this._target && this._callBack.apply(this._target, [a + 1])
  1533. };
  1534. a.prototype.useZoomOut = function (a) {
  1535. for (var b = 0; b < this.numChildren; b++)this.getChildAt(b).useZoomOut(a)
  1536. };
  1537. a.prototype.getCurrentTag = function () {
  1538. var a = Math.max(this._currentTag, 1);
  1539. return a = Math.min(a, this.numChildren)
  1540. };
  1541. return a
  1542. }(d.DisplayObjectContainer);
  1543. d.TabView = c
  1544. })(ns_egret ||
  1545. (ns_egret = {}));
  1546. __extends = this.__extends || function (d, c) {
  1547. function b() {
  1548. this.constructor = d
  1549. }
  1550. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  1551. b.prototype = c.prototype;
  1552. d.prototype = new b
  1553. };
  1554. (function (d) {
  1555. var c = function (b) {
  1556. function a() {
  1557. b.call(this);
  1558. this._frames = [];
  1559. this._currentFrame = 1;
  1560. this._scale = 1.1;
  1561. this._initScaleY = this._initScaleX = 0;
  1562. this._canScale = !0;
  1563. this._frameNumber = 0;
  1564. this._canScale = this.touchEnabled = !0
  1565. }
  1566. __extends(a, b);
  1567. a.prototype.hitTest = function (a, b) {
  1568. return d.DisplayObject.prototype.hitTest.call(this, a, b)
  1569. };
  1570. a.prototype._onAddToStage = function () {
  1571. b.prototype._onAddToStage.call(this);
  1572. this.addListeners();
  1573. this._initScaleX = this.scaleX;
  1574. this._initScaleY = this.scaleY
  1575. };
  1576. a.prototype._onRemoveFromStage =
  1577. function () {
  1578. b.prototype._onRemoveFromStage.call(this);
  1579. this.removeListeners()
  1580. };
  1581. a.prototype.addListeners = function () {
  1582. this.addEventListener(d.TouchEvent.TOUCH_BEGAN, this.mouseDown, this)
  1583. };
  1584. a.prototype.removeListeners = function () {
  1585. this.removeEventListener(d.TouchEvent.TOUCH_BEGAN, this.mouseDown, this);
  1586. d.MainContext.instance.stage.removeEventListener(d.TouchEvent.TOUCH_END, this.mouseUp, this);
  1587. d.MainContext.instance.stage.removeEventListener(d.TouchEvent.TOUCH_MOVE, this.mouseMove, this)
  1588. };
  1589. a.prototype.mouseDown = function (a, b) {
  1590. this._isMoved = !1;
  1591. d.MainContext.instance.stage.addEventListener(d.TouchEvent.TOUCH_END, this.mouseUp, this);
  1592. d.MainContext.instance.stage.addEventListener(d.TouchEvent.TOUCH_MOVE, this.mouseMove, this);
  1593. this._startX = b.stageX;
  1594. this._startY = b.stageY;
  1595. this.setChoose(!0)
  1596. };
  1597. a.prototype.mouseUp = function () {
  1598. this._isMoved || (this.setChoose(!1), this.onClick());
  1599. d.MainContext.instance.stage.removeEventListener(d.TouchEvent.TOUCH_END, this.mouseUp, this);
  1600. d.MainContext.instance.stage.removeEventListener(d.TouchEvent.TOUCH_MOVE,
  1601. this.mouseMove, this)
  1602. };
  1603. a.prototype.mouseMove = function (a, b) {
  1604. var c = b.stageY;
  1605. 10 > Math.abs(b.stageX - this._startX) && 10 > Math.abs(c - this._startY) || (this._isMoved = !0, this.setChoose(!1), d.MainContext.instance.stage.removeEventListener(d.TouchEvent.TOUCH_MOVE, this.mouseMove, this))
  1606. };
  1607. a.prototype.addOnClick = function (a, b) {
  1608. this._callBack = a;
  1609. this._target = b
  1610. };
  1611. a.prototype.onClick = function () {
  1612. this._callBack && this._target && this._callBack.apply(this._target, [])
  1613. };
  1614. a.prototype.setEnabled = function (a) {
  1615. this.touchEnabled = a
  1616. };
  1617. a.prototype.useZoomOut =
  1618. function (a) {
  1619. this._canScale = a
  1620. };
  1621. a.prototype.initFontTextField = function (a) {
  1622. this._textField = a;
  1623. a instanceof d.TextField && (a.stroke = 2);
  1624. if (a && null != a.parent) {
  1625. if (a.parent == this)return;
  1626. a.removeFromParent()
  1627. }
  1628. this.addChild(a)
  1629. };
  1630. a.prototype.setFontText = function (a, b) {
  1631. "undefined" === typeof b && (b = 30);
  1632. if (null == this._textField) {
  1633. this._textField = new d.TextField;
  1634. this._textField.setContentSize(0, 0);
  1635. this._textField.textColor = "#ffffff";
  1636. this._textField.textAlign = "center";
  1637. this._textField.font = "Courier-Bold";
  1638. this._textField.size =
  1639. b;
  1640. this._textField.stroke = 2;
  1641. this.addChild(this._textField);
  1642. this._textField.relativeAnchorPointX = 0.5;
  1643. this._textField.relativeAnchorPointY = 0.5;
  1644. var c = this.getBounds();
  1645. this._textField.x = c.width / 2;
  1646. this._textField.y = c.height / 2
  1647. }
  1648. this._textField.text = a
  1649. };
  1650. a.prototype.setFontColor = function (a) {
  1651. };
  1652. a.prototype.setChoose = function (a) {
  1653. this.playZoomOut(!a);
  1654. this.setFrameChild(a ? 2 : 1)
  1655. };
  1656. a.prototype.playZoomOut = function (a) {
  1657. this._canScale && (this.scaleX = a ? this._initScaleX : this._initScaleX * this._scale, this.scaleY = a ? this._initScaleY :
  1658. this._initScaleY * this._scale)
  1659. };
  1660. a.prototype.initFrameRes = function (a, b, d) {
  1661. this._currentFrame = b;
  1662. this._frameRes = a;
  1663. this._frames[b - 1] = d
  1664. };
  1665. a.prototype.changeBtn = function (a) {
  1666. if (this._frameRes != a) {
  1667. this._frameRes = a;
  1668. for (var b = a = 0; b < this._frames.length; b++) {
  1669. var d = this._frames[b];
  1670. d && (a = this.getChildIndex(d), this.removeChild(d), this._frames[b] = null)
  1671. }
  1672. this.setFrameChild(this._currentFrame, a)
  1673. }
  1674. };
  1675. a.prototype.setFrameNumber = function (a, b) {
  1676. this._frameRes = a;
  1677. b = Math.max(0, b);
  1678. 2 < b && (b = 0);
  1679. this._frameNumber = b
  1680. };
  1681. a.prototype.isInFrames =
  1682. function (a) {
  1683. return 0 == this._frameNumber || 0 < (a & this._frameNumber)
  1684. };
  1685. a.prototype.setFrameChild = function (a, b) {
  1686. "undefined" === typeof b && (b = 0);
  1687. if (this._frameRes) {
  1688. var c = this.getFrameChild(this._currentFrame), h = b;
  1689. c && (c.visible = !1, h = this.getChildIndex(c));
  1690. this._currentFrame = a;
  1691. if (this.isInFrames(a)) {
  1692. c = this.getFrameChild(a);
  1693. if (null == c) {
  1694. c = this.getIndexRes(this._frameRes, 1, a);
  1695. c = d.TextureCache.getInstance().getTexture(c);
  1696. c = d.Bitmap.initWithTexture(c);
  1697. this._frames[a - 1] = c;
  1698. c.relativeAnchorPointX = 0.5;
  1699. c.relativeAnchorPointY =
  1700. 0.5;
  1701. var k = this.getBounds();
  1702. c.x = k.width / 2;
  1703. c.y = k.height / 2;
  1704. this.addChild(c, h)
  1705. }
  1706. c.visible = !0
  1707. }
  1708. }
  1709. };
  1710. a.prototype.getFrameChild = function (a) {
  1711. return this._frames[a - 1]
  1712. };
  1713. a.prototype.getIndexRes = function (a, b, c) {
  1714. var h = a.lastIndexOf(".");
  1715. h < b && d.Logger.fatal("the argument [count] too large");
  1716. b = a.substring(0, h - b);
  1717. a = a.substring(h);
  1718. return b + c + a
  1719. };
  1720. return a
  1721. }(d.DisplayObjectContainer);
  1722. d.SimpleButton = c
  1723. })(ns_egret || (ns_egret = {}));
  1724. __extends = this.__extends || function (d, c) {
  1725. function b() {
  1726. this.constructor = d
  1727. }
  1728. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  1729. b.prototype = c.prototype;
  1730. d.prototype = new b
  1731. };
  1732. (function (d) {
  1733. var c = function (b) {
  1734. function a() {
  1735. b.call(this);
  1736. this._initY = this._initX = 0;
  1737. this._deltaTime = 200;
  1738. this.direction = d.Direction.BOTH;
  1739. this.touchEnabled = !0;
  1740. this._endY = this._endX = 0;
  1741. this.mask = new d.Rectangle(0, 0, 100, 100)
  1742. }
  1743. __extends(a, b);
  1744. a.prototype._onAddToStage = function () {
  1745. b.prototype._onAddToStage.call(this);
  1746. this.addListeners()
  1747. };
  1748. a.prototype._onRemoveFromStage = function () {
  1749. b.prototype._onRemoveFromStage.call(this);
  1750. this.removeListeners()
  1751. };
  1752. a.prototype.setContentSize = function (a, d) {
  1753. b.prototype.setContentSize.call(this,
  1754. a, d);
  1755. this._viewWidth = a;
  1756. this._viewHeight = d;
  1757. this.mask.width = a;
  1758. this.mask.height = d
  1759. };
  1760. a.prototype.setContainer = function (a, b, d) {
  1761. this._container && this._container.removeFromParent();
  1762. this._container = a;
  1763. this._initWidth = b;
  1764. this._initHeight = d;
  1765. this._endY = this._endX = 0;
  1766. if (null != this._container.parent)if (this._container.parent != this)this._container.removeFromParent(); else return;
  1767. this.addChild(this._container, 0)
  1768. };
  1769. a.prototype.mouseDown = function (a, b) {
  1770. this.touchEnabled && null != this._container && (this._isMoved = !1, d.MainContext.instance.stage.addEventListener(d.TouchEvent.TOUCH_END,
  1771. this.mouseUp, this), d.MainContext.instance.stage.addEventListener(d.TouchEvent.TOUCH_CANCEL, this.mouseUp, this), d.MainContext.instance.stage.addEventListener(d.TouchEvent.TOUCH_MOVE, this.mouseMove, this), console.log("begin"), d.Tween.removeTweens(this._container), this._initX = this._container.x, this._initY = this._container.y, this._endX = this._container.x, this._endY = this._container.y, this._downPX = b.stageX, this._downPY = b.stageY, this._downTime = d.Ticker.now())
  1772. };
  1773. a.prototype.mouseUp = function (a, b) {
  1774. d.MainContext.instance.stage.removeEventListener(d.TouchEvent.TOUCH_END,
  1775. this.mouseUp, this);
  1776. d.MainContext.instance.stage.removeEventListener(d.TouchEvent.TOUCH_CANCEL, this.mouseUp, this);
  1777. d.MainContext.instance.stage.removeEventListener(d.TouchEvent.TOUCH_MOVE, this.mouseMove, this);
  1778. console.log("end");
  1779. var c = d.Ticker.now();
  1780. if (c - this._downTime > this._deltaTime)this._backToPosition(); else {
  1781. var h = b.stageX - this._downPX, k = b.stageY - this._downPY, c = 2 * Math.floor(this._deltaTime / (c - this._downTime));
  1782. if (this.direction == d.Direction.BOTH || this.direction == d.Direction.HORIZONTAL)this._endX +=
  1783. h * c;
  1784. if (this.direction == d.Direction.BOTH || this.direction == d.Direction.VERTICAL)this._endY += k * c;
  1785. h = Math.max(100 * c, 100);
  1786. h = Math.min(h, 300);
  1787. k = d.Tween.get(this._container, {onChange: this.moveList, onChangeObj: this});
  1788. k.to({x: this._endX, y: this._endY}, h);
  1789. k.call(this._backToPosition, this)
  1790. }
  1791. };
  1792. a.prototype.mouseMove = function (a, b) {
  1793. var c = b.stageX - this._downPX, h = b.stageY - this._downPY;
  1794. if (this.direction == d.Direction.BOTH || this.direction == d.Direction.HORIZONTAL)this._endX = this._initX + c;
  1795. if (this.direction == d.Direction.BOTH ||
  1796. this.direction == d.Direction.VERTICAL)this._endY = this._initY + h;
  1797. this._container.x = this._endX;
  1798. this._container.y = this._endY;
  1799. this.moveList()
  1800. };
  1801. a.prototype._backToPosition = function () {
  1802. var a = !1;
  1803. 0 < this._endX ? (a = !0, this._endX = 0) : this._endX < this._viewWidth - this._initWidth && (a = !0, this._endX = this._viewWidth >= this._initWidth ? 0 : this._viewWidth - this._initWidth);
  1804. 0 < this._endY ? (a = !0, this._endY = 0) : this._endY < this._viewHeight - this._initHeight && (a = !0, this._endY = this._viewHeight >= this._initHeight ? 0 : this._viewHeight - this._initHeight);
  1805. a && d.Tween.get(this._container, {onChange: this.moveList, onChangeObj: this}).to({x: this._endX, y: this._endY}, 200)
  1806. };
  1807. a.prototype.moveList = function () {
  1808. };
  1809. a.prototype.addListeners = function () {
  1810. this.addEventListener(d.TouchEvent.TOUCH_BEGAN, this.mouseDown, this)
  1811. };
  1812. a.prototype.removeListeners = function () {
  1813. this.removeEventListener(d.TouchEvent.TOUCH_BEGAN, this.mouseDown, this);
  1814. d.MainContext.instance.stage.removeEventListener(d.TouchEvent.TOUCH_CANCEL, this.mouseUp, this);
  1815. d.MainContext.instance.stage.removeEventListener(d.TouchEvent.TOUCH_END,
  1816. this.mouseUp, this);
  1817. d.MainContext.instance.stage.removeEventListener(d.TouchEvent.TOUCH_MOVE, this.mouseMove, this);
  1818. console.log("remove")
  1819. };
  1820. return a
  1821. }(d.DisplayObjectContainer);
  1822. d.ScrollView = c
  1823. })(ns_egret || (ns_egret = {}));
  1824. __extends = this.__extends || function (d, c) {
  1825. function b() {
  1826. this.constructor = d
  1827. }
  1828. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  1829. b.prototype = c.prototype;
  1830. d.prototype = new b
  1831. };
  1832. (function (d) {
  1833. var c = function (b) {
  1834. function a() {
  1835. b.call(this);
  1836. this._currentIndex = 0;
  1837. this._itemArr = [];
  1838. this.disappearContainer = new d.DisplayObjectContainer;
  1839. this.addChild(this.disappearContainer)
  1840. }
  1841. __extends(a, b);
  1842. a.prototype.setContentSize = function (a, d) {
  1843. b.prototype.setContentSize.call(this, a, d)
  1844. };
  1845. a.prototype.reloadData = function (a) {
  1846. this._dataArr = a || [];
  1847. new d.DisplayObjectContainer;
  1848. var b, c;
  1849. a = 0;
  1850. this.direction == d.Direction.HORIZONTAL ? (b = this._itemWidth * this._dataArr.length, c = this._itemHeight, a = Math.floor(-this._container.x /
  1851. this._itemWidth)) : (b = this._itemWidth, c = this._itemHeight * this._dataArr.length, a = Math.floor(-this._container.y / this._itemHeight));
  1852. this._initWidth = b;
  1853. this._initHeight = c;
  1854. b = this._container.numChildren;
  1855. for (c = 0; c < b; c++) {
  1856. var h = this._container.getChildAt(c);
  1857. this.initItem(h, a + c)
  1858. }
  1859. this._currentIndex = a;
  1860. this._backToPosition()
  1861. };
  1862. a.prototype.showAnimation = function () {
  1863. if (this.direction == d.Direction.VERTICAL)for (var a = 0, b = 0; a < this._container.numChildren; a++) {
  1864. var c = this._container.getChildAt(a);
  1865. if (c.visible) {
  1866. var h = d.Tween.get(c);
  1867. c.x = this._itemWidth;
  1868. h.wait(100 * b + 10);
  1869. h.to({x: 0}, 200);
  1870. b++
  1871. }
  1872. }
  1873. };
  1874. a.prototype.hideAnimation = function () {
  1875. if (this.direction == d.Direction.VERTICAL)for (var a = 0, b = 0; a < this._container.numChildren; a++) {
  1876. var c = this._container.getChildAt(a);
  1877. if (c.visible) {
  1878. var h = d.Tween.get(c);
  1879. c.x = 0;
  1880. h.wait(100 * b + 10);
  1881. h.to({x: this._itemWidth}, 200);
  1882. b++
  1883. }
  1884. }
  1885. };
  1886. a.prototype.setList = function (a, b, c, h, k) {
  1887. this._dataArr = a || [];
  1888. this._delegate = c;
  1889. this._itemWidth = h;
  1890. this._itemHeight = k;
  1891. this.direction = b;
  1892. a = new d.DisplayObjectContainer;
  1893. this.direction == d.Direction.HORIZONTAL ?
  1894. this.setContainer(a, this._itemWidth * this._dataArr.length, this._itemHeight) : this.setContainer(a, this._itemWidth, this._itemHeight * this._dataArr.length);
  1895. this.initItemList()
  1896. };
  1897. a.prototype.initItemList = function () {
  1898. if (!(0 == this._itemWidth || 0 == this._itemHeight || 0 == this._viewWidth || 0 == this._viewHeight)) {
  1899. var a = 0, a = this.direction == d.Direction.HORIZONTAL ? Math.ceil(this._viewWidth / this._itemWidth) + 1 : Math.ceil(this._viewHeight / this._itemHeight) + 1;
  1900. this._itemArr = [];
  1901. for (var b = 0; b < a; b++) {
  1902. var c = this._delegate.createItemRenderer();
  1903. this._container.addChild(c);
  1904. this._itemArr.push(c);
  1905. this.initItem(c, b)
  1906. }
  1907. this._currentIndex = 0
  1908. }
  1909. };
  1910. a.prototype.getCurrent = function () {
  1911. var a = 0, a = this.direction == d.Direction.HORIZONTAL ? Math.floor(-this._container.x / this._itemWidth) : Math.floor(-this._container.y / this._itemHeight);
  1912. a > this._dataArr.length - this._itemArr.length ? a = this._dataArr.length - this._itemArr.length : 0 > a && (a = 0);
  1913. return a
  1914. };
  1915. a.prototype.moveList = function () {
  1916. var a = this.getCurrent();
  1917. if (a != this._currentIndex) {
  1918. var b = a - this._currentIndex;
  1919. console.log("deltaIdx " +
  1920. b);
  1921. console.log("current " + a);
  1922. console.log("this._currentIndex " + this._currentIndex);
  1923. if (0 > b)for (var d = 0; d < -b; d++) {
  1924. var c = this._container.getChildAt(this._container.numChildren - 1);
  1925. this._container.setChildIndex(c, 0);
  1926. var k = a + (-b - 1) - d;
  1927. this.initItem(c, k)
  1928. } else for (var l = this._container.numChildren, d = 0; d < b; d++)c = this._container.getChildAt(0), this._container.setChildIndex(c, -1), k = b >= l ? a + d : a + l - 1 - (b - 1 - d), this.initItem(c, k);
  1929. this._currentIndex = a
  1930. }
  1931. };
  1932. a.prototype.initItem = function (a, b) {
  1933. b >= this._dataArr.length ? a.visible = !1 : 0 > b ? a.visible = !1 : (a.visible = !0, console.log("item index " + b), this._delegate.updateItemRenderer(a, this._dataArr[b], b));
  1934. this.direction == d.Direction.HORIZONTAL ? a.x = this._itemWidth * b : a.y = this._itemHeight * b
  1935. };
  1936. return a
  1937. }(d.ScrollView);
  1938. d.TableView = c
  1939. })(ns_egret || (ns_egret = {}));
  1940. (function (d) {
  1941. var c = function () {
  1942. function b() {
  1943. }
  1944. b.prototype.getText = function () {
  1945. return this.inputElement.value
  1946. };
  1947. b.prototype.setText = function (a) {
  1948. this.inputElement.value = a
  1949. };
  1950. b.prototype.open = function (a, b, c, g) {
  1951. "undefined" === typeof c && (c = 160);
  1952. "undefined" === typeof g && (g = 21);
  1953. var h = document.createElement("input");
  1954. h.type = "text";
  1955. h.style.fontSize = "20px";
  1956. h.style.color = "#FFFFFF";
  1957. h.style.borderStyle = "none";
  1958. h.style.background = "none";
  1959. h.style.width = c * d.StageDelegate.getInstance().getScaleX() + "px";
  1960. h.style.height = g * d.StageDelegate.getInstance().getScaleY() +
  1961. "px";
  1962. h.style.outline = "medium";
  1963. var k = d.Browser.getInstance().$new("div");
  1964. k.style.position = "absolute";
  1965. k.position.x = a * d.StageDelegate.getInstance().getScaleX();
  1966. k.style.width = c * d.StageDelegate.getInstance().getScaleX() + "px";
  1967. k.style.height = g * d.StageDelegate.getInstance().getScaleY() + "px";
  1968. k.position.y = b * d.StageDelegate.getInstance().getScaleY();
  1969. k.transforms();
  1970. k.appendChild(h);
  1971. a = d.Browser.getInstance().$("#StageDelegateDiv");
  1972. a || (c = document.getElementById(d.StageDelegate.canvas_div_name), g = c.clientHeight,
  1973. c = c.clientWidth, a = d.Browser.getInstance().$new("div"), a.id = "StageDelegateDiv", a.style.position = "absolute", a.style.width = c + "px", a.style.maxHeight = g + "px", a.style.margin = 0, document.getElementById(d.StageDelegate.canvas_div_name).appendChild(a), a.position.y = -g, a.transforms());
  1974. a.appendChild(k);
  1975. this.div = k;
  1976. this.inputElement = h
  1977. };
  1978. b.prototype.remove = function () {
  1979. var a = this.div;
  1980. a && a.parentNode && a.parentNode.removeChild(a)
  1981. };
  1982. return b
  1983. }();
  1984. d.StageText = c
  1985. })(ns_egret || (ns_egret = {}));
  1986. (function (d) {
  1987. var c = function () {
  1988. function b() {
  1989. this.renderCost = 0;
  1990. this.texture_scale_factor = 1
  1991. }
  1992. b.prototype.clearScreen = function () {
  1993. };
  1994. b.prototype.clearRect = function (a, b, d, c) {
  1995. };
  1996. b.prototype.drawImage = function (a, b, c, g, h, k, l, m, p) {
  1997. d.Profiler.getInstance().onDrawImage()
  1998. };
  1999. b.prototype.setTransform = function (a) {
  2000. };
  2001. b.prototype.translate = function (a, b) {
  2002. };
  2003. b.prototype.save = function () {
  2004. };
  2005. b.prototype.restore = function () {
  2006. };
  2007. b.prototype.setAlpha = function (a, b) {
  2008. };
  2009. b.prototype.setupFont = function (a, b, d) {
  2010. };
  2011. b.prototype.measureText = function (a) {
  2012. return d.Rectangle.identity
  2013. };
  2014. b.prototype.drawText = function (a, b, c, g, h) {
  2015. d.Profiler.getInstance().onDrawImage()
  2016. };
  2017. b.prototype.clip = function (a, b, d, c) {
  2018. };
  2019. b.prototype.strokeRect = function (a, b, d, c, h) {
  2020. };
  2021. return b
  2022. }();
  2023. d.RendererContext = c;
  2024. c = function () {
  2025. function b(a) {
  2026. this.type = a;
  2027. switch (a) {
  2028. case "add":
  2029. case "layer":
  2030. this.value = "lighter";
  2031. break;
  2032. default:
  2033. this.value = "source-over"
  2034. }
  2035. }
  2036. b.getBlendMode = function (a) {
  2037. return!a ? d.BlendMode.NORMAL : d.BlendMode[a.toUpperCase()]
  2038. };
  2039. b.NORMAL = new b("normal");
  2040. b.ADD = new b("add");
  2041. b.LAYER = new b("layer");
  2042. return b
  2043. }();
  2044. d.BlendMode =
  2045. c
  2046. })(ns_egret || (ns_egret = {}));
  2047. __extends = this.__extends || function (d, c) {
  2048. function b() {
  2049. this.constructor = d
  2050. }
  2051. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  2052. b.prototype = c.prototype;
  2053. d.prototype = new b
  2054. };
  2055. (function (d) {
  2056. var c = function (b) {
  2057. function a(a) {
  2058. this.canvas = a;
  2059. this.canvasContext = a.getContext("2d");
  2060. b.call(this)
  2061. }
  2062. __extends(a, b);
  2063. a.prototype.clearScreen = function () {
  2064. var a = this.canvas;
  2065. this.canvasContext.setTransform(1, 0, 0, 1, 0, 0);
  2066. this.clearRect(0, 0, a.width, a.height);
  2067. this.renderCost = 0
  2068. };
  2069. a.prototype.clearRect = function (a, b, d, c) {
  2070. this.canvasContext.clearRect(a, b, d, c)
  2071. };
  2072. a.prototype.drawImage = function (a, c, g, h, k, l, m, p, n) {
  2073. c /= d.MainContext.instance.rendererContext.texture_scale_factor;
  2074. g /= d.MainContext.instance.rendererContext.texture_scale_factor;
  2075. h /= d.MainContext.instance.rendererContext.texture_scale_factor;
  2076. k /= d.MainContext.instance.rendererContext.texture_scale_factor;
  2077. d.DEBUG && d.DEBUG.DRAW_IMAGE && d.DEBUG.checkDrawImage(a, c, g, h, k, l, m, p, n);
  2078. var q = d.Ticker.now();
  2079. a = a._bitmapData;
  2080. this.canvasContext.drawImage(a, c, g, h, k, l, m, p, n);
  2081. b.prototype.drawImage.call(this, a, c, g, h, k, l, m, p, n);
  2082. this.renderCost += d.Ticker.now() - q
  2083. };
  2084. a.prototype.setTransform = function (a) {
  2085. this.canvasContext.setTransform(a.a, a.b, a.c, a.d, a.tx, a.ty)
  2086. };
  2087. a.prototype.translate = function (a, b) {
  2088. this.canvasContext.translate(a,
  2089. b)
  2090. };
  2091. a.prototype.save = function () {
  2092. this.canvasContext.save()
  2093. };
  2094. a.prototype.restore = function () {
  2095. this.canvasContext.restore()
  2096. };
  2097. a.prototype.setAlpha = function (a, b) {
  2098. a != this.canvasContext.globalAlpha && (this.canvasContext.globalAlpha = a);
  2099. this.canvasContext.globalCompositeOperation = b ? b.value : d.BlendMode.NORMAL.value
  2100. };
  2101. a.prototype.setupFont = function (a, b, d) {
  2102. var c = this.canvasContext;
  2103. c.font = a;
  2104. c.textAlign = b || "left";
  2105. c.textBaseline = d || "top"
  2106. };
  2107. a.prototype.measureText = function (a) {
  2108. a = this.canvasContext.measureText(a);
  2109. var b =
  2110. d.Rectangle.identity;
  2111. b.width = a.width;
  2112. b.height = a.height;
  2113. return b
  2114. };
  2115. a.prototype.drawText = function (a, d, c, h, k) {
  2116. var l = a.textColor, m = a.strokeColor;
  2117. a = a.stroke;
  2118. var p = this.canvasContext;
  2119. p.fillStyle = l;
  2120. p.strokeStyle = m;
  2121. a && (p.lineWidth = 2 * a, p.strokeText(d, c, h, k || 65535));
  2122. p.fillText(d, c, h, k || 65535);
  2123. b.prototype.drawText.call(this, d, c, h, k, a, l, m)
  2124. };
  2125. a.prototype.clip = function (a, b, d, c) {
  2126. this.canvasContext.beginPath();
  2127. this.canvasContext.rect(a, b, d, c);
  2128. this.canvasContext.clip();
  2129. this.canvasContext.closePath()
  2130. };
  2131. a.prototype.strokeRect =
  2132. function (a, b, d, c, k) {
  2133. this.canvasContext.strokeStyle = k;
  2134. this.canvasContext.strokeRect(a, b, d, c)
  2135. };
  2136. return a
  2137. }(d.RendererContext);
  2138. d.HTML5CanvasRenderer = c
  2139. })(ns_egret || (ns_egret = {}));
  2140. (function (d) {
  2141. var c = function () {
  2142. function a(a) {
  2143. this.canvas = a;
  2144. this._currentTouchTarget = {};
  2145. this.maxTouchs = 2
  2146. }
  2147. a.prototype.run = function () {
  2148. var a = this;
  2149. "ontouchstart"in window ? (this.canvas.addEventListener("touchstart", function (b) {
  2150. for (var d = b.changedTouches.length, c = 0; c < d && c < a.maxTouchs; c++)a.onTouchBegin(b.changedTouches[c]);
  2151. b.stopPropagation();
  2152. b.preventDefault()
  2153. }, !1), this.canvas.addEventListener("touchmove", function (b) {
  2154. for (var d = b.changedTouches.length, c = 0; c < d && c < a.maxTouchs; c++)a.onTouchMove(b.changedTouches[c]);
  2155. b.stopPropagation();
  2156. b.preventDefault()
  2157. }, !1), this.canvas.addEventListener("touchend", function (b) {
  2158. for (var d = b.changedTouches.length, c = 0; c < d && c < a.maxTouchs; c++)a.onTouchEnd(b.changedTouches[c]);
  2159. b.stopPropagation();
  2160. b.preventDefault()
  2161. }, !1), this.canvas.addEventListener("touchcancel", function (b) {
  2162. for (var d = b.changedTouches.length, c = 0; c < d && c < a.maxTouchs; c++)a.onTouchEnd(b.changedTouches[c]);
  2163. b.stopPropagation();
  2164. b.preventDefault()
  2165. }, !1)) : (this.canvas.addEventListener("mousedown", function (b) {
  2166. a.onTouchBegin(b)
  2167. }),
  2168. this.canvas.addEventListener("mousemove", function (b) {
  2169. a.onTouchMove(b)
  2170. }), this.canvas.addEventListener("mouseup", function (b) {
  2171. a.onTouchEnd(b)
  2172. }))
  2173. };
  2174. a.prototype.onTouchBegin = function (e) {
  2175. var c = a.getLocation(this.canvas, e), g = c.x, h = c.y;
  2176. if (c = d.MainContext.instance.stage.hitTest(g, h))e = this.getTouchData(e, g, h), e.target = c, e.beginTarget = c, a.dispachEvent(b.TOUCH_BEGAN, e)
  2177. };
  2178. a.prototype.onTouchMove = function (e) {
  2179. var c = a.getLocation(this.canvas, e), g = c.x, h = c.y;
  2180. if (c = d.MainContext.instance.stage.hitTest(g, h))e = this.getTouchData(e,
  2181. g, h), e.target = c, a.dispachEvent(b.TOUCH_MOVE, e)
  2182. };
  2183. a.prototype.onTouchEnd = function (e) {
  2184. var c = a.getLocation(this.canvas, e), g = c.x, h = c.y;
  2185. if (c = d.MainContext.instance.stage.hitTest(g, h)) {
  2186. e = this.getTouchData(e, g, h);
  2187. if (g = e.beginTarget)e.target = e.beginTarget, a.dispachEvent(b.TOUCH_CANCEL, e);
  2188. e.target = c;
  2189. a.dispachEvent(b.TOUCH_END, e);
  2190. g === c && a.dispachEvent(b.TOUCH_TAP, e);
  2191. delete this._currentTouchTarget[e.identifier]
  2192. }
  2193. };
  2194. a.prototype.getTouchData = function (a, b, d) {
  2195. var c = -1;
  2196. a.hasOwnProperty("identifier") && (c = a.identifier);
  2197. a = this._currentTouchTarget[c];
  2198. null == a && (a = {});
  2199. this._currentTouchTarget[c] = a;
  2200. a.stageX = b;
  2201. a.stageY = d;
  2202. a.identifier = c;
  2203. return a
  2204. };
  2205. a.dispachEvent = function (a, d) {
  2206. var c = d.target, h = b.identity;
  2207. h.touchId = d.identifier;
  2208. h.stageX = d.stageX;
  2209. h.stageY = d.stageY;
  2210. h.target = c;
  2211. for (var k = [], l = c; l.parent;)k.unshift(l.parent), l = l.parent;
  2212. k.push(c);
  2213. for (var c = k.length, m = c - 1; 0 <= m; m--)k.push(k[m]);
  2214. c = k.length;
  2215. for (m = 0; m < c && !(l = k[m], l.isUseCapture = m < c / 2 ? !0 : !1, h.currentTarget = l, l.dispatchEvent(a, h)); m++);
  2216. };
  2217. a.getLocation = function (a, b) {
  2218. var c =
  2219. document.documentElement, h = window, k, l;
  2220. "function" === typeof a.getBoundingClientRect ? (l = a.getBoundingClientRect(), k = l.left, l = l.top) : l = k = 0;
  2221. k += h.pageXOffset - c.clientLeft;
  2222. l += h.pageYOffset - c.clientTop;
  2223. null != b.pageX ? (c = b.pageX, h = b.pageY) : (k -= document.body.scrollLeft, l -= document.body.scrollTop, c = b.clientX, h = b.clientY);
  2224. var m = d.Point.identity;
  2225. m.x = (c - k) / d.StageDelegate.getInstance().getScaleX();
  2226. m.y = (h - l) / d.StageDelegate.getInstance().getScaleY();
  2227. return m
  2228. };
  2229. return a
  2230. }();
  2231. d.TouchContext = c;
  2232. var b = function () {
  2233. function a() {
  2234. }
  2235. a.prototype.getLocalPoint = function () {
  2236. return this.currentTarget.globalToLocal(this.stageX, this.stageY)
  2237. };
  2238. a.TOUCH_BEGAN = "touchBegan";
  2239. a.TOUCH_END = "touchEnd";
  2240. a.TOUCH_CANCEL = "touchCancel";
  2241. a.TOUCH_TAP = "touchTap";
  2242. a.TOUCH_MOVE = "touchMove";
  2243. a.identity = new a;
  2244. return a
  2245. }();
  2246. d.TouchEvent = b
  2247. })(ns_egret || (ns_egret = {}));
  2248. __extends = this.__extends || function (d, c) {
  2249. function b() {
  2250. this.constructor = d
  2251. }
  2252. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  2253. b.prototype = c.prototype;
  2254. d.prototype = new b
  2255. };
  2256. (function (d) {
  2257. var c = function (b) {
  2258. function a(d, c) {
  2259. b.call(this);
  2260. this.type = this.url = null;
  2261. this.state = a.LOAD_STATE_INIT;
  2262. this.fixedUrl = this.data = null;
  2263. this.url = d;
  2264. var g = d.indexOf("?");
  2265. this.fixedUrl = -1 < g ? d.substring(0, g) : d;
  2266. this.type = c
  2267. }
  2268. __extends(a, b);
  2269. a.prototype.load = function () {
  2270. switch (this.state) {
  2271. case a.LOAD_STATE_INIT:
  2272. this.startLoading();
  2273. break;
  2274. case a.LOAD_STATE_LOADED:
  2275. d.Ticker.getInstance().callLater(this._executeAllCallback, this)
  2276. }
  2277. };
  2278. a.prototype.startLoading = function () {
  2279. this.type == a.DATA_TYPE_IMAGE ? this._loadByImage() :
  2280. this._loadByAjax()
  2281. };
  2282. a.prototype._executeAllCallback = function (b) {
  2283. this.state = a.LOAD_STATE_LOADED;
  2284. b && (this.data = b);
  2285. if (this.onLoadComplete)this.onLoadComplete(this.data);
  2286. this.dispatchEvent(a.LOAD_COMPLETE, this.data)
  2287. };
  2288. a.prototype._loadByAjax = function () {
  2289. var b = this, c = new d.URLRequest(a.prefix + this.url, function (a) {
  2290. a = b._processXMLHttpResponse(a);
  2291. b._executeAllCallback(a)
  2292. }, this);
  2293. c.type = this.type;
  2294. d.NetContext.getInstance().send(c)
  2295. };
  2296. a.prototype._loadByImage = function () {
  2297. var b = new Image;
  2298. b.crossOrigin = "Anonymous";
  2299. var c = a.prefix + this.url, g = this, h = function () {
  2300. var a = d.Texture.create(g.fixedUrl);
  2301. a.bitmapData = b;
  2302. d.TextureCache.getInstance().addTexture(g.fixedUrl, a);
  2303. b.removeEventListener("load", h);
  2304. b.removeEventListener("error", h);
  2305. g._executeAllCallback(b)
  2306. }, k = function () {
  2307. b.removeEventListener("error", k)
  2308. };
  2309. b.addEventListener("load", h);
  2310. b.addEventListener("error", k);
  2311. b.src = c;
  2312. return b
  2313. };
  2314. a.prototype._setXMLHttpRequestHeader = function (b) {
  2315. /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent) ? this.type == a.DATA_TYPE_BINARY ?
  2316. b.setRequestHeader("Accept-Charset", "x-user-defined") : b.setRequestHeader("Accept-Charset", "utf-8") : b.overrideMimeType && (this.type == a.DATA_TYPE_BINARY ? b.overrideMimeType("text/plain; charset\x3dx-user-defined") : b.overrideMimeType("text/plain; charset\x3dutf-8"))
  2317. };
  2318. a.prototype._processXMLHttpResponse = function (b) {
  2319. if (this.type == a.DATA_TYPE_TEXT)return b.responseText;
  2320. var d;
  2321. if (!/msie/i.test(navigator.userAgent) || /opera/i.test(navigator.userAgent))d = b.responseText;
  2322. return this._stringConvertToArray(d)
  2323. };
  2324. a.prototype._stringConvertToArray =
  2325. function (a) {
  2326. if (!a)return null;
  2327. for (var b = new Uint8Array(a.length), d = 0; d < a.length; d++)b[d] = a.charCodeAt(d) & 255;
  2328. return b
  2329. };
  2330. a.create = function (b, c) {
  2331. "undefined" === typeof c && (c = "");
  2332. if (null == a.__pool[b]) {
  2333. var g = b.substring(b.lastIndexOf(".") + 1), g = a.__registerMap[g];
  2334. g || (g = d.ResourceLoader);
  2335. a.__pool[b] = new g(b, c)
  2336. }
  2337. return a.__pool[b]
  2338. };
  2339. a.registerHandler = function (b, d) {
  2340. a.__registerMap[b] = d
  2341. };
  2342. a.LOAD_COMPLETE = "resource_load_complete";
  2343. a.DATA_TYPE_BINARY = "binary";
  2344. a.DATA_TYPE_TEXT = "text";
  2345. a.DATA_TYPE_IMAGE = "image";
  2346. a.LOAD_STATE_INIT =
  2347. 0;
  2348. a.LOAD_STATE_LOADED = 1;
  2349. a.__pool = {};
  2350. a.prefix = "";
  2351. a.__registerMap = {};
  2352. return a
  2353. }(d.EventDispatcher);
  2354. d.ResourceLoader = c
  2355. })(ns_egret || (ns_egret = {}));
  2356. __extends = this.__extends || function (d, c) {
  2357. function b() {
  2358. this.constructor = d
  2359. }
  2360. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  2361. b.prototype = c.prototype;
  2362. d.prototype = new b
  2363. };
  2364. (function (d) {
  2365. var c = function (b) {
  2366. function a() {
  2367. b.apply(this, arguments);
  2368. this._resourceUrlList = null;
  2369. this._currentIndex = 0;
  2370. this._state = d.LoadingController.LOAD_STATE_IDLE
  2371. }
  2372. __extends(a, b);
  2373. a.prototype.addResource = function (a, b) {
  2374. "undefined" === typeof b && (b = null);
  2375. if (!this.checkIsLoading()) {
  2376. null == this._resourceUrlList && (this._resourceUrlList = []);
  2377. var c = d.ResourceLoader.create(a, b);
  2378. -1 == this._resourceUrlList.indexOf(c) && c.state != d.ResourceLoader.LOAD_STATE_LOADED && this._resourceUrlList.push(c)
  2379. }
  2380. };
  2381. a.prototype.load = function () {
  2382. this.checkIsLoading() ||
  2383. (null != this._resourceUrlList && 0 < this._resourceUrlList.length ? (this._state = a.LOAD_STATE_LOADING, this._currentIndex = 0, null != this._loadingView && this._loadingView.addToStage(), this.next()) : d.Ticker.getInstance().callLater(this.onComplete, this))
  2384. };
  2385. a.prototype.onComplete = function () {
  2386. this._state = a.LOAD_STATE_IDLE;
  2387. this.destroy();
  2388. this.dispatchEvent(d.ResourceLoader.LOAD_COMPLETE)
  2389. };
  2390. a.prototype.checkIsLoading = function () {
  2391. return this._state == a.LOAD_STATE_LOADING ? (d.Logger.info("\u6b63\u5728\u52a0\u8f7d\u4e2d"),
  2392. !0) : !1
  2393. };
  2394. a.prototype.next = function () {
  2395. this.removeResourceEvent();
  2396. this.onProgress();
  2397. if (this._resourceUrlList.length > this._currentIndex)this._currentResource = this._resourceUrlList[this._currentIndex], this._currentResource.addEventListener(d.ResourceLoader.LOAD_COMPLETE, this.next, this), this._currentResource.load(); else this.onComplete();
  2398. this._currentIndex++
  2399. };
  2400. a.prototype.removeResourceEvent = function () {
  2401. this._currentResource && (this._currentResource.removeEventListener(d.ResourceLoader.LOAD_COMPLETE, this.next,
  2402. this), this._currentResource = null)
  2403. };
  2404. a.prototype.onProgress = function () {
  2405. if (null != this._loadingView)this._loadingView.onProgress(this._currentIndex, this._resourceUrlList.length)
  2406. };
  2407. a.prototype.setLoadingView = function (a) {
  2408. null != this._loadingView && (this._loadingView.removeFromStage(), this._loadingView = null);
  2409. this._loadingView = a
  2410. };
  2411. a.prototype.destroy = function () {
  2412. this.removeResourceEvent();
  2413. null != this._loadingView && (this._loadingView.removeFromStage(), this._loadingView = null);
  2414. this._resourceUrlList = null
  2415. };
  2416. a.LOAD_STATE_IDLE =
  2417. 0;
  2418. a.LOAD_STATE_LOADING = 1;
  2419. return a
  2420. }(d.EventDispatcher);
  2421. d.LoadingController = c;
  2422. c = function () {
  2423. return function () {
  2424. }
  2425. }();
  2426. d.LoadingEvent = c
  2427. })(ns_egret || (ns_egret = {}));
  2428. __extends = this.__extends || function (d, c) {
  2429. function b() {
  2430. this.constructor = d
  2431. }
  2432. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  2433. b.prototype = c.prototype;
  2434. d.prototype = new b
  2435. };
  2436. (function (d) {
  2437. var c = function () {
  2438. function b() {
  2439. this._textureHeight = this._textureWidth = 0
  2440. }
  2441. Object.defineProperty(b.prototype, "bitmapData", {get: function () {
  2442. return this._bitmapData
  2443. }, set: function (a) {
  2444. this._bitmapData = a;
  2445. this._textureWidth = a.width * d.MainContext.instance.rendererContext.texture_scale_factor;
  2446. this._textureHeight = a.height * d.MainContext.instance.rendererContext.texture_scale_factor
  2447. }, enumerable: !0, configurable: !0});
  2448. b.prototype.getTextureWidth = function () {
  2449. return this._textureWidth
  2450. };
  2451. b.prototype.getTextureHeight =
  2452. function () {
  2453. return this._textureHeight
  2454. };
  2455. b.create = function (a) {
  2456. var d = new b;
  2457. d._path = a;
  2458. return d
  2459. };
  2460. b.createWithBase64 = function (a) {
  2461. var d = new b, c = new Image;
  2462. c.src = a;
  2463. d.bitmapData = c;
  2464. return d
  2465. };
  2466. return b
  2467. }();
  2468. d.Texture = c;
  2469. c = function (b) {
  2470. function a() {
  2471. this.cacheCanvas = document.createElement("canvas");
  2472. this.offsetY = this.offsetX = 0
  2473. }
  2474. __extends(a, b);
  2475. a.prototype.drawToTexture = function (a) {
  2476. var b = 1 / d.MainContext.instance.rendererContext.texture_scale_factor, c = this.cacheCanvas, h = a.getBounds();
  2477. c.width = h.width;
  2478. c.height = h.height;
  2479. c.getContext("2d").scale(b,
  2480. b);
  2481. a.worldTransform.identity();
  2482. a.worldAlpha = 1;
  2483. if (a instanceof d.DisplayObjectContainer) {
  2484. this.offsetX = h.x;
  2485. this.offsetY = h.y;
  2486. a.worldTransform.append(1, 0, 0, 1, -h.x, -h.y);
  2487. for (var h = 0, k = a._children.length; h < k; h++)a._children[h].updateTransform()
  2488. }
  2489. c = new d.HTML5CanvasRenderer(c);
  2490. c.texture_scale_factor = 1 / b;
  2491. a.render(c);
  2492. this.bitmapData = this.cacheCanvas
  2493. };
  2494. return a
  2495. }(c);
  2496. d.RenderTexture = c
  2497. })(ns_egret || (ns_egret = {}));
  2498. (function (d) {
  2499. var c = function () {
  2500. function b() {
  2501. this._textures = {};
  2502. this._spritesheets = {}
  2503. }
  2504. b.getInstance = function () {
  2505. null == b.instance && (b.instance = new b);
  2506. return b.instance
  2507. };
  2508. b.prototype.addTexture = function (a, b) {
  2509. this._textures[a] || (this._textures[a] = b)
  2510. };
  2511. b.prototype.removeTexture = function (a) {
  2512. delete this._textures[a]
  2513. };
  2514. b.prototype.getTexture = function (a) {
  2515. var b = this._textures[a];
  2516. b || d.Logger.warning("texture\u4e3a\u7a7a", a);
  2517. return b
  2518. };
  2519. b.prototype.addSpriteSheet = function (a, b, d) {
  2520. this.addTexture(a, d);
  2521. this._spritesheets[a] =
  2522. b
  2523. };
  2524. b.prototype.removeSpriteSheet = function (a) {
  2525. this.removeTexture(a);
  2526. delete this._spritesheets[a]
  2527. };
  2528. b.prototype.getSpriteSheet = function (a) {
  2529. return this._spritesheets[a]
  2530. };
  2531. return b
  2532. }();
  2533. d.TextureCache = c
  2534. })(ns_egret || (ns_egret = {}));
  2535. (function (d) {
  2536. var c = function () {
  2537. function a() {
  2538. }
  2539. a.getInstance = function () {
  2540. null == a.context && (a.context = new a);
  2541. return a.context
  2542. };
  2543. a.prototype.send = function (a) {
  2544. };
  2545. a.STATE_COMPLETE = "XHRLoaderComplete";
  2546. a.GET = "GET";
  2547. a.POST = "POST";
  2548. a.context = null;
  2549. return a
  2550. }();
  2551. d.NetContext = c;
  2552. var b = function () {
  2553. return function (a, b, d, g, h) {
  2554. "undefined" === typeof g && (g = c.GET);
  2555. "undefined" === typeof h && (h = void 0);
  2556. this.url = a;
  2557. this.callback = b;
  2558. this.thisObj = d;
  2559. this.method = g;
  2560. this.data = h
  2561. }
  2562. }();
  2563. d.URLRequest = b
  2564. })(ns_egret || (ns_egret = {}));
  2565. __extends = this.__extends || function (d, c) {
  2566. function b() {
  2567. this.constructor = d
  2568. }
  2569. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  2570. b.prototype = c.prototype;
  2571. d.prototype = new b
  2572. };
  2573. (function (d) {
  2574. var c = function (b) {
  2575. function a() {
  2576. b.apply(this, arguments)
  2577. }
  2578. __extends(a, b);
  2579. a.prototype.send = function (a) {
  2580. var b = this._getXMLHttpRequest();
  2581. b.open(a.method, a.url);
  2582. void 0 != a.type && this._setXMLHttpRequestHeader(b, a.type);
  2583. b.onreadystatechange = function () {
  2584. 4 == b.readyState && 200 == b.status && a.callback.apply(a.thisObj, [b])
  2585. };
  2586. b.send(a.data)
  2587. };
  2588. a.prototype._setXMLHttpRequestHeader = function (a, b) {
  2589. /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent) ? b == d.ResourceLoader.DATA_TYPE_BINARY ? a.setRequestHeader("Accept-Charset",
  2590. "x-user-defined") : a.setRequestHeader("Accept-Charset", "utf-8") : a.overrideMimeType && (b == d.ResourceLoader.DATA_TYPE_BINARY ? a.overrideMimeType("text/plain; charset\x3dx-user-defined") : a.overrideMimeType("text/plain; charset\x3dutf-8"))
  2591. };
  2592. a.prototype._getXMLHttpRequest = function () {
  2593. return window.XMLHttpRequest ? new window.XMLHttpRequest : new ActiveXObject("MSXML2.XMLHTTP")
  2594. };
  2595. return a
  2596. }(d.NetContext);
  2597. d.HTML5NetContext = c
  2598. })(ns_egret || (ns_egret = {}));
  2599. ns_egret.Codec = {name: "Jacob__Codec"};
  2600. ns_egret.Utils = {};
  2601. ns_egret.Utils.unzip = function () {
  2602. return ns_egret.Codec.GZip.gunzip.apply(ns_egret.Codec.GZip, arguments)
  2603. };
  2604. ns_egret.Utils.unzipBase64 = function () {
  2605. var d = ns_egret.Codec.Base64.decode.apply(ns_egret.Codec.Base64, arguments);
  2606. return ns_egret.Codec.GZip.gunzip.apply(ns_egret.Codec.GZip, [d])
  2607. };
  2608. ns_egret.Utils.unzipBase64AsArray = function (d, c) {
  2609. c = c || 1;
  2610. var b = this.unzipBase64(d), a = [], e, f, g;
  2611. e = 0;
  2612. for (g = b.length / c; e < g; e++) {
  2613. a[e] = 0;
  2614. for (f = c - 1; 0 <= f; --f)a[e] += b.charCodeAt(e * c + f) << 8 * f
  2615. }
  2616. return a
  2617. };
  2618. ns_egret.Utils.unzipAsArray = function (d, c) {
  2619. c = c || 1;
  2620. var b = this.unzip(d), a = [], e, f, g;
  2621. e = 0;
  2622. for (g = b.length / c; e < g; e++) {
  2623. a[e] = 0;
  2624. for (f = c - 1; 0 <= f; --f)a[e] += b.charCodeAt(e * c + f) << 8 * f
  2625. }
  2626. return a
  2627. };
  2628. ns_egret.Utils.StringToArray = function (d) {
  2629. d = d.split(",");
  2630. var c = [], b;
  2631. for (b = 0; b < d.length; b++)c.push(parseInt(d[b]));
  2632. return c
  2633. };
  2634. ns_egret.Codec.Base64 = {name: "Jacob__Codec__Base64"};
  2635. ns_egret.Codec.Base64._keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\x3d";
  2636. ns_egret.Codec.Base64.decode = function (d) {
  2637. var c = [], b, a, e, f, g, h = 0;
  2638. for (d = d.replace(/[^A-Za-z0-9\+\/\=]/g, ""); h < d.length;)b = this._keyStr.indexOf(d.charAt(h++)), a = this._keyStr.indexOf(d.charAt(h++)), f = this._keyStr.indexOf(d.charAt(h++)), g = this._keyStr.indexOf(d.charAt(h++)), b = b << 2 | a >> 4, a = (a & 15) << 4 | f >> 2, e = (f & 3) << 6 | g, c.push(String.fromCharCode(b)), 64 != f && c.push(String.fromCharCode(a)), 64 != g && c.push(String.fromCharCode(e));
  2639. return c = c.join("")
  2640. };
  2641. ns_egret.Codec.Base64.decodeAsArray = function (d, c) {
  2642. var b = this.decode(d), a = [], e, f, g;
  2643. e = 0;
  2644. for (g = b.length / c; e < g; e++) {
  2645. a[e] = 0;
  2646. for (f = c - 1; 0 <= f; --f)a[e] += b.charCodeAt(e * c + f) << 8 * f
  2647. }
  2648. return a
  2649. };
  2650. ns_egret.Utils.uint8ArrayToUint32Array = function (d) {
  2651. if (0 != d.length % 4)return null;
  2652. for (var c = d.length / 4, b = window.Uint32Array ? new Uint32Array(c) : [], a = 0; a < c; a++) {
  2653. var e = 4 * a;
  2654. b[a] = d[e] + 256 * d[e + 1] + 65536 * d[e + 2] + 16777216 * d[e + 3]
  2655. }
  2656. return b
  2657. };
  2658. ns_egret.Codec.GZip = function (d) {
  2659. this.data = d;
  2660. this.debug = !1;
  2661. this.gpflags = void 0;
  2662. this.files = 0;
  2663. this.unzipped = [];
  2664. this.buf32k = Array(32768);
  2665. this.bIdx = 0;
  2666. this.modeZIP = !1;
  2667. this.bytepos = 0;
  2668. this.bb = 1;
  2669. this.bits = 0;
  2670. this.nameBuf = [];
  2671. this.fileout = void 0;
  2672. this.literalTree = Array(ns_egret.Codec.GZip.LITERALS);
  2673. this.distanceTree = Array(32);
  2674. this.treepos = 0;
  2675. this.Places = null;
  2676. this.len = 0;
  2677. this.fpos = Array(17);
  2678. this.fpos[0] = 0;
  2679. this.fmax = this.flens = void 0
  2680. };
  2681. ns_egret.Codec.GZip.gunzip = function (d) {
  2682. return(new ns_egret.Codec.GZip(d)).gunzip()[0][0]
  2683. };
  2684. ns_egret.Codec.GZip.HufNode = function () {
  2685. this.b1 = this.b0 = 0;
  2686. this.jump = null;
  2687. this.jumppos = -1
  2688. };
  2689. ns_egret.Codec.GZip.LITERALS = 288;
  2690. ns_egret.Codec.GZip.NAMEMAX = 256;
  2691. ns_egret.Codec.GZip.bitReverse = [0, 128, 64, 192, 32, 160, 96, 224, 16, 144, 80, 208, 48, 176, 112, 240, 8, 136, 72, 200, 40, 168, 104, 232, 24, 152, 88, 216, 56, 184, 120, 248, 4, 132, 68, 196, 36, 164, 100, 228, 20, 148, 84, 212, 52, 180, 116, 244, 12, 140, 76, 204, 44, 172, 108, 236, 28, 156, 92, 220, 60, 188, 124, 252, 2, 130, 66, 194, 34, 162, 98, 226, 18, 146, 82, 210, 50, 178, 114, 242, 10, 138, 74, 202, 42, 170, 106, 234, 26, 154, 90, 218, 58, 186, 122, 250, 6, 134, 70, 198, 38, 166, 102, 230, 22, 150, 86, 214, 54, 182, 118, 246, 14, 142, 78, 206, 46, 174, 110, 238, 30, 158, 94, 222, 62, 190, 126, 254, 1, 129, 65, 193,
  2692. 33, 161, 97, 225, 17, 145, 81, 209, 49, 177, 113, 241, 9, 137, 73, 201, 41, 169, 105, 233, 25, 153, 89, 217, 57, 185, 121, 249, 5, 133, 69, 197, 37, 165, 101, 229, 21, 149, 85, 213, 53, 181, 117, 245, 13, 141, 77, 205, 45, 173, 109, 237, 29, 157, 93, 221, 61, 189, 125, 253, 3, 131, 67, 195, 35, 163, 99, 227, 19, 147, 83, 211, 51, 179, 115, 243, 11, 139, 75, 203, 43, 171, 107, 235, 27, 155, 91, 219, 59, 187, 123, 251, 7, 135, 71, 199, 39, 167, 103, 231, 23, 151, 87, 215, 55, 183, 119, 247, 15, 143, 79, 207, 47, 175, 111, 239, 31, 159, 95, 223, 63, 191, 127, 255];
  2693. ns_egret.Codec.GZip.cplens = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0];
  2694. ns_egret.Codec.GZip.cplext = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99];
  2695. ns_egret.Codec.GZip.cpdist = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577];
  2696. ns_egret.Codec.GZip.cpdext = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13];
  2697. ns_egret.Codec.GZip.border = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
  2698. ns_egret.Codec.GZip.prototype.gunzip = function () {
  2699. this.outputArr = [];
  2700. this.nextFile();
  2701. return this.unzipped
  2702. };
  2703. ns_egret.Codec.GZip.prototype.readByte = function () {
  2704. this.bits += 8;
  2705. return this.bytepos < this.data.length ? this.data.charCodeAt(this.bytepos++) : -1
  2706. };
  2707. ns_egret.Codec.GZip.prototype.byteAlign = function () {
  2708. this.bb = 1
  2709. };
  2710. ns_egret.Codec.GZip.prototype.readBit = function () {
  2711. var d;
  2712. this.bits++;
  2713. d = this.bb & 1;
  2714. this.bb >>= 1;
  2715. 0 == this.bb && (this.bb = this.readByte(), d = this.bb & 1, this.bb = this.bb >> 1 | 128);
  2716. return d
  2717. };
  2718. ns_egret.Codec.GZip.prototype.readBits = function (d) {
  2719. for (var c = 0, b = d; b--;)c = c << 1 | this.readBit();
  2720. d && (c = ns_egret.Codec.GZip.bitReverse[c] >> 8 - d);
  2721. return c
  2722. };
  2723. ns_egret.Codec.GZip.prototype.flushBuffer = function () {
  2724. this.bIdx = 0
  2725. };
  2726. ns_egret.Codec.GZip.prototype.addBuffer = function (d) {
  2727. this.buf32k[this.bIdx++] = d;
  2728. this.outputArr.push(String.fromCharCode(d));
  2729. 32768 == this.bIdx && (this.bIdx = 0)
  2730. };
  2731. ns_egret.Codec.GZip.prototype.IsPat = function () {
  2732. for (; ;) {
  2733. if (this.fpos[this.len] >= this.fmax)return-1;
  2734. if (this.flens[this.fpos[this.len]] == this.len)return this.fpos[this.len]++;
  2735. this.fpos[this.len]++
  2736. }
  2737. };
  2738. ns_egret.Codec.GZip.prototype.Rec = function () {
  2739. var d = this.Places[this.treepos], c;
  2740. if (17 == this.len)return-1;
  2741. this.treepos++;
  2742. this.len++;
  2743. c = this.IsPat();
  2744. if (0 <= c)d.b0 = c; else if (d.b0 = 32768, this.Rec())return-1;
  2745. c = this.IsPat();
  2746. if (0 <= c)d.b1 = c, d.jump = null; else if (d.b1 = 32768, d.jump = this.Places[this.treepos], d.jumppos = this.treepos, this.Rec())return-1;
  2747. this.len--;
  2748. return 0
  2749. };
  2750. ns_egret.Codec.GZip.prototype.CreateTree = function (d, c, b, a) {
  2751. this.Places = d;
  2752. this.treepos = 0;
  2753. this.flens = b;
  2754. this.fmax = c;
  2755. for (d = 0; 17 > d; d++)this.fpos[d] = 0;
  2756. this.len = 0;
  2757. return this.Rec() ? -1 : 0
  2758. };
  2759. ns_egret.Codec.GZip.prototype.DecodeValue = function (d) {
  2760. for (var c, b, a = 0, e = d[a]; ;)if (c = this.readBit()) {
  2761. if (!(e.b1 & 32768))return e.b1;
  2762. e = e.jump;
  2763. c = d.length;
  2764. for (b = 0; b < c; b++)if (d[b] === e) {
  2765. a = b;
  2766. break
  2767. }
  2768. } else {
  2769. if (!(e.b0 & 32768))return e.b0;
  2770. a++;
  2771. e = d[a]
  2772. }
  2773. return-1
  2774. };
  2775. ns_egret.Codec.GZip.prototype.DeflateLoop = function () {
  2776. var d, c, b, a, e;
  2777. do if (d = this.readBit(), b = this.readBits(2), 0 == b) {
  2778. this.byteAlign();
  2779. b = this.readByte();
  2780. b |= this.readByte() << 8;
  2781. c = this.readByte();
  2782. c |= this.readByte() << 8;
  2783. for ((b ^ ~c) & 65535 && document.write("BlockLen checksum mismatch\n"); b--;)c = this.readByte(), this.addBuffer(c)
  2784. } else if (1 == b)for (; ;)if (b = ns_egret.Codec.GZip.bitReverse[this.readBits(7)] >> 1, 23 < b ? (b = b << 1 | this.readBit(), 199 < b ? (b -= 128, b = b << 1 | this.readBit()) : (b -= 48, 143 < b && (b += 136))) : b += 256, 256 > b)this.addBuffer(b);
  2785. else if (256 == b)break; else {
  2786. var f;
  2787. b -= 257;
  2788. e = this.readBits(ns_egret.Codec.GZip.cplext[b]) + ns_egret.Codec.GZip.cplens[b];
  2789. b = ns_egret.Codec.GZip.bitReverse[this.readBits(5)] >> 3;
  2790. 8 < ns_egret.Codec.GZip.cpdext[b] ? (f = this.readBits(8), f |= this.readBits(ns_egret.Codec.GZip.cpdext[b] - 8) << 8) : f = this.readBits(ns_egret.Codec.GZip.cpdext[b]);
  2791. f += ns_egret.Codec.GZip.cpdist[b];
  2792. for (b = 0; b < e; b++)c = this.buf32k[this.bIdx - f & 32767], this.addBuffer(c)
  2793. } else if (2 == b) {
  2794. var g = Array(320);
  2795. c = 257 + this.readBits(5);
  2796. f = 1 + this.readBits(5);
  2797. a = 4 +
  2798. this.readBits(4);
  2799. for (b = 0; 19 > b; b++)g[b] = 0;
  2800. for (b = 0; b < a; b++)g[ns_egret.Codec.GZip.border[b]] = this.readBits(3);
  2801. e = this.distanceTree.length;
  2802. for (a = 0; a < e; a++)this.distanceTree[a] = new ns_egret.Codec.GZip.HufNode;
  2803. if (this.CreateTree(this.distanceTree, 19, g, 0))return this.flushBuffer(), 1;
  2804. e = c + f;
  2805. a = 0;
  2806. for (var h = -1; a < e;)if (h++, b = this.DecodeValue(this.distanceTree), 16 > b)g[a++] = b; else if (16 == b) {
  2807. var k;
  2808. b = 3 + this.readBits(2);
  2809. if (a + b > e)return this.flushBuffer(), 1;
  2810. for (k = a ? g[a - 1] : 0; b--;)g[a++] = k
  2811. } else {
  2812. b = 17 == b ? 3 + this.readBits(3) :
  2813. 11 + this.readBits(7);
  2814. if (a + b > e)return this.flushBuffer(), 1;
  2815. for (; b--;)g[a++] = 0
  2816. }
  2817. e = this.literalTree.length;
  2818. for (a = 0; a < e; a++)this.literalTree[a] = new ns_egret.Codec.GZip.HufNode;
  2819. if (this.CreateTree(this.literalTree, c, g, 0))return this.flushBuffer(), 1;
  2820. e = this.literalTree.length;
  2821. for (a = 0; a < e; a++)this.distanceTree[a] = new ns_egret.Codec.GZip.HufNode;
  2822. b = [];
  2823. for (a = c; a < g.length; a++)b[a - c] = g[a];
  2824. if (this.CreateTree(this.distanceTree, f, b, 0))return this.flushBuffer(), 1;
  2825. for (; ;)if (b = this.DecodeValue(this.literalTree), 256 <= b) {
  2826. b -=
  2827. 256;
  2828. if (0 == b)break;
  2829. b--;
  2830. e = this.readBits(ns_egret.Codec.GZip.cplext[b]) + ns_egret.Codec.GZip.cplens[b];
  2831. b = this.DecodeValue(this.distanceTree);
  2832. 8 < ns_egret.Codec.GZip.cpdext[b] ? (f = this.readBits(8), f |= this.readBits(ns_egret.Codec.GZip.cpdext[b] - 8) << 8) : f = this.readBits(ns_egret.Codec.GZip.cpdext[b]);
  2833. for (f += ns_egret.Codec.GZip.cpdist[b]; e--;)c = this.buf32k[this.bIdx - f & 32767], this.addBuffer(c)
  2834. } else this.addBuffer(b)
  2835. } while (!d);
  2836. this.flushBuffer();
  2837. this.byteAlign();
  2838. return 0
  2839. };
  2840. ns_egret.Codec.GZip.prototype.unzipFile = function (d) {
  2841. var c;
  2842. this.gunzip();
  2843. for (c = 0; c < this.unzipped.length; c++)if (this.unzipped[c][1] == d)return this.unzipped[c][0]
  2844. };
  2845. ns_egret.Codec.GZip.prototype.nextFile = function () {
  2846. this.outputArr = [];
  2847. this.modeZIP = !1;
  2848. var d = [];
  2849. d[0] = this.readByte();
  2850. d[1] = this.readByte();
  2851. 120 == d[0] && 218 == d[1] && (this.DeflateLoop(), this.unzipped[this.files] = [this.outputArr.join(""), "geonext.gxt"], this.files++);
  2852. 31 == d[0] && 139 == d[1] && (this.skipdir(), this.unzipped[this.files] = [this.outputArr.join(""), "file"], this.files++);
  2853. if (80 == d[0] && 75 == d[1] && (this.modeZIP = !0, d[2] = this.readByte(), d[3] = this.readByte(), 3 == d[2] && 4 == d[3])) {
  2854. d[0] = this.readByte();
  2855. d[1] = this.readByte();
  2856. this.gpflags = this.readByte();
  2857. this.gpflags |= this.readByte() << 8;
  2858. d = this.readByte();
  2859. d |= this.readByte() << 8;
  2860. this.readByte();
  2861. this.readByte();
  2862. this.readByte();
  2863. this.readByte();
  2864. this.readByte();
  2865. this.readByte();
  2866. this.readByte();
  2867. this.readByte();
  2868. this.readByte();
  2869. this.readByte();
  2870. this.readByte();
  2871. this.readByte();
  2872. var c = this.readByte(), c = c | this.readByte() << 8, b = this.readByte(), b = b | this.readByte() << 8, a = 0;
  2873. for (this.nameBuf = []; c--;) {
  2874. var e = this.readByte();
  2875. "/" == e | ":" == e ? a = 0 : a < ns_egret.Codec.GZip.NAMEMAX - 1 && (this.nameBuf[a++] =
  2876. String.fromCharCode(e))
  2877. }
  2878. this.fileout || (this.fileout = this.nameBuf);
  2879. for (var a = 0; a < b;)this.readByte(), a++;
  2880. 8 == d && (this.DeflateLoop(), this.unzipped[this.files] = [this.outputArr.join(""), this.nameBuf.join("")], this.files++);
  2881. this.skipdir()
  2882. }
  2883. };
  2884. ns_egret.Codec.GZip.prototype.skipdir = function () {
  2885. var d = [], c;
  2886. this.gpflags & 8 && (d[0] = this.readByte(), d[1] = this.readByte(), d[2] = this.readByte(), d[3] = this.readByte(), this.readByte(), this.readByte(), this.readByte(), this.readByte(), this.readByte(), this.readByte(), this.readByte(), this.readByte());
  2887. this.modeZIP && this.nextFile();
  2888. d[0] = this.readByte();
  2889. if (8 != d[0])return 0;
  2890. this.gpflags = this.readByte();
  2891. this.readByte();
  2892. this.readByte();
  2893. this.readByte();
  2894. this.readByte();
  2895. this.readByte();
  2896. this.readByte();
  2897. if (this.gpflags &
  2898. 4) {
  2899. d[0] = this.readByte();
  2900. d[2] = this.readByte();
  2901. this.len = d[0] + 256 * d[1];
  2902. for (d = 0; d < this.len; d++)this.readByte()
  2903. }
  2904. if (this.gpflags & 8) {
  2905. d = 0;
  2906. for (this.nameBuf = []; c = this.readByte();) {
  2907. if ("7" == c || ":" == c)d = 0;
  2908. d < ns_egret.Codec.GZip.NAMEMAX - 1 && (this.nameBuf[d++] = c)
  2909. }
  2910. }
  2911. if (this.gpflags & 16)for (; this.readByte(););
  2912. this.gpflags & 2 && (this.readByte(), this.readByte());
  2913. this.DeflateLoop();
  2914. this.readByte();
  2915. this.readByte();
  2916. this.readByte();
  2917. this.readByte();
  2918. this.modeZIP && this.nextFile()
  2919. };
  2920. /*
  2921. zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */
  2922. (function () {
  2923. function d(a) {
  2924. throw a;
  2925. }
  2926. function c(a, b) {
  2927. var d = a.split("."), e = H;
  2928. !(d[0]in e) && e.execScript && e.execScript("var " + d[0]);
  2929. for (var c; d.length && (c = d.shift());)!d.length && b !== D ? e[c] = b : e = e[c] ? e[c] : e[c] = {}
  2930. }
  2931. function b(a) {
  2932. if ("string" === typeof a) {
  2933. a = a.split("");
  2934. var b, d;
  2935. b = 0;
  2936. for (d = a.length; b < d; b++)a[b] = (a[b].charCodeAt(0) & 255) >>> 0
  2937. }
  2938. b = 1;
  2939. d = 0;
  2940. for (var e = a.length, c, f = 0; 0 < e;) {
  2941. c = 1024 < e ? 1024 : e;
  2942. e -= c;
  2943. do b += a[f++], d += b; while (--c);
  2944. b %= 65521;
  2945. d %= 65521
  2946. }
  2947. return(d << 16 | b) >>> 0
  2948. }
  2949. function a(a, b) {
  2950. this.index = "number" === typeof b ?
  2951. b : 0;
  2952. this.i = 0;
  2953. this.buffer = a instanceof(u ? Uint8Array : Array) ? a : new (u ? Uint8Array : Array)(32768);
  2954. 2 * this.buffer.length <= this.index && d(Error("invalid index"));
  2955. this.buffer.length <= this.index && this.f()
  2956. }
  2957. function e(a) {
  2958. this.buffer = new (u ? Uint16Array : Array)(2 * a);
  2959. this.length = 0
  2960. }
  2961. function f(a) {
  2962. var b = a.length, d = 0, e = Number.POSITIVE_INFINITY, c, f, g, h, n, s, q, k, x;
  2963. for (k = 0; k < b; ++k)a[k] > d && (d = a[k]), a[k] < e && (e = a[k]);
  2964. c = 1 << d;
  2965. f = new (u ? Uint32Array : Array)(c);
  2966. g = 1;
  2967. h = 0;
  2968. for (n = 2; g <= d;) {
  2969. for (k = 0; k < b; ++k)if (a[k] === g) {
  2970. s = 0;
  2971. q = h;
  2972. for (x = 0; x < g; ++x)s =
  2973. s << 1 | q & 1, q >>= 1;
  2974. for (x = s; x < c; x += n)f[x] = g << 16 | k;
  2975. ++h
  2976. }
  2977. ++g;
  2978. h <<= 1;
  2979. n <<= 1
  2980. }
  2981. return[f, d, e]
  2982. }
  2983. function g(a, b) {
  2984. this.h = J;
  2985. this.w = 0;
  2986. this.input = a;
  2987. this.b = 0;
  2988. b && (b.lazy && (this.w = b.lazy), "number" === typeof b.compressionType && (this.h = b.compressionType), b.outputBuffer && (this.a = u && b.outputBuffer instanceof Array ? new Uint8Array(b.outputBuffer) : b.outputBuffer), "number" === typeof b.outputIndex && (this.b = b.outputIndex));
  2989. this.a || (this.a = new (u ? Uint8Array : Array)(32768))
  2990. }
  2991. function h(a, b) {
  2992. this.length = a;
  2993. this.G = b
  2994. }
  2995. function k() {
  2996. var a = E;
  2997. switch (F) {
  2998. case 3 ===
  2999. a:
  3000. return[257, a - 3, 0];
  3001. case 4 === a:
  3002. return[258, a - 4, 0];
  3003. case 5 === a:
  3004. return[259, a - 5, 0];
  3005. case 6 === a:
  3006. return[260, a - 6, 0];
  3007. case 7 === a:
  3008. return[261, a - 7, 0];
  3009. case 8 === a:
  3010. return[262, a - 8, 0];
  3011. case 9 === a:
  3012. return[263, a - 9, 0];
  3013. case 10 === a:
  3014. return[264, a - 10, 0];
  3015. case 12 >= a:
  3016. return[265, a - 11, 1];
  3017. case 14 >= a:
  3018. return[266, a - 13, 1];
  3019. case 16 >= a:
  3020. return[267, a - 15, 1];
  3021. case 18 >= a:
  3022. return[268, a - 17, 1];
  3023. case 22 >= a:
  3024. return[269, a - 19, 2];
  3025. case 26 >= a:
  3026. return[270, a - 23, 2];
  3027. case 30 >= a:
  3028. return[271, a - 27, 2];
  3029. case 34 >= a:
  3030. return[272, a - 31, 2];
  3031. case 42 >= a:
  3032. return[273, a - 35, 3];
  3033. case 50 >=
  3034. a:
  3035. return[274, a - 43, 3];
  3036. case 58 >= a:
  3037. return[275, a - 51, 3];
  3038. case 66 >= a:
  3039. return[276, a - 59, 3];
  3040. case 82 >= a:
  3041. return[277, a - 67, 4];
  3042. case 98 >= a:
  3043. return[278, a - 83, 4];
  3044. case 114 >= a:
  3045. return[279, a - 99, 4];
  3046. case 130 >= a:
  3047. return[280, a - 115, 4];
  3048. case 162 >= a:
  3049. return[281, a - 131, 5];
  3050. case 194 >= a:
  3051. return[282, a - 163, 5];
  3052. case 226 >= a:
  3053. return[283, a - 195, 5];
  3054. case 257 >= a:
  3055. return[284, a - 227, 5];
  3056. case 258 === a:
  3057. return[285, a - 258, 0];
  3058. default:
  3059. d("invalid length: " + a)
  3060. }
  3061. }
  3062. function l(a, b) {
  3063. function e(a, b) {
  3064. var c = a.G, f = [], g = 0, h;
  3065. h = L[a.length];
  3066. f[g++] = h & 65535;
  3067. f[g++] = h >> 16 & 255;
  3068. f[g++] =
  3069. h >> 24;
  3070. var n;
  3071. switch (F) {
  3072. case 1 === c:
  3073. n = [0, c - 1, 0];
  3074. break;
  3075. case 2 === c:
  3076. n = [1, c - 2, 0];
  3077. break;
  3078. case 3 === c:
  3079. n = [2, c - 3, 0];
  3080. break;
  3081. case 4 === c:
  3082. n = [3, c - 4, 0];
  3083. break;
  3084. case 6 >= c:
  3085. n = [4, c - 5, 1];
  3086. break;
  3087. case 8 >= c:
  3088. n = [5, c - 7, 1];
  3089. break;
  3090. case 12 >= c:
  3091. n = [6, c - 9, 2];
  3092. break;
  3093. case 16 >= c:
  3094. n = [7, c - 13, 2];
  3095. break;
  3096. case 24 >= c:
  3097. n = [8, c - 17, 3];
  3098. break;
  3099. case 32 >= c:
  3100. n = [9, c - 25, 3];
  3101. break;
  3102. case 48 >= c:
  3103. n = [10, c - 33, 4];
  3104. break;
  3105. case 64 >= c:
  3106. n = [11, c - 49, 4];
  3107. break;
  3108. case 96 >= c:
  3109. n = [12, c - 65, 5];
  3110. break;
  3111. case 128 >= c:
  3112. n = [13, c - 97, 5];
  3113. break;
  3114. case 192 >= c:
  3115. n = [14, c - 129, 6];
  3116. break;
  3117. case 256 >= c:
  3118. n = [15, c - 193, 6];
  3119. break;
  3120. case 384 >= c:
  3121. n = [16, c - 257, 7];
  3122. break;
  3123. case 512 >= c:
  3124. n = [17, c - 385, 7];
  3125. break;
  3126. case 768 >= c:
  3127. n = [18, c - 513, 8];
  3128. break;
  3129. case 1024 >= c:
  3130. n = [19, c - 769, 8];
  3131. break;
  3132. case 1536 >= c:
  3133. n = [20, c - 1025, 9];
  3134. break;
  3135. case 2048 >= c:
  3136. n = [21, c - 1537, 9];
  3137. break;
  3138. case 3072 >= c:
  3139. n = [22, c - 2049, 10];
  3140. break;
  3141. case 4096 >= c:
  3142. n = [23, c - 3073, 10];
  3143. break;
  3144. case 6144 >= c:
  3145. n = [24, c - 4097, 11];
  3146. break;
  3147. case 8192 >= c:
  3148. n = [25, c - 6145, 11];
  3149. break;
  3150. case 12288 >= c:
  3151. n = [26, c - 8193, 12];
  3152. break;
  3153. case 16384 >= c:
  3154. n = [27, c - 12289, 12];
  3155. break;
  3156. case 24576 >= c:
  3157. n = [28, c - 16385, 13];
  3158. break;
  3159. case 32768 >= c:
  3160. n = [29, c - 24577, 13];
  3161. break;
  3162. default:
  3163. d("invalid distance")
  3164. }
  3165. h =
  3166. n;
  3167. f[g++] = h[0];
  3168. f[g++] = h[1];
  3169. f[g++] = h[2];
  3170. c = 0;
  3171. for (g = f.length; c < g; ++c)x[v++] = f[c];
  3172. l[f[0]]++;
  3173. p[f[3]]++;
  3174. m = a.length + b - 1;
  3175. k = null
  3176. }
  3177. var c, f, g, n, s, q = {}, k, x = u ? new Uint16Array(2 * b.length) : [], v = 0, m = 0, l = new (u ? Uint32Array : Array)(286), p = new (u ? Uint32Array : Array)(30), A = a.w, t;
  3178. if (!u) {
  3179. for (g = 0; 285 >= g;)l[g++] = 0;
  3180. for (g = 0; 29 >= g;)p[g++] = 0
  3181. }
  3182. l[256] = 1;
  3183. c = 0;
  3184. for (f = b.length; c < f; ++c) {
  3185. g = s = 0;
  3186. for (n = 3; g < n && c + g !== f; ++g)s = s << 8 | b[c + g];
  3187. q[s] === D && (q[s] = []);
  3188. g = q[s];
  3189. if (!(0 < m--)) {
  3190. for (; 0 < g.length && 32768 < c - g[0];)g.shift();
  3191. if (c + 3 >= f) {
  3192. k && e(k, -1);
  3193. g = 0;
  3194. for (n = f - c; g < n; ++g)t = b[c + g], x[v++] = t, ++l[t];
  3195. break
  3196. }
  3197. if (0 < g.length) {
  3198. s = n = D;
  3199. var r = 0, B = D, w = D, y = B = D, z = b.length, w = 0, y = g.length;
  3200. a:for (; w < y; w++) {
  3201. n = g[y - w - 1];
  3202. B = 3;
  3203. if (3 < r) {
  3204. for (B = r; 3 < B; B--)if (b[n + B - 1] !== b[c + B - 1])continue a;
  3205. B = r
  3206. }
  3207. for (; 258 > B && c + B < z && b[n + B] === b[c + B];)++B;
  3208. B > r && (s = n, r = B);
  3209. if (258 === B)break
  3210. }
  3211. n = new h(r, c - s);
  3212. k ? k.length < n.length ? (t = b[c - 1], x[v++] = t, ++l[t], e(n, 0)) : e(k, -1) : n.length < A ? k = n : e(n, 0)
  3213. } else k ? e(k, -1) : (t = b[c], x[v++] = t, ++l[t])
  3214. }
  3215. g.push(c)
  3216. }
  3217. x[v++] = 256;
  3218. l[256]++;
  3219. a.L = l;
  3220. a.K = p;
  3221. return u ? x.subarray(0, v) : x
  3222. }
  3223. function m(a, b) {
  3224. function d(a) {
  3225. var b = x[a][v[a]];
  3226. b === q ? (d(a + 1), d(a + 1)) : --k[b];
  3227. ++v[a]
  3228. }
  3229. var c = a.length, f = new e(572), g = new (u ? Uint8Array : Array)(c), n, h, s;
  3230. if (!u)for (h = 0; h < c; h++)g[h] = 0;
  3231. for (h = 0; h < c; ++h)0 < a[h] && f.push(h, a[h]);
  3232. c = Array(f.length / 2);
  3233. n = new (u ? Uint32Array : Array)(f.length / 2);
  3234. if (1 === c.length)return g[f.pop().index] = 1, g;
  3235. h = 0;
  3236. for (s = f.length / 2; h < s; ++h)c[h] = f.pop(), n[h] = c[h].value;
  3237. var q = n.length;
  3238. h = new (u ? Uint16Array : Array)(b);
  3239. var f = new (u ? Uint8Array : Array)(b), k = new (u ? Uint8Array : Array)(q);
  3240. s = Array(b);
  3241. var x = Array(b), v =
  3242. Array(b), m = (1 << b) - q, l = 1 << b - 1, p, A, t;
  3243. h[b - 1] = q;
  3244. for (p = 0; p < b; ++p)m < l ? f[p] = 0 : (f[p] = 1, m -= l), m <<= 1, h[b - 2 - p] = (h[b - 1 - p] / 2 | 0) + q;
  3245. h[0] = f[0];
  3246. s[0] = Array(h[0]);
  3247. x[0] = Array(h[0]);
  3248. for (p = 1; p < b; ++p)h[p] > 2 * h[p - 1] + f[p] && (h[p] = 2 * h[p - 1] + f[p]), s[p] = Array(h[p]), x[p] = Array(h[p]);
  3249. for (m = 0; m < q; ++m)k[m] = b;
  3250. for (l = 0; l < h[b - 1]; ++l)s[b - 1][l] = n[l], x[b - 1][l] = l;
  3251. for (m = 0; m < b; ++m)v[m] = 0;
  3252. 1 === f[b - 1] && (--k[0], ++v[b - 1]);
  3253. for (p = b - 2; 0 <= p; --p) {
  3254. A = m = 0;
  3255. t = v[p + 1];
  3256. for (l = 0; l < h[p]; l++)A = s[p + 1][t] + s[p + 1][t + 1], A > n[m] ? (s[p][l] = A, x[p][l] = q, t += 2) : (s[p][l] = n[m],
  3257. x[p][l] = m, ++m);
  3258. v[p] = 0;
  3259. 1 === f[p] && d(p)
  3260. }
  3261. n = k;
  3262. h = 0;
  3263. for (s = c.length; h < s; ++h)g[c[h].index] = n[h];
  3264. return g
  3265. }
  3266. function p(a) {
  3267. var b = new (u ? Uint16Array : Array)(a.length), c = [], e = [], f = 0, g, h, n;
  3268. g = 0;
  3269. for (h = a.length; g < h; g++)c[a[g]] = (c[a[g]] | 0) + 1;
  3270. g = 1;
  3271. for (h = 16; g <= h; g++)e[g] = f, f += c[g] | 0, f > 1 << g && d("overcommitted"), f <<= 1;
  3272. 65536 > f && d("undercommitted");
  3273. g = 0;
  3274. for (h = a.length; g < h; g++) {
  3275. f = e[a[g]];
  3276. e[a[g]] += 1;
  3277. c = b[g] = 0;
  3278. for (n = a[g]; c < n; c++)b[g] = b[g] << 1 | f & 1, f >>>= 1
  3279. }
  3280. return b
  3281. }
  3282. function n(a, b) {
  3283. this.input = a;
  3284. this.a = new (u ? Uint8Array : Array)(32768);
  3285. this.h =
  3286. I.j;
  3287. var d = {}, c;
  3288. if ((b || !(b = {})) && "number" === typeof b.compressionType)this.h = b.compressionType;
  3289. for (c in b)d[c] = b[c];
  3290. d.outputBuffer = this.a;
  3291. this.z = new g(this.input, d)
  3292. }
  3293. function q(a, b) {
  3294. this.k = [];
  3295. this.l = 32768;
  3296. this.e = this.g = this.c = this.q = 0;
  3297. this.input = u ? new Uint8Array(a) : a;
  3298. this.s = !1;
  3299. this.m = C;
  3300. this.B = !1;
  3301. if (b || !(b = {}))b.index && (this.c = b.index), b.bufferSize && (this.l = b.bufferSize), b.bufferType && (this.m = b.bufferType), b.resize && (this.B = b.resize);
  3302. switch (this.m) {
  3303. case M:
  3304. this.b = 32768;
  3305. this.a = new (u ? Uint8Array : Array)(32768 +
  3306. this.l + 258);
  3307. break;
  3308. case C:
  3309. this.b = 0;
  3310. this.a = new (u ? Uint8Array : Array)(this.l);
  3311. this.f = this.J;
  3312. this.t = this.H;
  3313. this.o = this.I;
  3314. break;
  3315. default:
  3316. d(Error("invalid inflate mode"))
  3317. }
  3318. }
  3319. function s(a, b) {
  3320. for (var c = a.g, e = a.e, f = a.input, g = a.c, h; e < b;)h = f[g++], h === D && d(Error("input buffer is broken")), c |= h << e, e += 8;
  3321. a.g = c >>> b;
  3322. a.e = e - b;
  3323. a.c = g;
  3324. return c & (1 << b) - 1
  3325. }
  3326. function x(a, b) {
  3327. for (var c = a.g, e = a.e, f = a.input, g = a.c, h = b[0], n = b[1], s; e < n;)s = f[g++], s === D && d(Error("input buffer is broken")), c |= s << e, e += 8;
  3328. f = h[c & (1 << n) - 1];
  3329. h = f >>> 16;
  3330. a.g = c >> h;
  3331. a.e =
  3332. e - h;
  3333. a.c = g;
  3334. return f & 65535
  3335. }
  3336. function A(a) {
  3337. function b(a, d, c) {
  3338. var e, f, g, h;
  3339. for (h = 0; h < a;)switch (e = x(this, d), e) {
  3340. case 16:
  3341. for (g = 3 + s(this, 2); g--;)c[h++] = f;
  3342. break;
  3343. case 17:
  3344. for (g = 3 + s(this, 3); g--;)c[h++] = 0;
  3345. f = 0;
  3346. break;
  3347. case 18:
  3348. for (g = 11 + s(this, 7); g--;)c[h++] = 0;
  3349. f = 0;
  3350. break;
  3351. default:
  3352. f = c[h++] = e
  3353. }
  3354. return c
  3355. }
  3356. var d = s(a, 5) + 257, c = s(a, 5) + 1, e = s(a, 4) + 4, g = new (u ? Uint8Array : Array)(K.length), h;
  3357. for (h = 0; h < e; ++h)g[K[h]] = s(a, 3);
  3358. e = f(g);
  3359. g = new (u ? Uint8Array : Array)(d);
  3360. h = new (u ? Uint8Array : Array)(c);
  3361. a.o(f(b.call(a, d, e, g)), f(b.call(a, c, e, h)))
  3362. }
  3363. function B(a, b) {
  3364. var c, e;
  3365. this.input = a;
  3366. this.c = 0;
  3367. if (b || !(b = {}))b.index && (this.c = b.index), b.verify && (this.M = b.verify);
  3368. c = a[this.c++];
  3369. e = a[this.c++];
  3370. switch (c & 15) {
  3371. case O:
  3372. this.method = O;
  3373. break;
  3374. default:
  3375. d(Error("unsupported compression method"))
  3376. }
  3377. 0 !== ((c << 8) + e) % 31 && d(Error("invalid fcheck flag:" + ((c << 8) + e) % 31));
  3378. e & 32 && d(Error("fdict flag is not supported"));
  3379. this.A = new q(a, {index: this.c, bufferSize: b.bufferSize, bufferType: b.bufferType, resize: b.resize})
  3380. }
  3381. var D = void 0, F = !0, H = this, u = "undefined" !== typeof Uint8Array && "undefined" !== typeof Uint16Array && "undefined" !== typeof Uint32Array;
  3382. a.prototype.f = function () {
  3383. var a = this.buffer, b, d = a.length, c = new (u ? Uint8Array : Array)(d << 1);
  3384. if (u)c.set(a); else for (b = 0; b < d; ++b)c[b] = a[b];
  3385. return this.buffer = c
  3386. };
  3387. a.prototype.d = function (a, b, d) {
  3388. var c = this.buffer, e = this.index, f = this.i, g = c[e];
  3389. d && 1 < b && (a = 8 < b ? (r[a & 255] << 24 | r[a >>> 8 & 255] << 16 | r[a >>> 16 & 255] << 8 | r[a >>> 24 & 255]) >> 32 - b : r[a] >> 8 - b);
  3390. if (8 > b + f)g = g << b | a, f += b; else for (d = 0; d < b; ++d)g = g << 1 | a >> b - d - 1 & 1, 8 === ++f && (f = 0, c[e++] = r[g], g = 0, e === c.length && (c = this.f()));
  3391. c[e] = g;
  3392. this.buffer = c;
  3393. this.i = f;
  3394. this.index = e
  3395. };
  3396. a.prototype.finish = function () {
  3397. var a = this.buffer, b = this.index, d;
  3398. 0 < this.i && (a[b] <<= 8 - this.i, a[b] = r[a[b]], b++);
  3399. u ? d = a.subarray(0, b) : (a.length = b, d = a);
  3400. return d
  3401. };
  3402. var z = new (u ? Uint8Array : Array)(256), t;
  3403. for (t = 0; 256 > t; ++t) {
  3404. for (var v = t, w = v, y = 7, v = v >>> 1; v; v >>>= 1)w <<= 1, w |= v & 1, --y;
  3405. z[t] = (w << y & 255) >>> 0
  3406. }
  3407. var r = z, z = [0, 1996959894, 3993919788, 2567524794, 124634137, 1886057615, 3915621685, 2657392035, 249268274, 2044508324, 3772115230, 2547177864, 162941995, 2125561021, 3887607047, 2428444049,
  3408. 498536548, 1789927666, 4089016648, 2227061214, 450548861, 1843258603, 4107580753, 2211677639, 325883990, 1684777152, 4251122042, 2321926636, 335633487, 1661365465, 4195302755, 2366115317, 997073096, 1281953886, 3579855332, 2724688242, 1006888145, 1258607687, 3524101629, 2768942443, 901097722, 1119000684, 3686517206, 2898065728, 853044451, 1172266101, 3705015759, 2882616665, 651767980, 1373503546, 3369554304, 3218104598, 565507253, 1454621731, 3485111705, 3099436303, 671266974, 1594198024, 3322730930, 2970347812, 795835527, 1483230225, 3244367275,
  3409. 3060149565, 1994146192, 31158534, 2563907772, 4023717930, 1907459465, 112637215, 2680153253, 3904427059, 2013776290, 251722036, 2517215374, 3775830040, 2137656763, 141376813, 2439277719, 3865271297, 1802195444, 476864866, 2238001368, 4066508878, 1812370925, 453092731, 2181625025, 4111451223, 1706088902, 314042704, 2344532202, 4240017532, 1658658271, 366619977, 2362670323, 4224994405, 1303535960, 984961486, 2747007092, 3569037538, 1256170817, 1037604311, 2765210733, 3554079995, 1131014506, 879679996, 2909243462, 3663771856, 1141124467, 855842277,
  3410. 2852801631, 3708648649, 1342533948, 654459306, 3188396048, 3373015174, 1466479909, 544179635, 3110523913, 3462522015, 1591671054, 702138776, 2966460450, 3352799412, 1504918807, 783551873, 3082640443, 3233442989, 3988292384, 2596254646, 62317068, 1957810842, 3939845945, 2647816111, 81470997, 1943803523, 3814918930, 2489596804, 225274430, 2053790376, 3826175755, 2466906013, 167816743, 2097651377, 4027552580, 2265490386, 503444072, 1762050814, 4150417245, 2154129355, 426522225, 1852507879, 4275313526, 2312317920, 282753626, 1742555852, 4189708143,
  3411. 2394877945, 397917763, 1622183637, 3604390888, 2714866558, 953729732, 1340076626, 3518719985, 2797360999, 1068828381, 1219638859, 3624741850, 2936675148, 906185462, 1090812512, 3747672003, 2825379669, 829329135, 1181335161, 3412177804, 3160834842, 628085408, 1382605366, 3423369109, 3138078467, 570562233, 1426400815, 3317316542, 2998733608, 733239954, 1555261956, 3268935591, 3050360625, 752459403, 1541320221, 2607071920, 3965973030, 1969922972, 40735498, 2617837225, 3943577151, 1913087877, 83908371, 2512341634, 3803740692, 2075208622, 213261112,
  3412. 2463272603, 3855990285, 2094854071, 198958881, 2262029012, 4057260610, 1759359992, 534414190, 2176718541, 4139329115, 1873836001, 414664567, 2282248934, 4279200368, 1711684554, 285281116, 2405801727, 4167216745, 1634467795, 376229701, 2685067896, 3608007406, 1308918612, 956543938, 2808555105, 3495958263, 1231636301, 1047427035, 2932959818, 3654703836, 1088359270, 936918E3, 2847714899, 3736837829, 1202900863, 817233897, 3183342108, 3401237130, 1404277552, 615818150, 3134207493, 3453421203, 1423857449, 601450431, 3009837614, 3294710456, 1567103746,
  3413. 711928724, 3020668471, 3272380065, 1510334235, 755167117];
  3414. u && new Uint32Array(z);
  3415. e.prototype.getParent = function (a) {
  3416. return 2 * ((a - 2) / 4 | 0)
  3417. };
  3418. e.prototype.push = function (a, b) {
  3419. var d, c, e = this.buffer, f;
  3420. d = this.length;
  3421. e[this.length++] = b;
  3422. for (e[this.length++] = a; 0 < d;)if (c = this.getParent(d), e[d] > e[c])f = e[d], e[d] = e[c], e[c] = f, f = e[d + 1], e[d + 1] = e[c + 1], e[c + 1] = f, d = c; else break;
  3423. return this.length
  3424. };
  3425. e.prototype.pop = function () {
  3426. var a, b, d = this.buffer, c, e, f;
  3427. b = d[0];
  3428. a = d[1];
  3429. this.length -= 2;
  3430. d[0] = d[this.length];
  3431. d[1] = d[this.length + 1];
  3432. for (f =
  3433. 0; ;) {
  3434. e = 2 * f + 2;
  3435. if (e >= this.length)break;
  3436. e + 2 < this.length && d[e + 2] > d[e] && (e += 2);
  3437. if (d[e] > d[f])c = d[f], d[f] = d[e], d[e] = c, c = d[f + 1], d[f + 1] = d[e + 1], d[e + 1] = c; else break;
  3438. f = e
  3439. }
  3440. return{index: a, value: b, length: this.length}
  3441. };
  3442. var J = 2, z = {NONE: 0, r: 1, j: J, N: 3}, N = [];
  3443. for (t = 0; 288 > t; t++)switch (F) {
  3444. case 143 >= t:
  3445. N.push([t + 48, 8]);
  3446. break;
  3447. case 255 >= t:
  3448. N.push([t - 144 + 400, 9]);
  3449. break;
  3450. case 279 >= t:
  3451. N.push([t - 256 + 0, 7]);
  3452. break;
  3453. case 287 >= t:
  3454. N.push([t - 280 + 192, 8]);
  3455. break;
  3456. default:
  3457. d("invalid literal: " + t)
  3458. }
  3459. g.prototype.n = function () {
  3460. var b, c, e, f, g = this.input;
  3461. switch (this.h) {
  3462. case 0:
  3463. e = 0;
  3464. for (f = g.length; e < f;) {
  3465. c = u ? g.subarray(e, e + 65535) : g.slice(e, e + 65535);
  3466. e += c.length;
  3467. var h = e === f, n = D, s = n = D, s = n = D, q = this.a, k = this.b;
  3468. if (u) {
  3469. for (q = new Uint8Array(this.a.buffer); q.length <= k + c.length + 5;)q = new Uint8Array(q.length << 1);
  3470. q.set(this.a)
  3471. }
  3472. n = h ? 1 : 0;
  3473. q[k++] = n | 0;
  3474. n = c.length;
  3475. s = ~n + 65536 & 65535;
  3476. q[k++] = n & 255;
  3477. q[k++] = n >>> 8 & 255;
  3478. q[k++] = s & 255;
  3479. q[k++] = s >>> 8 & 255;
  3480. if (u)q.set(c, k), k += c.length, q = q.subarray(0, k); else {
  3481. n = 0;
  3482. for (s = c.length; n < s; ++n)q[k++] = c[n];
  3483. q.length = k
  3484. }
  3485. this.b = k;
  3486. this.a = q
  3487. }
  3488. break;
  3489. case 1:
  3490. e =
  3491. new a(new Uint8Array(this.a.buffer), this.b);
  3492. e.d(1, 1, F);
  3493. e.d(1, 2, F);
  3494. g = l(this, g);
  3495. c = 0;
  3496. for (h = g.length; c < h; c++)if (f = g[c], a.prototype.d.apply(e, N[f]), 256 < f)e.d(g[++c], g[++c], F), e.d(g[++c], 5), e.d(g[++c], g[++c], F); else if (256 === f)break;
  3497. this.a = e.finish();
  3498. this.b = this.a.length;
  3499. break;
  3500. case J:
  3501. f = new a(new Uint8Array(this.a), this.b);
  3502. var x, v, A, t = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], B, r, n = Array(19), w, q = J;
  3503. f.d(1, 1, F);
  3504. f.d(q, 2, F);
  3505. g = l(this, g);
  3506. s = m(this.L, 15);
  3507. B = p(s);
  3508. q = m(this.K, 7);
  3509. k = p(q);
  3510. for (x = 286; 257 < x && 0 === s[x -
  3511. 1]; x--);
  3512. for (v = 30; 1 < v && 0 === q[v - 1]; v--);
  3513. var y = x, z = v;
  3514. b = new (u ? Uint32Array : Array)(y + z);
  3515. var H = new (u ? Uint32Array : Array)(316), E, C;
  3516. r = new (u ? Uint8Array : Array)(19);
  3517. for (w = A = 0; w < y; w++)b[A++] = s[w];
  3518. for (w = 0; w < z; w++)b[A++] = q[w];
  3519. if (!u) {
  3520. w = 0;
  3521. for (z = r.length; w < z; ++w)r[w] = 0
  3522. }
  3523. w = E = 0;
  3524. for (z = b.length; w < z; w += A) {
  3525. for (A = 1; w + A < z && b[w + A] === b[w]; ++A);
  3526. y = A;
  3527. if (0 === b[w])if (3 > y)for (; 0 < y--;)H[E++] = 0, r[0]++; else for (; 0 < y;)C = 138 > y ? y : 138, C > y - 3 && C < y && (C = y - 3), 10 >= C ? (H[E++] = 17, H[E++] = C - 3, r[17]++) : (H[E++] = 18, H[E++] = C - 11, r[18]++), y -= C; else if (H[E++] =
  3528. b[w], r[b[w]]++, y--, 3 > y)for (; 0 < y--;)H[E++] = b[w], r[b[w]]++; else for (; 0 < y;)C = 6 > y ? y : 6, C > y - 3 && C < y && (C = y - 3), H[E++] = 16, H[E++] = C - 3, r[16]++, y -= C
  3529. }
  3530. b = u ? H.subarray(0, E) : H.slice(0, E);
  3531. r = m(r, 7);
  3532. for (w = 0; 19 > w; w++)n[w] = r[t[w]];
  3533. for (A = 19; 4 < A && 0 === n[A - 1]; A--);
  3534. t = p(r);
  3535. f.d(x - 257, 5, F);
  3536. f.d(v - 1, 5, F);
  3537. f.d(A - 4, 4, F);
  3538. for (w = 0; w < A; w++)f.d(n[w], 3, F);
  3539. w = 0;
  3540. for (n = b.length; w < n; w++)if (c = b[w], f.d(t[c], r[c], F), 16 <= c) {
  3541. w++;
  3542. switch (c) {
  3543. case 16:
  3544. h = 2;
  3545. break;
  3546. case 17:
  3547. h = 3;
  3548. break;
  3549. case 18:
  3550. h = 7;
  3551. break;
  3552. default:
  3553. d("invalid code: " + c)
  3554. }
  3555. f.d(b[w], h, F)
  3556. }
  3557. h = [B, s];
  3558. k = [k,
  3559. q];
  3560. c = h[0];
  3561. h = h[1];
  3562. q = k[0];
  3563. B = k[1];
  3564. k = 0;
  3565. for (n = g.length; k < n; ++k)if (e = g[k], f.d(c[e], h[e], F), 256 < e)f.d(g[++k], g[++k], F), s = g[++k], f.d(q[s], B[s], F), f.d(g[++k], g[++k], F); else if (256 === e)break;
  3566. this.a = f.finish();
  3567. this.b = this.a.length;
  3568. break;
  3569. default:
  3570. d("invalid compression type")
  3571. }
  3572. return this.a
  3573. };
  3574. t = [];
  3575. var E;
  3576. for (E = 3; 258 >= E; E++)v = k(), t[E] = v[2] << 24 | v[1] << 16 | v[0];
  3577. var L = u ? new Uint32Array(t) : t, I = z;
  3578. n.prototype.n = function () {
  3579. var a, c, e, f, g = 0;
  3580. f = this.a;
  3581. a = O;
  3582. switch (a) {
  3583. case O:
  3584. c = Math.LOG2E * Math.log(32768) - 8;
  3585. break;
  3586. default:
  3587. d(Error("invalid compression method"))
  3588. }
  3589. c =
  3590. c << 4 | a;
  3591. f[g++] = c;
  3592. switch (a) {
  3593. case O:
  3594. switch (this.h) {
  3595. case I.NONE:
  3596. e = 0;
  3597. break;
  3598. case I.r:
  3599. e = 1;
  3600. break;
  3601. case I.j:
  3602. e = 2;
  3603. break;
  3604. default:
  3605. d(Error("unsupported compression type"))
  3606. }
  3607. break;
  3608. default:
  3609. d(Error("invalid compression method"))
  3610. }
  3611. a = e << 6 | 0;
  3612. f[g++] = a | 31 - (256 * c + a) % 31;
  3613. a = b(this.input);
  3614. this.z.b = g;
  3615. f = this.z.n();
  3616. g = f.length;
  3617. u && (f = new Uint8Array(f.buffer), f.length <= g + 4 && (this.a = new Uint8Array(f.length + 4), this.a.set(f), f = this.a), f = f.subarray(0, g + 4));
  3618. f[g++] = a >> 24 & 255;
  3619. f[g++] = a >> 16 & 255;
  3620. f[g++] = a >> 8 & 255;
  3621. f[g++] = a & 255;
  3622. return f
  3623. };
  3624. c("Zlib.Deflate",
  3625. n);
  3626. c("Zlib.Deflate.compress", function (a, b) {
  3627. return(new n(a, b)).n()
  3628. });
  3629. c("Zlib.Deflate.CompressionType", I);
  3630. c("Zlib.Deflate.CompressionType.NONE", I.NONE);
  3631. c("Zlib.Deflate.CompressionType.FIXED", I.r);
  3632. c("Zlib.Deflate.CompressionType.DYNAMIC", I.j);
  3633. var M = 0, C = 1, z = {D: M, C: C};
  3634. q.prototype.p = function () {
  3635. for (; !this.s;) {
  3636. var a = s(this, 3);
  3637. a & 1 && (this.s = F);
  3638. a >>>= 1;
  3639. switch (a) {
  3640. case 0:
  3641. var a = this.input, b = this.c, c = this.a, e = this.b, f = D, g = D, h = D, n = c.length, f = D;
  3642. this.e = this.g = 0;
  3643. f = a[b++];
  3644. f === D && d(Error("invalid uncompressed block header: LEN (first byte)"));
  3645. g = f;
  3646. f = a[b++];
  3647. f === D && d(Error("invalid uncompressed block header: LEN (second byte)"));
  3648. g |= f << 8;
  3649. f = a[b++];
  3650. f === D && d(Error("invalid uncompressed block header: NLEN (first byte)"));
  3651. h = f;
  3652. f = a[b++];
  3653. f === D && d(Error("invalid uncompressed block header: NLEN (second byte)"));
  3654. h |= f << 8;
  3655. g === ~h && d(Error("invalid uncompressed block header: length verify"));
  3656. b + g > a.length && d(Error("input buffer is broken"));
  3657. switch (this.m) {
  3658. case M:
  3659. for (; e + g > c.length;) {
  3660. f = n - e;
  3661. g -= f;
  3662. if (u)c.set(a.subarray(b, b + f), e), e += f, b += f; else for (; f--;)c[e++] =
  3663. a[b++];
  3664. this.b = e;
  3665. c = this.f();
  3666. e = this.b
  3667. }
  3668. break;
  3669. case C:
  3670. for (; e + g > c.length;)c = this.f({v: 2});
  3671. break;
  3672. default:
  3673. d(Error("invalid inflate mode"))
  3674. }
  3675. if (u)c.set(a.subarray(b, b + g), e), e += g, b += g; else for (; g--;)c[e++] = a[b++];
  3676. this.c = b;
  3677. this.b = e;
  3678. this.a = c;
  3679. break;
  3680. case 1:
  3681. this.o(S, T);
  3682. break;
  3683. case 2:
  3684. A(this);
  3685. break;
  3686. default:
  3687. d(Error("unknown BTYPE: " + a))
  3688. }
  3689. }
  3690. return this.t()
  3691. };
  3692. t = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
  3693. var K = u ? new Uint16Array(t) : t;
  3694. t = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227,
  3695. 258, 258, 258];
  3696. var G = u ? new Uint16Array(t) : t;
  3697. t = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0];
  3698. var P = u ? new Uint8Array(t) : t;
  3699. t = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577];
  3700. var R = u ? new Uint16Array(t) : t;
  3701. t = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13];
  3702. var Q = u ? new Uint8Array(t) : t;
  3703. t = new (u ? Uint8Array : Array)(288);
  3704. v = 0;
  3705. for (w = t.length; v < w; ++v)t[v] = 143 >= v ? 8 : 255 >= v ? 9 : 279 >= v ? 7 : 8;
  3706. var S = f(t);
  3707. t = new (u ? Uint8Array :
  3708. Array)(30);
  3709. v = 0;
  3710. for (w = t.length; v < w; ++v)t[v] = 5;
  3711. var T = f(t);
  3712. q.prototype.o = function (a, b) {
  3713. var d = this.a, c = this.b;
  3714. this.u = a;
  3715. for (var e = d.length - 258, f, g, h; 256 !== (f = x(this, a));)if (256 > f)c >= e && (this.b = c, d = this.f(), c = this.b), d[c++] = f; else {
  3716. f -= 257;
  3717. h = G[f];
  3718. 0 < P[f] && (h += s(this, P[f]));
  3719. f = x(this, b);
  3720. g = R[f];
  3721. 0 < Q[f] && (g += s(this, Q[f]));
  3722. for (c >= e && (this.b = c, d = this.f(), c = this.b); h--;)d[c] = d[c++ - g]
  3723. }
  3724. for (; 8 <= this.e;)this.e -= 8, this.c--;
  3725. this.b = c
  3726. };
  3727. q.prototype.I = function (a, b) {
  3728. var d = this.a, c = this.b;
  3729. this.u = a;
  3730. for (var e = d.length, f, g, h; 256 !==
  3731. (f = x(this, a));)if (256 > f)c >= e && (d = this.f(), e = d.length), d[c++] = f; else {
  3732. f -= 257;
  3733. h = G[f];
  3734. 0 < P[f] && (h += s(this, P[f]));
  3735. f = x(this, b);
  3736. g = R[f];
  3737. 0 < Q[f] && (g += s(this, Q[f]));
  3738. for (c + h > e && (d = this.f(), e = d.length); h--;)d[c] = d[c++ - g]
  3739. }
  3740. for (; 8 <= this.e;)this.e -= 8, this.c--;
  3741. this.b = c
  3742. };
  3743. q.prototype.f = function () {
  3744. var a = new (u ? Uint8Array : Array)(this.b - 32768), b = this.b - 32768, d, c, e = this.a;
  3745. if (u)a.set(e.subarray(32768, a.length)); else {
  3746. d = 0;
  3747. for (c = a.length; d < c; ++d)a[d] = e[d + 32768]
  3748. }
  3749. this.k.push(a);
  3750. this.q += a.length;
  3751. if (u)e.set(e.subarray(b, b + 32768));
  3752. else for (d = 0; 32768 > d; ++d)e[d] = e[b + d];
  3753. this.b = 32768;
  3754. return e
  3755. };
  3756. q.prototype.J = function (a) {
  3757. var b, d = this.input.length / this.c + 1 | 0, c, e, f, g = this.input, h = this.a;
  3758. a && ("number" === typeof a.v && (d = a.v), "number" === typeof a.F && (d += a.F));
  3759. 2 > d ? (c = (g.length - this.c) / this.u[2], f = 258 * (c / 2) | 0, e = f < h.length ? h.length + f : h.length << 1) : e = h.length * d;
  3760. u ? (b = new Uint8Array(e), b.set(h)) : b = h;
  3761. return this.a = b
  3762. };
  3763. q.prototype.t = function () {
  3764. var a = 0, b = this.a, d = this.k, c, e = new (u ? Uint8Array : Array)(this.q + (this.b - 32768)), f, g, h, n;
  3765. if (0 === d.length)return u ?
  3766. this.a.subarray(32768, this.b) : this.a.slice(32768, this.b);
  3767. f = 0;
  3768. for (g = d.length; f < g; ++f) {
  3769. c = d[f];
  3770. h = 0;
  3771. for (n = c.length; h < n; ++h)e[a++] = c[h]
  3772. }
  3773. f = 32768;
  3774. for (g = this.b; f < g; ++f)e[a++] = b[f];
  3775. this.k = [];
  3776. return this.buffer = e
  3777. };
  3778. q.prototype.H = function () {
  3779. var a, b = this.b;
  3780. u ? this.B ? (a = new Uint8Array(b), a.set(this.a.subarray(0, b))) : a = this.a.subarray(0, b) : (this.a.length > b && (this.a.length = b), a = this.a);
  3781. return this.buffer = a
  3782. };
  3783. B.prototype.p = function () {
  3784. var a = this.input, c, e;
  3785. c = this.A.p();
  3786. this.c = this.A.c;
  3787. this.M && (e = (a[this.c++] << 24 | a[this.c++] <<
  3788. 16 | a[this.c++] << 8 | a[this.c++]) >>> 0, e !== b(c) && d(Error("invalid adler-32 checksum")));
  3789. return c
  3790. };
  3791. c("Zlib.Inflate", B);
  3792. c("Zlib.Inflate.BufferType", z);
  3793. z.ADAPTIVE = z.C;
  3794. z.BLOCK = z.D;
  3795. c("Zlib.Inflate.prototype.decompress", B.prototype.p);
  3796. z = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
  3797. u && new Uint16Array(z);
  3798. z = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 258, 258];
  3799. u && new Uint16Array(z);
  3800. z = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0];
  3801. u && new Uint8Array(z);
  3802. z = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577];
  3803. u && new Uint16Array(z);
  3804. z = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13];
  3805. u && new Uint8Array(z);
  3806. z = new (u ? Uint8Array : Array)(288);
  3807. t = 0;
  3808. for (v = z.length; t < v; ++t)z[t] = 143 >= t ? 8 : 255 >= t ? 9 : 279 >= t ? 7 : 8;
  3809. f(z);
  3810. z = new (u ? Uint8Array : Array)(30);
  3811. t = 0;
  3812. for (v = z.length; t < v; ++t)z[t] = 5;
  3813. f(z);
  3814. var O = 8
  3815. }).call(this);
  3816. (function (d) {
  3817. var c = function () {
  3818. function b() {
  3819. this._isSupportDOMParser = this._xmlDict = this._parser = null;
  3820. this._xmlDict = {};
  3821. window.DOMParser ? (this._isSupportDOMParser = !0, this._parser = new DOMParser) : this._isSupportDOMParser = !1
  3822. }
  3823. b.getInstance = function () {
  3824. b._instance || (b._instance = new b);
  3825. return b._instance
  3826. };
  3827. b.prototype.parse = function (a) {
  3828. var b = a;
  3829. a = this.getList(a);
  3830. a = this.parserXML(a).documentElement;
  3831. "plist" != a.tagName && d.Logger.fatal(b + "\u4e0d\u662fplist\u6216\u8005\u6ca1\u6709\u9884\u52a0\u8f7dplist");
  3832. for (var b =
  3833. null, c = 0, g = a.childNodes.length; c < g && !(b = a.childNodes[c], 1 == b.nodeType); c++);
  3834. return this.parseNode(b)
  3835. };
  3836. b.prototype.tmxParse = function (a, b) {
  3837. "undefined" === typeof b && (b = !1);
  3838. b || (a = this.getList(a));
  3839. return this.parserXML(a)
  3840. };
  3841. b.prototype.parserXML = function (a) {
  3842. var b;
  3843. this._isSupportDOMParser ? b = this._parser.parseFromString(a, "text/xml") : (b = new ActiveXObject("Microsoft.XMLDOM"), b.async = "false", b.loadXML(a));
  3844. null == b && d.Logger.info("xml not found!");
  3845. return b
  3846. };
  3847. b.prototype.parseNode = function (a) {
  3848. var b = null;
  3849. switch (a.tagName) {
  3850. case "dict":
  3851. b =
  3852. this.parseDict(a);
  3853. break;
  3854. case "array":
  3855. b = this.parseArray(a);
  3856. break;
  3857. case "string":
  3858. if (1 == a.childNodes.length)b = a.firstChild.nodeValue; else for (var b = "", d = 0; d < a.childNodes.length; d++)b += a.childNodes[d].nodeValue;
  3859. break;
  3860. case "false":
  3861. b = !1;
  3862. break;
  3863. case "true":
  3864. b = !0;
  3865. break;
  3866. case "real":
  3867. b = parseFloat(a.firstChild.nodeValue);
  3868. break;
  3869. case "integer":
  3870. b = parseInt(a.firstChild.nodeValue, 10)
  3871. }
  3872. return b
  3873. };
  3874. b.prototype.parseArray = function (a) {
  3875. for (var b = [], d = 0, c = a.childNodes.length; d < c; d++) {
  3876. var h = a.childNodes[d];
  3877. 1 == h.nodeType && b.push(this.parseNode(h))
  3878. }
  3879. return b
  3880. };
  3881. b.prototype.parseDict = function (a) {
  3882. for (var b = {}, d = null, c = 0, h = a.childNodes.length; c < h; c++) {
  3883. var k = a.childNodes[c];
  3884. 1 == k.nodeType && ("key" == k.tagName ? d = k.firstChild.nodeValue : b[d] = this.parseNode(k))
  3885. }
  3886. return b
  3887. };
  3888. b.prototype.getName = function (a) {
  3889. var b = a.lastIndexOf("/", a.length) + 1, d = a.lastIndexOf(".", a.length);
  3890. return a.substring(b, d)
  3891. };
  3892. b.prototype.getExt = function (a) {
  3893. var b = a.lastIndexOf(".", a.length) + 1;
  3894. return a.substring(b, a.length)
  3895. };
  3896. b.prototype.getList = function (a) {
  3897. return null != this._xmlDict ? this._xmlDict[a] :
  3898. null
  3899. };
  3900. b._instance = null;
  3901. return b
  3902. }();
  3903. d.SAXParser = c
  3904. })(ns_egret || (ns_egret = {}));
  3905. (function (d) {
  3906. var c = function () {
  3907. function b() {
  3908. }
  3909. b.convert = function (a) {
  3910. if (1 < arguments.length)d.DOM.convert(arguments); else if (1 == arguments.length && !arguments[0].length)d.DOM.convert([arguments[0]]); else for (var b = arguments[0], c = 0; c < b.length; c++)b[c]instanceof d.DisplayObjectContainer ? b[c].dom || d.DOM.forSprite(b[c]) : d.Logger.info("DOM\u8f6c\u6362\u5668\u53ea\u652f\u6301DisplayObjectContainer"), b[c].visit = function () {
  3911. }, b[c].transform = function () {
  3912. }, d.DOM.setTransform(b[c]), b[c].visible = b[c].visible
  3913. };
  3914. b.forSprite =
  3915. function (a) {
  3916. a.dom = d.Browser.getInstance().$new("div");
  3917. a.canvas = d.Browser.getInstance().$new("canvas");
  3918. a.canvas.width = a.width;
  3919. a.canvas.height = a.height;
  3920. a.dom.style.position = "absolute";
  3921. a.ctx = a.canvas.getContext("2d");
  3922. a.dom.appendChild(a.canvas);
  3923. a.parent && d.DOM.parentDOM(a);
  3924. a.isSprite = !0
  3925. };
  3926. b.parentDOM = function (a) {
  3927. var b = a.parent;
  3928. if (!b || !a.dom)return!1;
  3929. b.dom || d.DOM.placeHolder(b);
  3930. a.dom.appendTo(b.dom);
  3931. if (b.parent)d.DOM.parentDOM(b); else if (a = d.Browser.getInstance().$("#StageDelegateDiv"))b.dom.appendTo(a);
  3932. else {
  3933. a = d.Browser.getInstance().$new("div");
  3934. a.id = "StageDelegateDiv";
  3935. var c = d.StageDelegate.getInstance(), g = c.getFrameWidth(), h = c.getFrameHeight(), k = c.getDesignWidth(), l = c.getDesignHeight();
  3936. 0 === k && 0 === l && (k = g, l = h);
  3937. a.style.position = "absolute";
  3938. a.style.width = k + "px";
  3939. a.style.maxHeight = l + "px";
  3940. a.style.margin = 0;
  3941. a.resize(c.getScaleX(), c.getScaleY());
  3942. b.dom.appendTo(a);
  3943. a.appendTo(document.getElementById(d.StageDelegate.canvas_div_name))
  3944. }
  3945. return!0
  3946. };
  3947. b.placeHolder = function (a) {
  3948. a.dom = d.Browser.getInstance().$new("div");
  3949. a.placeholder = !0;
  3950. a.dom.style.position = "absolute";
  3951. a.dom.style.width = (a.width || d.MainContext.instance.stage.stageWidth) + "px";
  3952. a.dom.style.maxHeight = (a.height || d.MainContext.instance.stage.stageHeight) + "px";
  3953. a.dom.style.margin = 0;
  3954. d.DOM.setTransform(a);
  3955. a.dom.transforms()
  3956. };
  3957. b.setTransform = function (a) {
  3958. a.dom && (a.dom.position.x = a.x, a.dom.position.y = a.y, a.dom.rotation = a.rotation, a.dom.scale = {x: a.scaleX, y: a.scaleY}, a.dom.skew = {x: a.skewX, y: a.skewX}, a.dom.transforms())
  3959. };
  3960. return b
  3961. }();
  3962. d.DOM = c
  3963. })(ns_egret || (ns_egret =
  3964. {}));
  3965. (function (d) {
  3966. var c = function () {
  3967. function b() {
  3968. this.translate = this.isHD ? function (a) {
  3969. return"translate3d(" + a.x + "px, " + (a.y - d.MainContext.instance.stage.stageHeight) + "px, 0) "
  3970. } : function (a) {
  3971. console.log("translate(" + a.x + "px, " + a.y + "px) ");
  3972. return"translate(" + a.x + "px, " + a.y + "px) "
  3973. };
  3974. this.rotate = this.isHD ? function (a) {
  3975. return"rotateZ(" + a + "deg) "
  3976. } : function (a) {
  3977. return"rotate(" + a + "deg) "
  3978. };
  3979. this.ua = navigator.userAgent.toLowerCase();
  3980. var a = this.ua.match(/micromessenger|qqbrowser|mqqbrowser|ucbrowser|360browser|baidubrowser|maxthon|ie|opera|firefox/) ||
  3981. this.ua.match(/chrome|safari/);
  3982. a && 0 < a.length && (a = a[0], "micromessenger" == a && (this.type = "wechat"), this.type = a);
  3983. this.type = "unknow";
  3984. switch (this.type) {
  3985. case "firefox":
  3986. this.pfx = "Moz";
  3987. this.isHD = !0;
  3988. break;
  3989. case "chrome":
  3990. case "safari":
  3991. this.pfx = "webkit";
  3992. this.isHD = !0;
  3993. break;
  3994. case "opera":
  3995. this.pfx = "O";
  3996. this.isHD = !1;
  3997. break;
  3998. case "ie":
  3999. this.pfx = "ms";
  4000. this.isHD = !1;
  4001. break;
  4002. default:
  4003. this.pfx = "webkit", this.isHD = !0
  4004. }
  4005. this.trans = this.pfx + "Transform";
  4006. this.isMobile = -1 != this.ua.indexOf("mobile") || -1 != this.ua.indexOf("android")
  4007. }
  4008. b.getInstance =
  4009. function () {
  4010. null == b.instance && (b.instance = new b);
  4011. return b.instance
  4012. };
  4013. b.prototype.$new = function (a) {
  4014. return this.$(document.createElement(a))
  4015. };
  4016. b.prototype.$ = function (a) {
  4017. var c = document;
  4018. if (a = a instanceof HTMLElement ? a : c.querySelector(a))a.find = a.find || this.$, a.hasClass = a.hasClass || function (a) {
  4019. return this.className.match(RegExp("(\\s|^)" + a + "(\\s|$)"))
  4020. }, a.addClass = a.addClass || function (a) {
  4021. this.hasClass(a) || (this.className && (this.className += " "), this.className += a);
  4022. return this
  4023. }, a.removeClass = a.removeClass || function (a) {
  4024. this.hasClass(a) &&
  4025. (this.className = this.className.replace(a, ""));
  4026. return this
  4027. }, a.remove = a.remove || function () {
  4028. }, a.appendTo = a.appendTo || function (a) {
  4029. a.appendChild(this);
  4030. return this
  4031. }, a.prependTo = a.prependTo || function (a) {
  4032. a.childNodes[0] ? a.insertBefore(this, a.childNodes[0]) : a.appendChild(this);
  4033. return this
  4034. }, a.transforms = a.transforms || function () {
  4035. this.style[b.getInstance().trans] = b.getInstance().translate(this.position) + b.getInstance().rotate(this.rotation) + b.getInstance().scale(this.scale) + b.getInstance().skew(this.skew);
  4036. return this
  4037. },
  4038. a.position = a.position || {x: 0, y: 0}, a.rotation = a.rotation || 0, a.scale = a.scale || {x: 1, y: 1}, a.skew = a.skew || {x: 0, y: 0}, a.translates = function (a, b) {
  4039. this.position.x = a;
  4040. this.position.y = b - d.MainContext.instance.stage.stageHeight;
  4041. this.transforms();
  4042. return this
  4043. }, a.rotate = function (a) {
  4044. this.rotation = a;
  4045. this.transforms();
  4046. return this
  4047. }, a.resize = function (a, b) {
  4048. this.scale.x = a;
  4049. this.scale.y = b;
  4050. this.transforms();
  4051. return this
  4052. }, a.setSkew = function (a, b) {
  4053. this.skew.x = a;
  4054. this.skew.y = b;
  4055. this.transforms();
  4056. return this
  4057. };
  4058. return a
  4059. };
  4060. b.prototype.scale =
  4061. function (a) {
  4062. return"scale(" + a.x + ", " + a.y + ") "
  4063. };
  4064. b.prototype.skew = function (a) {
  4065. return"skewX(" + -a.x + "deg) skewY(" + a.y + "deg)"
  4066. };
  4067. return b
  4068. }();
  4069. d.Browser = c
  4070. })(ns_egret || (ns_egret = {}));
  4071. __extends = this.__extends || function (d, c) {
  4072. function b() {
  4073. this.constructor = d
  4074. }
  4075. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  4076. b.prototype = c.prototype;
  4077. d.prototype = new b
  4078. };
  4079. (function (d) {
  4080. var c = function (b) {
  4081. function a(a, d, c) {
  4082. b.call(this);
  4083. this.target = null;
  4084. this.loop = this.ignoreGlobalPause = this._useTicks = !1;
  4085. this._actions = this._steps = this._initQueueProps = this._curQueueProps = this.pluginData = null;
  4086. this.paused = !1;
  4087. this.duration = 0;
  4088. this._prevPos = -1;
  4089. this.position = null;
  4090. this._stepPosition = this._prevPosition = 0;
  4091. this.passive = !1;
  4092. this.initialize(a, d, c)
  4093. }
  4094. __extends(a, b);
  4095. a.get = function (b, d, c, h) {
  4096. "undefined" === typeof d && (d = null);
  4097. "undefined" === typeof c && (c = null);
  4098. "undefined" === typeof h && (h = !1);
  4099. h &&
  4100. a.removeTweens(b);
  4101. return new a(b, d, c)
  4102. };
  4103. a.removeTweens = function (b) {
  4104. if (b.tween_count) {
  4105. for (var c = a._tweens, g = c.length - 1; 0 <= g; g--)c[g].target == b && (c[g].paused = !0, c.splice(g, 1));
  4106. b.tween_count = 0
  4107. } else d.Logger.warning("target\u6ca1\u6709\u6b63\u5728\u6267\u884ctween")
  4108. };
  4109. a.tick = function (b, d) {
  4110. "undefined" === typeof d && (d = !1);
  4111. for (var c = a._tweens, h = c.length - 1; 0 <= h; h--) {
  4112. var k = c[h];
  4113. d && !k.ignoreGlobalPause || k.paused || k.tick(k._useTicks ? 1 : b)
  4114. }
  4115. };
  4116. a._register = function (b, c) {
  4117. var g = b.target, h = a._tweens;
  4118. if (c)g && (g.tween_count =
  4119. g.tween_count ? g.tween_count + 1 : 1), h.push(b), a._inited || (d.Ticker.getInstance().register(a.tick, null), a._inited = !0); else {
  4120. g && g.tween_count--;
  4121. for (g = h.length; g--;)if (h[g] == b) {
  4122. h.splice(g, 1);
  4123. break
  4124. }
  4125. }
  4126. };
  4127. a.removeAllTweens = function () {
  4128. for (var b = a._tweens, d = 0, c = b.length; d < c; d++) {
  4129. var h = b[d];
  4130. h.paused = !0;
  4131. h.target.tweenjs_count = 0
  4132. }
  4133. b.length = 0
  4134. };
  4135. a.prototype.initialize = function (b, d, c) {
  4136. this.target = b;
  4137. d && (this._useTicks = d.useTicks, this.ignoreGlobalPause = d.ignoreGlobalPause, this.loop = d.loop, d.onChange && this.addEventListener("change",
  4138. d.onChange, d.onChangeObj), d.override && a.removeTweens(b));
  4139. this.pluginData = c || {};
  4140. this._curQueueProps = {};
  4141. this._initQueueProps = {};
  4142. this._steps = [];
  4143. this._actions = [];
  4144. d && d.paused ? this.paused = !0 : a._register(this, !0);
  4145. d && null != d.position && this.setPosition(d.position, a.NONE)
  4146. };
  4147. a.prototype.setPosition = function (a, b) {
  4148. "undefined" === typeof b && (b = 1);
  4149. 0 > a && (a = 0);
  4150. var d = a, c = !1;
  4151. d >= this.duration && (this.loop ? d %= this.duration : (d = this.duration, c = !0));
  4152. if (d == this._prevPos)return c;
  4153. var k = this._prevPos;
  4154. this.position = this._prevPos =
  4155. d;
  4156. this._prevPosition = a;
  4157. if (this.target)if (c)this._updateTargetProps(null, 1); else if (0 < this._steps.length) {
  4158. for (var l = 0, m = this._steps.length; l < m && !(this._steps[l].t > d); l++);
  4159. l = this._steps[l - 1];
  4160. this._updateTargetProps(l, (this._stepPosition = d - l.t) / l.d)
  4161. }
  4162. 0 != b && 0 < this._actions.length && (this._useTicks ? this._runActions(d, d) : 1 == b && d < k ? (k != this.duration && this._runActions(k, this.duration), this._runActions(0, d, !0)) : this._runActions(k, d));
  4163. c && this.setPaused(!0);
  4164. this.dispatchEvent("change");
  4165. return c
  4166. };
  4167. a.prototype._runActions =
  4168. function (a, b, d) {
  4169. "undefined" === typeof d && (d = !1);
  4170. var c = a, k = b, l = -1, m = this._actions.length, p = 1;
  4171. a > b && (c = b, k = a, l = m, m = p = -1);
  4172. for (; (l += p) != m;) {
  4173. b = this._actions[l];
  4174. var n = b.t;
  4175. (n == k || n > c && n < k || d && n == a) && b.f.apply(b.o, b.p)
  4176. }
  4177. };
  4178. a.prototype._updateTargetProps = function (b, d) {
  4179. var c, h, k, l;
  4180. if (!b && 1 == d)this.passive = !1, c = h = this._curQueueProps; else {
  4181. if (this.passive = !!b.v)return;
  4182. b.e && (d = b.e(d, 0, 1, 1));
  4183. c = b.p0;
  4184. h = b.p1
  4185. }
  4186. for (var m in this._initQueueProps) {
  4187. if (null == (k = c[m]))c[m] = k = this._initQueueProps[m];
  4188. if (null == (l = h[m]))h[m] = l = k;
  4189. k = k == l || 0 == d || 1 == d || "number" != typeof k ? 1 == d ? l : k : k + (l - k) * d;
  4190. var p = !1;
  4191. if (l = a._plugins[m])for (var n = 0, q = l.length; n < q; n++) {
  4192. var s = l[n].tween(this, m, k, c, h, d, !!b && c == h, !b);
  4193. s == a.IGNORE ? p = !0 : k = s
  4194. }
  4195. p || (this.target[m] = k)
  4196. }
  4197. };
  4198. a.prototype.setPaused = function (b) {
  4199. this.paused = b;
  4200. a._register(this, !b);
  4201. return this
  4202. };
  4203. a.prototype._cloneProps = function (a) {
  4204. var b = {}, d;
  4205. for (d in a)b[d] = a[d];
  4206. return b
  4207. };
  4208. a.prototype._addStep = function (a) {
  4209. 0 < a.d && (this._steps.push(a), a.t = this.duration, this.duration += a.d);
  4210. return this
  4211. };
  4212. a.prototype._appendQueueProps =
  4213. function (b) {
  4214. var d, c, h, k, l, m;
  4215. for (m in b)if (void 0 === this._initQueueProps[m]) {
  4216. c = this.target[m];
  4217. if (d = a._plugins[m]) {
  4218. h = 0;
  4219. for (k = d.length; h < k; h++)c = d[h].init(this, m, c)
  4220. }
  4221. this._initQueueProps[m] = this._curQueueProps[m] = void 0 === c ? null : c
  4222. }
  4223. for (m in b) {
  4224. c = this._curQueueProps[m];
  4225. if (d = a._plugins[m]) {
  4226. l = l || {};
  4227. h = 0;
  4228. for (k = d.length; h < k; h++)d[h].step && d[h].step(this, m, c, b[m], l)
  4229. }
  4230. this._curQueueProps[m] = b[m]
  4231. }
  4232. l && this._appendQueueProps(l);
  4233. return this._curQueueProps
  4234. };
  4235. a.prototype._addAction = function (a) {
  4236. a.t = this.duration;
  4237. this._actions.push(a);
  4238. return this
  4239. };
  4240. a.prototype._set = function (a, b) {
  4241. for (var d in a)b[d] = a[d]
  4242. };
  4243. a.prototype.wait = function (a, b) {
  4244. "undefined" === typeof b && (b = !1);
  4245. if (null == a || 0 >= a)return this;
  4246. var d = this._cloneProps(this._curQueueProps);
  4247. return this._addStep({d: a, p0: d, p1: d, v: b})
  4248. };
  4249. a.prototype.to = function (a, b, d) {
  4250. "undefined" === typeof d && (d = void 0);
  4251. if (isNaN(b) || 0 > b)b = 0;
  4252. return this._addStep({d: b || 0, p0: this._cloneProps(this._curQueueProps), e: d, p1: this._cloneProps(this._appendQueueProps(a))})
  4253. };
  4254. a.prototype.call = function (a, b, d) {
  4255. "undefined" === typeof b && (b = void 0);
  4256. "undefined" === typeof d && (d = void 0);
  4257. return this._addAction({f: a, p: d ? d : [this], o: b ? b : this.target})
  4258. };
  4259. a.prototype.set = function (a, b) {
  4260. "undefined" === typeof b && (b = null);
  4261. return this._addAction({f: this._set, o: this, p: [a, b ? b : this.target]})
  4262. };
  4263. a.prototype.play = function (a) {
  4264. a || (a = this);
  4265. return this.call(a.setPaused, [!1], a)
  4266. };
  4267. a.prototype.pause = function (a) {
  4268. a || (a = this);
  4269. return this.call(a.setPaused, [!0], a)
  4270. };
  4271. a.prototype.tick = function (a) {
  4272. this.paused || this.setPosition(this._prevPosition + a)
  4273. };
  4274. a.NONE = 0;
  4275. a.LOOP =
  4276. 1;
  4277. a.REVERSE = 2;
  4278. a._tweens = [];
  4279. a.IGNORE = {};
  4280. a._plugins = {};
  4281. a._inited = !1;
  4282. return a
  4283. }(d.EventDispatcher);
  4284. d.Tween = c
  4285. })(ns_egret || (ns_egret = {}));
  4286. (function (d) {
  4287. var c = function () {
  4288. function b() {
  4289. d.Logger.fatal("Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316")
  4290. }
  4291. b.get = function (a) {
  4292. -1 > a && (a = -1);
  4293. 1 < a && (a = 1);
  4294. return function (b) {
  4295. return 0 == a ? b : 0 > a ? b * (b * -a + 1 + a) : b * ((2 - b) * a + (1 - a))
  4296. }
  4297. };
  4298. b.getPowIn = function (a) {
  4299. return function (b) {
  4300. return Math.pow(b, a)
  4301. }
  4302. };
  4303. b.getPowOut = function (a) {
  4304. return function (b) {
  4305. return 1 - Math.pow(1 - b, a)
  4306. }
  4307. };
  4308. b.getPowInOut = function (a) {
  4309. return function (b) {
  4310. return 1 > (b *= 2) ? 0.5 * Math.pow(b, a) : 1 - 0.5 * Math.abs(Math.pow(2 - b, a))
  4311. }
  4312. };
  4313. b.sineIn = function (a) {
  4314. return 1 - Math.cos(a *
  4315. Math.PI / 2)
  4316. };
  4317. b.sineOut = function (a) {
  4318. return Math.sin(a * Math.PI / 2)
  4319. };
  4320. b.sineInOut = function (a) {
  4321. return-0.5 * (Math.cos(Math.PI * a) - 1)
  4322. };
  4323. b.getBackIn = function (a) {
  4324. return function (b) {
  4325. return b * b * ((a + 1) * b - a)
  4326. }
  4327. };
  4328. b.getBackOut = function (a) {
  4329. return function (b) {
  4330. b -= 1;
  4331. return b * b * ((a + 1) * b + a) + 1
  4332. }
  4333. };
  4334. b.getBackInOut = function (a) {
  4335. a *= 1.525;
  4336. return function (b) {
  4337. return 1 > (b *= 2) ? 0.5 * b * b * ((a + 1) * b - a) : 0.5 * ((b -= 2) * b * ((a + 1) * b + a) + 2)
  4338. }
  4339. };
  4340. b.circIn = function (a) {
  4341. return-(Math.sqrt(1 - a * a) - 1)
  4342. };
  4343. b.circOut = function (a) {
  4344. return Math.sqrt(1 - a * a)
  4345. };
  4346. b.circInOut = function (a) {
  4347. return 1 >
  4348. (a *= 2) ? -0.5 * (Math.sqrt(1 - a * a) - 1) : 0.5 * (Math.sqrt(1 - (a -= 2) * a) + 1)
  4349. };
  4350. b.bounceIn = function (a) {
  4351. return 1 - b.bounceOut(1 - a)
  4352. };
  4353. b.bounceOut = function (a) {
  4354. return a < 1 / 2.75 ? 7.5625 * a * a : a < 2 / 2.75 ? 7.5625 * (a -= 1.5 / 2.75) * a + 0.75 : a < 2.5 / 2.75 ? 7.5625 * (a -= 2.25 / 2.75) * a + 0.9375 : 7.5625 * (a -= 2.625 / 2.75) * a + 0.984375
  4355. };
  4356. b.bounceInOut = function (a) {
  4357. return 0.5 > a ? 0.5 * b.bounceIn(2 * a) : 0.5 * b.bounceOut(2 * a - 1) + 0.5
  4358. };
  4359. b.getElasticIn = function (a, b) {
  4360. var d = 2 * Math.PI;
  4361. return function (c) {
  4362. if (0 == c || 1 == c)return c;
  4363. var h = b / d * Math.asin(1 / a);
  4364. return-(a * Math.pow(2, 10 *
  4365. (c -= 1)) * Math.sin((c - h) * d / b))
  4366. }
  4367. };
  4368. b.getElasticOut = function (a, b) {
  4369. var d = 2 * Math.PI;
  4370. return function (c) {
  4371. if (0 == c || 1 == c)return c;
  4372. var h = b / d * Math.asin(1 / a);
  4373. return a * Math.pow(2, -10 * c) * Math.sin((c - h) * d / b) + 1
  4374. }
  4375. };
  4376. b.getElasticInOut = function (a, b) {
  4377. var d = 2 * Math.PI;
  4378. return function (c) {
  4379. var h = b / d * Math.asin(1 / a);
  4380. return 1 > (c *= 2) ? -0.5 * a * Math.pow(2, 10 * (c -= 1)) * Math.sin((c - h) * d / b) : 0.5 * a * Math.pow(2, -10 * (c -= 1)) * Math.sin((c - h) * d / b) + 1
  4381. }
  4382. };
  4383. b.quadIn = b.getPowIn(2);
  4384. b.quadOut = b.getPowOut(2);
  4385. b.quadInOut = b.getPowInOut(2);
  4386. b.cubicIn = b.getPowIn(3);
  4387. b.cubicOut = b.getPowOut(3);
  4388. b.cubicInOut = b.getPowInOut(3);
  4389. b.quartIn = b.getPowIn(4);
  4390. b.quartOut = b.getPowOut(4);
  4391. b.quartInOut = b.getPowInOut(4);
  4392. b.quintIn = b.getPowIn(5);
  4393. b.quintOut = b.getPowOut(5);
  4394. b.quintInOut = b.getPowInOut(5);
  4395. b.backIn = b.getBackIn(1.7);
  4396. b.backOut = b.getBackOut(1.7);
  4397. b.backInOut = b.getBackInOut(1.7);
  4398. b.elasticIn = b.getElasticIn(1, 0.3);
  4399. b.elasticOut = b.getElasticOut(1, 0.3);
  4400. b.elasticInOut = b.getElasticInOut(1, 0.3 * 1.5);
  4401. return b
  4402. }();
  4403. d.Ease = c
  4404. })(ns_egret || (ns_egret = {}));
  4405. (function (d) {
  4406. var c = function () {
  4407. function b() {
  4408. }
  4409. b.getInstance = function () {
  4410. null == b.context && (b.context = new b);
  4411. return b.context
  4412. };
  4413. b.prototype.preloadSound = function (a) {
  4414. };
  4415. b.prototype.playMusic = function (a, b) {
  4416. };
  4417. b.prototype.stopMusic = function (a) {
  4418. };
  4419. b.context = null;
  4420. b.isMusicPlaying = !1;
  4421. return b
  4422. }();
  4423. d.SoundContext = c
  4424. })(ns_egret || (ns_egret = {}));
  4425. __extends = this.__extends || function (d, c) {
  4426. function b() {
  4427. this.constructor = d
  4428. }
  4429. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  4430. b.prototype = c.prototype;
  4431. d.prototype = new b
  4432. };
  4433. (function (d) {
  4434. var c = function (b) {
  4435. function a() {
  4436. b.call(this);
  4437. this._soundList = {};
  4438. this._canPlay = !0;
  4439. this._supportedFormat = [];
  4440. var a = this._capabilities = {mp3: !1, ogg: !1, wav: !1, mp4: !1, m4a: !1};
  4441. this._checkCanPlay(a);
  4442. for (var d in a)if (a[d]) {
  4443. this._soundSupported = !0;
  4444. break
  4445. }
  4446. a = navigator.userAgent;
  4447. if (/Mobile/.test(a) && (/iPhone OS/.test(a) || /iPad/.test(a) || /Firefox/.test(a)) || /MSIE/.test(a))this._canPlay = !1;
  4448. this._getSupportedAudioFormat()
  4449. }
  4450. __extends(a, b);
  4451. a.prototype._checkCanPlay = function (a) {
  4452. var b = document.createElement("audio");
  4453. if (b.canPlayType) {
  4454. var d = function (a) {
  4455. a = b.canPlayType(a);
  4456. return"no" != a && "" != a
  4457. };
  4458. a.mp3 = d("audio/mpeg");
  4459. a.mp4 = d("audio/mp4");
  4460. a.m4a = d("audio/x-m4a") || d("audio/aac");
  4461. a.ogg = d('audio/ogg; codecs\x3d"vorbis"');
  4462. a.wav = d('audio/wav; codecs\x3d"1"')
  4463. }
  4464. };
  4465. a.prototype.preloadSound = function (a) {
  4466. if (this._soundSupported) {
  4467. var b = this._getExtFromFullPath(a);
  4468. if (this.isFormatSupported(b) && !this._soundList.hasOwnProperty(a) && this._canPlay) {
  4469. b = new Audio(d.ResourceLoader.prefix + a);
  4470. b.preload = "auto";
  4471. var c = function (a) {
  4472. this.removeEventListener("canplaythrough",
  4473. c, !1);
  4474. this.removeEventListener("error", h, !1)
  4475. }, h = function (a) {
  4476. this.removeEventListener("canplaythrough", c, !1);
  4477. this.removeEventListener("error", h, !1)
  4478. };
  4479. b.addEventListener("canplaythrough", c, !1);
  4480. b.addEventListener("error", h, !1);
  4481. this._soundList[a] = b;
  4482. b.load()
  4483. }
  4484. }
  4485. };
  4486. a.prototype._getSupportedAudioFormat = function () {
  4487. if (this._soundSupported) {
  4488. var a = ["ogg", "mp3", "wav", "mp4", "m4a"], b;
  4489. for (b in a) {
  4490. var d = a[b];
  4491. this._capabilities[d] && this._supportedFormat.push(d)
  4492. }
  4493. }
  4494. };
  4495. a.prototype.isFormatSupported = function (a) {
  4496. var b = this._supportedFormat,
  4497. d;
  4498. for (d in b)if (a === b[d])return!0;
  4499. return!1
  4500. };
  4501. a.prototype._getExtFromFullPath = function (a) {
  4502. var b = a.lastIndexOf(".");
  4503. return-1 !== b ? a.substring(b + 1, a.length) : ""
  4504. };
  4505. a.prototype.playMusic = function (a, b) {
  4506. "undefined" === typeof b && (b = !0);
  4507. if (this._soundSupported) {
  4508. var c, h = this._soundList;
  4509. h.hasOwnProperty(this._playingMusicName) && h[this._playingMusicName].pause();
  4510. this._playingMusicName = a;
  4511. h.hasOwnProperty(this._playingMusicName) ? c = h[this._playingMusicName] : (c = new Audio(d.ResourceLoader.prefix + a), c.preload = "auto", h[a] =
  4512. c, c.load());
  4513. c.addEventListener("pause", function () {
  4514. d.SoundContext.isMusicPlaying = !1;
  4515. this.removeEventListener("pause", arguments.callee, !1)
  4516. }, !1);
  4517. isNaN(c.duration) || (c.currentTime = 0);
  4518. c.loop = b;
  4519. c.play();
  4520. d.SoundContext.isMusicPlaying = !0
  4521. }
  4522. };
  4523. a.prototype.stopMusic = function (a) {
  4524. var b = this._soundList, c = this._playingMusicName;
  4525. if (b.hasOwnProperty(c)) {
  4526. var h = b[c];
  4527. h.pause();
  4528. h.currentTime = h.duration;
  4529. a && delete b[c];
  4530. d.SoundContext.isMusicPlaying = !1
  4531. }
  4532. };
  4533. return a
  4534. }(d.SoundContext);
  4535. d.HTML5SoundContext = c
  4536. })(ns_egret || (ns_egret =
  4537. {}));
  4538. __extends = this.__extends || function (d, c) {
  4539. function b() {
  4540. this.constructor = d
  4541. }
  4542. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  4543. b.prototype = c.prototype;
  4544. d.prototype = new b
  4545. };
  4546. (function (d) {
  4547. var c = function (b) {
  4548. function a() {
  4549. b.apply(this, arguments);
  4550. this.viewPortWidth = 400
  4551. }
  4552. __extends(a, b);
  4553. a.createWithFile = function (b) {
  4554. var d = new a;
  4555. d.initWithTMXFile(b);
  4556. return d
  4557. };
  4558. a.prototype.initWithTMXFile = function (a) {
  4559. (!a || 0 == a.length) && d.Logger.fatal("TMXTiledMap.initWithTMXFile(): tmxFile\u5e94\u8be5\u662f\u4e0d\u4e3anull\u7684string");
  4560. var b = d.TMXMapInfo.createWithFile(a);
  4561. if (b) {
  4562. var c = b.getTilesets();
  4563. (!c || 0 === c.length) && d.Logger.info("TMXTiledMap.initWithTMXFile(): Map\u6ca1\u6709", a);
  4564. this.buildWithMapInfo(b)
  4565. }
  4566. };
  4567. a.prototype.buildWithMapInfo = function (a) {
  4568. this.mapInfo = a;
  4569. var d = 0, c = a.getLayers();
  4570. if (c)for (var h = null, k = 0, l = c.length; k < l; k++)if ((h = c[k]) && h.visible)h = this.parseLayer(h, a), b.prototype.addChild.call(this, h, d), d++
  4571. };
  4572. a.prototype.parseLayer = function (a, b) {
  4573. var c = this.tilesetForLayer(a, b), c = d.TMXLayer.create(c, a, b);
  4574. a.ownTiles = !1;
  4575. c.setupTiles();
  4576. return c
  4577. };
  4578. a.prototype.tilesetForLayer = function (a, b) {
  4579. var c = a.layerWidth, h = a.layerHeight, k = b.getTilesets();
  4580. if (k)for (var l = k.length - 1; 0 <= l; l--) {
  4581. var m = k[l];
  4582. if (m)for (var p =
  4583. 0; p < h; p++)for (var n = 0; n < c; n++) {
  4584. var q = a._tiles[n + c * p];
  4585. if (0 != q && (q & d.TMX.TILE_FLIPPED_MASK) >>> 0 >= m.firstGid)return m
  4586. }
  4587. }
  4588. d.Logger.warning("TMXLayer" + a.name + "\u6ca1\u6709tiles");
  4589. return null
  4590. };
  4591. a.prototype.getLayer = function (a) {
  4592. (!a || 0 === a.length) && d.Logger.fatal("TMXTiledMap.getLayer(): layerName\u5e94\u8be5\u662f\u4e0d\u4e3anull\u7684string");
  4593. for (var c = this.numChildren, g = 0; g < c; g++) {
  4594. var h = b.prototype.getChildAt.call(this, g);
  4595. if (h && h.getLayerName && h.getLayerName() == a)return h
  4596. }
  4597. return null
  4598. };
  4599. a.prototype.getObjectGroup =
  4600. function (a) {
  4601. (!a || 0 === a.length) && d.Logger.fatal("TMXTiledMap.getObjectGroup(): groupName\u5e94\u8be5\u662f\u4e0d\u4e3anull\u7684string");
  4602. var b = this.mapInfo.getObjectGroups;
  4603. if (b)for (var c = 0, h = b.length; c < h; c++) {
  4604. var k = b[c];
  4605. if (k && k.getGroupName() == a)return k
  4606. }
  4607. return null
  4608. };
  4609. a.prototype.propertiesForGID = function (a) {
  4610. return this.mapInfo.getTileProperties()[a]
  4611. };
  4612. a.prototype.getProperty = function (a) {
  4613. return this.mapInfo.getProperties()[a.toString()]
  4614. };
  4615. a.prototype.setMoveX = function (a) {
  4616. this.x = a;
  4617. a = this.numChildren;
  4618. for (var b =
  4619. 0; b < a; b++) {
  4620. var c = this.getChildAt(b);
  4621. if (c instanceof d.TMXLayer) {
  4622. if (c.visible)for (var h = 0; h < c.numChildren; h++) {
  4623. var k = c.getChildAt(h);
  4624. k.x + this.mapInfo.getTileWidth() < -this.x || k.x > -this.x + this.viewPortWidth ? k.visible = !1 : k.visible = !0
  4625. }
  4626. } else h = c.getBounds(), c.visible = c.x + h.width - c.anchorPointX < -this.x || c.x - c.anchorPointX > -this.x + this.viewPortWidth ? !1 : !0
  4627. }
  4628. };
  4629. return a
  4630. }(d.DisplayObjectContainer);
  4631. d.TMXTiledMap = c
  4632. })(ns_egret || (ns_egret = {}));
  4633. __extends = this.__extends || function (d, c) {
  4634. function b() {
  4635. this.constructor = d
  4636. }
  4637. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  4638. b.prototype = c.prototype;
  4639. d.prototype = new b
  4640. };
  4641. (function (d) {
  4642. var c = function (b) {
  4643. function a() {
  4644. b.apply(this, arguments);
  4645. this._properties = this._layerOrientation = this._tileSet = this._tiles = this._mapTileHeight = this._mapTileWidth = this._layerHeight = this._layerWidth = this._texture = null;
  4646. this._layerName = "";
  4647. this._opacity = 1;
  4648. this._atlasIndexArray = this._maxGID = this._minGID = null
  4649. }
  4650. __extends(a, b);
  4651. a.create = function (b, d, c) {
  4652. var h = new a;
  4653. h.initWithTilesetInfo(b, d, c);
  4654. return h
  4655. };
  4656. a.prototype.initWithTilesetInfo = function (a, b, c) {
  4657. this._texture = d.TextureCache.getInstance().getTexture(a.sourceImage);
  4658. this._layerName = b.name;
  4659. this._layerWidth = b.layerWidth;
  4660. this._layerHeight = b.layerHeight;
  4661. this._tiles = b._tiles;
  4662. this._minGID = b._minGID;
  4663. this._maxGID = b._maxGID;
  4664. this._opacity = b.opacity;
  4665. this.setProperties(b.getProperties());
  4666. this._tileSet = a;
  4667. this._mapTileWidth = c.getTileWidth();
  4668. this._mapTileHeight = c.getTileHeight();
  4669. this._layerOrientation = c.getOrientation();
  4670. a = this.calculateLayerOffset(b.layerX, b.layerY);
  4671. this.x = a.x;
  4672. this.y = a.y;
  4673. this._atlasIndexArray = []
  4674. };
  4675. a.prototype.calculateLayerOffset = function (a, b) {
  4676. var c = d.Point.identity;
  4677. switch (this._layerOrientation) {
  4678. case d.TMX.ORIENTATION_ORTHO:
  4679. c.x = a * this._mapTileWidth;
  4680. c.y = -b * this._mapTileHeight;
  4681. break;
  4682. case d.TMX.ORIENTATION_ISO:
  4683. c.x = this._mapTileWidth / 2 * (a - b);
  4684. c.y = this._mapTileHeight / 2 * (-a - b);
  4685. break;
  4686. case d.TMX.ORIENTATION_HEX:
  4687. (0 !== a || 0 !== b) && d.Logger.info("hexagonal map\u8fd8\u6ca1\u6709\u5b8c\u6210")
  4688. }
  4689. return c
  4690. };
  4691. a.prototype.setupTiles = function () {
  4692. this._tileSet.imageWidth = this._texture.getTextureWidth();
  4693. this._tileSet.imageHeight = this._texture.getTextureHeight();
  4694. for (var a = this._layerHeight,
  4695. b = this._layerWidth, c = 0; c < a; c++)for (var h = 0; h < b; h++) {
  4696. var k = this._tiles[h + b * c];
  4697. 0 !== k && (this.appendTileForGID(k, h, c), this._minGID = Math.min(k, this._minGID), this._maxGID = Math.max(k, this._maxGID))
  4698. }
  4699. this._maxGID >= this._tileSet.firstGid && this._minGID >= this._tileSet.firstGid || d.Logger.warning("\u6bcf\u4e2alayer\u53ea\u652f\u63011\u4e2atileset")
  4700. };
  4701. a.prototype.appendTileForGID = function (a, d, c) {
  4702. var h = this._tileSet.rectForGID(a), h = this.reusedTileWithRect(h);
  4703. this.setupTileSprite(h, d, c, a);
  4704. b.prototype.addChild.call(this,
  4705. h, this._atlasIndexArray.length);
  4706. return h
  4707. };
  4708. a.prototype.reusedTileWithRect = function (a) {
  4709. var b = d.Bitmap.initWithTexture(d.TextureCache.getInstance().getTexture(this._tileSet.sourceImage)), c = new d.SpriteSheetFrame;
  4710. c.x = a.x;
  4711. c.y = a.y;
  4712. c.w = this._mapTileWidth;
  4713. c.h = this._mapTileHeight;
  4714. b.spriteFrame = c;
  4715. return b
  4716. };
  4717. a.prototype.setupTileSprite = function (a, b, d, c) {
  4718. b = this.getPositionAt(b, d);
  4719. a.x = b.x;
  4720. a.y = b.y
  4721. };
  4722. a.prototype.getPositionAt = function (a, b) {
  4723. var c = d.Point.identity;
  4724. switch (this._layerOrientation) {
  4725. case d.TMX.ORIENTATION_ORTHO:
  4726. c =
  4727. this.positionForOrthoAt(a, b);
  4728. break;
  4729. case d.TMX.ORIENTATION_ISO:
  4730. c = this.positionForIsoAt(a, b);
  4731. break;
  4732. case d.TMX.ORIENTATION_HEX:
  4733. c = this.positionForHexAt(a, b);
  4734. break;
  4735. default:
  4736. c.x = 0, c.y = 0
  4737. }
  4738. return c
  4739. };
  4740. a.prototype.positionForIsoAt = function (a, b) {
  4741. d.Point.identity.x = this._mapTileWidth / 2 * (this._layerWidth + a - b - 1);
  4742. d.Point.identity.y = -this._mapTileHeight / 2 * (2 * this._layerHeight - a - b - 2);
  4743. return d.Point.identity
  4744. };
  4745. a.prototype.positionForOrthoAt = function (a, b) {
  4746. d.Point.identity.x = a * this._mapTileWidth;
  4747. d.Point.identity.y = -(this._layerHeight -
  4748. b - 1) * this._mapTileHeight;
  4749. return d.Point.identity
  4750. };
  4751. a.prototype.positionForHexAt = function (a, b) {
  4752. var c = 1 == a % 2 ? -this._mapTileHeight / 2 : 0;
  4753. d.Point.identity.x = 3 * a * this._mapTileWidth / 4;
  4754. d.Point.identity.y = -((this._layerHeight - b - 1) * this._mapTileHeight + c);
  4755. return d.Point.identity
  4756. };
  4757. a.prototype.getTileGIDAt = function (a, b) {
  4758. (a >= this._layerWidth || b >= this._layerHeight || 0 > a || 0 > b) && d.Logger.fatal("TMXLayer.getTileGIDAt():\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  4759. return!this._tiles || !this._atlasIndexArray ?
  4760. (d.Logger.info("TMXLayer.getTileGIDAt(): tileMap\u5df2\u7ecf\u88ab\u9500\u6bc1"), null) : (this._tiles[0 | a + b * this._layerWidth] & d.TMX.TILE_FLIPPED_MASK) >>> 0
  4761. };
  4762. a.prototype.getProperties = function () {
  4763. return this._properties
  4764. };
  4765. a.prototype.setProperties = function (a) {
  4766. this._properties = a
  4767. };
  4768. a.prototype.getProperty = function (a) {
  4769. return this._properties[a]
  4770. };
  4771. a.prototype.getLayerName = function () {
  4772. return this._layerName
  4773. };
  4774. return a
  4775. }(d.DisplayObjectContainer);
  4776. d.TMXLayer = c
  4777. })(ns_egret || (ns_egret = {}));
  4778. (function (d) {
  4779. var c = function () {
  4780. function b() {
  4781. }
  4782. b.TILE_HORIZONTAL_FLAG = 2147483648;
  4783. b.TILE_VERTICAL_FLAG = 1073741824;
  4784. b.TILE_DIAGONAL_FLAG = 536870912;
  4785. b.TILE_FLIPPED_ALL = (b.TILE_HORIZONTAL_FLAG | b.TILE_VERTICAL_FLAG | b.TILE_DIAGONAL_FLAG) >>> 0;
  4786. b.TILE_FLIPPED_MASK = ~b.TILE_FLIPPED_ALL >>> 0;
  4787. b.LAYER_ATTRIB_NONE = 1;
  4788. b.LAYER_ATTRIB_BASE64 = 2;
  4789. b.LAYER_ATTRIB_GZIP = 4;
  4790. b.LAYER_ATTRIB_ZLIB = 8;
  4791. b.PROPERTY_NONE = 0;
  4792. b.PROPERTY_MAP = 1;
  4793. b.PROPERTY_LAYER = 2;
  4794. b.PROPERTY_OBJECTGROUP = 3;
  4795. b.PROPERTY_OBJECT = 4;
  4796. b.PROPERTY_TILE = 5;
  4797. b.ORIENTATION_ORTHO =
  4798. 0;
  4799. b.ORIENTATION_HEX = 1;
  4800. b.ORIENTATION_ISO = 2;
  4801. return b
  4802. }();
  4803. d.TMX = c
  4804. })(ns_egret || (ns_egret = {}));
  4805. (function (d) {
  4806. var c = function () {
  4807. function c() {
  4808. this._parentGID = this._objectGroups = this._tileSets = this._layers = this._tileHeight = this._tileWidth = this._mapHeight = this._mapWidth = this._orientation = null;
  4809. this._storingCharacters = !1;
  4810. this._tileProperties = this._currentString = this._TMXFileName = this._properties = null
  4811. }
  4812. c.createWithFile = function (a) {
  4813. var b = new c;
  4814. b.initWithTMXFile(a);
  4815. return b
  4816. };
  4817. c.prototype.initWithTMXFile = function (a) {
  4818. this.internalInit(a);
  4819. this.parseXMXFile(this._TMXFileName)
  4820. };
  4821. c.prototype.internalInit = function (a) {
  4822. this._tileSets =
  4823. [];
  4824. this._layers = [];
  4825. this._TMXFileName = a;
  4826. this._objectGroups = [];
  4827. this._properties = [];
  4828. this._tileProperties = [];
  4829. this._currentString = "";
  4830. this._storingCharacters = !1
  4831. };
  4832. c.prototype.parseXMXFile = function (c) {
  4833. var f = d.ResourceLoader.create(c).data;
  4834. null == f && d.Logger.fatal("tmx\u6587\u4ef6\u6ca1\u6709\u52a0\u8f7d\uff1a" + c);
  4835. var k;
  4836. c = d.SAXParser.getInstance().tmxParse(f, !0).documentElement;
  4837. c.getAttribute("version");
  4838. f = c.getAttribute("orientation");
  4839. if ("map" == c.nodeName && ("orthogonal" == f ? this.setOrientation(d.TMX.ORIENTATION_ORTHO) :
  4840. "isometric" == f ? this.setOrientation(d.TMX.ORIENTATION_ISO) : "hexagonal" == f ? this.setOrientation(d.TMX.ORIENTATION_HEX) : null !== f && d.Logger.info("TMXFomat: Unsupported orientation:" + this.getOrientation()), this._mapWidth = parseFloat(c.getAttribute("width")), this._mapHeight = parseFloat(c.getAttribute("height")), this._tileWidth = parseFloat(c.getAttribute("tilewidth")), this._tileHeight = parseFloat(c.getAttribute("tileheight")), k = c.querySelectorAll("map \x3e properties \x3e property"))) {
  4841. for (var l = {}, f = 0; f < k.length; f++)l[k[f].getAttribute("name")] =
  4842. k[f].getAttribute("value");
  4843. this.setProperties(l)
  4844. }
  4845. k = c.getElementsByTagName("tileset");
  4846. "map" !== c.nodeName && (k = [], k.push(c));
  4847. for (f = 0; f < k.length; f++) {
  4848. var m = k[f];
  4849. if (l = m.getAttribute("source"))this.parseXMLFile(l); else {
  4850. l = new b;
  4851. l.name = m.getAttribute("name") || "";
  4852. l.firstGid = parseInt(m.getAttribute("firstgid")) || 0;
  4853. l.spacing = parseInt(m.getAttribute("spacing")) || 0;
  4854. l.margin = parseInt(m.getAttribute("margin")) || 0;
  4855. l.tileWidth = parseFloat(m.getAttribute("tilewidth"));
  4856. l.tileHeight = parseFloat(m.getAttribute("tileheight"));
  4857. var m = m.getElementsByTagName("image")[0].getAttribute("source"), p = -1;
  4858. this._TMXFileName && (p = this._TMXFileName.lastIndexOf("/"));
  4859. -1 !== p ? (p = this._TMXFileName.substr(0, p + 1), l.sourceImage = p + m) : l.sourceImage = m;
  4860. this.setTilesets(l)
  4861. }
  4862. }
  4863. if (l = c.querySelectorAll("tile"))for (f = 0; f < l.length; f++)if (k = l[f], this.setParentGID(parseInt(this._tileSets[0].firstGid) + parseInt(k.getAttribute("id") || 0)), m = k.querySelectorAll("properties \x3e property")) {
  4864. p = {};
  4865. for (k = 0; k < m.length; k++) {
  4866. var n = m[k].getAttribute("name"), q = m[k].getAttribute("value");
  4867. p[n] = q
  4868. }
  4869. this._tileProperties[this.getParentGID()] = p
  4870. }
  4871. if (l = c.getElementsByTagName("layer"))for (f = 0; f < l.length; f++) {
  4872. p = l[f];
  4873. n = p.getElementsByTagName("data")[0];
  4874. m = new e;
  4875. m.name = p.getAttribute("name");
  4876. m.layerWidth = parseFloat(p.getAttribute("width"));
  4877. m.layerHeight = parseFloat(p.getAttribute("height"));
  4878. k = p.getAttribute("visible");
  4879. m.visible = "0" != k;
  4880. k = p.getAttribute("opacity") || 1;
  4881. m.opacity = k ? parseFloat(k) : 1;
  4882. m.layerX = parseFloat(p.getAttribute("x")) || 0;
  4883. m.layerY = parseFloat(p.getAttribute("y")) || 0;
  4884. q = "";
  4885. for (k = 0; k < n.childNodes.length; k++)q +=
  4886. n.childNodes[k].nodeValue;
  4887. q = q.trim();
  4888. k = n.getAttribute("compression");
  4889. var s = n.getAttribute("encoding");
  4890. if (k && "gzip" !== k && "zlib" !== k)return d.Logger.fatal("TMXMapInfo.parseXMLFile(): unsupported compression method"), null;
  4891. switch (k) {
  4892. case "gzip":
  4893. m._tiles = d.Utils.unzipBase64AsArray(q, 4);
  4894. break;
  4895. case "zlib":
  4896. k = new Zlib.Inflate(d.Codec.Base64.decodeAsArray(q, 1));
  4897. m._tiles = d.Utils.uint8ArrayToUint32Array(k.decompress());
  4898. break;
  4899. case null:
  4900. case "":
  4901. if ("base64" == s)m._tiles = d.Codec.Base64.decodeAsArray(q, 4); else if ("csv" ===
  4902. s) {
  4903. m._tiles = [];
  4904. k = q.split(",");
  4905. for (n = 0; n < k.length; n++)m._tiles.push(parseInt(k[n]))
  4906. } else {
  4907. k = n.getElementsByTagName("tile");
  4908. m._tiles = [];
  4909. for (n = 0; n < k.length; n++)m._tiles.push(parseInt(k[n].getAttribute("gid")))
  4910. }
  4911. break;
  4912. default:
  4913. d.Logger.info("TMXMapInfo.parseXMLFile(): Only base64 and/or gzip/zlib maps are supported")
  4914. }
  4915. if (p = p.querySelectorAll("properties \x3e property")) {
  4916. n = {};
  4917. for (k = 0; k < p.length; k++)n[p[k].getAttribute("name")] = p[k].getAttribute("value");
  4918. m.setProperties(n)
  4919. }
  4920. this.setLayers(m)
  4921. }
  4922. if (l = c.getElementsByTagName("objectgroup"))for (f =
  4923. 0; f < l.length; f++) {
  4924. p = l[f];
  4925. m = new a;
  4926. m.setGroupName(p.getAttribute("name"));
  4927. m.setPositionOffsetX(parseFloat(p.getAttribute("x")) * this._tileWidth || 0);
  4928. m.setPositionOffsetY(parseFloat(p.getAttribute("y")) * this._tileHeight || 0);
  4929. if (n = p.querySelectorAll("objectgroup \x3e properties \x3e property"))for (k = 0; k < n.length; k++)q = {}, q[n[k].getAttribute("name")] = n[k].getAttribute("value"), m.setProperties(q);
  4930. if (p = p.querySelectorAll("object"))for (k = 0; k < p.length; k++) {
  4931. q = p[k];
  4932. n = {};
  4933. n.name = q.getAttribute("name") || "";
  4934. n.type =
  4935. q.getAttribute("type") || "";
  4936. n.x = parseInt(q.getAttribute("x") || 0) + m.getPositionOffsetX();
  4937. s = parseInt(q.getAttribute("y") || 0) + m.getPositionOffsetY();
  4938. n.y = Math.floor(this._mapHeight * this._tileHeight) - s - n.height;
  4939. n.width = parseInt(q.getAttribute("width")) || 0;
  4940. n.height = parseInt(q.getAttribute("height")) || 0;
  4941. if (s = q.querySelectorAll("properties \x3e property"))for (var x = 0; x < s.length; x++)n[s[x].getAttribute("name")] = s[x].getAttribute("value");
  4942. if ((s = q.querySelectorAll("polygon")) && 0 < s.length)(s = s[0].getAttribute("points")) &&
  4943. (n.polygonPoints = this.parsePointsString(s));
  4944. if ((q = q.querySelectorAll("polyline")) && 0 < q.length)(q = q[0].getAttribute("points")) && (n.polylinePoints = this.parsePointsString(q));
  4945. m.addObject(n)
  4946. }
  4947. this.setObjectGroups(m)
  4948. }
  4949. return c
  4950. };
  4951. c.prototype.parsePointsString = function (a) {
  4952. if (!a)return null;
  4953. var b = [];
  4954. a = a.split(" ");
  4955. for (var c = 0; c < a.length; c++) {
  4956. var d = a[c].split(",");
  4957. b.push({x: d[0], y: d[1]})
  4958. }
  4959. return b
  4960. };
  4961. c.prototype.getOrientation = function () {
  4962. return this._orientation
  4963. };
  4964. c.prototype.setOrientation = function (a) {
  4965. this._orientation =
  4966. a
  4967. };
  4968. c.prototype.getProperties = function () {
  4969. return this._properties
  4970. };
  4971. c.prototype.setProperties = function (a) {
  4972. this._properties = a
  4973. };
  4974. c.prototype.getTilesets = function () {
  4975. return this._tileSets
  4976. };
  4977. c.prototype.setTilesets = function (a) {
  4978. this._tileSets.push(a)
  4979. };
  4980. c.prototype.getParentGID = function () {
  4981. return this._parentGID
  4982. };
  4983. c.prototype.setParentGID = function (a) {
  4984. this._parentGID = a
  4985. };
  4986. c.prototype.getLayers = function () {
  4987. return this._layers
  4988. };
  4989. c.prototype.setLayers = function (a) {
  4990. this._layers.push(a)
  4991. };
  4992. c.prototype.getObjectGroups = function () {
  4993. return this._objectGroups
  4994. };
  4995. c.prototype.setObjectGroups = function (a) {
  4996. this._objectGroups.push(a)
  4997. };
  4998. c.prototype.getTileProperties = function () {
  4999. return this._tileProperties
  5000. };
  5001. c.prototype.setTileProperties = function (a) {
  5002. this._tileProperties.push(a)
  5003. };
  5004. c.prototype.getTileWidth = function () {
  5005. return this._tileWidth
  5006. };
  5007. c.prototype.getTileHeight = function () {
  5008. return this._tileHeight
  5009. };
  5010. c.prototype.getMapWidth = function () {
  5011. return this._mapWidth
  5012. };
  5013. c.prototype.getMapHeight = function () {
  5014. return this._mapHeight
  5015. };
  5016. return c
  5017. }();
  5018. d.TMXMapInfo = c;
  5019. var b = function () {
  5020. function a() {
  5021. this.name =
  5022. ""
  5023. }
  5024. a.prototype.rectForGID = function (a) {
  5025. var b = d.Point.identity;
  5026. a &= d.TMX.TILE_FLIPPED_MASK;
  5027. a -= parseInt(this.firstGid, 10);
  5028. var c = Math.floor((this.imageWidth - 2 * this.margin + this.spacing) / (this.tileWidth + this.spacing));
  5029. b.x = parseInt(a % c * (this.tileWidth + this.spacing) + this.margin, 10);
  5030. b.y = parseInt(Math.floor(a / c) * (this.tileHeight + this.spacing) + this.margin, 10);
  5031. return b
  5032. };
  5033. return a
  5034. }();
  5035. d.TMXTilesetInfo = b;
  5036. var a = function () {
  5037. function a() {
  5038. this._properties = [];
  5039. this._objects = []
  5040. }
  5041. a.prototype.getGroupName = function () {
  5042. return this._groupName
  5043. };
  5044. a.prototype.setGroupName = function (a) {
  5045. this._groupName = a
  5046. };
  5047. a.prototype.getPositionOffsetX = function () {
  5048. return this._positionOffsetX
  5049. };
  5050. a.prototype.setPositionOffsetX = function (a) {
  5051. this._positionOffsetX = a
  5052. };
  5053. a.prototype.getPositionOffsetY = function () {
  5054. return this._positionOffsetY
  5055. };
  5056. a.prototype.setPositionOffsetY = function (a) {
  5057. this._positionOffsetY = a
  5058. };
  5059. a.prototype.getProperties = function () {
  5060. return this._properties
  5061. };
  5062. a.prototype.setProperties = function (a) {
  5063. this._properties.push(a)
  5064. };
  5065. a.prototype.getObjects = function () {
  5066. return this._objects
  5067. };
  5068. a.prototype.addObject = function (a) {
  5069. this._objects.push(a)
  5070. };
  5071. return a
  5072. }();
  5073. d.TMXObjectGroup = a;
  5074. var e = function () {
  5075. function a() {
  5076. this._minGID = 1E5;
  5077. this._maxGID = 0
  5078. }
  5079. a.prototype.getProperties = function () {
  5080. return this._properties
  5081. };
  5082. a.prototype.setProperties = function (a) {
  5083. this._properties = a
  5084. };
  5085. return a
  5086. }();
  5087. d.TMXLayerInfo = e
  5088. })(ns_egret || (ns_egret = {}));
  5089. __extends = this.__extends || function (d, c) {
  5090. function b() {
  5091. this.constructor = d
  5092. }
  5093. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  5094. b.prototype = c.prototype;
  5095. d.prototype = new b
  5096. };
  5097. (function (d) {
  5098. var c = function (b) {
  5099. function a() {
  5100. b.apply(this, arguments);
  5101. this.className = "VirtualJoystick";
  5102. this.leftButtonWidth = 79;
  5103. this.leftButtonHeight = 46;
  5104. this.leftButtonOffset = 30;
  5105. this.leftTouchPointY = this.leftTouchPointX = this.bottomImageDownName = this.rightImageDownName = this.topImageDownName = this.leftImageDownName = this.bottomImageNormalName = this.rightImageNormalName = this.topImageNormalName = this.leftImageNormalName = this.bottomImageDown = this.rightImageDown = this.topImageDown = this.leftImageDown = this.bottomImageNormal =
  5106. this.rightImageNormal = this.topImageNormal = this.leftImageNormal = this.bottomNode = this.rightNode = this.topNode = this.leftNode = null;
  5107. this.isLeftTouching = !1;
  5108. this.rightButtonImageDownName = this.rightButtonImageNormalName = this.rightButtonImageDown = this.rightButtonImageNormal = null;
  5109. this.rightButtonWidth = 0;
  5110. this.rightTouchPointY = this.rightTouchPointX = null;
  5111. this.isRightTouching = !1
  5112. }
  5113. __extends(a, b);
  5114. a.getInstance = function () {
  5115. null == a.instacce && (a.instacce = new a);
  5116. return a.instacce
  5117. };
  5118. a.prototype.show = function () {
  5119. this.leftContainer =
  5120. new d.DisplayObjectContainer;
  5121. this.leftContainer.touchEnabled = !0;
  5122. this.addChild(this.leftContainer);
  5123. this.leftNode = new d.DisplayObjectContainer;
  5124. this.leftNode.x = -this.leftButtonWidth - this.leftButtonOffset;
  5125. this.leftNode.y = -this.leftButtonHeight / 2;
  5126. this.leftContainer.addChild(this.leftNode);
  5127. this.topNode = new d.DisplayObjectContainer;
  5128. this.topNode.x = -this.leftButtonHeight / 2;
  5129. this.topNode.y = -this.leftButtonWidth - this.leftButtonOffset;
  5130. this.leftContainer.addChild(this.topNode);
  5131. this.rightNode = new d.DisplayObjectContainer;
  5132. this.rightNode.x = this.leftButtonOffset;
  5133. this.rightNode.y = -this.leftButtonHeight / 2;
  5134. this.leftContainer.addChild(this.rightNode);
  5135. this.bottomNode = new d.DisplayObjectContainer;
  5136. this.bottomNode.x = -this.leftButtonHeight / 2;
  5137. this.bottomNode.y = this.leftButtonOffset;
  5138. this.leftContainer.addChild(this.bottomNode);
  5139. this.rightButtonNode = new d.DisplayObjectContainer;
  5140. this.addChild(this.rightButtonNode);
  5141. this.resetLeft();
  5142. this.resetRight();
  5143. this.rightButtonWidth = this.rightButtonNode.getBounds().width;
  5144. this.rightButtonNode.x =
  5145. (d.StageDelegate.getInstance().getDesignWidth() - this.rightButtonWidth - this.x) / this.scaleX;
  5146. this.rightButtonNode.y = -this.rightButtonWidth / 2;
  5147. this.rightButtonNode.touchEnabled = !0;
  5148. var a = d.TextureCache.getInstance().getTexture("alpha_0.png"), a = d.Bitmap.initWithTexture(a), b = this.leftButtonWidth + this.leftButtonOffset;
  5149. a.scaleX = a.scaleY = 2 * b;
  5150. a.x = a.y = -b;
  5151. this.leftContainer.addChild(a);
  5152. this.leftContainer.addEventListener(d.TouchEvent.TOUCH_BEGAN, this.onLeftTouchBegin, this);
  5153. this.leftContainer.addEventListener(d.TouchEvent.TOUCH_MOVE,
  5154. this.onLeftTouchMoved, this);
  5155. this.rightButtonNode.addEventListener(d.TouchEvent.TOUCH_BEGAN, this.onRightTouchBegin, this);
  5156. this.rightButtonNode.addEventListener(d.TouchEvent.TOUCH_MOVE, this.onRightTouchMoved, this);
  5157. d.MainContext.instance.stage.addEventListener(d.TouchEvent.TOUCH_END, this.onTouchEnded, this);
  5158. d.Ticker.getInstance().register(this.update, this)
  5159. };
  5160. a.prototype.update = function () {
  5161. null != this.leftTouchPointX && (null != this.leftTouchPointY && this.isLeftTouching) && this.checkIsLeftTouchInside() && this.sendLeftTouchEvent();
  5162. null != this.rightTouchPointX && (null != this.rightTouchPointY && this.isRightTouching) && this.checkIsRightTouchInside() && (this.changeBtnState(this.rightButtonNode, "Down"), this.dispatchEvent(a.ON_TOUCH_RIGHT))
  5163. };
  5164. a.prototype.resetLeft = function () {
  5165. this.changeBtnState(this.leftNode, "Normal");
  5166. this.changeBtnState(this.topNode, "Normal");
  5167. this.changeBtnState(this.rightNode, "Normal");
  5168. this.changeBtnState(this.bottomNode, "Normal")
  5169. };
  5170. a.prototype.resetRight = function () {
  5171. this.changeBtnState(this.rightButtonNode, "Normal")
  5172. };
  5173. a.prototype.changeBtnState = function (a, b) {
  5174. var c;
  5175. switch (a) {
  5176. case this.leftNode:
  5177. null == this["leftImage" + b] && (this["leftImage" + b] = this.createBtn(this["leftImage" + b + "Name"]));
  5178. c = this["leftImage" + b];
  5179. break;
  5180. case this.topNode:
  5181. null == this["topImage" + b] && (this["topImage" + b] = this.createBtn(this["topImage" + b + "Name"]));
  5182. c = this["topImage" + b];
  5183. break;
  5184. case this.rightNode:
  5185. null == this["rightImage" + b] && (this["rightImage" + b] = this.createBtn(this["rightImage" + b + "Name"]));
  5186. c = this["rightImage" + b];
  5187. break;
  5188. case this.bottomNode:
  5189. null ==
  5190. this["bottomImage" + b] && (this["bottomImage" + b] = this.createBtn(this["bottomImage" + b + "Name"]));
  5191. c = this["bottomImage" + b];
  5192. break;
  5193. case this.rightButtonNode:
  5194. null == this["rightButtonImage" + b] && (this["rightButtonImage" + b] = this.createBtn(this["rightButtonImage" + b + "Name"])), c = this["rightButtonImage" + b]
  5195. }
  5196. a.removeAllChildren();
  5197. a.addChild(c)
  5198. };
  5199. a.prototype.createBtn = function (a) {
  5200. return d.Bitmap.initWithTexture(d.TextureCache.getInstance().getTexture(a))
  5201. };
  5202. a.prototype.onLeftTouchBegin = function (a, b) {
  5203. this.leftTouchId = b.touchId;
  5204. var c = b.getLocalPoint();
  5205. this.leftTouchPointX = c.x;
  5206. this.leftTouchPointY = c.y;
  5207. this.checkIsLeftTouchInside() && (this.isLeftTouching = !0)
  5208. };
  5209. a.prototype.checkIsLeftTouchInside = function () {
  5210. return this.leftTouchPointX * this.scaleX > -this.leftButtonWidth - this.leftButtonOffset && this.leftTouchPointX * this.scaleX < this.leftButtonWidth + this.leftButtonOffset && this.leftTouchPointY * this.scaleY > -this.leftButtonWidth - this.leftButtonOffset && this.leftTouchPointY * this.scaleY < this.leftButtonWidth + this.leftButtonOffset ? !0 : !1
  5211. };
  5212. a.prototype.onLeftTouchMoved =
  5213. function (a, b) {
  5214. var c = b.getLocalPoint();
  5215. this.leftTouchPointX = c.x;
  5216. this.leftTouchPointY = c.y
  5217. };
  5218. a.prototype.onTouchEnded = function (b, c) {
  5219. if (null == this.leftTouchId || this.leftTouchId == c.touchId)this.isLeftTouching && (this.isLeftTouching = !1, this.resetLeft(), this.dispatchEvent(a.STOP_TOUCH_LEFT)), this.leftTouchId = null;
  5220. if (null == this.rightTouchId || this.rightTouchId == c.touchId)this.isRightTouching && (this.isRightTouching = !1, this.resetRight(), this.dispatchEvent(a.STOP_TOUCH_RIGHT)), this.rightTouchId = null
  5221. };
  5222. a.prototype.sendLeftTouchEvent =
  5223. function () {
  5224. if (this.checkIsLeftTouchInside())if (this.leftTouchPointX > -this.leftButtonOffset && this.leftTouchPointX < this.leftButtonOffset && this.leftTouchPointY > -this.leftButtonOffset && this.leftTouchPointY < this.leftButtonOffset)this.resetLeft(); else {
  5225. var b = Math.atan2(this.leftTouchPointY, this.leftTouchPointX) * (180 / Math.PI);
  5226. 0 > b && (b += 360);
  5227. var c = [];
  5228. 330 < b || 30 > b ? (this.changeBtnState(this.leftNode, "Normal"), this.changeBtnState(this.topNode, "Normal"), this.changeBtnState(this.rightNode, "Down"), this.changeBtnState(this.bottomNode,
  5229. "Normal"), c.push(a.DIRECTION_RIGHT)) : 30 < b && 60 > b ? (this.changeBtnState(this.leftNode, "Normal"), this.changeBtnState(this.topNode, "Normal"), this.changeBtnState(this.rightNode, "Down"), this.changeBtnState(this.bottomNode, "Down"), c.push(a.DIRECTION_BOTTOM, a.DIRECTION_RIGHT)) : 60 < b && 120 > b ? (this.changeBtnState(this.leftNode, "Normal"), this.changeBtnState(this.topNode, "Normal"), this.changeBtnState(this.rightNode, "Normal"), this.changeBtnState(this.bottomNode, "Down"), c.push(a.DIRECTION_BOTTOM)) : 120 < b && 150 > b ? (this.changeBtnState(this.leftNode,
  5230. "Down"), this.changeBtnState(this.topNode, "Normal"), this.changeBtnState(this.rightNode, "Normal"), this.changeBtnState(this.bottomNode, "Down"), c.push(a.DIRECTION_BOTTOM, a.DIRECTION_LEFT)) : 150 < b && 210 > b ? (this.changeBtnState(this.leftNode, "Down"), this.changeBtnState(this.topNode, "Normal"), this.changeBtnState(this.rightNode, "Normal"), this.changeBtnState(this.bottomNode, "Normal"), c.push(a.DIRECTION_LEFT)) : 210 < b && 240 > b ? (this.changeBtnState(this.leftNode, "Down"), this.changeBtnState(this.topNode, "Down"), this.changeBtnState(this.rightNode,
  5231. "Normal"), this.changeBtnState(this.bottomNode, "Normal"), c.push(a.DIRECTION_LEFT, a.DIRECTION_TOP)) : 240 < b && 300 > b ? (this.changeBtnState(this.leftNode, "Normal"), this.changeBtnState(this.topNode, "Down"), this.changeBtnState(this.rightNode, "Normal"), this.changeBtnState(this.bottomNode, "Normal"), c.push(a.DIRECTION_TOP)) : 300 < b && 330 > b && (this.changeBtnState(this.leftNode, "Normal"), this.changeBtnState(this.topNode, "Down"), this.changeBtnState(this.rightNode, "Down"), this.changeBtnState(this.bottomNode, "Normal"),
  5232. c.push(a.DIRECTION_TOP, a.DIRECTION_RIGHT));
  5233. this.dispatchEvent(a.ON_TOUCH_LEFT, c)
  5234. }
  5235. };
  5236. a.prototype.onRightTouchBegin = function (a, b) {
  5237. this.rightTouchId = b.touchId;
  5238. var c = b.getLocalPoint();
  5239. this.rightTouchPointX = c.x;
  5240. this.rightTouchPointY = c.y;
  5241. this.checkIsRightTouchInside() && (this.isRightTouching = !0)
  5242. };
  5243. a.prototype.checkIsRightTouchInside = function () {
  5244. return this.rightTouchPointX * this.scaleX > -this.rightButtonWidth && this.rightTouchPointX * this.scaleX < this.rightButtonWidth && this.rightTouchPointY * this.scaleY > -this.rightButtonWidth &&
  5245. this.rightTouchPointY * this.scaleY < this.rightButtonWidth ? !0 : !1
  5246. };
  5247. a.prototype.onRightTouchMoved = function (a, b) {
  5248. var c = b.getLocalPoint();
  5249. this.rightTouchPointX = c.x;
  5250. this.rightTouchPointY = c.y
  5251. };
  5252. a.prototype.setBtnVisible = function (b, c) {
  5253. switch (b) {
  5254. case a.DIRECTION_LEFT:
  5255. this.leftNode.visible = c;
  5256. break;
  5257. case a.DIRECTION_TOP:
  5258. this.topNode.visible = c;
  5259. break;
  5260. case a.DIRECTION_RIGHT:
  5261. this.rightNode.visible = c;
  5262. break;
  5263. case a.DIRECTION_BOTTOM:
  5264. this.bottomNode.visible = c
  5265. }
  5266. };
  5267. a.prototype.setButtonWidth = function (a) {
  5268. this.leftButtonWidth =
  5269. a
  5270. };
  5271. a.prototype.setButtonHeight = function (a) {
  5272. this.leftButtonHeight = a
  5273. };
  5274. a.prototype.setButtonOffset = function (a) {
  5275. this.leftButtonOffset = a
  5276. };
  5277. a.prototype.setLeftImageNormalName = function (a) {
  5278. this.leftImageNormalName = a
  5279. };
  5280. a.prototype.setTopImageNormalName = function (a) {
  5281. this.topImageNormalName = a
  5282. };
  5283. a.prototype.setRightImageNormalName = function (a) {
  5284. this.rightImageNormalName = a
  5285. };
  5286. a.prototype.setBottomImageNormalName = function (a) {
  5287. this.bottomImageNormalName = a
  5288. };
  5289. a.prototype.setLeftImageDownName = function (a) {
  5290. this.leftImageDownName =
  5291. a
  5292. };
  5293. a.prototype.setTopImageDownName = function (a) {
  5294. this.topImageDownName = a
  5295. };
  5296. a.prototype.setRightImageDownName = function (a) {
  5297. this.rightImageDownName = a
  5298. };
  5299. a.prototype.setBottomImageDownName = function (a) {
  5300. this.bottomImageDownName = a
  5301. };
  5302. a.prototype.setRightButtonImageNormalName = function (a) {
  5303. this.rightButtonImageNormalName = a
  5304. };
  5305. a.prototype.setRightButtonImageDownName = function (a) {
  5306. this.rightButtonImageDownName = a
  5307. };
  5308. a.DIRECTION_LEFT = 1;
  5309. a.DIRECTION_TOP = 2;
  5310. a.DIRECTION_RIGHT = 3;
  5311. a.DIRECTION_BOTTOM = 4;
  5312. a.ON_TOUCH_LEFT = "VirtualJoystickClickLeft";
  5313. a.ON_TOUCH_RIGHT = "VirtualJoystickClickRight";
  5314. a.STOP_TOUCH_LEFT = "VirtualJoystickStopTouchLeft";
  5315. a.STOP_TOUCH_RIGHT = "VirtualJoystickStopTouchRight";
  5316. a.instacce = null;
  5317. return a
  5318. }(d.DisplayObjectContainer);
  5319. d.VirtualJoystick = c
  5320. })(ns_egret || (ns_egret = {}));
  5321. __extends = this.__extends || function (d, c) {
  5322. function b() {
  5323. this.constructor = d
  5324. }
  5325. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  5326. b.prototype = c.prototype;
  5327. d.prototype = new b
  5328. };
  5329. (function (d) {
  5330. var c = function (b) {
  5331. function a() {
  5332. b.call(this)
  5333. }
  5334. __extends(a, b);
  5335. a.prototype.onActivity = function () {
  5336. b.prototype.onActivity.call(this);
  5337. this.addEventListener(d.TouchEvent.TOUCH_TAP, this.onTouchTap, this)
  5338. };
  5339. a.prototype.onCancel = function () {
  5340. b.prototype.onCancel.call(this);
  5341. this.removeEventListener(d.TouchEvent.TOUCH_TAP, this.onTouchTap, this)
  5342. };
  5343. a.prototype.onTouchTap = function () {
  5344. console.log("tap!!")
  5345. };
  5346. return a
  5347. }(d.ComponentBase);
  5348. d.Button = c
  5349. })(ns_egret || (ns_egret = {}));
  5350. __extends = this.__extends || function (d, c) {
  5351. function b() {
  5352. this.constructor = d
  5353. }
  5354. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  5355. b.prototype = c.prototype;
  5356. d.prototype = new b
  5357. };
  5358. (function (d) {
  5359. var c = function (b) {
  5360. function a(a, c) {
  5361. "undefined" === typeof c && (c = "");
  5362. b.call(this);
  5363. "" != c && (this._bg = d.Bitmap.initWithTexture(d.TextureCache.getInstance().getTexture(c)), this.addChild(this._bg));
  5364. var g = d.TextureCache.getInstance().getTexture(a);
  5365. this._barWidth = g.getTextureWidth();
  5366. this._bar = d.Bitmap.initWithTexture(g);
  5367. this.addChild(this._bar);
  5368. g = {x: 0, y: 0, width: this._barWidth, height: g.getTextureHeight()};
  5369. this._bar.mask = g
  5370. }
  5371. __extends(a, b);
  5372. Object.defineProperty(a.prototype, "percentage", {get: function () {
  5373. return this._percentage
  5374. },
  5375. set: function (a) {
  5376. this._percentage = a;
  5377. this.setProgress(this._percentage, 100)
  5378. }, enumerable: !0, configurable: !0});
  5379. a.prototype.setOffset = function (a, b) {
  5380. this._bar.x = a;
  5381. this._bar.y = b
  5382. };
  5383. a.prototype.setProgress = function (a, b) {
  5384. this._percentage = 100 * (a / b);
  5385. this._bar.mask.width = this._barWidth * a / b
  5386. };
  5387. return a
  5388. }(d.DisplayObjectContainer);
  5389. d.ProgressBar = c
  5390. })(ns_egret || (ns_egret = {}));
  5391. __extends = this.__extends || function (d, c) {
  5392. function b() {
  5393. this.constructor = d
  5394. }
  5395. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  5396. b.prototype = c.prototype;
  5397. d.prototype = new b
  5398. };
  5399. (function (d) {
  5400. var c = function (b) {
  5401. function a(a) {
  5402. b.call(this);
  5403. this.texture = a;
  5404. this._right = this._left = this._bottom = this._top = this._defaultPadding = 5;
  5405. this._scaleHeight = this._scaleWidth = 0
  5406. }
  5407. __extends(a, b);
  5408. a.prototype.setScaleGrid = function (a, b, c, h) {
  5409. "undefined" === typeof a && (a = this._defaultPadding);
  5410. "undefined" === typeof b && (b = this._defaultPadding);
  5411. "undefined" === typeof c && (c = this._defaultPadding);
  5412. "undefined" === typeof h && (h = this._defaultPadding);
  5413. d.DEBUG && d.DEBUG.SCALE_BITMAP_SET_SCALE_GRID && d.DEBUG.checkSetScaleGrid(this.texture,
  5414. a, b, c, h);
  5415. this._top = a;
  5416. this._bottom = b;
  5417. this._left = c;
  5418. this._right = h
  5419. };
  5420. a.prototype.setContentSize = function (a, c) {
  5421. b.prototype.setContentSize.call(this, a, c);
  5422. this.texture || d.Logger.fatal("Scale9Bitmap\u6ca1\u6709\u7eb9\u7406");
  5423. 0 < parseInt(a) && (this._scaleWidth = a);
  5424. 0 < parseInt(c) && (this._scaleHeight = c)
  5425. };
  5426. a.prototype.render = function (a) {
  5427. var b = this.texture, c = b.getTextureWidth(), h = b.getTextureHeight(), k = this._scaleWidth, l = this._scaleHeight;
  5428. (!b || 0 == k || 0 == l) && d.Logger.fatal("ScaleBitmap\u9700\u8981\u8bbe\u7f6eScaleSize");
  5429. var b = h - this._top - this._bottom, m = c - this._left - this._right, l = l - this._top - this._bottom, p = k - this._left - this._right;
  5430. this.drawImage(a, this.texture, 0, 0, this._left, this._top, 0, 0, this._left, this._top);
  5431. a.translate(this._left, 0);
  5432. this.drawImage(a, this.texture, this._left, 0, m, this._top, 0, 0, p, this._top);
  5433. a.translate(p, 0);
  5434. this.drawImage(a, this.texture, c - this._right, 0, this._right, this._top, 0, 0, this._right, this._top);
  5435. a.translate(-(k - this._right), this._top);
  5436. this.drawImage(a, this.texture, 0, this._top, this._left, b, 0, 0,
  5437. this._left, l);
  5438. a.translate(this._left, 0);
  5439. this.drawImage(a, this.texture, this._left, this._top, m, b, 0, 0, p, l);
  5440. a.translate(p, 0);
  5441. this.drawImage(a, this.texture, c - this._right, this._top, this._right, b, 0, 0, this._right, l);
  5442. a.translate(-(k - this._right), l);
  5443. this.drawImage(a, this.texture, 0, h - this._bottom, this._left, this._bottom, 0, 0, this._left, this._bottom);
  5444. a.translate(this._left, 0);
  5445. this.drawImage(a, this.texture, this._left, h - this._bottom, m, this._bottom, 0, 0, p, this._bottom);
  5446. a.translate(p, 0);
  5447. this.drawImage(a, this.texture,
  5448. c - this._right, h - this._bottom, this._right, this._bottom, 0, 0, this._right, this._bottom)
  5449. };
  5450. a.prototype.drawImage = function (a, b, c, d, k, l, m, p, n, q) {
  5451. 0 < k && 0 < l && a.drawImage(b, c, d, k, l, m, p, n, q)
  5452. };
  5453. return a
  5454. }(d.DisplayObject);
  5455. d.Scale9Bitmap = c
  5456. })(ns_egret || (ns_egret = {}));
  5457. __extends = this.__extends || function (d, c) {
  5458. function b() {
  5459. this.constructor = d
  5460. }
  5461. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  5462. b.prototype = c.prototype;
  5463. d.prototype = new b
  5464. };
  5465. (function (d) {
  5466. var c = function (b) {
  5467. function a() {
  5468. b.apply(this, arguments)
  5469. }
  5470. __extends(a, b);
  5471. a.create = function (b, c, d) {
  5472. "undefined" === typeof c && (c = null);
  5473. "undefined" === typeof d && (d = null);
  5474. var h = new a;
  5475. h.startLoad(b, c, d);
  5476. return h
  5477. };
  5478. a.prototype.startLoad = function (a, b, c) {
  5479. this._src = a;
  5480. this._onLoadComplete = b;
  5481. this._onLoadCompleteThisObj = c;
  5482. this._resource = d.ResourceLoader.create(a, d.ResourceLoader.DATA_TYPE_IMAGE);
  5483. this._resource.addEventListener(d.ResourceLoader.LOAD_COMPLETE, this.resourceLoadComplete, this);
  5484. this._resource.load()
  5485. };
  5486. a.prototype.resourceLoadComplete = function () {
  5487. this._resource.removeEventListener(d.ResourceLoader.LOAD_COMPLETE, this.resourceLoadComplete, this);
  5488. this._resource = null;
  5489. this.texture = d.TextureCache.getInstance().getTexture(this._src);
  5490. this._onLoadComplete && (this._onLoadComplete.call(this._onLoadCompleteThisObj), this._onLoadCompleteThisObj = this._onLoadComplete = null)
  5491. };
  5492. a.prototype._measureBounds = function () {
  5493. return this.texture ? b.prototype._measureBounds.call(this) : d.Rectangle.identity.initialize(0, 0, 0, 0)
  5494. };
  5495. return a
  5496. }(d.Bitmap);
  5497. d.DynamicBitmap = c
  5498. })(ns_egret || (ns_egret = {}));
  5499. var __extends = this.__extends || function (d, c) {
  5500. function b() {
  5501. this.constructor = d
  5502. }
  5503. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  5504. b.prototype = c.prototype;
  5505. d.prototype = new b
  5506. }, dragonBones;
  5507. (function (d) {
  5508. (function (a) {
  5509. var b = function () {
  5510. function a(b, c) {
  5511. "undefined" === typeof b && (b = 0);
  5512. "undefined" === typeof c && (c = 0);
  5513. this.x = b;
  5514. this.y = c
  5515. }
  5516. a.prototype.toString = function () {
  5517. return"[Point (x\x3d" + this.x + " y\x3d" + this.y + ")]"
  5518. };
  5519. return a
  5520. }();
  5521. a.Point = b;
  5522. b = function () {
  5523. return function (a, b, c, d) {
  5524. "undefined" === typeof a && (a = 0);
  5525. "undefined" === typeof b && (b = 0);
  5526. "undefined" === typeof c && (c = 0);
  5527. "undefined" === typeof d && (d = 0);
  5528. this.x = a;
  5529. this.y = b;
  5530. this.width = c;
  5531. this.height = d
  5532. }
  5533. }();
  5534. a.Rectangle = b;
  5535. b = function () {
  5536. function a() {
  5537. this.a = 1;
  5538. this.c =
  5539. this.b = 0;
  5540. this.d = 1;
  5541. this.ty = this.tx = 0
  5542. }
  5543. a.prototype.invert = function () {
  5544. var a = this.a, b = this.b, c = this.c, d = this.d, e = this.tx, f = a * d - b * c;
  5545. this.a = d / f;
  5546. this.b = -b / f;
  5547. this.c = -c / f;
  5548. this.d = a / f;
  5549. this.tx = (c * this.ty - d * e) / f;
  5550. this.ty = -(a * this.ty - b * e) / f
  5551. };
  5552. return a
  5553. }();
  5554. a.Matrix = b;
  5555. b = function () {
  5556. return function () {
  5557. this.redOffset = this.redMultiplier = this.greenOffset = this.greenMultiplier = this.blueOffset = this.blueMultiplier = this.alphaOffset = this.alphaMultiplier = 0
  5558. }
  5559. }();
  5560. a.ColorTransform = b
  5561. })(d.geom || (d.geom = {}));
  5562. var c = d.geom;
  5563. (function (a) {
  5564. var b =
  5565. function () {
  5566. return function (a) {
  5567. this.type = a
  5568. }
  5569. }();
  5570. a.Event = b;
  5571. var c = function (a) {
  5572. function b(c) {
  5573. a.call(this, c)
  5574. }
  5575. __extends(b, a);
  5576. b.FADE_IN = "fadeIn";
  5577. b.FADE_OUT = "fadeOut";
  5578. b.START = "start";
  5579. b.COMPLETE = "complete";
  5580. b.LOOP_COMPLETE = "loopComplete";
  5581. b.FADE_IN_COMPLETE = "fadeInComplete";
  5582. b.FADE_OUT_COMPLETE = "fadeOutComplete";
  5583. return b
  5584. }(b);
  5585. a.AnimationEvent = c;
  5586. c = function (a) {
  5587. function b(c) {
  5588. a.call(this, c)
  5589. }
  5590. __extends(b, a);
  5591. b.Z_ORDER_UPDATED = "zOrderUpdated";
  5592. return b
  5593. }(b);
  5594. a.ArmatureEvent = c;
  5595. c = function (a) {
  5596. function b(c) {
  5597. a.call(this, c)
  5598. }
  5599. __extends(b,
  5600. a);
  5601. b.ANIMATION_FRAME_EVENT = "animationFrameEvent";
  5602. b.BONE_FRAME_EVENT = "boneFrameEvent";
  5603. return b
  5604. }(b);
  5605. a.FrameEvent = c;
  5606. b = function (a) {
  5607. function b(c) {
  5608. a.call(this, c)
  5609. }
  5610. __extends(b, a);
  5611. b.SOUND = "sound";
  5612. b.BONE_FRAME_EVENT = "boneFrameEvent";
  5613. return b
  5614. }(b);
  5615. a.SoundEvent = b;
  5616. b = function () {
  5617. function a() {
  5618. }
  5619. a.prototype.hasEventListener = function (a) {
  5620. return this._listenersMap && this._listenersMap[a] ? !0 : !1
  5621. };
  5622. a.prototype.addEventListener = function (a, b) {
  5623. if (a && b) {
  5624. this._listenersMap || (this._listenersMap = {});
  5625. var c = this._listenersMap[a];
  5626. c &&
  5627. this.removeEventListener(a, b);
  5628. c ? c.push(b) : this._listenersMap[a] = [b]
  5629. }
  5630. };
  5631. a.prototype.removeEventListener = function (a, b) {
  5632. if (this._listenersMap && a && b) {
  5633. var c = this._listenersMap[a];
  5634. if (c)for (var d = c.length, e = 0; e < d; e++)c[e] == b && (1 == d ? (c.length = 0, delete this._listenersMap[a]) : c.splice(e, 1))
  5635. }
  5636. };
  5637. a.prototype.removeAllEventListeners = function (a) {
  5638. a ? delete this._listenersMap[a] : this._listenersMap = null
  5639. };
  5640. a.prototype.dispatchEvent = function (a) {
  5641. if (a) {
  5642. var b = this._listenersMap[a.type];
  5643. if (b) {
  5644. a.target = this;
  5645. for (var c = b.concat(),
  5646. b = b.length, d = 0; d < b; d++)c[d](a)
  5647. }
  5648. }
  5649. };
  5650. return a
  5651. }();
  5652. a.EventDispatcher = b;
  5653. b = function (a) {
  5654. function b() {
  5655. a.call(this);
  5656. if (b._instance)throw Error("Singleton already constructed!");
  5657. }
  5658. __extends(b, a);
  5659. b.getInstance = function () {
  5660. b._instance || (b._instance = new b);
  5661. return b._instance
  5662. };
  5663. return b
  5664. }(b);
  5665. a.SoundEventManager = b
  5666. })(d.events || (d.events = {}));
  5667. var b = d.events;
  5668. (function (a) {
  5669. var d = function () {
  5670. function a() {
  5671. this.timeScale = 1;
  5672. this.time = 0.001 * (new Date).getTime();
  5673. this._animatableList = []
  5674. }
  5675. a.prototype.contains = function (a) {
  5676. return 0 <=
  5677. this._animatableList.indexOf(a)
  5678. };
  5679. a.prototype.add = function (a) {
  5680. a && -1 == this._animatableList.indexOf(a) && this._animatableList.push(a)
  5681. };
  5682. a.prototype.remove = function (a) {
  5683. a = this._animatableList.indexOf(a);
  5684. 0 <= a && (this._animatableList[a] = null)
  5685. };
  5686. a.prototype.clear = function () {
  5687. this._animatableList.length = 0
  5688. };
  5689. a.prototype.advanceTime = function (a) {
  5690. if (0 > a) {
  5691. var b = 0.001 * (new Date).getTime();
  5692. a = b - this.time;
  5693. this.time = b
  5694. }
  5695. a *= this.timeScale;
  5696. b = this._animatableList.length;
  5697. if (0 != b) {
  5698. for (var c = 0, d = 0; d < b; d++) {
  5699. var e = this._animatableList[d];
  5700. e && (c != d && (this._animatableList[c] = e, this._animatableList[d] = null), e.advanceTime(a), c++)
  5701. }
  5702. if (c != d) {
  5703. for (b = this._animatableList.length; d < b;)this._animatableList[c++] = this._animatableList[d++];
  5704. this._animatableList.length = c
  5705. }
  5706. }
  5707. };
  5708. a.clock = new a;
  5709. return a
  5710. }();
  5711. a.WorldClock = d;
  5712. var g = function () {
  5713. function a() {
  5714. this.transform = new e.DBTransform;
  5715. this.pivot = new c.Point;
  5716. this._durationTransform = new e.DBTransform;
  5717. this._durationPivot = new c.Point;
  5718. this._durationColor = new c.ColorTransform
  5719. }
  5720. a._borrowObject = function () {
  5721. return 0 ==
  5722. a._pool.length ? new a : a._pool.pop()
  5723. };
  5724. a._returnObject = function (b) {
  5725. 0 > a._pool.indexOf(b) && (a._pool[a._pool.length] = b);
  5726. b.clear()
  5727. };
  5728. a._clear = function () {
  5729. for (var b = a._pool.length; b--;)a._pool[b].clear();
  5730. a._pool.length = 0
  5731. };
  5732. a.getEaseValue = function (b, c) {
  5733. if (1 < c) {
  5734. var d = 0.5 * (1 - Math.cos(b * Math.PI)) - b;
  5735. c -= 1
  5736. } else 0 < c ? d = Math.sin(b * a.HALF_PI) - b : 0 > c && (d = 1 - Math.cos(b * a.HALF_PI) - b, c *= -1);
  5737. return d * c + b
  5738. };
  5739. a.prototype.fadeIn = function (a, b, c) {
  5740. this._bone = a;
  5741. this._animationState = b;
  5742. this._timeline = c;
  5743. this._originTransform = this._timeline.originTransform;
  5744. this._originPivot = this._timeline.originPivot;
  5745. this._tweenColor = this._tweenTransform = !1;
  5746. this._totalTime = this._animationState.totalTime;
  5747. this.transform.x = 0;
  5748. this.transform.y = 0;
  5749. this.transform.scaleX = 0;
  5750. this.transform.scaleY = 0;
  5751. this.transform.skewX = 0;
  5752. this.transform.skewY = 0;
  5753. this.pivot.x = 0;
  5754. this.pivot.y = 0;
  5755. this._durationTransform.x = 0;
  5756. this._durationTransform.y = 0;
  5757. this._durationTransform.scaleX = 0;
  5758. this._durationTransform.scaleY = 0;
  5759. this._durationTransform.skewX = 0;
  5760. this._durationTransform.skewY = 0;
  5761. this._durationPivot.x =
  5762. 0;
  5763. this._durationPivot.y = 0;
  5764. this._currentFrame = null;
  5765. switch (this._timeline.getFrameList().length) {
  5766. case 0:
  5767. this._bone._arriveAtFrame(null, this, this._animationState, !1);
  5768. this._updateState = 0;
  5769. break;
  5770. case 1:
  5771. this._updateState = -1;
  5772. break;
  5773. default:
  5774. this._updateState = 1
  5775. }
  5776. };
  5777. a.prototype.fadeOut = function () {
  5778. this.transform.skewX = f.TransformUtil.formatRadian(this.transform.skewX);
  5779. this.transform.skewY = f.TransformUtil.formatRadian(this.transform.skewY)
  5780. };
  5781. a.prototype.update = function (b) {
  5782. if (this._updateState)if (0 < this._updateState) {
  5783. b =
  5784. 0 == this._timeline.scale ? 1 : b / this._timeline.scale;
  5785. 1 == b && (b = 0.99999999);
  5786. b += this._timeline.offset;
  5787. var c = Math.floor(b);
  5788. b -= c;
  5789. for (var d = this._totalTime * b, e = !1, g; !this._currentFrame || d > this._currentFramePosition + this._currentFrameDuration || d < this._currentFramePosition;)e && this._bone._arriveAtFrame(this._currentFrame, this, this._animationState, !0), e = !0, this._currentFrame ? (g = this._timeline.getFrameList().indexOf(this._currentFrame) + 1, g >= this._timeline.getFrameList().length && (g = 0), this._currentFrame = this._timeline.getFrameList()[g]) :
  5790. (g = 0, this._currentFrame = this._timeline.getFrameList()[0]), this._currentFrameDuration = this._currentFrame.duration, this._currentFramePosition = this._currentFrame.position;
  5791. e && (this.tweenActive = 0 <= this._currentFrame.displayIndex, g++, g >= this._timeline.getFrameList().length && (g = 0), e = this._timeline.getFrameList()[g], 0 == g && this._animationState.loop && this._animationState.loopCount >= Math.abs(this._animationState.loop) - 1 && 0.99999999 < ((this._currentFramePosition + this._currentFrameDuration) / this._totalTime + c - this._timeline.offset) *
  5792. this._timeline.scale ? (this._updateState = 0, this._tweenEasing = NaN) : 0 > this._currentFrame.displayIndex || 0 > e.displayIndex || !this._animationState.tweenEnabled ? this._tweenEasing = NaN : isNaN(this._animationState.clip.tweenEasing) ? this._tweenEasing = this._currentFrame.tweenEasing : this._tweenEasing = this._animationState.clip.tweenEasing, isNaN(this._tweenEasing) ? this._tweenColor = this._tweenTransform = !1 : (this._durationTransform.x = e.transform.x - this._currentFrame.transform.x, this._durationTransform.y = e.transform.y -
  5793. this._currentFrame.transform.y, this._durationTransform.skewX = e.transform.skewX - this._currentFrame.transform.skewX, this._durationTransform.skewY = e.transform.skewY - this._currentFrame.transform.skewY, this._durationTransform.scaleX = e.transform.scaleX - this._currentFrame.transform.scaleX, this._durationTransform.scaleY = e.transform.scaleY - this._currentFrame.transform.scaleY, 0 == g && (this._durationTransform.skewX = f.TransformUtil.formatRadian(this._durationTransform.skewX), this._durationTransform.skewY = f.TransformUtil.formatRadian(this._durationTransform.skewY)),
  5794. this._durationPivot.x = e.pivot.x - this._currentFrame.pivot.x, this._durationPivot.y = e.pivot.y - this._currentFrame.pivot.y, this._tweenTransform = 0 != this._durationTransform.x || 0 != this._durationTransform.y || 0 != this._durationTransform.skewX || 0 != this._durationTransform.skewY || 0 != this._durationTransform.scaleX || 0 != this._durationTransform.scaleY || 0 != this._durationPivot.x || 0 != this._durationPivot.y ? !0 : !1, this._currentFrame.color && e.color ? (this._durationColor.alphaOffset = e.color.alphaOffset - this._currentFrame.color.alphaOffset,
  5795. this._durationColor.redOffset = e.color.redOffset - this._currentFrame.color.redOffset, this._durationColor.greenOffset = e.color.greenOffset - this._currentFrame.color.greenOffset, this._durationColor.blueOffset = e.color.blueOffset - this._currentFrame.color.blueOffset, this._durationColor.alphaMultiplier = e.color.alphaMultiplier - this._currentFrame.color.alphaMultiplier, this._durationColor.redMultiplier = e.color.redMultiplier - this._currentFrame.color.redMultiplier, this._durationColor.greenMultiplier = e.color.greenMultiplier -
  5796. this._currentFrame.color.greenMultiplier, this._durationColor.blueMultiplier = e.color.blueMultiplier - this._currentFrame.color.blueMultiplier, this._tweenColor = 0 != this._durationColor.alphaOffset || 0 != this._durationColor.redOffset || 0 != this._durationColor.greenOffset || 0 != this._durationColor.blueOffset || 0 != this._durationColor.alphaMultiplier || 0 != this._durationColor.redMultiplier || 0 != this._durationColor.greenMultiplier || 0 != this._durationColor.blueMultiplier ? !0 : !1) : this._currentFrame.color ? (this._tweenColor = !0, this._durationColor.alphaOffset = -this._currentFrame.color.alphaOffset, this._durationColor.redOffset = -this._currentFrame.color.redOffset, this._durationColor.greenOffset = -this._currentFrame.color.greenOffset, this._durationColor.blueOffset = -this._currentFrame.color.blueOffset, this._durationColor.alphaMultiplier = 1 - this._currentFrame.color.alphaMultiplier, this._durationColor.redMultiplier = 1 - this._currentFrame.color.redMultiplier, this._durationColor.greenMultiplier = 1 - this._currentFrame.color.greenMultiplier,
  5797. this._durationColor.blueMultiplier = 1 - this._currentFrame.color.blueMultiplier) : e.color ? (this._tweenColor = !0, this._durationColor.alphaOffset = e.color.alphaOffset, this._durationColor.redOffset = e.color.redOffset, this._durationColor.greenOffset = e.color.greenOffset, this._durationColor.blueOffset = e.color.blueOffset, this._durationColor.alphaMultiplier = e.color.alphaMultiplier - 1, this._durationColor.redMultiplier = e.color.redMultiplier - 1, this._durationColor.greenMultiplier = e.color.greenMultiplier - 1, this._durationColor.blueMultiplier =
  5798. e.color.blueMultiplier - 1) : this._tweenColor = !1), this._tweenTransform || (this._animationState.blend ? (this.transform.x = this._originTransform.x + this._currentFrame.transform.x, this.transform.y = this._originTransform.y + this._currentFrame.transform.y, this.transform.skewX = this._originTransform.skewX + this._currentFrame.transform.skewX, this.transform.skewY = this._originTransform.skewY + this._currentFrame.transform.skewY, this.transform.scaleX = this._originTransform.scaleX + this._currentFrame.transform.scaleX, this.transform.scaleY =
  5799. this._originTransform.scaleY + this._currentFrame.transform.scaleY, this.pivot.x = this._originPivot.x + this._currentFrame.pivot.x, this.pivot.y = this._originPivot.y + this._currentFrame.pivot.y) : (this.transform.x = this._currentFrame.transform.x, this.transform.y = this._currentFrame.transform.y, this.transform.skewX = this._currentFrame.transform.skewX, this.transform.skewY = this._currentFrame.transform.skewY, this.transform.scaleX = this._currentFrame.transform.scaleX, this.transform.scaleY = this._currentFrame.transform.scaleY,
  5800. this.pivot.x = this._currentFrame.pivot.x, this.pivot.y = this._currentFrame.pivot.y)), this._tweenColor || (this._currentFrame.color ? this._bone._updateColor(this._currentFrame.color.alphaOffset, this._currentFrame.color.redOffset, this._currentFrame.color.greenOffset, this._currentFrame.color.blueOffset, this._currentFrame.color.alphaMultiplier, this._currentFrame.color.redMultiplier, this._currentFrame.color.greenMultiplier, this._currentFrame.color.blueMultiplier, !0) : this._bone._isColorChanged && this._bone._updateColor(0,
  5801. 0, 0, 0, 1, 1, 1, 1, !1)), this._bone._arriveAtFrame(this._currentFrame, this, this._animationState, !1));
  5802. if (this._tweenTransform || this._tweenColor)b = (d - this._currentFramePosition) / this._currentFrameDuration, this._tweenEasing && (b = a.getEaseValue(b, this._tweenEasing));
  5803. this._tweenTransform && (c = this._currentFrame.transform, d = this._currentFrame.pivot, this._animationState.blend ? (this.transform.x = this._originTransform.x + c.x + this._durationTransform.x * b, this.transform.y = this._originTransform.y + c.y + this._durationTransform.y *
  5804. b, this.transform.skewX = this._originTransform.skewX + c.skewX + this._durationTransform.skewX * b, this.transform.skewY = this._originTransform.skewY + c.skewY + this._durationTransform.skewY * b, this.transform.scaleX = this._originTransform.scaleX + c.scaleX + this._durationTransform.scaleX * b, this.transform.scaleY = this._originTransform.scaleY + c.scaleY + this._durationTransform.scaleY * b, this.pivot.x = this._originPivot.x + d.x + this._durationPivot.x * b, this.pivot.y = this._originPivot.y + d.y + this._durationPivot.y * b) : (this.transform.x =
  5805. c.x + this._durationTransform.x * b, this.transform.y = c.y + this._durationTransform.y * b, this.transform.skewX = c.skewX + this._durationTransform.skewX * b, this.transform.skewY = c.skewY + this._durationTransform.skewY * b, this.transform.scaleX = c.scaleX + this._durationTransform.scaleX * b, this.transform.scaleY = c.scaleY + this._durationTransform.scaleY * b, this.pivot.x = d.x + this._durationPivot.x * b, this.pivot.y = d.y + this._durationPivot.y * b));
  5806. this._tweenColor && (this._currentFrame.color ? this._bone._updateColor(this._currentFrame.color.alphaOffset +
  5807. this._durationColor.alphaOffset * b, this._currentFrame.color.redOffset + this._durationColor.redOffset * b, this._currentFrame.color.greenOffset + this._durationColor.greenOffset * b, this._currentFrame.color.blueOffset + this._durationColor.blueOffset * b, this._currentFrame.color.alphaMultiplier + this._durationColor.alphaMultiplier * b, this._currentFrame.color.redMultiplier + this._durationColor.redMultiplier * b, this._currentFrame.color.greenMultiplier + this._durationColor.greenMultiplier * b, this._currentFrame.color.blueMultiplier +
  5808. this._durationColor.blueMultiplier * b, !0) : this._bone._updateColor(this._durationColor.alphaOffset * b, this._durationColor.redOffset * b, this._durationColor.greenOffset * b, this._durationColor.blueOffset * b, 1 + this._durationColor.alphaMultiplier * b, 1 + this._durationColor.redMultiplier * b, 1 + this._durationColor.greenMultiplier * b, 1 + this._durationColor.blueMultiplier * b, !0))
  5809. } else this._updateState = 0, this._animationState.blend ? (this.transform.copy(this._originTransform), this.pivot.x = this._originPivot.x, this.pivot.y =
  5810. this._originPivot.y) : (this.transform.x = this.transform.y = this.transform.skewX = this.transform.skewY = this.transform.scaleX = this.transform.scaleY = 0, this.pivot.x = 0, this.pivot.y = 0), this._currentFrame = this._timeline.getFrameList()[0], this.tweenActive = 0 <= this._currentFrame.displayIndex, this._currentFrame.color ? this._bone._updateColor(this._currentFrame.color.alphaOffset, this._currentFrame.color.redOffset, this._currentFrame.color.greenOffset, this._currentFrame.color.blueOffset, this._currentFrame.color.alphaMultiplier,
  5811. this._currentFrame.color.redMultiplier, this._currentFrame.color.greenMultiplier, this._currentFrame.color.blueMultiplier, !0) : this._bone._updateColor(0, 0, 0, 0, 1, 1, 1, 1, !1), this._bone._arriveAtFrame(this._currentFrame, this, this._animationState, !1)
  5812. };
  5813. a.prototype.clear = function () {
  5814. this._updateState = 0;
  5815. this._originPivot = this._originTransform = this._currentFrame = this._timeline = this._animationState = this._bone = null
  5816. };
  5817. a.HALF_PI = 0.5 * Math.PI;
  5818. a._pool = [];
  5819. return a
  5820. }();
  5821. a.TimelineState = g;
  5822. var h = function () {
  5823. function a() {
  5824. this.layer =
  5825. this.loop = 0;
  5826. this._timelineStates = {}
  5827. }
  5828. a._borrowObject = function () {
  5829. return 0 == a._pool.length ? new a : a._pool.pop()
  5830. };
  5831. a._returnObject = function (b) {
  5832. 0 > a._pool.indexOf(b) && (a._pool[a._pool.length] = b);
  5833. b.clear()
  5834. };
  5835. a._clear = function () {
  5836. for (var b = a._pool.length; b--;)a._pool[b].clear();
  5837. a._pool.length = 0
  5838. };
  5839. a.prototype.fadeIn = function (a, b, c, d, e, f, g, h) {
  5840. this.layer = f;
  5841. this.clip = b;
  5842. this.name = this.clip.name;
  5843. this.totalTime = this.clip.duration;
  5844. this._armature = a;
  5845. 2 > Math.round(this.clip.duration * this.clip.frameRate) || Infinity == d ? (this.timeScale =
  5846. 1, this.currentTime = this.totalTime, this.loop = 0 <= this.loop ? 1 : -1) : (this.timeScale = d, this.currentTime = 0, this.loop = e);
  5847. this._pauseBeforeFadeInComplete = h;
  5848. this._fadeInTime = c * this.timeScale;
  5849. this._fadeState = 1;
  5850. this._fadeOutBeginTime = 0;
  5851. this._fadeOutWeight = -1;
  5852. this._fadeWeight = 0;
  5853. this._fadeIn = !0;
  5854. this._fadeOut = !1;
  5855. this.loopCount = -1;
  5856. this.displayControl = g;
  5857. this.isPlaying = !0;
  5858. this.isComplete = !1;
  5859. this.weight = 1;
  5860. this.tweenEnabled = this.enabled = this.blend = !0;
  5861. this.updateTimelineStates()
  5862. };
  5863. a.prototype.fadeOut = function (a, b) {
  5864. "undefined" === typeof b && (b = !1);
  5865. if (this._armature && !(0 <= this._fadeOutWeight)) {
  5866. this._fadeState = -1;
  5867. this._fadeOutWeight = this._fadeWeight;
  5868. this._fadeOutTime = a * this.timeScale;
  5869. this._fadeOutBeginTime = this.currentTime;
  5870. this._fadeOut = !0;
  5871. this.isPlaying = !b;
  5872. this.displayControl = !1;
  5873. for (var c in this._timelineStates)this._timelineStates[c].fadeOut();
  5874. this.enabled = !0
  5875. }
  5876. };
  5877. a.prototype.play = function () {
  5878. this.isPlaying = !0
  5879. };
  5880. a.prototype.stop = function () {
  5881. this.isPlaying = !1
  5882. };
  5883. a.prototype.getMixingTransform = function (a) {
  5884. return this._mixingTransforms ?
  5885. Number(this._mixingTransforms[a]) : -1
  5886. };
  5887. a.prototype.addMixingTransform = function (a, b, c) {
  5888. "undefined" === typeof b && (b = 2);
  5889. "undefined" === typeof c && (c = !0);
  5890. if (this.clip && this.clip.getTimeline(a)) {
  5891. this._mixingTransforms || (this._mixingTransforms = {});
  5892. if (c) {
  5893. c = this._armature._boneList.length;
  5894. for (var d, e; c--;)if (d = this._armature._boneList[c], d.name == a && (e = d), e && (e == d || e.contains(d)))this._mixingTransforms[d.name] = b
  5895. } else this._mixingTransforms[a] = b;
  5896. this.updateTimelineStates()
  5897. } else throw Error();
  5898. };
  5899. a.prototype.removeMixingTransform =
  5900. function (a, b) {
  5901. "undefined" === typeof a && (a = null);
  5902. "undefined" === typeof b && (b = !0);
  5903. if (a) {
  5904. if (b)for (var c = this._armature._boneList.length, d, e; c--;)d = this._armature._boneList[c], d.name == a && (e = d), e && (e == d || e.contains(d)) && delete this._mixingTransforms[d.name]; else delete this._mixingTransforms[a];
  5905. for (var f in this._mixingTransforms) {
  5906. var g = !0;
  5907. break
  5908. }
  5909. g || (this._mixingTransforms = null)
  5910. } else this._mixingTransforms = null;
  5911. this.updateTimelineStates()
  5912. };
  5913. a.prototype.advanceTime = function (a) {
  5914. if (!this.enabled)return!1;
  5915. var c,
  5916. d;
  5917. this._fadeIn && (this._fadeIn = !1, this._armature.hasEventListener(b.AnimationEvent.FADE_IN) && (c = new b.AnimationEvent(b.AnimationEvent.FADE_IN), c.animationState = this, this._armature._eventList.push(c)));
  5918. this._fadeOut && (this._fadeOut = !1, this._armature.hasEventListener(b.AnimationEvent.FADE_OUT) && (c = new b.AnimationEvent(b.AnimationEvent.FADE_OUT), c.animationState = this, this._armature._eventList.push(c)));
  5919. this.currentTime += a * this.timeScale;
  5920. if (this.isPlaying && !this.isComplete) {
  5921. var e;
  5922. if (this._pauseBeforeFadeInComplete)this.isPlaying =
  5923. this._pauseBeforeFadeInComplete = !1, a = 0, e = Math.floor(a); else if (a = this.currentTime / this.totalTime, e = Math.floor(a), e != this.loopCount && (-1 == this.loopCount && this._armature.hasEventListener(b.AnimationEvent.START) && (c = new b.AnimationEvent(b.AnimationEvent.START), c.animationState = this, this._armature._eventList.push(c)), this.loopCount = e))this.loop && this.loopCount * this.loopCount >= this.loop * this.loop - 1 ? (d = !0, a = 1, e = 0, this._armature.hasEventListener(b.AnimationEvent.COMPLETE) && (c = new b.AnimationEvent(b.AnimationEvent.COMPLETE),
  5924. c.animationState = this, this._armature._eventList.push(c))) : this._armature.hasEventListener(b.AnimationEvent.LOOP_COMPLETE) && (c = new b.AnimationEvent(b.AnimationEvent.LOOP_COMPLETE), c.animationState = this, this._armature._eventList.push(c));
  5925. for (var f in this._timelineStates)this._timelineStates[f].update(a);
  5926. c = this.clip.getFrameList();
  5927. if (0 < c.length) {
  5928. a = this.totalTime * (a - e);
  5929. for (e = !1; !this._currentFrame || a > this._currentFrame.position + this._currentFrame.duration || a < this._currentFrame.position;)e && this._armature._arriveAtFrame(this._currentFrame,
  5930. null, this, !0), e = !0, this._currentFrame ? (f = c.indexOf(this._currentFrame), f++, f >= c.length && (f = 0), this._currentFrame = c[f]) : this._currentFrame = c[0];
  5931. e && this._armature._arriveAtFrame(this._currentFrame, null, this, !1)
  5932. }
  5933. }
  5934. if (0 < this._fadeState)0 == this._fadeInTime ? (this._fadeWeight = 1, this._fadeState = 0, this.isPlaying = !0, this._armature.hasEventListener(b.AnimationEvent.FADE_IN_COMPLETE) && (c = new b.AnimationEvent(b.AnimationEvent.FADE_IN_COMPLETE), c.animationState = this, this._armature._eventList.push(c))) : (this._fadeWeight =
  5935. this.currentTime / this._fadeInTime, 1 <= this._fadeWeight && (this._fadeWeight = 1, this._fadeState = 0, this.isPlaying || (this.currentTime -= this._fadeInTime), this.isPlaying = !0, this._armature.hasEventListener(b.AnimationEvent.FADE_IN_COMPLETE) && (c = new b.AnimationEvent(b.AnimationEvent.FADE_IN_COMPLETE), c.animationState = this, this._armature._eventList.push(c)))); else if (0 > this._fadeState) {
  5936. if (0 == this._fadeOutTime)return this._fadeState = this._fadeWeight = 0, this._armature.hasEventListener(b.AnimationEvent.FADE_OUT_COMPLETE) &&
  5937. (c = new b.AnimationEvent(b.AnimationEvent.FADE_OUT_COMPLETE), c.animationState = this, this._armature._eventList.push(c)), !0;
  5938. this._fadeWeight = (1 - (this.currentTime - this._fadeOutBeginTime) / this._fadeOutTime) * this._fadeOutWeight;
  5939. if (0 >= this._fadeWeight)return this._fadeState = this._fadeWeight = 0, this._armature.hasEventListener(b.AnimationEvent.FADE_OUT_COMPLETE) && (c = new b.AnimationEvent(b.AnimationEvent.FADE_OUT_COMPLETE), c.animationState = this, this._armature._eventList.push(c)), !0
  5940. }
  5941. d && (this.isComplete = !0, 0 > this.loop &&
  5942. this.fadeOut((this._fadeOutWeight || this._fadeInTime) / this.timeScale, !0));
  5943. return!1
  5944. };
  5945. a.prototype.updateTimelineStates = function () {
  5946. if (this._mixingTransforms) {
  5947. for (var a in this._timelineStates)null == this._mixingTransforms[a] && this.removeTimelineState(a);
  5948. for (a in this._mixingTransforms)this._timelineStates[a] || this.addTimelineState(a)
  5949. } else for (a in this.clip.getTimelines())this._timelineStates[a] || this.addTimelineState(a)
  5950. };
  5951. a.prototype.addTimelineState = function (a) {
  5952. var b = this._armature.getBone(a);
  5953. if (b) {
  5954. var c =
  5955. g._borrowObject(), d = this.clip.getTimeline(a);
  5956. c.fadeIn(b, this, d);
  5957. this._timelineStates[a] = c
  5958. }
  5959. };
  5960. a.prototype.removeTimelineState = function (a) {
  5961. g._returnObject(this._timelineStates[a]);
  5962. delete this._timelineStates[a]
  5963. };
  5964. a.prototype.clear = function () {
  5965. this.clip = null;
  5966. this.enabled = !1;
  5967. this._mixingTransforms = this._currentFrame = this._armature = null;
  5968. for (var a in this._timelineStates)this.removeTimelineState(a)
  5969. };
  5970. a._pool = [];
  5971. return a
  5972. }();
  5973. a.AnimationState = h;
  5974. d = function () {
  5975. function a(b) {
  5976. this._armature = b;
  5977. this._animationLayer =
  5978. [];
  5979. this._isPlaying = !1;
  5980. this.animationNameList = [];
  5981. this.tweenEnabled = !0;
  5982. this.timeScale = 1
  5983. }
  5984. a.prototype.getLastAnimationName = function () {
  5985. return this._lastAnimationState ? this._lastAnimationState.name : null
  5986. };
  5987. a.prototype.getLastAnimationState = function () {
  5988. return this._lastAnimationState
  5989. };
  5990. a.prototype.getAnimationDataList = function () {
  5991. return this._animationDataList
  5992. };
  5993. a.prototype.setAnimationDataList = function (a) {
  5994. this._animationDataList = a;
  5995. this.animationNameList.length = 0;
  5996. for (var b in this._animationDataList)this.animationNameList[this.animationNameList.length] =
  5997. this._animationDataList[b].name
  5998. };
  5999. a.prototype.getIsPlaying = function () {
  6000. return this._isPlaying && !this.getIsComplete()
  6001. };
  6002. a.prototype.getIsComplete = function () {
  6003. if (this._lastAnimationState) {
  6004. if (!this._lastAnimationState.isComplete)return!1;
  6005. for (var a = this._animationLayer.length; a--;)for (var b = this._animationLayer[a], c = b.length; c--;)if (!b[c].isComplete)return!1;
  6006. return!0
  6007. }
  6008. return!1
  6009. };
  6010. a.prototype.dispose = function () {
  6011. if (this._armature) {
  6012. this.stop();
  6013. for (var a = this._animationLayer.length; a--;) {
  6014. for (var b = this._animationLayer[a],
  6015. c = b.length; c--;)h._returnObject(b[c]);
  6016. b.length = 0
  6017. }
  6018. this._animationLayer.length = 0;
  6019. this.animationNameList.length = 0;
  6020. this.animationNameList = this._animationDataList = this._animationLayer = this._armature = null
  6021. }
  6022. };
  6023. a.prototype.gotoAndPlay = function (b, c, d, e, f, g, n, k, l, v) {
  6024. "undefined" === typeof c && (c = -1);
  6025. "undefined" === typeof d && (d = -1);
  6026. "undefined" === typeof e && (e = NaN);
  6027. "undefined" === typeof f && (f = 0);
  6028. "undefined" === typeof g && (g = null);
  6029. "undefined" === typeof n && (n = a.SAME_LAYER_AND_GROUP);
  6030. "undefined" === typeof k && (k = !0);
  6031. "undefined" === typeof l && (l = !0);
  6032. "undefined" === typeof v && (v = !0);
  6033. if (!this._animationDataList)return null;
  6034. for (var m = this._animationDataList.length, p; m--;)if (this._animationDataList[m].name == b) {
  6035. p = this._animationDataList[m];
  6036. break
  6037. }
  6038. if (!p)return null;
  6039. this._isPlaying = !0;
  6040. c = 0 > c ? 0 > p.fadeInTime ? 0.3 : p.fadeInTime : c;
  6041. d = 0 > d ? 0 > p.scale ? 1 : p.scale : d / p.duration;
  6042. e = isNaN(e) ? p.loop : e;
  6043. f = this.addLayer(f);
  6044. var r;
  6045. switch (n) {
  6046. case a.NONE:
  6047. break;
  6048. case a.SAME_LAYER:
  6049. r = this._animationLayer[f];
  6050. for (m = r.length; m--;)n = r[m], n.fadeOut(c, l);
  6051. break;
  6052. case a.SAME_GROUP:
  6053. for (J =
  6054. this._animationLayer.length; J--;) {
  6055. r = this._animationLayer[J];
  6056. for (m = r.length; m--;)n = r[m], n.group == g && n.fadeOut(c, l)
  6057. }
  6058. break;
  6059. case a.ALL:
  6060. for (var J = this._animationLayer.length; J--;) {
  6061. r = this._animationLayer[J];
  6062. for (m = r.length; m--;)n = r[m], n.fadeOut(c, l)
  6063. }
  6064. break;
  6065. default:
  6066. r = this._animationLayer[f];
  6067. for (m = r.length; m--;)n = r[m], n.group == g && n.fadeOut(c, l)
  6068. }
  6069. this._lastAnimationState = h._borrowObject();
  6070. this._lastAnimationState.group = g;
  6071. this._lastAnimationState.tweenEnabled = this.tweenEnabled;
  6072. this._lastAnimationState.fadeIn(this._armature,
  6073. p, c, 1 / d, e, f, k, v);
  6074. this.addState(this._lastAnimationState);
  6075. e = this._armature._slotList;
  6076. for (m = e.length; m--;)f = e[m], (f = f.getChildArmature()) && f.animation.gotoAndPlay(b, c);
  6077. return this._lastAnimationState
  6078. };
  6079. a.prototype.play = function () {
  6080. this._animationDataList && 0 != this._animationDataList.length && (this._lastAnimationState ? this._isPlaying ? this.gotoAndPlay(this._lastAnimationState.name) : this._isPlaying = !0 : this.gotoAndPlay(this._animationDataList[0].name))
  6081. };
  6082. a.prototype.stop = function () {
  6083. this._isPlaying = !1
  6084. };
  6085. a.prototype.getState =
  6086. function (a, b) {
  6087. "undefined" === typeof b && (b = 0);
  6088. var c = this._animationLayer.length;
  6089. if (0 == c)return null;
  6090. b >= c && (b = c - 1);
  6091. c = this._animationLayer[b];
  6092. if (!c)return null;
  6093. for (var d = c.length; d--;)if (c[d].name == a)return c[d];
  6094. return null
  6095. };
  6096. a.prototype.hasAnimation = function (a) {
  6097. for (var b = this._animationDataList.length; b--;)if (this._animationDataList[b].name == a)return!0;
  6098. return!1
  6099. };
  6100. a.prototype.advanceTime = function (a) {
  6101. if (this._isPlaying) {
  6102. a *= this.timeScale;
  6103. var b = this._armature._boneList.length, c, d, e = b, f, g, h, n, k, q, m, l, p, s,
  6104. E, L, I, M, C, K, G;
  6105. for (b--; e--;) {
  6106. g = this._armature._boneList[e];
  6107. h = g.name;
  6108. n = 1;
  6109. L = E = s = p = l = m = q = k = 0;
  6110. for (c = this._animationLayer.length; c--;) {
  6111. I = 0;
  6112. M = this._animationLayer[c];
  6113. f = M.length;
  6114. for (d = 0; d < f; d++)if (C = M[d], e == b && C.advanceTime(a))this.removeState(C), d--, f--; else if ((K = C._timelineStates[h]) && K.tweenActive)C = C._fadeWeight * C.weight * n, G = K.transform, K = K.pivot, k += G.x * C, q += G.y * C, m += G.skewX * C, l += G.skewY * C, p += G.scaleX * C, s += G.scaleY * C, E += K.x * C, L += K.y * C, I += C;
  6115. if (I >= n)break; else n -= I
  6116. }
  6117. G = g.tween;
  6118. K = g._tweenPivot;
  6119. G.x = k;
  6120. G.y =
  6121. q;
  6122. G.skewX = m;
  6123. G.skewY = l;
  6124. G.scaleX = p;
  6125. G.scaleY = s;
  6126. K.x = E;
  6127. K.y = L
  6128. }
  6129. }
  6130. };
  6131. a.prototype.addLayer = function (a) {
  6132. a >= this._animationLayer.length && (a = this._animationLayer.length, this._animationLayer[a] = []);
  6133. return a
  6134. };
  6135. a.prototype.addState = function (a) {
  6136. this._animationLayer[a.layer].push(a)
  6137. };
  6138. a.prototype.removeState = function (a) {
  6139. var b = a.layer, c = this._animationLayer[b];
  6140. c.splice(c.indexOf(a), 1);
  6141. h._returnObject(a);
  6142. 0 == c.length && b == this._animationLayer.length - 1 && this._animationLayer.length--
  6143. };
  6144. a.NONE = "none";
  6145. a.SAME_LAYER = "sameLayer";
  6146. a.SAME_GROUP = "sameGroup";
  6147. a.SAME_LAYER_AND_GROUP = "sameLayerAndGroup";
  6148. a.ALL = "all";
  6149. return a
  6150. }();
  6151. a.Animation = d
  6152. })(d.animation || (d.animation = {}));
  6153. var a = d.animation;
  6154. (function (a) {
  6155. var b = function () {
  6156. function a() {
  6157. this.skewY = this.skewX = this.y = this.x = 0;
  6158. this.scaleY = this.scaleX = 1
  6159. }
  6160. a.prototype.getRotation = function () {
  6161. return this.skewX
  6162. };
  6163. a.prototype.setRotation = function (a) {
  6164. this.skewX = this.skewY = a
  6165. };
  6166. a.prototype.copy = function (a) {
  6167. this.x = a.x;
  6168. this.y = a.y;
  6169. this.skewX = a.skewX;
  6170. this.skewY = a.skewY;
  6171. this.scaleX = a.scaleX;
  6172. this.scaleY =
  6173. a.scaleY
  6174. };
  6175. a.prototype.toString = function () {
  6176. return"[DBTransform (x\x3d" + this.x + " y\x3d" + this.y + " skewX\x3d" + this.skewX + " skewY\x3d" + this.skewY + " scaleX\x3d" + this.scaleX + " scaleY\x3d" + this.scaleY + ")]"
  6177. };
  6178. return a
  6179. }();
  6180. a.DBTransform = b;
  6181. var d = function () {
  6182. function a() {
  6183. this.duration = this.position = 0
  6184. }
  6185. a.prototype.dispose = function () {
  6186. };
  6187. return a
  6188. }();
  6189. a.Frame = d;
  6190. var e = function (a) {
  6191. function d() {
  6192. a.call(this);
  6193. this.displayIndex = this.tweenRotate = this.tweenEasing = 0;
  6194. this.zOrder = NaN;
  6195. this.visible = !0;
  6196. this.global = new b;
  6197. this.transform =
  6198. new b;
  6199. this.pivot = new c.Point
  6200. }
  6201. __extends(d, a);
  6202. d.prototype.dispose = function () {
  6203. a.prototype.dispose.call(this);
  6204. this.color = this.pivot = this.transform = this.global = null
  6205. };
  6206. return d
  6207. }(d);
  6208. a.TransformFrame = e;
  6209. var g = function () {
  6210. function a() {
  6211. this._frameList = [];
  6212. this.duration = 0;
  6213. this.scale = 1
  6214. }
  6215. a.prototype.getFrameList = function () {
  6216. return this._frameList
  6217. };
  6218. a.prototype.dispose = function () {
  6219. for (var a = this._frameList.length; a--;)this._frameList[a].dispose();
  6220. this._frameList.length = 0;
  6221. this._frameList = null
  6222. };
  6223. a.prototype.addFrame = function (a) {
  6224. if (!a)throw Error();
  6225. if (0 > this._frameList.indexOf(a))this._frameList[this._frameList.length] = a; else throw Error();
  6226. };
  6227. return a
  6228. }();
  6229. a.Timeline = g;
  6230. var h = function (a) {
  6231. function d() {
  6232. a.call(this);
  6233. this.originTransform = new b;
  6234. this.originPivot = new c.Point;
  6235. this.offset = 0;
  6236. this.transformed = !1
  6237. }
  6238. __extends(d, a);
  6239. d.prototype.dispose = function () {
  6240. this != d.HIDE_TIMELINE && (a.prototype.dispose.call(this), this.originPivot = this.originTransform = null)
  6241. };
  6242. d.HIDE_TIMELINE = new d;
  6243. return d
  6244. }(g);
  6245. a.TransformTimeline = h;
  6246. var k = function (a) {
  6247. function b() {
  6248. a.call(this);
  6249. this.loop = this.frameRate = 0;
  6250. this.tweenEasing = NaN;
  6251. this.fadeInTime = 0;
  6252. this._timelines = {}
  6253. }
  6254. __extends(b, a);
  6255. b.prototype.getTimelines = function () {
  6256. return this._timelines
  6257. };
  6258. b.prototype.dispose = function () {
  6259. a.prototype.dispose.call(this);
  6260. for (var b in this._timelines)this._timelines[b].dispose();
  6261. this._timelines = null
  6262. };
  6263. b.prototype.getTimeline = function (a) {
  6264. return this._timelines[a]
  6265. };
  6266. b.prototype.addTimeline = function (a, b) {
  6267. if (!a)throw Error();
  6268. this._timelines[b] = a
  6269. };
  6270. return b
  6271. }(g);
  6272. a.AnimationData = k;
  6273. var l = function () {
  6274. function a() {
  6275. this.transform =
  6276. new b
  6277. }
  6278. a.prototype.dispose = function () {
  6279. this.pivot = this.transform = null
  6280. };
  6281. a.ARMATURE = "armature";
  6282. a.IMAGE = "image";
  6283. return a
  6284. }();
  6285. a.DisplayData = l;
  6286. var D = function () {
  6287. function a() {
  6288. this._displayDataList = [];
  6289. this.zOrder = 0;
  6290. this.blendMode = "normal"
  6291. }
  6292. a.prototype.getDisplayDataList = function () {
  6293. return this._displayDataList
  6294. };
  6295. a.prototype.dispose = function () {
  6296. for (var a = this._displayDataList.length; a--;)this._displayDataList[a].dispose();
  6297. this._displayDataList.length = 0;
  6298. this._displayDataList = null
  6299. };
  6300. a.prototype.addDisplayData = function (a) {
  6301. if (!a)throw Error();
  6302. if (0 > this._displayDataList.indexOf(a))this._displayDataList[this._displayDataList.length] = a; else throw Error();
  6303. };
  6304. a.prototype.getDisplayData = function (a) {
  6305. for (var b = this._displayDataList.length; b--;)if (this._displayDataList[b].name == a)return this._displayDataList[b];
  6306. return null
  6307. };
  6308. return a
  6309. }();
  6310. a.SlotData = D;
  6311. var F = function () {
  6312. function a() {
  6313. this.length = 0;
  6314. this.global = new b;
  6315. this.transform = new b;
  6316. this.scaleMode = 1;
  6317. this.fixedRotation = !1
  6318. }
  6319. a.prototype.dispose = function () {
  6320. this.transform = this.global = null
  6321. };
  6322. return a
  6323. }();
  6324. a.BoneData =
  6325. F;
  6326. var H = function () {
  6327. function a() {
  6328. this._slotDataList = []
  6329. }
  6330. a.prototype.getSlotDataList = function () {
  6331. return this._slotDataList
  6332. };
  6333. a.prototype.dispose = function () {
  6334. for (var a = this._slotDataList.length; a--;)this._slotDataList[a].dispose();
  6335. this._slotDataList.length = 0;
  6336. this._slotDataList = null
  6337. };
  6338. a.prototype.getSlotData = function (a) {
  6339. for (var b = this._slotDataList.length; b--;)if (this._slotDataList[b].name == a)return this._slotDataList[b];
  6340. return null
  6341. };
  6342. a.prototype.addSlotData = function (a) {
  6343. if (!a)throw Error();
  6344. if (0 > this._slotDataList.indexOf(a))this._slotDataList[this._slotDataList.length] =
  6345. a; else throw Error();
  6346. };
  6347. return a
  6348. }();
  6349. a.SkinData = H;
  6350. var u = function () {
  6351. function a() {
  6352. this._boneDataList = [];
  6353. this._skinDataList = [];
  6354. this._animationDataList = []
  6355. }
  6356. a.prototype.getBoneDataList = function () {
  6357. return this._boneDataList
  6358. };
  6359. a.prototype.getSkinDataList = function () {
  6360. return this._skinDataList
  6361. };
  6362. a.prototype.getAnimationDataList = function () {
  6363. return this._animationDataList
  6364. };
  6365. a.prototype.dispose = function () {
  6366. for (var a = this._boneDataList.length; a--;)this._boneDataList[a].dispose();
  6367. for (a = this._skinDataList.length; a--;)this._skinDataList[a].dispose();
  6368. for (a = this._animationDataList.length; a--;)this._animationDataList[a].dispose();
  6369. this._boneDataList.length = 0;
  6370. this._skinDataList.length = 0;
  6371. this._animationDataList.length = 0;
  6372. this._animationDataList = this._skinDataList = this._boneDataList = null
  6373. };
  6374. a.prototype.getBoneData = function (a) {
  6375. for (var b = this._boneDataList.length; b--;)if (this._boneDataList[b].name == a)return this._boneDataList[b];
  6376. return null
  6377. };
  6378. a.prototype.getSkinData = function (a) {
  6379. if (!a)return this._skinDataList[0];
  6380. for (var b = this._skinDataList.length; b--;)if (this._skinDataList[b].name ==
  6381. a)return this._skinDataList[b];
  6382. return null
  6383. };
  6384. a.prototype.getAnimationData = function (a) {
  6385. for (var b = this._animationDataList.length; b--;)if (this._animationDataList[b].name == a)return this._animationDataList[b];
  6386. return null
  6387. };
  6388. a.prototype.addBoneData = function (a) {
  6389. if (!a)throw Error();
  6390. if (0 > this._boneDataList.indexOf(a))this._boneDataList[this._boneDataList.length] = a; else throw Error();
  6391. };
  6392. a.prototype.addSkinData = function (a) {
  6393. if (!a)throw Error();
  6394. if (0 > this._skinDataList.indexOf(a))this._skinDataList[this._skinDataList.length] =
  6395. a; else throw Error();
  6396. };
  6397. a.prototype.addAnimationData = function (a) {
  6398. if (!a)throw Error();
  6399. 0 > this._animationDataList.indexOf(a) && (this._animationDataList[this._animationDataList.length] = a)
  6400. };
  6401. a.prototype.sortBoneDataList = function () {
  6402. var a = this._boneDataList.length;
  6403. if (0 != a) {
  6404. for (var b = []; a--;) {
  6405. for (var c = this._boneDataList[a], d = 0, e = c; e && e.parent;)d++, e = this.getBoneData(e.parent);
  6406. b[a] = {level: d, boneData: c}
  6407. }
  6408. b.sort(this.sortBoneData);
  6409. for (a = b.length; a--;)this._boneDataList[a] = b[a].boneData
  6410. }
  6411. };
  6412. a.prototype.sortBoneData =
  6413. function (a, b) {
  6414. return a.level > b.level ? 1 : -1
  6415. };
  6416. return a
  6417. }();
  6418. a.ArmatureData = u;
  6419. var z = function () {
  6420. function a() {
  6421. this._armatureDataList = [];
  6422. this._subTexturePivots = {}
  6423. }
  6424. a.prototype.getArmatureNames = function () {
  6425. var a = [], b;
  6426. for (b in this._armatureDataList)a[a.length] = this._armatureDataList[b].name;
  6427. return a
  6428. };
  6429. a.prototype.getArmatureDataList = function () {
  6430. return this._armatureDataList
  6431. };
  6432. a.prototype.dispose = function () {
  6433. for (var a in this._armatureDataList)this._armatureDataList[a].dispose();
  6434. this._armatureDataList.length = 0;
  6435. this._subTexturePivots =
  6436. this._armatureDataList = null
  6437. };
  6438. a.prototype.getArmatureData = function (a) {
  6439. for (var b = this._armatureDataList.length; b--;)if (this._armatureDataList[b].name == a)return this._armatureDataList[b];
  6440. return null
  6441. };
  6442. a.prototype.addArmatureData = function (a) {
  6443. if (!a)throw Error();
  6444. if (0 > this._armatureDataList.indexOf(a))this._armatureDataList[this._armatureDataList.length] = a; else throw Error();
  6445. };
  6446. a.prototype.removeArmatureData = function (a) {
  6447. a = this._armatureDataList.indexOf(a);
  6448. 0 <= a && this._armatureDataList.splice(a, 1)
  6449. };
  6450. a.prototype.removeArmatureDataByName =
  6451. function (a) {
  6452. for (var b = this._armatureDataList.length; b--;)this._armatureDataList[b].name == a && this._armatureDataList.splice(b, 1)
  6453. };
  6454. a.prototype.getSubTexturePivot = function (a) {
  6455. return this._subTexturePivots[a]
  6456. };
  6457. a.prototype.addSubTexturePivot = function (a, b, d) {
  6458. var e = this._subTexturePivots[d];
  6459. e ? (e.x = a, e.y = b) : this._subTexturePivots[d] = e = new c.Point(a, b);
  6460. return e
  6461. };
  6462. a.prototype.removeSubTexturePivot = function (a) {
  6463. if (a)delete this._subTexturePivots[a]; else for (a in this._subTexturePivots)delete this._subTexturePivots[a]
  6464. };
  6465. return a
  6466. }();
  6467. a.SkeletonData = z;
  6468. g = function () {
  6469. function a() {
  6470. }
  6471. a.parseTextureAtlasData = function (a, b) {
  6472. "undefined" === typeof b && (b = 1);
  6473. if (!a)throw Error();
  6474. var d = {};
  6475. d.__name = a[f.ConstValues.A_NAME];
  6476. var e = a[f.ConstValues.SUB_TEXTURE], g;
  6477. for (g in e) {
  6478. var h = e[g], n = h[f.ConstValues.A_NAME], h = new c.Rectangle(Number(h[f.ConstValues.A_X]) / b, Number(h[f.ConstValues.A_Y]) / b, Number(h[f.ConstValues.A_WIDTH]) / b, Number(h[f.ConstValues.A_HEIGHT]) / b);
  6479. d[n] = h
  6480. }
  6481. return d
  6482. };
  6483. a.parseSkeletonData = function (b) {
  6484. if (!b)throw Error();
  6485. var c = Number(b[f.ConstValues.A_FRAME_RATE]),
  6486. d = new z;
  6487. d.name = b[f.ConstValues.A_NAME];
  6488. b = b[f.ConstValues.ARMATURE];
  6489. for (var e in b)d.addArmatureData(a.parseArmatureData(b[e], d, c));
  6490. return d
  6491. };
  6492. a.parseArmatureData = function (b, c, d) {
  6493. var e = new u;
  6494. e.name = b[f.ConstValues.A_NAME];
  6495. var g = b[f.ConstValues.BONE], h;
  6496. for (h in g)e.addBoneData(a.parseBoneData(g[h]));
  6497. g = b[f.ConstValues.SKIN];
  6498. for (h in g)e.addSkinData(a.parseSkinData(g[h], c));
  6499. f.DBDataUtil.transformArmatureData(e);
  6500. e.sortBoneDataList();
  6501. b = b[f.ConstValues.ANIMATION];
  6502. for (h in b)e.addAnimationData(a.parseAnimationData(b[h],
  6503. e, d));
  6504. return e
  6505. };
  6506. a.parseBoneData = function (b) {
  6507. var c = new F;
  6508. c.name = b[f.ConstValues.A_NAME];
  6509. c.parent = b[f.ConstValues.A_PARENT];
  6510. c.length = Number(b[f.ConstValues.A_LENGTH]) || 0;
  6511. var d = Number(b[f.ConstValues.A_SCALE_MODE]);
  6512. !isNaN(d) && d && (c.scaleMode = d);
  6513. if (d = b[f.ConstValues.A_FIXED_ROTATION])c.fixedRotation = d;
  6514. a.parseTransform(b[f.ConstValues.TRANSFORM], c.global);
  6515. c.transform.copy(c.global);
  6516. return c
  6517. };
  6518. a.parseSkinData = function (b, c) {
  6519. var d = new H;
  6520. d.name = b[f.ConstValues.A_NAME];
  6521. var e = b[f.ConstValues.SLOT], g;
  6522. for (g in e)d.addSlotData(a.parseSlotData(e[g],
  6523. c));
  6524. return d
  6525. };
  6526. a.parseSlotData = function (b, c) {
  6527. var d = new D;
  6528. d.name = b[f.ConstValues.A_NAME];
  6529. d.parent = b[f.ConstValues.A_PARENT];
  6530. d.zOrder = Number(b[f.ConstValues.A_Z_ORDER]);
  6531. d.blendMode = b[f.ConstValues.A_BLENDMODE];
  6532. d.blendMode || (d.blendMode = "normal");
  6533. var e = b[f.ConstValues.DISPLAY], g;
  6534. for (g in e)d.addDisplayData(a.parseDisplayData(e[g], c));
  6535. return d
  6536. };
  6537. a.parseDisplayData = function (b, c) {
  6538. var d = new l;
  6539. d.name = b[f.ConstValues.A_NAME];
  6540. d.type = b[f.ConstValues.A_TYPE];
  6541. d.pivot = c.addSubTexturePivot(0, 0, d.name);
  6542. a.parseTransform(b[f.ConstValues.TRANSFORM],
  6543. d.transform, d.pivot);
  6544. return d
  6545. };
  6546. a.parseAnimationData = function (b, c, d) {
  6547. var e = new k;
  6548. e.name = b[f.ConstValues.A_NAME];
  6549. e.frameRate = d;
  6550. e.loop = Number(b[f.ConstValues.A_LOOP]) || 0;
  6551. e.fadeInTime = Number(b[f.ConstValues.A_FADE_IN_TIME]);
  6552. e.duration = Number(b[f.ConstValues.A_DURATION]) / d;
  6553. e.scale = Number(b[f.ConstValues.A_SCALE]);
  6554. if (b.hasOwnProperty(f.ConstValues.A_TWEEN_EASING)) {
  6555. var g = b[f.ConstValues.A_TWEEN_EASING];
  6556. e.tweenEasing = void 0 == g || null == g ? NaN : Number(g)
  6557. } else e.tweenEasing = NaN;
  6558. a.parseTimeline(b, e, a.parseMainFrame,
  6559. d);
  6560. var h, g = b[f.ConstValues.TIMELINE], n;
  6561. for (n in g)h = g[n], b = a.parseTransformTimeline(h, e.duration, d), h = h[f.ConstValues.A_NAME], e.addTimeline(b, h);
  6562. f.DBDataUtil.addHideTimeline(e, c);
  6563. f.DBDataUtil.transformAnimationData(e, c);
  6564. return e
  6565. };
  6566. a.parseTimeline = function (a, b, c, d) {
  6567. var e = 0, g;
  6568. a = a[f.ConstValues.FRAME];
  6569. for (var h in a)g = c(a[h], d), g.position = e, b.addFrame(g), e += g.duration;
  6570. g && (g.duration = b.duration - g.position)
  6571. };
  6572. a.parseTransformTimeline = function (b, c, d) {
  6573. var e = new h;
  6574. e.duration = c;
  6575. a.parseTimeline(b, e, a.parseTransformFrame,
  6576. d);
  6577. e.scale = Number(b[f.ConstValues.A_SCALE]);
  6578. e.offset = Number(b[f.ConstValues.A_OFFSET]);
  6579. return e
  6580. };
  6581. a.parseFrame = function (a, b, c) {
  6582. b.duration = Number(a[f.ConstValues.A_DURATION]) / c;
  6583. b.action = a[f.ConstValues.A_ACTION];
  6584. b.event = a[f.ConstValues.A_EVENT];
  6585. b.sound = a[f.ConstValues.A_SOUND]
  6586. };
  6587. a.parseMainFrame = function (b, c) {
  6588. var e = new d;
  6589. a.parseFrame(b, e, c);
  6590. return e
  6591. };
  6592. a.parseTransformFrame = function (b, d) {
  6593. var g = new e;
  6594. a.parseFrame(b, g, d);
  6595. g.visible = 1 != Number(b[f.ConstValues.A_HIDE]);
  6596. if (b.hasOwnProperty(f.ConstValues.A_TWEEN_EASING)) {
  6597. var h =
  6598. b[f.ConstValues.A_TWEEN_EASING];
  6599. g.tweenEasing = void 0 == h || null == h ? NaN : Number(h)
  6600. } else g.tweenEasing = 0;
  6601. g.tweenRotate = Number(b[f.ConstValues.A_TWEEN_ROTATE]) || 0;
  6602. g.displayIndex = Number(b[f.ConstValues.A_DISPLAY_INDEX]) || 0;
  6603. g.zOrder = Number(b[f.ConstValues.A_Z_ORDER]) || 0;
  6604. a.parseTransform(b[f.ConstValues.TRANSFORM], g.global, g.pivot);
  6605. g.transform.copy(g.global);
  6606. if (h = b[f.ConstValues.COLOR_TRANSFORM])g.color = new c.ColorTransform, g.color.alphaOffset = Number(h[f.ConstValues.A_ALPHA_OFFSET]), g.color.redOffset = Number(h[f.ConstValues.A_RED_OFFSET]),
  6607. g.color.greenOffset = Number(h[f.ConstValues.A_GREEN_OFFSET]), g.color.blueOffset = Number(h[f.ConstValues.A_BLUE_OFFSET]), g.color.alphaMultiplier = 0.01 * Number(h[f.ConstValues.A_ALPHA_MULTIPLIER]), g.color.redMultiplier = 0.01 * Number(h[f.ConstValues.A_RED_MULTIPLIER]), g.color.greenMultiplier = 0.01 * Number(h[f.ConstValues.A_GREEN_MULTIPLIER]), g.color.blueMultiplier = 0.01 * Number(h[f.ConstValues.A_BLUE_MULTIPLIER]);
  6608. return g
  6609. };
  6610. a.parseTransform = function (a, b, c) {
  6611. "undefined" === typeof c && (c = null);
  6612. a && (b && (b.x = Number(a[f.ConstValues.A_X]),
  6613. b.y = Number(a[f.ConstValues.A_Y]), b.skewX = Number(a[f.ConstValues.A_SKEW_X]) * f.ConstValues.ANGLE_TO_RADIAN, b.skewY = Number(a[f.ConstValues.A_SKEW_Y]) * f.ConstValues.ANGLE_TO_RADIAN, b.scaleX = Number(a[f.ConstValues.A_SCALE_X]), b.scaleY = Number(a[f.ConstValues.A_SCALE_Y])), c && (c.x = Number(a[f.ConstValues.A_PIVOT_X]), c.y = Number(a[f.ConstValues.A_PIVOT_Y])))
  6614. };
  6615. return a
  6616. }();
  6617. a.DataParser = g
  6618. })(d.objects || (d.objects = {}));
  6619. var e = d.objects;
  6620. (function (a) {
  6621. var c = function (a) {
  6622. function b() {
  6623. a.call(this);
  6624. this._dataDic = {};
  6625. this._textureAtlasDic =
  6626. {};
  6627. this._textureAtlasLoadingDic = {}
  6628. }
  6629. __extends(b, a);
  6630. b.prototype.getSkeletonData = function (a) {
  6631. return this._dataDic[a]
  6632. };
  6633. b.prototype.addSkeletonData = function (a, b) {
  6634. "undefined" === typeof b && (b = null);
  6635. if (!a)throw Error();
  6636. b = b || a.name;
  6637. if (!b)throw Error("Unnamed data!");
  6638. this._dataDic[b] = a
  6639. };
  6640. b.prototype.removeSkeletonData = function (a) {
  6641. delete this._dataDic[a]
  6642. };
  6643. b.prototype.getTextureAtlas = function (a) {
  6644. return this._textureAtlasDic[a]
  6645. };
  6646. b.prototype.addTextureAtlas = function (a, b) {
  6647. "undefined" === typeof b && (b = null);
  6648. if (!a)throw Error();
  6649. b = b || a.name;
  6650. if (!b)throw Error("Unnamed data!");
  6651. this._textureAtlasDic[b] = a
  6652. };
  6653. b.prototype.removeTextureAtlas = function (a) {
  6654. delete this._textureAtlasDic[a]
  6655. };
  6656. b.prototype.dispose = function (a) {
  6657. "undefined" === typeof a && (a = !0);
  6658. if (a) {
  6659. for (var b in this._dataDic)this._dataDic[b].dispose();
  6660. for (b in this._textureAtlasDic)this._textureAtlasDic[b].dispose()
  6661. }
  6662. this._currentTextureAtlasName = this._currentDataName = this._textureAtlasLoadingDic = this._textureAtlasDic = this._dataDic = null
  6663. };
  6664. b.prototype.buildArmature = function (a, b, c, f, g) {
  6665. if (c) {
  6666. var h = this._dataDic[c];
  6667. if (h)var n = h.getArmatureData(a)
  6668. } else for (c in this._dataDic)if (h = this._dataDic[c], n = h.getArmatureData(a))break;
  6669. if (!n)return null;
  6670. this._currentDataName = c;
  6671. this._currentTextureAtlasName = f || c;
  6672. f = this._generateArmature();
  6673. f.name = a;
  6674. var k, q, l = n.getBoneDataList(), m;
  6675. for (m in l)q = l[m], k = new d.Bone, k.name = q.name, k.fixedRotation = q.fixedRotation, k.scaleMode = q.scaleMode, k.origin.copy(q.transform), n.getBoneData(q.parent) ? f.addChild(k, q.parent) : f.addChild(k, null);
  6676. if (b && b != a) {
  6677. var p =
  6678. h.getArmatureData(b);
  6679. if (!p)for (c in this._dataDic)if (h = this._dataDic[c], p = h.getArmatureData(b))break
  6680. }
  6681. p ? f.animation.setAnimationDataList(p.getAnimationDataList()) : f.animation.setAnimationDataList(n.getAnimationDataList());
  6682. k = n.getSkinData(g);
  6683. if (!k)throw Error();
  6684. a = [];
  6685. c = k.getSlotDataList();
  6686. for (m in c)if (h = c[m], k = f.getBone(h.parent)) {
  6687. g = h.getDisplayDataList();
  6688. b = this._generateSlot();
  6689. b.name = h.name;
  6690. b._blendMode = h.blendMode;
  6691. b._originZOrder = h.zOrder;
  6692. b._dislayDataList = g;
  6693. a.length = 0;
  6694. for (h = g.length; h--;)switch (n =
  6695. g[h], n.type) {
  6696. case e.DisplayData.ARMATURE:
  6697. (n = this.buildArmature(n.name, null, this._currentDataName, this._currentTextureAtlasName, null)) && (a[h] = n);
  6698. break;
  6699. default:
  6700. a[h] = this._generateDisplay(this._textureAtlasDic[this._currentTextureAtlasName], n.name, n.pivot.x, n.pivot.y)
  6701. }
  6702. b.setDisplayList(a);
  6703. b._changeDisplay(0);
  6704. k.addChild(b)
  6705. }
  6706. f._slotsZOrderChanged = !0;
  6707. f.advanceTime(0);
  6708. return f
  6709. };
  6710. b.prototype.getTextureDisplay = function (a, b, c, d) {
  6711. if (b)var e = this._textureAtlasDic[b];
  6712. if (!e && !b)for (b in this._textureAtlasDic) {
  6713. e = this._textureAtlasDic[b];
  6714. if (e.getRegion(a))break;
  6715. e = null
  6716. }
  6717. if (e) {
  6718. if (isNaN(c) || isNaN(d))if (b = this._dataDic[b])if (b = b.getSubTexturePivot(a))c = b.x, d = b.y;
  6719. return this._generateDisplay(e, a, c, d)
  6720. }
  6721. return null
  6722. };
  6723. b.prototype._generateArmature = function () {
  6724. return null
  6725. };
  6726. b.prototype._generateSlot = function () {
  6727. return null
  6728. };
  6729. b.prototype._generateDisplay = function (a, b, c, d) {
  6730. return null
  6731. };
  6732. return b
  6733. }(b.EventDispatcher);
  6734. a.BaseFactory = c
  6735. })(d.factorys || (d.factorys = {}));
  6736. (function (b) {
  6737. var d = function () {
  6738. function a() {
  6739. }
  6740. a.ANGLE_TO_RADIAN = Math.PI / 180;
  6741. a.DRAGON_BONES =
  6742. "dragonBones";
  6743. a.ARMATURE = "armature";
  6744. a.SKIN = "skin";
  6745. a.BONE = "bone";
  6746. a.SLOT = "slot";
  6747. a.DISPLAY = "display";
  6748. a.ANIMATION = "animation";
  6749. a.TIMELINE = "timeline";
  6750. a.FRAME = "frame";
  6751. a.TRANSFORM = "transform";
  6752. a.COLOR_TRANSFORM = "colorTransform";
  6753. a.TEXTURE_ATLAS = "TextureAtlas";
  6754. a.SUB_TEXTURE = "SubTexture";
  6755. a.A_VERSION = "version";
  6756. a.A_IMAGE_PATH = "imagePath";
  6757. a.A_FRAME_RATE = "frameRate";
  6758. a.A_NAME = "name";
  6759. a.A_PARENT = "parent";
  6760. a.A_LENGTH = "length";
  6761. a.A_TYPE = "type";
  6762. a.A_FADE_IN_TIME = "fadeInTime";
  6763. a.A_DURATION = "duration";
  6764. a.A_SCALE = "scale";
  6765. a.A_OFFSET =
  6766. "offset";
  6767. a.A_LOOP = "loop";
  6768. a.A_EVENT = "event";
  6769. a.A_SOUND = "sound";
  6770. a.A_ACTION = "action";
  6771. a.A_HIDE = "hide";
  6772. a.A_TWEEN_EASING = "tweenEasing";
  6773. a.A_TWEEN_ROTATE = "tweenRotate";
  6774. a.A_DISPLAY_INDEX = "displayIndex";
  6775. a.A_Z_ORDER = "z";
  6776. a.A_BLENDMODE = "blendMode";
  6777. a.A_WIDTH = "width";
  6778. a.A_HEIGHT = "height";
  6779. a.A_SCALE_MODE = "scaleMode";
  6780. a.A_FIXED_ROTATION = "fixedRotation";
  6781. a.A_X = "x";
  6782. a.A_Y = "y";
  6783. a.A_SKEW_X = "skX";
  6784. a.A_SKEW_Y = "skY";
  6785. a.A_SCALE_X = "scX";
  6786. a.A_SCALE_Y = "scY";
  6787. a.A_PIVOT_X = "pX";
  6788. a.A_PIVOT_Y = "pY";
  6789. a.A_ALPHA_OFFSET = "aO";
  6790. a.A_RED_OFFSET = "rO";
  6791. a.A_GREEN_OFFSET =
  6792. "gO";
  6793. a.A_BLUE_OFFSET = "bO";
  6794. a.A_ALPHA_MULTIPLIER = "aM";
  6795. a.A_RED_MULTIPLIER = "rM";
  6796. a.A_GREEN_MULTIPLIER = "gM";
  6797. a.A_BLUE_MULTIPLIER = "bM";
  6798. return a
  6799. }();
  6800. b.ConstValues = d;
  6801. var f = function () {
  6802. function a() {
  6803. }
  6804. a.transformPointWithParent = function (b, c) {
  6805. var d = a._helpMatrix;
  6806. a.transformToMatrix(c, d);
  6807. d.invert();
  6808. var e = b.x, f = b.y;
  6809. b.x = d.a * e + d.c * f + d.tx;
  6810. b.y = d.d * f + d.b * e + d.ty;
  6811. b.skewX = a.formatRadian(b.skewX - c.skewX);
  6812. b.skewY = a.formatRadian(b.skewY - c.skewY)
  6813. };
  6814. a.transformToMatrix = function (a, b) {
  6815. b.a = a.scaleX * Math.cos(a.skewY);
  6816. b.b = a.scaleX * Math.sin(a.skewY);
  6817. b.c = -a.scaleY * Math.sin(a.skewX);
  6818. b.d = a.scaleY * Math.cos(a.skewX);
  6819. b.tx = a.x;
  6820. b.ty = a.y
  6821. };
  6822. a.formatRadian = function (b) {
  6823. b %= a.DOUBLE_PI;
  6824. b > Math.PI && (b -= a.DOUBLE_PI);
  6825. b < -Math.PI && (b += a.DOUBLE_PI);
  6826. return b
  6827. };
  6828. a.DOUBLE_PI = 2 * Math.PI;
  6829. a._helpMatrix = new c.Matrix;
  6830. return a
  6831. }();
  6832. b.TransformUtil = f;
  6833. d = function () {
  6834. function b() {
  6835. }
  6836. b.transformArmatureData = function (a) {
  6837. for (var b = a.getBoneDataList(), c = b.length, d, e; c--;)if (d = b[c], d.parent && (e = a.getBoneData(d.parent)))d.transform.copy(d.global), f.transformPointWithParent(d.transform, e.global)
  6838. };
  6839. b.transformArmatureDataAnimations = function (a) {
  6840. for (var c = a.getAnimationDataList(), d = c.length; d--;)b.transformAnimationData(c[d], a)
  6841. };
  6842. b.transformAnimationData = function (a, c) {
  6843. for (var d = c.getSkinData(null), e = c.getBoneDataList(), d = d.getSlotDataList(), g = e.length, h, k, l, m, p, v, w, y, r, J; g--;)if (h = e[g], k = a.getTimeline(h.name)) {
  6844. l = null;
  6845. for (var N in d)if (l = d[N], l.parent == h.name)break;
  6846. m = h.parent ? a.getTimeline(h.parent) : null;
  6847. p = k.getFrameList();
  6848. y = w = v = null;
  6849. J = p.length;
  6850. for (var E = 0; E < J; E++) {
  6851. r = p[E];
  6852. m ? (b._helpTransform1.copy(r.global),
  6853. b.getTimelineTransform(m, r.position, b._helpTransform2), f.transformPointWithParent(b._helpTransform1, b._helpTransform2), r.transform.copy(b._helpTransform1)) : r.transform.copy(r.global);
  6854. r.transform.x -= h.transform.x;
  6855. r.transform.y -= h.transform.y;
  6856. r.transform.skewX -= h.transform.skewX;
  6857. r.transform.skewY -= h.transform.skewY;
  6858. r.transform.scaleX -= h.transform.scaleX;
  6859. r.transform.scaleY -= h.transform.scaleY;
  6860. !k.transformed && l && (r.zOrder -= l.zOrder);
  6861. v || (v = k.originTransform, v.copy(r.transform), v.skewX = f.formatRadian(v.skewX),
  6862. v.skewY = f.formatRadian(v.skewY), w = k.originPivot, w.x = r.pivot.x, w.y = r.pivot.y);
  6863. r.transform.x -= v.x;
  6864. r.transform.y -= v.y;
  6865. r.transform.skewX = f.formatRadian(r.transform.skewX - v.skewX);
  6866. r.transform.skewY = f.formatRadian(r.transform.skewY - v.skewY);
  6867. r.transform.scaleX -= v.scaleX;
  6868. r.transform.scaleY -= v.scaleY;
  6869. k.transformed || (r.pivot.x -= w.x, r.pivot.y -= w.y);
  6870. if (y) {
  6871. var L = r.transform.skewX - y.transform.skewX;
  6872. y.tweenRotate ? 0 < y.tweenRotate ? (0 > L && (r.transform.skewX += 2 * Math.PI, r.transform.skewY += 2 * Math.PI), 1 < y.tweenRotate &&
  6873. (r.transform.skewX += 2 * Math.PI * (y.tweenRotate - 1), r.transform.skewY += 2 * Math.PI * (y.tweenRotate - 1))) : (0 < L && (r.transform.skewX -= 2 * Math.PI, r.transform.skewY -= 2 * Math.PI), 1 > y.tweenRotate && (r.transform.skewX += 2 * Math.PI * (y.tweenRotate + 1), r.transform.skewY += 2 * Math.PI * (y.tweenRotate + 1))) : (r.transform.skewX = y.transform.skewX + f.formatRadian(r.transform.skewX - y.transform.skewX), r.transform.skewY = y.transform.skewY + f.formatRadian(r.transform.skewY - y.transform.skewY))
  6874. }
  6875. y = r
  6876. }
  6877. k.transformed = !0
  6878. }
  6879. };
  6880. b.getTimelineTransform =
  6881. function (b, c, d) {
  6882. for (var e = b.getFrameList(), g = e.length, h; g--;)if (b = e[g], b.position <= c && b.position + b.duration > c) {
  6883. h = b.tweenEasing;
  6884. g == e.length - 1 || isNaN(h) || c == b.position ? d.copy(b.global) : (c = (c - b.position) / b.duration, h && (c = a.TimelineState.getEaseValue(c, h)), e = e[g + 1], d.x = b.global.x + (e.global.x - b.global.x) * c, d.y = b.global.y + (e.global.y - b.global.y) * c, d.skewX = f.formatRadian(b.global.skewX + (e.global.skewX - b.global.skewX) * c), d.skewY = f.formatRadian(b.global.skewY + (e.global.skewY - b.global.skewY) * c), d.scaleX = b.global.scaleX +
  6885. (e.global.scaleX - b.global.scaleX) * c, d.scaleY = b.global.scaleY + (e.global.scaleY - b.global.scaleY) * c);
  6886. break
  6887. }
  6888. };
  6889. b.addHideTimeline = function (a, b) {
  6890. for (var c = b.getBoneDataList(), d = c.length, f; d--;)f = c[d], f = f.name, a.getTimeline(f) || a.addTimeline(e.TransformTimeline.HIDE_TIMELINE, f)
  6891. };
  6892. b._helpTransform1 = new e.DBTransform;
  6893. b._helpTransform2 = new e.DBTransform;
  6894. return b
  6895. }();
  6896. b.DBDataUtil = d
  6897. })(d.utils || (d.utils = {}));
  6898. var f = d.utils, g = function () {
  6899. function a() {
  6900. this.global = new e.DBTransform;
  6901. this.origin = new e.DBTransform;
  6902. this.offset =
  6903. new e.DBTransform;
  6904. this.tween = new e.DBTransform;
  6905. this.tween.scaleX = this.tween.scaleY = 0;
  6906. this._globalTransformMatrix = new c.Matrix;
  6907. this._visible = !0;
  6908. this._isDisplayOnStage = this._isColorChanged = !1;
  6909. this._scaleType = 0;
  6910. this.fixedRotation = !1
  6911. }
  6912. a.prototype.getVisible = function () {
  6913. return this._visible
  6914. };
  6915. a.prototype.setVisible = function (a) {
  6916. this._visible = a
  6917. };
  6918. a.prototype._setParent = function (a) {
  6919. this.parent = a
  6920. };
  6921. a.prototype._setArmature = function (a) {
  6922. this.armature && this.armature._removeDBObject(this);
  6923. (this.armature = a) && this.armature._addDBObject(this)
  6924. };
  6925. a.prototype.dispose = function () {
  6926. this._globalTransformMatrix = this.tween = this.offset = this.origin = this.global = this.armature = this.parent = null
  6927. };
  6928. a.prototype._update = function () {
  6929. this.global.scaleX = (this.origin.scaleX + this.tween.scaleX) * this.offset.scaleX;
  6930. this.global.scaleY = (this.origin.scaleY + this.tween.scaleY) * this.offset.scaleY;
  6931. if (this.parent) {
  6932. var a = this.origin.x + this.offset.x + this.tween.x, b = this.origin.y + this.offset.y + this.tween.y, c = this.parent._globalTransformMatrix;
  6933. this._globalTransformMatrix.tx = this.global.x =
  6934. c.a * a + c.c * b + c.tx;
  6935. this._globalTransformMatrix.ty = this.global.y = c.d * b + c.b * a + c.ty;
  6936. this.fixedRotation ? (this.global.skewX = this.origin.skewX + this.offset.skewX + this.tween.skewX, this.global.skewY = this.origin.skewY + this.offset.skewY + this.tween.skewY) : (this.global.skewX = this.origin.skewX + this.offset.skewX + this.tween.skewX + this.parent.global.skewX, this.global.skewY = this.origin.skewY + this.offset.skewY + this.tween.skewY + this.parent.global.skewY);
  6937. this.parent.scaleMode >= this._scaleType && (this.global.scaleX *= this.parent.global.scaleX,
  6938. this.global.scaleY *= this.parent.global.scaleY)
  6939. } else this._globalTransformMatrix.tx = this.global.x = this.origin.x + this.offset.x + this.tween.x, this._globalTransformMatrix.ty = this.global.y = this.origin.y + this.offset.y + this.tween.y, this.global.skewX = this.origin.skewX + this.offset.skewX + this.tween.skewX, this.global.skewY = this.origin.skewY + this.offset.skewY + this.tween.skewY;
  6940. this._globalTransformMatrix.a = this.global.scaleX * Math.cos(this.global.skewY);
  6941. this._globalTransformMatrix.b = this.global.scaleX * Math.sin(this.global.skewY);
  6942. this._globalTransformMatrix.c = -this.global.scaleY * Math.sin(this.global.skewX);
  6943. this._globalTransformMatrix.d = this.global.scaleY * Math.cos(this.global.skewX)
  6944. };
  6945. return a
  6946. }();
  6947. d.DBObject = g;
  6948. var h = function (a) {
  6949. function b(c) {
  6950. a.call(this);
  6951. this._displayBridge = c;
  6952. this._displayList = [];
  6953. this._displayIndex = -1;
  6954. this._scaleType = 1;
  6955. this._offsetZOrder = this._tweenZorder = this._originZOrder = 0;
  6956. this._isHideDisplay = this._isDisplayOnStage = !1;
  6957. this._blendMode = "normal";
  6958. this._displayBridge.updateBlendMode(this._blendMode)
  6959. }
  6960. __extends(b,
  6961. a);
  6962. b.prototype.getZOrder = function () {
  6963. return this._originZOrder + this._tweenZorder + this._offsetZOrder
  6964. };
  6965. b.prototype.setZOrder = function (a) {
  6966. this.getZOrder() != a && (this._offsetZOrder = a - this._originZOrder - this._tweenZorder, this.armature && (this.armature._slotsZOrderChanged = !0))
  6967. };
  6968. b.prototype.getDisplay = function () {
  6969. var a = this._displayList[this._displayIndex];
  6970. return a instanceof l ? a.getDisplay() : a
  6971. };
  6972. b.prototype.setDisplay = function (a) {
  6973. this._displayList[this._displayIndex] = a;
  6974. this._setDisplay(a)
  6975. };
  6976. b.prototype.getBlendMode =
  6977. function () {
  6978. return this._blendMode
  6979. };
  6980. b.prototype.setBlendMode = function (a) {
  6981. this._blendMode != a && (this._blendMode = a, this._displayBridge.getDisplay() && this._displayBridge.updateBlendMode(this._blendMode))
  6982. };
  6983. b.prototype.getChildArmature = function () {
  6984. var a = this._displayList[this._displayIndex];
  6985. return a instanceof l ? a : null
  6986. };
  6987. b.prototype.setChildArmature = function (a) {
  6988. (this._displayList[this._displayIndex] = a) && this._setDisplay(a.getDisplay())
  6989. };
  6990. b.prototype.getDisplayList = function () {
  6991. return this._displayList
  6992. };
  6993. b.prototype.setDisplayList =
  6994. function (a) {
  6995. if (!a)throw Error();
  6996. for (var b = this._displayList.length = a.length; b--;)this._displayList[b] = a[b];
  6997. 0 <= this._displayIndex && (a = this._displayIndex, this._displayIndex = -1, this._changeDisplay(a))
  6998. };
  6999. b.prototype._setDisplay = function (a) {
  7000. this._displayBridge.getDisplay() ? this._displayBridge.setDisplay(a) : (this._displayBridge.setDisplay(a), this.armature && (this._displayBridge.addDisplay(this.armature.getDisplay(), -1), this.armature._slotsZOrderChanged = !0));
  7001. this.updateChildArmatureAnimation();
  7002. a && this._displayBridge.updateBlendMode(this._blendMode);
  7003. !this._isHideDisplay && this._displayBridge.getDisplay() ? this._isDisplayOnStage = !0 : this._isDisplayOnStage = !1
  7004. };
  7005. b.prototype._changeDisplay = function (a) {
  7006. if (0 > a)this._isHideDisplay || (this._isHideDisplay = !0, this._displayBridge.removeDisplay(), this.updateChildArmatureAnimation()); else {
  7007. if (this._isHideDisplay) {
  7008. this._isHideDisplay = !1;
  7009. var b = !0;
  7010. this.armature && (this._displayBridge.addDisplay(this.armature.getDisplay(), -1), this.armature._slotsZOrderChanged = !0)
  7011. }
  7012. var c = this._displayList.length;
  7013. a >= c && 0 < c && (a = c - 1);
  7014. this._displayIndex !=
  7015. a ? (this._displayIndex = a, a = this._displayList[this._displayIndex], a instanceof l ? this._setDisplay(a.getDisplay()) : this._setDisplay(a), this._dislayDataList && this._displayIndex <= this._dislayDataList.length && this.origin.copy(this._dislayDataList[this._displayIndex].transform)) : b && this.updateChildArmatureAnimation()
  7016. }
  7017. !this._isHideDisplay && this._displayBridge.getDisplay() ? this._isDisplayOnStage = !0 : this._isDisplayOnStage = !1
  7018. };
  7019. b.prototype.setVisible = function (a) {
  7020. a != this._visible && (this._visible = a, this._updateVisible(this._visible))
  7021. };
  7022. b.prototype._setArmature = function (b) {
  7023. a.prototype._setArmature.call(this, b);
  7024. this.armature ? (this.armature._slotsZOrderChanged = !0, this._displayBridge.addDisplay(this.armature.getDisplay(), -1)) : this._displayBridge.removeDisplay()
  7025. };
  7026. b.prototype.dispose = function () {
  7027. this._displayBridge && (a.prototype.dispose.call(this), this._displayBridge.dispose(), this._displayList.length = 0, this._dislayDataList = this._displayList = this._displayBridge = null)
  7028. };
  7029. b.prototype._update = function () {
  7030. a.prototype._update.call(this);
  7031. if (this._isDisplayOnStage) {
  7032. var b =
  7033. this.parent._tweenPivot.x, c = this.parent._tweenPivot.y;
  7034. if (b || c) {
  7035. var d = this.parent._globalTransformMatrix;
  7036. this._globalTransformMatrix.tx += d.a * b + d.c * c;
  7037. this._globalTransformMatrix.ty += d.b * b + d.d * c
  7038. }
  7039. this._displayBridge.updateTransform(this._globalTransformMatrix, this.global)
  7040. }
  7041. };
  7042. b.prototype._updateVisible = function (a) {
  7043. this._displayBridge.setVisible(this.parent.getVisible() && this._visible && a)
  7044. };
  7045. b.prototype.updateChildArmatureAnimation = function () {
  7046. var a = this.getChildArmature();
  7047. if (a)if (this._isHideDisplay)a.animation.stop(),
  7048. a.animation._lastAnimationState = null; else {
  7049. var b = this.armature ? this.armature.animation.getLastAnimationName() : null;
  7050. b && a.animation.hasAnimation(b) ? a.animation.gotoAndPlay(b) : a.animation.play()
  7051. }
  7052. };
  7053. return b
  7054. }(g);
  7055. d.Slot = h;
  7056. var k = function (a) {
  7057. function d() {
  7058. a.call(this);
  7059. this._children = [];
  7060. this._scaleType = 2;
  7061. this._tweenPivot = new c.Point;
  7062. this.scaleMode = 1
  7063. }
  7064. __extends(d, a);
  7065. d.prototype.setVisible = function (a) {
  7066. if (this._visible != a) {
  7067. this._visible = a;
  7068. for (a = this._children.length; a--;) {
  7069. var b = this._children[a];
  7070. b instanceof h &&
  7071. b._updateVisible(this._visible)
  7072. }
  7073. }
  7074. };
  7075. d.prototype._setArmature = function (b) {
  7076. a.prototype._setArmature.call(this, b);
  7077. for (b = this._children.length; b--;)this._children[b]._setArmature(this.armature)
  7078. };
  7079. d.prototype.dispose = function () {
  7080. if (this._children) {
  7081. a.prototype.dispose.call(this);
  7082. for (var b = this._children.length; b--;)this._children[b].dispose();
  7083. this._children.length = 0;
  7084. this.slot = this._tweenPivot = this._children = null
  7085. }
  7086. };
  7087. d.prototype.contains = function (a) {
  7088. if (!a)throw Error();
  7089. if (a == this)return!1;
  7090. for (; !(a == this || null ==
  7091. a);)a = a.parent;
  7092. return a == this
  7093. };
  7094. d.prototype.addChild = function (a) {
  7095. if (!a)throw Error();
  7096. if (a == this || a instanceof d && a.contains(this))throw Error("An Bone cannot be added as a child to itself or one of its children (or children's children, etc.)");
  7097. a.parent && a.parent.removeChild(a);
  7098. this._children[this._children.length] = a;
  7099. a._setParent(this);
  7100. a._setArmature(this.armature);
  7101. !this.slot && a instanceof h && (this.slot = a)
  7102. };
  7103. d.prototype.removeChild = function (a) {
  7104. if (!a)throw Error();
  7105. var b = this._children.indexOf(a);
  7106. if (0 <=
  7107. b)this._children.splice(b, 1), a._setParent(null), a._setArmature(null), a == this.slot && (this.slot = null); else throw Error();
  7108. };
  7109. d.prototype.getSlots = function () {
  7110. for (var a = [], b = this._children.length; b--;)this._children[b]instanceof h && a.unshift(this._children[b]);
  7111. return a
  7112. };
  7113. d.prototype._arriveAtFrame = function (a, c, e, f) {
  7114. if (a) {
  7115. c = e.getMixingTransform(name);
  7116. if (e.displayControl && (2 == c || -1 == c))if ((!this.displayController || this.displayController == e.name) && this.slot)c = a.displayIndex, 0 <= c && (!isNaN(a.zOrder) && a.zOrder !=
  7117. this.slot._tweenZorder) && (this.slot._tweenZorder = a.zOrder, this.armature._slotsZOrderChanged = !0), this.slot._changeDisplay(c), this.slot._updateVisible(a.visible);
  7118. a.event && this.armature.hasEventListener(b.FrameEvent.BONE_FRAME_EVENT) && (c = new b.FrameEvent(b.FrameEvent.BONE_FRAME_EVENT), c.bone = this, c.animationState = e, c.frameLabel = a.event, this.armature._eventList.push(c));
  7119. a.sound && d._soundManager.hasEventListener(b.SoundEvent.SOUND) && (c = new b.SoundEvent(b.SoundEvent.SOUND), c.armature = this.armature, c.animationState =
  7120. e, c.sound = a.sound, d._soundManager.dispatchEvent(c));
  7121. if (a.action)for (var g in this._children)this._children[g]instanceof h && (e = this._children[g].getChildArmature()) && e.animation.gotoAndPlay(a.action)
  7122. } else this.slot && this.slot._changeDisplay(-1)
  7123. };
  7124. d.prototype._updateColor = function (a, b, c, d, e, f, g, h, k) {
  7125. (k || this._isColorChanged) && this.slot._displayBridge.updateColor(a, b, c, d, e, f, g, h);
  7126. this._isColorChanged = k
  7127. };
  7128. d._soundManager = b.SoundEventManager.getInstance();
  7129. return d
  7130. }(g);
  7131. d.Bone = k;
  7132. var l = function (c) {
  7133. function d(b) {
  7134. c.call(this);
  7135. this.animation = new a.Animation(this);
  7136. this._display = b;
  7137. this._slotsZOrderChanged = !1;
  7138. this._slotList = [];
  7139. this._boneList = [];
  7140. this._eventList = []
  7141. }
  7142. __extends(d, c);
  7143. d.prototype.getDisplay = function () {
  7144. return this._display
  7145. };
  7146. d.prototype.dispose = function () {
  7147. if (this.animation) {
  7148. this.animation.dispose();
  7149. for (var a = this._slotList.length; a--;)this._slotList[a].dispose();
  7150. for (a = this._boneList.length; a--;)this._boneList[a].dispose();
  7151. this._slotList.length = 0;
  7152. this._boneList.length = 0;
  7153. this._eventList.length = 0;
  7154. this.animation = this._display =
  7155. this._eventList = this._boneList = this._slotList = null
  7156. }
  7157. };
  7158. d.prototype.advanceTime = function (a) {
  7159. this.animation.advanceTime(a);
  7160. a *= this.animation.timeScale;
  7161. for (var c = this._boneList.length; c--;)this._boneList[c]._update();
  7162. for (var c = this._slotList.length, d; c--;)d = this._slotList[c], d._update(), d._isDisplayOnStage && (d = d.getChildArmature()) && d.advanceTime(a);
  7163. this._slotsZOrderChanged && (this.updateSlotsZOrder(), this.hasEventListener(b.ArmatureEvent.Z_ORDER_UPDATED) && this.dispatchEvent(new b.ArmatureEvent(b.ArmatureEvent.Z_ORDER_UPDATED)));
  7164. if (this._eventList.length) {
  7165. a = this._eventList.length;
  7166. for (c = 0; c < a; c++)this.dispatchEvent(this._eventList[c]);
  7167. this._eventList.length = 0
  7168. }
  7169. };
  7170. d.prototype.getSlots = function (a) {
  7171. "undefined" === typeof a && (a = !0);
  7172. return a ? this._slotList.concat() : this._slotList
  7173. };
  7174. d.prototype.getBones = function (a) {
  7175. "undefined" === typeof a && (a = !0);
  7176. return a ? this._boneList.concat() : this._boneList
  7177. };
  7178. d.prototype.getSlot = function (a) {
  7179. for (var b = this._slotList.length; b--;)if (this._slotList[b].name == a)return this._slotList[b];
  7180. return null
  7181. };
  7182. d.prototype.getSlotByDisplay =
  7183. function (a) {
  7184. if (a)for (var b = this._slotList.length; b--;)if (this._slotList[b].getDisplay() == a)return this._slotList[b];
  7185. return null
  7186. };
  7187. d.prototype.removeSlot = function (a) {
  7188. if (!a)throw Error();
  7189. if (0 <= this._slotList.indexOf(a))a.parent.removeChild(a); else throw Error();
  7190. };
  7191. d.prototype.removeSlotByName = function (a) {
  7192. a && (a = this.getSlot(a)) && this.removeSlot(a)
  7193. };
  7194. d.prototype.getBone = function (a) {
  7195. for (var b = this._boneList.length; b--;)if (this._boneList[b].name == a)return this._boneList[b];
  7196. return null
  7197. };
  7198. d.prototype.getBoneByDisplay =
  7199. function (a) {
  7200. return(a = this.getSlotByDisplay(a)) ? a.parent : null
  7201. };
  7202. d.prototype.removeBone = function (a) {
  7203. if (!a)throw Error();
  7204. if (0 <= this._boneList.indexOf(a))a.parent ? a.parent.removeChild(a) : a._setArmature(null); else throw Error();
  7205. };
  7206. d.prototype.removeBoneByName = function (a) {
  7207. a && (a = this.getBone(a)) && this.removeBone(a)
  7208. };
  7209. d.prototype.addChild = function (a, b) {
  7210. if (!a)throw Error();
  7211. if (b) {
  7212. var c = this.getBone(b);
  7213. if (c)c.addChild(a); else throw Error();
  7214. } else a.parent && a.parent.removeChild(a), a._setArmature(this)
  7215. };
  7216. d.prototype.updateSlotsZOrder =
  7217. function () {
  7218. this._slotList.sort(this.sortSlot);
  7219. for (var a = this._slotList.length, b; a--;)b = this._slotList[a], b._isDisplayOnStage && b._displayBridge.addDisplay(this._display, -1);
  7220. this._slotsZOrderChanged = !1
  7221. };
  7222. d.prototype._addDBObject = function (a) {
  7223. a instanceof h ? 0 > this._slotList.indexOf(a) && (this._slotList[this._slotList.length] = a) : a instanceof k && 0 > this._boneList.indexOf(a) && (this._boneList[this._boneList.length] = a, this._sortBoneList())
  7224. };
  7225. d.prototype._removeDBObject = function (a) {
  7226. a instanceof h ? (a = this._slotList.indexOf(a),
  7227. 0 <= a && this._slotList.splice(a, 1)) : a instanceof k && (a = this._boneList.indexOf(a), 0 <= a && this._boneList.splice(a, 1))
  7228. };
  7229. d.prototype._sortBoneList = function () {
  7230. var a = this._boneList.length;
  7231. if (0 != a) {
  7232. for (var b = [], c, d, e; a--;) {
  7233. c = 0;
  7234. for (e = d = this._boneList[a]; e;)c++, e = e.parent;
  7235. b[a] = {level: c, bone: d}
  7236. }
  7237. b.sort(this.sortBone);
  7238. for (a = b.length; a--;)this._boneList[a] = b[a].bone
  7239. }
  7240. };
  7241. d.prototype._arriveAtFrame = function (a, c, e, f) {
  7242. a.event && this.hasEventListener(b.FrameEvent.ANIMATION_FRAME_EVENT) && (c = new b.FrameEvent(b.FrameEvent.ANIMATION_FRAME_EVENT),
  7243. c.animationState = e, c.frameLabel = a.event, this._eventList.push(c));
  7244. a.sound && d._soundManager.hasEventListener(b.SoundEvent.SOUND) && (c = new b.SoundEvent(b.SoundEvent.SOUND), c.armature = this, c.animationState = e, c.sound = a.sound, d._soundManager.dispatchEvent(c));
  7245. a.action && e.isPlaying && this.animation.gotoAndPlay(a.action)
  7246. };
  7247. d.prototype.sortSlot = function (a, b) {
  7248. return a.getZOrder() < b.getZOrder() ? 1 : -1
  7249. };
  7250. d.prototype.sortBone = function (a, b) {
  7251. return a.level < b.level ? 1 : -1
  7252. };
  7253. d._soundManager = b.SoundEventManager.getInstance();
  7254. return d
  7255. }(b.EventDispatcher);
  7256. d.Armature = l
  7257. })(dragonBones || (dragonBones = {}));
  7258. __extends = this.__extends || function (d, c) {
  7259. function b() {
  7260. this.constructor = d
  7261. }
  7262. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  7263. b.prototype = c.prototype;
  7264. d.prototype = new b
  7265. };
  7266. (function (d) {
  7267. (function (b) {
  7268. var a = function () {
  7269. function a() {
  7270. }
  7271. a.prototype.getVisible = function () {
  7272. return this._display ? this._display.visible : !1
  7273. };
  7274. a.prototype.setVisible = function (a) {
  7275. this._display && (this._display.visible = a)
  7276. };
  7277. a.prototype.getDisplay = function () {
  7278. return this._display
  7279. };
  7280. a.prototype.setDisplay = function (a) {
  7281. if (this._display != a) {
  7282. if (this._display) {
  7283. var b = this._display.parent;
  7284. if (b)var c = -1;
  7285. this.removeDisplay()
  7286. }
  7287. this._display = a;
  7288. this.addDisplay(b, c)
  7289. }
  7290. };
  7291. a.prototype.dispose = function () {
  7292. this._display = null
  7293. };
  7294. a.prototype.updateTransform =
  7295. function (b, c) {
  7296. this._display.x = b.tx;
  7297. this._display.y = b.ty;
  7298. this._display.skewX = c.skewX * a.RADIAN_TO_ANGLE;
  7299. this._display.skewY = c.skewY * a.RADIAN_TO_ANGLE;
  7300. this._display.scaleX = c.scaleX;
  7301. this._display.scaleY = c.scaleY
  7302. };
  7303. a.prototype.updateColor = function (a, b, c, d, e, m, p, n) {
  7304. this._display && (this._display.alpha = e)
  7305. };
  7306. a.prototype.updateBlendMode = function (a) {
  7307. this._display && (this._display.blendMode = ns_egret.BlendMode.getBlendMode(a))
  7308. };
  7309. a.prototype.addDisplay = function (a, b) {
  7310. a && this._display && (this._display.parent && this._display.parent.removeChild(this._display),
  7311. 0 > b ? a.addChild(this._display) : a.addChild(this._display, Math.min(b, a.numChildren)))
  7312. };
  7313. a.prototype.removeDisplay = function () {
  7314. this._display && this._display.parent && this._display.parent.removeChild(this._display)
  7315. };
  7316. a.RADIAN_TO_ANGLE = 180 / Math.PI;
  7317. return a
  7318. }();
  7319. b.DragonBonesEgretBridge = a
  7320. })(d.display || (d.display = {}));
  7321. var c = d.display;
  7322. (function (b) {
  7323. var a = function () {
  7324. function a(b, c, d) {
  7325. "undefined" === typeof d && (d = 1);
  7326. this.texture = b;
  7327. this.scale = d;
  7328. this.parseData(c)
  7329. }
  7330. a.prototype.dispose = function () {
  7331. this.texture = null
  7332. };
  7333. a.prototype.getRegion =
  7334. function (a) {
  7335. throw Error("error");
  7336. };
  7337. a.prototype.parseData = function (a) {
  7338. this.name = a[d.utils.ConstValues.A_NAME];
  7339. this.spriteSheet = ns_egret.SpriteSheet.parseFromDragonBones(a)
  7340. };
  7341. return a
  7342. }();
  7343. b.EgretTextureAtlas = a
  7344. })(d.textures || (d.textures = {}));
  7345. (function (b) {
  7346. var a = function (a) {
  7347. function b() {
  7348. a.call(this)
  7349. }
  7350. __extends(b, a);
  7351. b.prototype._generateArmature = function () {
  7352. return new d.Armature(new ns_egret.DisplayObjectContainer)
  7353. };
  7354. b.prototype._generateSlot = function () {
  7355. return new d.Slot(new c.DragonBonesEgretBridge)
  7356. };
  7357. b.prototype._generateDisplay =
  7358. function (a, b, c, d) {
  7359. var e = ns_egret.Bitmap.initWithTexture(a.texture);
  7360. a = a.spriteSheet.getFrame(b);
  7361. e.spriteFrame = a;
  7362. e.setAnchorPoint(c, d);
  7363. return e
  7364. };
  7365. return b
  7366. }(d.factorys.BaseFactory);
  7367. b.EgretFactory = a
  7368. })(d.factorys || (d.factorys = {}))
  7369. })(dragonBones || (dragonBones = {}));
  7370. (function (d) {
  7371. var c = function () {
  7372. function b() {
  7373. }
  7374. b.checkDrawImage = function (a, b, c, g, h, k, l, m, p) {
  7375. null == a && d.Logger.fatal("texture\u4e3a\u7a7a");
  7376. (a.getTextureWidth() < b + g || a.getTextureHeight() < c + h) && d.Logger.fatal("\u63d0\u4f9b\u7684\u5c3a\u5bf8\u8d85\u51fatexture\u5c3a\u5bf8")
  7377. };
  7378. b.checkAddEventListener = function (a, b, c, g, h) {
  7379. (null == b || void 0 == b) && d.Logger.fatal("addEventListener\u4fa6\u542c\u51fd\u6570\u4e0d\u80fd\u4e3a\u7a7a")
  7380. };
  7381. b.checkSetScaleGrid = function (a, b, c, g, h) {
  7382. a || d.Logger.fatal("Scale9Bitmap\u6ca1\u6709\u7eb9\u7406");
  7383. (0 > parseInt(b) || 0 > parseInt(c) || 0 > parseInt(g) || 0 > parseInt(h)) && d.Logger.fatal("\u4f20\u5165\u7684\u503c\u4e0d\u80fd\u4e3a\u8d1f\u6570");
  7384. a.getTextureWidth() < g + h && d.Logger.fatal("\u4f20\u5165\u7684\u5bbd\u5ea6\u8d85\u51fa\u8303\u56f4");
  7385. a.getTextureHeight() < b + c && d.Logger.fatal("\u4f20\u5165\u7684\u9ad8\u5ea6\u8d85\u51fa\u8303\u56f4")
  7386. };
  7387. b.TRACE_RENDER_LOOP = function (a) {
  7388. "undefined" === typeof a && (a = 0);
  7389. var b = d.Ticker.getInstance(), c = d.MainContext.instance;
  7390. switch (a) {
  7391. case 0:
  7392. b.unregister(c.renderLoop, c);
  7393. break;
  7394. case 1:
  7395. c.renderLoop();
  7396. break;
  7397. case 2:
  7398. b.register(c.renderLoop, c)
  7399. }
  7400. };
  7401. b.DRAW_IMAGE = !0;
  7402. b.ADD_EVENT_LISTENER = !0;
  7403. b.SCALE_BITMAP_SET_SCALE_GRID = !0;
  7404. return b
  7405. }();
  7406. d.DEBUG = c
  7407. })(ns_egret || (ns_egret = {}));
  7408. egret_h5 = {prefix: "", loadScript: function (d, c) {
  7409. var b = 0;
  7410. if (-1 < navigator.userAgent.indexOf("Trident/5")) {
  7411. var a = function () {
  7412. egret_h5.loadSingleScript(egret_h5.prefix + d[b], function () {
  7413. b++;
  7414. b >= d.length ? c() : a()
  7415. })
  7416. };
  7417. a()
  7418. } else d.forEach(function (a, f) {
  7419. egret_h5.loadSingleScript(egret_h5.prefix + a, function () {
  7420. b++;
  7421. b >= d.length && c()
  7422. })
  7423. })
  7424. }, loadSingleScript: function (d, c) {
  7425. var b = document.createElement("script");
  7426. b.hasOwnProperty("async") && (b.async = !1);
  7427. b.src = d;
  7428. b.addEventListener("load", function () {
  7429. this.removeEventListener("load",
  7430. arguments.callee, !1);
  7431. c()
  7432. }, !1);
  7433. document.body.appendChild(b)
  7434. }, startGame: function () {
  7435. var d = document.getElementById(ns_egret.StageDelegate.canvas_name);
  7436. context = ns_egret.MainContext.instance;
  7437. context.rendererContext = new ns_egret.HTML5CanvasRenderer(d);
  7438. context.touchContext = new ns_egret.TouchContext(d);
  7439. context.stage = new ns_egret.Stage;
  7440. ns_egret.ResourceLoader.prefix = "assets/480/";
  7441. ns_egret.RendererContext.CONTENT_SCALE_FACTOR = 1;
  7442. ns_egret.NetContext.context = new ns_egret.HTML5NetContext;
  7443. context.run();
  7444. app && app.startGame &&
  7445. app.startGame()
  7446. }, preloadScript: function (d, c) {
  7447. egret_h5.preloadList || (egret_h5.preloadList = []);
  7448. egret_h5.preloadList = egret_h5.preloadList.concat(d.map(function (b) {
  7449. return c + b
  7450. }))
  7451. }, startLoading: function () {
  7452. egret_h5.loadScript(egret_h5.preloadList, egret_h5.startGame)
  7453. }};
  7454. var __extends = this.__extends || function (d, c) {
  7455. function b() {
  7456. this.constructor = d
  7457. }
  7458. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  7459. b.prototype = c.prototype;
  7460. d.prototype = new b
  7461. }, GameApp = function () {
  7462. function d() {
  7463. }
  7464. d.prototype.startGame = function () {
  7465. MyInfo = new UserInfo;
  7466. MyInfo.statistics("enterGame");
  7467. this.initLoader();
  7468. ns_egret.SoundContext.context = new ns_egret.HTML5SoundContext;
  7469. var c = new ns_egret.EqualToFrame, b = ns_egret.Browser.getInstance().isMobile ? new ns_egret.FixedWidth : new ns_egret.FixedSize(480, 800), c = new ns_egret.ResolutionPolicy(c,
  7470. b);
  7471. ns_egret.StageDelegate.getInstance().setDesignSize(480, 800, c);
  7472. c = document.getElementById(ns_egret.StageDelegate.canvas_name);
  7473. ns_egret.MainContext.instance.stage.stageWidth = c.width;
  7474. ns_egret.MainContext.instance.stage.stageHeight = c.height;
  7475. ns_egret.NetContext.context = new ns_egret.HTML5NetContext;
  7476. ns_egret.ResourceLoader.prefix = "assets/400/";
  7477. c = new ns_egret.LoadingController;
  7478. c.addResource("ui_egretLogo.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7479. c.addResource("ui_notice_codename.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7480. c.addResource("ui_word_get_award.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7481. c.addResource("ui_word_get_award_2.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7482. c.addResource("ui_word_zaipao.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7483. c.addResource("ui_word_mi.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7484. c.addResource("ui_get_award.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7485. c.addResource("ui_award_1.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7486. c.addResource("ui_gift_1.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7487. c.addResource("ui_gift_2.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7488. c.addResource("ui_gift_3.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7489. c.addResource("ui_return_1.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7490. c.addResource("ui_reset_1.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7491. c.addResource("number.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7492. c.addResource("number.json", ns_egret.ResourceLoader.DATA_TYPE_TEXT);
  7493. c.addResource("combo_number.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7494. c.addResource("combo_number.json",
  7495. ns_egret.ResourceLoader.DATA_TYPE_TEXT);
  7496. c.addResource("ui_logo.png?v\x3d2", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7497. c.addResource("ui_chuzhan_1.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7498. c.addResource("ui_tanchuang_1.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7499. c.addResource("ui_chendi_1.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7500. c.addResource("ui_title_fail.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7501. c.addResource("ui_title_success.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7502. c.addResource("ui_title_1.png",
  7503. ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7504. c.addResource("ui_font_score.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7505. c.addResource("ui_font_best.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7506. c.addResource("role2.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7507. c.addResource("role2.json", ns_egret.ResourceLoader.DATA_TYPE_TEXT);
  7508. c.addResource("background.jpg?v\x3d2", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7509. c.addResource("wall.jpg?v\x3d3", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7510. c.addResource("roof.png?v\x3d2",
  7511. ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7512. c.addResource("bubble.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7513. c.addResource("ui_anger_bg.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7514. c.addResource("ui_score_bg.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7515. c.addResource("ui_progress.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7516. c.addResource("anger.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7517. c.addResource("qiao.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7518. c.addResource("bird.png?v\x3d2", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7519. c.addResource("bird.json?v\x3d2", ns_egret.ResourceLoader.DATA_TYPE_TEXT);
  7520. c.addResource("death.png?v\x3d2", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7521. c.addResource("death.json?v\x3d2", ns_egret.ResourceLoader.DATA_TYPE_TEXT);
  7522. c.addResource("maxAnger.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7523. c.addResource("maxAnger.json", ns_egret.ResourceLoader.DATA_TYPE_TEXT);
  7524. c.addResource("monkey.png?v\x3d2", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7525. c.addResource("monkey.json?v\x3d2", ns_egret.ResourceLoader.DATA_TYPE_TEXT);
  7526. c.addResource("monkeyRun.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7527. c.addResource("monkeyRun2.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7528. c.addResource("monkeyRun.json", ns_egret.ResourceLoader.DATA_TYPE_TEXT);
  7529. c.addResource("horizontalMonster.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7530. c.addResource("horizontalMonster.json", ns_egret.ResourceLoader.DATA_TYPE_TEXT);
  7531. c.addResource("hit.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7532. c.addResource("hit.json", ns_egret.ResourceLoader.DATA_TYPE_TEXT);
  7533. c.addResource("lianji.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7534. c.addResource("chendi_bg.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7535. c.addResource("jindutiao_1.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7536. c.addResource("jindutiao_2.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7537. c.addResource("ui_lucheng.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7538. c.addResource("ui_lucheng2.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7539. c.addResource("bananaAnger.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7540. c.addResource("ui_ninbenzhou.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7541. c.addResource("duihua-1.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7542. c.addResource("duihua-2.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7543. c.addResource("duihua-3.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7544. c.addResource("zilaiye.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7545. c.addResource("hand.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7546. Const.HAS_RANK ? (c.addResource("paihang.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE),
  7547. c.addResource("button-qianwangduihuan-1.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE), c.addResource("qingliuaia.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE), c.addResource("dewanjia.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE), c.addResource("nin.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE), c.addResource("mi_2.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE), c.addResource("gong.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE), c.addResource("jisha.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE), c.addResource("zhiguai.png",
  7548. ns_egret.ResourceLoader.DATA_TYPE_IMAGE), c.addResource("zongji.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE), c.addResource("fen.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE), c.addResource("cent.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE), c.addResource("mingren.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE)) : c.addResource("ui_mingren.png", ns_egret.ResourceLoader.DATA_TYPE_IMAGE);
  7549. c.setLoadingView(new LoadingUI);
  7550. c.addEventListener(ns_egret.ResourceLoader.LOAD_COMPLETE, this.resourceLoadComplete, this);
  7551. c.load()
  7552. };
  7553. d.prototype.initLoader = function () {
  7554. var c = function (b) {
  7555. function a(a) {
  7556. b.call(this, a, ns_egret.ResourceLoader.DATA_TYPE_TEXT)
  7557. }
  7558. __extends(a, b);
  7559. a.prototype.onLoadComplete = function (a) {
  7560. this.data = JSON.parse(a)
  7561. };
  7562. return a
  7563. }(ns_egret.ResourceLoader);
  7564. ns_egret.ResourceLoader.registerHandler("json", c)
  7565. };
  7566. d.prototype.resourceLoadComplete = function () {
  7567. var c = ns_egret.MainContext.instance.stage, b = utils.createBitmap("background.jpg");
  7568. c.addChild(b);
  7569. gameContainer = new ns_egret.DisplayObjectContainer;
  7570. c.addChild(gameContainer);
  7571. topContainer = new ns_egret.DisplayObjectContainer;
  7572. c.addChild(topContainer);
  7573. c = new StateMachine;
  7574. c.changeState(new LoginState);
  7575. this.stateMachine = c
  7576. };
  7577. d.prototype.restartGame = function () {
  7578. !this.stateMachine.state.angerContainer.maxAnger && (!this.role.isGod && this.role.canDeath) && (this.role.hasBuff ? this.role.removeBuff() : (system.hitTest.reset(), this.stateMachine.state.onDeath(), this.role.death(), 999999999 <= MyInfo.score && (MyInfo.statistics("pass100score"), localStorage.setItem("guide", "complete"))))
  7579. };
  7580. return d
  7581. }(), Const =
  7582. function () {
  7583. function d() {
  7584. }
  7585. d.ROLE_V_X = 5;
  7586. d.BIRD_V_X = 8;
  7587. d.G = 1;
  7588. d.HORIZON = 200;
  7589. d.JUMP_X = 10;
  7590. d.SHOW_AWARD_TICK = 600;
  7591. d.WALL_WIDTH = 70;
  7592. d.SLIVER_GIFT = 9999999;
  7593. d.GOLD_GIFT = 9999999;
  7594. d.COMBO_CANCEL_TIME = 1500;
  7595. d.CAMERA_SPEED = 10;
  7596. d.COMBO_MAX = 7;
  7597. d.SCORE_MAX = 1E3;
  7598. d.BUILDING_SCORE = 25;
  7599. d.BUILDING_AND_MONKEY_SCORE = 50;
  7600. d.FLYING_SCORE = 30;
  7601. d.VERTICAL_MONKEY_SCORE = 0;
  7602. d.HORIZONTAL_MONKEY_SCORE = 70;
  7603. d.SUPER_VERTICAL_MONKEY_SCORE = 100;
  7604. d.JUMP_MONKEY_SCORE = 400;
  7605. d.HAS_RANK = !0;
  7606. d.GUIDE_STOP_LIST = [1010, 2180, 3400, 4400];
  7607. return d
  7608. }(), utils;
  7609. (function (d) {
  7610. d.createBitmap = function (c) {
  7611. var b = new ns_egret.Bitmap;
  7612. c = ns_egret.TextureCache.getInstance().getTexture(c);
  7613. b.texture = c;
  7614. return b
  7615. };
  7616. d.scaleDialog = function (c) {
  7617. c.scaleX = c.scaleY = 0;
  7618. ns_egret.Tween.get(c).to({scaleX: 1, scaleY: 1}, 400, ns_egret.Ease.backOut)
  7619. };
  7620. d.createGift = function () {
  7621. return 99999999 > MyInfo.score ? d.createBitmap("ui_gift_1.png") : 99999999 > MyInfo.score ? d.createBitmap("ui_gift_2.png") : d.createBitmap("ui_gift_3.png")
  7622. };
  7623. d.addHitMC = function (c) {
  7624. var b = ns_egret.ResourceLoader.create("hit.json").data, a = ns_egret.TextureCache.getInstance().getTexture("hit.png"),
  7625. b = new ns_egret.MovieClip(b, a);
  7626. b.gotoAndPlay("run");
  7627. b.setInterval(2);
  7628. b.relativeAnchorPointX = b.relativeAnchorPointY = 0.5;
  7629. c = c.localToGlobal();
  7630. b.x = c.x - 40;
  7631. b.y = c.y - 20;
  7632. ns_egret.MainContext.instance.stage.addChild(b);
  7633. b.addEventListener("playComplete", function () {
  7634. this.stop();
  7635. this.parent.removeChild(this)
  7636. }, b)
  7637. }
  7638. })(utils || (utils = {}));
  7639. var StateMachine = function () {
  7640. function d() {
  7641. }
  7642. d.prototype.changeState = function (c) {
  7643. if (this.state)this.state.onExit();
  7644. c.onEnter();
  7645. this.state = c
  7646. };
  7647. return d
  7648. }(), State = function () {
  7649. function d() {
  7650. }
  7651. d.prototype.onEnter = function () {
  7652. };
  7653. d.prototype.onExit = function () {
  7654. };
  7655. return d
  7656. }(), GameState = function (d) {
  7657. function c() {
  7658. d.apply(this, arguments);
  7659. this._tick = 0;
  7660. this._isDeath = !1;
  7661. this.monsterMoveY = this.moveY = 0;
  7662. this._isFirstClick = this._guideBirdAdded = this._guideBuildingAdded = !1;
  7663. this._lastTime = 0
  7664. }
  7665. __extends(c, d);
  7666. c.prototype.onEnter = function () {
  7667. this._tick =
  7668. MyInfo.killNumber = 0;
  7669. var b = ns_egret.MainContext.instance.stage, a = new Background;
  7670. a.create();
  7671. a.add();
  7672. gameContainer.addChild(a.view);
  7673. this.role = new MainRole;
  7674. this.role.create();
  7675. this.role.add();
  7676. gameContainer.addChild(this.role.view);
  7677. app.role = this.role;
  7678. this.allCombo = new Combo;
  7679. topContainer = new ns_egret.DisplayObjectContainer;
  7680. b.addChild(topContainer);
  7681. this.initAnger();
  7682. this.initScore();
  7683. -1 != MyInfo.guideStep ? (this.angerContainer.onGetAnger(), this.angerContainer.onGetAnger(), null == this._guideUI && (this._guideUI =
  7684. new GuideUI, this._guideUI.y = b.stageHeight - 150), b.addChild(this._guideUI), this._guideUI.setText("\u5c0f\u5b50\uff01\u8981\u60f3\u6210\u4e3a\u4e00\u540d\u4f18\u79c0\u7684\u5fcd\u8005\uff0c\u9996\u5148\u8981\u8bad\u7ec3\u7684\u5c31\u662f\u6d1e\u5bdf\u529b\u548c\u53cd\u5e94\u529b\u3002"), this.role.mc.gotoAndStop("run"), b.addEventListener(ns_egret.TouchEvent.TOUCH_TAP, this.guideBeginClick, this)) : ns_egret.Ticker.getInstance().register(this.run, this)
  7685. };
  7686. c.prototype.guideBeginClick = function () {
  7687. var b = ns_egret.MainContext.instance.stage;
  7688. b.removeEventListener(ns_egret.TouchEvent.TOUCH_TAP, this.guideBeginClick, this);
  7689. ns_egret.Ticker.getInstance().register(this.run, this);
  7690. b.removeChild(this._guideUI);
  7691. this.role.mc.gotoAndPlay("run")
  7692. };
  7693. c.prototype.addMonkey = function (b, a) {
  7694. var c = JSON.parse(ns_egret.ResourceLoader.create("monkey.json?v\x3d2").data), d = ns_egret.TextureCache.getInstance().getTexture("monkey.png"), c = new Monkey(c, d), d = c.view.getBounds();
  7695. b < ns_egret.MainContext.instance.stage.stageWidth / 2 ? c.view.x = d.width / 6 : (c.view.x = ns_egret.MainContext.instance.stage.stageWidth -
  7696. d.width / 6, c.view.scaleX = -1);
  7697. c.view.y = a - d.height / 2.5;
  7698. c.add()
  7699. };
  7700. c.prototype.initAnger = function () {
  7701. var b = ns_egret.MainContext.instance.stage;
  7702. this.angerContainer = new AngerContainer;
  7703. topContainer.addChild(this.angerContainer);
  7704. this.angerContainer.y = b.stageHeight - 100
  7705. };
  7706. c.prototype.initScore = function () {
  7707. var b = utils.createBitmap("ui_score_bg.png"), a = utils.createBitmap("ui_lucheng.png");
  7708. b.x = 100;
  7709. b.y = 65;
  7710. a.x = 95;
  7711. a.y = 63;
  7712. topContainer.addChild(b);
  7713. topContainer.addChild(a);
  7714. this.currentScoreFont = new UIFont(MyInfo.score);
  7715. this.currentScoreFont.scaleX = this.currentScoreFont.scaleY = 0.4;
  7716. this.currentScoreFont.x = b.x;
  7717. this.currentScoreFont.y = b.y + 15;
  7718. topContainer.addChild(this.currentScoreFont);
  7719. this.progress = new ns_egret.ProgressBar("ui_lucheng2.png");
  7720. this.progress.x = b.x + 58;
  7721. this.progress.y = b.y + 20;
  7722. this.progress.setProgress(0, 100);
  7723. topContainer.addChild(this.progress);
  7724. a = utils.createBitmap("ui_gift_1.png");
  7725. a.scaleX = a.scaleY = 0.2;
  7726. a.x = b.x + 55;
  7727. a.y = b.y + -15;
  7728. topContainer.addChild(a);
  7729. a = new UIFont(100);
  7730. a.scaleX = a.scaleY = 0.25;
  7731. a.x = b.x + 60;
  7732. a.y =
  7733. b.y + 30;
  7734. topContainer.addChild(a);
  7735. a = utils.createBitmap("ui_gift_2.png");
  7736. a.scaleX = a.scaleY = 0.2;
  7737. a.x = b.x + 115;
  7738. a.y = b.y + -15;
  7739. topContainer.addChild(a);
  7740. a = new UIFont(300);
  7741. a.scaleX = a.scaleY = 0.25;
  7742. a.x = b.x + 120;
  7743. a.y = b.y + 30;
  7744. topContainer.addChild(a);
  7745. a = utils.createBitmap("ui_gift_3.png");
  7746. a.scaleX = a.scaleY = 0.2;
  7747. a.x = b.x + 240;
  7748. a.y = b.y + -15;
  7749. topContainer.addChild(a);
  7750. a = new UIFont(1E3, 4);
  7751. a.scaleX = a.scaleY = 0.25;
  7752. a.x = b.x + 240;
  7753. a.y = b.y + 30;
  7754. topContainer.addChild(a)
  7755. };
  7756. c.prototype.onGetAnger = function () {
  7757. this.angerContainer.onGetAnger()
  7758. };
  7759. c.prototype.onGetBanana =
  7760. function () {
  7761. this.angerContainer.onGetBanana()
  7762. };
  7763. c.prototype.onCombo = function () {
  7764. this.allCombo.onCombo()
  7765. };
  7766. c.prototype.resetCombo = function () {
  7767. this.allCombo.resetCombo()
  7768. };
  7769. c.prototype.run = function (b) {
  7770. this.allCombo.addCombotime(b);
  7771. this.allCombo.getComboTime() >= Const.COMBO_CANCEL_TIME && this.allCombo.comboReset();
  7772. for (this._lastTime += b; this._lastTime > 1E3 / 60;) {
  7773. this._lastTime -= 1E3 / 60;
  7774. system.render.run();
  7775. if (this._isDeath)system.render.onCameraMove(-Const.CAMERA_SPEED); else if (b = Const.CAMERA_SPEED, b = Const.CAMERA_SPEED +
  7776. Math.floor(this.moveY / 2E4), 15 < b && (b = 15), app.role.isGod && (b *= 2), system.render.onCameraMove(b), this.moveY += b, this.monsterMoveY += 10, this.addMonster(), -1 != MyInfo.guideStep) {
  7777. b = ns_egret.MainContext.instance.stage;
  7778. var a = Const.GUIDE_STOP_LIST[MyInfo.guideStep - 1], a = a - (800 - b.stageHeight);
  7779. this.moveY >= a && (ns_egret.Ticker.getInstance().unregister(app.stateMachine.state.run, app.stateMachine.state), ns_egret.MainContext.instance.stage.addEventListener(ns_egret.TouchEvent.TOUCH_TAP, this.guideJump, this), this.role.mc.gotoAndStop("run"),
  7780. b.addChild(this._guideUI), this._isFirstClick = !0, 1 == MyInfo.guideStep ? this._guideUI.setText("\u6ce8\u610f\uff01\u649e\u5230\u5c4b\u6a90\u4f1a\u6389\u4e0b\u6765\u3002\u9700\u8981\u70b9\u51fb\u5c4f\u5e55\u8df3\u8dc3\u6765\u8eb2\u907f\u5c4b\u6a90\u3002") : 2 == MyInfo.guideStep ? this._guideUI.setText("\u7334\u5b50\u53ef\u662f\u4e2a\u8ba8\u538c\u7684\u5bb6\u4f19\uff0c\u4f60\u53ef\u4ee5\u8df3\u8fc7\u53bb\u51fb\u6740\u4ed6\u4eec\u3002") : 3 == MyInfo.guideStep ? this._guideUI.setText("\u51fb\u6740\u98de\u602a\u53ef\u4ee5\u5f97\u5230\u52fe\u7389\uff0c\u6512\u591f\u8db3\u591f\u7684\u52fe\u7389\u53ef\u4ee5\u91ca\u653e\u5965\u4e49\u3002") :
  7781. 4 == MyInfo.guideStep && (this._guideUI.setText("\u597d\u4e86\uff0c\u57fa\u672c\u6559\u5b66\u5c31\u5230\u8fd9\u91cc\u4e86\uff0c\u63a5\u4e0b\u6765\u5c31\u770b\u4f60\u7684\u4e86\u3002"), this._isFirstClick = !1))
  7782. }
  7783. this._tick++;
  7784. MyInfo.score >= Const.SCORE_MAX && (Const.HAS_RANK && MyInfo.score ? (app.stateMachine.changeState(new InputState), app.stateMachine.state.onAdd()) : app.stateMachine.changeState(new ResultState))
  7785. }
  7786. this._isDeath || MyInfo.setScore(this._tick / 20);
  7787. this.currentScoreFont.updateText(MyInfo.score);
  7788. this.progress.setProgress(MyInfo.score,
  7789. Const.SCORE_MAX)
  7790. };
  7791. c.prototype.guideJump = function () {
  7792. var b = ns_egret.MainContext.instance.stage;
  7793. this._isFirstClick ? (this._isFirstClick = !1, ns_egret.MainContext.instance.stage.removeChild(this._guideUI), null == this._hand && (this._hand = utils.createBitmap("hand.png"), this._hand.x = 200, this._hand.y = b.stageHeight - 270), ns_egret.Tween.get(this._hand, {loop: !0}).to({scaleX: 0.7, scaleY: 0.7}, 600).to({scaleX: 1, scaleY: 1}, 600), b.addChild(this._hand)) : (this._hand.scaleX = this._hand.scaleY = 1, ns_egret.Tween.removeTweens(this._hand),
  7794. this._hand.isRunning() ? b.removeChild(this._hand) : this._guideUI.isRunning() && ns_egret.MainContext.instance.stage.removeChild(this._guideUI), b.removeEventListener(ns_egret.TouchEvent.TOUCH_TAP, this.guideJump, this), MyInfo.setGuideStep(MyInfo.guideStep + 1), ns_egret.Ticker.getInstance().register(this.run, this), -1 != MyInfo.guideStep ? this.role.jump() : this.role.mc.gotoAndPlay("run"))
  7795. };
  7796. c.prototype.addMonster = function () {
  7797. if (1 == MyInfo.guideStep && !this._guideBuildingAdded) {
  7798. this._guideBuildingAdded = !0;
  7799. var b = new Building("roof.png"),
  7800. a = b.view.getBounds();
  7801. b.view.scaleX = -0.7;
  7802. b.view.scaleY = 0.7;
  7803. b.view.x = 0.7 * a.width;
  7804. b.view.y = -150;
  7805. b.add()
  7806. } else if (3 == MyInfo.guideStep && !this._guideBirdAdded)this._guideBirdAdded = !0, b = JSON.parse(ns_egret.ResourceLoader.create("bird.json?v\x3d2").data), a = ns_egret.TextureCache.getInstance().getTexture("bird.png"), b = new Bird(b, a), b.view.x = -100, b.view.y = -300, b.add(); else {
  7807. var b;
  7808. 0 == this.monsterMoveY % 1500 && MyInfo.score >= Const.BUILDING_SCORE && (b = new Building("roof.png"), a = b.view.getBounds(), 0.5 > Math.random() ? (b.view.scaleX =
  7809. 0.7, b.view.scaleY = 0.7, b.view.x = ns_egret.MainContext.instance.stage.stageWidth - 0.7 * a.width) : (b.view.scaleX = -0.7, b.view.scaleY = 0.7, b.view.x = 0.7 * a.width), b.view.y = -150, b.add(), 0.5 < Math.random() && MyInfo.score >= Const.BUILDING_AND_MONKEY_SCORE && this.addMonkey(b.view.x, b.view.y));
  7810. 0 == this.monsterMoveY % 3200 && MyInfo.score >= Const.FLYING_SCORE && (b = JSON.parse(ns_egret.ResourceLoader.create("bird.json?v\x3d2").data), a = ns_egret.TextureCache.getInstance().getTexture("bird.png"), b = new Bird(b, a), b.view.x = -100, b.view.y = -300, b.add());
  7811. 0 == this.monsterMoveY % 15E3 && (b = new Bubble, b.view.x = 150 * Math.random() + 100, b.view.y = -300, b.add());
  7812. var c, a = 1400;
  7813. 300 < MyInfo.score && (a = 1100 - Math.floor(MyInfo.score / Const.CAMERA_SPEED) * Const.CAMERA_SPEED);
  7814. 0 == this.monsterMoveY % a && (c = [], MyInfo.score >= Const.VERTICAL_MONKEY_SCORE && c.push("vertical"), MyInfo.score >= Const.SUPER_VERTICAL_MONKEY_SCORE && c.push("super"), MyInfo.score >= Const.HORIZONTAL_MONKEY_SCORE && c.push("horizontal"), MyInfo.score >= Const.JUMP_MONKEY_SCORE && c.push("jumpMonster"));
  7815. c && 0 !=
  7816. c.length && (c = c[Math.floor(Math.random() * c.length)], "vertical" == c ? (b = ns_egret.ResourceLoader.create("monkeyRun.json").data, a = ns_egret.TextureCache.getInstance().getTexture("monkeyRun.png"), b = new Monster(b, a)) : "super" == c ? (b = ns_egret.ResourceLoader.create("monkeyRun.json").data, a = ns_egret.TextureCache.getInstance().getTexture("monkeyRun2.png"), b = new SuperMonster(b, a)) : "jumpMonster" == c ? (b = ns_egret.ResourceLoader.create("monkeyRun.json").data, a = ns_egret.TextureCache.getInstance().getTexture("monkeyRun.png"),
  7817. b = new JumpMonster(b, a)) : "horizontal" == c ? (b = ns_egret.ResourceLoader.create("horizontalMonster.json").data, a = ns_egret.TextureCache.getInstance().getTexture("horizontalMonster.png"), b = new HorizontalMonster(b, a), c = new Bridge, c.view.y = -275, c.add()) : "flying" == c && (b = ns_egret.ResourceLoader.create("bird.json").data, a = ns_egret.TextureCache.getInstance().getTexture("bird.png"), b = new Bird(b, a), b.view.x = -100), b && (b.view.y = -300, b.add()))
  7818. }
  7819. };
  7820. c.prototype.onDeath = function () {
  7821. this._isDeath = !0
  7822. };
  7823. c.prototype.onExit = function () {
  7824. ns_egret.Ticker.getInstance().unregister(this.run,
  7825. this);
  7826. system.render.reset();
  7827. system.hitTest.reset();
  7828. this.role.view.visible = !1;
  7829. gameContainer.removeAllChildren();
  7830. topContainer.removeAllChildren()
  7831. };
  7832. return c
  7833. }(State), LoginState = function (d) {
  7834. function c() {
  7835. d.apply(this, arguments)
  7836. }
  7837. __extends(c, d);
  7838. c.prototype.onEnter = function () {
  7839. var b = new LoginUI;
  7840. BoxManager.getInstance().addBox(b);
  7841. this.login = b
  7842. };
  7843. c.prototype.onExit = function () {
  7844. BoxManager.getInstance().removeBox(this.login)
  7845. };
  7846. return c
  7847. }(State), InputState = function (d) {
  7848. function c() {
  7849. d.apply(this, arguments)
  7850. }
  7851. __extends(c,
  7852. d);
  7853. c.prototype.onEnter = function () {
  7854. var b = new NameInputUI;
  7855. BoxManager.getInstance().addBox(b);
  7856. b.y = 40 + (ns_egret.MainContext.instance.stage.stageHeight - 550 >> 1);
  7857. this.input = b
  7858. };
  7859. c.prototype.onAdd = function () {
  7860. this.input.add(MyInfo.score, MyInfo.killNumber)
  7861. };
  7862. c.prototype.onExit = function () {
  7863. BoxManager.getInstance().removeBox(this.input)
  7864. };
  7865. return c
  7866. }(State), ResultState = function (d) {
  7867. function c() {
  7868. d.apply(this, arguments)
  7869. }
  7870. __extends(c, d);
  7871. c.prototype.onEnter = function () {
  7872. this.current = new FailUI;
  7873. BoxManager.getInstance().addBox(this.current)
  7874. };
  7875. c.prototype.onExit = function () {
  7876. this.current.parent && BoxManager.getInstance().removeBox(this.current);
  7877. BoxManager.getInstance().clearAllBox()
  7878. };
  7879. return c
  7880. }(State), app = new GameApp, UserInfo = function () {
  7881. function d() {
  7882. this.killNumber = this.bestScore = this.score = this.currentWeek = 0;
  7883. this.serverAddress = "http://ninjaup.egret-labs.org/api.php";
  7884. this.secret = "#kjutg98@aa";
  7885. this._statisticsList = [];
  7886. this.guideStep = -1;
  7887. null == localStorage.getItem("guide") && (this.guideStep =
  7888. 1)
  7889. }
  7890. d.prototype.setGuideStep = function (c) {
  7891. this.guideStep = c;
  7892. c > Const.GUIDE_STOP_LIST.length && (this.guideStep = -1)
  7893. };
  7894. d.prototype.setScore = function (c) {
  7895. this.score = Math.floor(c);
  7896. this.score > this.bestScore && (this.bestScore = this.score)
  7897. };
  7898. d.prototype.addKill = function () {
  7899. this.killNumber++
  7900. };
  7901. d.prototype.statistics = function (c) {
  7902. -1 == this._statisticsList.indexOf(c) && (this._statisticsList.push(c), c = "http://ninjaup.egret-labs.org/statistics.php?gId\x3dninja_up\x26act\x3d" + c + "\x26sign\x3d" + hex_md5("ninja_up" + c + this.secret),
  7903. c = new ns_egret.URLRequest(c, function () {
  7904. }, this), ns_egret.NetContext.getInstance().send(c))
  7905. };
  7906. return d
  7907. }(), Combo = function (d) {
  7908. function c() {
  7909. this.initCombo();
  7910. this.comboTime = this.combo = 0;
  7911. this.initComboProgress();
  7912. this.role = app.role
  7913. }
  7914. __extends(c, d);
  7915. c.prototype.initCombo = function () {
  7916. this.comboContainer = new ns_egret.DisplayObjectContainer;
  7917. gameContainer.addChild(this.comboContainer);
  7918. var b = utils.createBitmap("lianji.png"), a = utils.createBitmap("chendi_bg.png");
  7919. b.y = a.getBounds().height / 4;
  7920. this.comboContainer.addChild(a);
  7921. this.comboContainer.addChild(b);
  7922. this.combo = 0;
  7923. this.comboFont = new ComboFont(this.combo);
  7924. this.comboContainer.addChild(this.comboFont);
  7925. this.comboFont.x = 2 * a.getBounds().width / 5;
  7926. this.comboFont.y = a.getBounds().height / 4;
  7927. this.comboFont.scaleX = 0.8;
  7928. this.comboFont.scaleY = 0.8;
  7929. this.comboContainer.visible = !1;
  7930. this.comboContainer.x = 0;
  7931. this.comboContainer.y = 110
  7932. };
  7933. c.prototype.initComboProgress = function () {
  7934. this.comboProgressContainer = new ns_egret.DisplayObjectContainer;
  7935. this.comboProgressBar = new ns_egret.ProgressBar("jindutiao_2.png",
  7936. "jindutiao_1.png");
  7937. this.comboProgressBar.setProgress(this.combo, Const.COMBO_MAX);
  7938. this.comboProgressContainer.addChild(this.comboProgressBar);
  7939. gameContainer.addChild(this.comboProgressContainer);
  7940. this.comboProgressContainer.y = this.comboContainer.y + 3 * this.comboContainer.getBounds().height / 4;
  7941. this.comboProgressContainer.x = -this.comboProgressContainer.getBounds().width
  7942. };
  7943. c.prototype.onCombo = function () {
  7944. if (!this.role._isDead && !this.role.isGod) {
  7945. this.comboTime = 0;
  7946. this.combo += 1;
  7947. if (1 < this.combo) {
  7948. var b = this.comboContainer.getBounds().width;
  7949. this.comboFont.updateText(this.combo);
  7950. 10 > this.comboFont.getValue() ? this.comboFont.x = 2 * b / 5 : this.comboFont.x = b / 5;
  7951. this.comboContainer.visible = !0;
  7952. 2 < this.combo && (ns_egret.Tween.removeTweens(this.comboContainer), ns_egret.Tween.get(this.comboContainer).to({scaleX: 1.2, scaleY: 1.2}, 100).to({scaleX: 1, scaleY: 1}, 100));
  7953. ns_egret.Tween.removeTweens(this.comboProgressContainer);
  7954. ns_egret.Tween.get(this.comboProgressContainer).to({x: 0}, 300);
  7955. ns_egret.Tween.removeTweens(this.comboProgressBar);
  7956. ns_egret.Tween.get(this.comboProgressBar).to({percentage: 100 *
  7957. this.combo / Const.COMBO_MAX}, 300)
  7958. }
  7959. this.combo == Const.COMBO_MAX && (this.role.beGod(), this.combo = 0, ns_egret.Tween.removeTweens(this.comboProgressBar), ns_egret.Tween.get(this.comboProgressBar).to({percentage: 100}, 1E3))
  7960. }
  7961. };
  7962. c.prototype.resetCombo = function () {
  7963. this.comboContainer.visible = !1;
  7964. this.comboProgressContainer.visible = !1;
  7965. this.combo -= 1
  7966. };
  7967. c.prototype.addCombotime = function (b) {
  7968. this.comboTime += b
  7969. };
  7970. c.prototype.comboReset = function () {
  7971. this.combo = this.comboTime = 0;
  7972. this.comboContainer.visible = !1;
  7973. ns_egret.Tween.get(this.comboProgressContainer).to({x: -this.comboProgressContainer.getBounds().width},
  7974. 300);
  7975. ns_egret.Tween.get(this.comboProgressBar).to({percentage: 100 * this.combo / Const.COMBO_MAX}, 300)
  7976. };
  7977. c.prototype.getComboTime = function () {
  7978. return this.comboTime
  7979. };
  7980. return c
  7981. }(ns_egret.DisplayObjectContainer);
  7982. var __extends = this.__extends || function (d, c) {
  7983. function b() {
  7984. this.constructor = d
  7985. }
  7986. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  7987. b.prototype = c.prototype;
  7988. d.prototype = new b
  7989. }, GameObject = function () {
  7990. function d() {
  7991. }
  7992. d.prototype.run = function () {
  7993. };
  7994. d.prototype.create = function () {
  7995. };
  7996. d.prototype.getHitBounds = function () {
  7997. return ns_egret.DisplayObject.getTransformBounds(this.view.getBounds(), this.view.worldTransform)
  7998. };
  7999. d.prototype.add = function () {
  8000. system.render.add(this)
  8001. };
  8002. d.prototype.remove = function () {
  8003. this._isDead = !0;
  8004. app.stateMachine.state.onCombo()
  8005. };
  8006. d.prototype.onCameraMove = function (c) {
  8007. };
  8008. d.prototype.checkAdd = function () {
  8009. -200 < this.view.y && null == this.view.parent ? (gameContainer.addChild(this.view), system.hitTest.addHitList(this)) : null != this.view.parent && this.view.y > ns_egret.MainContext.instance.stage.stageHeight + 200 && (this.view.visible = !1, system.hitTest.removeHitList(this))
  8010. };
  8011. return d
  8012. }(), MainRole = function (d) {
  8013. function c() {
  8014. d.apply(this, arguments);
  8015. this._vy = this._vx = 0;
  8016. this.canDeath = !0;
  8017. this.isBack = this.godJumping = this.isGod = this.hasBuff = !1
  8018. }
  8019. __extends(c,
  8020. d);
  8021. c.prototype.create = function () {
  8022. this.container = new ns_egret.DisplayObjectContainer;
  8023. var b = ns_egret.ResourceLoader.create("role2.json").data, a = ns_egret.TextureCache.getInstance().getTexture("role2.png");
  8024. this.mc = new ns_egret.MovieClip(b, a);
  8025. this.mc.relativeAnchorPointX = this.mc.relativeAnchorPointY = 0.5;
  8026. this.mc.setInterval(6);
  8027. this.container.addChild(this.mc);
  8028. this.view = this.container;
  8029. this.view.y = ns_egret.MainContext.instance.stage.stageHeight - Const.HORIZON;
  8030. this.view.x = Const.WALL_WIDTH;
  8031. this.changeAction("run");
  8032. ns_egret.Ticker.getInstance().callLater(this.addEvent, this)
  8033. };
  8034. c.prototype.addEvent = function () {
  8035. ns_egret.MainContext.instance.stage.addEventListener(ns_egret.TouchEvent.TOUCH_BEGAN, this.onTouch, this)
  8036. };
  8037. c.prototype.onTouch = function () {
  8038. this.isGod || -1 != MyInfo.guideStep || this.jump()
  8039. };
  8040. c.prototype.run = function () {
  8041. if (!this._isDead) {
  8042. for (var b = system.hitTest.hitTest(this), a = 0; a < b.length; a++)b[a].remove();
  8043. this.move()
  8044. }
  8045. };
  8046. c.prototype.beGod = function () {
  8047. !0 != this.isGod && (this.isGod = !0, this._vx = 0, ns_egret.Tween.get(this.view).to({x: Const.WALL_WIDTH},
  8048. 100).call(this.godJump, this))
  8049. };
  8050. c.prototype.beNormal = function () {
  8051. this._vx = this._vy = 0;
  8052. this.isBack = !0;
  8053. ns_egret.Tween.get(this.view).to({x: Const.WALL_WIDTH, y: ns_egret.MainContext.instance.stage.stageHeight - Const.HORIZON}, 1E3).call(this.lateBeNormal, this)
  8054. };
  8055. c.prototype.lateBeNormal = function () {
  8056. this.changeAction("run");
  8057. this.isBack = this.godJumping = !1;
  8058. this.view.scaleX = 1;
  8059. this.canDeath = this.isGod = !1;
  8060. ns_egret.Ticker.getInstance().callLater(this.notbegod, this, 1E3)
  8061. };
  8062. c.prototype.notbegod = function () {
  8063. this.canDeath = !0
  8064. };
  8065. c.prototype.godJump = function () {
  8066. this._vx = Const.JUMP_X;
  8067. this.godJumping = !0;
  8068. this.changeAction("jump")
  8069. };
  8070. c.prototype.move = function () {
  8071. if (this.godJumping)this.isBack || (150 > this.view.y && this.beNormal(), this.view.x += this._vx, this.view.x < Const.WALL_WIDTH ? (this._vx = Const.JUMP_X, this._vy = 0) : this.view.x > ns_egret.MainContext.instance.stage.stageWidth - Const.WALL_WIDTH && (this._vx = -Const.JUMP_X, this._vy = 0), this.view.y += this._vy, this._vy -= 0.1); else {
  8072. this.view.x += this._vx;
  8073. this.view.x < Const.WALL_WIDTH ? (this.view.x =
  8074. Const.WALL_WIDTH, this._vx = 0, this.view.scaleX = 1, this.changeAction("run")) : this.view.x > ns_egret.MainContext.instance.stage.stageWidth - Const.WALL_WIDTH && (this.view.x = ns_egret.MainContext.instance.stage.stageWidth - Const.WALL_WIDTH, this._vx = 0, this.view.scaleX = -1, this.changeAction("run"));
  8075. var b;
  8076. b = this.view.x < ns_egret.MainContext.instance.stage.stageWidth / 2 ? this.view.x - Const.WALL_WIDTH : Math.abs(this.view.x - ns_egret.MainContext.instance.stage.stageWidth + Const.WALL_WIDTH);
  8077. this.view.y = ns_egret.MainContext.instance.stage.stageHeight -
  8078. Const.HORIZON - b / 3
  8079. }
  8080. };
  8081. c.prototype.jump = function () {
  8082. this.view.x == Const.WALL_WIDTH ? (this._vx = Const.JUMP_X, this.changeAction("jump")) : this.view.x == ns_egret.MainContext.instance.stage.stageWidth - Const.WALL_WIDTH && (this._vx = -Const.JUMP_X, this.changeAction("jump"))
  8083. };
  8084. c.prototype.stop = function () {
  8085. };
  8086. c.prototype.death = function () {
  8087. app.stateMachine.state.resetCombo();
  8088. this.changeAction("death");
  8089. this._isDead = !0;
  8090. this._vx = 0;
  8091. var b = ns_egret.MainContext.instance.stage;
  8092. b.removeEventListener(ns_egret.TouchEvent.TOUCH_BEGAN,
  8093. this.onTouch, this);
  8094. ns_egret.Tween.get(this.view).to({x: b.stageWidth / 2, y: 8 * b.stageHeight / 10}, 600);
  8095. var b = JSON.parse(ns_egret.ResourceLoader.create("death.json?v\x3d2").data), a = ns_egret.TextureCache.getInstance().getTexture("death.png"), b = new ns_egret.MovieClip(b, a), a = this.view.localToGlobal();
  8096. b.x = a.x;
  8097. b.y = a.y;
  8098. b.relativeAnchorPointX = b.relativeAnchorPointY = 0.5;
  8099. gameContainer.addChild(b);
  8100. b.gotoAndPlay("run");
  8101. b.addEventListener("playComplete", function () {
  8102. this.stop();
  8103. this.parent.removeChild(this)
  8104. }, b);
  8105. ns_egret.Ticker.getInstance().callLater(function () {
  8106. Const.HAS_RANK &&
  8107. MyInfo.score ? (app.stateMachine.changeState(new InputState), app.stateMachine.state.onAdd()) : app.stateMachine.changeState(new ResultState)
  8108. }, this, 1500)
  8109. };
  8110. c.prototype.remove = function () {
  8111. };
  8112. c.prototype.changeAction = function (b) {
  8113. this._isDead || ("run" == b ? this.view.setContentSize(110, 80) : "jump" == b && this.view.setContentSize(150, 80), this.mc.gotoAndPlay(b))
  8114. };
  8115. c.prototype.getHitBounds = function () {
  8116. return 0 < this._vx ? ns_egret.Rectangle.identity.initialize(this.view.worldTransform.tx - this.view._contentWidth * this.mc.relativeAnchorPointX,
  8117. this.view.worldTransform.ty - this.view._contentHeight * this.mc.relativeAnchorPointY, this.view._contentWidth, this.view._contentHeight + 10) : ns_egret.Rectangle.identity.initialize(this.view.worldTransform.tx - this.view._contentWidth * this.mc.relativeAnchorPointX, this.view.worldTransform.ty - this.view._contentHeight * this.mc.relativeAnchorPointY, this.view._contentWidth, this.view._contentHeight)
  8118. };
  8119. c.prototype.addBuff = function () {
  8120. this.hasBuff = !0;
  8121. null == this.bubble && (this.bubble = utils.createBitmap("bubble.png"), this.bubble.scaleX =
  8122. this.bubble.scaleY = 0.5, this.bubble.relativeAnchorPointX = this.bubble.relativeAnchorPointY = 0.5);
  8123. this.bubble.parent || this.container.addChild(this.bubble)
  8124. };
  8125. c.prototype.removeBuff = function () {
  8126. this.hasBuff = !1;
  8127. this.container.removeChild(this.bubble)
  8128. };
  8129. return c
  8130. }(GameObject), Bubble = function (d) {
  8131. function c() {
  8132. var b = utils.createBitmap("bubble.png");
  8133. b.scaleX = b.scaleY = 0.5;
  8134. this.view = b
  8135. }
  8136. __extends(c, d);
  8137. c.prototype.onCameraMove = function (b) {
  8138. this.view.y += b;
  8139. this.checkAdd()
  8140. };
  8141. c.prototype.remove = function () {
  8142. system.hitTest.removeHitList(this);
  8143. this.view.visible = !1;
  8144. app.role.addBuff()
  8145. };
  8146. return c
  8147. }(GameObject), Background = function (d) {
  8148. function c() {
  8149. d.apply(this, arguments)
  8150. }
  8151. __extends(c, d);
  8152. c.prototype.create = function () {
  8153. var b = new ns_egret.DisplayObjectContainer, a = new ns_egret.DisplayObjectContainer;
  8154. b.addChild(a);
  8155. for (var c = -3; 228 > c; c++) {
  8156. var d = utils.createBitmap("wall.jpg"), g = d.getBounds();
  8157. d.x = ns_egret.MainContext.instance.stage.stageWidth - g.width + 20;
  8158. d.y = -c * d.getBounds().height;
  8159. a.addChild(d);
  8160. d = utils.createBitmap("wall.jpg");
  8161. d.x = g.width - 20;
  8162. d.y = -c * g.height;
  8163. d.scaleX = -1;
  8164. a.addChild(d)
  8165. }
  8166. this.view = b;
  8167. this.wall = a
  8168. };
  8169. c.prototype.onCameraMove = function (b) {
  8170. this.wall.y += 2 * b / 5
  8171. };
  8172. c.prototype.run = function () {
  8173. };
  8174. return c
  8175. }(GameObject), Building = function (d) {
  8176. function c(b) {
  8177. this.view = utils.createBitmap(b)
  8178. }
  8179. __extends(c, d);
  8180. c.prototype.onCameraMove = function (b) {
  8181. this.view.y += 2 * b / 5;
  8182. this.checkAdd()
  8183. };
  8184. c.prototype.remove = function () {
  8185. 0 == app.role._vx && (system.hitTest.removeHitList(this), app.restartGame())
  8186. };
  8187. c.prototype.getHitBounds = function () {
  8188. return 0 < this.view.scaleX ? ns_egret.Rectangle.identity.initialize(this.view.worldTransform.tx +
  8189. 40, this.view.worldTransform.ty + 30, 70, 10) : ns_egret.Rectangle.identity.initialize(this.view.worldTransform.tx - 110, this.view.worldTransform.ty + 30, 70, 10)
  8190. };
  8191. return c
  8192. }(GameObject), Monster = function (d) {
  8193. function c(b, a) {
  8194. c.addNumber++;
  8195. var d = new ns_egret.MovieClip(b, a);
  8196. d.gotoAndPlay("run");
  8197. d.setInterval(5);
  8198. d.relativeAnchorPointY = 0.5;
  8199. this._mc = this.view = d;
  8200. -1 != MyInfo.guideStep && 1 == c.addNumber ? this.setLeft() : 0.5 > Math.random() ? this.setRight() : this.setLeft()
  8201. }
  8202. __extends(c, d);
  8203. c.prototype.setLeft = function () {
  8204. this._mc.x =
  8205. Const.WALL_WIDTH;
  8206. this._mc.scaleX = 0.5;
  8207. this._mc.scaleY = 0.5;
  8208. this._mc.rotation = 90
  8209. };
  8210. c.prototype.setRight = function () {
  8211. this._mc.x = ns_egret.MainContext.instance.stage.stageWidth - Const.WALL_WIDTH;
  8212. this._mc.scaleX = -0.5;
  8213. this._mc.scaleY = 0.5;
  8214. this._mc.rotation = 270
  8215. };
  8216. c.prototype.onCameraMove = function (b) {
  8217. this.view.y += 4 * b / 5;
  8218. this.checkAdd()
  8219. };
  8220. c.prototype.getHitBounds = function () {
  8221. return 90 == this.view.rotation ? ns_egret.Rectangle.identity.initialize(this.view.worldTransform.tx - 60, this.view.worldTransform.ty + 10, 50, 50) : ns_egret.Rectangle.identity.initialize(this.view.worldTransform.tx,
  8222. this.view.worldTransform.ty, 50, 50)
  8223. };
  8224. c.prototype.remove = function () {
  8225. d.prototype.remove.call(this);
  8226. system.hitTest.removeHitList(this);
  8227. 0 != app.role._vx ? (this.view.visible = !1, MyInfo.addKill(), utils.addHitMC(this.view)) : (this.view.visible = !1, app.restartGame())
  8228. };
  8229. c.addNumber = 0;
  8230. return c
  8231. }(GameObject), SuperMonster = function (d) {
  8232. function c() {
  8233. d.apply(this, arguments);
  8234. this._isUp = !1
  8235. }
  8236. __extends(c, d);
  8237. c.prototype.onCameraMove = function (b) {
  8238. this._isUp ? this.view.y -= 1.1 * b : (this.view.y += 0.8 * b, this.view.y > ns_egret.MainContext.instance.stage.stageHeight +
  8239. 150 && (this._isUp = !0, this.view.scaleX *= -1));
  8240. this.checkAdd()
  8241. };
  8242. return c
  8243. }(Monster), JumpMonster = function (d) {
  8244. function c(b, a) {
  8245. d.call(this, b, a);
  8246. this.vy = this.vx = 0;
  8247. this.jumpedOver = this.jumped = !1;
  8248. this.jumpHigh = 150;
  8249. this.isStand = !1;
  8250. this._mc.scaleX *= 0.8;
  8251. this._mc.scaleY *= 0.8
  8252. }
  8253. __extends(c, d);
  8254. c.prototype.jump = function () {
  8255. this.jumped = !0;
  8256. this.vy = this.tempVy;
  8257. this.view.x == Const.WALL_WIDTH ? (this.vx = Const.JUMP_X, this.view.rotation = 0, this._mc.gotoAndPlay("jump")) : this.view.x == ns_egret.MainContext.instance.stage.stageWidth -
  8258. Const.WALL_WIDTH && (this.vx = -Const.JUMP_X, this.view.rotation = 0, this._mc.gotoAndPlay("jump"))
  8259. };
  8260. c.prototype.stand = function () {
  8261. this.isStand = !0;
  8262. this.tempVy = this.vy;
  8263. this.vy = 0;
  8264. ns_egret.Ticker.getInstance().callLater(this.jump, this, 500)
  8265. };
  8266. c.prototype.run = function () {
  8267. this.view.x += this.vx
  8268. };
  8269. c.prototype.onCameraMove = function (b) {
  8270. this.isStand || (this.vy = 2 * b / 3);
  8271. this.view.y += this.vy;
  8272. this.checkAdd();
  8273. if (!this.jumped || !this.jumpedOver)this.view.y > this.jumpHigh && (this.isStand ? this.jumped && this.jumpOver() : this.stand())
  8274. };
  8275. c.prototype.jumpOver = function () {
  8276. !(this.view.x != Const.WALL_WIDTH && this.view.x != ns_egret.MainContext.instance.stage.stageWidth - Const.WALL_WIDTH) && !this.jumpedOver && (this.vx = 0, this._mc.gotoAndPlay("run"), this.view.scaleX = -this.view.scaleX, this.view.x == Const.WALL_WIDTH ? (this._mc.rotation = 90, this.jumpedOver = !0) : this.view.x == ns_egret.MainContext.instance.stage.stageWidth - Const.WALL_WIDTH && (this._mc.rotation = 270, this.jumpedOver = !0))
  8277. };
  8278. return c
  8279. }(Monster), HorizontalMonster = function (d) {
  8280. function c(b, a) {
  8281. this.mc =
  8282. new ns_egret.MovieClip(b, a);
  8283. this.vx = Const.BIRD_V_X;
  8284. this.mc.gotoAndPlay("run");
  8285. this.mc.setInterval(4);
  8286. this.mc.relativeAnchorPointX = this.mc.relativeAnchorPointY = 0.5;
  8287. this.mc.scaleX = 0.5;
  8288. this.mc.scaleY = 0.5;
  8289. this.view = this.mc
  8290. }
  8291. __extends(c, d);
  8292. c.prototype.run = function () {
  8293. this.mc.x <= Const.WALL_WIDTH ? (this.vx = Const.BIRD_V_X, this.mc.scaleX = 0.5) : this.view.x >= ns_egret.MainContext.instance.stage.stageWidth - Const.WALL_WIDTH && (this.vx = -Const.BIRD_V_X, this.mc.scaleX = -0.5);
  8294. this.mc.x += this.vx
  8295. };
  8296. c.prototype.onCameraMove =
  8297. function (b) {
  8298. this.view.y += 2 * b / 5;
  8299. this.checkAdd()
  8300. };
  8301. c.prototype.remove = function () {
  8302. d.prototype.remove.call(this);
  8303. system.hitTest.removeHitList(this);
  8304. 0 != app.role._vx ? (MyInfo.addKill(), this.view.visible = !1, utils.addHitMC(this.view)) : (this.view.visible = !1, app.restartGame())
  8305. };
  8306. return c
  8307. }(GameObject), Bridge = function (d) {
  8308. function c() {
  8309. var b = new ns_egret.DisplayObjectContainer, a = utils.createBitmap("qiao.png");
  8310. a.x = 47;
  8311. a.scaleX = 0.9;
  8312. b.addChild(a);
  8313. a = utils.createBitmap("qiao.png");
  8314. a.x = ns_egret.MainContext.instance.stage.stageWidth -
  8315. 47;
  8316. a.scaleX = -0.9;
  8317. b.addChild(a);
  8318. this.view = b
  8319. }
  8320. __extends(c, d);
  8321. c.prototype.checkAdd = function () {
  8322. -200 < this.view.y && null == this.view.parent ? gameContainer.addChild(this.view) : null != this.view.parent && this.view.y > ns_egret.MainContext.instance.stage.stageHeight + 200 && (this.view.visible = !1)
  8323. };
  8324. c.prototype.onCameraMove = function (b) {
  8325. this.view.y += 2 * b / 5;
  8326. this.checkAdd()
  8327. };
  8328. return c
  8329. }(GameObject), Bird = function (d) {
  8330. function c(b, a) {
  8331. var c = new ns_egret.MovieClip(b, a);
  8332. this._tick = this.speed = this.vx = 0;
  8333. this._isAppear = !1;
  8334. c.gotoAndPlay("run");
  8335. c.setInterval(6);
  8336. c.relativeAnchorPointX = c.relativeAnchorPointY = 0.5;
  8337. this.view = c
  8338. }
  8339. __extends(c, d);
  8340. c.prototype.run = function () {
  8341. !this._isAppear && !app.stateMachine.state._isDeath && (3 == MyInfo.guideStep || app.role.view.x < ns_egret.MainContext.instance.stage.stageWidth / 2 ? (this._isAppear = !0, this.view.x = ns_egret.MainContext.instance.stage.stageWidth - 30, this.view.scaleX *= -1) : app.role.view.x > ns_egret.MainContext.instance.stage.stageWidth / 2 && (this._isAppear = !0, this.view.x = 20));
  8342. 0 == this.vx && this._isAppear && (this._tick++,
  8343. this.view.y = 50, 90 < this._tick && (this.vx = this.view.x > ns_egret.MainContext.instance.stage.stageWidth / 2 ? 0.8 * -this.speed / 1.15 : 0.8 * this.speed / 1.15));
  8344. this.view.x += this.vx
  8345. };
  8346. c.prototype.onCameraMove = function (b) {
  8347. this.speed = b;
  8348. this.view.y += b;
  8349. this.checkAdd()
  8350. };
  8351. c.prototype.remove = function () {
  8352. d.prototype.remove.call(this);
  8353. system.hitTest.removeHitList(this);
  8354. 0 != app.role._vx ? (MyInfo.addKill(), this.view.visible = !1, app.stateMachine.state.onGetAnger(), utils.addHitMC(this.view)) : (this.view.visible = !1, app.restartGame())
  8355. };
  8356. return c
  8357. }(GameObject), Banana = function (d) {
  8358. function c(b, a) {
  8359. var c = new ns_egret.MovieClip(b, a);
  8360. this.vx = 0;
  8361. this.vy = 1;
  8362. this.speed = Const.BIRD_V_X;
  8363. c.gotoAndPlay("banana");
  8364. c.setInterval(6);
  8365. c.scaleX = c.scaleY = 2;
  8366. this.view = c
  8367. }
  8368. __extends(c, d);
  8369. c.prototype.run = function () {
  8370. this.view.x += this.vx
  8371. };
  8372. c.prototype.onCameraMove = function (b) {
  8373. this.view.y += b / this.vy;
  8374. this.checkAdd()
  8375. };
  8376. c.prototype.remove = function () {
  8377. d.prototype.remove.call(this);
  8378. system.hitTest.removeHitList(this);
  8379. 0 != app.role._vx ? (MyInfo.addKill(), this.view.visible = !1,
  8380. app.stateMachine.state.onGetBanana(), utils.addHitMC(this.view)) : this.view.x > Const.WALL_WIDTH && this.view.x < ns_egret.MainContext.instance.stage.stageWidth - Const.WALL_WIDTH && (this.view.visible = !1, app.restartGame())
  8381. };
  8382. c.prototype.setVy = function (b) {
  8383. "undefined" === typeof b && (b = 2);
  8384. this.vy = b
  8385. };
  8386. c.prototype.setVx = function () {
  8387. this.vx = this.view.x < ns_egret.MainContext.instance.stage.stageWidth / 2 ? this.speed : -this.speed
  8388. };
  8389. return c
  8390. }(GameObject), Monkey = function (d) {
  8391. function c(b, a) {
  8392. this.mc = new ns_egret.MovieClip(b, a);
  8393. this.delay =
  8394. 0;
  8395. this.data = b;
  8396. this.texture = a;
  8397. this.mc.gotoAndPlay("stand");
  8398. this.mc.setInterval(3);
  8399. this.view = this.mc;
  8400. this.delayValue = Math.round(4 * Math.random()) + 1
  8401. }
  8402. __extends(c, d);
  8403. c.prototype.run = function () {
  8404. var b = ns_egret.MainContext.instance.stage;
  8405. !this._isDead && this.view.y >= b.stageHeight - 700 && (this.delay++, this.delay == this.delayValue && (this.mc.gotoAndPlay("attack"), this.mc.addEventListener("attackComplete", this.attackComplete, this), this.mc.addEventListener("startAttack", this.startAttack, this)))
  8406. };
  8407. c.prototype.attackComplete =
  8408. function () {
  8409. this.mc.gotoAndPlay("stand");
  8410. this.mc.removeEventListener("attackComplete", this.attackComplete, this)
  8411. };
  8412. c.prototype.startAttack = function () {
  8413. this.throw(2);
  8414. this.mc.removeEventListener("startAttack", this.attackComplete, this);
  8415. 300 < MyInfo.score && 0.5 < Math.random() && ns_egret.Ticker.getInstance().callLater(function () {
  8416. this.throw(1.5)
  8417. }, this, 100)
  8418. };
  8419. c.prototype.onCameraMove = function (b) {
  8420. this.view.y += 2 * b / 5;
  8421. this.checkAdd()
  8422. };
  8423. c.prototype.remove = function () {
  8424. d.prototype.remove.call(this);
  8425. system.hitTest.removeHitList(this);
  8426. 0 != app.role._vx ? (MyInfo.addKill(), this.view.visible = !1, utils.addHitMC(this.view)) : (this.view.visible = !1, app.restartGame())
  8427. };
  8428. c.prototype.throw = function (b) {
  8429. var a = new Banana(this.data, this.texture);
  8430. a.view.x = this.view.x;
  8431. a.view.y = this.view.y;
  8432. a.add();
  8433. a.setVx();
  8434. a.setVy(b)
  8435. };
  8436. return c
  8437. }(GameObject), RenderSystem = function () {
  8438. function d() {
  8439. this._list = []
  8440. }
  8441. d.prototype.add = function (c) {
  8442. this._list.push(c)
  8443. };
  8444. d.prototype.onCameraMove = function (c) {
  8445. for (var b in this._list)this._list[b].onCameraMove(c)
  8446. };
  8447. d.prototype.run = function () {
  8448. for (var c in this._list) {
  8449. var b =
  8450. this._list[c];
  8451. b && b.run()
  8452. }
  8453. };
  8454. d.prototype.remove = function (c) {
  8455. c = this._list.indexOf(c);
  8456. 0 <= c && this._list.splice(c, 1)
  8457. };
  8458. d.prototype.reset = function () {
  8459. this._list = []
  8460. };
  8461. return d
  8462. }(), HitTestSystem = function () {
  8463. function d() {
  8464. this.hitTestResultArray = [];
  8465. this._hitList = []
  8466. }
  8467. d.prototype.addHitList = function (c) {
  8468. this._hitList.push(c)
  8469. };
  8470. d.prototype.removeHitList = function (c) {
  8471. c = this._hitList.indexOf(c);
  8472. 0 <= c && this._hitList.splice(c, 1)
  8473. };
  8474. d.prototype.hitTest = function (c) {
  8475. this.hitTestResultArray.length = 0;
  8476. var b = c.getHitBounds();
  8477. c = b.x + 0;
  8478. var a = b.y + 0, d = b.width + 0, b = b.height + 0, f;
  8479. for (f in this._hitList) {
  8480. var g = this._hitList[f], h = g.getHitBounds(), k = h.x + 0, l = h.y + 0, m = h.width + 0, h = h.height + 0;
  8481. this.containPoint(k, l, m, h, c, a) || this.containPoint(k, l, m, h, c + d, a) || this.containPoint(k, l, m, h, c, a + b) || this.containPoint(k, l, m, h, c + d, a + b) ? this.hitTestResultArray.push(g) : (this.containPoint(c, a, d, b, k, l) || this.containPoint(c, a, d, b, k + m, l) || this.containPoint(c, a, d, b, k, l + h) || this.containPoint(c, a, d, b, k + m, l + h)) && this.hitTestResultArray.push(g)
  8482. }
  8483. return this.hitTestResultArray
  8484. };
  8485. d.prototype.containPoint = function (c, b, a, d, f, g) {
  8486. return c <= f && c + a >= f && b <= g && b + d >= g
  8487. };
  8488. d.prototype.reset = function () {
  8489. this._hitList = []
  8490. };
  8491. return d
  8492. }(), system = {render: new RenderSystem, hitTest: new HitTestSystem};
  8493. var __extends = this.__extends || function (d, c) {
  8494. function b() {
  8495. this.constructor = d
  8496. }
  8497. for (var a in c)c.hasOwnProperty(a) && (d[a] = c[a]);
  8498. b.prototype = c.prototype;
  8499. d.prototype = new b
  8500. }, BoxManager = function () {
  8501. function d() {
  8502. this._list = [];
  8503. this.container = gameContainer
  8504. }
  8505. d.getInstance = function () {
  8506. null == d._instance && (d._instance = new d);
  8507. return d._instance
  8508. };
  8509. d.prototype.addBox = function (c) {
  8510. c.x += 10;
  8511. this.container.addChild(c);
  8512. this._list.push(c);
  8513. c.onEnter()
  8514. };
  8515. d.prototype.removeBox = function (c) {
  8516. var b = this._list.indexOf(c);
  8517. b && this._list.splice(b,
  8518. 1);
  8519. this.container.removeChild(c);
  8520. c.onExit()
  8521. };
  8522. d.prototype.clearAllBox = function () {
  8523. this.container.removeAllChildren()
  8524. };
  8525. return d
  8526. }(), UIBase = function (d) {
  8527. function c() {
  8528. d.call(this);
  8529. this.createView()
  8530. }
  8531. __extends(c, d);
  8532. c.prototype.createView = function () {
  8533. };
  8534. c.prototype.onEnter = function () {
  8535. };
  8536. c.prototype.onExit = function () {
  8537. };
  8538. return c
  8539. }(ns_egret.DisplayObjectContainer), NameInputUI = function (d) {
  8540. function c() {
  8541. d.apply(this, arguments)
  8542. }
  8543. __extends(c, d);
  8544. c.prototype.createView = function () {
  8545. this.textField = new ns_egret.TextField;
  8546. var b =
  8547. utils.createBitmap("ui_tanchuang_1.png");
  8548. this.addChild(b);
  8549. this.width = b.getBounds().width;
  8550. this.height = b.getBounds().height;
  8551. var a = utils.createBitmap("ui_title_1.png");
  8552. a.relativeAnchorPointX = 0.5;
  8553. a.relativeAnchorPointY = 0.5;
  8554. a.x = b.getBounds().width / 2;
  8555. a.y = -20;
  8556. this.addChild(a);
  8557. a = utils.createBitmap("ui_title_success.png");
  8558. a.relativeAnchorPointX = 0.5;
  8559. a.relativeAnchorPointY = 0.5;
  8560. a.x = b.getBounds().width / 2;
  8561. a.y = -25;
  8562. this.addChild(a);
  8563. for (a = 0; 3 > a; a++) {
  8564. var c = utils.createBitmap("ui_chendi_1.png");
  8565. this.addChild(c);
  8566. c.relativeAnchorPointX =
  8567. 0.5;
  8568. c.scaleX = 0.8;
  8569. c.scaleY = 0.8;
  8570. c.x = this.width / 2;
  8571. c.y = 64 * a + 20
  8572. }
  8573. a = utils.createBitmap("nin.png");
  8574. a.relativeAnchorPointX = 0.5;
  8575. a.relativeAnchorPointY = 0.5;
  8576. a.x = b.getBounds().width / 2 - 120;
  8577. a.y = this.height - 253;
  8578. this.addChild(a);
  8579. c = utils.createBitmap("dewanjia.png");
  8580. c.relativeAnchorPointX = 0.5;
  8581. c.relativeAnchorPointY = 0.5;
  8582. c.x = b.getBounds().width / 2 + 140;
  8583. c.y = a.y;
  8584. this.addChild(c);
  8585. c = utils.createBitmap("gong.png");
  8586. c.relativeAnchorPointX = 0.5;
  8587. c.relativeAnchorPointY = 0.5;
  8588. c.x = b.getBounds().width / 2 - 100;
  8589. c.y = 50;
  8590. this.addChild(c);
  8591. c =
  8592. utils.createBitmap("mi_2.png");
  8593. c.relativeAnchorPointX = 0.5;
  8594. c.relativeAnchorPointY = 0.5;
  8595. c.x = b.getBounds().width / 2 + 82;
  8596. c.y = 50;
  8597. this.addChild(c);
  8598. c = utils.createBitmap("jisha.png");
  8599. c.relativeAnchorPointX = 0.5;
  8600. c.relativeAnchorPointY = 0.5;
  8601. c.x = b.getBounds().width / 2 - 100;
  8602. c.y = 114;
  8603. this.addChild(c);
  8604. c = utils.createBitmap("zhiguai.png");
  8605. c.relativeAnchorPointX = 0.5;
  8606. c.relativeAnchorPointY = 0.5;
  8607. c.x = b.getBounds().width / 2 + 100;
  8608. c.y = 114;
  8609. this.addChild(c);
  8610. c = utils.createBitmap("zongji.png");
  8611. c.relativeAnchorPointX = 0.5;
  8612. c.relativeAnchorPointY =
  8613. 0.5;
  8614. c.x = b.getBounds().width / 2 - 100;
  8615. c.y = 178;
  8616. this.addChild(c);
  8617. c = utils.createBitmap("fen.png");
  8618. c.relativeAnchorPointX = 0.5;
  8619. c.relativeAnchorPointY = 0.5;
  8620. c.x = b.getBounds().width / 2 + 82;
  8621. c.y = 178;
  8622. this.addChild(c)
  8623. };
  8624. c.prototype.onTouchBegan = function () {
  8625. function b(a) {
  8626. a = JSON.parse(a.responseText);
  8627. 0 == a.s ? (window.localStorage.getItem("userId") || (window.localStorage.setItem("userId", c), window.localStorage.setItem("userName", d)), window.localStorage.setItem("best_" + MyInfo.currentWeek, this.score), app.stateMachine.changeState(new ResultState)) :
  8628. 1 == a.s ? this.textField.text = "\u60a8\u8d77\u7684\u540d\u5b57\u8d85\u8fc7\u9650\u5236\u4e86" : 3 == a.s ? this.textField.text = "\u540d\u5b57\u5df2\u7ecf\u88ab\u4f7f\u7528\uff0c\u8bf7\u91cd\u65b0\u8d77\u540d" : 2 == a.s && (this.textField.text = "\u60a8\u7684\u540d\u5b57\u6709\u975e\u6cd5\u5b57\u7b26")
  8629. }
  8630. var a = window.localStorage.getItem("best_" + MyInfo.currentWeek);
  8631. if (a && parseInt(a) > this.score)app.stateMachine.changeState(new ResultState); else {
  8632. var c = window.localStorage.getItem("userId"), d = this.textInput.getText();
  8633. c ||
  8634. (c = ns_egret.Ticker.now() + "" + Math.floor(1E5 * Math.random()));
  8635. if ("" == d)this.textField.text = "\u540d\u5b57\u4e0d\u80fd\u4e3a\u7a7a"; else if (10 < d.length)this.textField.text = "\u60a8\u8d77\u7684\u540d\u5b57\u8d85\u8fc7\u9650\u5236\u4e86"; else {
  8636. var a = {mod: "Top", "do": "set"}, g = {};
  8637. a.p = g;
  8638. g.name = d;
  8639. g.uId = c;
  8640. g.num = this.score;
  8641. a = JSON.stringify(a);
  8642. a = new ns_egret.URLRequest(MyInfo.serverAddress + "?data\x3d" + a + "\x26s\x3d" + hex_md5(a + MyInfo.secret), b, this);
  8643. ns_egret.NetContext.getInstance().send(a)
  8644. }
  8645. }
  8646. };
  8647. c.prototype.add = function (b, a) {
  8648. "undefined" === typeof b && (b = 0);
  8649. "undefined" === typeof a && (a = 0);
  8650. this.score = b + a;
  8651. var c = utils.createBitmap("ui_tanchuang_1.png");
  8652. if (9999999 > MyInfo.score)c = utils.createBitmap("ui_word_zaipao.png"), c.x = 35, c.y = 320, c.relativeAnchorPointY = 0.5, c = utils.createBitmap("ui_word_mi.png"), c.relativeAnchorPointY = 0.5, c.x = 225, c.y = 320, c = MyInfo.score < Const.SLIVER_GIFT ? new UIFont(Const.SLIVER_GIFT - MyInfo.score) : new UIFont(Const.GOLD_GIFT - MyInfo.score), c.scaleX = c.scaleY = 0.7,
  8653. c.relativeAnchorPointY = 0.5, c.x = 115, c.y = 315, 100 > MyInfo.score ? c = utils.createBitmap("ui_word_get_award_2.png") : (c = utils.createBitmap("ui_word_get_award.png"), c.scaleX = c.scaleY = 0.9), c.relativeAnchorPointY = 0.5, c.x = 35, c.y = 365, c = utils.createBitmap("ui_return_1.png"), this.addChild(c), c.touchEnabled = !0, c.y = 400, c.x = 35, c.addEventListener(ns_egret.TouchEvent.TOUCH_BEGAN, function () {
  8654. app.stateMachine.changeState(new LoginState)
  8655. }, this), c = utils.createBitmap("ui_award_1.png"), c.addEventListener(ns_egret.TouchEvent.TOUCH_BEGAN,
  8656. function () {
  8657. EgretShare.share()
  8658. // app.stateMachine.changeState(new GameState)
  8659. }, this), c.touchEnabled = !0, this.addChild(c), c.y = 400, c.x = 235; else {
  8660. var d = utils.createBitmap("ui_award_1.png");
  8661. this.addChild(d);
  8662. d.relativeAnchorPointX = d.relativeAnchorPointY = 0.5;
  8663. d.addEventListener(ns_egret.TouchEvent.TOUCH_BEGAN, this.onTouchBegan, this);
  8664. d.x = c.getBounds().width / 2;
  8665. d.y = this.height - 65;
  8666. d.touchEnabled = !0;
  8667. this.button = d;
  8668. var g = window.localStorage.getItem("best_" + MyInfo.currentWeek);
  8669. if (g && parseInt(g) > this.score) {
  8670. var h = utils.createBitmap("ui_ninbenzhou.png");
  8671. h.relativeAnchorPointX = 0.5;
  8672. h.relativeAnchorPointY = 0.5;
  8673. h.x = c.getBounds().width / 2 - 65;
  8674. h.y = d.y - 140;
  8675. this.addChild(h);
  8676. g = new UIFont(g, 4);
  8677. g.relativeAnchorPointY = 0.5;
  8678. g.x = c.getBounds().width / 2 - 200;
  8679. g.y = d.y - 90;
  8680. this.addChild(g);
  8681. d = utils.createBitmap("fen.png");
  8682. d.relativeAnchorPointX = 0.5;
  8683. d.relativeAnchorPointY = 0.5;
  8684. d.x = c.getBounds().width / 2;
  8685. d.y = g.y;
  8686. this.addChild(d)
  8687. } else {
  8688. g = utils.createBitmap("ui_chendi_1.png");
  8689. g.scaleX = 0.7;
  8690. g.scaleY = 0.7;
  8691. this.addChild(g);
  8692. g.relativeAnchorPointX = 0.5;
  8693. g.x = this.width / 2;
  8694. g.y = d.y - 100;
  8695. d = utils.createBitmap("qingliuaia.png");
  8696. d.relativeAnchorPointX = 0.5;
  8697. d.relativeAnchorPointY = 0.5;
  8698. d.x = c.getBounds().width / 2;
  8699. d.y = g.y - 30;
  8700. this.addChild(d);
  8701. var k = window.localStorage.getItem("userName");
  8702. this.textInput = new ns_egret.TextInput;
  8703. this.textInput.x = 180;
  8704. this.textInput.y = 365;
  8705. ns_egret.Ticker.getInstance().callLater(function () {
  8706. this.addChild(this.textInput);
  8707. this.textInput.setText(k ? k : "\u5fcd\u8005" + Math.floor(1E5 * Math.random()))
  8708. }, this)
  8709. }
  8710. this.textField.relativeAnchorPointX = 0.5;
  8711. this.textField.y = 510;
  8712. this.textField.x = c.getBounds().width / 2;
  8713. this.textField.size =
  8714. 20;
  8715. this.addChild(this.textField)
  8716. }
  8717. c = new UIFont(b, 4);
  8718. c.scaleX = c.scaleY = 0.6;
  8719. c.relativeAnchorPointX = 0.5;
  8720. c.x = this.width / 2;
  8721. c.y = 30;
  8722. this.addChild(c);
  8723. c = new UIFont(a);
  8724. c.scaleX = c.scaleY = 0.6;
  8725. c.relativeAnchorPointX = 0.5;
  8726. c.x = this.width / 2;
  8727. c.y = 94;
  8728. this.addChild(c);
  8729. c = 1E3 > a + b ? new UIFont(a + b) : new UIFont(a + b, 4);
  8730. c.scaleX = c.scaleY = 0.6;
  8731. c.relativeAnchorPointX = 0.5;
  8732. c.x = this.width / 2;
  8733. c.y = 158;
  8734. this.addChild(c);
  8735. c = new UIFont(this.getScore(a + b), 2);
  8736. c.scaleX = c.scaleY = 1;
  8737. c.relativeAnchorPointX = 0.5;
  8738. c.x = this.width / 2 - 3;
  8739. c.y = 220;
  8740. this.addChild(c);
  8741. c = utils.createBitmap("cent.png");
  8742. c.relativeAnchorPointX = 0.5;
  8743. c.x = this.width / 2 + 60;
  8744. c.y = 235;
  8745. this.addChild(c)
  8746. };
  8747. c.prototype.getScore = function (b) {
  8748. b = Math.log(18 * b);
  8749. b *= b;
  8750. 99 < b && (b = 99);
  8751. return Math.round(b)
  8752. };
  8753. c.prototype.onExit = function () {
  8754. this.removeEventListener(ns_egret.TouchEvent.TOUCH_BEGAN, this.onTouchBegan, this)
  8755. };
  8756. return c
  8757. }(UIBase), LoginUI = function (d) {
  8758. function c() {
  8759. d.call(this)
  8760. }
  8761. __extends(c, d);
  8762. c.prototype.createView = function () {
  8763. var b = utils.createBitmap("ui_logo.png");
  8764. this.addChild(b);
  8765. var a;
  8766. a = Const.HAS_RANK ?
  8767. utils.createBitmap("mingren.png") : utils.createBitmap("ui_mingren.png");
  8768. a.scaleX = 0.8;
  8769. a.scaleY = 0.8;
  8770. a.x = Const.HAS_RANK ? -80 : 55;
  8771. this.addChild(a);
  8772. var b = ns_egret.MainContext.instance.stage, c = b.stageHeight - a.getBounds().height + 190;
  8773. Const.HAS_RANK && (c = b.stageHeight - a.getBounds().height + 150);
  8774. a.y = b.stageHeight + 100;
  8775. ns_egret.Tween.get(a).to({y: c}, 800, ns_egret.Ease.backOut).call(function () {
  8776. ns_egret.Tween.get(d).to({alpha: 1, scaleX: 0.7, scaleY: 0.7}, 300);
  8777. d.touchEnabled = !0
  8778. });
  8779. var d = utils.createBitmap("ui_chuzhan_1.png");
  8780. this.addChild(d);
  8781. d.alpha = 0;
  8782. d.scaleX = d.scaleY = 0;
  8783. d.relativeAnchorPointX = d.relativeAnchorPointY = 0.5;
  8784. d.x = Const.HAS_RANK ? b.stageWidth / 2 + 80 : b.stageWidth / 2;
  8785. d.y = b.stageHeight - 80;
  8786. d.addEventListener(ns_egret.TouchEvent.TOUCH_BEGAN, this.onTouchBegan, this);
  8787. this.button = d;
  8788. a = utils.createBitmap("ui_egretLogo.png");
  8789. this.addChild(a);
  8790. Const.HAS_RANK && (this.rank = new Rank, this.rank.scaleX = this.rank.scaleY = 0.7, this.rank.relativeAnchorPointX = 0.5, this.rank.x = this.button.x, this.rank.y = this.button.y - this.rank.getBounds().height *
  8791. this.rank.scaleX, this.addChild(this.rank));
  8792. a.scaleX = 0.5;
  8793. a.scaleY = 0.5;
  8794. a.y = b.stageHeight - a.getBounds().height / 2;
  8795. a.x = b.stageWidth / 2 - a.getBounds().width / 4
  8796. };
  8797. c.prototype.onTouchBegan = function () {
  8798. MyInfo.statistics("gameStart");
  8799. app.stateMachine.changeState(new GameState)
  8800. };
  8801. c.prototype.onExit = function () {
  8802. this.removeEventListener(ns_egret.TouchEvent.TOUCH_BEGAN, this.onTouchBegan, this)
  8803. };
  8804. return c
  8805. }(UIBase), Rank = function (d) {
  8806. function c() {
  8807. d.call(this);
  8808. this.number_max = 6;
  8809. this.currentNumber = 0;
  8810. this.scroll = new ns_egret.ScrollView;
  8811. this.rankContainer = new ns_egret.DisplayObjectContainer;
  8812. var b = utils.createBitmap("ui_tanchuang_1.png");
  8813. this.addChild(b);
  8814. this.soloHeight = b.getBounds().height / this.number_max;
  8815. var a = utils.createBitmap("ui_title_1.png");
  8816. a.relativeAnchorPointX = 0.5;
  8817. a.relativeAnchorPointY = 0.5;
  8818. a.x = b.getBounds().width / 2;
  8819. a.y = -20;
  8820. this.addChild(a);
  8821. a = utils.createBitmap("paihang.png");
  8822. a.relativeAnchorPointX = 0.5;
  8823. a.relativeAnchorPointY = 0.5;
  8824. a.x = b.getBounds().width / 2;
  8825. a.y = -25;
  8826. this.addChild(a);
  8827. this.width = b.getBounds().width;
  8828. this.height =
  8829. b.getBounds().height;
  8830. this.initRankContainer();
  8831. this.setRank()
  8832. }
  8833. __extends(c, d);
  8834. c.prototype.setRank = function () {
  8835. var b = {mod: "Top", "do": "getList"}, b = JSON.stringify(b), b = new ns_egret.URLRequest(MyInfo.serverAddress + "?data\x3d" + b + "\x26s\x3d" + hex_md5(b + MyInfo.secret), function (a) {
  8836. a = JSON.parse(a.responseText);
  8837. if (0 == a.s) {
  8838. MyInfo.currentWeek = a.w;
  8839. console.log(MyInfo.currentWeek);
  8840. for (var b = a.l, c = 0; c < a.l.length && 10 > c; c++) {
  8841. var d = b[c];
  8842. this.addValue(d.name, d.num)
  8843. }
  8844. }
  8845. }, this);
  8846. ns_egret.NetContext.getInstance().send(b)
  8847. };
  8848. c.prototype.addValue =
  8849. function (b, a) {
  8850. "undefined" === typeof b && (b = "unname");
  8851. "undefined" === typeof a && (a = 0);
  8852. var c = this.currentNumber, d = utils.createBitmap("ui_chendi_1.png");
  8853. this.rankContainer.addChild(d);
  8854. d.relativeAnchorPointX = 0.5;
  8855. d.x = this.width / 2;
  8856. d.y = 80 * c;
  8857. var g = new ComboFont(c + 1), h = new UIFont(Math.round(a), 4);
  8858. g.x = 50;
  8859. g.y = 80 * c + 15;
  8860. g.scaleX = g.scaleY = 0.7;
  8861. h.x = 290;
  8862. h.y = g.y;
  8863. h.scaleX = h.scaleY = 0.7;
  8864. this.rankContainer.addChild(g);
  8865. this.rankContainer.addChild(h);
  8866. c = new ns_egret.TextField;
  8867. c.text = b;
  8868. c.stroke = 2;
  8869. c.x = 118;
  8870. c.y = g.y + 5;
  8871. c.size = 28;
  8872. c.textColor =
  8873. "#FFFFFF";
  8874. this.rankContainer.addChild(c);
  8875. d = d.getBounds().height;
  8876. this.currentNumber++;
  8877. this.scroll.setContainer(this.rankContainer, this.width, this.currentNumber * d)
  8878. };
  8879. c.prototype.initRankContainer = function () {
  8880. this.addChild(this.scroll);
  8881. this.scroll.x = 0;
  8882. this.scroll.y = 20;
  8883. this.scroll.setContentSize(this.width, this.height - 40);
  8884. this.scroll.direction = ns_egret.Direction.VERTICAL;
  8885. this.scroll.setContainer(this.rankContainer, this.width, 120)
  8886. };
  8887. return c
  8888. }(ns_egret.DisplayObjectContainer), FailUI = function (d) {
  8889. function c() {
  8890. d.apply(this,
  8891. arguments)
  8892. }
  8893. __extends(c, d);
  8894. c.prototype.createView = function () {
  8895. var b = new UIBackground("ui_title_fail.png");
  8896. this.addChild(b);
  8897. var a = ns_egret.MainContext.instance.stage;
  8898. this.relativeAnchorPointX = this.relativeAnchorPointY = 0.5;
  8899. this.x = a.stageWidth / 2;
  8900. this.y = a.stageHeight / 2;
  8901. b = utils.createBitmap("ui_chendi_1.png");
  8902. this.addChild(b);
  8903. b.relativeAnchorPointX = 0.5;
  8904. b.x = a.stageWidth / 2;
  8905. b.y = 140;
  8906. b = utils.createBitmap("ui_chendi_1.png");
  8907. this.addChild(b);
  8908. b.relativeAnchorPointX = 0.5;
  8909. b.x = a.stageWidth / 2;
  8910. b.y = 240;
  8911. a = utils.createBitmap("ui_font_score.png");
  8912. this.addChild(a);
  8913. a.x = b.x - b.getBounds().width / 2 + 20;
  8914. a.y = 145;
  8915. a = utils.createBitmap("ui_font_best.png");
  8916. this.addChild(a);
  8917. a.x = b.x - b.getBounds().width / 2 + 20;
  8918. a.y = 245;
  8919. a = new UIFont(MyInfo.score);
  8920. this.addChild(a);
  8921. a.y = 145;
  8922. a.x = b.x + 20;
  8923. a = new UIFont(MyInfo.bestScore);
  8924. this.addChild(a);
  8925. a.y = 245;
  8926. a.x = b.x + 20;
  8927. b = utils.createBitmap("ui_word_zaipao.png");
  8928. // this.addChild(b);
  8929. b.x = 20;
  8930. b.y = 350;
  8931. b.relativeAnchorPointY = 0.5;
  8932. b = utils.createBitmap("ui_word_mi.png");
  8933. // this.addChild(b);
  8934. b.relativeAnchorPointY = 0.5;
  8935. b.x = 230;
  8936. b.y = 350;
  8937. b = new UIFont(Const.SLIVER_GIFT -
  8938. MyInfo.score);
  8939. // this.addChild(b);
  8940. // b.relativeAnchorPointY = 0.5;
  8941. // b.x = 90;
  8942. // b.y = 350;
  8943. b = utils.createBitmap("ui_word_get_award.png");
  8944. this.addChild(b);
  8945. b.relativeAnchorPointY = 0.5;
  8946. b.x = 20;
  8947. b.y = 400;
  8948. b = utils.createBitmap("ui_return_1.png");
  8949. this.addChild(b);
  8950. b.touchEnabled = !0;
  8951. b.y = 440;
  8952. b.x = 30;
  8953. b.addEventListener(ns_egret.TouchEvent.TOUCH_BEGAN, function () {
  8954. app.stateMachine.changeState(new LoginState)
  8955. }, this);
  8956. b = utils.createBitmap("ui_reset_1.png");
  8957. b.addEventListener(ns_egret.TouchEvent.TOUCH_BEGAN, function () {
  8958. app.stateMachine.changeState(new GameState)
  8959. },
  8960. this);
  8961. b.touchEnabled = !0;
  8962. this.addChild(b);
  8963. b.y = 440;
  8964. b.x = 230;
  8965. utils.scaleDialog(this)
  8966. };
  8967. return c
  8968. }(UIBase), WinUI = function (d) {
  8969. function c() {
  8970. d.apply(this, arguments)
  8971. }
  8972. __extends(c, d);
  8973. c.prototype.createView = function () {
  8974. var b = new ns_egret.URLRequest("http://ka.u9time.com/activity_api/getpartneractivity/685ff9c132d847d65d13fecb176a7ce0", function (a) {
  8975. a = JSON.parse(a.responseText);
  8976. a.result && a.result.card_id ? (a = a.result.card_id, MyInfo.statistics("getGift"), a = new GetAwardUI(a), BoxManager.getInstance().removeBox(this), BoxManager.getInstance().addBox(a)) :
  8977. alert(a.error.message + ",\u8bf7\u7a0d\u540e\u518d\u8bd5")
  8978. }, this);
  8979. ns_egret.NetContext.getInstance().send(b)
  8980. };
  8981. c.prototype.getGift = function () {
  8982. var b = new ns_egret.URLRequest("http://ka.u9time.com/activity_api/getpartneractivity/685ff9c132d847d65d13fecb176a7ce0", function (a) {
  8983. a = JSON.parse(a.responseText);
  8984. a.result && a.result.card_id ? (a = new GetAwardUI(a.result.card_id), BoxManager.getInstance().removeBox(this), BoxManager.getInstance().addBox(a)) : alert(a.error.message + ",\u8bf7\u7a0d\u540e\u518d\u8bd5")
  8985. }, this);
  8986. ns_egret.NetContext.getInstance().send(b)
  8987. };
  8988. return c
  8989. }(UIBase), UIBackground = function (d) {
  8990. function c(b) {
  8991. d.call(this);
  8992. var a = utils.createBitmap("ui_tanchuang_1.png");
  8993. this.addChild(a);
  8994. a.y = 65;
  8995. var c = utils.createBitmap("ui_title_1.png");
  8996. this.addChild(c);
  8997. c.relativeAnchorPointX = 0.5;
  8998. c.x = a.getBounds().width / 2;
  8999. b = utils.createBitmap(b);
  9000. this.addChild(b);
  9001. b.relativeAnchorPointX = 0.5;
  9002. b.x = a.getBounds().width / 2
  9003. }
  9004. __extends(c, d);
  9005. return c
  9006. }(ns_egret.DisplayObjectContainer), LoadingUI = function () {
  9007. function d() {
  9008. }
  9009. d.prototype.addToStage =
  9010. function () {
  9011. this.container = new ns_egret.DisplayObjectContainer;
  9012. this.textField = new ns_egret.TextField;
  9013. ns_egret.MainContext.instance.stage.addChild(this.container);
  9014. this.container.addChild(this.textField);
  9015. this.textField.x = 120;
  9016. this.textField.y = 300;
  9017. this.textField.setContentSize(480, 100);
  9018. this.textField.align = "middle"
  9019. };
  9020. d.prototype.removeFromStage = function () {
  9021. this.container.parent.removeChild(this.container)
  9022. };
  9023. d.prototype.onProgress = function (c, b) {
  9024. this.textField.text = "\u6e38\u620f\u52a0\u8f7d\u4e2d..." + Math.floor(100 *
  9025. (c / b)) + "%"
  9026. };
  9027. return d
  9028. }(), GetAwardUI = function (d) {
  9029. function c(b) {
  9030. this.codeName = b;
  9031. d.call(this)
  9032. }
  9033. __extends(c, d);
  9034. c.prototype.createView = function () {
  9035. var b = new UIBackground("ui_title_success.png");
  9036. this.addChild(b);
  9037. var a = ns_egret.MainContext.instance.stage;
  9038. this.relativeAnchorPointX = this.relativeAnchorPointY = 0.5;
  9039. this.x = a.stageWidth / 2;
  9040. this.y = a.stageHeight / 2;
  9041. b = utils.createBitmap("ui_word_get_award.png");
  9042. this.addChild(b);
  9043. b.x = a.stageWidth / 2;
  9044. b.relativeAnchorPointX = 0.5;
  9045. b.y = 85;
  9046. b = utils.createBitmap("ui_chendi_1.png");
  9047. this.addChild(b);
  9048. b.relativeAnchorPointX = 0.5;
  9049. b.x = a.stageWidth / 2;
  9050. b.y = 360;
  9051. b = new ns_egret.TextField;
  9052. b.text = this.codeName;
  9053. this.addChild(b);
  9054. b.setContentSize(480, 100);
  9055. b.textAlign = "center";
  9056. b.size = 48;
  9057. b.y = 365;
  9058. b = utils.createGift();
  9059. this.addChild(b);
  9060. b.touchEnabled = !0;
  9061. b.x = 240;
  9062. b.relativeAnchorPointX = 0.5;
  9063. b.y = 130;
  9064. b = utils.createBitmap("ui_notice_codename.png");
  9065. this.addChild(b);
  9066. b.relativeAnchorPointX = 0.5;
  9067. b.x = a.stageWidth / 2;
  9068. b.y = 310;
  9069. a = utils.createBitmap("ui_return_1.png");
  9070. this.addChild(a);
  9071. a.touchEnabled = !0;
  9072. a.y = 450;
  9073. a.x =
  9074. 30;
  9075. a.addEventListener(ns_egret.TouchEvent.TOUCH_BEGAN, function () {
  9076. app.stateMachine.changeState(new LoginState)
  9077. }, this);
  9078. a = utils.createBitmap("button-qianwangduihuan-1.png");
  9079. a.addEventListener(ns_egret.TouchEvent.TOUCH_BEGAN, function () {
  9080. MyInfo.statistics("goTargetGame");
  9081. window.open("http://m.hy.u9time.com/", "_self")
  9082. }, this);
  9083. a.touchEnabled = !0;
  9084. this.addChild(a);
  9085. a.y = 450;
  9086. a.x = 230;
  9087. utils.scaleDialog(this)
  9088. };
  9089. return c
  9090. }(UIBase), GuideUI = function (d) {
  9091. function c() {
  9092. d.call(this);
  9093. this.createView()
  9094. }
  9095. __extends(c, d);
  9096. c.prototype.createView =
  9097. function () {
  9098. var b = utils.createBitmap("zilaiye.png");
  9099. b.x = 90;
  9100. b.y = -280;
  9101. this.addChild(b);
  9102. b = utils.createBitmap("duihua-1.png");
  9103. this.addChild(b);
  9104. b = utils.createBitmap("duihua-3.png");
  9105. b.x = 415;
  9106. b.y = 90;
  9107. this.addChild(b);
  9108. ns_egret.Tween.get(b, {loop: !0}).to({y: 85}, 600).to({y: 90}, 600);
  9109. b = utils.createBitmap("duihua-2.png");
  9110. b.x = 415;
  9111. b.y = 110;
  9112. this.addChild(b);
  9113. this.txt = new ns_egret.TextField;
  9114. this.txt.x = 240;
  9115. this.txt.y = 65;
  9116. this.txt.size = 20;
  9117. this.txt.text = "\u70b9\u51fb";
  9118. this.txt.setContentSize(400, 0);
  9119. this.txt.textColor = "#23100b";
  9120. this.txt.relativeAnchorPointX = this.txt.relativeAnchorPointY = 0.5;
  9121. this.addChild(this.txt)
  9122. };
  9123. c.prototype.setText = function (b) {
  9124. this.txt.text = b
  9125. };
  9126. return c
  9127. }(ns_egret.DisplayObjectContainer), UIFont = function (d) {
  9128. function c(b, a) {
  9129. "undefined" === typeof a && (a = 3);
  9130. d.call(this);
  9131. this._list = [];
  9132. this.length = a;
  9133. var c = ns_egret.ResourceLoader.create("number.json").data;
  9134. this.spriteSheet = new ns_egret.SpriteSheet(c);
  9135. this.texture = ns_egret.TextureCache.getInstance().getTexture("number.png");
  9136. for (c = 0; c < a; c++) {
  9137. var f = new ns_egret.Bitmap;
  9138. this._list.push(f);
  9139. this.addChild(f);
  9140. f.x = 40 * c
  9141. }
  9142. this.updateText(b)
  9143. }
  9144. __extends(c, d);
  9145. c.prototype.updateText = function (b) {
  9146. 1E4 <= b && (b = 9999);
  9147. for (b = b.toString(); b.length < this.length;)b = "0" + b;
  9148. for (var a = 0; a < this.length; a++) {
  9149. var c = this._list[a], d = b[a];
  9150. c.texture = this.texture;
  9151. c.spriteFrame = this.spriteSheet.getFrame(d + ".png")
  9152. }
  9153. };
  9154. return c
  9155. }(ns_egret.DisplayObjectContainer), ComboFont = function (d) {
  9156. function c(b) {
  9157. d.call(this);
  9158. this._list = [];
  9159. var a = ns_egret.ResourceLoader.create("combo_number.json").data;
  9160. this.spriteSheet = new ns_egret.SpriteSheet(a);
  9161. this.texture = ns_egret.TextureCache.getInstance().getTexture("combo_number.png");
  9162. for (a = 0; 3 > a; a++) {
  9163. var c = new ns_egret.Bitmap;
  9164. this._list.push(c);
  9165. this.addChild(c);
  9166. c.x = 40 * a
  9167. }
  9168. this.updateText(b)
  9169. }
  9170. __extends(c, d);
  9171. c.prototype.updateText = function (b) {
  9172. this.value = b;
  9173. 1E3 <= b && (b = 999);
  9174. b = b.toString();
  9175. for (var a = 0; 3 > a; a++) {
  9176. var c = this._list[a];
  9177. if (a < b.length) {
  9178. c.visible = !0;
  9179. var d = b[a];
  9180. c.texture = this.texture;
  9181. c.spriteFrame = this.spriteSheet.getFrame(d + ".png")
  9182. } else c.visible = !1
  9183. }
  9184. };
  9185. c.prototype.getValue = function () {
  9186. return this.value
  9187. };
  9188. return c
  9189. }(ns_egret.DisplayObjectContainer), AngerContainer = function (d) {
  9190. function c() {
  9191. d.call(this);
  9192. this.anger = 0;
  9193. this.isBanana = !1;
  9194. this.angerList = [];
  9195. for (var b = 1; 3 >= b; b++) {
  9196. var a = utils.createBitmap("ui_anger_bg.png");
  9197. a.x = 60 * b;
  9198. this.addChild(a)
  9199. }
  9200. }
  9201. __extends(c, d);
  9202. c.prototype.onGetAnger = function () {
  9203. this.isBanana && this.maxAngerOver();
  9204. this.isBanana = !1;
  9205. this.anger++;
  9206. if (3 >= this.anger) {
  9207. var b = utils.createBitmap("anger.png");
  9208. b.x = 60 * this.anger + 5;
  9209. this.addChild(b);
  9210. this.angerList.push(b)
  9211. }
  9212. if (3 == this.anger) {
  9213. this.anger = 0;
  9214. var b =
  9215. ns_egret.ResourceLoader.create("maxAnger.json").data, a = ns_egret.TextureCache.getInstance().getTexture("maxAnger.png");
  9216. this.maxAngerMC = new ns_egret.MovieClip(b, a);
  9217. this.maxAngerMC.gotoAndPlay("run");
  9218. b = this.maxAngerMC.getBounds();
  9219. this.maxAngerMC.x = ns_egret.MainContext.instance.stage.stageWidth - b.width >> 1;
  9220. this.addChild(this.maxAngerMC);
  9221. this.maxAngerMC.y = ns_egret.MainContext.instance.stage.stageHeight - this.y;
  9222. this.maxAnger = !0;
  9223. b = -300 - this.y;
  9224. ns_egret.Tween.get(this.maxAngerMC).to({y: b}, 1200).call(this.maxAngerOver,
  9225. this);
  9226. ns_egret.Ticker.getInstance().register(this.update, this)
  9227. }
  9228. };
  9229. c.prototype.onGetBanana = function () {
  9230. this.isBanana || this.maxAngerOver();
  9231. this.isBanana = !0;
  9232. this.anger++;
  9233. if (3 >= this.anger) {
  9234. var b = utils.createBitmap("bananaAnger.png");
  9235. b.x = 60 * this.anger + 5;
  9236. this.addChild(b);
  9237. this.angerList.push(b)
  9238. }
  9239. if (3 == this.anger) {
  9240. this.anger = 0;
  9241. var b = ns_egret.ResourceLoader.create("maxAnger.json").data, a = ns_egret.TextureCache.getInstance().getTexture("maxAnger.png");
  9242. this.maxAngerMC = new ns_egret.MovieClip(b, a);
  9243. this.maxAngerMC.gotoAndPlay("run");
  9244. b = this.maxAngerMC.getBounds();
  9245. this.maxAngerMC.x = ns_egret.MainContext.instance.stage.stageWidth - b.width >> 1;
  9246. this.addChild(this.maxAngerMC);
  9247. this.maxAngerMC.y = ns_egret.MainContext.instance.stage.stageHeight - this.y;
  9248. this.maxAnger = !0;
  9249. b = -300 - this.y;
  9250. ns_egret.Tween.get(this.maxAngerMC).to({y: b}, 1200).call(this.maxAngerOver, this);
  9251. ns_egret.Ticker.getInstance().register(this.update, this)
  9252. }
  9253. };
  9254. c.prototype.update = function () {
  9255. if (this.maxAnger)for (var b = system.hitTest._hitList, a = b.length, c = 0; c < a; c++) {
  9256. var d = b[c];
  9257. d.view.y >
  9258. this.maxAngerMC.y && (system.hitTest.removeHitList(d), system.render.remove(d), d.view.visible = !1, c--, a--)
  9259. }
  9260. };
  9261. c.prototype.maxAngerOver = function () {
  9262. for (var b in this.angerList)this.angerList[b].removeFromParent();
  9263. this.angerList.length = 0;
  9264. this.maxAnger = !1;
  9265. ns_egret.Ticker.getInstance().unregister(this.update, this);
  9266. null == this.maxAngerMC ? this.anger = 0 : (this.maxAngerMC.parent.removeChild(this.maxAngerMC), this.maxAngerMC = null)
  9267. };
  9268. return c
  9269. }(ns_egret.DisplayObjectContainer);
  9270. var hexcase = 0, b64pad = "";
  9271. function hex_md5(d) {
  9272. return rstr2hex(rstr_md5(str2rstr_utf8(d)))
  9273. }
  9274. function b64_md5(d) {
  9275. return rstr2b64(rstr_md5(str2rstr_utf8(d)))
  9276. }
  9277. function any_md5(d, c) {
  9278. return rstr2any(rstr_md5(str2rstr_utf8(d)), c)
  9279. }
  9280. function hex_hmac_md5(d, c) {
  9281. return rstr2hex(rstr_hmac_md5(str2rstr_utf8(d), str2rstr_utf8(c)))
  9282. }
  9283. function b64_hmac_md5(d, c) {
  9284. return rstr2b64(rstr_hmac_md5(str2rstr_utf8(d), str2rstr_utf8(c)))
  9285. }
  9286. function any_hmac_md5(d, c, b) {
  9287. return rstr2any(rstr_hmac_md5(str2rstr_utf8(d), str2rstr_utf8(c)), b)
  9288. }
  9289. function md5_vm_test() {
  9290. return"900150983cd24fb0d6963f7d28e17f72" == hex_md5("abc").toLowerCase()
  9291. }
  9292. function rstr_md5(d) {
  9293. return binl2rstr(binl_md5(rstr2binl(d), 8 * d.length))
  9294. }
  9295. function rstr_hmac_md5(d, c) {
  9296. var b = rstr2binl(d);
  9297. 16 < b.length && (b = binl_md5(b, 8 * d.length));
  9298. for (var a = Array(16), e = Array(16), f = 0; 16 > f; f++)a[f] = b[f] ^ 909522486, e[f] = b[f] ^ 1549556828;
  9299. b = binl_md5(a.concat(rstr2binl(c)), 512 + 8 * c.length);
  9300. return binl2rstr(binl_md5(e.concat(b), 640))
  9301. }
  9302. function rstr2hex(d) {
  9303. try {
  9304. hexcase
  9305. } catch (c) {
  9306. hexcase = 0
  9307. }
  9308. for (var b = hexcase ? "0123456789ABCDEF" : "0123456789abcdef", a = "", e, f = 0; f < d.length; f++)e = d.charCodeAt(f), a += b.charAt(e >>> 4 & 15) + b.charAt(e & 15);
  9309. return a
  9310. }
  9311. function rstr2b64(d) {
  9312. try {
  9313. b64pad
  9314. } catch (c) {
  9315. b64pad = ""
  9316. }
  9317. for (var b = "", a = d.length, e = 0; e < a; e += 3)for (var f = d.charCodeAt(e) << 16 | (e + 1 < a ? d.charCodeAt(e + 1) << 8 : 0) | (e + 2 < a ? d.charCodeAt(e + 2) : 0), g = 0; 4 > g; g++)b = 8 * e + 6 * g > 8 * d.length ? b + b64pad : b + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f >>> 6 * (3 - g) & 63);
  9318. return b
  9319. }
  9320. function rstr2any(d, c) {
  9321. var b = c.length, a, e, f, g, h, k = Array(Math.ceil(d.length / 2));
  9322. for (a = 0; a < k.length; a++)k[a] = d.charCodeAt(2 * a) << 8 | d.charCodeAt(2 * a + 1);
  9323. var l = Math.ceil(8 * d.length / (Math.log(c.length) / Math.log(2))), m = Array(l);
  9324. for (e = 0; e < l; e++) {
  9325. h = [];
  9326. for (a = g = 0; a < k.length; a++)if (g = (g << 16) + k[a], f = Math.floor(g / b), g -= f * b, 0 < h.length || 0 < f)h[h.length] = f;
  9327. m[e] = g;
  9328. k = h
  9329. }
  9330. b = "";
  9331. for (a = m.length - 1; 0 <= a; a--)b += c.charAt(m[a]);
  9332. return b
  9333. }
  9334. function str2rstr_utf8(d) {
  9335. for (var c = "", b = -1, a, e; ++b < d.length;)a = d.charCodeAt(b), e = b + 1 < d.length ? d.charCodeAt(b + 1) : 0, 55296 <= a && (56319 >= a && 56320 <= e && 57343 >= e) && (a = 65536 + ((a & 1023) << 10) + (e & 1023), b++), 127 >= a ? c += String.fromCharCode(a) : 2047 >= a ? c += String.fromCharCode(192 | a >>> 6 & 31, 128 | a & 63) : 65535 >= a ? c += String.fromCharCode(224 | a >>> 12 & 15, 128 | a >>> 6 & 63, 128 | a & 63) : 2097151 >= a && (c += String.fromCharCode(240 | a >>> 18 & 7, 128 | a >>> 12 & 63, 128 | a >>> 6 & 63, 128 | a & 63));
  9336. return c
  9337. }
  9338. function str2rstr_utf16le(d) {
  9339. for (var c = "", b = 0; b < d.length; b++)c += String.fromCharCode(d.charCodeAt(b) & 255, d.charCodeAt(b) >>> 8 & 255);
  9340. return c
  9341. }
  9342. function str2rstr_utf16be(d) {
  9343. for (var c = "", b = 0; b < d.length; b++)c += String.fromCharCode(d.charCodeAt(b) >>> 8 & 255, d.charCodeAt(b) & 255);
  9344. return c
  9345. }
  9346. function rstr2binl(d) {
  9347. for (var c = Array(d.length >> 2), b = 0; b < c.length; b++)c[b] = 0;
  9348. for (b = 0; b < 8 * d.length; b += 8)c[b >> 5] |= (d.charCodeAt(b / 8) & 255) << b % 32;
  9349. return c
  9350. }
  9351. function binl2rstr(d) {
  9352. for (var c = "", b = 0; b < 32 * d.length; b += 8)c += String.fromCharCode(d[b >> 5] >>> b % 32 & 255);
  9353. return c
  9354. }
  9355. function binl_md5(d, c) {
  9356. d[c >> 5] |= 128 << c % 32;
  9357. d[(c + 64 >>> 9 << 4) + 14] = c;
  9358. for (var b = 1732584193, a = -271733879, e = -1732584194, f = 271733878, g = 0; g < d.length; g += 16)var h = b, k = a, l = e, m = f, b = md5_ff(b, a, e, f, d[g + 0], 7, -680876936), f = md5_ff(f, b, a, e, d[g + 1], 12, -389564586), e = md5_ff(e, f, b, a, d[g + 2], 17, 606105819), a = md5_ff(a, e, f, b, d[g + 3], 22, -1044525330), b = md5_ff(b, a, e, f, d[g + 4], 7, -176418897), f = md5_ff(f, b, a, e, d[g + 5], 12, 1200080426), e = md5_ff(e, f, b, a, d[g + 6], 17, -1473231341), a = md5_ff(a, e, f, b, d[g + 7], 22, -45705983), b = md5_ff(b, a, e, f, d[g + 8], 7,
  9359. 1770035416), f = md5_ff(f, b, a, e, d[g + 9], 12, -1958414417), e = md5_ff(e, f, b, a, d[g + 10], 17, -42063), a = md5_ff(a, e, f, b, d[g + 11], 22, -1990404162), b = md5_ff(b, a, e, f, d[g + 12], 7, 1804603682), f = md5_ff(f, b, a, e, d[g + 13], 12, -40341101), e = md5_ff(e, f, b, a, d[g + 14], 17, -1502002290), a = md5_ff(a, e, f, b, d[g + 15], 22, 1236535329), b = md5_gg(b, a, e, f, d[g + 1], 5, -165796510), f = md5_gg(f, b, a, e, d[g + 6], 9, -1069501632), e = md5_gg(e, f, b, a, d[g + 11], 14, 643717713), a = md5_gg(a, e, f, b, d[g + 0], 20, -373897302), b = md5_gg(b, a, e, f, d[g + 5], 5, -701558691), f = md5_gg(f, b, a, e, d[g +
  9360. 10], 9, 38016083), e = md5_gg(e, f, b, a, d[g + 15], 14, -660478335), a = md5_gg(a, e, f, b, d[g + 4], 20, -405537848), b = md5_gg(b, a, e, f, d[g + 9], 5, 568446438), f = md5_gg(f, b, a, e, d[g + 14], 9, -1019803690), e = md5_gg(e, f, b, a, d[g + 3], 14, -187363961), a = md5_gg(a, e, f, b, d[g + 8], 20, 1163531501), b = md5_gg(b, a, e, f, d[g + 13], 5, -1444681467), f = md5_gg(f, b, a, e, d[g + 2], 9, -51403784), e = md5_gg(e, f, b, a, d[g + 7], 14, 1735328473), a = md5_gg(a, e, f, b, d[g + 12], 20, -1926607734), b = md5_hh(b, a, e, f, d[g + 5], 4, -378558), f = md5_hh(f, b, a, e, d[g + 8], 11, -2022574463), e = md5_hh(e, f, b, a, d[g +
  9361. 11], 16, 1839030562), a = md5_hh(a, e, f, b, d[g + 14], 23, -35309556), b = md5_hh(b, a, e, f, d[g + 1], 4, -1530992060), f = md5_hh(f, b, a, e, d[g + 4], 11, 1272893353), e = md5_hh(e, f, b, a, d[g + 7], 16, -155497632), a = md5_hh(a, e, f, b, d[g + 10], 23, -1094730640), b = md5_hh(b, a, e, f, d[g + 13], 4, 681279174), f = md5_hh(f, b, a, e, d[g + 0], 11, -358537222), e = md5_hh(e, f, b, a, d[g + 3], 16, -722521979), a = md5_hh(a, e, f, b, d[g + 6], 23, 76029189), b = md5_hh(b, a, e, f, d[g + 9], 4, -640364487), f = md5_hh(f, b, a, e, d[g + 12], 11, -421815835), e = md5_hh(e, f, b, a, d[g + 15], 16, 530742520), a = md5_hh(a, e, f,
  9362. b, d[g + 2], 23, -995338651), b = md5_ii(b, a, e, f, d[g + 0], 6, -198630844), f = md5_ii(f, b, a, e, d[g + 7], 10, 1126891415), e = md5_ii(e, f, b, a, d[g + 14], 15, -1416354905), a = md5_ii(a, e, f, b, d[g + 5], 21, -57434055), b = md5_ii(b, a, e, f, d[g + 12], 6, 1700485571), f = md5_ii(f, b, a, e, d[g + 3], 10, -1894986606), e = md5_ii(e, f, b, a, d[g + 10], 15, -1051523), a = md5_ii(a, e, f, b, d[g + 1], 21, -2054922799), b = md5_ii(b, a, e, f, d[g + 8], 6, 1873313359), f = md5_ii(f, b, a, e, d[g + 15], 10, -30611744), e = md5_ii(e, f, b, a, d[g + 6], 15, -1560198380), a = md5_ii(a, e, f, b, d[g + 13], 21, 1309151649), b = md5_ii(b,
  9363. a, e, f, d[g + 4], 6, -145523070), f = md5_ii(f, b, a, e, d[g + 11], 10, -1120210379), e = md5_ii(e, f, b, a, d[g + 2], 15, 718787259), a = md5_ii(a, e, f, b, d[g + 9], 21, -343485551), b = safe_add(b, h), a = safe_add(a, k), e = safe_add(e, l), f = safe_add(f, m);
  9364. return[b, a, e, f]
  9365. }
  9366. function md5_cmn(d, c, b, a, e, f) {
  9367. return safe_add(bit_rol(safe_add(safe_add(c, d), safe_add(a, f)), e), b)
  9368. }
  9369. function md5_ff(d, c, b, a, e, f, g) {
  9370. return md5_cmn(c & b | ~c & a, d, c, e, f, g)
  9371. }
  9372. function md5_gg(d, c, b, a, e, f, g) {
  9373. return md5_cmn(c & a | b & ~a, d, c, e, f, g)
  9374. }
  9375. function md5_hh(d, c, b, a, e, f, g) {
  9376. return md5_cmn(c ^ b ^ a, d, c, e, f, g)
  9377. }
  9378. function md5_ii(d, c, b, a, e, f, g) {
  9379. return md5_cmn(b ^ (c | ~a), d, c, e, f, g)
  9380. }
  9381. function safe_add(d, c) {
  9382. var b = (d & 65535) + (c & 65535);
  9383. return(d >> 16) + (c >> 16) + (b >> 16) << 16 | b & 65535
  9384. }
  9385. function bit_rol(d, c) {
  9386. return d << c | d >>> 32 - c
  9387. };